@coralai/sps-cli 0.58.53 → 0.58.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/agentDaemon.d.ts +1 -0
- package/dist/commands/agentDaemon.d.ts.map +1 -1
- package/dist/commands/agentDaemon.js +7 -3
- package/dist/commands/agentDaemon.js.map +1 -1
- package/dist/commands/codexProxyCommand.js +2 -2
- package/dist/commands/codexProxyCommand.js.map +1 -1
- package/dist/commands/modelCommand.js +7 -5
- package/dist/commands/modelCommand.js.map +1 -1
- package/dist/console/routes/chat.d.ts +8 -0
- package/dist/console/routes/chat.d.ts.map +1 -1
- package/dist/console/routes/chat.js +26 -10
- package/dist/console/routes/chat.js.map +1 -1
- package/dist/console/routes/codexProxy.d.ts +1 -1
- package/dist/console/routes/codexProxy.d.ts.map +1 -1
- package/dist/console/routes/codexProxy.js +16 -6
- package/dist/console/routes/codexProxy.js.map +1 -1
- package/dist/console-assets/assets/index-BCfV8gEU.css +10 -0
- package/dist/console-assets/assets/index-BsgZkwXq.js +812 -0
- package/dist/console-assets/index.html +2 -2
- package/dist/core/agents/modelSettingsFile.d.ts +2 -0
- package/dist/core/agents/modelSettingsFile.d.ts.map +1 -1
- package/dist/core/agents/modelSettingsFile.js +15 -0
- package/dist/core/agents/modelSettingsFile.js.map +1 -1
- package/dist/core/agents/sidecar/CodexProxyManager.d.ts +8 -7
- package/dist/core/agents/sidecar/CodexProxyManager.d.ts.map +1 -1
- package/dist/core/agents/sidecar/CodexProxyManager.js +79 -25
- package/dist/core/agents/sidecar/CodexProxyManager.js.map +1 -1
- package/dist/core/agents/workerModelEnv.d.ts.map +1 -1
- package/dist/core/agents/workerModelEnv.js +12 -2
- package/dist/core/agents/workerModelEnv.js.map +1 -1
- package/dist/providers/mcp/spsMcpServer.d.ts.map +1 -1
- package/dist/providers/mcp/spsMcpServer.js +22 -0
- package/dist/providers/mcp/spsMcpServer.js.map +1 -1
- package/package.json +1 -1
- package/project-template/.claude/output-styles/sps-orchestrator.md +1 -0
- package/dist/console-assets/assets/index-BWtYBuM9.js +0 -686
- package/dist/console-assets/assets/index-Do-xvsh3.css +0 -10
|
@@ -0,0 +1,812 @@
|
|
|
1
|
+
var iO=Object.defineProperty;var tk=e=>{throw TypeError(e)};var rO=(e,t,n)=>t in e?iO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var nk=(e,t,n)=>rO(e,typeof t!="symbol"?t+"":t,n),Og=(e,t,n)=>t.has(e)||tk("Cannot "+n);var X=(e,t,n)=>(Og(e,t,"read from private field"),n?n.call(e):t.get(e)),Ye=(e,t,n)=>t.has(e)?tk("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ze=(e,t,n,i)=>(Og(e,t,"write to private field"),i?i.call(e,n):t.set(e,n),n),dt=(e,t,n)=>(Og(e,t,"access private method"),n);var _f=(e,t,n,i)=>({set _(r){ze(e,t,r,n)},get _(){return X(e,t,i)}});(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 a of r)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function n(r){const a={};return r.integrity&&(a.integrity=r.integrity),r.referrerPolicy&&(a.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?a.credentials="include":r.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function i(r){if(r.ep)return;r.ep=!0;const a=n(r);fetch(r.href,a)}})();function Yu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Rg={exports:{}},Zc={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var ik;function sO(){if(ik)return Zc;ik=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(i,r,a){var o=null;if(a!==void 0&&(o=""+a),r.key!==void 0&&(o=""+r.key),"key"in r){a={};for(var u in r)u!=="key"&&(a[u]=r[u])}else a=r;return r=a.ref,{$$typeof:e,type:i,key:o,ref:r!==void 0?r:null,props:a}}return Zc.Fragment=t,Zc.jsx=n,Zc.jsxs=n,Zc}var rk;function aO(){return rk||(rk=1,Rg.exports=sO()),Rg.exports}var c=aO(),Lg={exports:{}},st={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react.production.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var sk;function lO(){if(sk)return st;sk=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"),a=Symbol.for("react.consumer"),o=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),y=Symbol.iterator;function b(L){return L===null||typeof L!="object"?null:(L=y&&L[y]||L["@@iterator"],typeof L=="function"?L:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v=Object.assign,N={};function k(L,G,z){this.props=L,this.context=G,this.refs=N,this.updater=z||w}k.prototype.isReactComponent={},k.prototype.setState=function(L,G){if(typeof L!="object"&&typeof L!="function"&&L!=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,L,G,"setState")},k.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function A(){}A.prototype=k.prototype;function S(L,G,z){this.props=L,this.context=G,this.refs=N,this.updater=z||w}var _=S.prototype=new A;_.constructor=S,v(_,k.prototype),_.isPureReactComponent=!0;var C=Array.isArray;function T(){}var R={H:null,A:null,T:null,S:null},O=Object.prototype.hasOwnProperty;function B(L,G,z){var te=z.ref;return{$$typeof:e,type:L,key:G,ref:te!==void 0?te:null,props:z}}function P(L,G){return B(L.type,G,L.props)}function F(L){return typeof L=="object"&&L!==null&&L.$$typeof===e}function U(L){var G={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(z){return G[z]})}var V=/\/+/g;function M(L,G){return typeof L=="object"&&L!==null&&L.key!=null?U(""+L.key):G.toString(36)}function H(L){switch(L.status){case"fulfilled":return L.value;case"rejected":throw L.reason;default:switch(typeof L.status=="string"?L.then(T,T):(L.status="pending",L.then(function(G){L.status==="pending"&&(L.status="fulfilled",L.value=G)},function(G){L.status==="pending"&&(L.status="rejected",L.reason=G)})),L.status){case"fulfilled":return L.value;case"rejected":throw L.reason}}throw L}function $(L,G,z,te,me){var ye=typeof L;(ye==="undefined"||ye==="boolean")&&(L=null);var Se=!1;if(L===null)Se=!0;else switch(ye){case"bigint":case"string":case"number":Se=!0;break;case"object":switch(L.$$typeof){case e:case t:Se=!0;break;case g:return Se=L._init,$(Se(L._payload),G,z,te,me)}}if(Se)return me=me(L),Se=te===""?"."+M(L,0):te,C(me)?(z="",Se!=null&&(z=Se.replace(V,"$&/")+"/"),$(me,G,z,"",function(se){return se})):me!=null&&(F(me)&&(me=P(me,z+(me.key==null||L&&L.key===me.key?"":(""+me.key).replace(V,"$&/")+"/")+Se)),G.push(me)),1;Se=0;var re=te===""?".":te+":";if(C(L))for(var he=0;he<L.length;he++)te=L[he],ye=re+M(te,he),Se+=$(te,G,z,ye,me);else if(he=b(L),typeof he=="function")for(L=he.call(L),he=0;!(te=L.next()).done;)te=te.value,ye=re+M(te,he++),Se+=$(te,G,z,ye,me);else if(ye==="object"){if(typeof L.then=="function")return $(H(L),G,z,te,me);throw G=String(L),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(L).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return Se}function K(L,G,z){if(L==null)return L;var te=[],me=0;return $(L,te,"","",function(ye){return G.call(z,ye,me++)}),te}function W(L){if(L._status===-1){var G=L._result;G=G(),G.then(function(z){(L._status===0||L._status===-1)&&(L._status=1,L._result=z)},function(z){(L._status===0||L._status===-1)&&(L._status=2,L._result=z)}),L._status===-1&&(L._status=0,L._result=G)}if(L._status===1)return L._result.default;throw L._result}var Y=typeof reportError=="function"?reportError:function(L){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var G=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof L=="object"&&L!==null&&typeof L.message=="string"?String(L.message):String(L),error:L});if(!window.dispatchEvent(G))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",L);return}console.error(L)},I={map:K,forEach:function(L,G,z){K(L,function(){G.apply(this,arguments)},z)},count:function(L){var G=0;return K(L,function(){G++}),G},toArray:function(L){return K(L,function(G){return G})||[]},only:function(L){if(!F(L))throw Error("React.Children.only expected to receive a single React element child.");return L}};return st.Activity=p,st.Children=I,st.Component=k,st.Fragment=n,st.Profiler=r,st.PureComponent=S,st.StrictMode=i,st.Suspense=d,st.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=R,st.__COMPILER_RUNTIME={__proto__:null,c:function(L){return R.H.useMemoCache(L)}},st.cache=function(L){return function(){return L.apply(null,arguments)}},st.cacheSignal=function(){return null},st.cloneElement=function(L,G,z){if(L==null)throw Error("The argument must be a React element, but you passed "+L+".");var te=v({},L.props),me=L.key;if(G!=null)for(ye in G.key!==void 0&&(me=""+G.key),G)!O.call(G,ye)||ye==="key"||ye==="__self"||ye==="__source"||ye==="ref"&&G.ref===void 0||(te[ye]=G[ye]);var ye=arguments.length-2;if(ye===1)te.children=z;else if(1<ye){for(var Se=Array(ye),re=0;re<ye;re++)Se[re]=arguments[re+2];te.children=Se}return B(L.type,me,te)},st.createContext=function(L){return L={$$typeof:o,_currentValue:L,_currentValue2:L,_threadCount:0,Provider:null,Consumer:null},L.Provider=L,L.Consumer={$$typeof:a,_context:L},L},st.createElement=function(L,G,z){var te,me={},ye=null;if(G!=null)for(te in G.key!==void 0&&(ye=""+G.key),G)O.call(G,te)&&te!=="key"&&te!=="__self"&&te!=="__source"&&(me[te]=G[te]);var Se=arguments.length-2;if(Se===1)me.children=z;else if(1<Se){for(var re=Array(Se),he=0;he<Se;he++)re[he]=arguments[he+2];me.children=re}if(L&&L.defaultProps)for(te in Se=L.defaultProps,Se)me[te]===void 0&&(me[te]=Se[te]);return B(L,ye,me)},st.createRef=function(){return{current:null}},st.forwardRef=function(L){return{$$typeof:u,render:L}},st.isValidElement=F,st.lazy=function(L){return{$$typeof:g,_payload:{_status:-1,_result:L},_init:W}},st.memo=function(L,G){return{$$typeof:h,type:L,compare:G===void 0?null:G}},st.startTransition=function(L){var G=R.T,z={};R.T=z;try{var te=L(),me=R.S;me!==null&&me(z,te),typeof te=="object"&&te!==null&&typeof te.then=="function"&&te.then(T,Y)}catch(ye){Y(ye)}finally{G!==null&&z.types!==null&&(G.types=z.types),R.T=G}},st.unstable_useCacheRefresh=function(){return R.H.useCacheRefresh()},st.use=function(L){return R.H.use(L)},st.useActionState=function(L,G,z){return R.H.useActionState(L,G,z)},st.useCallback=function(L,G){return R.H.useCallback(L,G)},st.useContext=function(L){return R.H.useContext(L)},st.useDebugValue=function(){},st.useDeferredValue=function(L,G){return R.H.useDeferredValue(L,G)},st.useEffect=function(L,G){return R.H.useEffect(L,G)},st.useEffectEvent=function(L){return R.H.useEffectEvent(L)},st.useId=function(){return R.H.useId()},st.useImperativeHandle=function(L,G,z){return R.H.useImperativeHandle(L,G,z)},st.useInsertionEffect=function(L,G){return R.H.useInsertionEffect(L,G)},st.useLayoutEffect=function(L,G){return R.H.useLayoutEffect(L,G)},st.useMemo=function(L,G){return R.H.useMemo(L,G)},st.useOptimistic=function(L,G){return R.H.useOptimistic(L,G)},st.useReducer=function(L,G,z){return R.H.useReducer(L,G,z)},st.useRef=function(L){return R.H.useRef(L)},st.useState=function(L){return R.H.useState(L)},st.useSyncExternalStore=function(L,G,z){return R.H.useSyncExternalStore(L,G,z)},st.useTransition=function(){return R.H.useTransition()},st.version="19.2.5",st}var ak;function Wu(){return ak||(ak=1,Lg.exports=lO()),Lg.exports}var j=Wu();const oO=Yu(j);var zg={exports:{}},Jc={},Ig={exports:{}},Pg={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/var lk;function cO(){return lk||(lk=1,(function(e){function t($,K){var W=$.length;$.push(K);e:for(;0<W;){var Y=W-1>>>1,I=$[Y];if(0<r(I,K))$[Y]=K,$[W]=I,W=Y;else break e}}function n($){return $.length===0?null:$[0]}function i($){if($.length===0)return null;var K=$[0],W=$.pop();if(W!==K){$[0]=W;e:for(var Y=0,I=$.length,L=I>>>1;Y<L;){var G=2*(Y+1)-1,z=$[G],te=G+1,me=$[te];if(0>r(z,W))te<I&&0>r(me,z)?($[Y]=me,$[te]=W,Y=te):($[Y]=z,$[G]=W,Y=G);else if(te<I&&0>r(me,W))$[Y]=me,$[te]=W,Y=te;else break e}}return K}function r($,K){var W=$.sortIndex-K.sortIndex;return W!==0?W:$.id-K.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,u=o.now();e.unstable_now=function(){return o.now()-u}}var d=[],h=[],g=1,p=null,y=3,b=!1,w=!1,v=!1,N=!1,k=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;function _($){for(var K=n(h);K!==null;){if(K.callback===null)i(h);else if(K.startTime<=$)i(h),K.sortIndex=K.expirationTime,t(d,K);else break;K=n(h)}}function C($){if(v=!1,_($),!w)if(n(d)!==null)w=!0,T||(T=!0,U());else{var K=n(h);K!==null&&H(C,K.startTime-$)}}var T=!1,R=-1,O=5,B=-1;function P(){return N?!0:!(e.unstable_now()-B<O)}function F(){if(N=!1,T){var $=e.unstable_now();B=$;var K=!0;try{e:{w=!1,v&&(v=!1,A(R),R=-1),b=!0;var W=y;try{t:{for(_($),p=n(d);p!==null&&!(p.expirationTime>$&&P());){var Y=p.callback;if(typeof Y=="function"){p.callback=null,y=p.priorityLevel;var I=Y(p.expirationTime<=$);if($=e.unstable_now(),typeof I=="function"){p.callback=I,_($),K=!0;break t}p===n(d)&&i(d),_($)}else i(d);p=n(d)}if(p!==null)K=!0;else{var L=n(h);L!==null&&H(C,L.startTime-$),K=!1}}break e}finally{p=null,y=W,b=!1}K=void 0}}finally{K?U():T=!1}}}var U;if(typeof S=="function")U=function(){S(F)};else if(typeof MessageChannel<"u"){var V=new MessageChannel,M=V.port2;V.port1.onmessage=F,U=function(){M.postMessage(null)}}else U=function(){k(F,0)};function H($,K){R=k(function(){$(e.unstable_now())},K)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function($){$.callback=null},e.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<$?Math.floor(1e3/$):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function($){switch(y){case 1:case 2:case 3:var K=3;break;default:K=y}var W=y;y=K;try{return $()}finally{y=W}},e.unstable_requestPaint=function(){N=!0},e.unstable_runWithPriority=function($,K){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var W=y;y=$;try{return K()}finally{y=W}},e.unstable_scheduleCallback=function($,K,W){var Y=e.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?Y+W:Y):W=Y,$){case 1:var I=-1;break;case 2:I=250;break;case 5:I=1073741823;break;case 4:I=1e4;break;default:I=5e3}return I=W+I,$={id:g++,callback:K,priorityLevel:$,startTime:W,expirationTime:I,sortIndex:-1},W>Y?($.sortIndex=W,t(h,$),n(d)===null&&$===n(h)&&(v?(A(R),R=-1):v=!0,H(C,W-Y))):($.sortIndex=I,t(d,$),w||b||(w=!0,T||(T=!0,U()))),$},e.unstable_shouldYield=P,e.unstable_wrapCallback=function($){var K=y;return function(){var W=y;y=K;try{return $.apply(this,arguments)}finally{y=W}}}})(Pg)),Pg}var ok;function uO(){return ok||(ok=1,Ig.exports=cO()),Ig.exports}var Bg={exports:{}},Hn={};/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var ck;function dO(){if(ck)return Hn;ck=1;var e=Wu();function t(d){var h="https://react.dev/errors/"+d;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)h+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+d+"; visit "+h+" 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 a(d,h,g){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:r,key:p==null?null:""+p,children:d,containerInfo:h,implementation:g}}var o=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(d,h){if(d==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Hn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,Hn.createPortal=function(d,h){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(t(299));return a(d,h,null,g)},Hn.flushSync=function(d){var h=o.T,g=i.p;try{if(o.T=null,i.p=2,d)return d()}finally{o.T=h,i.p=g,i.d.f()}},Hn.preconnect=function(d,h){typeof d=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,i.d.C(d,h))},Hn.prefetchDNS=function(d){typeof d=="string"&&i.d.D(d)},Hn.preinit=function(d,h){if(typeof d=="string"&&h&&typeof h.as=="string"){var g=h.as,p=u(g,h.crossOrigin),y=typeof h.integrity=="string"?h.integrity:void 0,b=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;g==="style"?i.d.S(d,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:p,integrity:y,fetchPriority:b}):g==="script"&&i.d.X(d,{crossOrigin:p,integrity:y,fetchPriority:b,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Hn.preinitModule=function(d,h){if(typeof d=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var g=u(h.as,h.crossOrigin);i.d.M(d,{crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&i.d.M(d)},Hn.preload=function(d,h){if(typeof d=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var g=h.as,p=u(g,h.crossOrigin);i.d.L(d,g,{crossOrigin:p,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},Hn.preloadModule=function(d,h){if(typeof d=="string")if(h){var g=u(h.as,h.crossOrigin);i.d.m(d,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else i.d.m(d)},Hn.requestFormReset=function(d){i.d.r(d)},Hn.unstable_batchedUpdates=function(d,h){return d(h)},Hn.useFormState=function(d,h,g){return o.H.useFormState(d,h,g)},Hn.useFormStatus=function(){return o.H.useHostTransitionStatus()},Hn.version="19.2.5",Hn}var uk;function s2(){if(uk)return Bg.exports;uk=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(),Bg.exports=dO(),Bg.exports}/**
|
|
34
|
+
* @license React
|
|
35
|
+
* react-dom-client.production.js
|
|
36
|
+
*
|
|
37
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
+
*
|
|
39
|
+
* This source code is licensed under the MIT license found in the
|
|
40
|
+
* LICENSE file in the root directory of this source tree.
|
|
41
|
+
*/var dk;function fO(){if(dk)return Jc;dk=1;var e=uO(),t=Wu(),n=s2();function i(s){var l="https://react.dev/errors/"+s;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var f=2;f<arguments.length;f++)l+="&args[]="+encodeURIComponent(arguments[f])}return"Minified React error #"+s+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function a(s){var l=s,f=s;if(s.alternate)for(;l.return;)l=l.return;else{s=l;do l=s,(l.flags&4098)!==0&&(f=l.return),s=l.return;while(s)}return l.tag===3?f:null}function o(s){if(s.tag===13){var l=s.memoizedState;if(l===null&&(s=s.alternate,s!==null&&(l=s.memoizedState)),l!==null)return l.dehydrated}return null}function u(s){if(s.tag===31){var l=s.memoizedState;if(l===null&&(s=s.alternate,s!==null&&(l=s.memoizedState)),l!==null)return l.dehydrated}return null}function d(s){if(a(s)!==s)throw Error(i(188))}function h(s){var l=s.alternate;if(!l){if(l=a(s),l===null)throw Error(i(188));return l!==s?null:s}for(var f=s,m=l;;){var x=f.return;if(x===null)break;var E=x.alternate;if(E===null){if(m=x.return,m!==null){f=m;continue}break}if(x.child===E.child){for(E=x.child;E;){if(E===f)return d(x),s;if(E===m)return d(x),l;E=E.sibling}throw Error(i(188))}if(f.return!==m.return)f=x,m=E;else{for(var D=!1,q=x.child;q;){if(q===f){D=!0,f=x,m=E;break}if(q===m){D=!0,m=x,f=E;break}q=q.sibling}if(!D){for(q=E.child;q;){if(q===f){D=!0,f=E,m=x;break}if(q===m){D=!0,m=E,f=x;break}q=q.sibling}if(!D)throw Error(i(189))}}if(f.alternate!==m)throw Error(i(190))}if(f.tag!==3)throw Error(i(188));return f.stateNode.current===f?s:l}function g(s){var l=s.tag;if(l===5||l===26||l===27||l===6)return s;for(s=s.child;s!==null;){if(l=g(s),l!==null)return l;s=s.sibling}return null}var p=Object.assign,y=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),S=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),P=Symbol.for("react.memo_cache_sentinel"),F=Symbol.iterator;function U(s){return s===null||typeof s!="object"?null:(s=F&&s[F]||s["@@iterator"],typeof s=="function"?s:null)}var V=Symbol.for("react.client.reference");function M(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===V?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case v:return"Fragment";case k:return"Profiler";case N:return"StrictMode";case C:return"Suspense";case T:return"SuspenseList";case B:return"Activity"}if(typeof s=="object")switch(s.$$typeof){case w:return"Portal";case S:return s.displayName||"Context";case A:return(s._context.displayName||"Context")+".Consumer";case _:var l=s.render;return s=s.displayName,s||(s=l.displayName||l.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case R:return l=s.displayName||null,l!==null?l:M(s.type)||"Memo";case O:l=s._payload,s=s._init;try{return M(s(l))}catch{}}return null}var H=Array.isArray,$=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W={pending:!1,data:null,method:null,action:null},Y=[],I=-1;function L(s){return{current:s}}function G(s){0>I||(s.current=Y[I],Y[I]=null,I--)}function z(s,l){I++,Y[I]=s.current,s.current=l}var te=L(null),me=L(null),ye=L(null),Se=L(null);function re(s,l){switch(z(ye,l),z(me,s),z(te,null),l.nodeType){case 9:case 11:s=(s=l.documentElement)&&(s=s.namespaceURI)?Sw(s):0;break;default:if(s=l.tagName,l=l.namespaceURI)l=Sw(l),s=Nw(l,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}G(te),z(te,s)}function he(){G(te),G(me),G(ye)}function se(s){s.memoizedState!==null&&z(Se,s);var l=te.current,f=Nw(l,s.type);l!==f&&(z(me,s),z(te,f))}function J(s){me.current===s&&(G(te),G(me)),Se.current===s&&(G(Se),Yc._currentValue=W)}var ke,le;function Ce(s){if(ke===void 0)try{throw Error()}catch(f){var l=f.stack.trim().match(/\n( *(at )?)/);ke=l&&l[1]||"",le=-1<f.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<f.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+ke+s+le}var Me=!1;function _e(s,l){if(!s||Me)return"";Me=!0;var f=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var m={DetermineComponentFrameRoot:function(){try{if(l){var Ee=function(){throw Error()};if(Object.defineProperty(Ee.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ee,[])}catch(fe){var ce=fe}Reflect.construct(s,[],Ee)}else{try{Ee.call()}catch(fe){ce=fe}s.call(Ee.prototype)}}else{try{throw Error()}catch(fe){ce=fe}(Ee=s())&&typeof Ee.catch=="function"&&Ee.catch(function(){})}}catch(fe){if(fe&&ce&&typeof fe.stack=="string")return[fe.stack,ce.stack]}return[null,null]}};m.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var x=Object.getOwnPropertyDescriptor(m.DetermineComponentFrameRoot,"name");x&&x.configurable&&Object.defineProperty(m.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var E=m.DetermineComponentFrameRoot(),D=E[0],q=E[1];if(D&&q){var Q=D.split(`
|
|
44
|
+
`),oe=q.split(`
|
|
45
|
+
`);for(x=m=0;m<Q.length&&!Q[m].includes("DetermineComponentFrameRoot");)m++;for(;x<oe.length&&!oe[x].includes("DetermineComponentFrameRoot");)x++;if(m===Q.length||x===oe.length)for(m=Q.length-1,x=oe.length-1;1<=m&&0<=x&&Q[m]!==oe[x];)x--;for(;1<=m&&0<=x;m--,x--)if(Q[m]!==oe[x]){if(m!==1||x!==1)do if(m--,x--,0>x||Q[m]!==oe[x]){var ge=`
|
|
46
|
+
`+Q[m].replace(" at new "," at ");return s.displayName&&ge.includes("<anonymous>")&&(ge=ge.replace("<anonymous>",s.displayName)),ge}while(1<=m&&0<=x);break}}}finally{Me=!1,Error.prepareStackTrace=f}return(f=s?s.displayName||s.name:"")?Ce(f):""}function Qe(s,l){switch(s.tag){case 26:case 27:case 5:return Ce(s.type);case 16:return Ce("Lazy");case 13:return s.child!==l&&l!==null?Ce("Suspense Fallback"):Ce("Suspense");case 19:return Ce("SuspenseList");case 0:case 15:return _e(s.type,!1);case 11:return _e(s.type.render,!1);case 1:return _e(s.type,!0);case 31:return Ce("Activity");default:return""}}function Ue(s){try{var l="",f=null;do l+=Qe(s,f),f=s,s=s.return;while(s);return l}catch(m){return`
|
|
47
|
+
Error generating stack: `+m.message+`
|
|
48
|
+
`+m.stack}}var ue=Object.prototype.hasOwnProperty,we=e.unstable_scheduleCallback,xe=e.unstable_cancelCallback,pe=e.unstable_shouldYield,Ne=e.unstable_requestPaint,je=e.unstable_now,He=e.unstable_getCurrentPriorityLevel,ne=e.unstable_ImmediatePriority,de=e.unstable_UserBlockingPriority,Le=e.unstable_NormalPriority,Ze=e.unstable_LowPriority,rt=e.unstable_IdlePriority,At=e.log,$n=e.unstable_setDisableYieldValue,fn=null,Mt=null;function Wt(s){if(typeof At=="function"&&$n(s),Mt&&typeof Mt.setStrictMode=="function")try{Mt.setStrictMode(fn,s)}catch{}}var yt=Math.clz32?Math.clz32:_l,Ai=Math.log,Rn=Math.LN2;function _l(s){return s>>>=0,s===0?32:31-(Ai(s)/Rn|0)|0}var Br=256,ks=262144,$r=4194304;function Un(s){var l=s&42;if(l!==0)return l;switch(s&-s){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 s&261888;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function Z(s,l,f){var m=s.pendingLanes;if(m===0)return 0;var x=0,E=s.suspendedLanes,D=s.pingedLanes;s=s.warmLanes;var q=m&134217727;return q!==0?(m=q&~E,m!==0?x=Un(m):(D&=q,D!==0?x=Un(D):f||(f=q&~s,f!==0&&(x=Un(f))))):(q=m&~E,q!==0?x=Un(q):D!==0?x=Un(D):f||(f=m&~s,f!==0&&(x=Un(f)))),x===0?0:l!==0&&l!==x&&(l&E)===0&&(E=x&-x,f=l&-l,E>=f||E===32&&(f&4194048)!==0)?l:x}function be(s,l){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&l)===0}function Re(s,l){switch(s){case 1:case 2:case 4:case 8:case 64:return l+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 l+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 it(){var s=$r;return $r<<=1,($r&62914560)===0&&($r=4194304),s}function qt(s){for(var l=[],f=0;31>f;f++)l.push(s);return l}function Ot(s,l){s.pendingLanes|=l,l!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function $e(s,l,f,m,x,E){var D=s.pendingLanes;s.pendingLanes=f,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=f,s.entangledLanes&=f,s.errorRecoveryDisabledLanes&=f,s.shellSuspendCounter=0;var q=s.entanglements,Q=s.expirationTimes,oe=s.hiddenUpdates;for(f=D&~f;0<f;){var ge=31-yt(f),Ee=1<<ge;q[ge]=0,Q[ge]=-1;var ce=oe[ge];if(ce!==null)for(oe[ge]=null,ge=0;ge<ce.length;ge++){var fe=ce[ge];fe!==null&&(fe.lane&=-536870913)}f&=~Ee}m!==0&&Pe(s,m,0),E!==0&&x===0&&s.tag!==0&&(s.suspendedLanes|=E&~(D&~l))}function Pe(s,l,f){s.pendingLanes|=l,s.suspendedLanes&=~l;var m=31-yt(l);s.entangledLanes|=l,s.entanglements[m]=s.entanglements[m]|1073741824|f&261930}function et(s,l){var f=s.entangledLanes|=l;for(s=s.entanglements;f;){var m=31-yt(f),x=1<<m;x&l|s[m]&l&&(s[m]|=l),f&=~x}}function rn(s,l){var f=l&-l;return f=(f&42)!==0?1:Vt(f),(f&(s.suspendedLanes|l))!==0?0:f}function Vt(s){switch(s){case 2:s=1;break;case 8:s=4;break;case 32:s=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:s=128;break;case 268435456:s=134217728;break;default:s=0}return s}function Yi(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function Es(){var s=K.p;return s!==0?s:(s=window.event,s===void 0?32:Yw(s.type))}function Ss(s,l){var f=K.p;try{return K.p=s,l()}finally{K.p=f}}var Ti=Math.random().toString(36).slice(2),sn="__reactFiber$"+Ti,Tn="__reactProps$"+Ti,Wi="__reactContainer$"+Ti,Ns="__reactEvents$"+Ti,_a="__reactListeners$"+Ti,_s="__reactHandles$"+Ti,jl="__reactResources$"+Ti,Ur="__reactMarker$"+Ti;function ja(s){delete s[sn],delete s[Tn],delete s[Ns],delete s[_a],delete s[_s]}function Ln(s){var l=s[sn];if(l)return l;for(var f=s.parentNode;f;){if(l=f[Wi]||f[sn]){if(f=l.alternate,l.child!==null||f!==null&&f.child!==null)for(s=Dw(s);s!==null;){if(f=s[sn])return f;s=Dw(s)}return l}s=f,f=s.parentNode}return null}function Qi(s){if(s=s[sn]||s[Wi]){var l=s.tag;if(l===5||l===6||l===13||l===31||l===26||l===27||l===3)return s}return null}function Xi(s){var l=s.tag;if(l===5||l===26||l===27||l===6)return s.stateNode;throw Error(i(33))}function xr(s){var l=s[jl];return l||(l=s[jl]={hoistableStyles:new Map,hoistableScripts:new Map}),l}function hn(s){s[Ur]=!0}var Cl=new Set,Fr={};function Zi(s,l){Ae(s,l),Ae(s+"Capture",l)}function Ae(s,l){for(Fr[s]=l,s=0;s<l.length;s++)Cl.add(l[s])}var Ge=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]*$"),ht={},_t={};function an(s){return ue.call(_t,s)?!0:ue.call(ht,s)?!1:Ge.test(s)?_t[s]=!0:(ht[s]=!0,!1)}function Mn(s,l,f){if(an(l))if(f===null)s.removeAttribute(l);else{switch(typeof f){case"undefined":case"function":case"symbol":s.removeAttribute(l);return;case"boolean":var m=l.toLowerCase().slice(0,5);if(m!=="data-"&&m!=="aria-"){s.removeAttribute(l);return}}s.setAttribute(l,""+f)}}function Wn(s,l,f){if(f===null)s.removeAttribute(l);else{switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(l);return}s.setAttribute(l,""+f)}}function Fn(s,l,f,m){if(m===null)s.removeAttribute(f);else{switch(typeof m){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(f);return}s.setAttributeNS(l,f,""+m)}}function It(s){switch(typeof s){case"bigint":case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function Qn(s){var l=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function Al(s,l,f){var m=Object.getOwnPropertyDescriptor(s.constructor.prototype,l);if(!s.hasOwnProperty(l)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var x=m.get,E=m.set;return Object.defineProperty(s,l,{configurable:!0,get:function(){return x.call(this)},set:function(D){f=""+D,E.call(this,D)}}),Object.defineProperty(s,l,{enumerable:m.enumerable}),{getValue:function(){return f},setValue:function(D){f=""+D},stopTracking:function(){s._valueTracker=null,delete s[l]}}}}function js(s){if(!s._valueTracker){var l=Qn(s)?"checked":"value";s._valueTracker=Al(s,l,""+s[l])}}function vr(s){if(!s)return!1;var l=s._valueTracker;if(!l)return!0;var f=l.getValue(),m="";return s&&(m=Qn(s)?s.checked?"true":"false":s.value),s=m,s!==f?(l.setValue(s),!0):!1}function Cs(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var Tl=/[\n"\\]/g;function qn(s){return s.replace(Tl,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function Ca(s,l,f,m,x,E,D,q){s.name="",D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"?s.type=D:s.removeAttribute("type"),l!=null?D==="number"?(l===0&&s.value===""||s.value!=l)&&(s.value=""+It(l)):s.value!==""+It(l)&&(s.value=""+It(l)):D!=="submit"&&D!=="reset"||s.removeAttribute("value"),l!=null?As(s,D,It(l)):f!=null?As(s,D,It(f)):m!=null&&s.removeAttribute("value"),x==null&&E!=null&&(s.defaultChecked=!!E),x!=null&&(s.checked=x&&typeof x!="function"&&typeof x!="symbol"),q!=null&&typeof q!="function"&&typeof q!="symbol"&&typeof q!="boolean"?s.name=""+It(q):s.removeAttribute("name")}function Ji(s,l,f,m,x,E,D,q){if(E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"&&(s.type=E),l!=null||f!=null){if(!(E!=="submit"&&E!=="reset"||l!=null)){js(s);return}f=f!=null?""+It(f):"",l=l!=null?""+It(l):f,q||l===s.value||(s.value=l),s.defaultValue=l}m=m??x,m=typeof m!="function"&&typeof m!="symbol"&&!!m,s.checked=q?s.checked:!!m,s.defaultChecked=!!m,D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"&&(s.name=D),js(s)}function As(s,l,f){l==="number"&&Cs(s.ownerDocument)===s||s.defaultValue===""+f||(s.defaultValue=""+f)}function jn(s,l,f,m){if(s=s.options,l){l={};for(var x=0;x<f.length;x++)l["$"+f[x]]=!0;for(f=0;f<s.length;f++)x=l.hasOwnProperty("$"+s[f].value),s[f].selected!==x&&(s[f].selected=x),x&&m&&(s[f].defaultSelected=!0)}else{for(f=""+It(f),l=null,x=0;x<s.length;x++){if(s[x].value===f){s[x].selected=!0,m&&(s[x].defaultSelected=!0);return}l!==null||s[x].disabled||(l=s[x])}l!==null&&(l.selected=!0)}}function Aa(s,l,f){if(l!=null&&(l=""+It(l),l!==s.value&&(s.value=l),f==null)){s.defaultValue!==l&&(s.defaultValue=l);return}s.defaultValue=f!=null?""+It(f):""}function Ml(s,l,f,m){if(l==null){if(m!=null){if(f!=null)throw Error(i(92));if(H(m)){if(1<m.length)throw Error(i(93));m=m[0]}f=m}f==null&&(f=""),l=f}f=It(l),s.defaultValue=f,m=s.textContent,m===f&&m!==""&&m!==null&&(s.value=m),js(s)}function nt(s,l){if(l){var f=s.firstChild;if(f&&f===s.lastChild&&f.nodeType===3){f.nodeValue=l;return}}s.textContent=l}var md=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 xn(s,l,f){var m=l.indexOf("--")===0;f==null||typeof f=="boolean"||f===""?m?s.setProperty(l,""):l==="float"?s.cssFloat="":s[l]="":m?s.setProperty(l,f):typeof f!="number"||f===0||md.has(l)?l==="float"?s.cssFloat=f:s[l]=(""+f).trim():s[l]=f+"px"}function Rt(s,l,f){if(l!=null&&typeof l!="object")throw Error(i(62));if(s=s.style,f!=null){for(var m in f)!f.hasOwnProperty(m)||l!=null&&l.hasOwnProperty(m)||(m.indexOf("--")===0?s.setProperty(m,""):m==="float"?s.cssFloat="":s[m]="");for(var x in l)m=l[x],l.hasOwnProperty(x)&&f[x]!==m&&xn(s,x,m)}else for(var E in l)l.hasOwnProperty(E)&&xn(s,E,l[E])}function Ts(s){if(s.indexOf("-")===-1)return!1;switch(s){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 qr=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"]]),cc=/^[\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 Ms(s){return cc.test(""+s)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":s}function De(){}var Fe=null;function lt(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var bt=null,ln=null;function Mi(s){var l=Qi(s);if(l&&(s=l.stateNode)){var f=s[Tn]||null;e:switch(s=l.stateNode,l.type){case"input":if(Ca(s,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name),l=f.name,f.type==="radio"&&l!=null){for(f=s;f.parentNode;)f=f.parentNode;for(f=f.querySelectorAll('input[name="'+qn(""+l)+'"][type="radio"]'),l=0;l<f.length;l++){var m=f[l];if(m!==s&&m.form===s.form){var x=m[Tn]||null;if(!x)throw Error(i(90));Ca(m,x.value,x.defaultValue,x.defaultValue,x.checked,x.defaultChecked,x.type,x.name)}}for(l=0;l<f.length;l++)m=f[l],m.form===s.form&&vr(m)}break e;case"textarea":Aa(s,f.value,f.defaultValue);break e;case"select":l=f.value,l!=null&&jn(s,!!f.multiple,l,!1)}}}var uc=!1;function gd(s,l,f){if(uc)return s(l,f);uc=!0;try{var m=s(l);return m}finally{if(uc=!1,(bt!==null||ln!==null)&&(rf(),bt&&(l=bt,s=ln,ln=bt=null,Mi(l),s)))for(l=0;l<s.length;l++)Mi(s[l])}}function dc(s,l){var f=s.stateNode;if(f===null)return null;var m=f[Tn]||null;if(m===null)return null;f=m[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(m=!m.disabled)||(s=s.type,m=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!m;break e;default:s=!1}if(s)return null;if(f&&typeof f!="function")throw Error(i(231,l,typeof f));return f}var Hr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Op=!1;if(Hr)try{var fc={};Object.defineProperty(fc,"passive",{get:function(){Op=!0}}),window.addEventListener("test",fc,fc),window.removeEventListener("test",fc,fc)}catch{Op=!1}var Ds=null,Rp=null,yd=null;function N0(){if(yd)return yd;var s,l=Rp,f=l.length,m,x="value"in Ds?Ds.value:Ds.textContent,E=x.length;for(s=0;s<f&&l[s]===x[s];s++);var D=f-s;for(m=1;m<=D&&l[f-m]===x[E-m];m++);return yd=x.slice(s,1<m?1-m:void 0)}function bd(s){var l=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&l===13&&(s=13)):s=l,s===10&&(s=13),32<=s||s===13?s:0}function xd(){return!0}function _0(){return!1}function ii(s){function l(f,m,x,E,D){this._reactName=f,this._targetInst=x,this.type=m,this.nativeEvent=E,this.target=D,this.currentTarget=null;for(var q in s)s.hasOwnProperty(q)&&(f=s[q],this[q]=f?f(E):E[q]);return this.isDefaultPrevented=(E.defaultPrevented!=null?E.defaultPrevented:E.returnValue===!1)?xd:_0,this.isPropagationStopped=_0,this}return p(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var f=this.nativeEvent;f&&(f.preventDefault?f.preventDefault():typeof f.returnValue!="unknown"&&(f.returnValue=!1),this.isDefaultPrevented=xd)},stopPropagation:function(){var f=this.nativeEvent;f&&(f.stopPropagation?f.stopPropagation():typeof f.cancelBubble!="unknown"&&(f.cancelBubble=!0),this.isPropagationStopped=xd)},persist:function(){},isPersistent:xd}),l}var Ta={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},vd=ii(Ta),hc=p({},Ta,{view:0,detail:0}),tM=ii(hc),Lp,zp,pc,wd=p({},hc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Pp,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==pc&&(pc&&s.type==="mousemove"?(Lp=s.screenX-pc.screenX,zp=s.screenY-pc.screenY):zp=Lp=0,pc=s),Lp)},movementY:function(s){return"movementY"in s?s.movementY:zp}}),j0=ii(wd),nM=p({},wd,{dataTransfer:0}),iM=ii(nM),rM=p({},hc,{relatedTarget:0}),Ip=ii(rM),sM=p({},Ta,{animationName:0,elapsedTime:0,pseudoElement:0}),aM=ii(sM),lM=p({},Ta,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),oM=ii(lM),cM=p({},Ta,{data:0}),C0=ii(cM),uM={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},dM={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"},fM={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function hM(s){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(s):(s=fM[s])?!!l[s]:!1}function Pp(){return hM}var pM=p({},hc,{key:function(s){if(s.key){var l=uM[s.key]||s.key;if(l!=="Unidentified")return l}return s.type==="keypress"?(s=bd(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?dM[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Pp,charCode:function(s){return s.type==="keypress"?bd(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?bd(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),mM=ii(pM),gM=p({},wd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),A0=ii(gM),yM=p({},hc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Pp}),bM=ii(yM),xM=p({},Ta,{propertyName:0,elapsedTime:0,pseudoElement:0}),vM=ii(xM),wM=p({},wd,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),kM=ii(wM),EM=p({},Ta,{newState:0,oldState:0}),SM=ii(EM),NM=[9,13,27,32],Bp=Hr&&"CompositionEvent"in window,mc=null;Hr&&"documentMode"in document&&(mc=document.documentMode);var _M=Hr&&"TextEvent"in window&&!mc,T0=Hr&&(!Bp||mc&&8<mc&&11>=mc),M0=" ",D0=!1;function O0(s,l){switch(s){case"keyup":return NM.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function R0(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var Dl=!1;function jM(s,l){switch(s){case"compositionend":return R0(l);case"keypress":return l.which!==32?null:(D0=!0,M0);case"textInput":return s=l.data,s===M0&&D0?null:s;default:return null}}function CM(s,l){if(Dl)return s==="compositionend"||!Bp&&O0(s,l)?(s=N0(),yd=Rp=Ds=null,Dl=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return T0&&l.locale!=="ko"?null:l.data;default:return null}}var AM={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 L0(s){var l=s&&s.nodeName&&s.nodeName.toLowerCase();return l==="input"?!!AM[s.type]:l==="textarea"}function z0(s,l,f,m){bt?ln?ln.push(m):ln=[m]:bt=m,l=df(l,"onChange"),0<l.length&&(f=new vd("onChange","change",null,f,m),s.push({event:f,listeners:l}))}var gc=null,yc=null;function TM(s){bw(s,0)}function kd(s){var l=Xi(s);if(vr(l))return s}function I0(s,l){if(s==="change")return l}var P0=!1;if(Hr){var $p;if(Hr){var Up="oninput"in document;if(!Up){var B0=document.createElement("div");B0.setAttribute("oninput","return;"),Up=typeof B0.oninput=="function"}$p=Up}else $p=!1;P0=$p&&(!document.documentMode||9<document.documentMode)}function $0(){gc&&(gc.detachEvent("onpropertychange",U0),yc=gc=null)}function U0(s){if(s.propertyName==="value"&&kd(yc)){var l=[];z0(l,yc,s,lt(s)),gd(TM,l)}}function MM(s,l,f){s==="focusin"?($0(),gc=l,yc=f,gc.attachEvent("onpropertychange",U0)):s==="focusout"&&$0()}function DM(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return kd(yc)}function OM(s,l){if(s==="click")return kd(l)}function RM(s,l){if(s==="input"||s==="change")return kd(l)}function LM(s,l){return s===l&&(s!==0||1/s===1/l)||s!==s&&l!==l}var gi=typeof Object.is=="function"?Object.is:LM;function bc(s,l){if(gi(s,l))return!0;if(typeof s!="object"||s===null||typeof l!="object"||l===null)return!1;var f=Object.keys(s),m=Object.keys(l);if(f.length!==m.length)return!1;for(m=0;m<f.length;m++){var x=f[m];if(!ue.call(l,x)||!gi(s[x],l[x]))return!1}return!0}function F0(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function q0(s,l){var f=F0(s);s=0;for(var m;f;){if(f.nodeType===3){if(m=s+f.textContent.length,s<=l&&m>=l)return{node:f,offset:l-s};s=m}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=F0(f)}}function H0(s,l){return s&&l?s===l?!0:s&&s.nodeType===3?!1:l&&l.nodeType===3?H0(s,l.parentNode):"contains"in s?s.contains(l):s.compareDocumentPosition?!!(s.compareDocumentPosition(l)&16):!1:!1}function K0(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var l=Cs(s.document);l instanceof s.HTMLIFrameElement;){try{var f=typeof l.contentWindow.location.href=="string"}catch{f=!1}if(f)s=l.contentWindow;else break;l=Cs(s.document)}return l}function Fp(s){var l=s&&s.nodeName&&s.nodeName.toLowerCase();return l&&(l==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||l==="textarea"||s.contentEditable==="true")}var zM=Hr&&"documentMode"in document&&11>=document.documentMode,Ol=null,qp=null,xc=null,Hp=!1;function G0(s,l,f){var m=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;Hp||Ol==null||Ol!==Cs(m)||(m=Ol,"selectionStart"in m&&Fp(m)?m={start:m.selectionStart,end:m.selectionEnd}:(m=(m.ownerDocument&&m.ownerDocument.defaultView||window).getSelection(),m={anchorNode:m.anchorNode,anchorOffset:m.anchorOffset,focusNode:m.focusNode,focusOffset:m.focusOffset}),xc&&bc(xc,m)||(xc=m,m=df(qp,"onSelect"),0<m.length&&(l=new vd("onSelect","select",null,l,f),s.push({event:l,listeners:m}),l.target=Ol)))}function Ma(s,l){var f={};return f[s.toLowerCase()]=l.toLowerCase(),f["Webkit"+s]="webkit"+l,f["Moz"+s]="moz"+l,f}var Rl={animationend:Ma("Animation","AnimationEnd"),animationiteration:Ma("Animation","AnimationIteration"),animationstart:Ma("Animation","AnimationStart"),transitionrun:Ma("Transition","TransitionRun"),transitionstart:Ma("Transition","TransitionStart"),transitioncancel:Ma("Transition","TransitionCancel"),transitionend:Ma("Transition","TransitionEnd")},Kp={},V0={};Hr&&(V0=document.createElement("div").style,"AnimationEvent"in window||(delete Rl.animationend.animation,delete Rl.animationiteration.animation,delete Rl.animationstart.animation),"TransitionEvent"in window||delete Rl.transitionend.transition);function Da(s){if(Kp[s])return Kp[s];if(!Rl[s])return s;var l=Rl[s],f;for(f in l)if(l.hasOwnProperty(f)&&f in V0)return Kp[s]=l[f];return s}var Y0=Da("animationend"),W0=Da("animationiteration"),Q0=Da("animationstart"),IM=Da("transitionrun"),PM=Da("transitionstart"),BM=Da("transitioncancel"),X0=Da("transitionend"),Z0=new Map,Gp="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(" ");Gp.push("scrollEnd");function er(s,l){Z0.set(s,l),Zi(l,[s])}var Ed=typeof reportError=="function"?reportError:function(s){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var l=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof s=="object"&&s!==null&&typeof s.message=="string"?String(s.message):String(s),error:s});if(!window.dispatchEvent(l))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",s);return}console.error(s)},Di=[],Ll=0,Vp=0;function Sd(){for(var s=Ll,l=Vp=Ll=0;l<s;){var f=Di[l];Di[l++]=null;var m=Di[l];Di[l++]=null;var x=Di[l];Di[l++]=null;var E=Di[l];if(Di[l++]=null,m!==null&&x!==null){var D=m.pending;D===null?x.next=x:(x.next=D.next,D.next=x),m.pending=x}E!==0&&J0(f,x,E)}}function Nd(s,l,f,m){Di[Ll++]=s,Di[Ll++]=l,Di[Ll++]=f,Di[Ll++]=m,Vp|=m,s.lanes|=m,s=s.alternate,s!==null&&(s.lanes|=m)}function Yp(s,l,f,m){return Nd(s,l,f,m),_d(s)}function Oa(s,l){return Nd(s,null,null,l),_d(s)}function J0(s,l,f){s.lanes|=f;var m=s.alternate;m!==null&&(m.lanes|=f);for(var x=!1,E=s.return;E!==null;)E.childLanes|=f,m=E.alternate,m!==null&&(m.childLanes|=f),E.tag===22&&(s=E.stateNode,s===null||s._visibility&1||(x=!0)),s=E,E=E.return;return s.tag===3?(E=s.stateNode,x&&l!==null&&(x=31-yt(f),s=E.hiddenUpdates,m=s[x],m===null?s[x]=[l]:m.push(l),l.lane=f|536870912),E):null}function _d(s){if(50<Uc)throw Uc=0,ig=null,Error(i(185));for(var l=s.return;l!==null;)s=l,l=s.return;return s.tag===3?s.stateNode:null}var zl={};function $M(s,l,f,m){this.tag=s,this.key=f,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=m,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function yi(s,l,f,m){return new $M(s,l,f,m)}function Wp(s){return s=s.prototype,!(!s||!s.isReactComponent)}function Kr(s,l){var f=s.alternate;return f===null?(f=yi(s.tag,l,s.key,s.mode),f.elementType=s.elementType,f.type=s.type,f.stateNode=s.stateNode,f.alternate=s,s.alternate=f):(f.pendingProps=l,f.type=s.type,f.flags=0,f.subtreeFlags=0,f.deletions=null),f.flags=s.flags&65011712,f.childLanes=s.childLanes,f.lanes=s.lanes,f.child=s.child,f.memoizedProps=s.memoizedProps,f.memoizedState=s.memoizedState,f.updateQueue=s.updateQueue,l=s.dependencies,f.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},f.sibling=s.sibling,f.index=s.index,f.ref=s.ref,f.refCleanup=s.refCleanup,f}function ev(s,l){s.flags&=65011714;var f=s.alternate;return f===null?(s.childLanes=0,s.lanes=l,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=f.childLanes,s.lanes=f.lanes,s.child=f.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=f.memoizedProps,s.memoizedState=f.memoizedState,s.updateQueue=f.updateQueue,s.type=f.type,l=f.dependencies,s.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),s}function jd(s,l,f,m,x,E){var D=0;if(m=s,typeof s=="function")Wp(s)&&(D=1);else if(typeof s=="string")D=KD(s,f,te.current)?26:s==="html"||s==="head"||s==="body"?27:5;else e:switch(s){case B:return s=yi(31,f,l,x),s.elementType=B,s.lanes=E,s;case v:return Ra(f.children,x,E,l);case N:D=8,x|=24;break;case k:return s=yi(12,f,l,x|2),s.elementType=k,s.lanes=E,s;case C:return s=yi(13,f,l,x),s.elementType=C,s.lanes=E,s;case T:return s=yi(19,f,l,x),s.elementType=T,s.lanes=E,s;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case S:D=10;break e;case A:D=9;break e;case _:D=11;break e;case R:D=14;break e;case O:D=16,m=null;break e}D=29,f=Error(i(130,s===null?"null":typeof s,"")),m=null}return l=yi(D,f,l,x),l.elementType=s,l.type=m,l.lanes=E,l}function Ra(s,l,f,m){return s=yi(7,s,m,l),s.lanes=f,s}function Qp(s,l,f){return s=yi(6,s,null,l),s.lanes=f,s}function tv(s){var l=yi(18,null,null,0);return l.stateNode=s,l}function Xp(s,l,f){return l=yi(4,s.children!==null?s.children:[],s.key,l),l.lanes=f,l.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},l}var nv=new WeakMap;function Oi(s,l){if(typeof s=="object"&&s!==null){var f=nv.get(s);return f!==void 0?f:(l={value:s,source:l,stack:Ue(l)},nv.set(s,l),l)}return{value:s,source:l,stack:Ue(l)}}var Il=[],Pl=0,Cd=null,vc=0,Ri=[],Li=0,Os=null,wr=1,kr="";function Gr(s,l){Il[Pl++]=vc,Il[Pl++]=Cd,Cd=s,vc=l}function iv(s,l,f){Ri[Li++]=wr,Ri[Li++]=kr,Ri[Li++]=Os,Os=s;var m=wr;s=kr;var x=32-yt(m)-1;m&=~(1<<x),f+=1;var E=32-yt(l)+x;if(30<E){var D=x-x%5;E=(m&(1<<D)-1).toString(32),m>>=D,x-=D,wr=1<<32-yt(l)+x|f<<x|m,kr=E+s}else wr=1<<E|f<<x|m,kr=s}function Zp(s){s.return!==null&&(Gr(s,1),iv(s,1,0))}function Jp(s){for(;s===Cd;)Cd=Il[--Pl],Il[Pl]=null,vc=Il[--Pl],Il[Pl]=null;for(;s===Os;)Os=Ri[--Li],Ri[Li]=null,kr=Ri[--Li],Ri[Li]=null,wr=Ri[--Li],Ri[Li]=null}function rv(s,l){Ri[Li++]=wr,Ri[Li++]=kr,Ri[Li++]=Os,wr=l.id,kr=l.overflow,Os=s}var zn=null,Qt=null,wt=!1,Rs=null,zi=!1,em=Error(i(519));function Ls(s){var l=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw wc(Oi(l,s)),em}function sv(s){var l=s.stateNode,f=s.type,m=s.memoizedProps;switch(l[sn]=s,l[Tn]=m,f){case"dialog":mt("cancel",l),mt("close",l);break;case"iframe":case"object":case"embed":mt("load",l);break;case"video":case"audio":for(f=0;f<qc.length;f++)mt(qc[f],l);break;case"source":mt("error",l);break;case"img":case"image":case"link":mt("error",l),mt("load",l);break;case"details":mt("toggle",l);break;case"input":mt("invalid",l),Ji(l,m.value,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name,!0);break;case"select":mt("invalid",l);break;case"textarea":mt("invalid",l),Ml(l,m.value,m.defaultValue,m.children)}f=m.children,typeof f!="string"&&typeof f!="number"&&typeof f!="bigint"||l.textContent===""+f||m.suppressHydrationWarning===!0||kw(l.textContent,f)?(m.popover!=null&&(mt("beforetoggle",l),mt("toggle",l)),m.onScroll!=null&&mt("scroll",l),m.onScrollEnd!=null&&mt("scrollend",l),m.onClick!=null&&(l.onclick=De),l=!0):l=!1,l||Ls(s,!0)}function av(s){for(zn=s.return;zn;)switch(zn.tag){case 5:case 31:case 13:zi=!1;return;case 27:case 3:zi=!0;return;default:zn=zn.return}}function Bl(s){if(s!==zn)return!1;if(!wt)return av(s),wt=!0,!1;var l=s.tag,f;if((f=l!==3&&l!==27)&&((f=l===5)&&(f=s.type,f=!(f!=="form"&&f!=="button")||bg(s.type,s.memoizedProps)),f=!f),f&&Qt&&Ls(s),av(s),l===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(i(317));Qt=Mw(s)}else if(l===31){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(i(317));Qt=Mw(s)}else l===27?(l=Qt,Ws(s.type)?(s=Eg,Eg=null,Qt=s):Qt=l):Qt=zn?Pi(s.stateNode.nextSibling):null;return!0}function La(){Qt=zn=null,wt=!1}function tm(){var s=Rs;return s!==null&&(li===null?li=s:li.push.apply(li,s),Rs=null),s}function wc(s){Rs===null?Rs=[s]:Rs.push(s)}var nm=L(null),za=null,Vr=null;function zs(s,l,f){z(nm,l._currentValue),l._currentValue=f}function Yr(s){s._currentValue=nm.current,G(nm)}function im(s,l,f){for(;s!==null;){var m=s.alternate;if((s.childLanes&l)!==l?(s.childLanes|=l,m!==null&&(m.childLanes|=l)):m!==null&&(m.childLanes&l)!==l&&(m.childLanes|=l),s===f)break;s=s.return}}function rm(s,l,f,m){var x=s.child;for(x!==null&&(x.return=s);x!==null;){var E=x.dependencies;if(E!==null){var D=x.child;E=E.firstContext;e:for(;E!==null;){var q=E;E=x;for(var Q=0;Q<l.length;Q++)if(q.context===l[Q]){E.lanes|=f,q=E.alternate,q!==null&&(q.lanes|=f),im(E.return,f,s),m||(D=null);break e}E=q.next}}else if(x.tag===18){if(D=x.return,D===null)throw Error(i(341));D.lanes|=f,E=D.alternate,E!==null&&(E.lanes|=f),im(D,f,s),D=null}else D=x.child;if(D!==null)D.return=x;else for(D=x;D!==null;){if(D===s){D=null;break}if(x=D.sibling,x!==null){x.return=D.return,D=x;break}D=D.return}x=D}}function $l(s,l,f,m){s=null;for(var x=l,E=!1;x!==null;){if(!E){if((x.flags&524288)!==0)E=!0;else if((x.flags&262144)!==0)break}if(x.tag===10){var D=x.alternate;if(D===null)throw Error(i(387));if(D=D.memoizedProps,D!==null){var q=x.type;gi(x.pendingProps.value,D.value)||(s!==null?s.push(q):s=[q])}}else if(x===Se.current){if(D=x.alternate,D===null)throw Error(i(387));D.memoizedState.memoizedState!==x.memoizedState.memoizedState&&(s!==null?s.push(Yc):s=[Yc])}x=x.return}s!==null&&rm(l,s,f,m),l.flags|=262144}function Ad(s){for(s=s.firstContext;s!==null;){if(!gi(s.context._currentValue,s.memoizedValue))return!0;s=s.next}return!1}function Ia(s){za=s,Vr=null,s=s.dependencies,s!==null&&(s.firstContext=null)}function In(s){return lv(za,s)}function Td(s,l){return za===null&&Ia(s),lv(s,l)}function lv(s,l){var f=l._currentValue;if(l={context:l,memoizedValue:f,next:null},Vr===null){if(s===null)throw Error(i(308));Vr=l,s.dependencies={lanes:0,firstContext:l},s.flags|=524288}else Vr=Vr.next=l;return f}var UM=typeof AbortController<"u"?AbortController:function(){var s=[],l=this.signal={aborted:!1,addEventListener:function(f,m){s.push(m)}};this.abort=function(){l.aborted=!0,s.forEach(function(f){return f()})}},FM=e.unstable_scheduleCallback,qM=e.unstable_NormalPriority,vn={$$typeof:S,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function sm(){return{controller:new UM,data:new Map,refCount:0}}function kc(s){s.refCount--,s.refCount===0&&FM(qM,function(){s.controller.abort()})}var Ec=null,am=0,Ul=0,Fl=null;function HM(s,l){if(Ec===null){var f=Ec=[];am=0,Ul=cg(),Fl={status:"pending",value:void 0,then:function(m){f.push(m)}}}return am++,l.then(ov,ov),l}function ov(){if(--am===0&&Ec!==null){Fl!==null&&(Fl.status="fulfilled");var s=Ec;Ec=null,Ul=0,Fl=null;for(var l=0;l<s.length;l++)(0,s[l])()}}function KM(s,l){var f=[],m={status:"pending",value:null,reason:null,then:function(x){f.push(x)}};return s.then(function(){m.status="fulfilled",m.value=l;for(var x=0;x<f.length;x++)(0,f[x])(l)},function(x){for(m.status="rejected",m.reason=x,x=0;x<f.length;x++)(0,f[x])(void 0)}),m}var cv=$.S;$.S=function(s,l){G1=je(),typeof l=="object"&&l!==null&&typeof l.then=="function"&&HM(s,l),cv!==null&&cv(s,l)};var Pa=L(null);function lm(){var s=Pa.current;return s!==null?s:Ht.pooledCache}function Md(s,l){l===null?z(Pa,Pa.current):z(Pa,l.pool)}function uv(){var s=lm();return s===null?null:{parent:vn._currentValue,pool:s}}var ql=Error(i(460)),om=Error(i(474)),Dd=Error(i(542)),Od={then:function(){}};function dv(s){return s=s.status,s==="fulfilled"||s==="rejected"}function fv(s,l,f){switch(f=s[f],f===void 0?s.push(l):f!==l&&(l.then(De,De),l=f),l.status){case"fulfilled":return l.value;case"rejected":throw s=l.reason,pv(s),s;default:if(typeof l.status=="string")l.then(De,De);else{if(s=Ht,s!==null&&100<s.shellSuspendCounter)throw Error(i(482));s=l,s.status="pending",s.then(function(m){if(l.status==="pending"){var x=l;x.status="fulfilled",x.value=m}},function(m){if(l.status==="pending"){var x=l;x.status="rejected",x.reason=m}})}switch(l.status){case"fulfilled":return l.value;case"rejected":throw s=l.reason,pv(s),s}throw $a=l,ql}}function Ba(s){try{var l=s._init;return l(s._payload)}catch(f){throw f!==null&&typeof f=="object"&&typeof f.then=="function"?($a=f,ql):f}}var $a=null;function hv(){if($a===null)throw Error(i(459));var s=$a;return $a=null,s}function pv(s){if(s===ql||s===Dd)throw Error(i(483))}var Hl=null,Sc=0;function Rd(s){var l=Sc;return Sc+=1,Hl===null&&(Hl=[]),fv(Hl,s,l)}function Nc(s,l){l=l.props.ref,s.ref=l!==void 0?l:null}function Ld(s,l){throw l.$$typeof===y?Error(i(525)):(s=Object.prototype.toString.call(l),Error(i(31,s==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":s)))}function mv(s){function l(ie,ee){if(s){var ae=ie.deletions;ae===null?(ie.deletions=[ee],ie.flags|=16):ae.push(ee)}}function f(ie,ee){if(!s)return null;for(;ee!==null;)l(ie,ee),ee=ee.sibling;return null}function m(ie){for(var ee=new Map;ie!==null;)ie.key!==null?ee.set(ie.key,ie):ee.set(ie.index,ie),ie=ie.sibling;return ee}function x(ie,ee){return ie=Kr(ie,ee),ie.index=0,ie.sibling=null,ie}function E(ie,ee,ae){return ie.index=ae,s?(ae=ie.alternate,ae!==null?(ae=ae.index,ae<ee?(ie.flags|=67108866,ee):ae):(ie.flags|=67108866,ee)):(ie.flags|=1048576,ee)}function D(ie){return s&&ie.alternate===null&&(ie.flags|=67108866),ie}function q(ie,ee,ae,ve){return ee===null||ee.tag!==6?(ee=Qp(ae,ie.mode,ve),ee.return=ie,ee):(ee=x(ee,ae),ee.return=ie,ee)}function Q(ie,ee,ae,ve){var We=ae.type;return We===v?ge(ie,ee,ae.props.children,ve,ae.key):ee!==null&&(ee.elementType===We||typeof We=="object"&&We!==null&&We.$$typeof===O&&Ba(We)===ee.type)?(ee=x(ee,ae.props),Nc(ee,ae),ee.return=ie,ee):(ee=jd(ae.type,ae.key,ae.props,null,ie.mode,ve),Nc(ee,ae),ee.return=ie,ee)}function oe(ie,ee,ae,ve){return ee===null||ee.tag!==4||ee.stateNode.containerInfo!==ae.containerInfo||ee.stateNode.implementation!==ae.implementation?(ee=Xp(ae,ie.mode,ve),ee.return=ie,ee):(ee=x(ee,ae.children||[]),ee.return=ie,ee)}function ge(ie,ee,ae,ve,We){return ee===null||ee.tag!==7?(ee=Ra(ae,ie.mode,ve,We),ee.return=ie,ee):(ee=x(ee,ae),ee.return=ie,ee)}function Ee(ie,ee,ae){if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return ee=Qp(""+ee,ie.mode,ae),ee.return=ie,ee;if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case b:return ae=jd(ee.type,ee.key,ee.props,null,ie.mode,ae),Nc(ae,ee),ae.return=ie,ae;case w:return ee=Xp(ee,ie.mode,ae),ee.return=ie,ee;case O:return ee=Ba(ee),Ee(ie,ee,ae)}if(H(ee)||U(ee))return ee=Ra(ee,ie.mode,ae,null),ee.return=ie,ee;if(typeof ee.then=="function")return Ee(ie,Rd(ee),ae);if(ee.$$typeof===S)return Ee(ie,Td(ie,ee),ae);Ld(ie,ee)}return null}function ce(ie,ee,ae,ve){var We=ee!==null?ee.key:null;if(typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint")return We!==null?null:q(ie,ee,""+ae,ve);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case b:return ae.key===We?Q(ie,ee,ae,ve):null;case w:return ae.key===We?oe(ie,ee,ae,ve):null;case O:return ae=Ba(ae),ce(ie,ee,ae,ve)}if(H(ae)||U(ae))return We!==null?null:ge(ie,ee,ae,ve,null);if(typeof ae.then=="function")return ce(ie,ee,Rd(ae),ve);if(ae.$$typeof===S)return ce(ie,ee,Td(ie,ae),ve);Ld(ie,ae)}return null}function fe(ie,ee,ae,ve,We){if(typeof ve=="string"&&ve!==""||typeof ve=="number"||typeof ve=="bigint")return ie=ie.get(ae)||null,q(ee,ie,""+ve,We);if(typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case b:return ie=ie.get(ve.key===null?ae:ve.key)||null,Q(ee,ie,ve,We);case w:return ie=ie.get(ve.key===null?ae:ve.key)||null,oe(ee,ie,ve,We);case O:return ve=Ba(ve),fe(ie,ee,ae,ve,We)}if(H(ve)||U(ve))return ie=ie.get(ae)||null,ge(ee,ie,ve,We,null);if(typeof ve.then=="function")return fe(ie,ee,ae,Rd(ve),We);if(ve.$$typeof===S)return fe(ie,ee,ae,Td(ee,ve),We);Ld(ee,ve)}return null}function Be(ie,ee,ae,ve){for(var We=null,jt=null,qe=ee,ut=ee=0,vt=null;qe!==null&&ut<ae.length;ut++){qe.index>ut?(vt=qe,qe=null):vt=qe.sibling;var Ct=ce(ie,qe,ae[ut],ve);if(Ct===null){qe===null&&(qe=vt);break}s&&qe&&Ct.alternate===null&&l(ie,qe),ee=E(Ct,ee,ut),jt===null?We=Ct:jt.sibling=Ct,jt=Ct,qe=vt}if(ut===ae.length)return f(ie,qe),wt&&Gr(ie,ut),We;if(qe===null){for(;ut<ae.length;ut++)qe=Ee(ie,ae[ut],ve),qe!==null&&(ee=E(qe,ee,ut),jt===null?We=qe:jt.sibling=qe,jt=qe);return wt&&Gr(ie,ut),We}for(qe=m(qe);ut<ae.length;ut++)vt=fe(qe,ie,ut,ae[ut],ve),vt!==null&&(s&&vt.alternate!==null&&qe.delete(vt.key===null?ut:vt.key),ee=E(vt,ee,ut),jt===null?We=vt:jt.sibling=vt,jt=vt);return s&&qe.forEach(function(ea){return l(ie,ea)}),wt&&Gr(ie,ut),We}function tt(ie,ee,ae,ve){if(ae==null)throw Error(i(151));for(var We=null,jt=null,qe=ee,ut=ee=0,vt=null,Ct=ae.next();qe!==null&&!Ct.done;ut++,Ct=ae.next()){qe.index>ut?(vt=qe,qe=null):vt=qe.sibling;var ea=ce(ie,qe,Ct.value,ve);if(ea===null){qe===null&&(qe=vt);break}s&&qe&&ea.alternate===null&&l(ie,qe),ee=E(ea,ee,ut),jt===null?We=ea:jt.sibling=ea,jt=ea,qe=vt}if(Ct.done)return f(ie,qe),wt&&Gr(ie,ut),We;if(qe===null){for(;!Ct.done;ut++,Ct=ae.next())Ct=Ee(ie,Ct.value,ve),Ct!==null&&(ee=E(Ct,ee,ut),jt===null?We=Ct:jt.sibling=Ct,jt=Ct);return wt&&Gr(ie,ut),We}for(qe=m(qe);!Ct.done;ut++,Ct=ae.next())Ct=fe(qe,ie,ut,Ct.value,ve),Ct!==null&&(s&&Ct.alternate!==null&&qe.delete(Ct.key===null?ut:Ct.key),ee=E(Ct,ee,ut),jt===null?We=Ct:jt.sibling=Ct,jt=Ct);return s&&qe.forEach(function(nO){return l(ie,nO)}),wt&&Gr(ie,ut),We}function $t(ie,ee,ae,ve){if(typeof ae=="object"&&ae!==null&&ae.type===v&&ae.key===null&&(ae=ae.props.children),typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case b:e:{for(var We=ae.key;ee!==null;){if(ee.key===We){if(We=ae.type,We===v){if(ee.tag===7){f(ie,ee.sibling),ve=x(ee,ae.props.children),ve.return=ie,ie=ve;break e}}else if(ee.elementType===We||typeof We=="object"&&We!==null&&We.$$typeof===O&&Ba(We)===ee.type){f(ie,ee.sibling),ve=x(ee,ae.props),Nc(ve,ae),ve.return=ie,ie=ve;break e}f(ie,ee);break}else l(ie,ee);ee=ee.sibling}ae.type===v?(ve=Ra(ae.props.children,ie.mode,ve,ae.key),ve.return=ie,ie=ve):(ve=jd(ae.type,ae.key,ae.props,null,ie.mode,ve),Nc(ve,ae),ve.return=ie,ie=ve)}return D(ie);case w:e:{for(We=ae.key;ee!==null;){if(ee.key===We)if(ee.tag===4&&ee.stateNode.containerInfo===ae.containerInfo&&ee.stateNode.implementation===ae.implementation){f(ie,ee.sibling),ve=x(ee,ae.children||[]),ve.return=ie,ie=ve;break e}else{f(ie,ee);break}else l(ie,ee);ee=ee.sibling}ve=Xp(ae,ie.mode,ve),ve.return=ie,ie=ve}return D(ie);case O:return ae=Ba(ae),$t(ie,ee,ae,ve)}if(H(ae))return Be(ie,ee,ae,ve);if(U(ae)){if(We=U(ae),typeof We!="function")throw Error(i(150));return ae=We.call(ae),tt(ie,ee,ae,ve)}if(typeof ae.then=="function")return $t(ie,ee,Rd(ae),ve);if(ae.$$typeof===S)return $t(ie,ee,Td(ie,ae),ve);Ld(ie,ae)}return typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint"?(ae=""+ae,ee!==null&&ee.tag===6?(f(ie,ee.sibling),ve=x(ee,ae),ve.return=ie,ie=ve):(f(ie,ee),ve=Qp(ae,ie.mode,ve),ve.return=ie,ie=ve),D(ie)):f(ie,ee)}return function(ie,ee,ae,ve){try{Sc=0;var We=$t(ie,ee,ae,ve);return Hl=null,We}catch(qe){if(qe===ql||qe===Dd)throw qe;var jt=yi(29,qe,null,ie.mode);return jt.lanes=ve,jt.return=ie,jt}finally{}}}var Ua=mv(!0),gv=mv(!1),Is=!1;function cm(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function um(s,l){s=s.updateQueue,l.updateQueue===s&&(l.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function Ps(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function Bs(s,l,f){var m=s.updateQueue;if(m===null)return null;if(m=m.shared,(Tt&2)!==0){var x=m.pending;return x===null?l.next=l:(l.next=x.next,x.next=l),m.pending=l,l=_d(s),J0(s,null,f),l}return Nd(s,m,l,f),_d(s)}function _c(s,l,f){if(l=l.updateQueue,l!==null&&(l=l.shared,(f&4194048)!==0)){var m=l.lanes;m&=s.pendingLanes,f|=m,l.lanes=f,et(s,f)}}function dm(s,l){var f=s.updateQueue,m=s.alternate;if(m!==null&&(m=m.updateQueue,f===m)){var x=null,E=null;if(f=f.firstBaseUpdate,f!==null){do{var D={lane:f.lane,tag:f.tag,payload:f.payload,callback:null,next:null};E===null?x=E=D:E=E.next=D,f=f.next}while(f!==null);E===null?x=E=l:E=E.next=l}else x=E=l;f={baseState:m.baseState,firstBaseUpdate:x,lastBaseUpdate:E,shared:m.shared,callbacks:m.callbacks},s.updateQueue=f;return}s=f.lastBaseUpdate,s===null?f.firstBaseUpdate=l:s.next=l,f.lastBaseUpdate=l}var fm=!1;function jc(){if(fm){var s=Fl;if(s!==null)throw s}}function Cc(s,l,f,m){fm=!1;var x=s.updateQueue;Is=!1;var E=x.firstBaseUpdate,D=x.lastBaseUpdate,q=x.shared.pending;if(q!==null){x.shared.pending=null;var Q=q,oe=Q.next;Q.next=null,D===null?E=oe:D.next=oe,D=Q;var ge=s.alternate;ge!==null&&(ge=ge.updateQueue,q=ge.lastBaseUpdate,q!==D&&(q===null?ge.firstBaseUpdate=oe:q.next=oe,ge.lastBaseUpdate=Q))}if(E!==null){var Ee=x.baseState;D=0,ge=oe=Q=null,q=E;do{var ce=q.lane&-536870913,fe=ce!==q.lane;if(fe?(xt&ce)===ce:(m&ce)===ce){ce!==0&&ce===Ul&&(fm=!0),ge!==null&&(ge=ge.next={lane:0,tag:q.tag,payload:q.payload,callback:null,next:null});e:{var Be=s,tt=q;ce=l;var $t=f;switch(tt.tag){case 1:if(Be=tt.payload,typeof Be=="function"){Ee=Be.call($t,Ee,ce);break e}Ee=Be;break e;case 3:Be.flags=Be.flags&-65537|128;case 0:if(Be=tt.payload,ce=typeof Be=="function"?Be.call($t,Ee,ce):Be,ce==null)break e;Ee=p({},Ee,ce);break e;case 2:Is=!0}}ce=q.callback,ce!==null&&(s.flags|=64,fe&&(s.flags|=8192),fe=x.callbacks,fe===null?x.callbacks=[ce]:fe.push(ce))}else fe={lane:ce,tag:q.tag,payload:q.payload,callback:q.callback,next:null},ge===null?(oe=ge=fe,Q=Ee):ge=ge.next=fe,D|=ce;if(q=q.next,q===null){if(q=x.shared.pending,q===null)break;fe=q,q=fe.next,fe.next=null,x.lastBaseUpdate=fe,x.shared.pending=null}}while(!0);ge===null&&(Q=Ee),x.baseState=Q,x.firstBaseUpdate=oe,x.lastBaseUpdate=ge,E===null&&(x.shared.lanes=0),Hs|=D,s.lanes=D,s.memoizedState=Ee}}function yv(s,l){if(typeof s!="function")throw Error(i(191,s));s.call(l)}function bv(s,l){var f=s.callbacks;if(f!==null)for(s.callbacks=null,s=0;s<f.length;s++)yv(f[s],l)}var Kl=L(null),zd=L(0);function xv(s,l){s=is,z(zd,s),z(Kl,l),is=s|l.baseLanes}function hm(){z(zd,is),z(Kl,Kl.current)}function pm(){is=zd.current,G(Kl),G(zd)}var bi=L(null),Ii=null;function $s(s){var l=s.alternate;z(yn,yn.current&1),z(bi,s),Ii===null&&(l===null||Kl.current!==null||l.memoizedState!==null)&&(Ii=s)}function mm(s){z(yn,yn.current),z(bi,s),Ii===null&&(Ii=s)}function vv(s){s.tag===22?(z(yn,yn.current),z(bi,s),Ii===null&&(Ii=s)):Us()}function Us(){z(yn,yn.current),z(bi,bi.current)}function xi(s){G(bi),Ii===s&&(Ii=null),G(yn)}var yn=L(0);function Id(s){for(var l=s;l!==null;){if(l.tag===13){var f=l.memoizedState;if(f!==null&&(f=f.dehydrated,f===null||wg(f)||kg(f)))return l}else if(l.tag===19&&(l.memoizedProps.revealOrder==="forwards"||l.memoizedProps.revealOrder==="backwards"||l.memoizedProps.revealOrder==="unstable_legacy-backwards"||l.memoizedProps.revealOrder==="together")){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===s)break;for(;l.sibling===null;){if(l.return===null||l.return===s)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var Wr=0,ot=null,Pt=null,wn=null,Pd=!1,Gl=!1,Fa=!1,Bd=0,Ac=0,Vl=null,GM=0;function pn(){throw Error(i(321))}function gm(s,l){if(l===null)return!1;for(var f=0;f<l.length&&f<s.length;f++)if(!gi(s[f],l[f]))return!1;return!0}function ym(s,l,f,m,x,E){return Wr=E,ot=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,$.H=s===null||s.memoizedState===null?i1:Dm,Fa=!1,E=f(m,x),Fa=!1,Gl&&(E=kv(l,f,m,x)),wv(s),E}function wv(s){$.H=Dc;var l=Pt!==null&&Pt.next!==null;if(Wr=0,wn=Pt=ot=null,Pd=!1,Ac=0,Vl=null,l)throw Error(i(300));s===null||kn||(s=s.dependencies,s!==null&&Ad(s)&&(kn=!0))}function kv(s,l,f,m){ot=s;var x=0;do{if(Gl&&(Vl=null),Ac=0,Gl=!1,25<=x)throw Error(i(301));if(x+=1,wn=Pt=null,s.updateQueue!=null){var E=s.updateQueue;E.lastEffect=null,E.events=null,E.stores=null,E.memoCache!=null&&(E.memoCache.index=0)}$.H=r1,E=l(f,m)}while(Gl);return E}function VM(){var s=$.H,l=s.useState()[0];return l=typeof l.then=="function"?Tc(l):l,s=s.useState()[0],(Pt!==null?Pt.memoizedState:null)!==s&&(ot.flags|=1024),l}function bm(){var s=Bd!==0;return Bd=0,s}function xm(s,l,f){l.updateQueue=s.updateQueue,l.flags&=-2053,s.lanes&=~f}function vm(s){if(Pd){for(s=s.memoizedState;s!==null;){var l=s.queue;l!==null&&(l.pending=null),s=s.next}Pd=!1}Wr=0,wn=Pt=ot=null,Gl=!1,Ac=Bd=0,Vl=null}function Xn(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return wn===null?ot.memoizedState=wn=s:wn=wn.next=s,wn}function bn(){if(Pt===null){var s=ot.alternate;s=s!==null?s.memoizedState:null}else s=Pt.next;var l=wn===null?ot.memoizedState:wn.next;if(l!==null)wn=l,Pt=s;else{if(s===null)throw ot.alternate===null?Error(i(467)):Error(i(310));Pt=s,s={memoizedState:Pt.memoizedState,baseState:Pt.baseState,baseQueue:Pt.baseQueue,queue:Pt.queue,next:null},wn===null?ot.memoizedState=wn=s:wn=wn.next=s}return wn}function $d(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Tc(s){var l=Ac;return Ac+=1,Vl===null&&(Vl=[]),s=fv(Vl,s,l),l=ot,(wn===null?l.memoizedState:wn.next)===null&&(l=l.alternate,$.H=l===null||l.memoizedState===null?i1:Dm),s}function Ud(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return Tc(s);if(s.$$typeof===S)return In(s)}throw Error(i(438,String(s)))}function wm(s){var l=null,f=ot.updateQueue;if(f!==null&&(l=f.memoCache),l==null){var m=ot.alternate;m!==null&&(m=m.updateQueue,m!==null&&(m=m.memoCache,m!=null&&(l={data:m.data.map(function(x){return x.slice()}),index:0})))}if(l==null&&(l={data:[],index:0}),f===null&&(f=$d(),ot.updateQueue=f),f.memoCache=l,f=l.data[l.index],f===void 0)for(f=l.data[l.index]=Array(s),m=0;m<s;m++)f[m]=P;return l.index++,f}function Qr(s,l){return typeof l=="function"?l(s):l}function Fd(s){var l=bn();return km(l,Pt,s)}function km(s,l,f){var m=s.queue;if(m===null)throw Error(i(311));m.lastRenderedReducer=f;var x=s.baseQueue,E=m.pending;if(E!==null){if(x!==null){var D=x.next;x.next=E.next,E.next=D}l.baseQueue=x=E,m.pending=null}if(E=s.baseState,x===null)s.memoizedState=E;else{l=x.next;var q=D=null,Q=null,oe=l,ge=!1;do{var Ee=oe.lane&-536870913;if(Ee!==oe.lane?(xt&Ee)===Ee:(Wr&Ee)===Ee){var ce=oe.revertLane;if(ce===0)Q!==null&&(Q=Q.next={lane:0,revertLane:0,gesture:null,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null}),Ee===Ul&&(ge=!0);else if((Wr&ce)===ce){oe=oe.next,ce===Ul&&(ge=!0);continue}else Ee={lane:0,revertLane:oe.revertLane,gesture:null,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null},Q===null?(q=Q=Ee,D=E):Q=Q.next=Ee,ot.lanes|=ce,Hs|=ce;Ee=oe.action,Fa&&f(E,Ee),E=oe.hasEagerState?oe.eagerState:f(E,Ee)}else ce={lane:Ee,revertLane:oe.revertLane,gesture:oe.gesture,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null},Q===null?(q=Q=ce,D=E):Q=Q.next=ce,ot.lanes|=Ee,Hs|=Ee;oe=oe.next}while(oe!==null&&oe!==l);if(Q===null?D=E:Q.next=q,!gi(E,s.memoizedState)&&(kn=!0,ge&&(f=Fl,f!==null)))throw f;s.memoizedState=E,s.baseState=D,s.baseQueue=Q,m.lastRenderedState=E}return x===null&&(m.lanes=0),[s.memoizedState,m.dispatch]}function Em(s){var l=bn(),f=l.queue;if(f===null)throw Error(i(311));f.lastRenderedReducer=s;var m=f.dispatch,x=f.pending,E=l.memoizedState;if(x!==null){f.pending=null;var D=x=x.next;do E=s(E,D.action),D=D.next;while(D!==x);gi(E,l.memoizedState)||(kn=!0),l.memoizedState=E,l.baseQueue===null&&(l.baseState=E),f.lastRenderedState=E}return[E,m]}function Ev(s,l,f){var m=ot,x=bn(),E=wt;if(E){if(f===void 0)throw Error(i(407));f=f()}else f=l();var D=!gi((Pt||x).memoizedState,f);if(D&&(x.memoizedState=f,kn=!0),x=x.queue,_m(_v.bind(null,m,x,s),[s]),x.getSnapshot!==l||D||wn!==null&&wn.memoizedState.tag&1){if(m.flags|=2048,Yl(9,{destroy:void 0},Nv.bind(null,m,x,f,l),null),Ht===null)throw Error(i(349));E||(Wr&127)!==0||Sv(m,l,f)}return f}function Sv(s,l,f){s.flags|=16384,s={getSnapshot:l,value:f},l=ot.updateQueue,l===null?(l=$d(),ot.updateQueue=l,l.stores=[s]):(f=l.stores,f===null?l.stores=[s]:f.push(s))}function Nv(s,l,f,m){l.value=f,l.getSnapshot=m,jv(l)&&Cv(s)}function _v(s,l,f){return f(function(){jv(l)&&Cv(s)})}function jv(s){var l=s.getSnapshot;s=s.value;try{var f=l();return!gi(s,f)}catch{return!0}}function Cv(s){var l=Oa(s,2);l!==null&&oi(l,s,2)}function Sm(s){var l=Xn();if(typeof s=="function"){var f=s;if(s=f(),Fa){Wt(!0);try{f()}finally{Wt(!1)}}}return l.memoizedState=l.baseState=s,l.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qr,lastRenderedState:s},l}function Av(s,l,f,m){return s.baseState=f,km(s,Pt,typeof m=="function"?m:Qr)}function YM(s,l,f,m,x){if(Kd(s))throw Error(i(485));if(s=l.action,s!==null){var E={payload:x,action:s,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(D){E.listeners.push(D)}};$.T!==null?f(!0):E.isTransition=!1,m(E),f=l.pending,f===null?(E.next=l.pending=E,Tv(l,E)):(E.next=f.next,l.pending=f.next=E)}}function Tv(s,l){var f=l.action,m=l.payload,x=s.state;if(l.isTransition){var E=$.T,D={};$.T=D;try{var q=f(x,m),Q=$.S;Q!==null&&Q(D,q),Mv(s,l,q)}catch(oe){Nm(s,l,oe)}finally{E!==null&&D.types!==null&&(E.types=D.types),$.T=E}}else try{E=f(x,m),Mv(s,l,E)}catch(oe){Nm(s,l,oe)}}function Mv(s,l,f){f!==null&&typeof f=="object"&&typeof f.then=="function"?f.then(function(m){Dv(s,l,m)},function(m){return Nm(s,l,m)}):Dv(s,l,f)}function Dv(s,l,f){l.status="fulfilled",l.value=f,Ov(l),s.state=f,l=s.pending,l!==null&&(f=l.next,f===l?s.pending=null:(f=f.next,l.next=f,Tv(s,f)))}function Nm(s,l,f){var m=s.pending;if(s.pending=null,m!==null){m=m.next;do l.status="rejected",l.reason=f,Ov(l),l=l.next;while(l!==m)}s.action=null}function Ov(s){s=s.listeners;for(var l=0;l<s.length;l++)(0,s[l])()}function Rv(s,l){return l}function Lv(s,l){if(wt){var f=Ht.formState;if(f!==null){e:{var m=ot;if(wt){if(Qt){t:{for(var x=Qt,E=zi;x.nodeType!==8;){if(!E){x=null;break t}if(x=Pi(x.nextSibling),x===null){x=null;break t}}E=x.data,x=E==="F!"||E==="F"?x:null}if(x){Qt=Pi(x.nextSibling),m=x.data==="F!";break e}}Ls(m)}m=!1}m&&(l=f[0])}}return f=Xn(),f.memoizedState=f.baseState=l,m={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Rv,lastRenderedState:l},f.queue=m,f=e1.bind(null,ot,m),m.dispatch=f,m=Sm(!1),E=Mm.bind(null,ot,!1,m.queue),m=Xn(),x={state:l,dispatch:null,action:s,pending:null},m.queue=x,f=YM.bind(null,ot,x,E,f),x.dispatch=f,m.memoizedState=s,[l,f,!1]}function zv(s){var l=bn();return Iv(l,Pt,s)}function Iv(s,l,f){if(l=km(s,l,Rv)[0],s=Fd(Qr)[0],typeof l=="object"&&l!==null&&typeof l.then=="function")try{var m=Tc(l)}catch(D){throw D===ql?Dd:D}else m=l;l=bn();var x=l.queue,E=x.dispatch;return f!==l.memoizedState&&(ot.flags|=2048,Yl(9,{destroy:void 0},WM.bind(null,x,f),null)),[m,E,s]}function WM(s,l){s.action=l}function Pv(s){var l=bn(),f=Pt;if(f!==null)return Iv(l,f,s);bn(),l=l.memoizedState,f=bn();var m=f.queue.dispatch;return f.memoizedState=s,[l,m,!1]}function Yl(s,l,f,m){return s={tag:s,create:f,deps:m,inst:l,next:null},l=ot.updateQueue,l===null&&(l=$d(),ot.updateQueue=l),f=l.lastEffect,f===null?l.lastEffect=s.next=s:(m=f.next,f.next=s,s.next=m,l.lastEffect=s),s}function Bv(){return bn().memoizedState}function qd(s,l,f,m){var x=Xn();ot.flags|=s,x.memoizedState=Yl(1|l,{destroy:void 0},f,m===void 0?null:m)}function Hd(s,l,f,m){var x=bn();m=m===void 0?null:m;var E=x.memoizedState.inst;Pt!==null&&m!==null&&gm(m,Pt.memoizedState.deps)?x.memoizedState=Yl(l,E,f,m):(ot.flags|=s,x.memoizedState=Yl(1|l,E,f,m))}function $v(s,l){qd(8390656,8,s,l)}function _m(s,l){Hd(2048,8,s,l)}function QM(s){ot.flags|=4;var l=ot.updateQueue;if(l===null)l=$d(),ot.updateQueue=l,l.events=[s];else{var f=l.events;f===null?l.events=[s]:f.push(s)}}function Uv(s){var l=bn().memoizedState;return QM({ref:l,nextImpl:s}),function(){if((Tt&2)!==0)throw Error(i(440));return l.impl.apply(void 0,arguments)}}function Fv(s,l){return Hd(4,2,s,l)}function qv(s,l){return Hd(4,4,s,l)}function Hv(s,l){if(typeof l=="function"){s=s();var f=l(s);return function(){typeof f=="function"?f():l(null)}}if(l!=null)return s=s(),l.current=s,function(){l.current=null}}function Kv(s,l,f){f=f!=null?f.concat([s]):null,Hd(4,4,Hv.bind(null,l,s),f)}function jm(){}function Gv(s,l){var f=bn();l=l===void 0?null:l;var m=f.memoizedState;return l!==null&&gm(l,m[1])?m[0]:(f.memoizedState=[s,l],s)}function Vv(s,l){var f=bn();l=l===void 0?null:l;var m=f.memoizedState;if(l!==null&&gm(l,m[1]))return m[0];if(m=s(),Fa){Wt(!0);try{s()}finally{Wt(!1)}}return f.memoizedState=[m,l],m}function Cm(s,l,f){return f===void 0||(Wr&1073741824)!==0&&(xt&261930)===0?s.memoizedState=l:(s.memoizedState=f,s=Y1(),ot.lanes|=s,Hs|=s,f)}function Yv(s,l,f,m){return gi(f,l)?f:Kl.current!==null?(s=Cm(s,f,m),gi(s,l)||(kn=!0),s):(Wr&42)===0||(Wr&1073741824)!==0&&(xt&261930)===0?(kn=!0,s.memoizedState=f):(s=Y1(),ot.lanes|=s,Hs|=s,l)}function Wv(s,l,f,m,x){var E=K.p;K.p=E!==0&&8>E?E:8;var D=$.T,q={};$.T=q,Mm(s,!1,l,f);try{var Q=x(),oe=$.S;if(oe!==null&&oe(q,Q),Q!==null&&typeof Q=="object"&&typeof Q.then=="function"){var ge=KM(Q,m);Mc(s,l,ge,ki(s))}else Mc(s,l,m,ki(s))}catch(Ee){Mc(s,l,{then:function(){},status:"rejected",reason:Ee},ki())}finally{K.p=E,D!==null&&q.types!==null&&(D.types=q.types),$.T=D}}function XM(){}function Am(s,l,f,m){if(s.tag!==5)throw Error(i(476));var x=Qv(s).queue;Wv(s,x,l,W,f===null?XM:function(){return Xv(s),f(m)})}function Qv(s){var l=s.memoizedState;if(l!==null)return l;l={memoizedState:W,baseState:W,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qr,lastRenderedState:W},next:null};var f={};return l.next={memoizedState:f,baseState:f,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qr,lastRenderedState:f},next:null},s.memoizedState=l,s=s.alternate,s!==null&&(s.memoizedState=l),l}function Xv(s){var l=Qv(s);l.next===null&&(l=s.alternate.memoizedState),Mc(s,l.next.queue,{},ki())}function Tm(){return In(Yc)}function Zv(){return bn().memoizedState}function Jv(){return bn().memoizedState}function ZM(s){for(var l=s.return;l!==null;){switch(l.tag){case 24:case 3:var f=ki();s=Ps(f);var m=Bs(l,s,f);m!==null&&(oi(m,l,f),_c(m,l,f)),l={cache:sm()},s.payload=l;return}l=l.return}}function JM(s,l,f){var m=ki();f={lane:m,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},Kd(s)?t1(l,f):(f=Yp(s,l,f,m),f!==null&&(oi(f,s,m),n1(f,l,m)))}function e1(s,l,f){var m=ki();Mc(s,l,f,m)}function Mc(s,l,f,m){var x={lane:m,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null};if(Kd(s))t1(l,x);else{var E=s.alternate;if(s.lanes===0&&(E===null||E.lanes===0)&&(E=l.lastRenderedReducer,E!==null))try{var D=l.lastRenderedState,q=E(D,f);if(x.hasEagerState=!0,x.eagerState=q,gi(q,D))return Nd(s,l,x,0),Ht===null&&Sd(),!1}catch{}finally{}if(f=Yp(s,l,x,m),f!==null)return oi(f,s,m),n1(f,l,m),!0}return!1}function Mm(s,l,f,m){if(m={lane:2,revertLane:cg(),gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null},Kd(s)){if(l)throw Error(i(479))}else l=Yp(s,f,m,2),l!==null&&oi(l,s,2)}function Kd(s){var l=s.alternate;return s===ot||l!==null&&l===ot}function t1(s,l){Gl=Pd=!0;var f=s.pending;f===null?l.next=l:(l.next=f.next,f.next=l),s.pending=l}function n1(s,l,f){if((f&4194048)!==0){var m=l.lanes;m&=s.pendingLanes,f|=m,l.lanes=f,et(s,f)}}var Dc={readContext:In,use:Ud,useCallback:pn,useContext:pn,useEffect:pn,useImperativeHandle:pn,useLayoutEffect:pn,useInsertionEffect:pn,useMemo:pn,useReducer:pn,useRef:pn,useState:pn,useDebugValue:pn,useDeferredValue:pn,useTransition:pn,useSyncExternalStore:pn,useId:pn,useHostTransitionStatus:pn,useFormState:pn,useActionState:pn,useOptimistic:pn,useMemoCache:pn,useCacheRefresh:pn};Dc.useEffectEvent=pn;var i1={readContext:In,use:Ud,useCallback:function(s,l){return Xn().memoizedState=[s,l===void 0?null:l],s},useContext:In,useEffect:$v,useImperativeHandle:function(s,l,f){f=f!=null?f.concat([s]):null,qd(4194308,4,Hv.bind(null,l,s),f)},useLayoutEffect:function(s,l){return qd(4194308,4,s,l)},useInsertionEffect:function(s,l){qd(4,2,s,l)},useMemo:function(s,l){var f=Xn();l=l===void 0?null:l;var m=s();if(Fa){Wt(!0);try{s()}finally{Wt(!1)}}return f.memoizedState=[m,l],m},useReducer:function(s,l,f){var m=Xn();if(f!==void 0){var x=f(l);if(Fa){Wt(!0);try{f(l)}finally{Wt(!1)}}}else x=l;return m.memoizedState=m.baseState=x,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:x},m.queue=s,s=s.dispatch=JM.bind(null,ot,s),[m.memoizedState,s]},useRef:function(s){var l=Xn();return s={current:s},l.memoizedState=s},useState:function(s){s=Sm(s);var l=s.queue,f=e1.bind(null,ot,l);return l.dispatch=f,[s.memoizedState,f]},useDebugValue:jm,useDeferredValue:function(s,l){var f=Xn();return Cm(f,s,l)},useTransition:function(){var s=Sm(!1);return s=Wv.bind(null,ot,s.queue,!0,!1),Xn().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,l,f){var m=ot,x=Xn();if(wt){if(f===void 0)throw Error(i(407));f=f()}else{if(f=l(),Ht===null)throw Error(i(349));(xt&127)!==0||Sv(m,l,f)}x.memoizedState=f;var E={value:f,getSnapshot:l};return x.queue=E,$v(_v.bind(null,m,E,s),[s]),m.flags|=2048,Yl(9,{destroy:void 0},Nv.bind(null,m,E,f,l),null),f},useId:function(){var s=Xn(),l=Ht.identifierPrefix;if(wt){var f=kr,m=wr;f=(m&~(1<<32-yt(m)-1)).toString(32)+f,l="_"+l+"R_"+f,f=Bd++,0<f&&(l+="H"+f.toString(32)),l+="_"}else f=GM++,l="_"+l+"r_"+f.toString(32)+"_";return s.memoizedState=l},useHostTransitionStatus:Tm,useFormState:Lv,useActionState:Lv,useOptimistic:function(s){var l=Xn();l.memoizedState=l.baseState=s;var f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return l.queue=f,l=Mm.bind(null,ot,!0,f),f.dispatch=l,[s,l]},useMemoCache:wm,useCacheRefresh:function(){return Xn().memoizedState=ZM.bind(null,ot)},useEffectEvent:function(s){var l=Xn(),f={impl:s};return l.memoizedState=f,function(){if((Tt&2)!==0)throw Error(i(440));return f.impl.apply(void 0,arguments)}}},Dm={readContext:In,use:Ud,useCallback:Gv,useContext:In,useEffect:_m,useImperativeHandle:Kv,useInsertionEffect:Fv,useLayoutEffect:qv,useMemo:Vv,useReducer:Fd,useRef:Bv,useState:function(){return Fd(Qr)},useDebugValue:jm,useDeferredValue:function(s,l){var f=bn();return Yv(f,Pt.memoizedState,s,l)},useTransition:function(){var s=Fd(Qr)[0],l=bn().memoizedState;return[typeof s=="boolean"?s:Tc(s),l]},useSyncExternalStore:Ev,useId:Zv,useHostTransitionStatus:Tm,useFormState:zv,useActionState:zv,useOptimistic:function(s,l){var f=bn();return Av(f,Pt,s,l)},useMemoCache:wm,useCacheRefresh:Jv};Dm.useEffectEvent=Uv;var r1={readContext:In,use:Ud,useCallback:Gv,useContext:In,useEffect:_m,useImperativeHandle:Kv,useInsertionEffect:Fv,useLayoutEffect:qv,useMemo:Vv,useReducer:Em,useRef:Bv,useState:function(){return Em(Qr)},useDebugValue:jm,useDeferredValue:function(s,l){var f=bn();return Pt===null?Cm(f,s,l):Yv(f,Pt.memoizedState,s,l)},useTransition:function(){var s=Em(Qr)[0],l=bn().memoizedState;return[typeof s=="boolean"?s:Tc(s),l]},useSyncExternalStore:Ev,useId:Zv,useHostTransitionStatus:Tm,useFormState:Pv,useActionState:Pv,useOptimistic:function(s,l){var f=bn();return Pt!==null?Av(f,Pt,s,l):(f.baseState=s,[s,f.queue.dispatch])},useMemoCache:wm,useCacheRefresh:Jv};r1.useEffectEvent=Uv;function Om(s,l,f,m){l=s.memoizedState,f=f(m,l),f=f==null?l:p({},l,f),s.memoizedState=f,s.lanes===0&&(s.updateQueue.baseState=f)}var Rm={enqueueSetState:function(s,l,f){s=s._reactInternals;var m=ki(),x=Ps(m);x.payload=l,f!=null&&(x.callback=f),l=Bs(s,x,m),l!==null&&(oi(l,s,m),_c(l,s,m))},enqueueReplaceState:function(s,l,f){s=s._reactInternals;var m=ki(),x=Ps(m);x.tag=1,x.payload=l,f!=null&&(x.callback=f),l=Bs(s,x,m),l!==null&&(oi(l,s,m),_c(l,s,m))},enqueueForceUpdate:function(s,l){s=s._reactInternals;var f=ki(),m=Ps(f);m.tag=2,l!=null&&(m.callback=l),l=Bs(s,m,f),l!==null&&(oi(l,s,f),_c(l,s,f))}};function s1(s,l,f,m,x,E,D){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(m,E,D):l.prototype&&l.prototype.isPureReactComponent?!bc(f,m)||!bc(x,E):!0}function a1(s,l,f,m){s=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(f,m),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(f,m),l.state!==s&&Rm.enqueueReplaceState(l,l.state,null)}function qa(s,l){var f=l;if("ref"in l){f={};for(var m in l)m!=="ref"&&(f[m]=l[m])}if(s=s.defaultProps){f===l&&(f=p({},f));for(var x in s)f[x]===void 0&&(f[x]=s[x])}return f}function l1(s){Ed(s)}function o1(s){console.error(s)}function c1(s){Ed(s)}function Gd(s,l){try{var f=s.onUncaughtError;f(l.value,{componentStack:l.stack})}catch(m){setTimeout(function(){throw m})}}function u1(s,l,f){try{var m=s.onCaughtError;m(f.value,{componentStack:f.stack,errorBoundary:l.tag===1?l.stateNode:null})}catch(x){setTimeout(function(){throw x})}}function Lm(s,l,f){return f=Ps(f),f.tag=3,f.payload={element:null},f.callback=function(){Gd(s,l)},f}function d1(s){return s=Ps(s),s.tag=3,s}function f1(s,l,f,m){var x=f.type.getDerivedStateFromError;if(typeof x=="function"){var E=m.value;s.payload=function(){return x(E)},s.callback=function(){u1(l,f,m)}}var D=f.stateNode;D!==null&&typeof D.componentDidCatch=="function"&&(s.callback=function(){u1(l,f,m),typeof x!="function"&&(Ks===null?Ks=new Set([this]):Ks.add(this));var q=m.stack;this.componentDidCatch(m.value,{componentStack:q!==null?q:""})})}function eD(s,l,f,m,x){if(f.flags|=32768,m!==null&&typeof m=="object"&&typeof m.then=="function"){if(l=f.alternate,l!==null&&$l(l,f,x,!0),f=bi.current,f!==null){switch(f.tag){case 31:case 13:return Ii===null?sf():f.alternate===null&&mn===0&&(mn=3),f.flags&=-257,f.flags|=65536,f.lanes=x,m===Od?f.flags|=16384:(l=f.updateQueue,l===null?f.updateQueue=new Set([m]):l.add(m),ag(s,m,x)),!1;case 22:return f.flags|=65536,m===Od?f.flags|=16384:(l=f.updateQueue,l===null?(l={transitions:null,markerInstances:null,retryQueue:new Set([m])},f.updateQueue=l):(f=l.retryQueue,f===null?l.retryQueue=new Set([m]):f.add(m)),ag(s,m,x)),!1}throw Error(i(435,f.tag))}return ag(s,m,x),sf(),!1}if(wt)return l=bi.current,l!==null?((l.flags&65536)===0&&(l.flags|=256),l.flags|=65536,l.lanes=x,m!==em&&(s=Error(i(422),{cause:m}),wc(Oi(s,f)))):(m!==em&&(l=Error(i(423),{cause:m}),wc(Oi(l,f))),s=s.current.alternate,s.flags|=65536,x&=-x,s.lanes|=x,m=Oi(m,f),x=Lm(s.stateNode,m,x),dm(s,x),mn!==4&&(mn=2)),!1;var E=Error(i(520),{cause:m});if(E=Oi(E,f),$c===null?$c=[E]:$c.push(E),mn!==4&&(mn=2),l===null)return!0;m=Oi(m,f),f=l;do{switch(f.tag){case 3:return f.flags|=65536,s=x&-x,f.lanes|=s,s=Lm(f.stateNode,m,s),dm(f,s),!1;case 1:if(l=f.type,E=f.stateNode,(f.flags&128)===0&&(typeof l.getDerivedStateFromError=="function"||E!==null&&typeof E.componentDidCatch=="function"&&(Ks===null||!Ks.has(E))))return f.flags|=65536,x&=-x,f.lanes|=x,x=d1(x),f1(x,s,f,m),dm(f,x),!1}f=f.return}while(f!==null);return!1}var zm=Error(i(461)),kn=!1;function Pn(s,l,f,m){l.child=s===null?gv(l,null,f,m):Ua(l,s.child,f,m)}function h1(s,l,f,m,x){f=f.render;var E=l.ref;if("ref"in m){var D={};for(var q in m)q!=="ref"&&(D[q]=m[q])}else D=m;return Ia(l),m=ym(s,l,f,D,E,x),q=bm(),s!==null&&!kn?(xm(s,l,x),Xr(s,l,x)):(wt&&q&&Zp(l),l.flags|=1,Pn(s,l,m,x),l.child)}function p1(s,l,f,m,x){if(s===null){var E=f.type;return typeof E=="function"&&!Wp(E)&&E.defaultProps===void 0&&f.compare===null?(l.tag=15,l.type=E,m1(s,l,E,m,x)):(s=jd(f.type,null,m,l,l.mode,x),s.ref=l.ref,s.return=l,l.child=s)}if(E=s.child,!Hm(s,x)){var D=E.memoizedProps;if(f=f.compare,f=f!==null?f:bc,f(D,m)&&s.ref===l.ref)return Xr(s,l,x)}return l.flags|=1,s=Kr(E,m),s.ref=l.ref,s.return=l,l.child=s}function m1(s,l,f,m,x){if(s!==null){var E=s.memoizedProps;if(bc(E,m)&&s.ref===l.ref)if(kn=!1,l.pendingProps=m=E,Hm(s,x))(s.flags&131072)!==0&&(kn=!0);else return l.lanes=s.lanes,Xr(s,l,x)}return Im(s,l,f,m,x)}function g1(s,l,f,m){var x=m.children,E=s!==null?s.memoizedState:null;if(s===null&&l.stateNode===null&&(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),m.mode==="hidden"){if((l.flags&128)!==0){if(E=E!==null?E.baseLanes|f:f,s!==null){for(m=l.child=s.child,x=0;m!==null;)x=x|m.lanes|m.childLanes,m=m.sibling;m=x&~E}else m=0,l.child=null;return y1(s,l,E,f,m)}if((f&536870912)!==0)l.memoizedState={baseLanes:0,cachePool:null},s!==null&&Md(l,E!==null?E.cachePool:null),E!==null?xv(l,E):hm(),vv(l);else return m=l.lanes=536870912,y1(s,l,E!==null?E.baseLanes|f:f,f,m)}else E!==null?(Md(l,E.cachePool),xv(l,E),Us(),l.memoizedState=null):(s!==null&&Md(l,null),hm(),Us());return Pn(s,l,x,f),l.child}function Oc(s,l){return s!==null&&s.tag===22||l.stateNode!==null||(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.sibling}function y1(s,l,f,m,x){var E=lm();return E=E===null?null:{parent:vn._currentValue,pool:E},l.memoizedState={baseLanes:f,cachePool:E},s!==null&&Md(l,null),hm(),vv(l),s!==null&&$l(s,l,m,!0),l.childLanes=x,null}function Vd(s,l){return l=Wd({mode:l.mode,children:l.children},s.mode),l.ref=s.ref,s.child=l,l.return=s,l}function b1(s,l,f){return Ua(l,s.child,null,f),s=Vd(l,l.pendingProps),s.flags|=2,xi(l),l.memoizedState=null,s}function tD(s,l,f){var m=l.pendingProps,x=(l.flags&128)!==0;if(l.flags&=-129,s===null){if(wt){if(m.mode==="hidden")return s=Vd(l,m),l.lanes=536870912,Oc(null,s);if(mm(l),(s=Qt)?(s=Tw(s,zi),s=s!==null&&s.data==="&"?s:null,s!==null&&(l.memoizedState={dehydrated:s,treeContext:Os!==null?{id:wr,overflow:kr}:null,retryLane:536870912,hydrationErrors:null},f=tv(s),f.return=l,l.child=f,zn=l,Qt=null)):s=null,s===null)throw Ls(l);return l.lanes=536870912,null}return Vd(l,m)}var E=s.memoizedState;if(E!==null){var D=E.dehydrated;if(mm(l),x)if(l.flags&256)l.flags&=-257,l=b1(s,l,f);else if(l.memoizedState!==null)l.child=s.child,l.flags|=128,l=null;else throw Error(i(558));else if(kn||$l(s,l,f,!1),x=(f&s.childLanes)!==0,kn||x){if(m=Ht,m!==null&&(D=rn(m,f),D!==0&&D!==E.retryLane))throw E.retryLane=D,Oa(s,D),oi(m,s,D),zm;sf(),l=b1(s,l,f)}else s=E.treeContext,Qt=Pi(D.nextSibling),zn=l,wt=!0,Rs=null,zi=!1,s!==null&&rv(l,s),l=Vd(l,m),l.flags|=4096;return l}return s=Kr(s.child,{mode:m.mode,children:m.children}),s.ref=l.ref,l.child=s,s.return=l,s}function Yd(s,l){var f=l.ref;if(f===null)s!==null&&s.ref!==null&&(l.flags|=4194816);else{if(typeof f!="function"&&typeof f!="object")throw Error(i(284));(s===null||s.ref!==f)&&(l.flags|=4194816)}}function Im(s,l,f,m,x){return Ia(l),f=ym(s,l,f,m,void 0,x),m=bm(),s!==null&&!kn?(xm(s,l,x),Xr(s,l,x)):(wt&&m&&Zp(l),l.flags|=1,Pn(s,l,f,x),l.child)}function x1(s,l,f,m,x,E){return Ia(l),l.updateQueue=null,f=kv(l,m,f,x),wv(s),m=bm(),s!==null&&!kn?(xm(s,l,E),Xr(s,l,E)):(wt&&m&&Zp(l),l.flags|=1,Pn(s,l,f,E),l.child)}function v1(s,l,f,m,x){if(Ia(l),l.stateNode===null){var E=zl,D=f.contextType;typeof D=="object"&&D!==null&&(E=In(D)),E=new f(m,E),l.memoizedState=E.state!==null&&E.state!==void 0?E.state:null,E.updater=Rm,l.stateNode=E,E._reactInternals=l,E=l.stateNode,E.props=m,E.state=l.memoizedState,E.refs={},cm(l),D=f.contextType,E.context=typeof D=="object"&&D!==null?In(D):zl,E.state=l.memoizedState,D=f.getDerivedStateFromProps,typeof D=="function"&&(Om(l,f,D,m),E.state=l.memoizedState),typeof f.getDerivedStateFromProps=="function"||typeof E.getSnapshotBeforeUpdate=="function"||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(D=E.state,typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount(),D!==E.state&&Rm.enqueueReplaceState(E,E.state,null),Cc(l,m,E,x),jc(),E.state=l.memoizedState),typeof E.componentDidMount=="function"&&(l.flags|=4194308),m=!0}else if(s===null){E=l.stateNode;var q=l.memoizedProps,Q=qa(f,q);E.props=Q;var oe=E.context,ge=f.contextType;D=zl,typeof ge=="object"&&ge!==null&&(D=In(ge));var Ee=f.getDerivedStateFromProps;ge=typeof Ee=="function"||typeof E.getSnapshotBeforeUpdate=="function",q=l.pendingProps!==q,ge||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(q||oe!==D)&&a1(l,E,m,D),Is=!1;var ce=l.memoizedState;E.state=ce,Cc(l,m,E,x),jc(),oe=l.memoizedState,q||ce!==oe||Is?(typeof Ee=="function"&&(Om(l,f,Ee,m),oe=l.memoizedState),(Q=Is||s1(l,f,Q,m,ce,oe,D))?(ge||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount()),typeof E.componentDidMount=="function"&&(l.flags|=4194308)):(typeof E.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=m,l.memoizedState=oe),E.props=m,E.state=oe,E.context=D,m=Q):(typeof E.componentDidMount=="function"&&(l.flags|=4194308),m=!1)}else{E=l.stateNode,um(s,l),D=l.memoizedProps,ge=qa(f,D),E.props=ge,Ee=l.pendingProps,ce=E.context,oe=f.contextType,Q=zl,typeof oe=="object"&&oe!==null&&(Q=In(oe)),q=f.getDerivedStateFromProps,(oe=typeof q=="function"||typeof E.getSnapshotBeforeUpdate=="function")||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(D!==Ee||ce!==Q)&&a1(l,E,m,Q),Is=!1,ce=l.memoizedState,E.state=ce,Cc(l,m,E,x),jc();var fe=l.memoizedState;D!==Ee||ce!==fe||Is||s!==null&&s.dependencies!==null&&Ad(s.dependencies)?(typeof q=="function"&&(Om(l,f,q,m),fe=l.memoizedState),(ge=Is||s1(l,f,ge,m,ce,fe,Q)||s!==null&&s.dependencies!==null&&Ad(s.dependencies))?(oe||typeof E.UNSAFE_componentWillUpdate!="function"&&typeof E.componentWillUpdate!="function"||(typeof E.componentWillUpdate=="function"&&E.componentWillUpdate(m,fe,Q),typeof E.UNSAFE_componentWillUpdate=="function"&&E.UNSAFE_componentWillUpdate(m,fe,Q)),typeof E.componentDidUpdate=="function"&&(l.flags|=4),typeof E.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof E.componentDidUpdate!="function"||D===s.memoizedProps&&ce===s.memoizedState||(l.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||D===s.memoizedProps&&ce===s.memoizedState||(l.flags|=1024),l.memoizedProps=m,l.memoizedState=fe),E.props=m,E.state=fe,E.context=Q,m=ge):(typeof E.componentDidUpdate!="function"||D===s.memoizedProps&&ce===s.memoizedState||(l.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||D===s.memoizedProps&&ce===s.memoizedState||(l.flags|=1024),m=!1)}return E=m,Yd(s,l),m=(l.flags&128)!==0,E||m?(E=l.stateNode,f=m&&typeof f.getDerivedStateFromError!="function"?null:E.render(),l.flags|=1,s!==null&&m?(l.child=Ua(l,s.child,null,x),l.child=Ua(l,null,f,x)):Pn(s,l,f,x),l.memoizedState=E.state,s=l.child):s=Xr(s,l,x),s}function w1(s,l,f,m){return La(),l.flags|=256,Pn(s,l,f,m),l.child}var Pm={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Bm(s){return{baseLanes:s,cachePool:uv()}}function $m(s,l,f){return s=s!==null?s.childLanes&~f:0,l&&(s|=wi),s}function k1(s,l,f){var m=l.pendingProps,x=!1,E=(l.flags&128)!==0,D;if((D=E)||(D=s!==null&&s.memoizedState===null?!1:(yn.current&2)!==0),D&&(x=!0,l.flags&=-129),D=(l.flags&32)!==0,l.flags&=-33,s===null){if(wt){if(x?$s(l):Us(),(s=Qt)?(s=Tw(s,zi),s=s!==null&&s.data!=="&"?s:null,s!==null&&(l.memoizedState={dehydrated:s,treeContext:Os!==null?{id:wr,overflow:kr}:null,retryLane:536870912,hydrationErrors:null},f=tv(s),f.return=l,l.child=f,zn=l,Qt=null)):s=null,s===null)throw Ls(l);return kg(s)?l.lanes=32:l.lanes=536870912,null}var q=m.children;return m=m.fallback,x?(Us(),x=l.mode,q=Wd({mode:"hidden",children:q},x),m=Ra(m,x,f,null),q.return=l,m.return=l,q.sibling=m,l.child=q,m=l.child,m.memoizedState=Bm(f),m.childLanes=$m(s,D,f),l.memoizedState=Pm,Oc(null,m)):($s(l),Um(l,q))}var Q=s.memoizedState;if(Q!==null&&(q=Q.dehydrated,q!==null)){if(E)l.flags&256?($s(l),l.flags&=-257,l=Fm(s,l,f)):l.memoizedState!==null?(Us(),l.child=s.child,l.flags|=128,l=null):(Us(),q=m.fallback,x=l.mode,m=Wd({mode:"visible",children:m.children},x),q=Ra(q,x,f,null),q.flags|=2,m.return=l,q.return=l,m.sibling=q,l.child=m,Ua(l,s.child,null,f),m=l.child,m.memoizedState=Bm(f),m.childLanes=$m(s,D,f),l.memoizedState=Pm,l=Oc(null,m));else if($s(l),kg(q)){if(D=q.nextSibling&&q.nextSibling.dataset,D)var oe=D.dgst;D=oe,m=Error(i(419)),m.stack="",m.digest=D,wc({value:m,source:null,stack:null}),l=Fm(s,l,f)}else if(kn||$l(s,l,f,!1),D=(f&s.childLanes)!==0,kn||D){if(D=Ht,D!==null&&(m=rn(D,f),m!==0&&m!==Q.retryLane))throw Q.retryLane=m,Oa(s,m),oi(D,s,m),zm;wg(q)||sf(),l=Fm(s,l,f)}else wg(q)?(l.flags|=192,l.child=s.child,l=null):(s=Q.treeContext,Qt=Pi(q.nextSibling),zn=l,wt=!0,Rs=null,zi=!1,s!==null&&rv(l,s),l=Um(l,m.children),l.flags|=4096);return l}return x?(Us(),q=m.fallback,x=l.mode,Q=s.child,oe=Q.sibling,m=Kr(Q,{mode:"hidden",children:m.children}),m.subtreeFlags=Q.subtreeFlags&65011712,oe!==null?q=Kr(oe,q):(q=Ra(q,x,f,null),q.flags|=2),q.return=l,m.return=l,m.sibling=q,l.child=m,Oc(null,m),m=l.child,q=s.child.memoizedState,q===null?q=Bm(f):(x=q.cachePool,x!==null?(Q=vn._currentValue,x=x.parent!==Q?{parent:Q,pool:Q}:x):x=uv(),q={baseLanes:q.baseLanes|f,cachePool:x}),m.memoizedState=q,m.childLanes=$m(s,D,f),l.memoizedState=Pm,Oc(s.child,m)):($s(l),f=s.child,s=f.sibling,f=Kr(f,{mode:"visible",children:m.children}),f.return=l,f.sibling=null,s!==null&&(D=l.deletions,D===null?(l.deletions=[s],l.flags|=16):D.push(s)),l.child=f,l.memoizedState=null,f)}function Um(s,l){return l=Wd({mode:"visible",children:l},s.mode),l.return=s,s.child=l}function Wd(s,l){return s=yi(22,s,null,l),s.lanes=0,s}function Fm(s,l,f){return Ua(l,s.child,null,f),s=Um(l,l.pendingProps.children),s.flags|=2,l.memoizedState=null,s}function E1(s,l,f){s.lanes|=l;var m=s.alternate;m!==null&&(m.lanes|=l),im(s.return,l,f)}function qm(s,l,f,m,x,E){var D=s.memoizedState;D===null?s.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:m,tail:f,tailMode:x,treeForkCount:E}:(D.isBackwards=l,D.rendering=null,D.renderingStartTime=0,D.last=m,D.tail=f,D.tailMode=x,D.treeForkCount=E)}function S1(s,l,f){var m=l.pendingProps,x=m.revealOrder,E=m.tail;m=m.children;var D=yn.current,q=(D&2)!==0;if(q?(D=D&1|2,l.flags|=128):D&=1,z(yn,D),Pn(s,l,m,f),m=wt?vc:0,!q&&s!==null&&(s.flags&128)!==0)e:for(s=l.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&E1(s,f,l);else if(s.tag===19)E1(s,f,l);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===l)break e;for(;s.sibling===null;){if(s.return===null||s.return===l)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}switch(x){case"forwards":for(f=l.child,x=null;f!==null;)s=f.alternate,s!==null&&Id(s)===null&&(x=f),f=f.sibling;f=x,f===null?(x=l.child,l.child=null):(x=f.sibling,f.sibling=null),qm(l,!1,x,f,E,m);break;case"backwards":case"unstable_legacy-backwards":for(f=null,x=l.child,l.child=null;x!==null;){if(s=x.alternate,s!==null&&Id(s)===null){l.child=x;break}s=x.sibling,x.sibling=f,f=x,x=s}qm(l,!0,f,null,E,m);break;case"together":qm(l,!1,null,null,void 0,m);break;default:l.memoizedState=null}return l.child}function Xr(s,l,f){if(s!==null&&(l.dependencies=s.dependencies),Hs|=l.lanes,(f&l.childLanes)===0)if(s!==null){if($l(s,l,f,!1),(f&l.childLanes)===0)return null}else return null;if(s!==null&&l.child!==s.child)throw Error(i(153));if(l.child!==null){for(s=l.child,f=Kr(s,s.pendingProps),l.child=f,f.return=l;s.sibling!==null;)s=s.sibling,f=f.sibling=Kr(s,s.pendingProps),f.return=l;f.sibling=null}return l.child}function Hm(s,l){return(s.lanes&l)!==0?!0:(s=s.dependencies,!!(s!==null&&Ad(s)))}function nD(s,l,f){switch(l.tag){case 3:re(l,l.stateNode.containerInfo),zs(l,vn,s.memoizedState.cache),La();break;case 27:case 5:se(l);break;case 4:re(l,l.stateNode.containerInfo);break;case 10:zs(l,l.type,l.memoizedProps.value);break;case 31:if(l.memoizedState!==null)return l.flags|=128,mm(l),null;break;case 13:var m=l.memoizedState;if(m!==null)return m.dehydrated!==null?($s(l),l.flags|=128,null):(f&l.child.childLanes)!==0?k1(s,l,f):($s(l),s=Xr(s,l,f),s!==null?s.sibling:null);$s(l);break;case 19:var x=(s.flags&128)!==0;if(m=(f&l.childLanes)!==0,m||($l(s,l,f,!1),m=(f&l.childLanes)!==0),x){if(m)return S1(s,l,f);l.flags|=128}if(x=l.memoizedState,x!==null&&(x.rendering=null,x.tail=null,x.lastEffect=null),z(yn,yn.current),m)break;return null;case 22:return l.lanes=0,g1(s,l,f,l.pendingProps);case 24:zs(l,vn,s.memoizedState.cache)}return Xr(s,l,f)}function N1(s,l,f){if(s!==null)if(s.memoizedProps!==l.pendingProps)kn=!0;else{if(!Hm(s,f)&&(l.flags&128)===0)return kn=!1,nD(s,l,f);kn=(s.flags&131072)!==0}else kn=!1,wt&&(l.flags&1048576)!==0&&iv(l,vc,l.index);switch(l.lanes=0,l.tag){case 16:e:{var m=l.pendingProps;if(s=Ba(l.elementType),l.type=s,typeof s=="function")Wp(s)?(m=qa(s,m),l.tag=1,l=v1(null,l,s,m,f)):(l.tag=0,l=Im(null,l,s,m,f));else{if(s!=null){var x=s.$$typeof;if(x===_){l.tag=11,l=h1(null,l,s,m,f);break e}else if(x===R){l.tag=14,l=p1(null,l,s,m,f);break e}}throw l=M(s)||s,Error(i(306,l,""))}}return l;case 0:return Im(s,l,l.type,l.pendingProps,f);case 1:return m=l.type,x=qa(m,l.pendingProps),v1(s,l,m,x,f);case 3:e:{if(re(l,l.stateNode.containerInfo),s===null)throw Error(i(387));m=l.pendingProps;var E=l.memoizedState;x=E.element,um(s,l),Cc(l,m,null,f);var D=l.memoizedState;if(m=D.cache,zs(l,vn,m),m!==E.cache&&rm(l,[vn],f,!0),jc(),m=D.element,E.isDehydrated)if(E={element:m,isDehydrated:!1,cache:D.cache},l.updateQueue.baseState=E,l.memoizedState=E,l.flags&256){l=w1(s,l,m,f);break e}else if(m!==x){x=Oi(Error(i(424)),l),wc(x),l=w1(s,l,m,f);break e}else{switch(s=l.stateNode.containerInfo,s.nodeType){case 9:s=s.body;break;default:s=s.nodeName==="HTML"?s.ownerDocument.body:s}for(Qt=Pi(s.firstChild),zn=l,wt=!0,Rs=null,zi=!0,f=gv(l,null,m,f),l.child=f;f;)f.flags=f.flags&-3|4096,f=f.sibling}else{if(La(),m===x){l=Xr(s,l,f);break e}Pn(s,l,m,f)}l=l.child}return l;case 26:return Yd(s,l),s===null?(f=zw(l.type,null,l.pendingProps,null))?l.memoizedState=f:wt||(f=l.type,s=l.pendingProps,m=ff(ye.current).createElement(f),m[sn]=l,m[Tn]=s,Bn(m,f,s),hn(m),l.stateNode=m):l.memoizedState=zw(l.type,s.memoizedProps,l.pendingProps,s.memoizedState),null;case 27:return se(l),s===null&&wt&&(m=l.stateNode=Ow(l.type,l.pendingProps,ye.current),zn=l,zi=!0,x=Qt,Ws(l.type)?(Eg=x,Qt=Pi(m.firstChild)):Qt=x),Pn(s,l,l.pendingProps.children,f),Yd(s,l),s===null&&(l.flags|=4194304),l.child;case 5:return s===null&&wt&&((x=m=Qt)&&(m=DD(m,l.type,l.pendingProps,zi),m!==null?(l.stateNode=m,zn=l,Qt=Pi(m.firstChild),zi=!1,x=!0):x=!1),x||Ls(l)),se(l),x=l.type,E=l.pendingProps,D=s!==null?s.memoizedProps:null,m=E.children,bg(x,E)?m=null:D!==null&&bg(x,D)&&(l.flags|=32),l.memoizedState!==null&&(x=ym(s,l,VM,null,null,f),Yc._currentValue=x),Yd(s,l),Pn(s,l,m,f),l.child;case 6:return s===null&&wt&&((s=f=Qt)&&(f=OD(f,l.pendingProps,zi),f!==null?(l.stateNode=f,zn=l,Qt=null,s=!0):s=!1),s||Ls(l)),null;case 13:return k1(s,l,f);case 4:return re(l,l.stateNode.containerInfo),m=l.pendingProps,s===null?l.child=Ua(l,null,m,f):Pn(s,l,m,f),l.child;case 11:return h1(s,l,l.type,l.pendingProps,f);case 7:return Pn(s,l,l.pendingProps,f),l.child;case 8:return Pn(s,l,l.pendingProps.children,f),l.child;case 12:return Pn(s,l,l.pendingProps.children,f),l.child;case 10:return m=l.pendingProps,zs(l,l.type,m.value),Pn(s,l,m.children,f),l.child;case 9:return x=l.type._context,m=l.pendingProps.children,Ia(l),x=In(x),m=m(x),l.flags|=1,Pn(s,l,m,f),l.child;case 14:return p1(s,l,l.type,l.pendingProps,f);case 15:return m1(s,l,l.type,l.pendingProps,f);case 19:return S1(s,l,f);case 31:return tD(s,l,f);case 22:return g1(s,l,f,l.pendingProps);case 24:return Ia(l),m=In(vn),s===null?(x=lm(),x===null&&(x=Ht,E=sm(),x.pooledCache=E,E.refCount++,E!==null&&(x.pooledCacheLanes|=f),x=E),l.memoizedState={parent:m,cache:x},cm(l),zs(l,vn,x)):((s.lanes&f)!==0&&(um(s,l),Cc(l,null,null,f),jc()),x=s.memoizedState,E=l.memoizedState,x.parent!==m?(x={parent:m,cache:m},l.memoizedState=x,l.lanes===0&&(l.memoizedState=l.updateQueue.baseState=x),zs(l,vn,m)):(m=E.cache,zs(l,vn,m),m!==x.cache&&rm(l,[vn],f,!0))),Pn(s,l,l.pendingProps.children,f),l.child;case 29:throw l.pendingProps}throw Error(i(156,l.tag))}function Zr(s){s.flags|=4}function Km(s,l,f,m,x){if((l=(s.mode&32)!==0)&&(l=!1),l){if(s.flags|=16777216,(x&335544128)===x)if(s.stateNode.complete)s.flags|=8192;else if(Z1())s.flags|=8192;else throw $a=Od,om}else s.flags&=-16777217}function _1(s,l){if(l.type!=="stylesheet"||(l.state.loading&4)!==0)s.flags&=-16777217;else if(s.flags|=16777216,!Uw(l))if(Z1())s.flags|=8192;else throw $a=Od,om}function Qd(s,l){l!==null&&(s.flags|=4),s.flags&16384&&(l=s.tag!==22?it():536870912,s.lanes|=l,Zl|=l)}function Rc(s,l){if(!wt)switch(s.tailMode){case"hidden":l=s.tail;for(var f=null;l!==null;)l.alternate!==null&&(f=l),l=l.sibling;f===null?s.tail=null:f.sibling=null;break;case"collapsed":f=s.tail;for(var m=null;f!==null;)f.alternate!==null&&(m=f),f=f.sibling;m===null?l||s.tail===null?s.tail=null:s.tail.sibling=null:m.sibling=null}}function Xt(s){var l=s.alternate!==null&&s.alternate.child===s.child,f=0,m=0;if(l)for(var x=s.child;x!==null;)f|=x.lanes|x.childLanes,m|=x.subtreeFlags&65011712,m|=x.flags&65011712,x.return=s,x=x.sibling;else for(x=s.child;x!==null;)f|=x.lanes|x.childLanes,m|=x.subtreeFlags,m|=x.flags,x.return=s,x=x.sibling;return s.subtreeFlags|=m,s.childLanes=f,l}function iD(s,l,f){var m=l.pendingProps;switch(Jp(l),l.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Xt(l),null;case 1:return Xt(l),null;case 3:return f=l.stateNode,m=null,s!==null&&(m=s.memoizedState.cache),l.memoizedState.cache!==m&&(l.flags|=2048),Yr(vn),he(),f.pendingContext&&(f.context=f.pendingContext,f.pendingContext=null),(s===null||s.child===null)&&(Bl(l)?Zr(l):s===null||s.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,tm())),Xt(l),null;case 26:var x=l.type,E=l.memoizedState;return s===null?(Zr(l),E!==null?(Xt(l),_1(l,E)):(Xt(l),Km(l,x,null,m,f))):E?E!==s.memoizedState?(Zr(l),Xt(l),_1(l,E)):(Xt(l),l.flags&=-16777217):(s=s.memoizedProps,s!==m&&Zr(l),Xt(l),Km(l,x,s,m,f)),null;case 27:if(J(l),f=ye.current,x=l.type,s!==null&&l.stateNode!=null)s.memoizedProps!==m&&Zr(l);else{if(!m){if(l.stateNode===null)throw Error(i(166));return Xt(l),null}s=te.current,Bl(l)?sv(l):(s=Ow(x,m,f),l.stateNode=s,Zr(l))}return Xt(l),null;case 5:if(J(l),x=l.type,s!==null&&l.stateNode!=null)s.memoizedProps!==m&&Zr(l);else{if(!m){if(l.stateNode===null)throw Error(i(166));return Xt(l),null}if(E=te.current,Bl(l))sv(l);else{var D=ff(ye.current);switch(E){case 1:E=D.createElementNS("http://www.w3.org/2000/svg",x);break;case 2:E=D.createElementNS("http://www.w3.org/1998/Math/MathML",x);break;default:switch(x){case"svg":E=D.createElementNS("http://www.w3.org/2000/svg",x);break;case"math":E=D.createElementNS("http://www.w3.org/1998/Math/MathML",x);break;case"script":E=D.createElement("div"),E.innerHTML="<script><\/script>",E=E.removeChild(E.firstChild);break;case"select":E=typeof m.is=="string"?D.createElement("select",{is:m.is}):D.createElement("select"),m.multiple?E.multiple=!0:m.size&&(E.size=m.size);break;default:E=typeof m.is=="string"?D.createElement(x,{is:m.is}):D.createElement(x)}}E[sn]=l,E[Tn]=m;e:for(D=l.child;D!==null;){if(D.tag===5||D.tag===6)E.appendChild(D.stateNode);else if(D.tag!==4&&D.tag!==27&&D.child!==null){D.child.return=D,D=D.child;continue}if(D===l)break e;for(;D.sibling===null;){if(D.return===null||D.return===l)break e;D=D.return}D.sibling.return=D.return,D=D.sibling}l.stateNode=E;e:switch(Bn(E,x,m),x){case"button":case"input":case"select":case"textarea":m=!!m.autoFocus;break e;case"img":m=!0;break e;default:m=!1}m&&Zr(l)}}return Xt(l),Km(l,l.type,s===null?null:s.memoizedProps,l.pendingProps,f),null;case 6:if(s&&l.stateNode!=null)s.memoizedProps!==m&&Zr(l);else{if(typeof m!="string"&&l.stateNode===null)throw Error(i(166));if(s=ye.current,Bl(l)){if(s=l.stateNode,f=l.memoizedProps,m=null,x=zn,x!==null)switch(x.tag){case 27:case 5:m=x.memoizedProps}s[sn]=l,s=!!(s.nodeValue===f||m!==null&&m.suppressHydrationWarning===!0||kw(s.nodeValue,f)),s||Ls(l,!0)}else s=ff(s).createTextNode(m),s[sn]=l,l.stateNode=s}return Xt(l),null;case 31:if(f=l.memoizedState,s===null||s.memoizedState!==null){if(m=Bl(l),f!==null){if(s===null){if(!m)throw Error(i(318));if(s=l.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(i(557));s[sn]=l}else La(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Xt(l),s=!1}else f=tm(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=f),s=!0;if(!s)return l.flags&256?(xi(l),l):(xi(l),null);if((l.flags&128)!==0)throw Error(i(558))}return Xt(l),null;case 13:if(m=l.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(x=Bl(l),m!==null&&m.dehydrated!==null){if(s===null){if(!x)throw Error(i(318));if(x=l.memoizedState,x=x!==null?x.dehydrated:null,!x)throw Error(i(317));x[sn]=l}else La(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Xt(l),x=!1}else x=tm(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=x),x=!0;if(!x)return l.flags&256?(xi(l),l):(xi(l),null)}return xi(l),(l.flags&128)!==0?(l.lanes=f,l):(f=m!==null,s=s!==null&&s.memoizedState!==null,f&&(m=l.child,x=null,m.alternate!==null&&m.alternate.memoizedState!==null&&m.alternate.memoizedState.cachePool!==null&&(x=m.alternate.memoizedState.cachePool.pool),E=null,m.memoizedState!==null&&m.memoizedState.cachePool!==null&&(E=m.memoizedState.cachePool.pool),E!==x&&(m.flags|=2048)),f!==s&&f&&(l.child.flags|=8192),Qd(l,l.updateQueue),Xt(l),null);case 4:return he(),s===null&&hg(l.stateNode.containerInfo),Xt(l),null;case 10:return Yr(l.type),Xt(l),null;case 19:if(G(yn),m=l.memoizedState,m===null)return Xt(l),null;if(x=(l.flags&128)!==0,E=m.rendering,E===null)if(x)Rc(m,!1);else{if(mn!==0||s!==null&&(s.flags&128)!==0)for(s=l.child;s!==null;){if(E=Id(s),E!==null){for(l.flags|=128,Rc(m,!1),s=E.updateQueue,l.updateQueue=s,Qd(l,s),l.subtreeFlags=0,s=f,f=l.child;f!==null;)ev(f,s),f=f.sibling;return z(yn,yn.current&1|2),wt&&Gr(l,m.treeForkCount),l.child}s=s.sibling}m.tail!==null&&je()>tf&&(l.flags|=128,x=!0,Rc(m,!1),l.lanes=4194304)}else{if(!x)if(s=Id(E),s!==null){if(l.flags|=128,x=!0,s=s.updateQueue,l.updateQueue=s,Qd(l,s),Rc(m,!0),m.tail===null&&m.tailMode==="hidden"&&!E.alternate&&!wt)return Xt(l),null}else 2*je()-m.renderingStartTime>tf&&f!==536870912&&(l.flags|=128,x=!0,Rc(m,!1),l.lanes=4194304);m.isBackwards?(E.sibling=l.child,l.child=E):(s=m.last,s!==null?s.sibling=E:l.child=E,m.last=E)}return m.tail!==null?(s=m.tail,m.rendering=s,m.tail=s.sibling,m.renderingStartTime=je(),s.sibling=null,f=yn.current,z(yn,x?f&1|2:f&1),wt&&Gr(l,m.treeForkCount),s):(Xt(l),null);case 22:case 23:return xi(l),pm(),m=l.memoizedState!==null,s!==null?s.memoizedState!==null!==m&&(l.flags|=8192):m&&(l.flags|=8192),m?(f&536870912)!==0&&(l.flags&128)===0&&(Xt(l),l.subtreeFlags&6&&(l.flags|=8192)):Xt(l),f=l.updateQueue,f!==null&&Qd(l,f.retryQueue),f=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(f=s.memoizedState.cachePool.pool),m=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(m=l.memoizedState.cachePool.pool),m!==f&&(l.flags|=2048),s!==null&&G(Pa),null;case 24:return f=null,s!==null&&(f=s.memoizedState.cache),l.memoizedState.cache!==f&&(l.flags|=2048),Yr(vn),Xt(l),null;case 25:return null;case 30:return null}throw Error(i(156,l.tag))}function rD(s,l){switch(Jp(l),l.tag){case 1:return s=l.flags,s&65536?(l.flags=s&-65537|128,l):null;case 3:return Yr(vn),he(),s=l.flags,(s&65536)!==0&&(s&128)===0?(l.flags=s&-65537|128,l):null;case 26:case 27:case 5:return J(l),null;case 31:if(l.memoizedState!==null){if(xi(l),l.alternate===null)throw Error(i(340));La()}return s=l.flags,s&65536?(l.flags=s&-65537|128,l):null;case 13:if(xi(l),s=l.memoizedState,s!==null&&s.dehydrated!==null){if(l.alternate===null)throw Error(i(340));La()}return s=l.flags,s&65536?(l.flags=s&-65537|128,l):null;case 19:return G(yn),null;case 4:return he(),null;case 10:return Yr(l.type),null;case 22:case 23:return xi(l),pm(),s!==null&&G(Pa),s=l.flags,s&65536?(l.flags=s&-65537|128,l):null;case 24:return Yr(vn),null;case 25:return null;default:return null}}function j1(s,l){switch(Jp(l),l.tag){case 3:Yr(vn),he();break;case 26:case 27:case 5:J(l);break;case 4:he();break;case 31:l.memoizedState!==null&&xi(l);break;case 13:xi(l);break;case 19:G(yn);break;case 10:Yr(l.type);break;case 22:case 23:xi(l),pm(),s!==null&&G(Pa);break;case 24:Yr(vn)}}function Lc(s,l){try{var f=l.updateQueue,m=f!==null?f.lastEffect:null;if(m!==null){var x=m.next;f=x;do{if((f.tag&s)===s){m=void 0;var E=f.create,D=f.inst;m=E(),D.destroy=m}f=f.next}while(f!==x)}}catch(q){zt(l,l.return,q)}}function Fs(s,l,f){try{var m=l.updateQueue,x=m!==null?m.lastEffect:null;if(x!==null){var E=x.next;m=E;do{if((m.tag&s)===s){var D=m.inst,q=D.destroy;if(q!==void 0){D.destroy=void 0,x=l;var Q=f,oe=q;try{oe()}catch(ge){zt(x,Q,ge)}}}m=m.next}while(m!==E)}}catch(ge){zt(l,l.return,ge)}}function C1(s){var l=s.updateQueue;if(l!==null){var f=s.stateNode;try{bv(l,f)}catch(m){zt(s,s.return,m)}}}function A1(s,l,f){f.props=qa(s.type,s.memoizedProps),f.state=s.memoizedState;try{f.componentWillUnmount()}catch(m){zt(s,l,m)}}function zc(s,l){try{var f=s.ref;if(f!==null){switch(s.tag){case 26:case 27:case 5:var m=s.stateNode;break;case 30:m=s.stateNode;break;default:m=s.stateNode}typeof f=="function"?s.refCleanup=f(m):f.current=m}}catch(x){zt(s,l,x)}}function Er(s,l){var f=s.ref,m=s.refCleanup;if(f!==null)if(typeof m=="function")try{m()}catch(x){zt(s,l,x)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof f=="function")try{f(null)}catch(x){zt(s,l,x)}else f.current=null}function T1(s){var l=s.type,f=s.memoizedProps,m=s.stateNode;try{e:switch(l){case"button":case"input":case"select":case"textarea":f.autoFocus&&m.focus();break e;case"img":f.src?m.src=f.src:f.srcSet&&(m.srcset=f.srcSet)}}catch(x){zt(s,s.return,x)}}function Gm(s,l,f){try{var m=s.stateNode;_D(m,s.type,f,l),m[Tn]=l}catch(x){zt(s,s.return,x)}}function M1(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&Ws(s.type)||s.tag===4}function Vm(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||M1(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.tag===27&&Ws(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function Ym(s,l,f){var m=s.tag;if(m===5||m===6)s=s.stateNode,l?(f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f).insertBefore(s,l):(l=f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f,l.appendChild(s),f=f._reactRootContainer,f!=null||l.onclick!==null||(l.onclick=De));else if(m!==4&&(m===27&&Ws(s.type)&&(f=s.stateNode,l=null),s=s.child,s!==null))for(Ym(s,l,f),s=s.sibling;s!==null;)Ym(s,l,f),s=s.sibling}function Xd(s,l,f){var m=s.tag;if(m===5||m===6)s=s.stateNode,l?f.insertBefore(s,l):f.appendChild(s);else if(m!==4&&(m===27&&Ws(s.type)&&(f=s.stateNode),s=s.child,s!==null))for(Xd(s,l,f),s=s.sibling;s!==null;)Xd(s,l,f),s=s.sibling}function D1(s){var l=s.stateNode,f=s.memoizedProps;try{for(var m=s.type,x=l.attributes;x.length;)l.removeAttributeNode(x[0]);Bn(l,m,f),l[sn]=s,l[Tn]=f}catch(E){zt(s,s.return,E)}}var Jr=!1,En=!1,Wm=!1,O1=typeof WeakSet=="function"?WeakSet:Set,Dn=null;function sD(s,l){if(s=s.containerInfo,gg=xf,s=K0(s),Fp(s)){if("selectionStart"in s)var f={start:s.selectionStart,end:s.selectionEnd};else e:{f=(f=s.ownerDocument)&&f.defaultView||window;var m=f.getSelection&&f.getSelection();if(m&&m.rangeCount!==0){f=m.anchorNode;var x=m.anchorOffset,E=m.focusNode;m=m.focusOffset;try{f.nodeType,E.nodeType}catch{f=null;break e}var D=0,q=-1,Q=-1,oe=0,ge=0,Ee=s,ce=null;t:for(;;){for(var fe;Ee!==f||x!==0&&Ee.nodeType!==3||(q=D+x),Ee!==E||m!==0&&Ee.nodeType!==3||(Q=D+m),Ee.nodeType===3&&(D+=Ee.nodeValue.length),(fe=Ee.firstChild)!==null;)ce=Ee,Ee=fe;for(;;){if(Ee===s)break t;if(ce===f&&++oe===x&&(q=D),ce===E&&++ge===m&&(Q=D),(fe=Ee.nextSibling)!==null)break;Ee=ce,ce=Ee.parentNode}Ee=fe}f=q===-1||Q===-1?null:{start:q,end:Q}}else f=null}f=f||{start:0,end:0}}else f=null;for(yg={focusedElem:s,selectionRange:f},xf=!1,Dn=l;Dn!==null;)if(l=Dn,s=l.child,(l.subtreeFlags&1028)!==0&&s!==null)s.return=l,Dn=s;else for(;Dn!==null;){switch(l=Dn,E=l.alternate,s=l.flags,l.tag){case 0:if((s&4)!==0&&(s=l.updateQueue,s=s!==null?s.events:null,s!==null))for(f=0;f<s.length;f++)x=s[f],x.ref.impl=x.nextImpl;break;case 11:case 15:break;case 1:if((s&1024)!==0&&E!==null){s=void 0,f=l,x=E.memoizedProps,E=E.memoizedState,m=f.stateNode;try{var Be=qa(f.type,x);s=m.getSnapshotBeforeUpdate(Be,E),m.__reactInternalSnapshotBeforeUpdate=s}catch(tt){zt(f,f.return,tt)}}break;case 3:if((s&1024)!==0){if(s=l.stateNode.containerInfo,f=s.nodeType,f===9)vg(s);else if(f===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":vg(s);break;default:s.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((s&1024)!==0)throw Error(i(163))}if(s=l.sibling,s!==null){s.return=l.return,Dn=s;break}Dn=l.return}}function R1(s,l,f){var m=f.flags;switch(f.tag){case 0:case 11:case 15:ts(s,f),m&4&&Lc(5,f);break;case 1:if(ts(s,f),m&4)if(s=f.stateNode,l===null)try{s.componentDidMount()}catch(D){zt(f,f.return,D)}else{var x=qa(f.type,l.memoizedProps);l=l.memoizedState;try{s.componentDidUpdate(x,l,s.__reactInternalSnapshotBeforeUpdate)}catch(D){zt(f,f.return,D)}}m&64&&C1(f),m&512&&zc(f,f.return);break;case 3:if(ts(s,f),m&64&&(s=f.updateQueue,s!==null)){if(l=null,f.child!==null)switch(f.child.tag){case 27:case 5:l=f.child.stateNode;break;case 1:l=f.child.stateNode}try{bv(s,l)}catch(D){zt(f,f.return,D)}}break;case 27:l===null&&m&4&&D1(f);case 26:case 5:ts(s,f),l===null&&m&4&&T1(f),m&512&&zc(f,f.return);break;case 12:ts(s,f);break;case 31:ts(s,f),m&4&&I1(s,f);break;case 13:ts(s,f),m&4&&P1(s,f),m&64&&(s=f.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&(f=pD.bind(null,f),RD(s,f))));break;case 22:if(m=f.memoizedState!==null||Jr,!m){l=l!==null&&l.memoizedState!==null||En,x=Jr;var E=En;Jr=m,(En=l)&&!E?ns(s,f,(f.subtreeFlags&8772)!==0):ts(s,f),Jr=x,En=E}break;case 30:break;default:ts(s,f)}}function L1(s){var l=s.alternate;l!==null&&(s.alternate=null,L1(l)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(l=s.stateNode,l!==null&&ja(l)),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}var Zt=null,ri=!1;function es(s,l,f){for(f=f.child;f!==null;)z1(s,l,f),f=f.sibling}function z1(s,l,f){if(Mt&&typeof Mt.onCommitFiberUnmount=="function")try{Mt.onCommitFiberUnmount(fn,f)}catch{}switch(f.tag){case 26:En||Er(f,l),es(s,l,f),f.memoizedState?f.memoizedState.count--:f.stateNode&&(f=f.stateNode,f.parentNode.removeChild(f));break;case 27:En||Er(f,l);var m=Zt,x=ri;Ws(f.type)&&(Zt=f.stateNode,ri=!1),es(s,l,f),Kc(f.stateNode),Zt=m,ri=x;break;case 5:En||Er(f,l);case 6:if(m=Zt,x=ri,Zt=null,es(s,l,f),Zt=m,ri=x,Zt!==null)if(ri)try{(Zt.nodeType===9?Zt.body:Zt.nodeName==="HTML"?Zt.ownerDocument.body:Zt).removeChild(f.stateNode)}catch(E){zt(f,l,E)}else try{Zt.removeChild(f.stateNode)}catch(E){zt(f,l,E)}break;case 18:Zt!==null&&(ri?(s=Zt,Cw(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,f.stateNode),ao(s)):Cw(Zt,f.stateNode));break;case 4:m=Zt,x=ri,Zt=f.stateNode.containerInfo,ri=!0,es(s,l,f),Zt=m,ri=x;break;case 0:case 11:case 14:case 15:Fs(2,f,l),En||Fs(4,f,l),es(s,l,f);break;case 1:En||(Er(f,l),m=f.stateNode,typeof m.componentWillUnmount=="function"&&A1(f,l,m)),es(s,l,f);break;case 21:es(s,l,f);break;case 22:En=(m=En)||f.memoizedState!==null,es(s,l,f),En=m;break;default:es(s,l,f)}}function I1(s,l){if(l.memoizedState===null&&(s=l.alternate,s!==null&&(s=s.memoizedState,s!==null))){s=s.dehydrated;try{ao(s)}catch(f){zt(l,l.return,f)}}}function P1(s,l){if(l.memoizedState===null&&(s=l.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{ao(s)}catch(f){zt(l,l.return,f)}}function aD(s){switch(s.tag){case 31:case 13:case 19:var l=s.stateNode;return l===null&&(l=s.stateNode=new O1),l;case 22:return s=s.stateNode,l=s._retryCache,l===null&&(l=s._retryCache=new O1),l;default:throw Error(i(435,s.tag))}}function Zd(s,l){var f=aD(s);l.forEach(function(m){if(!f.has(m)){f.add(m);var x=mD.bind(null,s,m);m.then(x,x)}})}function si(s,l){var f=l.deletions;if(f!==null)for(var m=0;m<f.length;m++){var x=f[m],E=s,D=l,q=D;e:for(;q!==null;){switch(q.tag){case 27:if(Ws(q.type)){Zt=q.stateNode,ri=!1;break e}break;case 5:Zt=q.stateNode,ri=!1;break e;case 3:case 4:Zt=q.stateNode.containerInfo,ri=!0;break e}q=q.return}if(Zt===null)throw Error(i(160));z1(E,D,x),Zt=null,ri=!1,E=x.alternate,E!==null&&(E.return=null),x.return=null}if(l.subtreeFlags&13886)for(l=l.child;l!==null;)B1(l,s),l=l.sibling}var tr=null;function B1(s,l){var f=s.alternate,m=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:si(l,s),ai(s),m&4&&(Fs(3,s,s.return),Lc(3,s),Fs(5,s,s.return));break;case 1:si(l,s),ai(s),m&512&&(En||f===null||Er(f,f.return)),m&64&&Jr&&(s=s.updateQueue,s!==null&&(m=s.callbacks,m!==null&&(f=s.shared.hiddenCallbacks,s.shared.hiddenCallbacks=f===null?m:f.concat(m))));break;case 26:var x=tr;if(si(l,s),ai(s),m&512&&(En||f===null||Er(f,f.return)),m&4){var E=f!==null?f.memoizedState:null;if(m=s.memoizedState,f===null)if(m===null)if(s.stateNode===null){e:{m=s.type,f=s.memoizedProps,x=x.ownerDocument||x;t:switch(m){case"title":E=x.getElementsByTagName("title")[0],(!E||E[Ur]||E[sn]||E.namespaceURI==="http://www.w3.org/2000/svg"||E.hasAttribute("itemprop"))&&(E=x.createElement(m),x.head.insertBefore(E,x.querySelector("head > title"))),Bn(E,m,f),E[sn]=s,hn(E),m=E;break e;case"link":var D=Bw("link","href",x).get(m+(f.href||""));if(D){for(var q=0;q<D.length;q++)if(E=D[q],E.getAttribute("href")===(f.href==null||f.href===""?null:f.href)&&E.getAttribute("rel")===(f.rel==null?null:f.rel)&&E.getAttribute("title")===(f.title==null?null:f.title)&&E.getAttribute("crossorigin")===(f.crossOrigin==null?null:f.crossOrigin)){D.splice(q,1);break t}}E=x.createElement(m),Bn(E,m,f),x.head.appendChild(E);break;case"meta":if(D=Bw("meta","content",x).get(m+(f.content||""))){for(q=0;q<D.length;q++)if(E=D[q],E.getAttribute("content")===(f.content==null?null:""+f.content)&&E.getAttribute("name")===(f.name==null?null:f.name)&&E.getAttribute("property")===(f.property==null?null:f.property)&&E.getAttribute("http-equiv")===(f.httpEquiv==null?null:f.httpEquiv)&&E.getAttribute("charset")===(f.charSet==null?null:f.charSet)){D.splice(q,1);break t}}E=x.createElement(m),Bn(E,m,f),x.head.appendChild(E);break;default:throw Error(i(468,m))}E[sn]=s,hn(E),m=E}s.stateNode=m}else $w(x,s.type,s.stateNode);else s.stateNode=Pw(x,m,s.memoizedProps);else E!==m?(E===null?f.stateNode!==null&&(f=f.stateNode,f.parentNode.removeChild(f)):E.count--,m===null?$w(x,s.type,s.stateNode):Pw(x,m,s.memoizedProps)):m===null&&s.stateNode!==null&&Gm(s,s.memoizedProps,f.memoizedProps)}break;case 27:si(l,s),ai(s),m&512&&(En||f===null||Er(f,f.return)),f!==null&&m&4&&Gm(s,s.memoizedProps,f.memoizedProps);break;case 5:if(si(l,s),ai(s),m&512&&(En||f===null||Er(f,f.return)),s.flags&32){x=s.stateNode;try{nt(x,"")}catch(Be){zt(s,s.return,Be)}}m&4&&s.stateNode!=null&&(x=s.memoizedProps,Gm(s,x,f!==null?f.memoizedProps:x)),m&1024&&(Wm=!0);break;case 6:if(si(l,s),ai(s),m&4){if(s.stateNode===null)throw Error(i(162));m=s.memoizedProps,f=s.stateNode;try{f.nodeValue=m}catch(Be){zt(s,s.return,Be)}}break;case 3:if(mf=null,x=tr,tr=hf(l.containerInfo),si(l,s),tr=x,ai(s),m&4&&f!==null&&f.memoizedState.isDehydrated)try{ao(l.containerInfo)}catch(Be){zt(s,s.return,Be)}Wm&&(Wm=!1,$1(s));break;case 4:m=tr,tr=hf(s.stateNode.containerInfo),si(l,s),ai(s),tr=m;break;case 12:si(l,s),ai(s);break;case 31:si(l,s),ai(s),m&4&&(m=s.updateQueue,m!==null&&(s.updateQueue=null,Zd(s,m)));break;case 13:si(l,s),ai(s),s.child.flags&8192&&s.memoizedState!==null!=(f!==null&&f.memoizedState!==null)&&(ef=je()),m&4&&(m=s.updateQueue,m!==null&&(s.updateQueue=null,Zd(s,m)));break;case 22:x=s.memoizedState!==null;var Q=f!==null&&f.memoizedState!==null,oe=Jr,ge=En;if(Jr=oe||x,En=ge||Q,si(l,s),En=ge,Jr=oe,ai(s),m&8192)e:for(l=s.stateNode,l._visibility=x?l._visibility&-2:l._visibility|1,x&&(f===null||Q||Jr||En||Ha(s)),f=null,l=s;;){if(l.tag===5||l.tag===26){if(f===null){Q=f=l;try{if(E=Q.stateNode,x)D=E.style,typeof D.setProperty=="function"?D.setProperty("display","none","important"):D.display="none";else{q=Q.stateNode;var Ee=Q.memoizedProps.style,ce=Ee!=null&&Ee.hasOwnProperty("display")?Ee.display:null;q.style.display=ce==null||typeof ce=="boolean"?"":(""+ce).trim()}}catch(Be){zt(Q,Q.return,Be)}}}else if(l.tag===6){if(f===null){Q=l;try{Q.stateNode.nodeValue=x?"":Q.memoizedProps}catch(Be){zt(Q,Q.return,Be)}}}else if(l.tag===18){if(f===null){Q=l;try{var fe=Q.stateNode;x?Aw(fe,!0):Aw(Q.stateNode,!1)}catch(Be){zt(Q,Q.return,Be)}}}else if((l.tag!==22&&l.tag!==23||l.memoizedState===null||l===s)&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===s)break e;for(;l.sibling===null;){if(l.return===null||l.return===s)break e;f===l&&(f=null),l=l.return}f===l&&(f=null),l.sibling.return=l.return,l=l.sibling}m&4&&(m=s.updateQueue,m!==null&&(f=m.retryQueue,f!==null&&(m.retryQueue=null,Zd(s,f))));break;case 19:si(l,s),ai(s),m&4&&(m=s.updateQueue,m!==null&&(s.updateQueue=null,Zd(s,m)));break;case 30:break;case 21:break;default:si(l,s),ai(s)}}function ai(s){var l=s.flags;if(l&2){try{for(var f,m=s.return;m!==null;){if(M1(m)){f=m;break}m=m.return}if(f==null)throw Error(i(160));switch(f.tag){case 27:var x=f.stateNode,E=Vm(s);Xd(s,E,x);break;case 5:var D=f.stateNode;f.flags&32&&(nt(D,""),f.flags&=-33);var q=Vm(s);Xd(s,q,D);break;case 3:case 4:var Q=f.stateNode.containerInfo,oe=Vm(s);Ym(s,oe,Q);break;default:throw Error(i(161))}}catch(ge){zt(s,s.return,ge)}s.flags&=-3}l&4096&&(s.flags&=-4097)}function $1(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var l=s;$1(l),l.tag===5&&l.flags&1024&&l.stateNode.reset(),s=s.sibling}}function ts(s,l){if(l.subtreeFlags&8772)for(l=l.child;l!==null;)R1(s,l.alternate,l),l=l.sibling}function Ha(s){for(s=s.child;s!==null;){var l=s;switch(l.tag){case 0:case 11:case 14:case 15:Fs(4,l,l.return),Ha(l);break;case 1:Er(l,l.return);var f=l.stateNode;typeof f.componentWillUnmount=="function"&&A1(l,l.return,f),Ha(l);break;case 27:Kc(l.stateNode);case 26:case 5:Er(l,l.return),Ha(l);break;case 22:l.memoizedState===null&&Ha(l);break;case 30:Ha(l);break;default:Ha(l)}s=s.sibling}}function ns(s,l,f){for(f=f&&(l.subtreeFlags&8772)!==0,l=l.child;l!==null;){var m=l.alternate,x=s,E=l,D=E.flags;switch(E.tag){case 0:case 11:case 15:ns(x,E,f),Lc(4,E);break;case 1:if(ns(x,E,f),m=E,x=m.stateNode,typeof x.componentDidMount=="function")try{x.componentDidMount()}catch(oe){zt(m,m.return,oe)}if(m=E,x=m.updateQueue,x!==null){var q=m.stateNode;try{var Q=x.shared.hiddenCallbacks;if(Q!==null)for(x.shared.hiddenCallbacks=null,x=0;x<Q.length;x++)yv(Q[x],q)}catch(oe){zt(m,m.return,oe)}}f&&D&64&&C1(E),zc(E,E.return);break;case 27:D1(E);case 26:case 5:ns(x,E,f),f&&m===null&&D&4&&T1(E),zc(E,E.return);break;case 12:ns(x,E,f);break;case 31:ns(x,E,f),f&&D&4&&I1(x,E);break;case 13:ns(x,E,f),f&&D&4&&P1(x,E);break;case 22:E.memoizedState===null&&ns(x,E,f),zc(E,E.return);break;case 30:break;default:ns(x,E,f)}l=l.sibling}}function Qm(s,l){var f=null;s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(f=s.memoizedState.cachePool.pool),s=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(s=l.memoizedState.cachePool.pool),s!==f&&(s!=null&&s.refCount++,f!=null&&kc(f))}function Xm(s,l){s=null,l.alternate!==null&&(s=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==s&&(l.refCount++,s!=null&&kc(s))}function nr(s,l,f,m){if(l.subtreeFlags&10256)for(l=l.child;l!==null;)U1(s,l,f,m),l=l.sibling}function U1(s,l,f,m){var x=l.flags;switch(l.tag){case 0:case 11:case 15:nr(s,l,f,m),x&2048&&Lc(9,l);break;case 1:nr(s,l,f,m);break;case 3:nr(s,l,f,m),x&2048&&(s=null,l.alternate!==null&&(s=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==s&&(l.refCount++,s!=null&&kc(s)));break;case 12:if(x&2048){nr(s,l,f,m),s=l.stateNode;try{var E=l.memoizedProps,D=E.id,q=E.onPostCommit;typeof q=="function"&&q(D,l.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(Q){zt(l,l.return,Q)}}else nr(s,l,f,m);break;case 31:nr(s,l,f,m);break;case 13:nr(s,l,f,m);break;case 23:break;case 22:E=l.stateNode,D=l.alternate,l.memoizedState!==null?E._visibility&2?nr(s,l,f,m):Ic(s,l):E._visibility&2?nr(s,l,f,m):(E._visibility|=2,Wl(s,l,f,m,(l.subtreeFlags&10256)!==0||!1)),x&2048&&Qm(D,l);break;case 24:nr(s,l,f,m),x&2048&&Xm(l.alternate,l);break;default:nr(s,l,f,m)}}function Wl(s,l,f,m,x){for(x=x&&((l.subtreeFlags&10256)!==0||!1),l=l.child;l!==null;){var E=s,D=l,q=f,Q=m,oe=D.flags;switch(D.tag){case 0:case 11:case 15:Wl(E,D,q,Q,x),Lc(8,D);break;case 23:break;case 22:var ge=D.stateNode;D.memoizedState!==null?ge._visibility&2?Wl(E,D,q,Q,x):Ic(E,D):(ge._visibility|=2,Wl(E,D,q,Q,x)),x&&oe&2048&&Qm(D.alternate,D);break;case 24:Wl(E,D,q,Q,x),x&&oe&2048&&Xm(D.alternate,D);break;default:Wl(E,D,q,Q,x)}l=l.sibling}}function Ic(s,l){if(l.subtreeFlags&10256)for(l=l.child;l!==null;){var f=s,m=l,x=m.flags;switch(m.tag){case 22:Ic(f,m),x&2048&&Qm(m.alternate,m);break;case 24:Ic(f,m),x&2048&&Xm(m.alternate,m);break;default:Ic(f,m)}l=l.sibling}}var Pc=8192;function Ql(s,l,f){if(s.subtreeFlags&Pc)for(s=s.child;s!==null;)F1(s,l,f),s=s.sibling}function F1(s,l,f){switch(s.tag){case 26:Ql(s,l,f),s.flags&Pc&&s.memoizedState!==null&&GD(f,tr,s.memoizedState,s.memoizedProps);break;case 5:Ql(s,l,f);break;case 3:case 4:var m=tr;tr=hf(s.stateNode.containerInfo),Ql(s,l,f),tr=m;break;case 22:s.memoizedState===null&&(m=s.alternate,m!==null&&m.memoizedState!==null?(m=Pc,Pc=16777216,Ql(s,l,f),Pc=m):Ql(s,l,f));break;default:Ql(s,l,f)}}function q1(s){var l=s.alternate;if(l!==null&&(s=l.child,s!==null)){l.child=null;do l=s.sibling,s.sibling=null,s=l;while(s!==null)}}function Bc(s){var l=s.deletions;if((s.flags&16)!==0){if(l!==null)for(var f=0;f<l.length;f++){var m=l[f];Dn=m,K1(m,s)}q1(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)H1(s),s=s.sibling}function H1(s){switch(s.tag){case 0:case 11:case 15:Bc(s),s.flags&2048&&Fs(9,s,s.return);break;case 3:Bc(s);break;case 12:Bc(s);break;case 22:var l=s.stateNode;s.memoizedState!==null&&l._visibility&2&&(s.return===null||s.return.tag!==13)?(l._visibility&=-3,Jd(s)):Bc(s);break;default:Bc(s)}}function Jd(s){var l=s.deletions;if((s.flags&16)!==0){if(l!==null)for(var f=0;f<l.length;f++){var m=l[f];Dn=m,K1(m,s)}q1(s)}for(s=s.child;s!==null;){switch(l=s,l.tag){case 0:case 11:case 15:Fs(8,l,l.return),Jd(l);break;case 22:f=l.stateNode,f._visibility&2&&(f._visibility&=-3,Jd(l));break;default:Jd(l)}s=s.sibling}}function K1(s,l){for(;Dn!==null;){var f=Dn;switch(f.tag){case 0:case 11:case 15:Fs(8,f,l);break;case 23:case 22:if(f.memoizedState!==null&&f.memoizedState.cachePool!==null){var m=f.memoizedState.cachePool.pool;m!=null&&m.refCount++}break;case 24:kc(f.memoizedState.cache)}if(m=f.child,m!==null)m.return=f,Dn=m;else e:for(f=s;Dn!==null;){m=Dn;var x=m.sibling,E=m.return;if(L1(m),m===f){Dn=null;break e}if(x!==null){x.return=E,Dn=x;break e}Dn=E}}}var lD={getCacheForType:function(s){var l=In(vn),f=l.data.get(s);return f===void 0&&(f=s(),l.data.set(s,f)),f},cacheSignal:function(){return In(vn).controller.signal}},oD=typeof WeakMap=="function"?WeakMap:Map,Tt=0,Ht=null,pt=null,xt=0,Lt=0,vi=null,qs=!1,Xl=!1,Zm=!1,is=0,mn=0,Hs=0,Ka=0,Jm=0,wi=0,Zl=0,$c=null,li=null,eg=!1,ef=0,G1=0,tf=1/0,nf=null,Ks=null,Cn=0,Gs=null,Jl=null,rs=0,tg=0,ng=null,V1=null,Uc=0,ig=null;function ki(){return(Tt&2)!==0&&xt!==0?xt&-xt:$.T!==null?cg():Es()}function Y1(){if(wi===0)if((xt&536870912)===0||wt){var s=ks;ks<<=1,(ks&3932160)===0&&(ks=262144),wi=s}else wi=536870912;return s=bi.current,s!==null&&(s.flags|=32),wi}function oi(s,l,f){(s===Ht&&(Lt===2||Lt===9)||s.cancelPendingCommit!==null)&&(eo(s,0),Vs(s,xt,wi,!1)),Ot(s,f),((Tt&2)===0||s!==Ht)&&(s===Ht&&((Tt&2)===0&&(Ka|=f),mn===4&&Vs(s,xt,wi,!1)),Sr(s))}function W1(s,l,f){if((Tt&6)!==0)throw Error(i(327));var m=!f&&(l&127)===0&&(l&s.expiredLanes)===0||be(s,l),x=m?dD(s,l):sg(s,l,!0),E=m;do{if(x===0){Xl&&!m&&Vs(s,l,0,!1);break}else{if(f=s.current.alternate,E&&!cD(f)){x=sg(s,l,!1),E=!1;continue}if(x===2){if(E=l,s.errorRecoveryDisabledLanes&E)var D=0;else D=s.pendingLanes&-536870913,D=D!==0?D:D&536870912?536870912:0;if(D!==0){l=D;e:{var q=s;x=$c;var Q=q.current.memoizedState.isDehydrated;if(Q&&(eo(q,D).flags|=256),D=sg(q,D,!1),D!==2){if(Zm&&!Q){q.errorRecoveryDisabledLanes|=E,Ka|=E,x=4;break e}E=li,li=x,E!==null&&(li===null?li=E:li.push.apply(li,E))}x=D}if(E=!1,x!==2)continue}}if(x===1){eo(s,0),Vs(s,l,0,!0);break}e:{switch(m=s,E=x,E){case 0:case 1:throw Error(i(345));case 4:if((l&4194048)!==l)break;case 6:Vs(m,l,wi,!qs);break e;case 2:li=null;break;case 3:case 5:break;default:throw Error(i(329))}if((l&62914560)===l&&(x=ef+300-je(),10<x)){if(Vs(m,l,wi,!qs),Z(m,0,!0)!==0)break e;rs=l,m.timeoutHandle=_w(Q1.bind(null,m,f,li,nf,eg,l,wi,Ka,Zl,qs,E,"Throttled",-0,0),x);break e}Q1(m,f,li,nf,eg,l,wi,Ka,Zl,qs,E,null,-0,0)}}break}while(!0);Sr(s)}function Q1(s,l,f,m,x,E,D,q,Q,oe,ge,Ee,ce,fe){if(s.timeoutHandle=-1,Ee=l.subtreeFlags,Ee&8192||(Ee&16785408)===16785408){Ee={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:De},F1(l,E,Ee);var Be=(E&62914560)===E?ef-je():(E&4194048)===E?G1-je():0;if(Be=VD(Ee,Be),Be!==null){rs=E,s.cancelPendingCommit=Be(rw.bind(null,s,l,E,f,m,x,D,q,Q,ge,Ee,null,ce,fe)),Vs(s,E,D,!oe);return}}rw(s,l,E,f,m,x,D,q,Q)}function cD(s){for(var l=s;;){var f=l.tag;if((f===0||f===11||f===15)&&l.flags&16384&&(f=l.updateQueue,f!==null&&(f=f.stores,f!==null)))for(var m=0;m<f.length;m++){var x=f[m],E=x.getSnapshot;x=x.value;try{if(!gi(E(),x))return!1}catch{return!1}}if(f=l.child,l.subtreeFlags&16384&&f!==null)f.return=l,l=f;else{if(l===s)break;for(;l.sibling===null;){if(l.return===null||l.return===s)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function Vs(s,l,f,m){l&=~Jm,l&=~Ka,s.suspendedLanes|=l,s.pingedLanes&=~l,m&&(s.warmLanes|=l),m=s.expirationTimes;for(var x=l;0<x;){var E=31-yt(x),D=1<<E;m[E]=-1,x&=~D}f!==0&&Pe(s,f,l)}function rf(){return(Tt&6)===0?(Fc(0),!1):!0}function rg(){if(pt!==null){if(Lt===0)var s=pt.return;else s=pt,Vr=za=null,vm(s),Hl=null,Sc=0,s=pt;for(;s!==null;)j1(s.alternate,s),s=s.return;pt=null}}function eo(s,l){var f=s.timeoutHandle;f!==-1&&(s.timeoutHandle=-1,AD(f)),f=s.cancelPendingCommit,f!==null&&(s.cancelPendingCommit=null,f()),rs=0,rg(),Ht=s,pt=f=Kr(s.current,null),xt=l,Lt=0,vi=null,qs=!1,Xl=be(s,l),Zm=!1,Zl=wi=Jm=Ka=Hs=mn=0,li=$c=null,eg=!1,(l&8)!==0&&(l|=l&32);var m=s.entangledLanes;if(m!==0)for(s=s.entanglements,m&=l;0<m;){var x=31-yt(m),E=1<<x;l|=s[x],m&=~E}return is=l,Sd(),f}function X1(s,l){ot=null,$.H=Dc,l===ql||l===Dd?(l=hv(),Lt=3):l===om?(l=hv(),Lt=4):Lt=l===zm?8:l!==null&&typeof l=="object"&&typeof l.then=="function"?6:1,vi=l,pt===null&&(mn=1,Gd(s,Oi(l,s.current)))}function Z1(){var s=bi.current;return s===null?!0:(xt&4194048)===xt?Ii===null:(xt&62914560)===xt||(xt&536870912)!==0?s===Ii:!1}function J1(){var s=$.H;return $.H=Dc,s===null?Dc:s}function ew(){var s=$.A;return $.A=lD,s}function sf(){mn=4,qs||(xt&4194048)!==xt&&bi.current!==null||(Xl=!0),(Hs&134217727)===0&&(Ka&134217727)===0||Ht===null||Vs(Ht,xt,wi,!1)}function sg(s,l,f){var m=Tt;Tt|=2;var x=J1(),E=ew();(Ht!==s||xt!==l)&&(nf=null,eo(s,l)),l=!1;var D=mn;e:do try{if(Lt!==0&&pt!==null){var q=pt,Q=vi;switch(Lt){case 8:rg(),D=6;break e;case 3:case 2:case 9:case 6:bi.current===null&&(l=!0);var oe=Lt;if(Lt=0,vi=null,to(s,q,Q,oe),f&&Xl){D=0;break e}break;default:oe=Lt,Lt=0,vi=null,to(s,q,Q,oe)}}uD(),D=mn;break}catch(ge){X1(s,ge)}while(!0);return l&&s.shellSuspendCounter++,Vr=za=null,Tt=m,$.H=x,$.A=E,pt===null&&(Ht=null,xt=0,Sd()),D}function uD(){for(;pt!==null;)tw(pt)}function dD(s,l){var f=Tt;Tt|=2;var m=J1(),x=ew();Ht!==s||xt!==l?(nf=null,tf=je()+500,eo(s,l)):Xl=be(s,l);e:do try{if(Lt!==0&&pt!==null){l=pt;var E=vi;t:switch(Lt){case 1:Lt=0,vi=null,to(s,l,E,1);break;case 2:case 9:if(dv(E)){Lt=0,vi=null,nw(l);break}l=function(){Lt!==2&&Lt!==9||Ht!==s||(Lt=7),Sr(s)},E.then(l,l);break e;case 3:Lt=7;break e;case 4:Lt=5;break e;case 7:dv(E)?(Lt=0,vi=null,nw(l)):(Lt=0,vi=null,to(s,l,E,7));break;case 5:var D=null;switch(pt.tag){case 26:D=pt.memoizedState;case 5:case 27:var q=pt;if(D?Uw(D):q.stateNode.complete){Lt=0,vi=null;var Q=q.sibling;if(Q!==null)pt=Q;else{var oe=q.return;oe!==null?(pt=oe,af(oe)):pt=null}break t}}Lt=0,vi=null,to(s,l,E,5);break;case 6:Lt=0,vi=null,to(s,l,E,6);break;case 8:rg(),mn=6;break e;default:throw Error(i(462))}}fD();break}catch(ge){X1(s,ge)}while(!0);return Vr=za=null,$.H=m,$.A=x,Tt=f,pt!==null?0:(Ht=null,xt=0,Sd(),mn)}function fD(){for(;pt!==null&&!pe();)tw(pt)}function tw(s){var l=N1(s.alternate,s,is);s.memoizedProps=s.pendingProps,l===null?af(s):pt=l}function nw(s){var l=s,f=l.alternate;switch(l.tag){case 15:case 0:l=x1(f,l,l.pendingProps,l.type,void 0,xt);break;case 11:l=x1(f,l,l.pendingProps,l.type.render,l.ref,xt);break;case 5:vm(l);default:j1(f,l),l=pt=ev(l,is),l=N1(f,l,is)}s.memoizedProps=s.pendingProps,l===null?af(s):pt=l}function to(s,l,f,m){Vr=za=null,vm(l),Hl=null,Sc=0;var x=l.return;try{if(eD(s,x,l,f,xt)){mn=1,Gd(s,Oi(f,s.current)),pt=null;return}}catch(E){if(x!==null)throw pt=x,E;mn=1,Gd(s,Oi(f,s.current)),pt=null;return}l.flags&32768?(wt||m===1?s=!0:Xl||(xt&536870912)!==0?s=!1:(qs=s=!0,(m===2||m===9||m===3||m===6)&&(m=bi.current,m!==null&&m.tag===13&&(m.flags|=16384))),iw(l,s)):af(l)}function af(s){var l=s;do{if((l.flags&32768)!==0){iw(l,qs);return}s=l.return;var f=iD(l.alternate,l,is);if(f!==null){pt=f;return}if(l=l.sibling,l!==null){pt=l;return}pt=l=s}while(l!==null);mn===0&&(mn=5)}function iw(s,l){do{var f=rD(s.alternate,s);if(f!==null){f.flags&=32767,pt=f;return}if(f=s.return,f!==null&&(f.flags|=32768,f.subtreeFlags=0,f.deletions=null),!l&&(s=s.sibling,s!==null)){pt=s;return}pt=s=f}while(s!==null);mn=6,pt=null}function rw(s,l,f,m,x,E,D,q,Q){s.cancelPendingCommit=null;do lf();while(Cn!==0);if((Tt&6)!==0)throw Error(i(327));if(l!==null){if(l===s.current)throw Error(i(177));if(E=l.lanes|l.childLanes,E|=Vp,$e(s,f,E,D,q,Q),s===Ht&&(pt=Ht=null,xt=0),Jl=l,Gs=s,rs=f,tg=E,ng=x,V1=m,(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?(s.callbackNode=null,s.callbackPriority=0,gD(Le,function(){return cw(),null})):(s.callbackNode=null,s.callbackPriority=0),m=(l.flags&13878)!==0,(l.subtreeFlags&13878)!==0||m){m=$.T,$.T=null,x=K.p,K.p=2,D=Tt,Tt|=4;try{sD(s,l,f)}finally{Tt=D,K.p=x,$.T=m}}Cn=1,sw(),aw(),lw()}}function sw(){if(Cn===1){Cn=0;var s=Gs,l=Jl,f=(l.flags&13878)!==0;if((l.subtreeFlags&13878)!==0||f){f=$.T,$.T=null;var m=K.p;K.p=2;var x=Tt;Tt|=4;try{B1(l,s);var E=yg,D=K0(s.containerInfo),q=E.focusedElem,Q=E.selectionRange;if(D!==q&&q&&q.ownerDocument&&H0(q.ownerDocument.documentElement,q)){if(Q!==null&&Fp(q)){var oe=Q.start,ge=Q.end;if(ge===void 0&&(ge=oe),"selectionStart"in q)q.selectionStart=oe,q.selectionEnd=Math.min(ge,q.value.length);else{var Ee=q.ownerDocument||document,ce=Ee&&Ee.defaultView||window;if(ce.getSelection){var fe=ce.getSelection(),Be=q.textContent.length,tt=Math.min(Q.start,Be),$t=Q.end===void 0?tt:Math.min(Q.end,Be);!fe.extend&&tt>$t&&(D=$t,$t=tt,tt=D);var ie=q0(q,tt),ee=q0(q,$t);if(ie&&ee&&(fe.rangeCount!==1||fe.anchorNode!==ie.node||fe.anchorOffset!==ie.offset||fe.focusNode!==ee.node||fe.focusOffset!==ee.offset)){var ae=Ee.createRange();ae.setStart(ie.node,ie.offset),fe.removeAllRanges(),tt>$t?(fe.addRange(ae),fe.extend(ee.node,ee.offset)):(ae.setEnd(ee.node,ee.offset),fe.addRange(ae))}}}}for(Ee=[],fe=q;fe=fe.parentNode;)fe.nodeType===1&&Ee.push({element:fe,left:fe.scrollLeft,top:fe.scrollTop});for(typeof q.focus=="function"&&q.focus(),q=0;q<Ee.length;q++){var ve=Ee[q];ve.element.scrollLeft=ve.left,ve.element.scrollTop=ve.top}}xf=!!gg,yg=gg=null}finally{Tt=x,K.p=m,$.T=f}}s.current=l,Cn=2}}function aw(){if(Cn===2){Cn=0;var s=Gs,l=Jl,f=(l.flags&8772)!==0;if((l.subtreeFlags&8772)!==0||f){f=$.T,$.T=null;var m=K.p;K.p=2;var x=Tt;Tt|=4;try{R1(s,l.alternate,l)}finally{Tt=x,K.p=m,$.T=f}}Cn=3}}function lw(){if(Cn===4||Cn===3){Cn=0,Ne();var s=Gs,l=Jl,f=rs,m=V1;(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?Cn=5:(Cn=0,Jl=Gs=null,ow(s,s.pendingLanes));var x=s.pendingLanes;if(x===0&&(Ks=null),Yi(f),l=l.stateNode,Mt&&typeof Mt.onCommitFiberRoot=="function")try{Mt.onCommitFiberRoot(fn,l,void 0,(l.current.flags&128)===128)}catch{}if(m!==null){l=$.T,x=K.p,K.p=2,$.T=null;try{for(var E=s.onRecoverableError,D=0;D<m.length;D++){var q=m[D];E(q.value,{componentStack:q.stack})}}finally{$.T=l,K.p=x}}(rs&3)!==0&&lf(),Sr(s),x=s.pendingLanes,(f&261930)!==0&&(x&42)!==0?s===ig?Uc++:(Uc=0,ig=s):Uc=0,Fc(0)}}function ow(s,l){(s.pooledCacheLanes&=l)===0&&(l=s.pooledCache,l!=null&&(s.pooledCache=null,kc(l)))}function lf(){return sw(),aw(),lw(),cw()}function cw(){if(Cn!==5)return!1;var s=Gs,l=tg;tg=0;var f=Yi(rs),m=$.T,x=K.p;try{K.p=32>f?32:f,$.T=null,f=ng,ng=null;var E=Gs,D=rs;if(Cn=0,Jl=Gs=null,rs=0,(Tt&6)!==0)throw Error(i(331));var q=Tt;if(Tt|=4,H1(E.current),U1(E,E.current,D,f),Tt=q,Fc(0,!1),Mt&&typeof Mt.onPostCommitFiberRoot=="function")try{Mt.onPostCommitFiberRoot(fn,E)}catch{}return!0}finally{K.p=x,$.T=m,ow(s,l)}}function uw(s,l,f){l=Oi(f,l),l=Lm(s.stateNode,l,2),s=Bs(s,l,2),s!==null&&(Ot(s,2),Sr(s))}function zt(s,l,f){if(s.tag===3)uw(s,s,f);else for(;l!==null;){if(l.tag===3){uw(l,s,f);break}else if(l.tag===1){var m=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(Ks===null||!Ks.has(m))){s=Oi(f,s),f=d1(2),m=Bs(l,f,2),m!==null&&(f1(f,m,l,s),Ot(m,2),Sr(m));break}}l=l.return}}function ag(s,l,f){var m=s.pingCache;if(m===null){m=s.pingCache=new oD;var x=new Set;m.set(l,x)}else x=m.get(l),x===void 0&&(x=new Set,m.set(l,x));x.has(f)||(Zm=!0,x.add(f),s=hD.bind(null,s,l,f),l.then(s,s))}function hD(s,l,f){var m=s.pingCache;m!==null&&m.delete(l),s.pingedLanes|=s.suspendedLanes&f,s.warmLanes&=~f,Ht===s&&(xt&f)===f&&(mn===4||mn===3&&(xt&62914560)===xt&&300>je()-ef?(Tt&2)===0&&eo(s,0):Jm|=f,Zl===xt&&(Zl=0)),Sr(s)}function dw(s,l){l===0&&(l=it()),s=Oa(s,l),s!==null&&(Ot(s,l),Sr(s))}function pD(s){var l=s.memoizedState,f=0;l!==null&&(f=l.retryLane),dw(s,f)}function mD(s,l){var f=0;switch(s.tag){case 31:case 13:var m=s.stateNode,x=s.memoizedState;x!==null&&(f=x.retryLane);break;case 19:m=s.stateNode;break;case 22:m=s.stateNode._retryCache;break;default:throw Error(i(314))}m!==null&&m.delete(l),dw(s,f)}function gD(s,l){return we(s,l)}var of=null,no=null,lg=!1,cf=!1,og=!1,Ys=0;function Sr(s){s!==no&&s.next===null&&(no===null?of=no=s:no=no.next=s),cf=!0,lg||(lg=!0,bD())}function Fc(s,l){if(!og&&cf){og=!0;do for(var f=!1,m=of;m!==null;){if(s!==0){var x=m.pendingLanes;if(x===0)var E=0;else{var D=m.suspendedLanes,q=m.pingedLanes;E=(1<<31-yt(42|s)+1)-1,E&=x&~(D&~q),E=E&201326741?E&201326741|1:E?E|2:0}E!==0&&(f=!0,mw(m,E))}else E=xt,E=Z(m,m===Ht?E:0,m.cancelPendingCommit!==null||m.timeoutHandle!==-1),(E&3)===0||be(m,E)||(f=!0,mw(m,E));m=m.next}while(f);og=!1}}function yD(){fw()}function fw(){cf=lg=!1;var s=0;Ys!==0&&CD()&&(s=Ys);for(var l=je(),f=null,m=of;m!==null;){var x=m.next,E=hw(m,l);E===0?(m.next=null,f===null?of=x:f.next=x,x===null&&(no=f)):(f=m,(s!==0||(E&3)!==0)&&(cf=!0)),m=x}Cn!==0&&Cn!==5||Fc(s),Ys!==0&&(Ys=0)}function hw(s,l){for(var f=s.suspendedLanes,m=s.pingedLanes,x=s.expirationTimes,E=s.pendingLanes&-62914561;0<E;){var D=31-yt(E),q=1<<D,Q=x[D];Q===-1?((q&f)===0||(q&m)!==0)&&(x[D]=Re(q,l)):Q<=l&&(s.expiredLanes|=q),E&=~q}if(l=Ht,f=xt,f=Z(s,s===l?f:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),m=s.callbackNode,f===0||s===l&&(Lt===2||Lt===9)||s.cancelPendingCommit!==null)return m!==null&&m!==null&&xe(m),s.callbackNode=null,s.callbackPriority=0;if((f&3)===0||be(s,f)){if(l=f&-f,l===s.callbackPriority)return l;switch(m!==null&&xe(m),Yi(f)){case 2:case 8:f=de;break;case 32:f=Le;break;case 268435456:f=rt;break;default:f=Le}return m=pw.bind(null,s),f=we(f,m),s.callbackPriority=l,s.callbackNode=f,l}return m!==null&&m!==null&&xe(m),s.callbackPriority=2,s.callbackNode=null,2}function pw(s,l){if(Cn!==0&&Cn!==5)return s.callbackNode=null,s.callbackPriority=0,null;var f=s.callbackNode;if(lf()&&s.callbackNode!==f)return null;var m=xt;return m=Z(s,s===Ht?m:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),m===0?null:(W1(s,m,l),hw(s,je()),s.callbackNode!=null&&s.callbackNode===f?pw.bind(null,s):null)}function mw(s,l){if(lf())return null;W1(s,l,!0)}function bD(){TD(function(){(Tt&6)!==0?we(ne,yD):fw()})}function cg(){if(Ys===0){var s=Ul;s===0&&(s=Br,Br<<=1,(Br&261888)===0&&(Br=256)),Ys=s}return Ys}function gw(s){return s==null||typeof s=="symbol"||typeof s=="boolean"?null:typeof s=="function"?s:Ms(""+s)}function yw(s,l){var f=l.ownerDocument.createElement("input");return f.name=l.name,f.value=l.value,s.id&&f.setAttribute("form",s.id),l.parentNode.insertBefore(f,l),s=new FormData(s),f.parentNode.removeChild(f),s}function xD(s,l,f,m,x){if(l==="submit"&&f&&f.stateNode===x){var E=gw((x[Tn]||null).action),D=m.submitter;D&&(l=(l=D[Tn]||null)?gw(l.formAction):D.getAttribute("formAction"),l!==null&&(E=l,D=null));var q=new vd("action","action",null,m,x);s.push({event:q,listeners:[{instance:null,listener:function(){if(m.defaultPrevented){if(Ys!==0){var Q=D?yw(x,D):new FormData(x);Am(f,{pending:!0,data:Q,method:x.method,action:E},null,Q)}}else typeof E=="function"&&(q.preventDefault(),Q=D?yw(x,D):new FormData(x),Am(f,{pending:!0,data:Q,method:x.method,action:E},E,Q))},currentTarget:x}]})}}for(var ug=0;ug<Gp.length;ug++){var dg=Gp[ug],vD=dg.toLowerCase(),wD=dg[0].toUpperCase()+dg.slice(1);er(vD,"on"+wD)}er(Y0,"onAnimationEnd"),er(W0,"onAnimationIteration"),er(Q0,"onAnimationStart"),er("dblclick","onDoubleClick"),er("focusin","onFocus"),er("focusout","onBlur"),er(IM,"onTransitionRun"),er(PM,"onTransitionStart"),er(BM,"onTransitionCancel"),er(X0,"onTransitionEnd"),Ae("onMouseEnter",["mouseout","mouseover"]),Ae("onMouseLeave",["mouseout","mouseover"]),Ae("onPointerEnter",["pointerout","pointerover"]),Ae("onPointerLeave",["pointerout","pointerover"]),Zi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Zi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Zi("onBeforeInput",["compositionend","keypress","textInput","paste"]),Zi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Zi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Zi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var qc="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(" "),kD=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(qc));function bw(s,l){l=(l&4)!==0;for(var f=0;f<s.length;f++){var m=s[f],x=m.event;m=m.listeners;e:{var E=void 0;if(l)for(var D=m.length-1;0<=D;D--){var q=m[D],Q=q.instance,oe=q.currentTarget;if(q=q.listener,Q!==E&&x.isPropagationStopped())break e;E=q,x.currentTarget=oe;try{E(x)}catch(ge){Ed(ge)}x.currentTarget=null,E=Q}else for(D=0;D<m.length;D++){if(q=m[D],Q=q.instance,oe=q.currentTarget,q=q.listener,Q!==E&&x.isPropagationStopped())break e;E=q,x.currentTarget=oe;try{E(x)}catch(ge){Ed(ge)}x.currentTarget=null,E=Q}}}}function mt(s,l){var f=l[Ns];f===void 0&&(f=l[Ns]=new Set);var m=s+"__bubble";f.has(m)||(xw(l,s,2,!1),f.add(m))}function fg(s,l,f){var m=0;l&&(m|=4),xw(f,s,m,l)}var uf="_reactListening"+Math.random().toString(36).slice(2);function hg(s){if(!s[uf]){s[uf]=!0,Cl.forEach(function(f){f!=="selectionchange"&&(kD.has(f)||fg(f,!1,s),fg(f,!0,s))});var l=s.nodeType===9?s:s.ownerDocument;l===null||l[uf]||(l[uf]=!0,fg("selectionchange",!1,l))}}function xw(s,l,f,m){switch(Yw(l)){case 2:var x=QD;break;case 8:x=XD;break;default:x=Cg}f=x.bind(null,l,f,s),x=void 0,!Op||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(x=!0),m?x!==void 0?s.addEventListener(l,f,{capture:!0,passive:x}):s.addEventListener(l,f,!0):x!==void 0?s.addEventListener(l,f,{passive:x}):s.addEventListener(l,f,!1)}function pg(s,l,f,m,x){var E=m;if((l&1)===0&&(l&2)===0&&m!==null)e:for(;;){if(m===null)return;var D=m.tag;if(D===3||D===4){var q=m.stateNode.containerInfo;if(q===x)break;if(D===4)for(D=m.return;D!==null;){var Q=D.tag;if((Q===3||Q===4)&&D.stateNode.containerInfo===x)return;D=D.return}for(;q!==null;){if(D=Ln(q),D===null)return;if(Q=D.tag,Q===5||Q===6||Q===26||Q===27){m=E=D;continue e}q=q.parentNode}}m=m.return}gd(function(){var oe=E,ge=lt(f),Ee=[];e:{var ce=Z0.get(s);if(ce!==void 0){var fe=vd,Be=s;switch(s){case"keypress":if(bd(f)===0)break e;case"keydown":case"keyup":fe=mM;break;case"focusin":Be="focus",fe=Ip;break;case"focusout":Be="blur",fe=Ip;break;case"beforeblur":case"afterblur":fe=Ip;break;case"click":if(f.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":fe=j0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":fe=iM;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":fe=bM;break;case Y0:case W0:case Q0:fe=aM;break;case X0:fe=vM;break;case"scroll":case"scrollend":fe=tM;break;case"wheel":fe=kM;break;case"copy":case"cut":case"paste":fe=oM;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":fe=A0;break;case"toggle":case"beforetoggle":fe=SM}var tt=(l&4)!==0,$t=!tt&&(s==="scroll"||s==="scrollend"),ie=tt?ce!==null?ce+"Capture":null:ce;tt=[];for(var ee=oe,ae;ee!==null;){var ve=ee;if(ae=ve.stateNode,ve=ve.tag,ve!==5&&ve!==26&&ve!==27||ae===null||ie===null||(ve=dc(ee,ie),ve!=null&&tt.push(Hc(ee,ve,ae))),$t)break;ee=ee.return}0<tt.length&&(ce=new fe(ce,Be,null,f,ge),Ee.push({event:ce,listeners:tt}))}}if((l&7)===0){e:{if(ce=s==="mouseover"||s==="pointerover",fe=s==="mouseout"||s==="pointerout",ce&&f!==Fe&&(Be=f.relatedTarget||f.fromElement)&&(Ln(Be)||Be[Wi]))break e;if((fe||ce)&&(ce=ge.window===ge?ge:(ce=ge.ownerDocument)?ce.defaultView||ce.parentWindow:window,fe?(Be=f.relatedTarget||f.toElement,fe=oe,Be=Be?Ln(Be):null,Be!==null&&($t=a(Be),tt=Be.tag,Be!==$t||tt!==5&&tt!==27&&tt!==6)&&(Be=null)):(fe=null,Be=oe),fe!==Be)){if(tt=j0,ve="onMouseLeave",ie="onMouseEnter",ee="mouse",(s==="pointerout"||s==="pointerover")&&(tt=A0,ve="onPointerLeave",ie="onPointerEnter",ee="pointer"),$t=fe==null?ce:Xi(fe),ae=Be==null?ce:Xi(Be),ce=new tt(ve,ee+"leave",fe,f,ge),ce.target=$t,ce.relatedTarget=ae,ve=null,Ln(ge)===oe&&(tt=new tt(ie,ee+"enter",Be,f,ge),tt.target=ae,tt.relatedTarget=$t,ve=tt),$t=ve,fe&&Be)t:{for(tt=ED,ie=fe,ee=Be,ae=0,ve=ie;ve;ve=tt(ve))ae++;ve=0;for(var We=ee;We;We=tt(We))ve++;for(;0<ae-ve;)ie=tt(ie),ae--;for(;0<ve-ae;)ee=tt(ee),ve--;for(;ae--;){if(ie===ee||ee!==null&&ie===ee.alternate){tt=ie;break t}ie=tt(ie),ee=tt(ee)}tt=null}else tt=null;fe!==null&&vw(Ee,ce,fe,tt,!1),Be!==null&&$t!==null&&vw(Ee,$t,Be,tt,!0)}}e:{if(ce=oe?Xi(oe):window,fe=ce.nodeName&&ce.nodeName.toLowerCase(),fe==="select"||fe==="input"&&ce.type==="file")var jt=I0;else if(L0(ce))if(P0)jt=RM;else{jt=DM;var qe=MM}else fe=ce.nodeName,!fe||fe.toLowerCase()!=="input"||ce.type!=="checkbox"&&ce.type!=="radio"?oe&&Ts(oe.elementType)&&(jt=I0):jt=OM;if(jt&&(jt=jt(s,oe))){z0(Ee,jt,f,ge);break e}qe&&qe(s,ce,oe),s==="focusout"&&oe&&ce.type==="number"&&oe.memoizedProps.value!=null&&As(ce,"number",ce.value)}switch(qe=oe?Xi(oe):window,s){case"focusin":(L0(qe)||qe.contentEditable==="true")&&(Ol=qe,qp=oe,xc=null);break;case"focusout":xc=qp=Ol=null;break;case"mousedown":Hp=!0;break;case"contextmenu":case"mouseup":case"dragend":Hp=!1,G0(Ee,f,ge);break;case"selectionchange":if(zM)break;case"keydown":case"keyup":G0(Ee,f,ge)}var ut;if(Bp)e:{switch(s){case"compositionstart":var vt="onCompositionStart";break e;case"compositionend":vt="onCompositionEnd";break e;case"compositionupdate":vt="onCompositionUpdate";break e}vt=void 0}else Dl?O0(s,f)&&(vt="onCompositionEnd"):s==="keydown"&&f.keyCode===229&&(vt="onCompositionStart");vt&&(T0&&f.locale!=="ko"&&(Dl||vt!=="onCompositionStart"?vt==="onCompositionEnd"&&Dl&&(ut=N0()):(Ds=ge,Rp="value"in Ds?Ds.value:Ds.textContent,Dl=!0)),qe=df(oe,vt),0<qe.length&&(vt=new C0(vt,s,null,f,ge),Ee.push({event:vt,listeners:qe}),ut?vt.data=ut:(ut=R0(f),ut!==null&&(vt.data=ut)))),(ut=_M?jM(s,f):CM(s,f))&&(vt=df(oe,"onBeforeInput"),0<vt.length&&(qe=new C0("onBeforeInput","beforeinput",null,f,ge),Ee.push({event:qe,listeners:vt}),qe.data=ut)),xD(Ee,s,oe,f,ge)}bw(Ee,l)})}function Hc(s,l,f){return{instance:s,listener:l,currentTarget:f}}function df(s,l){for(var f=l+"Capture",m=[];s!==null;){var x=s,E=x.stateNode;if(x=x.tag,x!==5&&x!==26&&x!==27||E===null||(x=dc(s,f),x!=null&&m.unshift(Hc(s,x,E)),x=dc(s,l),x!=null&&m.push(Hc(s,x,E))),s.tag===3)return m;s=s.return}return[]}function ED(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5&&s.tag!==27);return s||null}function vw(s,l,f,m,x){for(var E=l._reactName,D=[];f!==null&&f!==m;){var q=f,Q=q.alternate,oe=q.stateNode;if(q=q.tag,Q!==null&&Q===m)break;q!==5&&q!==26&&q!==27||oe===null||(Q=oe,x?(oe=dc(f,E),oe!=null&&D.unshift(Hc(f,oe,Q))):x||(oe=dc(f,E),oe!=null&&D.push(Hc(f,oe,Q)))),f=f.return}D.length!==0&&s.push({event:l,listeners:D})}var SD=/\r\n?/g,ND=/\u0000|\uFFFD/g;function ww(s){return(typeof s=="string"?s:""+s).replace(SD,`
|
|
49
|
+
`).replace(ND,"")}function kw(s,l){return l=ww(l),ww(s)===l}function Bt(s,l,f,m,x,E){switch(f){case"children":typeof m=="string"?l==="body"||l==="textarea"&&m===""||nt(s,m):(typeof m=="number"||typeof m=="bigint")&&l!=="body"&&nt(s,""+m);break;case"className":Wn(s,"class",m);break;case"tabIndex":Wn(s,"tabindex",m);break;case"dir":case"role":case"viewBox":case"width":case"height":Wn(s,f,m);break;case"style":Rt(s,m,E);break;case"data":if(l!=="object"){Wn(s,"data",m);break}case"src":case"href":if(m===""&&(l!=="a"||f!=="href")){s.removeAttribute(f);break}if(m==null||typeof m=="function"||typeof m=="symbol"||typeof m=="boolean"){s.removeAttribute(f);break}m=Ms(""+m),s.setAttribute(f,m);break;case"action":case"formAction":if(typeof m=="function"){s.setAttribute(f,"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 E=="function"&&(f==="formAction"?(l!=="input"&&Bt(s,l,"name",x.name,x,null),Bt(s,l,"formEncType",x.formEncType,x,null),Bt(s,l,"formMethod",x.formMethod,x,null),Bt(s,l,"formTarget",x.formTarget,x,null)):(Bt(s,l,"encType",x.encType,x,null),Bt(s,l,"method",x.method,x,null),Bt(s,l,"target",x.target,x,null)));if(m==null||typeof m=="symbol"||typeof m=="boolean"){s.removeAttribute(f);break}m=Ms(""+m),s.setAttribute(f,m);break;case"onClick":m!=null&&(s.onclick=De);break;case"onScroll":m!=null&&mt("scroll",s);break;case"onScrollEnd":m!=null&&mt("scrollend",s);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(i(61));if(f=m.__html,f!=null){if(x.children!=null)throw Error(i(60));s.innerHTML=f}}break;case"multiple":s.multiple=m&&typeof m!="function"&&typeof m!="symbol";break;case"muted":s.muted=m&&typeof m!="function"&&typeof m!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(m==null||typeof m=="function"||typeof m=="boolean"||typeof m=="symbol"){s.removeAttribute("xlink:href");break}f=Ms(""+m),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",f);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":m!=null&&typeof m!="function"&&typeof m!="symbol"?s.setAttribute(f,""+m):s.removeAttribute(f);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":m&&typeof m!="function"&&typeof m!="symbol"?s.setAttribute(f,""):s.removeAttribute(f);break;case"capture":case"download":m===!0?s.setAttribute(f,""):m!==!1&&m!=null&&typeof m!="function"&&typeof m!="symbol"?s.setAttribute(f,m):s.removeAttribute(f);break;case"cols":case"rows":case"size":case"span":m!=null&&typeof m!="function"&&typeof m!="symbol"&&!isNaN(m)&&1<=m?s.setAttribute(f,m):s.removeAttribute(f);break;case"rowSpan":case"start":m==null||typeof m=="function"||typeof m=="symbol"||isNaN(m)?s.removeAttribute(f):s.setAttribute(f,m);break;case"popover":mt("beforetoggle",s),mt("toggle",s),Mn(s,"popover",m);break;case"xlinkActuate":Fn(s,"http://www.w3.org/1999/xlink","xlink:actuate",m);break;case"xlinkArcrole":Fn(s,"http://www.w3.org/1999/xlink","xlink:arcrole",m);break;case"xlinkRole":Fn(s,"http://www.w3.org/1999/xlink","xlink:role",m);break;case"xlinkShow":Fn(s,"http://www.w3.org/1999/xlink","xlink:show",m);break;case"xlinkTitle":Fn(s,"http://www.w3.org/1999/xlink","xlink:title",m);break;case"xlinkType":Fn(s,"http://www.w3.org/1999/xlink","xlink:type",m);break;case"xmlBase":Fn(s,"http://www.w3.org/XML/1998/namespace","xml:base",m);break;case"xmlLang":Fn(s,"http://www.w3.org/XML/1998/namespace","xml:lang",m);break;case"xmlSpace":Fn(s,"http://www.w3.org/XML/1998/namespace","xml:space",m);break;case"is":Mn(s,"is",m);break;case"innerText":case"textContent":break;default:(!(2<f.length)||f[0]!=="o"&&f[0]!=="O"||f[1]!=="n"&&f[1]!=="N")&&(f=qr.get(f)||f,Mn(s,f,m))}}function mg(s,l,f,m,x,E){switch(f){case"style":Rt(s,m,E);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(i(61));if(f=m.__html,f!=null){if(x.children!=null)throw Error(i(60));s.innerHTML=f}}break;case"children":typeof m=="string"?nt(s,m):(typeof m=="number"||typeof m=="bigint")&&nt(s,""+m);break;case"onScroll":m!=null&&mt("scroll",s);break;case"onScrollEnd":m!=null&&mt("scrollend",s);break;case"onClick":m!=null&&(s.onclick=De);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Fr.hasOwnProperty(f))e:{if(f[0]==="o"&&f[1]==="n"&&(x=f.endsWith("Capture"),l=f.slice(2,x?f.length-7:void 0),E=s[Tn]||null,E=E!=null?E[f]:null,typeof E=="function"&&s.removeEventListener(l,E,x),typeof m=="function")){typeof E!="function"&&E!==null&&(f in s?s[f]=null:s.hasAttribute(f)&&s.removeAttribute(f)),s.addEventListener(l,m,x);break e}f in s?s[f]=m:m===!0?s.setAttribute(f,""):Mn(s,f,m)}}}function Bn(s,l,f){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":mt("error",s),mt("load",s);var m=!1,x=!1,E;for(E in f)if(f.hasOwnProperty(E)){var D=f[E];if(D!=null)switch(E){case"src":m=!0;break;case"srcSet":x=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,l));default:Bt(s,l,E,D,f,null)}}x&&Bt(s,l,"srcSet",f.srcSet,f,null),m&&Bt(s,l,"src",f.src,f,null);return;case"input":mt("invalid",s);var q=E=D=x=null,Q=null,oe=null;for(m in f)if(f.hasOwnProperty(m)){var ge=f[m];if(ge!=null)switch(m){case"name":x=ge;break;case"type":D=ge;break;case"checked":Q=ge;break;case"defaultChecked":oe=ge;break;case"value":E=ge;break;case"defaultValue":q=ge;break;case"children":case"dangerouslySetInnerHTML":if(ge!=null)throw Error(i(137,l));break;default:Bt(s,l,m,ge,f,null)}}Ji(s,E,q,Q,oe,D,x,!1);return;case"select":mt("invalid",s),m=D=E=null;for(x in f)if(f.hasOwnProperty(x)&&(q=f[x],q!=null))switch(x){case"value":E=q;break;case"defaultValue":D=q;break;case"multiple":m=q;default:Bt(s,l,x,q,f,null)}l=E,f=D,s.multiple=!!m,l!=null?jn(s,!!m,l,!1):f!=null&&jn(s,!!m,f,!0);return;case"textarea":mt("invalid",s),E=x=m=null;for(D in f)if(f.hasOwnProperty(D)&&(q=f[D],q!=null))switch(D){case"value":m=q;break;case"defaultValue":x=q;break;case"children":E=q;break;case"dangerouslySetInnerHTML":if(q!=null)throw Error(i(91));break;default:Bt(s,l,D,q,f,null)}Ml(s,m,x,E);return;case"option":for(Q in f)if(f.hasOwnProperty(Q)&&(m=f[Q],m!=null))switch(Q){case"selected":s.selected=m&&typeof m!="function"&&typeof m!="symbol";break;default:Bt(s,l,Q,m,f,null)}return;case"dialog":mt("beforetoggle",s),mt("toggle",s),mt("cancel",s),mt("close",s);break;case"iframe":case"object":mt("load",s);break;case"video":case"audio":for(m=0;m<qc.length;m++)mt(qc[m],s);break;case"image":mt("error",s),mt("load",s);break;case"details":mt("toggle",s);break;case"embed":case"source":case"link":mt("error",s),mt("load",s);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(oe in f)if(f.hasOwnProperty(oe)&&(m=f[oe],m!=null))switch(oe){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,l));default:Bt(s,l,oe,m,f,null)}return;default:if(Ts(l)){for(ge in f)f.hasOwnProperty(ge)&&(m=f[ge],m!==void 0&&mg(s,l,ge,m,f,void 0));return}}for(q in f)f.hasOwnProperty(q)&&(m=f[q],m!=null&&Bt(s,l,q,m,f,null))}function _D(s,l,f,m){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var x=null,E=null,D=null,q=null,Q=null,oe=null,ge=null;for(fe in f){var Ee=f[fe];if(f.hasOwnProperty(fe)&&Ee!=null)switch(fe){case"checked":break;case"value":break;case"defaultValue":Q=Ee;default:m.hasOwnProperty(fe)||Bt(s,l,fe,null,m,Ee)}}for(var ce in m){var fe=m[ce];if(Ee=f[ce],m.hasOwnProperty(ce)&&(fe!=null||Ee!=null))switch(ce){case"type":E=fe;break;case"name":x=fe;break;case"checked":oe=fe;break;case"defaultChecked":ge=fe;break;case"value":D=fe;break;case"defaultValue":q=fe;break;case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(i(137,l));break;default:fe!==Ee&&Bt(s,l,ce,fe,m,Ee)}}Ca(s,D,q,Q,oe,ge,E,x);return;case"select":fe=D=q=ce=null;for(E in f)if(Q=f[E],f.hasOwnProperty(E)&&Q!=null)switch(E){case"value":break;case"multiple":fe=Q;default:m.hasOwnProperty(E)||Bt(s,l,E,null,m,Q)}for(x in m)if(E=m[x],Q=f[x],m.hasOwnProperty(x)&&(E!=null||Q!=null))switch(x){case"value":ce=E;break;case"defaultValue":q=E;break;case"multiple":D=E;default:E!==Q&&Bt(s,l,x,E,m,Q)}l=q,f=D,m=fe,ce!=null?jn(s,!!f,ce,!1):!!m!=!!f&&(l!=null?jn(s,!!f,l,!0):jn(s,!!f,f?[]:"",!1));return;case"textarea":fe=ce=null;for(q in f)if(x=f[q],f.hasOwnProperty(q)&&x!=null&&!m.hasOwnProperty(q))switch(q){case"value":break;case"children":break;default:Bt(s,l,q,null,m,x)}for(D in m)if(x=m[D],E=f[D],m.hasOwnProperty(D)&&(x!=null||E!=null))switch(D){case"value":ce=x;break;case"defaultValue":fe=x;break;case"children":break;case"dangerouslySetInnerHTML":if(x!=null)throw Error(i(91));break;default:x!==E&&Bt(s,l,D,x,m,E)}Aa(s,ce,fe);return;case"option":for(var Be in f)if(ce=f[Be],f.hasOwnProperty(Be)&&ce!=null&&!m.hasOwnProperty(Be))switch(Be){case"selected":s.selected=!1;break;default:Bt(s,l,Be,null,m,ce)}for(Q in m)if(ce=m[Q],fe=f[Q],m.hasOwnProperty(Q)&&ce!==fe&&(ce!=null||fe!=null))switch(Q){case"selected":s.selected=ce&&typeof ce!="function"&&typeof ce!="symbol";break;default:Bt(s,l,Q,ce,m,fe)}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 tt in f)ce=f[tt],f.hasOwnProperty(tt)&&ce!=null&&!m.hasOwnProperty(tt)&&Bt(s,l,tt,null,m,ce);for(oe in m)if(ce=m[oe],fe=f[oe],m.hasOwnProperty(oe)&&ce!==fe&&(ce!=null||fe!=null))switch(oe){case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(i(137,l));break;default:Bt(s,l,oe,ce,m,fe)}return;default:if(Ts(l)){for(var $t in f)ce=f[$t],f.hasOwnProperty($t)&&ce!==void 0&&!m.hasOwnProperty($t)&&mg(s,l,$t,void 0,m,ce);for(ge in m)ce=m[ge],fe=f[ge],!m.hasOwnProperty(ge)||ce===fe||ce===void 0&&fe===void 0||mg(s,l,ge,ce,m,fe);return}}for(var ie in f)ce=f[ie],f.hasOwnProperty(ie)&&ce!=null&&!m.hasOwnProperty(ie)&&Bt(s,l,ie,null,m,ce);for(Ee in m)ce=m[Ee],fe=f[Ee],!m.hasOwnProperty(Ee)||ce===fe||ce==null&&fe==null||Bt(s,l,Ee,ce,m,fe)}function Ew(s){switch(s){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function jD(){if(typeof performance.getEntriesByType=="function"){for(var s=0,l=0,f=performance.getEntriesByType("resource"),m=0;m<f.length;m++){var x=f[m],E=x.transferSize,D=x.initiatorType,q=x.duration;if(E&&q&&Ew(D)){for(D=0,q=x.responseEnd,m+=1;m<f.length;m++){var Q=f[m],oe=Q.startTime;if(oe>q)break;var ge=Q.transferSize,Ee=Q.initiatorType;ge&&Ew(Ee)&&(Q=Q.responseEnd,D+=ge*(Q<q?1:(q-oe)/(Q-oe)))}if(--m,l+=8*(E+D)/(x.duration/1e3),s++,10<s)break}}if(0<s)return l/s/1e6}return navigator.connection&&(s=navigator.connection.downlink,typeof s=="number")?s:5}var gg=null,yg=null;function ff(s){return s.nodeType===9?s:s.ownerDocument}function Sw(s){switch(s){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Nw(s,l){if(s===0)switch(l){case"svg":return 1;case"math":return 2;default:return 0}return s===1&&l==="foreignObject"?0:s}function bg(s,l){return s==="textarea"||s==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.children=="bigint"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var xg=null;function CD(){var s=window.event;return s&&s.type==="popstate"?s===xg?!1:(xg=s,!0):(xg=null,!1)}var _w=typeof setTimeout=="function"?setTimeout:void 0,AD=typeof clearTimeout=="function"?clearTimeout:void 0,jw=typeof Promise=="function"?Promise:void 0,TD=typeof queueMicrotask=="function"?queueMicrotask:typeof jw<"u"?function(s){return jw.resolve(null).then(s).catch(MD)}:_w;function MD(s){setTimeout(function(){throw s})}function Ws(s){return s==="head"}function Cw(s,l){var f=l,m=0;do{var x=f.nextSibling;if(s.removeChild(f),x&&x.nodeType===8)if(f=x.data,f==="/$"||f==="/&"){if(m===0){s.removeChild(x),ao(l);return}m--}else if(f==="$"||f==="$?"||f==="$~"||f==="$!"||f==="&")m++;else if(f==="html")Kc(s.ownerDocument.documentElement);else if(f==="head"){f=s.ownerDocument.head,Kc(f);for(var E=f.firstChild;E;){var D=E.nextSibling,q=E.nodeName;E[Ur]||q==="SCRIPT"||q==="STYLE"||q==="LINK"&&E.rel.toLowerCase()==="stylesheet"||f.removeChild(E),E=D}}else f==="body"&&Kc(s.ownerDocument.body);f=x}while(f);ao(l)}function Aw(s,l){var f=s;s=0;do{var m=f.nextSibling;if(f.nodeType===1?l?(f._stashedDisplay=f.style.display,f.style.display="none"):(f.style.display=f._stashedDisplay||"",f.getAttribute("style")===""&&f.removeAttribute("style")):f.nodeType===3&&(l?(f._stashedText=f.nodeValue,f.nodeValue=""):f.nodeValue=f._stashedText||""),m&&m.nodeType===8)if(f=m.data,f==="/$"){if(s===0)break;s--}else f!=="$"&&f!=="$?"&&f!=="$~"&&f!=="$!"||s++;f=m}while(f)}function vg(s){var l=s.firstChild;for(l&&l.nodeType===10&&(l=l.nextSibling);l;){var f=l;switch(l=l.nextSibling,f.nodeName){case"HTML":case"HEAD":case"BODY":vg(f),ja(f);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(f.rel.toLowerCase()==="stylesheet")continue}s.removeChild(f)}}function DD(s,l,f,m){for(;s.nodeType===1;){var x=f;if(s.nodeName.toLowerCase()!==l.toLowerCase()){if(!m&&(s.nodeName!=="INPUT"||s.type!=="hidden"))break}else if(m){if(!s[Ur])switch(l){case"meta":if(!s.hasAttribute("itemprop"))break;return s;case"link":if(E=s.getAttribute("rel"),E==="stylesheet"&&s.hasAttribute("data-precedence"))break;if(E!==x.rel||s.getAttribute("href")!==(x.href==null||x.href===""?null:x.href)||s.getAttribute("crossorigin")!==(x.crossOrigin==null?null:x.crossOrigin)||s.getAttribute("title")!==(x.title==null?null:x.title))break;return s;case"style":if(s.hasAttribute("data-precedence"))break;return s;case"script":if(E=s.getAttribute("src"),(E!==(x.src==null?null:x.src)||s.getAttribute("type")!==(x.type==null?null:x.type)||s.getAttribute("crossorigin")!==(x.crossOrigin==null?null:x.crossOrigin))&&E&&s.hasAttribute("async")&&!s.hasAttribute("itemprop"))break;return s;default:return s}}else if(l==="input"&&s.type==="hidden"){var E=x.name==null?null:""+x.name;if(x.type==="hidden"&&s.getAttribute("name")===E)return s}else return s;if(s=Pi(s.nextSibling),s===null)break}return null}function OD(s,l,f){if(l==="")return null;for(;s.nodeType!==3;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!f||(s=Pi(s.nextSibling),s===null))return null;return s}function Tw(s,l){for(;s.nodeType!==8;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!l||(s=Pi(s.nextSibling),s===null))return null;return s}function wg(s){return s.data==="$?"||s.data==="$~"}function kg(s){return s.data==="$!"||s.data==="$?"&&s.ownerDocument.readyState!=="loading"}function RD(s,l){var f=s.ownerDocument;if(s.data==="$~")s._reactRetry=l;else if(s.data!=="$?"||f.readyState!=="loading")l();else{var m=function(){l(),f.removeEventListener("DOMContentLoaded",m)};f.addEventListener("DOMContentLoaded",m),s._reactRetry=m}}function Pi(s){for(;s!=null;s=s.nextSibling){var l=s.nodeType;if(l===1||l===3)break;if(l===8){if(l=s.data,l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"||l==="F!"||l==="F")break;if(l==="/$"||l==="/&")return null}}return s}var Eg=null;function Mw(s){s=s.nextSibling;for(var l=0;s;){if(s.nodeType===8){var f=s.data;if(f==="/$"||f==="/&"){if(l===0)return Pi(s.nextSibling);l--}else f!=="$"&&f!=="$!"&&f!=="$?"&&f!=="$~"&&f!=="&"||l++}s=s.nextSibling}return null}function Dw(s){s=s.previousSibling;for(var l=0;s;){if(s.nodeType===8){var f=s.data;if(f==="$"||f==="$!"||f==="$?"||f==="$~"||f==="&"){if(l===0)return s;l--}else f!=="/$"&&f!=="/&"||l++}s=s.previousSibling}return null}function Ow(s,l,f){switch(l=ff(f),s){case"html":if(s=l.documentElement,!s)throw Error(i(452));return s;case"head":if(s=l.head,!s)throw Error(i(453));return s;case"body":if(s=l.body,!s)throw Error(i(454));return s;default:throw Error(i(451))}}function Kc(s){for(var l=s.attributes;l.length;)s.removeAttributeNode(l[0]);ja(s)}var Bi=new Map,Rw=new Set;function hf(s){return typeof s.getRootNode=="function"?s.getRootNode():s.nodeType===9?s:s.ownerDocument}var ss=K.d;K.d={f:LD,r:zD,D:ID,C:PD,L:BD,m:$D,X:FD,S:UD,M:qD};function LD(){var s=ss.f(),l=rf();return s||l}function zD(s){var l=Qi(s);l!==null&&l.tag===5&&l.type==="form"?Xv(l):ss.r(s)}var io=typeof document>"u"?null:document;function Lw(s,l,f){var m=io;if(m&&typeof l=="string"&&l){var x=qn(l);x='link[rel="'+s+'"][href="'+x+'"]',typeof f=="string"&&(x+='[crossorigin="'+f+'"]'),Rw.has(x)||(Rw.add(x),s={rel:s,crossOrigin:f,href:l},m.querySelector(x)===null&&(l=m.createElement("link"),Bn(l,"link",s),hn(l),m.head.appendChild(l)))}}function ID(s){ss.D(s),Lw("dns-prefetch",s,null)}function PD(s,l){ss.C(s,l),Lw("preconnect",s,l)}function BD(s,l,f){ss.L(s,l,f);var m=io;if(m&&s&&l){var x='link[rel="preload"][as="'+qn(l)+'"]';l==="image"&&f&&f.imageSrcSet?(x+='[imagesrcset="'+qn(f.imageSrcSet)+'"]',typeof f.imageSizes=="string"&&(x+='[imagesizes="'+qn(f.imageSizes)+'"]')):x+='[href="'+qn(s)+'"]';var E=x;switch(l){case"style":E=ro(s);break;case"script":E=so(s)}Bi.has(E)||(s=p({rel:"preload",href:l==="image"&&f&&f.imageSrcSet?void 0:s,as:l},f),Bi.set(E,s),m.querySelector(x)!==null||l==="style"&&m.querySelector(Gc(E))||l==="script"&&m.querySelector(Vc(E))||(l=m.createElement("link"),Bn(l,"link",s),hn(l),m.head.appendChild(l)))}}function $D(s,l){ss.m(s,l);var f=io;if(f&&s){var m=l&&typeof l.as=="string"?l.as:"script",x='link[rel="modulepreload"][as="'+qn(m)+'"][href="'+qn(s)+'"]',E=x;switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":E=so(s)}if(!Bi.has(E)&&(s=p({rel:"modulepreload",href:s},l),Bi.set(E,s),f.querySelector(x)===null)){switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(f.querySelector(Vc(E)))return}m=f.createElement("link"),Bn(m,"link",s),hn(m),f.head.appendChild(m)}}}function UD(s,l,f){ss.S(s,l,f);var m=io;if(m&&s){var x=xr(m).hoistableStyles,E=ro(s);l=l||"default";var D=x.get(E);if(!D){var q={loading:0,preload:null};if(D=m.querySelector(Gc(E)))q.loading=5;else{s=p({rel:"stylesheet",href:s,"data-precedence":l},f),(f=Bi.get(E))&&Sg(s,f);var Q=D=m.createElement("link");hn(Q),Bn(Q,"link",s),Q._p=new Promise(function(oe,ge){Q.onload=oe,Q.onerror=ge}),Q.addEventListener("load",function(){q.loading|=1}),Q.addEventListener("error",function(){q.loading|=2}),q.loading|=4,pf(D,l,m)}D={type:"stylesheet",instance:D,count:1,state:q},x.set(E,D)}}}function FD(s,l){ss.X(s,l);var f=io;if(f&&s){var m=xr(f).hoistableScripts,x=so(s),E=m.get(x);E||(E=f.querySelector(Vc(x)),E||(s=p({src:s,async:!0},l),(l=Bi.get(x))&&Ng(s,l),E=f.createElement("script"),hn(E),Bn(E,"link",s),f.head.appendChild(E)),E={type:"script",instance:E,count:1,state:null},m.set(x,E))}}function qD(s,l){ss.M(s,l);var f=io;if(f&&s){var m=xr(f).hoistableScripts,x=so(s),E=m.get(x);E||(E=f.querySelector(Vc(x)),E||(s=p({src:s,async:!0,type:"module"},l),(l=Bi.get(x))&&Ng(s,l),E=f.createElement("script"),hn(E),Bn(E,"link",s),f.head.appendChild(E)),E={type:"script",instance:E,count:1,state:null},m.set(x,E))}}function zw(s,l,f,m){var x=(x=ye.current)?hf(x):null;if(!x)throw Error(i(446));switch(s){case"meta":case"title":return null;case"style":return typeof f.precedence=="string"&&typeof f.href=="string"?(l=ro(f.href),f=xr(x).hoistableStyles,m=f.get(l),m||(m={type:"style",instance:null,count:0,state:null},f.set(l,m)),m):{type:"void",instance:null,count:0,state:null};case"link":if(f.rel==="stylesheet"&&typeof f.href=="string"&&typeof f.precedence=="string"){s=ro(f.href);var E=xr(x).hoistableStyles,D=E.get(s);if(D||(x=x.ownerDocument||x,D={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},E.set(s,D),(E=x.querySelector(Gc(s)))&&!E._p&&(D.instance=E,D.state.loading=5),Bi.has(s)||(f={rel:"preload",as:"style",href:f.href,crossOrigin:f.crossOrigin,integrity:f.integrity,media:f.media,hrefLang:f.hrefLang,referrerPolicy:f.referrerPolicy},Bi.set(s,f),E||HD(x,s,f,D.state))),l&&m===null)throw Error(i(528,""));return D}if(l&&m!==null)throw Error(i(529,""));return null;case"script":return l=f.async,f=f.src,typeof f=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(l=so(f),f=xr(x).hoistableScripts,m=f.get(l),m||(m={type:"script",instance:null,count:0,state:null},f.set(l,m)),m):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,s))}}function ro(s){return'href="'+qn(s)+'"'}function Gc(s){return'link[rel="stylesheet"]['+s+"]"}function Iw(s){return p({},s,{"data-precedence":s.precedence,precedence:null})}function HD(s,l,f,m){s.querySelector('link[rel="preload"][as="style"]['+l+"]")?m.loading=1:(l=s.createElement("link"),m.preload=l,l.addEventListener("load",function(){return m.loading|=1}),l.addEventListener("error",function(){return m.loading|=2}),Bn(l,"link",f),hn(l),s.head.appendChild(l))}function so(s){return'[src="'+qn(s)+'"]'}function Vc(s){return"script[async]"+s}function Pw(s,l,f){if(l.count++,l.instance===null)switch(l.type){case"style":var m=s.querySelector('style[data-href~="'+qn(f.href)+'"]');if(m)return l.instance=m,hn(m),m;var x=p({},f,{"data-href":f.href,"data-precedence":f.precedence,href:null,precedence:null});return m=(s.ownerDocument||s).createElement("style"),hn(m),Bn(m,"style",x),pf(m,f.precedence,s),l.instance=m;case"stylesheet":x=ro(f.href);var E=s.querySelector(Gc(x));if(E)return l.state.loading|=4,l.instance=E,hn(E),E;m=Iw(f),(x=Bi.get(x))&&Sg(m,x),E=(s.ownerDocument||s).createElement("link"),hn(E);var D=E;return D._p=new Promise(function(q,Q){D.onload=q,D.onerror=Q}),Bn(E,"link",m),l.state.loading|=4,pf(E,f.precedence,s),l.instance=E;case"script":return E=so(f.src),(x=s.querySelector(Vc(E)))?(l.instance=x,hn(x),x):(m=f,(x=Bi.get(E))&&(m=p({},f),Ng(m,x)),s=s.ownerDocument||s,x=s.createElement("script"),hn(x),Bn(x,"link",m),s.head.appendChild(x),l.instance=x);case"void":return null;default:throw Error(i(443,l.type))}else l.type==="stylesheet"&&(l.state.loading&4)===0&&(m=l.instance,l.state.loading|=4,pf(m,f.precedence,s));return l.instance}function pf(s,l,f){for(var m=f.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),x=m.length?m[m.length-1]:null,E=x,D=0;D<m.length;D++){var q=m[D];if(q.dataset.precedence===l)E=q;else if(E!==x)break}E?E.parentNode.insertBefore(s,E.nextSibling):(l=f.nodeType===9?f.head:f,l.insertBefore(s,l.firstChild))}function Sg(s,l){s.crossOrigin==null&&(s.crossOrigin=l.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=l.referrerPolicy),s.title==null&&(s.title=l.title)}function Ng(s,l){s.crossOrigin==null&&(s.crossOrigin=l.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=l.referrerPolicy),s.integrity==null&&(s.integrity=l.integrity)}var mf=null;function Bw(s,l,f){if(mf===null){var m=new Map,x=mf=new Map;x.set(f,m)}else x=mf,m=x.get(f),m||(m=new Map,x.set(f,m));if(m.has(s))return m;for(m.set(s,null),f=f.getElementsByTagName(s),x=0;x<f.length;x++){var E=f[x];if(!(E[Ur]||E[sn]||s==="link"&&E.getAttribute("rel")==="stylesheet")&&E.namespaceURI!=="http://www.w3.org/2000/svg"){var D=E.getAttribute(l)||"";D=s+D;var q=m.get(D);q?q.push(E):m.set(D,[E])}}return m}function $w(s,l,f){s=s.ownerDocument||s,s.head.insertBefore(f,l==="title"?s.querySelector("head > title"):null)}function KD(s,l,f){if(f===1||l.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof l.precedence!="string"||typeof l.href!="string"||l.href==="")break;return!0;case"link":if(typeof l.rel!="string"||typeof l.href!="string"||l.href===""||l.onLoad||l.onError)break;switch(l.rel){case"stylesheet":return s=l.disabled,typeof l.precedence=="string"&&s==null;default:return!0}case"script":if(l.async&&typeof l.async!="function"&&typeof l.async!="symbol"&&!l.onLoad&&!l.onError&&l.src&&typeof l.src=="string")return!0}return!1}function Uw(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function GD(s,l,f,m){if(f.type==="stylesheet"&&(typeof m.media!="string"||matchMedia(m.media).matches!==!1)&&(f.state.loading&4)===0){if(f.instance===null){var x=ro(m.href),E=l.querySelector(Gc(x));if(E){l=E._p,l!==null&&typeof l=="object"&&typeof l.then=="function"&&(s.count++,s=gf.bind(s),l.then(s,s)),f.state.loading|=4,f.instance=E,hn(E);return}E=l.ownerDocument||l,m=Iw(m),(x=Bi.get(x))&&Sg(m,x),E=E.createElement("link"),hn(E);var D=E;D._p=new Promise(function(q,Q){D.onload=q,D.onerror=Q}),Bn(E,"link",m),f.instance=E}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(f,l),(l=f.state.preload)&&(f.state.loading&3)===0&&(s.count++,f=gf.bind(s),l.addEventListener("load",f),l.addEventListener("error",f))}}var _g=0;function VD(s,l){return s.stylesheets&&s.count===0&&bf(s,s.stylesheets),0<s.count||0<s.imgCount?function(f){var m=setTimeout(function(){if(s.stylesheets&&bf(s,s.stylesheets),s.unsuspend){var E=s.unsuspend;s.unsuspend=null,E()}},6e4+l);0<s.imgBytes&&_g===0&&(_g=62500*jD());var x=setTimeout(function(){if(s.waitingForImages=!1,s.count===0&&(s.stylesheets&&bf(s,s.stylesheets),s.unsuspend)){var E=s.unsuspend;s.unsuspend=null,E()}},(s.imgBytes>_g?50:800)+l);return s.unsuspend=f,function(){s.unsuspend=null,clearTimeout(m),clearTimeout(x)}}:null}function gf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)bf(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var yf=null;function bf(s,l){s.stylesheets=null,s.unsuspend!==null&&(s.count++,yf=new Map,l.forEach(YD,s),yf=null,gf.call(s))}function YD(s,l){if(!(l.state.loading&4)){var f=yf.get(s);if(f)var m=f.get(null);else{f=new Map,yf.set(s,f);for(var x=s.querySelectorAll("link[data-precedence],style[data-precedence]"),E=0;E<x.length;E++){var D=x[E];(D.nodeName==="LINK"||D.getAttribute("media")!=="not all")&&(f.set(D.dataset.precedence,D),m=D)}m&&f.set(null,m)}x=l.instance,D=x.getAttribute("data-precedence"),E=f.get(D)||m,E===m&&f.set(null,x),f.set(D,x),this.count++,m=gf.bind(this),x.addEventListener("load",m),x.addEventListener("error",m),E?E.parentNode.insertBefore(x,E.nextSibling):(s=s.nodeType===9?s.head:s,s.insertBefore(x,s.firstChild)),l.state.loading|=4}}var Yc={$$typeof:S,Provider:null,Consumer:null,_currentValue:W,_currentValue2:W,_threadCount:0};function WD(s,l,f,m,x,E,D,q,Q){this.tag=1,this.containerInfo=s,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=qt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=qt(0),this.hiddenUpdates=qt(null),this.identifierPrefix=m,this.onUncaughtError=x,this.onCaughtError=E,this.onRecoverableError=D,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Q,this.incompleteTransitions=new Map}function Fw(s,l,f,m,x,E,D,q,Q,oe,ge,Ee){return s=new WD(s,l,f,D,Q,oe,ge,Ee,q),l=1,E===!0&&(l|=24),E=yi(3,null,null,l),s.current=E,E.stateNode=s,l=sm(),l.refCount++,s.pooledCache=l,l.refCount++,E.memoizedState={element:m,isDehydrated:f,cache:l},cm(E),s}function qw(s){return s?(s=zl,s):zl}function Hw(s,l,f,m,x,E){x=qw(x),m.context===null?m.context=x:m.pendingContext=x,m=Ps(l),m.payload={element:f},E=E===void 0?null:E,E!==null&&(m.callback=E),f=Bs(s,m,l),f!==null&&(oi(f,s,l),_c(f,s,l))}function Kw(s,l){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var f=s.retryLane;s.retryLane=f!==0&&f<l?f:l}}function jg(s,l){Kw(s,l),(s=s.alternate)&&Kw(s,l)}function Gw(s){if(s.tag===13||s.tag===31){var l=Oa(s,67108864);l!==null&&oi(l,s,67108864),jg(s,67108864)}}function Vw(s){if(s.tag===13||s.tag===31){var l=ki();l=Vt(l);var f=Oa(s,l);f!==null&&oi(f,s,l),jg(s,l)}}var xf=!0;function QD(s,l,f,m){var x=$.T;$.T=null;var E=K.p;try{K.p=2,Cg(s,l,f,m)}finally{K.p=E,$.T=x}}function XD(s,l,f,m){var x=$.T;$.T=null;var E=K.p;try{K.p=8,Cg(s,l,f,m)}finally{K.p=E,$.T=x}}function Cg(s,l,f,m){if(xf){var x=Ag(m);if(x===null)pg(s,l,m,vf,f),Ww(s,m);else if(JD(x,s,l,f,m))m.stopPropagation();else if(Ww(s,m),l&4&&-1<ZD.indexOf(s)){for(;x!==null;){var E=Qi(x);if(E!==null)switch(E.tag){case 3:if(E=E.stateNode,E.current.memoizedState.isDehydrated){var D=Un(E.pendingLanes);if(D!==0){var q=E;for(q.pendingLanes|=2,q.entangledLanes|=2;D;){var Q=1<<31-yt(D);q.entanglements[1]|=Q,D&=~Q}Sr(E),(Tt&6)===0&&(tf=je()+500,Fc(0))}}break;case 31:case 13:q=Oa(E,2),q!==null&&oi(q,E,2),rf(),jg(E,2)}if(E=Ag(m),E===null&&pg(s,l,m,vf,f),E===x)break;x=E}x!==null&&m.stopPropagation()}else pg(s,l,m,null,f)}}function Ag(s){return s=lt(s),Tg(s)}var vf=null;function Tg(s){if(vf=null,s=Ln(s),s!==null){var l=a(s);if(l===null)s=null;else{var f=l.tag;if(f===13){if(s=o(l),s!==null)return s;s=null}else if(f===31){if(s=u(l),s!==null)return s;s=null}else if(f===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;s=null}else l!==s&&(s=null)}}return vf=s,null}function Yw(s){switch(s){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(He()){case ne:return 2;case de:return 8;case Le:case Ze:return 32;case rt:return 268435456;default:return 32}default:return 32}}var Mg=!1,Qs=null,Xs=null,Zs=null,Wc=new Map,Qc=new Map,Js=[],ZD="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 Ww(s,l){switch(s){case"focusin":case"focusout":Qs=null;break;case"dragenter":case"dragleave":Xs=null;break;case"mouseover":case"mouseout":Zs=null;break;case"pointerover":case"pointerout":Wc.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":Qc.delete(l.pointerId)}}function Xc(s,l,f,m,x,E){return s===null||s.nativeEvent!==E?(s={blockedOn:l,domEventName:f,eventSystemFlags:m,nativeEvent:E,targetContainers:[x]},l!==null&&(l=Qi(l),l!==null&&Gw(l)),s):(s.eventSystemFlags|=m,l=s.targetContainers,x!==null&&l.indexOf(x)===-1&&l.push(x),s)}function JD(s,l,f,m,x){switch(l){case"focusin":return Qs=Xc(Qs,s,l,f,m,x),!0;case"dragenter":return Xs=Xc(Xs,s,l,f,m,x),!0;case"mouseover":return Zs=Xc(Zs,s,l,f,m,x),!0;case"pointerover":var E=x.pointerId;return Wc.set(E,Xc(Wc.get(E)||null,s,l,f,m,x)),!0;case"gotpointercapture":return E=x.pointerId,Qc.set(E,Xc(Qc.get(E)||null,s,l,f,m,x)),!0}return!1}function Qw(s){var l=Ln(s.target);if(l!==null){var f=a(l);if(f!==null){if(l=f.tag,l===13){if(l=o(f),l!==null){s.blockedOn=l,Ss(s.priority,function(){Vw(f)});return}}else if(l===31){if(l=u(f),l!==null){s.blockedOn=l,Ss(s.priority,function(){Vw(f)});return}}else if(l===3&&f.stateNode.current.memoizedState.isDehydrated){s.blockedOn=f.tag===3?f.stateNode.containerInfo:null;return}}}s.blockedOn=null}function wf(s){if(s.blockedOn!==null)return!1;for(var l=s.targetContainers;0<l.length;){var f=Ag(s.nativeEvent);if(f===null){f=s.nativeEvent;var m=new f.constructor(f.type,f);Fe=m,f.target.dispatchEvent(m),Fe=null}else return l=Qi(f),l!==null&&Gw(l),s.blockedOn=f,!1;l.shift()}return!0}function Xw(s,l,f){wf(s)&&f.delete(l)}function eO(){Mg=!1,Qs!==null&&wf(Qs)&&(Qs=null),Xs!==null&&wf(Xs)&&(Xs=null),Zs!==null&&wf(Zs)&&(Zs=null),Wc.forEach(Xw),Qc.forEach(Xw)}function kf(s,l){s.blockedOn===l&&(s.blockedOn=null,Mg||(Mg=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,eO)))}var Ef=null;function Zw(s){Ef!==s&&(Ef=s,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Ef===s&&(Ef=null);for(var l=0;l<s.length;l+=3){var f=s[l],m=s[l+1],x=s[l+2];if(typeof m!="function"){if(Tg(m||f)===null)continue;break}var E=Qi(f);E!==null&&(s.splice(l,3),l-=3,Am(E,{pending:!0,data:x,method:f.method,action:m},m,x))}}))}function ao(s){function l(Q){return kf(Q,s)}Qs!==null&&kf(Qs,s),Xs!==null&&kf(Xs,s),Zs!==null&&kf(Zs,s),Wc.forEach(l),Qc.forEach(l);for(var f=0;f<Js.length;f++){var m=Js[f];m.blockedOn===s&&(m.blockedOn=null)}for(;0<Js.length&&(f=Js[0],f.blockedOn===null);)Qw(f),f.blockedOn===null&&Js.shift();if(f=(s.ownerDocument||s).$$reactFormReplay,f!=null)for(m=0;m<f.length;m+=3){var x=f[m],E=f[m+1],D=x[Tn]||null;if(typeof E=="function")D||Zw(f);else if(D){var q=null;if(E&&E.hasAttribute("formAction")){if(x=E,D=E[Tn]||null)q=D.formAction;else if(Tg(x)!==null)continue}else q=D.action;typeof q=="function"?f[m+1]=q:(f.splice(m,3),m-=3),Zw(f)}}}function Jw(){function s(E){E.canIntercept&&E.info==="react-transition"&&E.intercept({handler:function(){return new Promise(function(D){return x=D})},focusReset:"manual",scroll:"manual"})}function l(){x!==null&&(x(),x=null),m||setTimeout(f,20)}function f(){if(!m&&!navigation.transition){var E=navigation.currentEntry;E&&E.url!=null&&navigation.navigate(E.url,{state:E.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var m=!1,x=null;return navigation.addEventListener("navigate",s),navigation.addEventListener("navigatesuccess",l),navigation.addEventListener("navigateerror",l),setTimeout(f,100),function(){m=!0,navigation.removeEventListener("navigate",s),navigation.removeEventListener("navigatesuccess",l),navigation.removeEventListener("navigateerror",l),x!==null&&(x(),x=null)}}}function Dg(s){this._internalRoot=s}Sf.prototype.render=Dg.prototype.render=function(s){var l=this._internalRoot;if(l===null)throw Error(i(409));var f=l.current,m=ki();Hw(f,m,s,l,null,null)},Sf.prototype.unmount=Dg.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var l=s.containerInfo;Hw(s.current,2,null,s,null,null),rf(),l[Wi]=null}};function Sf(s){this._internalRoot=s}Sf.prototype.unstable_scheduleHydration=function(s){if(s){var l=Es();s={blockedOn:null,target:s,priority:l};for(var f=0;f<Js.length&&l!==0&&l<Js[f].priority;f++);Js.splice(f,0,s),f===0&&Qw(s)}};var ek=t.version;if(ek!=="19.2.5")throw Error(i(527,ek,"19.2.5"));K.findDOMNode=function(s){var l=s._reactInternals;if(l===void 0)throw typeof s.render=="function"?Error(i(188)):(s=Object.keys(s).join(","),Error(i(268,s)));return s=h(l),s=s!==null?g(s):null,s=s===null?null:s.stateNode,s};var tO={bundleType:0,version:"19.2.5",rendererPackageName:"react-dom",currentDispatcherRef:$,reconcilerVersion:"19.2.5"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Nf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Nf.isDisabled&&Nf.supportsFiber)try{fn=Nf.inject(tO),Mt=Nf}catch{}}return Jc.createRoot=function(s,l){if(!r(s))throw Error(i(299));var f=!1,m="",x=l1,E=o1,D=c1;return l!=null&&(l.unstable_strictMode===!0&&(f=!0),l.identifierPrefix!==void 0&&(m=l.identifierPrefix),l.onUncaughtError!==void 0&&(x=l.onUncaughtError),l.onCaughtError!==void 0&&(E=l.onCaughtError),l.onRecoverableError!==void 0&&(D=l.onRecoverableError)),l=Fw(s,1,!1,null,null,f,m,null,x,E,D,Jw),s[Wi]=l.current,hg(s),new Dg(l)},Jc.hydrateRoot=function(s,l,f){if(!r(s))throw Error(i(299));var m=!1,x="",E=l1,D=o1,q=c1,Q=null;return f!=null&&(f.unstable_strictMode===!0&&(m=!0),f.identifierPrefix!==void 0&&(x=f.identifierPrefix),f.onUncaughtError!==void 0&&(E=f.onUncaughtError),f.onCaughtError!==void 0&&(D=f.onCaughtError),f.onRecoverableError!==void 0&&(q=f.onRecoverableError),f.formState!==void 0&&(Q=f.formState)),l=Fw(s,1,!0,l,f??null,m,x,Q,E,D,q,Jw),l.context=qw(null),f=l.current,m=ki(),m=Vt(m),x=Ps(m),x.callback=null,Bs(f,x,m),f=m,l.current.lanes=f,Ot(l,f),Sr(l),s[Wi]=l.current,hg(s),new Sf(l)},Jc.version="19.2.5",Jc}var fk;function hO(){if(fk)return zg.exports;fk=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(),zg.exports=fO(),zg.exports}var pO=hO(),Qo=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},el,ua,Ao,YN,mO=(YN=class extends Qo{constructor(){super();Ye(this,el);Ye(this,ua);Ye(this,Ao);ze(this,Ao,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){X(this,ua)||this.setEventListener(X(this,Ao))}onUnsubscribe(){var t;this.hasListeners()||((t=X(this,ua))==null||t.call(this),ze(this,ua,void 0))}setEventListener(t){var n;ze(this,Ao,t),(n=X(this,ua))==null||n.call(this),ze(this,ua,t(i=>{typeof i=="boolean"?this.setFocused(i):this.onFocus()}))}setFocused(t){X(this,el)!==t&&(ze(this,el,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof X(this,el)=="boolean"?X(this,el):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},el=new WeakMap,ua=new WeakMap,Ao=new WeakMap,YN),Gb=new mO,gO={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},da,Kb,WN,yO=(WN=class{constructor(){Ye(this,da,gO);Ye(this,Kb,!1)}setTimeoutProvider(e){ze(this,da,e)}setTimeout(e,t){return X(this,da).setTimeout(e,t)}clearTimeout(e){X(this,da).clearTimeout(e)}setInterval(e,t){return X(this,da).setInterval(e,t)}clearInterval(e){X(this,da).clearInterval(e)}},da=new WeakMap,Kb=new WeakMap,WN),Wa=new yO;function bO(e){setTimeout(e,0)}var xO=typeof window>"u"||"Deno"in globalThis;function ei(){}function vO(e,t){return typeof e=="function"?e(t):e}function Uy(e){return typeof e=="number"&&e>=0&&e!==1/0}function a2(e,t){return Math.max(e+(t||0)-Date.now(),0)}function xa(e,t){return typeof e=="function"?e(t):e}function Fi(e,t){return typeof e=="function"?e(t):e}function hk(e,t){const{type:n="all",exact:i,fetchStatus:r,predicate:a,queryKey:o,stale:u}=e;if(o){if(i){if(t.queryHash!==Vb(o,t.options))return!1}else if(!Su(t.queryKey,o))return!1}if(n!=="all"){const d=t.isActive();if(n==="active"&&!d||n==="inactive"&&d)return!1}return!(typeof u=="boolean"&&t.isStale()!==u||r&&r!==t.state.fetchStatus||a&&!a(t))}function pk(e,t){const{exact:n,status:i,predicate:r,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(dl(t.options.mutationKey)!==dl(a))return!1}else if(!Su(t.options.mutationKey,a))return!1}return!(i&&t.state.status!==i||r&&!r(t))}function Vb(e,t){return((t==null?void 0:t.queryKeyHashFn)||dl)(e)}function dl(e){return JSON.stringify(e,(t,n)=>Fy(n)?Object.keys(n).sort().reduce((i,r)=>(i[r]=n[r],i),{}):n)}function Su(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Su(e[n],t[n])):!1}var wO=Object.prototype.hasOwnProperty;function l2(e,t,n=0){if(e===t)return e;if(n>500)return t;const i=mk(e)&&mk(t);if(!i&&!(Fy(e)&&Fy(t)))return t;const a=(i?e:Object.keys(e)).length,o=i?t:Object.keys(t),u=o.length,d=i?new Array(u):{};let h=0;for(let g=0;g<u;g++){const p=i?g:o[g],y=e[p],b=t[p];if(y===b){d[p]=y,(i?g<a:wO.call(e,p))&&h++;continue}if(y===null||b===null||typeof y!="object"||typeof b!="object"){d[p]=b;continue}const w=l2(y,b,n+1);d[p]=w,w===y&&h++}return a===u&&h===a?e:d}function bh(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function mk(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Fy(e){if(!gk(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!gk(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function gk(e){return Object.prototype.toString.call(e)==="[object Object]"}function kO(e){return new Promise(t=>{Wa.setTimeout(t,e)})}function qy(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?l2(e,t):t}function EO(e,t,n=0){const i=[...e,t];return n&&i.length>n?i.slice(1):i}function SO(e,t,n=0){const i=[t,...e];return n&&i.length>n?i.slice(0,-1):i}var Yb=Symbol();function o2(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Yb?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Wb(e,t){return typeof e=="function"?e(...t):!!e}function NO(e,t,n){let i=!1,r;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(r??(r=t()),i||(i=!0,r.aborted?n():r.addEventListener("abort",n,{once:!0})),r)}),e}var Nu=(()=>{let e=()=>xO;return{isServer(){return e()},setIsServer(t){e=t}}})();function Hy(){let e,t;const n=new Promise((r,a)=>{e=r,t=a});n.status="pending",n.catch(()=>{});function i(r){Object.assign(n,r),delete n.resolve,delete n.reject}return n.resolve=r=>{i({status:"fulfilled",value:r}),e(r)},n.reject=r=>{i({status:"rejected",reason:r}),t(r)},n}var _O=bO;function jO(){let e=[],t=0,n=u=>{u()},i=u=>{u()},r=_O;const a=u=>{t?e.push(u):r(()=>{n(u)})},o=()=>{const u=e;e=[],u.length&&r(()=>{i(()=>{u.forEach(d=>{n(d)})})})};return{batch:u=>{let d;t++;try{d=u()}finally{t--,t||o()}return d},batchCalls:u=>(...d)=>{a(()=>{u(...d)})},schedule:a,setNotifyFunction:u=>{n=u},setBatchNotifyFunction:u=>{i=u},setScheduler:u=>{r=u}}}var An=jO(),To,fa,Mo,QN,CO=(QN=class extends Qo{constructor(){super();Ye(this,To,!0);Ye(this,fa);Ye(this,Mo);ze(this,Mo,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t(!0),i=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",i)}}})}onSubscribe(){X(this,fa)||this.setEventListener(X(this,Mo))}onUnsubscribe(){var t;this.hasListeners()||((t=X(this,fa))==null||t.call(this),ze(this,fa,void 0))}setEventListener(t){var n;ze(this,Mo,t),(n=X(this,fa))==null||n.call(this),ze(this,fa,t(this.setOnline.bind(this)))}setOnline(t){X(this,To)!==t&&(ze(this,To,t),this.listeners.forEach(i=>{i(t)}))}isOnline(){return X(this,To)}},To=new WeakMap,fa=new WeakMap,Mo=new WeakMap,QN),xh=new CO;function AO(e){return Math.min(1e3*2**e,3e4)}function c2(e){return(e??"online")==="online"?xh.isOnline():!0}var Ky=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function u2(e){let t=!1,n=0,i;const r=Hy(),a=()=>r.status!=="pending",o=v=>{var N;if(!a()){const k=new Ky(v);y(k),(N=e.onCancel)==null||N.call(e,k)}},u=()=>{t=!0},d=()=>{t=!1},h=()=>Gb.isFocused()&&(e.networkMode==="always"||xh.isOnline())&&e.canRun(),g=()=>c2(e.networkMode)&&e.canRun(),p=v=>{a()||(i==null||i(),r.resolve(v))},y=v=>{a()||(i==null||i(),r.reject(v))},b=()=>new Promise(v=>{var N;i=k=>{(a()||h())&&v(k)},(N=e.onPause)==null||N.call(e)}).then(()=>{var v;i=void 0,a()||(v=e.onContinue)==null||v.call(e)}),w=()=>{if(a())return;let v;const N=n===0?e.initialPromise:void 0;try{v=N??e.fn()}catch(k){v=Promise.reject(k)}Promise.resolve(v).then(p).catch(k=>{var T;if(a())return;const A=e.retry??(Nu.isServer()?0:3),S=e.retryDelay??AO,_=typeof S=="function"?S(n,k):S,C=A===!0||typeof A=="number"&&n<A||typeof A=="function"&&A(n,k);if(t||!C){y(k);return}n++,(T=e.onFail)==null||T.call(e,n,k),kO(_).then(()=>h()?void 0:b()).then(()=>{t?y(k):w()})})};return{promise:r,status:()=>r.status,cancel:o,continue:()=>(i==null||i(),r),cancelRetry:u,continueRetry:d,canStart:g,start:()=>(g()?w():b().then(w),r)}}var tl,XN,d2=(XN=class{constructor(){Ye(this,tl)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Uy(this.gcTime)&&ze(this,tl,Wa.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Nu.isServer()?1/0:300*1e3))}clearGcTimeout(){X(this,tl)!==void 0&&(Wa.clearTimeout(X(this,tl)),ze(this,tl,void 0))}},tl=new WeakMap,XN),nl,Do,Ui,il,On,qu,rl,Si,f2,ls,ZN,TO=(ZN=class extends d2{constructor(t){super();Ye(this,Si);Ye(this,nl);Ye(this,Do);Ye(this,Ui);Ye(this,il);Ye(this,On);Ye(this,qu);Ye(this,rl);ze(this,rl,!1),ze(this,qu,t.defaultOptions),this.setOptions(t.options),this.observers=[],ze(this,il,t.client),ze(this,Ui,X(this,il).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ze(this,nl,bk(this.options)),this.state=t.state??X(this,nl),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=X(this,On))==null?void 0:t.promise}setOptions(t){if(this.options={...X(this,qu),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=bk(this.options);n.data!==void 0&&(this.setState(yk(n.data,n.dataUpdatedAt)),ze(this,nl,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&X(this,Ui).remove(this)}setData(t,n){const i=qy(this.state.data,t,this.options);return dt(this,Si,ls).call(this,{data:i,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),i}setState(t,n){dt(this,Si,ls).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var i,r;const n=(i=X(this,On))==null?void 0:i.promise;return(r=X(this,On))==null||r.cancel(t),n?n.then(ei).catch(ei):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return X(this,nl)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>Fi(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Yb||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>xa(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!a2(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(i=>i.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=X(this,On))==null||n.continue()}onOnline(){var n;const t=this.observers.find(i=>i.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=X(this,On))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),X(this,Ui).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(X(this,On)&&(X(this,rl)||dt(this,Si,f2).call(this)?X(this,On).cancel({revert:!0}):X(this,On).cancelRetry()),this.scheduleGc()),X(this,Ui).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||dt(this,Si,ls).call(this,{type:"invalidate"})}async fetch(t,n){var d,h,g,p,y,b,w,v,N,k,A,S;if(this.state.fetchStatus!=="idle"&&((d=X(this,On))==null?void 0:d.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(X(this,On))return X(this,On).continueRetry(),X(this,On).promise}if(t&&this.setOptions(t),!this.options.queryFn){const _=this.observers.find(C=>C.options.queryFn);_&&this.setOptions(_.options)}const i=new AbortController,r=_=>{Object.defineProperty(_,"signal",{enumerable:!0,get:()=>(ze(this,rl,!0),i.signal)})},a=()=>{const _=o2(this.options,n),T=(()=>{const R={client:X(this,il),queryKey:this.queryKey,meta:this.meta};return r(R),R})();return ze(this,rl,!1),this.options.persister?this.options.persister(_,T,this):_(T)},u=(()=>{const _={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:X(this,il),state:this.state,fetchFn:a};return r(_),_})();(h=this.options.behavior)==null||h.onFetch(u,this),ze(this,Do,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((g=u.fetchOptions)==null?void 0:g.meta))&&dt(this,Si,ls).call(this,{type:"fetch",meta:(p=u.fetchOptions)==null?void 0:p.meta}),ze(this,On,u2({initialPromise:n==null?void 0:n.initialPromise,fn:u.fetchFn,onCancel:_=>{_ instanceof Ky&&_.revert&&this.setState({...X(this,Do),fetchStatus:"idle"}),i.abort()},onFail:(_,C)=>{dt(this,Si,ls).call(this,{type:"failed",failureCount:_,error:C})},onPause:()=>{dt(this,Si,ls).call(this,{type:"pause"})},onContinue:()=>{dt(this,Si,ls).call(this,{type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode,canRun:()=>!0}));try{const _=await X(this,On).start();if(_===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(_),(b=(y=X(this,Ui).config).onSuccess)==null||b.call(y,_,this),(v=(w=X(this,Ui).config).onSettled)==null||v.call(w,_,this.state.error,this),_}catch(_){if(_ instanceof Ky){if(_.silent)return X(this,On).promise;if(_.revert){if(this.state.data===void 0)throw _;return this.state.data}}throw dt(this,Si,ls).call(this,{type:"error",error:_}),(k=(N=X(this,Ui).config).onError)==null||k.call(N,_,this),(S=(A=X(this,Ui).config).onSettled)==null||S.call(A,this.state.data,_,this),_}finally{this.scheduleGc()}}},nl=new WeakMap,Do=new WeakMap,Ui=new WeakMap,il=new WeakMap,On=new WeakMap,qu=new WeakMap,rl=new WeakMap,Si=new WeakSet,f2=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},ls=function(t){const n=i=>{switch(t.type){case"failed":return{...i,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...i,fetchStatus:"paused"};case"continue":return{...i,fetchStatus:"fetching"};case"fetch":return{...i,...h2(i.data,this.options),fetchMeta:t.meta??null};case"success":const r={...i,...yk(t.data,t.dataUpdatedAt),dataUpdateCount:i.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ze(this,Do,t.manual?r:void 0),r;case"error":const a=t.error;return{...i,error:a,errorUpdateCount:i.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:i.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...i,isInvalidated:!0};case"setState":return{...i,...t.state}}};this.state=n(this.state),An.batch(()=>{this.observers.forEach(i=>{i.onQueryUpdate()}),X(this,Ui).notify({query:this,type:"updated",action:t})})},ZN);function h2(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:c2(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function yk(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function bk(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,i=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var ui,kt,Hu,Zn,sl,Oo,os,ha,Ku,Ro,Lo,al,ll,pa,zo,Dt,uu,Gy,Vy,Yy,Wy,Qy,Xy,Zy,p2,JN,MO=(JN=class extends Qo{constructor(t,n){super();Ye(this,Dt);Ye(this,ui);Ye(this,kt);Ye(this,Hu);Ye(this,Zn);Ye(this,sl);Ye(this,Oo);Ye(this,os);Ye(this,ha);Ye(this,Ku);Ye(this,Ro);Ye(this,Lo);Ye(this,al);Ye(this,ll);Ye(this,pa);Ye(this,zo,new Set);this.options=n,ze(this,ui,t),ze(this,ha,null),ze(this,os,Hy()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(X(this,kt).addObserver(this),xk(X(this,kt),this.options)?dt(this,Dt,uu).call(this):this.updateResult(),dt(this,Dt,Wy).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Jy(X(this,kt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Jy(X(this,kt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,dt(this,Dt,Qy).call(this),dt(this,Dt,Xy).call(this),X(this,kt).removeObserver(this)}setOptions(t){const n=this.options,i=X(this,kt);if(this.options=X(this,ui).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Fi(this.options.enabled,X(this,kt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");dt(this,Dt,Zy).call(this),X(this,kt).setOptions(this.options),n._defaulted&&!bh(this.options,n)&&X(this,ui).getQueryCache().notify({type:"observerOptionsUpdated",query:X(this,kt),observer:this});const r=this.hasListeners();r&&vk(X(this,kt),i,this.options,n)&&dt(this,Dt,uu).call(this),this.updateResult(),r&&(X(this,kt)!==i||Fi(this.options.enabled,X(this,kt))!==Fi(n.enabled,X(this,kt))||xa(this.options.staleTime,X(this,kt))!==xa(n.staleTime,X(this,kt)))&&dt(this,Dt,Gy).call(this);const a=dt(this,Dt,Vy).call(this);r&&(X(this,kt)!==i||Fi(this.options.enabled,X(this,kt))!==Fi(n.enabled,X(this,kt))||a!==X(this,pa))&&dt(this,Dt,Yy).call(this,a)}getOptimisticResult(t){const n=X(this,ui).getQueryCache().build(X(this,ui),t),i=this.createResult(n,t);return OO(this,i)&&(ze(this,Zn,i),ze(this,Oo,this.options),ze(this,sl,X(this,kt).state)),i}getCurrentResult(){return X(this,Zn)}trackResult(t,n){return new Proxy(t,{get:(i,r)=>(this.trackProp(r),n==null||n(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&X(this,os).status==="pending"&&X(this,os).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(i,r))})}trackProp(t){X(this,zo).add(t)}getCurrentQuery(){return X(this,kt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=X(this,ui).defaultQueryOptions(t),i=X(this,ui).getQueryCache().build(X(this,ui),n);return i.fetch().then(()=>this.createResult(i,n))}fetch(t){return dt(this,Dt,uu).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),X(this,Zn)))}createResult(t,n){var B;const i=X(this,kt),r=this.options,a=X(this,Zn),o=X(this,sl),u=X(this,Oo),h=t!==i?t.state:X(this,Hu),{state:g}=t;let p={...g},y=!1,b;if(n._optimisticResults){const P=this.hasListeners(),F=!P&&xk(t,n),U=P&&vk(t,i,n,r);(F||U)&&(p={...p,...h2(g.data,t.options)}),n._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:w,errorUpdatedAt:v,status:N}=p;b=p.data;let k=!1;if(n.placeholderData!==void 0&&b===void 0&&N==="pending"){let P;a!=null&&a.isPlaceholderData&&n.placeholderData===(u==null?void 0:u.placeholderData)?(P=a.data,k=!0):P=typeof n.placeholderData=="function"?n.placeholderData((B=X(this,Lo))==null?void 0:B.state.data,X(this,Lo)):n.placeholderData,P!==void 0&&(N="success",b=qy(a==null?void 0:a.data,P,n),y=!0)}if(n.select&&b!==void 0&&!k)if(a&&b===(o==null?void 0:o.data)&&n.select===X(this,Ku))b=X(this,Ro);else try{ze(this,Ku,n.select),b=n.select(b),b=qy(a==null?void 0:a.data,b,n),ze(this,Ro,b),ze(this,ha,null)}catch(P){ze(this,ha,P)}X(this,ha)&&(w=X(this,ha),b=X(this,Ro),v=Date.now(),N="error");const A=p.fetchStatus==="fetching",S=N==="pending",_=N==="error",C=S&&A,T=b!==void 0,O={status:N,fetchStatus:p.fetchStatus,isPending:S,isSuccess:N==="success",isError:_,isInitialLoading:C,isLoading:C,data:b,dataUpdatedAt:p.dataUpdatedAt,error:w,errorUpdatedAt:v,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:p.dataUpdateCount>h.dataUpdateCount||p.errorUpdateCount>h.errorUpdateCount,isFetching:A,isRefetching:A&&!S,isLoadingError:_&&!T,isPaused:p.fetchStatus==="paused",isPlaceholderData:y,isRefetchError:_&&T,isStale:Qb(t,n),refetch:this.refetch,promise:X(this,os),isEnabled:Fi(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const P=O.data!==void 0,F=O.status==="error"&&!P,U=H=>{F?H.reject(O.error):P&&H.resolve(O.data)},V=()=>{const H=ze(this,os,O.promise=Hy());U(H)},M=X(this,os);switch(M.status){case"pending":t.queryHash===i.queryHash&&U(M);break;case"fulfilled":(F||O.data!==M.value)&&V();break;case"rejected":(!F||O.error!==M.reason)&&V();break}}return O}updateResult(){const t=X(this,Zn),n=this.createResult(X(this,kt),this.options);if(ze(this,sl,X(this,kt).state),ze(this,Oo,this.options),X(this,sl).data!==void 0&&ze(this,Lo,X(this,kt)),bh(n,t))return;ze(this,Zn,n);const i=()=>{if(!t)return!0;const{notifyOnChangeProps:r}=this.options,a=typeof r=="function"?r():r;if(a==="all"||!a&&!X(this,zo).size)return!0;const o=new Set(a??X(this,zo));return this.options.throwOnError&&o.add("error"),Object.keys(X(this,Zn)).some(u=>{const d=u;return X(this,Zn)[d]!==t[d]&&o.has(d)})};dt(this,Dt,p2).call(this,{listeners:i()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&dt(this,Dt,Wy).call(this)}},ui=new WeakMap,kt=new WeakMap,Hu=new WeakMap,Zn=new WeakMap,sl=new WeakMap,Oo=new WeakMap,os=new WeakMap,ha=new WeakMap,Ku=new WeakMap,Ro=new WeakMap,Lo=new WeakMap,al=new WeakMap,ll=new WeakMap,pa=new WeakMap,zo=new WeakMap,Dt=new WeakSet,uu=function(t){dt(this,Dt,Zy).call(this);let n=X(this,kt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(ei)),n},Gy=function(){dt(this,Dt,Qy).call(this);const t=xa(this.options.staleTime,X(this,kt));if(Nu.isServer()||X(this,Zn).isStale||!Uy(t))return;const i=a2(X(this,Zn).dataUpdatedAt,t)+1;ze(this,al,Wa.setTimeout(()=>{X(this,Zn).isStale||this.updateResult()},i))},Vy=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(X(this,kt)):this.options.refetchInterval)??!1},Yy=function(t){dt(this,Dt,Xy).call(this),ze(this,pa,t),!(Nu.isServer()||Fi(this.options.enabled,X(this,kt))===!1||!Uy(X(this,pa))||X(this,pa)===0)&&ze(this,ll,Wa.setInterval(()=>{(this.options.refetchIntervalInBackground||Gb.isFocused())&&dt(this,Dt,uu).call(this)},X(this,pa)))},Wy=function(){dt(this,Dt,Gy).call(this),dt(this,Dt,Yy).call(this,dt(this,Dt,Vy).call(this))},Qy=function(){X(this,al)!==void 0&&(Wa.clearTimeout(X(this,al)),ze(this,al,void 0))},Xy=function(){X(this,ll)!==void 0&&(Wa.clearInterval(X(this,ll)),ze(this,ll,void 0))},Zy=function(){const t=X(this,ui).getQueryCache().build(X(this,ui),this.options);if(t===X(this,kt))return;const n=X(this,kt);ze(this,kt,t),ze(this,Hu,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},p2=function(t){An.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(X(this,Zn))}),X(this,ui).getQueryCache().notify({query:X(this,kt),type:"observerResultsUpdated"})})},JN);function DO(e,t){return Fi(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function xk(e,t){return DO(e,t)||e.state.data!==void 0&&Jy(e,t,t.refetchOnMount)}function Jy(e,t,n){if(Fi(t.enabled,e)!==!1&&xa(t.staleTime,e)!=="static"){const i=typeof n=="function"?n(e):n;return i==="always"||i!==!1&&Qb(e,t)}return!1}function vk(e,t,n,i){return(e!==t||Fi(i.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Qb(e,n)}function Qb(e,t){return Fi(t.enabled,e)!==!1&&e.isStaleByTime(xa(t.staleTime,e))}function OO(e,t){return!bh(e.getCurrentResult(),t)}function wk(e){return{onFetch:(t,n)=>{var g,p,y,b,w;const i=t.options,r=(y=(p=(g=t.fetchOptions)==null?void 0:g.meta)==null?void 0:p.fetchMore)==null?void 0:y.direction,a=((b=t.state.data)==null?void 0:b.pages)||[],o=((w=t.state.data)==null?void 0:w.pageParams)||[];let u={pages:[],pageParams:[]},d=0;const h=async()=>{let v=!1;const N=S=>{NO(S,()=>t.signal,()=>v=!0)},k=o2(t.options,t.fetchOptions),A=async(S,_,C)=>{if(v)return Promise.reject();if(_==null&&S.pages.length)return Promise.resolve(S);const R=(()=>{const F={client:t.client,queryKey:t.queryKey,pageParam:_,direction:C?"backward":"forward",meta:t.options.meta};return N(F),F})(),O=await k(R),{maxPages:B}=t.options,P=C?SO:EO;return{pages:P(S.pages,O,B),pageParams:P(S.pageParams,_,B)}};if(r&&a.length){const S=r==="backward",_=S?RO:kk,C={pages:a,pageParams:o},T=_(i,C);u=await A(C,T,S)}else{const S=e??a.length;do{const _=d===0?o[0]??i.initialPageParam:kk(i,u);if(d>0&&_==null)break;u=await A(u,_),d++}while(d<S)}return u};t.options.persister?t.fetchFn=()=>{var v,N;return(N=(v=t.options).persister)==null?void 0:N.call(v,h,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=h}}}function kk(e,{pages:t,pageParams:n}){const i=t.length-1;return t.length>0?e.getNextPageParam(t[i],t,n[i],n):void 0}function RO(e,{pages:t,pageParams:n}){var i;return t.length>0?(i=e.getPreviousPageParam)==null?void 0:i.call(e,t[0],t,n[0],n):void 0}var Gu,Cr,Kn,ol,Ar,la,e2,LO=(e2=class extends d2{constructor(t){super();Ye(this,Ar);Ye(this,Gu);Ye(this,Cr);Ye(this,Kn);Ye(this,ol);ze(this,Gu,t.client),this.mutationId=t.mutationId,ze(this,Kn,t.mutationCache),ze(this,Cr,[]),this.state=t.state||m2(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){X(this,Cr).includes(t)||(X(this,Cr).push(t),this.clearGcTimeout(),X(this,Kn).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ze(this,Cr,X(this,Cr).filter(n=>n!==t)),this.scheduleGc(),X(this,Kn).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){X(this,Cr).length||(this.state.status==="pending"?this.scheduleGc():X(this,Kn).remove(this))}continue(){var t;return((t=X(this,ol))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,u,d,h,g,p,y,b,w,v,N,k,A,S,_,C,T,R;const n=()=>{dt(this,Ar,la).call(this,{type:"continue"})},i={client:X(this,Gu),meta:this.options.meta,mutationKey:this.options.mutationKey};ze(this,ol,u2({fn:()=>this.options.mutationFn?this.options.mutationFn(t,i):Promise.reject(new Error("No mutationFn found")),onFail:(O,B)=>{dt(this,Ar,la).call(this,{type:"failed",failureCount:O,error:B})},onPause:()=>{dt(this,Ar,la).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>X(this,Kn).canRun(this)}));const r=this.state.status==="pending",a=!X(this,ol).canStart();try{if(r)n();else{dt(this,Ar,la).call(this,{type:"pending",variables:t,isPaused:a}),X(this,Kn).config.onMutate&&await X(this,Kn).config.onMutate(t,this,i);const B=await((u=(o=this.options).onMutate)==null?void 0:u.call(o,t,i));B!==this.state.context&&dt(this,Ar,la).call(this,{type:"pending",context:B,variables:t,isPaused:a})}const O=await X(this,ol).start();return await((h=(d=X(this,Kn).config).onSuccess)==null?void 0:h.call(d,O,t,this.state.context,this,i)),await((p=(g=this.options).onSuccess)==null?void 0:p.call(g,O,t,this.state.context,i)),await((b=(y=X(this,Kn).config).onSettled)==null?void 0:b.call(y,O,null,this.state.variables,this.state.context,this,i)),await((v=(w=this.options).onSettled)==null?void 0:v.call(w,O,null,t,this.state.context,i)),dt(this,Ar,la).call(this,{type:"success",data:O}),O}catch(O){try{await((k=(N=X(this,Kn).config).onError)==null?void 0:k.call(N,O,t,this.state.context,this,i))}catch(B){Promise.reject(B)}try{await((S=(A=this.options).onError)==null?void 0:S.call(A,O,t,this.state.context,i))}catch(B){Promise.reject(B)}try{await((C=(_=X(this,Kn).config).onSettled)==null?void 0:C.call(_,void 0,O,this.state.variables,this.state.context,this,i))}catch(B){Promise.reject(B)}try{await((R=(T=this.options).onSettled)==null?void 0:R.call(T,void 0,O,t,this.state.context,i))}catch(B){Promise.reject(B)}throw dt(this,Ar,la).call(this,{type:"error",error:O}),O}finally{X(this,Kn).runNext(this)}}},Gu=new WeakMap,Cr=new WeakMap,Kn=new WeakMap,ol=new WeakMap,Ar=new WeakSet,la=function(t){const n=i=>{switch(t.type){case"failed":return{...i,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...i,isPaused:!0};case"continue":return{...i,isPaused:!1};case"pending":return{...i,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...i,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...i,data:void 0,error:t.error,failureCount:i.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),An.batch(()=>{X(this,Cr).forEach(i=>{i.onMutationUpdate(t)}),X(this,Kn).notify({mutation:this,type:"updated",action:t})})},e2);function m2(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var cs,rr,Vu,t2,zO=(t2=class extends Qo{constructor(t={}){super();Ye(this,cs);Ye(this,rr);Ye(this,Vu);this.config=t,ze(this,cs,new Set),ze(this,rr,new Map),ze(this,Vu,0)}build(t,n,i){const r=new LO({client:t,mutationCache:this,mutationId:++_f(this,Vu)._,options:t.defaultMutationOptions(n),state:i});return this.add(r),r}add(t){X(this,cs).add(t);const n=jf(t);if(typeof n=="string"){const i=X(this,rr).get(n);i?i.push(t):X(this,rr).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(X(this,cs).delete(t)){const n=jf(t);if(typeof n=="string"){const i=X(this,rr).get(n);if(i)if(i.length>1){const r=i.indexOf(t);r!==-1&&i.splice(r,1)}else i[0]===t&&X(this,rr).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=jf(t);if(typeof n=="string"){const i=X(this,rr).get(n),r=i==null?void 0:i.find(a=>a.state.status==="pending");return!r||r===t}else return!0}runNext(t){var i;const n=jf(t);if(typeof n=="string"){const r=(i=X(this,rr).get(n))==null?void 0:i.find(a=>a!==t&&a.state.isPaused);return(r==null?void 0:r.continue())??Promise.resolve()}else return Promise.resolve()}clear(){An.batch(()=>{X(this,cs).forEach(t=>{this.notify({type:"removed",mutation:t})}),X(this,cs).clear(),X(this,rr).clear()})}getAll(){return Array.from(X(this,cs))}find(t){const n={exact:!0,...t};return this.getAll().find(i=>pk(n,i))}findAll(t={}){return this.getAll().filter(n=>pk(t,n))}notify(t){An.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return An.batch(()=>Promise.all(t.map(n=>n.continue().catch(ei))))}},cs=new WeakMap,rr=new WeakMap,Vu=new WeakMap,t2);function jf(e){var t;return(t=e.options.scope)==null?void 0:t.id}var us,ma,di,ds,gs,ih,eb,n2,IO=(n2=class extends Qo{constructor(n,i){super();Ye(this,gs);Ye(this,us);Ye(this,ma);Ye(this,di);Ye(this,ds);ze(this,us,n),this.setOptions(i),this.bindMethods(),dt(this,gs,ih).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var r;const i=this.options;this.options=X(this,us).defaultMutationOptions(n),bh(this.options,i)||X(this,us).getMutationCache().notify({type:"observerOptionsUpdated",mutation:X(this,di),observer:this}),i!=null&&i.mutationKey&&this.options.mutationKey&&dl(i.mutationKey)!==dl(this.options.mutationKey)?this.reset():((r=X(this,di))==null?void 0:r.state.status)==="pending"&&X(this,di).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=X(this,di))==null||n.removeObserver(this)}onMutationUpdate(n){dt(this,gs,ih).call(this),dt(this,gs,eb).call(this,n)}getCurrentResult(){return X(this,ma)}reset(){var n;(n=X(this,di))==null||n.removeObserver(this),ze(this,di,void 0),dt(this,gs,ih).call(this),dt(this,gs,eb).call(this)}mutate(n,i){var r;return ze(this,ds,i),(r=X(this,di))==null||r.removeObserver(this),ze(this,di,X(this,us).getMutationCache().build(X(this,us),this.options)),X(this,di).addObserver(this),X(this,di).execute(n)}},us=new WeakMap,ma=new WeakMap,di=new WeakMap,ds=new WeakMap,gs=new WeakSet,ih=function(){var i;const n=((i=X(this,di))==null?void 0:i.state)??m2();ze(this,ma,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},eb=function(n){An.batch(()=>{var i,r,a,o,u,d,h,g;if(X(this,ds)&&this.hasListeners()){const p=X(this,ma).variables,y=X(this,ma).context,b={client:X(this,us),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(r=(i=X(this,ds)).onSuccess)==null||r.call(i,n.data,p,y,b)}catch(w){Promise.reject(w)}try{(o=(a=X(this,ds)).onSettled)==null||o.call(a,n.data,null,p,y,b)}catch(w){Promise.reject(w)}}else if((n==null?void 0:n.type)==="error"){try{(d=(u=X(this,ds)).onError)==null||d.call(u,n.error,p,y,b)}catch(w){Promise.reject(w)}try{(g=(h=X(this,ds)).onSettled)==null||g.call(h,void 0,n.error,p,y,b)}catch(w){Promise.reject(w)}}}this.listeners.forEach(p=>{p(X(this,ma))})})},n2),Tr,i2,PO=(i2=class extends Qo{constructor(t={}){super();Ye(this,Tr);this.config=t,ze(this,Tr,new Map)}build(t,n,i){const r=n.queryKey,a=n.queryHash??Vb(r,n);let o=this.get(a);return o||(o=new TO({client:t,queryKey:r,queryHash:a,options:t.defaultQueryOptions(n),state:i,defaultOptions:t.getQueryDefaults(r)}),this.add(o)),o}add(t){X(this,Tr).has(t.queryHash)||(X(this,Tr).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=X(this,Tr).get(t.queryHash);n&&(t.destroy(),n===t&&X(this,Tr).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){An.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return X(this,Tr).get(t)}getAll(){return[...X(this,Tr).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(i=>hk(n,i))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(i=>hk(t,i)):n}notify(t){An.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){An.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){An.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Tr=new WeakMap,i2),gn,ga,ya,Io,Po,ba,Bo,$o,r2,BO=(r2=class{constructor(e={}){Ye(this,gn);Ye(this,ga);Ye(this,ya);Ye(this,Io);Ye(this,Po);Ye(this,ba);Ye(this,Bo);Ye(this,$o);ze(this,gn,e.queryCache||new PO),ze(this,ga,e.mutationCache||new zO),ze(this,ya,e.defaultOptions||{}),ze(this,Io,new Map),ze(this,Po,new Map),ze(this,ba,0)}mount(){_f(this,ba)._++,X(this,ba)===1&&(ze(this,Bo,Gb.subscribe(async e=>{e&&(await this.resumePausedMutations(),X(this,gn).onFocus())})),ze(this,$o,xh.subscribe(async e=>{e&&(await this.resumePausedMutations(),X(this,gn).onOnline())})))}unmount(){var e,t;_f(this,ba)._--,X(this,ba)===0&&((e=X(this,Bo))==null||e.call(this),ze(this,Bo,void 0),(t=X(this,$o))==null||t.call(this),ze(this,$o,void 0))}isFetching(e){return X(this,gn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return X(this,ga).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=X(this,gn).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=X(this,gn).build(this,t),i=n.state.data;return i===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(xa(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(i))}getQueriesData(e){return X(this,gn).findAll(e).map(({queryKey:t,state:n})=>{const i=n.data;return[t,i]})}setQueryData(e,t,n){const i=this.defaultQueryOptions({queryKey:e}),r=X(this,gn).get(i.queryHash),a=r==null?void 0:r.state.data,o=vO(t,a);if(o!==void 0)return X(this,gn).build(this,i).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return An.batch(()=>X(this,gn).findAll(e).map(({queryKey:i})=>[i,this.setQueryData(i,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=X(this,gn).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=X(this,gn);An.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=X(this,gn);return An.batch(()=>(n.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},i=An.batch(()=>X(this,gn).findAll(e).map(r=>r.cancel(n)));return Promise.all(i).then(ei).catch(ei)}invalidateQueries(e,t={}){return An.batch(()=>(X(this,gn).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},i=An.batch(()=>X(this,gn).findAll(e).filter(r=>!r.isDisabled()&&!r.isStatic()).map(r=>{let a=r.fetch(void 0,n);return n.throwOnError||(a=a.catch(ei)),r.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(i).then(ei)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=X(this,gn).build(this,t);return n.isStaleByTime(xa(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(ei).catch(ei)}fetchInfiniteQuery(e){return e.behavior=wk(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(ei).catch(ei)}ensureInfiniteQueryData(e){return e.behavior=wk(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return xh.isOnline()?X(this,ga).resumePausedMutations():Promise.resolve()}getQueryCache(){return X(this,gn)}getMutationCache(){return X(this,ga)}getDefaultOptions(){return X(this,ya)}setDefaultOptions(e){ze(this,ya,e)}setQueryDefaults(e,t){X(this,Io).set(dl(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...X(this,Io).values()],n={};return t.forEach(i=>{Su(e,i.queryKey)&&Object.assign(n,i.defaultOptions)}),n}setMutationDefaults(e,t){X(this,Po).set(dl(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...X(this,Po).values()],n={};return t.forEach(i=>{Su(e,i.mutationKey)&&Object.assign(n,i.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...X(this,ya).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Vb(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Yb&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...X(this,ya).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){X(this,gn).clear(),X(this,ga).clear()}},gn=new WeakMap,ga=new WeakMap,ya=new WeakMap,Io=new WeakMap,Po=new WeakMap,ba=new WeakMap,Bo=new WeakMap,$o=new WeakMap,r2),g2=j.createContext(void 0),Ft=e=>{const t=j.useContext(g2);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},$O=({client:e,children:t})=>(j.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),c.jsx(g2.Provider,{value:e,children:t})),y2=j.createContext(!1),UO=()=>j.useContext(y2);y2.Provider;function FO(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var qO=j.createContext(FO()),HO=()=>j.useContext(qO),KO=(e,t,n)=>{const i=n!=null&&n.state.error&&typeof e.throwOnError=="function"?Wb(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||i)&&(t.isReset()||(e.retryOnMount=!1))},GO=e=>{j.useEffect(()=>{e.clearReset()},[e])},VO=({result:e,errorResetBoundary:t,throwOnError:n,query:i,suspense:r})=>e.isError&&!t.isReset()&&!e.isFetching&&i&&(r&&e.data===void 0||Wb(n,[e.error,i])),YO=e=>{if(e.suspense){const n=r=>r==="static"?r:Math.max(r??1e3,1e3),i=e.staleTime;e.staleTime=typeof i=="function"?(...r)=>n(i(...r)):n(i),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},WO=(e,t)=>e.isLoading&&e.isFetching&&!t,QO=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Ek=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function XO(e,t,n){var y,b,w,v;const i=UO(),r=HO(),a=Ft(),o=a.defaultQueryOptions(e);(b=(y=a.getDefaultOptions().queries)==null?void 0:y._experimental_beforeQuery)==null||b.call(y,o);const u=a.getQueryCache().get(o.queryHash);o._optimisticResults=i?"isRestoring":"optimistic",YO(o),KO(o,r,u),GO(r);const d=!a.getQueryCache().get(o.queryHash),[h]=j.useState(()=>new t(a,o)),g=h.getOptimisticResult(o),p=!i&&e.subscribed!==!1;if(j.useSyncExternalStore(j.useCallback(N=>{const k=p?h.subscribe(An.batchCalls(N)):ei;return h.updateResult(),k},[h,p]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),j.useEffect(()=>{h.setOptions(o)},[o,h]),QO(o,g))throw Ek(o,h,r);if(VO({result:g,errorResetBoundary:r,throwOnError:o.throwOnError,query:u,suspense:o.suspense}))throw g.error;if((v=(w=a.getDefaultOptions().queries)==null?void 0:w._experimental_afterQuery)==null||v.call(w,o,g),o.experimental_prefetchInRender&&!Nu.isServer()&&WO(g,i)){const N=d?Ek(o,h,r):u==null?void 0:u.promise;N==null||N.catch(ei).finally(()=>{h.updateResult()})}return o.notifyOnChangeProps?g:h.trackResult(g)}function Ve(e,t){return XO(e,MO)}function Et(e,t){const n=Ft(),[i]=j.useState(()=>new IO(n,e));j.useEffect(()=>{i.setOptions(e)},[i,e]);const r=j.useSyncExternalStore(j.useCallback(o=>i.subscribe(An.batchCalls(o)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),a=j.useCallback((o,u)=>{i.mutate(o,u).catch(ei)},[i]);if(r.error&&Wb(i.options.throwOnError,[r.error]))throw r.error;return{...r,mutate:a,mutateAsync:r.mutate}}/**
|
|
50
|
+
* react-router v7.14.2
|
|
51
|
+
*
|
|
52
|
+
* Copyright (c) Remix Software Inc.
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the MIT license found in the
|
|
55
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
56
|
+
*
|
|
57
|
+
* @license MIT
|
|
58
|
+
*/var Sk="popstate";function Nk(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function ZO(e={}){function t(i,r){var h;let a=(h=r.state)==null?void 0:h.masked,{pathname:o,search:u,hash:d}=a||i.location;return tb("",{pathname:o,search:u,hash:d},r.state&&r.state.usr||null,r.state&&r.state.key||"default",a?{pathname:i.location.pathname,search:i.location.search,hash:i.location.hash}:void 0)}function n(i,r){return typeof r=="string"?r:_u(r)}return eR(t,n,null,e)}function cn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function fr(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function JO(){return Math.random().toString(36).substring(2,10)}function _k(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 tb(e,t,n=null,i,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Xo(t):t,state:n,key:t&&t.key||i||JO(),unstable_mask:r}}function _u({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 Xo(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 eR(e,t,n,i={}){let{window:r=document.defaultView,v5Compat:a=!1}=i,o=r.history,u="POP",d=null,h=g();h==null&&(h=0,o.replaceState({...o.state,idx:h},""));function g(){return(o.state||{idx:null}).idx}function p(){u="POP";let N=g(),k=N==null?null:N-h;h=N,d&&d({action:u,location:v.location,delta:k})}function y(N,k){u="PUSH";let A=Nk(N)?N:tb(v.location,N,k);h=g()+1;let S=_k(A,h),_=v.createHref(A.unstable_mask||A);try{o.pushState(S,"",_)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;r.location.assign(_)}a&&d&&d({action:u,location:v.location,delta:1})}function b(N,k){u="REPLACE";let A=Nk(N)?N:tb(v.location,N,k);h=g();let S=_k(A,h),_=v.createHref(A.unstable_mask||A);o.replaceState(S,"",_),a&&d&&d({action:u,location:v.location,delta:0})}function w(N){return tR(N)}let v={get action(){return u},get location(){return e(r,o)},listen(N){if(d)throw new Error("A history only accepts one active listener");return r.addEventListener(Sk,p),d=N,()=>{r.removeEventListener(Sk,p),d=null}},createHref(N){return t(r,N)},createURL:w,encodeLocation(N){let k=w(N);return{pathname:k.pathname,search:k.search,hash:k.hash}},push:y,replace:b,go(N){return o.go(N)}};return v}function tR(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),cn(n,"No window.location.(origin|href) available to create URL");let i=typeof e=="string"?e:_u(e);return i=i.replace(/ $/,"%20"),!t&&i.startsWith("//")&&(i=n+i),new URL(i,n)}function b2(e,t,n="/"){return nR(e,t,n,!1)}function nR(e,t,n,i){let r=typeof t=="string"?Xo(t):t,a=ys(r.pathname||"/",n);if(a==null)return null;let o=x2(e);iR(o);let u=null;for(let d=0;u==null&&d<o.length;++d){let h=pR(a);u=fR(o[d],h,i)}return u}function x2(e,t=[],n=[],i="",r=!1){let a=(o,u,d=r,h)=>{let g={relativePath:h===void 0?o.path||"":h,caseSensitive:o.caseSensitive===!0,childrenIndex:u,route:o};if(g.relativePath.startsWith("/")){if(!g.relativePath.startsWith(i)&&d)return;cn(g.relativePath.startsWith(i),`Absolute route path "${g.relativePath}" nested under path "${i}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),g.relativePath=g.relativePath.slice(i.length)}let p=ur([i,g.relativePath]),y=n.concat(g);o.children&&o.children.length>0&&(cn(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),x2(o.children,t,y,p,d)),!(o.path==null&&!o.index)&&t.push({path:p,score:uR(p,o.index),routesMeta:y})};return e.forEach((o,u)=>{var d;if(o.path===""||!((d=o.path)!=null&&d.includes("?")))a(o,u);else for(let h of v2(o.path))a(o,u,!0,h)}),t}function v2(e){let t=e.split("/");if(t.length===0)return[];let[n,...i]=t,r=n.endsWith("?"),a=n.replace(/\?$/,"");if(i.length===0)return r?[a,""]:[a];let o=v2(i.join("/")),u=[];return u.push(...o.map(d=>d===""?a:[a,d].join("/"))),r&&u.push(...o),u.map(d=>e.startsWith("/")&&d===""?"/":d)}function iR(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:dR(t.routesMeta.map(i=>i.childrenIndex),n.routesMeta.map(i=>i.childrenIndex)))}var rR=/^:[\w-]+$/,sR=3,aR=2,lR=1,oR=10,cR=-2,jk=e=>e==="*";function uR(e,t){let n=e.split("/"),i=n.length;return n.some(jk)&&(i+=cR),t&&(i+=aR),n.filter(r=>!jk(r)).reduce((r,a)=>r+(rR.test(a)?sR:a===""?lR:oR),i)}function dR(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 fR(e,t,n=!1){let{routesMeta:i}=e,r={},a="/",o=[];for(let u=0;u<i.length;++u){let d=i[u],h=u===i.length-1,g=a==="/"?t:t.slice(a.length)||"/",p=vh({path:d.relativePath,caseSensitive:d.caseSensitive,end:h},g),y=d.route;if(!p&&h&&n&&!i[i.length-1].route.index&&(p=vh({path:d.relativePath,caseSensitive:d.caseSensitive,end:!1},g)),!p)return null;Object.assign(r,p.params),o.push({params:r,pathname:ur([a,p.pathname]),pathnameBase:bR(ur([a,p.pathnameBase])),route:y}),p.pathnameBase!=="/"&&(a=ur([a,p.pathnameBase]))}return o}function vh(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,i]=hR(e.path,e.caseSensitive,e.end),r=t.match(n);if(!r)return null;let a=r[0],o=a.replace(/(.)\/+$/,"$1"),u=r.slice(1);return{params:i.reduce((h,{paramName:g,isOptional:p},y)=>{if(g==="*"){let w=u[y]||"";o=a.slice(0,a.length-w.length).replace(/(.)\/+$/,"$1")}const b=u[y];return p&&!b?h[g]=void 0:h[g]=(b||"").replace(/%2F/g,"/"),h},{}),pathname:a,pathnameBase:o,pattern:e}}function hR(e,t=!1,n=!0){fr(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,(o,u,d,h,g)=>{if(i.push({paramName:u,isOptional:d!=null}),d){let p=g.charAt(h+o.length);return p&&p!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}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 pR(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return fr(!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 ys(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 mR=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function gR(e,t="/"){let{pathname:n,search:i="",hash:r=""}=typeof e=="string"?Xo(e):e,a;return n?(n=k2(n),n.startsWith("/")?a=Ck(n.substring(1),"/"):a=Ck(n,t)):a=t,{pathname:a,search:xR(i),hash:vR(r)}}function Ck(e,t){let n=wh(t).split("/");return e.split("/").forEach(r=>{r===".."?n.length>1&&n.pop():r!=="."&&n.push(r)}),n.length>1?n.join("/"):"/"}function $g(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 yR(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function w2(e){let t=yR(e);return t.map((n,i)=>i===t.length-1?n.pathname:n.pathnameBase)}function Xb(e,t,n,i=!1){let r;typeof e=="string"?r=Xo(e):(r={...e},cn(!r.pathname||!r.pathname.includes("?"),$g("?","pathname","search",r)),cn(!r.pathname||!r.pathname.includes("#"),$g("#","pathname","hash",r)),cn(!r.search||!r.search.includes("#"),$g("#","search","hash",r)));let a=e===""||r.pathname==="",o=a?"/":r.pathname,u;if(o==null)u=n;else{let p=t.length-1;if(!i&&o.startsWith("..")){let y=o.split("/");for(;y[0]==="..";)y.shift(),p-=1;r.pathname=y.join("/")}u=p>=0?t[p]:"/"}let d=gR(r,u),h=o&&o!=="/"&&o.endsWith("/"),g=(a||o===".")&&n.endsWith("/");return!d.pathname.endsWith("/")&&(h||g)&&(d.pathname+="/"),d}var k2=e=>e.replace(/\/\/+/g,"/"),ur=e=>k2(e.join("/")),wh=e=>e.replace(/\/+$/,""),bR=e=>wh(e).replace(/^\/*/,"/"),xR=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,vR=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,wR=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 kR(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function ER(e){let t=e.map(n=>n.route.path).filter(Boolean);return ur(t)||"/"}var E2=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function S2(e,t){let n=e;if(typeof n!="string"||!mR.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let i=n,r=!1;if(E2)try{let a=new URL(window.location.href),o=n.startsWith("//")?new URL(a.protocol+n):new URL(n),u=ys(o.pathname,t);o.origin===a.origin&&u!=null?n=u+o.search+o.hash:r=!0}catch{fr(!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 N2=["POST","PUT","PATCH","DELETE"];new Set(N2);var SR=["GET",...N2];new Set(SR);var Zo=j.createContext(null);Zo.displayName="DataRouter";var Wh=j.createContext(null);Wh.displayName="DataRouterState";var _2=j.createContext(!1);function NR(){return j.useContext(_2)}var j2=j.createContext({isTransitioning:!1});j2.displayName="ViewTransition";var _R=j.createContext(new Map);_R.displayName="Fetchers";var jR=j.createContext(null);jR.displayName="Await";var Vi=j.createContext(null);Vi.displayName="Navigation";var Qu=j.createContext(null);Qu.displayName="Location";var pr=j.createContext({outlet:null,matches:[],isDataRoute:!1});pr.displayName="Route";var Zb=j.createContext(null);Zb.displayName="RouteError";var C2="REACT_ROUTER_ERROR",CR="REDIRECT",AR="ROUTE_ERROR_RESPONSE";function TR(e){if(e.startsWith(`${C2}:${CR}:{`))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 MR(e){if(e.startsWith(`${C2}:${AR}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new wR(t.status,t.statusText,t.data)}catch{}}function DR(e,{relative:t}={}){cn(Xu(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:i}=j.useContext(Vi),{hash:r,pathname:a,search:o}=Zu(e,{relative:t}),u=a;return n!=="/"&&(u=a==="/"?n:ur([n,a])),i.createHref({pathname:u,search:o,hash:r})}function Xu(){return j.useContext(Qu)!=null}function zr(){return cn(Xu(),"useLocation() may be used only in the context of a <Router> component."),j.useContext(Qu).location}var A2="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function T2(e){j.useContext(Vi).static||j.useLayoutEffect(e)}function wl(){let{isDataRoute:e}=j.useContext(pr);return e?VR():OR()}function OR(){cn(Xu(),"useNavigate() may be used only in the context of a <Router> component.");let e=j.useContext(Zo),{basename:t,navigator:n}=j.useContext(Vi),{matches:i}=j.useContext(pr),{pathname:r}=zr(),a=JSON.stringify(w2(i)),o=j.useRef(!1);return T2(()=>{o.current=!0}),j.useCallback((d,h={})=>{if(fr(o.current,A2),!o.current)return;if(typeof d=="number"){n.go(d);return}let g=Xb(d,JSON.parse(a),r,h.relative==="path");e==null&&t!=="/"&&(g.pathname=g.pathname==="/"?t:ur([t,g.pathname])),(h.replace?n.replace:n.push)(g,h.state,h)},[t,n,a,r,e])}var RR=j.createContext(null);function LR(e){let t=j.useContext(pr).outlet;return j.useMemo(()=>t&&j.createElement(RR.Provider,{value:e},t),[t,e])}function Jb(){let{matches:e}=j.useContext(pr),t=e[e.length-1];return(t==null?void 0:t.params)??{}}function Zu(e,{relative:t}={}){let{matches:n}=j.useContext(pr),{pathname:i}=zr(),r=JSON.stringify(w2(n));return j.useMemo(()=>Xb(e,JSON.parse(r),i,t==="path"),[e,r,i,t])}function zR(e,t){return M2(e,t)}function M2(e,t,n){var N;cn(Xu(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=j.useContext(Vi),{matches:r}=j.useContext(pr),a=r[r.length-1],o=a?a.params:{},u=a?a.pathname:"/",d=a?a.pathnameBase:"/",h=a&&a.route;{let k=h&&h.path||"";O2(u,!h||k.endsWith("*")||k.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${k}">) 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.
|
|
59
|
+
|
|
60
|
+
Please change the parent <Route path="${k}"> to <Route path="${k==="/"?"*":`${k}/*`}">.`)}let g=zr(),p;if(t){let k=typeof t=="string"?Xo(t):t;cn(d==="/"||((N=k.pathname)==null?void 0:N.startsWith(d)),`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 "${d}" but pathname "${k.pathname}" was given in the \`location\` prop.`),p=k}else p=g;let y=p.pathname||"/",b=y;if(d!=="/"){let k=d.replace(/^\//,"").split("/");b="/"+y.replace(/^\//,"").split("/").slice(k.length).join("/")}let w=b2(e,{pathname:b});fr(h||w!=null,`No routes matched location "${p.pathname}${p.search}${p.hash}" `),fr(w==null||w[w.length-1].route.element!==void 0||w[w.length-1].route.Component!==void 0||w[w.length-1].route.lazy!==void 0,`Matched leaf route at location "${p.pathname}${p.search}${p.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 v=UR(w&&w.map(k=>Object.assign({},k,{params:Object.assign({},o,k.params),pathname:ur([d,i.encodeLocation?i.encodeLocation(k.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?d:ur([d,i.encodeLocation?i.encodeLocation(k.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathnameBase])})),r,n);return t&&v?j.createElement(Qu.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...p},navigationType:"POP"}},v):v}function IR(){let e=GR(),t=kR(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},a={padding:"2px 4px",backgroundColor:i},o=null;return console.error("Error handled by React Router default ErrorBoundary:",e),o=j.createElement(j.Fragment,null,j.createElement("p",null,"💿 Hey developer 👋"),j.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",j.createElement("code",{style:a},"ErrorBoundary")," or"," ",j.createElement("code",{style:a},"errorElement")," prop on your route.")),j.createElement(j.Fragment,null,j.createElement("h2",null,"Unexpected Application Error!"),j.createElement("h3",{style:{fontStyle:"italic"}},t),n?j.createElement("pre",{style:r},n):null,o)}var PR=j.createElement(IR,null),D2=class extends j.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=MR(e.digest);n&&(e=n)}let t=e!==void 0?j.createElement(pr.Provider,{value:this.props.routeContext},j.createElement(Zb.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?j.createElement(BR,{error:e},t):t}};D2.contextType=_2;var Ug=new WeakMap;function BR({children:e,error:t}){let{basename:n}=j.useContext(Vi);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let i=TR(t.digest);if(i){let r=Ug.get(t);if(r)throw r;let a=S2(i.location,n);if(E2&&!Ug.get(t))if(a.isExternal||i.reloadDocument)window.location.href=a.absoluteURL||a.to;else{const o=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:i.replace}));throw Ug.set(t,o),o}return j.createElement("meta",{httpEquiv:"refresh",content:`0;url=${a.absoluteURL||a.to}`})}}return e}function $R({routeContext:e,match:t,children:n}){let i=j.useContext(Zo);return i&&i.static&&i.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=t.route.id),j.createElement(pr.Provider,{value:e},n)}function UR(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,a=i==null?void 0:i.errors;if(a!=null){let g=r.findIndex(p=>p.route.id&&(a==null?void 0:a[p.route.id])!==void 0);cn(g>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(",")}`),r=r.slice(0,Math.min(r.length,g+1))}let o=!1,u=-1;if(n&&i){o=i.renderFallback;for(let g=0;g<r.length;g++){let p=r[g];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(u=g),p.route.id){let{loaderData:y,errors:b}=i,w=p.route.loader&&!y.hasOwnProperty(p.route.id)&&(!b||b[p.route.id]===void 0);if(p.route.lazy||w){n.isStatic&&(o=!0),u>=0?r=r.slice(0,u+1):r=[r[0]];break}}}}let d=n==null?void 0:n.onError,h=i&&d?(g,p)=>{var y,b;d(g,{location:i.location,params:((b=(y=i.matches)==null?void 0:y[0])==null?void 0:b.params)??{},unstable_pattern:ER(i.matches),errorInfo:p})}:void 0;return r.reduceRight((g,p,y)=>{let b,w=!1,v=null,N=null;i&&(b=a&&p.route.id?a[p.route.id]:void 0,v=p.route.errorElement||PR,o&&(u<0&&y===0?(O2("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),w=!0,N=null):u===y&&(w=!0,N=p.route.hydrateFallbackElement||null)));let k=t.concat(r.slice(0,y+1)),A=()=>{let S;return b?S=v:w?S=N:p.route.Component?S=j.createElement(p.route.Component,null):p.route.element?S=p.route.element:S=g,j.createElement($R,{match:p,routeContext:{outlet:g,matches:k,isDataRoute:i!=null},children:S})};return i&&(p.route.ErrorBoundary||p.route.errorElement||y===0)?j.createElement(D2,{location:i.location,revalidation:i.revalidation,component:v,error:b,children:A(),routeContext:{outlet:null,matches:k,isDataRoute:!0},onError:h}):A()},null)}function ex(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function FR(e){let t=j.useContext(Zo);return cn(t,ex(e)),t}function qR(e){let t=j.useContext(Wh);return cn(t,ex(e)),t}function HR(e){let t=j.useContext(pr);return cn(t,ex(e)),t}function tx(e){let t=HR(e),n=t.matches[t.matches.length-1];return cn(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function KR(){return tx("useRouteId")}function GR(){var i;let e=j.useContext(Zb),t=qR("useRouteError"),n=tx("useRouteError");return e!==void 0?e:(i=t.errors)==null?void 0:i[n]}function VR(){let{router:e}=FR("useNavigate"),t=tx("useNavigate"),n=j.useRef(!1);return T2(()=>{n.current=!0}),j.useCallback(async(r,a={})=>{fr(n.current,A2),n.current&&(typeof r=="number"?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...a}))},[e,t])}var Ak={};function O2(e,t,n){!t&&!Ak[e]&&(Ak[e]=!0,fr(!1,n))}j.memo(YR);function YR({routes:e,future:t,state:n,isStatic:i,onError:r}){return M2(e,void 0,{state:n,isStatic:i,onError:r})}function WR(e){return LR(e.context)}function Sn(e){cn(!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 QR({basename:e="/",children:t=null,location:n,navigationType:i="POP",navigator:r,static:a=!1,unstable_useTransitions:o}){cn(!Xu(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let u=e.replace(/^\/*/,"/"),d=j.useMemo(()=>({basename:u,navigator:r,static:a,unstable_useTransitions:o,future:{}}),[u,r,a,o]);typeof n=="string"&&(n=Xo(n));let{pathname:h="/",search:g="",hash:p="",state:y=null,key:b="default",unstable_mask:w}=n,v=j.useMemo(()=>{let N=ys(h,u);return N==null?null:{location:{pathname:N,search:g,hash:p,state:y,key:b,unstable_mask:w},navigationType:i}},[u,h,g,p,y,b,i,w]);return fr(v!=null,`<Router basename="${u}"> is not able to match the URL "${h}${g}${p}" because it does not start with the basename, so the <Router> won't render anything.`),v==null?null:j.createElement(Vi.Provider,{value:d},j.createElement(Qu.Provider,{children:t,value:v}))}function XR({children:e,location:t}){return zR(nb(e),t)}function nb(e,t=[]){let n=[];return j.Children.forEach(e,(i,r)=>{if(!j.isValidElement(i))return;let a=[...t,r];if(i.type===j.Fragment){n.push.apply(n,nb(i.props.children,a));return}cn(i.type===Sn,`[${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>`),cn(!i.props.index||!i.props.children,"An index route cannot have child routes.");let o={id:i.props.id||a.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&&(o.children=nb(i.props.children,a)),n.push(o)}),n}var rh="get",sh="application/x-www-form-urlencoded";function Qh(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function ZR(e){return Qh(e)&&e.tagName.toLowerCase()==="button"}function JR(e){return Qh(e)&&e.tagName.toLowerCase()==="form"}function e3(e){return Qh(e)&&e.tagName.toLowerCase()==="input"}function t3(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function n3(e,t){return e.button===0&&(!t||t==="_self")&&!t3(e)}function ib(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let i=e[n];return t.concat(Array.isArray(i)?i.map(r=>[n,r]):[[n,i]])},[]))}function i3(e,t){let n=ib(e);return t&&t.forEach((i,r)=>{n.has(r)||t.getAll(r).forEach(a=>{n.append(r,a)})}),n}var Cf=null;function r3(){if(Cf===null)try{new FormData(document.createElement("form"),0),Cf=!1}catch{Cf=!0}return Cf}var s3=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Fg(e){return e!=null&&!s3.has(e)?(fr(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${sh}"`),null):e}function a3(e,t){let n,i,r,a,o;if(JR(e)){let u=e.getAttribute("action");i=u?ys(u,t):null,n=e.getAttribute("method")||rh,r=Fg(e.getAttribute("enctype"))||sh,a=new FormData(e)}else if(ZR(e)||e3(e)&&(e.type==="submit"||e.type==="image")){let u=e.form;if(u==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let d=e.getAttribute("formaction")||u.getAttribute("action");if(i=d?ys(d,t):null,n=e.getAttribute("formmethod")||u.getAttribute("method")||rh,r=Fg(e.getAttribute("formenctype"))||Fg(u.getAttribute("enctype"))||sh,a=new FormData(u,e),!r3()){let{name:h,type:g,value:p}=e;if(g==="image"){let y=h?`${h}.`:"";a.append(`${y}x`,"0"),a.append(`${y}y`,"0")}else h&&a.append(h,p)}}else{if(Qh(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=rh,i=null,r=sh,o=e}return a&&r==="text/plain"&&(o=a,a=void 0),{action:i,method:n.toLowerCase(),encType:r,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function nx(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function R2(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&&ys(r.pathname,t)==="/"?r.pathname=`${wh(t)}/_root.${i}`:r.pathname=`${wh(r.pathname)}.${i}`,r}async function l3(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 o3(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 c3(e,t,n){let i=await Promise.all(e.map(async r=>{let a=t.routes[r.route.id];if(a){let o=await l3(a,n);return o.links?o.links():[]}return[]}));return h3(i.flat(1).filter(o3).filter(r=>r.rel==="stylesheet"||r.rel==="preload").map(r=>r.rel==="stylesheet"?{...r,rel:"prefetch",as:"style"}:{...r,rel:"prefetch"}))}function Tk(e,t,n,i,r,a){let o=(d,h)=>n[h]?d.route.id!==n[h].route.id:!0,u=(d,h)=>{var g;return n[h].pathname!==d.pathname||((g=n[h].route.path)==null?void 0:g.endsWith("*"))&&n[h].params["*"]!==d.params["*"]};return a==="assets"?t.filter((d,h)=>o(d,h)||u(d,h)):a==="data"?t.filter((d,h)=>{var p;let g=i.routes[d.route.id];if(!g||!g.hasLoader)return!1;if(o(d,h)||u(d,h))return!0;if(d.route.shouldRevalidate){let y=d.route.shouldRevalidate({currentUrl:new URL(r.pathname+r.search+r.hash,window.origin),currentParams:((p=n[0])==null?void 0:p.params)||{},nextUrl:new URL(e,window.origin),nextParams:d.params,defaultShouldRevalidate:!0});if(typeof y=="boolean")return y}return!0}):[]}function u3(e,t,{includeHydrateFallback:n}={}){return d3(e.map(i=>{let r=t.routes[i.route.id];if(!r)return[];let a=[r.module];return r.clientActionModule&&(a=a.concat(r.clientActionModule)),r.clientLoaderModule&&(a=a.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(a=a.concat(r.hydrateFallbackModule)),r.imports&&(a=a.concat(r.imports)),a}).flat(1))}function d3(e){return[...new Set(e)]}function f3(e){let t={},n=Object.keys(e).sort();for(let i of n)t[i]=e[i];return t}function h3(e,t){let n=new Set;return new Set(t),e.reduce((i,r)=>{let a=JSON.stringify(f3(r));return n.has(a)||(n.add(a),i.push({key:a,link:r})),i},[])}function ix(){let e=j.useContext(Zo);return nx(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function p3(){let e=j.useContext(Wh);return nx(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var rx=j.createContext(void 0);rx.displayName="FrameworkContext";function sx(){let e=j.useContext(rx);return nx(e,"You must render this element inside a <HydratedRouter> element"),e}function m3(e,t){let n=j.useContext(rx),[i,r]=j.useState(!1),[a,o]=j.useState(!1),{onFocus:u,onBlur:d,onMouseEnter:h,onMouseLeave:g,onTouchStart:p}=t,y=j.useRef(null);j.useEffect(()=>{if(e==="render"&&o(!0),e==="viewport"){let v=k=>{k.forEach(A=>{o(A.isIntersecting)})},N=new IntersectionObserver(v,{threshold:.5});return y.current&&N.observe(y.current),()=>{N.disconnect()}}},[e]),j.useEffect(()=>{if(i){let v=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(v)}}},[i]);let b=()=>{r(!0)},w=()=>{r(!1),o(!1)};return n?e!=="intent"?[a,y,{}]:[a,y,{onFocus:eu(u,b),onBlur:eu(d,w),onMouseEnter:eu(h,b),onMouseLeave:eu(g,w),onTouchStart:eu(p,b)}]:[!1,y,{}]}function eu(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function g3({page:e,...t}){let n=NR(),{router:i}=ix(),r=j.useMemo(()=>b2(i.routes,e,i.basename),[i.routes,e,i.basename]);return r?n?j.createElement(b3,{page:e,matches:r,...t}):j.createElement(x3,{page:e,matches:r,...t}):null}function y3(e){let{manifest:t,routeModules:n}=sx(),[i,r]=j.useState([]);return j.useEffect(()=>{let a=!1;return c3(e,t,n).then(o=>{a||r(o)}),()=>{a=!0}},[e,t,n]),i}function b3({page:e,matches:t,...n}){let i=zr(),{future:r}=sx(),{basename:a}=ix(),o=j.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let u=R2(e,a,r.unstable_trailingSlashAwareDataRequests,"rsc"),d=!1,h=[];for(let g of t)typeof g.route.shouldRevalidate=="function"?d=!0:h.push(g.route.id);return d&&h.length>0&&u.searchParams.set("_routes",h.join(",")),[u.pathname+u.search]},[a,r.unstable_trailingSlashAwareDataRequests,e,i,t]);return j.createElement(j.Fragment,null,o.map(u=>j.createElement("link",{key:u,rel:"prefetch",as:"fetch",href:u,...n})))}function x3({page:e,matches:t,...n}){let i=zr(),{future:r,manifest:a,routeModules:o}=sx(),{basename:u}=ix(),{loaderData:d,matches:h}=p3(),g=j.useMemo(()=>Tk(e,t,h,a,i,"data"),[e,t,h,a,i]),p=j.useMemo(()=>Tk(e,t,h,a,i,"assets"),[e,t,h,a,i]),y=j.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let v=new Set,N=!1;if(t.forEach(A=>{var _;let S=a.routes[A.route.id];!S||!S.hasLoader||(!g.some(C=>C.route.id===A.route.id)&&A.route.id in d&&((_=o[A.route.id])!=null&&_.shouldRevalidate)||S.hasClientLoader?N=!0:v.add(A.route.id))}),v.size===0)return[];let k=R2(e,u,r.unstable_trailingSlashAwareDataRequests,"data");return N&&v.size>0&&k.searchParams.set("_routes",t.filter(A=>v.has(A.route.id)).map(A=>A.route.id).join(",")),[k.pathname+k.search]},[u,r.unstable_trailingSlashAwareDataRequests,d,i,a,g,t,e,o]),b=j.useMemo(()=>u3(p,a),[p,a]),w=y3(p);return j.createElement(j.Fragment,null,y.map(v=>j.createElement("link",{key:v,rel:"prefetch",as:"fetch",href:v,...n})),b.map(v=>j.createElement("link",{key:v,rel:"modulepreload",href:v,...n})),w.map(({key:v,link:N})=>j.createElement("link",{key:v,nonce:n.nonce,...N,crossOrigin:N.crossOrigin??n.crossOrigin})))}function v3(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var w3=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{w3&&(window.__reactRouterVersion="7.14.2")}catch{}function k3({basename:e,children:t,unstable_useTransitions:n,window:i}){let r=j.useRef();r.current==null&&(r.current=ZO({window:i,v5Compat:!0}));let a=r.current,[o,u]=j.useState({action:a.action,location:a.location}),d=j.useCallback(h=>{n===!1?u(h):j.startTransition(()=>u(h))},[n]);return j.useLayoutEffect(()=>a.listen(d),[a,d]),j.createElement(QR,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,unstable_useTransitions:n})}var L2=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,wa=j.forwardRef(function({onClick:t,discover:n="render",prefetch:i="none",relative:r,reloadDocument:a,replace:o,unstable_mask:u,state:d,target:h,to:g,preventScrollReset:p,viewTransition:y,unstable_defaultShouldRevalidate:b,...w},v){let{basename:N,navigator:k,unstable_useTransitions:A}=j.useContext(Vi),S=typeof g=="string"&&L2.test(g),_=S2(g,N);g=_.to;let C=DR(g,{relative:r}),T=zr(),R=null;if(u){let H=Xb(u,[],T.unstable_mask?T.unstable_mask.pathname:"/",!0);N!=="/"&&(H.pathname=H.pathname==="/"?N:ur([N,H.pathname])),R=k.createHref(H)}let[O,B,P]=m3(i,w),F=N3(g,{replace:o,unstable_mask:u,state:d,target:h,preventScrollReset:p,relative:r,viewTransition:y,unstable_defaultShouldRevalidate:b,unstable_useTransitions:A});function U(H){t&&t(H),H.defaultPrevented||F(H)}let V=!(_.isExternal||a),M=j.createElement("a",{...w,...P,href:(V?R:void 0)||_.absoluteURL||C,onClick:V?U:t,ref:v3(v,B),target:h,"data-discover":!S&&n==="render"?"true":void 0});return O&&!S?j.createElement(j.Fragment,null,M,j.createElement(g3,{page:C})):M});wa.displayName="Link";var z2=j.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:i="",end:r=!1,style:a,to:o,viewTransition:u,children:d,...h},g){let p=Zu(o,{relative:h.relative}),y=zr(),b=j.useContext(Wh),{navigator:w,basename:v}=j.useContext(Vi),N=b!=null&&T3(p)&&u===!0,k=w.encodeLocation?w.encodeLocation(p).pathname:p.pathname,A=y.pathname,S=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;n||(A=A.toLowerCase(),S=S?S.toLowerCase():null,k=k.toLowerCase()),S&&v&&(S=ys(S,v)||S);const _=k!=="/"&&k.endsWith("/")?k.length-1:k.length;let C=A===k||!r&&A.startsWith(k)&&A.charAt(_)==="/",T=S!=null&&(S===k||!r&&S.startsWith(k)&&S.charAt(k.length)==="/"),R={isActive:C,isPending:T,isTransitioning:N},O=C?t:void 0,B;typeof i=="function"?B=i(R):B=[i,C?"active":null,T?"pending":null,N?"transitioning":null].filter(Boolean).join(" ");let P=typeof a=="function"?a(R):a;return j.createElement(wa,{...h,"aria-current":O,className:B,ref:g,style:P,to:o,viewTransition:u},typeof d=="function"?d(R):d)});z2.displayName="NavLink";var E3=j.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:i,replace:r,state:a,method:o=rh,action:u,onSubmit:d,relative:h,preventScrollReset:g,viewTransition:p,unstable_defaultShouldRevalidate:y,...b},w)=>{let{unstable_useTransitions:v}=j.useContext(Vi),N=C3(),k=A3(u,{relative:h}),A=o.toLowerCase()==="get"?"get":"post",S=typeof u=="string"&&L2.test(u),_=C=>{if(d&&d(C),C.defaultPrevented)return;C.preventDefault();let T=C.nativeEvent.submitter,R=(T==null?void 0:T.getAttribute("formmethod"))||o,O=()=>N(T||C.currentTarget,{fetcherKey:t,method:R,navigate:n,replace:r,state:a,relative:h,preventScrollReset:g,viewTransition:p,unstable_defaultShouldRevalidate:y});v&&n!==!1?j.startTransition(()=>O()):O()};return j.createElement("form",{ref:w,method:A,action:k,onSubmit:i?d:_,...b,"data-discover":!S&&e==="render"?"true":void 0})});E3.displayName="Form";function S3(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function I2(e){let t=j.useContext(Zo);return cn(t,S3(e)),t}function N3(e,{target:t,replace:n,unstable_mask:i,state:r,preventScrollReset:a,relative:o,viewTransition:u,unstable_defaultShouldRevalidate:d,unstable_useTransitions:h}={}){let g=wl(),p=zr(),y=Zu(e,{relative:o});return j.useCallback(b=>{if(n3(b,t)){b.preventDefault();let w=n!==void 0?n:_u(p)===_u(y),v=()=>g(e,{replace:w,unstable_mask:i,state:r,preventScrollReset:a,relative:o,viewTransition:u,unstable_defaultShouldRevalidate:d});h?j.startTransition(()=>v()):v()}},[p,g,y,n,i,r,t,e,a,o,u,d,h])}function P2(e){fr(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=j.useRef(ib(e)),n=j.useRef(!1),i=zr(),r=j.useMemo(()=>i3(i.search,n.current?null:t.current),[i.search]),a=wl(),o=j.useCallback((u,d)=>{const h=ib(typeof u=="function"?u(new URLSearchParams(r)):u);n.current=!0,a("?"+h,d)},[a,r]);return[r,o]}var _3=0,j3=()=>`__${String(++_3)}__`;function C3(){let{router:e}=I2("useSubmit"),{basename:t}=j.useContext(Vi),n=KR(),i=e.fetch,r=e.navigate;return j.useCallback(async(a,o={})=>{let{action:u,method:d,encType:h,formData:g,body:p}=a3(a,t);if(o.navigate===!1){let y=o.fetcherKey||j3();await i(y,n,o.action||u,{unstable_defaultShouldRevalidate:o.unstable_defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:g,body:p,formMethod:o.method||d,formEncType:o.encType||h,flushSync:o.flushSync})}else await r(o.action||u,{unstable_defaultShouldRevalidate:o.unstable_defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:g,body:p,formMethod:o.method||d,formEncType:o.encType||h,replace:o.replace,state:o.state,fromRouteId:n,flushSync:o.flushSync,viewTransition:o.viewTransition})},[i,r,t,n])}function A3(e,{relative:t}={}){let{basename:n}=j.useContext(Vi),i=j.useContext(pr);cn(i,"useFormAction must be used inside a RouteContext");let[r]=i.matches.slice(-1),a={...Zu(e||".",{relative:t})},o=zr();if(e==null){a.search=o.search;let u=new URLSearchParams(a.search),d=u.getAll("index");if(d.some(g=>g==="")){u.delete("index"),d.filter(p=>p).forEach(p=>u.append("index",p));let g=u.toString();a.search=g?`?${g}`:""}}return(!e||e===".")&&r.route.index&&(a.search=a.search?a.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(a.pathname=a.pathname==="/"?n:ur([n,a.pathname])),_u(a)}function T3(e,{relative:t}={}){let n=j.useContext(j2);cn(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=I2("useViewTransitionState"),r=Zu(e,{relative:t});if(!n.isTransitioning)return!1;let a=ys(n.currentLocation.pathname,i)||n.currentLocation.pathname,o=ys(n.nextLocation.pathname,i)||n.nextLocation.pathname;return vh(r.pathname,o)!=null||vh(r.pathname,a)!=null}s2();/**
|
|
61
|
+
* @license lucide-react v0.544.0 - ISC
|
|
62
|
+
*
|
|
63
|
+
* This source code is licensed under the ISC license.
|
|
64
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
65
|
+
*/const M3=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),D3=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,i)=>i?i.toUpperCase():n.toLowerCase()),Mk=e=>{const t=D3(e);return t.charAt(0).toUpperCase()+t.slice(1)},B2=(...e)=>e.filter((t,n,i)=>!!t&&t.trim()!==""&&i.indexOf(t)===n).join(" ").trim(),O3=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
|
|
66
|
+
* @license lucide-react v0.544.0 - ISC
|
|
67
|
+
*
|
|
68
|
+
* This source code is licensed under the ISC license.
|
|
69
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
70
|
+
*/var R3={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
71
|
+
* @license lucide-react v0.544.0 - ISC
|
|
72
|
+
*
|
|
73
|
+
* This source code is licensed under the ISC license.
|
|
74
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
75
|
+
*/const L3=j.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:i,className:r="",children:a,iconNode:o,...u},d)=>j.createElement("svg",{ref:d,...R3,width:t,height:t,stroke:e,strokeWidth:i?Number(n)*24/Number(t):n,className:B2("lucide",r),...!a&&!O3(u)&&{"aria-hidden":"true"},...u},[...o.map(([h,g])=>j.createElement(h,g)),...Array.isArray(a)?a:[a]]));/**
|
|
76
|
+
* @license lucide-react v0.544.0 - ISC
|
|
77
|
+
*
|
|
78
|
+
* This source code is licensed under the ISC license.
|
|
79
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
80
|
+
*/const Oe=(e,t)=>{const n=j.forwardRef(({className:i,...r},a)=>j.createElement(L3,{ref:a,iconNode:t,className:B2(`lucide-${M3(Mk(e))}`,`lucide-${e}`,i),...r}));return n.displayName=Mk(e),n};/**
|
|
81
|
+
* @license lucide-react v0.544.0 - ISC
|
|
82
|
+
*
|
|
83
|
+
* This source code is licensed under the ISC license.
|
|
84
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
85
|
+
*/const z3=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],Xh=Oe("activity",z3);/**
|
|
86
|
+
* @license lucide-react v0.544.0 - ISC
|
|
87
|
+
*
|
|
88
|
+
* This source code is licensed under the ISC license.
|
|
89
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
90
|
+
*/const I3=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],P3=Oe("arrow-down",I3);/**
|
|
91
|
+
* @license lucide-react v0.544.0 - ISC
|
|
92
|
+
*
|
|
93
|
+
* This source code is licensed under the ISC license.
|
|
94
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
95
|
+
*/const B3=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],$2=Oe("arrow-left",B3);/**
|
|
96
|
+
* @license lucide-react v0.544.0 - ISC
|
|
97
|
+
*
|
|
98
|
+
* This source code is licensed under the ISC license.
|
|
99
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
100
|
+
*/const $3=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],U2=Oe("arrow-up",$3);/**
|
|
101
|
+
* @license lucide-react v0.544.0 - ISC
|
|
102
|
+
*
|
|
103
|
+
* This source code is licensed under the ISC license.
|
|
104
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
105
|
+
*/const U3=[["path",{d:"M18 6V4a2 2 0 1 0-4 0v2",key:"1aquzs"}],["path",{d:"M20 15v6a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"1rkj32"}],["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H10",key:"18wgow"}],["rect",{x:"12",y:"6",width:"8",height:"5",rx:"1",key:"73l30o"}]],F3=Oe("book-lock",U3);/**
|
|
106
|
+
* @license lucide-react v0.544.0 - ISC
|
|
107
|
+
*
|
|
108
|
+
* This source code is licensed under the ISC license.
|
|
109
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
110
|
+
*/const q3=[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M9 13a4.5 4.5 0 0 0 3-4",key:"10igwf"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M12 13h4",key:"1ku699"}],["path",{d:"M12 18h6a2 2 0 0 1 2 2v1",key:"105ag5"}],["path",{d:"M12 8h8",key:"1lhi5i"}],["path",{d:"M16 8V5a2 2 0 0 1 2-2",key:"u6izg6"}],["circle",{cx:"16",cy:"13",r:".5",key:"ry7gng"}],["circle",{cx:"18",cy:"3",r:".5",key:"1aiba7"}],["circle",{cx:"20",cy:"21",r:".5",key:"yhc1fs"}],["circle",{cx:"20",cy:"8",r:".5",key:"1e43v0"}]],H3=Oe("brain-circuit",q3);/**
|
|
111
|
+
* @license lucide-react v0.544.0 - ISC
|
|
112
|
+
*
|
|
113
|
+
* This source code is licensed under the ISC license.
|
|
114
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
115
|
+
*/const K3=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],G3=Oe("brain",K3);/**
|
|
116
|
+
* @license lucide-react v0.544.0 - ISC
|
|
117
|
+
*
|
|
118
|
+
* This source code is licensed under the ISC license.
|
|
119
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
120
|
+
*/const V3=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Y3=Oe("check",V3);/**
|
|
121
|
+
* @license lucide-react v0.544.0 - ISC
|
|
122
|
+
*
|
|
123
|
+
* This source code is licensed under the ISC license.
|
|
124
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
125
|
+
*/const W3=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Ju=Oe("chevron-down",W3);/**
|
|
126
|
+
* @license lucide-react v0.544.0 - ISC
|
|
127
|
+
*
|
|
128
|
+
* This source code is licensed under the ISC license.
|
|
129
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
130
|
+
*/const Q3=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Jo=Oe("chevron-right",Q3);/**
|
|
131
|
+
* @license lucide-react v0.544.0 - ISC
|
|
132
|
+
*
|
|
133
|
+
* This source code is licensed under the ISC license.
|
|
134
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
135
|
+
*/const X3=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Z3=Oe("chevron-up",X3);/**
|
|
136
|
+
* @license lucide-react v0.544.0 - ISC
|
|
137
|
+
*
|
|
138
|
+
* This source code is licensed under the ISC license.
|
|
139
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
140
|
+
*/const J3=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],ju=Oe("circle-alert",J3);/**
|
|
141
|
+
* @license lucide-react v0.544.0 - ISC
|
|
142
|
+
*
|
|
143
|
+
* This source code is licensed under the ISC license.
|
|
144
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
145
|
+
*/const eL=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],kh=Oe("circle-check-big",eL);/**
|
|
146
|
+
* @license lucide-react v0.544.0 - ISC
|
|
147
|
+
*
|
|
148
|
+
* This source code is licensed under the ISC license.
|
|
149
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
150
|
+
*/const tL=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Cu=Oe("circle-check",tL);/**
|
|
151
|
+
* @license lucide-react v0.544.0 - ISC
|
|
152
|
+
*
|
|
153
|
+
* This source code is licensed under the ISC license.
|
|
154
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
155
|
+
*/const nL=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]],iL=Oe("circle-dot",nL);/**
|
|
156
|
+
* @license lucide-react v0.544.0 - ISC
|
|
157
|
+
*
|
|
158
|
+
* This source code is licensed under the ISC license.
|
|
159
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
160
|
+
*/const rL=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],F2=Oe("circle-x",rL);/**
|
|
161
|
+
* @license lucide-react v0.544.0 - ISC
|
|
162
|
+
*
|
|
163
|
+
* This source code is licensed under the ISC license.
|
|
164
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
165
|
+
*/const sL=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],q2=Oe("clock",sL);/**
|
|
166
|
+
* @license lucide-react v0.544.0 - ISC
|
|
167
|
+
*
|
|
168
|
+
* This source code is licensed under the ISC license.
|
|
169
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
170
|
+
*/const aL=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],H2=Oe("copy",aL);/**
|
|
171
|
+
* @license lucide-react v0.544.0 - ISC
|
|
172
|
+
*
|
|
173
|
+
* This source code is licensed under the ISC license.
|
|
174
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
175
|
+
*/const lL=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],Eh=Oe("cpu",lL);/**
|
|
176
|
+
* @license lucide-react v0.544.0 - ISC
|
|
177
|
+
*
|
|
178
|
+
* This source code is licensed under the ISC license.
|
|
179
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
180
|
+
*/const oL=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],Zh=Oe("download",oL);/**
|
|
181
|
+
* @license lucide-react v0.544.0 - ISC
|
|
182
|
+
*
|
|
183
|
+
* This source code is licensed under the ISC license.
|
|
184
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
185
|
+
*/const cL=[["path",{d:"M6 8.5a6.5 6.5 0 1 1 13 0c0 6-6 6-6 10a3.5 3.5 0 1 1-7 0",key:"1dfaln"}],["path",{d:"M15 8.5a2.5 2.5 0 0 0-5 0v1a2 2 0 1 1 0 4",key:"1qnva7"}]],uL=Oe("ear",cL);/**
|
|
186
|
+
* @license lucide-react v0.544.0 - ISC
|
|
187
|
+
*
|
|
188
|
+
* This source code is licensed under the ISC license.
|
|
189
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
190
|
+
*/const dL=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],fL=Oe("external-link",dL);/**
|
|
191
|
+
* @license lucide-react v0.544.0 - ISC
|
|
192
|
+
*
|
|
193
|
+
* This source code is licensed under the ISC license.
|
|
194
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
195
|
+
*/const hL=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],pL=Oe("eye",hL);/**
|
|
196
|
+
* @license lucide-react v0.544.0 - ISC
|
|
197
|
+
*
|
|
198
|
+
* This source code is licensed under the ISC license.
|
|
199
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
200
|
+
*/const mL=[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]],Dk=Oe("file-code",mL);/**
|
|
201
|
+
* @license lucide-react v0.544.0 - ISC
|
|
202
|
+
*
|
|
203
|
+
* This source code is licensed under the ISC license.
|
|
204
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
205
|
+
*/const gL=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],ed=Oe("file-text",gL);/**
|
|
206
|
+
* @license lucide-react v0.544.0 - ISC
|
|
207
|
+
*
|
|
208
|
+
* This source code is licensed under the ISC license.
|
|
209
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
210
|
+
*/const yL=[["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["path",{d:"M18 19c-2.8 0-5-2.2-5-5v8",key:"pkpw2h"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]],bL=Oe("folder-git-2",yL);/**
|
|
211
|
+
* @license lucide-react v0.544.0 - ISC
|
|
212
|
+
*
|
|
213
|
+
* This source code is licensed under the ISC license.
|
|
214
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
215
|
+
*/const xL=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],K2=Oe("folder-open",xL);/**
|
|
216
|
+
* @license lucide-react v0.544.0 - ISC
|
|
217
|
+
*
|
|
218
|
+
* This source code is licensed under the ISC license.
|
|
219
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
220
|
+
*/const vL=[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],wL=Oe("folder-plus",vL);/**
|
|
221
|
+
* @license lucide-react v0.544.0 - ISC
|
|
222
|
+
*
|
|
223
|
+
* This source code is licensed under the ISC license.
|
|
224
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
225
|
+
*/const kL=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],Sh=Oe("folder",kL);/**
|
|
226
|
+
* @license lucide-react v0.544.0 - ISC
|
|
227
|
+
*
|
|
228
|
+
* This source code is licensed under the ISC license.
|
|
229
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
230
|
+
*/const EL=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],SL=Oe("funnel",EL);/**
|
|
231
|
+
* @license lucide-react v0.544.0 - ISC
|
|
232
|
+
*
|
|
233
|
+
* This source code is licensed under the ISC license.
|
|
234
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
235
|
+
*/const NL=[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]],_L=Oe("git-branch",NL);/**
|
|
236
|
+
* @license lucide-react v0.544.0 - ISC
|
|
237
|
+
*
|
|
238
|
+
* This source code is licensed under the ISC license.
|
|
239
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
240
|
+
*/const jL=[["circle",{cx:"5",cy:"6",r:"3",key:"1qnov2"}],["path",{d:"M5 9v12",key:"ih889a"}],["circle",{cx:"19",cy:"18",r:"3",key:"1qljk2"}],["path",{d:"m15 9-3-3 3-3",key:"1lwv8l"}],["path",{d:"M12 6h5a2 2 0 0 1 2 2v7",key:"1yj91y"}]],CL=Oe("git-pull-request-arrow",jL);/**
|
|
241
|
+
* @license lucide-react v0.544.0 - ISC
|
|
242
|
+
*
|
|
243
|
+
* This source code is licensed under the ISC license.
|
|
244
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
245
|
+
*/const AL=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],TL=Oe("globe",AL);/**
|
|
246
|
+
* @license lucide-react v0.544.0 - ISC
|
|
247
|
+
*
|
|
248
|
+
* This source code is licensed under the ISC license.
|
|
249
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
250
|
+
*/const ML=[["path",{d:"m15 12-9.373 9.373a1 1 0 0 1-3.001-3L12 9",key:"1hayfq"}],["path",{d:"m18 15 4-4",key:"16gjal"}],["path",{d:"m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172v-.344a2 2 0 0 0-.586-1.414l-1.657-1.657A6 6 0 0 0 12.516 3H9l1.243 1.243A6 6 0 0 1 12 8.485V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5",key:"15ts47"}]],DL=Oe("hammer",ML);/**
|
|
251
|
+
* @license lucide-react v0.544.0 - ISC
|
|
252
|
+
*
|
|
253
|
+
* This source code is licensed under the ISC license.
|
|
254
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
255
|
+
*/const OL=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],RL=Oe("history",OL);/**
|
|
256
|
+
* @license lucide-react v0.544.0 - ISC
|
|
257
|
+
*
|
|
258
|
+
* This source code is licensed under the ISC license.
|
|
259
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
260
|
+
*/const LL=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],G2=Oe("house",LL);/**
|
|
261
|
+
* @license lucide-react v0.544.0 - ISC
|
|
262
|
+
*
|
|
263
|
+
* This source code is licensed under the ISC license.
|
|
264
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
265
|
+
*/const zL=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],IL=Oe("image",zL);/**
|
|
266
|
+
* @license lucide-react v0.544.0 - ISC
|
|
267
|
+
*
|
|
268
|
+
* This source code is licensed under the ISC license.
|
|
269
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
270
|
+
*/const PL=[["path",{d:"M5 3v14",key:"9nsxs2"}],["path",{d:"M12 3v8",key:"1h2ygw"}],["path",{d:"M19 3v18",key:"1sk56x"}]],BL=Oe("kanban",PL);/**
|
|
271
|
+
* @license lucide-react v0.544.0 - ISC
|
|
272
|
+
*
|
|
273
|
+
* This source code is licensed under the ISC license.
|
|
274
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
275
|
+
*/const $L=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],UL=Oe("key-round",$L);/**
|
|
276
|
+
* @license lucide-react v0.544.0 - ISC
|
|
277
|
+
*
|
|
278
|
+
* This source code is licensed under the ISC license.
|
|
279
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
280
|
+
*/const FL=[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]],qL=Oe("languages",FL);/**
|
|
281
|
+
* @license lucide-react v0.544.0 - ISC
|
|
282
|
+
*
|
|
283
|
+
* This source code is licensed under the ISC license.
|
|
284
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
285
|
+
*/const HL=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],V2=Oe("layout-grid",HL);/**
|
|
286
|
+
* @license lucide-react v0.544.0 - ISC
|
|
287
|
+
*
|
|
288
|
+
* This source code is licensed under the ISC license.
|
|
289
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
290
|
+
*/const KL=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Xe=Oe("loader-circle",KL);/**
|
|
291
|
+
* @license lucide-react v0.544.0 - ISC
|
|
292
|
+
*
|
|
293
|
+
* This source code is licensed under the ISC license.
|
|
294
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
295
|
+
*/const GL=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],Ok=Oe("message-circle",GL);/**
|
|
296
|
+
* @license lucide-react v0.544.0 - ISC
|
|
297
|
+
*
|
|
298
|
+
* This source code is licensed under the ISC license.
|
|
299
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
300
|
+
*/const VL=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],Y2=Oe("message-square",VL);/**
|
|
301
|
+
* @license lucide-react v0.544.0 - ISC
|
|
302
|
+
*
|
|
303
|
+
* This source code is licensed under the ISC license.
|
|
304
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
305
|
+
*/const YL=[["path",{d:"m11 7.601-5.994 8.19a1 1 0 0 0 .1 1.298l.817.818a1 1 0 0 0 1.314.087L15.09 12",key:"80a601"}],["path",{d:"M16.5 21.174C15.5 20.5 14.372 20 13 20c-2.058 0-3.928 2.356-6 2-2.072-.356-2.775-3.369-1.5-4.5",key:"j0ngtp"}],["circle",{cx:"16",cy:"7",r:"5",key:"d08jfb"}]],Rk=Oe("mic-vocal",YL);/**
|
|
306
|
+
* @license lucide-react v0.544.0 - ISC
|
|
307
|
+
*
|
|
308
|
+
* This source code is licensed under the ISC license.
|
|
309
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
310
|
+
*/const WL=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],QL=Oe("moon",WL);/**
|
|
311
|
+
* @license lucide-react v0.544.0 - ISC
|
|
312
|
+
*
|
|
313
|
+
* This source code is licensed under the ISC license.
|
|
314
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
315
|
+
*/const XL=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],W2=Oe("network",XL);/**
|
|
316
|
+
* @license lucide-react v0.544.0 - ISC
|
|
317
|
+
*
|
|
318
|
+
* This source code is licensed under the ISC license.
|
|
319
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
320
|
+
*/const ZL=[["path",{d:"M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4",key:"re6nr2"}],["path",{d:"M2 6h4",key:"aawbzj"}],["path",{d:"M2 10h4",key:"l0bgd4"}],["path",{d:"M2 14h4",key:"1gsvsf"}],["path",{d:"M2 18h4",key:"1bu2t1"}],["path",{d:"M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"pqwjuv"}]],Q2=Oe("notebook-pen",ZL);/**
|
|
321
|
+
* @license lucide-react v0.544.0 - ISC
|
|
322
|
+
*
|
|
323
|
+
* This source code is licensed under the ISC license.
|
|
324
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
325
|
+
*/const JL=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m8 9 3 3-3 3",key:"12hl5m"}]],ez=Oe("panel-right-close",JL);/**
|
|
326
|
+
* @license lucide-react v0.544.0 - ISC
|
|
327
|
+
*
|
|
328
|
+
* This source code is licensed under the ISC license.
|
|
329
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
330
|
+
*/const tz=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],nz=Oe("paperclip",tz);/**
|
|
331
|
+
* @license lucide-react v0.544.0 - ISC
|
|
332
|
+
*
|
|
333
|
+
* This source code is licensed under the ISC license.
|
|
334
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
335
|
+
*/const iz=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],rz=Oe("pause",iz);/**
|
|
336
|
+
* @license lucide-react v0.544.0 - ISC
|
|
337
|
+
*
|
|
338
|
+
* This source code is licensed under the ISC license.
|
|
339
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
340
|
+
*/const sz=[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],Jh=Oe("pen-line",sz);/**
|
|
341
|
+
* @license lucide-react v0.544.0 - ISC
|
|
342
|
+
*
|
|
343
|
+
* This source code is licensed under the ISC license.
|
|
344
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
345
|
+
*/const az=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],X2=Oe("pencil",az);/**
|
|
346
|
+
* @license lucide-react v0.544.0 - ISC
|
|
347
|
+
*
|
|
348
|
+
* This source code is licensed under the ISC license.
|
|
349
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
350
|
+
*/const lz=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],td=Oe("play",lz);/**
|
|
351
|
+
* @license lucide-react v0.544.0 - ISC
|
|
352
|
+
*
|
|
353
|
+
* This source code is licensed under the ISC license.
|
|
354
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
355
|
+
*/const oz=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],pi=Oe("plus",oz);/**
|
|
356
|
+
* @license lucide-react v0.544.0 - ISC
|
|
357
|
+
*
|
|
358
|
+
* This source code is licensed under the ISC license.
|
|
359
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
360
|
+
*/const cz=[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]],uz=Oe("puzzle",cz);/**
|
|
361
|
+
* @license lucide-react v0.544.0 - ISC
|
|
362
|
+
*
|
|
363
|
+
* This source code is licensed under the ISC license.
|
|
364
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
365
|
+
*/const dz=[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],Z2=Oe("radio",dz);/**
|
|
366
|
+
* @license lucide-react v0.544.0 - ISC
|
|
367
|
+
*
|
|
368
|
+
* This source code is licensed under the ISC license.
|
|
369
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
370
|
+
*/const fz=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],bs=Oe("refresh-cw",fz);/**
|
|
371
|
+
* @license lucide-react v0.544.0 - ISC
|
|
372
|
+
*
|
|
373
|
+
* This source code is licensed under the ISC license.
|
|
374
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
375
|
+
*/const hz=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],ep=Oe("rotate-ccw",hz);/**
|
|
376
|
+
* @license lucide-react v0.544.0 - ISC
|
|
377
|
+
*
|
|
378
|
+
* This source code is licensed under the ISC license.
|
|
379
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
380
|
+
*/const pz=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M21 9H3",key:"1338ky"}],["path",{d:"M21 15H3",key:"9uk58r"}]],mz=Oe("rows-3",pz);/**
|
|
381
|
+
* @license lucide-react v0.544.0 - ISC
|
|
382
|
+
*
|
|
383
|
+
* This source code is licensed under the ISC license.
|
|
384
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
385
|
+
*/const gz=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],mr=Oe("save",gz);/**
|
|
386
|
+
* @license lucide-react v0.544.0 - ISC
|
|
387
|
+
*
|
|
388
|
+
* This source code is licensed under the ISC license.
|
|
389
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
390
|
+
*/const yz=[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],ax=Oe("scroll-text",yz);/**
|
|
391
|
+
* @license lucide-react v0.544.0 - ISC
|
|
392
|
+
*
|
|
393
|
+
* This source code is licensed under the ISC license.
|
|
394
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
395
|
+
*/const bz=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],fl=Oe("search",bz);/**
|
|
396
|
+
* @license lucide-react v0.544.0 - ISC
|
|
397
|
+
*
|
|
398
|
+
* This source code is licensed under the ISC license.
|
|
399
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
400
|
+
*/const xz=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],J2=Oe("settings",xz);/**
|
|
401
|
+
* @license lucide-react v0.544.0 - ISC
|
|
402
|
+
*
|
|
403
|
+
* This source code is licensed under the ISC license.
|
|
404
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
405
|
+
*/const vz=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],e_=Oe("shield-check",vz);/**
|
|
406
|
+
* @license lucide-react v0.544.0 - ISC
|
|
407
|
+
*
|
|
408
|
+
* This source code is licensed under the ISC license.
|
|
409
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
410
|
+
*/const wz=[["path",{d:"m12.5 17-.5-1-.5 1h1z",key:"3me087"}],["path",{d:"M15 22a1 1 0 0 0 1-1v-1a2 2 0 0 0 1.56-3.25 8 8 0 1 0-11.12 0A2 2 0 0 0 8 20v1a1 1 0 0 0 1 1z",key:"1o5pge"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}]],kz=Oe("skull",wz);/**
|
|
411
|
+
* @license lucide-react v0.544.0 - ISC
|
|
412
|
+
*
|
|
413
|
+
* This source code is licensed under the ISC license.
|
|
414
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
415
|
+
*/const Ez=[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]],Lk=Oe("sliders-horizontal",Ez);/**
|
|
416
|
+
* @license lucide-react v0.544.0 - ISC
|
|
417
|
+
*
|
|
418
|
+
* This source code is licensed under the ISC license.
|
|
419
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
420
|
+
*/const Sz=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],hl=Oe("sparkles",Sz);/**
|
|
421
|
+
* @license lucide-react v0.544.0 - ISC
|
|
422
|
+
*
|
|
423
|
+
* This source code is licensed under the ISC license.
|
|
424
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
425
|
+
*/const Nz=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],lx=Oe("square",Nz);/**
|
|
426
|
+
* @license lucide-react v0.544.0 - ISC
|
|
427
|
+
*
|
|
428
|
+
* This source code is licensed under the ISC license.
|
|
429
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
430
|
+
*/const _z=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],t_=Oe("star",_z);/**
|
|
431
|
+
* @license lucide-react v0.544.0 - ISC
|
|
432
|
+
*
|
|
433
|
+
* This source code is licensed under the ISC license.
|
|
434
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
435
|
+
*/const jz=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],Cz=Oe("sun",jz);/**
|
|
436
|
+
* @license lucide-react v0.544.0 - ISC
|
|
437
|
+
*
|
|
438
|
+
* This source code is licensed under the ISC license.
|
|
439
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
440
|
+
*/const Az=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],n_=Oe("terminal",Az);/**
|
|
441
|
+
* @license lucide-react v0.544.0 - ISC
|
|
442
|
+
*
|
|
443
|
+
* This source code is licensed under the ISC license.
|
|
444
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
445
|
+
*/const Tz=[["path",{d:"M10 2h4",key:"n1abiw"}],["path",{d:"M12 14v-4",key:"1evpnu"}],["path",{d:"M4 13a8 8 0 0 1 8-7 8 8 0 1 1-5.3 14L4 17.6",key:"1ts96g"}],["path",{d:"M9 17H4v5",key:"8t5av"}]],Mz=Oe("timer-reset",Tz);/**
|
|
446
|
+
* @license lucide-react v0.544.0 - ISC
|
|
447
|
+
*
|
|
448
|
+
* This source code is licensed under the ISC license.
|
|
449
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
450
|
+
*/const Dz=[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]],Oz=Oe("timer",Dz);/**
|
|
451
|
+
* @license lucide-react v0.544.0 - ISC
|
|
452
|
+
*
|
|
453
|
+
* This source code is licensed under the ISC license.
|
|
454
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
455
|
+
*/const Rz=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Ki=Oe("trash-2",Rz);/**
|
|
456
|
+
* @license lucide-react v0.544.0 - ISC
|
|
457
|
+
*
|
|
458
|
+
* This source code is licensed under the ISC license.
|
|
459
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
460
|
+
*/const Lz=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],zz=Oe("triangle-alert",Lz);/**
|
|
461
|
+
* @license lucide-react v0.544.0 - ISC
|
|
462
|
+
*
|
|
463
|
+
* This source code is licensed under the ISC license.
|
|
464
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
465
|
+
*/const Iz=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],i_=Oe("upload",Iz);/**
|
|
466
|
+
* @license lucide-react v0.544.0 - ISC
|
|
467
|
+
*
|
|
468
|
+
* This source code is licensed under the ISC license.
|
|
469
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
470
|
+
*/const Pz=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],r_=Oe("users",Pz);/**
|
|
471
|
+
* @license lucide-react v0.544.0 - ISC
|
|
472
|
+
*
|
|
473
|
+
* This source code is licensed under the ISC license.
|
|
474
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
475
|
+
*/const Bz=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]],$z=Oe("volume-2",Bz);/**
|
|
476
|
+
* @license lucide-react v0.544.0 - ISC
|
|
477
|
+
*
|
|
478
|
+
* This source code is licensed under the ISC license.
|
|
479
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
480
|
+
*/const Uz=[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]],ox=Oe("workflow",Uz);/**
|
|
481
|
+
* @license lucide-react v0.544.0 - ISC
|
|
482
|
+
*
|
|
483
|
+
* This source code is licensed under the ISC license.
|
|
484
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
485
|
+
*/const Fz=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],s_=Oe("wrench",Fz);/**
|
|
486
|
+
* @license lucide-react v0.544.0 - ISC
|
|
487
|
+
*
|
|
488
|
+
* This source code is licensed under the ISC license.
|
|
489
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
490
|
+
*/const qz=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Jt=Oe("x",qz);/**
|
|
491
|
+
* @license lucide-react v0.544.0 - ISC
|
|
492
|
+
*
|
|
493
|
+
* This source code is licensed under the ISC license.
|
|
494
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
495
|
+
*/const Hz=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Kz=Oe("zap",Hz),Gz={"app.title":"SPS Console","nav.home":"Home","nav.chat":"Chat","nav.projects":"Projects","nav.board":"Board","nav.workers":"Workers","nav.logs":"Logs","nav.skills":"Skills","nav.system":"System","nav.processes":"Processes","nav.audit":"Audit Log","nav.memory":"Memory","nav.plugins":"Plugins","plugins.h1":"Plugins","plugins.desc":"Global plugin toggles. Applies to newly dispatched cards.","plugins.tab.memory":"Memory","plugins.tab.channel":"Channel","plugins.tab.model":"Model","plugins.tab.tool":"Tool","plugins.comingSoon":"Coming soon","plugins.model.title":"Agent models","plugins.model.desc":"Configure both agents (global). worker=claude executes, review·designer=openai supervises+orchestrates.","plugins.model.worker":"Worker (executes / claude)","plugins.model.reviewer":"Review·Designer (supervisor / openai)","plugins.model.provider":"Provider","plugins.model.model":"Model","plugins.model.official":"Official claude (default)","plugins.model.save":"Save","plugins.model.saved":"Saved","plugins.model.error":"Save failed","nav.arrange":"Arrange","arrange.h1":"SmartArrange","arrange.project":"Project","arrange.none":'Not started — click "Start" above to launch (task list appears in seconds; approve to run). If the dropdown is empty, create a project in SmartArrange mode first.',"arrange.start":"Start","arrange.stop":"Stop","arrange.startErr":"Start/stop failed","arrange.view":"Toggle canvas view","arrange.viewFree":"Free","arrange.viewLane":"Lanes","arrange.starting":"Starting — breaking down the task list…","arrange.planning":"Breaking down the task list…","arrange.orchestrating":"Orchestrating…","arrange.status":"Status","arrange.goal":"Goal","arrange.plan":"Task list + card chain","arrange.approve":"Approve plan","arrange.approveErr":"Approve failed","arrange.tasks":"Task list","arrange.collapse":"Collapse","arrange.expand":"Expand task list","arrange.noCards":"No cards yet — waiting for the orchestrator to dispatch (starts after approval).","arrange.cardPrompt":"Card prompt","arrange.cardSkills":"Skills","arrange.cardTask":"Task","arrange.cardLog":"Log","arrange.close":"Close","arrange.cardsCount":"cards","nav.aria":"Main navigation","home.eyebrow":"Voice space","home.title":"What do you want to create today?","home.subtitle":"Let voice become the most natural interface between you and AI.","home.openChat":"Open chat","home.conversation.title":"Voice conversation","home.conversation.subtitle":"Speak naturally and AI will understand and respond in real time.","home.conversation.empty":"Select the voice orb below to begin","home.conversation.you":"You","home.conversation.ai":"AI","home.conversation.listening":"Listening…","home.conversation.thinking":"Thinking","home.debug.open":"Debug","home.debug.close":"Close debug panel","home.voice.start":"Start listening","home.voice.stop":"Stop listening","home.voice.finish":"Select again to finish","home.voice.idle":"Select the voice orb to begin","home.voice.listening":"Listening","home.voice.thinking":"Thinking","home.voice.speaking":"Speaking","home.error.recognitionUnsupported":"Speech recognition is not supported by this browser.","home.error.recognition":"No usable speech was recognized. Please try again.","home.error.response":"The AI response failed. Please try again.","home.phase.aria":"Voice interaction state","home.phase.idle":"Idle","home.phase.listening":"Listening","home.phase.thinking":"Thinking","home.phase.speaking":"Speaking","home.visualizer.aria":"Flow voice field","home.mic.inactive":"Microphone ready","home.mic.requesting":"Connecting microphone","home.mic.active":"Live microphone","home.mic.denied":"Microphone unavailable","home.mic.unsupported":"Microphone unsupported","home.message.idle":"Ready when you are.","home.message.listening":"I am listening. Tell me what you have in mind.","home.message.thinking":"Connecting your intent, context, and the next move.","home.message.speaking":"I have the direction. Let us move into the first step.","home.simulation.start":"Simulate","home.simulation.stop":"Stop simulation","home.simulation.running":"Simulation running","home.simulation.listeningText":"I am listening. Tell me what you have in mind.","home.simulation.speakingText":"The direction is clear. Let us start with the first step.","home.customize.title":"Customize","home.customize.reset":"Reset parameters","home.customize.colors":"Colors","home.customize.parameters":"Parameters","home.customize.color1":"Color 1","home.customize.color2":"Color 2","home.customize.color3":"Color 3","home.customize.count":"Count","home.customize.speed":"Speed","home.customize.amplitude":"Amplitude","home.customize.waviness":"Waviness","home.customize.thickness":"Thickness","home.customize.glow":"Glow","home.customize.taper":"Taper","home.customize.spread":"Spread","home.customize.hueShift":"Hue shift","home.customize.intensity":"Intensity","home.customize.saturation":"Saturation","home.customize.opacity":"Opacity","home.customize.scale":"Scale","memory.sub":"Cross-project memory · agentmemory proxied behind console auth","memory.searchPlaceholder":"Search memory… (e.g. how to fix the art race)","memory.search":"Search","memory.results":"Results","memory.rawHint":"(raw observation · distilled lessons appear after live capture + compression)","memory.sessions":"Recent sessions","memory.empty":"No memory yet · accumulates after live capture (P1)","processes.title":"Processes","processes.subtitle":"Claude processes launched by SPS ACP (others, e.g. your own session, are not shown)","processes.refresh":"Refresh","processes.aliveCount":"{n} running","processes.col.kind":"Type","processes.col.slot":"Slot","processes.col.project":"Project","processes.col.state":"State","processes.col.memory":"Memory","processes.col.action":"Action","processes.empty":"No SPS processes","processes.filter.all":"All","processes.filter.alive":"Running","processes.filter.offline":"Offline","processes.kind.all":"All types","processes.kind.worker":"Worker","processes.kind.chat":"Chat","processes.kill":"Kill","processes.killConfirm":"Kill process {slot}?","audit.title":"Audit Log","audit.subtitle":"Project lifecycle: create / modify / delete","audit.refresh":"Refresh","audit.filter.all":"All","audit.action.create":"Create","audit.action.modify":"Modify","audit.action.delete":"Delete","audit.action.daemon":"Daemon","audit.col.time":"Time","audit.col.action":"Action","audit.col.project":"Project","audit.col.detail":"Detail","audit.empty":"No audit records","lang.toggle.aria":"Switch interface language","lang.en":"EN","lang.zh":"中","theme.toggle.aria":"Switch theme","theme.dark":"Dark theme","theme.light":"Light theme","status.server":"server","status.offline":"offline","status.sse.open":"SSE","status.sse.connecting":"SSE·connect","status.sse.down":"SSE·down","status.pipelines.tooltip":"Active pipelines","status.workers.tooltip":"Active workers","status.pipeline.unit":"pipeline","status.worker.unit":"worker","common.save":"Save","common.cancel":"Cancel","common.delete":"Delete","common.confirm":"Confirm","common.create":"Create","common.edit":"Edit","common.close":"Close","common.loading":"Loading…","common.error":"Error","common.retry":"Retry","common.empty":"Nothing here yet","common.search":"Search","common.refresh":"Refresh","common.copy":"Copy","common.copied":"Copied","common.yes":"Yes","common.no":"No","common.required":"Required","common.optional":"Optional","common.ok":"OK","projects.title":"Projects","projects.count":"{count} local project(s)","projects.refresh.hint":"Click refresh to retry","projects.new":"New project","projects.selectHint":"Select a project on the left to see its details.","projects.sort.label":"Sort by","projects.sort.activity":"Activity","projects.sort.date":"Modified","projects.sort.name":"Name","projects.load.failed":"Failed to load","projects.empty.title":"No projects yet","projects.empty.hint":"Run {cmd} to create your first project.","newProject.title":"New project","newProject.subtitle":"Set up a project; the worker will run automatically","newProject.field.mode":"Execution mode","newProject.field.mode.pipeline":"Auto pipeline","newProject.field.mode.pipelineDesc":"Fixed-stage pipeline, claude worker runs cards","newProject.field.mode.smart":"SmartArrange","newProject.field.mode.smartDesc":"OpenAI monitor dispatches cards + claude worker","newProject.field.mode.pipelineHint":"Classic mode: you create cards, worker runs them by stage.","newProject.field.mode.smartHint":"Give one goal; the OpenAI monitor probes output each round, dispatches task cards dynamically, drives claude to finish.","newProject.field.goal":"Goal (GOAL.md)","newProject.field.goal.hint":"Written to docs/GOAL.md; SmartArrange derives the task list from it. Missing → tick skips the project.","newProject.field.goal.placeholder":"e.g. Build a pure-frontend, single-file Snake browser game…","newProject.field.name":"Project name","newProject.field.name.help":"Lowercase letters, digits, _ and - only","newProject.field.dir":"Project directory","newProject.field.dir.preview":"Project will be created at →","newProject.field.dir.help":"Absolute path; will be created if missing","newProject.field.branch":"Merge target branch","newProject.field.branch.help":"Default: main","newProject.field.maxWorkers":"Max concurrent workers","newProject.field.maxWorkers.help":"Per-project worker count (1 recommended)","newProject.field.ackTimeout":"ACK timeout (seconds)","newProject.field.ackTimeout.help":"How long to wait for the worker to ACK (default 300)","newProject.field.gitlabProject":"GitLab/GitHub remote","newProject.field.gitlabProject.help":"Format: user/repo (optional)","newProject.field.matrixRoom":"Matrix room ID","newProject.field.matrixRoom.help":"Optional, falls back to global default","newProject.field.git":"Enable git","newProject.field.git.help":"Off → non-code project, no commit/push/MR steps","newProject.submit":"Create project","newProject.creating":"Creating…","newProject.created":"Project created","newProject.error.dirRequired":"Project directory is required","newProject.dir.browse":"Browse","newProject.dir.browseAria":"Pick directory","newProject.back":"Back","newProject.back.aria":"Back to projects","newProject.field.name.placeholder":"e.g. acme-web","newProject.field.name.example":"Letters, digits, underscore, hyphen. e.g. acme-web","newProject.field.name.invalid":"Name only allows a-z A-Z 0-9 _ -","newProject.field.dir.long":"Absolute path of the PROJECT directory. The selected directory is the project root; project name defaults to the directory name. Has code → adopt (only adds .claude/ config, never touches source); empty → create new.","newProject.field.dir.placeholder":"/home/you/projects/my-app","newProject.field.dir.createIfMissing":"Auto-create if missing (recommended — otherwise .claude/ install gets skipped)","newProject.field.dir.pickerTitle":"Pick project directory","newProject.field.dir.adopt":"Existing content detected → will adopt (config only, source untouched)","newProject.field.dir.fresh":"Empty directory → create new project","newProject.field.name.derived":"Project name (defaults to directory name, editable)","newProject.field.maxWorkers.short":"Max workers","newProject.field.ackTimeout.minutes":"ACK timeout (min)","newProject.field.ackTimeout.minutes.help":"How long after dispatch before the worker is considered failed if no ACK","newProject.field.git.label":"Enable Git (worker auto commit + push)","newProject.field.git.detail":"When off, the worker only does the task, no version control — fits docs / data-processing non-code projects.","newProject.field.review.label":"Enable checklist review (independent agent verifies each finished card)","newProject.field.review.detail":"When on: cards carrying a checklist are verified item-by-item against the real output by an independent reviewer after the worker finishes; all-pass stays Done, any fail auto-inserts a priority fix card. Cards without a checklist are not reviewed. Write acceptance points with --checklist when creating cards.","newProject.field.git.branch":"Merge branch","newProject.field.gitlabProject.label":"Git remote project path","newProject.field.gitlabProject.help2":"Like user/repo. Empty = skip remote API (commit/push local only)","newProject.field.gitlabProject.placeholder":"user/repo","newProject.field.gitlabProjectId":"GitLab project ID","newProject.field.gitlabProjectId.help":"Number; leave blank for GitHub","newProject.field.gitlabProjectId.placeholder":"42","newProject.section.notifications":"Notifications","newProject.field.matrixRoom.label":"Matrix room ID","newProject.field.matrixRoom.help2":"Empty = use global config; blank = no notifications","newProject.field.matrixRoom.placeholder":"!abc:matrix.example.com","newProject.error.create.title":"Create failed","projectDetail.tab.pipeline":"Pipeline","projectDetail.tab.conf":"Conf","projectDetail.tab.delete":"Delete project","projectDetail.delete.title":"Delete this project","projectDetail.delete.warn":"This will remove the project conf, runtime, and worktrees. The repository under {repoDir} is untouched.","projectDetail.delete.confirmLabel":"Type the project name to confirm","projectDetail.delete.button":"Delete project","projectDetail.delete.deleting":"Deleting…","projectDetail.lastActivity":"Last activity","projectDetail.notFound":"Project not found","projectDetail.notFoundHint":"It may have been deleted or renamed.","projectDetail.backToList":"Back to projects","pipeline.editor.title":"Pipeline YAML","pipeline.editor.savedAt":"Saved {time}","pipeline.editor.unsaved":"Unsaved changes","pipeline.editor.save":"Save","pipeline.editor.saving":"Saving…","pipeline.editor.reload":"Reload from disk","pipeline.editor.discard.title":"Discard unsaved changes?","pipeline.editor.discard.body":"Your edits will be lost.","pipeline.editor.errors":"YAML parse errors","pipeline.editor.list":"Pipelines","pipeline.editor.list.add":"New pipeline","pipeline.editor.list.delete":"Delete pipeline","pipeline.editor.list.use":"Use as active","pipeline.editor.list.activeBadge":"active","pipeline.editor.list.sample":"sample","pipeline.editor.delete.confirm.title":"Delete pipeline {name}?","pipeline.editor.delete.confirm.body":"This action cannot be undone.","pipeline.newDialog.title":"New pipeline","pipeline.newDialog.field.filename":"Filename","pipeline.newDialog.field.filename.help":"Letters, digits, _ and - only; .yaml will be appended","pipeline.newDialog.field.copyFrom":"Copy from","pipeline.newDialog.copyFrom.sample":"sample template","pipeline.newDialog.copyFrom.active":"current active","pipeline.newDialog.create":"Create","projectDetail.tab.overview":"Overview","projectDetail.tab.config":"Config","projectDetail.tab.pipelines":"Pipelines","projectDetail.tab.danger":"Danger zone","projectDetail.openBoard":"Board","projectDetail.overview.repoDir":"Repo path","projectDetail.overview.pmBackend":"PM backend","projectDetail.overview.agent":"Agent","projectDetail.overview.cards":"Cards","projectDetail.overview.cards.value":"{total} total · {inprogress} in progress · {done} done","projectDetail.overview.workers":"Workers","projectDetail.overview.workers.value":"{total} total ({active} active)","projectDetail.overview.pipeline":"Pipeline","projectDetail.overview.lastActivity":"Last activity","projectDetail.overview.notFound":"Project {name} not found or unreadable.","projectDetail.config.confDirty":"● Unsaved changes","projectDetail.config.reload":"Reload","projectDetail.config.save":"Save","projectDetail.config.saveAria":"Save config","projectDetail.config.editorAria":"conf file editor","projectDetail.config.error.conflict.title":"Config was modified elsewhere","projectDetail.config.error.conflict.body":"The conf file was changed while you were editing. Click Reload, then re-edit.","projectDetail.config.error.save.title":"Save failed","projectDetail.config.error.load":"Load failed: {detail}","projectDetail.pipelines.title":"Pipelines","projectDetail.pipelines.add":"New pipeline","projectDetail.pipelines.empty":'No pipeline files yet. Click "New pipeline" to start.',"projectDetail.pipelines.activeBadge":"active","projectDetail.pipelines.edit":"Edit","projectDetail.pipelines.editAria":"Edit {name}","projectDetail.pipelines.switch":"Switch","projectDetail.pipelines.switchAria":"Switch to {name}","projectDetail.pipelines.switch.confirm.title":"Switch to {name}","projectDetail.pipelines.switch.confirm.body":"The current project.yaml will be overwritten with the contents of {name}. Continue?","projectDetail.pipelines.switch.confirm.button":"Switch","projectDetail.pipelines.switch.error":"Switch failed","projectDetail.pipelines.delete.confirm.title":"Delete {name}","projectDetail.pipelines.delete.confirm.body":"This pipeline file will be permanently deleted.","projectDetail.pipelines.delete.error":"Delete failed","projectDetail.pipelines.deleteAria":"Delete {name}","projectDetail.pipelines.create.error":"Create failed","projectDetail.danger.title":"Delete project","projectDetail.danger.body":"This clears {path} (all cards, runtime, logs).","projectDetail.danger.includeClaude.label":"Also clear repo's .claude/","projectDetail.danger.includeClaude.note":"The repo itself is untouched; only this directory is cleaned.","projectDetail.danger.confirmPrompt":"Type the project name {name} to confirm:","projectDetail.danger.deleteAria":"Permanently delete project","projectDetail.danger.deleteButton":"Permanently delete","projectDetail.danger.deleted.title":"Deleted","projectDetail.danger.deleted.bodyWithList":`Project deleted. Also cleaned up:
|
|
496
|
+
{paths}`,"projectDetail.danger.deleted.body":"Project deleted.","projectDetail.danger.error":"Delete failed","pipelineEditor.close":"Close","pipelineEditor.error.conflict.title":"File was modified elsewhere","pipelineEditor.error.yaml.title":"YAML syntax error","pipelineEditor.error.save.title":"Save failed","pipelineEditor.error.serialize.title":"YAML serialize failed","pipelineEditor.error.load":"Load failed: {detail}","pipelineEditor.mode.structured":"Structured","pipelineEditor.mode.yaml":"Raw YAML","pipelineEditor.parseError.prefix":"YAML parse: {detail}","pipelineEditor.activeWarning":"⚠ This is the active pipeline — saving will take effect on the next tick","pipelineEditor.yamlAria":"pipeline YAML editor","pipelineEditor.status.unsaved":"● Unsaved","pipelineEditor.status.saved":"Saved","pipelineEditor.status.noChanges":"No changes","pipelineEditor.reload":"Reload","pipelineEditor.save":"Save","pipelineEditor.saveAria":"Save pipeline","pipelineEditor.activeBadge":"active","pipelineEditor.modeHint":"project = event-driven pipeline (default) · steps = sequential script","pipelineEditor.stages.heading":"Stages ({count})","pipelineEditor.stages.add":"Add stage","pipelineEditor.stages.empty":'No stages yet. Click "Add stage" to start.',"pipelineEditor.stage.name.hint":"Unique stage name","pipelineEditor.stage.profile.hint":"skill profile, may be empty","pipelineEditor.stage.cardState.hint":"Card state during this stage","pipelineEditor.stage.timeout.hint":"Optional, e.g. 30m 2h","pipelineEditor.stage.trigger.hint":"Trigger condition, blank uses default","pipelineEditor.stage.onComplete.hint":"Action on success","pipelineEditor.stage.onFail.action.hint":"Action on failure, e.g. label NEEDS-FIX","pipelineEditor.stage.onFail.comment.hint":"Comment written on the card","pipelineEditor.stage.halt.note":"(stops pipeline on failure; uncheck to continue with next card)","pipelineEditor.stage.moveUp":"Move up","pipelineEditor.stage.moveDown":"Move down","pipelineEditor.stage.remove":"Remove stage","newPipelineDialog.title":"New pipeline","newPipelineDialog.field.filename.label":"Filename","newPipelineDialog.field.filename.placeholder":"e.g. ci","newPipelineDialog.field.filename.help":"Will be saved as {filename}. Only a-z A-Z 0-9 _ - allowed; an existing file errors 409.","newPipelineDialog.section.template":"Initial content","newPipelineDialog.template.blank.label":"Blank template","newPipelineDialog.template.blank.desc":"Minimal 1-stage pipeline (develop → Done)","newPipelineDialog.template.sample.label":"Tutorial template","newPipelineDialog.template.sample.desc":"Copied from sample.yaml.example (annotated, every field explained)","newPipelineDialog.template.sample.unavailable":"sample.yaml.example does not exist","newPipelineDialog.template.active.label":"Copy current active","newPipelineDialog.template.active.desc":"Copied from project.yaml (build on the current config)","newPipelineDialog.template.active.unavailable":"project.yaml does not exist","newPipelineDialog.create.aria":"Create pipeline","newPipelineDialog.cancel":"Cancel","board.title":"Board","board.title.bare":"Board","board.subtitle":"{name} · {cards} cards · {workers} workers active","board.pickPrompt.title":"Pick a project","board.pickPrompt.body":"The board is per-project. Pick one to start:","board.action.start":"Start","board.action.stop":"Stop","board.action.startAria":"Start pipeline","board.action.stopAria":"Stop pipeline","board.action.startError":"Failed to start pipeline","board.action.stopError":"Failed to stop pipeline","board.action.reset":"Reset","board.action.resetError":"Reset failed","board.action.reset.confirm.title":"Reset the entire pipeline","board.action.reset.confirm.body":"This clears all cards’ run state, worker markers, and branches. Cannot be undone.","board.action.reset.confirm.button":"Reset all","board.action.newCard":"New card","board.action.newCard.error":"Failed to create card","board.action.moveCard.error":"Failed to move card","board.search.placeholder":"Search title / skill / label…","board.search.aria":"Search cards","board.filter.clear":"Clear","board.filter.clearAria":"Clear filters","board.filter.aria":"Filter by {label}","board.filter.clearSelection":"Clear selection","board.error.loadCards":"Failed to load cards","board.col.planning":"Planning","board.col.backlog":"Backlog","board.col.todo":"Todo","board.col.inprogress":"Inprogress","board.col.qa":"QA / Review","board.col.done":"Done","kanban.checklist.label":"Checklist {done}/{total}","kanban.checklist.more":"… {count} more","kanban.column.empty":"— empty —","kanban.time.justNow":"just now","kanban.time.minutes":"{n}m ago","kanban.time.hours":"{n}h ago","kanban.time.days":"{n}d ago","newCard.title":"New card","newCard.field.title":"Title *","newCard.field.title.placeholder":"e.g. Add GitHub OAuth login","newCard.field.title.help":"Short, clear goal (<200 chars)","newCard.field.description":"Description","newCard.field.description.placeholder":"User story, requirements, acceptance criteria, references… Claude reads this when starting","newCard.field.description.help":"Markdown supported. If empty, Claude only sees the title.","newCard.field.skills":"Skills","newCard.field.skills.help":"Pick which skills get loaded (via frontmatter `skills:`). Optional — worker falls back to project-level skills.","newCard.field.skills.loading":"Loading skills…","newCard.field.skills.error":"Failed to load skills (creation still works): {detail}","newCard.field.skills.selected":"{count} selected: {names}","newCard.field.dispatch":"Dispatch","newCard.field.dispatch.label":"Dispatch immediately (go straight to Backlog)","newCard.field.dispatch.help":"Default off: card lands in Planning to wait; drag to Backlog when ready. On: skip Planning, the next tick assigns a worker.","newCard.create.aria":"Create card","cardDetail.loading":"Loading…","cardDetail.error.load":"Failed to load card","cardDetail.tabs.overview":"Overview","cardDetail.tabs.body":"Description","cardDetail.tabs.checklist":"Checklist","cardDetail.tabs.history":"History","cardDetail.tabs.actions":"Actions","cardDetail.field.state":"State","cardDetail.field.skills":"Skills","cardDetail.field.labels":"Labels","cardDetail.field.branch":"Branch","cardDetail.field.assignee":"Assignee","cardDetail.field.created":"Created","cardDetail.field.updated":"Updated","cardDetail.field.empty":"—","cardDetail.actions.delete":"Delete card","cardDetail.actions.delete.confirm.title":"Delete card #{seq}","cardDetail.actions.delete.confirm.body":"This card will be permanently deleted.","cardDetail.actions.delete.error":"Delete failed","cardDetail.actions.update.error":"Update failed","cardDetail.body.empty":"No description","cardDetail.checklist.empty":"No checklist","cardDetail.checklist.progress":"Progress {done}/{total}","cardDetail.history.empty":"No history","cardDetail.notFound":"Card #{seq} not found","cardDetail.copy.aria":"Copy seq","cardDetail.close.aria":"Close","cardDetail.save":"Save","cardDetail.saving":"Saving…","workers.title":"Workers","workers.summary":"Across {projects} projects · {running} running · {starting} starting · {stuck} stuck · {crashed} crashed · {idle} idle","workers.summary.stuck":"{n} stuck","workers.summary.crashed":"{n} crashed","workers.refresh.aria":"Refresh","workers.refresh":"Refresh","workers.error.load":"Load failed: {detail}","workers.empty.hint":"Click a project / worker to see details","logs.title":"Logs 📜","logs.subtitle.allProjects":"All projects","logs.subtitle.project":"{name} live tail","logs.filter.errors":"Errors only","logs.filter.errors.aria":"Show errors only","logs.filter.search.placeholder":"Filter messages…","logs.empty":"No logs yet — waiting for events","logs.error.load":"Failed to load logs","logs.refresh":"Refresh","logs.refresh.aria":"Refresh logs","logs.scroll.bottom.aria":"Scroll to bottom","logs.scroll.pause":"Paused (autoscroll off)","logs.scroll.resume":"Resume autoscroll","logs.subtitle.allProjectsCount":"All projects ({count})","logs.poll.5s":"5s polling","logs.paused":"⏸ PAUSED","logs.mode.live":"Live","logs.mode.history":"History","logs.history.startAria":"Query start time","logs.history.queryAria":"Query","logs.history.query":"Query","logs.filter.project.aria":"Filter project","logs.filter.project.all":"All projects","logs.filter.keyword.placeholder":"Filter keyword…","logs.filter.keyword.aria":"Filter logs","logs.empty.match":"No matching logs","skills.title":"Skills 🧠","skills.subtitle":"Skills shared across projects (managed via `sps skill ...`)","skills.empty.title":"No skills yet","skills.empty.hint":"Run {cmd} to sync the bundled skills.","skills.linked.tooltip":"linked into this project","skills.frozen.tooltip":"frozen (per-project copy)","skills.category.all":"All","skills.category.language":"language","skills.category.domain":"domain","skills.category.persona":"persona","skills.category.workflow":"workflow","skills.category.engine":"engine","skills.category.genre":"genre","skills.category.platform":"platform","skills.category.review":"review","skills.category.meta":"meta","skills.category.other":"other","skills.tags.title":"Tags","skills.tags.clear":"Clear","skills.subtitleCount":"{count} user-level skill(s)","skills.search.placeholder":"Search skill…","skills.search.aria":"Search skill","skillDetail.actionFailed":"{label} failed","skillDetail.unfreezeAction":"Unfreeze","skillDetail.freezeAction":"Freeze","skillDetail.removeAction":"Remove","skillDetail.removeConfirm.title":"Remove {name} from {project}","skillDetail.removeConfirm.body":"The skill link will be removed; the project will not see this skill on next run.","skillDetail.removeConfirm.button":"Remove","skillDetail.unfreezeConfirm.title":"Unfreeze {name} @ {project}","skillDetail.unfreezeConfirm.body":"Local changes to this skill will be overwritten with the latest shared version.","skillDetail.unfreezeConfirm.button":"Unfreeze","skillDetail.close.aria":"Close","skillDetail.loading":"Loading…","skillDetail.error.load":"Load failed: {detail}","skillDetail.section.projects":"Per-project link status","skillDetail.section.empty":"No projects yet. Create one first.","skillDetail.section.preview":"SKILL.md preview","skillDetail.toggleSection.aria":"{action} {file}","skillDetail.expand":"Expand","skillDetail.collapse":"Collapse","skillDetail.edit":"Edit","skillDetail.translate":"ZH/EN","skillDetail.delete":"Delete","skillDetail.save":"Save","skillDetail.cancel":"Cancel","skillDetail.translating":"Translating…","skillDetail.saving":"Saving…","skillDetail.editHint":"Edit the raw SKILL.md (incl. frontmatter). After saving, run `sps skill lint` to check the taxonomy & format.","skillDetail.deleteConfirm":'Delete "{name}" from the library? The whole directory is removed — this cannot be undone.',"skillDetail.translateFailed":"Translate failed: {detail}","skillDetail.saveFailed":"Save failed: {detail}","skillDetail.deleteFailed":"Delete failed: {detail}","system.title":"System 🛠","system.subtitle":"Global config + diagnostics + upgrades","system.section.env":"Global env","system.section.env.help":"Stored in ~/.coral/env (mode 600). Used by all projects.","system.section.env.save":"Save env","system.section.env.error.conflict":"env was modified elsewhere","system.section.env.error.save":"Failed to save env","system.section.env.error.load":"Failed to load env","system.section.env.dirtyDot":"● Unsaved","system.section.env.aria":"env editor","system.section.env.reload":"Reload","system.section.upgrade":"Upgrade","system.section.upgrade.current":"Current: v{version}","system.section.upgrade.latest":"Latest on npm: v{version}","system.section.upgrade.uptodate":"Up to date","system.section.upgrade.update":"Upgrade now","system.section.upgrade.upgrading":"Upgrading…","system.section.upgrade.checking":"Checking npm…","system.section.upgrade.checkError":"Check failed: {detail}","system.section.upgrade.upgradeError":"Upgrade failed: {detail}","system.section.upgrade.upgradeError.title":"Upgrade failed","system.section.upgrade.command":"Or run in terminal: {cmd}","system.section.upgrade.runningPipelines":"Pipelines running — stop them first: {projects}","system.section.diagnostics":"Diagnostics","system.section.diagnostics.help":"Run sps doctor across all projects, see failures at a glance","system.section.diagnostics.run":"Run diagnostics","system.section.diagnostics.running":"Running…","system.section.diagnostics.empty":"No projects","system.section.diagnostics.checkAria":"Check {project}","system.section.diagnostics.statusOk":"OK","system.section.diagnostics.statusFail":"Issues","system.section.diagnostics.error":"Diagnostic failed: {detail}","system.h1":"System","system.runtime":"Runtime","system.memory.title":"Memory backend","system.memory.desc":"Global setting: which backend workers read/write memory through. Applies to newly dispatched cards.","system.memory.provider":"Backend","system.memory.url":"Custom URL","system.memory.url.placeholder":"http://127.0.0.1:3111","system.memory.save":"Save","system.memory.save.aria":"Save memory backend setting","system.memory.saved":"Saved","system.memory.error":"Save failed","system.memory.opt.none":"Off (none)","system.memory.opt.builtin":"Local file memory (builtin)","system.memory.opt.agentmemory":"agentmemory (semantic)","system.memory.opt.custom":"Custom REST (custom)","system.env.title.code":"~/.coral/env","system.env.title.prefix":"Global config ","system.env.edit.aria":"Edit env file","system.env.edit.button":"Edit","system.env.editing.label":"⚠ Editing","system.env.empty.before":'env file does not exist. Click "Edit" or run ',"system.env.empty.after":" in the terminal.","system.env.warning":"⚠ This file contains plaintext credentials. Keep mode 0600 on save.","system.env.aria":"env editor","system.env.dirtyMark":" · ● Unsaved","system.env.cancel":"Cancel","system.env.save":"Save","system.env.save.aria":"Save env","system.env.error.conflict.title":"env was modified elsewhere","system.env.error.save.title":"Save failed","system.env.error.conflict.body":"Cancel and reopen the editor.","system.upgrade.title":"Version","system.upgrade.checkLatest.aria":"Check latest version","system.upgrade.checkUpdate":"Check update","system.upgrade.label.current":"sps-cli (current)","system.upgrade.label.latest":"npm (latest)","system.upgrade.latestPill":"latest","system.upgrade.button.upgradeAria":"Upgrade to latest","system.upgrade.button.upgrade":"Upgrade","system.upgrade.button.copyAria":"Copy upgrade command","system.upgrade.button.copyTitle":"Copy command (run manually if auto upgrade fails)","system.upgrade.button.copy":"Copy command","system.upgrade.label.installed":"Installed","system.upgrade.installed.ok":"Active (restart console to see)","system.upgrade.installed.fail":"Upgrade not effective","system.upgrade.label.check":"Check","system.upgrade.confirm.title":"Upgrade sps-cli","system.upgrade.confirm.body":"Current {current}, upgrade to {latest}. Requires all pipelines stopped. Restart sps console after upgrade.","system.upgrade.confirm.button":"Upgrade","system.upgrade.success.title":"Upgrade complete","system.upgrade.success.body":'Installed v{version}. Run `pkill -f "sps console"` and restart to see it.',"system.upgrade.notEffective.title":"Upgrade not effective","system.upgrade.notEffective.same":"npm finished but the version did not change (still {version}) — likely a permissions or registry issue. Copy the command below to run manually.","system.upgrade.notEffective.notInstalled":"npm did not install a new version. Copy the command to run manually, or check the log below.","system.upgrade.error.title":"Upgrade failed","system.upgrade.copy.success.title":"Command copied","system.upgrade.copy.success.body":`Paste it into a terminal:
|
|
497
|
+
{cmd}`,"system.upgrade.copy.fail.title":"Copy failed","system.upgrade.copy.fail.body":`Copy manually:
|
|
498
|
+
{cmd}`,"system.diagnostics.title":"Project health check","system.diagnostics.checkAll":"Check all","system.diagnostics.empty":"No projects yet.","system.diagnostics.expandAria":"Expand","system.diagnostics.collapseAria":"Collapse","system.diagnostics.never":'Click "Check" to run sps doctor',"system.diagnostics.checkAria":"Check","system.diagnostics.check":"Check","system.diagnostics.noFixesNeeded":"Nothing to fix","system.diagnostics.fix.tip":"Run sps doctor <proj> --fix: auto-create .claude/hooks/stop.sh, state.json, etc.","system.diagnostics.fixAria":"Auto fix","system.diagnostics.fix":"Fix","system.diagnostics.fixed":"Fixed","system.diagnostics.error.fix":"doctor fix failed","system.diagnostics.error.check":"doctor check failed","chat.title":"Chat 💬","chat.empty.title":"Chat 💬","chat.empty.hint":'Click "New chat" on the left to start a session, or just type below — a session will be auto-created.',"chat.empty.shortcuts":"Enter to send · Shift+Enter for newline · streamed reply","chat.list.heading":"History {count}","chat.list.new":"New chat","chat.list.empty":"No chats yet. Click above to start.","chat.list.delete.aria":"Delete chat","chat.list.deleteCli.aria":"Remove this CLI session from the Console (does not affect Claude jsonl history)","chat.list.openAria":"Open chat {title}{cwd}","chat.list.cwdSuffix":" (cwd: {cwd})","chat.list.msgs":"{count} msg · {time}","chat.list.olderToggle":"Earlier · {count}","chat.detail.model.tooltip":"Current model in use","chat.detail.claudeSession.tooltip":"Underlying claude session id — the anchor for resuming session & memory","chat.delete.confirm.title":"Delete chat","chat.delete.confirm.body.cli":"Will be removed from the Console list (the daemon session is stopped). The Claude CLI history under ~/.claude/projects is preserved — to continue, run `sps agent --chat --name <name>` in a terminal.","chat.delete.confirm.body.console":"Chat history will be permanently deleted.","chat.delete.confirm.button":"Delete","chat.cli.banner.bold":"CLI session","chat.cli.banner":"This session was created by sps agent. The Console only shows history. To continue, run in a terminal:","chat.input.placeholder":"Say something… (Enter to send, Shift+Enter for newline, drag files / paste images)","chat.input.dragOver":"Drop to attach…","chat.input.aria":"Message input","chat.input.attach.aria":"Attach a local file","chat.input.attach.title":"Attach a local file (also drag / paste images)","chat.input.send":"Send","chat.input.send.aria":"Send","chat.input.interrupt":"Stop","chat.input.interrupt.aria":"Stop generation","chat.input.uploading":"Uploading…","chat.input.removeAttachment":"Remove {name}","chat.error.interrupt.title":"Interrupt failed","chat.cliBadge":"CLI","chat.cliBadge.tooltip":"Created by sps agent CLI; history is read live from Claude jsonl (read-only).","chat.session.title":"{title}","chat.session.id":"{id}","chat.session.empty":"Type a question below to start · Enter to send · Shift+Enter for newline","notFound.title":"404","notFound.body":"This page does not exist.","notFound.home":"Back to home","workers.active.empty":"No workers running.","workers.alerts.allHealthy":"All workers healthy","workers.alerts.pidDead":"PID dead.","workers.alerts.markerStale":"marker stale {ago}.","workers.capacity.col.project":"Project","workers.capacity.col.usage":"Usage","workers.capacity.col.other":"Other","workers.capacity.detailHint":"details →","workers.panel.boardLink":"Board →","workers.panel.loading":"Loading workers…","workers.panel.empty.slots":"This project has no worker slots.","workers.panel.empty.noWorker":"No workers","workers.panel.empty.pickOne":"Pick a worker","workers.panel.idle.short":"idle","workers.panel.section.currentCard":"Current card","workers.panel.idle.full":"Slot idle, no current card.","workers.panel.section.claudeOutput":"Claude output · last {n} lines","workers.panel.output.loading":"Loading…","workers.panel.output.empty":"No session output yet. The worker needs a few seconds to start.","workers.panel.section.heartbeat":"Supervisor heartbeat · last {n} lines","workers.panel.heartbeat.fullLog":"View full log →","workers.panel.action.restart":"Restart","workers.panel.action.restart.confirm.title":"Restart worker-{slot}","workers.panel.action.restart.confirm.body":"Kill the process, then re-launch onto #{seq}","workers.panel.action.restart.confirm.button":"Restart","workers.panel.action.restart.error":"Restart failed","workers.panel.action.kill":"Kill","workers.panel.action.kill.confirm.title":"Kill worker-{slot}","workers.panel.action.kill.confirm.body":"The current task will be force-aborted.","workers.panel.action.kill.confirm.button":"Kill","workers.panel.action.kill.error":"Kill failed","dialog.confirm.default":"OK","dialog.alert.default":"Got it","dialog.cancel.default":"Cancel","dirPicker.title.default":"Pick a directory","dirPicker.close.aria":"Close","dirPicker.up.aria":"Parent directory","dirPicker.up.title":"Parent directory","dirPicker.home.aria":"Back to home","dirPicker.home.title":"Back to home","dirPicker.loading":"Loading…","dirPicker.error.title":"Read failed","dirPicker.empty":"— empty —","dirPicker.enter.aria":"Enter {name}/","dirPicker.pickFile.aria":"Pick {name} (double-click to confirm)","dirPicker.fileLocked":"File not selectable","dirPicker.cancel":"Cancel","dirPicker.useFile":"Use this file","dirPicker.useFile.tooltip.empty":"Click a file first","dirPicker.useDir":"Use this directory","dirPicker.newDir":"New folder","dirPicker.newDir.aria":"Create a subdirectory in the current directory","dirPicker.newDir.prompt":"New folder name (letters, digits, _ . - only)","dirPicker.newDir.placeholder":"Folder name","dirPicker.newDir.create":"Create","dirPicker.newDir.error.title":"Failed to create folder","errorBoundary.title":"💥 UI crashed","errorBoundary.refresh":"Refresh page","chat.error.create.title":"Failed to create chat","chat.error.send.title":"Send failed","chat.error.fileTooBig.title":"File too large","chat.error.fileTooBig.body":"Per-file limit is 50 MB; this is {size} MB ({name})","chat.error.uploadAttachment.title":"Attachment upload failed","chat.placeholder.attachment":"(attachment)","chat.placeholder.viewAttachment":"(see attachment)","chat.placeholder.attachmentTitle":"Attachment","chat.attachment.previewTooltip":`{name}
|
|
499
|
+
{path}
|
|
500
|
+
Click to preview`,"chat.attachment.previewSimpleTooltip":`{name}
|
|
501
|
+
Click to zoom`,"chat.attachment.preview.aria":"Preview {name}","chat.attachment.close.aria":"Close","chat.attachment.readErr":"Read failed: {detail}","chat.attachment.loading":"Loading…","chat.attachment.unsupported":"This file type cannot be previewed inline.","chat.attachment.download":"Download","chat.message.role.you":"You","chat.message.role.error":"Error","chat.message.role.assistant":"assistant","chat.message.truncated":"⚠ Output exceeded 10MB and was truncated","chat.filePicker.title":"Pick attachment file","chat.newSession.title":"New chat","chat.newSession.title.aria":"New chat","chat.newSession.close.aria":"Close","chat.newSession.field.agent":"Agent","chat.newSession.field.model":"Model (optional)","chat.newSession.field.model.default":"Use global default model","chat.newSession.field.title":"Title (optional)","chat.newSession.field.title.placeholder":"Empty = auto-generate from first message","chat.newSession.field.cwd":"Working directory (optional)","chat.newSession.field.cwd.browse":"Browse","chat.newSession.field.cwd.browseAria":"Pick directory","chat.newSession.field.cwd.title":"Pick directory","chat.newSession.field.cwd.help1":"The agent reads/writes files here. Absolute path; must exist.","chat.newSession.field.cwd.help2":"Empty = use the daemon’s startup cwd.","chat.newSession.cancel":"Cancel","chat.newSession.create":"Create","cardModal.editing":"⚠ Editing","cardModal.title.aria":"Card title","cardModal.editAria":"Edit card","cardModal.edit":"Edit","cardModal.close.aria":"Close","cardModal.error.save.title":"Save failed","cardModal.error.load":"Load failed: {detail}","cardModal.skills.loading":"Loading skill list…","cardModal.label.removeAria":"Remove {label}","cardModal.label.addPlaceholder":"+ Add label","cardModal.label.addAria":"Add label","cardModal.label.note":"Note: AI-PIPELINE / STARTED-* / COMPLETED-* / NEEDS-FIX are managed by the pipeline; manual changes may be overwritten","cardModal.section.description":"Description","cardModal.section.empty":"(empty)","cardModal.section.checklist":"Checklist","cardModal.checklist.empty":"No checklist items. Add `- [ ] item` syntax in the description.","cardModal.section.log":"Log","cardModal.body.aria":"Card description","cardModal.body.replaceNote":'Only replaces the "## Description" section; checklist and log sections are untouched.',"cardModal.action.launch":"Launch worker","cardModal.action.launch.disabledDone":"Card is done; drag back to Todo to launch","cardModal.action.launch.disabledRunning":"Pipeline is running — supervisor dispatches automatically, no manual launch needed","cardModal.action.launch.error":"Launch worker failed","cardModal.action.reset":"Reset card","cardModal.action.viewPrompt":"View prompt","cardModal.prompt.title":"Worker prompt (preview)","cardModal.prompt.loading":"Rebuilding prompt…","cardModal.prompt.error":"Failed: {detail}","cardModal.prompt.copy":"Copy","cardModal.prompt.copied":"Copied","cardModal.prompt.metaSkills":"skills: {skills}","cardModal.prompt.metaMemory":"memory block","cardModal.prompt.metaGit":"git mode","cardModal.prompt.metaNonGit":"non-git","cardModal.prompt.nativeTitle":"Also read natively by claude (not in this string):","cardModal.prompt.sourceActual":"✅ Actual prompt as dispatched ({time})","cardModal.prompt.sourcePreview":"⚠️ Reconstructed preview (card not yet dispatched; memory reflects current state, may differ from the real dispatch)","cardModal.action.reset.confirm.title":"Reset card #{seq}","cardModal.action.reset.confirm.body":"Card state goes back to initial; checklist progress is cleared.","cardModal.action.reset.confirm.button":"Reset","cardModal.action.reset.error":"Reset failed","cardModal.action.delete":"Delete card","cardModal.action.delete.confirm1.title":"Delete card #{seq}","cardModal.action.delete.confirm1.body":'About to delete "{title}". This cannot be undone (the md file is physically removed). Continue?',"cardModal.action.delete.confirm1.button":"Continue","cardModal.action.delete.confirm2.title":"Final confirmation","cardModal.action.delete.confirm2.body":"Please re-confirm deleting card #{seq}.","projectDetail.tab.skills":"Skills","projectDetail.tab.rules":"Rules","projectDetail.skills.title":"Skill whitelist","projectDetail.skills.desc":"Pick which skills this project loads. Narrows what workers, subagents and chat see — cuts token cost.","projectDetail.skills.noPolicy":"No whitelist — all skills are available (subagents load the full set from disk).","projectDetail.skills.hasPolicy":"Whitelist active — {count} skill(s) eligible.","projectDetail.skills.save":"Save whitelist","projectDetail.skills.clear":"Clear (load all)","projectDetail.skills.saveError":"Failed to save whitelist","projectDetail.skills.applied":"Saved. Projected {linked} linked, {pruned} pruned.","projectDetail.skills.unknown":"Unknown skill name(s), ignored: {names}","projectDetail.skills.empty":"No skills installed. Run `sps skill sync` first.","projectDetail.skills.selectAll":"Select all","projectDetail.skills.selectNone":"Select none","projectDetail.rules.title":"Project rules (read-only)","projectDetail.rules.readonly":"sps-cli only reads these. Editing is done at project creation or by an agent later.","projectDetail.rules.missing":"Not present","nav.prompts":"Prompts","prompts.title":"Prompt library","prompts.desc":"Reusable prompts with {{variable}} templates. Insert them into chat.","prompts.new":"New prompt","prompts.search":"Search prompts…","prompts.empty":"No prompts yet. Create one.","prompts.name":"Name","prompts.namePlaceholder":"kebab-case, e.g. code-review","prompts.nameError":"Name must be kebab-case (a-z, 0-9, dashes).","prompts.description":"Description","prompts.tags":"Tags","prompts.tagsPlaceholder":"comma,separated","prompts.body":"Body","prompts.bodyPlaceholder":"Write your prompt. Use {{variable}} for fill-ins.","prompts.favorite":"Favorite","prompts.save":"Save","prompts.delete":"Delete","prompts.deleteConfirm":'Delete prompt "{name}"? This removes the file.',"prompts.saveError":"Failed to save prompt","prompts.vars":"Variables: {names}","prompts.noVars":"No variables","prompts.insert":"Insert a prompt","prompts.selectHint":"Select a prompt on the left, or create a new one.","prompts.tagAdd":"Type a tag, press Enter","prompts.ai":"AI generate","prompts.ai.title":"AI generate a prompt","prompts.ai.intent":"Describe what you want","prompts.ai.placeholder":"e.g. a prompt for reviewing TypeScript code for security issues","prompts.ai.submit":"Generate","prompts.ai.wait":"The agent is writing… this can take a while.","prompts.ai.error":"Generation failed","skills.import":"Import","skills.import.title":"Import a skill","skills.import.name":"Name (kebab-case)","skills.import.body":"SKILL.md content","skills.import.submit":"Import","skills.import.error":"Import failed","skills.export":"Export SKILL.md","skills.updates.badge":"{count} update(s) available","skills.updates.none":"Up to date","skills.ai":"AI create","skills.ai.title":"AI create a skill","skills.ai.name":"Name (kebab-case)","skills.ai.intent":"What is this skill for?","skills.ai.placeholder":"e.g. how to write idiomatic Rust error handling","skills.ai.submit":"Create","skills.ai.wait":"The agent is writing the skill… this can take a while.","skills.ai.error":"Create failed","projectDetail.tab.graph":"Code Graph","projectDetail.tab.logs":"Logs","graph.title":"Code Graph","graph.desc":"A symbol-level dependency graph of this project (tree-sitter, zero-token). Gives agents surgical context so they explore fewer files.","graph.build":"Build graph","graph.rebuild":"Rebuild","graph.building":"Building…","graph.sync":"Sync","graph.syncing":"Syncing…","graph.sync.desc":"Incremental — only re-index changed files (fast)","graph.empty":"No graph yet — build one to enable agent navigation and the dependency view.","graph.buildFailed":"Build failed","graph.stat.files":"Files","graph.stat.nodes":"Nodes","graph.stat.edges":"Edges","graph.stat.db":"DB size","graph.stat.lastBuilt":"Last built","graph.viz.title":"File dependency graph","graph.viz.loading":"Loading graph…","graph.viz.empty":"Build the graph to see the dependency view.","graph.viz.hint":"Node = file · edge = import · drag to explore · search to highlight","graph.viz.search":"Highlight files…"},Vz={"app.title":"SPS 控制台","nav.home":"首页","nav.chat":"对话","nav.projects":"项目","nav.board":"看板","nav.workers":"Workers","nav.logs":"日志","nav.skills":"技能","nav.system":"系统","nav.processes":"进程","nav.audit":"审计日志","nav.memory":"记忆","nav.plugins":"插件","plugins.h1":"插件","plugins.desc":"全局插件开关。改动对之后新派发的卡生效。","plugins.tab.memory":"记忆","plugins.tab.channel":"频道","plugins.tab.model":"模型","plugins.tab.tool":"工具","plugins.comingSoon":"即将上线","plugins.model.title":"智能体模型","plugins.model.desc":"配置两个智能体的模型(全局)。worker=claude 执行、review·designer=openai 监工+编排。","plugins.model.worker":"Worker(执行 / claude)","plugins.model.reviewer":"Review·Designer(监工 / openai)","plugins.model.provider":"Provider","plugins.model.model":"模型","plugins.model.official":"官方 claude(默认)","plugins.model.save":"保存","plugins.model.saved":"已保存","plugins.model.error":"保存失败","nav.arrange":"编排","arrange.h1":"智能编排","arrange.project":"项目","arrange.none":"尚未开始 — 点上方「启动」拉起编排(几秒后出任务清单,确认即跑)。若下拉无项目,先在「新建项目」选智能编排模式。","arrange.start":"启动","arrange.stop":"停止","arrange.startErr":"启动/停止失败","arrange.view":"切换画板视图","arrange.viewFree":"自由","arrange.viewLane":"泳道","arrange.starting":"启动中,正在拆解任务清单…","arrange.planning":"正在拆解任务清单…","arrange.orchestrating":"正在编排中…","arrange.status":"状态","arrange.goal":"目标","arrange.plan":"任务清单 + 卡链路","arrange.approve":"确认任务清单","arrange.approveErr":"确认失败","arrange.tasks":"任务清单","arrange.collapse":"收起","arrange.expand":"展开任务清单","arrange.noCards":"暂无卡片 — 等待 orchestrator 派卡(确认清单后开始)。","arrange.cardPrompt":"卡片提示词","arrange.cardSkills":"技能","arrange.cardTask":"所属任务","arrange.cardLog":"日志","arrange.close":"关闭","arrange.cardsCount":"张卡","nav.aria":"主导航","home.eyebrow":"语音空间","home.title":"今天想创造什么?","home.subtitle":"让语音成为你与 AI 之间最自然的界面。","home.openChat":"打开对话","home.conversation.title":"语音对话","home.conversation.subtitle":"直接说出你的想法,AI 会实时理解并回应。","home.conversation.empty":"点击下方语音球开始对话","home.conversation.you":"你","home.conversation.ai":"AI","home.conversation.listening":"正在聆听…","home.conversation.thinking":"思考中","home.debug.open":"调试","home.debug.close":"关闭调试面板","home.voice.start":"开始聆听","home.voice.stop":"结束聆听","home.voice.finish":"再次点击结束聆听","home.voice.idle":"点击语音球开始","home.voice.listening":"正在聆听","home.voice.thinking":"正在思考","home.voice.speaking":"正在回答","home.error.recognitionUnsupported":"当前浏览器不支持语音识别。","home.error.recognition":"没有识别到有效语音,请重试。","home.error.response":"AI 响应失败,请重试。","home.phase.aria":"语音交互状态","home.phase.idle":"待机","home.phase.listening":"聆听","home.phase.thinking":"思考","home.phase.speaking":"回答","home.visualizer.aria":"Flow 语音声场","home.mic.inactive":"麦克风就绪","home.mic.requesting":"正在连接麦克风","home.mic.active":"麦克风实时输入","home.mic.denied":"麦克风不可用","home.mic.unsupported":"浏览器不支持麦克风","home.message.idle":"准备好了,随时可以开始。","home.message.listening":"我在听。告诉我你脑海里的想法。","home.message.thinking":"正在连接你的意图、上下文与下一步。","home.message.speaking":"方向已经清晰,我们从第一步开始。","home.simulation.start":"模拟","home.simulation.stop":"停止模拟","home.simulation.running":"效果模拟中","home.simulation.listeningText":"我在听。告诉我你脑海里的想法。","home.simulation.speakingText":"方向已经清晰,我们从第一步开始。","home.customize.title":"参数调节","home.customize.reset":"重置参数","home.customize.colors":"颜色","home.customize.parameters":"参数","home.customize.color1":"颜色 1","home.customize.color2":"颜色 2","home.customize.color3":"颜色 3","home.customize.count":"数量","home.customize.speed":"速度","home.customize.amplitude":"振幅","home.customize.waviness":"波形密度","home.customize.thickness":"宽度","home.customize.glow":"光晕","home.customize.taper":"边缘收束","home.customize.spread":"分离度","home.customize.hueShift":"色相偏移","home.customize.intensity":"亮度","home.customize.saturation":"饱和度","home.customize.opacity":"透明度","home.customize.scale":"缩放","memory.sub":"跨项目记忆 · 经 console 鉴权代理 agentmemory","memory.searchPlaceholder":"搜索记忆…(如:三消美术竞态怎么修)","memory.search":"搜索","memory.results":"召回结果","memory.rawHint":"(原始观察 · 接入实时捕获+压缩后这里会显示提炼的教训)","memory.sessions":"最近会话","memory.empty":"暂无记忆 · 接入实时捕获(P1)后自动累积","processes.title":"进程监控","processes.subtitle":"SPS ACP 启动的 claude 进程(其它途径启动的,如你自己的会话,不显示)","processes.refresh":"刷新","processes.aliveCount":"运行中 {n}","processes.col.kind":"类型","processes.col.slot":"会话槽","processes.col.project":"项目","processes.col.state":"状态","processes.col.memory":"内存","processes.col.action":"操作","processes.empty":"没有 SPS 进程","processes.filter.all":"全部","processes.filter.alive":"运行中","processes.filter.offline":"离线","processes.kind.all":"全部类型","processes.kind.worker":"构建 Worker","processes.kind.chat":"对话","processes.kill":"关闭","processes.killConfirm":"确定关闭进程 {slot}?","audit.title":"审计日志","audit.subtitle":"项目生命周期:创建 / 修改 / 删除","audit.refresh":"刷新","audit.filter.all":"全部","audit.action.create":"创建","audit.action.modify":"修改","audit.action.delete":"删除","audit.action.daemon":"Daemon","audit.col.time":"时间","audit.col.action":"动作","audit.col.project":"项目","audit.col.detail":"详情","audit.empty":"暂无审计记录","lang.toggle.aria":"切换界面语言","lang.en":"EN","lang.zh":"中","theme.toggle.aria":"切换主题","theme.dark":"暗色主题","theme.light":"亮色主题","status.server":"服务","status.offline":"离线","status.sse.open":"SSE","status.sse.connecting":"SSE·连接中","status.sse.down":"SSE·断开","status.pipelines.tooltip":"活跃流水线数","status.workers.tooltip":"活跃 Worker 数","status.pipeline.unit":"流水线","status.worker.unit":"Worker","common.save":"保存","common.cancel":"取消","common.delete":"删除","common.confirm":"确认","common.create":"创建","common.edit":"编辑","common.close":"关闭","common.loading":"加载中…","common.error":"出错","common.retry":"重试","common.empty":"暂无内容","common.search":"搜索","common.refresh":"刷新","common.copy":"复制","common.copied":"已复制","common.yes":"是","common.no":"否","common.required":"必填","common.optional":"可选","common.ok":"好","projects.title":"项目","projects.count":"本机有 {count} 个项目","projects.refresh.hint":"点击刷新重试","projects.new":"新建项目","projects.selectHint":"在左侧选择一个项目查看详情。","projects.sort.label":"排序方式","projects.sort.activity":"活跃度","projects.sort.date":"修改日期","projects.sort.name":"名字","projects.load.failed":"加载失败","projects.empty.title":"还没有项目","projects.empty.hint":"运行 {cmd} 创建第一个项目。","newProject.title":"新建项目","newProject.subtitle":"配置一个项目,worker 自动开跑","newProject.field.mode":"执行模式","newProject.field.mode.pipeline":"自动工作流","newProject.field.mode.pipelineDesc":"固定阶段流水线,claude worker 按卡执行","newProject.field.mode.smart":"智能编排","newProject.field.mode.smartDesc":"OpenAI 监工动态派卡 + claude worker 执行","newProject.field.mode.pipelineHint":"传统模式:你建卡片,worker 按阶段跑。","newProject.field.mode.smartHint":"给一个总目标,OpenAI 监工每轮探查产物、动态生成任务卡、驱动 claude 完成。","newProject.field.goal":"总目标 (GOAL.md)","newProject.field.goal.hint":"写入 docs/GOAL.md;智能编排据此拆任务清单。缺失则 tick 跳过该项目。","newProject.field.goal.placeholder":"例:做一个纯前端、单文件可运行的贪吃蛇网页小游戏…","newProject.field.name":"项目名","newProject.field.name.help":"只允许小写字母、数字、_ 和 -","newProject.field.dir":"项目目录","newProject.field.dir.preview":"项目将创建在 →","newProject.field.dir.help":"绝对路径;不存在会自动创建","newProject.field.branch":"合并目标分支","newProject.field.branch.help":"默认 main","newProject.field.maxWorkers":"最大并发 Worker 数","newProject.field.maxWorkers.help":"单项目并发数(推荐 1)","newProject.field.ackTimeout":"ACK 超时(秒)","newProject.field.ackTimeout.help":"Worker 响应等待秒数(默认 300)","newProject.field.gitlabProject":"GitLab/GitHub 远程","newProject.field.gitlabProject.help":"格式:用户名/仓库(可选)","newProject.field.matrixRoom":"Matrix 房间 ID","newProject.field.matrixRoom.help":"可选;不填则用全局默认","newProject.field.git":"启用 git","newProject.field.git.help":"关闭 → 非代码项目,跳过 commit/push/MR","newProject.submit":"创建项目","newProject.creating":"创建中…","newProject.created":"项目已创建","newProject.error.dirRequired":"项目目录必填","newProject.dir.browse":"浏览","newProject.dir.browseAria":"选择目录","newProject.back":"返回","newProject.back.aria":"返回项目列表","newProject.field.name.placeholder":"例如:acme-web","newProject.field.name.example":"只能用字母、数字、下划线、连字符。例如 acme-web","newProject.field.name.invalid":"名称只能包含 a-z A-Z 0-9 _ -","newProject.field.dir.long":"本机绝对路径的【项目目录】。选中的目录本身就是项目根;项目名默认取目录名。已有代码 → 收编(只加 .claude/ 配置,不动源码);空目录 → 新建。","newProject.field.dir.placeholder":"/home/you/projects/my-app","newProject.field.dir.createIfMissing":"目录不存在时自动创建(推荐 —— 否则 .claude/ 安装会被跳过)","newProject.field.dir.pickerTitle":"选择项目目录","newProject.field.dir.adopt":"检测到已有内容 → 将收编(只加配置,不动源码)","newProject.field.dir.fresh":"空目录 → 新建项目","newProject.field.name.derived":"项目名(默认取目录名,可微调)","newProject.field.maxWorkers.short":"最大 Worker 数","newProject.field.ackTimeout.minutes":"ACK 超时(分钟)","newProject.field.ackTimeout.minutes.help":"Worker 启动后多久没 ACK 视为失败","newProject.field.git.label":"启用 Git(Worker 自动 commit + push)","newProject.field.git.detail":"关闭后 Worker 只做任务、不做版本控制;适合文档/数据处理等非代码项目。","newProject.field.review.label":"启用清单验收(每卡完成后独立 agent 审核)","newProject.field.review.detail":"开启后:卡带「检查清单」的,Worker 完成后由独立 reviewer 逐条对着真实产物验收;全过留 Done,有不过自动插一张修正卡(优先跑)。无清单的卡不审。建卡时用 --checklist 写验收点。","newProject.field.git.branch":"合并分支","newProject.field.gitlabProject.label":"Git 远程项目路径","newProject.field.gitlabProject.help2":"如 user/repo,空则跳过远程 API(只本地 commit/push)","newProject.field.gitlabProject.placeholder":"user/repo","newProject.field.gitlabProjectId":"GitLab 项目 ID","newProject.field.gitlabProjectId.help":"数字;GitHub 用户留空","newProject.field.gitlabProjectId.placeholder":"42","newProject.section.notifications":"通知","newProject.field.matrixRoom.label":"Matrix 房间 ID","newProject.field.matrixRoom.help2":"空则使用全局配置;不填 = 不通知","newProject.field.matrixRoom.placeholder":"!abc:matrix.example.com","newProject.error.create.title":"创建失败","projectDetail.tab.pipeline":"流水线","projectDetail.tab.conf":"配置","projectDetail.tab.delete":"删除项目","projectDetail.delete.title":"删除该项目","projectDetail.delete.warn":"会删除项目配置、运行时和 worktree。{repoDir} 下的代码仓库不动。","projectDetail.delete.confirmLabel":"输入项目名以确认","projectDetail.delete.button":"删除项目","projectDetail.delete.deleting":"删除中…","projectDetail.lastActivity":"最后活跃","projectDetail.notFound":"项目不存在","projectDetail.notFoundHint":"可能已被删除或重命名。","projectDetail.backToList":"返回项目列表","pipeline.editor.title":"流水线 YAML","pipeline.editor.savedAt":"{time} 已保存","pipeline.editor.unsaved":"有未保存的修改","pipeline.editor.save":"保存","pipeline.editor.saving":"保存中…","pipeline.editor.reload":"从磁盘重新加载","pipeline.editor.discard.title":"放弃未保存的修改?","pipeline.editor.discard.body":"你的编辑会丢失。","pipeline.editor.errors":"YAML 解析错误","pipeline.editor.list":"流水线","pipeline.editor.list.add":"新建流水线","pipeline.editor.list.delete":"删除流水线","pipeline.editor.list.use":"设为当前","pipeline.editor.list.activeBadge":"当前","pipeline.editor.list.sample":"示例","pipeline.editor.delete.confirm.title":"删除流水线 {name}?","pipeline.editor.delete.confirm.body":"此操作不可撤销。","pipeline.newDialog.title":"新建流水线","pipeline.newDialog.field.filename":"文件名","pipeline.newDialog.field.filename.help":"只允许字母、数字、_ 和 -;自动追加 .yaml","pipeline.newDialog.field.copyFrom":"复制自","pipeline.newDialog.copyFrom.sample":"示例模板","pipeline.newDialog.copyFrom.active":"当前活动","pipeline.newDialog.create":"创建","projectDetail.tab.overview":"概览","projectDetail.tab.config":"配置","projectDetail.tab.pipelines":"流水线","projectDetail.tab.danger":"危险操作","projectDetail.openBoard":"看板","projectDetail.overview.repoDir":"仓库路径","projectDetail.overview.pmBackend":"PM 后端","projectDetail.overview.agent":"Agent","projectDetail.overview.cards":"卡片","projectDetail.overview.cards.value":"共 {total} 张 · {inprogress} 进行中 · {done} 完成","projectDetail.overview.workers":"Worker","projectDetail.overview.workers.value":"共 {total} 个({active} 活跃)","projectDetail.overview.pipeline":"Pipeline","projectDetail.overview.lastActivity":"最近活动","projectDetail.overview.notFound":"项目 {name} 不存在或无法读取。","projectDetail.config.confDirty":"● 未保存的修改","projectDetail.config.reload":"重新加载","projectDetail.config.save":"保存","projectDetail.config.saveAria":"保存配置","projectDetail.config.editorAria":"conf 文件编辑器","projectDetail.config.error.conflict.title":"配置已被其他地方修改","projectDetail.config.error.conflict.body":'conf 文件在你编辑期间被改过。点"重新加载"后再编辑。',"projectDetail.config.error.save.title":"保存失败","projectDetail.config.error.load":"加载失败:{detail}","projectDetail.pipelines.title":"流水线","projectDetail.pipelines.add":"新建流水线","projectDetail.pipelines.empty":'还没有流水线文件。点"新建流水线"开始。',"projectDetail.pipelines.activeBadge":"当前","projectDetail.pipelines.edit":"编辑","projectDetail.pipelines.editAria":"编辑 {name}","projectDetail.pipelines.switch":"切换","projectDetail.pipelines.switchAria":"切换到 {name}","projectDetail.pipelines.switch.confirm.title":"切换到 {name}","projectDetail.pipelines.switch.confirm.body":"当前 project.yaml 会被 {name} 的内容覆盖。继续?","projectDetail.pipelines.switch.confirm.button":"切换","projectDetail.pipelines.switch.error":"切换失败","projectDetail.pipelines.delete.confirm.title":"删除 {name}","projectDetail.pipelines.delete.confirm.body":"这个流水线文件会被永久删除。","projectDetail.pipelines.delete.error":"删除失败","projectDetail.pipelines.deleteAria":"删除 {name}","projectDetail.pipelines.create.error":"创建失败","projectDetail.danger.title":"删除项目","projectDetail.danger.body":"这会清理 {path}(包括所有卡片、runtime、logs)。","projectDetail.danger.includeClaude.label":"同时清理 repo 的 .claude/","projectDetail.danger.includeClaude.note":"repo 本身不动,只清这个目录。","projectDetail.danger.confirmPrompt":"输入项目名 {name} 确认:","projectDetail.danger.deleteAria":"永久删除项目","projectDetail.danger.deleteButton":"永久删除","projectDetail.danger.deleted.title":"已删除","projectDetail.danger.deleted.bodyWithList":`项目已删除。同时清理了:
|
|
502
|
+
{paths}`,"projectDetail.danger.deleted.body":"项目已删除。","projectDetail.danger.error":"删除失败","pipelineEditor.close":"关闭","pipelineEditor.error.conflict.title":"文件已被其他地方修改","pipelineEditor.error.yaml.title":"YAML 语法错误","pipelineEditor.error.save.title":"保存失败","pipelineEditor.error.serialize.title":"YAML 序列化失败","pipelineEditor.error.load":"加载失败:{detail}","pipelineEditor.mode.structured":"结构化","pipelineEditor.mode.yaml":"原始 YAML","pipelineEditor.parseError.prefix":"YAML 解析:{detail}","pipelineEditor.activeWarning":"⚠ 这是当前激活的流水线,保存后下一轮 tick 生效","pipelineEditor.yamlAria":"pipeline YAML 编辑器","pipelineEditor.status.unsaved":"● 未保存","pipelineEditor.status.saved":"已保存","pipelineEditor.status.noChanges":"无变化","pipelineEditor.reload":"重新加载","pipelineEditor.save":"保存","pipelineEditor.saveAria":"保存 pipeline","pipelineEditor.activeBadge":"当前","pipelineEditor.modeHint":"project = 事件驱动流水线(默认) · steps = 顺序脚本","pipelineEditor.stages.heading":"Stages({count})","pipelineEditor.stages.add":"添加 stage","pipelineEditor.stages.empty":'还没 stage。点"添加 stage"开始。',"pipelineEditor.stage.name.hint":"stage 唯一名","pipelineEditor.stage.profile.hint":"skill 画像,可空","pipelineEditor.stage.cardState.hint":"本 stage 期间卡片状态","pipelineEditor.stage.timeout.hint":"可选,如 30m 2h","pipelineEditor.stage.trigger.hint":"触发条件,可空走默认","pipelineEditor.stage.onComplete.hint":"成功后动作","pipelineEditor.stage.onFail.action.hint":"失败时动作,如 label NEEDS-FIX","pipelineEditor.stage.onFail.comment.hint":"写进卡片的注释","pipelineEditor.stage.halt.note":"(失败后停流水线;去掉则继续下一张卡)","pipelineEditor.stage.moveUp":"上移","pipelineEditor.stage.moveDown":"下移","pipelineEditor.stage.remove":"删除 stage","newPipelineDialog.title":"新建流水线","newPipelineDialog.field.filename.label":"文件名","newPipelineDialog.field.filename.placeholder":"例如 ci","newPipelineDialog.field.filename.help":"实际会保存为 {filename}。只允许 a-z A-Z 0-9 _ -;已有同名文件会 409 报错。","newPipelineDialog.section.template":"初始内容","newPipelineDialog.template.blank.label":"空白模板","newPipelineDialog.template.blank.desc":"最简 1 stage(develop → Done)","newPipelineDialog.template.sample.label":"教学模板","newPipelineDialog.template.sample.desc":"从 sample.yaml.example 复制(带注释,讲解所有字段)","newPipelineDialog.template.sample.unavailable":"sample.yaml.example 不存在","newPipelineDialog.template.active.label":"复制当前活动的","newPipelineDialog.template.active.desc":"从 project.yaml 复制(基于目前的配置改)","newPipelineDialog.template.active.unavailable":"project.yaml 不存在","newPipelineDialog.create.aria":"创建 pipeline","newPipelineDialog.cancel":"取消","board.title":"看板","board.title.bare":"看板","board.subtitle":"{name} · {cards} 张卡片 · {workers} workers 活跃","board.pickPrompt.title":"选择一个项目 🎯","board.pickPrompt.body":"看板按项目分。挑一个开始:","board.action.start":"启动","board.action.stop":"停止","board.action.startAria":"启动 pipeline","board.action.stopAria":"停止 pipeline","board.action.startError":"启动 pipeline 失败","board.action.stopError":"停止 pipeline 失败","board.action.reset":"重置","board.action.resetError":"重置失败","board.action.reset.confirm.title":"重置整个流水线","board.action.reset.confirm.body":"这会清空所有卡片的运行状态、worker marker、分支。不可撤销。","board.action.reset.confirm.button":"重置全部","board.action.newCard":"新卡片","board.action.newCard.error":"新建卡片失败","board.action.moveCard.error":"移动卡片失败","board.search.placeholder":"搜索标题 / skill / label…","board.search.aria":"搜索卡片","board.filter.clear":"清空","board.filter.clearAria":"清空筛选","board.filter.aria":"按 {label} 筛选","board.filter.clearSelection":"清空选择","board.error.loadCards":"加载卡片失败","board.col.planning":"Planning","board.col.backlog":"Backlog","board.col.todo":"Todo","board.col.inprogress":"Inprogress","board.col.qa":"QA / Review","board.col.done":"Done","kanban.checklist.label":"检查清单 {done}/{total}","kanban.checklist.more":"… 还有 {count} 条","kanban.column.empty":"— 空 —","kanban.time.justNow":"刚才","kanban.time.minutes":"{n} 分钟前","kanban.time.hours":"{n} 小时前","kanban.time.days":"{n} 天前","newCard.title":"新建卡片","newCard.field.title":"标题 *","newCard.field.title.placeholder":"例如:接入 GitHub OAuth 登录","newCard.field.title.help":"写简短明了的目标(<200 字符)","newCard.field.description":"描述","newCard.field.description.placeholder":"用户故事、需求、验收标准、参考资料… Claude 启动时会读这里的内容","newCard.field.description.help":"支持 markdown。空的话就只有 title,Claude 只能靠 title 推断要做啥。","newCard.field.skills":"技能","newCard.field.skills.help":"勾选哪些 skill 会被加载(走 frontmatter `skills:`)。不选也行,Worker 默认加载项目级 skills。","newCard.field.skills.loading":"加载 skill 列表…","newCard.field.skills.error":"skill 列表加载失败,不影响创建:{detail}","newCard.field.skills.selected":"已选 {count} 个:{names}","newCard.field.dispatch":"派发","newCard.field.dispatch.label":"立即派发执行(直接进 Backlog)","newCard.field.dispatch.help":"默认不勾:卡进 Planning 暂存,等你看板上拖到 Backlog 再开工。勾上:跳过暂存,下次 tick 直接派 worker 跑。","newCard.create.aria":"创建卡片","cardDetail.loading":"加载中…","cardDetail.error.load":"卡片加载失败","cardDetail.tabs.overview":"概览","cardDetail.tabs.body":"描述","cardDetail.tabs.checklist":"检查清单","cardDetail.tabs.history":"历史","cardDetail.tabs.actions":"操作","cardDetail.field.state":"状态","cardDetail.field.skills":"技能","cardDetail.field.labels":"标签","cardDetail.field.branch":"分支","cardDetail.field.assignee":"处理人","cardDetail.field.created":"创建时间","cardDetail.field.updated":"更新时间","cardDetail.field.empty":"—","cardDetail.actions.delete":"删除卡片","cardDetail.actions.delete.confirm.title":"删除卡片 #{seq}","cardDetail.actions.delete.confirm.body":"该卡片会被永久删除。","cardDetail.actions.delete.error":"删除失败","cardDetail.actions.update.error":"更新失败","cardDetail.body.empty":"没有描述","cardDetail.checklist.empty":"没有检查清单","cardDetail.checklist.progress":"进度 {done}/{total}","cardDetail.history.empty":"没有历史记录","cardDetail.notFound":"卡片 #{seq} 不存在","cardDetail.copy.aria":"复制 seq","cardDetail.close.aria":"关闭","cardDetail.save":"保存","cardDetail.saving":"保存中…","workers.title":"Workers","workers.summary":"跨 {projects} 项目 · {running} 跑 · {starting} 启动 · {stuck} 卡 · {crashed} 崩 · {idle} 闲","workers.summary.stuck":"{n} 卡","workers.summary.crashed":"{n} 崩","workers.refresh.aria":"刷新","workers.refresh":"刷新","workers.error.load":"加载失败:{detail}","workers.empty.hint":"点击项目 / worker 查看详情","logs.title":"日志","logs.subtitle.allProjects":"全部项目","logs.subtitle.project":"{name} 实时日志","logs.filter.errors":"只看错误","logs.filter.errors.aria":"只显示错误","logs.filter.search.placeholder":"过滤消息…","logs.empty":"还没有日志 —— 等待事件中","logs.error.load":"日志加载失败","logs.refresh":"刷新","logs.refresh.aria":"刷新日志","logs.scroll.bottom.aria":"滚动到底部","logs.scroll.pause":"已暂停(自动滚动关闭)","logs.scroll.resume":"恢复自动滚动","logs.subtitle.allProjectsCount":"全部项目({count})","logs.poll.5s":"5s 轮询","logs.paused":"⏸ 已暂停","logs.mode.live":"实时","logs.mode.history":"历史","logs.history.startAria":"查询起始时间","logs.history.queryAria":"查询","logs.history.query":"查询","logs.filter.project.aria":"筛选项目","logs.filter.project.all":"全部项目","logs.filter.keyword.placeholder":"过滤关键字…","logs.filter.keyword.aria":"过滤日志","logs.empty.match":"没有匹配的日志","skills.title":"技能 🧠","skills.subtitle":"跨项目共用的 skill(用 `sps skill ...` 管理)","skills.empty.title":"还没有 skill","skills.empty.hint":"运行 {cmd} 同步 bundled skills。","skills.linked.tooltip":"已链接到该项目","skills.frozen.tooltip":"已冻结(项目独立副本)","skills.category.all":"全部","skills.category.language":"语言","skills.category.domain":"领域","skills.category.persona":"角色","skills.category.workflow":"流程","skills.category.engine":"引擎","skills.category.genre":"品类","skills.category.platform":"平台","skills.category.review":"审核","skills.category.meta":"工具","skills.category.other":"其它","skills.tags.title":"标签","skills.tags.clear":"清除","skills.subtitleCount":"{count} 个 user-level skill","skills.search.placeholder":"搜索 skill…","skills.search.aria":"搜索 skill","skillDetail.actionFailed":"{label}失败","skillDetail.unfreezeAction":"解冻","skillDetail.freezeAction":"冻结","skillDetail.removeAction":"移除","skillDetail.removeConfirm.title":"从 {project} 移除 {name}","skillDetail.removeConfirm.body":"skill 链接会被解除,项目后续运行时将无法使用该 skill。","skillDetail.removeConfirm.button":"移除","skillDetail.unfreezeConfirm.title":"解冻 {name} @ {project}","skillDetail.unfreezeConfirm.body":"本地对这个 skill 的改动会被覆盖,回到最新共享版本。","skillDetail.unfreezeConfirm.button":"解冻","skillDetail.close.aria":"关闭","skillDetail.loading":"加载中…","skillDetail.error.load":"加载失败:{detail}","skillDetail.section.projects":"项目链接状态","skillDetail.section.empty":"还没有任何项目。先去创建一个项目。","skillDetail.section.preview":"SKILL.md 预览","skillDetail.toggleSection.aria":"{action} {file}","skillDetail.expand":"展开","skillDetail.collapse":"收起","skillDetail.edit":"编辑","skillDetail.translate":"中英转换","skillDetail.delete":"删除","skillDetail.save":"保存","skillDetail.cancel":"取消","skillDetail.translating":"翻译中…","skillDetail.saving":"保存中…","skillDetail.editHint":"直接编辑整份 SKILL.md(含 frontmatter)。保存后建议跑 `sps skill lint` 校验三轴与格式。","skillDetail.deleteConfirm":"确定从库中删除「{name}」?整目录会被移除,此操作不可撤销。","skillDetail.translateFailed":"翻译失败:{detail}","skillDetail.saveFailed":"保存失败:{detail}","skillDetail.deleteFailed":"删除失败:{detail}","system.title":"系统","system.subtitle":"全局配置 + 诊断 + 升级","system.section.env":"全局 env","system.section.env.help":"存储在 ~/.coral/env(mode 600)。所有项目共用。","system.section.env.save":"保存 env","system.section.env.error.conflict":"env 已被其它地方修改","system.section.env.error.save":"保存 env 失败","system.section.env.error.load":"加载 env 失败","system.section.env.dirtyDot":"● 未保存","system.section.env.aria":"env 编辑器","system.section.env.reload":"重新加载","system.section.upgrade":"升级","system.section.upgrade.current":"当前:v{version}","system.section.upgrade.latest":"npm 最新:v{version}","system.section.upgrade.uptodate":"已是最新","system.section.upgrade.update":"立即升级","system.section.upgrade.upgrading":"升级中…","system.section.upgrade.checking":"正在查询 npm…","system.section.upgrade.checkError":"查询失败:{detail}","system.section.upgrade.upgradeError":"升级失败:{detail}","system.section.upgrade.upgradeError.title":"升级失败","system.section.upgrade.command":"或在终端执行:{cmd}","system.section.upgrade.runningPipelines":"有 pipeline 在跑,先停止:{projects}","system.section.diagnostics":"诊断","system.section.diagnostics.help":"一次性跑所有项目的 sps doctor,看哪些项目出问题","system.section.diagnostics.run":"运行诊断","system.section.diagnostics.running":"运行中…","system.section.diagnostics.empty":"没有项目","system.section.diagnostics.checkAria":"检查 {project}","system.section.diagnostics.statusOk":"正常","system.section.diagnostics.statusFail":"有问题","system.section.diagnostics.error":"诊断失败:{detail}","system.h1":"系统","system.runtime":"运行时","system.memory.title":"记忆后端","system.memory.desc":"全局设置:worker 的记忆读写走哪个后端。改动对新派发的卡生效。","system.memory.provider":"后端","system.memory.url":"自定义 URL","system.memory.url.placeholder":"http://127.0.0.1:3111","system.memory.save":"保存","system.memory.save.aria":"保存记忆后端设置","system.memory.saved":"已保存","system.memory.error":"保存失败","system.memory.opt.none":"关闭(none)","system.memory.opt.builtin":"本地文件记忆(builtin)","system.memory.opt.agentmemory":"agentmemory(语义库)","system.memory.opt.custom":"自定义 REST(custom)","system.env.title.code":"~/.coral/env","system.env.title.prefix":"全局配置 ","system.env.edit.aria":"编辑 env 文件","system.env.edit.button":"编辑","system.env.editing.label":"⚠ 编辑模式","system.env.empty.before":'env 文件不存在。点"编辑"或者终端运行 ',"system.env.empty.after":"。","system.env.warning":"⚠ 文件包含凭证明文。保存时保持 0600 权限。","system.env.aria":"env 文件编辑器","system.env.dirtyMark":" · ● 未保存","system.env.cancel":"取消","system.env.save":"保存","system.env.save.aria":"保存 env","system.env.error.conflict.title":"env 被其他地方修改了","system.env.error.save.title":"保存失败","system.env.error.conflict.body":"请点取消后重开编辑。","system.upgrade.title":"版本","system.upgrade.checkLatest.aria":"检查最新版本","system.upgrade.checkUpdate":"检查更新","system.upgrade.label.current":"sps-cli(当前)","system.upgrade.label.latest":"npm(最新)","system.upgrade.latestPill":"最新","system.upgrade.button.upgradeAria":"升级到最新版本","system.upgrade.button.upgrade":"升级","system.upgrade.button.copyAria":"复制升级命令","system.upgrade.button.copyTitle":"自动升级失败时手动跑","system.upgrade.button.copy":"复制命令","system.upgrade.label.installed":"已安装","system.upgrade.installed.ok":"已生效(重启 console 后可见)","system.upgrade.installed.fail":"未升级成功","system.upgrade.label.check":"检查","system.upgrade.confirm.title":"升级 sps-cli","system.upgrade.confirm.body":"当前 {current},升级到 {latest}。要求所有 pipeline 已停止。升级后请重启 sps console 生效。","system.upgrade.confirm.button":"升级","system.upgrade.success.title":"升级完成","system.upgrade.success.body":'装上了 v{version}。请 `pkill -f "sps console"` 再重启以生效。',"system.upgrade.notEffective.title":"升级未生效","system.upgrade.notEffective.same":"npm 执行完毕但版本没变(仍 {version})——多半是权限或 registry 问题。可复制下面的命令在终端手动跑。","system.upgrade.notEffective.notInstalled":"npm 没装上新版本。可复制命令手动跑,或看下面日志定位。","system.upgrade.error.title":"升级失败","system.upgrade.copy.success.title":"命令已复制","system.upgrade.copy.success.body":`粘贴到终端运行即可:
|
|
503
|
+
{cmd}`,"system.upgrade.copy.fail.title":"复制失败","system.upgrade.copy.fail.body":`请手动复制:
|
|
504
|
+
{cmd}`,"system.diagnostics.title":"项目健康检查","system.diagnostics.checkAll":"检查全部","system.diagnostics.empty":"还没有项目。","system.diagnostics.expandAria":"展开","system.diagnostics.collapseAria":"折叠","system.diagnostics.never":'点 "检查" 运行 sps doctor',"system.diagnostics.checkAria":"检查","system.diagnostics.check":"检查","system.diagnostics.noFixesNeeded":"已无可修问题","system.diagnostics.fix.tip":"调 sps doctor <proj> --fix:自动创建 .claude/hooks/stop.sh、state.json 等","system.diagnostics.fixAria":"自动修复","system.diagnostics.fix":"修复","system.diagnostics.fixed":"已修复","system.diagnostics.error.fix":"doctor 修复失败","system.diagnostics.error.check":"doctor 检查失败","chat.title":"对话 💬","chat.empty.title":"对话 💬","chat.empty.hint":'点左上角"新建对话"开始一个 session。或直接在下方输入,会自动建 session。',"chat.empty.shortcuts":"Enter 发送 · Shift+Enter 换行 · 内容流式返回","chat.list.heading":"历史 {count}","chat.list.new":"新建对话","chat.list.empty":"还没对话。点上面新建。","chat.list.delete.aria":"删除对话","chat.list.deleteCli.aria":"从 Console 移除该 CLI 会话(不影响 Claude jsonl 存档)","chat.list.openAria":"打开对话 {title}{cwd}","chat.list.cwdSuffix":"(工作目录 {cwd})","chat.list.msgs":"{count} 条 · {time}","chat.list.olderToggle":"更早 · {count} 条","chat.detail.model.tooltip":"当前使用的模型","chat.detail.claudeSession.tooltip":"底层 claude 会话 id —— 恢复会话与记忆的锚","chat.delete.confirm.title":"删除对话","chat.delete.confirm.body.cli":"会从 Console 列表移除(停 daemon 会话)。Claude CLI 在 ~/.claude/projects 下的对话存档会保留 —— 想恢复到终端继续聊就重新跑 sps agent --chat --name <名>。","chat.delete.confirm.body.console":"对话记录会永久删除,不可恢复。","chat.delete.confirm.button":"删除","chat.cli.banner.bold":"CLI 会话","chat.cli.banner":"这是 CLI 会话(由 sps agent 创建),Console 仅展示历史。续聊请在终端运行:","chat.input.placeholder":"说点什么… (Enter 发送,Shift+Enter 换行,可拖入文件 / 粘贴图片)","chat.input.dragOver":"松开鼠标以附加文件…","chat.input.aria":"消息输入","chat.input.attach.aria":"附加本地文件","chat.input.attach.title":"附加本地文件(也可拖拽 / 粘贴图片)","chat.input.send":"发送","chat.input.send.aria":"发送","chat.input.interrupt":"中断","chat.input.interrupt.aria":"中断生成","chat.input.uploading":"上传中…","chat.input.removeAttachment":"移除 {name}","chat.error.interrupt.title":"中断失败","chat.cliBadge":"CLI","chat.cliBadge.tooltip":"该会话由 sps agent CLI 创建,从 Claude jsonl 实时读取(只读)","chat.session.title":"{title}","chat.session.id":"{id}","chat.session.empty":"下方输入问题开始对话 · Enter 发送 · Shift+Enter 换行","notFound.title":"404","notFound.body":"这个页面不存在。","notFound.home":"回到首页","workers.active.empty":"没有 worker 在运行。","workers.alerts.allHealthy":"全部 worker 健康","workers.alerts.pidDead":"PID 已死。","workers.alerts.markerStale":"marker 停 {ago}。","workers.capacity.col.project":"项目","workers.capacity.col.usage":"占用","workers.capacity.col.other":"其它","workers.capacity.detailHint":"详情 →","workers.panel.boardLink":"看板 →","workers.panel.loading":"加载 workers…","workers.panel.empty.slots":"该项目没有 worker slot。","workers.panel.empty.noWorker":"无 worker","workers.panel.empty.pickOne":"请选择一个 worker","workers.panel.idle.short":"空闲","workers.panel.section.currentCard":"当前卡片","workers.panel.idle.full":"slot 空闲,没有当前卡片。","workers.panel.section.claudeOutput":"Claude 输出 · 最近 {n} 行","workers.panel.output.loading":"加载中…","workers.panel.output.empty":"还没收到 session 输出。Worker 刚启动时需要几秒。","workers.panel.section.heartbeat":"Supervisor 心跳 · 最近 {n} 行","workers.panel.heartbeat.fullLog":"查看完整 log →","workers.panel.action.restart":"重启","workers.panel.action.restart.confirm.title":"重启 worker-{slot}","workers.panel.action.restart.confirm.body":"先杀进程,再重新 launch 到 #{seq}","workers.panel.action.restart.confirm.button":"重启","workers.panel.action.restart.error":"重启失败","workers.panel.action.kill":"终止","workers.panel.action.kill.confirm.title":"终止 worker-{slot}","workers.panel.action.kill.confirm.body":"当前任务强制中断。","workers.panel.action.kill.confirm.button":"终止","workers.panel.action.kill.error":"终止失败","dialog.confirm.default":"确定","dialog.alert.default":"知道了","dialog.cancel.default":"取消","dirPicker.title.default":"选择目录","dirPicker.close.aria":"关闭","dirPicker.up.aria":"上级目录","dirPicker.up.title":"上级目录","dirPicker.home.aria":"回到 Home","dirPicker.home.title":"回到 Home","dirPicker.loading":"加载中...","dirPicker.error.title":"读取失败","dirPicker.empty":"— 空目录 —","dirPicker.enter.aria":"进入 {name}/","dirPicker.pickFile.aria":"选择 {name}(双击直接确认)","dirPicker.fileLocked":"文件不可选","dirPicker.cancel":"取消","dirPicker.useFile":"使用此文件","dirPicker.useFile.tooltip.empty":"请先点选一个文件","dirPicker.useDir":"选此目录","dirPicker.newDir":"新建目录","dirPicker.newDir.aria":"在当前目录下新建子目录","dirPicker.newDir.prompt":"新目录名(仅字母数字 _ . -)","dirPicker.newDir.placeholder":"目录名","dirPicker.newDir.create":"创建","dirPicker.newDir.error.title":"新建目录失败","errorBoundary.title":"💥 UI 崩了","errorBoundary.refresh":"刷新页面","chat.error.create.title":"新建对话失败","chat.error.send.title":"发送失败","chat.error.fileTooBig.title":"文件超过上限","chat.error.fileTooBig.body":"单文件上限 50 MB;当前 {size} MB({name})","chat.error.uploadAttachment.title":"附件上传失败","chat.placeholder.attachment":"(附件)","chat.placeholder.viewAttachment":"(请查看附件)","chat.placeholder.attachmentTitle":"附件","chat.attachment.previewTooltip":`{name}
|
|
505
|
+
{path}
|
|
506
|
+
点击预览`,"chat.attachment.previewSimpleTooltip":`{name}
|
|
507
|
+
点击放大`,"chat.attachment.preview.aria":"预览 {name}","chat.attachment.close.aria":"关闭","chat.attachment.readErr":"读取失败:{detail}","chat.attachment.loading":"加载中...","chat.attachment.unsupported":"此文件类型不支持内联预览。","chat.attachment.download":"下载","chat.message.role.you":"你","chat.message.role.error":"错误","chat.message.role.assistant":"assistant","chat.message.truncated":"⚠ 输出超过 10MB,已截断","chat.filePicker.title":"选择附件文件","chat.newSession.title":"新建对话","chat.newSession.title.aria":"新建对话","chat.newSession.close.aria":"关闭","chat.newSession.field.agent":"Agent","chat.newSession.field.model":"模型(可选)","chat.newSession.field.model.default":"用全局默认模型","chat.newSession.field.title":"标题(可选)","chat.newSession.field.title.placeholder":"留空 = 自动用首条消息生成","chat.newSession.field.cwd":"工作目录(可选)","chat.newSession.field.cwd.browse":"浏览","chat.newSession.field.cwd.browseAria":"浏览选择目录","chat.newSession.field.cwd.title":"选择目录","chat.newSession.field.cwd.help1":"Agent 在该目录下读写文件。绝对路径,必须存在。","chat.newSession.field.cwd.help2":"留空则用 daemon 启动时的目录。","chat.newSession.cancel":"取消","chat.newSession.create":"创建","cardModal.editing":"⚠ 编辑中","cardModal.title.aria":"卡片标题","cardModal.editAria":"编辑卡片","cardModal.edit":"编辑","cardModal.close.aria":"关闭","cardModal.error.save.title":"保存失败","cardModal.error.load":"加载失败:{detail}","cardModal.skills.loading":"加载 skill 列表…","cardModal.label.removeAria":"删除 {label}","cardModal.label.addPlaceholder":"+ 添加 label","cardModal.label.addAria":"添加 label","cardModal.label.note":"注意:AI-PIPELINE / STARTED-* / COMPLETED-* / NEEDS-FIX 由流水线自动管理,手动改可能被覆盖","cardModal.section.description":"描述","cardModal.section.empty":"(空)","cardModal.section.checklist":"检查清单","cardModal.checklist.empty":"暂无清单项。在描述里用 `- [ ] 项` 语法添加。","cardModal.section.log":"日志","cardModal.body.aria":"卡片描述","cardModal.body.replaceNote":'只替换 "## 描述" 段的内容;检查清单和日志段不动。',"cardModal.action.launch":"启动 worker","cardModal.action.launch.disabledDone":"卡片已完成;先拖回 Todo 再启动","cardModal.action.launch.disabledRunning":"Pipeline 正在跑——supervisor 会自动 dispatch,无需手动启动","cardModal.action.launch.error":"启动 worker 失败","cardModal.action.reset":"重置卡片","cardModal.action.viewPrompt":"查看 prompt","cardModal.prompt.title":"注入 worker 的提示词(预览)","cardModal.prompt.loading":"重建提示词中…","cardModal.prompt.error":"获取失败:{detail}","cardModal.prompt.copy":"复制","cardModal.prompt.copied":"已复制","cardModal.prompt.metaSkills":"skills:{skills}","cardModal.prompt.metaMemory":"记忆块","cardModal.prompt.metaGit":"git 模式","cardModal.prompt.metaNonGit":"非 git","cardModal.prompt.nativeTitle":"claude 另原生读入(不在本串里):","cardModal.prompt.sourceActual":"✅ 派发时真实注入({time})","cardModal.prompt.sourcePreview":"⚠️ 预览重建(本卡未派发过;记忆按当前库状态,可能与真实派发不同)","cardModal.action.reset.confirm.title":"重置卡片 #{seq}","cardModal.action.reset.confirm.body":"卡片状态会回到初始,已做的 checklist 会清空。","cardModal.action.reset.confirm.button":"重置","cardModal.action.reset.error":"重置失败","cardModal.action.delete":"删除卡片","cardModal.action.delete.confirm1.title":"删除卡片 #{seq}","cardModal.action.delete.confirm1.body":'即将删除 "{title}"。此操作不可恢复(md 文件将被物理删除)。是否继续?',"cardModal.action.delete.confirm1.button":"继续","cardModal.action.delete.confirm2.title":"最终确认","cardModal.action.delete.confirm2.body":"请再次确认删除卡片 #{seq}。","projectDetail.tab.skills":"技能","projectDetail.tab.rules":"规则","projectDetail.skills.title":"Skill 白名单","projectDetail.skills.desc":"选择本项目加载哪些 skill。收窄 worker、subagent 与 chat 能看到的范围,降低 token 消耗。","projectDetail.skills.noPolicy":"未设白名单 —— 全部 skill 都可用(subagent 会从磁盘吃全量)。","projectDetail.skills.hasPolicy":"白名单已生效 —— {count} 个 skill 合格。","projectDetail.skills.save":"保存白名单","projectDetail.skills.clear":"清除(加载全部)","projectDetail.skills.saveError":"保存白名单失败","projectDetail.skills.applied":"已保存。投影 {linked} 个链接,清理 {pruned} 个。","projectDetail.skills.unknown":"未识别的 skill 名(已忽略):{names}","projectDetail.skills.empty":"尚无已安装的 skill,先跑 `sps skill sync`。","projectDetail.skills.selectAll":"全选","projectDetail.skills.selectNone":"全不选","projectDetail.rules.title":"项目规则(只读)","projectDetail.rules.readonly":"sps-cli 只读这些文件。编辑在项目创建时或日后由 agent 协助完成。","projectDetail.rules.missing":"不存在","nav.prompts":"提示词","prompts.title":"提示词库","prompts.desc":"带 {{变量}} 模板的可复用提示词,可插入到会话中。","prompts.new":"新建提示词","prompts.search":"搜索提示词…","prompts.empty":"还没有提示词,新建一个。","prompts.name":"名称","prompts.namePlaceholder":"kebab-case,如 code-review","prompts.nameError":"名称须为 kebab-case(小写字母、数字、连字符)。","prompts.description":"描述","prompts.tags":"标签","prompts.tagsPlaceholder":"逗号,分隔","prompts.body":"正文","prompts.bodyPlaceholder":"写你的提示词。用 {{变量}} 做填充位。","prompts.favorite":"收藏","prompts.save":"保存","prompts.delete":"删除","prompts.deleteConfirm":"删除提示词「{name}」?会移除文件。","prompts.saveError":"保存提示词失败","prompts.vars":"变量:{names}","prompts.noVars":"无变量","prompts.insert":"插入提示词","prompts.selectHint":"在左侧选择一个提示词,或新建一个。","prompts.tagAdd":"输入标签后按 Enter","prompts.ai":"AI 生成","prompts.ai.title":"AI 生成提示词","prompts.ai.intent":"描述你想要什么","prompts.ai.placeholder":"例如:一个用于审查 TypeScript 代码安全问题的提示词","prompts.ai.submit":"生成","prompts.ai.wait":"agent 正在生成…可能需要一会儿。","prompts.ai.error":"生成失败","skills.import":"导入","skills.import.title":"导入 Skill","skills.import.name":"名称(kebab-case)","skills.import.body":"SKILL.md 内容","skills.import.submit":"导入","skills.import.error":"导入失败","skills.export":"导出 SKILL.md","skills.updates.badge":"有 {count} 个可更新","skills.updates.none":"已是最新","skills.ai":"AI 创建","skills.ai.title":"AI 创建 Skill","skills.ai.name":"名称(kebab-case)","skills.ai.intent":"这个 skill 用来做什么?","skills.ai.placeholder":"例如:如何写地道的 Rust 错误处理","skills.ai.submit":"创建","skills.ai.wait":"agent 正在生成 skill…可能需要一会儿。","skills.ai.error":"创建失败","projectDetail.tab.graph":"代码图谱","projectDetail.tab.logs":"日志","graph.title":"代码图谱","graph.desc":"本项目的符号级依赖图(tree-sitter,零 token)。给 agent 精准上下文,少读文件、省 token。","graph.build":"建图","graph.rebuild":"重建","graph.building":"建图中…","graph.sync":"增量同步","graph.syncing":"同步中…","graph.sync.desc":"增量 —— 只重新索引变化的文件(快)","graph.empty":"尚未建图 —— 建一次即可启用 agent 导航与依赖图。","graph.buildFailed":"建图失败","graph.stat.files":"文件","graph.stat.nodes":"节点","graph.stat.edges":"边","graph.stat.db":"DB 体积","graph.stat.lastBuilt":"上次建图","graph.viz.title":"文件依赖图","graph.viz.loading":"加载图谱…","graph.viz.empty":"建图后可查看依赖图。","graph.viz.hint":"节点=文件 · 边=import · 拖拽探索 · 搜索高亮","graph.viz.search":"高亮文件…"},a_=j.createContext(null),l_="sps-console-lang";function Yz(){if(typeof window>"u")return"en";try{const e=window.localStorage.getItem(l_);if(e==="en"||e==="zh")return e}catch{}return"en"}function Wz(e){try{window.localStorage.setItem(l_,e)}catch{}}function Qz({children:e}){const[t,n]=j.useState(()=>Yz());j.useEffect(()=>{typeof document<"u"&&(document.documentElement.lang=t==="zh"?"zh-CN":"en")},[t]);const i=j.useCallback(o=>{n(o),Wz(o)},[]),r=j.useMemo(()=>{const o=t==="zh"?Vz:Gz;return(u,d)=>{let h=o[u]??u;if(d)for(const[g,p]of Object.entries(d))p!==void 0&&(h=h.replace(`{${g}}`,String(p)));return h}},[t]),a=j.useMemo(()=>({lang:t,setLang:i,t:r}),[t,i,r]);return c.jsx(a_.Provider,{value:a,children:e})}function o_(){const e=j.useContext(a_);if(!e)throw new Error("useLang must be used inside I18nProvider");return e}function Ie(){return o_().t}function Xz(){const{lang:e,setLang:t,t:n}=o_();return c.jsxs("div",{role:"group","aria-label":n("lang.toggle.aria"),className:"dimension-segmented flex-1 min-w-0",children:[c.jsx(zk,{active:e==="en",onClick:()=>t("en"),label:n("lang.en"),ariaLabel:"English"}),c.jsx(zk,{active:e==="zh",onClick:()=>t("zh"),label:n("lang.zh"),ariaLabel:"中文"})]})}function zk({active:e,onClick:t,label:n,ariaLabel:i}){return c.jsx("button",{type:"button",onClick:t,"aria-label":i,"aria-pressed":e,className:["dimension-segment flex-1 py-1.5 text-xs font-bold font-[family-name:var(--font-mono)]",e?"dimension-segment-active":""].join(" "),children:n})}const c_="sps-console-theme";function u_(){if(typeof window>"u")return"dark";try{const e=window.localStorage.getItem(c_);if(e==="dark"||e==="light")return e}catch{}return"dark"}function rb(e){typeof document>"u"||(document.documentElement.dataset.theme=e)}function Zz(e){try{window.localStorage.setItem(c_,e)}catch{}}function Jz(){const e=u_();return rb(e),e}const eI=["dark","light"];function tI(){const e=Ie(),[t,n]=j.useState(()=>u_());j.useEffect(()=>{rb(t)},[t]);const i=j.useCallback(r=>{n(r),Zz(r),rb(r)},[]);return c.jsx("div",{role:"group","aria-label":e("theme.toggle.aria"),className:"dimension-segmented shrink-0",children:eI.map(r=>{const a=t===r,o=r==="dark"?QL:Cz;return c.jsx("button",{type:"button","aria-label":e(r==="dark"?"theme.dark":"theme.light"),"aria-pressed":a,title:e(r==="dark"?"theme.dark":"theme.light"),onClick:()=>i(r),className:["dimension-segment h-8 w-9",a?"dimension-segment-active":""].join(" "),children:c.jsx(o,{size:15,strokeWidth:2.4})},r)})})}const nI=[{to:"/",labelKey:"nav.home",icon:G2},{to:"/chat",labelKey:"nav.chat",icon:Y2},{to:"/projects",labelKey:"nav.projects",icon:V2},{to:"/board",labelKey:"nav.board",icon:BL},{to:"/workers",labelKey:"nav.workers",icon:r_},{to:"/skills",labelKey:"nav.skills",icon:TL},{to:"/prompts",labelKey:"nav.prompts",icon:Q2},{to:"/arrange",labelKey:"nav.arrange",icon:ox},{to:"/plugins",labelKey:"nav.plugins",icon:uz},{to:"/system",labelKey:"nav.system",icon:J2},{to:"/processes",labelKey:"nav.processes",icon:Eh},{to:"/audit",labelKey:"nav.audit",icon:ax},{to:"/memory",labelKey:"nav.memory",icon:G3}];function iI(){const e=Ie();return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"shrink-0 font-[family-name:var(--font-heading)] font-bold text-lg px-1 md:px-3 pt-2 pb-4 flex items-center justify-center md:justify-start gap-3 text-[var(--color-text)]","aria-label":e("app.title"),children:[c.jsx(hl,{size:20,strokeWidth:2.5}),c.jsx("span",{className:"hidden md:inline",children:e("app.title")})]}),c.jsx("nav",{className:"flex flex-1 min-h-0 flex-col gap-0.5 mt-2 overflow-y-auto pr-1","aria-label":e("nav.aria"),children:nI.map(t=>{const n=t.icon;return c.jsxs(z2,{to:t.to,end:t.to==="/","aria-label":e(t.labelKey),className:({isActive:i})=>["dimension-menu-item justify-center md:justify-start gap-0 md:gap-3 px-2 md:px-3 py-2.5 md:pl-4 font-semibold text-sm cursor-pointer",i?"dimension-menu-item-active":""].join(" "),children:[c.jsx(n,{size:18,strokeWidth:2.5}),c.jsx("span",{className:"hidden md:inline",children:e(t.labelKey)})]},t.to)})}),c.jsxs("div",{className:"shrink-0 pt-3 hidden md:flex items-center gap-2",children:[c.jsx(Xz,{}),c.jsx(tI,{})]})]})}class rI extends Error{constructor(t,n,i){super(n),this.status=t,this.detail=i,this.name="ApiError"}}async function cx(e){const t=await e.text().catch(()=>"");let n=t,i=`${e.status} ${e.statusText}`;try{const r=JSON.parse(t);if(n=r,r&&typeof r=="object"){const a=r,o=a.detail??a.title??a.message;typeof o=="string"&&o&&(i=o)}}catch{t&&(i=t.slice(0,300))}return new rI(e.status,i,n)}async function ct(e){const t=await fetch(e,{headers:{Accept:"application/json"}});if(!t.ok)throw await cx(t);return await t.json()}async function gr(e,t){return f_("POST",e,t)}async function ux(e,t){return f_("PUT",e,t)}async function d_(e){const t=await fetch(e,{method:"DELETE",headers:{Accept:"application/json"}});if(!t.ok)throw await cx(t)}async function f_(e,t,n){const i=await fetch(t,{method:e,headers:{Accept:"application/json","Content-Type":"application/json"},body:n===void 0?void 0:JSON.stringify(n)});if(!i.ok)throw await cx(i);return await i.json()}function h_(){return ct("/api/system/info")}function sI(){return ct("/api/system/env")}function aI(){return ct("/api/system/env/raw")}async function lI(e,t){const n=await fetch("/api/system/env",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:e,etag:t})});if(!n.ok){const i=await n.text(),r=new Error(`${n.status}: ${i}`);throw r.status=n.status,r}return n.json()}function oI(){return ct("/api/system/memory")}async function cI(e,t){const n=await fetch("/api/system/memory",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:e,url:t})});if(!n.ok)throw new Error(`${n.status}: ${await n.text()}`);return n.json()}function dx(){return ct("/api/system/agents")}async function uI(e){const t=await fetch("/api/system/agents",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error(`${t.status}: ${await t.text()}`);return t.json()}function dI(){return ct("/api/system/latest-version")}async function fI(){const e=await fetch("/api/system/upgrade",{method:"POST"});if(!e.ok&&e.status!==409)throw new Error(`${e.status}: ${await e.text()}`);return e.json()}async function hI(e,t=!1){const n=t?"?fix=1":"",i=await fetch(`/api/system/doctor/${encodeURIComponent(e)}${n}`,{method:"POST"});if(!i.ok)throw new Error(`${i.status}: ${await i.text()}`);return i.json()}function Ea(){return ct("/api/projects")}function pI(e){return ct(`/api/projects/${encodeURIComponent(e)}`)}async function mI(e){const t=await fetch("/api/projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok){const n=await t.text();throw new Error(`${t.status}: ${n}`)}return t.json()}function gI(e){return ct(`/api/projects/${encodeURIComponent(e)}/conf`)}async function yI(e,t,n){const i=await fetch(`/api/projects/${encodeURIComponent(e)}/conf`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:t,etag:n})});if(!i.ok){const r=await i.text(),a=new Error(`${i.status}: ${r}`);throw a.status=i.status,a}return i.json()}async function bI(e,t={}){const n=await fetch(`/api/projects/${encodeURIComponent(e)}`,{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok){const i=await n.text();throw new Error(`${n.status}: ${i}`)}return n.json()}function xI(e){return ct(`/api/projects/${encodeURIComponent(e)}/pipelines`)}async function vI(e,t){const n=await fetch(`/api/projects/${encodeURIComponent(e)}/pipeline`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({pipeline:t})});if(!n.ok){const i=await n.text();throw new Error(`${n.status}: ${i}`)}return n.json()}function wI(e,t){return ct(`/api/projects/${encodeURIComponent(e)}/pipelines/${encodeURIComponent(t)}`)}async function kI(e,t,n,i){const r=await fetch(`/api/projects/${encodeURIComponent(e)}/pipelines/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:n,etag:i})});if(!r.ok){const a=await r.text(),o=new Error(`${r.status}: ${a}`);throw o.status=r.status,o}return r.json()}async function EI(e,t,n="blank"){const i=await fetch(`/api/projects/${encodeURIComponent(e)}/pipelines`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:t,template:n})});if(!i.ok){const r=await i.text();throw new Error(`${i.status}: ${r}`)}return i.json()}async function SI(e,t){const n=await fetch(`/api/projects/${encodeURIComponent(e)}/pipelines/${encodeURIComponent(t)}`,{method:"DELETE"});if(!n.ok){const i=await n.text();throw new Error(`${n.status}: ${i}`)}}function NI(){var d;const e=Ie(),t=Ve({queryKey:["system-info"],queryFn:h_,refetchInterval:3e4}),n=Ve({queryKey:["projects"],queryFn:Ea,refetchInterval:1e4}),i=jI(),r=!t.isError,a=((d=n.data)==null?void 0:d.data)??[],o=a.filter(h=>h.pipelineStatus==="running").length,u=a.reduce((h,g)=>h+g.workers.active,0);return c.jsxs("div",{className:"h-full flex items-center gap-3 px-6 font-[family-name:var(--font-mono)] text-[11px] text-[var(--color-text-muted)]",children:[c.jsx("span",{className:"nb-status",style:{background:r?"var(--color-running-bg)":"var(--color-crashed-bg)",color:r?"var(--color-running)":"var(--color-crashed)",padding:"2px 8px 2px 7px"},children:e(r?"status.server":"status.offline")}),c.jsx(_I,{state:i}),c.jsx("span",{className:"text-[var(--color-text-subtle)]",children:"·"}),c.jsxs("span",{className:"flex items-center gap-1",title:e("status.pipelines.tooltip"),children:[c.jsx(Xh,{size:10,strokeWidth:2.5}),c.jsx("span",{className:"font-bold text-[var(--color-text)]",children:o})," ",e("status.pipeline.unit")]}),c.jsx("span",{className:"text-[var(--color-text-subtle)]",children:"·"}),c.jsxs("span",{className:"flex items-center gap-1",title:e("status.workers.tooltip"),children:[c.jsx(Z2,{size:10,strokeWidth:2.5}),c.jsx("span",{className:"font-bold text-[var(--color-text)]",children:u})," ",e("status.worker.unit")]}),c.jsx("span",{className:"text-[var(--color-text-subtle)]",children:"·"}),c.jsxs("span",{children:["localhost:",window.location.port]}),t.data&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"text-[var(--color-text-subtle)]",children:"·"}),c.jsxs("span",{children:["v",t.data.version]}),c.jsx("span",{className:"text-[var(--color-text-subtle)]",children:"·"}),c.jsxs("span",{children:["node ",t.data.nodeVersion]})]})]})}function _I({state:e}){const t=Ie();return e==="open"?c.jsx("span",{className:"nb-status",style:{background:"var(--color-running-bg)",color:"var(--color-running)",padding:"2px 8px 2px 7px"},children:t("status.sse.open")}):e==="connecting"?c.jsx("span",{className:"nb-status",style:{background:"var(--color-stuck-bg)",color:"var(--color-stuck)",padding:"2px 8px 2px 7px"},children:t("status.sse.connecting")}):c.jsxs("span",{className:"nb-status",style:{background:"var(--color-crashed-bg)",color:"var(--color-crashed)",padding:"2px 8px 2px 7px"},children:[c.jsx(ju,{size:9,strokeWidth:2.5}),t("status.sse.down")]})}function jI(){const[e,t]=j.useState("connecting");return j.useEffect(()=>{let n=null,i=null,r=!1;const a=()=>{r||(n=new EventSource("/stream/heartbeat"),n.addEventListener("server.heartbeat",()=>t("open")),n.addEventListener("open",()=>t("open")),n.addEventListener("error",()=>{(n==null?void 0:n.readyState)===EventSource.CLOSED?(t("closed"),i==null&&(i=setTimeout(()=>{i=null,n==null||n.close(),a()},1e4))):t("connecting")}))};return a(),()=>{r=!0,i!=null&&clearTimeout(i),n==null||n.close()}},[]),e}function Ik({contentMode:e="workspace"}){const t=e==="workspace"?"overflow-hidden":"overflow-auto";return c.jsxs("div",{className:"grid grid-cols-[64px_minmax(0,1fr)] md:grid-cols-[240px_minmax(0,1fr)] grid-rows-[minmax(0,1fr)_40px] h-dvh overflow-hidden",children:[c.jsx("aside",{className:"row-start-1 min-h-0 overflow-hidden border-r-[3px] border-[var(--color-text)] bg-[var(--color-bg)] p-2 md:p-4 flex flex-col",children:c.jsx(iI,{})}),c.jsx("main",{className:["row-start-1 min-h-0 p-3 md:p-6 flex flex-col gap-4",t].join(" "),children:c.jsx(WR,{})}),c.jsx("footer",{className:"col-span-2 row-start-2 border-t-[3px] border-[var(--color-text)] bg-[var(--color-bg)]",children:c.jsx(NI,{})})]})}function sb(e,t){try{const n=JSON.stringify({message:(e instanceof Error?e.message:String(e)).slice(0,1e3),stack:(e instanceof Error?e.stack??"":"").slice(0,4e3),url:typeof window<"u"?window.location.href:"",ua:typeof navigator<"u"?navigator.userAgent:"",ts:new Date().toISOString(),context:t==null?void 0:t.slice(0,200)});fetch("/api/system/client-errors",{method:"POST",headers:{"Content-Type":"application/json"},body:n,keepalive:!0}).catch(()=>{})}catch{}}function CI(){typeof window>"u"||(window.addEventListener("error",e=>{sb(e.error??e.message??"unknown error","window.error")}),window.addEventListener("unhandledrejection",e=>{const t=e.reason;sb(t instanceof Error?t:String(t),"unhandledrejection")}))}class AI extends j.Component{constructor(){super(...arguments);nk(this,"state",{error:null})}static getDerivedStateFromError(n){return{error:n}}componentDidCatch(n,i){var r;sb(n,`ErrorBoundary: ${((r=i.componentStack)==null?void 0:r.slice(0,200))??""}`),console.error("[ErrorBoundary]",n,i)}render(){if(this.state.error){const n=(()=>{try{return window.localStorage.getItem("sps-console-lang")==="zh"?"zh":"en"}catch{return"en"}})(),i=n==="zh"?"💥 UI 崩了":"💥 UI crashed",r=n==="zh"?"刷新页面":"Refresh page";return c.jsx("div",{className:"p-6",children:c.jsxs("div",{className:"nb-card max-w-2xl bg-[var(--color-crashed-bg)]",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-2xl font-bold mb-2",children:i}),c.jsx("p",{className:"text-sm mb-3 text-[var(--color-text-muted)]",children:this.state.error.message}),c.jsxs("details",{className:"text-xs mb-4",children:[c.jsx("summary",{className:"cursor-pointer font-semibold",children:"stack"}),c.jsx("pre",{className:"mt-2 font-[family-name:var(--font-mono)] overflow-auto max-h-60 bg-[var(--color-bg)] border-2 border-[var(--color-text)] rounded-md p-3",children:this.state.error.stack??"(no stack)"})]}),c.jsx("button",{className:"nb-btn nb-btn-mint",type:"button",onClick:()=>{this.setState({error:null}),window.location.reload()},children:r})]})})}return this.props.children}}function gu(e){let t=e[0],n=e[1],i=e[2];return Math.sqrt(t*t+n*n+i*i)}function ab(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function TI(e,t,n,i){return e[0]=t,e[1]=n,e[2]=i,e}function Pk(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}function Bk(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}function MI(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e}function DI(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e}function qg(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}function OI(e,t){let n=t[0]-e[0],i=t[1]-e[1],r=t[2]-e[2];return Math.sqrt(n*n+i*i+r*r)}function RI(e,t){let n=t[0]-e[0],i=t[1]-e[1],r=t[2]-e[2];return n*n+i*i+r*r}function $k(e){let t=e[0],n=e[1],i=e[2];return t*t+n*n+i*i}function LI(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function zI(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}function lb(e,t){let n=t[0],i=t[1],r=t[2],a=n*n+i*i+r*r;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}function p_(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Uk(e,t,n){let i=t[0],r=t[1],a=t[2],o=n[0],u=n[1],d=n[2];return e[0]=r*d-a*u,e[1]=a*o-i*d,e[2]=i*u-r*o,e}function II(e,t,n,i){let r=t[0],a=t[1],o=t[2];return e[0]=r+i*(n[0]-r),e[1]=a+i*(n[1]-a),e[2]=o+i*(n[2]-o),e}function PI(e,t,n,i,r){const a=Math.exp(-i*r);let o=t[0],u=t[1],d=t[2];return e[0]=n[0]+(o-n[0])*a,e[1]=n[1]+(u-n[1])*a,e[2]=n[2]+(d-n[2])*a,e}function BI(e,t,n){let i=t[0],r=t[1],a=t[2],o=n[3]*i+n[7]*r+n[11]*a+n[15];return o=o||1,e[0]=(n[0]*i+n[4]*r+n[8]*a+n[12])/o,e[1]=(n[1]*i+n[5]*r+n[9]*a+n[13])/o,e[2]=(n[2]*i+n[6]*r+n[10]*a+n[14])/o,e}function $I(e,t,n){let i=t[0],r=t[1],a=t[2],o=n[3]*i+n[7]*r+n[11]*a+n[15];return o=o||1,e[0]=(n[0]*i+n[4]*r+n[8]*a)/o,e[1]=(n[1]*i+n[5]*r+n[9]*a)/o,e[2]=(n[2]*i+n[6]*r+n[10]*a)/o,e}function UI(e,t,n){let i=t[0],r=t[1],a=t[2];return e[0]=i*n[0]+r*n[3]+a*n[6],e[1]=i*n[1]+r*n[4]+a*n[7],e[2]=i*n[2]+r*n[5]+a*n[8],e}function FI(e,t,n){let i=t[0],r=t[1],a=t[2],o=n[0],u=n[1],d=n[2],h=n[3],g=u*a-d*r,p=d*i-o*a,y=o*r-u*i,b=u*y-d*p,w=d*g-o*y,v=o*p-u*g,N=h*2;return g*=N,p*=N,y*=N,b*=2,w*=2,v*=2,e[0]=i+g+b,e[1]=r+p+w,e[2]=a+y+v,e}const qI=(function(){const e=[0,0,0],t=[0,0,0];return function(n,i){ab(e,n),ab(t,i),lb(e,e),lb(t,t);let r=p_(e,t);return r>1?0:r<-1?Math.PI:Math.acos(r)}})();function HI(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}class lr extends Array{constructor(t=0,n=t,i=t){return super(t,n,i),this}get x(){return this[0]}get y(){return this[1]}get z(){return this[2]}set x(t){this[0]=t}set y(t){this[1]=t}set z(t){this[2]=t}set(t,n=t,i=t){return t.length?this.copy(t):(TI(this,t,n,i),this)}copy(t){return ab(this,t),this}add(t,n){return n?Pk(this,t,n):Pk(this,this,t),this}sub(t,n){return n?Bk(this,t,n):Bk(this,this,t),this}multiply(t){return t.length?MI(this,this,t):qg(this,this,t),this}divide(t){return t.length?DI(this,this,t):qg(this,this,1/t),this}inverse(t=this){return zI(this,t),this}len(){return gu(this)}distance(t){return t?OI(this,t):gu(this)}squaredLen(){return $k(this)}squaredDistance(t){return t?RI(this,t):$k(this)}negate(t=this){return LI(this,t),this}cross(t,n){return n?Uk(this,t,n):Uk(this,this,t),this}scale(t){return qg(this,this,t),this}normalize(){return lb(this,this),this}dot(t){return p_(this,t)}equals(t){return HI(this,t)}applyMatrix3(t){return UI(this,this,t),this}applyMatrix4(t){return BI(this,this,t),this}scaleRotateMatrix4(t){return $I(this,this,t),this}applyQuaternion(t){return FI(this,this,t),this}angle(t){return qI(this,t)}lerp(t,n){return II(this,this,t,n),this}smoothLerp(t,n,i){return PI(this,this,t,n,i),this}clone(){return new lr(this[0],this[1],this[2])}fromArray(t,n=0){return this[0]=t[n],this[1]=t[n+1],this[2]=t[n+2],this}toArray(t=[],n=0){return t[n]=this[0],t[n+1]=this[1],t[n+2]=this[2],t}transformDirection(t){const n=this[0],i=this[1],r=this[2];return this[0]=t[0]*n+t[4]*i+t[8]*r,this[1]=t[1]*n+t[5]*i+t[9]*r,this[2]=t[2]*n+t[6]*i+t[10]*r,this.normalize()}}const Fk=new lr;let KI=1,GI=1,qk=!1;class VI{constructor(t,n={}){t.canvas||console.error("gl not passed as first argument to Geometry"),this.gl=t,this.attributes=n,this.id=KI++,this.VAOs={},this.drawRange={start:0,count:0},this.instancedCount=0,this.gl.renderer.bindVertexArray(null),this.gl.renderer.currentGeometry=null,this.glState=this.gl.renderer.state;for(let i in n)this.addAttribute(i,n[i])}addAttribute(t,n){if(this.attributes[t]=n,n.id=GI++,n.size=n.size||1,n.type=n.type||(n.data.constructor===Float32Array?this.gl.FLOAT:n.data.constructor===Uint16Array?this.gl.UNSIGNED_SHORT:this.gl.UNSIGNED_INT),n.target=t==="index"?this.gl.ELEMENT_ARRAY_BUFFER:this.gl.ARRAY_BUFFER,n.normalized=n.normalized||!1,n.stride=n.stride||0,n.offset=n.offset||0,n.count=n.count||(n.stride?n.data.byteLength/n.stride:n.data.length/n.size),n.divisor=n.instanced||0,n.needsUpdate=!1,n.usage=n.usage||this.gl.STATIC_DRAW,n.buffer||this.updateAttribute(n),n.divisor){if(this.isInstanced=!0,this.instancedCount&&this.instancedCount!==n.count*n.divisor)return console.warn("geometry has multiple instanced buffers of different length"),this.instancedCount=Math.min(this.instancedCount,n.count*n.divisor);this.instancedCount=n.count*n.divisor}else t==="index"?this.drawRange.count=n.count:this.attributes.index||(this.drawRange.count=Math.max(this.drawRange.count,n.count))}updateAttribute(t){const n=!t.buffer;n&&(t.buffer=this.gl.createBuffer()),this.glState.boundBuffer!==t.buffer&&(this.gl.bindBuffer(t.target,t.buffer),this.glState.boundBuffer=t.buffer),n?this.gl.bufferData(t.target,t.data,t.usage):this.gl.bufferSubData(t.target,0,t.data),t.needsUpdate=!1}setIndex(t){this.addAttribute("index",t)}setDrawRange(t,n){this.drawRange.start=t,this.drawRange.count=n}setInstancedCount(t){this.instancedCount=t}createVAO(t){this.VAOs[t.attributeOrder]=this.gl.renderer.createVertexArray(),this.gl.renderer.bindVertexArray(this.VAOs[t.attributeOrder]),this.bindAttributes(t)}bindAttributes(t){t.attributeLocations.forEach((n,{name:i,type:r})=>{if(!this.attributes[i]){console.warn(`active attribute ${i} not being supplied`);return}const a=this.attributes[i];this.gl.bindBuffer(a.target,a.buffer),this.glState.boundBuffer=a.buffer;let o=1;r===35674&&(o=2),r===35675&&(o=3),r===35676&&(o=4);const u=a.size/o,d=o===1?0:o*o*4,h=o===1?0:o*4;for(let g=0;g<o;g++)this.gl.vertexAttribPointer(n+g,u,a.type,a.normalized,a.stride+d,a.offset+g*h),this.gl.enableVertexAttribArray(n+g),this.gl.renderer.vertexAttribDivisor(n+g,a.divisor)}),this.attributes.index&&this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,this.attributes.index.buffer)}draw({program:t,mode:n=this.gl.TRIANGLES}){var r;this.gl.renderer.currentGeometry!==`${this.id}_${t.attributeOrder}`&&(this.VAOs[t.attributeOrder]||this.createVAO(t),this.gl.renderer.bindVertexArray(this.VAOs[t.attributeOrder]),this.gl.renderer.currentGeometry=`${this.id}_${t.attributeOrder}`),t.attributeLocations.forEach((a,{name:o})=>{const u=this.attributes[o];u.needsUpdate&&this.updateAttribute(u)});let i=2;((r=this.attributes.index)==null?void 0:r.type)===this.gl.UNSIGNED_INT&&(i=4),this.isInstanced?this.attributes.index?this.gl.renderer.drawElementsInstanced(n,this.drawRange.count,this.attributes.index.type,this.attributes.index.offset+this.drawRange.start*i,this.instancedCount):this.gl.renderer.drawArraysInstanced(n,this.drawRange.start,this.drawRange.count,this.instancedCount):this.attributes.index?this.gl.drawElements(n,this.drawRange.count,this.attributes.index.type,this.attributes.index.offset+this.drawRange.start*i):this.gl.drawArrays(n,this.drawRange.start,this.drawRange.count)}getPosition(){const t=this.attributes.position;if(t.data)return t;if(!qk)return console.warn("No position buffer data found to compute bounds"),qk=!0}computeBoundingBox(t){t||(t=this.getPosition());const n=t.data,i=t.size;this.bounds||(this.bounds={min:new lr,max:new lr,center:new lr,scale:new lr,radius:1/0});const r=this.bounds.min,a=this.bounds.max,o=this.bounds.center,u=this.bounds.scale;r.set(1/0),a.set(-1/0);for(let d=0,h=n.length;d<h;d+=i){const g=n[d],p=n[d+1],y=n[d+2];r.x=Math.min(g,r.x),r.y=Math.min(p,r.y),r.z=Math.min(y,r.z),a.x=Math.max(g,a.x),a.y=Math.max(p,a.y),a.z=Math.max(y,a.z)}u.sub(a,r),o.add(r,a).divide(2)}computeBoundingSphere(t){t||(t=this.getPosition());const n=t.data,i=t.size;this.bounds||this.computeBoundingBox(t);let r=0;for(let a=0,o=n.length;a<o;a+=i)Fk.fromArray(n,a),r=Math.max(r,this.bounds.center.squaredDistance(Fk));this.bounds.radius=Math.sqrt(r)}remove(){for(let t in this.VAOs)this.gl.renderer.deleteVertexArray(this.VAOs[t]),delete this.VAOs[t];for(let t in this.attributes)this.gl.deleteBuffer(this.attributes[t].buffer),delete this.attributes[t]}}let YI=1;const Hk={};class WI{constructor(t,{vertex:n,fragment:i,uniforms:r={},transparent:a=!1,cullFace:o=t.BACK,frontFace:u=t.CCW,depthTest:d=!0,depthWrite:h=!0,depthFunc:g=t.LEQUAL}={}){t.canvas||console.error("gl not passed as first argument to Program"),this.gl=t,this.uniforms=r,this.id=YI++,n||console.warn("vertex shader not supplied"),i||console.warn("fragment shader not supplied"),this.transparent=a,this.cullFace=o,this.frontFace=u,this.depthTest=d,this.depthWrite=h,this.depthFunc=g,this.blendFunc={},this.blendEquation={},this.stencilFunc={},this.stencilOp={},this.transparent&&!this.blendFunc.src&&(this.gl.renderer.premultipliedAlpha?this.setBlendFunc(this.gl.ONE,this.gl.ONE_MINUS_SRC_ALPHA):this.setBlendFunc(this.gl.SRC_ALPHA,this.gl.ONE_MINUS_SRC_ALPHA)),this.vertexShader=t.createShader(t.VERTEX_SHADER),this.fragmentShader=t.createShader(t.FRAGMENT_SHADER),this.program=t.createProgram(),t.attachShader(this.program,this.vertexShader),t.attachShader(this.program,this.fragmentShader),this.setShaders({vertex:n,fragment:i})}setShaders({vertex:t,fragment:n}){if(t&&(this.gl.shaderSource(this.vertexShader,t),this.gl.compileShader(this.vertexShader),this.gl.getShaderInfoLog(this.vertexShader)!==""&&console.warn(`${this.gl.getShaderInfoLog(this.vertexShader)}
|
|
508
|
+
Vertex Shader
|
|
509
|
+
${Kk(t)}`)),n&&(this.gl.shaderSource(this.fragmentShader,n),this.gl.compileShader(this.fragmentShader),this.gl.getShaderInfoLog(this.fragmentShader)!==""&&console.warn(`${this.gl.getShaderInfoLog(this.fragmentShader)}
|
|
510
|
+
Fragment Shader
|
|
511
|
+
${Kk(n)}`)),this.gl.linkProgram(this.program),!this.gl.getProgramParameter(this.program,this.gl.LINK_STATUS))return console.warn(this.gl.getProgramInfoLog(this.program));this.uniformLocations=new Map;let i=this.gl.getProgramParameter(this.program,this.gl.ACTIVE_UNIFORMS);for(let o=0;o<i;o++){let u=this.gl.getActiveUniform(this.program,o);this.uniformLocations.set(u,this.gl.getUniformLocation(this.program,u.name));const d=u.name.match(/(\w+)/g);u.uniformName=d[0],u.nameComponents=d.slice(1)}this.attributeLocations=new Map;const r=[],a=this.gl.getProgramParameter(this.program,this.gl.ACTIVE_ATTRIBUTES);for(let o=0;o<a;o++){const u=this.gl.getActiveAttrib(this.program,o),d=this.gl.getAttribLocation(this.program,u.name);d!==-1&&(r[d]=u.name,this.attributeLocations.set(u,d))}this.attributeOrder=r.join("")}setBlendFunc(t,n,i,r){this.blendFunc.src=t,this.blendFunc.dst=n,this.blendFunc.srcAlpha=i,this.blendFunc.dstAlpha=r,t&&(this.transparent=!0)}setBlendEquation(t,n){this.blendEquation.modeRGB=t,this.blendEquation.modeAlpha=n}setStencilFunc(t,n,i){this.stencilRef=n,this.stencilFunc.func=t,this.stencilFunc.ref=n,this.stencilFunc.mask=i}setStencilOp(t,n,i){this.stencilOp.stencilFail=t,this.stencilOp.depthFail=n,this.stencilOp.depthPass=i}applyState(){this.depthTest?this.gl.renderer.enable(this.gl.DEPTH_TEST):this.gl.renderer.disable(this.gl.DEPTH_TEST),this.cullFace?this.gl.renderer.enable(this.gl.CULL_FACE):this.gl.renderer.disable(this.gl.CULL_FACE),this.blendFunc.src?this.gl.renderer.enable(this.gl.BLEND):this.gl.renderer.disable(this.gl.BLEND),this.cullFace&&this.gl.renderer.setCullFace(this.cullFace),this.gl.renderer.setFrontFace(this.frontFace),this.gl.renderer.setDepthMask(this.depthWrite),this.gl.renderer.setDepthFunc(this.depthFunc),this.blendFunc.src&&this.gl.renderer.setBlendFunc(this.blendFunc.src,this.blendFunc.dst,this.blendFunc.srcAlpha,this.blendFunc.dstAlpha),this.gl.renderer.setBlendEquation(this.blendEquation.modeRGB,this.blendEquation.modeAlpha),this.stencilFunc.func||this.stencilOp.stencilFail?this.gl.renderer.enable(this.gl.STENCIL_TEST):this.gl.renderer.disable(this.gl.STENCIL_TEST),this.gl.renderer.setStencilFunc(this.stencilFunc.func,this.stencilFunc.ref,this.stencilFunc.mask),this.gl.renderer.setStencilOp(this.stencilOp.stencilFail,this.stencilOp.depthFail,this.stencilOp.depthPass)}use({flipFaces:t=!1}={}){let n=-1;this.gl.renderer.state.currentProgram===this.id||(this.gl.useProgram(this.program),this.gl.renderer.state.currentProgram=this.id),this.uniformLocations.forEach((r,a)=>{let o=this.uniforms[a.uniformName];for(const u of a.nameComponents){if(!o)break;if(u in o)o=o[u];else{if(Array.isArray(o.value))break;o=void 0;break}}if(!o)return Gk(`Active uniform ${a.name} has not been supplied`);if(o&&o.value===void 0)return Gk(`${a.name} uniform is missing a value parameter`);if(o.value.texture)return n=n+1,o.value.update(n),Hg(this.gl,a.type,r,n);if(o.value.length&&o.value[0].texture){const u=[];return o.value.forEach(d=>{n=n+1,d.update(n),u.push(n)}),Hg(this.gl,a.type,r,u)}Hg(this.gl,a.type,r,o.value)}),this.applyState(),t&&this.gl.renderer.setFrontFace(this.frontFace===this.gl.CCW?this.gl.CW:this.gl.CCW)}remove(){this.gl.deleteProgram(this.program)}}function Hg(e,t,n,i){i=i.length?QI(i):i;const r=e.renderer.state.uniformLocations.get(n);if(i.length)if(r===void 0||r.length!==i.length)e.renderer.state.uniformLocations.set(n,i.slice(0));else{if(XI(r,i))return;r.set?r.set(i):ZI(r,i),e.renderer.state.uniformLocations.set(n,r)}else{if(r===i)return;e.renderer.state.uniformLocations.set(n,i)}switch(t){case 5126:return i.length?e.uniform1fv(n,i):e.uniform1f(n,i);case 35664:return e.uniform2fv(n,i);case 35665:return e.uniform3fv(n,i);case 35666:return e.uniform4fv(n,i);case 35670:case 5124:case 35678:case 36306:case 35680:case 36289:return i.length?e.uniform1iv(n,i):e.uniform1i(n,i);case 35671:case 35667:return e.uniform2iv(n,i);case 35672:case 35668:return e.uniform3iv(n,i);case 35673:case 35669:return e.uniform4iv(n,i);case 35674:return e.uniformMatrix2fv(n,!1,i);case 35675:return e.uniformMatrix3fv(n,!1,i);case 35676:return e.uniformMatrix4fv(n,!1,i)}}function Kk(e){let t=e.split(`
|
|
512
|
+
`);for(let n=0;n<t.length;n++)t[n]=n+1+": "+t[n];return t.join(`
|
|
513
|
+
`)}function QI(e){const t=e.length,n=e[0].length;if(n===void 0)return e;const i=t*n;let r=Hk[i];r||(Hk[i]=r=new Float32Array(i));for(let a=0;a<t;a++)r.set(e[a],a*n);return r}function XI(e,t){if(e.length!==t.length)return!1;for(let n=0,i=e.length;n<i;n++)if(e[n]!==t[n])return!1;return!0}function ZI(e,t){for(let n=0,i=e.length;n<i;n++)e[n]=t[n]}let Kg=0;function Gk(e){Kg>100||(console.warn(e),Kg++,Kg>100&&console.warn("More than 100 program warnings - stopping logs."))}const Gg=new lr;let JI=1;class e4{constructor({canvas:t=document.createElement("canvas"),width:n=300,height:i=150,dpr:r=1,alpha:a=!1,depth:o=!0,stencil:u=!1,antialias:d=!1,premultipliedAlpha:h=!1,preserveDrawingBuffer:g=!1,powerPreference:p="default",autoClear:y=!0,webgl:b=2}={}){const w={alpha:a,depth:o,stencil:u,antialias:d,premultipliedAlpha:h,preserveDrawingBuffer:g,powerPreference:p};this.dpr=r,this.alpha=a,this.color=!0,this.depth=o,this.stencil=u,this.premultipliedAlpha=h,this.autoClear=y,this.id=JI++,b===2&&(this.gl=t.getContext("webgl2",w)),this.isWebgl2=!!this.gl,this.gl||(this.gl=t.getContext("webgl",w)),this.gl||console.error("unable to create webgl context"),this.gl.renderer=this,this.setSize(n,i),this.state={},this.state.blendFunc={src:this.gl.ONE,dst:this.gl.ZERO},this.state.blendEquation={modeRGB:this.gl.FUNC_ADD},this.state.cullFace=!1,this.state.frontFace=this.gl.CCW,this.state.depthMask=!0,this.state.depthFunc=this.gl.LEQUAL,this.state.premultiplyAlpha=!1,this.state.flipY=!1,this.state.unpackAlignment=4,this.state.framebuffer=null,this.state.viewport={x:0,y:0,width:null,height:null},this.state.textureUnits=[],this.state.activeTextureUnit=0,this.state.boundBuffer=null,this.state.uniformLocations=new Map,this.state.currentProgram=null,this.extensions={},this.isWebgl2?(this.getExtension("EXT_color_buffer_float"),this.getExtension("OES_texture_float_linear")):(this.getExtension("OES_texture_float"),this.getExtension("OES_texture_float_linear"),this.getExtension("OES_texture_half_float"),this.getExtension("OES_texture_half_float_linear"),this.getExtension("OES_element_index_uint"),this.getExtension("OES_standard_derivatives"),this.getExtension("EXT_sRGB"),this.getExtension("WEBGL_depth_texture"),this.getExtension("WEBGL_draw_buffers")),this.getExtension("WEBGL_compressed_texture_astc"),this.getExtension("EXT_texture_compression_bptc"),this.getExtension("WEBGL_compressed_texture_s3tc"),this.getExtension("WEBGL_compressed_texture_etc1"),this.getExtension("WEBGL_compressed_texture_pvrtc"),this.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),this.vertexAttribDivisor=this.getExtension("ANGLE_instanced_arrays","vertexAttribDivisor","vertexAttribDivisorANGLE"),this.drawArraysInstanced=this.getExtension("ANGLE_instanced_arrays","drawArraysInstanced","drawArraysInstancedANGLE"),this.drawElementsInstanced=this.getExtension("ANGLE_instanced_arrays","drawElementsInstanced","drawElementsInstancedANGLE"),this.createVertexArray=this.getExtension("OES_vertex_array_object","createVertexArray","createVertexArrayOES"),this.bindVertexArray=this.getExtension("OES_vertex_array_object","bindVertexArray","bindVertexArrayOES"),this.deleteVertexArray=this.getExtension("OES_vertex_array_object","deleteVertexArray","deleteVertexArrayOES"),this.drawBuffers=this.getExtension("WEBGL_draw_buffers","drawBuffers","drawBuffersWEBGL"),this.parameters={},this.parameters.maxTextureUnits=this.gl.getParameter(this.gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS),this.parameters.maxAnisotropy=this.getExtension("EXT_texture_filter_anisotropic")?this.gl.getParameter(this.getExtension("EXT_texture_filter_anisotropic").MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}setSize(t,n){this.width=t,this.height=n,this.gl.canvas.width=t*this.dpr,this.gl.canvas.height=n*this.dpr,this.gl.canvas.style&&Object.assign(this.gl.canvas.style,{width:t+"px",height:n+"px"})}setViewport(t,n,i=0,r=0){this.state.viewport.width===t&&this.state.viewport.height===n||(this.state.viewport.width=t,this.state.viewport.height=n,this.state.viewport.x=i,this.state.viewport.y=r,this.gl.viewport(i,r,t,n))}setScissor(t,n,i=0,r=0){this.gl.scissor(i,r,t,n)}enable(t){this.state[t]!==!0&&(this.gl.enable(t),this.state[t]=!0)}disable(t){this.state[t]!==!1&&(this.gl.disable(t),this.state[t]=!1)}setBlendFunc(t,n,i,r){this.state.blendFunc.src===t&&this.state.blendFunc.dst===n&&this.state.blendFunc.srcAlpha===i&&this.state.blendFunc.dstAlpha===r||(this.state.blendFunc.src=t,this.state.blendFunc.dst=n,this.state.blendFunc.srcAlpha=i,this.state.blendFunc.dstAlpha=r,i!==void 0?this.gl.blendFuncSeparate(t,n,i,r):this.gl.blendFunc(t,n))}setBlendEquation(t,n){t=t||this.gl.FUNC_ADD,!(this.state.blendEquation.modeRGB===t&&this.state.blendEquation.modeAlpha===n)&&(this.state.blendEquation.modeRGB=t,this.state.blendEquation.modeAlpha=n,n!==void 0?this.gl.blendEquationSeparate(t,n):this.gl.blendEquation(t))}setCullFace(t){this.state.cullFace!==t&&(this.state.cullFace=t,this.gl.cullFace(t))}setFrontFace(t){this.state.frontFace!==t&&(this.state.frontFace=t,this.gl.frontFace(t))}setDepthMask(t){this.state.depthMask!==t&&(this.state.depthMask=t,this.gl.depthMask(t))}setDepthFunc(t){this.state.depthFunc!==t&&(this.state.depthFunc=t,this.gl.depthFunc(t))}setStencilMask(t){this.state.stencilMask!==t&&(this.state.stencilMask=t,this.gl.stencilMask(t))}setStencilFunc(t,n,i){this.state.stencilFunc===t&&this.state.stencilRef===n&&this.state.stencilFuncMask===i||(this.state.stencilFunc=t||this.gl.ALWAYS,this.state.stencilRef=n||0,this.state.stencilFuncMask=i||0,this.gl.stencilFunc(t||this.gl.ALWAYS,n||0,i||0))}setStencilOp(t,n,i){this.state.stencilFail===t&&this.state.stencilDepthFail===n&&this.state.stencilDepthPass===i||(this.state.stencilFail=t,this.state.stencilDepthFail=n,this.state.stencilDepthPass=i,this.gl.stencilOp(t,n,i))}activeTexture(t){this.state.activeTextureUnit!==t&&(this.state.activeTextureUnit=t,this.gl.activeTexture(this.gl.TEXTURE0+t))}bindFramebuffer({target:t=this.gl.FRAMEBUFFER,buffer:n=null}={}){this.state.framebuffer!==n&&(this.state.framebuffer=n,this.gl.bindFramebuffer(t,n))}getExtension(t,n,i){return n&&this.gl[n]?this.gl[n].bind(this.gl):(this.extensions[t]||(this.extensions[t]=this.gl.getExtension(t)),n?this.extensions[t]?this.extensions[t][i].bind(this.extensions[t]):null:this.extensions[t])}sortOpaque(t,n){return t.renderOrder!==n.renderOrder?t.renderOrder-n.renderOrder:t.program.id!==n.program.id?t.program.id-n.program.id:t.zDepth!==n.zDepth?t.zDepth-n.zDepth:n.id-t.id}sortTransparent(t,n){return t.renderOrder!==n.renderOrder?t.renderOrder-n.renderOrder:t.zDepth!==n.zDepth?n.zDepth-t.zDepth:n.id-t.id}sortUI(t,n){return t.renderOrder!==n.renderOrder?t.renderOrder-n.renderOrder:t.program.id!==n.program.id?t.program.id-n.program.id:n.id-t.id}getRenderList({scene:t,camera:n,frustumCull:i,sort:r}){let a=[];if(n&&i&&n.updateFrustum(),t.traverse(o=>{if(!o.visible)return!0;o.draw&&(i&&o.frustumCulled&&n&&!n.frustumIntersectsMesh(o)||a.push(o))}),r){const o=[],u=[],d=[];a.forEach(h=>{h.program.transparent?h.program.depthTest?u.push(h):d.push(h):o.push(h),h.zDepth=0,!(h.renderOrder!==0||!h.program.depthTest||!n)&&(h.worldMatrix.getTranslation(Gg),Gg.applyMatrix4(n.projectionViewMatrix),h.zDepth=Gg.z)}),o.sort(this.sortOpaque),u.sort(this.sortTransparent),d.sort(this.sortUI),a=o.concat(u,d)}return a}render({scene:t,camera:n,target:i=null,update:r=!0,sort:a=!0,frustumCull:o=!0,clear:u}){i===null?(this.bindFramebuffer(),this.setViewport(this.width*this.dpr,this.height*this.dpr)):(this.bindFramebuffer(i),this.setViewport(i.width,i.height)),(u||this.autoClear&&u!==!1)&&(this.depth&&(!i||i.depth)&&(this.enable(this.gl.DEPTH_TEST),this.setDepthMask(!0)),(this.stencil||!i||i.stencil)&&(this.enable(this.gl.STENCIL_TEST),this.setStencilMask(255)),this.gl.clear((this.color?this.gl.COLOR_BUFFER_BIT:0)|(this.depth?this.gl.DEPTH_BUFFER_BIT:0)|(this.stencil?this.gl.STENCIL_BUFFER_BIT:0))),r&&t.updateMatrixWorld(),n&&n.updateMatrixWorld(),this.getRenderList({scene:t,camera:n,frustumCull:o,sort:a}).forEach(h=>{h.draw({camera:n})})}}function t4(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function n4(e,t,n,i,r){return e[0]=t,e[1]=n,e[2]=i,e[3]=r,e}function i4(e,t){let n=t[0],i=t[1],r=t[2],a=t[3],o=n*n+i*i+r*r+a*a;return o>0&&(o=1/Math.sqrt(o)),e[0]=n*o,e[1]=i*o,e[2]=r*o,e[3]=a*o,e}function r4(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function s4(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function a4(e,t,n){n=n*.5;let i=Math.sin(n);return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=Math.cos(n),e}function Vk(e,t,n){let i=t[0],r=t[1],a=t[2],o=t[3],u=n[0],d=n[1],h=n[2],g=n[3];return e[0]=i*g+o*u+r*h-a*d,e[1]=r*g+o*d+a*u-i*h,e[2]=a*g+o*h+i*d-r*u,e[3]=o*g-i*u-r*d-a*h,e}function l4(e,t,n){n*=.5;let i=t[0],r=t[1],a=t[2],o=t[3],u=Math.sin(n),d=Math.cos(n);return e[0]=i*d+o*u,e[1]=r*d+a*u,e[2]=a*d-r*u,e[3]=o*d-i*u,e}function o4(e,t,n){n*=.5;let i=t[0],r=t[1],a=t[2],o=t[3],u=Math.sin(n),d=Math.cos(n);return e[0]=i*d-a*u,e[1]=r*d+o*u,e[2]=a*d+i*u,e[3]=o*d-r*u,e}function c4(e,t,n){n*=.5;let i=t[0],r=t[1],a=t[2],o=t[3],u=Math.sin(n),d=Math.cos(n);return e[0]=i*d+r*u,e[1]=r*d-i*u,e[2]=a*d+o*u,e[3]=o*d-a*u,e}function u4(e,t,n,i){let r=t[0],a=t[1],o=t[2],u=t[3],d=n[0],h=n[1],g=n[2],p=n[3],y,b,w,v,N;return b=r*d+a*h+o*g+u*p,b<0&&(b=-b,d=-d,h=-h,g=-g,p=-p),1-b>1e-6?(y=Math.acos(b),w=Math.sin(y),v=Math.sin((1-i)*y)/w,N=Math.sin(i*y)/w):(v=1-i,N=i),e[0]=v*r+N*d,e[1]=v*a+N*h,e[2]=v*o+N*g,e[3]=v*u+N*p,e}function d4(e,t){let n=t[0],i=t[1],r=t[2],a=t[3],o=n*n+i*i+r*r+a*a,u=o?1/o:0;return e[0]=-n*u,e[1]=-i*u,e[2]=-r*u,e[3]=a*u,e}function f4(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function h4(e,t){let n=t[0]+t[4]+t[8],i;if(n>0)i=Math.sqrt(n+1),e[3]=.5*i,i=.5/i,e[0]=(t[5]-t[7])*i,e[1]=(t[6]-t[2])*i,e[2]=(t[1]-t[3])*i;else{let r=0;t[4]>t[0]&&(r=1),t[8]>t[r*3+r]&&(r=2);let a=(r+1)%3,o=(r+2)%3;i=Math.sqrt(t[r*3+r]-t[a*3+a]-t[o*3+o]+1),e[r]=.5*i,i=.5/i,e[3]=(t[a*3+o]-t[o*3+a])*i,e[a]=(t[a*3+r]+t[r*3+a])*i,e[o]=(t[o*3+r]+t[r*3+o])*i}return e}function p4(e,t,n="YXZ"){let i=Math.sin(t[0]*.5),r=Math.cos(t[0]*.5),a=Math.sin(t[1]*.5),o=Math.cos(t[1]*.5),u=Math.sin(t[2]*.5),d=Math.cos(t[2]*.5);return n==="XYZ"?(e[0]=i*o*d+r*a*u,e[1]=r*a*d-i*o*u,e[2]=r*o*u+i*a*d,e[3]=r*o*d-i*a*u):n==="YXZ"?(e[0]=i*o*d+r*a*u,e[1]=r*a*d-i*o*u,e[2]=r*o*u-i*a*d,e[3]=r*o*d+i*a*u):n==="ZXY"?(e[0]=i*o*d-r*a*u,e[1]=r*a*d+i*o*u,e[2]=r*o*u+i*a*d,e[3]=r*o*d-i*a*u):n==="ZYX"?(e[0]=i*o*d-r*a*u,e[1]=r*a*d+i*o*u,e[2]=r*o*u-i*a*d,e[3]=r*o*d+i*a*u):n==="YZX"?(e[0]=i*o*d+r*a*u,e[1]=r*a*d+i*o*u,e[2]=r*o*u-i*a*d,e[3]=r*o*d-i*a*u):n==="XZY"&&(e[0]=i*o*d-r*a*u,e[1]=r*a*d-i*o*u,e[2]=r*o*u+i*a*d,e[3]=r*o*d+i*a*u),e}const m4=t4,g4=n4,y4=r4,b4=i4;class x4 extends Array{constructor(t=0,n=0,i=0,r=1){super(t,n,i,r),this.onChange=()=>{},this._target=this;const a=["0","1","2","3"];return new Proxy(this,{set(o,u){const d=Reflect.set(...arguments);return d&&a.includes(u)&&o.onChange(),d}})}get x(){return this[0]}get y(){return this[1]}get z(){return this[2]}get w(){return this[3]}set x(t){this._target[0]=t,this.onChange()}set y(t){this._target[1]=t,this.onChange()}set z(t){this._target[2]=t,this.onChange()}set w(t){this._target[3]=t,this.onChange()}identity(){return s4(this._target),this.onChange(),this}set(t,n,i,r){return t.length?this.copy(t):(g4(this._target,t,n,i,r),this.onChange(),this)}rotateX(t){return l4(this._target,this._target,t),this.onChange(),this}rotateY(t){return o4(this._target,this._target,t),this.onChange(),this}rotateZ(t){return c4(this._target,this._target,t),this.onChange(),this}inverse(t=this._target){return d4(this._target,t),this.onChange(),this}conjugate(t=this._target){return f4(this._target,t),this.onChange(),this}copy(t){return m4(this._target,t),this.onChange(),this}normalize(t=this._target){return b4(this._target,t),this.onChange(),this}multiply(t,n){return n?Vk(this._target,t,n):Vk(this._target,this._target,t),this.onChange(),this}dot(t){return y4(this._target,t)}fromMatrix3(t){return h4(this._target,t),this.onChange(),this}fromEuler(t,n){return p4(this._target,t,t.order),n||this.onChange(),this}fromAxisAngle(t,n){return a4(this._target,t,n),this.onChange(),this}slerp(t,n){return u4(this._target,this._target,t,n),this.onChange(),this}fromArray(t,n=0){return this._target[0]=t[n],this._target[1]=t[n+1],this._target[2]=t[n+2],this._target[3]=t[n+3],this.onChange(),this}toArray(t=[],n=0){return t[n]=this[0],t[n+1]=this[1],t[n+2]=this[2],t[n+3]=this[3],t}}const v4=1e-6;function w4(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function k4(e,t,n,i,r,a,o,u,d,h,g,p,y,b,w,v,N){return e[0]=t,e[1]=n,e[2]=i,e[3]=r,e[4]=a,e[5]=o,e[6]=u,e[7]=d,e[8]=h,e[9]=g,e[10]=p,e[11]=y,e[12]=b,e[13]=w,e[14]=v,e[15]=N,e}function E4(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function S4(e,t){let n=t[0],i=t[1],r=t[2],a=t[3],o=t[4],u=t[5],d=t[6],h=t[7],g=t[8],p=t[9],y=t[10],b=t[11],w=t[12],v=t[13],N=t[14],k=t[15],A=n*u-i*o,S=n*d-r*o,_=n*h-a*o,C=i*d-r*u,T=i*h-a*u,R=r*h-a*d,O=g*v-p*w,B=g*N-y*w,P=g*k-b*w,F=p*N-y*v,U=p*k-b*v,V=y*k-b*N,M=A*V-S*U+_*F+C*P-T*B+R*O;return M?(M=1/M,e[0]=(u*V-d*U+h*F)*M,e[1]=(r*U-i*V-a*F)*M,e[2]=(v*R-N*T+k*C)*M,e[3]=(y*T-p*R-b*C)*M,e[4]=(d*P-o*V-h*B)*M,e[5]=(n*V-r*P+a*B)*M,e[6]=(N*_-w*R-k*S)*M,e[7]=(g*R-y*_+b*S)*M,e[8]=(o*U-u*P+h*O)*M,e[9]=(i*P-n*U-a*O)*M,e[10]=(w*T-v*_+k*A)*M,e[11]=(p*_-g*T-b*A)*M,e[12]=(u*B-o*F-d*O)*M,e[13]=(n*F-i*B+r*O)*M,e[14]=(v*S-w*C-N*A)*M,e[15]=(g*C-p*S+y*A)*M,e):null}function m_(e){let t=e[0],n=e[1],i=e[2],r=e[3],a=e[4],o=e[5],u=e[6],d=e[7],h=e[8],g=e[9],p=e[10],y=e[11],b=e[12],w=e[13],v=e[14],N=e[15],k=t*o-n*a,A=t*u-i*a,S=t*d-r*a,_=n*u-i*o,C=n*d-r*o,T=i*d-r*u,R=h*w-g*b,O=h*v-p*b,B=h*N-y*b,P=g*v-p*w,F=g*N-y*w,U=p*N-y*v;return k*U-A*F+S*P+_*B-C*O+T*R}function Yk(e,t,n){let i=t[0],r=t[1],a=t[2],o=t[3],u=t[4],d=t[5],h=t[6],g=t[7],p=t[8],y=t[9],b=t[10],w=t[11],v=t[12],N=t[13],k=t[14],A=t[15],S=n[0],_=n[1],C=n[2],T=n[3];return e[0]=S*i+_*u+C*p+T*v,e[1]=S*r+_*d+C*y+T*N,e[2]=S*a+_*h+C*b+T*k,e[3]=S*o+_*g+C*w+T*A,S=n[4],_=n[5],C=n[6],T=n[7],e[4]=S*i+_*u+C*p+T*v,e[5]=S*r+_*d+C*y+T*N,e[6]=S*a+_*h+C*b+T*k,e[7]=S*o+_*g+C*w+T*A,S=n[8],_=n[9],C=n[10],T=n[11],e[8]=S*i+_*u+C*p+T*v,e[9]=S*r+_*d+C*y+T*N,e[10]=S*a+_*h+C*b+T*k,e[11]=S*o+_*g+C*w+T*A,S=n[12],_=n[13],C=n[14],T=n[15],e[12]=S*i+_*u+C*p+T*v,e[13]=S*r+_*d+C*y+T*N,e[14]=S*a+_*h+C*b+T*k,e[15]=S*o+_*g+C*w+T*A,e}function N4(e,t,n){let i=n[0],r=n[1],a=n[2],o,u,d,h,g,p,y,b,w,v,N,k;return t===e?(e[12]=t[0]*i+t[4]*r+t[8]*a+t[12],e[13]=t[1]*i+t[5]*r+t[9]*a+t[13],e[14]=t[2]*i+t[6]*r+t[10]*a+t[14],e[15]=t[3]*i+t[7]*r+t[11]*a+t[15]):(o=t[0],u=t[1],d=t[2],h=t[3],g=t[4],p=t[5],y=t[6],b=t[7],w=t[8],v=t[9],N=t[10],k=t[11],e[0]=o,e[1]=u,e[2]=d,e[3]=h,e[4]=g,e[5]=p,e[6]=y,e[7]=b,e[8]=w,e[9]=v,e[10]=N,e[11]=k,e[12]=o*i+g*r+w*a+t[12],e[13]=u*i+p*r+v*a+t[13],e[14]=d*i+y*r+N*a+t[14],e[15]=h*i+b*r+k*a+t[15]),e}function _4(e,t,n){let i=n[0],r=n[1],a=n[2];return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function j4(e,t,n,i){let r=i[0],a=i[1],o=i[2],u=Math.hypot(r,a,o),d,h,g,p,y,b,w,v,N,k,A,S,_,C,T,R,O,B,P,F,U,V,M,H;return Math.abs(u)<v4?null:(u=1/u,r*=u,a*=u,o*=u,d=Math.sin(n),h=Math.cos(n),g=1-h,p=t[0],y=t[1],b=t[2],w=t[3],v=t[4],N=t[5],k=t[6],A=t[7],S=t[8],_=t[9],C=t[10],T=t[11],R=r*r*g+h,O=a*r*g+o*d,B=o*r*g-a*d,P=r*a*g-o*d,F=a*a*g+h,U=o*a*g+r*d,V=r*o*g+a*d,M=a*o*g-r*d,H=o*o*g+h,e[0]=p*R+v*O+S*B,e[1]=y*R+N*O+_*B,e[2]=b*R+k*O+C*B,e[3]=w*R+A*O+T*B,e[4]=p*P+v*F+S*U,e[5]=y*P+N*F+_*U,e[6]=b*P+k*F+C*U,e[7]=w*P+A*F+T*U,e[8]=p*V+v*M+S*H,e[9]=y*V+N*M+_*H,e[10]=b*V+k*M+C*H,e[11]=w*V+A*M+T*H,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)}function C4(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function g_(e,t){let n=t[0],i=t[1],r=t[2],a=t[4],o=t[5],u=t[6],d=t[8],h=t[9],g=t[10];return e[0]=Math.hypot(n,i,r),e[1]=Math.hypot(a,o,u),e[2]=Math.hypot(d,h,g),e}function A4(e){let t=e[0],n=e[1],i=e[2],r=e[4],a=e[5],o=e[6],u=e[8],d=e[9],h=e[10];const g=t*t+n*n+i*i,p=r*r+a*a+o*o,y=u*u+d*d+h*h;return Math.sqrt(Math.max(g,p,y))}const y_=(function(){const e=[1,1,1];return function(t,n){let i=e;g_(i,n);let r=1/i[0],a=1/i[1],o=1/i[2],u=n[0]*r,d=n[1]*a,h=n[2]*o,g=n[4]*r,p=n[5]*a,y=n[6]*o,b=n[8]*r,w=n[9]*a,v=n[10]*o,N=u+p+v,k=0;return N>0?(k=Math.sqrt(N+1)*2,t[3]=.25*k,t[0]=(y-w)/k,t[1]=(b-h)/k,t[2]=(d-g)/k):u>p&&u>v?(k=Math.sqrt(1+u-p-v)*2,t[3]=(y-w)/k,t[0]=.25*k,t[1]=(d+g)/k,t[2]=(b+h)/k):p>v?(k=Math.sqrt(1+p-u-v)*2,t[3]=(b-h)/k,t[0]=(d+g)/k,t[1]=.25*k,t[2]=(y+w)/k):(k=Math.sqrt(1+v-u-p)*2,t[3]=(d-g)/k,t[0]=(b+h)/k,t[1]=(y+w)/k,t[2]=.25*k),t}})();function T4(e,t,n,i){let r=gu([e[0],e[1],e[2]]);const a=gu([e[4],e[5],e[6]]),o=gu([e[8],e[9],e[10]]);m_(e)<0&&(r=-r),n[0]=e[12],n[1]=e[13],n[2]=e[14];const d=e.slice(),h=1/r,g=1/a,p=1/o;d[0]*=h,d[1]*=h,d[2]*=h,d[4]*=g,d[5]*=g,d[6]*=g,d[8]*=p,d[9]*=p,d[10]*=p,y_(t,d),i[0]=r,i[1]=a,i[2]=o}function M4(e,t,n,i){const r=e,a=t[0],o=t[1],u=t[2],d=t[3],h=a+a,g=o+o,p=u+u,y=a*h,b=a*g,w=a*p,v=o*g,N=o*p,k=u*p,A=d*h,S=d*g,_=d*p,C=i[0],T=i[1],R=i[2];return r[0]=(1-(v+k))*C,r[1]=(b+_)*C,r[2]=(w-S)*C,r[3]=0,r[4]=(b-_)*T,r[5]=(1-(y+k))*T,r[6]=(N+A)*T,r[7]=0,r[8]=(w+S)*R,r[9]=(N-A)*R,r[10]=(1-(y+v))*R,r[11]=0,r[12]=n[0],r[13]=n[1],r[14]=n[2],r[15]=1,r}function D4(e,t){let n=t[0],i=t[1],r=t[2],a=t[3],o=n+n,u=i+i,d=r+r,h=n*o,g=i*o,p=i*u,y=r*o,b=r*u,w=r*d,v=a*o,N=a*u,k=a*d;return e[0]=1-p-w,e[1]=g+k,e[2]=y-N,e[3]=0,e[4]=g-k,e[5]=1-h-w,e[6]=b+v,e[7]=0,e[8]=y+N,e[9]=b-v,e[10]=1-h-p,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function O4(e,t,n,i,r){let a=1/Math.tan(t/2),o=1/(i-r);return e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=(r+i)*o,e[11]=-1,e[12]=0,e[13]=0,e[14]=2*r*i*o,e[15]=0,e}function R4(e,t,n,i,r,a,o){let u=1/(t-n),d=1/(i-r),h=1/(a-o);return e[0]=-2*u,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*d,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*h,e[11]=0,e[12]=(t+n)*u,e[13]=(r+i)*d,e[14]=(o+a)*h,e[15]=1,e}function L4(e,t,n,i){let r=t[0],a=t[1],o=t[2],u=i[0],d=i[1],h=i[2],g=r-n[0],p=a-n[1],y=o-n[2],b=g*g+p*p+y*y;b===0?y=1:(b=1/Math.sqrt(b),g*=b,p*=b,y*=b);let w=d*y-h*p,v=h*g-u*y,N=u*p-d*g;return b=w*w+v*v+N*N,b===0&&(h?u+=1e-6:d?h+=1e-6:d+=1e-6,w=d*y-h*p,v=h*g-u*y,N=u*p-d*g,b=w*w+v*v+N*N),b=1/Math.sqrt(b),w*=b,v*=b,N*=b,e[0]=w,e[1]=v,e[2]=N,e[3]=0,e[4]=p*N-y*v,e[5]=y*w-g*N,e[6]=g*v-p*w,e[7]=0,e[8]=g,e[9]=p,e[10]=y,e[11]=0,e[12]=r,e[13]=a,e[14]=o,e[15]=1,e}function Wk(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e[9]=t[9]+n[9],e[10]=t[10]+n[10],e[11]=t[11]+n[11],e[12]=t[12]+n[12],e[13]=t[13]+n[13],e[14]=t[14]+n[14],e[15]=t[15]+n[15],e}function Qk(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e[9]=t[9]-n[9],e[10]=t[10]-n[10],e[11]=t[11]-n[11],e[12]=t[12]-n[12],e[13]=t[13]-n[13],e[14]=t[14]-n[14],e[15]=t[15]-n[15],e}function z4(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11]*n,e[12]=t[12]*n,e[13]=t[13]*n,e[14]=t[14]*n,e[15]=t[15]*n,e}class Nh extends Array{constructor(t=1,n=0,i=0,r=0,a=0,o=1,u=0,d=0,h=0,g=0,p=1,y=0,b=0,w=0,v=0,N=1){return super(t,n,i,r,a,o,u,d,h,g,p,y,b,w,v,N),this}get x(){return this[12]}get y(){return this[13]}get z(){return this[14]}get w(){return this[15]}set x(t){this[12]=t}set y(t){this[13]=t}set z(t){this[14]=t}set w(t){this[15]=t}set(t,n,i,r,a,o,u,d,h,g,p,y,b,w,v,N){return t.length?this.copy(t):(k4(this,t,n,i,r,a,o,u,d,h,g,p,y,b,w,v,N),this)}translate(t,n=this){return N4(this,n,t),this}rotate(t,n,i=this){return j4(this,i,t,n),this}scale(t,n=this){return _4(this,n,typeof t=="number"?[t,t,t]:t),this}add(t,n){return n?Wk(this,t,n):Wk(this,this,t),this}sub(t,n){return n?Qk(this,t,n):Qk(this,this,t),this}multiply(t,n){return t.length?n?Yk(this,t,n):Yk(this,this,t):z4(this,this,t),this}identity(){return E4(this),this}copy(t){return w4(this,t),this}fromPerspective({fov:t,aspect:n,near:i,far:r}={}){return O4(this,t,n,i,r),this}fromOrthogonal({left:t,right:n,bottom:i,top:r,near:a,far:o}){return R4(this,t,n,i,r,a,o),this}fromQuaternion(t){return D4(this,t),this}setPosition(t){return this.x=t[0],this.y=t[1],this.z=t[2],this}inverse(t=this){return S4(this,t),this}compose(t,n,i){return M4(this,t,n,i),this}decompose(t,n,i){return T4(this,t,n,i),this}getRotation(t){return y_(t,this),this}getTranslation(t){return C4(t,this),this}getScaling(t){return g_(t,this),this}getMaxScaleOnAxis(){return A4(this)}lookAt(t,n,i){return L4(this,t,n,i),this}determinant(){return m_(this)}fromArray(t,n=0){return this[0]=t[n],this[1]=t[n+1],this[2]=t[n+2],this[3]=t[n+3],this[4]=t[n+4],this[5]=t[n+5],this[6]=t[n+6],this[7]=t[n+7],this[8]=t[n+8],this[9]=t[n+9],this[10]=t[n+10],this[11]=t[n+11],this[12]=t[n+12],this[13]=t[n+13],this[14]=t[n+14],this[15]=t[n+15],this}toArray(t=[],n=0){return t[n]=this[0],t[n+1]=this[1],t[n+2]=this[2],t[n+3]=this[3],t[n+4]=this[4],t[n+5]=this[5],t[n+6]=this[6],t[n+7]=this[7],t[n+8]=this[8],t[n+9]=this[9],t[n+10]=this[10],t[n+11]=this[11],t[n+12]=this[12],t[n+13]=this[13],t[n+14]=this[14],t[n+15]=this[15],t}}function I4(e,t,n="YXZ"){return n==="XYZ"?(e[1]=Math.asin(Math.min(Math.max(t[8],-1),1)),Math.abs(t[8])<.99999?(e[0]=Math.atan2(-t[9],t[10]),e[2]=Math.atan2(-t[4],t[0])):(e[0]=Math.atan2(t[6],t[5]),e[2]=0)):n==="YXZ"?(e[0]=Math.asin(-Math.min(Math.max(t[9],-1),1)),Math.abs(t[9])<.99999?(e[1]=Math.atan2(t[8],t[10]),e[2]=Math.atan2(t[1],t[5])):(e[1]=Math.atan2(-t[2],t[0]),e[2]=0)):n==="ZXY"?(e[0]=Math.asin(Math.min(Math.max(t[6],-1),1)),Math.abs(t[6])<.99999?(e[1]=Math.atan2(-t[2],t[10]),e[2]=Math.atan2(-t[4],t[5])):(e[1]=0,e[2]=Math.atan2(t[1],t[0]))):n==="ZYX"?(e[1]=Math.asin(-Math.min(Math.max(t[2],-1),1)),Math.abs(t[2])<.99999?(e[0]=Math.atan2(t[6],t[10]),e[2]=Math.atan2(t[1],t[0])):(e[0]=0,e[2]=Math.atan2(-t[4],t[5]))):n==="YZX"?(e[2]=Math.asin(Math.min(Math.max(t[1],-1),1)),Math.abs(t[1])<.99999?(e[0]=Math.atan2(-t[9],t[5]),e[1]=Math.atan2(-t[2],t[0])):(e[0]=0,e[1]=Math.atan2(t[8],t[10]))):n==="XZY"&&(e[2]=Math.asin(-Math.min(Math.max(t[4],-1),1)),Math.abs(t[4])<.99999?(e[0]=Math.atan2(t[6],t[5]),e[1]=Math.atan2(t[8],t[0])):(e[0]=Math.atan2(-t[9],t[10]),e[1]=0)),e}const Xk=new Nh;class P4 extends Array{constructor(t=0,n=t,i=t,r="YXZ"){super(t,n,i),this.order=r,this.onChange=()=>{},this._target=this;const a=["0","1","2"];return new Proxy(this,{set(o,u){const d=Reflect.set(...arguments);return d&&a.includes(u)&&o.onChange(),d}})}get x(){return this[0]}get y(){return this[1]}get z(){return this[2]}set x(t){this._target[0]=t,this.onChange()}set y(t){this._target[1]=t,this.onChange()}set z(t){this._target[2]=t,this.onChange()}set(t,n=t,i=t){return t.length?this.copy(t):(this._target[0]=t,this._target[1]=n,this._target[2]=i,this.onChange(),this)}copy(t){return this._target[0]=t[0],this._target[1]=t[1],this._target[2]=t[2],this.onChange(),this}reorder(t){return this._target.order=t,this.onChange(),this}fromRotationMatrix(t,n=this.order){return I4(this._target,t,n),this.onChange(),this}fromQuaternion(t,n=this.order,i){return Xk.fromQuaternion(t),this._target.fromRotationMatrix(Xk,n),i||this.onChange(),this}fromArray(t,n=0){return this._target[0]=t[n],this._target[1]=t[n+1],this._target[2]=t[n+2],this}toArray(t=[],n=0){return t[n]=this[0],t[n+1]=this[1],t[n+2]=this[2],t}}let B4=class{constructor(){this.parent=null,this.children=[],this.visible=!0,this.matrix=new Nh,this.worldMatrix=new Nh,this.matrixAutoUpdate=!0,this.worldMatrixNeedsUpdate=!1,this.position=new lr,this.quaternion=new x4,this.scale=new lr(1),this.rotation=new P4,this.up=new lr(0,1,0),this.rotation._target.onChange=()=>this.quaternion.fromEuler(this.rotation,!0),this.quaternion._target.onChange=()=>this.rotation.fromQuaternion(this.quaternion,void 0,!0)}setParent(t,n=!0){this.parent&&t!==this.parent&&this.parent.removeChild(this,!1),this.parent=t,n&&t&&t.addChild(this,!1)}addChild(t,n=!0){~this.children.indexOf(t)||this.children.push(t),n&&t.setParent(this,!1)}removeChild(t,n=!0){~this.children.indexOf(t)&&this.children.splice(this.children.indexOf(t),1),n&&t.setParent(null,!1)}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.worldMatrixNeedsUpdate||t)&&(this.parent===null?this.worldMatrix.copy(this.matrix):this.worldMatrix.multiply(this.parent.worldMatrix,this.matrix),this.worldMatrixNeedsUpdate=!1,t=!0);for(let n=0,i=this.children.length;n<i;n++)this.children[n].updateMatrixWorld(t)}updateMatrix(){this.matrix.compose(this.quaternion,this.position,this.scale),this.worldMatrixNeedsUpdate=!0}traverse(t){if(!t(this))for(let n=0,i=this.children.length;n<i;n++)this.children[n].traverse(t)}decompose(){this.matrix.decompose(this.quaternion._target,this.position,this.scale),this.rotation.fromQuaternion(this.quaternion)}lookAt(t,n=!1){n?this.matrix.lookAt(this.position,t,this.up):this.matrix.lookAt(t,this.position,this.up),this.matrix.getRotation(this.quaternion._target),this.rotation.fromQuaternion(this.quaternion)}};function $4(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}function U4(e,t){let n=t[0],i=t[1],r=t[2],a=t[3],o=n+n,u=i+i,d=r+r,h=n*o,g=i*o,p=i*u,y=r*o,b=r*u,w=r*d,v=a*o,N=a*u,k=a*d;return e[0]=1-p-w,e[3]=g-k,e[6]=y+N,e[1]=g+k,e[4]=1-h-w,e[7]=b-v,e[2]=y-N,e[5]=b+v,e[8]=1-h-p,e}function F4(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function q4(e,t,n,i,r,a,o,u,d,h){return e[0]=t,e[1]=n,e[2]=i,e[3]=r,e[4]=a,e[5]=o,e[6]=u,e[7]=d,e[8]=h,e}function H4(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function K4(e,t){let n=t[0],i=t[1],r=t[2],a=t[3],o=t[4],u=t[5],d=t[6],h=t[7],g=t[8],p=g*o-u*h,y=-g*a+u*d,b=h*a-o*d,w=n*p+i*y+r*b;return w?(w=1/w,e[0]=p*w,e[1]=(-g*i+r*h)*w,e[2]=(u*i-r*o)*w,e[3]=y*w,e[4]=(g*n-r*d)*w,e[5]=(-u*n+r*a)*w,e[6]=b*w,e[7]=(-h*n+i*d)*w,e[8]=(o*n-i*a)*w,e):null}function Zk(e,t,n){let i=t[0],r=t[1],a=t[2],o=t[3],u=t[4],d=t[5],h=t[6],g=t[7],p=t[8],y=n[0],b=n[1],w=n[2],v=n[3],N=n[4],k=n[5],A=n[6],S=n[7],_=n[8];return e[0]=y*i+b*o+w*h,e[1]=y*r+b*u+w*g,e[2]=y*a+b*d+w*p,e[3]=v*i+N*o+k*h,e[4]=v*r+N*u+k*g,e[5]=v*a+N*d+k*p,e[6]=A*i+S*o+_*h,e[7]=A*r+S*u+_*g,e[8]=A*a+S*d+_*p,e}function G4(e,t,n){let i=t[0],r=t[1],a=t[2],o=t[3],u=t[4],d=t[5],h=t[6],g=t[7],p=t[8],y=n[0],b=n[1];return e[0]=i,e[1]=r,e[2]=a,e[3]=o,e[4]=u,e[5]=d,e[6]=y*i+b*o+h,e[7]=y*r+b*u+g,e[8]=y*a+b*d+p,e}function V4(e,t,n){let i=t[0],r=t[1],a=t[2],o=t[3],u=t[4],d=t[5],h=t[6],g=t[7],p=t[8],y=Math.sin(n),b=Math.cos(n);return e[0]=b*i+y*o,e[1]=b*r+y*u,e[2]=b*a+y*d,e[3]=b*o-y*i,e[4]=b*u-y*r,e[5]=b*d-y*a,e[6]=h,e[7]=g,e[8]=p,e}function Y4(e,t,n){let i=n[0],r=n[1];return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=r*t[3],e[4]=r*t[4],e[5]=r*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function W4(e,t){let n=t[0],i=t[1],r=t[2],a=t[3],o=t[4],u=t[5],d=t[6],h=t[7],g=t[8],p=t[9],y=t[10],b=t[11],w=t[12],v=t[13],N=t[14],k=t[15],A=n*u-i*o,S=n*d-r*o,_=n*h-a*o,C=i*d-r*u,T=i*h-a*u,R=r*h-a*d,O=g*v-p*w,B=g*N-y*w,P=g*k-b*w,F=p*N-y*v,U=p*k-b*v,V=y*k-b*N,M=A*V-S*U+_*F+C*P-T*B+R*O;return M?(M=1/M,e[0]=(u*V-d*U+h*F)*M,e[1]=(d*P-o*V-h*B)*M,e[2]=(o*U-u*P+h*O)*M,e[3]=(r*U-i*V-a*F)*M,e[4]=(n*V-r*P+a*B)*M,e[5]=(i*P-n*U-a*O)*M,e[6]=(v*R-N*T+k*C)*M,e[7]=(N*_-w*R-k*S)*M,e[8]=(w*T-v*_+k*A)*M,e):null}class Q4 extends Array{constructor(t=1,n=0,i=0,r=0,a=1,o=0,u=0,d=0,h=1){return super(t,n,i,r,a,o,u,d,h),this}set(t,n,i,r,a,o,u,d,h){return t.length?this.copy(t):(q4(this,t,n,i,r,a,o,u,d,h),this)}translate(t,n=this){return G4(this,n,t),this}rotate(t,n=this){return V4(this,n,t),this}scale(t,n=this){return Y4(this,n,t),this}multiply(t,n){return n?Zk(this,t,n):Zk(this,this,t),this}identity(){return H4(this),this}copy(t){return F4(this,t),this}fromMatrix4(t){return $4(this,t),this}fromQuaternion(t){return U4(this,t),this}fromBasis(t,n,i){return this.set(t[0],t[1],t[2],n[0],n[1],n[2],i[0],i[1],i[2]),this}inverse(t=this){return K4(this,t),this}getNormalMatrix(t){return W4(this,t),this}}let X4=0;class Z4 extends B4{constructor(t,{geometry:n,program:i,mode:r=t.TRIANGLES,frustumCulled:a=!0,renderOrder:o=0}={}){super(),t.canvas||console.error("gl not passed as first argument to Mesh"),this.gl=t,this.id=X4++,this.geometry=n,this.program=i,this.mode=r,this.frustumCulled=a,this.renderOrder=o,this.modelViewMatrix=new Nh,this.normalMatrix=new Q4,this.beforeRenderCallbacks=[],this.afterRenderCallbacks=[]}onBeforeRender(t){return this.beforeRenderCallbacks.push(t),this}onAfterRender(t){return this.afterRenderCallbacks.push(t),this}draw({camera:t}={}){t&&(this.program.uniforms.modelMatrix||Object.assign(this.program.uniforms,{modelMatrix:{value:null},viewMatrix:{value:null},modelViewMatrix:{value:null},normalMatrix:{value:null},projectionMatrix:{value:null},cameraPosition:{value:null}}),this.program.uniforms.projectionMatrix.value=t.projectionMatrix,this.program.uniforms.cameraPosition.value=t.worldPosition,this.program.uniforms.viewMatrix.value=t.viewMatrix,this.modelViewMatrix.multiply(t.viewMatrix,this.worldMatrix),this.normalMatrix.getNormalMatrix(this.modelViewMatrix),this.program.uniforms.modelMatrix.value=this.worldMatrix,this.program.uniforms.modelViewMatrix.value=this.modelViewMatrix,this.program.uniforms.normalMatrix.value=this.normalMatrix),this.beforeRenderCallbacks.forEach(i=>i&&i({mesh:this,camera:t}));let n=this.program.cullFace&&this.worldMatrix.determinant()<0;this.program.use({flipFaces:n}),this.geometry.draw({mode:this.mode,program:this.program}),this.afterRenderCallbacks.forEach(i=>i&&i({mesh:this,camera:t}))}}const Jk={black:"#000000",white:"#ffffff",red:"#ff0000",green:"#00ff00",blue:"#0000ff",fuchsia:"#ff00ff",cyan:"#00ffff",yellow:"#ffff00",orange:"#ff8000"};function eE(e){e.length===4&&(e=e[0]+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]);const t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t||console.warn(`Unable to convert hex string ${e} to rgb values`),[parseInt(t[1],16)/255,parseInt(t[2],16)/255,parseInt(t[3],16)/255]}function J4(e){return e=parseInt(e),[(e>>16&255)/255,(e>>8&255)/255,(e&255)/255]}function tE(e){return e===void 0?[0,0,0]:arguments.length===3?arguments:isNaN(e)?e[0]==="#"?eE(e):Jk[e.toLowerCase()]?eE(Jk[e.toLowerCase()]):(console.warn("Color format not recognised"),[0,0,0]):J4(e)}let e5=class extends Array{constructor(t){return Array.isArray(t)?super(...t):super(...tE(...arguments))}get r(){return this[0]}get g(){return this[1]}get b(){return this[2]}set r(t){this[0]=t}set g(t){this[1]=t}set b(t){this[2]=t}set(t){return Array.isArray(t)?this.copy(t):this.copy(tE(...arguments))}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this}};class t5 extends VI{constructor(t,{attributes:n={}}={}){Object.assign(n,{position:{size:2,data:new Float32Array([-1,-1,3,-1,-1,3])},uv:{size:2,data:new Float32Array([0,0,2,0,0,2])}}),super(t,n)}}const ob=8,_h=8,n5=`#version 300 es
|
|
514
|
+
in vec2 position;
|
|
515
|
+
|
|
516
|
+
void main() {
|
|
517
|
+
gl_Position = vec4(position, 0.0, 1.0);
|
|
518
|
+
}
|
|
519
|
+
`,i5=`#version 300 es
|
|
520
|
+
precision highp float;
|
|
521
|
+
|
|
522
|
+
uniform float uTime;
|
|
523
|
+
uniform vec2 uResolution;
|
|
524
|
+
uniform vec3 uColors[${_h}];
|
|
525
|
+
uniform int uColorCount;
|
|
526
|
+
uniform int uStrandCount;
|
|
527
|
+
uniform float uSpeed;
|
|
528
|
+
uniform float uAmplitude;
|
|
529
|
+
uniform float uWaviness;
|
|
530
|
+
uniform float uThickness;
|
|
531
|
+
uniform float uGlow;
|
|
532
|
+
uniform float uTaper;
|
|
533
|
+
uniform float uSpread;
|
|
534
|
+
uniform float uHueShift;
|
|
535
|
+
uniform float uIntensity;
|
|
536
|
+
uniform float uOpacity;
|
|
537
|
+
uniform float uScale;
|
|
538
|
+
uniform float uSaturation;
|
|
539
|
+
uniform float uActivity;
|
|
540
|
+
|
|
541
|
+
out vec4 fragColor;
|
|
542
|
+
|
|
543
|
+
const float PI = 3.14159265;
|
|
544
|
+
|
|
545
|
+
vec3 spectrum(float t) {
|
|
546
|
+
return 0.5 + 0.5 * cos(2.0 * PI * (t + vec3(0.0, 0.33, 0.67)));
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
vec3 samplePalette(float t) {
|
|
550
|
+
float scaled = fract(t) * float(uColorCount);
|
|
551
|
+
int index = int(floor(scaled));
|
|
552
|
+
int nextIndex = index + 1;
|
|
553
|
+
if (nextIndex >= uColorCount) nextIndex = 0;
|
|
554
|
+
return mix(uColors[index], uColors[nextIndex], fract(scaled));
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
vec3 strandColor(float t) {
|
|
558
|
+
if (uColorCount > 0) return samplePalette(t);
|
|
559
|
+
return spectrum(t);
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
void main() {
|
|
563
|
+
vec2 screenPosition = gl_FragCoord.xy / uResolution;
|
|
564
|
+
vec2 uv = screenPosition * 2.0 - 1.0;
|
|
565
|
+
uv /= max(uScale, 0.0001);
|
|
566
|
+
|
|
567
|
+
float energy = 0.06 + uIntensity * 0.94;
|
|
568
|
+
float screenX = screenPosition.x * 2.0 - 1.0;
|
|
569
|
+
float envelope = pow(max(cos(screenX * PI * 0.5), 0.0), uTaper);
|
|
570
|
+
vec3 color = vec3(0.0);
|
|
571
|
+
|
|
572
|
+
for (int i = 0; i < ${ob}; i++) {
|
|
573
|
+
if (i >= uStrandCount) break;
|
|
574
|
+
|
|
575
|
+
float strand = float(i);
|
|
576
|
+
float phase = strand * 1.7 * uSpread;
|
|
577
|
+
float frequency = (2.0 + strand * 0.35) * uWaviness;
|
|
578
|
+
float strandSpeed = 1.4 + strand * 1.2;
|
|
579
|
+
float time = uTime * uSpeed;
|
|
580
|
+
float wave = sin(uv.x * frequency + time * strandSpeed + phase) * 0.6
|
|
581
|
+
+ sin(uv.x * frequency * 1.1 - time * strandSpeed * 0.7 + phase * 1.7) * 0.4;
|
|
582
|
+
|
|
583
|
+
float activityWidth = 1.0 + uActivity * 0.9;
|
|
584
|
+
float amplitude = (0.1 + 0.02 * energy) * envelope * uAmplitude * activityWidth;
|
|
585
|
+
float distanceToWave = abs(uv.y - wave * amplitude);
|
|
586
|
+
float thickness = (0.001 + 0.05 * energy) * (0.35 + envelope) * uThickness
|
|
587
|
+
* (1.0 + uActivity * envelope * 0.55);
|
|
588
|
+
float glow = thickness / (distanceToWave + thickness * 0.45);
|
|
589
|
+
glow *= glow;
|
|
590
|
+
|
|
591
|
+
float hue = strand / float(uStrandCount) + uv.x * 0.3 + uTime * 0.04 + uHueShift;
|
|
592
|
+
color += strandColor(hue) * glow * envelope;
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
color *= 0.45 + 0.7 * energy;
|
|
596
|
+
color = 1.0 - exp(-color * uGlow);
|
|
597
|
+
float gray = dot(color, vec3(0.2126, 0.7152, 0.0722));
|
|
598
|
+
color = max(mix(vec3(gray), color, uSaturation), 0.0);
|
|
599
|
+
|
|
600
|
+
float alpha = clamp(max(max(color.r, color.g), color.b), 0.0, 1.0) * uOpacity;
|
|
601
|
+
fragColor = vec4(color * uOpacity, alpha);
|
|
602
|
+
}
|
|
603
|
+
`;function r5({active:e=!0,activityAnalyser:t=null,activityLevelRef:n=null,amplitude:i=1,className:r="",colors:a=["#61e7ff","#b463ff","#ff5fa2"],count:o=3,glow:u=2.6,hueShift:d=0,intensity:h=.6,opacity:g=1,saturation:p=1,scale:y=1,speed:b=.5,spread:w=1,style:v,taper:N=3,thickness:k=.7,waviness:A=1}){const S=j.useRef(null),_=j.useRef({active:e,activityAnalyser:t,activityLevelRef:n,amplitude:i,colors:a,count:o,glow:u,hueShift:d,intensity:h,opacity:g,saturation:p,scale:y,speed:b,spread:w,taper:N,thickness:k,waviness:A});return _.current={active:e,activityAnalyser:t,activityLevelRef:n,amplitude:i,colors:a,count:o,glow:u,hueShift:d,intensity:h,opacity:g,saturation:p,scale:y,speed:b,spread:w,taper:N,thickness:k,waviness:A},j.useEffect(()=>{var L;const C=S.current;if(!C)return;const T=document.createElement("canvas");if(!T.getContext("webgl2"))return;const R=new e4({alpha:!0,antialias:!0,canvas:T,dpr:Math.min(window.devicePixelRatio||1,2),premultipliedAlpha:!0}),O=R.gl;O.clearColor(0,0,0,0),O.enable(O.BLEND),O.blendFunc(O.ONE,O.ONE_MINUS_SRC_ALPHA);const B=new t5(O);delete B.attributes.uv;const P=new WI(O,{vertex:n5,fragment:i5,transparent:!0,depthTest:!1,depthWrite:!1,uniforms:{uTime:{value:0},uResolution:{value:[1,1]},uColors:{value:nE(_.current.colors)},uColorCount:{value:Math.min(_.current.colors.length,_h)},uStrandCount:{value:Math.min(_.current.count,ob)},uSpeed:{value:_.current.speed},uAmplitude:{value:_.current.amplitude},uWaviness:{value:_.current.waviness},uThickness:{value:_.current.thickness},uGlow:{value:_.current.glow},uTaper:{value:_.current.taper},uSpread:{value:_.current.spread},uHueShift:{value:_.current.hueShift},uIntensity:{value:_.current.intensity},uOpacity:{value:_.current.opacity},uScale:{value:_.current.scale},uSaturation:{value:_.current.saturation},uActivity:{value:0}}}),F=new Z4(O,{geometry:B,program:P}),U=((L=window.matchMedia)==null?void 0:L.call(window,"(prefers-reduced-motion: reduce)").matches)??!1;O.canvas.className="strands-canvas",C.appendChild(O.canvas);const V=()=>{const G=Math.max(1,C.offsetWidth),z=Math.max(1,C.offsetHeight);R.setSize(G,z),P.uniforms.uResolution.value=[O.canvas.width,O.canvas.height]},M=typeof ResizeObserver>"u"?null:new ResizeObserver(V);M==null||M.observe(C),window.addEventListener("resize",V),V();let H=0,$=0,K=0,W=0,Y=new Uint8Array(new ArrayBuffer(2048));const I=G=>{var re;const z=_.current,te=z.active?z.activityAnalyser:null;te&&Y.length!==te.fftSize&&(Y=new Uint8Array(new ArrayBuffer(te.fftSize)));const ye=(z.active?(re=z.activityLevelRef)==null?void 0:re.current:void 0)??(te?s5(te,Y):0);W+=(ye-W)*.08;const Se=$===0?0:Math.min((G-$)/1e3,.05);$=G,U||(K+=Se*z.speed*(1+W*2.2)),P.uniforms.uTime.value=K,P.uniforms.uColors.value=nE(z.colors),P.uniforms.uColorCount.value=Math.min(z.colors.length,_h),P.uniforms.uStrandCount.value=Math.min(Math.max(Math.round(z.count),1),ob),P.uniforms.uSpeed.value=1,P.uniforms.uAmplitude.value=z.amplitude,P.uniforms.uWaviness.value=z.waviness,P.uniforms.uThickness.value=z.thickness,P.uniforms.uGlow.value=z.glow,P.uniforms.uTaper.value=z.taper,P.uniforms.uSpread.value=z.spread,P.uniforms.uHueShift.value=z.hueShift,P.uniforms.uIntensity.value=z.intensity,P.uniforms.uOpacity.value=z.opacity,P.uniforms.uScale.value=z.scale,P.uniforms.uSaturation.value=z.saturation,P.uniforms.uActivity.value=W,R.render({scene:F}),U||(H=window.requestAnimationFrame(I))};return I(0),()=>{var G;window.cancelAnimationFrame(H),M==null||M.disconnect(),window.removeEventListener("resize",V),B.remove(),P.remove(),O.canvas.parentNode===C&&C.removeChild(O.canvas),(G=O.getExtension("WEBGL_lose_context"))==null||G.loseContext()}},[]),c.jsx("div",{ref:S,className:`strands-container ${e?"strands-active":""} ${r}`.trim(),style:v,"aria-hidden":"true"})}function nE(e){const t=e.length>0?e:["#ffffff"];return Array.from({length:_h},(n,i)=>{const r=t[t.length-1]??"#ffffff",a=new e5(t[i]??r);return[a.r,a.g,a.b]})}function s5(e,t){e.getByteTimeDomainData(t);let n=0;for(const i of t){const r=(i-128)/128;n+=r*r}return Math.min(1,Math.sqrt(n/t.length)*3.6)}function Vg(){if(!(typeof window>"u"))return window.SpeechRecognition??window.webkitSpeechRecognition}function a5({onComplete:e,onError:t}){const[n,i]=j.useState(!1),[r,a]=j.useState(""),o=j.useRef(null),u=j.useRef(""),d=j.useRef(""),h=j.useRef(0),g=j.useRef(!1),p=j.useRef(!1),y=j.useRef(null),b=j.useRef(e),w=j.useRef(t);b.current=e,w.current=t;const v=j.useCallback(()=>{y.current!==null&&(window.clearTimeout(y.current),y.current=null)},[]),N=j.useCallback(()=>{i(!1);const C=d.current.trim();u.current="",d.current="",C?b.current(C):w.current("no-speech")},[]),k=j.useCallback(()=>{h.current+=1,g.current=!1,p.current=!0,v();const C=o.current;o.current=null,C==null||C.abort(),u.current="",d.current="",a(""),i(!1)},[v]),A=j.useCallback(C=>{const T=Vg();if(!T||C!==h.current||!g.current)return!1;const R=new T;R.continuous=!0,R.interimResults=!0,R.lang=navigator.language||"zh-CN",R.onresult=O=>{var P;if(C!==h.current)return;let B="";for(let F=O.resultIndex;F<O.results.length;F+=1){const U=O.results[F],V=((P=U==null?void 0:U[0])==null?void 0:P.transcript.trim())??"";U!=null&&U.isFinal&&V?u.current=`${u.current} ${V}`.trim():V&&(B+=` ${V}`)}d.current=`${u.current}${B}`.trim(),a(d.current)},R.onerror=O=>{C===h.current&&(O.error==="no-speech"||O.error==="aborted"||O.error==="network"||(g.current=!1,p.current=!0,i(!1),w.current(O.error)))},R.onend=()=>{if(C===h.current){if(o.current===R&&(o.current=null),p.current){p.current=!1;return}if(!g.current){N();return}i(!0),v(),y.current=window.setTimeout(()=>{y.current=null,A(C)},180)}},o.current=R;try{return R.start(),i(!0),!0}catch{return o.current=null,g.current=!1,i(!1),w.current("start-failed"),!1}},[v,N]),S=j.useCallback(()=>{g.current=!1,v();const C=o.current;C?C.stop():N()},[v,N]),_=j.useCallback(()=>{if(!Vg())return w.current("unsupported"),!1;k();const T=h.current;return g.current=!0,p.current=!1,u.current="",d.current="",a(""),A(T)},[k,A]);return j.useEffect(()=>k,[k]),{cancel:k,isListening:n,start:_,stop:S,supported:!!Vg(),transcript:r}}function l5(){const[e,t]=j.useState("inactive"),[n,i]=j.useState(null),r=j.useRef(null),a=j.useRef(null),o=j.useRef(0),u=j.useCallback(()=>{var h,g;o.current+=1,(h=a.current)==null||h.getTracks().forEach(p=>p.stop()),a.current=null,(g=r.current)==null||g.close(),r.current=null,i(null),t("inactive")},[]),d=j.useCallback(async()=>{var y;if(!((y=navigator.mediaDevices)!=null&&y.getUserMedia)||typeof AudioContext>"u"){t("unsupported");return}u();const h=o.current;t("requesting");let g=null,p=null;try{if(g=await navigator.mediaDevices.getUserMedia({audio:{autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0}}),h!==o.current){g.getTracks().forEach(v=>v.stop());return}if(p=new AudioContext,p.state==="suspended"&&await p.resume(),h!==o.current){g.getTracks().forEach(v=>v.stop()),p.close();return}const b=p.createMediaStreamSource(g),w=p.createAnalyser();w.fftSize=2048,w.smoothingTimeConstant=.72,b.connect(w),a.current=g,r.current=p,i(w),t("active")}catch{g==null||g.getTracks().forEach(b=>b.stop()),p==null||p.close(),h===o.current&&t("denied")}},[u]);return j.useEffect(()=>u,[u]),{analyser:n,start:d,status:e,stop:u}}function o5(){return ct("/api/chat/sessions")}function c5(e){return ct(`/api/chat/sessions/${e}`)}async function ah(e={}){const t=await fetch("/api/chat/sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error(`${t.status}: ${await t.text()}`);return await t.json()}async function u5(e){const t=await fetch(`/api/chat/sessions/${e}`,{method:"DELETE"});if(!t.ok)throw new Error(`${t.status}`)}async function b_(e,t,n){const i=await fetch(`/api/chat/sessions/${e}/messages`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:t,attachments:n})});if(!i.ok)throw new Error(`${i.status}: ${await i.text()}`);return await i.json()}async function d5(e){const t=await fetch(`/api/chat/sessions/${e}/interrupt`,{method:"POST"});if(!t.ok&&t.status!==204)throw new Error(`${t.status}: ${await t.text()}`)}function f5(e,t){const n=t?`?since=${encodeURIComponent(t)}`:"";return ct(`/api/chat/sessions/${e}/messages${n}`)}function tu(e){try{return JSON.parse(e.data)}catch{return null}}function h5(e){var t;return e.content?e.content:((t=e.blocks)==null?void 0:t.filter(n=>n.type==="text").map(n=>n.text).join(""))??""}function p5(e){const[t,n]=j.useState([]),[i,r]=j.useState(!1),a=j.useRef(e),o=j.useRef(null),u=j.useRef(null),d=j.useRef(null),h=j.useRef(null),g=j.useRef(""),p=j.useRef(null);a.current=e;const y=j.useCallback(N=>{const k=N instanceof Error?N:new Error(String(N));r(!1),n(A=>[...A,{id:`error-${Date.now()}`,role:"error",content:k.message,status:"error"}]),a.current.onError(k)},[]),b=j.useCallback(N=>{if(u.current&&d.current)return d.current;const k=new EventSource(`/stream/chat/${encodeURIComponent(N)}`);return u.current=k,d.current=new Promise(A=>{let S=!1;const _=()=>{S||(S=!0,A())};k.addEventListener("open",_,{once:!0}),window.setTimeout(_,1500)}),k.addEventListener("chat.message.pending",(A=>{const S=tu(A);S!=null&&S.assistantId&&(h.current=S.assistantId)})),k.addEventListener("chat.message.snapshot",(A=>{var C;const S=tu(A);if(!(S!=null&&S.assistantId))return;const _=((C=S.blocks)==null?void 0:C.filter(T=>T.type==="text").map(T=>T.text).join(""))??"";_&&(h.current=S.assistantId,g.current=_,n(T=>Yg(T,S.assistantId,_,"streaming")),a.current.onAssistantChunk(_))})),k.addEventListener("chat.message.chunk.text",(A=>{const S=tu(A);!(S!=null&&S.assistantId)||!S.text||(h.current=S.assistantId,g.current+=S.text,n(_=>Yg(_,S.assistantId,g.current,"streaming")),a.current.onAssistantChunk(S.text))})),k.addEventListener("chat.message.complete",(A=>{const S=tu(A);if(!(S!=null&&S.message))return;const _=S.assistantId||S.message.id,C=h5(S.message)||g.current;if(h.current=_,g.current=C,S.message.role==="error"){p.current=_,n(T=>x_(T,{id:_,role:"error",content:C,status:"error"})),r(!1),a.current.onError(new Error(C));return}n(T=>Yg(T,_,C,"complete")),r(!1),a.current.onAssistantComplete(C)})),k.addEventListener("chat.message.error",(A=>{var C,T;const S=tu(A),_=(S==null?void 0:S.assistantId)??(S==null?void 0:S.turnId)??((C=S==null?void 0:S.message)==null?void 0:C.id);_&&p.current===_||y(new Error((S==null?void 0:S.error)??((T=S==null?void 0:S.message)==null?void 0:T.content)??"Voice response failed"))})),d.current},[y]),w=j.useCallback(async()=>{if(o.current)return o.current;const N=await ah({title:"Voice conversation"});return o.current=N.id,await b(N.id),N.id},[b]),v=j.useCallback(async N=>{const k=N.trim();if(!k||i)return;const A=`local-${Date.now()}`;n(S=>[...S,{id:A,role:"user",content:k,status:"complete"}]),r(!0),h.current=null,g.current="",p.current=null,a.current.onThinking();try{const S=await w();await b(S);const _=await b_(S,k);h.current=_.assistantId,n(C=>C.map(T=>T.id===A?{...T,id:_.user.id,content:_.user.content}:T))}catch(S){y(S)}},[b,w,y,i]);return j.useEffect(()=>()=>{var N;(N=u.current)==null||N.close(),u.current=null},[]),{isSending:i,messages:t,send:v}}function Yg(e,t,n,i){return x_(e,{id:t,role:"assistant",content:n,status:i})}function x_(e,t){const n=e.findIndex(i=>i.id===t.id);return n===-1?[...e,t]:e.map((i,r)=>r===n?t:i)}const m5=900;function g5({phase:e,inputAnalyser:t,outputAnalyser:n=null,outputText:i,thinkingConfig:r}){const a=j.useRef(null),o=j.useRef(e);return j.useEffect(()=>{var F;const u=a.current;if(!u)return;const d=u.getContext("2d");if(!d)return;const h=o.current;o.current=e;const g=performance.now(),p=((F=window.matchMedia)==null?void 0:F.call(window,"(prefers-reduced-motion: reduce)").matches)??!1,y=new Uint8Array(new ArrayBuffer((t==null?void 0:t.fftSize)??2048)),b=new Uint8Array(new ArrayBuffer((n==null?void 0:n.fftSize)??2048)),w=new Float32Array(256),v=new Float32Array(256);let N=0,k=0,A=0,S=1,_=0,C=0;const T=window.getComputedStyle(u),R={cyan:T.getPropertyValue("--voice-cyan").trim(),blue:T.getPropertyValue("--voice-blue").trim(),violet:T.getPropertyValue("--voice-violet").trim(),pink:T.getPropertyValue("--voice-pink").trim(),amber:T.getPropertyValue("--voice-amber").trim(),mint:T.getPropertyValue("--voice-mint").trim()},O=()=>{const U=u.getBoundingClientRect();S=Math.min(window.devicePixelRatio||1,2),k=Math.max(1,Math.round(U.width)),A=Math.max(1,Math.round(U.height)),u.width=Math.round(k*S),u.height=Math.round(A*S),d.setTransform(S,0,0,S,0,0)},B=U=>{const V=U/1e3,M=p?1:Math.min(1,(U-g)/m5),H=M*M*(3-2*M);iE(t,y,w),iE(n,b,v),_+=(sE(w)-_)*.08,C+=(sE(v)-C)*.08,d.clearRect(0,0,k,A),H<1&&h!==e&&rE(d,h,k,A,V,1-H,w,v,_,C,i,R,r),rE(d,e,k,A,V,H,w,v,_,C,i,R,r),p||(N=window.requestAnimationFrame(B))};O(),B(performance.now());const P=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>{O(),p&&B(performance.now())});return P==null||P.observe(u),window.addEventListener("resize",O),()=>{window.cancelAnimationFrame(N),P==null||P.disconnect(),window.removeEventListener("resize",O)}},[t,n,i,e,r]),c.jsx("canvas",{ref:a,className:"voice-canvas","aria-hidden":"true"})}function iE(e,t,n){if(!e){n.fill(0);return}e.getByteTimeDomainData(t);const i=t.length/n.length;for(let r=0;r<n.length;r+=1){const a=t[Math.min(t.length-1,Math.floor(r*i))]??128;n[r]=(a-128)/128}}function rE(e,t,n,i,r,a,o,u,d,h,g,p,y){t==="idle"&&y5(e,n,i,r,a,p),t==="listening"&&b5(e,n,i,r,a,o,d,p),t==="thinking"&&x5(e,n,i,r,a,p,y),t==="speaking"&&v5(e,n,i,r,a,u,h,g,p)}function y5(e,t,n,i,r,a){const o=[a.blue,a.violet];e.save(),e.globalCompositeOperation="screen",o.forEach((u,d)=>{e.beginPath();for(let h=0;h<=180;h+=1){const g=h/180,p=Math.sin(Math.PI*g),y=n/2+Math.sin(g*Math.PI*3+i*.42+d)*n*.018*p;h===0?e.moveTo(g*t,y):e.lineTo(g*t,y)}e.strokeStyle=u,e.lineWidth=2+d*2,e.globalAlpha=r*(.28+d*.08),e.shadowColor=u,e.shadowBlur=12,e.stroke()}),e.restore()}function b5(e,t,n,i,r,a,o,u){const d=[u.cyan,u.blue,u.violet,u.pink,u.mint];e.save(),e.globalCompositeOperation="screen",d.forEach((h,g)=>{w_(e,t,n,i,g,d.length,h,r,.12+o*.62,.7,p=>v_(a,p))}),e.restore()}function x5(e,t,n,i,r,a,o){const u=[a.pink,a.amber,a.violet,a.blue,a.cyan,a.mint],d=o.colors.length>0?o.colors:u,h=Math.min(8,Math.max(1,Math.round(o.count))),g=Array.from({length:h},(R,O)=>d[O%d.length]??a.violet),p=t/2,y=n/2,b=Math.min(t,n),w=Math.max(0,o.amplitude),v=Math.max(.2,o.waviness),N=Math.max(.1,o.scale),k=Math.max(0,o.saturation),A=Math.max(0,.4+o.intensity),S=`hue-rotate(${o.hueShift*360}deg) saturate(${k}) brightness(${A})`,_=Math.max(0,o.glow),C=_*(8+N*4),T=Math.min(.72,_*.16)*(.55+o.intensity*.45);e.save(),e.globalCompositeOperation="source-over",g.forEach((R,O)=>{const B=O%2===0?1:-1,P=i*Math.max(0,o.speed),F=P*(.72+O*.06)*B+O*(.92+o.spread*.2),U=O%3===0?-1:1,V=P*(1.5+O*.12)*U+O*.83,M=b*(.055+o.spread*.035+O%3*.01)*w,H=p+Math.cos(F*.78+O)*M,$=y+Math.sin(F*.66+O)*M*.72,K=b*(.14+o.thickness*.08+O%3*.012)*N,W=96,Y=Math.max(2,Math.min(8,Math.round(2+v))),I=Y+2,L=[];for(let he=0;he<W;he+=1){const se=he/W*Math.PI*2,J=1+Math.sin(se*Y+V)*w*.09+Math.cos(se*I-V*.74+O*.7)*w*.05;L.push({x:H+Math.cos(se+F)*K*J,y:$+Math.sin(se+F)*K*J*(.84+O%2*.07)})}const G=L[0],z=L[L.length-1];if(!G||!z)return;const te=F+O*.47,me=Math.cos(te)*K*1.15,ye=Math.sin(te)*K*1.15,Se=e.createLinearGradient(H-me,$-ye,H+me,$+ye),re=Math.max(1,d.length);for(let he=0;he<=re;he+=1){const se=d[(he+O)%d.length]??R;Se.addColorStop(he/re,se)}e.beginPath(),e.moveTo((z.x+G.x)/2,(z.y+G.y)/2);for(let he=0;he<L.length;he+=1){const se=L[he],J=L[(he+1)%L.length];!se||!J||e.quadraticCurveTo(se.x,se.y,(se.x+J.x)/2,(se.y+J.y)/2)}e.closePath(),C>0&&o.intensity>0&&[1.55,.72].forEach((he,se)=>{e.save(),e.globalCompositeOperation="screen",e.filter=`${S} blur(${C*he*(se===0?.58:.24)}px)`,e.fillStyle=Se,e.globalAlpha=r*o.opacity*T*(se===0?.72:.92),e.fill(),e.restore()}),e.save(),e.globalCompositeOperation="screen",e.filter=S,e.fillStyle=Se,e.globalAlpha=r*o.opacity*(.3+O%3*.025),e.fill(),e.restore()}),e.restore()}function v5(e,t,n,i,r,a,o,u,d){const h=[d.mint,d.cyan,d.blue,d.violet,d.pink],g=o>.006;e.save(),e.globalCompositeOperation="screen",h.forEach((p,y)=>{w_(e,t,n,i*.86,y,h.length,p,r,.34+o*.36,1.45,b=>g?v_(a,b):w5(u,b,i,y))}),e.restore()}function w5(e,t,n,i){const r=e||"SPS",a=(n*1.6+t*r.length*.72+i*.46)%r.length,o=r.charCodeAt(Math.floor(a))||83,u=.18+o%13/42,d=2.2+o%5*.16;return Math.sin(t*Math.PI*d-n*(.72+o%4*.08)+i*.74)*u}function sE(e){let t=0;for(const n of e)t+=n*n;return Math.min(1,Math.sqrt(t/e.length)*3.2)}function v_(e,t){const n=Math.round(t*(e.length-1));let i=0,r=0;for(let a=-6;a<=6;a+=1){const o=Math.max(0,Math.min(e.length-1,n+a));i+=e[o]??0,r+=1}return i/r}function w_(e,t,n,i,r,a,o,u,d,h,g){const y=[],b=[],w=r%2===0?1:-1,v=r*1.18+i*(.32+r*.018)*w;for(let k=0;k<=84;k+=1){const A=k/84,S=Math.pow(Math.sin(Math.PI*A),.42),_=Math.pow(Math.sin(Math.PI*A),.9),C=Math.sin(A*Math.PI*(2.2+r*.18)+v),T=Math.sin(A*Math.PI*1.25-v*.58+r)*.38,R=g(A)*n*(.02+d*.025);y.push(n/2+(r-(a-1)/2)*n*.013+(C+T)*n*(.038+d*.038)*h*S+R*S),b.push(n*(.05+r*.005)*(.9+d*.38)*(.88+Math.sin(A*Math.PI*2-v)*.12)*_)}e.beginPath(),y.forEach((k,A)=>{const S=A/84*t,_=k-(b[A]??0);A===0?e.moveTo(S,_):e.lineTo(S,_)});for(let k=84;k>=0;k-=1)e.lineTo(k/84*t,(y[k]??n/2)+(b[k]??0));e.closePath();const N=e.createLinearGradient(0,0,t,0);N.addColorStop(0,"transparent"),N.addColorStop(.1,o),N.addColorStop(.9,o),N.addColorStop(1,"transparent"),e.fillStyle=N,e.globalAlpha=u*(.22+r*.03),e.shadowColor=o,e.shadowBlur=28+r*4,e.fill()}const k5=[{id:"idle",labelKey:"home.phase.idle",icon:iL},{id:"listening",labelKey:"home.phase.listening",icon:uL},{id:"thinking",labelKey:"home.phase.thinking",icon:H3},{id:"speaking",labelKey:"home.phase.speaking",icon:$z}],Af=["#f97316","#7c3aed","#06b6d4"],du={idle:{colors:Af,count:6,speed:1,amplitude:.2,waviness:.8,thickness:.7,glow:1.5,taper:1.4,spread:.9,hueShift:0,intensity:.4,saturation:3,opacity:1,scale:2},listening:{colors:Af,count:6,speed:1.7,amplitude:1.4,waviness:1.1,thickness:.75,glow:4.2,taper:1.4,spread:1.7,hueShift:0,intensity:.8,saturation:3,opacity:1,scale:2.1},thinking:{colors:Af,count:6,speed:1.5,amplitude:1.2,waviness:1.5,thickness:.8,glow:4,taper:4.7,spread:2,hueShift:0,intensity:.9,saturation:3,opacity:1,scale:1.6},speaking:{colors:Af,count:6,speed:1.5,amplitude:2.3,waviness:2.5,thickness:1.4,glow:4,taper:1.6,spread:2,hueShift:0,intensity:.9,saturation:3,opacity:1,scale:2.35}},E5=[{key:"count",labelKey:"home.customize.count",min:1,max:8,step:1},{key:"speed",labelKey:"home.customize.speed",min:0,max:2,step:.05},{key:"amplitude",labelKey:"home.customize.amplitude",min:0,max:2.5,step:.05},{key:"waviness",labelKey:"home.customize.waviness",min:.2,max:3,step:.05},{key:"thickness",labelKey:"home.customize.thickness",min:.1,max:1.5,step:.05},{key:"glow",labelKey:"home.customize.glow",min:0,max:5,step:.1},{key:"taper",labelKey:"home.customize.taper",min:.2,max:6,step:.1},{key:"spread",labelKey:"home.customize.spread",min:0,max:2.5,step:.05},{key:"hueShift",labelKey:"home.customize.hueShift",min:0,max:1,step:.01},{key:"intensity",labelKey:"home.customize.intensity",min:0,max:1,step:.05},{key:"saturation",labelKey:"home.customize.saturation",min:0,max:3,step:.05},{key:"opacity",labelKey:"home.customize.opacity",min:0,max:1,step:.05},{key:"scale",labelKey:"home.customize.scale",min:.5,max:2.5,step:.05}];function fu(e){return{...e,colors:[...e.colors]}}function S5(){return{idle:fu(du.idle),listening:fu(du.listening),thinking:fu(du.thinking),speaking:fu(du.speaking)}}function N5(e,t){e.getByteTimeDomainData(t);let n=0;for(const i of t){const r=(i-128)/128;n+=r*r}return Math.min(1,Math.sqrt(n/t.length)*3.4)}function _5(e){return e.replace(/```[\s\S]*?```/g,"").replace(/[`*_>#\[\]()]/g,"").replace(/\s+/g," ").trim()}function j5({outputAnalyser:e=null}){var I;const t=Ie(),[n,i]=j.useState("idle"),[r,a]=j.useState("idle"),[o,u]=j.useState(!1),[d,h]=j.useState(""),[g,p]=j.useState(S5),y=j.useRef(null),b=j.useRef(null),w=j.useRef(0),v=j.useRef(0),N=j.useRef(0),k=j.useRef(""),A=j.useRef(!1),S=j.useRef(!1),_=l5(),C=g[n],T=g[r],R=L=>{L===v.current&&A.current&&N.current===0&&i("idle")},O=L=>{const G=_5(L);if(!G||typeof window>"u"||!window.speechSynthesis)return;const z=v.current,te=new SpeechSynthesisUtterance(G);te.lang=navigator.language||"zh-CN",te.rate=1,N.current+=1;const me=()=>{z===v.current&&(N.current=Math.max(0,N.current-1),R(z))};te.onend=me,te.onerror=me,window.speechSynthesis.speak(te)},B=L=>{k.current+=L;let G=k.current.match(/^([\s\S]*?[。!?.!?])([\s\S]*)$/);for(;G;)O(G[1]??""),k.current=G[2]??"",G=k.current.match(/^([\s\S]*?[。!?.!?])([\s\S]*)$/)},P=()=>{var L;v.current+=1,N.current=0,k.current="",A.current=!1,(L=window.speechSynthesis)==null||L.cancel()},F=p5({onAssistantChunk:L=>{S.current=!0,i("speaking"),B(L)},onAssistantComplete:L=>{A.current=!0,S.current?k.current.trim()&&O(k.current):O(L),k.current="",R(v.current)},onError:()=>{h(t("home.error.response")),i("idle")},onThinking:()=>{P(),S.current=!1,h(""),i("thinking")}}),U=a5({onComplete:L=>{_.stop(),F.send(L)},onError:L=>{_.stop(),h(t(L==="unsupported"?"home.error.recognitionUnsupported":"home.error.recognition")),i("idle")}}),V=()=>{n!=="idle"||F.isSending||(h(""),P(),U.start()&&(i("listening"),_.start()))},M=()=>{n==="listening"?U.stop():V()};j.useEffect(()=>{var ye;const L=y.current;if(!L)return;if(((ye=window.matchMedia)==null?void 0:ye.call(window,"(prefers-reduced-motion: reduce)").matches)??!1){L.style.setProperty("--voice-activity","0"),L.style.setProperty("--voice-scale","1");return}let z=0,te=new Uint8Array(new ArrayBuffer(2048));const me=Se=>{const re=n==="listening"?_.analyser:n==="speaking"?e:null;re&&te.length!==re.fftSize&&(te=new Uint8Array(new ArrayBuffer(re.fftSize)));let he=re?N5(re,te):0;if(!re&&n==="speaking"){const J=Se/1e3;he=.16+(.5+Math.sin(J*6.8)*.5)*.34+(.5+Math.sin(J*11.4+1.2)*.5)*.16}const se=he>w.current?.16:.065;w.current+=(he-w.current)*se,L.style.setProperty("--voice-scale",(1+w.current*.065).toFixed(4)),L.style.setProperty("--voice-activity",w.current.toFixed(3)),z=window.requestAnimationFrame(me)};return z=window.requestAnimationFrame(me),()=>window.cancelAnimationFrame(z)},[_.analyser,e,n]),j.useEffect(()=>{const L=b.current;L&&(typeof L.scrollTo=="function"?L.scrollTo({top:L.scrollHeight,behavior:"smooth"}):L.scrollTop=L.scrollHeight)},[n,U.transcript,F.messages]),j.useEffect(()=>{if(!o)return;const L=G=>{G.key==="Escape"&&u(!1)};return window.addEventListener("keydown",L),()=>window.removeEventListener("keydown",L)},[o]),j.useEffect(()=>()=>{P(),_.stop()},[]);const H=j.useMemo(()=>({amplitude:C.amplitude,colors:C.colors,count:C.count,glow:C.glow,hueShift:C.hueShift,intensity:C.intensity,opacity:C.opacity,saturation:C.saturation,scale:C.scale,speed:C.speed,spread:C.spread,thickness:C.thickness,waviness:C.waviness}),[C]),$=(L,G)=>{if(!Number.isFinite(G))return;const z=Math.min(L.max,Math.max(L.min,G));p(te=>({...te,[r]:{...te[r],[L.key]:z}}))},K=(L,G)=>{p(z=>{const te=[...z[r].colors];return te[L]=G,{...z,[r]:{...z[r],colors:te}}})},W=((I=[...F.messages].reverse().find(L=>L.role==="assistant"))==null?void 0:I.content)??"",Y=n==="listening"&&_.status==="requesting"?t("home.mic.requesting"):t(`home.phase.${n}`);return c.jsxs("section",{className:"voice-home","aria-labelledby":"voice-home-title",children:[c.jsxs("header",{className:"voice-home-header",children:[c.jsxs("div",{children:[c.jsx("h1",{id:"voice-home-title",children:t("home.conversation.title")}),c.jsx("p",{children:t("home.conversation.subtitle")})]}),c.jsxs("div",{className:"voice-header-actions",children:[c.jsxs("span",{className:"voice-live-status","data-phase":n,children:[c.jsx("span",{"aria-hidden":"true"}),Y]}),c.jsxs("button",{type:"button",className:"nb-btn",onClick:()=>{a(n),u(!0)},children:[c.jsx(Lk,{size:15,strokeWidth:2.2,"aria-hidden":"true"}),t("home.debug.open")]})]})]}),c.jsxs("div",{className:"voice-conversation","data-phase":n,children:[c.jsxs("div",{ref:b,className:"voice-message-stream","aria-live":"polite",children:[F.messages.length===0&&n==="idle"&&c.jsxs("div",{className:"voice-empty-state",children:[c.jsx(Rk,{size:18,strokeWidth:2,"aria-hidden":"true"}),c.jsx("p",{children:t("home.conversation.empty")})]}),F.messages.map(L=>c.jsxs("article",{className:`voice-message voice-message-${L.role}`,"data-streaming":L.status==="streaming",children:[c.jsx("span",{children:L.role==="user"?t("home.conversation.you"):t("home.conversation.ai")}),c.jsx("p",{children:L.content})]},L.id)),n==="listening"&&c.jsxs("article",{className:"voice-message voice-message-user voice-message-live",children:[c.jsx("span",{children:t("home.conversation.you")}),c.jsx("p",{children:U.transcript||t("home.conversation.listening")})]}),n==="thinking"&&c.jsxs("article",{className:"voice-message voice-message-assistant voice-message-thinking",children:[c.jsx("span",{children:t("home.conversation.ai")}),c.jsxs("p",{children:[t("home.conversation.thinking"),c.jsx("i",{"aria-hidden":"true"})]})]})]}),c.jsxs("div",{className:"voice-dock",children:[d&&c.jsx("p",{className:"voice-error",role:"alert",children:d}),c.jsx("button",{type:"button",className:"voice-orb-button",disabled:n==="thinking"||n==="speaking","aria-label":t(n==="listening"?"home.voice.stop":"home.voice.start"),"aria-pressed":n==="listening",onClick:M,children:c.jsxs("div",{ref:y,className:"voice-flow-glass","data-phase":n,"aria-label":t("home.visualizer.aria"),children:[c.jsx(g5,{phase:n,inputAnalyser:_.analyser,outputText:W||t("home.message.speaking"),thinkingConfig:H}),c.jsx(r5,{active:n!=="thinking",activityLevelRef:w,activityAnalyser:n==="listening"?_.analyser:n==="speaking"?e:null,amplitude:C.amplitude,className:"voice-active-strands",colors:C.colors,count:C.count,glow:C.glow,hueShift:C.hueShift,intensity:C.intensity,opacity:C.opacity,saturation:C.saturation,scale:C.scale,speed:C.speed,spread:C.spread,taper:C.taper,thickness:C.thickness,waviness:C.waviness}),c.jsx("span",{className:"voice-orb-icon","aria-hidden":"true",children:c.jsx(Rk,{size:18,strokeWidth:2.2})})]})}),c.jsx("p",{className:"voice-dock-label",children:t(n==="listening"?"home.voice.finish":`home.voice.${n}`)})]})]}),o&&c.jsx("div",{className:"voice-debug-backdrop",role:"presentation",onMouseDown:L=>{L.target===L.currentTarget&&u(!1)},children:c.jsxs("section",{className:"voice-debug-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"voice-debug-title",children:[c.jsxs("header",{className:"voice-debug-header",children:[c.jsxs("div",{children:[c.jsx(Lk,{size:16,strokeWidth:2.2,"aria-hidden":"true"}),c.jsx("h2",{id:"voice-debug-title",children:t("home.customize.title")})]}),c.jsxs("div",{children:[c.jsx("button",{type:"button","aria-label":t("home.customize.reset"),title:t("home.customize.reset"),onClick:()=>p(L=>({...L,[r]:fu(du[r])})),children:c.jsx(ep,{size:15,strokeWidth:2.2,"aria-hidden":"true"})}),c.jsx("button",{type:"button","aria-label":t("home.debug.close"),title:t("home.debug.close"),onClick:()=>u(!1),children:c.jsx(Jt,{size:16,strokeWidth:2.2,"aria-hidden":"true"})})]})]}),c.jsx("div",{className:"voice-debug-phases",role:"group","aria-label":t("home.phase.aria"),children:k5.map(L=>{const G=L.icon;return c.jsxs("button",{type:"button","aria-pressed":r===L.id,onClick:()=>a(L.id),children:[c.jsx(G,{size:15,strokeWidth:2.2,"aria-hidden":"true"}),t(L.labelKey)]},L.id)})}),c.jsxs("div",{className:"voice-debug-body",children:[c.jsxs("fieldset",{className:"voice-customizer-group",children:[c.jsx("legend",{children:t("home.customize.colors")}),T.colors.map((L,G)=>c.jsxs("label",{className:"voice-color-control",children:[c.jsx("span",{children:t(`home.customize.color${G+1}`)}),c.jsx("input",{type:"color",value:L,onChange:z=>K(G,z.target.value)}),c.jsx("code",{children:L.toUpperCase()})]},G))]}),c.jsxs("fieldset",{className:"voice-customizer-group",children:[c.jsx("legend",{children:t("home.customize.parameters")}),E5.map(L=>{const G=t(L.labelKey),z=T[L.key];return c.jsxs("label",{className:"voice-parameter-control",children:[c.jsx("span",{children:G}),c.jsx("input",{type:"number",min:L.min,max:L.max,step:L.step,value:z,"aria-label":`${G} value`,onChange:te=>$(L,Number(te.target.value))}),c.jsx("input",{type:"range",min:L.min,max:L.max,step:L.step,value:z,"aria-label":G,onChange:te=>$(L,Number(te.target.value))})]},L.key)})]})]})]})})]})}function fx(e,t){const[n,i]=j.useState(()=>{try{const r=localStorage.getItem(e);return r!==null?JSON.parse(r):t}catch{return t}});return j.useEffect(()=>{try{localStorage.setItem(e,JSON.stringify(n))}catch{}},[e,n]),[n,i]}const Tf=e=>e.lastActivityAt?Date.parse(e.lastActivityAt):0;function k_(e,t){const n=[...e];return t==="name"?n.sort((i,r)=>i.name.localeCompare(r.name)):t==="date"?n.sort((i,r)=>Tf(r)-Tf(i)):n.sort((i,r)=>{const a=i.pipelineStatus==="running"?1:0,o=r.pipelineStatus==="running"?1:0;return a!==o?o-a:Tf(r)-Tf(i)})}function C5(e,t,n=7){const i=Date.now()-n*864e5,r=[],a=[];for(const o of e){const u=t(o);((u?Date.parse(u):0)>=i?r:a).push(o)}return{recent:r,older:a}}function A5(e){const t=new URLSearchParams;return e.project&&t.set("project",e.project),e.worker&&t.set("worker",e.worker),t.set("limit",String(e.limit)),e.since&&t.set("since",e.since),e.file&&t.set("file",e.file),ct(`/api/logs?${t}`)}function T5(e){return ct(`/api/logs/sources?project=${encodeURIComponent(e)}`)}const M5=["error","warn","info","debug"],D5=["error","warn","info"];function O5({project:e,initialWorker:t}){const n=Ie(),i=t??"",[r,a]=j.useState([]),[o,u]=j.useState(!1),[d,h]=j.useState(!0),[g,p]=j.useState(()=>new Set(D5)),[y,b]=j.useState(""),[w,v]=j.useState("live"),[N,k]=j.useState(()=>{const U=new Date(Date.now()-36e5),V=M=>String(M).padStart(2,"0");return`${U.getFullYear()}-${V(U.getMonth()+1)}-${V(U.getDate())}T${V(U.getHours())}:${V(U.getMinutes())}`}),A=j.useRef(null),[S,_]=j.useState(""),{data:C}=Ve({queryKey:["log-sources",e],queryFn:()=>T5(e),enabled:!!e,refetchInterval:5e3}),T=j.useMemo(()=>(C==null?void 0:C.sources)??[],[C]),R=T.find(U=>U.key===S)??(i?T.find(U=>U.worker===Number(i)):void 0)??T.find(U=>U.kind==="pipeline")??T[0],O=R==null?void 0:R.file;j.useEffect(()=>{a([])},[e,O]);const{data:B,refetch:P}=Ve({queryKey:["logs",e,O,w,w==="history"?N:"live"],queryFn:()=>A5({project:e,file:O,limit:w==="history"?2e3:500,since:w==="history"?new Date(N).toISOString():void 0}),enabled:!!e,refetchInterval:w==="live"&&!o?2500:!1});j.useEffect(()=>{B!=null&&B.data&&a(B.data)},[B]),j.useEffect(()=>{if(!d)return;const U=A.current;U&&(U.scrollTop=U.scrollHeight)},[r,d]);const F=j.useMemo(()=>{const U=y.toLowerCase();return r.filter(V=>!(!g.has(V.level)||U&&!V.msg.toLowerCase().includes(U)))},[r,g,y]);return c.jsxs("div",{className:"flex h-full min-h-0 max-w-full flex-col gap-3",children:[T.length>0&&c.jsxs("div",{className:"flex shrink-0 items-center gap-1.5 flex-wrap",children:[T.filter(U=>U.worker==null).map(U=>c.jsx(aE,{s:U,active:(R==null?void 0:R.key)===U.key,onClick:()=>_(U.key)},U.key)),c.jsx("div",{className:"ml-auto flex items-center gap-1.5 flex-wrap",children:T.filter(U=>U.worker!=null).map(U=>c.jsx(aE,{s:U,active:(R==null?void 0:R.key)===U.key,onClick:()=>_(U.key)},U.key))})]}),c.jsxs("div",{className:"flex shrink-0 items-center gap-2 flex-wrap",children:[c.jsxs("div",{className:"flex gap-1 p-1 bg-[var(--color-bg)] border-[2px] border-[var(--color-text)] rounded-full shadow-[2px_2px_0_var(--color-text)]",children:[c.jsxs("button",{type:"button",onClick:()=>v("live"),"aria-pressed":w==="live",className:["px-3 py-1 rounded-full text-xs font-bold flex items-center gap-1.5",w==="live"?"bg-[var(--color-primary)] text-[var(--color-text)] shadow-[1px_1px_0_var(--color-text)]":"text-[var(--color-text-muted)]"].join(" "),children:[c.jsx(Z2,{size:11,strokeWidth:2.5}),n("logs.mode.live")]}),c.jsxs("button",{type:"button",onClick:()=>v("history"),"aria-pressed":w==="history",className:["px-3 py-1 rounded-full text-xs font-bold flex items-center gap-1.5",w==="history"?"bg-[var(--color-primary)] text-[var(--color-text)] shadow-[1px_1px_0_var(--color-text)]":"text-[var(--color-text-muted)]"].join(" "),children:[c.jsx(RL,{size:11,strokeWidth:2.5}),n("logs.mode.history")]})]}),w==="history"&&c.jsxs(c.Fragment,{children:[c.jsx("input",{type:"datetime-local",className:"nb-input",style:{padding:"4px 8px",fontSize:12},value:N,onChange:U=>k(U.target.value),"aria-label":n("logs.history.startAria")}),c.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"6px 12px",fontSize:12},onClick:()=>P(),type:"button","aria-label":n("logs.history.queryAria"),children:[c.jsx(fl,{size:11,strokeWidth:3}),n("logs.history.query")]})]}),c.jsxs("div",{className:"relative flex-1 max-w-md",children:[c.jsx(fl,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-[var(--color-text-subtle)]"}),c.jsx("input",{className:"nb-input pl-9 w-full",placeholder:n("logs.filter.keyword.placeholder"),value:y,onChange:U=>b(U.target.value),"aria-label":n("logs.filter.keyword.aria")})]}),c.jsx("div",{className:"flex items-center gap-1 p-1 bg-[var(--color-bg)] border-[2px] border-[var(--color-text)] rounded-full shadow-[2px_2px_0_var(--color-text)]",children:M5.map(U=>c.jsx(R5,{level:U,enabled:g.has(U),onToggle:()=>{p(V=>{const M=new Set(V);return M.has(U)?M.delete(U):M.add(U),M})}},U))}),c.jsxs("div",{className:"ml-auto flex gap-2",children:[w==="live"&&c.jsxs(c.Fragment,{children:[c.jsx("button",{className:"nb-btn",style:{padding:"6px 12px",fontSize:12},onClick:()=>h(U=>!U),type:"button",children:d?"✓ Auto-scroll":"Auto-scroll"}),c.jsx("button",{className:"nb-btn",style:{padding:"6px 12px",fontSize:12},onClick:()=>u(U=>!U),type:"button",children:o?c.jsxs(c.Fragment,{children:[c.jsx(td,{size:12,strokeWidth:3})," Resume"]}):c.jsxs(c.Fragment,{children:[c.jsx(rz,{size:12,strokeWidth:3})," Pause"]})})]}),c.jsxs("button",{className:"nb-btn",style:{padding:"6px 12px",fontSize:12},onClick:()=>{const U=new Blob([F.map(H=>H.raw).join(`
|
|
604
|
+
`)],{type:"text/plain"}),V=URL.createObjectURL(U),M=document.createElement("a");M.href=V,M.download=`${e}-log-${Date.now()}.log`,M.click(),URL.revokeObjectURL(V)},type:"button",children:[c.jsx(Zh,{size:12,strokeWidth:2.5})," Export"]})]})]}),c.jsxs("div",{className:"scroll-frame flex min-h-0 flex-1 flex-col rounded-lg border-2 border-[var(--color-border-light)] bg-[var(--color-bg-cream)]",children:[c.jsxs("div",{className:"px-4 bg-surface-soft bg-color-bg-soft py-2 bg-[var(--color-bg-cream)] border-b-2 border-[var(--color-border-light)] flex shrink-0 items-center justify-between font-[family-name:var(--font-mono)] text-xs",children:[c.jsxs("span",{className:"text-[var(--color-text-muted)]",children:[(B==null?void 0:B.file)??`~/.coral/projects/${e}/logs/*.log`," · ",r.length," lines",o&&c.jsx("span",{className:"text-[var(--color-stuck)] ml-2 font-bold",children:n("logs.paused")})]}),w==="live"?c.jsx("span",{className:"nb-status",style:{background:"var(--color-running-bg)",color:"var(--color-running)"},children:"live"}):c.jsx("span",{className:"nb-status",style:{background:"var(--color-accent-purple)",color:"var(--color-text)"},children:"history"})]}),c.jsxs("div",{ref:A,className:"scroll-frame-body flex-1 bg-surface-input font-[family-name:var(--font-mono)] text-[12px] leading-[22px] p-2",onScroll:U=>{const V=U.currentTarget;!(V.scrollHeight-V.scrollTop-V.clientHeight<40)&&d&&h(!1)},children:[F.map((U,V)=>c.jsx(L5,{line:U},V)),F.length===0&&c.jsx("div",{className:"text-center py-12 text-[var(--color-text-subtle)]",children:n("logs.empty.match")})]})]})]})}function R5({level:e,enabled:t,onToggle:n}){const i={error:"var(--color-crashed-bg)",warn:"var(--color-stuck-bg)",info:"var(--color-secondary)",debug:"var(--color-accent-purple)"},r={error:"var(--color-crashed)",warn:"var(--color-stuck)",info:"var(--color-text)",debug:"var(--color-text)"};return c.jsx("button",{type:"button",onClick:n,"aria-pressed":t,className:["px-3 py-0.5 rounded-full font-[family-name:var(--font-mono)] text-[10px] font-bold tracking-widest cursor-pointer",t?"border-[1.5px] border-[var(--color-text)]":"text-[var(--color-text-subtle)]"].join(" "),style:t?{background:i[e],color:r[e]}:{},children:e.toUpperCase()})}function L5({line:e}){var n;const t={error:"bg-[var(--color-crashed)] text-[var(--color-text)]",warn:"bg-[var(--color-stuck)] text-[var(--color-text)]",info:"bg-[var(--color-secondary)] text-[var(--color-text)]",debug:"",trace:""};return c.jsxs("div",{className:"grid gap-2 px-2 py-0.5 rounded hover:bg-[var(--color-bg-cream)] grid-cols-[100px_60px_1fr]",children:[c.jsx("span",{className:"text-[var(--color-text-subtle)] whitespace-nowrap",children:e.ts?((n=e.ts.split("T")[1])==null?void 0:n.replace("Z",""))??e.ts:"--"}),c.jsx("span",{className:`text-center font-bold ${t[e.level]??""}`,style:{borderRadius:4,padding:"0 6px"},children:e.level.toUpperCase()}),c.jsx("span",{className:"truncate text-[var(--color-text)]",children:e.msg})]})}function aE({s:e,active:t,onClick:n}){const i=e.status==="running"?"#22c55e":e.status==="error"?"#ef4444":"#9ca3af";return c.jsxs("button",{type:"button",onClick:n,"aria-pressed":t,"aria-label":`查看${e.label}日志`,className:["px-2.5 py-1 rounded-full text-xs font-bold border-[2px] border-[var(--color-text)] flex items-center gap-1.5",t?"bg-[var(--color-primary)] text-[var(--color-text)] shadow-[1px_1px_0_var(--color-text)]":"bg-white text-[var(--color-text-muted)] hover:-translate-y-px"].join(" "),children:[e.worker!=null&&c.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:i,display:"inline-block"},"aria-hidden":!0}),e.label]})}function z5({title:e,body:t,confirm:n,cancel:i,onConfirm:r,onCancel:a,danger:o}){const u=Ie();return j.useEffect(()=>{const d=h=>{h.key==="Escape"&&a()};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[a]),c.jsx("div",{role:"dialog","aria-modal":"true","aria-labelledby":"confirm-title",className:"fixed inset-0 z-50 flex items-center justify-center p-6 bg-black/30",children:c.jsxs("div",{className:"nb-card max-w-md w-full",children:[c.jsx("h2",{id:"confirm-title",className:"font-[family-name:var(--font-heading)] text-xl font-bold mb-2",children:e}),c.jsx("p",{className:"text-sm text-[var(--color-text-muted)] mb-5",children:t}),c.jsxs("div",{className:"flex gap-3 justify-end",children:[c.jsx("button",{className:"nb-btn",onClick:a,type:"button",children:i??u("dialog.cancel.default")}),c.jsx("button",{className:o?"nb-btn nb-btn-danger":"nb-btn nb-btn-yellow",onClick:async()=>{await r()},type:"button",children:n})]})]})})}const E_=j.createContext(null);function I5({children:e}){const t=Ie(),[n,i]=j.useState(null),r=j.useCallback(u=>new Promise(d=>{i({kind:"confirm",opts:u,resolve:h=>{i(null),d(h)}})}),[]),a=j.useCallback(u=>new Promise(d=>{i({kind:"alert",opts:u,resolve:()=>{i(null),d()}})}),[]),o=j.useCallback(u=>new Promise(d=>{i({kind:"prompt",opts:u,resolve:h=>{i(null),d(h)}})}),[]);return c.jsxs(E_.Provider,{value:{confirm:r,alert:a,prompt:o},children:[e,(n==null?void 0:n.kind)==="confirm"&&c.jsx(z5,{title:n.opts.title,body:n.opts.body,confirm:n.opts.confirm??t("dialog.confirm.default"),cancel:n.opts.cancel,danger:n.opts.danger,onConfirm:()=>n.resolve(!0),onCancel:()=>n.resolve(!1)}),(n==null?void 0:n.kind)==="alert"&&c.jsx(P5,{title:n.opts.title,body:n.opts.body,confirm:n.opts.confirm??t("dialog.alert.default"),onClose:()=>n.resolve()}),(n==null?void 0:n.kind)==="prompt"&&c.jsx(B5,{title:n.opts.title,body:n.opts.body,placeholder:n.opts.placeholder,defaultValue:n.opts.defaultValue,confirm:n.opts.confirm??t("dialog.confirm.default"),cancel:n.opts.cancel??t("dialog.cancel.default"),onConfirm:u=>n.resolve(u),onCancel:()=>n.resolve(null)})]})}function dn(){const e=j.useContext(E_);if(!e)throw new Error("useDialog must be used inside <DialogProvider>");return e}function P5({title:e,body:t,confirm:n,onClose:i}){return j.useEffect(()=>{const r=a=>{(a.key==="Escape"||a.key==="Enter")&&i()};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[i]),c.jsx("div",{role:"dialog","aria-modal":"true",className:"fixed inset-0 z-50 flex items-center justify-center p-6 bg-black/30",children:c.jsxs("div",{className:"nb-card max-w-md w-full",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold mb-2",children:e}),c.jsx("p",{className:"text-sm text-[var(--color-text-muted)] mb-5 whitespace-pre-wrap break-words",children:t}),c.jsx("div",{className:"flex gap-3 justify-end",children:c.jsx("button",{className:"nb-btn nb-btn-primary",onClick:i,type:"button",autoFocus:!0,children:n})})]})})}function B5({title:e,body:t,placeholder:n,defaultValue:i,confirm:r,cancel:a,onConfirm:o,onCancel:u}){const[d,h]=j.useState(i??""),g=j.useRef(null);j.useEffect(()=>{var b,w;(b=g.current)==null||b.focus(),(w=g.current)==null||w.select();const y=v=>{v.key==="Escape"&&u()};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[u]);const p=()=>{const y=d.trim();y&&o(y)};return c.jsx("div",{role:"dialog","aria-modal":"true",className:"fixed inset-0 z-50 flex items-center justify-center p-6 bg-black/30",children:c.jsxs("div",{className:"nb-card max-w-md w-full",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold mb-2",children:e}),t&&c.jsx("p",{className:"text-sm text-[var(--color-text-muted)] mb-3 whitespace-pre-wrap break-words",children:t}),c.jsx("input",{ref:g,type:"text",className:"nb-input w-full mb-5",placeholder:n,value:d,onChange:y=>h(y.target.value),onKeyDown:y=>{y.key==="Enter"&&!y.nativeEvent.isComposing&&(y.preventDefault(),p())}}),c.jsxs("div",{className:"flex gap-3 justify-end",children:[c.jsx("button",{className:"nb-btn",onClick:u,type:"button",children:a}),c.jsx("button",{className:"nb-btn nb-btn-primary",onClick:p,type:"button",disabled:!d.trim(),children:r})]})]})})}const hx=Symbol.for("yaml.alias"),cb=Symbol.for("yaml.document"),va=Symbol.for("yaml.map"),S_=Symbol.for("yaml.pair"),Lr=Symbol.for("yaml.scalar"),ec=Symbol.for("yaml.seq"),Gi=Symbol.for("yaml.node.type"),Sa=e=>!!e&&typeof e=="object"&&e[Gi]===hx,kl=e=>!!e&&typeof e=="object"&&e[Gi]===cb,tc=e=>!!e&&typeof e=="object"&&e[Gi]===va,en=e=>!!e&&typeof e=="object"&&e[Gi]===S_,Gt=e=>!!e&&typeof e=="object"&&e[Gi]===Lr,nc=e=>!!e&&typeof e=="object"&&e[Gi]===ec;function on(e){if(e&&typeof e=="object")switch(e[Gi]){case va:case ec:return!0}return!1}function un(e){if(e&&typeof e=="object")switch(e[Gi]){case hx:case va:case Lr:case ec:return!0}return!1}const N_=e=>(Gt(e)||on(e))&&!!e.anchor,fi=Symbol("break visit"),__=Symbol("skip children"),Or=Symbol("remove node");function El(e,t){const n=j_(t);kl(e)?yo(null,e.contents,n,Object.freeze([e]))===Or&&(e.contents=null):yo(null,e,n,Object.freeze([]))}El.BREAK=fi;El.SKIP=__;El.REMOVE=Or;function yo(e,t,n,i){const r=C_(e,t,n,i);if(un(r)||en(r))return A_(e,i,r),yo(e,r,n,i);if(typeof r!="symbol"){if(on(t)){i=Object.freeze(i.concat(t));for(let a=0;a<t.items.length;++a){const o=yo(a,t.items[a],n,i);if(typeof o=="number")a=o-1;else{if(o===fi)return fi;o===Or&&(t.items.splice(a,1),a-=1)}}}else if(en(t)){i=Object.freeze(i.concat(t));const a=yo("key",t.key,n,i);if(a===fi)return fi;a===Or&&(t.key=null);const o=yo("value",t.value,n,i);if(o===fi)return fi;o===Or&&(t.value=null)}}return r}async function tp(e,t){const n=j_(t);kl(e)?await bo(null,e.contents,n,Object.freeze([e]))===Or&&(e.contents=null):await bo(null,e,n,Object.freeze([]))}tp.BREAK=fi;tp.SKIP=__;tp.REMOVE=Or;async function bo(e,t,n,i){const r=await C_(e,t,n,i);if(un(r)||en(r))return A_(e,i,r),bo(e,r,n,i);if(typeof r!="symbol"){if(on(t)){i=Object.freeze(i.concat(t));for(let a=0;a<t.items.length;++a){const o=await bo(a,t.items[a],n,i);if(typeof o=="number")a=o-1;else{if(o===fi)return fi;o===Or&&(t.items.splice(a,1),a-=1)}}}else if(en(t)){i=Object.freeze(i.concat(t));const a=await bo("key",t.key,n,i);if(a===fi)return fi;a===Or&&(t.key=null);const o=await bo("value",t.value,n,i);if(o===fi)return fi;o===Or&&(t.value=null)}}return r}function j_(e){return typeof e=="object"&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function C_(e,t,n,i){var r,a,o,u,d;if(typeof n=="function")return n(e,t,i);if(tc(t))return(r=n.Map)==null?void 0:r.call(n,e,t,i);if(nc(t))return(a=n.Seq)==null?void 0:a.call(n,e,t,i);if(en(t))return(o=n.Pair)==null?void 0:o.call(n,e,t,i);if(Gt(t))return(u=n.Scalar)==null?void 0:u.call(n,e,t,i);if(Sa(t))return(d=n.Alias)==null?void 0:d.call(n,e,t,i)}function A_(e,t,n){const i=t[t.length-1];if(on(i))i.items[e]=n;else if(en(i))e==="key"?i.key=n:i.value=n;else if(kl(i))i.contents=n;else{const r=Sa(i)?"alias":"scalar";throw new Error(`Cannot replace node with ${r} parent`)}}const $5={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},U5=e=>e.replace(/[!,[\]{}]/g,t=>$5[t]);class ti{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},ti.defaultYaml,t),this.tags=Object.assign({},ti.defaultTags,n)}clone(){const t=new ti(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new ti(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:ti.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},ti.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:ti.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},ti.defaultTags),this.atNextDocument=!1);const i=t.trim().split(/[ \t]+/),r=i.shift();switch(r){case"%TAG":{if(i.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),i.length<2))return!1;const[a,o]=i;return this.tags[a]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,i.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[a]=i;if(a==="1.1"||a==="1.2")return this.yaml.version=a,!0;{const o=/^\d+\.\d+$/.test(a);return n(6,`Unsupported YAML version ${a}`,o),!1}}default:return n(0,`Unknown directive ${r}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const o=t.slice(2,-1);return o==="!"||o==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),o)}const[,i,r]=t.match(/^(.*!)([^!]*)$/s);r||n(`The ${t} tag has no suffix`);const a=this.tags[i];if(a)try{return a+decodeURIComponent(r)}catch(o){return n(String(o)),null}return i==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[n,i]of Object.entries(this.tags))if(t.startsWith(i))return n+U5(t.substring(i.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],i=Object.entries(this.tags);let r;if(t&&i.length>0&&un(t.contents)){const a={};El(t.contents,(o,u)=>{un(u)&&u.tag&&(a[u.tag]=!0)}),r=Object.keys(a)}else r=[];for(const[a,o]of i)a==="!!"&&o==="tag:yaml.org,2002:"||(!t||r.some(u=>u.startsWith(o)))&&n.push(`%TAG ${a} ${o}`);return n.join(`
|
|
605
|
+
`)}}ti.defaultYaml={explicit:!1,version:"1.2"};ti.defaultTags={"!!":"tag:yaml.org,2002:"};function T_(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(n)}return!0}function M_(e){const t=new Set;return El(e,{Value(n,i){i.anchor&&t.add(i.anchor)}}),t}function D_(e,t){for(let n=1;;++n){const i=`${e}${n}`;if(!t.has(i))return i}}function F5(e,t){const n=[],i=new Map;let r=null;return{onAnchor:a=>{n.push(a),r??(r=M_(e));const o=D_(t,r);return r.add(o),o},setAnchors:()=>{for(const a of n){const o=i.get(a);if(typeof o=="object"&&o.anchor&&(Gt(o.node)||on(o.node)))o.node.anchor=o.anchor;else{const u=new Error("Failed to resolve repeated object (this should not happen)");throw u.source=a,u}}},sourceObjects:i}}function xo(e,t,n,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let r=0,a=i.length;r<a;++r){const o=i[r],u=xo(e,i,String(r),o);u===void 0?delete i[r]:u!==o&&(i[r]=u)}else if(i instanceof Map)for(const r of Array.from(i.keys())){const a=i.get(r),o=xo(e,i,r,a);o===void 0?i.delete(r):o!==a&&i.set(r,o)}else if(i instanceof Set)for(const r of Array.from(i)){const a=xo(e,i,r,r);a===void 0?i.delete(r):a!==r&&(i.delete(r),i.add(a))}else for(const[r,a]of Object.entries(i)){const o=xo(e,i,r,a);o===void 0?delete i[r]:o!==a&&(i[r]=o)}return e.call(t,n,i)}function Hi(e,t,n){if(Array.isArray(e))return e.map((i,r)=>Hi(i,String(r),n));if(e&&typeof e.toJSON=="function"){if(!n||!N_(e))return e.toJSON(t,n);const i={aliasCount:0,count:1,res:void 0};n.anchors.set(e,i),n.onCreate=a=>{i.res=a,delete n.onCreate};const r=e.toJSON(t,n);return n.onCreate&&n.onCreate(r),r}return typeof e=="bigint"&&!(n!=null&&n.keep)?Number(e):e}class px{constructor(t){Object.defineProperty(this,Gi,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:i,onAnchor:r,reviver:a}={}){if(!kl(t))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},u=Hi(this,"",o);if(typeof r=="function")for(const{count:d,res:h}of o.anchors.values())r(h,d);return typeof a=="function"?xo(a,{"":u},"",u):u}}class np extends px{constructor(t){super(hx),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){let i;n!=null&&n.aliasResolveCache?i=n.aliasResolveCache:(i=[],El(t,{Node:(a,o)=>{(Sa(o)||N_(o))&&i.push(o)}}),n&&(n.aliasResolveCache=i));let r;for(const a of i){if(a===this)break;a.anchor===this.source&&(r=a)}return r}toJSON(t,n){if(!n)return{source:this.source};const{anchors:i,doc:r,maxAliasCount:a}=n,o=this.resolve(r,n);if(!o){const d=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(d)}let u=i.get(o);if(u||(Hi(o,null,n),u=i.get(o)),(u==null?void 0:u.res)===void 0){const d="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(d)}if(a>=0&&(u.count+=1,u.aliasCount===0&&(u.aliasCount=lh(r,o,i)),u.count*u.aliasCount>a)){const d="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(d)}return u.res}toString(t,n,i){const r=`*${this.source}`;if(t){if(T_(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const a=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(a)}if(t.implicitKey)return`${r} `}return r}}function lh(e,t,n){if(Sa(t)){const i=t.resolve(e),r=n&&i&&n.get(i);return r?r.count*r.aliasCount:0}else if(on(t)){let i=0;for(const r of t.items){const a=lh(e,r,n);a>i&&(i=a)}return i}else if(en(t)){const i=lh(e,t.key,n),r=lh(e,t.value,n);return Math.max(i,r)}return 1}const O_=e=>!e||typeof e!="function"&&typeof e!="object";class at extends px{constructor(t){super(Lr),this.value=t}toJSON(t,n){return n!=null&&n.keep?this.value:Hi(this.value,t,n)}toString(){return String(this.value)}}at.BLOCK_FOLDED="BLOCK_FOLDED";at.BLOCK_LITERAL="BLOCK_LITERAL";at.PLAIN="PLAIN";at.QUOTE_DOUBLE="QUOTE_DOUBLE";at.QUOTE_SINGLE="QUOTE_SINGLE";const q5="tag:yaml.org,2002:";function H5(e,t,n){if(t){const i=n.filter(a=>a.tag===t),r=i.find(a=>!a.format)??i[0];if(!r)throw new Error(`Tag ${t} not found`);return r}return n.find(i=>{var r;return((r=i.identify)==null?void 0:r.call(i,e))&&!i.format})}function Au(e,t,n){var p,y,b;if(kl(e)&&(e=e.contents),un(e))return e;if(en(e)){const w=(y=(p=n.schema[va]).createNode)==null?void 0:y.call(p,n.schema,null,n);return w.items.push(e),w}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:i,onAnchor:r,onTagObj:a,schema:o,sourceObjects:u}=n;let d;if(i&&e&&typeof e=="object"){if(d=u.get(e),d)return d.anchor??(d.anchor=r(e)),new np(d.anchor);d={anchor:null,node:null},u.set(e,d)}t!=null&&t.startsWith("!!")&&(t=q5+t.slice(2));let h=H5(e,t,o.tags);if(!h){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const w=new at(e);return d&&(d.node=w),w}h=e instanceof Map?o[va]:Symbol.iterator in Object(e)?o[ec]:o[va]}a&&(a(h),delete n.onTagObj);const g=h!=null&&h.createNode?h.createNode(n.schema,e,n):typeof((b=h==null?void 0:h.nodeClass)==null?void 0:b.from)=="function"?h.nodeClass.from(n.schema,e,n):new at(e);return t?g.tag=t:h.default||(g.tag=h.tag),d&&(d.node=g),g}function jh(e,t,n){let i=n;for(let r=t.length-1;r>=0;--r){const a=t[r];if(typeof a=="number"&&Number.isInteger(a)&&a>=0){const o=[];o[a]=i,i=o}else i=new Map([[a,i]])}return Au(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const hu=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class R_ extends px{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(i=>un(i)||en(i)?i.clone(t):i),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(hu(t))this.add(n);else{const[i,...r]=t,a=this.get(i,!0);if(on(a))a.addIn(r,n);else if(a===void 0&&this.schema)this.set(i,jh(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}deleteIn(t){const[n,...i]=t;if(i.length===0)return this.delete(n);const r=this.get(n,!0);if(on(r))return r.deleteIn(i);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}getIn(t,n){const[i,...r]=t,a=this.get(i,!0);return r.length===0?!n&&Gt(a)?a.value:a:on(a)?a.getIn(r,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!en(n))return!1;const i=n.value;return i==null||t&&Gt(i)&&i.value==null&&!i.commentBefore&&!i.comment&&!i.tag})}hasIn(t){const[n,...i]=t;if(i.length===0)return this.has(n);const r=this.get(n,!0);return on(r)?r.hasIn(i):!1}setIn(t,n){const[i,...r]=t;if(r.length===0)this.set(i,n);else{const a=this.get(i,!0);if(on(a))a.setIn(r,n);else if(a===void 0&&this.schema)this.set(i,jh(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}}const K5=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function fs(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const Qa=(e,t,n)=>e.endsWith(`
|
|
606
|
+
`)?fs(n,t):n.includes(`
|
|
607
|
+
`)?`
|
|
608
|
+
`+fs(n,t):(e.endsWith(" ")?"":" ")+n,L_="flow",ub="block",oh="quoted";function ip(e,t,n="flow",{indentAtStart:i,lineWidth:r=80,minContentWidth:a=20,onFold:o,onOverflow:u}={}){if(!r||r<0)return e;r<a&&(a=0);const d=Math.max(1+a,1+r-t.length);if(e.length<=d)return e;const h=[],g={};let p=r-t.length;typeof i=="number"&&(i>r-Math.max(2,a)?h.push(0):p=r-i);let y,b,w=!1,v=-1,N=-1,k=-1;n===ub&&(v=lE(e,v,t.length),v!==-1&&(p=v+d));for(let S;S=e[v+=1];){if(n===oh&&S==="\\"){switch(N=v,e[v+1]){case"x":v+=3;break;case"u":v+=5;break;case"U":v+=9;break;default:v+=1}k=v}if(S===`
|
|
609
|
+
`)n===ub&&(v=lE(e,v,t.length)),p=v+t.length+d,y=void 0;else{if(S===" "&&b&&b!==" "&&b!==`
|
|
610
|
+
`&&b!==" "){const _=e[v+1];_&&_!==" "&&_!==`
|
|
611
|
+
`&&_!==" "&&(y=v)}if(v>=p)if(y)h.push(y),p=y+d,y=void 0;else if(n===oh){for(;b===" "||b===" ";)b=S,S=e[v+=1],w=!0;const _=v>k+1?v-2:N-1;if(g[_])return e;h.push(_),g[_]=!0,p=_+d,y=void 0}else w=!0}b=S}if(w&&u&&u(),h.length===0)return e;o&&o();let A=e.slice(0,h[0]);for(let S=0;S<h.length;++S){const _=h[S],C=h[S+1]||e.length;_===0?A=`
|
|
612
|
+
${t}${e.slice(0,C)}`:(n===oh&&g[_]&&(A+=`${e[_]}\\`),A+=`
|
|
613
|
+
${t}${e.slice(_+1,C)}`)}return A}function lE(e,t,n){let i=t,r=t+1,a=e[r];for(;a===" "||a===" ";)if(t<r+n)a=e[++t];else{do a=e[++t];while(a&&a!==`
|
|
614
|
+
`);i=t,r=t+1,a=e[r]}return i}const rp=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),sp=e=>/^(%|---|\.\.\.)/m.test(e);function G5(e,t,n){if(!t||t<0)return!1;const i=t-n,r=e.length;if(r<=i)return!1;for(let a=0,o=0;a<r;++a)if(e[a]===`
|
|
615
|
+
`){if(a-o>i)return!0;if(o=a+1,r-o<=i)return!1}return!0}function yu(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:i}=t,r=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(sp(e)?" ":"");let o="",u=0;for(let d=0,h=n[d];h;h=n[++d])if(h===" "&&n[d+1]==="\\"&&n[d+2]==="n"&&(o+=n.slice(u,d)+"\\ ",d+=1,u=d,h="\\"),h==="\\")switch(n[d+1]){case"u":{o+=n.slice(u,d);const g=n.substr(d+2,4);switch(g){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:g.substr(0,2)==="00"?o+="\\x"+g.substr(2):o+=n.substr(d,6)}d+=5,u=d+1}break;case"n":if(i||n[d+2]==='"'||n.length<r)d+=1;else{for(o+=n.slice(u,d)+`
|
|
616
|
+
|
|
617
|
+
`;n[d+2]==="\\"&&n[d+3]==="n"&&n[d+4]!=='"';)o+=`
|
|
618
|
+
`,d+=2;o+=a,n[d+2]===" "&&(o+="\\"),d+=1,u=d+1}break;default:d+=1}return o=u?o+n.slice(u):n,i?o:ip(o,a,oh,rp(t,!1))}function db(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
|
619
|
+
`)||/[ \t]\n|\n[ \t]/.test(e))return yu(e,t);const n=t.indent||(sp(e)?" ":""),i="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
620
|
+
${n}`)+"'";return t.implicitKey?i:ip(i,n,L_,rp(t,!1))}function vo(e,t){const{singleQuote:n}=t.options;let i;if(n===!1)i=yu;else{const r=e.includes('"'),a=e.includes("'");r&&!a?i=db:a&&!r?i=yu:i=n?db:yu}return i(e,t)}let fb;try{fb=new RegExp(`(^|(?<!
|
|
621
|
+
))
|
|
622
|
+
+(?!
|
|
623
|
+
|$)`,"g")}catch{fb=/\n+(?!\n|$)/g}function ch({comment:e,type:t,value:n},i,r,a){const{blockQuote:o,commentString:u,lineWidth:d}=i.options;if(!o||/\n[\t ]+$/.test(n))return vo(n,i);const h=i.indent||(i.forceBlockIndent||sp(n)?" ":""),g=o==="literal"?!0:o==="folded"||t===at.BLOCK_FOLDED?!1:t===at.BLOCK_LITERAL?!0:!G5(n,d,h.length);if(!n)return g?`|
|
|
624
|
+
`:`>
|
|
625
|
+
`;let p,y;for(y=n.length;y>0;--y){const C=n[y-1];if(C!==`
|
|
626
|
+
`&&C!==" "&&C!==" ")break}let b=n.substring(y);const w=b.indexOf(`
|
|
627
|
+
`);w===-1?p="-":n===b||w!==b.length-1?(p="+",a&&a()):p="",b&&(n=n.slice(0,-b.length),b[b.length-1]===`
|
|
628
|
+
`&&(b=b.slice(0,-1)),b=b.replace(fb,`$&${h}`));let v=!1,N,k=-1;for(N=0;N<n.length;++N){const C=n[N];if(C===" ")v=!0;else if(C===`
|
|
629
|
+
`)k=N;else break}let A=n.substring(0,k<N?k+1:N);A&&(n=n.substring(A.length),A=A.replace(/\n+/g,`$&${h}`));let _=(v?h?"2":"1":"")+p;if(e&&(_+=" "+u(e.replace(/ ?[\r\n]+/g," ")),r&&r()),!g){const C=n.replace(/\n+/g,`
|
|
630
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${h}`);let T=!1;const R=rp(i,!0);o!=="folded"&&t!==at.BLOCK_FOLDED&&(R.onOverflow=()=>{T=!0});const O=ip(`${A}${C}${b}`,h,ub,R);if(!T)return`>${_}
|
|
631
|
+
${h}${O}`}return n=n.replace(/\n+/g,`$&${h}`),`|${_}
|
|
632
|
+
${h}${A}${n}${b}`}function V5(e,t,n,i){const{type:r,value:a}=e,{actualString:o,implicitKey:u,indent:d,indentStep:h,inFlow:g}=t;if(u&&a.includes(`
|
|
633
|
+
`)||g&&/[[\]{},]/.test(a))return vo(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return u||g||!a.includes(`
|
|
634
|
+
`)?vo(a,t):ch(e,t,n,i);if(!u&&!g&&r!==at.PLAIN&&a.includes(`
|
|
635
|
+
`))return ch(e,t,n,i);if(sp(a)){if(d==="")return t.forceBlockIndent=!0,ch(e,t,n,i);if(u&&d===h)return vo(a,t)}const p=a.replace(/\n+/g,`$&
|
|
636
|
+
${d}`);if(o){const y=v=>{var N;return v.default&&v.tag!=="tag:yaml.org,2002:str"&&((N=v.test)==null?void 0:N.test(p))},{compat:b,tags:w}=t.doc.schema;if(w.some(y)||b!=null&&b.some(y))return vo(a,t)}return u?p:ip(p,d,L_,rp(t,!1))}function nd(e,t,n,i){const{implicitKey:r,inFlow:a}=t,o=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:u}=e;u!==at.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(u=at.QUOTE_DOUBLE);const d=g=>{switch(g){case at.BLOCK_FOLDED:case at.BLOCK_LITERAL:return r||a?vo(o.value,t):ch(o,t,n,i);case at.QUOTE_DOUBLE:return yu(o.value,t);case at.QUOTE_SINGLE:return db(o.value,t);case at.PLAIN:return V5(o,t,n,i);default:return null}};let h=d(u);if(h===null){const{defaultKeyType:g,defaultStringType:p}=t.options,y=r&&g||p;if(h=d(y),h===null)throw new Error(`Unsupported default string type ${y}`)}return h}function z_(e,t){const n=Object.assign({blockQuote:!0,commentString:K5,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);let i;switch(n.collectionStyle){case"block":i=!1;break;case"flow":i=!0;break;default:i=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:i,options:n}}function Y5(e,t){var r;if(t.tag){const a=e.filter(o=>o.tag===t.tag);if(a.length>0)return a.find(o=>o.format===t.format)??a[0]}let n,i;if(Gt(t)){i=t.value;let a=e.filter(o=>{var u;return(u=o.identify)==null?void 0:u.call(o,i)});if(a.length>1){const o=a.filter(u=>u.test);o.length>0&&(a=o)}n=a.find(o=>o.format===t.format)??a.find(o=>!o.format)}else i=t,n=e.find(a=>a.nodeClass&&i instanceof a.nodeClass);if(!n){const a=((r=i==null?void 0:i.constructor)==null?void 0:r.name)??(i===null?"null":typeof i);throw new Error(`Tag not resolved for ${a} value`)}return n}function W5(e,t,{anchors:n,doc:i}){if(!i.directives)return"";const r=[],a=(Gt(e)||on(e))&&e.anchor;a&&T_(a)&&(n.add(a),r.push(`&${a}`));const o=e.tag??(t.default?null:t.tag);return o&&r.push(i.directives.tagString(o)),r.join(" ")}function Uo(e,t,n,i){var d;if(en(e))return e.toString(t,n,i);if(Sa(e)){if(t.doc.directives)return e.toString(t);if((d=t.resolvedAliases)!=null&&d.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let r;const a=un(e)?e:t.doc.createNode(e,{onTagObj:h=>r=h});r??(r=Y5(t.doc.schema.tags,a));const o=W5(a,r,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);const u=typeof r.stringify=="function"?r.stringify(a,t,n,i):Gt(a)?nd(a,t,n,i):a.toString(t,n,i);return o?Gt(a)||u[0]==="{"||u[0]==="["?`${o} ${u}`:`${o}
|
|
637
|
+
${t.indent}${u}`:u}function Q5({key:e,value:t},n,i,r){const{allNullValues:a,doc:o,indent:u,indentStep:d,options:{commentString:h,indentSeq:g,simpleKeys:p}}=n;let y=un(e)&&e.comment||null;if(p){if(y)throw new Error("With simple keys, key nodes cannot have comments");if(on(e)||!un(e)&&typeof e=="object"){const R="With simple keys, collection cannot be used as a key value";throw new Error(R)}}let b=!p&&(!e||y&&t==null&&!n.inFlow||on(e)||(Gt(e)?e.type===at.BLOCK_FOLDED||e.type===at.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!b&&(p||!a),indent:u+d});let w=!1,v=!1,N=Uo(e,n,()=>w=!0,()=>v=!0);if(!b&&!n.inFlow&&N.length>1024){if(p)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");b=!0}if(n.inFlow){if(a||t==null)return w&&i&&i(),N===""?"?":b?`? ${N}`:N}else if(a&&!p||t==null&&b)return N=`? ${N}`,y&&!w?N+=Qa(N,n.indent,h(y)):v&&r&&r(),N;w&&(y=null),b?(y&&(N+=Qa(N,n.indent,h(y))),N=`? ${N}
|
|
638
|
+
${u}:`):(N=`${N}:`,y&&(N+=Qa(N,n.indent,h(y))));let k,A,S;un(t)?(k=!!t.spaceBefore,A=t.commentBefore,S=t.comment):(k=!1,A=null,S=null,t&&typeof t=="object"&&(t=o.createNode(t))),n.implicitKey=!1,!b&&!y&&Gt(t)&&(n.indentAtStart=N.length+1),v=!1,!g&&d.length>=2&&!n.inFlow&&!b&&nc(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let _=!1;const C=Uo(t,n,()=>_=!0,()=>v=!0);let T=" ";if(y||k||A){if(T=k?`
|
|
639
|
+
`:"",A){const R=h(A);T+=`
|
|
640
|
+
${fs(R,n.indent)}`}C===""&&!n.inFlow?T===`
|
|
641
|
+
`&&S&&(T=`
|
|
642
|
+
|
|
643
|
+
`):T+=`
|
|
644
|
+
${n.indent}`}else if(!b&&on(t)){const R=C[0],O=C.indexOf(`
|
|
645
|
+
`),B=O!==-1,P=n.inFlow??t.flow??t.items.length===0;if(B||!P){let F=!1;if(B&&(R==="&"||R==="!")){let U=C.indexOf(" ");R==="&"&&U!==-1&&U<O&&C[U+1]==="!"&&(U=C.indexOf(" ",U+1)),(U===-1||O<U)&&(F=!0)}F||(T=`
|
|
646
|
+
${n.indent}`)}}else(C===""||C[0]===`
|
|
647
|
+
`)&&(T="");return N+=T+C,n.inFlow?_&&i&&i():S&&!_?N+=Qa(N,n.indent,h(S)):v&&r&&r(),N}function I_(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const Mf="<<",ps={identify:e=>e===Mf||typeof e=="symbol"&&e.description===Mf,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new at(Symbol(Mf)),{addToJSMap:P_}),stringify:()=>Mf},X5=(e,t)=>(ps.identify(t)||Gt(t)&&(!t.type||t.type===at.PLAIN)&&ps.identify(t.value))&&(e==null?void 0:e.doc.schema.tags.some(n=>n.tag===ps.tag&&n.default));function P_(e,t,n){if(n=e&&Sa(n)?n.resolve(e.doc):n,nc(n))for(const i of n.items)Wg(e,t,i);else if(Array.isArray(n))for(const i of n)Wg(e,t,i);else Wg(e,t,n)}function Wg(e,t,n){const i=e&&Sa(n)?n.resolve(e.doc):n;if(!tc(i))throw new Error("Merge sources must be maps or map aliases");const r=i.toJSON(null,e,Map);for(const[a,o]of r)t instanceof Map?t.has(a)||t.set(a,o):t instanceof Set?t.add(a):Object.prototype.hasOwnProperty.call(t,a)||Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0});return t}function B_(e,t,{key:n,value:i}){if(un(n)&&n.addToJSMap)n.addToJSMap(e,t,i);else if(X5(e,n))P_(e,t,i);else{const r=Hi(n,"",e);if(t instanceof Map)t.set(r,Hi(i,r,e));else if(t instanceof Set)t.add(r);else{const a=Z5(n,r,e),o=Hi(i,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function Z5(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(un(e)&&(n!=null&&n.doc)){const i=z_(n.doc,{});i.anchors=new Set;for(const a of n.anchors.keys())i.anchors.add(a.anchor);i.inFlow=!0,i.inStringifyKey=!0;const r=e.toString(i);if(!n.mapKeyWarned){let a=JSON.stringify(r);a.length>40&&(a=a.substring(0,36)+'..."'),I_(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${a}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}function mx(e,t,n){const i=Au(e,void 0,n),r=Au(t,void 0,n);return new Vn(i,r)}class Vn{constructor(t,n=null){Object.defineProperty(this,Gi,{value:S_}),this.key=t,this.value=n}clone(t){let{key:n,value:i}=this;return un(n)&&(n=n.clone(t)),un(i)&&(i=i.clone(t)),new Vn(n,i)}toJSON(t,n){const i=n!=null&&n.mapAsMap?new Map:{};return B_(n,i,this)}toString(t,n,i){return t!=null&&t.doc?Q5(this,t,n,i):JSON.stringify(this)}}function $_(e,t,n){return(t.inFlow??e.flow?eP:J5)(e,t,n)}function J5({comment:e,items:t},n,{blockItemPrefix:i,flowChars:r,itemIndent:a,onChompKeep:o,onComment:u}){const{indent:d,options:{commentString:h}}=n,g=Object.assign({},n,{indent:a,type:null});let p=!1;const y=[];for(let w=0;w<t.length;++w){const v=t[w];let N=null;if(un(v))!p&&v.spaceBefore&&y.push(""),Ch(n,y,v.commentBefore,p),v.comment&&(N=v.comment);else if(en(v)){const A=un(v.key)?v.key:null;A&&(!p&&A.spaceBefore&&y.push(""),Ch(n,y,A.commentBefore,p))}p=!1;let k=Uo(v,g,()=>N=null,()=>p=!0);N&&(k+=Qa(k,a,h(N))),p&&N&&(p=!1),y.push(i+k)}let b;if(y.length===0)b=r.start+r.end;else{b=y[0];for(let w=1;w<y.length;++w){const v=y[w];b+=v?`
|
|
648
|
+
${d}${v}`:`
|
|
649
|
+
`}}return e?(b+=`
|
|
650
|
+
`+fs(h(e),d),u&&u()):p&&o&&o(),b}function eP({items:e},t,{flowChars:n,itemIndent:i}){const{indent:r,indentStep:a,flowCollectionPadding:o,options:{commentString:u}}=t;i+=a;const d=Object.assign({},t,{indent:i,inFlow:!0,type:null});let h=!1,g=0;const p=[];for(let w=0;w<e.length;++w){const v=e[w];let N=null;if(un(v))v.spaceBefore&&p.push(""),Ch(t,p,v.commentBefore,!1),v.comment&&(N=v.comment);else if(en(v)){const A=un(v.key)?v.key:null;A&&(A.spaceBefore&&p.push(""),Ch(t,p,A.commentBefore,!1),A.comment&&(h=!0));const S=un(v.value)?v.value:null;S?(S.comment&&(N=S.comment),S.commentBefore&&(h=!0)):v.value==null&&(A!=null&&A.comment)&&(N=A.comment)}N&&(h=!0);let k=Uo(v,d,()=>N=null);h||(h=p.length>g||k.includes(`
|
|
651
|
+
`)),w<e.length-1?k+=",":t.options.trailingComma&&(t.options.lineWidth>0&&(h||(h=p.reduce((A,S)=>A+S.length+2,2)+(k.length+2)>t.options.lineWidth)),h&&(k+=",")),N&&(k+=Qa(k,i,u(N))),p.push(k),g=p.length}const{start:y,end:b}=n;if(p.length===0)return y+b;if(!h){const w=p.reduce((v,N)=>v+N.length+2,2);h=t.options.lineWidth>0&&w>t.options.lineWidth}if(h){let w=y;for(const v of p)w+=v?`
|
|
652
|
+
${a}${r}${v}`:`
|
|
653
|
+
`;return`${w}
|
|
654
|
+
${r}${b}`}else return`${y}${o}${p.join(" ")}${o}${b}`}function Ch({indent:e,options:{commentString:t}},n,i,r){if(i&&r&&(i=i.replace(/^\n+/,"")),i){const a=fs(t(i),e);n.push(a.trimStart())}}function Xa(e,t){const n=Gt(t)?t.value:t;for(const i of e)if(en(i)&&(i.key===t||i.key===n||Gt(i.key)&&i.key.value===n))return i}class Ni extends R_{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(va,t),this.items=[]}static from(t,n,i){const{keepUndefined:r,replacer:a}=i,o=new this(t),u=(d,h)=>{if(typeof a=="function")h=a.call(n,d,h);else if(Array.isArray(a)&&!a.includes(d))return;(h!==void 0||r)&&o.items.push(mx(d,h,i))};if(n instanceof Map)for(const[d,h]of n)u(d,h);else if(n&&typeof n=="object")for(const d of Object.keys(n))u(d,n[d]);return typeof t.sortMapEntries=="function"&&o.items.sort(t.sortMapEntries),o}add(t,n){var o;let i;en(t)?i=t:!t||typeof t!="object"||!("key"in t)?i=new Vn(t,t==null?void 0:t.value):i=new Vn(t.key,t.value);const r=Xa(this.items,i.key),a=(o=this.schema)==null?void 0:o.sortMapEntries;if(r){if(!n)throw new Error(`Key ${i.key} already set`);Gt(r.value)&&O_(i.value)?r.value.value=i.value:r.value=i.value}else if(a){const u=this.items.findIndex(d=>a(i,d)<0);u===-1?this.items.push(i):this.items.splice(u,0,i)}else this.items.push(i)}delete(t){const n=Xa(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const i=Xa(this.items,t),r=i==null?void 0:i.value;return(!n&&Gt(r)?r.value:r)??void 0}has(t){return!!Xa(this.items,t)}set(t,n){this.add(new Vn(t,n),!0)}toJSON(t,n,i){const r=i?new i:n!=null&&n.mapAsMap?new Map:{};n!=null&&n.onCreate&&n.onCreate(r);for(const a of this.items)B_(n,r,a);return r}toString(t,n,i){if(!t)return JSON.stringify(this);for(const r of this.items)if(!en(r))throw new Error(`Map items must all be pairs; found ${JSON.stringify(r)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),$_(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:i,onComment:n})}}const ic={collection:"map",default:!0,nodeClass:Ni,tag:"tag:yaml.org,2002:map",resolve(e,t){return tc(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>Ni.from(e,t,n)};class ka extends R_{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(ec,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=Df(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const i=Df(t);if(typeof i!="number")return;const r=this.items[i];return!n&&Gt(r)?r.value:r}has(t){const n=Df(t);return typeof n=="number"&&n<this.items.length}set(t,n){const i=Df(t);if(typeof i!="number")throw new Error(`Expected a valid index, not ${t}.`);const r=this.items[i];Gt(r)&&O_(n)?r.value=n:this.items[i]=n}toJSON(t,n){const i=[];n!=null&&n.onCreate&&n.onCreate(i);let r=0;for(const a of this.items)i.push(Hi(a,String(r++),n));return i}toString(t,n,i){return t?$_(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:i,onComment:n}):JSON.stringify(this)}static from(t,n,i){const{replacer:r}=i,a=new this(t);if(n&&Symbol.iterator in Object(n)){let o=0;for(let u of n){if(typeof r=="function"){const d=n instanceof Set?u:String(o++);u=r.call(n,d,u)}a.items.push(Au(u,void 0,i))}}return a}}function Df(e){let t=Gt(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}const rc={collection:"seq",default:!0,nodeClass:ka,tag:"tag:yaml.org,2002:seq",resolve(e,t){return nc(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>ka.from(e,t,n)},ap={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,i){return t=Object.assign({actualString:!0},t),nd(e,t,n,i)}},lp={identify:e=>e==null,createNode:()=>new at(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new at(null),stringify:({source:e},t)=>typeof e=="string"&&lp.test.test(e)?e:t.options.nullStr},gx={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new at(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&gx.test.test(e)){const i=e[0]==="t"||e[0]==="T";if(t===i)return e}return t?n.options.trueStr:n.options.falseStr}};function yr({format:e,minFractionDigits:t,tag:n,value:i}){if(typeof i=="bigint")return String(i);const r=typeof i=="number"?i:Number(i);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let a=Object.is(i,-0)?"-0":JSON.stringify(i);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^\d/.test(a)){let o=a.indexOf(".");o<0&&(o=a.length,a+=".");let u=t-(a.length-o-1);for(;u-- >0;)a+="0"}return a}const U_={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:yr},F_={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():yr(e)}},q_={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new at(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:yr},op=e=>typeof e=="bigint"||Number.isInteger(e),yx=(e,t,n,{intAsBigInt:i})=>i?BigInt(e):parseInt(e.substring(t),n);function H_(e,t,n){const{value:i}=e;return op(i)&&i>=0?n+i.toString(t):yr(e)}const K_={identify:e=>op(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>yx(e,2,8,n),stringify:e=>H_(e,8,"0o")},G_={identify:op,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>yx(e,0,10,n),stringify:yr},V_={identify:e=>op(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>yx(e,2,16,n),stringify:e=>H_(e,16,"0x")},tP=[ic,rc,ap,lp,gx,K_,G_,V_,U_,F_,q_];function oE(e){return typeof e=="bigint"||Number.isInteger(e)}const Of=({value:e})=>JSON.stringify(e),nP=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Of},{identify:e=>e==null,createNode:()=>new at(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Of},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:Of},{identify:oE,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>oE(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:Of}],iP={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},rP=[ic,rc].concat(nP,iP),bx={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof atob=="function"){const n=atob(e.replace(/[\n\r]/g,"")),i=new Uint8Array(n.length);for(let r=0;r<n.length;++r)i[r]=n.charCodeAt(r);return i}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:n},i,r,a){if(!n)return"";const o=n;let u;if(typeof btoa=="function"){let d="";for(let h=0;h<o.length;++h)d+=String.fromCharCode(o[h]);u=btoa(d)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=at.BLOCK_LITERAL),t!==at.QUOTE_DOUBLE){const d=Math.max(i.options.lineWidth-i.indent.length,i.options.minContentWidth),h=Math.ceil(u.length/d),g=new Array(h);for(let p=0,y=0;p<h;++p,y+=d)g[p]=u.substr(y,d);u=g.join(t===at.BLOCK_LITERAL?`
|
|
655
|
+
`:" ")}return nd({comment:e,type:t,value:u},i,r,a)}};function Y_(e,t){if(nc(e))for(let n=0;n<e.items.length;++n){let i=e.items[n];if(!en(i)){if(tc(i)){i.items.length>1&&t("Each pair must have its own sequence indicator");const r=i.items[0]||new Vn(new at(null));if(i.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${i.commentBefore}
|
|
656
|
+
${r.key.commentBefore}`:i.commentBefore),i.comment){const a=r.value??r.key;a.comment=a.comment?`${i.comment}
|
|
657
|
+
${a.comment}`:i.comment}i=r}e.items[n]=en(i)?i:new Vn(i)}}else t("Expected a sequence for this tag");return e}function W_(e,t,n){const{replacer:i}=n,r=new ka(e);r.tag="tag:yaml.org,2002:pairs";let a=0;if(t&&Symbol.iterator in Object(t))for(let o of t){typeof i=="function"&&(o=i.call(t,String(a++),o));let u,d;if(Array.isArray(o))if(o.length===2)u=o[0],d=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){const h=Object.keys(o);if(h.length===1)u=h[0],d=o[u];else throw new TypeError(`Expected tuple with one key, not ${h.length} keys`)}else u=o;r.items.push(mx(u,d,n))}return r}const xx={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Y_,createNode:W_};class Eo extends ka{constructor(){super(),this.add=Ni.prototype.add.bind(this),this.delete=Ni.prototype.delete.bind(this),this.get=Ni.prototype.get.bind(this),this.has=Ni.prototype.has.bind(this),this.set=Ni.prototype.set.bind(this),this.tag=Eo.tag}toJSON(t,n){if(!n)return super.toJSON(t);const i=new Map;n!=null&&n.onCreate&&n.onCreate(i);for(const r of this.items){let a,o;if(en(r)?(a=Hi(r.key,"",n),o=Hi(r.value,a,n)):a=Hi(r,"",n),i.has(a))throw new Error("Ordered maps must not include duplicate keys");i.set(a,o)}return i}static from(t,n,i){const r=W_(t,n,i),a=new this;return a.items=r.items,a}}Eo.tag="tag:yaml.org,2002:omap";const vx={collection:"seq",identify:e=>e instanceof Map,nodeClass:Eo,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=Y_(e,t),i=[];for(const{key:r}of n.items)Gt(r)&&(i.includes(r.value)?t(`Ordered maps must not include duplicate keys: ${r.value}`):i.push(r.value));return Object.assign(new Eo,n)},createNode:(e,t,n)=>Eo.from(e,t,n)};function Q_({value:e,source:t},n){return t&&(e?X_:Z_).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const X_={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new at(!0),stringify:Q_},Z_={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new at(!1),stringify:Q_},sP={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:yr},aP={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():yr(e)}},lP={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const t=new at(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){const i=e.substring(n+1).replace(/_/g,"");i[i.length-1]==="0"&&(t.minFractionDigits=i.length)}return t},stringify:yr},id=e=>typeof e=="bigint"||Number.isInteger(e);function cp(e,t,n,{intAsBigInt:i}){const r=e[0];if((r==="-"||r==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),i){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const o=BigInt(e);return r==="-"?BigInt(-1)*o:o}const a=parseInt(e,n);return r==="-"?-1*a:a}function wx(e,t,n){const{value:i}=e;if(id(i)){const r=i.toString(t);return i<0?"-"+n+r.substr(1):n+r}return yr(e)}const oP={identify:id,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>cp(e,2,2,n),stringify:e=>wx(e,2,"0b")},cP={identify:id,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>cp(e,1,8,n),stringify:e=>wx(e,8,"0")},uP={identify:id,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>cp(e,0,10,n),stringify:yr},dP={identify:id,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>cp(e,2,16,n),stringify:e=>wx(e,16,"0x")};class So extends Ni{constructor(t){super(t),this.tag=So.tag}add(t){let n;en(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new Vn(t.key,null):n=new Vn(t,null),Xa(this.items,n.key)||this.items.push(n)}get(t,n){const i=Xa(this.items,t);return!n&&en(i)?Gt(i.key)?i.key.value:i.key:i}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);const i=Xa(this.items,t);i&&!n?this.items.splice(this.items.indexOf(i),1):!i&&n&&this.items.push(new Vn(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,i){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,i);throw new Error("Set items must all have null values")}static from(t,n,i){const{replacer:r}=i,a=new this(t);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof r=="function"&&(o=r.call(n,o,o)),a.items.push(mx(o,null,i));return a}}So.tag="tag:yaml.org,2002:set";const kx={collection:"map",identify:e=>e instanceof Set,nodeClass:So,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>So.from(e,t,n),resolve(e,t){if(tc(e)){if(e.hasAllNullValues(!0))return Object.assign(new So,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function Ex(e,t){const n=e[0],i=n==="-"||n==="+"?e.substring(1):e,r=o=>t?BigInt(o):Number(o),a=i.replace(/_/g,"").split(":").reduce((o,u)=>o*r(60)+r(u),r(0));return n==="-"?r(-1)*a:a}function J_(e){let{value:t}=e,n=o=>o;if(typeof t=="bigint")n=o=>BigInt(o);else if(isNaN(t)||!isFinite(t))return yr(e);let i="";t<0&&(i="-",t*=n(-1));const r=n(60),a=[t%r];return t<60?a.unshift(0):(t=(t-a[0])/r,a.unshift(t%r),t>=60&&(t=(t-a[0])/r,a.unshift(t))),i+a.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const ej={identify:e=>typeof e=="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>Ex(e,n),stringify:J_},tj={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>Ex(e,!1),stringify:J_},up={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const t=e.match(up.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,i,r,a,o,u]=t.map(Number),d=t[7]?Number((t[7]+"00").substr(1,3)):0;let h=Date.UTC(n,i-1,r,a||0,o||0,u||0,d);const g=t[8];if(g&&g!=="Z"){let p=Ex(g,!1);Math.abs(p)<30&&(p*=60),h-=6e4*p}return new Date(h)},stringify:({value:e})=>(e==null?void 0:e.toISOString().replace(/(T00:00:00)?\.000Z$/,""))??""},cE=[ic,rc,ap,lp,X_,Z_,oP,cP,uP,dP,sP,aP,lP,bx,ps,vx,xx,kx,ej,tj,up],uE=new Map([["core",tP],["failsafe",[ic,rc,ap]],["json",rP],["yaml11",cE],["yaml-1.1",cE]]),dE={binary:bx,bool:gx,float:q_,floatExp:F_,floatNaN:U_,floatTime:tj,int:G_,intHex:V_,intOct:K_,intTime:ej,map:ic,merge:ps,null:lp,omap:vx,pairs:xx,seq:rc,set:kx,timestamp:up},fP={"tag:yaml.org,2002:binary":bx,"tag:yaml.org,2002:merge":ps,"tag:yaml.org,2002:omap":vx,"tag:yaml.org,2002:pairs":xx,"tag:yaml.org,2002:set":kx,"tag:yaml.org,2002:timestamp":up};function Qg(e,t,n){const i=uE.get(t);if(i&&!e)return n&&!i.includes(ps)?i.concat(ps):i.slice();let r=i;if(!r)if(Array.isArray(e))r=[];else{const a=Array.from(uE.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${a} or define customTags array`)}if(Array.isArray(e))for(const a of e)r=r.concat(a);else typeof e=="function"&&(r=e(r.slice()));return n&&(r=r.concat(ps)),r.reduce((a,o)=>{const u=typeof o=="string"?dE[o]:o;if(!u){const d=JSON.stringify(o),h=Object.keys(dE).map(g=>JSON.stringify(g)).join(", ");throw new Error(`Unknown custom tag ${d}; use one of ${h}`)}return a.includes(u)||a.push(u),a},[])}const hP=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;let nj=class ij{constructor({compat:t,customTags:n,merge:i,resolveKnownTags:r,schema:a,sortMapEntries:o,toStringDefaults:u}){this.compat=Array.isArray(t)?Qg(t,"compat"):t?Qg(null,t):null,this.name=typeof a=="string"&&a||"core",this.knownTags=r?fP:{},this.tags=Qg(n,this.name,i),this.toStringOptions=u??null,Object.defineProperty(this,va,{value:ic}),Object.defineProperty(this,Lr,{value:ap}),Object.defineProperty(this,ec,{value:rc}),this.sortMapEntries=typeof o=="function"?o:o===!0?hP:null}clone(){const t=Object.create(ij.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};function pP(e,t){var d;const n=[];let i=t.directives===!0;if(t.directives!==!1&&e.directives){const h=e.directives.toString(e);h?(n.push(h),i=!0):e.directives.docStart&&(i=!0)}i&&n.push("---");const r=z_(e,t),{commentString:a}=r.options;if(e.commentBefore){n.length!==1&&n.unshift("");const h=a(e.commentBefore);n.unshift(fs(h,""))}let o=!1,u=null;if(e.contents){if(un(e.contents)){if(e.contents.spaceBefore&&i&&n.push(""),e.contents.commentBefore){const p=a(e.contents.commentBefore);n.push(fs(p,""))}r.forceBlockIndent=!!e.comment,u=e.contents.comment}const h=u?void 0:()=>o=!0;let g=Uo(e.contents,r,()=>u=null,h);u&&(g+=Qa(g,"",a(u))),(g[0]==="|"||g[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${g}`:n.push(g)}else n.push(Uo(e.contents,r));if((d=e.directives)!=null&&d.docEnd)if(e.comment){const h=a(e.comment);h.includes(`
|
|
658
|
+
`)?(n.push("..."),n.push(fs(h,""))):n.push(`... ${h}`)}else n.push("...");else{let h=e.comment;h&&o&&(h=h.replace(/^\n+/,"")),h&&((!o||u)&&n[n.length-1]!==""&&n.push(""),n.push(fs(a(h),"")))}return n.join(`
|
|
659
|
+
`)+`
|
|
660
|
+
`}class sc{constructor(t,n,i){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Gi,{value:cb});let r=null;typeof n=="function"||Array.isArray(n)?r=n:i===void 0&&n&&(i=n,n=void 0);const a=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},i);this.options=a;let{version:o}=a;i!=null&&i._directives?(this.directives=i._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new ti({version:o}),this.setSchema(o,i),this.contents=t===void 0?null:this.createNode(t,r,i)}clone(){const t=Object.create(sc.prototype,{[Gi]:{value:cb}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=un(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){lo(this.contents)&&this.contents.add(t)}addIn(t,n){lo(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const i=M_(this);t.anchor=!n||i.has(n)?D_(n||"a",i):n}return new np(t.anchor)}createNode(t,n,i){let r;if(typeof n=="function")t=n.call({"":t},"",t),r=n;else if(Array.isArray(n)){const N=A=>typeof A=="number"||A instanceof String||A instanceof Number,k=n.filter(N).map(String);k.length>0&&(n=n.concat(k)),r=n}else i===void 0&&n&&(i=n,n=void 0);const{aliasDuplicateObjects:a,anchorPrefix:o,flow:u,keepUndefined:d,onTagObj:h,tag:g}=i??{},{onAnchor:p,setAnchors:y,sourceObjects:b}=F5(this,o||"a"),w={aliasDuplicateObjects:a??!0,keepUndefined:d??!1,onAnchor:p,onTagObj:h,replacer:r,schema:this.schema,sourceObjects:b},v=Au(t,g,w);return u&&on(v)&&(v.flow=!0),y(),v}createPair(t,n,i={}){const r=this.createNode(t,null,i),a=this.createNode(n,null,i);return new Vn(r,a)}delete(t){return lo(this.contents)?this.contents.delete(t):!1}deleteIn(t){return hu(t)?this.contents==null?!1:(this.contents=null,!0):lo(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return on(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return hu(t)?!n&&Gt(this.contents)?this.contents.value:this.contents:on(this.contents)?this.contents.getIn(t,n):void 0}has(t){return on(this.contents)?this.contents.has(t):!1}hasIn(t){return hu(t)?this.contents!==void 0:on(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=jh(this.schema,[t],n):lo(this.contents)&&this.contents.set(t,n)}setIn(t,n){hu(t)?this.contents=n:this.contents==null?this.contents=jh(this.schema,Array.from(t),n):lo(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let i;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new ti({version:"1.1"}),i={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new ti({version:t}),i={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,i=null;break;default:{const r=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${r}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(i)this.schema=new nj(Object.assign(i,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:i,maxAliasCount:r,onAnchor:a,reviver:o}={}){const u={anchors:new Map,doc:this,keep:!t,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},d=Hi(this.contents,n??"",u);if(typeof a=="function")for(const{count:h,res:g}of u.anchors.values())a(g,h);return typeof o=="function"?xo(o,{"":d},"",d):d}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return pP(this,t)}}function lo(e){if(on(e))return!0;throw new Error("Expected a YAML collection as document contents")}class Sx extends Error{constructor(t,n,i,r){super(),this.name=t,this.code=i,this.message=r,this.pos=n}}class Za extends Sx{constructor(t,n,i){super("YAMLParseError",t,n,i)}}class rj extends Sx{constructor(t,n,i){super("YAMLWarning",t,n,i)}}const Ah=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(u=>t.linePos(u));const{line:i,col:r}=n.linePos[0];n.message+=` at line ${i}, column ${r}`;let a=r-1,o=e.substring(t.lineStarts[i-1],t.lineStarts[i]).replace(/[\n\r]+$/,"");if(a>=60&&o.length>80){const u=Math.min(a-39,o.length-79);o="…"+o.substring(u),a-=u-1}if(o.length>80&&(o=o.substring(0,79)+"…"),i>1&&/^ *$/.test(o.substring(0,a))){let u=e.substring(t.lineStarts[i-2],t.lineStarts[i-1]);u.length>80&&(u=u.substring(0,79)+`…
|
|
661
|
+
`),o=u+o}if(/[^ ]/.test(o)){let u=1;const d=n.linePos[1];(d==null?void 0:d.line)===i&&d.col>r&&(u=Math.max(1,Math.min(d.col-r,80-a)));const h=" ".repeat(a)+"^".repeat(u);n.message+=`:
|
|
662
|
+
|
|
663
|
+
${o}
|
|
664
|
+
${h}
|
|
665
|
+
`}};function Fo(e,{flow:t,indicator:n,next:i,offset:r,onError:a,parentIndent:o,startOnNewline:u}){let d=!1,h=u,g=u,p="",y="",b=!1,w=!1,v=null,N=null,k=null,A=null,S=null,_=null,C=null;for(const O of e)switch(w&&(O.type!=="space"&&O.type!=="newline"&&O.type!=="comma"&&a(O.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),w=!1),v&&(h&&O.type!=="comment"&&O.type!=="newline"&&a(v,"TAB_AS_INDENT","Tabs are not allowed as indentation"),v=null),O.type){case"space":!t&&(n!=="doc-start"||(i==null?void 0:i.type)!=="flow-collection")&&O.source.includes(" ")&&(v=O),g=!0;break;case"comment":{g||a(O,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const B=O.source.substring(1)||" ";p?p+=y+B:p=B,y="",h=!1;break}case"newline":h?p?p+=O.source:(!_||n!=="seq-item-ind")&&(d=!0):y+=O.source,h=!0,b=!0,(N||k)&&(A=O),g=!0;break;case"anchor":N&&a(O,"MULTIPLE_ANCHORS","A node can have at most one anchor"),O.source.endsWith(":")&&a(O.offset+O.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),N=O,C??(C=O.offset),h=!1,g=!1,w=!0;break;case"tag":{k&&a(O,"MULTIPLE_TAGS","A node can have at most one tag"),k=O,C??(C=O.offset),h=!1,g=!1,w=!0;break}case n:(N||k)&&a(O,"BAD_PROP_ORDER",`Anchors and tags must be after the ${O.source} indicator`),_&&a(O,"UNEXPECTED_TOKEN",`Unexpected ${O.source} in ${t??"collection"}`),_=O,h=n==="seq-item-ind"||n==="explicit-key-ind",g=!1;break;case"comma":if(t){S&&a(O,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),S=O,h=!1,g=!1;break}default:a(O,"UNEXPECTED_TOKEN",`Unexpected ${O.type} token`),h=!1,g=!1}const T=e[e.length-1],R=T?T.offset+T.source.length:r;return w&&i&&i.type!=="space"&&i.type!=="newline"&&i.type!=="comma"&&(i.type!=="scalar"||i.source!=="")&&a(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),v&&(h&&v.indent<=o||(i==null?void 0:i.type)==="block-map"||(i==null?void 0:i.type)==="block-seq")&&a(v,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:S,found:_,spaceBefore:d,comment:p,hasNewline:b,anchor:N,tag:k,newlineAfterProp:A,end:R,start:C??R}}function Tu(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
|
|
666
|
+
`))return!0;if(e.end){for(const t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(const t of e.items){for(const n of t.start)if(n.type==="newline")return!0;if(t.sep){for(const n of t.sep)if(n.type==="newline")return!0}if(Tu(t.key)||Tu(t.value))return!0}return!1;default:return!0}}function hb(e,t,n){if((t==null?void 0:t.type)==="flow-collection"){const i=t.end[0];i.indent===e&&(i.source==="]"||i.source==="}")&&Tu(t)&&n(i,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function sj(e,t,n){const{uniqueKeys:i}=e.options;if(i===!1)return!1;const r=typeof i=="function"?i:(a,o)=>a===o||Gt(a)&&Gt(o)&&a.value===o.value;return t.some(a=>r(a.key,n))}const fE="All mapping items must start at the same column";function mP({composeNode:e,composeEmptyNode:t},n,i,r,a){var g;const o=(a==null?void 0:a.nodeClass)??Ni,u=new o(n.schema);n.atRoot&&(n.atRoot=!1);let d=i.offset,h=null;for(const p of i.items){const{start:y,key:b,sep:w,value:v}=p,N=Fo(y,{indicator:"explicit-key-ind",next:b??(w==null?void 0:w[0]),offset:d,onError:r,parentIndent:i.indent,startOnNewline:!0}),k=!N.found;if(k){if(b&&(b.type==="block-seq"?r(d,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in b&&b.indent!==i.indent&&r(d,"BAD_INDENT",fE)),!N.anchor&&!N.tag&&!w){h=N.end,N.comment&&(u.comment?u.comment+=`
|
|
667
|
+
`+N.comment:u.comment=N.comment);continue}(N.newlineAfterProp||Tu(b))&&r(b??y[y.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((g=N.found)==null?void 0:g.indent)!==i.indent&&r(d,"BAD_INDENT",fE);n.atKey=!0;const A=N.end,S=b?e(n,b,N,r):t(n,A,y,null,N,r);n.schema.compat&&hb(i.indent,b,r),n.atKey=!1,sj(n,u.items,S)&&r(A,"DUPLICATE_KEY","Map keys must be unique");const _=Fo(w??[],{indicator:"map-value-ind",next:v,offset:S.range[2],onError:r,parentIndent:i.indent,startOnNewline:!b||b.type==="block-scalar"});if(d=_.end,_.found){k&&((v==null?void 0:v.type)==="block-map"&&!_.hasNewline&&r(d,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&N.start<_.found.offset-1024&&r(S.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const C=v?e(n,v,_,r):t(n,d,w,null,_,r);n.schema.compat&&hb(i.indent,v,r),d=C.range[2];const T=new Vn(S,C);n.options.keepSourceTokens&&(T.srcToken=p),u.items.push(T)}else{k&&r(S.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),_.comment&&(S.comment?S.comment+=`
|
|
668
|
+
`+_.comment:S.comment=_.comment);const C=new Vn(S);n.options.keepSourceTokens&&(C.srcToken=p),u.items.push(C)}}return h&&h<d&&r(h,"IMPOSSIBLE","Map comment with trailing content"),u.range=[i.offset,d,h??d],u}function gP({composeNode:e,composeEmptyNode:t},n,i,r,a){const o=(a==null?void 0:a.nodeClass)??ka,u=new o(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let d=i.offset,h=null;for(const{start:g,value:p}of i.items){const y=Fo(g,{indicator:"seq-item-ind",next:p,offset:d,onError:r,parentIndent:i.indent,startOnNewline:!0});if(!y.found)if(y.anchor||y.tag||p)(p==null?void 0:p.type)==="block-seq"?r(y.end,"BAD_INDENT","All sequence items must start at the same column"):r(d,"MISSING_CHAR","Sequence item without - indicator");else{h=y.end,y.comment&&(u.comment=y.comment);continue}const b=p?e(n,p,y,r):t(n,y.end,g,null,y,r);n.schema.compat&&hb(i.indent,p,r),d=b.range[2],u.items.push(b)}return u.range=[i.offset,d,h??d],u}function rd(e,t,n,i){let r="";if(e){let a=!1,o="";for(const u of e){const{source:d,type:h}=u;switch(h){case"space":a=!0;break;case"comment":{n&&!a&&i(u,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const g=d.substring(1)||" ";r?r+=o+g:r=g,o="";break}case"newline":r&&(o+=d),a=!0;break;default:i(u,"UNEXPECTED_TOKEN",`Unexpected ${h} at node end`)}t+=d.length}}return{comment:r,offset:t}}const Xg="Block collections are not allowed within flow collections",Zg=e=>e&&(e.type==="block-map"||e.type==="block-seq");function yP({composeNode:e,composeEmptyNode:t},n,i,r,a){var N;const o=i.start.source==="{",u=o?"flow map":"flow sequence",d=(a==null?void 0:a.nodeClass)??(o?Ni:ka),h=new d(n.schema);h.flow=!0;const g=n.atRoot;g&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let p=i.offset+i.start.source.length;for(let k=0;k<i.items.length;++k){const A=i.items[k],{start:S,key:_,sep:C,value:T}=A,R=Fo(S,{flow:u,indicator:"explicit-key-ind",next:_??(C==null?void 0:C[0]),offset:p,onError:r,parentIndent:i.indent,startOnNewline:!1});if(!R.found){if(!R.anchor&&!R.tag&&!C&&!T){k===0&&R.comma?r(R.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${u}`):k<i.items.length-1&&r(R.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${u}`),R.comment&&(h.comment?h.comment+=`
|
|
669
|
+
`+R.comment:h.comment=R.comment),p=R.end;continue}!o&&n.options.strict&&Tu(_)&&r(_,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(k===0)R.comma&&r(R.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${u}`);else if(R.comma||r(R.start,"MISSING_CHAR",`Missing , between ${u} items`),R.comment){let O="";e:for(const B of S)switch(B.type){case"comma":case"space":break;case"comment":O=B.source.substring(1);break e;default:break e}if(O){let B=h.items[h.items.length-1];en(B)&&(B=B.value??B.key),B.comment?B.comment+=`
|
|
670
|
+
`+O:B.comment=O,R.comment=R.comment.substring(O.length+1)}}if(!o&&!C&&!R.found){const O=T?e(n,T,R,r):t(n,R.end,C,null,R,r);h.items.push(O),p=O.range[2],Zg(T)&&r(O.range,"BLOCK_IN_FLOW",Xg)}else{n.atKey=!0;const O=R.end,B=_?e(n,_,R,r):t(n,O,S,null,R,r);Zg(_)&&r(B.range,"BLOCK_IN_FLOW",Xg),n.atKey=!1;const P=Fo(C??[],{flow:u,indicator:"map-value-ind",next:T,offset:B.range[2],onError:r,parentIndent:i.indent,startOnNewline:!1});if(P.found){if(!o&&!R.found&&n.options.strict){if(C)for(const V of C){if(V===P.found)break;if(V.type==="newline"){r(V,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}R.start<P.found.offset-1024&&r(P.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else T&&("source"in T&&((N=T.source)==null?void 0:N[0])===":"?r(T,"MISSING_CHAR",`Missing space after : in ${u}`):r(P.start,"MISSING_CHAR",`Missing , or : between ${u} items`));const F=T?e(n,T,P,r):P.found?t(n,P.end,C,null,P,r):null;F?Zg(T)&&r(F.range,"BLOCK_IN_FLOW",Xg):P.comment&&(B.comment?B.comment+=`
|
|
671
|
+
`+P.comment:B.comment=P.comment);const U=new Vn(B,F);if(n.options.keepSourceTokens&&(U.srcToken=A),o){const V=h;sj(n,V.items,B)&&r(O,"DUPLICATE_KEY","Map keys must be unique"),V.items.push(U)}else{const V=new Ni(n.schema);V.flow=!0,V.items.push(U);const M=(F??B).range;V.range=[B.range[0],M[1],M[2]],h.items.push(V)}p=F?F.range[2]:P.end}}const y=o?"}":"]",[b,...w]=i.end;let v=p;if((b==null?void 0:b.source)===y)v=b.offset+b.source.length;else{const k=u[0].toUpperCase()+u.substring(1),A=g?`${k} must end with a ${y}`:`${k} in block collection must be sufficiently indented and end with a ${y}`;r(p,g?"MISSING_CHAR":"BAD_INDENT",A),b&&b.source.length!==1&&w.unshift(b)}if(w.length>0){const k=rd(w,v,n.options.strict,r);k.comment&&(h.comment?h.comment+=`
|
|
672
|
+
`+k.comment:h.comment=k.comment),h.range=[i.offset,v,k.offset]}else h.range=[i.offset,v,v];return h}function Jg(e,t,n,i,r,a){const o=n.type==="block-map"?mP(e,t,n,i,a):n.type==="block-seq"?gP(e,t,n,i,a):yP(e,t,n,i,a),u=o.constructor;return r==="!"||r===u.tagName?(o.tag=u.tagName,o):(r&&(o.tag=r),o)}function bP(e,t,n,i,r){var y;const a=i.tag,o=a?t.directives.tagName(a.source,b=>r(a,"TAG_RESOLVE_FAILED",b)):null;if(n.type==="block-seq"){const{anchor:b,newlineAfterProp:w}=i,v=b&&a?b.offset>a.offset?b:a:b??a;v&&(!w||w.offset<v.offset)&&r(v,"MISSING_CHAR","Missing newline after block sequence props")}const u=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!a||!o||o==="!"||o===Ni.tagName&&u==="map"||o===ka.tagName&&u==="seq")return Jg(e,t,n,r,o);let d=t.schema.tags.find(b=>b.tag===o&&b.collection===u);if(!d){const b=t.schema.knownTags[o];if((b==null?void 0:b.collection)===u)t.schema.tags.push(Object.assign({},b,{default:!1})),d=b;else return b?r(a,"BAD_COLLECTION_TYPE",`${b.tag} used for ${u} collection, but expects ${b.collection??"scalar"}`,!0):r(a,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),Jg(e,t,n,r,o)}const h=Jg(e,t,n,r,o,d),g=((y=d.resolve)==null?void 0:y.call(d,h,b=>r(a,"TAG_RESOLVE_FAILED",b),t.options))??h,p=un(g)?g:new at(g);return p.range=h.range,p.tag=o,d!=null&&d.format&&(p.format=d.format),p}function aj(e,t,n){const i=t.offset,r=xP(t,e.options.strict,n);if(!r)return{value:"",type:null,comment:"",range:[i,i,i]};const a=r.mode===">"?at.BLOCK_FOLDED:at.BLOCK_LITERAL,o=t.source?vP(t.source):[];let u=o.length;for(let v=o.length-1;v>=0;--v){const N=o[v][1];if(N===""||N==="\r")u=v;else break}if(u===0){const v=r.chomp==="+"&&o.length>0?`
|
|
673
|
+
`.repeat(Math.max(1,o.length-1)):"";let N=i+r.length;return t.source&&(N+=t.source.length),{value:v,type:a,comment:r.comment,range:[i,N,N]}}let d=t.indent+r.indent,h=t.offset+r.length,g=0;for(let v=0;v<u;++v){const[N,k]=o[v];if(k===""||k==="\r")r.indent===0&&N.length>d&&(d=N.length);else{N.length<d&&n(h+N.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),r.indent===0&&(d=N.length),g=v,d===0&&!e.atRoot&&n(h,"BAD_INDENT","Block scalar values in collections must be indented");break}h+=N.length+k.length+1}for(let v=o.length-1;v>=u;--v)o[v][0].length>d&&(u=v+1);let p="",y="",b=!1;for(let v=0;v<g;++v)p+=o[v][0].slice(d)+`
|
|
674
|
+
`;for(let v=g;v<u;++v){let[N,k]=o[v];h+=N.length+k.length+1;const A=k[k.length-1]==="\r";if(A&&(k=k.slice(0,-1)),k&&N.length<d){const _=`Block scalar lines must not be less indented than their ${r.indent?"explicit indentation indicator":"first line"}`;n(h-k.length-(A?2:1),"BAD_INDENT",_),N=""}a===at.BLOCK_LITERAL?(p+=y+N.slice(d)+k,y=`
|
|
675
|
+
`):N.length>d||k[0]===" "?(y===" "?y=`
|
|
676
|
+
`:!b&&y===`
|
|
677
|
+
`&&(y=`
|
|
678
|
+
|
|
679
|
+
`),p+=y+N.slice(d)+k,y=`
|
|
680
|
+
`,b=!0):k===""?y===`
|
|
681
|
+
`?p+=`
|
|
682
|
+
`:y=`
|
|
683
|
+
`:(p+=y+k,y=" ",b=!1)}switch(r.chomp){case"-":break;case"+":for(let v=u;v<o.length;++v)p+=`
|
|
684
|
+
`+o[v][0].slice(d);p[p.length-1]!==`
|
|
685
|
+
`&&(p+=`
|
|
686
|
+
`);break;default:p+=`
|
|
687
|
+
`}const w=i+r.length+t.source.length;return{value:p,type:a,comment:r.comment,range:[i,w,w]}}function xP({offset:e,props:t},n,i){if(t[0].type!=="block-scalar-header")return i(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:r}=t[0],a=r[0];let o=0,u="",d=-1;for(let y=1;y<r.length;++y){const b=r[y];if(!u&&(b==="-"||b==="+"))u=b;else{const w=Number(b);!o&&w?o=w:d===-1&&(d=e+y)}}d!==-1&&i(d,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${r}`);let h=!1,g="",p=r.length;for(let y=1;y<t.length;++y){const b=t[y];switch(b.type){case"space":h=!0;case"newline":p+=b.source.length;break;case"comment":n&&!h&&i(b,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),p+=b.source.length,g=b.source.substring(1);break;case"error":i(b,"UNEXPECTED_TOKEN",b.message),p+=b.source.length;break;default:{const w=`Unexpected token in block scalar header: ${b.type}`;i(b,"UNEXPECTED_TOKEN",w);const v=b.source;v&&typeof v=="string"&&(p+=v.length)}}}return{mode:a,indent:o,chomp:u,comment:g,length:p}}function vP(e){const t=e.split(/\n( *)/),n=t[0],i=n.match(/^( *)/),a=[i!=null&&i[1]?[i[1],n.slice(i[1].length)]:["",n]];for(let o=1;o<t.length;o+=2)a.push([t[o],t[o+1]]);return a}function lj(e,t,n){const{offset:i,type:r,source:a,end:o}=e;let u,d;const h=(y,b,w)=>n(i+y,b,w);switch(r){case"scalar":u=at.PLAIN,d=wP(a,h);break;case"single-quoted-scalar":u=at.QUOTE_SINGLE,d=kP(a,h);break;case"double-quoted-scalar":u=at.QUOTE_DOUBLE,d=EP(a,h);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[i,i+a.length,i+a.length]}}const g=i+a.length,p=rd(o,g,t,n);return{value:d,type:u,comment:p.comment,range:[i,g,p.offset]}}function wP(e,t){let n="";switch(e[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${e[0]}`;break}case"@":case"`":{n=`reserved character ${e[0]}`;break}}return n&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),oj(e)}function kP(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),oj(e.slice(1,-1)).replace(/''/g,"'")}function oj(e){let t,n;try{t=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
688
|
+
`,"sy"),n=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
689
|
+
`,"sy")}catch{t=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let i=t.exec(e);if(!i)return e;let r=i[1],a=" ",o=t.lastIndex;for(n.lastIndex=o;i=n.exec(e);)i[1]===""?a===`
|
|
690
|
+
`?r+=a:a=`
|
|
691
|
+
`:(r+=a+i[1],a=" "),o=n.lastIndex;const u=/[ \t]*(.*)/sy;return u.lastIndex=o,i=u.exec(e),r+a+((i==null?void 0:i[1])??"")}function EP(e,t){let n="";for(let i=1;i<e.length-1;++i){const r=e[i];if(!(r==="\r"&&e[i+1]===`
|
|
692
|
+
`))if(r===`
|
|
693
|
+
`){const{fold:a,offset:o}=SP(e,i);n+=a,i=o}else if(r==="\\"){let a=e[++i];const o=NP[a];if(o)n+=o;else if(a===`
|
|
694
|
+
`)for(a=e[i+1];a===" "||a===" ";)a=e[++i+1];else if(a==="\r"&&e[i+1]===`
|
|
695
|
+
`)for(a=e[++i+1];a===" "||a===" ";)a=e[++i+1];else if(a==="x"||a==="u"||a==="U"){const u={x:2,u:4,U:8}[a];n+=_P(e,i+1,u,t),i+=u}else{const u=e.substr(i-1,2);t(i-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${u}`),n+=u}}else if(r===" "||r===" "){const a=i;let o=e[i+1];for(;o===" "||o===" ";)o=e[++i+1];o!==`
|
|
696
|
+
`&&!(o==="\r"&&e[i+2]===`
|
|
697
|
+
`)&&(n+=i>a?e.slice(a,i+1):r)}else n+=r}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function SP(e,t){let n="",i=e[t+1];for(;(i===" "||i===" "||i===`
|
|
698
|
+
`||i==="\r")&&!(i==="\r"&&e[t+2]!==`
|
|
699
|
+
`);)i===`
|
|
700
|
+
`&&(n+=`
|
|
701
|
+
`),t+=1,i=e[t+1];return n||(n=" "),{fold:n,offset:t}}const NP={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
702
|
+
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function _P(e,t,n,i){const r=e.substr(t,n),o=r.length===n&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,16):NaN;if(isNaN(o)){const u=e.substr(t-2,n+2);return i(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${u}`),u}return String.fromCodePoint(o)}function cj(e,t,n,i){const{value:r,type:a,comment:o,range:u}=t.type==="block-scalar"?aj(e,t,i):lj(t,e.options.strict,i),d=n?e.directives.tagName(n.source,p=>i(n,"TAG_RESOLVE_FAILED",p)):null;let h;e.options.stringKeys&&e.atKey?h=e.schema[Lr]:d?h=jP(e.schema,r,d,n,i):t.type==="scalar"?h=CP(e,r,t,i):h=e.schema[Lr];let g;try{const p=h.resolve(r,y=>i(n??t,"TAG_RESOLVE_FAILED",y),e.options);g=Gt(p)?p:new at(p)}catch(p){const y=p instanceof Error?p.message:String(p);i(n??t,"TAG_RESOLVE_FAILED",y),g=new at(r)}return g.range=u,g.source=r,a&&(g.type=a),d&&(g.tag=d),h.format&&(g.format=h.format),o&&(g.comment=o),g}function jP(e,t,n,i,r){var u;if(n==="!")return e[Lr];const a=[];for(const d of e.tags)if(!d.collection&&d.tag===n)if(d.default&&d.test)a.push(d);else return d;for(const d of a)if((u=d.test)!=null&&u.test(t))return d;const o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(r(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[Lr])}function CP({atKey:e,directives:t,schema:n},i,r,a){const o=n.tags.find(u=>{var d;return(u.default===!0||e&&u.default==="key")&&((d=u.test)==null?void 0:d.test(i))})||n[Lr];if(n.compat){const u=n.compat.find(d=>{var h;return d.default&&((h=d.test)==null?void 0:h.test(i))})??n[Lr];if(o.tag!==u.tag){const d=t.tagString(o.tag),h=t.tagString(u.tag),g=`Value may be parsed as either ${d} or ${h}`;a(r,"TAG_RESOLVE_FAILED",g,!0)}}return o}function AP(e,t,n){if(t){n??(n=t.length);for(let i=n-1;i>=0;--i){let r=t[i];switch(r.type){case"space":case"comment":case"newline":e-=r.source.length;continue}for(r=t[++i];(r==null?void 0:r.type)==="space";)e+=r.source.length,r=t[++i];break}}return e}const TP={composeNode:uj,composeEmptyNode:Nx};function uj(e,t,n,i){const r=e.atKey,{spaceBefore:a,comment:o,anchor:u,tag:d}=n;let h,g=!0;switch(t.type){case"alias":h=MP(e,t,i),(u||d)&&i(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":h=cj(e,t,d,i),u&&(h.anchor=u.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{h=bP(TP,e,t,n,i),u&&(h.anchor=u.source.substring(1))}catch(p){const y=p instanceof Error?p.message:String(p);i(t,"RESOURCE_EXHAUSTION",y)}break;default:{const p=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;i(t,"UNEXPECTED_TOKEN",p),g=!1}}return h??(h=Nx(e,t.offset,void 0,null,n,i)),u&&h.anchor===""&&i(u,"BAD_ALIAS","Anchor cannot be an empty string"),r&&e.options.stringKeys&&(!Gt(h)||typeof h.value!="string"||h.tag&&h.tag!=="tag:yaml.org,2002:str")&&i(d??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),a&&(h.spaceBefore=!0),o&&(t.type==="scalar"&&t.source===""?h.comment=o:h.commentBefore=o),e.options.keepSourceTokens&&g&&(h.srcToken=t),h}function Nx(e,t,n,i,{spaceBefore:r,comment:a,anchor:o,tag:u,end:d},h){const g={type:"scalar",offset:AP(t,n,i),indent:-1,source:""},p=cj(e,g,u,h);return o&&(p.anchor=o.source.substring(1),p.anchor===""&&h(o,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(p.spaceBefore=!0),a&&(p.comment=a,p.range[2]=d),p}function MP({options:e},{offset:t,source:n,end:i},r){const a=new np(n.substring(1));a.source===""&&r(t,"BAD_ALIAS","Alias cannot be an empty string"),a.source.endsWith(":")&&r(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const o=t+n.length,u=rd(i,o,e.strict,r);return a.range=[t,o,u.offset],u.comment&&(a.comment=u.comment),a}function DP(e,t,{offset:n,start:i,value:r,end:a},o){const u=Object.assign({_directives:t},e),d=new sc(void 0,u),h={atKey:!1,atRoot:!0,directives:d.directives,options:d.options,schema:d.schema},g=Fo(i,{indicator:"doc-start",next:r??(a==null?void 0:a[0]),offset:n,onError:o,parentIndent:0,startOnNewline:!0});g.found&&(d.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!g.hasNewline&&o(g.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),d.contents=r?uj(h,r,g,o):Nx(h,g.end,i,null,g,o);const p=d.contents.range[2],y=rd(a,p,!1,o);return y.comment&&(d.comment=y.comment),d.range=[n,p,y.offset],d}function nu(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];const{offset:t,source:n}=e;return[t,t+(typeof n=="string"?n.length:1)]}function hE(e){var r;let t="",n=!1,i=!1;for(let a=0;a<e.length;++a){const o=e[a];switch(o[0]){case"#":t+=(t===""?"":i?`
|
|
703
|
+
|
|
704
|
+
`:`
|
|
705
|
+
`)+(o.substring(1)||" "),n=!0,i=!1;break;case"%":((r=e[a+1])==null?void 0:r[0])!=="#"&&(a+=1),n=!1;break;default:n||(i=!0),n=!1}}return{comment:t,afterEmptyLine:i}}class _x{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,i,r,a)=>{const o=nu(n);a?this.warnings.push(new rj(o,i,r)):this.errors.push(new Za(o,i,r))},this.directives=new ti({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:i,afterEmptyLine:r}=hE(this.prelude);if(i){const a=t.contents;if(n)t.comment=t.comment?`${t.comment}
|
|
706
|
+
${i}`:i;else if(r||t.directives.docStart||!a)t.commentBefore=i;else if(on(a)&&!a.flow&&a.items.length>0){let o=a.items[0];en(o)&&(o=o.key);const u=o.commentBefore;o.commentBefore=u?`${i}
|
|
707
|
+
${u}`:i}else{const o=a.commentBefore;a.commentBefore=o?`${i}
|
|
708
|
+
${o}`:i}}n?(Array.prototype.push.apply(t.errors,this.errors),Array.prototype.push.apply(t.warnings,this.warnings)):(t.errors=this.errors,t.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:hE(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(t,n=!1,i=-1){for(const r of t)yield*this.next(r);yield*this.end(n,i)}*next(t){switch(t.type){case"directive":this.directives.add(t.source,(n,i,r)=>{const a=nu(t);a[0]+=n,this.onError(a,"BAD_DIRECTIVE",i,r)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=DP(this.options,this.directives,t,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{const n=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,i=new Za(nu(t),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(i):this.doc.errors.push(i);break}case"doc-end":{if(!this.doc){const i="Unexpected doc-end without preceding document";this.errors.push(new Za(nu(t),"UNEXPECTED_TOKEN",i));break}this.doc.directives.docEnd=!0;const n=rd(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){const i=this.doc.comment;this.doc.comment=i?`${i}
|
|
709
|
+
${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new Za(nu(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){const i=Object.assign({_directives:this.directives},this.options),r=new sc(void 0,i);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,n,n],this.decorate(r,!1),yield r}}}function OP(e,t=!0,n){if(e){const i=(r,a,o)=>{const u=typeof r=="number"?r:Array.isArray(r)?r[0]:r.offset;if(n)n(u,a,o);else throw new Za([u,u+1],a,o)};switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return lj(e,t,i);case"block-scalar":return aj({options:{strict:t}},e,i)}}return null}function RP(e,t){const{implicitKey:n=!1,indent:i,inFlow:r=!1,offset:a=-1,type:o="PLAIN"}=t,u=nd({type:o,value:e},{implicitKey:n,indent:i>0?" ".repeat(i):"",inFlow:r,options:{blockQuote:!0,lineWidth:-1}}),d=t.end??[{type:"newline",offset:-1,indent:i,source:`
|
|
710
|
+
`}];switch(u[0]){case"|":case">":{const h=u.indexOf(`
|
|
711
|
+
`),g=u.substring(0,h),p=u.substring(h+1)+`
|
|
712
|
+
`,y=[{type:"block-scalar-header",offset:a,indent:i,source:g}];return dj(y,d)||y.push({type:"newline",offset:-1,indent:i,source:`
|
|
713
|
+
`}),{type:"block-scalar",offset:a,indent:i,props:y,source:p}}case'"':return{type:"double-quoted-scalar",offset:a,indent:i,source:u,end:d};case"'":return{type:"single-quoted-scalar",offset:a,indent:i,source:u,end:d};default:return{type:"scalar",offset:a,indent:i,source:u,end:d}}}function LP(e,t,n={}){let{afterKey:i=!1,implicitKey:r=!1,inFlow:a=!1,type:o}=n,u="indent"in e?e.indent:null;if(i&&typeof u=="number"&&(u+=2),!o)switch(e.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{const h=e.props[0];if(h.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o=h.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}const d=nd({type:o,value:t},{implicitKey:r||u===null,indent:u!==null&&u>0?" ".repeat(u):"",inFlow:a,options:{blockQuote:!0,lineWidth:-1}});switch(d[0]){case"|":case">":zP(e,d);break;case'"':ey(e,d,"double-quoted-scalar");break;case"'":ey(e,d,"single-quoted-scalar");break;default:ey(e,d,"scalar")}}function zP(e,t){const n=t.indexOf(`
|
|
714
|
+
`),i=t.substring(0,n),r=t.substring(n+1)+`
|
|
715
|
+
`;if(e.type==="block-scalar"){const a=e.props[0];if(a.type!=="block-scalar-header")throw new Error("Invalid block scalar header");a.source=i,e.source=r}else{const{offset:a}=e,o="indent"in e?e.indent:-1,u=[{type:"block-scalar-header",offset:a,indent:o,source:i}];dj(u,"end"in e?e.end:void 0)||u.push({type:"newline",offset:-1,indent:o,source:`
|
|
716
|
+
`});for(const d of Object.keys(e))d!=="type"&&d!=="offset"&&delete e[d];Object.assign(e,{type:"block-scalar",indent:o,props:u,source:r})}}function dj(e,t){if(t)for(const n of t)switch(n.type){case"space":case"comment":e.push(n);break;case"newline":return e.push(n),!0}return!1}function ey(e,t,n){switch(e.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":e.type=n,e.source=t;break;case"block-scalar":{const i=e.props.slice(1);let r=t.length;e.props[0].type==="block-scalar-header"&&(r-=e.props[0].source.length);for(const a of i)a.offset+=r;delete e.props,Object.assign(e,{type:n,source:t,end:i});break}case"block-map":case"block-seq":{const r={type:"newline",offset:e.offset+t.length,indent:e.indent,source:`
|
|
717
|
+
`};delete e.items,Object.assign(e,{type:n,source:t,end:[r]});break}default:{const i="indent"in e?e.indent:-1,r="end"in e&&Array.isArray(e.end)?e.end.filter(a=>a.type==="space"||a.type==="comment"||a.type==="newline"):[];for(const a of Object.keys(e))a!=="type"&&a!=="offset"&&delete e[a];Object.assign(e,{type:n,indent:i,source:t,end:r})}}}const IP=e=>"type"in e?Th(e):uh(e);function Th(e){switch(e.type){case"block-scalar":{let t="";for(const n of e.props)t+=Th(n);return t+e.source}case"block-map":case"block-seq":{let t="";for(const n of e.items)t+=uh(n);return t}case"flow-collection":{let t=e.start.source;for(const n of e.items)t+=uh(n);for(const n of e.end)t+=n.source;return t}case"document":{let t=uh(e);if(e.end)for(const n of e.end)t+=n.source;return t}default:{let t=e.source;if("end"in e&&e.end)for(const n of e.end)t+=n.source;return t}}}function uh({start:e,key:t,sep:n,value:i}){let r="";for(const a of e)r+=a.source;if(t&&(r+=Th(t)),n)for(const a of n)r+=a.source;return i&&(r+=Th(i)),r}const pb=Symbol("break visit"),PP=Symbol("skip children"),fj=Symbol("remove item");function pl(e,t){"type"in e&&e.type==="document"&&(e={start:e.start,value:e.value}),hj(Object.freeze([]),e,t)}pl.BREAK=pb;pl.SKIP=PP;pl.REMOVE=fj;pl.itemAtPath=(e,t)=>{let n=e;for(const[i,r]of t){const a=n==null?void 0:n[i];if(a&&"items"in a)n=a.items[r];else return}return n};pl.parentCollection=(e,t)=>{const n=pl.itemAtPath(e,t.slice(0,-1)),i=t[t.length-1][0],r=n==null?void 0:n[i];if(r&&"items"in r)return r;throw new Error("Parent collection not found")};function hj(e,t,n){let i=n(t,e);if(typeof i=="symbol")return i;for(const r of["key","value"]){const a=t[r];if(a&&"items"in a){for(let o=0;o<a.items.length;++o){const u=hj(Object.freeze(e.concat([[r,o]])),a.items[o],n);if(typeof u=="number")o=u-1;else{if(u===pb)return pb;u===fj&&(a.items.splice(o,1),o-=1)}}typeof i=="function"&&r==="key"&&(i=i(t,e))}}return typeof i=="function"?i(t,e):i}const dp="\uFEFF",fp="",hp="",Mu="",BP=e=>!!e&&"items"in e,$P=e=>!!e&&(e.type==="scalar"||e.type==="single-quoted-scalar"||e.type==="double-quoted-scalar"||e.type==="block-scalar");function UP(e){switch(e){case dp:return"<BOM>";case fp:return"<DOC>";case hp:return"<FLOW_END>";case Mu:return"<SCALAR>";default:return JSON.stringify(e)}}function pj(e){switch(e){case dp:return"byte-order-mark";case fp:return"doc-mode";case hp:return"flow-error-end";case Mu:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
718
|
+
`:case`\r
|
|
719
|
+
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}const FP=Object.freeze(Object.defineProperty({__proto__:null,BOM:dp,DOCUMENT:fp,FLOW_END:hp,SCALAR:Mu,createScalarToken:RP,isCollection:BP,isScalar:$P,prettyToken:UP,resolveAsScalar:OP,setScalarValue:LP,stringify:IP,tokenType:pj,visit:pl},Symbol.toStringTag,{value:"Module"}));function ir(e){switch(e){case void 0:case" ":case`
|
|
720
|
+
`:case"\r":case" ":return!0;default:return!1}}const pE=new Set("0123456789ABCDEFabcdef"),qP=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Rf=new Set(",[]{}"),HP=new Set(` ,[]{}
|
|
721
|
+
\r `),ty=e=>!e||HP.has(e);class mj{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(t,n=!1){if(t){if(typeof t!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!n;let i=this.next??"stream";for(;i&&(n||this.hasChars(1));)i=yield*this.parseNext(i)}atLineEnd(){let t=this.pos,n=this.buffer[t];for(;n===" "||n===" ";)n=this.buffer[++t];return!n||n==="#"||n===`
|
|
722
|
+
`?!0:n==="\r"?this.buffer[t+1]===`
|
|
723
|
+
`:!1}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let n=this.buffer[t];if(this.indentNext>0){let i=0;for(;n===" ";)n=this.buffer[++i+t];if(n==="\r"){const r=this.buffer[i+t+1];if(r===`
|
|
724
|
+
`||!r&&!this.atEnd)return t+i+1}return n===`
|
|
725
|
+
`||i>=this.indentNext||!n&&!this.atEnd?t+i:-1}if(n==="-"||n==="."){const i=this.buffer.substr(t,3);if((i==="---"||i==="...")&&ir(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&t<this.pos)&&(t=this.buffer.indexOf(`
|
|
726
|
+
`,this.pos),this.lineEndPos=t),t===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[t-1]==="\r"&&(t-=1),this.buffer.substring(this.pos,t))}hasChars(t){return this.pos+t<=this.buffer.length}setNext(t){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=t,null}peek(t){return this.buffer.substr(this.pos,t)}*parseNext(t){switch(t){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let t=this.getLine();if(t===null)return this.setNext("stream");if(t[0]===dp&&(yield*this.pushCount(1),t=t.substring(1)),t[0]==="%"){let n=t.length,i=t.indexOf("#");for(;i!==-1;){const a=t[i-1];if(a===" "||a===" "){n=i-1;break}else i=t.indexOf("#",i+1)}for(;;){const a=t[n-1];if(a===" "||a===" ")n-=1;else break}const r=(yield*this.pushCount(n))+(yield*this.pushSpaces(!0));return yield*this.pushCount(t.length-r),this.pushNewline(),"stream"}if(this.atLineEnd()){const n=yield*this.pushSpaces(!0);return yield*this.pushCount(t.length-n),yield*this.pushNewline(),"stream"}return yield fp,yield*this.parseLineStart()}*parseLineStart(){const t=this.charAt(0);if(!t&&!this.atEnd)return this.setNext("line-start");if(t==="-"||t==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const n=this.peek(3);if((n==="---"||n==="...")&&ir(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,n==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!ir(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[t,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((t==="-"||t==="?"||t===":")&&ir(n)){const i=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=i,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const t=this.getLine();if(t===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(t[n]){case"#":yield*this.pushCount(t.length-n);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(ty),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(t.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,n,i=-1;do t=yield*this.pushNewline(),t>0?(n=yield*this.pushSpaces(!1),this.indentValue=i=n):n=0,n+=yield*this.pushSpaces(!0);while(t+n>0);const r=this.getLine();if(r===null)return this.setNext("flow");if((i!==-1&&i<this.indentNext&&r[0]!=="#"||i===0&&(r.startsWith("---")||r.startsWith("..."))&&ir(r[3]))&&!(i===this.indentNext-1&&this.flowLevel===1&&(r[0]==="]"||r[0]==="}")))return this.flowLevel=0,yield hp,yield*this.parseLineStart();let a=0;for(;r[a]===",";)a+=yield*this.pushCount(1),a+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(a+=yield*this.pushIndicators(),r[a]){case void 0:return"flow";case"#":return yield*this.pushCount(r.length-a),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(ty),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const o=this.charAt(1);if(this.flowKey||ir(o)||o===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const t=this.charAt(0);let n=this.buffer.indexOf(t,this.pos+1);if(t==="'")for(;n!==-1&&this.buffer[n+1]==="'";)n=this.buffer.indexOf("'",n+2);else for(;n!==-1;){let a=0;for(;this.buffer[n-1-a]==="\\";)a+=1;if(a%2===0)break;n=this.buffer.indexOf('"',n+1)}const i=this.buffer.substring(0,n);let r=i.indexOf(`
|
|
727
|
+
`,this.pos);if(r!==-1){for(;r!==-1;){const a=this.continueScalar(r+1);if(a===-1)break;r=i.indexOf(`
|
|
728
|
+
`,a)}r!==-1&&(n=r-(i[r-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.setNext("quoted-scalar");n=this.buffer.length}return yield*this.pushToIndex(n+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let t=this.pos;for(;;){const n=this.buffer[++t];if(n==="+")this.blockScalarKeep=!0;else if(n>"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>ir(n)||n==="#")}*parseBlockScalar(){let t=this.pos-1,n=0,i;e:for(let a=this.pos;i=this.buffer[a];++a)switch(i){case" ":n+=1;break;case`
|
|
729
|
+
`:t=a,n=0;break;case"\r":{const o=this.buffer[a+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
|
|
730
|
+
`)break}default:break e}if(!i&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const a=this.continueScalar(t+1);if(a===-1)break;t=this.buffer.indexOf(`
|
|
731
|
+
`,a)}while(t!==-1);if(t===-1){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let r=t+1;for(i=this.buffer[r];i===" ";)i=this.buffer[++r];if(i===" "){for(;i===" "||i===" "||i==="\r"||i===`
|
|
732
|
+
`;)i=this.buffer[++r];t=r-1}else if(!this.blockScalarKeep)do{let a=t-1,o=this.buffer[a];o==="\r"&&(o=this.buffer[--a]);const u=a;for(;o===" ";)o=this.buffer[--a];if(o===`
|
|
733
|
+
`&&a>=this.pos&&a+1+n>u)t=a;else break}while(!0);return yield Mu,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const t=this.flowLevel>0;let n=this.pos-1,i=this.pos-1,r;for(;r=this.buffer[++i];)if(r===":"){const a=this.buffer[i+1];if(ir(a)||t&&Rf.has(a))break;n=i}else if(ir(r)){let a=this.buffer[i+1];if(r==="\r"&&(a===`
|
|
734
|
+
`?(i+=1,r=`
|
|
735
|
+
`,a=this.buffer[i+1]):n=i),a==="#"||t&&Rf.has(a))break;if(r===`
|
|
736
|
+
`){const o=this.continueScalar(i+1);if(o===-1)break;i=Math.max(i,o-2)}}else{if(t&&Rf.has(r))break;n=i}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield Mu,yield*this.pushToIndex(n+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,n){const i=this.buffer.slice(this.pos,t);return i?(yield i,this.pos+=i.length,i.length):(n&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(ty))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const t=this.flowLevel>0,n=this.charAt(1);if(ir(n)||t&&Rf.has(n))return t?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,n=this.buffer[t];for(;!ir(n)&&n!==">";)n=this.buffer[++t];return yield*this.pushToIndex(n===">"?t+1:t,!1)}else{let t=this.pos+1,n=this.buffer[t];for(;n;)if(qP.has(n))n=this.buffer[++t];else if(n==="%"&&pE.has(this.buffer[t+1])&&pE.has(this.buffer[t+2]))n=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){const t=this.buffer[this.pos];return t===`
|
|
737
|
+
`?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===`
|
|
738
|
+
`?yield*this.pushCount(2):0}*pushSpaces(t){let n=this.pos-1,i;do i=this.buffer[++n];while(i===" "||t&&i===" ");const r=n-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=n),r}*pushUntil(t){let n=this.pos,i=this.buffer[n];for(;!t(i);)i=this.buffer[++n];return yield*this.pushToIndex(n,!1)}}class gj{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,i=this.lineStarts.length;for(;n<i;){const a=n+i>>1;this.lineStarts[a]<t?n=a+1:i=a}if(this.lineStarts[n]===t)return{line:n+1,col:1};if(n===0)return{line:0,col:t};const r=this.lineStarts[n-1];return{line:n,col:t-r+1}}}}function oa(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function mE(e){for(let t=0;t<e.length;++t)switch(e[t].type){case"space":case"comment":case"newline":break;default:return t}return-1}function yj(e){switch(e==null?void 0:e.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Lf(e){switch(e.type){case"document":return e.start;case"block-map":{const t=e.items[e.items.length-1];return t.sep??t.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function oo(e){var n;if(e.length===0)return[];let t=e.length;e:for(;--t>=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;((n=e[++t])==null?void 0:n.type)==="space";);return e.splice(t,e.length)}function gE(e){if(e.start.type==="flow-seq-start")for(const t of e.items)t.sep&&!t.value&&!oa(t.start,"explicit-key-ind")&&!oa(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,yj(t.value)?t.value.end?Array.prototype.push.apply(t.value.end,t.sep):t.value.end=t.sep:Array.prototype.push.apply(t.start,t.sep),delete t.sep)}class jx{constructor(t){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new mj,this.onNewLine=t}*parse(t,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const i of this.lexer.lex(t,n))yield*this.next(i);n||(yield*this.end())}*next(t){if(this.source=t,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=t.length;return}const n=pj(t);if(n)if(n==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=n,yield*this.step(),n){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+t.length);break;case"space":this.atNewLine&&t[0]===" "&&(this.indent+=t.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=t.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=t.length}else{const i=`Not a YAML token: ${t}`;yield*this.pop({type:"error",offset:this.offset,message:i,source:t}),this.offset+=t.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const t=this.peek(1);if(this.type==="doc-end"&&(t==null?void 0:t.type)!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}peek(t){return this.stack[this.stack.length-t]}*pop(t){const n=t??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{const i=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in i?i.indent:0:n.type==="flow-collection"&&i.type==="document"&&(n.indent=0),n.type==="flow-collection"&&gE(n),i.type){case"document":i.value=n;break;case"block-scalar":i.props.push(n);break;case"block-map":{const r=i.items[i.items.length-1];if(r.value){i.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(r.sep)r.value=n;else{Object.assign(r,{key:n,sep:[]}),this.onKeyLine=!r.explicitKey;return}break}case"block-seq":{const r=i.items[i.items.length-1];r.value?i.items.push({start:[],value:n}):r.value=n;break}case"flow-collection":{const r=i.items[i.items.length-1];!r||r.value?i.items.push({start:[],key:n,sep:[]}):r.sep?r.value=n:Object.assign(r,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((i.type==="document"||i.type==="block-map"||i.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){const r=n.items[n.items.length-1];r&&!r.sep&&!r.value&&r.start.length>0&&mE(r.start)===-1&&(n.indent===0||r.start.every(a=>a.type!=="comment"||a.indent<n.indent))&&(i.type==="document"?i.end=r.start:i.items.push({start:r.start}),n.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{const t={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&t.start.push(this.sourceToken),this.stack.push(t);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(t){if(t.value)return yield*this.lineEnd(t);switch(this.type){case"doc-start":{mE(t.start)!==-1?(yield*this.pop(),yield*this.step()):t.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":t.start.push(this.sourceToken);return}const n=this.startBlockValue(t);n?this.stack.push(n):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(t){if(this.type==="map-value-ind"){const n=Lf(this.peek(2)),i=oo(n);let r;t.end?(r=t.end,r.push(this.sourceToken),delete t.end):r=[this.sourceToken];const a={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:i,key:t,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(t)}*blockScalar(t){switch(this.type){case"space":case"comment":case"newline":t.props.push(this.sourceToken);return;case"scalar":if(t.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let n=this.source.indexOf(`
|
|
739
|
+
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
740
|
+
`,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){var i;const n=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){const r="end"in n.value?n.value.end:void 0,a=Array.isArray(r)?r[r.length-1]:void 0;(a==null?void 0:a.type)==="comment"?r==null||r.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,t.indent)){const r=t.items[t.items.length-2],a=(i=r==null?void 0:r.value)==null?void 0:i.end;if(Array.isArray(a)){Array.prototype.push.apply(a,n.start),a.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=t.indent){const r=!this.onKeyLine&&this.indent===t.indent,a=r&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let o=[];if(a&&n.sep&&!n.value){const u=[];for(let d=0;d<n.sep.length;++d){const h=n.sep[d];switch(h.type){case"newline":u.push(d);break;case"space":break;case"comment":h.indent>t.indent&&(u.length=0);break;default:u.length=0}}u.length>=2&&(o=n.sep.splice(u[1]))}switch(this.type){case"anchor":case"tag":a||n.value?(o.push(this.sourceToken),t.items.push({start:o}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):a||n.value?(o.push(this.sourceToken),t.items.push({start:o,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(oa(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(yj(n.key)&&!oa(n.sep,"newline")){const u=oo(n.start),d=n.key,h=n.sep;h.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:u,key:d,sep:h}]})}else o.length>0?n.sep=n.sep.concat(o,this.sourceToken):n.sep.push(this.sourceToken);else if(oa(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const u=oo(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:u,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||a?t.items.push({start:o,key:null,sep:[this.sourceToken]}):oa(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const u=this.flowScalar(this.type);a||n.value?(t.items.push({start:o,key:u,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(u):(Object.assign(n,{key:u,sep:[]}),this.onKeyLine=!0);return}default:{const u=this.startBlockValue(t);if(u){if(u.type==="block-seq"){if(!n.explicitKey&&n.sep&&!oa(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else r&&t.items.push({start:o});this.stack.push(u);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){var i;const n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){const r="end"in n.value?n.value.end:void 0,a=Array.isArray(r)?r[r.length-1]:void 0;(a==null?void 0:a.type)==="comment"?r==null||r.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){const r=t.items[t.items.length-2],a=(i=r==null?void 0:r.value)==null?void 0:i.end;if(Array.isArray(a)){Array.prototype.push.apply(a,n.start),a.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||oa(n.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>t.indent){const r=this.startBlockValue(t);if(r){this.stack.push(r);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){const n=t.items[t.items.length-1];if(this.type==="flow-error-end"){let i;do yield*this.pop(),i=this.peek(1);while((i==null?void 0:i.type)==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?t.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const r=this.flowScalar(this.type);!n||n.value?t.items.push({start:[],key:r,sep:[]}):n.sep?this.stack.push(r):Object.assign(n,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}const i=this.startBlockValue(t);i?this.stack.push(i):(yield*this.pop(),yield*this.step())}else{const i=this.peek(2);if(i.type==="block-map"&&(this.type==="map-value-ind"&&i.indent===t.indent||this.type==="newline"&&!i.items[i.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&i.type!=="flow-collection"){const r=Lf(i),a=oo(r);gE(t);const o=t.end.splice(1,t.end.length);o.push(this.sourceToken);const u={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:a,key:t,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=u}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(`
|
|
741
|
+
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
742
|
+
`,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const n=Lf(t),i=oo(n);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const n=Lf(t),i=oo(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(i=>i.type==="newline"||i.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function bj(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new gj||null,prettyErrors:t}}function KP(e,t={}){const{lineCounter:n,prettyErrors:i}=bj(t),r=new jx(n==null?void 0:n.addNewLine),a=new _x(t),o=Array.from(a.compose(r.parse(e)));if(i&&n)for(const u of o)u.errors.forEach(Ah(e,n)),u.warnings.forEach(Ah(e,n));return o.length>0?o:Object.assign([],{empty:!0},a.streamInfo())}function xj(e,t={}){const{lineCounter:n,prettyErrors:i}=bj(t),r=new jx(n==null?void 0:n.addNewLine),a=new _x(t);let o=null;for(const u of a.compose(r.parse(e),!0,e.length))if(!o)o=u;else if(o.options.logLevel!=="silent"){o.errors.push(new Za(u.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&n&&(o.errors.forEach(Ah(e,n)),o.warnings.forEach(Ah(e,n))),o}function GP(e,t,n){let i;typeof t=="function"?i=t:n===void 0&&t&&typeof t=="object"&&(n=t);const r=xj(e,n);if(!r)return null;if(r.warnings.forEach(a=>I_(r.options.logLevel,a)),r.errors.length>0){if(r.options.logLevel!=="silent")throw r.errors[0];r.errors=[]}return r.toJS(Object.assign({reviver:i},n))}function VP(e,t,n){let i=null;if(typeof t=="function"||Array.isArray(t)?i=t:n===void 0&&t&&(n=t),typeof n=="string"&&(n=n.length),typeof n=="number"){const r=Math.round(n);n=r<1?void 0:r>8?{indent:8}:{indent:r}}if(e===void 0){const{keepUndefined:r}=n??t??{};if(!r)return}return kl(e)&&!i?e.toString(n):new sc(e,i,n).toString(n)}const yE=Object.freeze(Object.defineProperty({__proto__:null,Alias:np,CST:FP,Composer:_x,Document:sc,Lexer:mj,LineCounter:gj,Pair:Vn,Parser:jx,Scalar:at,Schema:nj,YAMLError:Sx,YAMLMap:Ni,YAMLParseError:Za,YAMLSeq:ka,YAMLWarning:rj,isAlias:Sa,isCollection:on,isDocument:kl,isMap:tc,isNode:un,isPair:en,isScalar:Gt,isSeq:nc,parse:GP,parseAllDocuments:KP,parseDocument:xj,stringify:VP,visit:El,visitAsync:tp},Symbol.toStringTag,{value:"Module"}));function YP({projectName:e,file:t,onClose:n,onSaved:i}){const r=Ie(),a=Ft(),{alert:o}=dn(),{data:u,isLoading:d,isError:h,error:g,refetch:p}=Ve({queryKey:["pipeline-file",e,t],queryFn:()=>wI(e,t)}),[y,b]=j.useState("structured"),[w,v]=j.useState(null),[N,k]=j.useState(null);j.useEffect(()=>{u&&w===null&&(v(u.content),k(u.etag),u.parseError&&b("yaml"))},[u,w]),j.useEffect(()=>{const R=O=>{O.key==="Escape"&&n()};return window.addEventListener("keydown",R),()=>window.removeEventListener("keydown",R)},[n]);const A=Et({mutationFn:()=>{if(w===null||N===null)throw new Error("no draft");return kI(e,t,w,N)},onSuccess:R=>{k(R.etag),a.invalidateQueries({queryKey:["pipeline-file",e,t]}),a.invalidateQueries({queryKey:["project-pipelines",e]}),i()},onError:R=>{const O=R.status;o({title:r(O===409?"pipelineEditor.error.conflict.title":O===422?"pipelineEditor.error.yaml.title":"pipelineEditor.error.save.title"),body:R instanceof Error?R.message:String(R)})}}),S=w!==null&&u&&w!==u.content,{parsed:_,parseError:C}=j.useMemo(()=>{if(w===null)return{parsed:null,parseError:null};try{return{parsed:yE.parse(w)??{},parseError:null}}catch(R){return{parsed:null,parseError:R instanceof Error?R.message:String(R)}}},[w]),T=R=>{try{const O=yE.stringify(R,{lineWidth:0});v(O)}catch(O){o({title:r("pipelineEditor.error.serialize.title"),body:O instanceof Error?O.message:String(O)})}};return c.jsx("div",{role:"dialog","aria-modal":"true",className:"fixed inset-0 z-40 flex items-start justify-center p-6 bg-black/30 overflow-auto",children:c.jsxs("div",{className:"nb-card mt-8 w-full max-w-4xl flex flex-col",style:{maxHeight:"calc(100vh - 64px)"},children:[c.jsxs("header",{className:"flex items-start justify-between gap-3 mb-3 flex-shrink-0",children:[c.jsxs("div",{children:[c.jsxs("h2",{className:"font-[family-name:var(--font-heading)] text-2xl font-bold flex items-center gap-2",children:[c.jsx(Dk,{size:20,strokeWidth:2.5}),c.jsx("code",{className:"font-[family-name:var(--font-mono)] text-lg",children:t}),(u==null?void 0:u.isActive)&&c.jsx("span",{className:"nb-status",style:{background:"var(--color-running-bg)",color:"var(--color-running)",padding:"2px 8px"},children:r("pipelineEditor.activeBadge")})]}),c.jsxs("p",{className:"text-xs text-[var(--color-text-muted)] font-[family-name:var(--font-mono)] mt-1",children:[e,"/pipelines/",t,N&&` · etag ${N}`]})]}),c.jsx("button",{className:"nb-btn nb-btn-mint p-2",onClick:n,type:"button","aria-label":r("pipelineEditor.close"),children:c.jsx(Jt,{size:14,strokeWidth:3})})]}),d&&c.jsx("p",{className:"text-[var(--color-text-muted)]",children:r("common.loading")}),h&&c.jsx("p",{className:"text-[var(--color-crashed)]",children:r("pipelineEditor.error.load",{detail:g instanceof Error?g.message:String(g)})}),u&&w!==null&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex items-center gap-3 mb-3 flex-shrink-0 flex-wrap",children:[c.jsxs("div",{className:"flex gap-1 p-1 bg-[var(--color-bg)] border-[2px] border-[var(--color-text)] rounded-full shadow-[2px_2px_0_var(--color-text)]",children:[c.jsxs("button",{type:"button",onClick:()=>b("structured"),"aria-pressed":y==="structured",disabled:!!C,className:["px-3 py-1 rounded-full text-xs font-bold flex items-center gap-1.5",y==="structured"?"bg-[var(--color-primary)] text-[var(--color-text)] shadow-[1px_1px_0_var(--color-text)]":"text-[var(--color-text-muted)]",C?"opacity-50 cursor-not-allowed":""].join(" "),title:C??void 0,children:[c.jsx(ed,{size:11,strokeWidth:2.5}),r("pipelineEditor.mode.structured")]}),c.jsxs("button",{type:"button",onClick:()=>b("yaml"),"aria-pressed":y==="yaml",className:["px-3 py-1 rounded-full text-xs font-bold flex items-center gap-1.5",y==="yaml"?"bg-[var(--color-primary)] text-[var(--color-text)] shadow-[1px_1px_0_var(--color-text)]":"text-[var(--color-text-muted)]"].join(" "),children:[c.jsx(Dk,{size:11,strokeWidth:2.5}),r("pipelineEditor.mode.yaml")]})]}),C&&c.jsxs("div",{className:"flex items-center gap-1 text-xs text-[var(--color-crashed)] font-bold",children:[c.jsx(ju,{size:12,strokeWidth:2.5}),r("pipelineEditor.parseError.prefix",{detail:C})]}),(u==null?void 0:u.isActive)&&c.jsx("span",{className:"text-xs text-[var(--color-stuck)] font-bold ml-auto",children:r("pipelineEditor.activeWarning")})]}),c.jsxs("div",{className:"flex-1 overflow-auto",children:[y==="structured"&&_&&c.jsx(WP,{parsed:_,onChange:T}),y==="yaml"&&c.jsx("textarea",{className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",style:{minHeight:400,resize:"vertical"},value:w,onChange:R=>v(R.target.value),spellCheck:!1,"aria-label":r("pipelineEditor.yamlAria")})]}),c.jsxs("div",{className:"flex items-center justify-between mt-3 pt-3 border-t-2 border-dashed border-[var(--color-text)] flex-shrink-0",children:[c.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:S?c.jsx("span",{className:"text-[var(--color-stuck)] font-bold",children:r("pipelineEditor.status.unsaved")}):A.isSuccess?c.jsxs("span",{className:"text-[var(--color-running)] font-bold flex items-center gap-1",children:[c.jsx(Cu,{size:12,strokeWidth:2.5})," ",r("pipelineEditor.status.saved")]}):r("pipelineEditor.status.noChanges")}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("button",{className:"nb-btn",style:{padding:"6px 14px"},onClick:()=>{v(null),p()},disabled:A.isPending,type:"button",children:r("pipelineEditor.reload")}),c.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"6px 14px"},onClick:()=>A.mutate(),disabled:!S||A.isPending,type:"button","aria-label":r("pipelineEditor.saveAria"),children:[A.isPending?c.jsx(Xe,{size:13,strokeWidth:3,className:"animate-spin"}):c.jsx(mr,{size:13,strokeWidth:3}),r("pipelineEditor.save")]})]})]})]})]})})}function WP({parsed:e,onChange:t}){const n=Ie(),i=e.stages??[],r=h=>{t({...e,stages:h})},a=()=>{r([...i,{name:`stage-${i.length+1}`,on_complete:"move_card Done"}])},o=h=>{r(i.filter((g,p)=>p!==h))},u=(h,g)=>{const p=[...i],y=h+g;y<0||y>=p.length||([p[h],p[y]]=[p[y],p[h]],r(p))},d=(h,g)=>{r(i.map((p,y)=>y===h?{...p,...g}:p))};return c.jsxs("div",{className:"flex flex-col gap-4",children:[c.jsxs("div",{className:"flex bg-surface-input items-center gap-3 p-3 border-2 border-[var(--color-text)] rounded-lg",children:[c.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[c.jsx("span",{className:"font-bold",children:"mode:"}),c.jsxs("select",{className:"nb-input",style:{padding:"4px 10px",fontSize:12},value:e.mode??"project",onChange:h=>t({...e,mode:h.target.value}),children:[c.jsx("option",{value:"project",children:"project"}),c.jsx("option",{value:"steps",children:"steps"})]})]}),c.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:n("pipelineEditor.modeHint")})]}),c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsx("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold uppercase tracking-wider",children:n("pipelineEditor.stages.heading",{count:i.length})}),c.jsxs("button",{type:"button",className:"nb-btn nb-btn-mint",style:{padding:"4px 12px",fontSize:12},onClick:a,"aria-label":n("pipelineEditor.stages.add"),children:[c.jsx(pi,{size:11,strokeWidth:3})," ",n("pipelineEditor.stages.add")]})]}),i.length===0?c.jsx("p",{className:"text-sm text-[var(--color-text-muted)] italic p-4 border-2 border-dashed border-[var(--color-text)] rounded-lg text-center",children:n("pipelineEditor.stages.empty")}):c.jsx("div",{className:"flex flex-col gap-3",children:i.map((h,g)=>c.jsx(QP,{stage:h,index:g,total:i.length,onChange:p=>d(g,p),onRemove:()=>o(g),onMoveUp:()=>u(g,-1),onMoveDown:()=>u(g,1)},g))})]})]})}function QP({stage:e,index:t,total:n,onChange:i,onRemove:r,onMoveUp:a,onMoveDown:o}){const u=Ie(),d=e.on_fail??{};return c.jsxs("div",{className:"nb-card bg-[var(--color-bg-cream)] p-4",children:[c.jsxs("div",{className:"flex items-center justify-between mb-3",children:[c.jsxs("h4",{className:"font-[family-name:var(--font-heading)] font-bold text-sm",children:["Stage #",t+1,e.name&&c.jsx("code",{className:"ml-2 text-xs font-[family-name:var(--font-mono)] bg-[var(--color-bg)] border-2 border-[var(--color-text)] px-2 py-0.5 rounded",children:e.name})]}),c.jsxs("div",{className:"flex gap-1",children:[c.jsx("button",{type:"button",className:"nb-btn",style:{padding:"3px 8px"},onClick:a,disabled:t===0,"aria-label":u("pipelineEditor.stage.moveUp"),children:c.jsx(Z3,{size:12,strokeWidth:3})}),c.jsx("button",{type:"button",className:"nb-btn",style:{padding:"3px 8px"},onClick:o,disabled:t===n-1,"aria-label":u("pipelineEditor.stage.moveDown"),children:c.jsx(Ju,{size:12,strokeWidth:3})}),c.jsx("button",{type:"button",className:"nb-btn nb-btn-danger",style:{padding:"3px 8px"},onClick:r,"aria-label":u("pipelineEditor.stage.remove"),children:c.jsx(Ki,{size:12,strokeWidth:3})})]})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[c.jsx(ta,{label:"name",hint:u("pipelineEditor.stage.name.hint"),children:c.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",value:e.name??"",onChange:h=>i({name:h.target.value}),placeholder:"develop"})}),c.jsx(ta,{label:"profile",hint:u("pipelineEditor.stage.profile.hint"),children:c.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",value:e.profile??"",onChange:h=>i({profile:h.target.value||void 0}),placeholder:"fullstack"})}),c.jsx(ta,{label:"card_state",hint:u("pipelineEditor.stage.cardState.hint"),children:c.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",value:e.card_state??"",onChange:h=>i({card_state:h.target.value||void 0}),placeholder:"Inprogress"})}),c.jsx(ta,{label:"timeout",hint:u("pipelineEditor.stage.timeout.hint"),children:c.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",value:e.timeout??"",onChange:h=>i({timeout:h.target.value||void 0}),placeholder:"2h"})}),c.jsx(ta,{label:"trigger",hint:u("pipelineEditor.stage.trigger.hint"),children:c.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",value:e.trigger??"",onChange:h=>i({trigger:h.target.value||void 0}),placeholder:"card_enters 'Todo'"})}),c.jsx(ta,{label:"on_complete",hint:u("pipelineEditor.stage.onComplete.hint"),children:c.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",value:e.on_complete??"",onChange:h=>i({on_complete:h.target.value}),placeholder:"move_card Done"})})]}),c.jsxs("div",{className:"mt-4 pt-3 border-t-2 border-dashed border-[var(--color-text)]",children:[c.jsx("h5",{className:"text-xs font-bold uppercase tracking-wider mb-2 text-[var(--color-text-muted)]",children:"on_fail"}),c.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[c.jsx(ta,{label:"action",hint:u("pipelineEditor.stage.onFail.action.hint"),children:c.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",value:d.action??"",onChange:h=>i({on_fail:{...d,action:h.target.value||void 0}}),placeholder:"label NEEDS-FIX"})}),c.jsx(ta,{label:"comment",hint:u("pipelineEditor.stage.onFail.comment.hint"),children:c.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",value:d.comment??"",onChange:h=>i({on_fail:{...d,comment:h.target.value||void 0}}),placeholder:"Worker failed. Check logs."})})]}),c.jsxs("label",{className:"flex items-center gap-2 mt-3 text-sm cursor-pointer",children:[c.jsx("input",{type:"checkbox",checked:d.halt??!0,onChange:h=>i({on_fail:{...d,halt:h.target.checked}})}),c.jsx("span",{className:"font-bold",children:"halt"}),c.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:u("pipelineEditor.stage.halt.note")})]})]})]})}function ta({label:e,hint:t,children:n}){return c.jsxs("label",{className:"flex flex-col gap-1",children:[c.jsx("span",{className:"text-xs font-bold font-[family-name:var(--font-mono)]",children:e}),n,t&&c.jsx("span",{className:"text-[10px] text-[var(--color-text-muted)]",children:t})]})}function XP({onCancel:e,onCreate:t,hasActive:n,hasSample:i,isPending:r}){const a=Ie(),[o,u]=j.useState(""),[d,h]=j.useState("blank");j.useEffect(()=>{const N=k=>{k.key==="Escape"&&e()};return window.addEventListener("keydown",N),()=>window.removeEventListener("keydown",N)},[e]);const g=o.trim(),p=g.endsWith(".yaml")?g:g?`${g}.yaml`:"",y=p&&/^[a-zA-Z0-9_.-]+\.yaml$/.test(p),b=()=>{!y||r||t(p,d)},v=a("newPipelineDialog.field.filename.help",{filename:"__FN__"}).split("__FN__");return c.jsx("div",{role:"dialog","aria-modal":"true",className:"fixed inset-0 z-50 flex items-center justify-center p-6 bg-black/30",children:c.jsxs("div",{className:"nb-card max-w-md w-full",children:[c.jsxs("header",{className:"flex items-start justify-between mb-4",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold",children:a("newPipelineDialog.title")}),c.jsx("button",{className:"nb-btn nb-btn-mint p-2",onClick:e,type:"button","aria-label":a("common.close"),children:c.jsx(Jt,{size:14,strokeWidth:3})})]}),c.jsxs("form",{onSubmit:N=>{N.preventDefault(),b()},className:"flex flex-col gap-4",children:[c.jsxs("label",{className:"flex flex-col gap-1.5",children:[c.jsx("span",{className:"text-sm font-bold",children:a("newPipelineDialog.field.filename.label")}),c.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)]",placeholder:a("newPipelineDialog.field.filename.placeholder"),value:o,onChange:N=>u(N.target.value),autoFocus:!0}),c.jsxs("span",{className:"text-xs text-[var(--color-text-muted)]",children:[v[0],c.jsx("code",{className:"font-[family-name:var(--font-mono)]",children:p||"xxx.yaml"}),v[1]]})]}),c.jsxs("fieldset",{className:"flex flex-col gap-2",children:[c.jsx("legend",{className:"text-sm font-bold mb-1",children:a("newPipelineDialog.section.template")}),c.jsx(ny,{value:"blank",current:d,label:a("newPipelineDialog.template.blank.label"),desc:a("newPipelineDialog.template.blank.desc"),onSelect:h}),c.jsx(ny,{value:"sample",current:d,label:a("newPipelineDialog.template.sample.label"),desc:a("newPipelineDialog.template.sample.desc"),onSelect:h,disabled:!i,disabledReason:a("newPipelineDialog.template.sample.unavailable")}),c.jsx(ny,{value:"active",current:d,label:a("newPipelineDialog.template.active.label"),desc:a("newPipelineDialog.template.active.desc"),onSelect:h,disabled:!n,disabledReason:a("newPipelineDialog.template.active.unavailable")})]}),c.jsxs("div",{className:"flex gap-3 justify-end pt-2",children:[c.jsx("button",{className:"nb-btn",onClick:e,type:"button",disabled:r,children:a("common.cancel")}),c.jsxs("button",{className:"nb-btn nb-btn-primary",type:"submit",disabled:!y||r,"aria-label":a("newPipelineDialog.create.aria"),children:[r?c.jsx(Xe,{size:13,strokeWidth:3,className:"animate-spin"}):c.jsx(pi,{size:13,strokeWidth:3}),a("common.create")]})]})]})]})})}function ny({value:e,current:t,label:n,desc:i,onSelect:r,disabled:a,disabledReason:o}){const u=t===e;return c.jsxs("label",{className:["flex items-start gap-2 p-2 rounded-lg border-2 cursor-pointer",a?"border-[var(--color-border-light)] opacity-50 cursor-not-allowed":u?"bg-[var(--color-accent-mint)] border-[var(--color-text)] shadow-[2px_2px_0_var(--color-text)]":"border-[var(--color-border-light)] hover:bg-[var(--color-bg-cream)] hover:border-[var(--color-text)]"].join(" "),children:[c.jsx("input",{type:"radio",name:"pipeline-template",value:e,checked:u,disabled:a,onChange:()=>r(e),className:"mt-1 flex-shrink-0"}),c.jsxs("div",{className:"flex-1",children:[c.jsx("div",{className:"text-sm font-bold",children:n}),c.jsx("div",{className:"text-xs text-[var(--color-text-muted)]",children:a?o:i})]})]})}function ZP(e){return ct(`/api/rules/${encodeURIComponent(e)}`)}function bE(e){return Array.isArray(e)?e.map(t=>String(t).trim()).filter(Boolean):typeof e=="string"?e.split(",").map(t=>t.trim()).filter(Boolean):[]}function JP(e){return typeof e=="string"&&["language","domain","persona","workflow","engine","genre","platform","review","meta","other"].includes(e)?e:"other"}function dh(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}function Cx(e){const t=dh(e);return{name:typeof t.name=="string"?t.name:"",category:JP(t.category),tags:bE(t.tags),description:typeof t.description=="string"?t.description:"",origin:typeof t.origin=="string"?t.origin:"",linkedProjects:bE(t.linkedProjects),stateInProject:t.stateInProject==="absent"||t.stateInProject==="linked"||t.stateInProject==="frozen"?t.stateInProject:void 0}}function e6(e){const t=dh(e);return{...Cx(t),body:typeof t.body=="string"?t.body:"",references:Array.isArray(t.references)?t.references.map(i=>{const r=dh(i);return{name:typeof r.name=="string"?r.name:"",lines:typeof r.lines=="number"?r.lines:0}}).filter(i=>i.name):[],linkedProjects:Array.isArray(t.linkedProjects)?t.linkedProjects.map(i=>{const r=dh(i),a=r.state==="frozen"?"frozen":"linked";return{project:typeof r.project=="string"?r.project:"",state:a}}).filter(i=>i.project):[]}}function t6(e){return{data:Array.isArray(e.data)?e.data.map(Cx).filter(t=>t.name):[]}}async function Ax(e){const t=e?`?project=${encodeURIComponent(e)}`:"",n=await ct(`/api/skills${t}`);return t6(n)}async function n6(e){const t=await ct(`/api/skills/${encodeURIComponent(e)}`);return e6(t)}function i6(e,t){return ct(`/api/skills/${encodeURIComponent(e)}/references/${encodeURIComponent(t)}`)}async function r6(e,t){const n=await fetch(`/api/skills/${encodeURIComponent(e)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:t})});if(!n.ok)throw new Error(`${n.status}: ${await n.text()}`)}function s6(e){return d_(`/api/skills/${encodeURIComponent(e)}`)}function a6(e){return gr(`/api/skills/${encodeURIComponent(e)}/translate`)}async function l6(e,t){const n=await fetch(e,{method:"POST",headers:void 0,body:void 0});if(!n.ok)throw new Error(`${n.status}: ${await n.text()}`);return n.json().catch(()=>({}))}function o6(){return l6("/api/skills/sync")}async function c6(e){const t=await ct(`/api/skills/policy/${encodeURIComponent(e)}`);return{data:{...t.data,skills:Array.isArray(t.data.skills)?t.data.skills.map(Cx).filter(n=>n.name):[]}}}function u6(e,t){return ux(`/api/skills/policy/${encodeURIComponent(e)}`,t)}function d6(){return ct("/api/skills/updates")}function f6(e,t,n){return gr("/api/skills/import",{name:e,files:t,overwrite:n})}function h6(e){return ct(`/api/skills/${encodeURIComponent(e)}/export`)}function p6(e,t){return gr("/api/skills/create",{name:e,intent:t})}function vj(){return c.jsx("div",{className:"nb-card",children:c.jsxs("p",{className:"text-[var(--color-text-muted)] flex items-center gap-2",children:[c.jsx(Xe,{size:14,className:"animate-spin"})," …"]})})}function wj({msg:e}){return c.jsx("div",{className:"nb-card bg-[var(--color-crashed-bg)]",children:c.jsx("p",{children:e})})}function m6({name:e}){var b,w;const t=Ie(),n=Ft(),{alert:i}=dn(),r=Ve({queryKey:["skill-policy",e],queryFn:()=>c6(e),enabled:!!e}),a=(b=r.data)==null?void 0:b.data,[o,u]=j.useState(null),[d,h]=j.useState(null);j.useEffect(()=>{var v;a&&o===null&&u((v=a.policy.allow)!=null&&v.length?new Set(a.policy.allow):new Set(a.skills.map(N=>N.name)))},[a,o]);const g=Et({mutationFn:v=>u6(e,v),onSuccess:v=>{h(v),u(null),n.invalidateQueries({queryKey:["skill-policy",e]})},onError:v=>void i({title:t("projectDetail.skills.saveError"),body:v instanceof Error?v.message:String(v)})});if(r.isLoading||a&&o===null)return c.jsx(vj,{});if(r.isError)return c.jsx(wj,{msg:r.error instanceof Error?r.error.message:String(r.error)});if(!a||!o)return null;if(a.skills.length===0)return c.jsx("div",{className:"nb-card",children:c.jsx("p",{className:"text-[var(--color-text-muted)]",children:t("projectDetail.skills.empty")})});const p=a.eligible!==null,y=v=>u(N=>{const k=new Set(N);return k.has(v)?k.delete(v):k.add(v),k});return c.jsxs("div",{className:"nb-card flex flex-col gap-4 h-full min-h-0",children:[c.jsxs("div",{className:"shrink-0",children:[c.jsxs("h2",{className:"font-[family-name:var(--font-heading)] text-lg font-bold flex items-center gap-2",children:[c.jsx(e_,{size:18,strokeWidth:2.5}),t("projectDetail.skills.title")]}),c.jsx("p",{className:"text-sm text-[var(--color-text-muted)] mt-1",children:t("projectDetail.skills.desc")}),c.jsx("p",{className:"text-sm mt-1 font-medium",children:p?t("projectDetail.skills.hasPolicy",{count:String(((w=a.eligible)==null?void 0:w.length)??0)}):t("projectDetail.skills.noPolicy")})]}),c.jsxs("div",{className:"flex gap-2 shrink-0",children:[c.jsx("button",{type:"button",className:"nb-btn",style:{padding:"4px 10px",fontSize:12},onClick:()=>u(new Set(a.skills.map(v=>v.name))),children:t("projectDetail.skills.selectAll")}),c.jsx("button",{type:"button",className:"nb-btn",style:{padding:"4px 10px",fontSize:12},onClick:()=>u(new Set),children:t("projectDetail.skills.selectNone")})]}),c.jsx("div",{className:"flex bg-surface-input flex-col gap-1 flex-1 min-h-0 overflow-auto border-2 border-[var(--color-text)] rounded p-2",children:a.skills.map(v=>c.jsxs("label",{className:"flex items-start gap-2 px-2 py-1 rounded hover:bg-[var(--color-bg-cream)] cursor-pointer",children:[c.jsx("input",{type:"checkbox",checked:o.has(v.name),onChange:()=>y(v.name),className:"mt-1"}),c.jsxs("span",{className:"flex-1",children:[c.jsx("code",{className:"font-[family-name:var(--font-mono)] text-sm font-bold",children:v.name}),c.jsx("span",{className:"ml-2 text-[10px] uppercase text-[var(--color-text-muted)]",children:v.category}),v.description&&c.jsx("span",{className:"block text-xs text-[var(--color-text-muted)]",children:v.description})]})]},v.name))}),c.jsxs("div",{className:"flex items-center gap-2 flex-wrap shrink-0",children:[c.jsxs("button",{type:"button",className:"nb-btn nb-btn-mint",disabled:g.isPending,onClick:()=>g.mutate({allow:[...o]}),children:[g.isPending?c.jsx(Xe,{size:14,className:"animate-spin"}):c.jsx(mr,{size:14,strokeWidth:3}),t("projectDetail.skills.save")]}),c.jsxs("button",{type:"button",className:"nb-btn",disabled:g.isPending,onClick:()=>g.mutate({}),children:[c.jsx(ep,{size:14,strokeWidth:3}),t("projectDetail.skills.clear")]}),c.jsxs("span",{className:"text-sm text-[var(--color-text-muted)]",children:[o.size,"/",a.skills.length]})]}),d&&c.jsxs("div",{className:"text-sm border-2 border-[var(--color-text)] rounded p-2 bg-[var(--color-bg-cream)]",children:[c.jsx("p",{children:t("projectDetail.skills.applied",{linked:String(d.applied.linked),pruned:String(d.applied.pruned)})}),d.unknown.length>0&&c.jsx("p",{className:"text-[var(--color-text-muted)]",children:t("projectDetail.skills.unknown",{names:d.unknown.join(", ")})})]})]})}function g6({name:e}){var r;const t=Ie(),n=Ve({queryKey:["rules",e],queryFn:()=>ZP(e),enabled:!!e});if(n.isLoading)return c.jsx(vj,{});if(n.isError)return c.jsx(wj,{msg:n.error instanceof Error?n.error.message:String(n.error)});const i=((r=n.data)==null?void 0:r.data)??[];return c.jsxs("div",{className:"flex flex-col gap-4 min-h-full",children:[c.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:t("projectDetail.rules.readonly")}),i.map(a=>c.jsxs("div",{className:"nb-card",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[c.jsx("code",{className:"font-[family-name:var(--font-mono)] text-sm font-bold border-2 border-[var(--color-text)] px-2 py-0.5 rounded",children:a.name}),!a.exists&&c.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:t("projectDetail.rules.missing")})]}),a.exists&&c.jsx("pre",{className:"overflow-auto max-h-[28rem] text-xs font-[family-name:var(--font-mono)] whitespace-pre-wrap break-words bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded p-3",children:a.content})]},a.name))]})}const pp=e=>`/api/projects/${encodeURIComponent(e)}/graph`;function y6(e){return ct(`${pp(e)}/status`)}function b6(e){return ct(`${pp(e)}/data`)}function x6(e){return gr(`${pp(e)}/build`)}function v6(e){return gr(`${pp(e)}/sync`)}const w6={typescript:"#1D4E89",tsx:"#2563EB",javascript:"#B8860B",json:"#6B7280",yaml:"#C2410C"},zf=e=>w6[e]??"#2D6A4F";function xE(e){return[parseInt(e.slice(1,3),16),parseInt(e.slice(3,5),16),parseInt(e.slice(5,7),16)]}const k6=e=>Math.max(8,Math.min(22,8+e*2.5));function E6(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(0)} KB`:`${(e/1024/1024).toFixed(2)} MB`}function S6(e){if(!e)return"—";const t=new Date(e);if(Number.isNaN(t.getTime()))return"—";const n=i=>String(i).padStart(2,"0");return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}`}function N6({name:e,status:t}){var y,b,w,v;const n=Ie(),i=Ve({queryKey:["graph-data",e],queryFn:()=>b6(e)}),[r,a]=j.useState(""),o=j.useRef(null),u=j.useRef(null),d=j.useRef(null),h=j.useRef(null),g=[...new Set((((b=(y=i.data)==null?void 0:y.data)==null?void 0:b.nodes)??[]).map(N=>N.language))];if(j.useEffect(()=>{h.current&&(h.current.search=r.trim().toLowerCase())},[r]),j.useEffect(()=>{var ke;const N=(ke=i.data)==null?void 0:ke.data,k=u.current,A=o.current;if(!N||!N.nodes.length||!k||!A)return;const S=k.getContext("2d");if(!S)return;const _={};for(const le of N.links)_[le.source]=(_[le.source]??0)+1,_[le.target]=(_[le.target]??0)+1;const C=N.nodes.length,T=window.devicePixelRatio||1,R=A.getBoundingClientRect(),O=R.width||800,B=R.height||500,P=Math.min(O,B)*.35+C*1.5,F=N.nodes.map((le,Ce)=>{const Me=2*Math.PI*Ce/Math.max(C,1),_e=_[le.id]??0;return{id:le.id,language:le.language,symbols:le.symbols,deg:_e,name:le.id.split("/").pop()||le.id,x:Math.cos(Me)*P+Math.sin(Ce*12.9898)*43758.5453%1*40,y:Math.sin(Me)*P+Math.sin(Ce*78.233)*12345.678%1*40,vx:0,vy:0,r:k6(_e)}}),U={};for(const le of F)U[le.id]=le;const V=N.links.map(le=>({source:le.source,target:le.target,weight:le.weight})),M={nodes:F,edges:V,map:U,panX:O/2,panY:B/2,zoom:1,drag:null,mouseX:0,mouseY:0,raf:null,tick:0,quiet:0,sel:null,search:r.trim().toLowerCase(),fitted:!1};h.current=M;const H=()=>{const le=A.getBoundingClientRect();k.width=le.width*T,k.height=le.height*T,k.style.width=le.width+"px",k.style.height=le.height+"px",S.setTransform(T,0,0,T,0,0)};H();const $=new ResizeObserver(H);$.observe(A);const K=()=>{let le=1/0,Ce=1/0,Me=-1/0,_e=-1/0;for(const we of F)le=Math.min(le,we.x-we.r),Ce=Math.min(Ce,we.y-we.r),Me=Math.max(Me,we.x+we.r),_e=Math.max(_e,we.y+we.r);const Qe=k.width/T,Ue=k.height/T,ue=Math.min(Qe/Math.max(Me-le,1),Ue/Math.max(_e-Ce,1),1.4)*.88;M.zoom=ue,M.panX=Qe/2-(le+Me)/2*ue,M.panY=Ue/2-(Ce+_e)/2*ue},W=()=>{const le=F.length;M.tick++;const Ce=.9-Math.min(.4,M.tick/1500),Me=le>1e3?3e3:le>100?2e3:le>50?1200:800,_e=le>100?.002:.005,Qe=le>1e3?.012:le>100?.005:.01,Ue=le>1e3?6:le>200?12:24;for(let xe=0;xe<le;xe++){const pe=F[xe];let Ne=-pe.x*Qe,je=-pe.y*Qe;for(let He=0;He<le;He++){if(xe===He)continue;const ne=F[He],de=pe.x-ne.x,Le=pe.y-ne.y,Ze=de*de+Le*Le||1,rt=Math.sqrt(Ze),At=Me/Ze;Ne+=de/rt*At,je+=Le/rt*At}if(pe!==M.drag){let He=(pe.vx+Ne)*Ce,ne=(pe.vy+je)*Ce;He=Math.max(-Ue,Math.min(Ue,He)),ne=Math.max(-Ue,Math.min(Ue,ne)),pe.vx=He,pe.vy=ne}}for(const xe of V){const pe=U[xe.source],Ne=U[xe.target];if(!pe||!Ne)continue;const je=Ne.x-pe.x,He=Ne.y-pe.y,ne=Math.sqrt(je*je+He*He)||1,de=(ne-100)*_e,Le=je/ne*de,Ze=He/ne*de;pe!==M.drag&&(pe.vx+=Le,pe.vy+=Ze),Ne!==M.drag&&(Ne.vx-=Le,Ne.vy-=Ze)}let ue=0;for(const xe of F)xe!==M.drag&&(xe.x+=xe.vx,xe.y+=xe.vy,ue+=xe.vx*xe.vx+xe.vy*xe.vy);(le?Math.sqrt(ue/le):0)<.05&&M.tick>60&&!M.drag?M.quiet++:M.quiet=0,!M.fitted&&(M.quiet>8||M.tick>400)&&(M.fitted=!0,K())},Y=()=>{const le=k.width/T,Ce=k.height/T;S.clearRect(0,0,le,Ce),S.strokeStyle="rgba(45,55,72,0.05)",S.lineWidth=.5;for(let we=0;we<le;we+=24)S.beginPath(),S.moveTo(we,0),S.lineTo(we,Ce),S.stroke();for(let we=0;we<Ce;we+=24)S.beginPath(),S.moveTo(0,we),S.lineTo(le,we),S.stroke();S.save(),S.translate(M.panX,M.panY),S.scale(M.zoom,M.zoom);const Me=M.search,_e=F.length>40;let Qe=null;if(!M.drag){const we=k.getBoundingClientRect(),xe=(M.mouseX-we.left-M.panX)/M.zoom,pe=(M.mouseY-we.top-M.panY)/M.zoom;for(let Ne=F.length-1;Ne>=0;Ne--){const je=F[Ne],He=je.x-xe,ne=je.y-pe;if(He*He+ne*ne<je.r*je.r+25){Qe=je.id;break}}}const Ue=M.sel||Qe;for(const we of V){const xe=U[we.source],pe=U[we.target];if(!xe||!pe)continue;const Ne=Me&&!(xe.name.toLowerCase().includes(Me)||pe.name.toLowerCase().includes(Me)),je=Ue&&(we.source===Ue||we.target===Ue),He=pe.x-xe.x,ne=pe.y-xe.y,de=Math.sqrt(He*He+ne*ne)||1,Le=_e?12:18,Ze=(xe.x+pe.x)/2+-ne/de*Le,rt=(xe.y+pe.y)/2+He/de*Le,[At,$n,fn]=xE(zf(xe.language));let Mt;if(Ne?Mt=.05:Ue&&je?Mt=.6:Ue&&!je?Mt=.05:Mt=_e?.14:.24,S.beginPath(),S.moveTo(xe.x,xe.y),S.quadraticCurveTo(Ze,rt,pe.x,pe.y),S.strokeStyle=`rgba(${At},${$n},${fn},${Mt})`,S.lineWidth=je?2+we.weight*.4:1+we.weight*.25,S.stroke(),!_e||je){const Wt=Math.atan2(pe.y-rt,pe.x-Ze),yt=5+S.lineWidth;S.beginPath(),S.moveTo(pe.x-pe.r*Math.cos(Wt),pe.y-pe.r*Math.sin(Wt)),S.lineTo(pe.x-(pe.r+yt)*Math.cos(Wt-.3),pe.y-(pe.r+yt)*Math.sin(Wt-.3)),S.lineTo(pe.x-(pe.r+yt)*Math.cos(Wt+.3),pe.y-(pe.r+yt)*Math.sin(Wt+.3)),S.closePath(),S.fillStyle=`rgba(${At},${$n},${fn},${Ne?.05:je?.55:.18})`,S.fill()}}const ue=_e?1.5:.5;for(const we of F){const xe=zf(we.language),pe=M.sel===we.id,Ne=Qe===we.id,je=!Me||we.name.toLowerCase().includes(Me),He=Ue&&we.id!==Ue&&!V.some(At=>At.source===Ue&&At.target===we.id||At.target===Ue&&At.source===we.id),ne=je?He?.2:1:.12;S.save(),S.globalAlpha=ne,je&&!He&&(pe||Ne||!Me)&&(S.shadowColor=xe,S.shadowBlur=pe?20:Ne?16:_e?4:8);const[de,Le,Ze]=xE(xe),rt=S.createRadialGradient(we.x-we.r*.3,we.y-we.r*.3,0,we.x,we.y,we.r*1.2);if(rt.addColorStop(0,`rgba(${Math.min(255,de+60)},${Math.min(255,Le+60)},${Math.min(255,Ze+60)},0.95)`),rt.addColorStop(1,xe),S.beginPath(),S.arc(we.x,we.y,we.r,0,Math.PI*2),S.fillStyle=rt,S.fill(),S.shadowBlur=0,S.lineWidth=pe?2.5:1,S.strokeStyle=pe?"#111827":"rgba(255,255,255,0.7)",S.stroke(),S.restore(),je&&!He&&(pe||Ne||M.zoom>ue)){const At=1/M.zoom;S.save(),S.globalAlpha=ne,S.fillStyle="rgba(45,55,72,0.92)",S.font=`${(10*At).toFixed(1)}px 'DM Sans', sans-serif`,S.textAlign="center",S.fillText(we.name,we.x,we.y+we.r+11*At),S.restore()}}S.restore()},I=()=>{if(W(),Y(),M.quiet>40&&!M.drag){M.raf=null;return}M.raf=requestAnimationFrame(I)},L=()=>{M.raf==null&&(M.quiet=0,M.raf=requestAnimationFrame(I))};M.raf=requestAnimationFrame(I);let G=!1,z=0,te=0;const me=le=>{const Ce=k.getBoundingClientRect();return{x:(le.clientX-Ce.left-M.panX)/M.zoom,y:(le.clientY-Ce.top-M.panY)/M.zoom}},ye=(le,Ce)=>{for(let Me=F.length-1;Me>=0;Me--){const _e=F[Me];if(!_e)continue;const Qe=_e.x-le,Ue=_e.y-Ce;if(Qe*Qe+Ue*Ue<_e.r*_e.r+25)return _e}return null},Se=le=>{const Ce=me(le),Me=ye(Ce.x,Ce.y);Me?M.drag=Me:G=!0,z=le.clientX,te=le.clientY,L()},re=le=>{const Ce=le.clientX-z,Me=le.clientY-te;M.drag?(M.drag.x+=Ce/M.zoom,M.drag.y+=Me/M.zoom,M.drag.vx=0,M.drag.vy=0,L()):G&&(M.panX+=Ce,M.panY+=Me,L()),z=le.clientX,te=le.clientY,M.mouseX=le.clientX,M.mouseY=le.clientY;const _e=d.current,Qe=me(le),Ue=!M.drag&&!G?ye(Qe.x,Qe.y):null;if(_e)if(Ue){const ue=V.filter(xe=>xe.source===Ue.id||xe.target===Ue.id).length;_e.innerHTML=`<div style="font-weight:700;word-break:break-all">${Ue.id}</div><div style="margin-top:4px;color:#64748b;font-family:var(--font-mono,monospace)"><span style="color:${zf(Ue.language)}">●</span> ${Ue.language} · ${Ue.symbols} symbols · ${ue} links</div>`;const we=k.getBoundingClientRect();_e.style.left=le.clientX-we.left+14+"px",_e.style.top=le.clientY-we.top+14+"px",_e.style.display="block",k.style.cursor="pointer"}else _e.style.display="none",k.style.cursor=M.drag||G?"grabbing":"grab";L()},he=le=>{M.drag&&!G?Math.abs(le.clientX-z)>3||(M.sel=M.sel===M.drag.id?null:M.drag.id):G&&Math.abs(le.clientX-z)<3&&Math.abs(le.clientY-te)<3&&(M.sel=null),M.drag=null,G=!1,L()},se=le=>{le.preventDefault();const Ce=k.getBoundingClientRect(),Me=le.clientX-Ce.left,_e=le.clientY-Ce.top,Qe=le.deltaY>0?.9:1.1,Ue=Math.max(.1,Math.min(5,M.zoom*Qe));M.panX=Me-(Me-M.panX)/M.zoom*Ue,M.panY=_e-(_e-M.panY)/M.zoom*Ue,M.zoom=Ue,L()},J=()=>{d.current&&(d.current.style.display="none")};return k.addEventListener("mousedown",Se),window.addEventListener("mousemove",re),window.addEventListener("mouseup",he),k.addEventListener("wheel",se,{passive:!1}),k.addEventListener("mouseleave",J),()=>{M.raf!=null&&cancelAnimationFrame(M.raf),$.disconnect(),k.removeEventListener("mousedown",Se),window.removeEventListener("mousemove",re),window.removeEventListener("mouseup",he),k.removeEventListener("wheel",se),k.removeEventListener("mouseleave",J),h.current=null}},[i.data]),i.isLoading)return c.jsxs("div",{className:"nb-card flex items-center gap-2 text-sm text-[var(--color-text-muted)]",children:[c.jsx(Xe,{size:14,className:"animate-spin"})," ",n("graph.viz.loading")]});if(!((v=(w=i.data)==null?void 0:w.data)!=null&&v.nodes.length))return c.jsx("div",{className:"nb-card text-sm text-[var(--color-text-muted)]",children:n("graph.viz.empty")});const p=[{label:n("graph.stat.files"),value:t.files.toLocaleString()},{label:n("graph.stat.nodes"),value:t.nodes.toLocaleString()},{label:n("graph.stat.edges"),value:t.edges.toLocaleString()},{label:n("graph.stat.db"),value:E6(t.dbSizeBytes)},{label:n("graph.stat.lastBuilt"),value:S6(t.lastIndexedAt)}];return c.jsxs("div",{ref:o,className:"relative w-full flex-1 min-h-[420px] nb-card p-0 overflow-hidden",style:{background:"var(--color-bg-cream)"},children:[c.jsx("canvas",{ref:u,className:"block bg-color-bg-soft absolute inset-0",style:{cursor:"grab"}}),c.jsx("div",{ref:d,className:"absolute z-40 pointer-events-none nb-card bg-[var(--color-bg)] px-3 py-2 text-xs max-w-xs",style:{display:"none"}}),c.jsxs("div",{className:"absolute top-3 right-3 w-52 flex flex-col gap-2 pointer-events-none",children:[c.jsxs("div",{className:"relative pointer-events-auto",children:[c.jsx(fl,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-[var(--color-text-subtle)]"}),c.jsx("input",{className:"nb-input pl-9 w-full text-sm",placeholder:n("graph.viz.search"),value:r,onChange:N=>a(N.target.value),"aria-label":n("graph.viz.search")})]}),c.jsxs("div",{className:"nb-card p-3 flex flex-col gap-1.5 pointer-events-auto bg-[var(--color-bg)]",children:[p.map(N=>c.jsxs("div",{className:"flex items-center justify-between gap-2 text-xs",children:[c.jsx("span",{className:"text-[var(--color-text-subtle)] shrink-0",children:N.label}),c.jsx("span",{className:"font-bold font-[family-name:var(--font-mono)] text-right",children:N.value})]},N.label)),c.jsx("div",{className:"mt-1 pt-1.5 border-t-[1.5px] border-dashed border-[var(--color-border-light)] flex flex-wrap gap-x-2 gap-y-1",children:g.map(N=>c.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] font-[family-name:var(--font-mono)]",children:[c.jsx("span",{className:"inline-block w-2.5 h-2.5 rounded-full border-[1.5px] border-[var(--color-text)]",style:{background:zf(N)}}),N]},N))})]}),c.jsx("p",{className:"text-[10px] text-[var(--color-text-subtle)] text-right leading-tight pointer-events-none",children:n("graph.viz.hint")})]})]})}function _6({name:e}){var p,y;const t=Ie(),n=Ft(),i=Ve({queryKey:["graph-status",e],queryFn:()=>y6(e)}),r=()=>{n.invalidateQueries({queryKey:["graph-status",e]}),n.invalidateQueries({queryKey:["graph-data",e]})},a=Et({mutationFn:()=>x6(e),onSuccess:r}),o=Et({mutationFn:()=>v6(e),onSuccess:r}),u=((p=i.data)==null?void 0:p.data)??null,d=a.isPending,h=o.isPending,g=d||h;return c.jsxs("div",{className:"flex flex-col gap-3 max-w-full flex-1 min-h-0",children:[c.jsxs("header",{className:"flex items-center justify-between flex-wrap gap-3 shrink-0",children:[c.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[c.jsx(W2,{size:20,strokeWidth:2.5,className:"shrink-0"}),c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold shrink-0",children:t("graph.title")}),c.jsx("span",{className:"text-xs text-[var(--color-text-muted)] truncate hidden sm:inline",children:t("graph.desc")})]}),c.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[u&&c.jsxs("button",{className:"nb-btn shrink-0",onClick:()=>o.mutate(),disabled:g,type:"button",title:t("graph.sync.desc"),children:[h?c.jsx(Xe,{size:14,strokeWidth:2.5,className:"animate-spin"}):c.jsx(CL,{size:14,strokeWidth:2.5}),t(h?"graph.syncing":"graph.sync")]}),c.jsxs("button",{className:"nb-btn nb-btn-mint shrink-0",onClick:()=>a.mutate(),disabled:g,type:"button",children:[d?c.jsx(Xe,{size:14,strokeWidth:2.5,className:"animate-spin"}):u?c.jsx(bs,{size:14,strokeWidth:2.5}):c.jsx(DL,{size:14,strokeWidth:2.5}),t(d?"graph.building":u?"graph.rebuild":"graph.build")]})]})]}),(a.isError||o.isError)&&c.jsxs("div",{className:"nb-card bg-[var(--color-crashed-bg)] text-sm shrink-0",children:[t("graph.buildFailed"),": ",((y=a.error||o.error)==null?void 0:y.message)??""]}),i.isLoading?c.jsxs("div",{className:"nb-card flex items-center gap-2 text-sm text-[var(--color-text-muted)]",children:[c.jsx(Xe,{size:14,className:"animate-spin"})," ",t("graph.viz.loading")]}):u?c.jsx(N6,{name:e,status:u}):c.jsx("div",{className:"nb-card text-sm text-[var(--color-text-muted)]",children:t("graph.empty")})]})}const vE=["overview","config","pipelines","skills","rules","graph","logs"];function j6({name:e,embedded:t}={}){var v;const n=Ie(),{name:i=""}=Jb(),r=e??i,a=wl(),[o]=P2(),[u,d]=fx("projectDetail.tab","overview"),h=vE.includes(u)?u:"overview",[g,p]=j.useState(!1),y=o.get("tab"),b=o.get("worker")??void 0;j.useEffect(()=>{if(y==="danger"){p(!0);return}y&&vE.includes(y)&&d(y)},[y]);const w=Ve({queryKey:["project",r],queryFn:()=>pI(r),enabled:!!r});return c.jsxs("div",{className:"flex flex-col gap-4 w-full flex-1 min-h-0",children:[c.jsxs("header",{className:"flex items-center gap-3 shrink-0",children:[!t&&c.jsxs("button",{type:"button",onClick:()=>a("/projects"),className:"nb-btn",style:{padding:"6px 12px"},"aria-label":n("newProject.back.aria"),children:[c.jsx($2,{size:14,strokeWidth:3}),n("newProject.back")]}),c.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-3xl font-bold flex-1 truncate",children:r})]}),c.jsxs("nav",{className:"flex items-center gap-2 flex-wrap shrink-0",children:[c.jsx(na,{current:h,value:"overview",onSelect:d,icon:bL,children:n("projectDetail.tab.overview")}),c.jsx(na,{current:h,value:"config",onSelect:d,icon:J2,children:n("projectDetail.tab.config")}),c.jsx(na,{current:h,value:"pipelines",onSelect:d,icon:ox,children:n("projectDetail.tab.pipelines")}),c.jsx(na,{current:h,value:"skills",onSelect:d,icon:e_,children:n("projectDetail.tab.skills")}),c.jsx(na,{current:h,value:"rules",onSelect:d,icon:F3,children:n("projectDetail.tab.rules")}),c.jsx(na,{current:h,value:"graph",onSelect:d,icon:W2,children:n("projectDetail.tab.graph")}),c.jsx(na,{current:h,value:"logs",onSelect:d,icon:ax,children:n("projectDetail.tab.logs")}),c.jsx(na,{current:h,value:"danger",onSelect:()=>p(!0),icon:Ki,children:n("projectDetail.tab.danger")}),c.jsx(wa,{to:`/board?project=${encodeURIComponent(r)}`,className:"nb-btn nb-btn-mint ml-auto",children:n("projectDetail.openBoard")})]}),c.jsxs("div",{className:["flex-1 min-h-0 pr-1 flex flex-col",h==="logs"?"overflow-hidden":"overflow-y-auto"].join(" "),children:[h==="overview"&&c.jsx(C6,{name:r,data:w.data,loading:w.isLoading}),h==="config"&&c.jsx(A6,{name:r}),h==="pipelines"&&c.jsx(T6,{name:r}),h==="skills"&&c.jsx(m6,{name:r}),h==="rules"&&c.jsx(g6,{name:r}),h==="graph"&&c.jsx(_6,{name:r}),h==="logs"&&c.jsx(O5,{project:r,initialWorker:h==="logs"?b:void 0})]}),g&&c.jsx(M6,{name:r,repoDir:((v=w.data)==null?void 0:v.repoDir)??null,onClose:()=>p(!1)})]})}function na({current:e,value:t,onSelect:n,icon:i,children:r}){const a=e===t;return c.jsxs("button",{type:"button",onClick:()=>n(t),"aria-current":a?"page":void 0,className:["nb-btn",a?"nb-btn-primary":""].join(" "),style:{padding:"6px 14px",fontSize:13},children:[c.jsx(i,{size:13,strokeWidth:2.5}),r]})}function C6({name:e,data:t,loading:n}){const i=Ie();return n?c.jsx("div",{className:"nb-card",children:c.jsx("p",{className:"text-[var(--color-text-muted)]",children:i("common.loading")})}):t?c.jsx("div",{className:"nb-card",children:c.jsxs("dl",{className:"grid grid-cols-[160px_1fr] gap-y-3 text-sm",children:[c.jsx("dt",{className:"font-bold",children:i("projectDetail.overview.repoDir")}),c.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:t.repoDir??"—"}),c.jsx("dt",{className:"font-bold",children:i("projectDetail.overview.pmBackend")}),c.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:t.pmBackend}),c.jsx("dt",{className:"font-bold",children:i("projectDetail.overview.agent")}),c.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:t.agentProvider}),c.jsx("dt",{className:"font-bold",children:i("projectDetail.overview.cards")}),c.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:i("projectDetail.overview.cards.value",{total:t.cards.total,inprogress:t.cards.inprogress,done:t.cards.done})}),c.jsx("dt",{className:"font-bold",children:i("projectDetail.overview.workers")}),c.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:i("projectDetail.overview.workers.value",{total:t.workers.total,active:t.workers.active})}),c.jsx("dt",{className:"font-bold",children:i("projectDetail.overview.pipeline")}),c.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:t.pipelineStatus}),c.jsx("dt",{className:"font-bold",children:i("projectDetail.overview.lastActivity")}),c.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:t.lastActivityAt?new Date(t.lastActivityAt).toLocaleString():"—"})]})}):c.jsx("div",{className:"nb-card bg-[var(--color-crashed-bg)]",children:c.jsx("p",{children:i("projectDetail.overview.notFound",{name:e})})})}function A6({name:e}){const t=Ie(),n=Ft(),{alert:i}=dn(),{data:r,isLoading:a,isError:o,error:u,refetch:d}=Ve({queryKey:["project-conf",e],queryFn:()=>gI(e)}),[h,g]=j.useState(null),[p,y]=j.useState(null);j.useEffect(()=>{r&&h===null&&(g(r.content),y(r.etag))},[r,h]);const b=h!==null&&r!==void 0&&h!==r.content,w=Et({mutationFn:()=>{if(h===null||p===null)throw new Error("no draft");return yI(e,h,p)},onSuccess:v=>{y(v.etag),n.invalidateQueries({queryKey:["project-conf",e]}),n.invalidateQueries({queryKey:["project",e]})},onError:v=>{const N=v.status;i({title:t(N===409?"projectDetail.config.error.conflict.title":"projectDetail.config.error.save.title"),body:N===409?t("projectDetail.config.error.conflict.body"):v instanceof Error?v.message:String(v)})}});return a?c.jsx("div",{className:"nb-card",children:c.jsx("p",{className:"text-[var(--color-text-muted)]",children:t("common.loading")})}):o?c.jsx("div",{className:"nb-card bg-[var(--color-crashed-bg)]",children:c.jsx("p",{children:t("projectDetail.config.error.load",{detail:u instanceof Error?u.message:String(u)})})}):c.jsxs("div",{className:"nb-card",children:[c.jsxs("div",{className:"flex items-center justify-between mb-3",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-lg font-bold",children:c.jsxs("code",{className:"font-[family-name:var(--font-mono)] text-sm border-2 border-[var(--color-text)] px-2 py-0.5 rounded",children:["~/.coral/projects/",e,"/conf"]})}),p&&c.jsxs("p",{className:"text-xs text-[var(--color-text-muted)] font-[family-name:var(--font-mono)] mt-1",children:["etag: ",p]})]}),c.jsxs("div",{className:"flex gap-2",children:[c.jsxs("button",{type:"button",className:"nb-btn",style:{padding:"6px 12px"},onClick:()=>{g(null),d()},disabled:w.isPending,"aria-label":t("projectDetail.config.reload"),children:[c.jsx(bs,{size:13,strokeWidth:2.5}),t("projectDetail.config.reload")]}),c.jsxs("button",{type:"button",className:"nb-btn nb-btn-primary",style:{padding:"6px 12px"},onClick:()=>w.mutate(),disabled:!b||w.isPending,"aria-label":t("projectDetail.config.saveAria"),children:[w.isPending?c.jsx(Xe,{size:13,strokeWidth:3,className:"animate-spin"}):w.isSuccess&&!b?c.jsx(Y3,{size:13,strokeWidth:3}):c.jsx(mr,{size:13,strokeWidth:3}),t("projectDetail.config.save")]})]})]}),c.jsx("textarea",{className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",style:{minHeight:480,resize:"vertical"},value:h??"",onChange:v=>g(v.target.value),spellCheck:!1,"aria-label":t("projectDetail.config.editorAria")}),b&&c.jsx("p",{className:"text-xs text-[var(--color-stuck)] mt-2 font-bold",children:t("projectDetail.config.confDirty")})]})}function T6({name:e}){const t=Ie(),n=Ft(),{confirm:i,alert:r}=dn(),{data:a,isLoading:o}=Ve({queryKey:["project-pipelines",e],queryFn:()=>xI(e)}),[u,d]=j.useState(null),[h,g]=j.useState(!1),p=Et({mutationFn:v=>vI(e,v),onSuccess:()=>n.invalidateQueries({queryKey:["project-pipelines",e]}),onError:v=>{r({title:t("projectDetail.pipelines.switch.error"),body:v instanceof Error?v.message:String(v)})}}),y=Et({mutationFn:v=>SI(e,v),onSuccess:()=>n.invalidateQueries({queryKey:["project-pipelines",e]}),onError:v=>{r({title:t("projectDetail.pipelines.delete.error"),body:v instanceof Error?v.message:String(v)})}}),b=Et({mutationFn:v=>EI(e,v.name,v.template),onSuccess:v=>{n.invalidateQueries({queryKey:["project-pipelines",e]}),g(!1),d(v.name)},onError:v=>{r({title:t("projectDetail.pipelines.create.error"),body:v instanceof Error?v.message:String(v)})}});if(o)return c.jsx("div",{className:"nb-card",children:c.jsx("p",{className:"text-[var(--color-text-muted)]",children:t("common.loading")})});const w=[];a!=null&&a.active&&w.push({name:a.active,isActive:!0});for(const v of(a==null?void 0:a.available)??[])w.push({name:v.name,isActive:!1});return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"nb-card",children:[c.jsxs("div",{className:"flex items-center justify-between mb-3",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-lg font-bold",children:t("projectDetail.pipelines.title")}),c.jsxs("button",{type:"button",className:"nb-btn nb-btn-mint",style:{padding:"6px 12px",fontSize:12},onClick:()=>g(!0),disabled:b.isPending,"aria-label":t("projectDetail.pipelines.add"),children:[c.jsx(pi,{size:12,strokeWidth:3}),t("projectDetail.pipelines.add")]})]}),w.length===0?c.jsx("p",{className:"text-sm text-[var(--color-text-muted)] italic p-4 border-2 border-dashed border-[var(--color-text)] rounded-lg text-center",children:t("projectDetail.pipelines.empty")}):c.jsx("ul",{className:"flex flex-col gap-2",children:w.map(v=>c.jsxs("li",{className:"flex bg-surface-input items-center gap-3 p-3 bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-lg",children:[c.jsx(ox,{size:16,strokeWidth:2.5}),c.jsx("span",{className:"font-[family-name:var(--font-mono)] font-bold flex-1",children:v.name}),v.isActive&&c.jsx("span",{className:"nb-status",style:{background:"var(--color-running-bg)",color:"var(--color-running)"},children:t("projectDetail.pipelines.activeBadge")}),c.jsxs("div",{className:"flex gap-1",children:[c.jsxs("button",{type:"button",className:"nb-btn",style:{padding:"4px 10px",fontSize:11},onClick:()=>d(v.name),"aria-label":t("projectDetail.pipelines.editAria",{name:v.name}),children:[c.jsx(Jh,{size:11,strokeWidth:2.5}),t("projectDetail.pipelines.edit")]}),!v.isActive&&c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button",className:"nb-btn nb-btn-primary",style:{padding:"4px 10px",fontSize:11},onClick:async()=>{await i({title:t("projectDetail.pipelines.switch.confirm.title",{name:v.name}),body:t("projectDetail.pipelines.switch.confirm.body",{name:v.name}),confirm:t("projectDetail.pipelines.switch.confirm.button")})&&p.mutate(v.name)},disabled:p.isPending,"aria-label":t("projectDetail.pipelines.switchAria",{name:v.name}),children:t("projectDetail.pipelines.switch")}),c.jsx("button",{type:"button",className:"nb-btn nb-btn-danger",style:{padding:"4px 10px",fontSize:11},onClick:async()=>{await i({title:t("projectDetail.pipelines.delete.confirm.title",{name:v.name}),body:t("projectDetail.pipelines.delete.confirm.body"),confirm:t("common.delete"),danger:!0})&&y.mutate(v.name)},disabled:y.isPending,"aria-label":t("projectDetail.pipelines.deleteAria",{name:v.name}),children:c.jsx(Ki,{size:11,strokeWidth:2.5})})]})]})]},v.name))})]}),u&&c.jsx(YP,{projectName:e,file:u,onClose:()=>d(null),onSaved:()=>{n.invalidateQueries({queryKey:["project-pipelines",e]})}}),h&&c.jsx(XP,{hasActive:!!(a!=null&&a.active),hasSample:!0,isPending:b.isPending,onCancel:()=>g(!1),onCreate:(v,N)=>b.mutate({name:v,template:N})})]})}function M6({name:e,repoDir:t,onClose:n}){const i=Ie(),r=wl(),a=Ft(),{alert:o}=dn(),[u,d]=j.useState(""),[h,g]=j.useState(!0),p=Et({mutationFn:()=>bI(e,{includeClaudeDir:h}),onSuccess:N=>{a.invalidateQueries({queryKey:["projects"]});const k=N.claudeRemoved.filter(A=>A.ok).map(A=>A.path);n(),o({title:i("projectDetail.danger.deleted.title"),body:k.length>0?i("projectDetail.danger.deleted.bodyWithList",{paths:k.join(`
|
|
743
|
+
`)}):i("projectDetail.danger.deleted.body")}).then(()=>r("/projects"))},onError:N=>{o({title:i("projectDetail.danger.error"),body:N instanceof Error?N.message:String(N)})}});j.useEffect(()=>{const N=k=>{k.key==="Escape"&&n()};return window.addEventListener("keydown",N),()=>window.removeEventListener("keydown",N)},[n]);const b=i("projectDetail.danger.body",{path:"__PATH__"}).split("__PATH__"),v=i("projectDetail.danger.confirmPrompt",{name:"__NAME__"}).split("__NAME__");return c.jsx("div",{role:"dialog","aria-modal":"true","aria-labelledby":"danger-dialog-title",className:"fixed inset-0 z-50 flex items-center justify-center bg-black/30 p-4 overflow-hidden",children:c.jsxs("div",{className:"nb-card w-full max-w-xl max-h-[calc(100vh-2rem)] overflow-y-auto bg-[var(--color-crashed-bg)]",children:[c.jsxs("header",{className:"flex items-center justify-between gap-3 mb-3",children:[c.jsx("h2",{id:"danger-dialog-title",className:"font-[family-name:var(--font-heading)] text-lg font-bold text-[var(--color-crashed)]",children:i("projectDetail.danger.title")}),c.jsx("button",{type:"button",className:"nb-btn nb-btn-mint p-2",onClick:n,"aria-label":i("common.close"),disabled:p.isPending,children:c.jsx(Jt,{size:14,strokeWidth:3})})]}),c.jsxs("p",{className:"text-sm mb-4",children:[b[0],c.jsxs("code",{className:"font-[family-name:var(--font-mono)] bg-[var(--color-bg)] border-2 border-[var(--color-text)] px-1.5 py-0.5 rounded",children:["~/.coral/projects/",e,"/"]}),b[1]]}),t&&c.jsxs("label",{className:"flex items-start gap-2 mb-4 p-3 bg-[var(--color-bg)] border-2 border-[var(--color-text)] rounded-lg cursor-pointer",children:[c.jsx("input",{type:"checkbox",checked:h,onChange:N=>g(N.target.checked),className:"mt-0.5",disabled:p.isPending}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsx("div",{className:"text-sm font-bold",children:i("projectDetail.danger.includeClaude.label")}),c.jsxs("div",{className:"text-xs text-[var(--color-text-muted)] font-[family-name:var(--font-mono)] break-all",children:[t,"/.claude/"]}),c.jsx("div",{className:"text-xs text-[var(--color-text-muted)] mt-1",children:i("projectDetail.danger.includeClaude.note")})]})]}),c.jsx("div",{className:"mb-4",children:c.jsxs("label",{className:"flex flex-col gap-1.5",children:[c.jsxs("span",{className:"text-sm font-bold",children:[v[0],c.jsx("code",{className:"font-[family-name:var(--font-mono)] text-xs",children:e}),v[1]]}),c.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)]",value:u,onChange:N=>d(N.target.value),placeholder:e,disabled:p.isPending})]})}),c.jsxs("div",{className:"flex gap-2 justify-end pt-3 border-t-2 border-dashed border-[var(--color-text)]",children:[c.jsx("button",{type:"button",className:"nb-btn",onClick:n,disabled:p.isPending,children:i("common.cancel")}),c.jsxs("button",{type:"button",className:"nb-btn nb-btn-danger",disabled:u!==e||p.isPending,onClick:()=>p.mutate(),"aria-label":i("projectDetail.danger.deleteAria"),children:[p.isPending?c.jsx(Xe,{size:14,strokeWidth:3,className:"animate-spin"}):c.jsx(Ki,{size:14,strokeWidth:3}),i("projectDetail.danger.deleteButton")]})]})]})})}function Tx(){return ct("/api/providers")}function kj(e){const t=[];for(const n of e)for(const i of n.models)t.push({providerId:n.id,model:i,label:`${i} · ${n.name}`});return t}async function D6(e,t){const n=await fetch("/api/providers",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({kind:e,entry:t})});if(!n.ok)throw new Error(`${n.status}: ${await n.text()}`);return n.json()}async function O6(e,t){const n=await fetch(`/api/providers/${e}/${encodeURIComponent(t)}`,{method:"DELETE"});if(!n.ok)throw new Error(`${n.status}: ${await n.text()}`);return n.json()}function Ej(e){const t=e?`?path=${encodeURIComponent(e)}`:"";return ct(`/api/fs/browse${t}`)}async function R6(e,t){const n=await fetch("/api/fs/mkdir",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e,name:t})});if(!n.ok){const i=await n.text();throw new Error(`${n.status}: ${i}`)}return await n.json()}const Sj=50*1024*1024;async function L6(e,t){if(t.size>Sj)throw new Error(`文件超过 50 MB 上限(当前 ${(t.size/1024/1024).toFixed(2)} MB)`);const n=new FormData;n.append("sessionId",e),n.append("file",t,t.name);const i=await fetch("/api/fs/upload",{method:"POST",body:n});if(!i.ok){const r=await i.text();throw new Error(`${i.status}: ${r}`)}return await i.json()}function mb(e,t){return`/api/fs/file?${new URLSearchParams({path:t,sessionId:e}).toString()}`}function Mx({initialPath:e,onCancel:t,onSelect:n,title:i,mode:r="directory"}){var A,S,_;const a=Ie(),{prompt:o,alert:u}=dn(),d=i??a("dirPicker.title.default"),[h,g]=j.useState(e??null),[p,y]=j.useState(null),b=Ve({queryKey:["fs-browse",h],queryFn:()=>Ej(h??void 0),staleTime:0,gcTime:0}),w=((A=b.data)==null?void 0:A.path)??h??"",v=((S=b.data)==null?void 0:S.parent)??null,N=((_=b.data)==null?void 0:_.home)??null,k=async()=>{var T;if(!w)return;const C=(T=await o({title:a("dirPicker.newDir"),body:a("dirPicker.newDir.prompt"),placeholder:a("dirPicker.newDir.placeholder"),confirm:a("dirPicker.newDir.create")}))==null?void 0:T.trim();if(C)try{const R=await R6(w,C);g(R.path)}catch(R){u({title:a("dirPicker.newDir.error.title"),body:R instanceof Error?R.message:String(R)})}};return j.useEffect(()=>{const C=T=>{T.key==="Escape"&&(T.preventDefault(),t())};return window.addEventListener("keydown",C),()=>window.removeEventListener("keydown",C)},[t]),c.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-[rgba(45,55,72,0.5)] p-4",role:"presentation",children:c.jsxs("div",{className:"nb-card bg-[var(--color-bg)] max-w-lg w-full h-[70vh] min-h-0 overflow-hidden p-5 flex flex-col",role:"dialog","aria-modal":"true","aria-label":d,children:[c.jsxs("header",{className:"flex items-center justify-between mb-3 shrink-0",children:[c.jsx("div",{className:"flex items-center gap-2 min-w-0",children:c.jsx("h3",{className:"font-[family-name:var(--font-heading)] font-bold text-base truncate",children:d})}),c.jsx("button",{type:"button",className:"p-1 hover:bg-[var(--color-bg-cream)] rounded",onClick:t,"aria-label":a("dirPicker.close.aria"),children:c.jsx(Jt,{size:14,strokeWidth:3})})]}),c.jsxs("div",{className:"flex items-center gap-2 mb-3 shrink-0",children:[c.jsx("button",{type:"button",className:"nb-btn flex-shrink-0",style:{padding:"4px 10px",fontSize:12},onClick:()=>v&&g(v),disabled:!v||b.isLoading,"aria-label":a("dirPicker.up.aria"),title:a("dirPicker.up.title"),children:c.jsx(U2,{size:12,strokeWidth:3})}),c.jsx("button",{type:"button",className:"nb-btn flex-shrink-0",style:{padding:"4px 10px",fontSize:12},onClick:()=>N&&g(N),disabled:!N||b.isLoading,"aria-label":a("dirPicker.home.aria"),title:a("dirPicker.home.title"),children:c.jsx(G2,{size:12,strokeWidth:3})}),c.jsx("button",{type:"button",className:"nb-btn flex-shrink-0",style:{padding:"4px 10px",fontSize:12},onClick:()=>void k(),disabled:!w||b.isLoading||b.isError,"aria-label":a("dirPicker.newDir.aria"),title:a("dirPicker.newDir.aria"),children:c.jsx(wL,{size:12,strokeWidth:3})}),c.jsx("div",{className:"flex-1 min-w-0 nb-input font-[family-name:var(--font-mono)] text-xs px-2 py-1.5 truncate",title:w,dir:"rtl",children:w||"..."})]}),c.jsx("div",{className:"scroll-frame flex-1 border-2 border-[var(--color-text)] rounded-lg bg-[var(--color-bg-cream)] min-h-0",children:c.jsxs("div",{className:"scroll-frame-body h-full",children:[b.isLoading&&c.jsxs("div",{className:"flex items-center justify-center py-12 text-[var(--color-text-muted)]",children:[c.jsx(Xe,{size:16,strokeWidth:3,className:"animate-spin mr-2"}),a("dirPicker.loading")]}),b.isError&&c.jsxs("div",{className:"p-4 text-sm text-[var(--color-crashed)]",children:[c.jsx("p",{className:"font-bold mb-1",children:a("dirPicker.error.title")}),c.jsx("p",{className:"text-xs font-[family-name:var(--font-mono)] break-all",children:b.error instanceof Error?b.error.message:String(b.error)})]}),b.data&&c.jsxs("ul",{className:"divide-y-2 divide-[var(--color-text)]/20",children:[b.data.entries.length===0&&c.jsx("li",{className:"p-4 text-xs text-[var(--color-text-subtle)] italic text-center",children:a("dirPicker.empty")}),b.data.entries.map(C=>{const T=(()=>{const B=w.endsWith("/")||w.endsWith("\\")?"":"/";return`${w}${B}${C.name}`})(),R=r==="file"&&p===T,O=C.isDirectory||r==="file";return c.jsx("li",{children:c.jsxs("button",{type:"button",className:["w-full flex items-center gap-2 px-3 py-2 text-left text-sm font-[family-name:var(--font-mono)]","disabled:opacity-50 disabled:cursor-not-allowed",R?"bg-[var(--color-accent-mint)] font-bold":"hover:bg-[var(--color-accent-mint)]"].join(" "),disabled:!O,onClick:()=>{C.isDirectory?(y(null),g(T)):r==="file"&&y(T)},onDoubleClick:()=>{r==="file"&&!C.isDirectory&&n(T)},title:C.isDirectory?a("dirPicker.enter.aria",{name:C.name}):r==="file"?a("dirPicker.pickFile.aria",{name:C.name}):a("dirPicker.fileLocked"),children:[C.isDirectory?c.jsx(Sh,{size:14,strokeWidth:2.5,className:"flex-shrink-0 text-[var(--color-text)]"}):c.jsx("span",{className:"w-3.5 h-3.5 flex-shrink-0"}),c.jsx("span",{className:"truncate",children:C.name}),C.isDirectory&&c.jsx(Jo,{size:12,strokeWidth:2.5,className:"ml-auto flex-shrink-0 text-[var(--color-text-muted)]"})]})},C.name)})]})]})}),c.jsxs("div",{className:"flex gap-2 justify-end pt-3 shrink-0",children:[c.jsx("button",{type:"button",className:"nb-btn",onClick:t,children:a("dirPicker.cancel")}),r==="file"?c.jsxs("button",{type:"button",className:"nb-btn nb-btn-primary",onClick:()=>p&&n(p),disabled:!p||b.isLoading||b.isError,title:p??a("dirPicker.useFile.tooltip.empty"),children:[c.jsx(Cu,{size:14,strokeWidth:3}),a("dirPicker.useFile")]}):c.jsxs("button",{type:"button",className:"nb-btn nb-btn-primary",onClick:()=>n(w),disabled:!w||b.isLoading||b.isError,children:[c.jsx(Cu,{size:14,strokeWidth:3}),a("dirPicker.useDir")]})]})]})})}function If(e){return(e.replace(/\/+$/,"").split("/").pop()??"").replace(/[^a-zA-Z0-9_-]/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"")}function Nj({onCancel:e,onCreated:t,dialogMode:n=!1}={}){var F,U,V,M,H,$;const i=Ie(),r=wl(),a=Ft(),{alert:o}=dn(),u=e??(()=>r("/projects")),[d,h]=j.useState({name:"",projectDir:"",enableGit:!0,createIfMissing:!0,mergeBranch:"main",maxWorkers:"1",ackTimeoutMin:"5",pipelineMode:"pipeline"}),g=d.pipelineMode==="smartArrange",p=Ve({queryKey:["system-agents"],queryFn:dx}),y=((F=p.data)==null?void 0:F.agents.worker.model)??"",b=((U=p.data)==null?void 0:U.agents.reviewer.model)??"",w=[...new Set((((V=p.data)==null?void 0:V.providers.openai)??[]).flatMap(K=>K.models))],v=Ve({queryKey:["providers"],queryFn:Tx}),N=kj(((M=v.data)==null?void 0:M.anthropic)??[]),k=d.workerModel?`${d.workerProviderId??""}::${d.workerModel}`:"",[A,S]=j.useState(!1),_=Et({mutationFn:K=>mI(K),onSuccess:K=>{a.invalidateQueries({queryKey:["projects"]}),t?t(K.name):r(`/projects/${encodeURIComponent(K.name)}`)},onError:K=>{o({title:i("newProject.error.create.title"),body:K instanceof Error?K.message:String(K)})}}),C=/^[a-zA-Z0-9_-]+$/.test(d.name),T=C&&d.projectDir.trim()!==""&&!_.isPending,R=d.projectDir.trim(),O=Ve({queryKey:["fs-browse-probe",R],queryFn:()=>Ej(R),enabled:R.startsWith("/"),staleTime:0,gcTime:0,retry:!1}),B=O.isSuccess&&(((H=O.data)==null?void 0:H.entries.length)??0)>0,P=O.isError||O.isSuccess&&((($=O.data)==null?void 0:$.entries.length)??0)===0;return c.jsxs("div",{className:n?"w-full h-full min-h-0":"w-full",children:[c.jsxs("div",{className:n?"nb-card flex h-full min-h-0 flex-col overflow-hidden":"nb-card flex flex-col gap-4",children:[c.jsxs("header",{className:n?"flex shrink-0 items-center gap-3 border-b-2 border-dashed border-[var(--color-text)] pb-4":"flex items-center gap-3",children:[c.jsxs("button",{type:"button",onClick:u,className:"nb-btn",style:{padding:"6px 12px"},"aria-label":i("newProject.back.aria"),children:[c.jsx($2,{size:14,strokeWidth:3}),i("newProject.back")]}),c.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-2xl font-bold",children:i("newProject.title")})]}),c.jsxs("form",{onSubmit:K=>{K.preventDefault(),T&&_.mutate(d)},className:n?"flex min-h-0 flex-1 flex-col":"flex flex-col gap-4",children:[c.jsxs("div",{className:["grid grid-cols-1 md:grid-cols-2 gap-x-6 gap-y-4",n?"min-h-0 flex-1 overflow-y-auto overscroll-contain pr-3 pt-4":""].join(" "),children:[c.jsx($i,{className:"md:col-span-2",label:i("newProject.field.mode"),hint:i(g?"newProject.field.mode.smartHint":"newProject.field.mode.pipelineHint"),children:c.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:["pipeline","smartArrange"].map(K=>{const W=d.pipelineMode===K;return c.jsxs("button",{type:"button",onClick:()=>h({...d,pipelineMode:K}),"aria-pressed":W,className:["text-left rounded-xl border-2 p-3 transition-all",W?"bg-[var(--color-accent-mint)] border-[var(--color-text)] shadow-[3px_3px_0_var(--color-text)] font-bold":"bg-[var(--color-bg)] border-[var(--color-border-light)] hover:border-[var(--color-text)]"].join(" "),children:[c.jsx("div",{className:"text-sm font-bold",children:i(K==="pipeline"?"newProject.field.mode.pipeline":"newProject.field.mode.smart")}),c.jsx("div",{className:"text-xs text-[var(--color-text-muted)] mt-0.5",children:i(K==="pipeline"?"newProject.field.mode.pipelineDesc":"newProject.field.mode.smartDesc")})]},K)})})}),g&&c.jsx($i,{className:"md:col-span-2",label:i("newProject.field.goal"),hint:i("newProject.field.goal.hint"),children:c.jsx("textarea",{className:"nb-input w-full font-[family-name:var(--font-mono)] text-sm",style:{minHeight:110,resize:"vertical"},placeholder:i("newProject.field.goal.placeholder"),value:d.goal??"",onChange:K=>h({...d,goal:K.target.value})})}),c.jsx($i,{label:"Worker 模型",hint:`默认:${y||"全局默认"}(留空用默认)`,children:c.jsxs("select",{className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",value:k,onChange:K=>{const W=K.target.value;if(!W)return h({...d,workerModel:void 0,workerProviderId:void 0});const[Y,I]=W.split("::");h({...d,workerModel:I,workerProviderId:Y||void 0})},children:[c.jsx("option",{value:"",children:"用全局默认模型"}),N.map(K=>c.jsx("option",{value:`${K.providerId}::${K.model}`,children:K.label},`${K.providerId}::${K.model}`))]})}),g&&c.jsxs($i,{label:"OpenAI Agent(监工)模型",hint:`默认:${b||"全局默认"}(留空用默认)`,children:[c.jsx("input",{className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",value:d.reviewerModel??"",onChange:K=>h({...d,reviewerModel:K.target.value}),placeholder:b,list:"np-reviewer-models",spellCheck:!1}),c.jsx("datalist",{id:"np-reviewer-models",children:w.map(K=>c.jsx("option",{value:K},K))})]}),c.jsxs($i,{label:i("newProject.field.name"),hint:i("newProject.field.name.derived"),children:[c.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)]",placeholder:i("newProject.field.name.placeholder"),value:d.name,onChange:K=>h({...d,name:K.target.value}),required:!0}),d.name&&!C&&c.jsx("p",{className:"text-xs text-[var(--color-crashed)] mt-1",children:i("newProject.field.name.invalid")})]}),c.jsxs($i,{className:"md:col-span-2",label:i("newProject.field.dir"),hint:i("newProject.field.dir.long"),children:[c.jsxs("div",{className:"flex gap-2",children:[c.jsx("input",{type:"text",className:"nb-input flex-1 font-[family-name:var(--font-mono)]",placeholder:i("newProject.field.dir.placeholder"),value:d.projectDir,onChange:K=>{const W=K.target.value,Y=If(W),I=If(d.projectDir),L=d.name&&d.name!==I;h({...d,projectDir:W,name:L?d.name:Y})},required:!0}),c.jsxs("button",{type:"button",className:"nb-btn flex-shrink-0",onClick:()=>S(!0),"aria-label":i("newProject.dir.browseAria"),title:i("newProject.dir.browseAria"),children:[c.jsx(K2,{size:14,strokeWidth:2.5}),i("newProject.dir.browse")]})]}),B&&c.jsx("p",{className:"text-xs mt-1.5 font-bold text-[var(--color-text)]",children:i("newProject.field.dir.adopt")}),P&&R.startsWith("/")&&c.jsx("p",{className:"text-xs mt-1.5 text-[var(--color-text-muted)]",children:i("newProject.field.dir.fresh")}),c.jsxs("label",{className:"flex items-center gap-2 mt-2 cursor-pointer select-none",children:[c.jsx("input",{type:"checkbox",checked:d.createIfMissing!==!1,onChange:K=>h({...d,createIfMissing:K.target.checked}),className:"w-4 h-4 cursor-pointer"}),c.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:i("newProject.field.dir.createIfMissing")})]})]}),c.jsx($i,{label:i("newProject.field.maxWorkers.short"),children:c.jsx("input",{type:"number",min:"1",max:"8",className:"nb-input w-full font-[family-name:var(--font-mono)]",value:d.maxWorkers,onChange:K=>h({...d,maxWorkers:K.target.value})})}),c.jsx($i,{label:i("newProject.field.ackTimeout.minutes"),hint:i("newProject.field.ackTimeout.minutes.help"),children:c.jsx("input",{type:"number",min:"1",max:"30",className:"nb-input w-full font-[family-name:var(--font-mono)]",value:d.ackTimeoutMin??"5",onChange:K=>h({...d,ackTimeoutMin:K.target.value})})}),c.jsxs("div",{className:"md:col-span-2 pt-3 border-t-2 border-[var(--color-text)] border-dashed",children:[c.jsxs("label",{className:"flex items-center gap-3 mb-2 cursor-pointer select-none",children:[c.jsx("input",{type:"checkbox",checked:d.enableReview??!1,onChange:K=>h({...d,enableReview:K.target.checked}),className:"w-4 h-4 cursor-pointer"}),c.jsx("span",{className:"text-sm font-bold",children:i("newProject.field.review.label")})]}),c.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:i("newProject.field.review.detail")})]}),c.jsxs("div",{className:"md:col-span-2 pt-3 border-t-2 border-[var(--color-text)] border-dashed",children:[c.jsxs("label",{className:"flex items-center gap-3 mb-3 cursor-pointer select-none",children:[c.jsx("input",{type:"checkbox",checked:d.enableGit??!0,onChange:K=>h({...d,enableGit:K.target.checked}),className:"w-4 h-4 cursor-pointer"}),c.jsx("span",{className:"text-sm font-bold",children:i("newProject.field.git.label")})]}),c.jsx("p",{className:"text-xs text-[var(--color-text-muted)] mb-3",children:i("newProject.field.git.detail")}),d.enableGit!==!1&&c.jsxs("div",{className:"flex flex-col gap-4 bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-lg p-4",children:[c.jsx($i,{label:i("newProject.field.git.branch"),children:c.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)]",value:d.mergeBranch??"main",onChange:K=>h({...d,mergeBranch:K.target.value})})}),c.jsx($i,{label:i("newProject.field.gitlabProject.label"),hint:i("newProject.field.gitlabProject.help2"),children:c.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)]",placeholder:i("newProject.field.gitlabProject.placeholder"),value:d.gitlabProject??"",onChange:K=>h({...d,gitlabProject:K.target.value})})}),d.gitlabProject&&c.jsx($i,{label:i("newProject.field.gitlabProjectId"),hint:i("newProject.field.gitlabProjectId.help"),children:c.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)]",placeholder:i("newProject.field.gitlabProjectId.placeholder"),value:d.gitlabProjectId??"",onChange:K=>h({...d,gitlabProjectId:K.target.value})})})]})]}),c.jsxs("div",{className:"md:col-span-2 pt-3 border-t-2 border-[var(--color-text)] border-dashed",children:[c.jsx("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold uppercase tracking-wider mb-3 text-[var(--color-text-muted)]",children:i("newProject.section.notifications")}),c.jsx($i,{label:i("newProject.field.matrixRoom.label"),hint:i("newProject.field.matrixRoom.help2"),children:c.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)]",placeholder:i("newProject.field.matrixRoom.placeholder"),value:d.matrixRoomId??"",onChange:K=>h({...d,matrixRoomId:K.target.value})})})]})]}),c.jsxs("div",{className:n?"flex shrink-0 gap-3 justify-end border-t-2 border-dashed border-[var(--color-text)] pt-4 mt-4":"flex gap-3 justify-end pt-3",children:[c.jsx("button",{type:"button",className:"nb-btn",onClick:u,disabled:_.isPending,children:i("common.cancel")}),c.jsx("button",{type:"submit",className:"nb-btn nb-btn-primary",disabled:!T,"aria-label":i("newProject.submit"),children:_.isPending?c.jsxs(c.Fragment,{children:[c.jsx(Xe,{size:14,strokeWidth:3,className:"animate-spin"}),i("newProject.creating")]}):c.jsxs(c.Fragment,{children:[c.jsx(pi,{size:14,strokeWidth:3}),i("common.create")]})})]})]})]}),A&&c.jsx(Mx,{title:i("newProject.field.dir.pickerTitle"),initialPath:d.projectDir.trim()||void 0,onCancel:()=>S(!1),onSelect:K=>{const W=If(K),Y=If(d.projectDir),I=d.name&&d.name!==Y;h({...d,projectDir:K,name:I?d.name:W}),S(!1)}})]})}function $i({label:e,hint:t,children:n,className:i}){return c.jsxs("label",{className:`flex flex-col gap-1.5 ${i??""}`,children:[c.jsx("span",{className:"text-sm font-bold",children:e}),n,t&&c.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:t})]})}function z6({onClose:e,onCreated:t}){return c.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/30 p-4 overflow-hidden",children:c.jsx("div",{className:"w-full max-w-6xl h-[calc(100vh-2rem)] min-h-0",children:c.jsx(Nj,{dialogMode:!0,onCancel:e,onCreated:n=>{e(),t(n)}})})})}const wE="projects.last",I6=["activity","date","name"];function kE(){const e=Ie(),t=wl(),{name:n}=Jb(),[i,r]=fx("projects.sort","activity"),[a,o]=j.useState(!1),[u,d]=j.useState(!1),{data:h,isLoading:g,isError:p,error:y,refetch:b}=Ve({queryKey:["projects"],queryFn:Ea}),w=C=>t(`/projects/${encodeURIComponent(C)}`),v=h?k_(h.data,i):[],N=i!=="name",{recent:k,older:A}=N?C5(v,C=>C.lastActivityAt):{recent:v,older:[]},S=a?A:A.filter(C=>C.name===n),_=A.length-S.length;return j.useEffect(()=>{if(n)try{localStorage.setItem(wE,n)}catch{}},[n]),j.useEffect(()=>{if(n||!h)return;let C=null;try{C=localStorage.getItem(wE)}catch{}C&&h.data.some(T=>T.name===C)&&t(`/projects/${encodeURIComponent(C)}`,{replace:!0})},[n,h,t]),c.jsxs("div",{className:"flex flex-col flex-1 min-h-0 w-full",children:[p?c.jsxs("div",{className:"nb-card bg-[var(--color-crashed-bg)]",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold mb-2",children:e("projects.load.failed")}),c.jsx("p",{className:"text-sm text-[var(--color-text)]",children:y instanceof Error?y.message:String(y)}),c.jsx("button",{className:"nb-btn mt-4",onClick:()=>b(),type:"button",children:e("common.retry")})]}):h&&h.data.length===0?c.jsx(U6,{onNew:()=>d(!0)}):c.jsxs("div",{className:"flex gap-5 flex-1 min-h-0",children:[c.jsxs("aside",{className:"w-80 shrink-0 flex flex-col min-h-0",children:[c.jsxs("div",{className:"shrink-0 flex flex-col gap-2 pb-3",children:[c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-2xl font-bold truncate",children:e("projects.title")}),c.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:h?e("projects.count",{count:h.data.length}):e("common.loading")})]}),c.jsxs("button",{className:"nb-btn nb-btn-primary shrink-0",type:"button",onClick:()=>d(!0),"aria-label":e("projects.new"),children:[c.jsx(pi,{size:16,strokeWidth:3}),e("projects.new")]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"inline-flex flex-1 rounded-full overflow-hidden bg-color-bg-soft",role:"group","aria-label":e("projects.sort.label"),children:I6.map(C=>c.jsx("button",{type:"button","aria-pressed":i===C,onClick:()=>r(C),className:["flex-1 px-2 py-1.5 text-xs font-bold font-[family-name:var(--font-mono)] focus-visible:outline focus-visible:outline-2",i===C?"bg-surface-input text-[var(--color-text)]":"bg-transparent text-[var(--color-text-muted)] hover:bg-[rgba(255,255,255,0.08)]"].join(" "),children:e(`projects.sort.${C}`)},C))}),c.jsx("button",{className:"nb-btn nb-btn-yellow shrink-0",style:{padding:"6px 10px"},onClick:()=>b(),type:"button","aria-label":e("common.refresh"),children:c.jsx(Xh,{size:16,strokeWidth:2.5})})]})]}),c.jsx("ul",{className:"flex-1 min-h-0 overflow-y-auto flex flex-col gap-0.5 pr-1",children:g?c.jsx($6,{}):c.jsxs(c.Fragment,{children:[[...k,...S].map(C=>c.jsx(P6,{project:C,selected:C.name===n,onClick:()=>w(C.name)},C.name)),(_>0||a&&A.length>0)&&c.jsx("button",{type:"button",className:"nb-btn text-xs self-start mt-1",onClick:()=>o(C=>!C),"aria-label":a?"收起更早项目":"显示更早项目",children:a?"收起更早":`含更早 (${_})`})]})})]}),c.jsx("div",{className:"flex-1 min-w-0 min-h-0 flex flex-col",children:n?c.jsx(j6,{name:n,embedded:!0}):c.jsx("div",{className:"nb-card",children:c.jsx("p",{className:"text-[var(--color-text-muted)]",children:e("projects.selectHint")})})})]}),u&&c.jsx(z6,{onClose:()=>d(!1),onCreated:w})]})}function P6({project:e,selected:t,onClick:n}){return c.jsx("li",{children:c.jsxs("button",{type:"button",onClick:n,className:["dimension-menu-item w-full text-left flex-col items-stretch gap-1 px-3 py-2 pl-4",t?"dimension-menu-item-active":""].join(" "),children:[c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsx("h3",{className:"font-[family-name:var(--font-heading)] font-bold truncate",children:e.name}),c.jsx(B6,{status:e.pipelineStatus})]}),e.repoDir&&c.jsx("p",{className:"text-[10px] font-[family-name:var(--font-mono)] text-[var(--color-text-muted)] truncate mt-0.5",children:e.repoDir}),c.jsxs("div",{className:"flex gap-3 text-[11px] font-[family-name:var(--font-mono)] text-[var(--color-text-muted)] mt-1.5",children:[c.jsxs("span",{children:[e.cards.total," cards"]}),c.jsxs("span",{children:[e.cards.inprogress," run"]}),c.jsxs("span",{children:[e.workers.active,"/",e.workers.total," w"]})]})]})})}function B6({status:e}){const t={running:{bg:"var(--color-running-bg)",label:"running"},idle:{bg:"var(--color-idle-bg)",label:"idle"},stopping:{bg:"var(--color-stuck-bg)",label:"stopping"},error:{bg:"var(--color-crashed-bg)",label:"error"}},{bg:n,label:i}=t[e],r=e==="running"?"var(--color-running)":e==="error"?"var(--color-crashed)":e==="stopping"?"var(--color-stuck)":"var(--color-idle)";return c.jsx("span",{className:"nb-status",style:{background:n,color:r},children:i})}function $6(){return c.jsx(c.Fragment,{children:[0,1,2].map(e=>c.jsxs("div",{className:"nb-card opacity-60 animate-pulse",style:{padding:"10px 12px"},children:[c.jsx("div",{className:"h-5 w-28 bg-[var(--color-border-light)] rounded-md mb-2"}),c.jsx("div",{className:"h-3 w-2/3 bg-[var(--color-border-light)] rounded-md"})]},e))})}function U6({onNew:e}){const t=Ie(),n=t("projects.empty.hint",{cmd:"__CMD__"}),[i,r]=n.split("__CMD__");return c.jsxs("div",{className:"nb-card bg-[var(--color-accent-yellow)] flex items-center gap-6 p-8",children:[c.jsx("div",{className:"w-20 h-20 rounded-3xl bg-[rgba(255,255,255,0.12)] text-[var(--color-text)] flex items-center justify-center shadow-[rgba(255,255,255,0.10)_0_0_0_1px_inset]",children:c.jsx(r_,{size:32,strokeWidth:2.5})}),c.jsxs("div",{className:"flex-1",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-2xl font-bold mb-2",children:t("projects.empty.title")}),c.jsxs("p",{className:"text-sm text-[var(--color-text)] mb-4",children:[i,c.jsx("code",{className:"bg-[rgba(0,0,0,0.35)] px-2 py-0.5 rounded-md font-[family-name:var(--font-mono)]",children:"sps project init <name>"}),r]}),c.jsxs("button",{className:"nb-btn nb-btn-primary",type:"button",onClick:e,children:[c.jsx(pi,{size:16,strokeWidth:3}),t("projects.new")]})]})]})}function F6({project:e,isPending:t,onCancel:n,onCreate:i}){var S;const r=Ie(),[a,o]=j.useState(""),[u,d]=j.useState(""),[h,g]=j.useState(new Set),[p,y]=j.useState(!1),b=Ve({queryKey:["skills-all",e],queryFn:()=>Ax(e)});j.useEffect(()=>{const _=C=>{C.key==="Escape"&&n()};return window.addEventListener("keydown",_),()=>window.removeEventListener("keydown",_)},[n]);const v=a.trim().length>0&&a.trim().length<=200&&!t,N=_=>{const C=new Set(h);C.has(_)?C.delete(_):C.add(_),g(C)},k=()=>{v&&i({title:a.trim(),description:u.trim(),skills:[...h],labels:["AI-PIPELINE"],initialState:p?"Backlog":"Planning"})},A=((S=b.data)==null?void 0:S.data)??[];return c.jsx("div",{role:"dialog","aria-modal":"true",className:"fixed inset-0 z-40 flex items-center justify-center p-4 md:p-6 bg-black/30 overflow-hidden",children:c.jsxs("div",{className:"nb-card w-full max-w-5xl flex flex-col",style:{maxHeight:"calc(100vh - 48px)"},children:[c.jsxs("header",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-2xl font-bold",children:r("newCard.title")}),c.jsx("button",{className:"nb-btn nb-btn-mint p-2",onClick:n,type:"button","aria-label":r("common.close"),children:c.jsx(Jt,{size:14,strokeWidth:3})})]}),c.jsx("form",{onSubmit:_=>{_.preventDefault(),k()},className:"flex min-h-0 flex-1 flex-col",children:c.jsxs("div",{className:"grid min-h-0 flex-1 grid-cols-1 gap-4 overflow-y-auto pr-1 md:grid-cols-[minmax(0,1fr)_minmax(280px,380px)] md:overflow-hidden md:pr-0",children:[c.jsxs("div",{className:"flex min-h-0 flex-col gap-4 md:overflow-y-auto md:pr-1",children:[c.jsxs("label",{className:"flex flex-col gap-1.5",children:[c.jsx("span",{className:"text-sm font-bold",children:r("newCard.field.title")}),c.jsx("input",{type:"text",className:"nb-input w-full",placeholder:r("newCard.field.title.placeholder"),value:a,onChange:_=>o(_.target.value),maxLength:200,autoFocus:!0,required:!0}),c.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:r("newCard.field.title.help")})]}),c.jsxs("label",{className:"flex flex-col gap-1.5",children:[c.jsx("span",{className:"text-sm font-bold",children:r("newCard.field.description")}),c.jsx("textarea",{className:"nb-input w-full",style:{minHeight:160,resize:"vertical"},placeholder:r("newCard.field.description.placeholder"),value:u,onChange:_=>d(_.target.value)}),c.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:r("newCard.field.description.help")})]}),c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsx("span",{className:"text-sm font-bold",children:r("newCard.field.dispatch")}),c.jsxs("label",{className:"flex items-center gap-3 cursor-pointer select-none p-3 border-[2px] border-[var(--color-text)] rounded-lg bg-[var(--color-bg-cream)]",children:[c.jsx("input",{type:"checkbox",className:"w-4 h-4 accent-[var(--color-cta)] cursor-pointer",checked:p,onChange:_=>y(_.target.checked)}),c.jsxs("div",{className:"flex-1",children:[c.jsx("div",{className:"text-sm font-bold",children:r("newCard.field.dispatch.label")}),c.jsx("div",{className:"text-xs text-[var(--color-text-muted)] mt-0.5",children:r("newCard.field.dispatch.help")})]})]})]})]}),c.jsxs("section",{className:"flex min-h-[240px] flex-col gap-2 md:min-h-0 md:overflow-hidden",children:[c.jsx("span",{className:"text-sm font-bold",children:r("newCard.field.skills")}),c.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:r("newCard.field.skills.help")}),c.jsx("div",{className:"scroll-frame min-h-0 flex-1 rounded-lg border-2 border-[var(--color-border-light)] bg-[var(--color-bg-cream)]",children:c.jsxs("div",{className:"scroll-frame-body h-full p-2",children:[b.isLoading&&c.jsx("p",{className:"text-xs text-[var(--color-text-muted)] italic",children:r("newCard.field.skills.loading")}),b.isError&&c.jsx("p",{className:"text-xs text-[var(--color-crashed)]",children:r("newCard.field.skills.error",{detail:b.error instanceof Error?b.error.message:String(b.error)})}),A.length>0&&c.jsx("div",{className:"flex flex-wrap gap-2",children:A.map(_=>{const C=h.has(_.name);return c.jsx("button",{type:"button",onClick:()=>N(_.name),className:["max-w-full break-all px-2.5 py-1 text-left text-xs font-[family-name:var(--font-mono)] rounded-full border-2 transition-all",C?"bg-[var(--color-accent-mint)] border-[var(--color-text)] shadow-[2px_2px_0_var(--color-text)] font-bold":"bg-[var(--color-bg)] border-[var(--color-border-light)] hover:border-[var(--color-text)]"].join(" "),"aria-pressed":C,children:_.name},_.name)})})]})}),h.size>0&&c.jsx("p",{className:"max-h-14 overflow-y-auto break-words text-xs text-[var(--color-text-muted)]",children:r("newCard.field.skills.selected",{count:h.size,names:[...h].join(", ")})})]})]})}),c.jsxs("div",{className:"flex gap-2 justify-end mt-4 pt-3 border-t-2 border-dashed border-[var(--color-text)] flex-shrink-0",children:[c.jsx("button",{className:"nb-btn",style:{padding:"6px 14px"},onClick:n,disabled:t,type:"button",children:r("common.cancel")}),c.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"6px 14px"},onClick:k,disabled:!v,type:"button","aria-label":r("newCard.create.aria"),children:[t?c.jsx(Xe,{size:13,strokeWidth:3,className:"animate-spin"}):c.jsx(pi,{size:13,strokeWidth:3}),r("common.create")]})]})]})})}function q6(e){return ct(`/api/projects/${encodeURIComponent(e)}/cards`)}function H6(e,t){return ct(`/api/projects/${encodeURIComponent(e)}/cards/${t}`)}function K6(e,t){return ct(`/api/projects/${encodeURIComponent(e)}/cards/${t}/prompt`)}async function ac(e,t){const n=await fetch(e,{method:"POST",headers:t?{"Content-Type":"application/json"}:void 0,body:t?JSON.stringify(t):void 0});if(!n.ok){const i=await n.text();throw new Error(`${n.status} ${n.statusText}: ${i}`)}return n.json().catch(()=>({}))}function G6(e,t){return ac(`/api/projects/${encodeURIComponent(e)}/cards/${t}/reset`)}async function V6(e,t){const n=await fetch(`/api/projects/${encodeURIComponent(e)}/cards/${t}`,{method:"DELETE"});if(!n.ok){const i=await n.text();throw new Error(`${n.status}: ${i}`)}}function Y6(e,t){return ac(`/api/projects/${encodeURIComponent(e)}/cards/${t}/launch`)}function W6(e,t){const n=typeof t=="string"?{title:t}:t;return ac(`/api/projects/${encodeURIComponent(e)}/cards`,n)}async function Q6(e,t,n){const i=await fetch(`/api/projects/${encodeURIComponent(e)}/cards/${t}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({state:n})});if(!i.ok){const r=await i.text();throw new Error(`${i.status}: ${r}`)}}async function X6(e,t,n){const i=await fetch(`/api/projects/${encodeURIComponent(e)}/cards/${t}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!i.ok){const r=await i.text();throw new Error(`${i.status}: ${r}`)}return i.json()}function _j(e){return ac(`/api/projects/${encodeURIComponent(e)}/pipeline/start`)}function jj(e){return ac(`/api/projects/${encodeURIComponent(e)}/pipeline/stop`)}function Z6(e,t){return ac(`/api/projects/${encodeURIComponent(e)}/pipeline/reset`,t??{})}function J6(e){const t=Ft();j.useEffect(()=>{if(!e)return;const n=`/stream/projects/${encodeURIComponent(e)}`,i=new EventSource(n),r=u=>{try{const d=JSON.parse(u.data);t.invalidateQueries({queryKey:["cards",d.project]}),t.invalidateQueries({queryKey:["card",d.project,d.seq]}),t.invalidateQueries({queryKey:["projects"]})}catch{}},a=u=>{try{const d=JSON.parse(u.data);t.invalidateQueries({queryKey:["workers",d.project]}),t.invalidateQueries({queryKey:["projects"]})}catch{}},o=u=>{try{const d=JSON.parse(u.data);t.invalidateQueries({queryKey:["pipeline-status",d.project]}),t.invalidateQueries({queryKey:["projects"]})}catch{}};return i.addEventListener("card.created",r),i.addEventListener("card.updated",r),i.addEventListener("card.moved",r),i.addEventListener("card.deleted",r),i.addEventListener("worker.updated",a),i.addEventListener("worker.added",a),i.addEventListener("worker.deleted",a),i.addEventListener("pipeline.status",o),i.addEventListener("pipeline.started",o),i.addEventListener("pipeline.stopped",o),()=>i.close()},[e,t])}const eB=new Set(["python","typescript","golang","rust","kotlin","swift","java"]),tB=new Set(["frontend","backend","mobile","database","devops"]),nB=new Set(["backend-architect","frontend-developer","code-reviewer","database-optimizer","devops-automator","security-engineer","qa-tester","security","qa","architect","db-opt"]),iB=new Set(["coding-standards","tdd-workflow","git-workflow","architecture-decision-records","debugging-workflow"]);function rB(e){return eB.has(e)?"lang":tB.has(e)?"end":nB.has(e)?"persona":iB.has(e)?"workflow":"other"}const sB={lang:"var(--skill-badge-lang-bg, var(--color-accent-purple))",end:"var(--skill-badge-end-bg, var(--color-secondary))",persona:"var(--skill-badge-persona-bg, var(--color-primary))",workflow:"var(--skill-badge-workflow-bg, var(--color-accent-mint))",other:"var(--skill-badge-other-bg, var(--color-bg))"};function Dx({name:e}){const t=sB[rB(e)];return c.jsx("span",{className:"nb-badge",style:{background:t},children:e})}function Cj({label:e,kind:t="default"}){const n=t==="warn"?"var(--color-accent-pink)":t==="accent"?"var(--color-accent-yellow)":"var(--color-bg-cream)";return c.jsx("span",{className:"nb-badge",style:{background:n},children:e})}function aB({card:e,onClick:t,done:n,draggable:i}){const r=Ie(),a=e.labels.some(o=>o.startsWith("STARTED-"))&&!n;return c.jsxs("article",{onClick:t,onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),t())},draggable:i,onDragStart:o=>{o.dataTransfer.setData("application/x-sps-card-seq",String(e.seq)),o.dataTransfer.effectAllowed="move"},tabIndex:0,role:"button","aria-label":`Card #${e.seq}: ${e.title}`,className:["nb-card nb-card-interactive p-3 cursor-pointer","transition-[transform,background-color,border-color] duration-[180ms] ease-out","focus:outline-none focus-visible:ring-[3px] focus-visible:ring-offset-2 focus-visible:ring-[var(--color-text)]",n?"opacity-60":"",i?"active:cursor-grabbing":""].join(" "),children:[c.jsxs("div",{className:"flex items-center justify-between gap-2 mb-2",children:[c.jsxs("span",{className:"nb-badge font-[family-name:var(--font-mono)] text-[11px] px-2 py-0.5",children:["#",e.seq]}),a&&c.jsx("span",{className:"nb-status",style:{background:"var(--color-running-bg)",color:"var(--color-running)"},children:"running"})]}),c.jsx("p",{className:`font-bold text-sm leading-5 mb-2 line-clamp-2 ${n?"line-through decoration-2":""}`,children:e.title}),(e.skills.length>0||e.labels.length>0)&&c.jsxs("div",{className:"flex flex-wrap gap-1 mb-2",children:[e.skills.slice(0,3).map(o=>c.jsx(Dx,{name:o},o)),e.labels.filter(o=>o==="NEEDS-FIX").map(o=>c.jsx(Cj,{label:o,kind:"warn"},o))]}),e.checklist&&e.checklist.total>0&&c.jsx(lB,{stats:e.checklist}),c.jsxs("div",{className:"pt-2 border-t-[1.5px] border-dashed border-[var(--color-border-light)] flex items-center gap-2 text-[11px] font-[family-name:var(--font-mono)] text-[var(--color-text-subtle)]",children:[c.jsx("span",{children:oB(e.updatedAt??e.createdAt,r)}),e.branch&&c.jsxs("span",{className:"truncate",children:["· ",e.branch]})]})]})}function lB({stats:e}){const t=Ie();return c.jsxs("div",{className:"mb-2",children:[c.jsxs("div",{className:"flex items-center justify-between text-[11px] font-[family-name:var(--font-mono)] mb-1",children:[c.jsx("span",{className:"font-bold",children:t("kanban.checklist.label",{done:e.done,total:e.total})}),c.jsxs("span",{className:"text-[var(--color-text-subtle)]",children:[e.percent,"%"]})]}),c.jsx("div",{className:"w-full h-1.5 bg-[rgba(255,255,255,0.08)] rounded-full overflow-hidden mb-1.5",children:c.jsx("div",{className:"h-full bg-[var(--color-snow-white)] transition-[width] duration-200",style:{width:`${e.percent}%`}})}),c.jsxs("ul",{className:"text-[11px] space-y-0.5",children:[e.items.slice(0,3).map((n,i)=>c.jsxs("li",{className:`flex items-start gap-1 ${n.done?"opacity-60 line-through":""}`,children:[c.jsx("span",{className:"flex-shrink-0 mt-0.5",children:n.done?"✓":"○"}),c.jsx("span",{className:"line-clamp-1",children:n.text})]},i)),e.items.length>3&&c.jsx("li",{className:"text-[var(--color-text-subtle)] italic pl-3",children:t("kanban.checklist.more",{count:e.items.length-3})})]})]})}function oB(e,t){if(!e)return"—";const n=new Date(e),i=Date.now()-n.getTime();return i<6e4?t("kanban.time.justNow"):i<36e5?t("kanban.time.minutes",{n:Math.floor(i/6e4)}):i<864e5?t("kanban.time.hours",{n:Math.floor(i/36e5)}):n.toLocaleDateString()}function cB({label:e,bg:t,badgeVars:n,cards:i,onCardClick:r,onDropCard:a}){const o=Ie(),[u,d]=j.useState(!1);return c.jsxs("div",{className:["nb-card flex flex-col p-3 min-h-[280px] h-full min-h-0 overflow-hidden","transition-all",u?"bg-[rgba(255,255,255,0.16)]":""].join(" "),style:{background:t,...n},onDragOver:h=>{!a||!h.dataTransfer.types.includes("application/x-sps-card-seq")||(h.preventDefault(),h.dataTransfer.dropEffect="move",u||d(!0))},onDragLeave:()=>d(!1),onDrop:h=>{if(d(!1),!a)return;const g=h.dataTransfer.getData("application/x-sps-card-seq"),p=Number.parseInt(g,10);Number.isFinite(p)&&(h.preventDefault(),a(p))},children:[c.jsxs("div",{className:"flex items-center justify-between px-1 pb-2 mb-2 border-b border-[var(--color-border-light)] shrink-0",children:[c.jsx("span",{className:"font-[family-name:var(--font-heading)] font-bold text-sm uppercase tracking-wider",children:e}),c.jsx("span",{className:"nb-badge font-[family-name:var(--font-mono)] text-xs px-2 py-0.5",children:i.length})]}),c.jsxs("div",{className:"flex flex-col gap-2 flex-1 min-h-0 overflow-y-auto pr-1 -mr-1",style:{scrollbarWidth:"thin",scrollbarColor:"rgba(229,229,229,0.36) transparent"},children:[i.length===0&&c.jsx("div",{className:"text-xs text-[var(--color-text-muted)] text-center py-6 italic",children:o("kanban.column.empty")}),i.map(h=>c.jsx(aB,{card:h,onClick:()=>r(h),done:e==="Done",draggable:!!a},h.seq))]})]})}function gb(e,t){if(!e)return"";const n=e.split(`
|
|
744
|
+
`),i=new RegExp(`^##\\s+${t}\\s*$`),r=n.findIndex(o=>i.test(o));if(r===-1)return"";let a=n.length;for(let o=r+1;o<n.length;o++)if(/^##\s+/.test(n[o]??"")){a=o;break}return n.slice(r+1,a).join(`
|
|
745
|
+
`).trim()}function iy(e){return gb(e,"描述")}function uB({project:e,seq:t,onClose:n,onChanged:i}){var Y,I,L,G,z,te,me,ye,Se,re,he;const r=Ie(),a=Ft(),{confirm:o,alert:u}=dn(),{data:d,isLoading:h,isError:g,error:p,refetch:y}=Ve({queryKey:["card",e,t],queryFn:()=>H6(e,t)}),[b,w]=j.useState(!1),[v,N]=j.useState(!1),[k,A]=j.useState(""),[S,_]=j.useState(""),[C,T]=j.useState(new Set),[R,O]=j.useState([]),[B,P]=j.useState(""),F=Ve({queryKey:["skills-all",e],queryFn:()=>Ax(e),enabled:b}),V=((I=(Y=Ve({queryKey:["projects"],queryFn:Ea,refetchInterval:1e4}).data)==null?void 0:Y.data.find(se=>se.name===e))==null?void 0:I.pipelineStatus)==="running";j.useEffect(()=>{b&&d&&(A(d.title),_(iy(d.body)),T(new Set(d.skills)),O([...d.labels]))},[b,d]),j.useEffect(()=>{const se=J=>{J.key==="Escape"&&(b?w(!1):n())};return window.addEventListener("keydown",se),()=>window.removeEventListener("keydown",se)},[n,b]);const M=Et({mutationFn:()=>{if(!d)throw new Error("no data");const se={},J=k.trim();J&&J!==d.title&&(se.title=J);const ke=iy(d.body);S!==ke&&(se.description=S);const le=[...C].sort(),Ce=[...d.skills].sort();return JSON.stringify(le)!==JSON.stringify(Ce)&&(se.skills=le),JSON.stringify(R)!==JSON.stringify(d.labels)&&(se.labels=R),Object.keys(se).length===0?Promise.resolve({ok:!0,noop:!0}):X6(e,t,se)},onSuccess:()=>{a.invalidateQueries({queryKey:["card",e,t]}),a.invalidateQueries({queryKey:["cards",e]}),w(!1),i()},onError:se=>{u({title:r("cardModal.error.save.title"),body:se instanceof Error?se.message:String(se)})}}),H=j.useMemo(()=>{if(!b||!d)return!1;if(k.trim()!==d.title||S!==iy(d.body))return!0;const se=[...C].sort(),J=[...d.skills].sort();return JSON.stringify(se)!==JSON.stringify(J)||JSON.stringify(R)!==JSON.stringify(d.labels)},[b,d,k,S,C,R]),$=se=>{const J=new Set(C);J.has(se)?J.delete(se):J.add(se),T(J)},K=()=>{const se=B.trim();if(se){if(R.includes(se)){P("");return}O([...R,se]),P("")}},W=se=>{O(R.filter(J=>J!==se))};return c.jsxs("div",{role:"dialog","aria-modal":"true","aria-labelledby":"card-modal-title",className:"fixed inset-0 z-40 flex items-start justify-center p-6 bg-black/30 overflow-auto",children:[c.jsxs("div",{className:"nb-card mt-12 w-full max-w-3xl bg-[var(--color-bg)]",children:[c.jsxs("header",{className:"flex items-start justify-between gap-4 mb-4",children:[c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[c.jsxs("span",{className:"font-[family-name:var(--font-mono)] font-bold text-xs px-2 py-0.5 bg-[var(--color-accent-purple)] border-2 border-[var(--color-text)] rounded-full",children:["#",t]}),(d==null?void 0:d.state)&&c.jsx("span",{className:"font-[family-name:var(--font-mono)] text-xs px-2 py-0.5 bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-full font-semibold",children:d.state}),b&&c.jsx("span",{className:"text-xs font-bold text-[var(--color-stuck)]",children:r("cardModal.editing")})]}),b?c.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-heading)] text-xl font-bold",value:k,onChange:se=>A(se.target.value),maxLength:200,"aria-label":r("cardModal.title.aria")}):c.jsx("h2",{id:"card-modal-title",className:"font-[family-name:var(--font-heading)] text-2xl font-bold break-words",children:(d==null?void 0:d.title)??r("common.loading")})]}),c.jsxs("div",{className:"flex gap-2 flex-shrink-0",children:[!b&&d&&c.jsxs("button",{onClick:()=>w(!0),className:"nb-btn",style:{padding:"6px 12px"},type:"button","aria-label":r("cardModal.editAria"),children:[c.jsx(Jh,{size:12,strokeWidth:2.5})," ",r("cardModal.edit")]}),c.jsx("button",{onClick:n,className:"nb-btn nb-btn-mint p-2","aria-label":r("cardModal.close.aria"),type:"button",children:c.jsx(Jt,{size:14,strokeWidth:3})})]})]}),h&&c.jsx("p",{className:"text-[var(--color-text-muted)]",children:r("common.loading")}),g&&c.jsx("p",{className:"text-[var(--color-crashed)]",children:r("cardModal.error.load",{detail:p instanceof Error?p.message:String(p)})}),d&&c.jsxs("div",{className:"flex flex-col gap-4",children:[d.branch&&!b&&c.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[c.jsx(_L,{size:14}),c.jsx("span",{className:"font-[family-name:var(--font-mono)]",children:d.branch})]}),b?c.jsxs(c.Fragment,{children:[c.jsxs("div",{children:[c.jsx("div",{className:"text-sm font-bold mb-1.5",children:"Skills"}),F.isLoading&&c.jsx("p",{className:"text-xs text-[var(--color-text-muted)] italic",children:r("cardModal.skills.loading")}),F.data&&F.data.data.length>0&&c.jsx("div",{className:"flex flex-wrap gap-1.5",children:F.data.data.map(se=>{const J=C.has(se.name);return c.jsx("button",{type:"button",onClick:()=>$(se.name),"aria-pressed":J,className:["px-2.5 py-1 text-xs font-[family-name:var(--font-mono)] rounded-full border-2 transition-all",J?"bg-[var(--color-accent-mint)] border-[var(--color-text)] shadow-[2px_2px_0_var(--color-text)] font-bold":"bg-[var(--color-bg)] border-[var(--color-border-light)] hover:border-[var(--color-text)]"].join(" "),children:se.name},se.name)})})]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-sm font-bold mb-1.5",children:"Labels"}),c.jsxs("div",{className:"flex flex-wrap gap-1.5 items-center",children:[R.map(se=>c.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 text-xs font-[family-name:var(--font-mono)] bg-[var(--color-accent-yellow)] border-2 border-[var(--color-text)] rounded-full",children:[se,c.jsx("button",{type:"button",onClick:()=>W(se),className:"hover:text-[var(--color-crashed)]","aria-label":r("cardModal.label.removeAria",{label:se}),children:c.jsx(Jt,{size:10,strokeWidth:3})})]},se)),c.jsx("input",{type:"text",className:"nb-input",style:{padding:"4px 8px",fontSize:12,width:140},placeholder:r("cardModal.label.addPlaceholder"),value:B,onChange:se=>P(se.target.value),onKeyDown:se=>{se.key==="Enter"&&!se.nativeEvent.isComposing&&(se.preventDefault(),K())}}),B&&c.jsx("button",{type:"button",className:"nb-btn",style:{padding:"2px 6px",fontSize:11},onClick:K,"aria-label":r("cardModal.label.addAria"),children:c.jsx(pi,{size:10,strokeWidth:3})})]}),c.jsx("p",{className:"text-[10px] text-[var(--color-text-muted)] mt-1",children:r("cardModal.label.note")})]})]}):c.jsxs(c.Fragment,{children:[d.skills.length>0&&c.jsxs("div",{children:[c.jsx("div",{className:"text-sm font-bold mb-1.5",children:"Skills"}),c.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:d.skills.map(se=>c.jsx(Dx,{name:se},se))})]}),d.labels.length>0&&c.jsxs("div",{children:[c.jsx("div",{className:"text-sm font-bold mb-1.5",children:"Labels"}),c.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:d.labels.map(se=>c.jsx(Cj,{label:se,kind:se==="NEEDS-FIX"?"warn":"default"},se))})]})]}),b?c.jsxs(c.Fragment,{children:[c.jsxs("div",{children:[c.jsx("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold mb-2 uppercase tracking-wider",children:r("cardModal.section.description")}),c.jsx("textarea",{className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",style:{minHeight:180,resize:"vertical"},value:S,onChange:se=>_(se.target.value),"aria-label":r("cardModal.body.aria")}),c.jsx("p",{className:"text-[10px] text-[var(--color-text-muted)] mt-1",children:r("cardModal.body.replaceNote")})]}),(((ye=d.checklist)==null?void 0:ye.total)??0)>0&&c.jsxs("div",{className:"nb-card bg-[var(--color-bg-cream)] p-3",children:[c.jsx("div",{className:"flex items-center justify-between mb-2",children:c.jsxs("span",{className:"font-bold text-sm",children:[r("cardModal.section.checklist")," ",((Se=d.checklist)==null?void 0:Se.done)??0,"/",((re=d.checklist)==null?void 0:re.total)??0]})}),c.jsx("ul",{className:"text-sm space-y-1",children:(((he=d.checklist)==null?void 0:he.items)??[]).map((se,J)=>c.jsxs("li",{className:`flex items-start gap-2 ${se.done?"opacity-60 line-through":""}`,children:[c.jsx("span",{children:se.done?"✓":"○"}),c.jsx("span",{children:se.text})]},J))})]})]}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{children:[c.jsx("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold mb-2 uppercase tracking-wider",children:r("cardModal.section.description")}),c.jsx("pre",{className:"text-xs whitespace-pre-wrap font-[family-name:var(--font-mono)] bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-lg p-4 max-h-64 overflow-auto",children:gb(d.body,"描述")||r("cardModal.section.empty")})]}),c.jsxs("div",{children:[c.jsxs("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold mb-2 uppercase tracking-wider",children:[r("cardModal.section.checklist")," ",c.jsxs("span",{className:"text-[var(--color-text-muted)] normal-case tracking-normal",children:[((L=d.checklist)==null?void 0:L.done)??0,"/",((G=d.checklist)==null?void 0:G.total)??0]})]}),c.jsx("div",{className:"nb-card bg-[var(--color-bg-cream)] p-3",children:(((z=d.checklist)==null?void 0:z.total)??0)>0?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"flex items-center justify-end mb-2",children:c.jsx("div",{className:"w-24 h-2 bg-[var(--color-bg)] border-2 border-[var(--color-text)] rounded-full overflow-hidden",children:c.jsx("div",{className:"h-full bg-[var(--color-cta)]",style:{width:`${((te=d.checklist)==null?void 0:te.percent)??0}%`}})})}),c.jsx("ul",{className:"text-sm space-y-1",children:(((me=d.checklist)==null?void 0:me.items)??[]).map((se,J)=>c.jsxs("li",{className:`flex items-start gap-2 ${se.done?"opacity-60 line-through":""}`,children:[c.jsx("span",{children:se.done?"✓":"○"}),c.jsx("span",{children:se.text})]},J))})]}):c.jsx("p",{className:"text-xs text-[var(--color-text-muted)] italic",children:r("cardModal.checklist.empty")})})]}),c.jsxs("div",{children:[c.jsx("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold mb-2 uppercase tracking-wider",children:r("cardModal.section.log")}),c.jsx("pre",{className:"text-xs whitespace-pre-wrap font-[family-name:var(--font-mono)] bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-lg p-4 max-h-64 overflow-auto",children:gb(d.body,"日志")||r("cardModal.section.empty")})]})]}),c.jsx("div",{className:"flex gap-2 pt-2 border-t-2 border-[var(--color-border-light)] justify-end flex-wrap",children:b?c.jsxs(c.Fragment,{children:[c.jsx("button",{className:"nb-btn",type:"button",onClick:()=>{w(!1),y()},disabled:M.isPending,children:r("common.cancel")}),c.jsxs("button",{className:"nb-btn nb-btn-primary",type:"button",onClick:()=>M.mutate(),disabled:!H||!k.trim()||M.isPending,"aria-label":r("cardDetail.save"),children:[M.isPending?c.jsx(Xe,{size:14,strokeWidth:3,className:"animate-spin"}):c.jsx(mr,{size:14,strokeWidth:3}),r("common.save")]})]}):c.jsxs(c.Fragment,{children:[c.jsxs("button",{className:"nb-btn nb-btn-primary",type:"button",disabled:d.state==="Done"||V,title:d.state==="Done"?r("cardModal.action.launch.disabledDone"):V?r("cardModal.action.launch.disabledRunning"):void 0,onClick:async()=>{try{await Y6(e,t),i()}catch(se){u({title:r("cardModal.action.launch.error"),body:se instanceof Error?se.message:String(se)})}},children:[c.jsx(td,{size:14,strokeWidth:3}),r("cardModal.action.launch")]}),c.jsxs("button",{className:"nb-btn nb-btn-yellow",type:"button",onClick:async()=>{if(await o({title:r("cardModal.action.reset.confirm.title",{seq:t}),body:r("cardModal.action.reset.confirm.body"),confirm:r("cardModal.action.reset.confirm.button"),danger:!0}))try{await G6(e,t),i(),n()}catch(J){u({title:r("cardModal.action.reset.error"),body:J instanceof Error?J.message:String(J)})}},children:[c.jsx(ep,{size:14,strokeWidth:2.5}),r("cardModal.action.reset")]}),c.jsxs("button",{className:"nb-btn nb-btn-lilac",type:"button",onClick:()=>N(!0),children:[c.jsx(ed,{size:14,strokeWidth:2.5}),r("cardModal.action.viewPrompt")]}),c.jsxs("button",{className:"nb-btn",style:{background:"var(--color-crashed)",color:"var(--color-bg)"},type:"button",onClick:async()=>{if(!(!await o({title:r("cardModal.action.delete.confirm1.title",{seq:t}),body:r("cardModal.action.delete.confirm1.body",{title:d.title}),confirm:r("cardModal.action.delete.confirm1.button"),danger:!0})||!await o({title:r("cardModal.action.delete.confirm2.title"),body:r("cardModal.action.delete.confirm2.body",{seq:t}),confirm:r("cardModal.action.delete"),danger:!0})))try{await V6(e,t),i(),n()}catch(ke){u({title:r("projectDetail.pipelines.delete.error"),body:ke instanceof Error?ke.message:String(ke)})}},"aria-label":r("cardModal.action.delete"),children:[c.jsx(Ki,{size:14,strokeWidth:2.5}),r("cardModal.action.delete")]})]})})]})]}),v&&c.jsx(dB,{project:e,seq:t,onClose:()=>N(!1)})]})}function dB({project:e,seq:t,onClose:n}){const i=Ie(),[r,a]=j.useState(!1),{data:o,isLoading:u,isError:d,error:h}=Ve({queryKey:["card-prompt",e,t],queryFn:()=>K6(e,t),staleTime:0});j.useEffect(()=>{const p=y=>{y.key==="Escape"&&n()};return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[n]);const g=()=>{o!=null&&o.prompt&&navigator.clipboard.writeText(o.prompt).then(()=>{a(!0),setTimeout(()=>a(!1),1500)})};return c.jsx("div",{role:"dialog","aria-modal":"true",className:"fixed inset-0 z-50 flex items-start justify-center p-6 bg-black/40 overflow-auto",onClick:n,children:c.jsxs("div",{className:"nb-card mt-8 w-full max-w-4xl",onClick:p=>p.stopPropagation(),children:[c.jsxs("header",{className:"flex items-center justify-between gap-4 mb-3",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-2xl font-bold",children:i("cardModal.prompt.title")}),c.jsxs("div",{className:"flex items-center gap-2",children:[(o==null?void 0:o.prompt)&&c.jsxs("button",{className:"nb-btn px-3 py-2 text-sm flex items-center gap-1.5",type:"button",onClick:g,children:[c.jsx(H2,{size:14,strokeWidth:2.5}),i(r?"cardModal.prompt.copied":"cardModal.prompt.copy")]}),c.jsx("button",{className:"nb-btn nb-btn-mint p-2",type:"button",onClick:n,"aria-label":i("skillDetail.close.aria"),children:c.jsx(Jt,{size:16,strokeWidth:3})})]})]}),u&&c.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:i("cardModal.prompt.loading")}),d&&c.jsx("p",{className:"text-sm text-[var(--color-crashed)]",children:i("cardModal.prompt.error",{detail:h instanceof Error?h.message:String(h)})}),o&&c.jsxs("div",{className:"flex flex-col gap-3",children:[c.jsx("div",{className:"text-xs font-bold px-3 py-2 rounded-lg border-2 border-[var(--color-text)]",style:{background:o.meta.source==="actual"?"var(--color-accent-mint)":"var(--color-accent-yellow)"},children:o.meta.source==="actual"?i("cardModal.prompt.sourceActual",{time:o.meta.dispatchedAt?new Date(o.meta.dispatchedAt).toLocaleString():"—"}):i("cardModal.prompt.sourcePreview")}),o.meta.source==="preview"&&c.jsxs("div",{className:"flex flex-wrap gap-2 text-xs",children:[c.jsx("span",{className:"nb-badge",children:i("cardModal.prompt.metaSkills",{skills:o.meta.skills.length?o.meta.skills.join(", "):"—"})}),o.meta.memoryIncluded&&c.jsx("span",{className:"nb-badge",children:i("cardModal.prompt.metaMemory")}),c.jsx("span",{className:"nb-badge",children:o.meta.git?i("cardModal.prompt.metaGit"):i("cardModal.prompt.metaNonGit")})]}),c.jsx("div",{className:"scroll-frame max-h-[60vh] rounded-lg border-2 border-[var(--color-text)] bg-surface-input",children:c.jsx("pre",{className:"scroll-frame-body max-h-[60vh] p-4 text-xs font-[family-name:var(--font-mono)] whitespace-pre-wrap break-words",children:o.prompt})}),o.meta.nativeContext.length>0&&c.jsxs("div",{className:"text-xs text-[var(--color-text-muted)]",children:[c.jsx("p",{className:"font-bold mb-1",children:i("cardModal.prompt.nativeTitle")}),c.jsx("ul",{className:"list-disc pl-5 flex flex-col gap-0.5",children:o.meta.nativeContext.map(p=>c.jsx("li",{children:p},p))})]}),o.meta.notes.map(p=>c.jsx("p",{className:"text-xs text-[var(--color-text-subtle)] italic",children:p},p))]})]})})}function fB({current:e,onChange:t}){const[n,i]=j.useState(!1),r=j.useRef(null),{data:a}=Ve({queryKey:["projects"],queryFn:Ea});return j.useEffect(()=>{const o=u=>{var d;(d=r.current)!=null&&d.contains(u.target)||i(!1)};return document.addEventListener("mousedown",o),()=>document.removeEventListener("mousedown",o)},[]),c.jsxs("div",{className:"relative",ref:r,children:[c.jsxs("button",{type:"button",className:"nb-btn font-[family-name:var(--font-mono)] text-sm",onClick:()=>i(o=>!o),children:[e,c.jsx(Ju,{size:14,strokeWidth:2.5})]}),n&&a&&c.jsx("div",{className:"absolute right-0 mt-2 z-20 min-w-[200px] nb-card p-1 overflow-hidden",children:c.jsx("div",{className:"max-h-[60vh] overflow-y-auto",children:k_(a.data,"activity").map(o=>{const u=o.pipelineStatus==="running";return c.jsxs("button",{type:"button",onClick:()=>{t(o.name),i(!1)},className:["dimension-menu-item w-full text-left px-4 py-2 text-sm font-semibold flex items-center gap-2",o.name===e?"dimension-menu-item-active":""].join(" "),children:[u&&c.jsx(td,{size:12,strokeWidth:3,className:"text-[var(--color-running)] shrink-0","aria-label":"运行中"}),c.jsx("span",{className:"font-[family-name:var(--font-mono)]",children:o.name}),c.jsxs("span",{className:"ml-auto text-xs text-[var(--color-text-muted)]",children:[o.cards.total," cards"]})]},o.name)})})})]})}const hB=[{state:"Planning",labelKey:"board.col.planning",bg:"linear-gradient(180deg, rgba(139, 117, 255, 0.20), rgba(188, 166, 255, 0.075))",badgeVars:{"--skill-badge-lang-bg":"rgba(172, 153, 255, 0.30)","--skill-badge-end-bg":"rgba(151, 133, 239, 0.26)","--skill-badge-persona-bg":"rgba(193, 178, 255, 0.24)","--skill-badge-workflow-bg":"rgba(159, 146, 220, 0.27)","--skill-badge-other-bg":"rgba(126, 107, 206, 0.30)"}},{state:"Backlog",labelKey:"board.col.backlog",bg:"linear-gradient(180deg, rgba(147, 158, 190, 0.14), rgba(188, 166, 255, 0.055))",badgeVars:{"--skill-badge-lang-bg":"rgba(149, 160, 198, 0.24)","--skill-badge-end-bg":"rgba(128, 141, 176, 0.25)","--skill-badge-persona-bg":"rgba(165, 172, 199, 0.22)","--skill-badge-workflow-bg":"rgba(138, 152, 184, 0.26)","--skill-badge-other-bg":"rgba(116, 127, 158, 0.28)"}},{state:"Todo",labelKey:"board.col.todo",bg:"linear-gradient(180deg, rgba(239, 201, 126, 0.18), rgba(188, 166, 255, 0.055))",badgeVars:{"--skill-badge-lang-bg":"rgba(245, 207, 135, 0.28)","--skill-badge-end-bg":"rgba(226, 182, 101, 0.25)","--skill-badge-persona-bg":"rgba(249, 221, 159, 0.23)","--skill-badge-workflow-bg":"rgba(232, 193, 118, 0.27)","--skill-badge-other-bg":"rgba(204, 159, 84, 0.29)"}},{state:"Inprogress",labelKey:"board.col.inprogress",bg:"linear-gradient(180deg, rgba(98, 176, 242, 0.18), rgba(188, 166, 255, 0.065))",badgeVars:{"--skill-badge-lang-bg":"rgba(104, 181, 246, 0.28)","--skill-badge-end-bg":"rgba(79, 153, 223, 0.26)","--skill-badge-persona-bg":"rgba(136, 198, 250, 0.22)","--skill-badge-workflow-bg":"rgba(91, 166, 228, 0.27)","--skill-badge-other-bg":"rgba(67, 128, 197, 0.29)"}},{state:"QA",labelKey:"board.col.qa",bg:"linear-gradient(180deg, rgba(222, 171, 222, 0.18), rgba(188, 166, 255, 0.065))",badgeVars:{"--skill-badge-lang-bg":"rgba(226, 174, 226, 0.28)","--skill-badge-end-bg":"rgba(206, 145, 213, 0.25)","--skill-badge-persona-bg":"rgba(236, 197, 236, 0.22)","--skill-badge-workflow-bg":"rgba(215, 158, 218, 0.27)","--skill-badge-other-bg":"rgba(184, 125, 196, 0.29)"}},{state:"Done",labelKey:"board.col.done",bg:"linear-gradient(180deg, rgba(120, 214, 163, 0.18), rgba(188, 166, 255, 0.055))",badgeVars:{"--skill-badge-lang-bg":"rgba(125, 216, 166, 0.27)","--skill-badge-end-bg":"rgba(93, 190, 139, 0.25)","--skill-badge-persona-bg":"rgba(154, 226, 185, 0.22)","--skill-badge-workflow-bg":"rgba(107, 202, 150, 0.28)","--skill-badge-other-bg":"rgba(75, 166, 120, 0.29)"}}],Aj="sps-console:last-board-project";function pB(){if(typeof window>"u")return null;try{return localStorage.getItem(Aj)}catch{return null}}function mB(e){if(!(typeof window>"u"))try{localStorage.setItem(Aj,e)}catch{}}function gB(){var $,K,W;const e=Ie(),[t,n]=P2(),i=t.get("project"),[r,a]=j.useState(null),[o,u]=j.useState(""),[d,h]=j.useState(()=>new Set),[g,p]=j.useState(()=>new Set),{confirm:y,alert:b}=dn();J6(i);const w=Ve({queryKey:["projects"],queryFn:Ea}),v=Ve({queryKey:["cards",i],queryFn:()=>q6(i??""),enabled:!!i,refetchInterval:3e3}),N=Ft(),k=()=>{N.invalidateQueries({queryKey:["cards",i]}),N.invalidateQueries({queryKey:["projects"]}),N.invalidateQueries({queryKey:["pipeline-status",i]})},A=Y=>{n({project:Y})};j.useEffect(()=>{var I;if(i){mB(i);return}const Y=pB();Y&&((I=w.data)!=null&&I.data.some(L=>L.name===Y))&&n({project:Y},{replace:!0})},[i,w.data,n]);const S=Et({mutationFn:()=>_j(i),onSuccess:()=>{k()},onError:Y=>{b({title:e("board.action.startError"),body:Y instanceof Error?Y.message:String(Y)})}}),_=Et({mutationFn:()=>jj(i),onSuccess:()=>k(),onError:Y=>{b({title:e("board.action.stopError"),body:Y instanceof Error?Y.message:String(Y)})}}),C=Et({mutationFn:()=>Z6(i,{all:!0}),onSuccess:()=>k(),onError:Y=>{b({title:e("board.action.resetError"),body:Y instanceof Error?Y.message:String(Y)})}}),[T,R]=j.useState(!1),O=Et({mutationFn:Y=>W6(i,Y),onSuccess:()=>{k(),R(!1)},onError:Y=>{b({title:e("board.action.newCard.error"),body:Y instanceof Error?Y.message:String(Y)})}}),B=Et({mutationFn:({seq:Y,state:I})=>Q6(i,Y,I),onMutate:async({seq:Y,state:I})=>{await N.cancelQueries({queryKey:["cards",i]});const L=N.getQueryData(["cards",i]);return L&&N.setQueryData(["cards",i],{...L,data:L.data.map(G=>G.seq===Y?{...G,state:I}:G)}),{prev:L}},onError:(Y,I,L)=>{L!=null&&L.prev&&N.setQueryData(["cards",i],L.prev),b({title:e("board.action.moveCard.error"),body:Y instanceof Error?Y.message:String(Y)})},onSettled:()=>{N.invalidateQueries({queryKey:["cards",i]})}}),P=(($=v.data)==null?void 0:$.data)??[],{allSkills:F,allLabels:U}=j.useMemo(()=>{const Y=new Set,I=new Set;for(const L of P){for(const G of L.skills)Y.add(G);for(const G of L.labels)I.add(G)}return{allSkills:[...Y].sort(),allLabels:[...I].sort()}},[P]);if(!i)return c.jsxs("div",{className:"flex flex-col gap-6 w-full",children:[c.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-4xl font-bold",children:e("board.title.bare")}),c.jsxs("div",{className:"nb-card bg-[var(--color-accent-yellow)] max-w-2xl",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold mb-3",children:e("board.pickPrompt.title")}),c.jsx("p",{className:"text-sm mb-4 text-[var(--color-text-muted)]",children:e("board.pickPrompt.body")}),c.jsx("div",{className:"flex flex-wrap gap-2",children:(K=w.data)==null?void 0:K.data.map(Y=>c.jsx("button",{className:"nb-btn nb-btn-blue",onClick:()=>A(Y.name),type:"button",children:Y.name},Y.name))})]})]});const V=P.filter(Y=>{if(o){const I=o.toLowerCase();if(!(Y.title.toLowerCase().includes(I)||Y.skills.some(G=>G.toLowerCase().includes(I))||Y.labels.some(G=>G.toLowerCase().includes(I))))return!1}return!(d.size>0&&!Y.skills.some(L=>d.has(L))||g.size>0&&!Y.labels.some(L=>g.has(L)))}),M=(W=w.data)==null?void 0:W.data.find(Y=>Y.name===i),H=(M==null?void 0:M.pipelineStatus)==="running";return c.jsxs("div",{className:"flex flex-col gap-4 max-w-full flex-1 min-h-0",children:[c.jsxs("header",{className:"flex items-center justify-between flex-wrap gap-3 shrink-0",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-4xl font-bold tracking-tight",children:e("board.title")}),c.jsx("p",{className:"text-[var(--color-text-muted)] text-sm mt-1",children:M?e("board.subtitle",{name:M.name,cards:M.cards.total,workers:M.workers.active}):e("common.loading")})]}),c.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[c.jsx(fB,{current:i,onChange:A}),c.jsxs("button",{className:H?"nb-btn nb-btn-danger":"nb-btn nb-btn-primary",onClick:()=>H?_.mutate():S.mutate(),disabled:S.isPending||_.isPending,type:"button","aria-label":e(H?"board.action.stopAria":"board.action.startAria"),title:e(H?"board.action.stopAria":"board.action.startAria"),children:[S.isPending||_.isPending?c.jsx(Xe,{size:14,strokeWidth:3,className:"animate-spin"}):H?c.jsx(lx,{size:14,strokeWidth:3}):c.jsx(td,{size:14,strokeWidth:3}),e(H?"board.action.stop":"board.action.start")]}),c.jsxs("button",{className:"nb-btn nb-btn-yellow",type:"button",onClick:async()=>{await y({title:e("board.action.reset.confirm.title"),body:e("board.action.reset.confirm.body"),confirm:e("board.action.reset.confirm.button"),danger:!0})&&C.mutate()},disabled:C.isPending,children:[C.isPending?c.jsx(Xe,{size:14,strokeWidth:3,className:"animate-spin"}):c.jsx(ep,{size:14,strokeWidth:2.5}),e("board.action.reset")]}),c.jsxs("button",{className:"nb-btn nb-btn-mint",type:"button",onClick:()=>R(!0),disabled:O.isPending,children:[O.isPending?c.jsx(Xe,{size:14,strokeWidth:3,className:"animate-spin"}):c.jsx(pi,{size:14,strokeWidth:3}),e("board.action.newCard")]})]})]}),c.jsxs("div",{className:"flex items-center gap-3 flex-wrap shrink-0",children:[c.jsxs("div",{className:"relative flex-1 max-w-md",children:[c.jsx(fl,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-[var(--color-text-subtle)]"}),c.jsx("input",{className:"nb-input pl-9 w-full",placeholder:e("board.search.placeholder"),value:o,onChange:Y=>u(Y.target.value),"aria-label":e("board.search.aria")})]}),c.jsx(EE,{label:"skill",options:F,selected:d,onChange:h}),c.jsx(EE,{label:"label",options:U,selected:g,onChange:p}),(o||d.size>0||g.size>0)&&c.jsxs("button",{className:"nb-btn",style:{padding:"4px 10px",fontSize:11},onClick:()=>{u(""),h(new Set),p(new Set)},type:"button","aria-label":e("board.filter.clearAria"),children:[c.jsx(Jt,{size:11,strokeWidth:3}),e("board.filter.clear")]}),c.jsxs("span",{className:"text-xs text-[var(--color-text-muted)] flex items-center gap-1 font-[family-name:var(--font-mono)]",children:[c.jsx(SL,{size:12}),V.length," / ",P.length]})]}),v.isError&&c.jsxs("div",{className:"nb-card bg-[var(--color-crashed-bg)]",children:[c.jsx("p",{className:"font-semibold",children:e("board.error.loadCards")}),c.jsx("p",{className:"text-sm mt-1 text-[var(--color-text-muted)]",children:v.error instanceof Error?v.error.message:String(v.error)})]}),!v.isError&&c.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6 auto-rows-fr gap-3 flex-1 min-h-0",children:hB.map(Y=>c.jsx(cB,{label:e(Y.labelKey),bg:Y.bg,badgeVars:Y.badgeVars,cards:V.filter(yB(Y.state)),onCardClick:I=>a(I.seq),onDropCard:I=>B.mutate({seq:I,state:Y.state})},Y.state))}),r!==null&&c.jsx(uB,{project:i,seq:r,onClose:()=>a(null),onChanged:k}),T&&c.jsx(F6,{project:i,isPending:O.isPending,onCancel:()=>R(!1),onCreate:Y=>O.mutate(Y)})]})}function yB(e){return t=>e==="QA"?t.state==="QA"||t.state==="Review":e==="Done"?t.state==="Done"||t.state==="Canceled":t.state===e}function EE({label:e,options:t,selected:n,onChange:i}){const r=Ie(),[a,o]=j.useState(!1),u=j.useRef(null);j.useEffect(()=>{if(!a)return;const p=b=>{var w;(w=u.current)!=null&&w.contains(b.target)||o(!1)},y=b=>{b.key==="Escape"&&o(!1)};return window.addEventListener("click",p),window.addEventListener("keydown",y),()=>{window.removeEventListener("click",p),window.removeEventListener("keydown",y)}},[a]);const d=p=>{const y=new Set(n);y.has(p)?y.delete(p):y.add(p),i(y)},h=t.length===0,g=n.size;return c.jsxs("div",{ref:u,className:"relative",children:[c.jsxs("button",{type:"button",className:"nb-btn",style:{padding:"6px 12px",fontSize:12},onClick:()=>!h&&o(p=>!p),disabled:h,"aria-haspopup":"listbox","aria-expanded":a,"aria-label":r("board.filter.aria",{label:e}),children:[e,g>0&&c.jsx("span",{className:"ml-1 px-1.5 py-0.5 text-[10px] font-bold rounded-full bg-[var(--color-primary)] text-[var(--color-text)] border border-[var(--color-text)]",children:g}),c.jsx(Ju,{size:11,strokeWidth:3,className:["transition-transform",a?"rotate-180":""].join(" ")})]}),a&&c.jsx("div",{className:"absolute left-0 top-full mt-2 z-20 min-w-[200px] nb-card p-2 overflow-hidden",style:{padding:8},children:c.jsxs("div",{role:"listbox",className:"max-h-64 overflow-auto",children:[t.map(p=>{const y=n.has(p);return c.jsxs("label",{className:["flex items-center gap-2 px-2 py-1.5 rounded cursor-pointer text-sm font-[family-name:var(--font-mono)]",y?"bg-[var(--color-accent-mint)]":"hover:bg-[var(--color-bg-cream)]"].join(" "),children:[c.jsx("input",{type:"checkbox",checked:y,onChange:()=>d(p),className:"flex-shrink-0"}),c.jsx("span",{className:"truncate",children:p})]},p)}),g>0&&c.jsx("button",{type:"button",className:"w-full mt-2 pt-2 border-t-2 border-dashed border-[var(--color-text)] text-xs font-bold text-[var(--color-crashed)] text-center",onClick:()=>i(new Set),children:r("board.filter.clearSelection")})]})})]})}function bB(){return ct("/api/workers/all")}function xB(e){return ct(`/api/projects/${encodeURIComponent(e)}/workers`)}function vB(e,t){return ct(`/api/projects/${encodeURIComponent(e)}/workers/${t}`)}async function Tj(e,t){const n=await fetch(e,{method:"POST",headers:t?{"Content-Type":"application/json"}:void 0,body:t?JSON.stringify(t):void 0});if(!n.ok)throw new Error(`${n.status}: ${await n.text()}`);return n.json().catch(()=>({}))}function SE(e,t){return Tj(`/api/projects/${encodeURIComponent(e)}/workers/${t}/kill`)}function wB(e,t,n){return Tj(`/api/projects/${encodeURIComponent(e)}/workers/${t}/launch`,n?{seq:n}:void 0)}function Ox({state:e}){const n={running:{bg:"var(--color-running-bg)",color:"var(--color-running)",label:"running"},starting:{bg:"var(--color-secondary)",color:"var(--color-text)",label:"starting",icon:c.jsx(Xe,{size:9,strokeWidth:3,className:"animate-spin"})},stuck:{bg:"var(--color-stuck-bg)",color:"var(--color-stuck)",label:"stuck"},crashed:{bg:"var(--color-crashed-bg)",color:"var(--color-crashed)",label:"crashed",icon:c.jsx(kz,{size:9,strokeWidth:2.5})},idle:{bg:"var(--color-idle-bg)",color:"var(--color-idle)",label:"idle"}}[e];return c.jsxs("span",{className:"nb-status inline-flex items-center gap-1",style:{background:n.bg,color:n.color},children:[n.icon,n.label]})}function Rx(e){if(e==null||e<=0)return"—";const t=Math.floor(e/1e3),n=Math.floor(t/3600),i=Math.floor(t%3600/60),r=t%60;return n>0?`${n}h ${i}m`:i>0?`${i}m ${r}s`:`${r}s`}function kB(e){if(e==null||e<=0)return"text-[var(--color-text-muted)]";const t=e/6e4;return t<10?"text-[var(--color-running)]":t<60?"text-[var(--color-stuck)]":"text-[var(--color-crashed)]"}function Lx(e){const t=Date.now()-new Date(e).getTime();return t<6e4?`${Math.floor(t/1e3)}s 前`:t<36e5?`${Math.floor(t/6e4)}m 前`:`${Math.floor(t/36e5)}h 前`}function EB({alerts:e,selected:t,onSelect:n}){const i=Ie();return e.length===0?c.jsxs("div",{className:"nb-card bg-[var(--color-running-bg)] flex items-center gap-3",children:[c.jsx(Cu,{size:18,strokeWidth:2.5,className:"text-[var(--color-running)]"}),c.jsx("span",{className:"text-sm font-bold text-[var(--color-running)]",children:i("workers.alerts.allHealthy")})]}):c.jsxs("section",{children:[c.jsxs("h2",{className:"font-[family-name:var(--font-heading)] text-sm font-bold uppercase tracking-wider mb-2 flex items-center gap-2 text-[var(--color-crashed)]",children:[c.jsx(zz,{size:14,strokeWidth:2.5}),"Alerts (",e.length,")"]}),c.jsx("div",{className:"flex flex-col gap-2",children:e.map(r=>{const a=(t==null?void 0:t.project)===r.project&&(t==null?void 0:t.slot)===r.slot;return c.jsxs("button",{type:"button",onClick:()=>n(r.project,r.slot),className:["nb-card p-3 text-left",r.state==="crashed"?"bg-[var(--color-crashed-bg)]":"bg-[var(--color-stuck-bg)]",a?"ring-4 ring-[var(--color-text)]":""].join(" "),children:[c.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[c.jsx(Ox,{state:r.state}),c.jsxs("span",{className:"font-[family-name:var(--font-mono)] font-bold",children:[r.project,"/worker-",r.slot]}),r.card&&c.jsxs("span",{className:"truncate",children:["#",r.card.seq," ",r.card.title]}),c.jsxs("span",{className:"ml-auto text-xs text-[var(--color-text-muted)] font-[family-name:var(--font-mono)] flex items-center gap-1",children:[c.jsx(q2,{size:10,strokeWidth:2.5}),Rx(r.runtimeMs)]})]}),r.markerUpdatedAt&&c.jsx("div",{className:"text-xs text-[var(--color-text-muted)] mt-1 font-[family-name:var(--font-mono)]",children:r.state==="crashed"?i("workers.alerts.pidDead"):i("workers.alerts.markerStale",{ago:Lx(r.markerUpdatedAt)})})]},`${r.project}-${r.slot}`)})})]})}function SB({active:e,selected:t,onSelect:n}){const i=Ie();return e.length===0?c.jsx("div",{className:"nb-card",children:c.jsx("p",{className:"text-sm text-[var(--color-text-muted)] italic",children:i("workers.active.empty")})}):c.jsxs("section",{children:[c.jsxs("h2",{className:"font-[family-name:var(--font-heading)] text-sm font-bold uppercase tracking-wider mb-2 flex items-center gap-2",children:[c.jsx(Xh,{size:14,strokeWidth:2.5}),"Active (",e.length,")"]}),c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:e.map(r=>{const a=(t==null?void 0:t.project)===r.project&&(t==null?void 0:t.slot)===r.slot;return c.jsxs("button",{type:"button",onClick:()=>n(r.project,r.slot),className:["nb-card p-3 text-left",r.state==="starting"?"bg-[var(--color-secondary)]":"bg-[var(--color-running-bg)]",a?"ring-4 ring-[var(--color-text)]":""].join(" "),children:[c.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[c.jsx(Ox,{state:r.state}),c.jsxs("span",{className:"font-[family-name:var(--font-mono)] font-bold text-sm flex-1 truncate",children:[r.project,"/worker-",r.slot]}),c.jsx("span",{className:`text-xs font-[family-name:var(--font-mono)] ${kB(r.runtimeMs)}`,children:Rx(r.runtimeMs)})]}),r.card&&c.jsxs("div",{className:"text-sm font-semibold mb-1 truncate",children:["#",r.card.seq," · ",r.card.title]}),c.jsxs("div",{className:"text-xs text-[var(--color-text-muted)] font-[family-name:var(--font-mono)] flex items-center gap-2 mb-1",children:[r.stage&&c.jsxs("span",{children:["stage: ",r.stage]}),r.markerUpdatedAt&&c.jsxs("span",{className:"ml-auto",children:["marker ",Lx(r.markerUpdatedAt)]})]}),r.lastLogLine&&c.jsxs("div",{className:"text-[11px] font-[family-name:var(--font-mono)] text-[var(--color-text-muted)] bg-[var(--color-bg)] border-2 border-[var(--color-text)] rounded px-2 py-1 mt-2 truncate",children:[c.jsx(n_,{size:9,strokeWidth:2.5,className:"inline-block mr-1 align-text-bottom"}),r.lastLogLine.msg]})]},`${r.project}-${r.slot}`)})})]})}function NB({capacity:e,selected:t,onSelect:n}){const i=Ie();return e.length===0?null:c.jsxs("section",{className:"flex flex-col min-h-0 flex-1",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-sm font-bold uppercase tracking-wider mb-2 shrink-0",children:"Capacity"}),c.jsxs("div",{className:"scroll-frame min-h-0 flex-1 rounded-lg border-2 border-[var(--color-border-light)] bg-[var(--color-bg-cream)] flex flex-col",children:[c.jsxs("table",{className:"w-full table-fixed text-sm shrink-0",children:[c.jsx(NE,{}),c.jsx("thead",{children:c.jsxs("tr",{className:"border-b-2 border-[var(--color-border-light)] bg-[var(--color-bg-soft)]",children:[c.jsx("th",{className:"px-3 py-2 text-left font-bold text-xs uppercase tracking-wider",children:i("workers.capacity.col.project")}),c.jsx("th",{className:"px-3 py-2 text-left font-bold text-xs uppercase tracking-wider",children:i("workers.capacity.col.usage")}),c.jsx("th",{className:"px-3 py-2 text-right font-bold text-xs uppercase tracking-wider",children:"running"}),c.jsx("th",{className:"px-3 py-2 text-right font-bold text-xs uppercase tracking-wider",children:i("workers.capacity.col.other")}),c.jsx("th",{className:"px-3 py-2"})]})})]}),c.jsx("div",{className:"bg-color-bg-soft scroll-frame-body flex-1",children:c.jsxs("table",{className:"w-full table-fixed text-sm",children:[c.jsx(NE,{}),c.jsx("tbody",{children:e.map(r=>c.jsx(_B,{capacity:r,selected:(t==null?void 0:t.project)===r.project,onSelect:()=>n(r.project)},r.project))})]})})]})]})}function NE(){return c.jsxs("colgroup",{children:[c.jsx("col",{className:"w-[24%]"}),c.jsx("col",{className:"w-[28%]"}),c.jsx("col",{className:"w-[16%]"}),c.jsx("col",{className:"w-[20%]"}),c.jsx("col",{className:"w-[12%]"})]})}function _B({capacity:e,selected:t,onSelect:n}){const i=Ie(),r=e.running+e.starting+e.stuck+e.crashed;return c.jsxs("tr",{onClick:n,className:["border-b border-dashed border-[var(--color-border-light)] last:border-0 cursor-pointer hover:bg-[var(--color-accent-yellow)]",t?"bg-[var(--color-accent-yellow)]":""].join(" "),children:[c.jsx("td",{className:"px-3 py-2 font-[family-name:var(--font-mono)] font-bold",children:e.project}),c.jsx("td",{className:"px-3 py-2",children:c.jsx(jB,{total:e.total,cap:e})}),c.jsxs("td",{className:"px-3 py-2 text-right font-[family-name:var(--font-mono)]",children:[c.jsx("span",{className:"text-[var(--color-running)] font-bold",children:e.running}),c.jsxs("span",{className:"text-[var(--color-text-muted)]",children:["/",e.total]})]}),c.jsxs("td",{className:"px-3 py-2 text-right text-xs font-[family-name:var(--font-mono)] text-[var(--color-text-muted)]",children:[e.starting>0&&c.jsxs("span",{className:"mr-2",children:["starting ",e.starting]}),e.stuck>0&&c.jsxs("span",{className:"text-[var(--color-stuck)] font-bold mr-2",children:["stuck ",e.stuck]}),e.crashed>0&&c.jsxs("span",{className:"text-[var(--color-crashed)] font-bold mr-2",children:["crashed ",e.crashed]}),r===0&&c.jsx("span",{children:"idle"})]}),c.jsx("td",{className:"px-3 py-2 text-right",children:c.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:i("workers.capacity.detailHint")})})]})}function jB({total:e,cap:t}){const n=[];for(let i=0;i<t.crashed;i++)n.push("crashed");for(let i=0;i<t.stuck;i++)n.push("stuck");for(let i=0;i<t.starting;i++)n.push("starting");for(let i=0;i<t.running;i++)n.push("running");for(let i=0;i<t.idle;i++)n.push("idle");return c.jsxs("div",{className:"flex gap-1 items-center",children:[n.map((i,r)=>c.jsx("span",{className:"inline-block w-3 h-3 rounded-full border-2 border-[var(--color-text)]",style:{background:CB(i)},title:i},r)),c.jsxs("span",{className:"text-xs text-[var(--color-text-muted)] ml-2 font-[family-name:var(--font-mono)]",children:[e," slot",e!==1?"s":""]})]})}function CB(e){switch(e){case"running":return"var(--color-running-bg)";case"starting":return"var(--color-secondary)";case"stuck":return"var(--color-stuck-bg)";case"crashed":return"var(--color-crashed-bg)";default:return"var(--color-idle-bg)"}}function AB({project:e,initialSlot:t,onChange:n}){var h;const i=Ie(),r=Ve({queryKey:["workers",e],queryFn:()=>xB(e),refetchInterval:3e3}),a=((h=r.data)==null?void 0:h.data)??[],[o,u]=j.useState(null);j.useEffect(()=>{if(a.length===0){u(null);return}const g=a[0].slot;u(p=>p!=null&&a.some(y=>y.slot===p)?p:t!=null&&a.some(y=>y.slot===t)?t:g)},[e,t,a.length]);const d=a.find(g=>g.slot===o)??null;return c.jsxs("div",{className:"flex flex-col h-full",children:[c.jsxs("div",{className:"px-4 bg-color-bg-soft py-3 border-b-2 border-[var(--color-text)] bg-[var(--color-bg-cream)]",children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsx("span",{className:"font-[family-name:var(--font-mono)] font-bold truncate",children:e}),c.jsx(wa,{to:`/board?project=${encodeURIComponent(e)}`,className:"text-xs underline text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:i("workers.panel.boardLink")})]}),r.isLoading&&a.length===0?c.jsx("p",{className:"text-xs text-[var(--color-text-muted)] italic",children:i("workers.panel.loading")}):a.length===0?c.jsx("p",{className:"text-xs text-[var(--color-text-muted)] italic",children:i("workers.panel.empty.slots")}):c.jsx("div",{className:"flex flex-wrap gap-2",children:a.map(g=>c.jsx(TB,{worker:g,active:g.slot===o,onClick:()=>u(g.slot)},g.slot))})]}),d?c.jsx(MB,{project:e,worker:d,onChange:n}):c.jsx("div",{className:"flex-1 flex items-center justify-center p-6 text-center",children:c.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:a.length===0?i("workers.panel.empty.noWorker"):i("workers.panel.empty.pickOne")})})]})}function TB({worker:e,active:t,onClick:n}){const i=Ie();return c.jsxs("button",{type:"button",onClick:n,className:["nb-card p-2 text-left min-w-[130px] transition-transform",t?"ring-4 ring-[var(--color-text)]":"opacity-80 hover:opacity-100"].join(" "),children:[c.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[c.jsx(Ox,{state:e.state}),c.jsxs("span",{className:"font-[family-name:var(--font-mono)] font-bold text-xs",children:["worker-",e.slot]})]}),e.card?c.jsxs("div",{className:"text-[11px] truncate font-[family-name:var(--font-mono)]",children:["#",e.card.seq," ",e.card.title]}):c.jsx("div",{className:"text-[11px] text-[var(--color-text-muted)] italic",children:i("workers.panel.idle.short")})]})}function MB({project:e,worker:t,onChange:n}){var y,b;const i=Ie(),{confirm:r,alert:a}=dn(),o=t.state==="crashed"||t.state==="stuck",u=Ve({queryKey:["worker-detail",e,t.slot],queryFn:()=>vB(e,t.slot),refetchInterval:3e3}),d=((y=u.data)==null?void 0:y.recentOutput)??[],h=((b=u.data)==null?void 0:b.recentLogs)??[],g=j.useRef(null),p=j.useRef(!0);return j.useEffect(()=>{const w=g.current;w&&p.current&&(w.scrollTop=w.scrollHeight)},[d]),c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex-1 overflow-auto p-4 flex flex-col gap-4",children:[t.card?c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-text-muted)] mb-1",children:i("workers.panel.section.currentCard")}),c.jsxs("div",{className:"text-sm font-semibold break-words",children:["#",t.card.seq," · ",t.card.title]})]}):c.jsx("div",{className:"text-sm text-[var(--color-text-muted)] italic",children:i("workers.panel.idle.full")}),c.jsxs("dl",{className:"grid grid-cols-[100px_1fr] gap-y-2 text-sm",children:[c.jsx("dt",{className:"font-bold",children:"Stage"}),c.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:t.stage??"—"}),c.jsx("dt",{className:"font-bold",children:"PID"}),c.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:t.pid??"—"}),c.jsx("dt",{className:"font-bold",children:"Runtime"}),c.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:Rx(t.runtimeMs)}),c.jsx("dt",{className:"font-bold",children:"Started"}),c.jsx("dd",{className:"font-[family-name:var(--font-mono)] text-xs",children:t.startedAt?new Date(t.startedAt).toLocaleString():"—"}),c.jsx("dt",{className:"font-bold",children:"Marker"}),c.jsx("dd",{className:"font-[family-name:var(--font-mono)] text-xs",children:t.markerUpdatedAt?Lx(t.markerUpdatedAt):"—"})]}),c.jsxs("div",{children:[c.jsxs("div",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-text-muted)] mb-1 flex items-center gap-1",children:[c.jsx(n_,{size:10,strokeWidth:2.5}),i("workers.panel.section.claudeOutput",{n:d.length})]}),u.isLoading&&d.length===0?c.jsx("p",{className:"text-xs text-[var(--color-text-muted)] italic",children:i("workers.panel.output.loading")}):d.length===0?c.jsx("p",{className:"text-xs text-[var(--color-text-muted)] italic",children:i("workers.panel.output.empty")}):c.jsx("pre",{ref:g,onScroll:w=>{const v=w.currentTarget;p.current=v.scrollHeight-v.scrollTop-v.clientHeight<24},className:"text-xs font-[family-name:var(--font-mono)] bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded p-2 max-h-80 overflow-auto whitespace-pre-wrap break-words",children:d.map(w=>`${w.ts?`${w.ts} [${w.kind}] `:`[${w.kind}] `}${w.text}`).join(`
|
|
746
|
+
`)})]}),h.length>0&&c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-text-muted)] mb-1 opacity-60",children:i("workers.panel.section.heartbeat",{n:h.length})}),c.jsx("pre",{className:"text-xs font-[family-name:var(--font-mono)] bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded p-2 max-h-40 overflow-auto whitespace-pre-wrap break-words opacity-80",children:h.map(w=>`${w.ts??""} [${w.level}] ${w.msg}`).join(`
|
|
747
|
+
`)}),c.jsx(wa,{to:`/projects/${encodeURIComponent(e)}?tab=logs&worker=${t.slot}`,className:"text-xs underline text-[var(--color-running)] mt-1 inline-block",children:i("workers.panel.heartbeat.fullLog")})]})]}),c.jsxs("div",{className:"px-4 py-3 border-t-2 border-[var(--color-text)] bg-[var(--color-bg-cream)] flex gap-2 justify-end flex-wrap",children:[o&&t.card&&c.jsxs("button",{type:"button",className:"nb-btn nb-btn-mint",style:{padding:"4px 10px",fontSize:11},onClick:async()=>{if(await r({title:i("workers.panel.action.restart.confirm.title",{slot:t.slot}),body:i("workers.panel.action.restart.confirm.body",{seq:t.card.seq}),confirm:i("workers.panel.action.restart.confirm.button")})){try{await SE(e,t.slot)}catch{}try{await wB(e,t.slot,t.card.seq),n()}catch(v){a({title:i("workers.panel.action.restart.error"),body:v instanceof Error?v.message:String(v)})}}},children:[c.jsx(Mz,{size:11,strokeWidth:2.5})," ",i("workers.panel.action.restart")]}),t.state!=="idle"&&c.jsxs("button",{type:"button",className:"nb-btn nb-btn-danger",style:{padding:"4px 10px",fontSize:11},onClick:async()=>{if(await r({title:i("workers.panel.action.kill.confirm.title",{slot:t.slot}),body:i("workers.panel.action.kill.confirm.body"),confirm:i("workers.panel.action.kill.confirm.button"),danger:!0}))try{await SE(e,t.slot),n()}catch(v){a({title:i("workers.panel.action.kill.error"),body:v instanceof Error?v.message:String(v)})}},children:[c.jsx(Kz,{size:11,strokeWidth:2.5})," ",i("workers.panel.action.kill")]})]})]})}function DB(){var o;const e=Ie(),t=Ft(),[n,i]=j.useState(null),r=Ve({queryKey:["workers-agg"],queryFn:bB,refetchInterval:5e3});j.useEffect(()=>{if(!r.data)return;const u=r.data.capacity.map(h=>h.project),d=[];for(const h of u){const g=new EventSource(`/stream/projects/${encodeURIComponent(h)}`),p=()=>{t.invalidateQueries({queryKey:["workers-agg"]})};g.addEventListener("worker.updated",p),g.addEventListener("worker.added",p),g.addEventListener("worker.deleted",p),g.addEventListener("card.updated",p),d.push(g)}return()=>{for(const h of d)h.close()}},[(o=r.data)==null?void 0:o.capacity.map(u=>u.project).join(","),t]);const a=j.useMemo(()=>{if(!r.data)return{projects:0,running:0,starting:0,stuck:0,crashed:0,idle:0};const u={projects:r.data.capacity.length,running:0,starting:0,stuck:0,crashed:0,idle:0};for(const d of r.data.capacity)u.running+=d.running,u.starting+=d.starting,u.stuck+=d.stuck,u.crashed+=d.crashed,u.idle+=d.idle;return u},[r.data]);return c.jsxs("div",{className:"flex flex-col gap-4 h-[calc(100vh-140px)]",children:[c.jsxs("header",{className:"flex items-center justify-between flex-wrap gap-3",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-4xl font-bold tracking-tight",children:e("workers.title")}),c.jsx("p",{className:"text-sm text-[var(--color-text-muted)] mt-1",children:e("workers.summary",{projects:a.projects,running:a.running,starting:a.starting,stuck:a.stuck,crashed:a.crashed,idle:a.idle})})]}),c.jsxs("button",{className:"nb-btn",style:{padding:"6px 12px",fontSize:12},onClick:()=>r.refetch(),disabled:r.isFetching,type:"button","aria-label":e("workers.refresh.aria"),children:[r.isFetching?c.jsx(Xe,{size:12,strokeWidth:3,className:"animate-spin"}):c.jsx(bs,{size:12,strokeWidth:2.5}),e("workers.refresh")]})]}),c.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-4 flex-1 min-h-0",children:[c.jsxs("div",{className:"flex flex-col gap-4 min-h-0 pr-2",children:[r.isLoading&&c.jsx("p",{className:"text-[var(--color-text-muted)] italic",children:e("common.loading")}),r.isError&&c.jsx("div",{className:"nb-card bg-[var(--color-crashed-bg)]",children:c.jsx("p",{children:e("workers.error.load",{detail:r.error instanceof Error?r.error.message:String(r.error)})})}),r.data&&c.jsxs(c.Fragment,{children:[c.jsx(EB,{alerts:r.data.alerts,selected:n,onSelect:(u,d)=>i({project:u,slot:d})}),c.jsx(SB,{active:r.data.active,selected:n,onSelect:(u,d)=>i({project:u,slot:d})}),c.jsx(NB,{capacity:r.data.capacity,selected:n,onSelect:u=>i({project:u})})]})]}),c.jsx("aside",{className:"nb-card p-0 overflow-hidden flex flex-col h-full",children:n?c.jsx(AB,{project:n.project,initialSlot:n.slot,onChange:()=>t.invalidateQueries({queryKey:["workers-agg"]})}):c.jsx("div",{className:"flex-1 bg-color-bg-soft bg-surface-input flex items-center justify-center p-6 text-center",children:c.jsxs("div",{children:[c.jsx(Xh,{size:32,className:"mx-auto mb-3 text-[var(--color-text-subtle)]",strokeWidth:2}),c.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:e("workers.empty.hint")})]})})})]})]})}function Mj(){return ct("/api/gen/jobs")}function OB(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const RB=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,LB=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,zB={};function _E(e,t){return(zB.jsx?LB:RB).test(e)}const IB=/[ \t\n\f\r]/g;function PB(e){return typeof e=="object"?e.type==="text"?jE(e.value):!1:jE(e)}function jE(e){return e.replace(IB,"")===""}class sd{constructor(t,n,i){this.normal=n,this.property=t,i&&(this.space=i)}}sd.prototype.normal={};sd.prototype.property={};sd.prototype.space=void 0;function Dj(e,t){const n={},i={};for(const r of e)Object.assign(n,r.property),Object.assign(i,r.normal);return new sd(n,i,t)}function yb(e){return e.toLowerCase()}class mi{constructor(t,n){this.attribute=n,this.property=t}}mi.prototype.attribute="";mi.prototype.booleanish=!1;mi.prototype.boolean=!1;mi.prototype.commaOrSpaceSeparated=!1;mi.prototype.commaSeparated=!1;mi.prototype.defined=!1;mi.prototype.mustUseProperty=!1;mi.prototype.number=!1;mi.prototype.overloadedBoolean=!1;mi.prototype.property="";mi.prototype.spaceSeparated=!1;mi.prototype.space=void 0;let BB=0;const ft=Sl(),Nn=Sl(),bb=Sl(),Te=Sl(),Yt=Sl(),No=Sl(),Ei=Sl();function Sl(){return 2**++BB}const xb=Object.freeze(Object.defineProperty({__proto__:null,boolean:ft,booleanish:Nn,commaOrSpaceSeparated:Ei,commaSeparated:No,number:Te,overloadedBoolean:bb,spaceSeparated:Yt},Symbol.toStringTag,{value:"Module"})),ry=Object.keys(xb);class zx extends mi{constructor(t,n,i,r){let a=-1;if(super(t,n),CE(this,"space",r),typeof i=="number")for(;++a<ry.length;){const o=ry[a];CE(this,ry[a],(i&xb[o])===xb[o])}}}zx.prototype.defined=!0;function CE(e,t,n){n&&(e[t]=n)}function lc(e){const t={},n={};for(const[i,r]of Object.entries(e.properties)){const a=new zx(i,e.transform(e.attributes||{},i),r,e.space);e.mustUseProperty&&e.mustUseProperty.includes(i)&&(a.mustUseProperty=!0),t[i]=a,n[yb(i)]=i,n[yb(a.attribute)]=i}return new sd(t,n,e.space)}const Oj=lc({properties:{ariaActiveDescendant:null,ariaAtomic:Nn,ariaAutoComplete:null,ariaBusy:Nn,ariaChecked:Nn,ariaColCount:Te,ariaColIndex:Te,ariaColSpan:Te,ariaControls:Yt,ariaCurrent:null,ariaDescribedBy:Yt,ariaDetails:null,ariaDisabled:Nn,ariaDropEffect:Yt,ariaErrorMessage:null,ariaExpanded:Nn,ariaFlowTo:Yt,ariaGrabbed:Nn,ariaHasPopup:null,ariaHidden:Nn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Yt,ariaLevel:Te,ariaLive:null,ariaModal:Nn,ariaMultiLine:Nn,ariaMultiSelectable:Nn,ariaOrientation:null,ariaOwns:Yt,ariaPlaceholder:null,ariaPosInSet:Te,ariaPressed:Nn,ariaReadOnly:Nn,ariaRelevant:null,ariaRequired:Nn,ariaRoleDescription:Yt,ariaRowCount:Te,ariaRowIndex:Te,ariaRowSpan:Te,ariaSelected:Nn,ariaSetSize:Te,ariaSort:null,ariaValueMax:Te,ariaValueMin:Te,ariaValueNow:Te,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Rj(e,t){return t in e?e[t]:t}function Lj(e,t){return Rj(e,t.toLowerCase())}const $B=lc({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:No,acceptCharset:Yt,accessKey:Yt,action:null,allow:null,allowFullScreen:ft,allowPaymentRequest:ft,allowUserMedia:ft,alt:null,as:null,async:ft,autoCapitalize:null,autoComplete:Yt,autoFocus:ft,autoPlay:ft,blocking:Yt,capture:null,charSet:null,checked:ft,cite:null,className:Yt,cols:Te,colSpan:null,content:null,contentEditable:Nn,controls:ft,controlsList:Yt,coords:Te|No,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ft,defer:ft,dir:null,dirName:null,disabled:ft,download:bb,draggable:Nn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ft,formTarget:null,headers:Yt,height:Te,hidden:bb,high:Te,href:null,hrefLang:null,htmlFor:Yt,httpEquiv:Yt,id:null,imageSizes:null,imageSrcSet:null,inert:ft,inputMode:null,integrity:null,is:null,isMap:ft,itemId:null,itemProp:Yt,itemRef:Yt,itemScope:ft,itemType:Yt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ft,low:Te,manifest:null,max:null,maxLength:Te,media:null,method:null,min:null,minLength:Te,multiple:ft,muted:ft,name:null,nonce:null,noModule:ft,noValidate:ft,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:ft,optimum:Te,pattern:null,ping:Yt,placeholder:null,playsInline:ft,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ft,referrerPolicy:null,rel:Yt,required:ft,reversed:ft,rows:Te,rowSpan:Te,sandbox:Yt,scope:null,scoped:ft,seamless:ft,selected:ft,shadowRootClonable:ft,shadowRootDelegatesFocus:ft,shadowRootMode:null,shape:null,size:Te,sizes:null,slot:null,span:Te,spellCheck:Nn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Te,step:null,style:null,tabIndex:Te,target:null,title:null,translate:null,type:null,typeMustMatch:ft,useMap:null,value:Nn,width:Te,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Yt,axis:null,background:null,bgColor:null,border:Te,borderColor:null,bottomMargin:Te,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ft,declare:ft,event:null,face:null,frame:null,frameBorder:null,hSpace:Te,leftMargin:Te,link:null,longDesc:null,lowSrc:null,marginHeight:Te,marginWidth:Te,noResize:ft,noHref:ft,noShade:ft,noWrap:ft,object:null,profile:null,prompt:null,rev:null,rightMargin:Te,rules:null,scheme:null,scrolling:Nn,standby:null,summary:null,text:null,topMargin:Te,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Te,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ft,disableRemotePlayback:ft,prefix:null,property:null,results:Te,security:null,unselectable:null},space:"html",transform:Lj}),UB=lc({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:Ei,accentHeight:Te,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Te,amplitude:Te,arabicForm:null,ascent:Te,attributeName:null,attributeType:null,azimuth:Te,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Te,by:null,calcMode:null,capHeight:Te,className:Yt,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:Te,diffuseConstant:Te,direction:null,display:null,dur:null,divisor:Te,dominantBaseline:null,download:ft,dx:null,dy:null,edgeMode:null,editable:null,elevation:Te,enableBackground:null,end:null,event:null,exponent:Te,externalResourcesRequired:null,fill:null,fillOpacity:Te,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:No,g2:No,glyphName:No,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Te,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Te,horizOriginX:Te,horizOriginY:Te,id:null,ideographic:Te,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Te,k:Te,k1:Te,k2:Te,k3:Te,k4:Te,kernelMatrix:Ei,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Te,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:Te,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:Te,overlineThickness:Te,paintOrder:null,panose1:null,path:null,pathLength:Te,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Yt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Te,pointsAtY:Te,pointsAtZ:Te,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ei,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ei,rev:Ei,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ei,requiredFeatures:Ei,requiredFonts:Ei,requiredFormats:Ei,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:Te,specularExponent:Te,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Te,strikethroughThickness:Te,string:null,stroke:null,strokeDashArray:Ei,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Te,strokeOpacity:Te,strokeWidth:null,style:null,surfaceScale:Te,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ei,tabIndex:Te,tableValues:null,target:null,targetX:Te,targetY:Te,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ei,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Te,underlineThickness:Te,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Te,values:null,vAlphabetic:Te,vMathematical:Te,vectorEffect:null,vHanging:Te,vIdeographic:Te,version:null,vertAdvY:Te,vertOriginX:Te,vertOriginY:Te,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Te,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Rj}),zj=lc({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()}}),Ij=lc({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Lj}),Pj=lc({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),FB={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"},qB=/[A-Z]/g,AE=/-[a-z]/g,HB=/^data[-\w.:]+$/i;function KB(e,t){const n=yb(t);let i=t,r=mi;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&HB.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(AE,VB);i="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!AE.test(a)){let o=a.replace(qB,GB);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}r=zx}return new r(i,t)}function GB(e){return"-"+e.toLowerCase()}function VB(e){return e.charAt(1).toUpperCase()}const YB=Dj([Oj,$B,zj,Ij,Pj],"html"),Ix=Dj([Oj,UB,zj,Ij,Pj],"svg");function WB(e){return e.join(" ").trim()}var co={},sy,TE;function QB(){if(TE)return sy;TE=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,r=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,u=/^\s+|\s+$/g,d=`
|
|
748
|
+
`,h="/",g="*",p="",y="comment",b="declaration";function w(N,k){if(typeof N!="string")throw new TypeError("First argument must be a string");if(!N)return[];k=k||{};var A=1,S=1;function _(M){var H=M.match(t);H&&(A+=H.length);var $=M.lastIndexOf(d);S=~$?M.length-$:S+M.length}function C(){var M={line:A,column:S};return function(H){return H.position=new T(M),B(),H}}function T(M){this.start=M,this.end={line:A,column:S},this.source=k.source}T.prototype.content=N;function R(M){var H=new Error(k.source+":"+A+":"+S+": "+M);if(H.reason=M,H.filename=k.source,H.line=A,H.column=S,H.source=N,!k.silent)throw H}function O(M){var H=M.exec(N);if(H){var $=H[0];return _($),N=N.slice($.length),H}}function B(){O(n)}function P(M){var H;for(M=M||[];H=F();)H!==!1&&M.push(H);return M}function F(){var M=C();if(!(h!=N.charAt(0)||g!=N.charAt(1))){for(var H=2;p!=N.charAt(H)&&(g!=N.charAt(H)||h!=N.charAt(H+1));)++H;if(H+=2,p===N.charAt(H-1))return R("End of comment missing");var $=N.slice(2,H-2);return S+=2,_($),N=N.slice(H),S+=2,M({type:y,comment:$})}}function U(){var M=C(),H=O(i);if(H){if(F(),!O(r))return R("property missing ':'");var $=O(a),K=M({type:b,property:v(H[0].replace(e,p)),value:$?v($[0].replace(e,p)):p});return O(o),K}}function V(){var M=[];P(M);for(var H;H=U();)H!==!1&&(M.push(H),P(M));return M}return B(),V()}function v(N){return N?N.replace(u,p):p}return sy=w,sy}var ME;function XB(){if(ME)return co;ME=1;var e=co&&co.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(co,"__esModule",{value:!0}),co.default=n;const t=e(QB());function n(i,r){let a=null;if(!i||typeof i!="string")return a;const o=(0,t.default)(i),u=typeof r=="function";return o.forEach(d=>{if(d.type!=="declaration")return;const{property:h,value:g}=d;u?r(h,g,d):g&&(a=a||{},a[h]=g)}),a}return co}var iu={},DE;function ZB(){if(DE)return iu;DE=1,Object.defineProperty(iu,"__esModule",{value:!0}),iu.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,r=/^-(ms)-/,a=function(h){return!h||n.test(h)||e.test(h)},o=function(h,g){return g.toUpperCase()},u=function(h,g){return"".concat(g,"-")},d=function(h,g){return g===void 0&&(g={}),a(h)?h:(h=h.toLowerCase(),g.reactCompat?h=h.replace(r,u):h=h.replace(i,u),h.replace(t,o))};return iu.camelCase=d,iu}var ru,OE;function JB(){if(OE)return ru;OE=1;var e=ru&&ru.__importDefault||function(r){return r&&r.__esModule?r:{default:r}},t=e(XB()),n=ZB();function i(r,a){var o={};return!r||typeof r!="string"||(0,t.default)(r,function(u,d){u&&d&&(o[(0,n.camelCase)(u,a)]=d)}),o}return i.default=i,ru=i,ru}var e$=JB();const t$=Yu(e$),Bj=$j("end"),Px=$j("start");function $j(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 n$(e){const t=Px(e),n=Bj(e);if(t&&n)return{start:t,end:n}}function bu(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?RE(e.position):"start"in e||"end"in e?RE(e):"line"in e||"column"in e?vb(e):""}function vb(e){return LE(e&&e.line)+":"+LE(e&&e.column)}function RE(e){return vb(e&&e.start)+"-"+vb(e&&e.end)}function LE(e){return e&&typeof e=="number"?e:1}class Yn extends Error{constructor(t,n,i){super(),typeof n=="string"&&(i=n,n=void 0);let r="",a={},o=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?r=t:!a.cause&&t&&(o=!0,r=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof i=="string"){const d=i.indexOf(":");d===-1?a.ruleId=i:(a.source=i.slice(0,d),a.ruleId=i.slice(d+1))}if(!a.place&&a.ancestors&&a.ancestors){const d=a.ancestors[a.ancestors.length-1];d&&(a.place=d.position)}const u=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=u?u.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=u?u.line:void 0,this.name=bu(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=o&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Yn.prototype.file="";Yn.prototype.name="";Yn.prototype.reason="";Yn.prototype.message="";Yn.prototype.stack="";Yn.prototype.column=void 0;Yn.prototype.line=void 0;Yn.prototype.ancestors=void 0;Yn.prototype.cause=void 0;Yn.prototype.fatal=void 0;Yn.prototype.place=void 0;Yn.prototype.ruleId=void 0;Yn.prototype.source=void 0;const Bx={}.hasOwnProperty,i$=new Map,r$=/[A-Z]/g,s$=new Set(["table","tbody","thead","tfoot","tr"]),a$=new Set(["td","th"]),Uj="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function l$(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=m$(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=p$(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"?Ix:YB,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Fj(r,e,void 0);return a&&typeof a!="string"?a:r.create(e,r.Fragment,{children:a||void 0},void 0)}function Fj(e,t,n){if(t.type==="element")return o$(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return c$(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return d$(e,t,n);if(t.type==="mdxjsEsm")return u$(e,t);if(t.type==="root")return f$(e,t,n);if(t.type==="text")return h$(e,t)}function o$(e,t,n){const i=e.schema;let r=i;t.tagName.toLowerCase()==="svg"&&i.space==="html"&&(r=Ix,e.schema=r),e.ancestors.push(t);const a=Hj(e,t.tagName,!1),o=g$(e,t);let u=Ux(e,t);return s$.has(t.tagName)&&(u=u.filter(function(d){return typeof d=="string"?!PB(d):!0})),qj(e,o,a,t),$x(o,u),e.ancestors.pop(),e.schema=i,e.create(t,a,o,n)}function c$(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)}Du(e,t.position)}function u$(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Du(e,t.position)}function d$(e,t,n){const i=e.schema;let r=i;t.name==="svg"&&i.space==="html"&&(r=Ix,e.schema=r),e.ancestors.push(t);const a=t.name===null?e.Fragment:Hj(e,t.name,!0),o=y$(e,t),u=Ux(e,t);return qj(e,o,a,t),$x(o,u),e.ancestors.pop(),e.schema=i,e.create(t,a,o,n)}function f$(e,t,n){const i={};return $x(i,Ux(e,t)),e.create(t,e.Fragment,i,n)}function h$(e,t){return t.value}function qj(e,t,n,i){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=i)}function $x(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function p$(e,t,n){return i;function i(r,a,o,u){const h=Array.isArray(o.children)?n:t;return u?h(a,o,u):h(a,o)}}function m$(e,t){return n;function n(i,r,a,o){const u=Array.isArray(a.children),d=Px(i);return t(r,a,o,u,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function g$(e,t){const n={};let i,r;for(r in t.properties)if(r!=="children"&&Bx.call(t.properties,r)){const a=b$(e,r,t.properties[r]);if(a){const[o,u]=a;e.tableCellAlignToStyle&&o==="align"&&typeof u=="string"&&a$.has(t.tagName)?i=u:n[o]=u}}if(i){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return n}function y$(e,t){const n={};for(const i of t.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&e.evaluater){const a=i.data.estree.body[0];a.type;const o=a.expression;o.type;const u=o.properties[0];u.type,Object.assign(n,e.evaluater.evaluateExpression(u.argument))}else Du(e,t.position);else{const r=i.name;let a;if(i.value&&typeof i.value=="object")if(i.value.data&&i.value.data.estree&&e.evaluater){const u=i.value.data.estree.body[0];u.type,a=e.evaluater.evaluateExpression(u.expression)}else Du(e,t.position);else a=i.value===null?!0:i.value;n[r]=a}return n}function Ux(e,t){const n=[];let i=-1;const r=e.passKeys?new Map:i$;for(;++i<t.children.length;){const a=t.children[i];let o;if(e.passKeys){const d=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(d){const h=r.get(d)||0;o=d+"-"+h,r.set(d,h+1)}}const u=Fj(e,a,o);u!==void 0&&n.push(u)}return n}function b$(e,t,n){const i=KB(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=i.commaSeparated?OB(n):WB(n)),i.property==="style"){let r=typeof n=="object"?n:x$(e,String(n));return e.stylePropertyNameCase==="css"&&(r=v$(r)),["style",r]}return[e.elementAttributeNameCase==="react"&&i.space?FB[i.property]||i.property:i.attribute,n]}}function x$(e,t){try{return t$(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const i=n,r=new Yn("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=Uj+"#cannot-parse-style-attribute",r}}function Hj(e,t,n){let i;if(!n)i={type:"Literal",value:t};else if(t.includes(".")){const r=t.split(".");let a=-1,o;for(;++a<r.length;){const u=_E(r[a])?{type:"Identifier",name:r[a]}:{type:"Literal",value:r[a]};o=o?{type:"MemberExpression",object:o,property:u,computed:!!(a&&u.type==="Literal"),optional:!1}:u}i=o}else i=_E(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(i.type==="Literal"){const r=i.value;return Bx.call(e.components,r)?e.components[r]:r}if(e.evaluater)return e.evaluater.evaluateExpression(i);Du(e)}function Du(e,t){const n=new Yn("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=Uj+"#cannot-handle-mdx-estrees-without-createevaluater",n}function v$(e){const t={};let n;for(n in e)Bx.call(e,n)&&(t[w$(n)]=e[n]);return t}function w$(e){let t=e.replace(r$,k$);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function k$(e){return"-"+e.toLowerCase()}const ay={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"]},E$={};function Fx(e,t){const n=E$,i=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,r=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Kj(e,i,r)}function Kj(e,t,n){if(S$(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 zE(e.children,t,n)}return Array.isArray(e)?zE(e,t,n):""}function zE(e,t,n){const i=[];let r=-1;for(;++r<e.length;)i[r]=Kj(e[r],t,n);return i.join("")}function S$(e){return!!(e&&typeof e=="object")}const IE=document.createElement("i");function qx(e){const t="&"+e+";";IE.innerHTML=t;const n=IE.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function ji(e,t,n,i){const r=e.length;let a=0,o;if(t<0?t=-t>r?0:r+t:t=t>r?r:t,n=n>0?n:0,i.length<1e4)o=Array.from(i),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<i.length;)o=i.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function qi(e,t){return e.length>0?(ji(e,e.length,0,t),e):t}const PE={}.hasOwnProperty;function Gj(e){const t={};let n=-1;for(;++n<e.length;)N$(t,e[n]);return t}function N$(e,t){let n;for(n in t){const r=(PE.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let o;if(a)for(o in a){PE.call(r,o)||(r[o]=[]);const u=a[o];_$(r[o],Array.isArray(u)?u:u?[u]:[])}}}function _$(e,t){let n=-1;const i=[];for(;++n<t.length;)(t[n].add==="after"?e:i).push(t[n]);ji(e,0,0,i)}function Vj(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 dr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ni=Na(/[A-Za-z]/),Gn=Na(/[\dA-Za-z]/),j$=Na(/[#-'*+\--9=?A-Z^-~]/);function Mh(e){return e!==null&&(e<32||e===127)}const wb=Na(/\d/),C$=Na(/[\dA-Fa-f]/),A$=Na(/[!-/:-@[-`{-~]/);function Je(e){return e!==null&&e<-2}function Kt(e){return e!==null&&(e<0||e===32)}function gt(e){return e===-2||e===-1||e===32}const mp=Na(new RegExp("\\p{P}|\\p{S}","u")),ml=Na(/\s/);function Na(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function oc(e){const t=[];let n=-1,i=0,r=0;for(;++n<e.length;){const a=e.charCodeAt(n);let o="";if(a===37&&Gn(e.charCodeAt(n+1))&&Gn(e.charCodeAt(n+2)))r=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){const u=e.charCodeAt(n+1);a<56320&&u>56319&&u<57344?(o=String.fromCharCode(a,u),r=1):o="�"}else o=String.fromCharCode(a);o&&(t.push(e.slice(i,n),encodeURIComponent(o)),i=n+r+1,o=""),r&&(n+=r,r=0)}return t.join("")+e.slice(i)}function St(e,t,n,i){const r=i?i-1:Number.POSITIVE_INFINITY;let a=0;return o;function o(d){return gt(d)?(e.enter(n),u(d)):t(d)}function u(d){return gt(d)&&a++<r?(e.consume(d),u):(e.exit(n),t(d))}}const T$={tokenize:M$};function M$(e){const t=e.attempt(this.parser.constructs.contentInitial,i,r);let n;return t;function i(u){if(u===null){e.consume(u);return}return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),St(e,t,"linePrefix")}function r(u){return e.enter("paragraph"),a(u)}function a(u){const d=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=d),n=d,o(u)}function o(u){if(u===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(u);return}return Je(u)?(e.consume(u),e.exit("chunkText"),a):(e.consume(u),o)}}const D$={tokenize:O$},BE={tokenize:R$};function O$(e){const t=this,n=[];let i=0,r,a,o;return u;function u(S){if(i<n.length){const _=n[i];return t.containerState=_[1],e.attempt(_[0].continuation,d,h)(S)}return h(S)}function d(S){if(i++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,r&&A();const _=t.events.length;let C=_,T;for(;C--;)if(t.events[C][0]==="exit"&&t.events[C][1].type==="chunkFlow"){T=t.events[C][1].end;break}k(i);let R=_;for(;R<t.events.length;)t.events[R][1].end={...T},R++;return ji(t.events,C+1,0,t.events.slice(_)),t.events.length=R,h(S)}return u(S)}function h(S){if(i===n.length){if(!r)return y(S);if(r.currentConstruct&&r.currentConstruct.concrete)return w(S);t.interrupt=!!(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(BE,g,p)(S)}function g(S){return r&&A(),k(i),y(S)}function p(S){return t.parser.lazy[t.now().line]=i!==n.length,o=t.now().offset,w(S)}function y(S){return t.containerState={},e.attempt(BE,b,w)(S)}function b(S){return i++,n.push([t.currentConstruct,t.containerState]),y(S)}function w(S){if(S===null){r&&A(),k(0),e.consume(S);return}return r=r||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:r,contentType:"flow",previous:a}),v(S)}function v(S){if(S===null){N(e.exit("chunkFlow"),!0),k(0),e.consume(S);return}return Je(S)?(e.consume(S),N(e.exit("chunkFlow")),i=0,t.interrupt=void 0,u):(e.consume(S),v)}function N(S,_){const C=t.sliceStream(S);if(_&&C.push(null),S.previous=a,a&&(a.next=S),a=S,r.defineSkip(S.start),r.write(C),t.parser.lazy[S.start.line]){let T=r.events.length;for(;T--;)if(r.events[T][1].start.offset<o&&(!r.events[T][1].end||r.events[T][1].end.offset>o))return;const R=t.events.length;let O=R,B,P;for(;O--;)if(t.events[O][0]==="exit"&&t.events[O][1].type==="chunkFlow"){if(B){P=t.events[O][1].end;break}B=!0}for(k(i),T=R;T<t.events.length;)t.events[T][1].end={...P},T++;ji(t.events,O+1,0,t.events.slice(R)),t.events.length=T}}function k(S){let _=n.length;for(;_-- >S;){const C=n[_];t.containerState=C[1],C[0].exit.call(t,e)}n.length=S}function A(){r.write([null]),a=void 0,r=void 0,t.containerState._closeFlow=void 0}}function R$(e,t,n){return St(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function qo(e){if(e===null||Kt(e)||ml(e))return 1;if(mp(e))return 2}function gp(e,t,n){const i=[];let r=-1;for(;++r<e.length;){const a=e[r].resolveAll;a&&!i.includes(a)&&(t=a(t,n),i.push(a))}return t}const kb={name:"attention",resolveAll:L$,tokenize:z$};function L$(e,t){let n=-1,i,r,a,o,u,d,h,g;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;d=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 p={...e[i][1].end},y={...e[n][1].start};$E(p,-d),$E(y,d),o={type:d>1?"strongSequence":"emphasisSequence",start:p,end:{...e[i][1].end}},u={type:d>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:y},a={type:d>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[n][1].start}},r={type:d>1?"strong":"emphasis",start:{...o.start},end:{...u.end}},e[i][1].end={...o.start},e[n][1].start={...u.end},h=[],e[i][1].end.offset-e[i][1].start.offset&&(h=qi(h,[["enter",e[i][1],t],["exit",e[i][1],t]])),h=qi(h,[["enter",r,t],["enter",o,t],["exit",o,t],["enter",a,t]]),h=qi(h,gp(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),h=qi(h,[["exit",a,t],["enter",u,t],["exit",u,t],["exit",r,t]]),e[n][1].end.offset-e[n][1].start.offset?(g=2,h=qi(h,[["enter",e[n][1],t],["exit",e[n][1],t]])):g=0,ji(e,i-1,n-i+3,h),n=i+h.length-g-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function z$(e,t){const n=this.parser.constructs.attentionMarkers.null,i=this.previous,r=qo(i);let a;return o;function o(d){return a=d,e.enter("attentionSequence"),u(d)}function u(d){if(d===a)return e.consume(d),u;const h=e.exit("attentionSequence"),g=qo(d),p=!g||g===2&&r||n.includes(d),y=!r||r===2&&g||n.includes(i);return h._open=!!(a===42?p:p&&(r||!y)),h._close=!!(a===42?y:y&&(g||!p)),t(d)}}function $E(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const I$={name:"autolink",tokenize:P$};function P$(e,t,n){let i=0;return r;function r(b){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(b){return ni(b)?(e.consume(b),o):b===64?n(b):h(b)}function o(b){return b===43||b===45||b===46||Gn(b)?(i=1,u(b)):h(b)}function u(b){return b===58?(e.consume(b),i=0,d):(b===43||b===45||b===46||Gn(b))&&i++<32?(e.consume(b),u):(i=0,h(b))}function d(b){return b===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):b===null||b===32||b===60||Mh(b)?n(b):(e.consume(b),d)}function h(b){return b===64?(e.consume(b),g):j$(b)?(e.consume(b),h):n(b)}function g(b){return Gn(b)?p(b):n(b)}function p(b){return b===46?(e.consume(b),i=0,g):b===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):y(b)}function y(b){if((b===45||Gn(b))&&i++<63){const w=b===45?y:p;return e.consume(b),w}return n(b)}}const ad={partial:!0,tokenize:B$};function B$(e,t,n){return i;function i(a){return gt(a)?St(e,r,"linePrefix")(a):r(a)}function r(a){return a===null||Je(a)?t(a):n(a)}}const Yj={continuation:{tokenize:U$},exit:F$,name:"blockQuote",tokenize:$$};function $$(e,t,n){const i=this;return r;function r(o){if(o===62){const u=i.containerState;return u.open||(e.enter("blockQuote",{_container:!0}),u.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),a}return n(o)}function a(o){return gt(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function U$(e,t,n){const i=this;return r;function r(o){return gt(o)?St(e,a,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):a(o)}function a(o){return e.attempt(Yj,t,n)(o)}}function F$(e){e.exit("blockQuote")}const Wj={name:"characterEscape",tokenize:q$};function q$(e,t,n){return i;function i(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),r}function r(a){return A$(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const Qj={name:"characterReference",tokenize:H$};function H$(e,t,n){const i=this;let r=0,a,o;return u;function u(p){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),d}function d(p){return p===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(p),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),a=31,o=Gn,g(p))}function h(p){return p===88||p===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(p),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,o=C$,g):(e.enter("characterReferenceValue"),a=7,o=wb,g(p))}function g(p){if(p===59&&r){const y=e.exit("characterReferenceValue");return o===Gn&&!qx(i.sliceSerialize(y))?n(p):(e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(p)&&r++<a?(e.consume(p),g):n(p)}}const UE={partial:!0,tokenize:G$},FE={concrete:!0,name:"codeFenced",tokenize:K$};function K$(e,t,n){const i=this,r={partial:!0,tokenize:C};let a=0,o=0,u;return d;function d(T){return h(T)}function h(T){const R=i.events[i.events.length-1];return a=R&&R[1].type==="linePrefix"?R[2].sliceSerialize(R[1],!0).length:0,u=T,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),g(T)}function g(T){return T===u?(o++,e.consume(T),g):o<3?n(T):(e.exit("codeFencedFenceSequence"),gt(T)?St(e,p,"whitespace")(T):p(T))}function p(T){return T===null||Je(T)?(e.exit("codeFencedFence"),i.interrupt?t(T):e.check(UE,v,_)(T)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),y(T))}function y(T){return T===null||Je(T)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),p(T)):gt(T)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),St(e,b,"whitespace")(T)):T===96&&T===u?n(T):(e.consume(T),y)}function b(T){return T===null||Je(T)?p(T):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),w(T))}function w(T){return T===null||Je(T)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),p(T)):T===96&&T===u?n(T):(e.consume(T),w)}function v(T){return e.attempt(r,_,N)(T)}function N(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),k}function k(T){return a>0&>(T)?St(e,A,"linePrefix",a+1)(T):A(T)}function A(T){return T===null||Je(T)?e.check(UE,v,_)(T):(e.enter("codeFlowValue"),S(T))}function S(T){return T===null||Je(T)?(e.exit("codeFlowValue"),A(T)):(e.consume(T),S)}function _(T){return e.exit("codeFenced"),t(T)}function C(T,R,O){let B=0;return P;function P(H){return T.enter("lineEnding"),T.consume(H),T.exit("lineEnding"),F}function F(H){return T.enter("codeFencedFence"),gt(H)?St(T,U,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(H):U(H)}function U(H){return H===u?(T.enter("codeFencedFenceSequence"),V(H)):O(H)}function V(H){return H===u?(B++,T.consume(H),V):B>=o?(T.exit("codeFencedFenceSequence"),gt(H)?St(T,M,"whitespace")(H):M(H)):O(H)}function M(H){return H===null||Je(H)?(T.exit("codeFencedFence"),R(H)):O(H)}}}function G$(e,t,n){const i=this;return r;function r(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a)}function a(o){return i.parser.lazy[i.now().line]?n(o):t(o)}}const ly={name:"codeIndented",tokenize:Y$},V$={partial:!0,tokenize:W$};function Y$(e,t,n){const i=this;return r;function r(h){return e.enter("codeIndented"),St(e,a,"linePrefix",5)(h)}function a(h){const g=i.events[i.events.length-1];return g&&g[1].type==="linePrefix"&&g[2].sliceSerialize(g[1],!0).length>=4?o(h):n(h)}function o(h){return h===null?d(h):Je(h)?e.attempt(V$,o,d)(h):(e.enter("codeFlowValue"),u(h))}function u(h){return h===null||Je(h)?(e.exit("codeFlowValue"),o(h)):(e.consume(h),u)}function d(h){return e.exit("codeIndented"),t(h)}}function W$(e,t,n){const i=this;return r;function r(o){return i.parser.lazy[i.now().line]?n(o):Je(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),r):St(e,a,"linePrefix",5)(o)}function a(o){const u=i.events[i.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(o):Je(o)?r(o):n(o)}}const Q$={name:"codeText",previous:Z$,resolve:X$,tokenize:J$};function X$(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 Z$(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function J$(e,t,n){let i=0,r,a;return o;function o(p){return e.enter("codeText"),e.enter("codeTextSequence"),u(p)}function u(p){return p===96?(e.consume(p),i++,u):(e.exit("codeTextSequence"),d(p))}function d(p){return p===null?n(p):p===32?(e.enter("space"),e.consume(p),e.exit("space"),d):p===96?(a=e.enter("codeTextSequence"),r=0,g(p)):Je(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),d):(e.enter("codeTextData"),h(p))}function h(p){return p===null||p===32||p===96||Je(p)?(e.exit("codeTextData"),d(p)):(e.consume(p),h)}function g(p){return p===96?(e.consume(p),r++,g):r===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(p)):(a.type="codeTextData",h(p))}}class eU{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 a=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return i&&su(this.left,i),a.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),su(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),su(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);su(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);su(this.left,n.reverse())}}}function su(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 Xj(e){const t={};let n=-1,i,r,a,o,u,d,h;const g=new eU(e);for(;++n<g.length;){for(;n in t;)n=t[n];if(i=g.get(n),n&&i[1].type==="chunkFlow"&&g.get(n-1)[1].type==="listItemPrefix"&&(d=i[1]._tokenizer.events,a=0,a<d.length&&d[a][1].type==="lineEndingBlank"&&(a+=2),a<d.length&&d[a][1].type==="content"))for(;++a<d.length&&d[a][1].type!=="content";)d[a][1].type==="chunkText"&&(d[a][1]._isInFirstContentOfListItem=!0,a++);if(i[0]==="enter")i[1].contentType&&(Object.assign(t,tU(g,n)),n=t[n],h=!0);else if(i[1]._container){for(a=n,r=void 0;a--;)if(o=g.get(a),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(r&&(g.get(r)[1].type="lineEndingBlank"),o[1].type="lineEnding",r=a);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;r&&(i[1].end={...g.get(r)[1].start},u=g.slice(r,n),u.unshift(i),g.splice(r,n-r+1,u))}}return ji(e,0,Number.POSITIVE_INFINITY,g.slice(0)),!h}function tU(e,t){const n=e.get(t)[1],i=e.get(t)[2];let r=t-1;const a=[];let o=n._tokenizer;o||(o=i.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const u=o.events,d=[],h={};let g,p,y=-1,b=n,w=0,v=0;const N=[v];for(;b;){for(;e.get(++r)[1]!==b;);a.push(r),b._tokenizer||(g=i.sliceStream(b),b.next||g.push(null),p&&o.defineSkip(b.start),b._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(g),b._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),p=b,b=b.next}for(b=n;++y<u.length;)u[y][0]==="exit"&&u[y-1][0]==="enter"&&u[y][1].type===u[y-1][1].type&&u[y][1].start.line!==u[y][1].end.line&&(v=y+1,N.push(v),b._tokenizer=void 0,b.previous=void 0,b=b.next);for(o.events=[],b?(b._tokenizer=void 0,b.previous=void 0):N.pop(),y=N.length;y--;){const k=u.slice(N[y],N[y+1]),A=a.pop();d.push([A,A+k.length-1]),e.splice(A,2,k)}for(d.reverse(),y=-1;++y<d.length;)h[w+d[y][0]]=w+d[y][1],w+=d[y][1]-d[y][0]-1;return h}const nU={resolve:rU,tokenize:sU},iU={partial:!0,tokenize:aU};function rU(e){return Xj(e),e}function sU(e,t){let n;return i;function i(u){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(u)}function r(u){return u===null?a(u):Je(u)?e.check(iU,o,a)(u):(e.consume(u),r)}function a(u){return e.exit("chunkContent"),e.exit("content"),t(u)}function o(u){return e.consume(u),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}function aU(e,t,n){const i=this;return r;function r(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),St(e,a,"linePrefix")}function a(o){if(o===null||Je(o))return n(o);const u=i.events[i.events.length-1];return!i.parser.constructs.disable.null.includes("codeIndented")&&u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(o):e.interrupt(i.parser.constructs.flow,n,t)(o)}}function Zj(e,t,n,i,r,a,o,u,d){const h=d||Number.POSITIVE_INFINITY;let g=0;return p;function p(k){return k===60?(e.enter(i),e.enter(r),e.enter(a),e.consume(k),e.exit(a),y):k===null||k===32||k===41||Mh(k)?n(k):(e.enter(i),e.enter(o),e.enter(u),e.enter("chunkString",{contentType:"string"}),v(k))}function y(k){return k===62?(e.enter(a),e.consume(k),e.exit(a),e.exit(r),e.exit(i),t):(e.enter(u),e.enter("chunkString",{contentType:"string"}),b(k))}function b(k){return k===62?(e.exit("chunkString"),e.exit(u),y(k)):k===null||k===60||Je(k)?n(k):(e.consume(k),k===92?w:b)}function w(k){return k===60||k===62||k===92?(e.consume(k),b):b(k)}function v(k){return!g&&(k===null||k===41||Kt(k))?(e.exit("chunkString"),e.exit(u),e.exit(o),e.exit(i),t(k)):g<h&&k===40?(e.consume(k),g++,v):k===41?(e.consume(k),g--,v):k===null||k===32||k===40||Mh(k)?n(k):(e.consume(k),k===92?N:v)}function N(k){return k===40||k===41||k===92?(e.consume(k),v):v(k)}}function Jj(e,t,n,i,r,a){const o=this;let u=0,d;return h;function h(b){return e.enter(i),e.enter(r),e.consume(b),e.exit(r),e.enter(a),g}function g(b){return u>999||b===null||b===91||b===93&&!d||b===94&&!u&&"_hiddenFootnoteSupport"in o.parser.constructs?n(b):b===93?(e.exit(a),e.enter(r),e.consume(b),e.exit(r),e.exit(i),t):Je(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),g):(e.enter("chunkString",{contentType:"string"}),p(b))}function p(b){return b===null||b===91||b===93||Je(b)||u++>999?(e.exit("chunkString"),g(b)):(e.consume(b),d||(d=!gt(b)),b===92?y:p)}function y(b){return b===91||b===92||b===93?(e.consume(b),u++,p):p(b)}}function eC(e,t,n,i,r,a){let o;return u;function u(y){return y===34||y===39||y===40?(e.enter(i),e.enter(r),e.consume(y),e.exit(r),o=y===40?41:y,d):n(y)}function d(y){return y===o?(e.enter(r),e.consume(y),e.exit(r),e.exit(i),t):(e.enter(a),h(y))}function h(y){return y===o?(e.exit(a),d(o)):y===null?n(y):Je(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),St(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),g(y))}function g(y){return y===o||y===null||Je(y)?(e.exit("chunkString"),h(y)):(e.consume(y),y===92?p:g)}function p(y){return y===o||y===92?(e.consume(y),g):g(y)}}function xu(e,t){let n;return i;function i(r){return Je(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),n=!0,i):gt(r)?St(e,i,n?"linePrefix":"lineSuffix")(r):t(r)}}const lU={name:"definition",tokenize:cU},oU={partial:!0,tokenize:uU};function cU(e,t,n){const i=this;let r;return a;function a(b){return e.enter("definition"),o(b)}function o(b){return Jj.call(i,e,u,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function u(b){return r=dr(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),d):n(b)}function d(b){return Kt(b)?xu(e,h)(b):h(b)}function h(b){return Zj(e,g,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function g(b){return e.attempt(oU,p,p)(b)}function p(b){return gt(b)?St(e,y,"whitespace")(b):y(b)}function y(b){return b===null||Je(b)?(e.exit("definition"),i.parser.defined.push(r),t(b)):n(b)}}function uU(e,t,n){return i;function i(u){return Kt(u)?xu(e,r)(u):n(u)}function r(u){return eC(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function a(u){return gt(u)?St(e,o,"whitespace")(u):o(u)}function o(u){return u===null||Je(u)?t(u):n(u)}}const dU={name:"hardBreakEscape",tokenize:fU};function fU(e,t,n){return i;function i(a){return e.enter("hardBreakEscape"),e.consume(a),r}function r(a){return Je(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const hU={name:"headingAtx",resolve:pU,tokenize:mU};function pU(e,t){let n=e.length-2,i=3,r,a;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},a={type:"chunkText",start:e[i][1].start,end:e[n][1].end,contentType:"text"},ji(e,i,n-i+1,[["enter",r,t],["enter",a,t],["exit",a,t],["exit",r,t]])),e}function mU(e,t,n){let i=0;return r;function r(g){return e.enter("atxHeading"),a(g)}function a(g){return e.enter("atxHeadingSequence"),o(g)}function o(g){return g===35&&i++<6?(e.consume(g),o):g===null||Kt(g)?(e.exit("atxHeadingSequence"),u(g)):n(g)}function u(g){return g===35?(e.enter("atxHeadingSequence"),d(g)):g===null||Je(g)?(e.exit("atxHeading"),t(g)):gt(g)?St(e,u,"whitespace")(g):(e.enter("atxHeadingText"),h(g))}function d(g){return g===35?(e.consume(g),d):(e.exit("atxHeadingSequence"),u(g))}function h(g){return g===null||g===35||Kt(g)?(e.exit("atxHeadingText"),u(g)):(e.consume(g),h)}}const gU=["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"],qE=["pre","script","style","textarea"],yU={concrete:!0,name:"htmlFlow",resolveTo:vU,tokenize:wU},bU={partial:!0,tokenize:EU},xU={partial:!0,tokenize:kU};function vU(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 wU(e,t,n){const i=this;let r,a,o,u,d;return h;function h(z){return g(z)}function g(z){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(z),p}function p(z){return z===33?(e.consume(z),y):z===47?(e.consume(z),a=!0,v):z===63?(e.consume(z),r=3,i.interrupt?t:I):ni(z)?(e.consume(z),o=String.fromCharCode(z),N):n(z)}function y(z){return z===45?(e.consume(z),r=2,b):z===91?(e.consume(z),r=5,u=0,w):ni(z)?(e.consume(z),r=4,i.interrupt?t:I):n(z)}function b(z){return z===45?(e.consume(z),i.interrupt?t:I):n(z)}function w(z){const te="CDATA[";return z===te.charCodeAt(u++)?(e.consume(z),u===te.length?i.interrupt?t:U:w):n(z)}function v(z){return ni(z)?(e.consume(z),o=String.fromCharCode(z),N):n(z)}function N(z){if(z===null||z===47||z===62||Kt(z)){const te=z===47,me=o.toLowerCase();return!te&&!a&&qE.includes(me)?(r=1,i.interrupt?t(z):U(z)):gU.includes(o.toLowerCase())?(r=6,te?(e.consume(z),k):i.interrupt?t(z):U(z)):(r=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(z):a?A(z):S(z))}return z===45||Gn(z)?(e.consume(z),o+=String.fromCharCode(z),N):n(z)}function k(z){return z===62?(e.consume(z),i.interrupt?t:U):n(z)}function A(z){return gt(z)?(e.consume(z),A):P(z)}function S(z){return z===47?(e.consume(z),P):z===58||z===95||ni(z)?(e.consume(z),_):gt(z)?(e.consume(z),S):P(z)}function _(z){return z===45||z===46||z===58||z===95||Gn(z)?(e.consume(z),_):C(z)}function C(z){return z===61?(e.consume(z),T):gt(z)?(e.consume(z),C):S(z)}function T(z){return z===null||z===60||z===61||z===62||z===96?n(z):z===34||z===39?(e.consume(z),d=z,R):gt(z)?(e.consume(z),T):O(z)}function R(z){return z===d?(e.consume(z),d=null,B):z===null||Je(z)?n(z):(e.consume(z),R)}function O(z){return z===null||z===34||z===39||z===47||z===60||z===61||z===62||z===96||Kt(z)?C(z):(e.consume(z),O)}function B(z){return z===47||z===62||gt(z)?S(z):n(z)}function P(z){return z===62?(e.consume(z),F):n(z)}function F(z){return z===null||Je(z)?U(z):gt(z)?(e.consume(z),F):n(z)}function U(z){return z===45&&r===2?(e.consume(z),$):z===60&&r===1?(e.consume(z),K):z===62&&r===4?(e.consume(z),L):z===63&&r===3?(e.consume(z),I):z===93&&r===5?(e.consume(z),Y):Je(z)&&(r===6||r===7)?(e.exit("htmlFlowData"),e.check(bU,G,V)(z)):z===null||Je(z)?(e.exit("htmlFlowData"),V(z)):(e.consume(z),U)}function V(z){return e.check(xU,M,G)(z)}function M(z){return e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),H}function H(z){return z===null||Je(z)?V(z):(e.enter("htmlFlowData"),U(z))}function $(z){return z===45?(e.consume(z),I):U(z)}function K(z){return z===47?(e.consume(z),o="",W):U(z)}function W(z){if(z===62){const te=o.toLowerCase();return qE.includes(te)?(e.consume(z),L):U(z)}return ni(z)&&o.length<8?(e.consume(z),o+=String.fromCharCode(z),W):U(z)}function Y(z){return z===93?(e.consume(z),I):U(z)}function I(z){return z===62?(e.consume(z),L):z===45&&r===2?(e.consume(z),I):U(z)}function L(z){return z===null||Je(z)?(e.exit("htmlFlowData"),G(z)):(e.consume(z),L)}function G(z){return e.exit("htmlFlow"),t(z)}}function kU(e,t,n){const i=this;return r;function r(o){return Je(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a):n(o)}function a(o){return i.parser.lazy[i.now().line]?n(o):t(o)}}function EU(e,t,n){return i;function i(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(ad,t,n)}}const SU={name:"htmlText",tokenize:NU};function NU(e,t,n){const i=this;let r,a,o;return u;function u(I){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(I),d}function d(I){return I===33?(e.consume(I),h):I===47?(e.consume(I),C):I===63?(e.consume(I),S):ni(I)?(e.consume(I),O):n(I)}function h(I){return I===45?(e.consume(I),g):I===91?(e.consume(I),a=0,w):ni(I)?(e.consume(I),A):n(I)}function g(I){return I===45?(e.consume(I),b):n(I)}function p(I){return I===null?n(I):I===45?(e.consume(I),y):Je(I)?(o=p,K(I)):(e.consume(I),p)}function y(I){return I===45?(e.consume(I),b):p(I)}function b(I){return I===62?$(I):I===45?y(I):p(I)}function w(I){const L="CDATA[";return I===L.charCodeAt(a++)?(e.consume(I),a===L.length?v:w):n(I)}function v(I){return I===null?n(I):I===93?(e.consume(I),N):Je(I)?(o=v,K(I)):(e.consume(I),v)}function N(I){return I===93?(e.consume(I),k):v(I)}function k(I){return I===62?$(I):I===93?(e.consume(I),k):v(I)}function A(I){return I===null||I===62?$(I):Je(I)?(o=A,K(I)):(e.consume(I),A)}function S(I){return I===null?n(I):I===63?(e.consume(I),_):Je(I)?(o=S,K(I)):(e.consume(I),S)}function _(I){return I===62?$(I):S(I)}function C(I){return ni(I)?(e.consume(I),T):n(I)}function T(I){return I===45||Gn(I)?(e.consume(I),T):R(I)}function R(I){return Je(I)?(o=R,K(I)):gt(I)?(e.consume(I),R):$(I)}function O(I){return I===45||Gn(I)?(e.consume(I),O):I===47||I===62||Kt(I)?B(I):n(I)}function B(I){return I===47?(e.consume(I),$):I===58||I===95||ni(I)?(e.consume(I),P):Je(I)?(o=B,K(I)):gt(I)?(e.consume(I),B):$(I)}function P(I){return I===45||I===46||I===58||I===95||Gn(I)?(e.consume(I),P):F(I)}function F(I){return I===61?(e.consume(I),U):Je(I)?(o=F,K(I)):gt(I)?(e.consume(I),F):B(I)}function U(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(e.consume(I),r=I,V):Je(I)?(o=U,K(I)):gt(I)?(e.consume(I),U):(e.consume(I),M)}function V(I){return I===r?(e.consume(I),r=void 0,H):I===null?n(I):Je(I)?(o=V,K(I)):(e.consume(I),V)}function M(I){return I===null||I===34||I===39||I===60||I===61||I===96?n(I):I===47||I===62||Kt(I)?B(I):(e.consume(I),M)}function H(I){return I===47||I===62||Kt(I)?B(I):n(I)}function $(I){return I===62?(e.consume(I),e.exit("htmlTextData"),e.exit("htmlText"),t):n(I)}function K(I){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),W}function W(I){return gt(I)?St(e,Y,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):Y(I)}function Y(I){return e.enter("htmlTextData"),o(I)}}const Hx={name:"labelEnd",resolveAll:AU,resolveTo:TU,tokenize:MU},_U={tokenize:DU},jU={tokenize:OU},CU={tokenize:RU};function AU(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&&ji(e,0,e.length,n),e}function TU(e,t){let n=e.length,i=0,r,a,o,u;for(;n--;)if(r=e[n][1],a){if(r.type==="link"||r.type==="labelLink"&&r._inactive)break;e[n][0]==="enter"&&r.type==="labelLink"&&(r._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(r.type==="labelImage"||r.type==="labelLink")&&!r._balanced&&(a=n,r.type!=="labelLink")){i=2;break}}else r.type==="labelEnd"&&(o=n);const d={type:e[a][1].type==="labelLink"?"link":"image",start:{...e[a][1].start},end:{...e[e.length-1][1].end}},h={type:"label",start:{...e[a][1].start},end:{...e[o][1].end}},g={type:"labelText",start:{...e[a+i+2][1].end},end:{...e[o-2][1].start}};return u=[["enter",d,t],["enter",h,t]],u=qi(u,e.slice(a+1,a+i+3)),u=qi(u,[["enter",g,t]]),u=qi(u,gp(t.parser.constructs.insideSpan.null,e.slice(a+i+4,o-3),t)),u=qi(u,[["exit",g,t],e[o-2],e[o-1],["exit",h,t]]),u=qi(u,e.slice(o+1)),u=qi(u,[["exit",d,t]]),ji(e,a,e.length,u),e}function MU(e,t,n){const i=this;let r=i.events.length,a,o;for(;r--;)if((i.events[r][1].type==="labelImage"||i.events[r][1].type==="labelLink")&&!i.events[r][1]._balanced){a=i.events[r][1];break}return u;function u(y){return a?a._inactive?p(y):(o=i.parser.defined.includes(dr(i.sliceSerialize({start:a.end,end:i.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(y),e.exit("labelMarker"),e.exit("labelEnd"),d):n(y)}function d(y){return y===40?e.attempt(_U,g,o?g:p)(y):y===91?e.attempt(jU,g,o?h:p)(y):o?g(y):p(y)}function h(y){return e.attempt(CU,g,p)(y)}function g(y){return t(y)}function p(y){return a._balanced=!0,n(y)}}function DU(e,t,n){return i;function i(p){return e.enter("resource"),e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),r}function r(p){return Kt(p)?xu(e,a)(p):a(p)}function a(p){return p===41?g(p):Zj(e,o,u,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function o(p){return Kt(p)?xu(e,d)(p):g(p)}function u(p){return n(p)}function d(p){return p===34||p===39||p===40?eC(e,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):g(p)}function h(p){return Kt(p)?xu(e,g)(p):g(p)}function g(p){return p===41?(e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),e.exit("resource"),t):n(p)}}function OU(e,t,n){const i=this;return r;function r(u){return Jj.call(i,e,a,o,"reference","referenceMarker","referenceString")(u)}function a(u){return i.parser.defined.includes(dr(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?t(u):n(u)}function o(u){return n(u)}}function RU(e,t,n){return i;function i(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),r}function r(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):n(a)}}const LU={name:"labelStartImage",resolveAll:Hx.resolveAll,tokenize:zU};function zU(e,t,n){const i=this;return r;function r(u){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(u),e.exit("labelImageMarker"),a}function a(u){return u===91?(e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelImage"),o):n(u)}function o(u){return u===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(u):t(u)}}const IU={name:"labelStartLink",resolveAll:Hx.resolveAll,tokenize:PU};function PU(e,t,n){const i=this;return r;function r(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),a}function a(o){return o===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(o):t(o)}}const oy={name:"lineEnding",tokenize:BU};function BU(e,t){return n;function n(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),St(e,t,"linePrefix")}}const fh={name:"thematicBreak",tokenize:$U};function $U(e,t,n){let i=0,r;return a;function a(h){return e.enter("thematicBreak"),o(h)}function o(h){return r=h,u(h)}function u(h){return h===r?(e.enter("thematicBreakSequence"),d(h)):i>=3&&(h===null||Je(h))?(e.exit("thematicBreak"),t(h)):n(h)}function d(h){return h===r?(e.consume(h),i++,d):(e.exit("thematicBreakSequence"),gt(h)?St(e,u,"whitespace")(h):u(h))}}const ci={continuation:{tokenize:HU},exit:GU,name:"list",tokenize:qU},UU={partial:!0,tokenize:VU},FU={partial:!0,tokenize:KU};function qU(e,t,n){const i=this,r=i.events[i.events.length-1];let a=r&&r[1].type==="linePrefix"?r[2].sliceSerialize(r[1],!0).length:0,o=0;return u;function u(b){const w=i.containerState.type||(b===42||b===43||b===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!i.containerState.marker||b===i.containerState.marker:wb(b)){if(i.containerState.type||(i.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),b===42||b===45?e.check(fh,n,h)(b):h(b);if(!i.interrupt||b===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(b)}return n(b)}function d(b){return wb(b)&&++o<10?(e.consume(b),d):(!i.interrupt||o<2)&&(i.containerState.marker?b===i.containerState.marker:b===41||b===46)?(e.exit("listItemValue"),h(b)):n(b)}function h(b){return e.enter("listItemMarker"),e.consume(b),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||b,e.check(ad,i.interrupt?n:g,e.attempt(UU,y,p))}function g(b){return i.containerState.initialBlankLine=!0,a++,y(b)}function p(b){return gt(b)?(e.enter("listItemPrefixWhitespace"),e.consume(b),e.exit("listItemPrefixWhitespace"),y):n(b)}function y(b){return i.containerState.size=a+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(b)}}function HU(e,t,n){const i=this;return i.containerState._closeFlow=void 0,e.check(ad,r,a);function r(u){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,St(e,t,"listItemIndent",i.containerState.size+1)(u)}function a(u){return i.containerState.furtherBlankLines||!gt(u)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,o(u)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(FU,t,o)(u))}function o(u){return i.containerState._closeFlow=!0,i.interrupt=void 0,St(e,e.attempt(ci,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function KU(e,t,n){const i=this;return St(e,r,"listItemIndent",i.containerState.size+1);function r(a){const o=i.events[i.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===i.containerState.size?t(a):n(a)}}function GU(e){e.exit(this.containerState.type)}function VU(e,t,n){const i=this;return St(e,r,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function r(a){const o=i.events[i.events.length-1];return!gt(a)&&o&&o[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const HE={name:"setextUnderline",resolveTo:YU,tokenize:WU};function YU(e,t){let n=e.length,i,r,a;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),!a&&e[n][1].type==="definition"&&(a=n);const o={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[r][1].type="setextHeadingText",a?(e.splice(r,0,["enter",o,t]),e.splice(a+1,0,["exit",e[i][1],t]),e[i][1].end={...e[a][1].end}):e[i][1]=o,e.push(["exit",o,t]),e}function WU(e,t,n){const i=this;let r;return a;function a(h){let g=i.events.length,p;for(;g--;)if(i.events[g][1].type!=="lineEnding"&&i.events[g][1].type!=="linePrefix"&&i.events[g][1].type!=="content"){p=i.events[g][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||p)?(e.enter("setextHeadingLine"),r=h,o(h)):n(h)}function o(h){return e.enter("setextHeadingLineSequence"),u(h)}function u(h){return h===r?(e.consume(h),u):(e.exit("setextHeadingLineSequence"),gt(h)?St(e,d,"lineSuffix")(h):d(h))}function d(h){return h===null||Je(h)?(e.exit("setextHeadingLine"),t(h)):n(h)}}const QU={tokenize:XU};function XU(e){const t=this,n=e.attempt(ad,i,e.attempt(this.parser.constructs.flowInitial,r,St(e,e.attempt(this.parser.constructs.flow,r,e.attempt(nU,r)),"linePrefix")));return n;function i(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const ZU={resolveAll:nC()},JU=tC("string"),e9=tC("text");function tC(e){return{resolveAll:nC(e==="text"?t9:void 0),tokenize:t};function t(n){const i=this,r=this.parser.constructs[e],a=n.attempt(r,o,u);return o;function o(g){return h(g)?a(g):u(g)}function u(g){if(g===null){n.consume(g);return}return n.enter("data"),n.consume(g),d}function d(g){return h(g)?(n.exit("data"),a(g)):(n.consume(g),d)}function h(g){if(g===null)return!0;const p=r[g];let y=-1;if(p)for(;++y<p.length;){const b=p[y];if(!b.previous||b.previous.call(i,i.previous))return!0}return!1}}}function nC(e){return t;function t(n,i){let r=-1,a;for(;++r<=n.length;)a===void 0?n[r]&&n[r][1].type==="data"&&(a=r,r++):(!n[r]||n[r][1].type!=="data")&&(r!==a+2&&(n[a][1].end=n[r-1][1].end,n.splice(a+2,r-a-2),r=a+2),a=void 0);return e?e(n,i):n}}function t9(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 a=r.length,o=-1,u=0,d;for(;a--;){const h=r[a];if(typeof h=="string"){for(o=h.length;h.charCodeAt(o-1)===32;)u++,o--;if(o)break;o=-1}else if(h===-2)d=!0,u++;else if(h!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(u=0),u){const h={type:n===e.length||d||u<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?o:i.start._bufferIndex+o,_index:i.start._index+a,line:i.end.line,column:i.end.column-u,offset:i.end.offset-u},end:{...i.end}};i.end={...h.start},i.start.offset===i.end.offset?Object.assign(i,h):(e.splice(n,0,["enter",h,t],["exit",h,t]),n+=2)}n++}return e}const n9={42:ci,43:ci,45:ci,48:ci,49:ci,50:ci,51:ci,52:ci,53:ci,54:ci,55:ci,56:ci,57:ci,62:Yj},i9={91:lU},r9={[-2]:ly,[-1]:ly,32:ly},s9={35:hU,42:fh,45:[HE,fh],60:yU,61:HE,95:fh,96:FE,126:FE},a9={38:Qj,92:Wj},l9={[-5]:oy,[-4]:oy,[-3]:oy,33:LU,38:Qj,42:kb,60:[I$,SU],91:IU,92:[dU,Wj],93:Hx,95:kb,96:Q$},o9={null:[kb,ZU]},c9={null:[42,95]},u9={null:[]},d9=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:c9,contentInitial:i9,disable:u9,document:n9,flow:s9,flowInitial:r9,insideSpan:o9,string:a9,text:l9},Symbol.toStringTag,{value:"Module"}));function f9(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={},a=[];let o=[],u=[];const d={attempt:R(C),check:R(T),consume:A,enter:S,exit:_,interrupt:R(T,{interrupt:!0})},h={code:null,containerState:{},defineSkip:v,events:[],now:w,parser:e,previous:null,sliceSerialize:y,sliceStream:b,write:p};let g=t.tokenize.call(h,d);return t.resolveAll&&a.push(t),h;function p(F){return o=qi(o,F),N(),o[o.length-1]!==null?[]:(O(t,0),h.events=gp(a,h.events,h),h.events)}function y(F,U){return p9(b(F),U)}function b(F){return h9(o,F)}function w(){const{_bufferIndex:F,_index:U,line:V,column:M,offset:H}=i;return{_bufferIndex:F,_index:U,line:V,column:M,offset:H}}function v(F){r[F.line]=F.column,P()}function N(){let F;for(;i._index<o.length;){const U=o[i._index];if(typeof U=="string")for(F=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===F&&i._bufferIndex<U.length;)k(U.charCodeAt(i._bufferIndex));else k(U)}}function k(F){g=g(F)}function A(F){Je(F)?(i.line++,i.column=1,i.offset+=F===-3?2:1,P()):F!==-1&&(i.column++,i.offset++),i._bufferIndex<0?i._index++:(i._bufferIndex++,i._bufferIndex===o[i._index].length&&(i._bufferIndex=-1,i._index++)),h.previous=F}function S(F,U){const V=U||{};return V.type=F,V.start=w(),h.events.push(["enter",V,h]),u.push(V),V}function _(F){const U=u.pop();return U.end=w(),h.events.push(["exit",U,h]),U}function C(F,U){O(F,U.from)}function T(F,U){U.restore()}function R(F,U){return V;function V(M,H,$){let K,W,Y,I;return Array.isArray(M)?G(M):"tokenize"in M?G([M]):L(M);function L(ye){return Se;function Se(re){const he=re!==null&&ye[re],se=re!==null&&ye.null,J=[...Array.isArray(he)?he:he?[he]:[],...Array.isArray(se)?se:se?[se]:[]];return G(J)(re)}}function G(ye){return K=ye,W=0,ye.length===0?$:z(ye[W])}function z(ye){return Se;function Se(re){return I=B(),Y=ye,ye.partial||(h.currentConstruct=ye),ye.name&&h.parser.constructs.disable.null.includes(ye.name)?me():ye.tokenize.call(U?Object.assign(Object.create(h),U):h,d,te,me)(re)}}function te(ye){return F(Y,I),H}function me(ye){return I.restore(),++W<K.length?z(K[W]):$}}}function O(F,U){F.resolveAll&&!a.includes(F)&&a.push(F),F.resolve&&ji(h.events,U,h.events.length-U,F.resolve(h.events.slice(U),h)),F.resolveTo&&(h.events=F.resolveTo(h.events,h))}function B(){const F=w(),U=h.previous,V=h.currentConstruct,M=h.events.length,H=Array.from(u);return{from:M,restore:$};function $(){i=F,h.previous=U,h.currentConstruct=V,h.events.length=M,u=H,P()}}function P(){i.line in r&&i.column<2&&(i.column=r[i.line],i.offset+=r[i.line]-1)}}function h9(e,t){const n=t.start._index,i=t.start._bufferIndex,r=t.end._index,a=t.end._bufferIndex;let o;if(n===r)o=[e[n].slice(i,a)];else{if(o=e.slice(n,r),i>-1){const u=o[0];typeof u=="string"?o[0]=u.slice(i):o.shift()}a>0&&o.push(e[r].slice(0,a))}return o}function p9(e,t){let n=-1;const i=[];let r;for(;++n<e.length;){const a=e[n];let o;if(typeof a=="string")o=a;else switch(a){case-5:{o="\r";break}case-4:{o=`
|
|
749
|
+
`;break}case-3:{o=`\r
|
|
750
|
+
`;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&r)continue;o=" ";break}default:o=String.fromCharCode(a)}r=a===-2,i.push(o)}return i.join("")}function m9(e){const i={constructs:Gj([d9,...(e||{}).extensions||[]]),content:r(T$),defined:[],document:r(D$),flow:r(QU),lazy:{},string:r(JU),text:r(e9)};return i;function r(a){return o;function o(u){return f9(i,a,u)}}}function g9(e){for(;!Xj(e););return e}const KE=/[\0\t\n\r]/g;function y9(){let e=1,t="",n=!0,i;return r;function r(a,o,u){const d=[];let h,g,p,y,b;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(o||void 0).decode(a)),p=0,t="",n&&(a.charCodeAt(0)===65279&&p++,n=void 0);p<a.length;){if(KE.lastIndex=p,h=KE.exec(a),y=h&&h.index!==void 0?h.index:a.length,b=a.charCodeAt(y),!h){t=a.slice(p);break}if(b===10&&p===y&&i)d.push(-3),i=void 0;else switch(i&&(d.push(-5),i=void 0),p<y&&(d.push(a.slice(p,y)),e+=y-p),b){case 0:{d.push(65533),e++;break}case 9:{for(g=Math.ceil(e/4)*4,d.push(-2);e++<g;)d.push(-1);break}case 10:{d.push(-4),e=1;break}default:i=!0,e=1}p=y+1}return u&&(i&&d.push(-5),t&&d.push(t),d.push(null)),d}}const b9=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function x9(e){return e.replace(b9,v9)}function v9(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const r=n.charCodeAt(1),a=r===120||r===88;return Vj(n.slice(a?2:1),a?16:10)}return qx(n)||e}const iC={}.hasOwnProperty;function w9(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),k9(n)(g9(m9(n).document().write(y9()(e,t,!0))))}function k9(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(ue),autolinkProtocol:B,autolinkEmail:B,atxHeading:a(Me),blockQuote:a(se),characterEscape:B,characterReference:B,codeFenced:a(J),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(J,o),codeText:a(ke,o),codeTextData:B,data:B,codeFlowValue:B,definition:a(le),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(Ce),hardBreakEscape:a(_e),hardBreakTrailing:a(_e),htmlFlow:a(Qe,o),htmlFlowData:B,htmlText:a(Qe,o),htmlTextData:B,image:a(Ue),label:o,link:a(ue),listItem:a(xe),listItemValue:y,listOrdered:a(we,p),listUnordered:a(we),paragraph:a(pe),reference:z,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(Me),strong:a(Ne),thematicBreak:a(He)},exit:{atxHeading:d(),atxHeadingSequence:C,autolink:d(),autolinkEmail:he,autolinkProtocol:re,blockQuote:d(),characterEscapeValue:P,characterReferenceMarkerHexadecimal:me,characterReferenceMarkerNumeric:me,characterReferenceValue:ye,characterReference:Se,codeFenced:d(N),codeFencedFence:v,codeFencedFenceInfo:b,codeFencedFenceMeta:w,codeFlowValue:P,codeIndented:d(k),codeText:d(H),codeTextData:P,data:P,definition:d(),definitionDestinationString:_,definitionLabelString:A,definitionTitleString:S,emphasis:d(),hardBreakEscape:d(U),hardBreakTrailing:d(U),htmlFlow:d(V),htmlFlowData:P,htmlText:d(M),htmlTextData:P,image:d(K),label:Y,labelText:W,lineEnding:F,link:d($),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:te,resourceDestinationString:I,resourceTitleString:L,resource:G,setextHeading:d(O),setextHeadingLineSequence:R,setextHeadingText:T,strong:d(),thematicBreak:d()}};rC(t,(e||{}).mdastExtensions||[]);const n={};return i;function i(ne){let de={type:"root",children:[]};const Le={stack:[de],tokenStack:[],config:t,enter:u,exit:h,buffer:o,resume:g,data:n},Ze=[];let rt=-1;for(;++rt<ne.length;)if(ne[rt][1].type==="listOrdered"||ne[rt][1].type==="listUnordered")if(ne[rt][0]==="enter")Ze.push(rt);else{const At=Ze.pop();rt=r(ne,At,rt)}for(rt=-1;++rt<ne.length;){const At=t[ne[rt][0]];iC.call(At,ne[rt][1].type)&&At[ne[rt][1].type].call(Object.assign({sliceSerialize:ne[rt][2].sliceSerialize},Le),ne[rt][1])}if(Le.tokenStack.length>0){const At=Le.tokenStack[Le.tokenStack.length-1];(At[1]||GE).call(Le,void 0,At[0])}for(de.position={start:ia(ne.length>0?ne[0][1].start:{line:1,column:1,offset:0}),end:ia(ne.length>0?ne[ne.length-2][1].end:{line:1,column:1,offset:0})},rt=-1;++rt<t.transforms.length;)de=t.transforms[rt](de)||de;return de}function r(ne,de,Le){let Ze=de-1,rt=-1,At=!1,$n,fn,Mt,Wt;for(;++Ze<=Le;){const yt=ne[Ze];switch(yt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{yt[0]==="enter"?rt++:rt--,Wt=void 0;break}case"lineEndingBlank":{yt[0]==="enter"&&($n&&!Wt&&!rt&&!Mt&&(Mt=Ze),Wt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Wt=void 0}if(!rt&&yt[0]==="enter"&&yt[1].type==="listItemPrefix"||rt===-1&&yt[0]==="exit"&&(yt[1].type==="listUnordered"||yt[1].type==="listOrdered")){if($n){let Ai=Ze;for(fn=void 0;Ai--;){const Rn=ne[Ai];if(Rn[1].type==="lineEnding"||Rn[1].type==="lineEndingBlank"){if(Rn[0]==="exit")continue;fn&&(ne[fn][1].type="lineEndingBlank",At=!0),Rn[1].type="lineEnding",fn=Ai}else if(!(Rn[1].type==="linePrefix"||Rn[1].type==="blockQuotePrefix"||Rn[1].type==="blockQuotePrefixWhitespace"||Rn[1].type==="blockQuoteMarker"||Rn[1].type==="listItemIndent"))break}Mt&&(!fn||Mt<fn)&&($n._spread=!0),$n.end=Object.assign({},fn?ne[fn][1].start:yt[1].end),ne.splice(fn||Ze,0,["exit",$n,yt[2]]),Ze++,Le++}if(yt[1].type==="listItemPrefix"){const Ai={type:"listItem",_spread:!1,start:Object.assign({},yt[1].start),end:void 0};$n=Ai,ne.splice(Ze,0,["enter",Ai,yt[2]]),Ze++,Le++,Mt=void 0,Wt=!0}}}return ne[de][1]._spread=At,Le}function a(ne,de){return Le;function Le(Ze){u.call(this,ne(Ze),Ze),de&&de.call(this,Ze)}}function o(){this.stack.push({type:"fragment",children:[]})}function u(ne,de,Le){this.stack[this.stack.length-1].children.push(ne),this.stack.push(ne),this.tokenStack.push([de,Le||void 0]),ne.position={start:ia(de.start),end:void 0}}function d(ne){return de;function de(Le){ne&&ne.call(this,Le),h.call(this,Le)}}function h(ne,de){const Le=this.stack.pop(),Ze=this.tokenStack.pop();if(Ze)Ze[0].type!==ne.type&&(de?de.call(this,ne,Ze[0]):(Ze[1]||GE).call(this,ne,Ze[0]));else throw new Error("Cannot close `"+ne.type+"` ("+bu({start:ne.start,end:ne.end})+"): it’s not open");Le.position.end=ia(ne.end)}function g(){return Fx(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function y(ne){if(this.data.expectingFirstListItemValue){const de=this.stack[this.stack.length-2];de.start=Number.parseInt(this.sliceSerialize(ne),10),this.data.expectingFirstListItemValue=void 0}}function b(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.lang=ne}function w(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.meta=ne}function v(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function N(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.value=ne.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function k(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.value=ne.replace(/(\r?\n|\r)$/g,"")}function A(ne){const de=this.resume(),Le=this.stack[this.stack.length-1];Le.label=de,Le.identifier=dr(this.sliceSerialize(ne)).toLowerCase()}function S(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.title=ne}function _(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.url=ne}function C(ne){const de=this.stack[this.stack.length-1];if(!de.depth){const Le=this.sliceSerialize(ne).length;de.depth=Le}}function T(){this.data.setextHeadingSlurpLineEnding=!0}function R(ne){const de=this.stack[this.stack.length-1];de.depth=this.sliceSerialize(ne).codePointAt(0)===61?1:2}function O(){this.data.setextHeadingSlurpLineEnding=void 0}function B(ne){const Le=this.stack[this.stack.length-1].children;let Ze=Le[Le.length-1];(!Ze||Ze.type!=="text")&&(Ze=je(),Ze.position={start:ia(ne.start),end:void 0},Le.push(Ze)),this.stack.push(Ze)}function P(ne){const de=this.stack.pop();de.value+=this.sliceSerialize(ne),de.position.end=ia(ne.end)}function F(ne){const de=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Le=de.children[de.children.length-1];Le.position.end=ia(ne.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(de.type)&&(B.call(this,ne),P.call(this,ne))}function U(){this.data.atHardBreak=!0}function V(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.value=ne}function M(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.value=ne}function H(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.value=ne}function $(){const ne=this.stack[this.stack.length-1];if(this.data.inReference){const de=this.data.referenceType||"shortcut";ne.type+="Reference",ne.referenceType=de,delete ne.url,delete ne.title}else delete ne.identifier,delete ne.label;this.data.referenceType=void 0}function K(){const ne=this.stack[this.stack.length-1];if(this.data.inReference){const de=this.data.referenceType||"shortcut";ne.type+="Reference",ne.referenceType=de,delete ne.url,delete ne.title}else delete ne.identifier,delete ne.label;this.data.referenceType=void 0}function W(ne){const de=this.sliceSerialize(ne),Le=this.stack[this.stack.length-2];Le.label=x9(de),Le.identifier=dr(de).toLowerCase()}function Y(){const ne=this.stack[this.stack.length-1],de=this.resume(),Le=this.stack[this.stack.length-1];if(this.data.inReference=!0,Le.type==="link"){const Ze=ne.children;Le.children=Ze}else Le.alt=de}function I(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.url=ne}function L(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.title=ne}function G(){this.data.inReference=void 0}function z(){this.data.referenceType="collapsed"}function te(ne){const de=this.resume(),Le=this.stack[this.stack.length-1];Le.label=de,Le.identifier=dr(this.sliceSerialize(ne)).toLowerCase(),this.data.referenceType="full"}function me(ne){this.data.characterReferenceType=ne.type}function ye(ne){const de=this.sliceSerialize(ne),Le=this.data.characterReferenceType;let Ze;Le?(Ze=Vj(de,Le==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ze=qx(de);const rt=this.stack[this.stack.length-1];rt.value+=Ze}function Se(ne){const de=this.stack.pop();de.position.end=ia(ne.end)}function re(ne){P.call(this,ne);const de=this.stack[this.stack.length-1];de.url=this.sliceSerialize(ne)}function he(ne){P.call(this,ne);const de=this.stack[this.stack.length-1];de.url="mailto:"+this.sliceSerialize(ne)}function se(){return{type:"blockquote",children:[]}}function J(){return{type:"code",lang:null,meta:null,value:""}}function ke(){return{type:"inlineCode",value:""}}function le(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ce(){return{type:"emphasis",children:[]}}function Me(){return{type:"heading",depth:0,children:[]}}function _e(){return{type:"break"}}function Qe(){return{type:"html",value:""}}function Ue(){return{type:"image",title:null,url:"",alt:null}}function ue(){return{type:"link",title:null,url:"",children:[]}}function we(ne){return{type:"list",ordered:ne.type==="listOrdered",start:null,spread:ne._spread,children:[]}}function xe(ne){return{type:"listItem",spread:ne._spread,checked:null,children:[]}}function pe(){return{type:"paragraph",children:[]}}function Ne(){return{type:"strong",children:[]}}function je(){return{type:"text",value:""}}function He(){return{type:"thematicBreak"}}}function ia(e){return{line:e.line,column:e.column,offset:e.offset}}function rC(e,t){let n=-1;for(;++n<t.length;){const i=t[n];Array.isArray(i)?rC(e,i):E9(e,i)}}function E9(e,t){let n;for(n in t)if(iC.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 GE(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+bu({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+bu({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+bu({start:t.start,end:t.end})+") is still open")}function S9(e){const t=this;t.parser=n;function n(i){return w9(i,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function N9(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 _9(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
751
|
+
`}]}function j9(e,t){const n=t.value?t.value+`
|
|
752
|
+
`:"",i={},r=t.lang?t.lang.split(/\s+/):[];r.length>0&&(i.className=["language-"+r[0]]);let a={type:"element",tagName:"code",properties:i,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a}function C9(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function A9(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function T9(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=String(t.identifier).toUpperCase(),r=oc(i.toLowerCase()),a=e.footnoteOrder.indexOf(i);let o,u=e.footnoteCounts.get(i);u===void 0?(u=0,e.footnoteOrder.push(i),o=e.footnoteOrder.length):o=a+1,u+=1,e.footnoteCounts.set(i,u);const d={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+r,id:n+"fnref-"+r+(u>1?"-"+u:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,d);const h={type:"element",tagName:"sup",properties:{},children:[d]};return e.patch(t,h),e.applyData(t,h)}function M9(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 D9(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function sC(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),a=r[0];a&&a.type==="text"?a.value="["+a.value:r.unshift({type:"text",value:"["});const o=r[r.length-1];return o&&o.type==="text"?o.value+=i:r.push({type:"text",value:i}),r}function O9(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return sC(e,t);const r={src:oc(i.url||""),alt:t.alt};i.title!==null&&i.title!==void 0&&(r.title=i.title);const a={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,a),e.applyData(t,a)}function R9(e,t){const n={src:oc(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 L9(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 z9(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return sC(e,t);const r={href:oc(i.url||"")};i.title!==null&&i.title!==void 0&&(r.title=i.title);const a={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function I9(e,t){const n={href:oc(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 P9(e,t,n){const i=e.all(t),r=n?B9(n):aC(t),a={},o=[];if(typeof t.checked=="boolean"){const g=i[0];let p;g&&g.type==="element"&&g.tagName==="p"?p=g:(p={type:"element",tagName:"p",properties:{},children:[]},i.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let u=-1;for(;++u<i.length;){const g=i[u];(r||u!==0||g.type!=="element"||g.tagName!=="p")&&o.push({type:"text",value:`
|
|
753
|
+
`}),g.type==="element"&&g.tagName==="p"&&!r?o.push(...g.children):o.push(g)}const d=i[i.length-1];d&&(r||d.type!=="element"||d.tagName!=="p")&&o.push({type:"text",value:`
|
|
754
|
+
`});const h={type:"element",tagName:"li",properties:a,children:o};return e.patch(t,h),e.applyData(t,h)}function B9(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=aC(n[i])}return t}function aC(e){const t=e.spread;return t??e.children.length>1}function $9(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 o=i[r];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const a={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function U9(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function F9(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function q9(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function H9(e,t){const n=e.all(t),i=n.shift(),r=[];if(i){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([i],!0)};e.patch(t.children[0],o),r.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},u=Px(t.children[1]),d=Bj(t.children[t.children.length-1]);u&&d&&(o.position={start:u,end:d}),r.push(o)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function K9(e,t,n){const i=n?n.children:void 0,a=(i?i.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,u=o?o.length:t.children.length;let d=-1;const h=[];for(;++d<u;){const p=t.children[d],y={},b=o?o[d]:void 0;b&&(y.align=b);let w={type:"element",tagName:a,properties:y,children:[]};p&&(w.children=e.all(p),e.patch(p,w),w=e.applyData(p,w)),h.push(w)}const g={type:"element",tagName:"tr",properties:{},children:e.wrap(h,!0)};return e.patch(t,g),e.applyData(t,g)}function G9(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const VE=9,YE=32;function V9(e){const t=String(e),n=/\r?\n|\r/g;let i=n.exec(t),r=0;const a=[];for(;i;)a.push(WE(t.slice(r,i.index),r>0,!0),i[0]),r=i.index+i[0].length,i=n.exec(t);return a.push(WE(t.slice(r),r>0,!1)),a.join("")}function WE(e,t,n){let i=0,r=e.length;if(t){let a=e.codePointAt(i);for(;a===VE||a===YE;)i++,a=e.codePointAt(i)}if(n){let a=e.codePointAt(r-1);for(;a===VE||a===YE;)r--,a=e.codePointAt(r-1)}return r>i?e.slice(i,r):""}function Y9(e,t){const n={type:"text",value:V9(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function W9(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Q9={blockquote:N9,break:_9,code:j9,delete:C9,emphasis:A9,footnoteReference:T9,heading:M9,html:D9,imageReference:O9,image:R9,inlineCode:L9,linkReference:z9,link:I9,listItem:P9,list:$9,paragraph:U9,root:F9,strong:q9,table:H9,tableCell:G9,tableRow:K9,text:Y9,thematicBreak:W9,toml:Pf,yaml:Pf,definition:Pf,footnoteDefinition:Pf};function Pf(){}const lC=-1,yp=0,vu=1,Dh=2,Kx=3,Gx=4,Vx=5,Yx=6,oC=7,cC=8,QE=typeof self=="object"?self:globalThis,X9=(e,t)=>{const n=(r,a)=>(e.set(a,r),r),i=r=>{if(e.has(r))return e.get(r);const[a,o]=t[r];switch(a){case yp:case lC:return n(o,r);case vu:{const u=n([],r);for(const d of o)u.push(i(d));return u}case Dh:{const u=n({},r);for(const[d,h]of o)u[i(d)]=i(h);return u}case Kx:return n(new Date(o),r);case Gx:{const{source:u,flags:d}=o;return n(new RegExp(u,d),r)}case Vx:{const u=n(new Map,r);for(const[d,h]of o)u.set(i(d),i(h));return u}case Yx:{const u=n(new Set,r);for(const d of o)u.add(i(d));return u}case oC:{const{name:u,message:d}=o;return n(new QE[u](d),r)}case cC:return n(BigInt(o),r);case"BigInt":return n(Object(BigInt(o)),r);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:u}=new Uint8Array(o);return n(new DataView(u),o)}}return n(new QE[a](o),r)};return i},XE=e=>X9(new Map,e)(0),uo="",{toString:Z9}={},{keys:J9}=Object,au=e=>{const t=typeof e;if(t!=="object"||!e)return[yp,t];const n=Z9.call(e).slice(8,-1);switch(n){case"Array":return[vu,uo];case"Object":return[Dh,uo];case"Date":return[Kx,uo];case"RegExp":return[Gx,uo];case"Map":return[Vx,uo];case"Set":return[Yx,uo];case"DataView":return[vu,n]}return n.includes("Array")?[vu,n]:n.includes("Error")?[oC,n]:[Dh,n]},Bf=([e,t])=>e===yp&&(t==="function"||t==="symbol"),e8=(e,t,n,i)=>{const r=(o,u)=>{const d=i.push(o)-1;return n.set(u,d),d},a=o=>{if(n.has(o))return n.get(o);let[u,d]=au(o);switch(u){case yp:{let g=o;switch(d){case"bigint":u=cC,g=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);g=null;break;case"undefined":return r([lC],o)}return r([u,g],o)}case vu:{if(d){let y=o;return d==="DataView"?y=new Uint8Array(o.buffer):d==="ArrayBuffer"&&(y=new Uint8Array(o)),r([d,[...y]],o)}const g=[],p=r([u,g],o);for(const y of o)g.push(a(y));return p}case Dh:{if(d)switch(d){case"BigInt":return r([d,o.toString()],o);case"Boolean":case"Number":case"String":return r([d,o.valueOf()],o)}if(t&&"toJSON"in o)return a(o.toJSON());const g=[],p=r([u,g],o);for(const y of J9(o))(e||!Bf(au(o[y])))&&g.push([a(y),a(o[y])]);return p}case Kx:return r([u,o.toISOString()],o);case Gx:{const{source:g,flags:p}=o;return r([u,{source:g,flags:p}],o)}case Vx:{const g=[],p=r([u,g],o);for(const[y,b]of o)(e||!(Bf(au(y))||Bf(au(b))))&&g.push([a(y),a(b)]);return p}case Yx:{const g=[],p=r([u,g],o);for(const y of o)(e||!Bf(au(y)))&&g.push(a(y));return p}}const{message:h}=o;return r([u,{name:d,message:h}],o)};return a},ZE=(e,{json:t,lossy:n}={})=>{const i=[];return e8(!(t||n),!!t,new Map,i)(e),i},Oh=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?XE(ZE(e,t)):structuredClone(e):(e,t)=>XE(ZE(e,t));function t8(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 n8(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function i8(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||t8,i=e.options.footnoteBackLabel||n8,r=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},u=[];let d=-1;for(;++d<e.footnoteOrder.length;){const h=e.footnoteById.get(e.footnoteOrder[d]);if(!h)continue;const g=e.all(h),p=String(h.identifier).toUpperCase(),y=oc(p.toLowerCase());let b=0;const w=[],v=e.footnoteCounts.get(p);for(;v!==void 0&&++b<=v;){w.length>0&&w.push({type:"text",value:" "});let A=typeof n=="string"?n:n(d,b);typeof A=="string"&&(A={type:"text",value:A}),w.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+y+(b>1?"-"+b:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(d,b),className:["data-footnote-backref"]},children:Array.isArray(A)?A:[A]})}const N=g[g.length-1];if(N&&N.type==="element"&&N.tagName==="p"){const A=N.children[N.children.length-1];A&&A.type==="text"?A.value+=" ":N.children.push({type:"text",value:" "}),N.children.push(...w)}else g.push(...w);const k={type:"element",tagName:"li",properties:{id:t+"fn-"+y},children:e.wrap(g,!0)};e.patch(h,k),u.push(k)}if(u.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...Oh(o),id:"footnote-label"},children:[{type:"text",value:r}]},{type:"text",value:`
|
|
755
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(u,!0)},{type:"text",value:`
|
|
756
|
+
`}]}}const ld=(function(e){if(e==null)return l8;if(typeof e=="function")return bp(e);if(typeof e=="object")return Array.isArray(e)?r8(e):s8(e);if(typeof e=="string")return a8(e);throw new Error("Expected function, string, or object as test")});function r8(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=ld(e[n]);return bp(i);function i(...r){let a=-1;for(;++a<t.length;)if(t[a].apply(this,r))return!0;return!1}}function s8(e){const t=e;return bp(n);function n(i){const r=i;let a;for(a in e)if(r[a]!==t[a])return!1;return!0}}function a8(e){return bp(t);function t(n){return n&&n.type===e}}function bp(e){return t;function t(n,i,r){return!!(o8(n)&&e.call(this,n,typeof i=="number"?i:void 0,r||void 0))}}function l8(){return!0}function o8(e){return e!==null&&typeof e=="object"&&"type"in e}const uC=[],c8=!0,Eb=!1,u8="skip";function dC(e,t,n,i){let r;typeof t=="function"&&typeof n!="function"?(i=n,n=t):r=t;const a=ld(r),o=i?-1:1;u(e,void 0,[])();function u(d,h,g){const p=d&&typeof d=="object"?d:{};if(typeof p.type=="string"){const b=typeof p.tagName=="string"?p.tagName:typeof p.name=="string"?p.name:void 0;Object.defineProperty(y,"name",{value:"node ("+(d.type+(b?"<"+b+">":""))+")"})}return y;function y(){let b=uC,w,v,N;if((!t||a(d,h,g[g.length-1]||void 0))&&(b=d8(n(d,g)),b[0]===Eb))return b;if("children"in d&&d.children){const k=d;if(k.children&&b[0]!==u8)for(v=(i?k.children.length:-1)+o,N=g.concat(k);v>-1&&v<k.children.length;){const A=k.children[v];if(w=u(A,v,N)(),w[0]===Eb)return w;v=typeof w[1]=="number"?w[1]:v+o}}return b}}}function d8(e){return Array.isArray(e)?e:typeof e=="number"?[c8,e]:e==null?uC:[e]}function xp(e,t,n,i){let r,a,o;typeof t=="function"&&typeof n!="function"?(a=void 0,o=t,r=n):(a=t,o=n,r=i),dC(e,a,u,r);function u(d,h){const g=h[h.length-1],p=g?g.children.indexOf(d):void 0;return o(d,p,g)}}const Sb={}.hasOwnProperty,f8={};function h8(e,t){const n=t||f8,i=new Map,r=new Map,a=new Map,o={...Q9,...n.handlers},u={all:h,applyData:m8,definitionById:i,footnoteById:r,footnoteCounts:a,footnoteOrder:[],handlers:o,one:d,options:n,patch:p8,wrap:y8};return xp(e,function(g){if(g.type==="definition"||g.type==="footnoteDefinition"){const p=g.type==="definition"?i:r,y=String(g.identifier).toUpperCase();p.has(y)||p.set(y,g)}}),u;function d(g,p){const y=g.type,b=u.handlers[y];if(Sb.call(u.handlers,y)&&b)return b(u,g,p);if(u.options.passThrough&&u.options.passThrough.includes(y)){if("children"in g){const{children:v,...N}=g,k=Oh(N);return k.children=u.all(g),k}return Oh(g)}return(u.options.unknownHandler||g8)(u,g,p)}function h(g){const p=[];if("children"in g){const y=g.children;let b=-1;for(;++b<y.length;){const w=u.one(y[b],g);if(w){if(b&&y[b-1].type==="break"&&(!Array.isArray(w)&&w.type==="text"&&(w.value=JE(w.value)),!Array.isArray(w)&&w.type==="element")){const v=w.children[0];v&&v.type==="text"&&(v.value=JE(v.value))}Array.isArray(w)?p.push(...w):p.push(w)}}}return p}}function p8(e,t){e.position&&(t.position=n$(e))}function m8(e,t){let n=t;if(e&&e.data){const i=e.data.hName,r=e.data.hChildren,a=e.data.hProperties;if(typeof i=="string")if(n.type==="element")n.tagName=i;else{const o="children"in n?n.children:[n];n={type:"element",tagName:i,properties:{},children:o}}n.type==="element"&&a&&Object.assign(n.properties,Oh(a)),"children"in n&&n.children&&r!==null&&r!==void 0&&(n.children=r)}return n}function g8(e,t){const n=t.data||{},i="value"in t&&!(Sb.call(n,"hProperties")||Sb.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 y8(e,t){const n=[];let i=-1;for(t&&n.push({type:"text",value:`
|
|
757
|
+
`});++i<e.length;)i&&n.push({type:"text",value:`
|
|
758
|
+
`}),n.push(e[i]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
759
|
+
`}),n}function JE(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function eS(e,t){const n=h8(e,t),i=n.one(e,void 0),r=i8(n),a=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return r&&a.children.push({type:"text",value:`
|
|
760
|
+
`},r),a}function b8(e,t){return e&&"run"in e?async function(n,i){const r=eS(n,{file:i,...t});await e.run(r,i)}:function(n,i){return eS(n,{file:i,...e||t})}}function tS(e){if(e)throw e}var cy,nS;function x8(){if(nS)return cy;nS=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,r=function(h){return typeof Array.isArray=="function"?Array.isArray(h):t.call(h)==="[object Array]"},a=function(h){if(!h||t.call(h)!=="[object Object]")return!1;var g=e.call(h,"constructor"),p=h.constructor&&h.constructor.prototype&&e.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!g&&!p)return!1;var y;for(y in h);return typeof y>"u"||e.call(h,y)},o=function(h,g){n&&g.name==="__proto__"?n(h,g.name,{enumerable:!0,configurable:!0,value:g.newValue,writable:!0}):h[g.name]=g.newValue},u=function(h,g){if(g==="__proto__")if(e.call(h,g)){if(i)return i(h,g).value}else return;return h[g]};return cy=function d(){var h,g,p,y,b,w,v=arguments[0],N=1,k=arguments.length,A=!1;for(typeof v=="boolean"&&(A=v,v=arguments[1]||{},N=2),(v==null||typeof v!="object"&&typeof v!="function")&&(v={});N<k;++N)if(h=arguments[N],h!=null)for(g in h)p=u(v,g),y=u(h,g),v!==y&&(A&&y&&(a(y)||(b=r(y)))?(b?(b=!1,w=p&&r(p)?p:[]):w=p&&a(p)?p:{},o(v,{name:g,newValue:d(A,w,y)})):typeof y<"u"&&o(v,{name:g,newValue:y}));return v},cy}var v8=x8();const uy=Yu(v8);function Nb(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 w8(){const e=[],t={run:n,use:i};return t;function n(...r){let a=-1;const o=r.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);u(null,...r);function u(d,...h){const g=e[++a];let p=-1;if(d){o(d);return}for(;++p<r.length;)(h[p]===null||h[p]===void 0)&&(h[p]=r[p]);r=h,g?k8(g,u)(...h):o(null,...h)}}function i(r){if(typeof r!="function")throw new TypeError("Expected `middelware` to be a function, not "+r);return e.push(r),t}}function k8(e,t){let n;return i;function i(...o){const u=e.length>o.length;let d;u&&o.push(r);try{d=e.apply(this,o)}catch(h){const g=h;if(u&&n)throw g;return r(g)}u||(d&&d.then&&typeof d.then=="function"?d.then(a,r):d instanceof Error?r(d):a(d))}function r(o,...u){n||(n=!0,t(o,...u))}function a(o){r(null,o)}}const jr={basename:E8,dirname:S8,extname:N8,join:_8,sep:"/"};function E8(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');od(e);let n=0,i=-1,r=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;r--;)if(e.codePointAt(r)===47){if(a){n=r+1;break}}else i<0&&(a=!0,i=r+1);return i<0?"":e.slice(n,i)}if(t===e)return"";let o=-1,u=t.length-1;for(;r--;)if(e.codePointAt(r)===47){if(a){n=r+1;break}}else o<0&&(a=!0,o=r+1),u>-1&&(e.codePointAt(r)===t.codePointAt(u--)?u<0&&(i=r):(u=-1,i=o));return n===i?i=o:i<0&&(i=e.length),e.slice(n,i)}function S8(e){if(od(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 N8(e){od(e);let t=e.length,n=-1,i=0,r=-1,a=0,o;for(;t--;){const u=e.codePointAt(t);if(u===47){if(o){i=t+1;break}continue}n<0&&(o=!0,n=t+1),u===46?r<0?r=t:a!==1&&(a=1):r>-1&&(a=-1)}return r<0||n<0||a===0||a===1&&r===n-1&&r===i+1?"":e.slice(r,n)}function _8(...e){let t=-1,n;for(;++t<e.length;)od(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":j8(n)}function j8(e){od(e);const t=e.codePointAt(0)===47;let n=C8(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function C8(e,t){let n="",i=0,r=-1,a=0,o=-1,u,d;for(;++o<=e.length;){if(o<e.length)u=e.codePointAt(o);else{if(u===47)break;u=47}if(u===47){if(!(r===o-1||a===1))if(r!==o-1&&a===2){if(n.length<2||i!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(d=n.lastIndexOf("/"),d!==n.length-1){d<0?(n="",i=0):(n=n.slice(0,d),i=n.length-1-n.lastIndexOf("/")),r=o,a=0;continue}}else if(n.length>0){n="",i=0,r=o,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",i=2)}else n.length>0?n+="/"+e.slice(r+1,o):n=e.slice(r+1,o),i=o-r-1;r=o,a=0}else u===46&&a>-1?a++:a=-1}return n}function od(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const A8={cwd:T8};function T8(){return"/"}function _b(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function M8(e){if(typeof e=="string")e=new URL(e);else if(!_b(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 D8(e)}function D8(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 dy=["history","path","basename","stem","extname","dirname"];class fC{constructor(t){let n;t?_b(t)?n={path:t}:typeof t=="string"||O8(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":A8.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i<dy.length;){const a=dy[i];a in n&&n[a]!==void 0&&n[a]!==null&&(this[a]=a==="history"?[...n[a]]:n[a])}let r;for(r in n)dy.includes(r)||(this[r]=n[r])}get basename(){return typeof this.path=="string"?jr.basename(this.path):void 0}set basename(t){hy(t,"basename"),fy(t,"basename"),this.path=jr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?jr.dirname(this.path):void 0}set dirname(t){iS(this.basename,"dirname"),this.path=jr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?jr.extname(this.path):void 0}set extname(t){if(fy(t,"extname"),iS(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=jr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){_b(t)&&(t=M8(t)),hy(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?jr.basename(this.path,this.extname):void 0}set stem(t){hy(t,"stem"),fy(t,"stem"),this.path=jr.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 Yn(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 fy(e,t){if(e&&e.includes(jr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+jr.sep+"`")}function hy(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function iS(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function O8(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const R8=(function(e){const i=this.constructor.prototype,r=i[e],a=function(){return r.apply(a,arguments)};return Object.setPrototypeOf(a,i),a}),L8={}.hasOwnProperty;class Wx extends R8{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=w8()}copy(){const t=new Wx;let n=-1;for(;++n<this.attachers.length;){const i=this.attachers[n];t.use(...i)}return t.data(uy(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(gy("data",this.frozen),this.namespace[t]=n,this):L8.call(this.namespace,t)&&this.namespace[t]||void 0:t?(gy("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=$f(t),i=this.parser||this.Parser;return py("parse",i),i(String(n),n)}process(t,n){const i=this;return this.freeze(),py("process",this.parser||this.Parser),my("process",this.compiler||this.Compiler),n?r(void 0,n):new Promise(r);function r(a,o){const u=$f(t),d=i.parse(u);i.run(d,u,function(g,p,y){if(g||!p||!y)return h(g);const b=p,w=i.stringify(b,y);P8(w)?y.value=w:y.result=w,h(g,y)});function h(g,p){g||!p?o(g):a?a(p):n(void 0,p)}}}processSync(t){let n=!1,i;return this.freeze(),py("processSync",this.parser||this.Parser),my("processSync",this.compiler||this.Compiler),this.process(t,r),sS("processSync","process",n),i;function r(a,o){n=!0,tS(a),i=o}}run(t,n,i){rS(t),this.freeze();const r=this.transformers;return!i&&typeof n=="function"&&(i=n,n=void 0),i?a(void 0,i):new Promise(a);function a(o,u){const d=$f(n);r.run(t,d,h);function h(g,p,y){const b=p||t;g?u(g):o?o(b):i(void 0,b,y)}}}runSync(t,n){let i=!1,r;return this.run(t,n,a),sS("runSync","run",i),r;function a(o,u){tS(o),r=u,i=!0}}stringify(t,n){this.freeze();const i=$f(n),r=this.compiler||this.Compiler;return my("stringify",r),rS(t),r(t,i)}use(t,...n){const i=this.attachers,r=this.namespace;if(gy("use",this.frozen),t!=null)if(typeof t=="function")d(t,n);else if(typeof t=="object")Array.isArray(t)?u(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function a(h){if(typeof h=="function")d(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[g,...p]=h;d(g,p)}else o(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function o(h){if(!("plugins"in h)&&!("settings"in h))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");u(h.plugins),h.settings&&(r.settings=uy(!0,r.settings,h.settings))}function u(h){let g=-1;if(h!=null)if(Array.isArray(h))for(;++g<h.length;){const p=h[g];a(p)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function d(h,g){let p=-1,y=-1;for(;++p<i.length;)if(i[p][0]===h){y=p;break}if(y===-1)i.push([h,...g]);else if(g.length>0){let[b,...w]=g;const v=i[y][1];Nb(v)&&Nb(b)&&(b=uy(!0,v,b)),i[y]=[h,b,...w]}}}}const z8=new Wx().freeze();function py(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function my(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function gy(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 rS(e){if(!Nb(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function sS(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function $f(e){return I8(e)?e:new fC(e)}function I8(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function P8(e){return typeof e=="string"||B8(e)}function B8(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const $8="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",aS=[],lS={allowDangerousHtml:!0},U8=/^(https?|ircs?|mailto|xmpp)$/i,F8=[{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 Qx(e){const t=q8(e),n=H8(e);return K8(t.runSync(t.parse(n),n),e)}function q8(e){const t=e.rehypePlugins||aS,n=e.remarkPlugins||aS,i=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...lS}:lS;return z8().use(S9).use(n).use(b8,i).use(t)}function H8(e){const t=e.children||"",n=new fC;return typeof t=="string"&&(n.value=t),n}function K8(e,t){const n=t.allowedElements,i=t.allowElement,r=t.components,a=t.disallowedElements,o=t.skipHtml,u=t.unwrapDisallowed,d=t.urlTransform||G8;for(const g of F8)Object.hasOwn(t,g.from)&&(""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+$8+g.id,void 0);return xp(e,h),l$(e,{Fragment:c.Fragment,components:r,ignoreInvalidStyle:!0,jsx:c.jsx,jsxs:c.jsxs,passKeys:!0,passNode:!0});function h(g,p,y){if(g.type==="raw"&&y&&typeof p=="number")return o?y.children.splice(p,1):y.children[p]={type:"text",value:g.value},p;if(g.type==="element"){let b;for(b in ay)if(Object.hasOwn(ay,b)&&Object.hasOwn(g.properties,b)){const w=g.properties[b],v=ay[b];(v===null||v.includes(g.tagName))&&(g.properties[b]=d(String(w||""),b,g))}}if(g.type==="element"){let b=n?!n.includes(g.tagName):a?a.includes(g.tagName):!1;if(!b&&i&&typeof p=="number"&&(b=!i(g,p,y)),b&&y&&typeof p=="number")return u&&g.children?y.children.splice(p,1,...g.children):y.children.splice(p,1),p}}}function G8(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||U8.test(e.slice(0,t))?e:""}function oS(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 V8(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Y8(e,t,n){const r=ld((n||{}).ignore||[]),a=W8(t);let o=-1;for(;++o<a.length;)dC(e,"text",u);function u(h,g){let p=-1,y;for(;++p<g.length;){const b=g[p],w=y?y.children:void 0;if(r(b,w?w.indexOf(b):void 0,y))return;y=b}if(y)return d(h,g)}function d(h,g){const p=g[g.length-1],y=a[o][0],b=a[o][1];let w=0;const N=p.children.indexOf(h);let k=!1,A=[];y.lastIndex=0;let S=y.exec(h.value);for(;S;){const _=S.index,C={index:S.index,input:S.input,stack:[...g,h]};let T=b(...S,C);if(typeof T=="string"&&(T=T.length>0?{type:"text",value:T}:void 0),T===!1?y.lastIndex=_+1:(w!==_&&A.push({type:"text",value:h.value.slice(w,_)}),Array.isArray(T)?A.push(...T):T&&A.push(T),w=_+S[0].length,k=!0),!y.global)break;S=y.exec(h.value)}return k?(w<h.value.length&&A.push({type:"text",value:h.value.slice(w)}),p.children.splice(N,1,...A)):A=[h],N+A.length}}function W8(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([Q8(r[0]),X8(r[1])])}return t}function Q8(e){return typeof e=="string"?new RegExp(V8(e),"g"):e}function X8(e){return typeof e=="function"?e:function(){return e}}const yy="phrasing",by=["autolink","link","image","label"];function Z8(){return{transforms:[sF],enter:{literalAutolink:eF,literalAutolinkEmail:xy,literalAutolinkHttp:xy,literalAutolinkWww:xy},exit:{literalAutolink:rF,literalAutolinkEmail:iF,literalAutolinkHttp:tF,literalAutolinkWww:nF}}}function J8(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:yy,notInConstruct:by},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:yy,notInConstruct:by},{character:":",before:"[ps]",after:"\\/",inConstruct:yy,notInConstruct:by}]}}function eF(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function xy(e){this.config.enter.autolinkProtocol.call(this,e)}function tF(e){this.config.exit.autolinkProtocol.call(this,e)}function nF(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 iF(e){this.config.exit.autolinkEmail.call(this,e)}function rF(e){this.exit(e)}function sF(e){Y8(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,aF],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),lF]],{ignore:["link","linkReference"]})}function aF(e,t,n,i,r){let a="";if(!hC(r)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!oF(n)))return!1;const o=cF(n+i);if(!o[0])return!1;const u={type:"link",title:null,url:a+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[u,{type:"text",value:o[1]}]:u}function lF(e,t,n,i){return!hC(i,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function oF(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 cF(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=oS(e,"(");let a=oS(e,")");for(;i!==-1&&r>a;)e+=n.slice(0,i+1),n=n.slice(i+1),i=n.indexOf(")"),a++;return[e,n]}function hC(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||ml(n)||mp(n))&&(!t||n!==47)}pC.peek=bF;function uF(){this.buffer()}function dF(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function fF(){this.buffer()}function hF(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function pF(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=dr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function mF(e){this.exit(e)}function gF(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=dr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function yF(e){this.exit(e)}function bF(){return"["}function pC(e,t,n,i){const r=n.createTracker(i);let a=r.move("[^");const o=n.enter("footnoteReference"),u=n.enter("reference");return a+=r.move(n.safe(n.associationId(e),{after:"]",before:a})),u(),o(),a+=r.move("]"),a}function xF(){return{enter:{gfmFootnoteCallString:uF,gfmFootnoteCall:dF,gfmFootnoteDefinitionLabelString:fF,gfmFootnoteDefinition:hF},exit:{gfmFootnoteCallString:pF,gfmFootnoteCall:mF,gfmFootnoteDefinitionLabelString:gF,gfmFootnoteDefinition:yF}}}function vF(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:pC},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(i,r,a,o){const u=a.createTracker(o);let d=u.move("[^");const h=a.enter("footnoteDefinition"),g=a.enter("label");return d+=u.move(a.safe(a.associationId(i),{before:d,after:"]"})),g(),d+=u.move("]:"),i.children&&i.children.length>0&&(u.shift(4),d+=u.move((t?`
|
|
761
|
+
`:" ")+a.indentLines(a.containerFlow(i,u.current()),t?mC:wF))),h(),d}}function wF(e,t,n){return t===0?e:mC(e,t,n)}function mC(e,t,n){return(n?"":" ")+e}const kF=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];gC.peek=jF;function EF(){return{canContainEols:["delete"],enter:{strikethrough:NF},exit:{strikethrough:_F}}}function SF(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:kF}],handlers:{delete:gC}}}function NF(e){this.enter({type:"delete",children:[]},e)}function _F(e){this.exit(e)}function gC(e,t,n,i){const r=n.createTracker(i),a=n.enter("strikethrough");let o=r.move("~~");return o+=n.containerPhrasing(e,{...r.current(),before:o,after:"~"}),o+=r.move("~~"),a(),o}function jF(){return"~"}function CF(e){return e.length}function AF(e,t){const n=t||{},i=(n.align||[]).concat(),r=n.stringLength||CF,a=[],o=[],u=[],d=[];let h=0,g=-1;for(;++g<e.length;){const v=[],N=[];let k=-1;for(e[g].length>h&&(h=e[g].length);++k<e[g].length;){const A=TF(e[g][k]);if(n.alignDelimiters!==!1){const S=r(A);N[k]=S,(d[k]===void 0||S>d[k])&&(d[k]=S)}v.push(A)}o[g]=v,u[g]=N}let p=-1;if(typeof i=="object"&&"length"in i)for(;++p<h;)a[p]=cS(i[p]);else{const v=cS(i);for(;++p<h;)a[p]=v}p=-1;const y=[],b=[];for(;++p<h;){const v=a[p];let N="",k="";v===99?(N=":",k=":"):v===108?N=":":v===114&&(k=":");let A=n.alignDelimiters===!1?1:Math.max(1,d[p]-N.length-k.length);const S=N+"-".repeat(A)+k;n.alignDelimiters!==!1&&(A=N.length+A+k.length,A>d[p]&&(d[p]=A),b[p]=A),y[p]=S}o.splice(1,0,y),u.splice(1,0,b),g=-1;const w=[];for(;++g<o.length;){const v=o[g],N=u[g];p=-1;const k=[];for(;++p<h;){const A=v[p]||"";let S="",_="";if(n.alignDelimiters!==!1){const C=d[p]-(N[p]||0),T=a[p];T===114?S=" ".repeat(C):T===99?C%2?(S=" ".repeat(C/2+.5),_=" ".repeat(C/2-.5)):(S=" ".repeat(C/2),_=S):_=" ".repeat(C)}n.delimiterStart!==!1&&!p&&k.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&A==="")&&(n.delimiterStart!==!1||p)&&k.push(" "),n.alignDelimiters!==!1&&k.push(S),k.push(A),n.alignDelimiters!==!1&&k.push(_),n.padding!==!1&&k.push(" "),(n.delimiterEnd!==!1||p!==h-1)&&k.push("|")}w.push(n.delimiterEnd===!1?k.join("").replace(/ +$/,""):k.join(""))}return w.join(`
|
|
762
|
+
`)}function TF(e){return e==null?"":String(e)}function cS(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 MF(e,t,n,i){const r=n.enter("blockquote"),a=n.createTracker(i);a.move("> "),a.shift(2);const o=n.indentLines(n.containerFlow(e,a.current()),DF);return r(),o}function DF(e,t,n){return">"+(n?"":" ")+e}function OF(e,t){return uS(e,t.inConstruct,!0)&&!uS(e,t.notInConstruct,!1)}function uS(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 dS(e,t,n,i){let r=-1;for(;++r<n.unsafe.length;)if(n.unsafe[r].character===`
|
|
763
|
+
`&&OF(n.stack,n.unsafe[r]))return/[ \t]/.test(i.before)?"":" ";return`\\
|
|
764
|
+
`}function RF(e,t){const n=String(e);let i=n.indexOf(t),r=i,a=0,o=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;i!==-1;)i===r?++a>o&&(o=a):a=1,r=i+t.length,i=n.indexOf(t,r);return o}function LF(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 zF(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 IF(e,t,n,i){const r=zF(n),a=e.value||"",o=r==="`"?"GraveAccent":"Tilde";if(LF(e,n)){const p=n.enter("codeIndented"),y=n.indentLines(a,PF);return p(),y}const u=n.createTracker(i),d=r.repeat(Math.max(RF(a,r)+1,3)),h=n.enter("codeFenced");let g=u.move(d);if(e.lang){const p=n.enter(`codeFencedLang${o}`);g+=u.move(n.safe(e.lang,{before:g,after:" ",encode:["`"],...u.current()})),p()}if(e.lang&&e.meta){const p=n.enter(`codeFencedMeta${o}`);g+=u.move(" "),g+=u.move(n.safe(e.meta,{before:g,after:`
|
|
765
|
+
`,encode:["`"],...u.current()})),p()}return g+=u.move(`
|
|
766
|
+
`),a&&(g+=u.move(a+`
|
|
767
|
+
`)),g+=u.move(d),h(),g}function PF(e,t,n){return(n?"":" ")+e}function Xx(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 BF(e,t,n,i){const r=Xx(n),a=r==='"'?"Quote":"Apostrophe",o=n.enter("definition");let u=n.enter("label");const d=n.createTracker(i);let h=d.move("[");return h+=d.move(n.safe(n.associationId(e),{before:h,after:"]",...d.current()})),h+=d.move("]: "),u(),!e.url||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),h+=d.move("<"),h+=d.move(n.safe(e.url,{before:h,after:">",...d.current()})),h+=d.move(">")):(u=n.enter("destinationRaw"),h+=d.move(n.safe(e.url,{before:h,after:e.title?" ":`
|
|
768
|
+
`,...d.current()}))),u(),e.title&&(u=n.enter(`title${a}`),h+=d.move(" "+r),h+=d.move(n.safe(e.title,{before:h,after:r,...d.current()})),h+=d.move(r),u()),o(),h}function $F(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 Ou(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Rh(e,t,n){const i=qo(e),r=qo(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}}yC.peek=UF;function yC(e,t,n,i){const r=$F(n),a=n.enter("emphasis"),o=n.createTracker(i),u=o.move(r);let d=o.move(n.containerPhrasing(e,{after:r,before:u,...o.current()}));const h=d.charCodeAt(0),g=Rh(i.before.charCodeAt(i.before.length-1),h,r);g.inside&&(d=Ou(h)+d.slice(1));const p=d.charCodeAt(d.length-1),y=Rh(i.after.charCodeAt(0),p,r);y.inside&&(d=d.slice(0,-1)+Ou(p));const b=o.move(r);return a(),n.attentionEncodeSurroundingInfo={after:y.outside,before:g.outside},u+d+b}function UF(e,t,n){return n.options.emphasis||"*"}function FF(e,t){let n=!1;return xp(e,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return n=!0,Eb}),!!((!e.depth||e.depth<3)&&Fx(e)&&(t.options.setext||n))}function qF(e,t,n,i){const r=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(i);if(FF(e,n)){const g=n.enter("headingSetext"),p=n.enter("phrasing"),y=n.containerPhrasing(e,{...a.current(),before:`
|
|
769
|
+
`,after:`
|
|
770
|
+
`});return p(),g(),y+`
|
|
771
|
+
`+(r===1?"=":"-").repeat(y.length-(Math.max(y.lastIndexOf("\r"),y.lastIndexOf(`
|
|
772
|
+
`))+1))}const o="#".repeat(r),u=n.enter("headingAtx"),d=n.enter("phrasing");a.move(o+" ");let h=n.containerPhrasing(e,{before:"# ",after:`
|
|
773
|
+
`,...a.current()});return/^[\t ]/.test(h)&&(h=Ou(h.charCodeAt(0))+h.slice(1)),h=h?o+" "+h:o,n.options.closeAtx&&(h+=" "+o),d(),u(),h}bC.peek=HF;function bC(e){return e.value||""}function HF(){return"<"}xC.peek=KF;function xC(e,t,n,i){const r=Xx(n),a=r==='"'?"Quote":"Apostrophe",o=n.enter("image");let u=n.enter("label");const d=n.createTracker(i);let h=d.move("![");return h+=d.move(n.safe(e.alt,{before:h,after:"]",...d.current()})),h+=d.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),h+=d.move("<"),h+=d.move(n.safe(e.url,{before:h,after:">",...d.current()})),h+=d.move(">")):(u=n.enter("destinationRaw"),h+=d.move(n.safe(e.url,{before:h,after:e.title?" ":")",...d.current()}))),u(),e.title&&(u=n.enter(`title${a}`),h+=d.move(" "+r),h+=d.move(n.safe(e.title,{before:h,after:r,...d.current()})),h+=d.move(r),u()),h+=d.move(")"),o(),h}function KF(){return"!"}vC.peek=GF;function vC(e,t,n,i){const r=e.referenceType,a=n.enter("imageReference");let o=n.enter("label");const u=n.createTracker(i);let d=u.move("![");const h=n.safe(e.alt,{before:d,after:"]",...u.current()});d+=u.move(h+"]["),o();const g=n.stack;n.stack=[],o=n.enter("reference");const p=n.safe(n.associationId(e),{before:d,after:"]",...u.current()});return o(),n.stack=g,a(),r==="full"||!h||h!==p?d+=u.move(p+"]"):r==="shortcut"?d=d.slice(0,-1):d+=u.move("]"),d}function GF(){return"!"}wC.peek=VF;function wC(e,t,n){let i=e.value||"",r="`",a=-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+" ");++a<n.unsafe.length;){const o=n.unsafe[a],u=n.compilePattern(o);let d;if(o.atBreak)for(;d=u.exec(i);){let h=d.index;i.charCodeAt(h)===10&&i.charCodeAt(h-1)===13&&h--,i=i.slice(0,h)+" "+i.slice(d.index+1)}}return r+i+r}function VF(){return"`"}function kC(e,t){const n=Fx(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))}EC.peek=YF;function EC(e,t,n,i){const r=Xx(n),a=r==='"'?"Quote":"Apostrophe",o=n.createTracker(i);let u,d;if(kC(e,n)){const g=n.stack;n.stack=[],u=n.enter("autolink");let p=o.move("<");return p+=o.move(n.containerPhrasing(e,{before:p,after:">",...o.current()})),p+=o.move(">"),u(),n.stack=g,p}u=n.enter("link"),d=n.enter("label");let h=o.move("[");return h+=o.move(n.containerPhrasing(e,{before:h,after:"](",...o.current()})),h+=o.move("]("),d(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),h+=o.move("<"),h+=o.move(n.safe(e.url,{before:h,after:">",...o.current()})),h+=o.move(">")):(d=n.enter("destinationRaw"),h+=o.move(n.safe(e.url,{before:h,after:e.title?" ":")",...o.current()}))),d(),e.title&&(d=n.enter(`title${a}`),h+=o.move(" "+r),h+=o.move(n.safe(e.title,{before:h,after:r,...o.current()})),h+=o.move(r),d()),h+=o.move(")"),u(),h}function YF(e,t,n){return kC(e,n)?"<":"["}SC.peek=WF;function SC(e,t,n,i){const r=e.referenceType,a=n.enter("linkReference");let o=n.enter("label");const u=n.createTracker(i);let d=u.move("[");const h=n.containerPhrasing(e,{before:d,after:"]",...u.current()});d+=u.move(h+"]["),o();const g=n.stack;n.stack=[],o=n.enter("reference");const p=n.safe(n.associationId(e),{before:d,after:"]",...u.current()});return o(),n.stack=g,a(),r==="full"||!h||h!==p?d+=u.move(p+"]"):r==="shortcut"?d=d.slice(0,-1):d+=u.move("]"),d}function WF(){return"["}function Zx(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 QF(e){const t=Zx(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 XF(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 NC(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 ZF(e,t,n,i){const r=n.enter("list"),a=n.bulletCurrent;let o=e.ordered?XF(n):Zx(n);const u=e.ordered?o==="."?")":".":QF(n);let d=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const g=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&g&&(!g.children||!g.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&&(d=!0),NC(n)===o&&g){let p=-1;for(;++p<e.children.length;){const y=e.children[p];if(y&&y.type==="listItem"&&y.children&&y.children[0]&&y.children[0].type==="thematicBreak"){d=!0;break}}}}d&&(o=u),n.bulletCurrent=o;const h=n.containerFlow(e,i);return n.bulletLastUsed=o,n.bulletCurrent=a,r(),h}function JF(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 eq(e,t,n,i){const r=JF(n);let a=n.bulletCurrent||Zx(n);t&&t.type==="list"&&t.ordered&&(a=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(r==="tab"||r==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const u=n.createTracker(i);u.move(a+" ".repeat(o-a.length)),u.shift(o);const d=n.enter("listItem"),h=n.indentLines(n.containerFlow(e,u.current()),g);return d(),h;function g(p,y,b){return y?(b?"":" ".repeat(o))+p:(b?a:a+" ".repeat(o-a.length))+p}}function tq(e,t,n,i){const r=n.enter("paragraph"),a=n.enter("phrasing"),o=n.containerPhrasing(e,i);return a(),r(),o}const nq=ld(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function iq(e,t,n,i){return(e.children.some(function(o){return nq(o)})?n.containerPhrasing:n.containerFlow).call(n,e,i)}function rq(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}_C.peek=sq;function _C(e,t,n,i){const r=rq(n),a=n.enter("strong"),o=n.createTracker(i),u=o.move(r+r);let d=o.move(n.containerPhrasing(e,{after:r,before:u,...o.current()}));const h=d.charCodeAt(0),g=Rh(i.before.charCodeAt(i.before.length-1),h,r);g.inside&&(d=Ou(h)+d.slice(1));const p=d.charCodeAt(d.length-1),y=Rh(i.after.charCodeAt(0),p,r);y.inside&&(d=d.slice(0,-1)+Ou(p));const b=o.move(r+r);return a(),n.attentionEncodeSurroundingInfo={after:y.outside,before:g.outside},u+d+b}function sq(e,t,n){return n.options.strong||"*"}function aq(e,t,n,i){return n.safe(e.value,i)}function lq(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 oq(e,t,n){const i=(NC(n)+(n.options.ruleSpaces?" ":"")).repeat(lq(n));return n.options.ruleSpaces?i.slice(0,-1):i}const jC={blockquote:MF,break:dS,code:IF,definition:BF,emphasis:yC,hardBreak:dS,heading:qF,html:bC,image:xC,imageReference:vC,inlineCode:wC,link:EC,linkReference:SC,list:ZF,listItem:eq,paragraph:tq,root:iq,strong:_C,text:aq,thematicBreak:oq};function cq(){return{enter:{table:uq,tableData:fS,tableHeader:fS,tableRow:fq},exit:{codeText:hq,table:dq,tableData:vy,tableHeader:vy,tableRow:vy}}}function uq(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 dq(e){this.exit(e),this.data.inTable=void 0}function fq(e){this.enter({type:"tableRow",children:[]},e)}function vy(e){this.exit(e)}function fS(e){this.enter({type:"tableCell",children:[]},e)}function hq(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,pq));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function pq(e,t){return t==="|"?t:e}function mq(e){const t=e||{},n=t.tableCellPadding,i=t.tablePipeAlign,r=t.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
774
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:y,table:o,tableCell:d,tableRow:u}};function o(b,w,v,N){return h(g(b,v,N),b.align)}function u(b,w,v,N){const k=p(b,v,N),A=h([k]);return A.slice(0,A.indexOf(`
|
|
775
|
+
`))}function d(b,w,v,N){const k=v.enter("tableCell"),A=v.enter("phrasing"),S=v.containerPhrasing(b,{...N,before:a,after:a});return A(),k(),S}function h(b,w){return AF(b,{align:w,alignDelimiters:i,padding:n,stringLength:r})}function g(b,w,v){const N=b.children;let k=-1;const A=[],S=w.enter("table");for(;++k<N.length;)A[k]=p(N[k],w,v);return S(),A}function p(b,w,v){const N=b.children;let k=-1;const A=[],S=w.enter("tableRow");for(;++k<N.length;)A[k]=d(N[k],b,w,v);return S(),A}function y(b,w,v){let N=jC.inlineCode(b,w,v);return v.stack.includes("tableCell")&&(N=N.replace(/\|/g,"\\$&")),N}}function gq(){return{exit:{taskListCheckValueChecked:hS,taskListCheckValueUnchecked:hS,paragraph:bq}}}function yq(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:xq}}}function hS(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function bq(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 a=-1,o;for(;++a<r.length;){const u=r[a];if(u.type==="paragraph"){o=u;break}}o===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 xq(e,t,n,i){const r=e.children[0],a=typeof e.checked=="boolean"&&r&&r.type==="paragraph",o="["+(e.checked?"x":" ")+"] ",u=n.createTracker(i);a&&u.move(o);let d=jC.listItem(e,t,n,{...i,...u.current()});return a&&(d=d.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),d;function h(g){return g+o}}function vq(){return[Z8(),xF(),EF(),cq(),gq()]}function wq(e){return{extensions:[J8(),vF(e),SF(),mq(e),yq()]}}const kq={tokenize:Cq,partial:!0},CC={tokenize:Aq,partial:!0},AC={tokenize:Tq,partial:!0},TC={tokenize:Mq,partial:!0},Eq={tokenize:Dq,partial:!0},MC={name:"wwwAutolink",tokenize:_q,previous:OC},DC={name:"protocolAutolink",tokenize:jq,previous:RC},vs={name:"emailAutolink",tokenize:Nq,previous:LC},Ir={};function Sq(){return{text:Ir}}let Ga=48;for(;Ga<123;)Ir[Ga]=vs,Ga++,Ga===58?Ga=65:Ga===91&&(Ga=97);Ir[43]=vs;Ir[45]=vs;Ir[46]=vs;Ir[95]=vs;Ir[72]=[vs,DC];Ir[104]=[vs,DC];Ir[87]=[vs,MC];Ir[119]=[vs,MC];function Nq(e,t,n){const i=this;let r,a;return o;function o(p){return!jb(p)||!LC.call(i,i.previous)||Jx(i.events)?n(p):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),u(p))}function u(p){return jb(p)?(e.consume(p),u):p===64?(e.consume(p),d):n(p)}function d(p){return p===46?e.check(Eq,g,h)(p):p===45||p===95||Gn(p)?(a=!0,e.consume(p),d):g(p)}function h(p){return e.consume(p),r=!0,d}function g(p){return a&&r&&ni(i.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(p)):n(p)}}function _q(e,t,n){const i=this;return r;function r(o){return o!==87&&o!==119||!OC.call(i,i.previous)||Jx(i.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(kq,e.attempt(CC,e.attempt(AC,a),n),n)(o))}function a(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function jq(e,t,n){const i=this;let r="",a=!1;return o;function o(p){return(p===72||p===104)&&RC.call(i,i.previous)&&!Jx(i.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),r+=String.fromCodePoint(p),e.consume(p),u):n(p)}function u(p){if(ni(p)&&r.length<5)return r+=String.fromCodePoint(p),e.consume(p),u;if(p===58){const y=r.toLowerCase();if(y==="http"||y==="https")return e.consume(p),d}return n(p)}function d(p){return p===47?(e.consume(p),a?h:(a=!0,d)):n(p)}function h(p){return p===null||Mh(p)||Kt(p)||ml(p)||mp(p)?n(p):e.attempt(CC,e.attempt(AC,g),n)(p)}function g(p){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(p)}}function Cq(e,t,n){let i=0;return r;function r(o){return(o===87||o===119)&&i<3?(i++,e.consume(o),r):o===46&&i===3?(e.consume(o),a):n(o)}function a(o){return o===null?n(o):t(o)}}function Aq(e,t,n){let i,r,a;return o;function o(h){return h===46||h===95?e.check(TC,d,u)(h):h===null||Kt(h)||ml(h)||h!==45&&mp(h)?d(h):(a=!0,e.consume(h),o)}function u(h){return h===95?i=!0:(r=i,i=void 0),e.consume(h),o}function d(h){return r||i||!a?n(h):t(h)}}function Tq(e,t){let n=0,i=0;return r;function r(o){return o===40?(n++,e.consume(o),r):o===41&&i<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(TC,t,a)(o):o===null||Kt(o)||ml(o)?t(o):(e.consume(o),r)}function a(o){return o===41&&i++,e.consume(o),r}}function Mq(e,t,n){return i;function i(u){return u===33||u===34||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===63||u===95||u===126?(e.consume(u),i):u===38?(e.consume(u),a):u===93?(e.consume(u),r):u===60||u===null||Kt(u)||ml(u)?t(u):n(u)}function r(u){return u===null||u===40||u===91||Kt(u)||ml(u)?t(u):i(u)}function a(u){return ni(u)?o(u):n(u)}function o(u){return u===59?(e.consume(u),i):ni(u)?(e.consume(u),o):n(u)}}function Dq(e,t,n){return i;function i(a){return e.consume(a),r}function r(a){return Gn(a)?n(a):t(a)}}function OC(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Kt(e)}function RC(e){return!ni(e)}function LC(e){return!(e===47||jb(e))}function jb(e){return e===43||e===45||e===46||e===95||Gn(e)}function Jx(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 Oq={tokenize:Uq,partial:!0};function Rq(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Pq,continuation:{tokenize:Bq},exit:$q}},text:{91:{name:"gfmFootnoteCall",tokenize:Iq},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Lq,resolveTo:zq}}}}function Lq(e,t,n){const i=this;let r=i.events.length;const a=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let o;for(;r--;){const d=i.events[r][1];if(d.type==="labelImage"){o=d;break}if(d.type==="gfmFootnoteCall"||d.type==="labelLink"||d.type==="label"||d.type==="image"||d.type==="link")break}return u;function u(d){if(!o||!o._balanced)return n(d);const h=dr(i.sliceSerialize({start:o.end,end:i.now()}));return h.codePointAt(0)!==94||!a.includes(h.slice(1))?n(d):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),t(d))}}function zq(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 a={type:"gfmFootnoteCallString",start:Object.assign({},r.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},u=[e[n+1],e[n+2],["enter",i,t],e[n+3],e[n+4],["enter",r,t],["exit",r,t],["enter",a,t],["enter",o,t],["exit",o,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",i,t]];return e.splice(n,e.length-n+1,...u),e}function Iq(e,t,n){const i=this,r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let a=0,o;return u;function u(p){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),d}function d(p){return p!==94?n(p):(e.enter("gfmFootnoteCallMarker"),e.consume(p),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",h)}function h(p){if(a>999||p===93&&!o||p===null||p===91||Kt(p))return n(p);if(p===93){e.exit("chunkString");const y=e.exit("gfmFootnoteCallString");return r.includes(dr(i.sliceSerialize(y)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(p)}return Kt(p)||(o=!0),a++,e.consume(p),p===92?g:h}function g(p){return p===91||p===92||p===93?(e.consume(p),a++,h):h(p)}}function Pq(e,t,n){const i=this,r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let a,o=0,u;return d;function d(w){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(w){return w===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",g):n(w)}function g(w){if(o>999||w===93&&!u||w===null||w===91||Kt(w))return n(w);if(w===93){e.exit("chunkString");const v=e.exit("gfmFootnoteDefinitionLabelString");return a=dr(i.sliceSerialize(v)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),y}return Kt(w)||(u=!0),o++,e.consume(w),w===92?p:g}function p(w){return w===91||w===92||w===93?(e.consume(w),o++,g):g(w)}function y(w){return w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),r.includes(a)||r.push(a),St(e,b,"gfmFootnoteDefinitionWhitespace")):n(w)}function b(w){return t(w)}}function Bq(e,t,n){return e.check(ad,t,e.attempt(Oq,t,n))}function $q(e){e.exit("gfmFootnoteDefinition")}function Uq(e,t,n){const i=this;return St(e,r,"gfmFootnoteDefinitionIndent",5);function r(a){const o=i.events[i.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(a):n(a)}}function Fq(e){let n=(e||{}).singleTilde;const i={name:"strikethrough",tokenize:a,resolveAll:r};return n==null&&(n=!0),{text:{126:i},insideSpan:{null:[i]},attentionMarkers:{null:[126]}};function r(o,u){let d=-1;for(;++d<o.length;)if(o[d][0]==="enter"&&o[d][1].type==="strikethroughSequenceTemporary"&&o[d][1]._close){let h=d;for(;h--;)if(o[h][0]==="exit"&&o[h][1].type==="strikethroughSequenceTemporary"&&o[h][1]._open&&o[d][1].end.offset-o[d][1].start.offset===o[h][1].end.offset-o[h][1].start.offset){o[d][1].type="strikethroughSequence",o[h][1].type="strikethroughSequence";const g={type:"strikethrough",start:Object.assign({},o[h][1].start),end:Object.assign({},o[d][1].end)},p={type:"strikethroughText",start:Object.assign({},o[h][1].end),end:Object.assign({},o[d][1].start)},y=[["enter",g,u],["enter",o[h][1],u],["exit",o[h][1],u],["enter",p,u]],b=u.parser.constructs.insideSpan.null;b&&ji(y,y.length,0,gp(b,o.slice(h+1,d),u)),ji(y,y.length,0,[["exit",p,u],["enter",o[d][1],u],["exit",o[d][1],u],["exit",g,u]]),ji(o,h-1,d-h+3,y),d=h+y.length-2;break}}for(d=-1;++d<o.length;)o[d][1].type==="strikethroughSequenceTemporary"&&(o[d][1].type="data");return o}function a(o,u,d){const h=this.previous,g=this.events;let p=0;return y;function y(w){return h===126&&g[g.length-1][1].type!=="characterEscape"?d(w):(o.enter("strikethroughSequenceTemporary"),b(w))}function b(w){const v=qo(h);if(w===126)return p>1?d(w):(o.consume(w),p++,b);if(p<2&&!n)return d(w);const N=o.exit("strikethroughSequenceTemporary"),k=qo(w);return N._open=!k||k===2&&!!v,N._close=!v||v===2&&!!k,u(w)}}}class qq{constructor(){this.map=[]}add(t,n,i){Hq(this,t,n,i)}consume(t){if(this.map.sort(function(a,o){return a[0]-o[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 a of r)t.push(a);r=i.pop()}this.map.length=0}}function Hq(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 Kq(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 a=i.length-1;i[a]=i[a]==="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 Gq(){return{flow:{null:{name:"table",tokenize:Vq,resolveAll:Yq}}}}function Vq(e,t,n){const i=this;let r=0,a=0,o;return u;function u(P){let F=i.events.length-1;for(;F>-1;){const M=i.events[F][1].type;if(M==="lineEnding"||M==="linePrefix")F--;else break}const U=F>-1?i.events[F][1].type:null,V=U==="tableHead"||U==="tableRow"?T:d;return V===T&&i.parser.lazy[i.now().line]?n(P):V(P)}function d(P){return e.enter("tableHead"),e.enter("tableRow"),h(P)}function h(P){return P===124||(o=!0,a+=1),g(P)}function g(P){return P===null?n(P):Je(P)?a>1?(a=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),b):n(P):gt(P)?St(e,g,"whitespace")(P):(a+=1,o&&(o=!1,r+=1),P===124?(e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),o=!0,g):(e.enter("data"),p(P)))}function p(P){return P===null||P===124||Kt(P)?(e.exit("data"),g(P)):(e.consume(P),P===92?y:p)}function y(P){return P===92||P===124?(e.consume(P),p):p(P)}function b(P){return i.interrupt=!1,i.parser.lazy[i.now().line]?n(P):(e.enter("tableDelimiterRow"),o=!1,gt(P)?St(e,w,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):w(P))}function w(P){return P===45||P===58?N(P):P===124?(o=!0,e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),v):C(P)}function v(P){return gt(P)?St(e,N,"whitespace")(P):N(P)}function N(P){return P===58?(a+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(P),e.exit("tableDelimiterMarker"),k):P===45?(a+=1,k(P)):P===null||Je(P)?_(P):C(P)}function k(P){return P===45?(e.enter("tableDelimiterFiller"),A(P)):C(P)}function A(P){return P===45?(e.consume(P),A):P===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(P),e.exit("tableDelimiterMarker"),S):(e.exit("tableDelimiterFiller"),S(P))}function S(P){return gt(P)?St(e,_,"whitespace")(P):_(P)}function _(P){return P===124?w(P):P===null||Je(P)?!o||r!==a?C(P):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(P)):C(P)}function C(P){return n(P)}function T(P){return e.enter("tableRow"),R(P)}function R(P){return P===124?(e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),R):P===null||Je(P)?(e.exit("tableRow"),t(P)):gt(P)?St(e,R,"whitespace")(P):(e.enter("data"),O(P))}function O(P){return P===null||P===124||Kt(P)?(e.exit("data"),R(P)):(e.consume(P),P===92?B:O)}function B(P){return P===92||P===124?(e.consume(P),O):O(P)}}function Yq(e,t){let n=-1,i=!0,r=0,a=[0,0,0,0],o=[0,0,0,0],u=!1,d=0,h,g,p;const y=new qq;for(;++n<e.length;){const b=e[n],w=b[1];b[0]==="enter"?w.type==="tableHead"?(u=!1,d!==0&&(pS(y,t,d,h,g),g=void 0,d=0),h={type:"table",start:Object.assign({},w.start),end:Object.assign({},w.end)},y.add(n,0,[["enter",h,t]])):w.type==="tableRow"||w.type==="tableDelimiterRow"?(i=!0,p=void 0,a=[0,0,0,0],o=[0,n+1,0,0],u&&(u=!1,g={type:"tableBody",start:Object.assign({},w.start),end:Object.assign({},w.end)},y.add(n,0,[["enter",g,t]])),r=w.type==="tableDelimiterRow"?2:g?3:1):r&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")?(i=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],p=Uf(y,t,a,r,void 0,p),a=[0,0,0,0]),o[2]=n)):w.type==="tableCellDivider"&&(i?i=!1:(a[1]!==0&&(o[0]=o[1],p=Uf(y,t,a,r,void 0,p)),a=o,o=[a[1],n,0,0])):w.type==="tableHead"?(u=!0,d=n):w.type==="tableRow"||w.type==="tableDelimiterRow"?(d=n,a[1]!==0?(o[0]=o[1],p=Uf(y,t,a,r,n,p)):o[1]!==0&&(p=Uf(y,t,o,r,n,p)),r=0):r&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")&&(o[3]=n)}for(d!==0&&pS(y,t,d,h,g),y.consume(t.events),n=-1;++n<t.events.length;){const b=t.events[n];b[0]==="enter"&&b[1].type==="table"&&(b[1]._align=Kq(t.events,n))}return e}function Uf(e,t,n,i,r,a){const o=i===1?"tableHeader":i===2?"tableDelimiter":"tableData",u="tableContent";n[0]!==0&&(a.end=Object.assign({},po(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const d=po(t.events,n[1]);if(a={type:o,start:Object.assign({},d),end:Object.assign({},d)},e.add(n[1],0,[["enter",a,t]]),n[2]!==0){const h=po(t.events,n[2]),g=po(t.events,n[3]),p={type:u,start:Object.assign({},h),end:Object.assign({},g)};if(e.add(n[2],0,[["enter",p,t]]),i!==2){const y=t.events[n[2]],b=t.events[n[3]];if(y[1].end=Object.assign({},b[1].end),y[1].type="chunkText",y[1].contentType="text",n[3]>n[2]+1){const w=n[2]+1,v=n[3]-n[2]-1;e.add(w,v,[])}}e.add(n[3]+1,0,[["exit",p,t]])}return r!==void 0&&(a.end=Object.assign({},po(t.events,r)),e.add(r,0,[["exit",a,t]]),a=void 0),a}function pS(e,t,n,i,r){const a=[],o=po(t.events,n);r&&(r.end=Object.assign({},o),a.push(["exit",r,t])),i.end=Object.assign({},o),a.push(["exit",i,t]),e.add(n+1,0,a)}function po(e,t){const n=e[t],i=n[0]==="enter"?"start":"end";return n[1][i]}const Wq={name:"tasklistCheck",tokenize:Xq};function Qq(){return{text:{91:Wq}}}function Xq(e,t,n){const i=this;return r;function r(d){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?n(d):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),a)}function a(d){return Kt(d)?(e.enter("taskListCheckValueUnchecked"),e.consume(d),e.exit("taskListCheckValueUnchecked"),o):d===88||d===120?(e.enter("taskListCheckValueChecked"),e.consume(d),e.exit("taskListCheckValueChecked"),o):n(d)}function o(d){return d===93?(e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),u):n(d)}function u(d){return Je(d)?t(d):gt(d)?e.check({tokenize:Zq},t,n)(d):n(d)}}function Zq(e,t,n){return St(e,i,"whitespace");function i(r){return r===null?n(r):t(r)}}function Jq(e){return Gj([Sq(),Rq(),Fq(e),Gq(),Qq()])}const e7={};function e0(e){const t=this,n=e||e7,i=t.data(),r=i.micromarkExtensions||(i.micromarkExtensions=[]),a=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),o=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);r.push(Jq(n)),a.push(vq()),o.push(wq(n))}const mS=(function(e,t,n){const i=ld(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]}),Nl=(function(e){if(e==null)return i7;if(typeof e=="string")return n7(e);if(typeof e=="object")return t7(e);if(typeof e=="function")return t0(e);throw new Error("Expected function, string, or array as `test`")});function t7(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Nl(e[n]);return t0(i);function i(...r){let a=-1;for(;++a<t.length;)if(t[a].apply(this,r))return!0;return!1}}function n7(e){return t0(t);function t(n){return n.tagName===e}}function t0(e){return t;function t(n,i,r){return!!(r7(n)&&e.call(this,n,typeof i=="number"?i:void 0,r||void 0))}}function i7(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function r7(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const gS=/\n/g,yS=/[\t ]+/g,Cb=Nl("br"),bS=Nl(f7),s7=Nl("p"),xS=Nl("tr"),a7=Nl(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",d7,h7]),zC=Nl(["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 l7(e,t){const n=t||{},i="children"in e?e.children:[],r=zC(e),a=BC(e,{whitespace:n.whitespace||"normal"}),o=[];(e.type==="text"||e.type==="comment")&&o.push(...PC(e,{breakBefore:!0,breakAfter:!0}));let u=-1;for(;++u<i.length;)o.push(...IC(i[u],e,{whitespace:a,breakBefore:u?void 0:r,breakAfter:u<i.length-1?Cb(i[u+1]):r}));const d=[];let h;for(u=-1;++u<o.length;){const g=o[u];typeof g=="number"?h!==void 0&&g>h&&(h=g):g&&(h!==void 0&&h>-1&&d.push(`
|
|
776
|
+
`.repeat(h)||" "),h=-1,d.push(g))}return d.join("")}function IC(e,t,n){return e.type==="element"?o7(e,t,n):e.type==="text"?n.whitespace==="normal"?PC(e,n):c7(e):[]}function o7(e,t,n){const i=BC(e,n),r=e.children||[];let a=-1,o=[];if(a7(e))return o;let u,d;for(Cb(e)||xS(e)&&mS(t,e,xS)?d=`
|
|
777
|
+
`:s7(e)?(u=2,d=2):zC(e)&&(u=1,d=1);++a<r.length;)o=o.concat(IC(r[a],e,{whitespace:i,breakBefore:a?void 0:u,breakAfter:a<r.length-1?Cb(r[a+1]):d}));return bS(e)&&mS(t,e,bS)&&o.push(" "),u&&o.unshift(u),d&&o.push(d),o}function PC(e,t){const n=String(e.value),i=[],r=[];let a=0;for(;a<=n.length;){gS.lastIndex=a;const d=gS.exec(n),h=d&&"index"in d?d.index:n.length;i.push(u7(n.slice(a,h).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),a===0?t.breakBefore:!0,h===n.length?t.breakAfter:!0)),a=h+1}let o=-1,u;for(;++o<i.length;)i[o].charCodeAt(i[o].length-1)===8203||o<i.length-1&&i[o+1].charCodeAt(0)===8203?(r.push(i[o]),u=void 0):i[o]?(typeof u=="number"&&r.push(u),r.push(i[o]),u=0):(o===0||o===i.length-1)&&r.push(0);return r}function c7(e){return[String(e.value)]}function u7(e,t,n){const i=[];let r=0,a;for(;r<e.length;){yS.lastIndex=r;const o=yS.exec(e);a=o?o.index:e.length,!r&&!a&&o&&!t&&i.push(""),r!==a&&i.push(e.slice(r,a)),r=o?a+o[0].length:a}return r!==a&&!n&&i.push(""),i.join(" ")}function BC(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 d7(e){return!!(e.properties||{}).hidden}function f7(e){return e.tagName==="td"||e.tagName==="th"}function h7(e){return e.tagName==="dialog"&&!(e.properties||{}).open}function p7(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",o="(?!struct)("+i+"|"+t.optional(r)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",u={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},h={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})"/})]},g={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},p={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(h,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},y={className:"title",begin:t.optional(r)+e.IDENT_RE,relevance:0},b=t.optional(r)+e.IDENT_RE+"\\s*\\(",w=["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"],v=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],N=["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"],k=["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"],_={type:v,keyword:w,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:N},C={className:"function.dispatch",relevance:0,keywords:{_hint:k},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},T=[C,p,u,n,e.C_BLOCK_COMMENT_MODE,g,h],R={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:_,contains:T.concat([{begin:/\(/,end:/\)/,keywords:_,contains:T.concat(["self"]),relevance:0}]),relevance:0},O={className:"function",begin:"("+o+"[\\*&\\s]+)+"+b,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:_,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:_,relevance:0},{begin:b,returnBegin:!0,contains:[y],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[h,g]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,h,g,u,{begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,h,g,u]}]},u,n,e.C_BLOCK_COMMENT_MODE,p]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:_,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(R,O,C,T,[p,{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:_,contains:["self",u]},{begin:e.IDENT_RE+"::",keywords:_},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function m7(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=p7(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 g7(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]},a=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},u={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,r]};r.contains.push(u);const d={match:/\\"/},h={className:"string",begin:/'/,end:/'/},g={match:/\\'/},p={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},y=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],b=e.SHEBANG({binary:`(${y.join("|")})`,relevance:10}),w={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},v=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],N=["true","false"],k={match:/(\/[a-z._-]+)+/},A=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],S=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],_=["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"],C=["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:v,literal:N,built_in:[...A,...S,"set","shopt",..._,...C]},contains:[b,e.SHEBANG(),w,p,a,o,k,u,d,h,g,n]}}function y7(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",o="("+i+"|"+t.optional(r)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",u={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},h={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})"/})]},g={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},p={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(h,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},y={className:"title",begin:t.optional(r)+e.IDENT_RE,relevance:0},b=t.optional(r)+e.IDENT_RE+"\\s*\\(",N={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"},k=[p,u,n,e.C_BLOCK_COMMENT_MODE,g,h],A={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:N,contains:k.concat([{begin:/\(/,end:/\)/,keywords:N,contains:k.concat(["self"]),relevance:0}]),relevance:0},S={begin:"("+o+"[\\*&\\s]+)+"+b,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:N,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:N,relevance:0},{begin:b,returnBegin:!0,contains:[e.inherit(y,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:N,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,h,g,u,{begin:/\(/,end:/\)/,keywords:N,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,h,g,u]}]},u,n,e.C_BLOCK_COMMENT_MODE,p]};return{name:"C",aliases:["h"],keywords:N,disableAutodetect:!0,illegal:"</",contains:[].concat(A,S,k,[p,{begin:e.IDENT_RE+"::",keywords:N},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:p,strings:h,keywords:N}}}function b7(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",o="(?!struct)("+i+"|"+t.optional(r)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",u={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},h={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})"/})]},g={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},p={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(h,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},y={className:"title",begin:t.optional(r)+e.IDENT_RE,relevance:0},b=t.optional(r)+e.IDENT_RE+"\\s*\\(",w=["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"],v=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],N=["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"],k=["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"],_={type:v,keyword:w,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:N},C={className:"function.dispatch",relevance:0,keywords:{_hint:k},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},T=[C,p,u,n,e.C_BLOCK_COMMENT_MODE,g,h],R={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:_,contains:T.concat([{begin:/\(/,end:/\)/,keywords:_,contains:T.concat(["self"]),relevance:0}]),relevance:0},O={className:"function",begin:"("+o+"[\\*&\\s]+)+"+b,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:_,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:_,relevance:0},{begin:b,returnBegin:!0,contains:[y],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[h,g]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,h,g,u,{begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,h,g,u]}]},u,n,e.C_BLOCK_COMMENT_MODE,p]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:_,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(R,O,C,T,[p,{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:_,contains:["self",u]},{begin:e.IDENT_RE+"::",keywords:_},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function x7(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"],a=["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"],o={keyword:r.concat(a),built_in:t,literal:i},u=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),d={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},h={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},g={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},p=e.inherit(g,{illegal:/\n/}),y={className:"subst",begin:/\{/,end:/\}/,keywords:o},b=e.inherit(y,{illegal:/\n/}),w={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,b]},v={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},y]},N=e.inherit(v,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},b]});y.contains=[v,w,g,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,d,e.C_BLOCK_COMMENT_MODE],b.contains=[N,w,p,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,d,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const k={variants:[h,v,w,g,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},A={begin:"<",end:">",contains:[{beginKeywords:"in out"},u]},S=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",_={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:o,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"}},k,d,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},u,A,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[u,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[u,A,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:"("+S+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:o,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,A],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,relevance:0,contains:[k,d,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},_]}}const v7=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_-]*/}}),w7=["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"],k7=["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"],E7=[...w7,...k7],S7=["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(),N7=["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(),_7=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),j7=["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 C7(e){const t=e.regex,n=v7(e),i={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},r="and or not only",a=/@-?\w[\w]*(-\w+)*/,o="[a-zA-Z-][a-zA-Z0-9_-]*",u=[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:"\\."+o,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+N7.join("|")+")"},{begin:":(:)?("+_7.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+j7.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...u,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...u,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:a},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:r,attribute:S7.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...u,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+E7.join("|")+")\\b"}]}}function A7(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 T7(e){const a={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:a,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:a,illegal:/["']/}]}]}}function M7(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 D7(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:/\$\{(.*?)\}/}]},a={className:"literal",begin:/\bon|off|true|false|yes|no\b/},o={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},u={begin:/\[/,end:/\]/,contains:[i,a,r,o,n,"self"],relevance:0},d=/[A-Za-z0-9_-]+/,h=/"(\\"|[^"])*"/,g=/'[^']*'/,p=t.either(d,h,g),y=t.concat(p,"(\\s*\\.\\s*",p,")*",t.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[i,{className:"section",begin:/\[+/,end:/\]+/},{begin:y,className:"attr",starts:{end:/$/,contains:[i,u,a,r,o,n]}}]}}var mo="[0-9](_*[0-9])*",Ff=`\\.(${mo})`,qf="[0-9a-fA-F](_*[0-9a-fA-F])*",vS={className:"number",variants:[{begin:`(\\b(${mo})((${Ff})|\\.)?|(${Ff}))[eE][+-]?(${mo})[fFdD]?\\b`},{begin:`\\b(${mo})((${Ff})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Ff})[fFdD]?\\b`},{begin:`\\b(${mo})[fFdD]\\b`},{begin:`\\b0[xX]((${qf})\\.?|(${qf})?\\.(${qf}))[pP][+-]?(${mo})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${qf})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function $C(e,t,n){return n===-1?"":e.replace(t,i=>$C(e,t,n-1))}function O7(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",i=n+$C("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),d={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"]},h={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},g={className:"params",begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:d,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:[g,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:d,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[h,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,vS,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},vS,h]}}const wS="[A-Za-z$_][0-9A-Za-z$_]*",R7=["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"],L7=["true","false","null","undefined","NaN","Infinity"],UC=["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"],FC=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],qC=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],z7=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],I7=[].concat(qC,UC,FC);function P7(e){const t=e.regex,n=(W,{after:Y})=>{const I="</"+W[0].slice(1);return W.input.indexOf(I,Y)!==-1},i=wS,r={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(W,Y)=>{const I=W[0].length+W.index,L=W.input[I];if(L==="<"||L===","){Y.ignoreMatch();return}L===">"&&(n(W,{after:I})||Y.ignoreMatch());let G;const z=W.input.substring(I);if(G=z.match(/^\s*=/)){Y.ignoreMatch();return}if((G=z.match(/^\s+extends\s+/))&&G.index===0){Y.ignoreMatch();return}}},u={$pattern:wS,keyword:R7,literal:L7,built_in:I7,"variable.language":z7},d="[0-9](_?[0-9])*",h=`\\.(${d})`,g="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",p={className:"number",variants:[{begin:`(\\b(${g})((${h})|\\.)?|(${h}))[eE][+-]?(${d})\\b`},{begin:`\\b(${g})\\b((${h})\\b|\\.)?|(${h})\\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},y={className:"subst",begin:"\\$\\{",end:"\\}",keywords:u,contains:[]},b={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"xml"}},w={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"css"}},v={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"graphql"}},N={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,y]},A={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]},S=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,b,w,v,N,{match:/\$\d+/},p];y.contains=S.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(S)});const _=[].concat(A,y.contains),C=_.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(_)}]),T={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:C},R={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"}}]},O={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:{_:[...UC,...FC]}},B={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},P={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[T],illegal:/%/},F={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function U(W){return t.concat("(?!",W.join("|"),")")}const V={match:t.concat(/\b/,U([...qC,"super","import"].map(W=>`${W}\\s*\\(`)),i,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},M={begin:t.concat(/\./,t.lookahead(t.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},H={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},T]},$="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",K={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead($)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[T]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:C,CLASS_REFERENCE:O},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),B,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,b,w,v,N,A,{match:/\$\d+/},p,O,{scope:"attr",match:i+t.lookahead(":"),relevance:0},K,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[A,e.REGEXP_MODE,{className:"function",begin:$,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:u,contains:C}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},P,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[T,e.inherit(e.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},M,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[T]},V,F,R,H,{match:/\$[(.]/}]}}function B7(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 go="[0-9](_*[0-9])*",Hf=`\\.(${go})`,Kf="[0-9a-fA-F](_*[0-9a-fA-F])*",$7={className:"number",variants:[{begin:`(\\b(${go})((${Hf})|\\.)?|(${Hf}))[eE][+-]?(${go})[fFdD]?\\b`},{begin:`\\b(${go})((${Hf})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Hf})[fFdD]?\\b`},{begin:`\\b(${go})[fFdD]\\b`},{begin:`\\b0[xX]((${Kf})\\.?|(${Kf})?\\.(${Kf}))[pP][+-]?(${go})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Kf})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function U7(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]},a={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},o={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[a,r]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,a,r]}]};r.contains.push(o);const u={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},d={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(o,{className:"string"}),"self"]}]},h=$7,g=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),p={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},y=p;return y.variants[1].contains=[p],p.variants[1].contains=[y],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,g,n,i,u,d,{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:[p,e.C_LINE_COMMENT_MODE,g],relevance:0},e.C_LINE_COMMENT_MODE,g,u,d,o,e.C_NUMBER_MODE]},g]},{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},u,d]},o,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
|
|
778
|
+
`},h]}}const F7=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_-]*/}}),q7=["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"],H7=["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"],K7=[...q7,...H7],G7=["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(),HC=["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(),KC=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),V7=["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(),Y7=HC.concat(KC).sort().reverse();function W7(e){const t=F7(e),n=Y7,i="and or not only",r="[\\w-]+",a="("+r+"|@\\{"+r+"\\})",o=[],u=[],d=function(S){return{className:"string",begin:"~?"+S+".*?"+S}},h=function(S,_,C){return{className:S,begin:_,relevance:C}},g={$pattern:/[a-z-]+/,keyword:i,attribute:G7.join(" ")},p={begin:"\\(",end:"\\)",contains:u,keywords:g,relevance:0};u.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,d("'"),d('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,p,h("variable","@@?"+r,10),h("variable","@\\{"+r+"\\}"),h("built_in","~?`[^`]*?`"),{className:"attribute",begin:r+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const y=u.concat({begin:/\{/,end:/\}/,contains:o}),b={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(u)},w={begin:a+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+V7.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:u}}]},v={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:g,returnEnd:!0,contains:u,relevance:0}},N={className:"variable",variants:[{begin:"@"+r+"\\s*:",relevance:15},{begin:"@"+r}],starts:{end:"[;}]",returnEnd:!0,contains:y}},k={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:a,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,b,h("keyword","all\\b"),h("variable","@\\{"+r+"\\}"),{begin:"\\b("+K7.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,h("selector-tag",a,0),h("selector-id","#"+a),h("selector-class","\\."+a,0),h("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+HC.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+KC.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:y},{begin:"!important"},t.FUNCTION_DISPATCH]},A={begin:r+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[k]};return o.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,v,N,A,w,k,b,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:o}}function Q7(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 X7(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*(?=[:+?]?=)"},a={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},o={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,a,o]}}function Z7(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}]},a={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},o={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},u=/[A-Za-z][A-Za-z0-9+.-]*/,d={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,u,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},h={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},g={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},p=e.inherit(h,{contains:[]}),y=e.inherit(g,{contains:[]});h.contains.push(y),g.contains.push(p);let b=[n,d];return[h,g,p,y].forEach(k=>{k.contains=k.contains.concat(b)}),b=b.concat(h,g),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:b},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:b}]}]},n,a,h,g,{className:"quote",begin:"^>\\s+",contains:b,end:"$"},r,i,d,o,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function J7(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_]*/,u={"variable.language":["this","super"],$pattern:n,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},d={$pattern:n,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:u,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:"("+d.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:d,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function eH(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(" ")},a={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:r},o={begin:/->\{/,end:/\}/},u={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},d={scope:"variable",variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[u]},h={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},g=[e.BACKSLASH_ESCAPE,a,d],p=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],y=(v,N,k="\\1")=>{const A=k==="\\1"?k:t.concat(k,N);return t.concat(t.concat("(?:",v,")"),N,/(?:\\.|[^\\\/])*?/,A,/(?:\\.|[^\\\/])*?/,k,i)},b=(v,N,k)=>t.concat(t.concat("(?:",v,")"),N,/(?:\\.|[^\\\/])*?/,k,i),w=[d,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),o,{className:"string",contains:g,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}]},h,{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:y("s|tr|y",t.either(...p,{capture:!0}))},{begin:y("s|tr|y","\\(","\\)")},{begin:y("s|tr|y","\\[","\\]")},{begin:y("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:b("(?:m|qr)?",/\//,/\//)},{begin:b("m|qr",t.either(...p,{capture:!0}),/\1/)},{begin:b("m|qr",/\(/,/\)/)},{begin:b("m|qr",/\[/,/\]/)},{begin:b("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,u]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,u,h]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return a.contains=w,o.contains=w,{name:"Perl",aliases:["pl","pm"],keywords:r,contains:w}}function tH(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),a=t.concat(/[A-Z]+/,n),o={scope:"variable",match:"\\$+"+i},u={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},d={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},h=e.inherit(e.APOS_STRING_MODE,{illegal:null}),g=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(d)}),p={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(d),"on:begin":(M,H)=>{H.data._beginMatch=M[1]||M[2]},"on:end":(M,H)=>{H.data._beginMatch!==M[1]&&H.ignoreMatch()}},y=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),b=`[
|
|
779
|
+
]`,w={scope:"string",variants:[g,h,p,y]},v={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},N=["false","null","true"],k=["__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"],A=["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"],_={keyword:k,literal:(M=>{const H=[];return M.forEach($=>{H.push($),$.toLowerCase()===$?H.push($.toUpperCase()):H.push($.toLowerCase())}),H})(N),built_in:A},C=M=>M.map(H=>H.replace(/\|\d+$/,"")),T={variants:[{match:[/new/,t.concat(b,"+"),t.concat("(?!",C(A).join("\\b|"),"\\b)"),r],scope:{1:"keyword",4:"title.class"}}]},R=t.concat(i,"\\b(?!\\()"),O={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),R],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[r,t.concat(/::/,t.lookahead(/(?!class\b)/)),R],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"}}]},B={scope:"attr",match:t.concat(i,t.lookahead(":"),t.lookahead(/(?!::)/))},P={relevance:0,begin:/\(/,end:/\)/,keywords:_,contains:[B,o,O,e.C_BLOCK_COMMENT_MODE,w,v,T]},F={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",C(k).join("\\b|"),"|",C(A).join("\\b|"),"\\b)"),i,t.concat(b,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[P]};P.contains.push(F);const U=[B,O,e.C_BLOCK_COMMENT_MODE,w,v,T],V={begin:t.concat(/#\[\s*\\?/,t.either(r,a)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:N,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:N,keyword:["new","array"]},contains:["self",...U]},...U,{scope:"meta",variants:[{match:r},{match:a}]}]};return{case_insensitive:!1,keywords:_,contains:[V,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}]}},u,{scope:"variable.language",match:/\$this\b/},o,F,O,{match:[/const/,/\s/,i],scope:{1:"keyword",3:"variable.constant"}},T,{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:_,contains:["self",V,o,O,e.C_BLOCK_COMMENT_MODE,w,v]}]},{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]},w,v]}}function nH(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 iH(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function rH(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"],u={$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"]},d={className:"meta",begin:/^(>>>|\.\.\.) /},h={className:"subst",begin:/\{/,end:/\}/,keywords:u,illegal:/#/},g={begin:/\{\{/,relevance:0},p={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,d],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,d],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,d,g,h]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,d,g,h]},{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,g,h]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,g,h]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},y="[0-9](_?[0-9])*",b=`(\\b(${y}))?\\.(${y})|\\b(${y})\\.`,w=`\\b|${i.join("|")}`,v={className:"number",relevance:0,variants:[{begin:`(\\b(${y})|(${b}))[eE][+-]?(${y})[jJ]?(?=${w})`},{begin:`(${b})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${w})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${w})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${w})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${w})`},{begin:`\\b(${y})[jJ](?=${w})`}]},N={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:u,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},k={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:["self",d,v,p,e.HASH_COMMENT_MODE]}]};return h.contains=[p,v,d],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:u,illegal:/(<\/|\?)|=>/,contains:[d,v,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},p,N,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[k]},{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:[v,k,p]}]}}function sH(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function aH(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=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,a=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:[a,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:a},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function lH(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+)*/),o={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},u={className:"doctag",begin:"@[A-Za-z]+"},d={begin:"#<",end:">"},h=[e.COMMENT("#","$",{contains:[u]}),e.COMMENT("^=begin","^=end",{contains:[u],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],g={className:"subst",begin:/#\{/,end:/\}/,keywords:o},p={className:"string",contains:[e.BACKSLASH_ESCAPE,g],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,g]})]}]},y="[1-9](_?[0-9])*|0",b="[0-9](_?[0-9])*",w={className:"number",relevance:0,variants:[{begin:`\\b(${y})(\\.(${b}))?([eE][+-]?(${b})|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"}]},v={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:o}]},T=[p,{variants:[{match:[/class\s+/,r,/\s+<\s+/,r]},{match:[/\b(class|module)\s+/,r]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:o},{match:[/(include|extend)\s+/,r],scope:{2:"title.class"},keywords:o},{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:[v]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[p,{begin:n}],relevance:0},w,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:o},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,g],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(d,h),relevance:0}].concat(d,h);g.contains=T,v.contains=T;const P=[{begin:/^\s*=>/,starts:{end:"$",contains:T}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:o,contains:T}}];return h.unshift(d),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:o,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(P).concat(h).concat(T)}}function oH(e){const t=e.regex,n=/(r#)?/,i=t.concat(n,e.UNDERSCORE_IDENT_RE),r=t.concat(n,e.IDENT_RE),a={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,r,t.lookahead(/\s*\(/))},o="([ui](8|16|32|64|128|size)|f(32|64))?",u=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],d=["true","false","Some","None","Ok","Err"],h=["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!"],g=["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:g,keyword:u,literal:d,built_in:h},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_]+)"+o},{begin:"\\b0o([0-7_]+)"+o},{begin:"\\b0x([A-Fa-f0-9_]+)"+o},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+o}],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:h,type:g}},{className:"punctuation",begin:"->"},a]}}const cH=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_-]*/}}),uH=["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"],dH=["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"],fH=[...uH,...dH],hH=["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(),pH=["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(),mH=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),gH=["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 yH(e){const t=cH(e),n=mH,i=pH,r="@[a-z-]+",a="and or not only",u={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[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("+fH.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+i.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},u,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+gH.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,u,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:a,attribute:hH.join(" ")},contains:[{begin:r,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},u,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function bH(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function xH(e){const t=e.regex,n=e.COMMENT("--","$"),i={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},r={begin:/"/,end:/"/,contains:[{match:/""/}]},a=["true","false","unknown"],o=["double precision","large object","with timezone","without timezone"],u=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],d=["add","asc","collation","desc","final","first","last","view"],h=["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"],g=["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"],p=["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"],y=["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"],b=g,w=[...h,...d].filter(C=>!g.includes(C)),v={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},N={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},k={match:t.concat(/\b/,t.either(...b),/\s*\(/),relevance:0,keywords:{built_in:b}};function A(C){return t.concat(/\b/,t.either(...C.map(T=>T.replace(/\s+/,"\\s+"))),/\b/)}const S={scope:"keyword",match:A(y),relevance:0};function _(C,{exceptions:T,when:R}={}){const O=R;return T=T||[],C.map(B=>B.match(/\|\d+$/)||T.includes(B)?B:O(B)?`${B}|0`:B)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:_(w,{when:C=>C.length<3}),literal:a,type:u,built_in:p},contains:[{scope:"type",match:A(o)},S,k,v,i,r,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,N]}}function GC(e){return e?typeof e=="string"?e:e.source:null}function lu(e){return Ut("(?=",e,")")}function Ut(...e){return e.map(n=>GC(n)).join("")}function vH(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Jn(...e){return"("+(vH(e).capture?"":"?:")+e.map(i=>GC(i)).join("|")+")"}const n0=e=>Ut(/\b/,e,/\w$/.test(e)?/\b/:/\B/),wH=["Protocol","Type"].map(n0),kS=["init","self"].map(n0),kH=["Any","Self"],wy=["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"],ES=["false","nil","true"],EH=["assignment","associativity","higherThan","left","lowerThan","none","right"],SH=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],SS=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],VC=Jn(/[/=\-+!*%<>&|^~?]/,/[\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]/),YC=Jn(VC,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),ky=Ut(VC,YC,"*"),WC=Jn(/[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]/),Lh=Jn(WC,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),_r=Ut(WC,Lh,"*"),Gf=Ut(/[A-Z]/,Lh,"*"),NH=["attached","autoclosure",Ut(/convention\(/,Jn("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",Ut(/objc\(/,_r,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],_H=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function jH(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),i=[e.C_LINE_COMMENT_MODE,n],r={match:[/\./,Jn(...wH,...kS)],className:{2:"keyword"}},a={match:Ut(/\./,Jn(...wy)),relevance:0},o=wy.filter(_e=>typeof _e=="string").concat(["_|0"]),u=wy.filter(_e=>typeof _e!="string").concat(kH).map(n0),d={variants:[{className:"keyword",match:Jn(...u,...kS)}]},h={$pattern:Jn(/\b\w+/,/#\w+/),keyword:o.concat(SH),literal:ES},g=[r,a,d],p={match:Ut(/\./,Jn(...SS)),relevance:0},y={className:"built_in",match:Ut(/\b/,Jn(...SS),/(?=\()/)},b=[p,y],w={match:/->/,relevance:0},v={className:"operator",relevance:0,variants:[{match:ky},{match:`\\.(\\.|${YC})+`}]},N=[w,v],k="([0-9]_*)+",A="([0-9a-fA-F]_*)+",S={className:"number",relevance:0,variants:[{match:`\\b(${k})(\\.(${k}))?([eE][+-]?(${k}))?\\b`},{match:`\\b0x(${A})(\\.(${A}))?([pP][+-]?(${k}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},_=(_e="")=>({className:"subst",variants:[{match:Ut(/\\/,_e,/[0\\tnr"']/)},{match:Ut(/\\/,_e,/u\{[0-9a-fA-F]{1,8}\}/)}]}),C=(_e="")=>({className:"subst",match:Ut(/\\/,_e,/[\t ]*(?:[\r\n]|\r\n)/)}),T=(_e="")=>({className:"subst",label:"interpol",begin:Ut(/\\/,_e,/\(/),end:/\)/}),R=(_e="")=>({begin:Ut(_e,/"""/),end:Ut(/"""/,_e),contains:[_(_e),C(_e),T(_e)]}),O=(_e="")=>({begin:Ut(_e,/"/),end:Ut(/"/,_e),contains:[_(_e),T(_e)]}),B={className:"string",variants:[R(),R("#"),R("##"),R("###"),O(),O("#"),O("##"),O("###")]},P=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],F={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:P},U=_e=>{const Qe=Ut(_e,/\//),Ue=Ut(/\//,_e);return{begin:Qe,end:Ue,contains:[...P,{scope:"comment",begin:`#(?!.*${Ue})`,end:/$/}]}},V={scope:"regexp",variants:[U("###"),U("##"),U("#"),F]},M={match:Ut(/`/,_r,/`/)},H={className:"variable",match:/\$\d+/},$={className:"variable",match:`\\$${Lh}+`},K=[M,H,$],W={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:_H,contains:[...N,S,B]}]}},Y={scope:"keyword",match:Ut(/@/,Jn(...NH),lu(Jn(/\(/,/\s+/)))},I={scope:"meta",match:Ut(/@/,_r)},L=[W,Y,I],G={match:lu(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:Ut(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,Lh,"+")},{className:"type",match:Gf,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:Ut(/\s+&\s+/,lu(Gf)),relevance:0}]},z={begin:/</,end:/>/,keywords:h,contains:[...i,...g,...L,w,G]};G.contains.push(z);const te={match:Ut(_r,/\s*:/),keywords:"_|0",relevance:0},me={begin:/\(/,end:/\)/,relevance:0,keywords:h,contains:["self",te,...i,V,...g,...b,...N,S,B,...K,...L,G]},ye={begin:/</,end:/>/,keywords:"repeat each",contains:[...i,G]},Se={begin:Jn(lu(Ut(_r,/\s*:/)),lu(Ut(_r,/\s+/,_r,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:_r}]},re={begin:/\(/,end:/\)/,keywords:h,contains:[Se,...i,...g,...N,S,B,...L,G,me],endsParent:!0,illegal:/["']/},he={match:[/(func|macro)/,/\s+/,Jn(M.match,_r,ky)],className:{1:"keyword",3:"title.function"},contains:[ye,re,t],illegal:[/\[/,/%/]},se={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[ye,re,t],illegal:/\[|%/},J={match:[/operator/,/\s+/,ky],className:{1:"keyword",3:"title"}},ke={begin:[/precedencegroup/,/\s+/,Gf],className:{1:"keyword",3:"title"},contains:[G],keywords:[...EH,...ES],end:/}/},le={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},Ce={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},Me={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,_r,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:h,contains:[ye,...g,{begin:/:/,end:/\{/,keywords:h,contains:[{scope:"title.class.inherited",match:Gf},...g],relevance:0}]};for(const _e of B.variants){const Qe=_e.contains.find(ue=>ue.label==="interpol");Qe.keywords=h;const Ue=[...g,...b,...N,S,B,...K];Qe.contains=[...Ue,{begin:/\(/,end:/\)/,contains:["self",...Ue]}]}return{name:"Swift",keywords:h,contains:[...i,he,se,le,Ce,Me,J,ke,{beginKeywords:"import",end:/$/,contains:[...i],relevance:0},V,...g,...b,...N,S,B,...K,...L,G,me]}}const zh="[A-Za-z$_][0-9A-Za-z$_]*",QC=["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"],XC=["true","false","null","undefined","NaN","Infinity"],ZC=["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"],JC=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],eA=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],tA=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],nA=[].concat(eA,ZC,JC);function CH(e){const t=e.regex,n=(W,{after:Y})=>{const I="</"+W[0].slice(1);return W.input.indexOf(I,Y)!==-1},i=zh,r={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(W,Y)=>{const I=W[0].length+W.index,L=W.input[I];if(L==="<"||L===","){Y.ignoreMatch();return}L===">"&&(n(W,{after:I})||Y.ignoreMatch());let G;const z=W.input.substring(I);if(G=z.match(/^\s*=/)){Y.ignoreMatch();return}if((G=z.match(/^\s+extends\s+/))&&G.index===0){Y.ignoreMatch();return}}},u={$pattern:zh,keyword:QC,literal:XC,built_in:nA,"variable.language":tA},d="[0-9](_?[0-9])*",h=`\\.(${d})`,g="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",p={className:"number",variants:[{begin:`(\\b(${g})((${h})|\\.)?|(${h}))[eE][+-]?(${d})\\b`},{begin:`\\b(${g})\\b((${h})\\b|\\.)?|(${h})\\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},y={className:"subst",begin:"\\$\\{",end:"\\}",keywords:u,contains:[]},b={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"xml"}},w={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"css"}},v={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"graphql"}},N={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,y]},A={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]},S=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,b,w,v,N,{match:/\$\d+/},p];y.contains=S.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(S)});const _=[].concat(A,y.contains),C=_.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(_)}]),T={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:C},R={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"}}]},O={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:{_:[...ZC,...JC]}},B={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},P={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[T],illegal:/%/},F={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function U(W){return t.concat("(?!",W.join("|"),")")}const V={match:t.concat(/\b/,U([...eA,"super","import"].map(W=>`${W}\\s*\\(`)),i,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},M={begin:t.concat(/\./,t.lookahead(t.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},H={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},T]},$="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",K={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead($)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[T]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:C,CLASS_REFERENCE:O},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),B,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,b,w,v,N,A,{match:/\$\d+/},p,O,{scope:"attr",match:i+t.lookahead(":"),relevance:0},K,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[A,e.REGEXP_MODE,{className:"function",begin:$,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:u,contains:C}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},P,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[T,e.inherit(e.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},M,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[T]},V,F,R,H,{match:/\$[(.]/}]}}function AH(e){const t=e.regex,n=CH(e),i=zh,r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],a={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},o={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:r},contains:[n.exports.CLASS_REFERENCE]},u={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},d=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],h={$pattern:zh,keyword:QC.concat(d),literal:XC,built_in:nA.concat(r),"variable.language":tA},g={className:"meta",begin:"@"+i},p=(v,N,k)=>{const A=v.contains.findIndex(S=>S.label===N);if(A===-1)throw new Error("can not find mode to replace");v.contains.splice(A,1,k)};Object.assign(n.keywords,h),n.exports.PARAMS_CONTAINS.push(g);const y=n.contains.find(v=>v.scope==="attr"),b=Object.assign({},y,{match:t.concat(i,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,y,b]),n.contains=n.contains.concat([g,a,o,b]),p(n,"shebang",e.SHEBANG()),p(n,"use_strict",u);const w=n.contains.find(v=>v.label==="func.def");return w.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function TH(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}/,a=/\d{4}-\d{1,2}-\d{1,2}/,o=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,u=/\d{1,2}(:\d{1,2}){1,2}/,d={className:"literal",variants:[{begin:t.concat(/# */,t.either(a,r),/ *#/)},{begin:t.concat(/# */,u,/ *#/)},{begin:t.concat(/# */,o,/ *#/)},{begin:t.concat(/# */,t.either(a,r),/ +/,t.either(o,u),/ *#/)}]},h={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])|[%&])?/}]},g={className:"label",begin:/^\w+:/},p=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),y=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,d,h,g,p,y,{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:[y]}]}}function MH(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"}},a={className:"variable",begin:/\$[\w_]+/},o={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},u={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},d={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},h={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"}},a,o,r,e.QUOTE_STRING_MODE,d,h,u]}}function DH(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]+;/},a={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(a,{begin:/\(/,end:/\)/}),u=e.inherit(e.APOS_STRING_MODE,{className:"string"}),d=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),h={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:[a,d,u,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[a,o,d,u]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},r,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[d]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[h],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[h],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:h}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function OH(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:/\}/}]},a={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},o={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,r]},u=e.inherit(o,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),y={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"},b={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},w={begin:/\{/,end:/\}/,contains:[b],illegal:"\\n",relevance:0},v={begin:"\\[",end:"\\]",contains:[b],illegal:"\\n",relevance:0},N=[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}},y,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},w,v,a,o],k=[...N];return k.pop(),k.push(u),b.contains=k,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:N}}const RH={arduino:m7,bash:g7,c:y7,cpp:b7,csharp:x7,css:C7,diff:A7,go:T7,graphql:M7,ini:D7,java:O7,javascript:P7,json:B7,kotlin:U7,less:W7,lua:Q7,makefile:X7,markdown:Z7,objectivec:J7,perl:eH,php:tH,"php-template":nH,plaintext:iH,python:rH,"python-repl":sH,r:aH,ruby:lH,rust:oH,scss:yH,shell:bH,sql:xH,swift:jH,typescript:AH,vbnet:TH,wasm:MH,xml:DH,yaml:OH};var Ey,NS;function LH(){if(NS)return Ey;NS=1;function e(Z){return Z instanceof Map?Z.clear=Z.delete=Z.set=function(){throw new Error("map is read-only")}:Z instanceof Set&&(Z.add=Z.clear=Z.delete=function(){throw new Error("set is read-only")}),Object.freeze(Z),Object.getOwnPropertyNames(Z).forEach(be=>{const Re=Z[be],it=typeof Re;(it==="object"||it==="function")&&!Object.isFrozen(Re)&&e(Re)}),Z}class t{constructor(be){be.data===void 0&&(be.data={}),this.data=be.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function n(Z){return Z.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function i(Z,...be){const Re=Object.create(null);for(const it in Z)Re[it]=Z[it];return be.forEach(function(it){for(const qt in it)Re[qt]=it[qt]}),Re}const r="</span>",a=Z=>!!Z.scope,o=(Z,{prefix:be})=>{if(Z.startsWith("language:"))return Z.replace("language:","language-");if(Z.includes(".")){const Re=Z.split(".");return[`${be}${Re.shift()}`,...Re.map((it,qt)=>`${it}${"_".repeat(qt+1)}`)].join(" ")}return`${be}${Z}`};class u{constructor(be,Re){this.buffer="",this.classPrefix=Re.classPrefix,be.walk(this)}addText(be){this.buffer+=n(be)}openNode(be){if(!a(be))return;const Re=o(be.scope,{prefix:this.classPrefix});this.span(Re)}closeNode(be){a(be)&&(this.buffer+=r)}value(){return this.buffer}span(be){this.buffer+=`<span class="${be}">`}}const d=(Z={})=>{const be={children:[]};return Object.assign(be,Z),be};class h{constructor(){this.rootNode=d(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(be){this.top.children.push(be)}openNode(be){const Re=d({scope:be});this.add(Re),this.stack.push(Re)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(be){return this.constructor._walk(be,this.rootNode)}static _walk(be,Re){return typeof Re=="string"?be.addText(Re):Re.children&&(be.openNode(Re),Re.children.forEach(it=>this._walk(be,it)),be.closeNode(Re)),be}static _collapse(be){typeof be!="string"&&be.children&&(be.children.every(Re=>typeof Re=="string")?be.children=[be.children.join("")]:be.children.forEach(Re=>{h._collapse(Re)}))}}class g extends h{constructor(be){super(),this.options=be}addText(be){be!==""&&this.add(be)}startScope(be){this.openNode(be)}endScope(){this.closeNode()}__addSublanguage(be,Re){const it=be.root;Re&&(it.scope=`language:${Re}`),this.add(it)}toHTML(){return new u(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function p(Z){return Z?typeof Z=="string"?Z:Z.source:null}function y(Z){return v("(?=",Z,")")}function b(Z){return v("(?:",Z,")*")}function w(Z){return v("(?:",Z,")?")}function v(...Z){return Z.map(Re=>p(Re)).join("")}function N(Z){const be=Z[Z.length-1];return typeof be=="object"&&be.constructor===Object?(Z.splice(Z.length-1,1),be):{}}function k(...Z){return"("+(N(Z).capture?"":"?:")+Z.map(it=>p(it)).join("|")+")"}function A(Z){return new RegExp(Z.toString()+"|").exec("").length-1}function S(Z,be){const Re=Z&&Z.exec(be);return Re&&Re.index===0}const _=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function C(Z,{joinWith:be}){let Re=0;return Z.map(it=>{Re+=1;const qt=Re;let Ot=p(it),$e="";for(;Ot.length>0;){const Pe=_.exec(Ot);if(!Pe){$e+=Ot;break}$e+=Ot.substring(0,Pe.index),Ot=Ot.substring(Pe.index+Pe[0].length),Pe[0][0]==="\\"&&Pe[1]?$e+="\\"+String(Number(Pe[1])+qt):($e+=Pe[0],Pe[0]==="("&&Re++)}return $e}).map(it=>`(${it})`).join(be)}const T=/\b\B/,R="[a-zA-Z]\\w*",O="[a-zA-Z_]\\w*",B="\\b\\d+(\\.\\d+)?",P="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",F="\\b(0b[01]+)",U="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",V=(Z={})=>{const be=/^#![ ]*\//;return Z.binary&&(Z.begin=v(be,/.*\b/,Z.binary,/\b.*/)),i({scope:"meta",begin:be,end:/$/,relevance:0,"on:begin":(Re,it)=>{Re.index!==0&&it.ignoreMatch()}},Z)},M={begin:"\\\\[\\s\\S]",relevance:0},H={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[M]},$={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[M]},K={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},W=function(Z,be,Re={}){const it=i({scope:"comment",begin:Z,end:be,contains:[]},Re);it.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 qt=k("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 it.contains.push({begin:v(/[ ]+/,"(",qt,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),it},Y=W("//","$"),I=W("/\\*","\\*/"),L=W("#","$"),G={scope:"number",begin:B,relevance:0},z={scope:"number",begin:P,relevance:0},te={scope:"number",begin:F,relevance:0},me={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[M,{begin:/\[/,end:/\]/,relevance:0,contains:[M]}]},ye={scope:"title",begin:R,relevance:0},Se={scope:"title",begin:O,relevance:0},re={begin:"\\.\\s*"+O,relevance:0};var se=Object.freeze({__proto__:null,APOS_STRING_MODE:H,BACKSLASH_ESCAPE:M,BINARY_NUMBER_MODE:te,BINARY_NUMBER_RE:F,COMMENT:W,C_BLOCK_COMMENT_MODE:I,C_LINE_COMMENT_MODE:Y,C_NUMBER_MODE:z,C_NUMBER_RE:P,END_SAME_AS_BEGIN:function(Z){return Object.assign(Z,{"on:begin":(be,Re)=>{Re.data._beginMatch=be[1]},"on:end":(be,Re)=>{Re.data._beginMatch!==be[1]&&Re.ignoreMatch()}})},HASH_COMMENT_MODE:L,IDENT_RE:R,MATCH_NOTHING_RE:T,METHOD_GUARD:re,NUMBER_MODE:G,NUMBER_RE:B,PHRASAL_WORDS_MODE:K,QUOTE_STRING_MODE:$,REGEXP_MODE:me,RE_STARTERS_RE:U,SHEBANG:V,TITLE_MODE:ye,UNDERSCORE_IDENT_RE:O,UNDERSCORE_TITLE_MODE:Se});function J(Z,be){Z.input[Z.index-1]==="."&&be.ignoreMatch()}function ke(Z,be){Z.className!==void 0&&(Z.scope=Z.className,delete Z.className)}function le(Z,be){be&&Z.beginKeywords&&(Z.begin="\\b("+Z.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",Z.__beforeBegin=J,Z.keywords=Z.keywords||Z.beginKeywords,delete Z.beginKeywords,Z.relevance===void 0&&(Z.relevance=0))}function Ce(Z,be){Array.isArray(Z.illegal)&&(Z.illegal=k(...Z.illegal))}function Me(Z,be){if(Z.match){if(Z.begin||Z.end)throw new Error("begin & end are not supported with match");Z.begin=Z.match,delete Z.match}}function _e(Z,be){Z.relevance===void 0&&(Z.relevance=1)}const Qe=(Z,be)=>{if(!Z.beforeMatch)return;if(Z.starts)throw new Error("beforeMatch cannot be used with starts");const Re=Object.assign({},Z);Object.keys(Z).forEach(it=>{delete Z[it]}),Z.keywords=Re.keywords,Z.begin=v(Re.beforeMatch,y(Re.begin)),Z.starts={relevance:0,contains:[Object.assign(Re,{endsParent:!0})]},Z.relevance=0,delete Re.beforeMatch},Ue=["of","and","for","in","not","or","if","then","parent","list","value"],ue="keyword";function we(Z,be,Re=ue){const it=Object.create(null);return typeof Z=="string"?qt(Re,Z.split(" ")):Array.isArray(Z)?qt(Re,Z):Object.keys(Z).forEach(function(Ot){Object.assign(it,we(Z[Ot],be,Ot))}),it;function qt(Ot,$e){be&&($e=$e.map(Pe=>Pe.toLowerCase())),$e.forEach(function(Pe){const et=Pe.split("|");it[et[0]]=[Ot,xe(et[0],et[1])]})}}function xe(Z,be){return be?Number(be):pe(Z)?0:1}function pe(Z){return Ue.includes(Z.toLowerCase())}const Ne={},je=Z=>{console.error(Z)},He=(Z,...be)=>{console.log(`WARN: ${Z}`,...be)},ne=(Z,be)=>{Ne[`${Z}/${be}`]||(console.log(`Deprecated as of ${Z}. ${be}`),Ne[`${Z}/${be}`]=!0)},de=new Error;function Le(Z,be,{key:Re}){let it=0;const qt=Z[Re],Ot={},$e={};for(let Pe=1;Pe<=be.length;Pe++)$e[Pe+it]=qt[Pe],Ot[Pe+it]=!0,it+=A(be[Pe-1]);Z[Re]=$e,Z[Re]._emit=Ot,Z[Re]._multi=!0}function Ze(Z){if(Array.isArray(Z.begin)){if(Z.skip||Z.excludeBegin||Z.returnBegin)throw je("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),de;if(typeof Z.beginScope!="object"||Z.beginScope===null)throw je("beginScope must be object"),de;Le(Z,Z.begin,{key:"beginScope"}),Z.begin=C(Z.begin,{joinWith:""})}}function rt(Z){if(Array.isArray(Z.end)){if(Z.skip||Z.excludeEnd||Z.returnEnd)throw je("skip, excludeEnd, returnEnd not compatible with endScope: {}"),de;if(typeof Z.endScope!="object"||Z.endScope===null)throw je("endScope must be object"),de;Le(Z,Z.end,{key:"endScope"}),Z.end=C(Z.end,{joinWith:""})}}function At(Z){Z.scope&&typeof Z.scope=="object"&&Z.scope!==null&&(Z.beginScope=Z.scope,delete Z.scope)}function $n(Z){At(Z),typeof Z.beginScope=="string"&&(Z.beginScope={_wrap:Z.beginScope}),typeof Z.endScope=="string"&&(Z.endScope={_wrap:Z.endScope}),Ze(Z),rt(Z)}function fn(Z){function be($e,Pe){return new RegExp(p($e),"m"+(Z.case_insensitive?"i":"")+(Z.unicodeRegex?"u":"")+(Pe?"g":""))}class Re{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(Pe,et){et.position=this.position++,this.matchIndexes[this.matchAt]=et,this.regexes.push([et,Pe]),this.matchAt+=A(Pe)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const Pe=this.regexes.map(et=>et[1]);this.matcherRe=be(C(Pe,{joinWith:"|"}),!0),this.lastIndex=0}exec(Pe){this.matcherRe.lastIndex=this.lastIndex;const et=this.matcherRe.exec(Pe);if(!et)return null;const rn=et.findIndex((Yi,Es)=>Es>0&&Yi!==void 0),Vt=this.matchIndexes[rn];return et.splice(0,rn),Object.assign(et,Vt)}}class it{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(Pe){if(this.multiRegexes[Pe])return this.multiRegexes[Pe];const et=new Re;return this.rules.slice(Pe).forEach(([rn,Vt])=>et.addRule(rn,Vt)),et.compile(),this.multiRegexes[Pe]=et,et}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(Pe,et){this.rules.push([Pe,et]),et.type==="begin"&&this.count++}exec(Pe){const et=this.getMatcher(this.regexIndex);et.lastIndex=this.lastIndex;let rn=et.exec(Pe);if(this.resumingScanAtSamePosition()&&!(rn&&rn.index===this.lastIndex)){const Vt=this.getMatcher(0);Vt.lastIndex=this.lastIndex+1,rn=Vt.exec(Pe)}return rn&&(this.regexIndex+=rn.position+1,this.regexIndex===this.count&&this.considerAll()),rn}}function qt($e){const Pe=new it;return $e.contains.forEach(et=>Pe.addRule(et.begin,{rule:et,type:"begin"})),$e.terminatorEnd&&Pe.addRule($e.terminatorEnd,{type:"end"}),$e.illegal&&Pe.addRule($e.illegal,{type:"illegal"}),Pe}function Ot($e,Pe){const et=$e;if($e.isCompiled)return et;[ke,Me,$n,Qe].forEach(Vt=>Vt($e,Pe)),Z.compilerExtensions.forEach(Vt=>Vt($e,Pe)),$e.__beforeBegin=null,[le,Ce,_e].forEach(Vt=>Vt($e,Pe)),$e.isCompiled=!0;let rn=null;return typeof $e.keywords=="object"&&$e.keywords.$pattern&&($e.keywords=Object.assign({},$e.keywords),rn=$e.keywords.$pattern,delete $e.keywords.$pattern),rn=rn||/\w+/,$e.keywords&&($e.keywords=we($e.keywords,Z.case_insensitive)),et.keywordPatternRe=be(rn,!0),Pe&&($e.begin||($e.begin=/\B|\b/),et.beginRe=be(et.begin),!$e.end&&!$e.endsWithParent&&($e.end=/\B|\b/),$e.end&&(et.endRe=be(et.end)),et.terminatorEnd=p(et.end)||"",$e.endsWithParent&&Pe.terminatorEnd&&(et.terminatorEnd+=($e.end?"|":"")+Pe.terminatorEnd)),$e.illegal&&(et.illegalRe=be($e.illegal)),$e.contains||($e.contains=[]),$e.contains=[].concat(...$e.contains.map(function(Vt){return Wt(Vt==="self"?$e:Vt)})),$e.contains.forEach(function(Vt){Ot(Vt,et)}),$e.starts&&Ot($e.starts,Pe),et.matcher=qt(et),et}if(Z.compilerExtensions||(Z.compilerExtensions=[]),Z.contains&&Z.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return Z.classNameAliases=i(Z.classNameAliases||{}),Ot(Z)}function Mt(Z){return Z?Z.endsWithParent||Mt(Z.starts):!1}function Wt(Z){return Z.variants&&!Z.cachedVariants&&(Z.cachedVariants=Z.variants.map(function(be){return i(Z,{variants:null},be)})),Z.cachedVariants?Z.cachedVariants:Mt(Z)?i(Z,{starts:Z.starts?i(Z.starts):null}):Object.isFrozen(Z)?i(Z):Z}var yt="11.11.1";class Ai extends Error{constructor(be,Re){super(be),this.name="HTMLInjectionError",this.html=Re}}const Rn=n,_l=i,Br=Symbol("nomatch"),ks=7,$r=function(Z){const be=Object.create(null),Re=Object.create(null),it=[];let qt=!0;const Ot="Could not find the language '{}', did you forget to load/include a language module?",$e={disableAutodetect:!0,name:"Plain text",contains:[]};let Pe={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:g};function et(Ae){return Pe.noHighlightRe.test(Ae)}function rn(Ae){let Ge=Ae.className+" ";Ge+=Ae.parentNode?Ae.parentNode.className:"";const ht=Pe.languageDetectRe.exec(Ge);if(ht){const _t=Ln(ht[1]);return _t||(He(Ot.replace("{}",ht[1])),He("Falling back to no-highlight mode for this block.",Ae)),_t?ht[1]:"no-highlight"}return Ge.split(/\s+/).find(_t=>et(_t)||Ln(_t))}function Vt(Ae,Ge,ht){let _t="",an="";typeof Ge=="object"?(_t=Ae,ht=Ge.ignoreIllegals,an=Ge.language):(ne("10.7.0","highlight(lang, code, ...args) has been deprecated."),ne("10.7.0",`Please use highlight(code, options) instead.
|
|
780
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),an=Ae,_t=Ge),ht===void 0&&(ht=!0);const Mn={code:_t,language:an};Fr("before:highlight",Mn);const Wn=Mn.result?Mn.result:Yi(Mn.language,Mn.code,ht);return Wn.code=Mn.code,Fr("after:highlight",Wn),Wn}function Yi(Ae,Ge,ht,_t){const an=Object.create(null);function Mn(De,Fe){return De.keywords[Fe]}function Wn(){if(!nt.keywords){xn.addText(Rt);return}let De=0;nt.keywordPatternRe.lastIndex=0;let Fe=nt.keywordPatternRe.exec(Rt),lt="";for(;Fe;){lt+=Rt.substring(De,Fe.index);const bt=jn.case_insensitive?Fe[0].toLowerCase():Fe[0],ln=Mn(nt,bt);if(ln){const[Mi,uc]=ln;if(xn.addText(lt),lt="",an[bt]=(an[bt]||0)+1,an[bt]<=ks&&(Ts+=uc),Mi.startsWith("_"))lt+=Fe[0];else{const gd=jn.classNameAliases[Mi]||Mi;Qn(Fe[0],gd)}}else lt+=Fe[0];De=nt.keywordPatternRe.lastIndex,Fe=nt.keywordPatternRe.exec(Rt)}lt+=Rt.substring(De),xn.addText(lt)}function Fn(){if(Rt==="")return;let De=null;if(typeof nt.subLanguage=="string"){if(!be[nt.subLanguage]){xn.addText(Rt);return}De=Yi(nt.subLanguage,Rt,!0,md[nt.subLanguage]),md[nt.subLanguage]=De._top}else De=Ss(Rt,nt.subLanguage.length?nt.subLanguage:null);nt.relevance>0&&(Ts+=De.relevance),xn.__addSublanguage(De._emitter,De.language)}function It(){nt.subLanguage!=null?Fn():Wn(),Rt=""}function Qn(De,Fe){De!==""&&(xn.startScope(Fe),xn.addText(De),xn.endScope())}function Al(De,Fe){let lt=1;const bt=Fe.length-1;for(;lt<=bt;){if(!De._emit[lt]){lt++;continue}const ln=jn.classNameAliases[De[lt]]||De[lt],Mi=Fe[lt];ln?Qn(Mi,ln):(Rt=Mi,Wn(),Rt=""),lt++}}function js(De,Fe){return De.scope&&typeof De.scope=="string"&&xn.openNode(jn.classNameAliases[De.scope]||De.scope),De.beginScope&&(De.beginScope._wrap?(Qn(Rt,jn.classNameAliases[De.beginScope._wrap]||De.beginScope._wrap),Rt=""):De.beginScope._multi&&(Al(De.beginScope,Fe),Rt="")),nt=Object.create(De,{parent:{value:nt}}),nt}function vr(De,Fe,lt){let bt=S(De.endRe,lt);if(bt){if(De["on:end"]){const ln=new t(De);De["on:end"](Fe,ln),ln.isMatchIgnored&&(bt=!1)}if(bt){for(;De.endsParent&&De.parent;)De=De.parent;return De}}if(De.endsWithParent)return vr(De.parent,Fe,lt)}function Cs(De){return nt.matcher.regexIndex===0?(Rt+=De[0],1):(Ms=!0,0)}function Tl(De){const Fe=De[0],lt=De.rule,bt=new t(lt),ln=[lt.__beforeBegin,lt["on:begin"]];for(const Mi of ln)if(Mi&&(Mi(De,bt),bt.isMatchIgnored))return Cs(Fe);return lt.skip?Rt+=Fe:(lt.excludeBegin&&(Rt+=Fe),It(),!lt.returnBegin&&!lt.excludeBegin&&(Rt=Fe)),js(lt,De),lt.returnBegin?0:Fe.length}function qn(De){const Fe=De[0],lt=Ge.substring(De.index),bt=vr(nt,De,lt);if(!bt)return Br;const ln=nt;nt.endScope&&nt.endScope._wrap?(It(),Qn(Fe,nt.endScope._wrap)):nt.endScope&&nt.endScope._multi?(It(),Al(nt.endScope,De)):ln.skip?Rt+=Fe:(ln.returnEnd||ln.excludeEnd||(Rt+=Fe),It(),ln.excludeEnd&&(Rt=Fe));do nt.scope&&xn.closeNode(),!nt.skip&&!nt.subLanguage&&(Ts+=nt.relevance),nt=nt.parent;while(nt!==bt.parent);return bt.starts&&js(bt.starts,De),ln.returnEnd?0:Fe.length}function Ca(){const De=[];for(let Fe=nt;Fe!==jn;Fe=Fe.parent)Fe.scope&&De.unshift(Fe.scope);De.forEach(Fe=>xn.openNode(Fe))}let Ji={};function As(De,Fe){const lt=Fe&&Fe[0];if(Rt+=De,lt==null)return It(),0;if(Ji.type==="begin"&&Fe.type==="end"&&Ji.index===Fe.index&<===""){if(Rt+=Ge.slice(Fe.index,Fe.index+1),!qt){const bt=new Error(`0 width match regex (${Ae})`);throw bt.languageName=Ae,bt.badRule=Ji.rule,bt}return 1}if(Ji=Fe,Fe.type==="begin")return Tl(Fe);if(Fe.type==="illegal"&&!ht){const bt=new Error('Illegal lexeme "'+lt+'" for mode "'+(nt.scope||"<unnamed>")+'"');throw bt.mode=nt,bt}else if(Fe.type==="end"){const bt=qn(Fe);if(bt!==Br)return bt}if(Fe.type==="illegal"&<==="")return Rt+=`
|
|
781
|
+
`,1;if(cc>1e5&&cc>Fe.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Rt+=lt,lt.length}const jn=Ln(Ae);if(!jn)throw je(Ot.replace("{}",Ae)),new Error('Unknown language: "'+Ae+'"');const Aa=fn(jn);let Ml="",nt=_t||Aa;const md={},xn=new Pe.__emitter(Pe);Ca();let Rt="",Ts=0,qr=0,cc=0,Ms=!1;try{if(jn.__emitTokens)jn.__emitTokens(Ge,xn);else{for(nt.matcher.considerAll();;){cc++,Ms?Ms=!1:nt.matcher.considerAll(),nt.matcher.lastIndex=qr;const De=nt.matcher.exec(Ge);if(!De)break;const Fe=Ge.substring(qr,De.index),lt=As(Fe,De);qr=De.index+lt}As(Ge.substring(qr))}return xn.finalize(),Ml=xn.toHTML(),{language:Ae,value:Ml,relevance:Ts,illegal:!1,_emitter:xn,_top:nt}}catch(De){if(De.message&&De.message.includes("Illegal"))return{language:Ae,value:Rn(Ge),illegal:!0,relevance:0,_illegalBy:{message:De.message,index:qr,context:Ge.slice(qr-100,qr+100),mode:De.mode,resultSoFar:Ml},_emitter:xn};if(qt)return{language:Ae,value:Rn(Ge),illegal:!1,relevance:0,errorRaised:De,_emitter:xn,_top:nt};throw De}}function Es(Ae){const Ge={value:Rn(Ae),illegal:!1,relevance:0,_top:$e,_emitter:new Pe.__emitter(Pe)};return Ge._emitter.addText(Ae),Ge}function Ss(Ae,Ge){Ge=Ge||Pe.languages||Object.keys(be);const ht=Es(Ae),_t=Ge.filter(Ln).filter(Xi).map(It=>Yi(It,Ae,!1));_t.unshift(ht);const an=_t.sort((It,Qn)=>{if(It.relevance!==Qn.relevance)return Qn.relevance-It.relevance;if(It.language&&Qn.language){if(Ln(It.language).supersetOf===Qn.language)return 1;if(Ln(Qn.language).supersetOf===It.language)return-1}return 0}),[Mn,Wn]=an,Fn=Mn;return Fn.secondBest=Wn,Fn}function Ti(Ae,Ge,ht){const _t=Ge&&Re[Ge]||ht;Ae.classList.add("hljs"),Ae.classList.add(`language-${_t}`)}function sn(Ae){let Ge=null;const ht=rn(Ae);if(et(ht))return;if(Fr("before:highlightElement",{el:Ae,language:ht}),Ae.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",Ae);return}if(Ae.children.length>0&&(Pe.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(Ae)),Pe.throwUnescapedHTML))throw new Ai("One of your code blocks includes unescaped HTML.",Ae.innerHTML);Ge=Ae;const _t=Ge.textContent,an=ht?Vt(_t,{language:ht,ignoreIllegals:!0}):Ss(_t);Ae.innerHTML=an.value,Ae.dataset.highlighted="yes",Ti(Ae,ht,an.language),Ae.result={language:an.language,re:an.relevance,relevance:an.relevance},an.secondBest&&(Ae.secondBest={language:an.secondBest.language,relevance:an.secondBest.relevance}),Fr("after:highlightElement",{el:Ae,result:an,text:_t})}function Tn(Ae){Pe=_l(Pe,Ae)}const Wi=()=>{_s(),ne("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Ns(){_s(),ne("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let _a=!1;function _s(){function Ae(){_s()}if(document.readyState==="loading"){_a||window.addEventListener("DOMContentLoaded",Ae,!1),_a=!0;return}document.querySelectorAll(Pe.cssSelector).forEach(sn)}function jl(Ae,Ge){let ht=null;try{ht=Ge(Z)}catch(_t){if(je("Language definition for '{}' could not be registered.".replace("{}",Ae)),qt)je(_t);else throw _t;ht=$e}ht.name||(ht.name=Ae),be[Ae]=ht,ht.rawDefinition=Ge.bind(null,Z),ht.aliases&&Qi(ht.aliases,{languageName:Ae})}function Ur(Ae){delete be[Ae];for(const Ge of Object.keys(Re))Re[Ge]===Ae&&delete Re[Ge]}function ja(){return Object.keys(be)}function Ln(Ae){return Ae=(Ae||"").toLowerCase(),be[Ae]||be[Re[Ae]]}function Qi(Ae,{languageName:Ge}){typeof Ae=="string"&&(Ae=[Ae]),Ae.forEach(ht=>{Re[ht.toLowerCase()]=Ge})}function Xi(Ae){const Ge=Ln(Ae);return Ge&&!Ge.disableAutodetect}function xr(Ae){Ae["before:highlightBlock"]&&!Ae["before:highlightElement"]&&(Ae["before:highlightElement"]=Ge=>{Ae["before:highlightBlock"](Object.assign({block:Ge.el},Ge))}),Ae["after:highlightBlock"]&&!Ae["after:highlightElement"]&&(Ae["after:highlightElement"]=Ge=>{Ae["after:highlightBlock"](Object.assign({block:Ge.el},Ge))})}function hn(Ae){xr(Ae),it.push(Ae)}function Cl(Ae){const Ge=it.indexOf(Ae);Ge!==-1&&it.splice(Ge,1)}function Fr(Ae,Ge){const ht=Ae;it.forEach(function(_t){_t[ht]&&_t[ht](Ge)})}function Zi(Ae){return ne("10.7.0","highlightBlock will be removed entirely in v12.0"),ne("10.7.0","Please use highlightElement now."),sn(Ae)}Object.assign(Z,{highlight:Vt,highlightAuto:Ss,highlightAll:_s,highlightElement:sn,highlightBlock:Zi,configure:Tn,initHighlighting:Wi,initHighlightingOnLoad:Ns,registerLanguage:jl,unregisterLanguage:Ur,listLanguages:ja,getLanguage:Ln,registerAliases:Qi,autoDetection:Xi,inherit:_l,addPlugin:hn,removePlugin:Cl}),Z.debugMode=function(){qt=!1},Z.safeMode=function(){qt=!0},Z.versionString=yt,Z.regex={concat:v,lookahead:y,either:k,optional:w,anyNumberOfTimes:b};for(const Ae in se)typeof se[Ae]=="object"&&e(se[Ae]);return Object.assign(Z,se),Z},Un=$r({});return Un.newInstance=()=>$r({}),Ey=Un,Un.HighlightJS=Un,Un.default=Un,Ey}var zH=LH();const IH=Yu(zH),_S={},PH="hljs-";function BH(e){const t=IH.newInstance();return e&&a(e),{highlight:n,highlightAuto:i,listLanguages:r,register:a,registerAlias:o,registered:u};function n(d,h,g){const p=g||_S,y=typeof p.prefix=="string"?p.prefix:PH;if(!t.getLanguage(d))throw new Error("Unknown language: `"+d+"` is not registered");t.configure({__emitter:$H,classPrefix:y});const b=t.highlight(h,{ignoreIllegals:!0,language:d});if(b.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:b.errorRaised});const w=b._emitter.root,v=w.data;return v.language=b.language,v.relevance=b.relevance,w}function i(d,h){const p=(h||_S).subset||r();let y=-1,b=0,w;for(;++y<p.length;){const v=p[y];if(!t.getLanguage(v))continue;const N=n(v,d,h);N.data&&N.data.relevance!==void 0&&N.data.relevance>b&&(b=N.data.relevance,w=N)}return w||{type:"root",children:[],data:{language:void 0,relevance:b}}}function r(){return t.listLanguages()}function a(d,h){if(typeof d=="string")t.registerLanguage(d,h);else{let g;for(g in d)Object.hasOwn(d,g)&&t.registerLanguage(g,d[g])}}function o(d,h){if(typeof d=="string")t.registerAliases(typeof h=="string"?h:[...h],{languageName:d});else{let g;for(g in d)if(Object.hasOwn(d,g)){const p=d[g];t.registerAliases(typeof p=="string"?p:[...p],{languageName:g})}}}function u(d){return!!t.getLanguage(d)}}class $H{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(o,u){return u?o+"_".repeat(u):n.options.classPrefix+o}),r=this.stack[this.stack.length-1],a={type:"element",tagName:"span",properties:{className:i},children:[]};r.children.push(a),this.stack.push(a)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const UH={};function i0(e){const t=e||UH,n=t.aliases,i=t.detect||!1,r=t.languages||RH,a=t.plainText,o=t.prefix,u=t.subset;let d="hljs";const h=BH(r);if(n&&h.registerAlias(n),o){const g=o.indexOf("-");d=g===-1?o:o.slice(0,g)}return function(g,p){xp(g,"element",function(y,b,w){if(y.tagName!=="code"||!w||w.type!=="element"||w.tagName!=="pre")return;const v=FH(y);if(v===!1||!v&&!i||v&&a&&a.includes(v))return;Array.isArray(y.properties.className)||(y.properties.className=[]),y.properties.className.includes(d)||y.properties.className.unshift(d);const N=l7(y,{whitespace:"pre"});let k;try{k=v?h.highlight(v,N,{prefix:o}):h.highlightAuto(N,{prefix:o,subset:u})}catch(A){const S=A;if(v&&/Unknown language/.test(S.message)){p.message("Cannot highlight as `"+v+"`, it’s not registered",{ancestors:[w,y],cause:S,place:y.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw S}!v&&k.data&&k.data.language&&y.properties.className.push("language-"+k.data.language),k.children.length>0&&(y.children=k.children)})}}function FH(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}const Sy=e=>e instanceof Error?e.message:String(e),jS=e=>e.replace(/^---\n[\s\S]*?\n---\n?/,"");function qH({name:e,onClose:t}){const n=Ie(),i=Ft(),{data:r,isLoading:a,isError:o,error:u}=Ve({queryKey:["skill",e],queryFn:()=>n6(e)}),[d,h]=j.useState(!1),[g,p]=j.useState(""),[y,b]=j.useState(!1),[w,v]=j.useState(null),N=C=>{p(C),h(!0),b(!1),v(null)},k=Et({mutationFn:()=>r6(e,g),onSuccess:()=>{i.invalidateQueries({queryKey:["skill",e]}),i.invalidateQueries({queryKey:["skills"]}),h(!1)},onError:C=>v(n("skillDetail.saveFailed",{detail:Sy(C)}))}),A=Et({mutationFn:()=>a6(e),onSuccess:C=>N(C.content),onError:C=>v(n("skillDetail.translateFailed",{detail:Sy(C)}))}),S=Et({mutationFn:()=>s6(e),onSuccess:()=>{i.invalidateQueries({queryKey:["skills"]}),t()},onError:C=>v(n("skillDetail.deleteFailed",{detail:Sy(C)}))}),_=k.isPending||A.isPending||S.isPending;return j.useEffect(()=>{const C=T=>{T.key==="Escape"&&(d?h(!1):t())};return window.addEventListener("keydown",C),()=>window.removeEventListener("keydown",C)},[t,d]),c.jsx("div",{role:"dialog","aria-modal":"true",className:"fixed inset-0 z-40 flex items-start justify-center p-6 bg-black/30 overflow-auto",children:c.jsxs("div",{className:"nb-card mt-8 w-full max-w-4xl",children:[c.jsxs("header",{className:"flex items-start justify-between gap-4 mb-4",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-3xl font-bold",children:e}),r&&c.jsxs("p",{className:"text-sm text-[var(--color-text-muted)] mt-1",children:[r.category," · ",r.origin||"local"]})]}),c.jsxs("div",{className:"flex items-center gap-2 flex-wrap justify-end",children:[r&&!d&&c.jsxs(c.Fragment,{children:[c.jsxs("button",{onClick:()=>N(r.body),className:"nb-btn nb-btn-blue px-3 py-2 text-sm flex items-center gap-1.5",type:"button",disabled:_,children:[c.jsx(X2,{size:14,strokeWidth:2.5})," ",n("skillDetail.edit")]}),c.jsxs("button",{onClick:()=>A.mutate(),className:"nb-btn nb-btn-lilac px-3 py-2 text-sm flex items-center gap-1.5",type:"button",disabled:_,children:[c.jsx(qL,{size:14,strokeWidth:2.5})," ",A.isPending?n("skillDetail.translating"):n("skillDetail.translate")]}),c.jsxs("button",{onClick:()=>y?S.mutate():b(!0),className:`nb-btn px-3 py-2 text-sm flex items-center gap-1.5 ${y?"nb-btn-danger":""}`,type:"button",disabled:_,children:[c.jsx(Ki,{size:14,strokeWidth:2.5})," ",y?n("skillDetail.deleteConfirm",{name:e}):n("skillDetail.delete")]})]}),d&&c.jsxs(c.Fragment,{children:[c.jsxs("button",{onClick:()=>k.mutate(),className:"nb-btn nb-btn-mint px-3 py-2 text-sm flex items-center gap-1.5",type:"button",disabled:_,children:[c.jsx(mr,{size:14,strokeWidth:2.5})," ",k.isPending?n("skillDetail.saving"):n("skillDetail.save")]}),c.jsx("button",{onClick:()=>h(!1),className:"nb-btn px-3 py-2 text-sm",type:"button",disabled:_,children:n("skillDetail.cancel")})]}),c.jsx("button",{onClick:t,className:"nb-btn nb-btn-mint p-2","aria-label":n("skillDetail.close.aria"),type:"button",children:c.jsx(Jt,{size:16,strokeWidth:3})})]})]}),w&&c.jsx("p",{className:"text-sm text-[var(--color-crashed)] mb-3",children:w}),a&&c.jsx("p",{children:n("skillDetail.loading")}),o&&c.jsx("p",{className:"text-[var(--color-crashed)]",children:n("skillDetail.error.load",{detail:u instanceof Error?u.message:String(u)})}),r&&c.jsxs("div",{className:"flex flex-col gap-4",children:[!d&&(r.description||r.tags.length>0)&&c.jsxs("div",{className:"flex flex-col gap-2 rounded-lg border-2 border-[var(--color-text)] bg-[var(--color-bg-cream)] p-3",children:[r.description&&c.jsx("p",{className:"text-sm leading-6",children:r.description}),r.tags.length>0&&c.jsx("div",{className:"flex flex-wrap gap-1.5",children:r.tags.map(C=>c.jsx("span",{className:"text-xs font-[family-name:var(--font-mono)] px-2 py-0.5 rounded-full bg-[var(--color-bg)] border border-[var(--color-text)]",children:C},C))})]}),c.jsxs("div",{children:[c.jsx("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold mb-2 uppercase tracking-wider",children:n("skillDetail.section.preview")}),d?c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:n("skillDetail.editHint")}),c.jsx("textarea",{value:g,onChange:C=>p(C.target.value),spellCheck:!1,className:"w-full h-96 rounded-lg border-2 border-[var(--color-text)] bg-surface-input p-4 text-sm font-[family-name:var(--font-mono)] resize-y"})]}):c.jsx("div",{className:"scroll-frame max-h-80 rounded-lg border-2 border-[var(--color-text)] bg-surface-input",children:c.jsx("div",{className:"scroll-frame-body prose-chat max-h-80 p-4 text-sm",children:jS(r.body).trim()?c.jsx(Qx,{remarkPlugins:[e0],rehypePlugins:[i0],children:jS(r.body)}):c.jsx("p",{className:"text-[var(--color-text-muted)] italic",children:"(empty)"})})})]}),r.references.length>0&&c.jsxs("div",{children:[c.jsx("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold mb-2 uppercase tracking-wider",children:"References"}),c.jsx("ul",{className:"flex flex-col gap-2",children:r.references.map(C=>c.jsx(HH,{skillName:e,file:C.name,lines:C.lines},C.name))})]})]})]})})}function HH({skillName:e,file:t,lines:n}){const i=Ie(),[r,a]=j.useState(!1),{data:o,isLoading:u,isError:d,error:h}=Ve({queryKey:["skill-ref",e,t],queryFn:()=>i6(e,t),enabled:r,staleTime:1/0});return c.jsxs("li",{className:"border-2 border-[var(--color-text)] rounded-lg overflow-hidden bg-[var(--color-bg-cream)]",children:[c.jsxs("button",{type:"button",onClick:()=>a(g=>!g),"aria-label":i("skillDetail.toggleSection.aria",{action:i(r?"skillDetail.collapse":"skillDetail.expand"),file:t}),"aria-expanded":r,className:"w-full flex items-center gap-2 px-3 py-2 text-sm font-[family-name:var(--font-mono)] hover:bg-[var(--color-accent-yellow)] transition-colors",children:[c.jsx(Jo,{size:12,strokeWidth:3,className:["transition-transform",r?"rotate-90":""].join(" ")}),c.jsx(ed,{size:12,strokeWidth:2.5}),c.jsx("span",{className:"flex-1 text-left font-bold",children:t}),c.jsxs("span",{className:"text-xs text-[var(--color-text-subtle)]",children:[n," lines"]})]}),r&&c.jsxs("div",{className:"px-4 py-3 border-t-2 border-[var(--color-text)] bg-[var(--color-bg)] max-h-96 overflow-auto",children:[u&&c.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:i("skillDetail.loading")}),d&&c.jsx("p",{className:"text-xs text-[var(--color-crashed)]",children:i("skillDetail.error.load",{detail:h instanceof Error?h.message:String(h)})}),o&&c.jsx("div",{className:"prose-chat text-sm",children:c.jsx(Qx,{remarkPlugins:[e0],rehypePlugins:[i0],children:o.content})})]})]})}function KH({onClose:e}){const t=Ie(),n=Ft(),{alert:i}=dn(),[r,a]=j.useState(""),[o,u]=j.useState(""),d=/^[a-z0-9][a-z0-9-]*$/.test(r),h=Et({mutationFn:()=>f6(r,{"SKILL.md":o}),onSuccess:()=>{n.invalidateQueries({queryKey:["skills"]}),n.invalidateQueries({queryKey:["skill-updates"]}),e()},onError:g=>void i({title:t("skills.import.error"),body:g instanceof Error?g.message:String(g)})});return c.jsx("div",{className:"fixed inset-0 z-50 flex items-start justify-center bg-black/30 p-4",onClick:e,children:c.jsxs("div",{className:"nb-card mt-16 w-full max-w-xl flex flex-col gap-3",onClick:g=>g.stopPropagation(),children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-lg font-bold",children:t("skills.import.title")}),c.jsx("button",{type:"button",className:"nb-btn p-2",onClick:e,"aria-label":"close",children:c.jsx(Jt,{size:14,strokeWidth:3})})]}),c.jsxs("label",{className:"flex flex-col gap-1",children:[c.jsx("span",{className:"text-sm font-bold",children:t("skills.import.name")}),c.jsx("input",{className:"nb-input w-full",value:r,onChange:g=>a(g.target.value),placeholder:"code-review","aria-label":t("skills.import.name")})]}),c.jsxs("label",{className:"flex flex-col gap-1",children:[c.jsx("span",{className:"text-sm font-bold",children:t("skills.import.body")}),c.jsx("textarea",{className:"nb-input w-full font-[family-name:var(--font-mono)] text-sm",rows:12,value:o,onChange:g=>u(g.target.value),placeholder:`---
|
|
782
|
+
name: code-review
|
|
783
|
+
description: ...
|
|
784
|
+
---
|
|
785
|
+
|
|
786
|
+
# ...`,"aria-label":t("skills.import.body")})]}),c.jsxs("button",{type:"button",className:"nb-btn nb-btn-mint self-start",disabled:h.isPending||!d||!o.trim(),onClick:()=>h.mutate(),children:[h.isPending?c.jsx(Xe,{size:14,className:"animate-spin"}):c.jsx(i_,{size:14,strokeWidth:3}),t("skills.import.submit")]})]})})}function GH({onClose:e,onSubmit:t}){const n=Ie(),[i,r]=j.useState(""),[a,o]=j.useState(""),u=/^[a-z0-9][a-z0-9-]*$/.test(i);return c.jsx("div",{className:"fixed inset-0 z-50 flex items-start justify-center bg-black/30 p-4 overflow-auto",children:c.jsx("div",{className:"w-full max-w-xl my-8",children:c.jsxs("div",{className:"nb-card flex flex-col gap-3",children:[c.jsxs("div",{className:"flex items-center justify-between shrink-0",children:[c.jsxs("h2",{className:"font-[family-name:var(--font-heading)] text-lg font-bold flex items-center gap-2",children:[c.jsx(hl,{size:16,strokeWidth:2.5}),n("skills.ai.title")]}),c.jsx("button",{type:"button",className:"nb-btn p-2",onClick:e,"aria-label":"close",children:c.jsx(Jt,{size:14,strokeWidth:3})})]}),c.jsxs("label",{className:"flex flex-col gap-1",children:[c.jsx("span",{className:"text-sm font-bold",children:n("skills.ai.name")}),c.jsx("input",{type:"text",value:i,onChange:d=>r(d.target.value),placeholder:"rust-error-handling",className:"nb-input w-full font-[family-name:var(--font-mono)]","aria-label":n("skills.ai.name")})]}),c.jsxs("label",{className:"flex flex-col gap-1",children:[c.jsx("span",{className:"text-sm font-bold",children:n("skills.ai.intent")}),c.jsx("textarea",{value:a,onChange:d=>o(d.target.value),placeholder:n("skills.ai.placeholder"),rows:5,className:"nb-input w-full text-sm","aria-label":n("skills.ai.intent")})]}),c.jsxs("button",{type:"button",className:"nb-btn nb-btn-mint self-start",disabled:!u||!a.trim(),onClick:()=>t(i,a),children:[c.jsx(hl,{size:14,strokeWidth:2.5}),n("skills.ai.submit")]})]})})})}async function VH(e){const{files:t}=await h6(e),n=t["SKILL.md"]??"",i=new Blob([n],{type:"text/markdown"}),r=URL.createObjectURL(i),a=document.createElement("a");a.href=r,a.download=`${e}.SKILL.md`,a.click(),URL.revokeObjectURL(r)}const YH=[{value:"all",labelKey:"skills.category.all"},{value:"language",labelKey:"skills.category.language"},{value:"domain",labelKey:"skills.category.domain"},{value:"persona",labelKey:"skills.category.persona"},{value:"workflow",labelKey:"skills.category.workflow"},{value:"engine",labelKey:"skills.category.engine"},{value:"genre",labelKey:"skills.category.genre"},{value:"platform",labelKey:"skills.category.platform"},{value:"review",labelKey:"skills.category.review"},{value:"meta",labelKey:"skills.category.meta"},{value:"other",labelKey:"skills.category.other"}],WH={language:"var(--color-accent-purple)",domain:"var(--color-secondary)",persona:"var(--color-primary)",workflow:"var(--color-accent-mint)",engine:"var(--color-accent-yellow)",genre:"var(--color-accent-pink)",platform:"var(--color-secondary-dark)",review:"var(--color-primary-dark)",meta:"var(--color-bg-cream)",other:"var(--color-bg-cream)"};function QH(){var U,V;const e=Ie(),[t,n]=j.useState("all"),[i,r]=j.useState([]),[a,o]=j.useState(""),[u,d]=j.useState(null),[h,g]=j.useState(!1),[p,y]=j.useState(!1),b=Ft(),v=(((U=Ve({queryKey:["gen-jobs"],queryFn:Mj,refetchInterval:3e3}).data)==null?void 0:U.data)??[]).filter(M=>M.kind==="skill"),N=v.filter(M=>M.status!=="done"),k=j.useRef(new Set);j.useEffect(()=>{for(const M of v)(M.status==="done"||M.status==="error")&&!k.current.has(M.id)&&(k.current.add(M.id),b.invalidateQueries({queryKey:["skills"]}),b.invalidateQueries({queryKey:["skill-updates"]}))},[v,b]);const A=(M,H)=>{p6(M,H).then(()=>b.invalidateQueries({queryKey:["gen-jobs"]})).catch(()=>{})},_=(((V=Ve({queryKey:["skill-updates"],queryFn:d6}).data)==null?void 0:V.data)??[]).filter(M=>M.status!=="same").length,{data:C,isLoading:T}=Ve({queryKey:["skills"],queryFn:()=>Ax()}),R=Ve({queryKey:["projects"],queryFn:Ea}),O=j.useMemo(()=>((C==null?void 0:C.data)??[]).filter(H=>!(t!=="all"&&H.category!==t||i.length>0&&!H.tags.some($=>i.includes($))||a&&!H.name.toLowerCase().includes(a.toLowerCase()))),[C,t,i,a]),B=j.useMemo(()=>{const M=(C==null?void 0:C.data)??[],H={all:M.length};for(const $ of M)H[$.category]=(H[$.category]??0)+1;return H},[C]),P=j.useMemo(()=>{const M=new Map;for(const H of(C==null?void 0:C.data)??[])for(const $ of H.tags)M.set($,(M.get($)??0)+1);return[...M.entries()].sort((H,$)=>$[1]-H[1]||H[0].localeCompare($[0]))},[C]),F=M=>r(H=>H.includes(M)?H.filter($=>$!==M):[...H,M]);return c.jsxs("div",{className:"flex flex-col gap-4 max-w-full",children:[c.jsxs("header",{className:"flex items-center justify-between flex-wrap gap-3",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-4xl font-bold",children:"Skills"}),c.jsx("p",{className:"text-sm text-[var(--color-text-muted)] mt-1",children:T?e("common.loading"):e("skills.subtitleCount",{count:(C==null?void 0:C.data.length)??0})})]}),c.jsxs("div",{className:"flex gap-3 items-center",children:[_>0&&c.jsx("span",{className:"nb-badge text-[10px]",title:e("skills.updates.badge",{count:String(_)}),children:e("skills.updates.badge",{count:String(_)})}),c.jsxs("button",{className:"nb-btn",onClick:()=>y(!0),type:"button",children:[c.jsx(hl,{size:14,strokeWidth:2.5}),e("skills.ai")]}),c.jsxs("button",{className:"nb-btn",onClick:()=>g(!0),type:"button",children:[c.jsx(i_,{size:14,strokeWidth:2.5}),e("skills.import")]}),c.jsxs("button",{className:"nb-btn nb-btn-mint",onClick:async()=>{await o6(),b.invalidateQueries({queryKey:["skills"]}),b.invalidateQueries({queryKey:["skill-updates"]})},type:"button",children:[c.jsx(bs,{size:14,strokeWidth:2.5}),"Sync bundled"]})]})]}),c.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[c.jsxs("div",{className:"relative flex-1 max-w-md",children:[c.jsx(fl,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-[var(--color-text-subtle)]"}),c.jsx("input",{className:"nb-input pl-9 w-full",placeholder:e("skills.search.placeholder"),value:a,onChange:M=>o(M.target.value),"aria-label":e("skills.search.aria")})]}),c.jsx("div",{className:"flex flex-wrap gap-1 p-1 bg-[var(--color-bg)] border-[2px] border-[var(--color-text)] rounded-2xl shadow-[2px_2px_0_var(--color-text)]",children:YH.filter(M=>M.value==="all"||(B[M.value]??0)>0).map(M=>c.jsxs("button",{type:"button",onClick:()=>n(M.value),className:["px-3 py-1 rounded-full text-xs font-bold font-[family-name:var(--font-body)]",t===M.value?"bg-[var(--color-text)] text-[var(--color-bg)]":"text-[var(--color-text-muted)] hover:text-[var(--color-text)]"].join(" "),children:[e(M.labelKey)," ",B[M.value]??0]},M.value))})]}),P.length>0&&c.jsxs("div",{className:"flex items-start gap-2 flex-wrap",children:[c.jsx("span",{className:"text-xs font-bold text-[var(--color-text-muted)] pt-1.5 uppercase tracking-wider",children:e("skills.tags.title")}),c.jsxs("div",{className:"flex flex-wrap gap-1.5 flex-1",children:[P.map(([M,H])=>{const $=i.includes(M);return c.jsxs("button",{type:"button",onClick:()=>F(M),className:["px-2.5 py-1 rounded-full text-xs font-[family-name:var(--font-mono)] border-2 border-[var(--color-text)] transition-colors",$?"bg-[var(--color-text)] text-[var(--color-bg)] font-bold":"bg-[var(--color-bg)] text-[var(--color-text-muted)] hover:bg-[var(--color-accent-yellow)]"].join(" "),children:[M," ",c.jsx("span",{className:"opacity-60",children:H})]},M)}),i.length>0&&c.jsx("button",{type:"button",onClick:()=>r([]),className:"px-2.5 py-1 rounded-full text-xs font-bold text-[var(--color-crashed)] hover:underline",children:e("skills.tags.clear")})]})]}),c.jsxs("div",{className:"grid gap-4 grid-cols-[repeat(auto-fill,minmax(280px,1fr))]",children:[N.map(M=>c.jsxs("div",{className:`nb-card flex items-center gap-2 ${M.status==="error"?"bg-[var(--color-crashed-bg)]":"opacity-70"}`,children:[M.status==="running"?c.jsx(Xe,{size:14,className:"animate-spin"}):c.jsx(Jt,{size:14,strokeWidth:3}),c.jsx("span",{className:"text-sm text-[var(--color-text-muted)] truncate",children:M.status==="running"?`${M.label} · ${e("skills.ai.wait")}`:`${M.label}: ${M.error??e("skills.ai.error")}`})]},M.id)),O.map(M=>{var H;return c.jsx(XH,{skill:M,projectCount:((H=R.data)==null?void 0:H.data.length)??0,onOpen:()=>d(M.name),onExport:()=>void VH(M.name)},M.name)})]}),u&&c.jsx(qH,{name:u,onClose:()=>d(null)}),h&&c.jsx(KH,{onClose:()=>g(!1)}),p&&c.jsx(GH,{onClose:()=>y(!1),onSubmit:(M,H)=>{A(M,H),y(!1)}})]})}function XH({skill:e,projectCount:t,onOpen:n,onExport:i}){const r=Ie(),a=WH[e.category];return c.jsxs("article",{onClick:n,onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),n())},tabIndex:0,role:"button","aria-label":`Open ${e.name}`,className:"nb-card nb-card-interactive flex flex-col gap-3",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("h3",{className:"font-[family-name:var(--font-heading)] font-bold text-lg",children:e.name}),c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx("button",{type:"button",className:"nb-btn p-1",onClick:o=>{o.stopPropagation(),i()},"aria-label":r("skills.export"),title:r("skills.export"),children:c.jsx(Zh,{size:12,strokeWidth:2.5})}),c.jsx("span",{className:"nb-badge text-[10px]",style:{background:a},children:e.category})]})]}),c.jsx("p",{className:"text-sm text-[var(--color-text-muted)] leading-5 line-clamp-3",children:e.description||"(no description)"}),e.tags.length>0&&c.jsx("div",{className:"flex flex-wrap gap-1",children:e.tags.map(o=>c.jsx("span",{className:"text-[10px] font-[family-name:var(--font-mono)] px-1.5 py-0.5 rounded-full bg-[var(--color-bg-cream)] border border-[var(--color-text)]",children:o},o))}),c.jsxs("div",{className:"flex items-center justify-between text-xs font-[family-name:var(--font-mono)] pt-2 border-t-[1.5px] border-dashed border-[var(--color-border-light)] mt-auto",children:[c.jsx("span",{className:"font-bold",children:e.linkedProjects.length>0?`● linked in ${e.linkedProjects.length}`:"○ not linked"}),c.jsxs("span",{className:"text-[var(--color-text-subtle)]",children:[t," projects"]})]})]})}function iA(e){const t=e?`?q=${encodeURIComponent(e)}`:"";return ct(`/api/prompts${t}`)}function r0(e){return ct(`/api/prompts/${encodeURIComponent(e)}`)}function ZH(e){return gr("/api/prompts",e)}function JH(e,t){return ux(`/api/prompts/${encodeURIComponent(e)}`,t)}function eK(e){return d_(`/api/prompts/${encodeURIComponent(e)}`)}function tK(e){return gr("/api/prompts/generate",{intent:e})}function rA(e){const t=new Set,n=[];for(const i of e.matchAll(/\{\{\s*([a-zA-Z_][a-zA-Z0-9_]*)\s*\}\}/g)){const r=i[1];r&&!t.has(r)&&(t.add(r),n.push(r))}return n}function nK(){var T,R;const e=Ie(),[t,n]=fx("prompts.last",""),[i,r]=j.useState(null),[a,o]=j.useState(!1),[u,d]=j.useState(""),[h,g]=j.useState(new Set),p=Ft(),y=Ve({queryKey:["prompts"],queryFn:()=>iA()}),b=((T=y.data)==null?void 0:T.data)??[],w=j.useMemo(()=>[...new Set(b.flatMap(O=>O.tags))].sort(),[b]),N=(((R=Ve({queryKey:["gen-jobs"],queryFn:Mj,refetchInterval:3e3}).data)==null?void 0:R.data)??[]).filter(O=>O.kind==="prompt"),k=N.filter(O=>O.status!=="done"),A=j.useRef(new Set);j.useEffect(()=>{for(const O of N)(O.status==="done"||O.status==="error")&&!A.current.has(O.id)&&(A.current.add(O.id),p.invalidateQueries({queryKey:["prompts"]}),O.status==="done"&&O.result&&n(O.result))},[N,p,n]);const S=O=>{tK(O).then(()=>p.invalidateQueries({queryKey:["gen-jobs"]})).catch(()=>{})},_=j.useMemo(()=>{const O=u.trim().toLowerCase();return b.filter(B=>!(h.size&&![...h].every(P=>B.tags.includes(P))||O&&!(B.name.toLowerCase().includes(O)||B.description.toLowerCase().includes(O)||B.tags.some(F=>F.toLowerCase().includes(O)))))},[b,h,u]);j.useEffect(()=>{t&&b.length&&!b.some(O=>O.name===t)&&n("")},[t,b,n]);const C=O=>g(B=>{const P=new Set(B);return P.has(O)?P.delete(O):P.add(O),P});return c.jsxs("div",{className:"flex flex-col flex-1 min-h-0 w-full gap-3",children:[c.jsxs("div",{className:"shrink-0 flex items-center justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-3xl font-bold",children:e("prompts.title")}),c.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:e("prompts.desc")})]}),c.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[c.jsxs("button",{className:"nb-btn",type:"button",onClick:()=>o(!0),children:[c.jsx(hl,{size:14,strokeWidth:2.5}),e("prompts.ai")]}),c.jsxs("button",{className:"nb-btn nb-btn-mint",type:"button",onClick:()=>r({mode:"new"}),children:[c.jsx(pi,{size:14,strokeWidth:3}),e("prompts.new")]})]})]}),c.jsxs("div",{className:"shrink-0 flex flex-col gap-2",children:[c.jsxs("label",{className:"nb-input flex items-center gap-2 w-full",style:{padding:"6px 10px"},children:[c.jsx(fl,{size:14}),c.jsx("input",{type:"text",value:u,onChange:O=>d(O.target.value),placeholder:e("prompts.search"),className:"bg-transparent outline-none flex-1 text-sm","aria-label":e("prompts.search")})]}),w.length>0&&c.jsx("div",{className:"flex flex-wrap gap-1.5",children:w.map(O=>c.jsx("button",{type:"button",onClick:()=>C(O),className:`text-xs border-2 border-[var(--color-text)] rounded-full px-2 py-0.5 ${h.has(O)?"bg-[var(--color-accent-mint)] font-bold":""}`,children:O},O))})]}),c.jsxs("div",{className:"flex gap-5 flex-1 min-h-0",children:[c.jsxs("aside",{className:"w-80 shrink-0 min-h-0 overflow-y-auto flex flex-col gap-2 pr-1",children:[k.map(O=>c.jsxs("div",{className:`nb-card flex items-center gap-2 ${O.status==="error"?"bg-[var(--color-crashed-bg)]":"opacity-70"}`,style:{padding:"8px 10px"},children:[O.status==="running"?c.jsx(Xe,{size:12,className:"animate-spin"}):c.jsx(Jt,{size:12,strokeWidth:3}),c.jsx("span",{className:"text-xs text-[var(--color-text-muted)] truncate",children:O.status==="running"?e("prompts.ai.wait"):`${e("prompts.ai.error")}: ${O.error??""}`})]},O.id)),y.isLoading?c.jsx("div",{className:"nb-card",children:c.jsx(Xe,{size:14,className:"animate-spin"})}):_.length===0?c.jsx("div",{className:"nb-card",children:c.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:e("prompts.empty")})}):_.map(O=>c.jsxs("button",{type:"button",onClick:()=>n(O.name),className:`nb-card w-full text-left ${t===O.name?"bg-[var(--color-accent-mint)]":""}`,style:{padding:"8px 10px"},children:[c.jsxs("span",{className:"flex items-center gap-1.5",children:[O.favorite&&c.jsx(t_,{size:12,fill:"currentColor"}),c.jsx("code",{className:"font-[family-name:var(--font-mono)] text-sm font-bold truncate",children:O.name})]}),O.description&&c.jsx("span",{className:"block text-xs text-[var(--color-text-muted)] truncate",children:O.description})]},O.name))]}),c.jsx("div",{className:"flex-1 min-w-0 min-h-0",children:t?c.jsx(rK,{name:t,onEdit:()=>r({mode:"edit",name:t}),onDeleted:()=>n("")},t):c.jsx("div",{className:"nb-card",children:c.jsx("p",{className:"text-[var(--color-text-muted)]",children:e("prompts.selectHint")})})})]}),i&&c.jsx(aK,{name:i.mode==="edit"?i.name:null,onClose:()=>r(null),onSaved:O=>{r(null),n(O)}}),a&&c.jsx(iK,{onClose:()=>o(!1),onSubmit:O=>{S(O),o(!1)}})]})}function iK({onClose:e,onSubmit:t}){const n=Ie(),[i,r]=j.useState("");return c.jsx("div",{className:"fixed inset-0 z-50 flex items-start justify-center bg-black/30 p-4 overflow-auto",children:c.jsx("div",{className:"w-full max-w-xl my-8",children:c.jsxs("div",{className:"nb-card flex flex-col gap-3",children:[c.jsxs("div",{className:"flex items-center justify-between shrink-0",children:[c.jsxs("h2",{className:"font-[family-name:var(--font-heading)] text-lg font-bold flex items-center gap-2",children:[c.jsx(hl,{size:16,strokeWidth:2.5}),n("prompts.ai.title")]}),c.jsx("button",{type:"button",className:"nb-btn p-2",onClick:e,"aria-label":"close",children:c.jsx(Jt,{size:14,strokeWidth:3})})]}),c.jsxs("label",{className:"flex flex-col gap-1",children:[c.jsx("span",{className:"text-sm font-bold",children:n("prompts.ai.intent")}),c.jsx("textarea",{value:i,onChange:a=>r(a.target.value),placeholder:n("prompts.ai.placeholder"),rows:5,className:"nb-input w-full text-sm","aria-label":n("prompts.ai.intent")})]}),c.jsxs("button",{type:"button",className:"nb-btn nb-btn-mint self-start",disabled:!i.trim(),onClick:()=>t(i),children:[c.jsx(hl,{size:14,strokeWidth:2.5}),n("prompts.ai.submit")]})]})})})}function rK({name:e,onEdit:t,onDeleted:n}){const i=Ie(),r=Ft(),{confirm:a}=dn(),o=Ve({queryKey:["prompt",e],queryFn:()=>r0(e)}),u=Et({mutationFn:()=>eK(e),onSuccess:()=>{r.invalidateQueries({queryKey:["prompts"]}),n()}});if(o.isLoading)return c.jsx("div",{className:"nb-card",children:c.jsx(Xe,{size:14,className:"animate-spin"})});const d=o.data;if(!d)return null;const h=rA(d.body);return c.jsxs("div",{className:"nb-card flex flex-col gap-3 h-full min-h-0",children:[c.jsxs("div",{className:"flex items-start justify-between gap-3 shrink-0",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsxs("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold flex items-center gap-2",children:[d.favorite&&c.jsx(t_,{size:16,fill:"currentColor"}),c.jsx("code",{className:"font-[family-name:var(--font-mono)] truncate",children:d.name})]}),d.description&&c.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:d.description})]}),c.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[c.jsxs("button",{type:"button",className:"nb-btn nb-btn-mint",onClick:t,children:[c.jsx(Jh,{size:14,strokeWidth:3}),i("common.edit")]}),c.jsx("button",{type:"button",className:"nb-btn",disabled:u.isPending,onClick:async()=>{await a({title:i("prompts.delete"),body:i("prompts.deleteConfirm",{name:e})})&&u.mutate()},"aria-label":i("prompts.delete"),children:c.jsx(Ki,{size:14,strokeWidth:3})})]})]}),d.tags.length>0&&c.jsx("div",{className:"flex flex-wrap gap-1.5 shrink-0",children:d.tags.map(g=>c.jsx("span",{className:"text-xs border-2 border-[var(--color-text)] rounded-full px-2 py-0.5",children:g},g))}),c.jsx("pre",{className:"flex-1 bg-surface-input min-h-0 overflow-auto text-sm font-[family-name:var(--font-mono)] whitespace-pre-wrap break-words bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded p-3",children:d.body}),c.jsx("span",{className:"text-xs text-[var(--color-text-muted)] shrink-0",children:h.length?i("prompts.vars",{names:h.join(", ")}):i("prompts.noVars")})]})}function sK({tags:e,onChange:t}){const n=Ie(),[i,r]=j.useState(""),a=()=>{const o=i.trim();o&&!e.includes(o)&&t([...e,o]),r("")};return c.jsxs("div",{className:"nb-input w-full flex flex-wrap gap-1.5 items-center",children:[e.map(o=>c.jsxs("span",{className:"inline-flex items-center gap-1 text-xs bg-[var(--color-accent-mint)] border-2 border-[var(--color-text)] rounded px-1.5 py-0.5",children:[o,c.jsx("button",{type:"button",onClick:()=>t(e.filter(u=>u!==o)),"aria-label":`remove ${o}`,children:c.jsx(Jt,{size:10,strokeWidth:3})})]},o)),c.jsx("input",{className:"flex-1 min-w-[90px] bg-transparent outline-none text-sm",value:i,onChange:o=>r(o.target.value),onKeyDown:o=>{o.key==="Enter"?(o.preventDefault(),a()):o.key==="Backspace"&&!i&&e.length&&t(e.slice(0,-1))},placeholder:e.length?"":n("prompts.tagAdd"),"aria-label":n("prompts.tags")})]})}function aK({name:e,onClose:t,onSaved:n}){const i=Ie(),r=Ft(),{alert:a}=dn(),o=e===null,u=Ve({queryKey:["prompt",e],queryFn:()=>r0(e),enabled:!o}),[d,h]=j.useState(o?{name:"",description:"",tags:[],body:"",favorite:!1}:null);j.useEffect(()=>{if(!o&&u.data&&d===null){const b=u.data;h({name:b.name,description:b.description,tags:b.tags,body:b.body,favorite:b.favorite})}},[o,u.data,d]);const g=Et({mutationFn:()=>{if(!d)throw new Error("no form");const b={description:d.description||void 0,tags:d.tags,favorite:d.favorite,body:d.body};return o?ZH({name:d.name,...b}):JH(e,b)},onSuccess:b=>{r.invalidateQueries({queryKey:["prompts"]}),r.invalidateQueries({queryKey:["prompt",b.name]}),n(b.name)},onError:b=>void a({title:i("prompts.saveError"),body:b instanceof Error?b.message:String(b)})}),p=j.useMemo(()=>d?/^[a-z0-9][a-z0-9-]*$/.test(d.name):!1,[d]),y=j.useMemo(()=>d?rA(d.body):[],[d]);return c.jsx("div",{className:"fixed inset-0 z-50 flex items-start justify-center bg-black/30 p-4 overflow-auto",children:c.jsx("div",{className:"w-full max-w-2xl my-8",children:c.jsxs("div",{className:"nb-card flex flex-col gap-3",children:[c.jsxs("div",{className:"flex items-center justify-between shrink-0",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-lg font-bold",children:o?i("prompts.new"):e}),c.jsx("button",{type:"button",className:"nb-btn p-2",onClick:t,"aria-label":"close",children:c.jsx(Jt,{size:14,strokeWidth:3})})]}),!o&&u.isLoading?c.jsx(Xe,{size:14,className:"animate-spin"}):d?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[c.jsxs("label",{className:"flex flex-col gap-1",children:[c.jsx("span",{className:"text-sm font-bold",children:i("prompts.name")}),c.jsx("input",{type:"text",value:d.name,disabled:!o,onChange:b=>h({...d,name:b.target.value}),placeholder:i("prompts.namePlaceholder"),className:"nb-input w-full","aria-label":i("prompts.name")}),o&&d.name&&!p&&c.jsx("span",{className:"text-xs text-[var(--color-crashed)]",children:i("prompts.nameError")})]}),c.jsxs("label",{className:"flex flex-col gap-1",children:[c.jsx("span",{className:"text-sm font-bold",children:i("prompts.description")}),c.jsx("input",{type:"text",value:d.description,onChange:b=>h({...d,description:b.target.value}),className:"nb-input w-full","aria-label":i("prompts.description")})]})]}),c.jsxs("label",{className:"flex flex-col gap-1",children:[c.jsx("span",{className:"text-sm font-bold",children:i("prompts.tags")}),c.jsx(sK,{tags:d.tags,onChange:b=>h({...d,tags:b})})]}),c.jsxs("label",{className:"flex flex-col gap-1",children:[c.jsx("span",{className:"text-sm font-bold",children:i("prompts.body")}),c.jsx("textarea",{value:d.body,onChange:b=>h({...d,body:b.target.value}),placeholder:i("prompts.bodyPlaceholder"),rows:12,className:"nb-input w-full font-[family-name:var(--font-mono)] text-sm","aria-label":i("prompts.body")}),c.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:y.length?i("prompts.vars",{names:y.join(", ")}):i("prompts.noVars")})]}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsxs("button",{type:"button",className:"nb-btn nb-btn-mint",disabled:g.isPending||o&&!p||!d.body.trim(),onClick:()=>g.mutate(),children:[g.isPending?c.jsx(Xe,{size:14,className:"animate-spin"}):c.jsx(mr,{size:14,strokeWidth:3}),i("prompts.save")]}),c.jsxs("label",{className:"flex items-center gap-2 text-sm cursor-pointer",children:[c.jsx("input",{type:"checkbox",checked:d.favorite,onChange:b=>h({...d,favorite:b.target.checked})}),i("prompts.favorite")]})]})]}):null]})})})}function lK(){var a;const e=Ie(),t=Ve({queryKey:["system-info"],queryFn:h_}),n=Ve({queryKey:["system-env"],queryFn:sI}),[i,r]=j.useState(!1);return c.jsxs("div",{className:"flex flex-col gap-6 w-full",children:[c.jsx("header",{children:c.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-4xl font-bold",children:e("system.h1")})}),c.jsx(oK,{current:(a=t.data)==null?void 0:a.version}),c.jsxs("section",{className:"nb-card",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold mb-3",children:e("system.runtime")}),t.data?c.jsxs("dl",{className:"grid grid-cols-1 sm:grid-cols-[160px_1fr] gap-y-2 text-sm",children:[c.jsx("dt",{className:"font-bold",children:"Node"}),c.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:t.data.nodeVersion}),c.jsx("dt",{className:"font-bold",children:"Platform"}),c.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:t.data.platform}),c.jsx("dt",{className:"font-bold",children:"PID"}),c.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:t.data.pid??"—"}),c.jsx("dt",{className:"font-bold",children:"Uptime"}),c.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:fK(t.data.uptimeMs)})]}):c.jsx("p",{className:"text-[var(--color-text-muted)]",children:e("common.loading")})]}),c.jsxs("section",{className:"nb-card",children:[c.jsxs("div",{className:"flex items-center justify-between mb-3",children:[c.jsxs("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold",children:[e("system.env.title.prefix"),c.jsx("code",{className:"text-sm font-[family-name:var(--font-mono)] font-normal border-2 border-[var(--color-text)] px-2 py-0.5 rounded",children:"~/.coral/env"})]}),i?c.jsx("span",{className:"text-xs text-[var(--color-stuck)] font-bold",children:e("system.env.editing.label")}):c.jsxs("button",{className:"nb-btn",style:{padding:"6px 12px",fontSize:12},onClick:()=>r(!0),type:"button","aria-label":e("system.env.edit.aria"),children:[c.jsx(Jh,{size:12,strokeWidth:2.5})," ",e("system.env.edit.button")]})]}),i?c.jsx(cK,{onClose:()=>{r(!1),n.refetch()}}):n.data&&n.data.exists?c.jsx("dl",{className:"grid grid-cols-1 sm:grid-cols-[220px_1fr] gap-y-1 text-sm font-[family-name:var(--font-mono)]",children:n.data.entries.map(o=>c.jsxs("div",{className:"contents",children:[c.jsxs("dt",{className:"font-bold flex items-center gap-2",children:[o.masked&&c.jsx("span",{className:"text-[var(--color-stuck)]",children:"🔒"}),o.key]}),c.jsx("dd",{className:"text-[var(--color-text-muted)] truncate",children:o.value})]},o.key))}):c.jsxs("p",{className:"text-[var(--color-text-muted)] text-sm",children:[e("system.env.empty.before"),c.jsx("code",{className:"bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] px-2 py-0.5 rounded font-[family-name:var(--font-mono)]",children:"sps setup"}),e("system.env.empty.after")]})]}),c.jsx(uK,{})]})}function oK({current:e}){var v;const t=Ie(),{confirm:n,alert:i}=dn(),[r,a]=j.useState(!1),[o,u]=j.useState(null),d=Ve({queryKey:["latest-version"],queryFn:dI,enabled:!1}),[h,g]=j.useState(null),[p,y]=j.useState("npm i -g @coralai/sps-cli@latest"),b=async()=>{var k;if(await n({title:t("system.upgrade.confirm.title"),body:t("system.upgrade.confirm.body",{current:e??"?",latest:((k=d.data)==null?void 0:k.latest)??"?"}),confirm:t("system.upgrade.confirm.button")})){a(!0),u(null),g(null);try{const A=await fI();if(u(A.output),g(A.installedVersion),y(A.command),A.ok)i({title:t("system.upgrade.success.title"),body:t("system.upgrade.success.body",{version:A.installedVersion??"?"})});else{const S=A.installedVersion&&A.installedVersion===e?t("system.upgrade.notEffective.same",{version:A.installedVersion}):t("system.upgrade.notEffective.notInstalled");i({title:t("system.upgrade.notEffective.title"),body:S})}}catch(A){u(A.message),i({title:t("system.upgrade.error.title"),body:A.message})}finally{a(!1)}}},w=async()=>{const N=d.data&&!d.data.upToDate?`npm i -g @coralai/sps-cli@${d.data.latest}`:p;try{await navigator.clipboard.writeText(N),i({title:t("system.upgrade.copy.success.title"),body:t("system.upgrade.copy.success.body",{cmd:N})})}catch{i({title:t("system.upgrade.copy.fail.title"),body:t("system.upgrade.copy.fail.body",{cmd:N})})}};return c.jsxs("section",{className:"nb-card",children:[c.jsxs("div",{className:"flex items-center justify-between mb-3",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold",children:t("system.upgrade.title")}),c.jsxs("button",{className:"nb-btn",style:{padding:"6px 12px",fontSize:12},onClick:()=>d.refetch(),disabled:d.isFetching||!e,type:"button","aria-label":t("system.upgrade.checkLatest.aria"),children:[d.isFetching?c.jsx(Xe,{size:12,strokeWidth:3,className:"animate-spin"}):c.jsx(bs,{size:12,strokeWidth:2.5}),t("system.upgrade.checkUpdate")]})]}),c.jsxs("dl",{className:"grid grid-cols-1 sm:grid-cols-[160px_1fr] gap-y-2 text-sm",children:[c.jsx("dt",{className:"font-bold",children:t("system.upgrade.label.current")}),c.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:e??"—"}),d.data&&c.jsxs(c.Fragment,{children:[c.jsx("dt",{className:"font-bold",children:t("system.upgrade.label.latest")}),c.jsxs("dd",{className:"font-[family-name:var(--font-mono)] flex items-center gap-2 flex-wrap",children:[d.data.latest,d.data.upToDate?c.jsx("span",{className:"nb-status",style:{background:"var(--color-running-bg)",color:"var(--color-running)"},children:t("system.upgrade.latestPill")}):c.jsxs(c.Fragment,{children:[c.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"3px 10px",fontSize:11},onClick:b,disabled:r,type:"button","aria-label":t("system.upgrade.button.upgradeAria"),children:[r?c.jsx(Xe,{size:11,strokeWidth:3,className:"animate-spin"}):c.jsx(Zh,{size:11,strokeWidth:2.5}),t("system.upgrade.button.upgrade")]}),c.jsxs("button",{className:"nb-btn",style:{padding:"3px 10px",fontSize:11},onClick:w,type:"button","aria-label":t("system.upgrade.button.copyAria"),title:t("system.upgrade.button.copyTitle"),children:[c.jsx(H2,{size:11,strokeWidth:2.5})," ",t("system.upgrade.button.copy")]})]})]})]}),h&&c.jsxs(c.Fragment,{children:[c.jsx("dt",{className:"font-bold",children:t("system.upgrade.label.installed")}),c.jsxs("dd",{className:"font-[family-name:var(--font-mono)] flex items-center gap-2",children:[h,h===((v=d.data)==null?void 0:v.latest)?c.jsx("span",{className:"nb-status",style:{background:"var(--color-running-bg)",color:"var(--color-running)"},children:t("system.upgrade.installed.ok")}):h===e?c.jsx("span",{className:"nb-status",style:{background:"var(--color-stuck-bg)",color:"var(--color-stuck)"},children:t("system.upgrade.installed.fail")}):null]})]}),d.isError&&c.jsxs(c.Fragment,{children:[c.jsx("dt",{className:"font-bold",children:t("system.upgrade.label.check")}),c.jsx("dd",{className:"text-[var(--color-crashed)] text-xs",children:d.error instanceof Error?d.error.message:String(d.error)})]})]}),o&&c.jsx("pre",{className:"mt-3 text-xs font-[family-name:var(--font-mono)] bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-lg p-3 max-h-40 overflow-auto whitespace-pre-wrap",children:o})]})}function cK({onClose:e}){const t=Ie(),n=Ft(),{alert:i}=dn(),r=Ve({queryKey:["system-env-raw"],queryFn:aI}),[a,o]=j.useState(null),[u,d]=j.useState(null);j.useEffect(()=>{r.data&&a===null&&(o(r.data.content),d(r.data.etag))},[r.data,a]);const h=a!==null&&r.data&&a!==r.data.content,g=Et({mutationFn:()=>{if(a===null)throw new Error("no draft");return lI(a,u??"")},onSuccess:()=>{n.invalidateQueries({queryKey:["system-env"]}),n.invalidateQueries({queryKey:["system-env-raw"]}),e()},onError:p=>{const y=p.status;i({title:t(y===409?"system.env.error.conflict.title":"system.env.error.save.title"),body:y===409?t("system.env.error.conflict.body"):p instanceof Error?p.message:String(p)})}});return r.isLoading?c.jsx("p",{className:"text-[var(--color-text-muted)]",children:t("common.loading")}):c.jsxs("div",{children:[c.jsx("p",{className:"text-xs text-[var(--color-stuck)] font-bold mb-2",children:t("system.env.warning")}),c.jsx("textarea",{className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",style:{minHeight:320,resize:"vertical"},value:a??"",onChange:p=>o(p.target.value),spellCheck:!1,"aria-label":t("system.env.aria")}),c.jsxs("div",{className:"flex items-center justify-between mt-3",children:[c.jsxs("span",{className:"text-xs text-[var(--color-text-muted)] font-[family-name:var(--font-mono)]",children:[u?`etag: ${u}`:"",h?t("system.env.dirtyMark"):""]}),c.jsxs("div",{className:"flex gap-2",children:[c.jsxs("button",{className:"nb-btn",style:{padding:"6px 12px"},onClick:e,disabled:g.isPending,type:"button",children:[c.jsx(Jt,{size:12,strokeWidth:3})," ",t("system.env.cancel")]}),c.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"6px 12px"},onClick:()=>g.mutate(),disabled:!h||g.isPending,type:"button","aria-label":t("system.env.save.aria"),children:[g.isPending?c.jsx(Xe,{size:12,strokeWidth:3,className:"animate-spin"}):c.jsx(mr,{size:12,strokeWidth:3}),t("system.env.save")]})]})]})]})}function uK(){var y;const e=Ie(),{alert:t}=dn(),n=Ve({queryKey:["projects"],queryFn:Ea}),[i,r]=j.useState({}),[a,o]=j.useState({}),[u,d]=j.useState({}),h=(((y=n.data)==null?void 0:y.data)??[]).map(b=>({project:b.name})),g=async(b,w)=>{o(v=>({...v,[b]:w?"fix":"check"}));try{const v=await hI(b,w);r(N=>({...N,[b]:v})),d(N=>({...N,[b]:!0}))}catch(v){t({title:e(w?"system.diagnostics.error.fix":"system.diagnostics.error.check"),body:v instanceof Error?v.message:String(v)})}finally{o(v=>({...v,[b]:null}))}},p=async()=>{for(const b of h)await g(b.project,!1)};return c.jsxs("section",{className:"nb-card",children:[c.jsxs("div",{className:"flex items-center justify-between mb-3",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold",children:e("system.diagnostics.title")}),c.jsxs("button",{className:"nb-btn nb-btn-mint",style:{padding:"6px 12px",fontSize:12},onClick:()=>{p()},disabled:h.length===0||Object.values(a).some(Boolean),type:"button",children:[c.jsx(bs,{size:12,strokeWidth:2.5}),e("system.diagnostics.checkAll")]})]}),h.length===0?c.jsx("p",{className:"text-[var(--color-text-muted)] text-sm",children:e("system.diagnostics.empty")}):c.jsx("ul",{className:"flex flex-col gap-2",children:h.map(b=>{const w=i[b.project],v=a[b.project],N=w?w.checks.filter(_=>_.status==="fail").length:0,k=w?w.checks.filter(_=>_.status==="warn").length:0,A=u[b.project]??!1,S=w!=null;return c.jsxs("li",{className:"bg-surface-input border-2 border-[var(--color-text)] rounded-lg",children:[c.jsxs("div",{className:"flex items-center gap-3 px-3 py-2",children:[c.jsxs("button",{type:"button",onClick:()=>d(_=>({..._,[b.project]:!A})),disabled:!S,className:"flex items-center gap-2 flex-1 text-left min-w-0","aria-label":e(A?"system.diagnostics.collapseAria":"system.diagnostics.expandAria"),children:[S&&w.ok?c.jsx(kh,{size:16,className:"text-[var(--color-running)] shrink-0",strokeWidth:2.5}):S?c.jsx(ju,{size:16,className:"text-[var(--color-stuck)] shrink-0",strokeWidth:2.5}):c.jsx(kh,{size:16,className:"text-[var(--color-text-subtle)] shrink-0",strokeWidth:2.5}),S&&(A?c.jsx(Ju,{size:12}):c.jsx(Jo,{size:12})),c.jsx("span",{className:"font-bold font-[family-name:var(--font-mono)]",children:b.project}),S?w.ok?c.jsx("span",{className:"text-xs text-[var(--color-running)] font-semibold",children:"OK"}):c.jsxs("span",{className:"text-xs text-[var(--color-stuck)] font-semibold",children:[N," fail · ",k," warn"]}):c.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:e("system.diagnostics.never")})]}),c.jsxs("button",{className:"nb-btn",style:{padding:"4px 10px",fontSize:11},onClick:()=>{g(b.project,!1)},disabled:!!v,type:"button","aria-label":e("system.diagnostics.checkAria"),children:[v==="check"?c.jsx(Xe,{size:11,strokeWidth:3,className:"animate-spin"}):c.jsx(bs,{size:11,strokeWidth:2.5}),e("system.diagnostics.check")]}),c.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"4px 10px",fontSize:11},onClick:()=>{g(b.project,!0)},disabled:!!v||S&&w.ok,type:"button","aria-label":e("system.diagnostics.fixAria"),title:S&&w.ok?e("system.diagnostics.noFixesNeeded"):e("system.diagnostics.fix.tip"),children:[v==="fix"?c.jsx(Xe,{size:11,strokeWidth:3,className:"animate-spin"}):c.jsx(s_,{size:11,strokeWidth:2.5}),e("system.diagnostics.fix")]})]}),A&&S&&c.jsxs("div",{className:"border-t-2 border-dashed border-[var(--color-text)] px-3 py-2",children:[c.jsx("ul",{className:"flex flex-col gap-1 text-xs font-[family-name:var(--font-mono)]",children:w.checks.map((_,C)=>c.jsx(dK,{check:_},`${_.name}-${C}`))}),w.fixes.length>0&&c.jsxs("div",{className:"mt-3 bg-[var(--color-running-bg)] border-2 border-[var(--color-running)] rounded p-2",children:[c.jsx("div",{className:"text-xs font-bold text-[var(--color-running)] mb-1",children:e("system.diagnostics.fixed")}),c.jsx("ul",{className:"text-xs list-disc pl-4",children:w.fixes.map((_,C)=>c.jsx("li",{children:_},C))})]})]})]},b.project)})})]})}function dK({check:e}){const t=e.status==="pass"?c.jsx(kh,{size:12,className:"text-[var(--color-running)]",strokeWidth:2.5}):e.status==="fail"?c.jsx(ju,{size:12,className:"text-[var(--color-crashed)]",strokeWidth:2.5}):e.status==="warn"?c.jsx(ju,{size:12,className:"text-[var(--color-stuck)]",strokeWidth:2.5}):c.jsx("span",{className:"w-3 h-3 rounded-full bg-[var(--color-text-subtle)] inline-block"});return c.jsxs("li",{className:"flex items-start gap-2",children:[c.jsx("span",{className:"pt-0.5 shrink-0",children:t}),c.jsx("span",{className:"font-bold w-32 shrink-0",children:e.name}),c.jsx("span",{className:"text-[var(--color-text-muted)] break-words",children:e.message})]})}function fK(e){const t=Math.floor(e/1e3),n=Math.floor(t/3600),i=Math.floor(t%3600/60),r=t%60;return n>0?`${n}h ${i}m ${r}s`:i>0?`${i}m ${r}s`:`${r}s`}function hK({onInsert:e,disabled:t,className:n="nb-btn"}){var p;const i=Ie(),[r,a]=j.useState(!1),[o,u]=j.useState(""),h=((p=Ve({queryKey:["prompts",o],queryFn:()=>iA(o||void 0),enabled:r}).data)==null?void 0:p.data)??[],g=async y=>{try{const b=await r0(y);e(b.body)}finally{a(!1),u("")}};return c.jsxs("div",{className:"relative flex-shrink-0",children:[c.jsx("button",{type:"button",className:n,onClick:()=>a(y=>!y),disabled:t,"aria-label":i("prompts.insert"),title:i("prompts.insert"),children:c.jsx(Q2,{size:15,strokeWidth:2.5})}),r&&c.jsxs("div",{className:"absolute bottom-full mb-2 left-0 z-20 w-72 nb-card overflow-hidden flex flex-col gap-2",children:[c.jsxs("label",{className:"flex items-center gap-2 border-2 border-[var(--color-text)] rounded px-2 py-1",children:[c.jsx(fl,{size:12}),c.jsx("input",{autoFocus:!0,value:o,onChange:y=>u(y.target.value),placeholder:i("prompts.search"),className:"bg-transparent outline-none flex-1 text-sm","aria-label":i("prompts.search")})]}),c.jsx("div",{className:"max-h-64 overflow-auto flex flex-col gap-1",children:h.length===0?c.jsx("p",{className:"text-xs text-[var(--color-text-muted)] px-1 py-2",children:i("prompts.empty")}):h.map(y=>c.jsxs("button",{type:"button",onClick:()=>void g(y.name),className:"text-left px-2 py-1 rounded hover:bg-[var(--color-bg-cream)]",children:[c.jsx("code",{className:"font-[family-name:var(--font-mono)] text-sm font-bold",children:y.name}),y.description&&c.jsx("span",{className:"block text-xs text-[var(--color-text-muted)] truncate",children:y.description})]},y.name))})]})]})}function CS(){var se,J,ke,le,Ce,Me,_e,Qe,Ue;const e=Ie(),{sessionId:t}=Jb(),n=wl(),i=Ft(),{confirm:r,alert:a}=dn(),o=Ve({queryKey:["chat-sessions"],queryFn:o5,refetchInterval:5e3}),u=Ve({queryKey:["chat-session",t],queryFn:()=>c5(t??""),enabled:!!t,refetchInterval:4e3}),[d,h]=j.useState(null),g=ue=>`chat-draft:${ue??""}`,[p,y]=j.useState(()=>localStorage.getItem(g(t))??""),b=j.useCallback(ue=>{y(we=>{const xe=typeof ue=="function"?ue(we):ue;try{t&&localStorage.setItem(g(t),xe)}catch{}return xe})},[t]);j.useEffect(()=>{y(localStorage.getItem(g(t))??"")},[t]);const[w,v]=j.useState(!1),N=j.useRef(null),k=j.useRef(!0),[A,S]=j.useState(!1),_=()=>{const ue=N.current;return!ue||ue.scrollHeight-ue.scrollTop-ue.clientHeight<40},C=j.useCallback(()=>{const ue=N.current;ue&&(ue.scrollTop=ue.scrollHeight),k.current=!0,S(!1)},[]),T=j.useCallback(()=>{const ue=_();k.current=ue,S(!ue)},[]),R=j.useRef(null);j.useEffect(()=>{const ue=R.current;ue&&(ue.style.height="auto",ue.style.height=`${Math.min(ue.scrollHeight,200)}px`,ue.scrollTop=ue.scrollHeight)},[p]);const O="w-8 h-8 flex items-center justify-center rounded-full bg-[rgba(255,255,255,0.08)] text-[var(--color-text-muted)] hover:bg-[rgba(255,255,255,0.14)] hover:text-[var(--color-text)] transition-colors disabled:opacity-50",[B,P]=j.useState(!1),[F,U]=j.useState([]),[V,M]=j.useState(!1),[H,$]=j.useState(!1),[K,W]=j.useState(!1),[Y,I]=j.useState(null),[L,G]=j.useState(!1);j.useEffect(()=>{if(!t)return;const ue=new EventSource(`/stream/chat/${encodeURIComponent(t)}`);let we=!0;return ue.addEventListener("open",()=>{if(we){we=!1;return}const xe=i.getQueryData(["chat-session",t]),pe=xe!=null&&xe.messages.length?xe.messages[xe.messages.length-1].ts:void 0;f5(t,pe).then(Ne=>{Ne.data.length!==0&&i.setQueryData(["chat-session",t],je=>{if(!je)return je;const He=new Set(je.messages.map(de=>de.id)),ne=Ne.data.filter(de=>!He.has(de.id));return ne.length===0?je:{...je,messages:[...je.messages,...ne],lastMessageAt:ne[ne.length-1].ts,messageCount:je.messageCount+ne.length}})}).catch(()=>{})}),ue.addEventListener("chat.message",xe=>{try{const pe=JSON.parse(xe.data);i.setQueryData(["chat-session",t],Ne=>{if(!Ne||Ne.messages.some(ne=>ne.id===pe.message.id))return Ne;const He=Ne.messages.findIndex(ne=>ne.role==="user"&&ne.id.startsWith("optim-")&&ne.content===pe.message.content);if(He>=0){const ne=[...Ne.messages];return ne[He]=pe.message,{...Ne,messages:ne}}return{...Ne,messages:[...Ne.messages,pe.message]}})}catch{}}),ue.addEventListener("chat.message.pending",xe=>{try{const pe=JSON.parse(xe.data);h({sessionId:t,id:pe.assistantId,blocks:[],done:!1,finalMessage:null})}catch{}}),ue.addEventListener("chat.message.snapshot",xe=>{try{const pe=JSON.parse(xe.data);h({sessionId:t,id:pe.assistantId,blocks:pe.blocks.map(Ne=>Ne.type==="text"?{type:"text",target:Ne.text,displayed:Ne.text}:{type:"tool_use",id:Ne.id,title:Ne.title,kind:Ne.kind,status:Ne.status,input:Ne.input,locations:Ne.locations}),done:!1,finalMessage:null})}catch{}}),ue.addEventListener("chat.message.chunk.text",xe=>{try{const pe=JSON.parse(xe.data);h(Ne=>{if(!Ne||Ne.id!==pe.assistantId)return Ne;const je=[...Ne.blocks],He=je[je.length-1];return He&&He.type==="text"?je[je.length-1]={...He,target:He.target+pe.text}:je.push({type:"text",target:pe.text,displayed:""}),{...Ne,blocks:je}})}catch{}}),ue.addEventListener("chat.message.chunk.tool_use",xe=>{try{const pe=JSON.parse(xe.data);h(Ne=>!Ne||Ne.id!==pe.assistantId?Ne:{...Ne,blocks:[...Ne.blocks,{type:"tool_use",id:pe.id,title:pe.title,kind:pe.kind,status:pe.status,input:pe.input,locations:pe.locations}]})}catch{}}),ue.addEventListener("chat.message.chunk.tool_update",xe=>{try{const pe=JSON.parse(xe.data);h(Ne=>!Ne||Ne.id!==pe.assistantId?Ne:{...Ne,blocks:Ne.blocks.map(je=>je.type==="tool_use"&&je.id===pe.id?{...je,status:pe.status,input:je.input??pe.input,locations:je.locations??pe.locations}:je)})}catch{}}),ue.addEventListener("chat.message.complete",xe=>{try{const pe=JSON.parse(xe.data);h(Ne=>Ne&&Ne.id===pe.assistantId?{...Ne,done:!0,finalMessage:pe.message}:Ne)}catch{}}),ue.addEventListener("chat.message.error",xe=>{try{const pe=JSON.parse(xe.data);h(je=>je&&je.sessionId===t&&(!pe.assistantId||je.id===pe.assistantId||je.id===pe.turnId)?null:je),v(!1);const Ne=pe.message;Ne&&i.setQueryData(["chat-session",t],je=>!je||je.messages.some(He=>He.id===Ne.id)?je:{...je,messages:[...je.messages,Ne],lastMessageAt:Ne.ts,messageCount:je.messageCount+1})}catch{}}),()=>ue.close()},[t,i]),j.useEffect(()=>{if(!d||d.sessionId!==t)return;const ue=d.blocks.reduce((xe,pe)=>pe.type==="text"?xe+(pe.target.length-pe.displayed.length):xe,0);if(ue<=0){if(d.done&&d.finalMessage){const xe=d.finalMessage;i.setQueryData(["chat-session",t],pe=>!pe||pe.messages.some(Ne=>Ne.id===xe.id)?pe:{...pe,messages:[...pe.messages,xe],lastMessageAt:xe.ts,messageCount:pe.messageCount+1}),i.invalidateQueries({queryKey:["chat-sessions"]}),i.invalidateQueries({queryKey:["chat-session",t]}),h(null),v(!1)}return}const we=setTimeout(()=>{h(xe=>{if(!xe)return xe;let pe=Math.max(1,Math.ceil(ue/40));const Ne=xe.blocks.map(je=>{if(je.type!=="text"||pe<=0)return je;const He=je.target.length-je.displayed.length;if(He<=0)return je;const ne=Math.min(He,pe);return pe-=ne,{...je,displayed:je.target.slice(0,je.displayed.length+ne)}});return{...xe,blocks:Ne}})},25);return()=>clearTimeout(we)},[d,i,t]),j.useEffect(()=>{if(k.current){const ue=N.current;ue&&(ue.scrollTop=ue.scrollHeight)}},[u.data,d]),j.useEffect(()=>{k.current=!0,S(!1),v(!1)},[t]);const z=j.useCallback(async(ue={})=>{var we,xe;try{const pe=await ah({cwd:((we=ue.cwd)==null?void 0:we.trim())||void 0,title:((xe=ue.title)==null?void 0:xe.trim())||void 0,agentKind:ue.agentKind,model:ue.model,providerId:ue.providerId});i.invalidateQueries({queryKey:["chat-sessions"]}),n(`/chat/${pe.id}`),P(!1)}catch(pe){a({title:e("chat.error.create.title"),body:pe instanceof Error?pe.message:String(pe)})}},[i,n,a,e]),te=j.useCallback(async()=>{const ue=p.trim();if(!ue&&F.length===0||w)return;let we=t;if(!we){const Ne=await ah();i.invalidateQueries({queryKey:["chat-sessions"]}),we=Ne.id,n(`/chat/${we}`,{replace:!0})}k.current=!0,S(!1);const xe=F.map(Ne=>Ne.path),pe={id:`optim-${Date.now()}`,role:"user",content:ue||e("chat.placeholder.attachment"),ts:new Date().toISOString(),status:"complete",attachments:xe.length>0?xe:void 0};i.setQueryData(["chat-session",we],Ne=>Ne?{...Ne,messages:[...Ne.messages,pe],lastMessageAt:pe.ts,messageCount:Ne.messageCount+1}:{id:we,createdAt:pe.ts,lastMessageAt:pe.ts,title:ue.slice(0,60)||e("chat.placeholder.attachmentTitle"),project:null,messageCount:1,messages:[pe]}),b(""),U([]),v(!0);try{await b_(we,ue||e("chat.placeholder.viewAttachment"),xe.length>0?xe:void 0)}catch(Ne){v(!1),console.error("sendMessage failed",Ne),a({title:e("chat.error.send.title"),body:Ne instanceof Error?Ne.message:String(Ne)})}},[p,F,w,t,i,n,a,e]),me=j.useCallback(async ue=>{if(ue.size>Sj){a({title:e("chat.error.fileTooBig.title"),body:e("chat.error.fileTooBig.body",{size:(ue.size/1024/1024).toFixed(2),name:ue.name})});return}let we=t;if(!we){const xe=await ah();i.invalidateQueries({queryKey:["chat-sessions"]}),we=xe.id,n(`/chat/${we}`,{replace:!0})}M(!0);try{const xe=await L6(we,ue);U(pe=>[...pe,{path:xe.path,name:xe.name}])}catch(xe){a({title:e("chat.error.uploadAttachment.title"),body:xe instanceof Error?xe.message:String(xe)})}finally{M(!1)}},[t,i,n,a,e]),ye=j.useCallback(ue=>{U(we=>we.filter(xe=>xe.path!==ue))},[]),Se=j.useCallback(async(ue,we)=>{await r({title:e("chat.delete.confirm.title"),body:e(we==="cli"?"chat.delete.confirm.body.cli":"chat.delete.confirm.body.console"),confirm:e("chat.delete.confirm.button"),danger:!0})&&(await u5(ue),i.invalidateQueries({queryKey:["chat-sessions"]}),t===ue&&n("/chat"))},[i,t,n,r,e]),re=j.useCallback(async()=>{if(t)try{await d5(t)}catch(ue){a({title:e("chat.error.interrupt.title"),body:ue instanceof Error?ue.message:String(ue)})}},[t,a,e]),he=d&&d.sessionId===t?d:null;return c.jsxs("div",{className:"grid flex-1 min-h-0 grid-cols-[260px_minmax(0,1fr)] items-stretch gap-4",children:[c.jsxs("aside",{className:"nb-card p-3 overflow-hidden flex h-full min-h-0 flex-col gap-2",children:[c.jsxs("button",{className:"nb-btn nb-btn-primary w-full justify-center",onClick:()=>P(!0),type:"button",children:[c.jsx(pi,{size:14,strokeWidth:3}),e("chat.list.new")]}),c.jsx("div",{className:"mt-2 text-xs font-[family-name:var(--font-heading)] uppercase tracking-wider text-[var(--color-text-muted)] px-2",children:e("chat.list.heading",{count:((se=o.data)==null?void 0:se.data.length)??0})}),c.jsx("div",{className:"flex flex-col gap-0.5 mt-1 overflow-auto min-h-0",children:(()=>{var ne;const ue=((ne=o.data)==null?void 0:ne.data)??[],we=Date.now(),xe=10080*60*1e3,pe=de=>new Date(de.lastMessageAt??de.createdAt).getTime(),Ne=ue.filter(de=>we-pe(de)<=xe),je=ue.filter(de=>we-pe(de)>xe),He=de=>c.jsxs("div",{className:["dimension-menu-item group items-start gap-2 px-3 py-2 pl-4",t===de.id?"dimension-menu-item-active":""].join(" "),children:[c.jsxs("button",{type:"button","aria-label":e("chat.list.openAria",{title:de.title,cwd:de.cwd?e("chat.list.cwdSuffix",{cwd:de.cwd}):""}),onClick:()=>n(`/chat/${de.id}`),className:"flex items-start gap-2 flex-1 min-w-0 text-left",children:[c.jsx(Ok,{size:14,strokeWidth:2.5,className:"mt-0.5 flex-shrink-0"}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[c.jsx("p",{className:"text-sm font-semibold truncate flex-1",children:de.title}),de.source==="cli"&&c.jsx("span",{className:"flex-shrink-0 px-1.5 py-0 rounded-md bg-[var(--color-accent-purple)] border-2 border-[var(--color-text)] text-[9px] font-[family-name:var(--font-mono)] uppercase tracking-wider leading-tight",title:e("chat.cliBadge.tooltip"),children:e("chat.cliBadge")})]}),c.jsx("p",{className:"text-[10px] text-[var(--color-text-muted)] font-[family-name:var(--font-mono)] truncate",children:e("chat.list.msgs",{count:de.messageCount,time:lA(de.lastMessageAt??de.createdAt,e)})}),de.cwd&&c.jsxs("p",{className:"text-[10px] text-[var(--color-text-subtle)] font-[family-name:var(--font-mono)] truncate flex items-center gap-1",title:de.cwd,children:[c.jsx(Sh,{size:9,strokeWidth:2.5,className:"flex-shrink-0"}),c.jsx("span",{className:"truncate",dir:"rtl",children:de.cwd})]})]})]}),c.jsx("button",{type:"button","aria-label":de.source==="cli"?e("chat.list.deleteCli.aria"):e("chat.list.delete.aria"),className:"opacity-0 group-hover:opacity-100 p-1 hover:text-[var(--color-crashed)]",onClick:Le=>{Le.stopPropagation(),Se(de.id,de.source)},children:c.jsx(Ki,{size:12})})]},de.id);return c.jsxs(c.Fragment,{children:[Ne.map(He),je.length>0&&c.jsxs(c.Fragment,{children:[c.jsxs("button",{type:"button",onClick:()=>G(de=>!de),"aria-expanded":L,className:"flex items-center gap-1 px-2 py-1 mt-1 rounded-lg text-xs font-semibold text-[var(--color-text-muted)] hover:text-[var(--color-text)] hover:bg-[var(--color-bg-cream)] focus-visible:outline focus-visible:outline-2",children:[L?c.jsx(Ju,{size:12,strokeWidth:2.5}):c.jsx(Jo,{size:12,strokeWidth:2.5}),e("chat.list.olderToggle",{count:je.length})]}),L&&je.map(He)]}),ue.length===0&&c.jsx("p",{className:"text-xs text-[var(--color-text-subtle)] italic text-center py-4",children:e("chat.list.empty")})]})})()})]}),c.jsx("div",{className:"nb-card p-0 flex h-full min-h-0 flex-col overflow-hidden",children:t?c.jsxs(c.Fragment,{children:[c.jsxs("header",{className:"px-4 py-3 border-b-2 border-[var(--color-text)] bg-color-bg-soft",children:[c.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] font-bold text-lg",children:((J=u.data)==null?void 0:J.title)??e("common.loading")}),((ke=u.data)==null?void 0:ke.model)&&c.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md bg-[var(--color-accent-yellow)] border-2 border-[var(--color-text)] text-[10px] font-[family-name:var(--font-mono)] font-bold uppercase tracking-wider",title:e("chat.detail.model.tooltip"),children:[c.jsx(Eh,{size:11,strokeWidth:2.5})," ",u.data.model]})]}),c.jsx("p",{className:"text-xs text-[var(--color-text-muted)] font-[family-name:var(--font-mono)]",children:t}),((le=u.data)==null?void 0:le.claudeSessionId)&&c.jsxs("p",{className:"text-xs text-[var(--color-text-subtle)] font-[family-name:var(--font-mono)] truncate",title:e("chat.detail.claudeSession.tooltip"),children:["claude: ",u.data.claudeSessionId]}),((Ce=u.data)==null?void 0:Ce.cwd)&&c.jsxs("p",{className:"text-xs text-[var(--color-text-muted)] font-[family-name:var(--font-mono)] flex items-center gap-1 mt-1",title:u.data.cwd,children:[c.jsx(Sh,{size:11,strokeWidth:2.5,className:"flex-shrink-0"}),c.jsx("span",{className:"truncate",children:u.data.cwd})]})]}),c.jsxs("div",{className:"relative flex-1 flex flex-col min-h-0",children:[c.jsxs("div",{ref:N,onScroll:T,className:"flex-1 overflow-auto p-4 flex flex-col gap-4",children:[(((Me=u.data)==null?void 0:Me.messages)??[]).filter(ue=>!(he&&ue.status==="streaming")).map(ue=>c.jsx(gK,{msg:ue,sessionId:t??null,onPreviewAttachment:we=>I(we)},ue.id)),he&&c.jsx(bK,{pending:he}),!u.isLoading&&(((_e=u.data)==null?void 0:_e.messages)??[]).length===0&&!he&&!w&&c.jsx("p",{className:"text-center text-[var(--color-text-subtle)] italic mt-12",children:e("chat.session.empty")})]}),A&&c.jsx("button",{type:"button",onClick:C,className:"absolute bottom-3 right-4 z-10 w-9 h-9 flex items-center justify-center rounded-full border-2 border-[var(--color-text)] bg-white shadow-[2px_2px_0_var(--color-text)] hover:-translate-y-px hover:shadow-[3px_3px_0_var(--color-text)] active:translate-y-px active:shadow-none transition-transform","aria-label":"滚动到底部",title:"↓ 回到底部",children:c.jsx(P3,{size:18,strokeWidth:3})})]}),((Qe=u.data)==null?void 0:Qe.source)==="cli"?c.jsxs("div",{className:"border-t-2 border-[var(--color-text)] p-4 bg-[var(--color-accent-purple)]",children:[c.jsxs("p",{className:"text-sm font-[family-name:var(--font-mono)] text-[var(--color-text-muted)] text-center",children:[c.jsx("strong",{children:e("chat.cli.banner.bold")})," — ",e("chat.cli.banner")]}),c.jsxs("pre",{className:"mt-2 px-3 py-2 bg-[var(--color-bg)] border-2 border-[var(--color-text)] rounded-md text-xs font-[family-name:var(--font-mono)] overflow-x-auto",children:["sps agent --chat --name ",(t??"").replace(/^session-/,"")]})]}):c.jsxs("div",{className:["border-t-2 border-[var(--color-text)] p-3 transition-colors",K?"bg-[var(--color-accent-mint)]":""].join(" "),onDragOver:ue=>{ue.dataTransfer.types.includes("Files")&&(ue.preventDefault(),ue.dataTransfer.dropEffect="copy",K||W(!0))},onDragLeave:()=>W(!1),onDrop:ue=>{if(!ue.dataTransfer.types.includes("Files"))return;ue.preventDefault(),W(!1);const we=Array.from(ue.dataTransfer.files??[]);for(const xe of we)me(xe)},children:[(F.length>0||V)&&c.jsxs("div",{className:"flex flex-wrap gap-2 mb-2",children:[F.map(ue=>c.jsxs("button",{type:"button",className:"flex items-center gap-1.5 px-2 py-1 rounded-md bg-[var(--color-bg)] border-2 border-[var(--color-text)] text-xs font-[family-name:var(--font-mono)] hover:bg-[var(--color-accent-mint)] group",onClick:()=>I(ue.path),title:e("chat.attachment.previewTooltip",{name:ue.name,path:ue.path}),children:[Ih(ue.path)?c.jsx(IL,{size:11,strokeWidth:2.5,className:"flex-shrink-0"}):c.jsx(ed,{size:11,strokeWidth:2.5,className:"flex-shrink-0"}),c.jsx("span",{className:"truncate max-w-[180px]",children:ue.name}),c.jsx("span",{role:"button","aria-label":e("chat.input.removeAttachment",{name:ue.name}),className:"ml-1 hover:text-[var(--color-crashed)] cursor-pointer",onClick:we=>{we.stopPropagation(),ye(ue.path)},children:c.jsx(Jt,{size:11,strokeWidth:3})})]},ue.path)),V&&c.jsxs("span",{className:"flex items-center gap-1.5 px-2 py-1 text-xs text-[var(--color-text-muted)] font-[family-name:var(--font-mono)]",children:[c.jsx(Xe,{size:11,strokeWidth:2.5,className:"animate-spin"}),e("chat.input.uploading")]})]}),c.jsxs("div",{className:"flex flex-col gap-2 rounded-2xl border-[3px] border-[var(--color-text)] bg-white px-3 py-2 shadow-[3px_3px_0_var(--color-text)] focus-within:shadow-[4px_4px_0_var(--color-text)] transition-shadow",children:[c.jsx("textarea",{ref:R,className:"w-full resize-none border-0 !bg-transparent outline-none text-sm leading-relaxed max-h-[200px] px-1 pt-1",placeholder:e(K?"chat.input.dragOver":"chat.input.placeholder"),rows:1,value:p,onChange:ue=>b(ue.target.value),onKeyDown:ue=>{ue.key==="Enter"&&!ue.shiftKey&&!ue.nativeEvent.isComposing&&(ue.preventDefault(),te())},onPaste:ue=>{const xe=Array.from(ue.clipboardData.items??[]).filter(pe=>pe.kind==="file"&&pe.type.startsWith("image/"));if(xe.length!==0){ue.preventDefault();for(const pe of xe){const Ne=pe.getAsFile();Ne&&me(Ne)}}},"aria-label":e("chat.input.aria")}),c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx("button",{type:"button",className:O,onClick:()=>$(!0),disabled:w,"aria-label":e("chat.input.attach.aria"),title:e("chat.input.attach.title"),children:c.jsx(nz,{size:15,strokeWidth:2.5})}),c.jsx(hK,{className:O,disabled:w,onInsert:ue=>b(we=>we.trim()?`${we}
|
|
787
|
+
${ue}`:ue)}),c.jsx("div",{className:"flex-1"}),he?c.jsx("button",{className:"nb-btn nb-btn-danger w-9 h-9 p-0 justify-center",onClick:re,type:"button","aria-label":e("chat.input.interrupt.aria"),title:e("chat.input.interrupt"),children:c.jsx(lx,{size:14,strokeWidth:3})}):c.jsx("button",{className:"nb-btn nb-btn-primary w-9 h-9 p-0 justify-center disabled:opacity-40 disabled:cursor-not-allowed",onClick:te,disabled:!p.trim()&&F.length===0||w,type:"button","aria-label":e("chat.input.send.aria"),title:e("chat.input.send"),children:w?c.jsx(Xe,{size:16,strokeWidth:3,className:"animate-spin"}):c.jsx(U2,{size:18,strokeWidth:3})})]})]})]})]}):c.jsx("div",{className:"flex-1 flex items-center justify-center p-8",children:c.jsxs("div",{className:"text-center max-w-md",children:[c.jsx("div",{className:"w-20 h-20 rounded-2xl bg-[var(--color-accent-mint)] border-[3px] border-[var(--color-text)] shadow-[3px_3px_0_var(--color-text)] flex items-center justify-center mx-auto mb-4",children:c.jsx(Ok,{size:32,strokeWidth:2.5})}),c.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-2xl font-bold mb-2",children:e("chat.empty.title")}),c.jsx("p",{className:"text-sm text-[var(--color-text-muted)] mb-4",children:e("chat.empty.hint")}),c.jsx("p",{className:"text-xs text-[var(--color-text-subtle)] italic",children:e("chat.empty.shortcuts")})]})})}),B&&c.jsx(mK,{onCancel:()=>P(!1),onCreate:ue=>z(ue)}),H&&c.jsx(Mx,{mode:"file",title:e("chat.filePicker.title"),initialPath:((Ue=u.data)==null?void 0:Ue.cwd)??void 0,onCancel:()=>$(!1),onSelect:ue=>{U(we=>{if(we.some(pe=>pe.path===ue))return we;const xe=ue.split(/[\\/]/).pop()||ue;return[...we,{path:ue,name:xe}]}),$(!1)}}),Y&&t&&c.jsx(pK,{sessionId:t,path:Y,onClose:()=>I(null)})]})}function Ih(e){return/\.(png|jpe?g|gif|webp|svg|avif)$/i.test(e)}function AS(e){return/\.pdf$/i.test(e)}function Ny(e){return/\.(txt|md|log|json|yaml|yml|csv|html|xml|tsx?|jsx?|css|sh|ya?ml|conf|toml|ini|env|gitignore|sql|py|rb|go|rs|java|kt|swift|c|cc|cpp|h|hpp)$/i.test(e)}function pK({sessionId:e,path:t,onClose:n}){const i=Ie(),[r,a]=j.useState(null),[o,u]=j.useState(null);j.useEffect(()=>{const g=p=>{p.key==="Escape"&&(p.preventDefault(),n())};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[n]),j.useEffect(()=>{if(!Ny(t))return;let g=!1;return fetch(mb(e,t)).then(async p=>{if(!p.ok)throw new Error(`${p.status}`);return p.text()}).then(p=>{g||a(p.length>2e5?p.slice(0,2e5)+`
|
|
788
|
+
|
|
789
|
+
…(truncated)`:p)}).catch(p=>{g||u(p instanceof Error?p.message:String(p))}),()=>{g=!0}},[e,t]);const d=mb(e,t),h=t.split(/[\\/]/).pop()??t;return c.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-[rgba(45,55,72,0.6)] p-4",role:"presentation",children:c.jsxs("div",{className:"nb-card bg-[var(--color-bg)] max-w-3xl w-full p-5 flex flex-col",style:{maxHeight:"85vh"},role:"dialog","aria-modal":"true","aria-label":i("chat.attachment.preview.aria",{name:h}),children:[c.jsxs("header",{className:"flex items-center justify-between mb-3 shrink-0",children:[c.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[c.jsx(pL,{size:16,strokeWidth:2.5,className:"flex-shrink-0"}),c.jsx("h3",{className:"font-[family-name:var(--font-heading)] font-bold text-base truncate",children:h})]}),c.jsx("button",{type:"button",className:"p-1 hover:bg-[var(--color-bg-cream)] rounded flex-shrink-0",onClick:n,"aria-label":i("chat.attachment.close.aria"),children:c.jsx(Jt,{size:16,strokeWidth:3})})]}),c.jsx("p",{className:"text-[10px] text-[var(--color-text-muted)] font-[family-name:var(--font-mono)] truncate mb-2 shrink-0",title:t,dir:"rtl",children:t}),c.jsxs("div",{className:"flex-1 overflow-auto border-2 border-[var(--color-text)] rounded-lg bg-[var(--color-bg-cream)] min-h-0",children:[Ih(t)&&c.jsx("div",{className:"flex items-center justify-center p-4",children:c.jsx("img",{src:d,alt:`Preview: ${h}`,className:"max-w-full max-h-[60vh] object-contain"})}),AS(t)&&c.jsx("iframe",{src:d,title:`PDF: ${h}`,className:"w-full",style:{height:"60vh",border:0}}),Ny(t)&&c.jsx("pre",{className:"p-3 text-xs font-[family-name:var(--font-mono)] whitespace-pre-wrap break-words",children:o?c.jsx("span",{className:"text-[var(--color-crashed)]",children:i("chat.attachment.readErr",{detail:o})}):r===null?c.jsx("span",{className:"text-[var(--color-text-muted)]",children:i("chat.attachment.loading")}):r}),!Ih(t)&&!AS(t)&&!Ny(t)&&c.jsxs("div",{className:"p-6 text-center text-sm text-[var(--color-text-muted)]",children:[c.jsx("p",{className:"mb-3",children:i("chat.attachment.unsupported")}),c.jsx("a",{href:d,download:h,className:"nb-btn nb-btn-primary inline-flex",children:i("chat.attachment.download")})]})]})]})})}function mK({onCancel:e,onCreate:t}){var S;const n=Ie(),[i,r]=j.useState(""),[a,o]=j.useState(""),[u,d]=j.useState(""),[h,g]=j.useState(!1),[p,y]=j.useState(!1),[b,w]=j.useState(!1),v=Ve({queryKey:["providers"],queryFn:Tx}),N=Ve({queryKey:["system-agents"],queryFn:dx}),k=kj(((S=v.data)==null?void 0:S.anthropic)??[]);j.useEffect(()=>{var T;if(h)return;const _=(T=N.data)==null?void 0:T.agents.worker;if(!_)return;const C=`${_.providerId||"official"}::${_.model}`;k.some(R=>`${R.providerId}::${R.model}`===C)&&d(C)},[N.data,k,h]),j.useEffect(()=>{if(b)return;const _=C=>{C.key==="Escape"&&(C.preventDefault(),e())};return window.addEventListener("keydown",_),()=>window.removeEventListener("keydown",_)},[e,b]);const A=async()=>{if(!p){y(!0);try{const[_,C]=u?u.split("::"):[void 0,void 0];t({title:i.trim()||void 0,cwd:a.trim()||void 0,agentKind:"claude",model:C,providerId:_})}finally{y(!1)}}};return c.jsxs("div",{className:"fixed inset-0 z-40 flex items-center justify-center bg-[rgba(45,55,72,0.4)] p-4",role:"presentation",children:[c.jsxs("div",{className:"nb-card bg-[var(--color-bg)] max-w-md w-full p-5",role:"dialog","aria-modal":"true","aria-label":n("chat.newSession.title.aria"),children:[c.jsxs("header",{className:"flex items-center justify-between mb-4",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] font-bold text-lg",children:n("chat.newSession.title")}),c.jsx("button",{type:"button",className:"p-1 hover:bg-[var(--color-bg-cream)] rounded",onClick:e,"aria-label":n("chat.newSession.close.aria"),children:c.jsx(Jt,{size:16,strokeWidth:3})})]}),c.jsxs("div",{className:"flex flex-col gap-4",children:[c.jsxs("div",{children:[c.jsx("label",{htmlFor:"new-session-model",className:"block text-xs font-bold mb-1.5 uppercase tracking-wider",children:n("chat.newSession.field.model")}),c.jsxs("select",{id:"new-session-model",className:"nb-input w-full font-[family-name:var(--font-mono)] text-sm",value:u,onChange:_=>{g(!0),d(_.target.value)},children:[c.jsx("option",{value:"",children:n("chat.newSession.field.model.default")}),k.map(_=>c.jsx("option",{value:`${_.providerId}::${_.model}`,children:_.label},`${_.providerId}::${_.model}`))]})]}),c.jsxs("div",{children:[c.jsx("label",{htmlFor:"new-session-title",className:"block text-xs font-bold mb-1.5 uppercase tracking-wider",children:n("chat.newSession.field.title")}),c.jsx("input",{id:"new-session-title",type:"text",className:"nb-input w-full",placeholder:n("chat.newSession.field.title.placeholder"),value:i,onChange:_=>r(_.target.value),autoFocus:!0})]}),c.jsxs("div",{children:[c.jsx("label",{htmlFor:"new-session-cwd",className:"block text-xs font-bold mb-1.5 uppercase tracking-wider",children:n("chat.newSession.field.cwd")}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("input",{id:"new-session-cwd",type:"text",className:"nb-input flex-1 font-[family-name:var(--font-mono)] text-sm",placeholder:"/home/coral/projects/my-app",value:a,onChange:_=>o(_.target.value)}),c.jsxs("button",{type:"button",className:"nb-btn flex-shrink-0",onClick:()=>w(!0),"aria-label":n("chat.newSession.field.cwd.browseAria"),title:n("chat.newSession.field.cwd.browseAria"),children:[c.jsx(K2,{size:14,strokeWidth:2.5}),n("chat.newSession.field.cwd.browse")]})]}),c.jsxs("p",{className:"text-[11px] text-[var(--color-text-muted)] mt-1.5 leading-relaxed",children:[c.jsx(Sh,{size:10,strokeWidth:2.5,className:"inline mr-1 -mt-0.5"}),n("chat.newSession.field.cwd.help1")," ",n("chat.newSession.field.cwd.help2")]})]}),c.jsxs("div",{className:"flex gap-2 justify-end pt-2",children:[c.jsx("button",{type:"button",className:"nb-btn",onClick:e,children:n("chat.newSession.cancel")}),c.jsxs("button",{type:"button",className:"nb-btn nb-btn-primary",onClick:A,disabled:p,children:[p?c.jsx(Xe,{size:14,strokeWidth:3,className:"animate-spin"}):c.jsx(pi,{size:14,strokeWidth:3}),n("chat.newSession.create")]})]})]})]}),b&&c.jsx(Mx,{initialPath:a.trim()||void 0,onCancel:()=>w(!1),onSelect:_=>{o(_),w(!1)}})]})}function gK({msg:e,sessionId:t,onPreviewAttachment:n}){const i=Ie(),r=e.role==="user",a=e.role==="error",o=e.blocks&&e.blocks.length>0?e.blocks:[{type:"text",text:e.content}],u=e.attachments??[];return c.jsx("div",{className:r?"self-end max-w-3xl":"self-start max-w-3xl",children:c.jsxs("div",{className:["nb-card",r?"bg-[var(--color-secondary)]":a?"bg-[var(--color-crashed-bg)]":"bg-surface-input"].join(" "),children:[c.jsxs("p",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-text-muted)] mb-2 flex items-center gap-2",children:[i(r?"chat.message.role.you":a?"chat.message.role.error":"chat.message.role.assistant"),c.jsx("span",{className:"font-normal",children:"·"}),c.jsx("span",{className:"font-normal cursor-help",title:wK(e.ts),children:lA(e.ts,i)})]}),c.jsx("div",{className:"flex flex-col gap-2",children:o.map((d,h)=>c.jsx(xK,{block:d},h))}),u.length>0&&t&&c.jsx("div",{className:"mt-3 pt-3 border-t-2 border-dashed border-[var(--color-text)]/30 flex flex-wrap gap-2",children:u.map(d=>c.jsx(yK,{sessionId:t,path:d,onPreview:()=>n(d)},d))}),e.truncated&&c.jsx("p",{className:"mt-3 px-3 py-2 bg-[var(--color-stuck-bg)] border-2 border-[var(--color-stuck)] rounded-lg text-xs text-[var(--color-stuck)] font-bold",children:i("chat.message.truncated")})]})})}function yK({sessionId:e,path:t,onPreview:n}){const i=Ie(),r=t.split(/[\\/]/).pop()??t;return Ih(t)?c.jsx("button",{type:"button",onClick:n,className:"block rounded-md overflow-hidden border-2 border-[var(--color-text)] hover:shadow-[2px_2px_0_var(--color-text)] transition-shadow",title:i("chat.attachment.previewSimpleTooltip",{name:r}),children:c.jsx("img",{src:mb(e,t),alt:r,className:"block max-h-40 max-w-[12rem] object-cover",loading:"lazy"})}):c.jsxs("button",{type:"button",onClick:n,className:"flex items-center gap-1.5 px-2 py-1 rounded-md bg-[var(--color-bg)] border-2 border-[var(--color-text)] text-xs font-[family-name:var(--font-mono)] hover:bg-[var(--color-accent-mint)]",title:i("chat.attachment.previewTooltip",{name:r,path:t}),children:[c.jsx(ed,{size:11,strokeWidth:2.5,className:"flex-shrink-0"}),c.jsx("span",{className:"truncate max-w-[200px]",children:r})]})}function bK({pending:e}){const t=(()=>{for(let n=e.blocks.length-1;n>=0;n--)if(e.blocks[n].type==="text")return n;return-1})();return c.jsx("div",{className:"self-start max-w-3xl",children:c.jsxs("div",{className:"nb-card bg-[var(--color-bg)]",children:[c.jsxs("p",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-text-muted)] mb-2 flex items-center gap-2",children:["assistant",c.jsx("span",{className:"font-normal",children:"·"}),c.jsxs("span",{className:"flex items-center gap-1 font-normal text-[var(--color-running)]",children:[c.jsx(Xe,{size:10,strokeWidth:3,className:"animate-spin"}),"streaming"]})]}),c.jsxs("div",{className:"flex flex-col gap-2",children:[e.blocks.length===0&&c.jsx("p",{className:"text-sm text-[var(--color-text-muted)] italic",children:"…"}),e.blocks.map((n,i)=>{if(n.type==="text"){const r=i===t;return c.jsxs("div",{className:"relative",children:[c.jsx(sA,{text:n.displayed}),r&&c.jsx("span",{className:"inline-block w-2 h-4 ml-1 bg-[var(--color-text)] animate-pulse align-middle"})]},i)}return c.jsx(aA,{tool:n},i)})]})]})})}function xK({block:e}){return e.type==="text"?c.jsx(sA,{text:e.text}):c.jsx(aA,{tool:e})}function sA({text:e}){return e?c.jsx("div",{className:"text-sm font-[family-name:var(--font-body)] break-words prose-chat",children:c.jsx(Qx,{remarkPlugins:[e0],rehypePlugins:[i0],children:e})}):null}function vK(e){if(e==null||typeof e!="object")return typeof e=="string"?e:"";const t=e,n=r=>typeof t[r]=="string"?t[r]:void 0;return n("file_path")??n("path")??n("notebook_path")??n("command")??n("pattern")??n("query")??n("url")??n("name")??n("description")??n("prompt")??Object.values(t).find(r=>typeof r=="string"&&r.trim())??""}function aA({tool:e}){const[t,n]=j.useState(!1),i=e.status==="completed"||e.status==="complete",r=e.status==="failed",a=!i&&!r,o=vK(e.input),u=e.input!=null&&(typeof e.input!="object"||Object.keys(e.input).length>0);return c.jsxs("div",{className:"border-2 border-[var(--color-text)] rounded-lg overflow-hidden bg-[var(--color-bg-cream)]",children:[c.jsxs("button",{type:"button",onClick:()=>n(d=>!d),className:"w-full bg-color-bg-soft-button flex items-center gap-2 px-3 py-2 text-xs font-[family-name:var(--font-mono)] hover:bg-[var(--color-accent-yellow)] transition-colors",children:[c.jsx(Jo,{size:12,strokeWidth:3,className:["transition-transform flex-shrink-0",t?"rotate-90":""].join(" ")}),c.jsx(s_,{size:12,strokeWidth:2.5,className:"flex-shrink-0"}),c.jsx("span",{className:"font-bold flex-shrink-0",children:e.title||e.kind}),c.jsx("span",{className:"flex-1 text-left text-[var(--color-text-muted)] truncate",title:o,children:o}),a&&c.jsx(Xe,{size:12,strokeWidth:3,className:"animate-spin text-[var(--color-running)] flex-shrink-0"}),i&&c.jsx(Cu,{size:12,strokeWidth:2.5,className:"text-[var(--color-running)] flex-shrink-0"}),r&&c.jsx(F2,{size:12,strokeWidth:2.5,className:"text-[var(--color-crashed)] flex-shrink-0"})]}),t&&c.jsxs("div",{className:"px-3 py-2 text-xs font-[family-name:var(--font-mono)] text-[var(--color-text-muted)] border-t-2 border-[var(--color-text)] space-y-1",children:[u?c.jsx("pre",{className:"whitespace-pre-wrap break-all text-[var(--color-text)] max-h-72 overflow-auto",children:typeof e.input=="string"?e.input:JSON.stringify(e.input,null,2)}):c.jsx("div",{children:"无参数"}),c.jsxs("div",{className:"opacity-60",children:["id: ",e.id," · ",e.status]})]})]})}function lA(e,t){if(!e)return"";const n=new Date(e),i=Date.now()-n.getTime();return i<6e4?t("kanban.time.justNow"):i<36e5?t("kanban.time.minutes",{n:Math.floor(i/6e4)}):i<864e5?t("kanban.time.hours",{n:Math.floor(i/36e5)}):n.toLocaleDateString()}function wK(e){if(!e)return;const t=new Date(e),n=i=>String(i).padStart(2,"0");return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())}`}function kK(){return ct("/api/processes").then(e=>e.data)}function EK(e){return gr(`/api/processes/${e}/kill`)}function SK(){return ct("/api/processes/reclaim")}async function NK(e){const t=await fetch("/api/processes/reclaim",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({idleMinutes:e})});if(!t.ok)throw new Error(`${t.status}: ${await t.text()}`);return t.json()}const TS="nb-card";function _K(e){if(!e)return"—";const t=Date.now()-new Date(e).getTime();if(!Number.isFinite(t)||t<0)return"—";const n=Math.floor(t/6e4);if(n<1)return"<1m";if(n<60)return`${n}m`;const i=Math.floor(n/60);return i<24?`${i}h${n%60?` ${n%60}m`:""}`:`${Math.floor(i/24)}d${i%24?` ${i%24}h`:""}`}function _y(e){return e.project?e.project:e.cwd?e.cwd.split("/").filter(Boolean).pop()??e.slot:e.slot}function MS(e){const t=/^session-chat-(.+)$/.exec(e.slot);return(t==null?void 0:t[1])??null}function jK({p:e}){const t=e.alive?e.sessionState??"alive":"offline",n=e.alive?"bg-[var(--color-accent-mint)]":"bg-[var(--color-bg-cream)] text-[var(--color-text)]/60";return c.jsx("span",{className:`nb-status font-[family-name:var(--font-mono)] ${n}`,children:t})}function CK(){var w;const e=Ie(),t=Ft(),[n,i]=j.useState(null),[r,a]=j.useState("all"),o=Ve({queryKey:["processes"],queryFn:kK,refetchInterval:5e3}),u=Et({mutationFn:EK,onSuccess:v=>{i(v.message),t.invalidateQueries({queryKey:["processes"]})},onError:v=>i(v instanceof Error?v.message:String(v))}),d=Ve({queryKey:["reclaim"],queryFn:SK}),[h,g]=j.useState("");j.useEffect(()=>{d.data&&h===""&&g(String(d.data.idleMinutes))},[d.data,h]);const p=Et({mutationFn:v=>NK(v),onSuccess:v=>{i(`自动回收已设为 ${v.idleMinutes} 分钟空闲`),t.invalidateQueries({queryKey:["reclaim"]})},onError:v=>i(v instanceof Error?v.message:String(v))}),y=o.data??[],b=y.filter(v=>r==="all"?!0:v.kind===r);return c.jsxs("div",{className:"max-w-full",children:[c.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[c.jsx(Eh,{size:22,strokeWidth:2.5}),c.jsx("h1",{className:"font-[family-name:var(--font-heading)] font-bold text-2xl",children:e("processes.title")}),c.jsxs("button",{type:"button","aria-label":e("processes.refresh"),onClick:()=>t.invalidateQueries({queryKey:["processes"]}),className:"nb-btn ml-auto text-sm",children:[o.isFetching?c.jsx(Xe,{size:15,className:"animate-spin"}):c.jsx(bs,{size:15}),e("processes.refresh")]})]}),c.jsxs("p",{className:"text-sm text-[var(--color-text)]/70 mb-3",children:[e("processes.subtitle")," · ",e("processes.aliveCount").replace("{n}",String(y.length))]}),c.jsxs("div",{className:`${TS} px-4 py-3 mb-4 flex flex-wrap items-center gap-2`,children:[c.jsx(Oz,{size:16,strokeWidth:2.5}),c.jsx("span",{className:"text-sm font-bold",children:"自动回收"}),c.jsx("span",{className:"text-sm text-[var(--color-text)]/70",children:"会话空闲"}),c.jsx("input",{type:"number",min:1,max:1440,value:h,onChange:v=>g(v.target.value),className:"nb-input w-20 px-2 py-1 font-[family-name:var(--font-mono)] text-sm","aria-label":"自动回收空闲分钟数"}),c.jsx("span",{className:"text-sm text-[var(--color-text)]/70",children:"分钟后自动停(下次访问自动续上,不丢上下文)"}),c.jsxs("button",{type:"button",disabled:p.isPending||h===""||Number(h)===((w=d.data)==null?void 0:w.idleMinutes),onClick:()=>p.mutate(Math.round(Number(h))),className:"nb-btn nb-btn-primary ml-auto text-sm disabled:opacity-50","aria-label":"保存自动回收设置",children:[p.isPending?c.jsx(Xe,{size:14,className:"animate-spin"}):c.jsx(mr,{size:14,strokeWidth:3}),"保存"]})]}),n&&c.jsx("div",{className:"nb-card mb-3 px-3 py-2 text-sm font-mono",children:n}),c.jsx("div",{className:"flex flex-wrap gap-2 mb-3 items-center",children:["all","worker","chat"].map(v=>c.jsx("button",{type:"button","aria-label":e(`processes.kind.${v}`),onClick:()=>a(v),className:`nb-btn px-3 py-1 text-sm ${r===v?"dimension-menu-item-active":""}`,children:e(`processes.kind.${v}`)},v))}),c.jsx("div",{className:`${TS} overflow-hidden p-0`,children:c.jsxs("table",{className:"w-full text-sm",children:[c.jsx("thead",{className:"bg-[var(--color-bg-cream)] font-[family-name:var(--font-heading)]",children:c.jsxs("tr",{className:"text-left",children:[c.jsx("th",{className:"px-3 py-2",children:e("processes.col.kind")}),c.jsx("th",{className:"px-3 py-2",children:e("processes.col.slot")}),c.jsx("th",{className:"px-3 py-2",children:e("processes.col.project")}),c.jsx("th",{className:"px-3 py-2",children:"PID"}),c.jsx("th",{className:"px-3 py-2",children:e("processes.col.state")}),c.jsx("th",{className:"px-3 py-2",children:e("processes.col.memory")}),c.jsx("th",{className:"px-3 py-2",children:"运行时间"}),c.jsx("th",{className:"px-3 py-2",children:e("processes.col.action")})]})}),c.jsxs("tbody",{className:"font-[family-name:var(--font-mono)]",children:[b.length===0&&c.jsx("tr",{children:c.jsx("td",{colSpan:8,className:"px-3 py-6 text-center text-[var(--color-text)]/50",children:e("processes.empty")})}),b.map(v=>c.jsxs("tr",{className:"border-t-2 border-[var(--color-text)]/10",title:v.cwd??"",children:[c.jsx("td",{className:"px-3 py-2",children:c.jsx("span",{className:`nb-badge text-xs ${v.kind==="worker"?"bg-[var(--color-accent-yellow)]":"bg-[var(--color-accent-purple)]"}`,children:e(`processes.kind.${v.kind}`)})}),c.jsx("td",{className:"px-3 py-2 max-w-[220px] truncate",children:v.slot}),c.jsx("td",{className:"px-3 py-2 max-w-[220px] truncate",children:v.kind==="chat"&&MS(v)?c.jsxs(wa,{to:`/chat/${MS(v)}`,className:"inline-flex items-center gap-1 font-semibold text-[var(--color-text)] underline decoration-2 underline-offset-2 hover:opacity-70",title:"打开对话窗口",children:[c.jsx(Y2,{size:12,strokeWidth:2.5})," ",_y(v)]}):v.kind==="worker"&&v.project?c.jsxs(wa,{to:`/board?project=${encodeURIComponent(v.project)}`,className:"inline-flex items-center gap-1 font-semibold text-[var(--color-text)] underline decoration-2 underline-offset-2 hover:opacity-70",title:"打开该项目看板",children:[c.jsx(Eh,{size:12,strokeWidth:2.5})," ",_y(v)]}):c.jsx("span",{children:_y(v)})}),c.jsx("td",{className:"px-3 py-2",children:v.pid??"—"}),c.jsx("td",{className:"px-3 py-2",children:c.jsx(jK,{p:v})}),c.jsx("td",{className:"px-3 py-2",children:v.memoryMB!=null?`${v.memoryMB} MB`:"—"}),c.jsx("td",{className:"px-3 py-2",children:_K(v.startedAt)}),c.jsx("td",{className:"px-3 py-2",children:v.alive&&v.pid!=null?c.jsxs("button",{type:"button","aria-label":`${e("processes.kill")} ${v.slot}`,onClick:()=>{confirm(e("processes.killConfirm").replace("{slot}",v.slot))&&u.mutate(v.pid)},className:"nb-btn nb-btn-danger px-2.5 py-1 text-xs",children:[c.jsx(F2,{size:13})," ",e("processes.kill")]}):c.jsx("span",{className:"text-[var(--color-text)]/40 text-xs",children:"—"})})]},v.slot))]})]})})]})}function AK(e={}){const t=new URLSearchParams;e.project&&t.set("project",e.project),e.action&&t.set("action",e.action);const n=t.toString();return ct(`/api/audit${n?`?${n}`:""}`).then(i=>i.data)}const TK="nb-card",MK={create:"bg-[var(--color-accent-mint)]",modify:"bg-[var(--color-accent-yellow)]",delete:"bg-[var(--color-accent-pink)]",daemon:"bg-[var(--color-accent-purple)]"};function DK(){const e=Ie(),t=Ft(),[n,i]=j.useState(""),r=Ve({queryKey:["audit",n],queryFn:()=>AK(n?{action:n}:{}),refetchInterval:8e3}),a=r.data??[],o=u=>e(`audit.action.${u}`);return c.jsxs("div",{className:"max-w-full",children:[c.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[c.jsx(ax,{size:22,strokeWidth:2.5}),c.jsx("h1",{className:"font-[family-name:var(--font-heading)] font-bold text-2xl",children:e("audit.title")}),c.jsxs("button",{type:"button","aria-label":e("audit.refresh"),onClick:()=>t.invalidateQueries({queryKey:["audit"]}),className:"nb-btn ml-auto text-sm",children:[r.isFetching?c.jsx(Xe,{size:15,className:"animate-spin"}):c.jsx(bs,{size:15}),e("audit.refresh")]})]}),c.jsx("p",{className:"text-sm text-[var(--color-text)]/70 mb-4",children:e("audit.subtitle")}),c.jsx("div",{className:"flex gap-2 mb-3",children:["","create","modify","delete","daemon"].map(u=>c.jsx("button",{type:"button","aria-label":u?o(u):e("audit.filter.all"),onClick:()=>i(u),className:`nb-btn px-3 py-1 text-sm ${n===u?"dimension-menu-item-active":""}`,children:u?o(u):e("audit.filter.all")},u||"all"))}),c.jsx("div",{className:`${TK} overflow-hidden p-0`,children:c.jsxs("table",{className:"w-full text-sm",children:[c.jsx("thead",{className:"bg-[var(--color-bg-cream)] font-[family-name:var(--font-heading)]",children:c.jsxs("tr",{className:"text-left",children:[c.jsx("th",{className:"px-3 py-2",children:e("audit.col.time")}),c.jsx("th",{className:"px-3 py-2",children:e("audit.col.action")}),c.jsx("th",{className:"px-3 py-2",children:e("audit.col.project")}),c.jsx("th",{className:"px-3 py-2",children:e("audit.col.detail")})]})}),c.jsxs("tbody",{className:"font-[family-name:var(--font-mono)]",children:[a.length===0&&c.jsx("tr",{children:c.jsx("td",{colSpan:4,className:"px-3 py-6 text-center text-[var(--color-text)]/50",children:e("audit.empty")})}),a.map((u,d)=>c.jsxs("tr",{className:"border-t-2 border-[var(--color-text)]/10",children:[c.jsx("td",{className:"px-3 py-2 whitespace-nowrap",children:new Date(u.ts).toLocaleString()}),c.jsx("td",{className:"px-3 py-2",children:c.jsx("span",{className:`nb-badge text-xs ${MK[u.action]}`,children:o(u.action)})}),c.jsx("td",{className:"px-3 py-2",children:u.project}),c.jsx("td",{className:"px-3 py-2 text-[var(--color-text)]/70",children:u.detail??(u.source?`(${u.source})`:"—")})]},`${u.ts}-${d}`))]})]})})]})}const OK=["convention","decision","gotcha","pattern","reference","note"],RK=["local","local+external","external","none"];function s0(e){return e!=null&&typeof e=="object"?e:{}}function _o(e){return Array.isArray(e)?e:[]}function LK(e){switch(e){case"none":return"none";case"agentmemory":case"custom":return"external";case"builtin":default:return"local"}}function DS(e){const t=s0(e);return{mode:typeof t.mode=="string"&&t.mode?t.mode:LK(t.provider),externalUrl:typeof t.externalUrl=="string"?t.externalUrl:typeof t.url=="string"?t.url:"",modeOptions:_o(t.modeOptions).length>0?_o(t.modeOptions):RK}}function zK(e){const t=s0(e),n=t.scope==="global"||t.scope==="project"||t.scope==="agent"?t.scope:null;return n?{scope:n,project:typeof t.project=="string"?t.project:void 0,agentId:typeof t.agentId=="string"?t.agentId:void 0,count:typeof t.count=="number"?t.count:0,updated:typeof t.updated=="string"?t.updated:""}:null}function IK(e){const t=s0(e);if(typeof t.id!="string")return null;const n=t.scope==="global"||t.scope==="project"||t.scope==="agent"?t.scope:"global";return{id:t.id,title:typeof t.title=="string"?t.title:t.id,scope:n,category:typeof t.category=="string"?t.category:"note",tags:_o(t.tags),salience:typeof t.salience=="number"?t.salience:3,source:typeof t.source=="string"?t.source:"human",project:typeof t.project=="string"?t.project:void 0,agentId:typeof t.agentId=="string"?t.agentId:void 0,created:typeof t.created=="string"?t.created:"",updated:typeof t.updated=="string"?t.updated:"",body:typeof t.body=="string"?t.body:""}}function ra(e){return`${e.scope}:${e.project??e.agentId??""}`}function Vf(e){return e.scope==="global"?`全局 (${e.count})`:e.scope==="project"?`项目:${e.project} (${e.count})`:`会话:${e.agentId} (${e.count})`}function Va(e){const t={scope:e.scope};return e.project&&(t.project=e.project),e.agentId&&(t.agentId=e.agentId),t}async function Nr(e,t){const n=await fetch(e,t);if(!n.ok){const i=await n.json().catch(()=>null);throw new Error((i==null?void 0:i.detail)||(i==null?void 0:i.title)||`HTTP ${n.status}`)}return await n.json()}const PK=()=>({title:"",body:"",category:"note",tags:"",salience:3});function BK(){var re,he,se;const e=Ie(),[t,n]=j.useState([]),[i,r]=j.useState(null),[a,o]=j.useState(!1),[u,d]=j.useState([]),[h,g]=j.useState(null),[p,y]=j.useState(!1),[b,w]=j.useState(""),[v,N]=j.useState(!0),[k,A]=j.useState([]),[S,_]=j.useState(null),[C,T]=j.useState(null),[R,O]=j.useState(null),[B,P]=j.useState(null),[F,U]=j.useState(""),[V,M]=j.useState(""),H=j.useCallback(async()=>{try{const{scopes:J}=await Nr("/api/memory/scopes"),ke=_o(J).map(zK).filter(le=>le!=null);n(ke),r(le=>le??ke[0]??null)}catch(J){g(J instanceof Error?J.message:String(J))}},[]),$=j.useCallback(async J=>{try{const ke=new URLSearchParams(Va(J)).toString(),{data:le}=await Nr(`/api/memory/entries?${ke}`);d(_o(le).map(IK).filter(Ce=>Ce!=null))}catch(ke){g(ke instanceof Error?ke.message:String(ke))}},[]);j.useEffect(()=>{H(),Nr("/api/system/memory").then(J=>{const ke=DS(J);P(ke),U(ke.mode),M(ke.externalUrl)}).catch(()=>{})},[H]),j.useEffect(()=>{i&&$(i),(i==null?void 0:i.scope)==="project"&&i.project?Nr(`/api/memory/external?project=${encodeURIComponent(i.project)}`).then(J=>O(J)).catch(()=>O(null)):O(null)},[i,$]);const K=j.useCallback(async()=>{if(!b.trim()){A([]);return}y(!0),g(null);try{const J=new URLSearchParams({q:b,limit:"20"});if(v)J.set("all","1");else if(i)for(const[le,Ce]of Object.entries(Va(i)))J.set(le,Ce);const{results:ke}=await Nr(`/api/memory/recall?${J.toString()}`);A(_o(ke))}catch(J){g(J instanceof Error?J.message:String(J))}finally{y(!1)}},[b,v,i]),W=j.useCallback(async()=>{if(!(!i||!S)){y(!0),g(null);try{await Nr("/api/memory/entries",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({...Va(i),id:S.id,title:S.title,body:S.body,category:S.category,tags:S.tags.split(",").map(J=>J.trim()).filter(Boolean),salience:S.salience})}),_(null),await Promise.all([$(i),H()])}catch(J){g(J instanceof Error?J.message:String(J))}finally{y(!1)}}},[i,S,$,H]),Y=j.useCallback(async J=>{if(i){y(!0),g(null);try{const ke=new URLSearchParams(Va(i)).toString();await Nr(`/api/memory/entries/${encodeURIComponent(J)}?${ke}`,{method:"DELETE"}),await Promise.all([$(i),H()])}catch(ke){g(ke instanceof Error?ke.message:String(ke))}finally{y(!1)}}},[i,$,H]),I=j.useCallback(async(J,ke,le)=>{if(i){y(!0),g(null);try{await Nr("/api/memory/promote",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({from:Va(i),id:J.id,to:Va(ke),move:le})}),T(null),await Promise.all([$(i),H()])}catch(Ce){g(Ce instanceof Error?Ce.message:String(Ce))}finally{y(!1)}}},[i,$,H]),L=j.useCallback(async()=>{if(i){y(!0),g(null);try{const ke=(await Nr("/api/memory/gc",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(Va(i))})).results[0];ke&&g(`收敛完成:清 tombstone ${ke.purged}、去重 ${ke.deduped}、剩余 ${ke.kept}`),await Promise.all([$(i),H()])}catch(J){g(J instanceof Error?J.message:String(J))}finally{y(!1)}}},[i,$,H]),G=j.useCallback(async()=>{y(!0),g(null);try{const J=DS(await Nr("/api/system/memory",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({mode:F,externalUrl:V})}));P(J),U(J.mode),M(J.externalUrl),g("模式已保存(重启 worker 生效)")}catch(J){g(J instanceof Error?J.message:String(J))}finally{y(!1)}},[F,V]),z=B!=null&&(F!==B.mode||V!==B.externalUrl),te=F==="external"||F==="local+external",me=j.useMemo(()=>C?t.filter(J=>ra(J)!==ra(i??{scope:""})):[],[C,t,i]),ye=Array.isArray((re=R==null?void 0:R.profile)==null?void 0:re.topConcepts)?R.profile.topConcepts:[],Se=Array.isArray((he=R==null?void 0:R.graph)==null?void 0:he.edges)?R.graph.edges.length:0;return c.jsxs("div",{className:"flex flex-col gap-4",children:[c.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[c.jsxs("h1",{className:"font-[family-name:var(--font-heading)] font-bold text-2xl text-[var(--color-text)]",children:["🧠 ",e("nav.memory")]}),c.jsx("span",{className:"text-xs text-[var(--color-text)] opacity-60",children:"本地记忆 v2 · markdown 真源"})]}),B&&c.jsxs("section",{className:"nb-card flex flex-wrap items-end gap-3",children:[c.jsxs("label",{className:"flex flex-col gap-1 text-sm",children:[c.jsx("span",{className:"font-bold",children:"记忆模式"}),c.jsx("select",{className:"nb-input",value:F,onChange:J=>U(J.target.value),"aria-label":"记忆模式",children:B.modeOptions.map(J=>c.jsx("option",{value:J,children:J},J))})]}),te&&c.jsxs("label",{className:"flex flex-col gap-1 text-sm flex-1 min-w-[220px]",children:[c.jsx("span",{className:"font-bold",children:"外部后端地址"}),c.jsx("input",{className:"nb-input font-[family-name:var(--font-mono)] text-xs",value:V,onChange:J=>M(J.target.value),placeholder:"http://127.0.0.1:3113",spellCheck:!1,"aria-label":"外部后端地址"})]}),c.jsx("button",{type:"button",className:"nb-btn nb-btn-mint",onClick:G,disabled:p||!z,"aria-label":"保存模式",children:"保存模式"})]}),c.jsxs("div",{className:"flex gap-2 flex-wrap items-center",children:[c.jsx("input",{value:b,onChange:J=>w(J.target.value),onKeyDown:J=>J.key==="Enter"&&K(),placeholder:"检索记忆…","aria-label":"检索记忆",className:"nb-input flex-1 min-w-[200px] font-[family-name:var(--font-mono)] text-sm"}),c.jsxs("label",{className:"flex items-center gap-1 text-sm font-semibold",children:[c.jsx("input",{type:"checkbox",checked:v,onChange:J=>N(J.target.checked),"aria-label":"全局检索"}),"全局"]}),c.jsx("button",{type:"button",className:"nb-btn nb-btn-mint",onClick:K,disabled:p,"aria-label":"检索",children:p?"…":"检索"})]}),h&&c.jsxs("div",{className:"text-sm text-[var(--color-text)] font-semibold nb-card py-2",children:["ℹ ",h]}),k.length>0&&c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsxs("h2",{className:"font-[family-name:var(--font-heading)] font-bold text-sm",children:["检索结果(",k.length,")"]}),k.map(J=>c.jsxs("div",{className:"nb-card",children:[c.jsxs("div",{className:"flex items-center gap-2 text-xs opacity-60 font-[family-name:var(--font-mono)]",children:[c.jsx("span",{className:"nb-badge",children:J.source==="external"?"🌐 外部":"📁 本地"}),c.jsx("span",{children:J.source==="external"?J.type??"":J.scope==="project"?`项目:${J.project}`:J.scope}),J.category&&c.jsxs(c.Fragment,{children:[c.jsx("span",{children:"·"}),c.jsx("span",{children:J.category})]})]}),c.jsx("div",{className:"font-bold text-sm mt-1",children:J.title}),c.jsx("div",{className:"text-sm mt-1 whitespace-pre-wrap opacity-80",children:J.snippet.slice(0,300)})]},J.id))]}),(()=>{const J=new Date(Date.now()-6048e5).toISOString(),ke=i?ra(i):"",le=a?t:t.filter(Me=>Me.scope!=="project"||Me.updated>=J||ra(Me)===ke),Ce=t.length-le.length;return c.jsxs("div",{className:"flex gap-2 flex-wrap items-center",children:[c.jsx("select",{className:"nb-input",value:ke,onChange:Me=>r(t.find(_e=>ra(_e)===Me.target.value)??null),"aria-label":"选择作用域",children:le.map(Me=>c.jsx("option",{value:ra(Me),children:Vf(Me)},ra(Me)))}),(Ce>0||a)&&c.jsx("button",{type:"button",className:"nb-btn text-xs",onClick:()=>o(Me=>!Me),"aria-label":a?"收起更早项目":"显示更早项目",children:a?"收起更早":`含更早 (${Ce})`}),c.jsx("button",{type:"button",className:"nb-btn nb-btn-blue",onClick:()=>_(PK()),disabled:!i,"aria-label":"新建记忆",children:"+ 新建"}),c.jsx("button",{type:"button",className:"nb-btn nb-btn-yellow",onClick:L,disabled:p||!i,"aria-label":"收敛去重",children:"收敛"})]})})(),R&&(ye.length||Se)?c.jsxs("section",{className:"nb-card flex flex-col gap-1",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] font-bold text-sm",children:"🌐 外部智能(agentmemory)"}),ye.length?c.jsxs("div",{className:"text-xs",children:[c.jsx("span",{className:"font-bold",children:"概念:"}),ye.slice(0,8).map(J=>c.jsx("span",{className:"nb-badge ml-1",children:J.concept},J.concept))]}):null,c.jsxs("div",{className:"text-xs opacity-70 font-[family-name:var(--font-mono)]",children:["知识图谱 ",Se," 条边 · 观测 ",((se=R.profile)==null?void 0:se.totalObservations)??0]})]}):null,S&&c.jsxs("section",{className:"nb-card flex flex-col gap-2",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] font-bold text-sm",children:S.id?"编辑记忆":"新建记忆"}),c.jsx("input",{className:"nb-input text-sm",value:S.title,onChange:J=>_({...S,title:J.target.value}),placeholder:"标题","aria-label":"标题"}),c.jsxs("div",{className:"flex gap-2 flex-wrap",children:[c.jsx("select",{className:"nb-input",value:S.category,onChange:J=>_({...S,category:J.target.value}),"aria-label":"类别",children:OK.map(J=>c.jsx("option",{value:J,children:J},J))}),c.jsx("input",{className:"nb-input flex-1 min-w-[160px] text-sm",value:S.tags,onChange:J=>_({...S,tags:J.target.value}),placeholder:"标签(逗号分隔)","aria-label":"标签"}),c.jsxs("label",{className:"flex items-center gap-1 text-sm",children:["显著度",c.jsx("input",{className:"nb-input w-16",type:"number",min:1,max:5,value:S.salience,onChange:J=>_({...S,salience:Number(J.target.value)}),"aria-label":"显著度"})]})]}),c.jsx("textarea",{className:"nb-input font-[family-name:var(--font-mono)] text-sm min-h-[120px]",value:S.body,onChange:J=>_({...S,body:J.target.value}),placeholder:"正文","aria-label":"正文"}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("button",{type:"button",className:"nb-btn nb-btn-mint",onClick:W,disabled:p||!S.title.trim()||!S.body.trim(),"aria-label":"保存",children:"保存"}),c.jsx("button",{type:"button",className:"nb-btn",onClick:()=>_(null),"aria-label":"取消",children:"取消"})]})]}),c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] font-bold text-sm",children:i?Vf(i):"条目"}),u.length===0&&c.jsx("div",{className:"nb-card text-sm opacity-60",children:"(无记忆)"}),u.map(J=>c.jsxs("div",{className:"nb-card",children:[c.jsxs("div",{className:"flex items-center gap-2 text-xs opacity-60 font-[family-name:var(--font-mono)] flex-wrap",children:[c.jsx("span",{className:"nb-badge",children:J.category}),c.jsxs("span",{children:["s",J.salience]}),c.jsx("span",{children:"·"}),c.jsx("span",{children:J.source}),J.tags.map(ke=>c.jsxs("span",{children:["#",ke]},ke))]}),c.jsx("div",{className:"font-bold text-sm mt-1",children:J.title}),c.jsx("div",{className:"text-sm mt-1 whitespace-pre-wrap opacity-80",children:J.body.slice(0,400)}),c.jsxs("div",{className:"flex gap-2 mt-2",children:[c.jsx("button",{type:"button",className:"nb-btn nb-btn-blue text-xs",onClick:()=>_({id:J.id,title:J.title,body:J.body,category:J.category,tags:J.tags.join(", "),salience:J.salience}),"aria-label":"编辑",children:"编辑"}),c.jsx("button",{type:"button",className:"nb-btn nb-btn-purple text-xs",onClick:()=>T(J),"aria-label":"提升",children:"提升"}),c.jsx("button",{type:"button",className:"nb-btn nb-btn-danger text-xs",onClick:()=>Y(J.id),"aria-label":"删除",children:"删除"})]}),(C==null?void 0:C.id)===J.id&&c.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2 border-t-[3px] border-[var(--color-text)] pt-2",children:[c.jsx("span",{className:"text-xs font-bold",children:"提升到:"}),me.map(ke=>c.jsx("button",{type:"button",className:"nb-btn nb-btn-mint text-xs",onClick:()=>I(J,ke,!1),"aria-label":`复制到${Vf(ke)}`,children:Vf(ke)},ra(ke))),me.length===0&&c.jsx("span",{className:"text-xs opacity-60",children:"(无其它作用域)"}),c.jsx("button",{type:"button",className:"nb-btn text-xs",onClick:()=>T(null),"aria-label":"取消提升",children:"取消"})]})]},J.id))]})]})}async function $K(){return(await ct("/api/channels")).data??{console:{},adapters:[]}}async function UK(e){return(await ux("/api/channels",e)).data}async function FK(){return(await ct("/api/codex-proxy")).data}async function qK(){return(await gr("/api/codex-proxy/install")).data}async function HK(e){const t=await fetch(`/api/codex-proxy?purgeAuth=${e?"1":"0"}`,{method:"DELETE",headers:{Accept:"application/json"}});if(!t.ok)throw new Error(`${t.status}: ${await t.text()}`);return(await t.json()).data}async function KK(){return(await gr("/api/codex-proxy/auth/start")).data}async function GK(){await gr("/api/codex-proxy/auth/cancel")}const OS=[{key:"memory",labelKey:"plugins.tab.memory"},{key:"channel",labelKey:"plugins.tab.channel"},{key:"model",labelKey:"plugins.tab.model"},{key:"tool",labelKey:"plugins.tab.tool"}];function VK(){const e=Ie(),[t,n]=j.useState("memory");return c.jsxs("div",{className:"flex flex-col gap-6 w-full",children:[c.jsxs("header",{children:[c.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-4xl font-bold",children:e("plugins.h1")}),c.jsx("p",{className:"text-sm text-[var(--color-text-muted)] mt-1",children:e("plugins.desc")})]}),c.jsx("div",{role:"tablist","aria-label":e("plugins.h1"),className:"flex gap-2 flex-wrap",children:OS.map(i=>{const r=t===i.key;return c.jsx("button",{role:"tab","aria-selected":r,type:"button",onClick:()=>n(i.key),className:["px-4 bg-surface-soft-button py-2 rounded-xl font-bold text-sm border-2 transition-transform duration-150",r?"bg-[var(--color-accent-mint)] border-[var(--color-text)] shadow-[3px_3px_0_var(--color-text)]":"border-[var(--color-text)] hover:-translate-x-px hover:-translate-y-px hover:shadow-[3px_3px_0_var(--color-text)]"].join(" "),children:e(i.labelKey)},i.key)})}),c.jsx("div",{role:"tabpanel",children:t==="memory"?c.jsx(WK,{}):t==="channel"?c.jsx(nG,{}):t==="model"?c.jsx(QK,{}):c.jsx(YK,{label:e(OS.find(i=>i.key===t).labelKey)})})]})}function YK({label:e}){const t=Ie();return c.jsx("section",{className:"nb-card",children:c.jsxs("p",{className:"text-[var(--color-text-muted)] text-sm",children:[e," — ",t("plugins.comingSoon")]})})}function WK(){var w,v,N;const e=Ie(),t=Ft(),{alert:n}=dn(),i=Ve({queryKey:["system-memory"],queryFn:oI}),[r,a]=j.useState(null),[o,u]=j.useState(null);j.useEffect(()=>{i.data&&r===null&&(a(i.data.provider),u(i.data.url))},[i.data,r]);const d=r??((w=i.data)==null?void 0:w.provider)??"agentmemory",h=o??((v=i.data)==null?void 0:v.url)??"",g=i.data!=null&&(d!==i.data.provider||d==="custom"&&h!==i.data.url),p=k=>{const A=`system.memory.opt.${k}`;return e(A)},y=Et({mutationFn:()=>cI(d,d==="custom"?h:""),onSuccess:()=>{t.invalidateQueries({queryKey:["system-memory"]}),t.invalidateQueries({queryKey:["system-env"]})},onError:k=>{n({title:e("system.memory.error"),body:k instanceof Error?k.message:String(k)})}}),b=((N=i.data)==null?void 0:N.options)??["none","builtin","agentmemory","custom"];return c.jsxs("section",{className:"nb-card",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold mb-1",children:e("system.memory.title")}),c.jsx("p",{className:"text-xs text-[var(--color-text-muted)] mb-3",children:e("system.memory.desc")}),c.jsxs("div",{className:"flex flex-col gap-3 max-w-md",children:[c.jsxs("label",{className:"flex flex-col gap-1 text-sm",children:[c.jsx("span",{className:"font-bold",children:e("system.memory.provider")}),c.jsx("select",{className:"nb-input",value:d,onChange:k=>a(k.target.value),"aria-label":e("system.memory.provider"),children:b.map(k=>c.jsx("option",{value:k,children:p(k)},k))})]}),d==="custom"&&c.jsxs("label",{className:"flex flex-col gap-1 text-sm",children:[c.jsx("span",{className:"font-bold",children:e("system.memory.url")}),c.jsx("input",{className:"nb-input font-[family-name:var(--font-mono)] text-xs",type:"text",value:h,onChange:k=>u(k.target.value),placeholder:e("system.memory.url.placeholder"),spellCheck:!1,"aria-label":e("system.memory.url")})]}),c.jsx("div",{className:"flex justify-end",children:c.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"6px 12px",fontSize:12},onClick:()=>y.mutate(),disabled:!g||y.isPending,type:"button","aria-label":e("system.memory.save.aria"),children:[y.isPending?c.jsx(Xe,{size:12,strokeWidth:3,className:"animate-spin"}):c.jsx(mr,{size:12,strokeWidth:3}),y.isSuccess&&!g?e("system.memory.saved"):e("system.memory.save")]})})]})]})}function QK(){var N,k,A;const e=Ft(),{alert:t,confirm:n}=dn(),i=Ve({queryKey:["providers"],queryFn:Tx}),a=(N=Ve({queryKey:["system-agents"],queryFn:dx}).data)==null?void 0:N.agents,[o,u]=j.useState(null),d=Et({mutationFn:S=>D6(o.kind,S),onSuccess:()=>{u(null),e.invalidateQueries({queryKey:["providers"]})},onError:S=>void t({title:"保存失败",body:S instanceof Error?S.message:String(S)})}),h=Et({mutationFn:S=>O6(S.kind,S.id),onSuccess:()=>void e.invalidateQueries({queryKey:["providers"]}),onError:S=>void t({title:"删除失败",body:S instanceof Error?S.message:String(S)})}),g=Et({mutationFn:S=>uI(S),onSuccess:()=>void e.invalidateQueries({queryKey:["system-agents"]}),onError:S=>void t({title:"设默认失败",body:S instanceof Error?S.message:String(S)})}),p=(S,_,C)=>{if(!a)return!1;const T=S==="anthropic"?a.worker:a.reviewer;return(T.providerId||"official")===_&&T.model===C},y=(S,_,C)=>{if(!a)return;let T;if(S==="anthropic"){const R={...a.worker,model:C};_==="official"?delete R.providerId:R.providerId=_,T={...a,worker:R}}else T={...a,reviewer:{...a.reviewer,providerId:_,model:C}};g.mutate(T)},b=[{kind:"anthropic",title:"Anthropic 兼容(worker / claude)",items:((k=i.data)==null?void 0:k.anthropic)??[]},{kind:"openai",title:"OpenAI 兼容(reviewer / openai agent)",items:((A=i.data)==null?void 0:A.openai)??[]}],w=S=>u({kind:S,isNew:!0,entry:{id:"",name:"",baseUrl:"",apiKey:"",models:[]}}),v=(S,_)=>u({kind:S,isNew:!1,entry:{id:_.id,name:_.name,baseUrl:_.baseUrl,apiKey:"",models:_.models}});return c.jsxs("section",{className:"nb-card",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold mb-1",children:"模型 API 端点"}),c.jsx("p",{className:"text-xs text-[var(--color-text-muted)] mb-4",children:"本地官方订阅(已登录验证)自动置顶,不可编辑;下方可增删第三方兼容端点。**点模型标签设为默认**(anthropic→worker / openai→监工);✓ = 当前默认。"}),c.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-5",children:b.map(S=>c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"font-bold text-sm",children:S.title}),c.jsxs("button",{className:"nb-btn",style:{padding:"4px 10px",fontSize:12},type:"button",onClick:()=>w(S.kind),"aria-label":`添加 ${S.title} 端点`,children:[c.jsx(pi,{size:12,strokeWidth:3})," 添加"]})]}),S.items.length===0&&c.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:"(无端点)"}),S.items.map(_=>_.id==="codex-proxy"?c.jsx(JK,{isDefault:C=>p(S.kind,_.id,C),pickDefault:C=>y(S.kind,_.id,C),setDefaultPending:g.isPending},_.id):c.jsxs("div",{className:["rounded-lg px-3 py-2 border-2",(_.builtin,"border-[var(--color-text)]")].join(" "),children:[c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("span",{className:"font-[family-name:var(--font-mono)] font-bold text-sm",children:_.id}),c.jsxs("span",{className:"text-[var(--color-text-muted)] text-sm",children:[" · ",_.name]}),_.builtin?c.jsxs("div",{className:"text-xs text-[var(--color-text-muted)] truncate",children:["本地订阅",_.detail?` · ${_.detail}`:""," · 已验证可用"]}):c.jsxs("div",{className:"text-xs text-[var(--color-text-muted)] truncate",children:[_.baseUrl," · key ",_.hasKey?_.apiKey:"未设置"]})]}),_.builtin?c.jsx("span",{className:"shrink-0 text-[10px] font-bold px-2 py-0.5 rounded-md border-2 border-[var(--color-text)] bg-[var(--color-accent-yellow)]",children:"内置"}):c.jsxs("div",{className:"flex gap-1 shrink-0",children:[c.jsx("button",{className:"nb-btn",style:{padding:"4px 8px"},type:"button",onClick:()=>v(S.kind,_),"aria-label":`编辑 ${_.id}`,children:c.jsx(X2,{size:12,strokeWidth:3})}),c.jsx("button",{className:"nb-btn nb-btn-danger",style:{padding:"4px 8px"},type:"button",onClick:async()=>{await n({title:"删除端点",body:`删除 ${_.id}?`,danger:!0})&&h.mutate({kind:S.kind,id:_.id})},"aria-label":`删除 ${_.id}`,children:c.jsx(Ki,{size:12,strokeWidth:3})})]})]}),_.models.length>0&&c.jsx("div",{className:"flex flex-wrap gap-1.5 mt-2",children:_.models.map(C=>{const T=p(S.kind,_.id,C);return c.jsxs("button",{type:"button",onClick:()=>y(S.kind,_.id,C),disabled:g.isPending,"aria-pressed":T,className:["px-2 py-0.5 rounded-md text-xs font-[family-name:var(--font-mono)] border-2 border-[var(--color-text)]",T?"bg-[var(--color-accent-mint)] font-bold":" hover:bg-[var(--color-bg-cream)]"].join(" "),title:T?"当前默认":"设为默认",children:[C,T?" ✓":""]},C)})})]},_.id))]},S.kind))}),o&&c.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",onClick:()=>u(null),children:c.jsx("div",{onClick:S=>S.stopPropagation(),children:c.jsx(ZK,{state:o,onChange:S=>u({...o,entry:S}),onCancel:()=>u(null),onSave:S=>d.mutate(S),saving:d.isPending})})})]})}function Ab(e,t){const n=[...e];for(const i of t.split(/[,,\n\r]+/)){const r=i.trim();r&&!n.includes(r)&&n.push(r)}return n}function XK({models:e,draft:t,onModelsChange:n,onDraftChange:i}){const r=a=>{n(Ab(e,a)),i("")};return c.jsxs("div",{className:"nb-input min-h-[46px] w-full flex flex-wrap gap-1.5 items-center px-2.5 py-2",children:[e.map(a=>c.jsxs("span",{className:"inline-flex max-w-full items-center gap-1.5 rounded-md border border-[var(--color-border-light)] bg-[var(--surface-control)] px-2 py-1 text-xs font-[family-name:var(--font-mono)]",children:[c.jsx("span",{className:"max-w-[480px] truncate",children:a}),c.jsx("button",{type:"button",className:"shrink-0 text-[var(--color-text-muted)] hover:text-[var(--color-text)]",onClick:()=>n(e.filter(o=>o!==a)),"aria-label":`删除模型 ${a}`,children:c.jsx(Jt,{size:12,strokeWidth:2.5})})]},a)),c.jsx("input",{id:"provider-models",className:"min-w-[180px] flex-1 bg-transparent px-1 py-0.5 text-sm outline-none font-[family-name:var(--font-mono)]",value:t,onChange:a=>{const o=a.target.value,u=o.split(/[,,\n\r]/);if(u.length===1){i(o);return}const d=u.pop()??"";n(Ab(e,u.join(","))),i(d)},onKeyDown:a=>{a.key==="Enter"&&!a.nativeEvent.isComposing?(a.preventDefault(),r(t)):a.key==="Backspace"&&!t&&e.length>0&&n(e.slice(0,-1))},placeholder:e.length>0?"继续添加模型":"输入模型名后按 Enter","aria-label":"Models",spellCheck:!1})]})}function ZK({state:e,onChange:t,onCancel:n,onSave:i,saving:r}){const a=e.entry,[o,u]=j.useState(""),d=g=>t({...a,...g}),h=/^[a-zA-Z0-9_-]+$/.test(a.id)&&a.name.trim()&&a.baseUrl.trim();return c.jsxs("div",{className:"border-[3px] border-[var(--color-text)] rounded-2xl p-6 bg-[var(--color-bg-cream)] shadow-[6px_6px_0_var(--color-text)] flex flex-col gap-4 w-[min(92vw,640px)] max-h-[88vh] overflow-y-auto",children:[c.jsxs("span",{className:"font-[family-name:var(--font-heading)] font-bold text-lg",children:[e.isNew?"新增端点":`编辑 ${a.id}`,c.jsxs("span",{className:"text-[var(--color-text-muted)] text-sm font-normal",children:["(",e.kind,")"]})]}),c.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[c.jsxs("label",{className:"flex flex-col gap-1 text-sm font-bold",children:["id(英数 _ -)",c.jsx("input",{className:"nb-input font-[family-name:var(--font-mono)]",value:a.id,disabled:!e.isNew,onChange:g=>d({id:g.target.value}),placeholder:"如 my-openai",spellCheck:!1})]}),c.jsxs("label",{className:"flex flex-col gap-1 text-sm font-bold",children:["名称",c.jsx("input",{className:"nb-input",value:a.name,onChange:g=>d({name:g.target.value}),placeholder:"显示名"})]})]}),c.jsxs("label",{className:"flex flex-col gap-1 text-sm font-bold",children:["Base URL",c.jsx("input",{className:"nb-input font-[family-name:var(--font-mono)] text-sm",value:a.baseUrl,onChange:g=>d({baseUrl:g.target.value}),placeholder:"https://api.example.com/v1",spellCheck:!1})]}),c.jsxs("label",{className:"flex flex-col gap-1 text-sm font-bold",children:["API Key",!e.isNew&&"(留空=保留)",c.jsx("input",{className:"nb-input font-[family-name:var(--font-mono)] text-sm",type:"password",value:a.apiKey??"",onChange:g=>d({apiKey:g.target.value}),placeholder:e.isNew?"sk-...":"••••(留空不改)",spellCheck:!1})]}),c.jsxs("div",{className:"flex flex-col gap-1",children:[c.jsx("label",{htmlFor:"provider-models",className:"text-sm font-bold",children:"Models"}),c.jsx(XK,{models:a.models,draft:o,onModelsChange:g=>d({models:g}),onDraftChange:u}),c.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:"输入模型名,按 Enter 或逗号添加"})]}),c.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[c.jsx("button",{className:"nb-btn",style:{padding:"8px 16px"},type:"button",onClick:n,children:"取消"}),c.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"8px 16px"},type:"button",disabled:!h||r,onClick:()=>i({...a,models:Ab(a.models,o)}),children:[r?c.jsx(Xe,{size:14,strokeWidth:3,className:"animate-spin"}):c.jsx(mr,{size:14,strokeWidth:3})," 保存"]})]})]})}function JK({isDefault:e,pickDefault:t,setDefaultPending:n}){const i=Ft(),{alert:r,confirm:a}=dn(),[o,u]=j.useState(!1),[d,h]=j.useState(null),[g,p]=j.useState(!1),[y,b]=j.useState(!1),[w,v]=j.useState(!1),k=Ve({queryKey:["codex-proxy"],queryFn:FK,refetchInterval:o?3e3:!1}).data;j.useEffect(()=>{o&&(k!=null&&k.authed)?(u(!1),h(null),i.invalidateQueries({queryKey:["codex-proxy"]})):o&&(k!=null&&k.authError)&&(u(!1),h(null),r({title:"授权失败",body:k.authError}))},[o,k==null?void 0:k.authed,k==null?void 0:k.authError,i,r]);const A=Et({mutationFn:qK,onSuccess:B=>{i.invalidateQueries({queryKey:["codex-proxy"]}),i.invalidateQueries({queryKey:["providers"]}),B.ok||r({title:"安装失败",body:(B.output||"未知错误").slice(-600)})},onError:B=>void r({title:"安装失败",body:B instanceof Error?B.message:String(B)})}),S=Et({mutationFn:B=>HK(B),onSuccess:B=>{p(!1),b(!1),i.invalidateQueries({queryKey:["codex-proxy"]}),i.invalidateQueries({queryKey:["providers"]}),i.invalidateQueries({queryKey:["system-agents"]}),B.ok||r({title:"卸载未完成",body:B.note??"删除失败(可能需 sudo)"})},onError:B=>void r({title:"卸载失败",body:B instanceof Error?B.message:String(B)})}),_=async()=>{await a({title:"安装 claude-code-proxy",body:"将运行官方安装脚本(curl … install.sh | bash),下载预编译二进制到 ~/.local/bin。继续?"})&&A.mutate()},C=async()=>{u(!0),h(null);try{const B=await KK();h(B)}catch(B){u(!1),r({title:"订阅失败",body:B instanceof Error?B.message:String(B)})}},T=()=>{GK(),u(!1),h(null)},R=A.isPending||(k==null?void 0:k.installing),O=w&&(k!=null&&k.models.all.length)?k.models.all:(k==null?void 0:k.models.curated)??[];return c.jsxs("div",{className:"rounded-lg px-3 py-2 border-2 border-[var(--color-text)]",children:[c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("span",{className:"font-[family-name:var(--font-mono)] font-bold text-sm",children:"codex-proxy"}),c.jsx("span",{className:"text-[var(--color-text-muted)] text-sm",children:" · ChatGPT 订阅"}),c.jsx("div",{className:"text-xs text-[var(--color-text-muted)] truncate",children:k?k.binInstalled?k.authed?`已订阅${k.account?` · ${k.account.slice(0,8)}…`:""} · worker 出 GPT`:k.nativeCodex.available?"已检测到本机 ChatGPT 订阅 · proxy 待独立授权":"已安装 · 未检测到 ChatGPT 登录":"未安装 claude-code-proxy":"加载中…"})]}),(k==null?void 0:k.binInstalled)&&c.jsx("button",{className:"nb-btn nb-btn-danger shrink-0",style:{padding:"4px 8px"},type:"button",onClick:()=>p(!0),"aria-label":"卸载 codex-proxy",children:c.jsx(Ki,{size:12,strokeWidth:3})})]}),c.jsx("div",{className:"mt-2",children:k?k.binInstalled?k.authed?c.jsxs("div",{className:"flex flex-wrap gap-1.5 items-center",children:[O.map(B=>{const P=e(B);return c.jsxs("button",{type:"button",onClick:()=>t(B),disabled:n,"aria-pressed":P,className:["px-2 py-0.5 rounded-md text-xs font-[family-name:var(--font-mono)] border-2 border-[var(--color-text)]",P?"bg-[var(--color-accent-mint)] font-bold":" hover:bg-[var(--color-bg-cream)]"].join(" "),title:P?"当前默认":"设为 worker 默认",children:[B,P?" ✓":""]},B)}),k.models.all.length>k.models.curated.length&&c.jsx("button",{type:"button",className:"text-xs text-[var(--color-text-muted)] underline",onClick:()=>v(B=>!B),children:w?"收起":`显示全部(${k.models.all.length})`})]}):c.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"4px 12px",fontSize:12},type:"button",onClick:C,children:[c.jsx(UL,{size:12,strokeWidth:3})," ",k.nativeCodex.available?"授权 proxy":"授权 ChatGPT"]}):c.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"4px 12px",fontSize:12},type:"button",disabled:!!R,onClick:_,children:[R?c.jsx(Xe,{size:12,strokeWidth:3,className:"animate-spin"}):c.jsx(Zh,{size:12,strokeWidth:3}),R?" 安装中…":" 安装插件"]}):c.jsx(Xe,{size:14,strokeWidth:3,className:"animate-spin text-[var(--color-text-muted)]"})}),o&&c.jsxs(RS,{onClose:T,children:[c.jsx("span",{className:"font-[family-name:var(--font-heading)] font-bold text-lg",children:"授权 codex-proxy(浏览器)"}),(k==null?void 0:k.nativeCodex.available)&&c.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:"已检测到本机 Codex CLI 的 ChatGPT 登录。codex-proxy 使用独立凭据,不读取或修改 ~/.codex;为避免令牌轮换冲突,需要为 proxy 单独授权一次。"}),d!=null&&d.authorizationUrl?c.jsxs("div",{className:"flex flex-col gap-3 text-sm",children:[c.jsxs("div",{children:["① 打开"," ",c.jsxs("a",{href:d.authorizationUrl,target:"_blank",rel:"noreferrer",className:"font-bold underline inline-flex items-center gap-1",children:["ChatGPT 授权页面 ",c.jsx(fL,{size:12,strokeWidth:3})]})]}),c.jsx("div",{children:"② 在浏览器完成授权,成功后会自动返回本机回调页面"}),c.jsxs("div",{className:"flex items-center gap-2 text-[var(--color-text-muted)]",children:[c.jsx(Xe,{size:14,strokeWidth:3,className:"animate-spin"})," 等待授权…(完成后自动刷新)"]})]}):c.jsxs("div",{className:"flex flex-col gap-2 text-sm text-[var(--color-text-muted)]",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Xe,{size:14,strokeWidth:3,className:"animate-spin"})," 正在生成浏览器授权地址…"]}),c.jsxs("div",{children:["若长时间无响应,可在终端运行 ",c.jsx("code",{className:"font-[family-name:var(--font-mono)]",children:"sps codex-proxy auth"}),"。"]})]}),c.jsx("div",{className:"flex justify-end pt-1",children:c.jsx("button",{className:"nb-btn",style:{padding:"6px 14px"},type:"button",onClick:T,children:"取消"})})]}),g&&c.jsxs(RS,{onClose:()=>p(!1),children:[c.jsx("span",{className:"font-[family-name:var(--font-heading)] font-bold text-lg",children:"卸载 claude-code-proxy"}),c.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:"停止 proxy 并删除二进制。默认保留授权(重装免再授权)。"}),c.jsxs("label",{className:"flex items-center gap-2 text-sm font-bold",children:[c.jsx("input",{type:"checkbox",checked:y,onChange:B=>b(B.target.checked)}),"同时清除 proxy 独立授权(macOS 钥匙串或配置目录)"]}),c.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[c.jsx("button",{className:"nb-btn",style:{padding:"6px 14px"},type:"button",onClick:()=>p(!1),children:"取消"}),c.jsxs("button",{className:"nb-btn nb-btn-danger",style:{padding:"6px 14px"},type:"button",disabled:S.isPending,onClick:()=>S.mutate(y),children:[S.isPending?c.jsx(Xe,{size:14,strokeWidth:3,className:"animate-spin"}):c.jsx(Ki,{size:14,strokeWidth:3})," 卸载"]})]})]})]})}function RS({children:e,onClose:t}){return c.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",onClick:t,children:c.jsx("div",{className:"border-[3px] border-[var(--color-text)] rounded-2xl p-6 bg-[var(--color-bg-cream)] shadow-[6px_6px_0_var(--color-text)] flex flex-col gap-4 w-[min(92vw,520px)]",onClick:n=>n.stopPropagation(),children:e})})}const eG=["telegram","dingtalk","matrix","slack","discord","feishu"],wu={telegram:"Telegram",dingtalk:"钉钉 (Stream)",matrix:"Matrix",slack:"Slack",discord:"Discord",feishu:"飞书 / Lark"},tG={telegram:[{key:"token",label:"Bot Token(@BotFather)",type:"password",placeholder:"123456:ABC-..."},{key:"allowedChatIds",label:"允许的 Chat ID(白名单,空=全放)",type:"list",placeholder:"逗号/换行分隔"}],dingtalk:[{key:"clientId",label:"Client ID(AppKey)",type:"text"},{key:"clientSecret",label:"Client Secret(AppSecret)",type:"password"},{key:"allowedConversations",label:"允许的会话 ID(白名单,空=全放)",type:"list"}],matrix:[{key:"homeserver",label:"Homeserver URL",type:"text",placeholder:"https://matrix.org"},{key:"accessToken",label:"Access Token",type:"password"},{key:"allowedRooms",label:"允许的 Room ID(白名单,空=全放)",type:"list"}],slack:[{key:"appToken",label:"App Token(xapp-,Socket Mode)",type:"password",placeholder:"xapp-..."},{key:"botToken",label:"Bot Token(xoxb-)",type:"password",placeholder:"xoxb-..."},{key:"allowedChannels",label:"允许的 Channel(白名单,空=全放)",type:"list"}],discord:[{key:"token",label:"Bot Token",type:"password"},{key:"allowedChannels",label:"允许的 Channel ID(白名单,空=全放)",type:"list"}],feishu:[{key:"appId",label:"App ID",type:"text"},{key:"appSecret",label:"App Secret",type:"password"},{key:"verificationToken",label:"Verification Token",type:"text"},{key:"encryptKey",label:"Encrypt Key(设了则事件 AES 解密)",type:"password"},{key:"port",label:"本机监听端口(默认 9800)",type:"number",placeholder:"9800"},{key:"path",label:"监听路径(默认 /feishu)",type:"text",placeholder:"/feishu"},{key:"allowedChats",label:"允许的 chat_id(白名单,空=全放)",type:"list"}]};function nG(){var w,v,N;const e=Ft(),{alert:t}=dn(),n=Ve({queryKey:["channels"],queryFn:$K}),[i,r]=j.useState(null),[a,o]=j.useState({type:"console"});j.useEffect(()=>{n.data&&!i&&r({console:n.data.console??{},adapters:n.data.adapters??[]})},[n.data,i]);const u=Et({mutationFn:()=>UK(i),onSuccess:k=>{r({console:k.console??{},adapters:k.adapters??[]}),e.invalidateQueries({queryKey:["channels"]})},onError:k=>void t({title:"保存失败",body:k instanceof Error?k.message:String(k)})});if(!i)return c.jsx("section",{className:"nb-card",children:c.jsxs("p",{className:"text-sm text-[var(--color-text-muted)] flex items-center gap-2",children:[c.jsx(Xe,{size:14,strokeWidth:3,className:"animate-spin"})," 加载频道配置…"]})});const d=i.adapters??[],h=JSON.stringify(i)!==JSON.stringify({console:((w=n.data)==null?void 0:w.console)??{},adapters:((v=n.data)==null?void 0:v.adapters)??[]}),g=k=>{const A=[...d,{kind:k,enabled:!0}];r({...i,adapters:A}),o({type:"adapter",index:A.length-1})},p=k=>{const A=d.filter((S,_)=>_!==k);r({...i,adapters:A}),o({type:"console"})},y=(k,A)=>{const S=d.map((_,C)=>C===k?{..._,...A}:_);r({...i,adapters:S})},b=k=>r({...i,console:{...i.console,...k}});return c.jsxs("section",{className:"nb-card",children:[c.jsxs("div",{className:"flex items-start justify-between gap-3 mb-1",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold",children:"频道(IM 网关)"}),c.jsxs("p",{className:"text-xs text-[var(--color-text-muted)] mt-1",children:["接入 Telegram / 钉钉 / 飞书 / Slack / Discord / Matrix。左侧选频道,右侧改设置。保存后 ",c.jsx("code",{className:"font-[family-name:var(--font-mono)]",children:"sps im"})," 重启生效。"]})]}),c.jsxs("button",{className:"nb-btn nb-btn-primary shrink-0",style:{padding:"8px 16px"},type:"button",disabled:!h||u.isPending,onClick:()=>u.mutate(),"aria-label":"保存频道配置",children:[u.isPending?c.jsx(Xe,{size:14,strokeWidth:3,className:"animate-spin"}):c.jsx(mr,{size:14,strokeWidth:3})," 保存"]})]}),c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-[220px_1fr] gap-5 mt-4",children:[c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsx(LS,{label:"console 桥接",sub:((N=i.console)==null?void 0:N.url)||"未配置",active:a.type==="console",onClick:()=>o({type:"console"})}),c.jsx("div",{className:"h-px bg-[var(--color-text)] opacity-20 my-1"}),d.length===0&&c.jsx("p",{className:"text-xs text-[var(--color-text-muted)] px-1",children:"(无频道)"}),d.map((k,A)=>c.jsx(LS,{label:wu[k.kind]??k.kind,sub:k.enabled===!1?"已停用":"启用",active:a.type==="adapter"&&a.index===A,onClick:()=>o({type:"adapter",index:A})},A)),c.jsxs("div",{className:"mt-2",children:[c.jsx("span",{className:"text-xs font-bold text-[var(--color-text-muted)]",children:"添加频道"}),c.jsx("div",{className:"flex flex-wrap gap-1.5 mt-1.5",children:eG.map(k=>c.jsxs("button",{className:"nb-btn",style:{padding:"4px 8px",fontSize:12},type:"button",onClick:()=>g(k),"aria-label":`添加 ${wu[k]} 频道`,children:[c.jsx(pi,{size:11,strokeWidth:3})," ",wu[k]]},k))})]})]}),c.jsx("div",{className:"border-2 bg-surface-input border-[var(--color-text)] rounded-xl p-4 bg-[var(--color-bg-cream)]",children:(()=>{if(a.type!=="adapter")return c.jsx(zS,{console:i.console??{},onChange:b});const k=d[a.index];if(!k)return c.jsx(zS,{console:i.console??{},onChange:b});const A=a.index;return c.jsx(iG,{adapter:k,onChange:S=>y(A,S),onRemove:()=>p(A)})})()})]})]})}function LS({label:e,sub:t,active:n,onClick:i}){return c.jsxs("button",{type:"button",onClick:i,"aria-pressed":n,className:["text-left rounded-lg px-3 py-2 border-2 border-[var(--color-text)] transition-transform duration-150",n?"bg-[var(--color-accent-mint)] shadow-[3px_3px_0_var(--color-text)]":"hover:-translate-x-px hover:-translate-y-px hover:shadow-[3px_3px_0_var(--color-text)]"].join(" "),children:[c.jsx("div",{className:"font-bold text-sm",children:e}),c.jsx("div",{className:"text-xs text-[var(--color-text-muted)] truncate font-[family-name:var(--font-mono)]",children:t})]})}function zS({console:e,onChange:t}){return c.jsxs("div",{className:"flex flex-col gap-4",children:[c.jsxs("div",{children:[c.jsx("span",{className:"font-[family-name:var(--font-heading)] font-bold text-lg",children:"console 桥接"}),c.jsx("p",{className:"text-xs text-[var(--color-text-muted)] mt-1",children:"IM 纯文本消息桥接到项目 agent 对话。设了 URL 才启用桥接;token 为 console 鉴权令牌。"})]}),c.jsxs("label",{className:"flex flex-col gap-1 text-sm font-bold",children:["Console URL",c.jsx("input",{className:"nb-input font-[family-name:var(--font-mono)] text-sm",value:e.url??"",onChange:n=>t({url:n.target.value}),placeholder:"http://localhost:4321",spellCheck:!1})]}),c.jsxs("label",{className:"flex flex-col gap-1 text-sm font-bold",children:["Console Token(SPS_CONSOLE_TOKEN)",c.jsx("input",{className:"nb-input font-[family-name:var(--font-mono)] text-sm",type:"password",value:e.token??"",onChange:n=>t({token:n.target.value}),placeholder:"鉴权令牌(可空)",spellCheck:!1})]}),c.jsxs("label",{className:"flex flex-col gap-1 text-sm font-bold",children:["对话后端",c.jsxs("select",{className:"nb-input",value:e.agentKind??"claude",onChange:n=>t({agentKind:n.target.value}),children:[c.jsx("option",{value:"claude",children:"claude"}),c.jsx("option",{value:"openai",children:"openai"})]})]})]})}function iG({adapter:e,onChange:t,onRemove:n}){const{confirm:i}=dn(),r=tG[e.kind]??[],a=e.enabled!==!1;return c.jsxs("div",{className:"flex flex-col gap-4",children:[c.jsxs("div",{className:"flex items-start justify-between gap-2",children:[c.jsxs("div",{children:[c.jsx("span",{className:"font-[family-name:var(--font-heading)] font-bold text-lg",children:wu[e.kind]??e.kind}),c.jsxs("span",{className:"text-[var(--color-text-muted)] text-sm font-[family-name:var(--font-mono)]",children:[" · ",e.kind]})]}),c.jsxs("button",{className:"nb-btn nb-btn-danger shrink-0",style:{padding:"4px 10px",fontSize:12},type:"button",onClick:async()=>{await i({title:"删除频道",body:`删除 ${wu[e.kind]??e.kind} 频道?`,danger:!0})&&n()},"aria-label":"删除频道",children:[c.jsx(Ki,{size:12,strokeWidth:3})," 删除"]})]}),c.jsxs("label",{className:"flex items-center gap-2 text-sm font-bold",children:[c.jsx("input",{type:"checkbox",checked:a,onChange:o=>t({enabled:o.target.checked})}),"启用此频道"]}),r.map(o=>c.jsx(rG,{spec:o,value:e[o.key],onChange:u=>t({[o.key]:u})},o.key))]})}function rG({spec:e,value:t,onChange:n}){if(e.type==="list"){const i=Array.isArray(t)?t.map(String):[];return c.jsxs("label",{className:"flex flex-col gap-1 text-sm font-bold",children:[e.label,c.jsx("textarea",{className:"nb-input font-[family-name:var(--font-mono)] text-sm",rows:2,value:i.join(", "),onChange:r=>{const a=r.target.value.split(/[,\n]/).map(o=>o.trim()).filter(Boolean);n(a.length?a:void 0)},placeholder:e.placeholder,spellCheck:!1})]})}return c.jsxs("label",{className:"flex flex-col gap-1 text-sm font-bold",children:[e.label,c.jsx("input",{className:"nb-input font-[family-name:var(--font-mono)] text-sm",type:e.type==="password"?"password":"text",value:t==null?"":String(t),onChange:i=>{const r=i.target.value;e.type==="number"?n(r.trim()===""?void 0:Number(r)):n(r===""?void 0:r)},placeholder:e.placeholder,spellCheck:!1})]})}function _n(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=_n(e[n]))!==""&&(t+=(t&&" ")+i);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var sG={value:()=>{}};function vp(){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 hh(n)}function hh(e){this._=e}function aG(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}})}hh.prototype=vp.prototype={constructor:hh,on:function(e,t){var n=this._,i=aG(e+"",n),r,a=-1,o=i.length;if(arguments.length<2){for(;++a<o;)if((r=(e=i[a]).type)&&(r=lG(n[r],e.name)))return r;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++a<o;)if(r=(e=i[a]).type)n[r]=IS(n[r],e.name,t);else if(t==null)for(r in n)n[r]=IS(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 hh(e)},call:function(e,t){if((r=arguments.length-2)>0)for(var n=new Array(r),i=0,r,a;i<r;++i)n[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(a=this._[e],i=0,r=a.length;i<r;++i)a[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,a=i.length;r<a;++r)i[r].value.apply(t,n)}};function lG(e,t){for(var n=0,i=e.length,r;n<i;++n)if((r=e[n]).name===t)return r.value}function IS(e,t,n){for(var i=0,r=e.length;i<r;++i)if(e[i].name===t){e[i]=sG,e=e.slice(0,i).concat(e.slice(i+1));break}return n!=null&&e.push({name:t,value:n}),e}var Tb="http://www.w3.org/1999/xhtml";const PS={svg:"http://www.w3.org/2000/svg",xhtml:Tb,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function wp(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),PS.hasOwnProperty(t)?{space:PS[t],local:e}:e}function oG(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Tb&&t.documentElement.namespaceURI===Tb?t.createElement(e):t.createElementNS(n,e)}}function cG(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function oA(e){var t=wp(e);return(t.local?cG:oG)(t)}function uG(){}function a0(e){return e==null?uG:function(){return this.querySelector(e)}}function dG(e){typeof e!="function"&&(e=a0(e));for(var t=this._groups,n=t.length,i=new Array(n),r=0;r<n;++r)for(var a=t[r],o=a.length,u=i[r]=new Array(o),d,h,g=0;g<o;++g)(d=a[g])&&(h=e.call(d,d.__data__,g,a))&&("__data__"in d&&(h.__data__=d.__data__),u[g]=h);return new Ci(i,this._parents)}function fG(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function hG(){return[]}function cA(e){return e==null?hG:function(){return this.querySelectorAll(e)}}function pG(e){return function(){return fG(e.apply(this,arguments))}}function mG(e){typeof e=="function"?e=pG(e):e=cA(e);for(var t=this._groups,n=t.length,i=[],r=[],a=0;a<n;++a)for(var o=t[a],u=o.length,d,h=0;h<u;++h)(d=o[h])&&(i.push(e.call(d,d.__data__,h,o)),r.push(d));return new Ci(i,r)}function uA(e){return function(){return this.matches(e)}}function dA(e){return function(t){return t.matches(e)}}var gG=Array.prototype.find;function yG(e){return function(){return gG.call(this.children,e)}}function bG(){return this.firstElementChild}function xG(e){return this.select(e==null?bG:yG(typeof e=="function"?e:dA(e)))}var vG=Array.prototype.filter;function wG(){return Array.from(this.children)}function kG(e){return function(){return vG.call(this.children,e)}}function EG(e){return this.selectAll(e==null?wG:kG(typeof e=="function"?e:dA(e)))}function SG(e){typeof e!="function"&&(e=uA(e));for(var t=this._groups,n=t.length,i=new Array(n),r=0;r<n;++r)for(var a=t[r],o=a.length,u=i[r]=[],d,h=0;h<o;++h)(d=a[h])&&e.call(d,d.__data__,h,a)&&u.push(d);return new Ci(i,this._parents)}function fA(e){return new Array(e.length)}function NG(){return new Ci(this._enter||this._groups.map(fA),this._parents)}function Ph(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Ph.prototype={constructor:Ph,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 _G(e){return function(){return e}}function jG(e,t,n,i,r,a){for(var o=0,u,d=t.length,h=a.length;o<h;++o)(u=t[o])?(u.__data__=a[o],i[o]=u):n[o]=new Ph(e,a[o]);for(;o<d;++o)(u=t[o])&&(r[o]=u)}function CG(e,t,n,i,r,a,o){var u,d,h=new Map,g=t.length,p=a.length,y=new Array(g),b;for(u=0;u<g;++u)(d=t[u])&&(y[u]=b=o.call(d,d.__data__,u,t)+"",h.has(b)?r[u]=d:h.set(b,d));for(u=0;u<p;++u)b=o.call(e,a[u],u,a)+"",(d=h.get(b))?(i[u]=d,d.__data__=a[u],h.delete(b)):n[u]=new Ph(e,a[u]);for(u=0;u<g;++u)(d=t[u])&&h.get(y[u])===d&&(r[u]=d)}function AG(e){return e.__data__}function TG(e,t){if(!arguments.length)return Array.from(this,AG);var n=t?CG:jG,i=this._parents,r=this._groups;typeof e!="function"&&(e=_G(e));for(var a=r.length,o=new Array(a),u=new Array(a),d=new Array(a),h=0;h<a;++h){var g=i[h],p=r[h],y=p.length,b=MG(e.call(g,g&&g.__data__,h,i)),w=b.length,v=u[h]=new Array(w),N=o[h]=new Array(w),k=d[h]=new Array(y);n(g,p,v,N,k,b,t);for(var A=0,S=0,_,C;A<w;++A)if(_=v[A]){for(A>=S&&(S=A+1);!(C=N[S])&&++S<w;);_._next=C||null}}return o=new Ci(o,i),o._enter=u,o._exit=d,o}function MG(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function DG(){return new Ci(this._exit||this._groups.map(fA),this._parents)}function OG(e,t,n){var i=this.enter(),r=this,a=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?a.remove():n(a),i&&r?i.merge(r).order():r}function RG(e){for(var t=e.selection?e.selection():e,n=this._groups,i=t._groups,r=n.length,a=i.length,o=Math.min(r,a),u=new Array(r),d=0;d<o;++d)for(var h=n[d],g=i[d],p=h.length,y=u[d]=new Array(p),b,w=0;w<p;++w)(b=h[w]||g[w])&&(y[w]=b);for(;d<r;++d)u[d]=n[d];return new Ci(u,this._parents)}function LG(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var i=e[t],r=i.length-1,a=i[r],o;--r>=0;)(o=i[r])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function zG(e){e||(e=IG);function t(p,y){return p&&y?e(p.__data__,y.__data__):!p-!y}for(var n=this._groups,i=n.length,r=new Array(i),a=0;a<i;++a){for(var o=n[a],u=o.length,d=r[a]=new Array(u),h,g=0;g<u;++g)(h=o[g])&&(d[g]=h);d.sort(t)}return new Ci(r,this._parents).order()}function IG(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function PG(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function BG(){return Array.from(this)}function $G(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var i=e[t],r=0,a=i.length;r<a;++r){var o=i[r];if(o)return o}return null}function UG(){let e=0;for(const t of this)++e;return e}function FG(){return!this.node()}function qG(e){for(var t=this._groups,n=0,i=t.length;n<i;++n)for(var r=t[n],a=0,o=r.length,u;a<o;++a)(u=r[a])&&e.call(u,u.__data__,a,r);return this}function HG(e){return function(){this.removeAttribute(e)}}function KG(e){return function(){this.removeAttributeNS(e.space,e.local)}}function GG(e,t){return function(){this.setAttribute(e,t)}}function VG(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function YG(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function WG(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 QG(e,t){var n=wp(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?KG:HG:typeof t=="function"?n.local?WG:YG:n.local?VG:GG)(n,t))}function hA(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function XG(e){return function(){this.style.removeProperty(e)}}function ZG(e,t,n){return function(){this.style.setProperty(e,t,n)}}function JG(e,t,n){return function(){var i=t.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,n)}}function eV(e,t,n){return arguments.length>1?this.each((t==null?XG:typeof t=="function"?JG:ZG)(e,t,n??"")):Ho(this.node(),e)}function Ho(e,t){return e.style.getPropertyValue(t)||hA(e).getComputedStyle(e,null).getPropertyValue(t)}function tV(e){return function(){delete this[e]}}function nV(e,t){return function(){this[e]=t}}function iV(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function rV(e,t){return arguments.length>1?this.each((t==null?tV:typeof t=="function"?iV:nV)(e,t)):this.node()[e]}function pA(e){return e.trim().split(/^|\s+/)}function l0(e){return e.classList||new mA(e)}function mA(e){this._node=e,this._names=pA(e.getAttribute("class")||"")}mA.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 gA(e,t){for(var n=l0(e),i=-1,r=t.length;++i<r;)n.add(t[i])}function yA(e,t){for(var n=l0(e),i=-1,r=t.length;++i<r;)n.remove(t[i])}function sV(e){return function(){gA(this,e)}}function aV(e){return function(){yA(this,e)}}function lV(e,t){return function(){(t.apply(this,arguments)?gA:yA)(this,e)}}function oV(e,t){var n=pA(e+"");if(arguments.length<2){for(var i=l0(this.node()),r=-1,a=n.length;++r<a;)if(!i.contains(n[r]))return!1;return!0}return this.each((typeof t=="function"?lV:t?sV:aV)(n,t))}function cV(){this.textContent=""}function uV(e){return function(){this.textContent=e}}function dV(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function fV(e){return arguments.length?this.each(e==null?cV:(typeof e=="function"?dV:uV)(e)):this.node().textContent}function hV(){this.innerHTML=""}function pV(e){return function(){this.innerHTML=e}}function mV(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function gV(e){return arguments.length?this.each(e==null?hV:(typeof e=="function"?mV:pV)(e)):this.node().innerHTML}function yV(){this.nextSibling&&this.parentNode.appendChild(this)}function bV(){return this.each(yV)}function xV(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function vV(){return this.each(xV)}function wV(e){var t=typeof e=="function"?e:oA(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function kV(){return null}function EV(e,t){var n=typeof e=="function"?e:oA(e),i=t==null?kV:typeof t=="function"?t:a0(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),i.apply(this,arguments)||null)})}function SV(){var e=this.parentNode;e&&e.removeChild(this)}function NV(){return this.each(SV)}function _V(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function jV(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function CV(e){return this.select(e?jV:_V)}function AV(e){return arguments.length?this.property("__data__",e):this.node().__data__}function TV(e){return function(t){e.call(this,t,this.__data__)}}function MV(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 DV(e){return function(){var t=this.__on;if(t){for(var n=0,i=-1,r=t.length,a;n<r;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++i]=a;++i?t.length=i:delete this.__on}}}function OV(e,t,n){return function(){var i=this.__on,r,a=TV(t);if(i){for(var o=0,u=i.length;o<u;++o)if((r=i[o]).type===e.type&&r.name===e.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=a,r.options=n),r.value=t;return}}this.addEventListener(e.type,a,n),r={type:e.type,name:e.name,value:t,listener:a,options:n},i?i.push(r):this.__on=[r]}}function RV(e,t,n){var i=MV(e+""),r,a=i.length,o;if(arguments.length<2){var u=this.node().__on;if(u){for(var d=0,h=u.length,g;d<h;++d)for(r=0,g=u[d];r<a;++r)if((o=i[r]).type===g.type&&o.name===g.name)return g.value}return}for(u=t?OV:DV,r=0;r<a;++r)this.each(u(i[r],t,n));return this}function bA(e,t,n){var i=hA(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 LV(e,t){return function(){return bA(this,e,t)}}function zV(e,t){return function(){return bA(this,e,t.apply(this,arguments))}}function IV(e,t){return this.each((typeof t=="function"?zV:LV)(e,t))}function*PV(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var i=e[t],r=0,a=i.length,o;r<a;++r)(o=i[r])&&(yield o)}var xA=[null];function Ci(e,t){this._groups=e,this._parents=t}function cd(){return new Ci([[document.documentElement]],xA)}function BV(){return this}Ci.prototype=cd.prototype={constructor:Ci,select:dG,selectAll:mG,selectChild:xG,selectChildren:EG,filter:SG,data:TG,enter:NG,exit:DG,join:OG,merge:RG,selection:BV,order:LG,sort:zG,call:PG,nodes:BG,node:$G,size:UG,empty:FG,each:qG,attr:QG,style:eV,property:rV,classed:oV,text:fV,html:gV,raise:bV,lower:vV,append:wV,insert:EV,remove:NV,clone:CV,datum:AV,on:RV,dispatch:IV,[Symbol.iterator]:PV};function _i(e){return typeof e=="string"?new Ci([[document.querySelector(e)]],[document.documentElement]):new Ci([[e]],xA)}function $V(e){let t;for(;t=e.sourceEvent;)e=t;return e}function sr(e,t){if(e=$V(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 UV={passive:!1},Ru={capture:!0,passive:!1};function jy(e){e.stopImmediatePropagation()}function jo(e){e.preventDefault(),e.stopImmediatePropagation()}function vA(e){var t=e.document.documentElement,n=_i(e).on("dragstart.drag",jo,Ru);"onselectstart"in t?n.on("selectstart.drag",jo,Ru):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function wA(e,t){var n=e.document.documentElement,i=_i(e).on("dragstart.drag",null);t&&(i.on("click.drag",jo,Ru),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 Yf=e=>()=>e;function Mb(e,{sourceEvent:t,subject:n,target:i,identifier:r,active:a,x:o,y:u,dx:d,dy:h,dispatch:g}){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:a,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:u,enumerable:!0,configurable:!0},dx:{value:d,enumerable:!0,configurable:!0},dy:{value:h,enumerable:!0,configurable:!0},_:{value:g}})}Mb.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function FV(e){return!e.ctrlKey&&!e.button}function qV(){return this.parentNode}function HV(e,t){return t??{x:e.x,y:e.y}}function KV(){return navigator.maxTouchPoints||"ontouchstart"in this}function kA(){var e=FV,t=qV,n=HV,i=KV,r={},a=vp("start","drag","end"),o=0,u,d,h,g,p=0;function y(_){_.on("mousedown.drag",b).filter(i).on("touchstart.drag",N).on("touchmove.drag",k,UV).on("touchend.drag touchcancel.drag",A).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function b(_,C){if(!(g||!e.call(this,_,C))){var T=S(this,t.call(this,_,C),_,C,"mouse");T&&(_i(_.view).on("mousemove.drag",w,Ru).on("mouseup.drag",v,Ru),vA(_.view),jy(_),h=!1,u=_.clientX,d=_.clientY,T("start",_))}}function w(_){if(jo(_),!h){var C=_.clientX-u,T=_.clientY-d;h=C*C+T*T>p}r.mouse("drag",_)}function v(_){_i(_.view).on("mousemove.drag mouseup.drag",null),wA(_.view,h),jo(_),r.mouse("end",_)}function N(_,C){if(e.call(this,_,C)){var T=_.changedTouches,R=t.call(this,_,C),O=T.length,B,P;for(B=0;B<O;++B)(P=S(this,R,_,C,T[B].identifier,T[B]))&&(jy(_),P("start",_,T[B]))}}function k(_){var C=_.changedTouches,T=C.length,R,O;for(R=0;R<T;++R)(O=r[C[R].identifier])&&(jo(_),O("drag",_,C[R]))}function A(_){var C=_.changedTouches,T=C.length,R,O;for(g&&clearTimeout(g),g=setTimeout(function(){g=null},500),R=0;R<T;++R)(O=r[C[R].identifier])&&(jy(_),O("end",_,C[R]))}function S(_,C,T,R,O,B){var P=a.copy(),F=sr(B||T,C),U,V,M;if((M=n.call(_,new Mb("beforestart",{sourceEvent:T,target:y,identifier:O,active:o,x:F[0],y:F[1],dx:0,dy:0,dispatch:P}),R))!=null)return U=M.x-F[0]||0,V=M.y-F[1]||0,function H($,K,W){var Y=F,I;switch($){case"start":r[O]=H,I=o++;break;case"end":delete r[O],--o;case"drag":F=sr(W||K,C),I=o;break}P.call($,_,new Mb($,{sourceEvent:K,subject:M,target:y,identifier:O,active:I,x:F[0]+U,y:F[1]+V,dx:F[0]-Y[0],dy:F[1]-Y[1],dispatch:P}),R)}}return y.filter=function(_){return arguments.length?(e=typeof _=="function"?_:Yf(!!_),y):e},y.container=function(_){return arguments.length?(t=typeof _=="function"?_:Yf(_),y):t},y.subject=function(_){return arguments.length?(n=typeof _=="function"?_:Yf(_),y):n},y.touchable=function(_){return arguments.length?(i=typeof _=="function"?_:Yf(!!_),y):i},y.on=function(){var _=a.on.apply(a,arguments);return _===a?y:_},y.clickDistance=function(_){return arguments.length?(p=(_=+_)*_,y):Math.sqrt(p)},y}function o0(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function EA(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function ud(){}var Lu=.7,Bh=1/Lu,Co="\\s*([+-]?\\d+)\\s*",zu="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Rr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",GV=/^#([0-9a-f]{3,8})$/,VV=new RegExp(`^rgb\\(${Co},${Co},${Co}\\)$`),YV=new RegExp(`^rgb\\(${Rr},${Rr},${Rr}\\)$`),WV=new RegExp(`^rgba\\(${Co},${Co},${Co},${zu}\\)$`),QV=new RegExp(`^rgba\\(${Rr},${Rr},${Rr},${zu}\\)$`),XV=new RegExp(`^hsl\\(${zu},${Rr},${Rr}\\)$`),ZV=new RegExp(`^hsla\\(${zu},${Rr},${Rr},${zu}\\)$`),BS={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};o0(ud,gl,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:$S,formatHex:$S,formatHex8:JV,formatHsl:eY,formatRgb:US,toString:US});function $S(){return this.rgb().formatHex()}function JV(){return this.rgb().formatHex8()}function eY(){return SA(this).formatHsl()}function US(){return this.rgb().formatRgb()}function gl(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=GV.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?FS(t):n===3?new hi(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Wf(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Wf(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=VV.exec(e))?new hi(t[1],t[2],t[3],1):(t=YV.exec(e))?new hi(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=WV.exec(e))?Wf(t[1],t[2],t[3],t[4]):(t=QV.exec(e))?Wf(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=XV.exec(e))?KS(t[1],t[2]/100,t[3]/100,1):(t=ZV.exec(e))?KS(t[1],t[2]/100,t[3]/100,t[4]):BS.hasOwnProperty(e)?FS(BS[e]):e==="transparent"?new hi(NaN,NaN,NaN,0):null}function FS(e){return new hi(e>>16&255,e>>8&255,e&255,1)}function Wf(e,t,n,i){return i<=0&&(e=t=n=NaN),new hi(e,t,n,i)}function tY(e){return e instanceof ud||(e=gl(e)),e?(e=e.rgb(),new hi(e.r,e.g,e.b,e.opacity)):new hi}function Db(e,t,n,i){return arguments.length===1?tY(e):new hi(e,t,n,i??1)}function hi(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}o0(hi,Db,EA(ud,{brighter(e){return e=e==null?Bh:Math.pow(Bh,e),new hi(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Lu:Math.pow(Lu,e),new hi(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new hi(cl(this.r),cl(this.g),cl(this.b),$h(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:qS,formatHex:qS,formatHex8:nY,formatRgb:HS,toString:HS}));function qS(){return`#${Ja(this.r)}${Ja(this.g)}${Ja(this.b)}`}function nY(){return`#${Ja(this.r)}${Ja(this.g)}${Ja(this.b)}${Ja((isNaN(this.opacity)?1:this.opacity)*255)}`}function HS(){const e=$h(this.opacity);return`${e===1?"rgb(":"rgba("}${cl(this.r)}, ${cl(this.g)}, ${cl(this.b)}${e===1?")":`, ${e})`}`}function $h(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function cl(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ja(e){return e=cl(e),(e<16?"0":"")+e.toString(16)}function KS(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ar(e,t,n,i)}function SA(e){if(e instanceof ar)return new ar(e.h,e.s,e.l,e.opacity);if(e instanceof ud||(e=gl(e)),!e)return new ar;if(e instanceof ar)return e;e=e.rgb();var t=e.r/255,n=e.g/255,i=e.b/255,r=Math.min(t,n,i),a=Math.max(t,n,i),o=NaN,u=a-r,d=(a+r)/2;return u?(t===a?o=(n-i)/u+(n<i)*6:n===a?o=(i-t)/u+2:o=(t-n)/u+4,u/=d<.5?a+r:2-a-r,o*=60):u=d>0&&d<1?0:o,new ar(o,u,d,e.opacity)}function iY(e,t,n,i){return arguments.length===1?SA(e):new ar(e,t,n,i??1)}function ar(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}o0(ar,iY,EA(ud,{brighter(e){return e=e==null?Bh:Math.pow(Bh,e),new ar(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Lu:Math.pow(Lu,e),new ar(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 hi(Cy(e>=240?e-240:e+120,r,i),Cy(e,r,i),Cy(e<120?e+240:e-120,r,i),this.opacity)},clamp(){return new ar(GS(this.h),Qf(this.s),Qf(this.l),$h(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=$h(this.opacity);return`${e===1?"hsl(":"hsla("}${GS(this.h)}, ${Qf(this.s)*100}%, ${Qf(this.l)*100}%${e===1?")":`, ${e})`}`}}));function GS(e){return e=(e||0)%360,e<0?e+360:e}function Qf(e){return Math.max(0,Math.min(1,e||0))}function Cy(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 c0=e=>()=>e;function rY(e,t){return function(n){return e+n*t}}function sY(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 aY(e){return(e=+e)==1?NA:function(t,n){return n-t?sY(t,n,e):c0(isNaN(t)?n:t)}}function NA(e,t){var n=t-e;return n?rY(e,n):c0(isNaN(e)?t:e)}const Uh=(function e(t){var n=aY(t);function i(r,a){var o=n((r=Db(r)).r,(a=Db(a)).r),u=n(r.g,a.g),d=n(r.b,a.b),h=NA(r.opacity,a.opacity);return function(g){return r.r=o(g),r.g=u(g),r.b=d(g),r.opacity=h(g),r+""}}return i.gamma=e,i})(1);function lY(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,i=t.slice(),r;return function(a){for(r=0;r<n;++r)i[r]=e[r]*(1-a)+t[r]*a;return i}}function oY(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function cY(e,t){var n=t?t.length:0,i=e?Math.min(n,e.length):0,r=new Array(i),a=new Array(n),o;for(o=0;o<i;++o)r[o]=ku(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(u){for(o=0;o<i;++o)a[o]=r[o](u);return a}}function uY(e,t){var n=new Date;return e=+e,t=+t,function(i){return n.setTime(e*(1-i)+t*i),n}}function Mr(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function dY(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]=ku(e[r],t[r]):i[r]=t[r];return function(a){for(r in n)i[r]=n[r](a);return i}}var Ob=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ay=new RegExp(Ob.source,"g");function fY(e){return function(){return e}}function hY(e){return function(t){return e(t)+""}}function _A(e,t){var n=Ob.lastIndex=Ay.lastIndex=0,i,r,a,o=-1,u=[],d=[];for(e=e+"",t=t+"";(i=Ob.exec(e))&&(r=Ay.exec(t));)(a=r.index)>n&&(a=t.slice(n,a),u[o]?u[o]+=a:u[++o]=a),(i=i[0])===(r=r[0])?u[o]?u[o]+=r:u[++o]=r:(u[++o]=null,d.push({i:o,x:Mr(i,r)})),n=Ay.lastIndex;return n<t.length&&(a=t.slice(n),u[o]?u[o]+=a:u[++o]=a),u.length<2?d[0]?hY(d[0].x):fY(t):(t=d.length,function(h){for(var g=0,p;g<t;++g)u[(p=d[g]).i]=p.x(h);return u.join("")})}function ku(e,t){var n=typeof t,i;return t==null||n==="boolean"?c0(t):(n==="number"?Mr:n==="string"?(i=gl(t))?(t=i,Uh):_A:t instanceof gl?Uh:t instanceof Date?uY:oY(t)?lY:Array.isArray(t)?cY:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?dY:Mr)(e,t)}var VS=180/Math.PI,Rb={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function jA(e,t,n,i,r,a){var o,u,d;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(d=e*n+t*i)&&(n-=e*d,i-=t*d),(u=Math.sqrt(n*n+i*i))&&(n/=u,i/=u,d/=u),e*i<t*n&&(e=-e,t=-t,d=-d,o=-o),{translateX:r,translateY:a,rotate:Math.atan2(t,e)*VS,skewX:Math.atan(d)*VS,scaleX:o,scaleY:u}}var Xf;function pY(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Rb:jA(t.a,t.b,t.c,t.d,t.e,t.f)}function mY(e){return e==null||(Xf||(Xf=document.createElementNS("http://www.w3.org/2000/svg","g")),Xf.setAttribute("transform",e),!(e=Xf.transform.baseVal.consolidate()))?Rb:(e=e.matrix,jA(e.a,e.b,e.c,e.d,e.e,e.f))}function CA(e,t,n,i){function r(h){return h.length?h.pop()+" ":""}function a(h,g,p,y,b,w){if(h!==p||g!==y){var v=b.push("translate(",null,t,null,n);w.push({i:v-4,x:Mr(h,p)},{i:v-2,x:Mr(g,y)})}else(p||y)&&b.push("translate("+p+t+y+n)}function o(h,g,p,y){h!==g?(h-g>180?g+=360:g-h>180&&(h+=360),y.push({i:p.push(r(p)+"rotate(",null,i)-2,x:Mr(h,g)})):g&&p.push(r(p)+"rotate("+g+i)}function u(h,g,p,y){h!==g?y.push({i:p.push(r(p)+"skewX(",null,i)-2,x:Mr(h,g)}):g&&p.push(r(p)+"skewX("+g+i)}function d(h,g,p,y,b,w){if(h!==p||g!==y){var v=b.push(r(b)+"scale(",null,",",null,")");w.push({i:v-4,x:Mr(h,p)},{i:v-2,x:Mr(g,y)})}else(p!==1||y!==1)&&b.push(r(b)+"scale("+p+","+y+")")}return function(h,g){var p=[],y=[];return h=e(h),g=e(g),a(h.translateX,h.translateY,g.translateX,g.translateY,p,y),o(h.rotate,g.rotate,p,y),u(h.skewX,g.skewX,p,y),d(h.scaleX,h.scaleY,g.scaleX,g.scaleY,p,y),h=g=null,function(b){for(var w=-1,v=y.length,N;++w<v;)p[(N=y[w]).i]=N.x(b);return p.join("")}}}var gY=CA(pY,"px, ","px)","deg)"),yY=CA(mY,", ",")",")"),bY=1e-12;function YS(e){return((e=Math.exp(e))+1/e)/2}function xY(e){return((e=Math.exp(e))-1/e)/2}function vY(e){return((e=Math.exp(2*e))-1)/(e+1)}const ph=(function e(t,n,i){function r(a,o){var u=a[0],d=a[1],h=a[2],g=o[0],p=o[1],y=o[2],b=g-u,w=p-d,v=b*b+w*w,N,k;if(v<bY)k=Math.log(y/h)/t,N=function(R){return[u+R*b,d+R*w,h*Math.exp(t*R*k)]};else{var A=Math.sqrt(v),S=(y*y-h*h+i*v)/(2*h*n*A),_=(y*y-h*h-i*v)/(2*y*n*A),C=Math.log(Math.sqrt(S*S+1)-S),T=Math.log(Math.sqrt(_*_+1)-_);k=(T-C)/t,N=function(R){var O=R*k,B=YS(C),P=h/(n*A)*(B*vY(t*O+C)-xY(C));return[u+P*b,d+P*w,h*B/YS(t*O+C)]}}return N.duration=k*1e3*t/Math.SQRT2,N}return r.rho=function(a){var o=Math.max(.001,+a),u=o*o,d=u*u;return e(o,u,d)},r})(Math.SQRT2,2,4);var Ko=0,pu=0,ou=0,AA=1e3,Fh,mu,qh=0,yl=0,kp=0,Iu=typeof performance=="object"&&performance.now?performance:Date,TA=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function u0(){return yl||(TA(wY),yl=Iu.now()+kp)}function wY(){yl=0}function Hh(){this._call=this._time=this._next=null}Hh.prototype=MA.prototype={constructor:Hh,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?u0():+n)+(t==null?0:+t),!this._next&&mu!==this&&(mu?mu._next=this:Fh=this,mu=this),this._call=e,this._time=n,Lb()},stop:function(){this._call&&(this._call=null,this._time=1/0,Lb())}};function MA(e,t,n){var i=new Hh;return i.restart(e,t,n),i}function kY(){u0(),++Ko;for(var e=Fh,t;e;)(t=yl-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Ko}function WS(){yl=(qh=Iu.now())+kp,Ko=pu=0;try{kY()}finally{Ko=0,SY(),yl=0}}function EY(){var e=Iu.now(),t=e-qh;t>AA&&(kp-=t,qh=e)}function SY(){for(var e,t=Fh,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:Fh=n);mu=e,Lb(i)}function Lb(e){if(!Ko){pu&&(pu=clearTimeout(pu));var t=e-yl;t>24?(e<1/0&&(pu=setTimeout(WS,e-Iu.now()-kp)),ou&&(ou=clearInterval(ou))):(ou||(qh=Iu.now(),ou=setInterval(EY,AA)),Ko=1,TA(WS))}}function QS(e,t,n){var i=new Hh;return t=t==null?0:+t,i.restart(r=>{i.stop(),e(r+t)},t,n),i}var NY=vp("start","end","cancel","interrupt"),_Y=[],DA=0,XS=1,zb=2,mh=3,ZS=4,Ib=5,gh=6;function Ep(e,t,n,i,r,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;jY(e,n,{name:t,index:i,group:r,on:NY,tween:_Y,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:DA})}function d0(e,t){var n=br(e,t);if(n.state>DA)throw new Error("too late; already scheduled");return n}function Pr(e,t){var n=br(e,t);if(n.state>mh)throw new Error("too late; already running");return n}function br(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function jY(e,t,n){var i=e.__transition,r;i[t]=n,n.timer=MA(a,0,n.time);function a(h){n.state=XS,n.timer.restart(o,n.delay,n.time),n.delay<=h&&o(h-n.delay)}function o(h){var g,p,y,b;if(n.state!==XS)return d();for(g in i)if(b=i[g],b.name===n.name){if(b.state===mh)return QS(o);b.state===ZS?(b.state=gh,b.timer.stop(),b.on.call("interrupt",e,e.__data__,b.index,b.group),delete i[g]):+g<t&&(b.state=gh,b.timer.stop(),b.on.call("cancel",e,e.__data__,b.index,b.group),delete i[g])}if(QS(function(){n.state===mh&&(n.state=ZS,n.timer.restart(u,n.delay,n.time),u(h))}),n.state=zb,n.on.call("start",e,e.__data__,n.index,n.group),n.state===zb){for(n.state=mh,r=new Array(y=n.tween.length),g=0,p=-1;g<y;++g)(b=n.tween[g].value.call(e,e.__data__,n.index,n.group))&&(r[++p]=b);r.length=p+1}}function u(h){for(var g=h<n.duration?n.ease.call(null,h/n.duration):(n.timer.restart(d),n.state=Ib,1),p=-1,y=r.length;++p<y;)r[p].call(e,g);n.state===Ib&&(n.on.call("end",e,e.__data__,n.index,n.group),d())}function d(){n.state=gh,n.timer.stop(),delete i[t];for(var h in i)return;delete e.__transition}}function yh(e,t){var n=e.__transition,i,r,a=!0,o;if(n){t=t==null?null:t+"";for(o in n){if((i=n[o]).name!==t){a=!1;continue}r=i.state>zb&&i.state<Ib,i.state=gh,i.timer.stop(),i.on.call(r?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete n[o]}a&&delete e.__transition}}function CY(e){return this.each(function(){yh(this,e)})}function AY(e,t){var n,i;return function(){var r=Pr(this,e),a=r.tween;if(a!==n){i=n=a;for(var o=0,u=i.length;o<u;++o)if(i[o].name===t){i=i.slice(),i.splice(o,1);break}}r.tween=i}}function TY(e,t,n){var i,r;if(typeof n!="function")throw new Error;return function(){var a=Pr(this,e),o=a.tween;if(o!==i){r=(i=o).slice();for(var u={name:t,value:n},d=0,h=r.length;d<h;++d)if(r[d].name===t){r[d]=u;break}d===h&&r.push(u)}a.tween=r}}function MY(e,t){var n=this._id;if(e+="",arguments.length<2){for(var i=br(this.node(),n).tween,r=0,a=i.length,o;r<a;++r)if((o=i[r]).name===e)return o.value;return null}return this.each((t==null?AY:TY)(n,e,t))}function f0(e,t,n){var i=e._id;return e.each(function(){var r=Pr(this,i);(r.value||(r.value={}))[t]=n.apply(this,arguments)}),function(r){return br(r,i).value[t]}}function OA(e,t){var n;return(typeof t=="number"?Mr:t instanceof gl?Uh:(n=gl(t))?(t=n,Uh):_A)(e,t)}function DY(e){return function(){this.removeAttribute(e)}}function OY(e){return function(){this.removeAttributeNS(e.space,e.local)}}function RY(e,t,n){var i,r=n+"",a;return function(){var o=this.getAttribute(e);return o===r?null:o===i?a:a=t(i=o,n)}}function LY(e,t,n){var i,r=n+"",a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===r?null:o===i?a:a=t(i=o,n)}}function zY(e,t,n){var i,r,a;return function(){var o,u=n(this),d;return u==null?void this.removeAttribute(e):(o=this.getAttribute(e),d=u+"",o===d?null:o===i&&d===r?a:(r=d,a=t(i=o,u)))}}function IY(e,t,n){var i,r,a;return function(){var o,u=n(this),d;return u==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),d=u+"",o===d?null:o===i&&d===r?a:(r=d,a=t(i=o,u)))}}function PY(e,t){var n=wp(e),i=n==="transform"?yY:OA;return this.attrTween(e,typeof t=="function"?(n.local?IY:zY)(n,i,f0(this,"attr."+e,t)):t==null?(n.local?OY:DY)(n):(n.local?LY:RY)(n,i,t))}function BY(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function $Y(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function UY(e,t){var n,i;function r(){var a=t.apply(this,arguments);return a!==i&&(n=(i=a)&&$Y(e,a)),n}return r._value=t,r}function FY(e,t){var n,i;function r(){var a=t.apply(this,arguments);return a!==i&&(n=(i=a)&&BY(e,a)),n}return r._value=t,r}function qY(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=wp(e);return this.tween(n,(i.local?UY:FY)(i,t))}function HY(e,t){return function(){d0(this,e).delay=+t.apply(this,arguments)}}function KY(e,t){return t=+t,function(){d0(this,e).delay=t}}function GY(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?HY:KY)(t,e)):br(this.node(),t).delay}function VY(e,t){return function(){Pr(this,e).duration=+t.apply(this,arguments)}}function YY(e,t){return t=+t,function(){Pr(this,e).duration=t}}function WY(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?VY:YY)(t,e)):br(this.node(),t).duration}function QY(e,t){if(typeof t!="function")throw new Error;return function(){Pr(this,e).ease=t}}function XY(e){var t=this._id;return arguments.length?this.each(QY(t,e)):br(this.node(),t).ease}function ZY(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Pr(this,e).ease=n}}function JY(e){if(typeof e!="function")throw new Error;return this.each(ZY(this._id,e))}function eW(e){typeof e!="function"&&(e=uA(e));for(var t=this._groups,n=t.length,i=new Array(n),r=0;r<n;++r)for(var a=t[r],o=a.length,u=i[r]=[],d,h=0;h<o;++h)(d=a[h])&&e.call(d,d.__data__,h,a)&&u.push(d);return new xs(i,this._parents,this._name,this._id)}function tW(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,i=t.length,r=n.length,a=Math.min(i,r),o=new Array(i),u=0;u<a;++u)for(var d=t[u],h=n[u],g=d.length,p=o[u]=new Array(g),y,b=0;b<g;++b)(y=d[b]||h[b])&&(p[b]=y);for(;u<i;++u)o[u]=t[u];return new xs(o,this._parents,this._name,this._id)}function nW(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 iW(e,t,n){var i,r,a=nW(t)?d0:Pr;return function(){var o=a(this,e),u=o.on;u!==i&&(r=(i=u).copy()).on(t,n),o.on=r}}function rW(e,t){var n=this._id;return arguments.length<2?br(this.node(),n).on.on(e):this.each(iW(n,e,t))}function sW(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function aW(){return this.on("end.remove",sW(this._id))}function lW(e){var t=this._name,n=this._id;typeof e!="function"&&(e=a0(e));for(var i=this._groups,r=i.length,a=new Array(r),o=0;o<r;++o)for(var u=i[o],d=u.length,h=a[o]=new Array(d),g,p,y=0;y<d;++y)(g=u[y])&&(p=e.call(g,g.__data__,y,u))&&("__data__"in g&&(p.__data__=g.__data__),h[y]=p,Ep(h[y],t,n,y,h,br(g,n)));return new xs(a,this._parents,t,n)}function oW(e){var t=this._name,n=this._id;typeof e!="function"&&(e=cA(e));for(var i=this._groups,r=i.length,a=[],o=[],u=0;u<r;++u)for(var d=i[u],h=d.length,g,p=0;p<h;++p)if(g=d[p]){for(var y=e.call(g,g.__data__,p,d),b,w=br(g,n),v=0,N=y.length;v<N;++v)(b=y[v])&&Ep(b,t,n,v,y,w);a.push(y),o.push(g)}return new xs(a,o,t,n)}var cW=cd.prototype.constructor;function uW(){return new cW(this._groups,this._parents)}function dW(e,t){var n,i,r;return function(){var a=Ho(this,e),o=(this.style.removeProperty(e),Ho(this,e));return a===o?null:a===n&&o===i?r:r=t(n=a,i=o)}}function RA(e){return function(){this.style.removeProperty(e)}}function fW(e,t,n){var i,r=n+"",a;return function(){var o=Ho(this,e);return o===r?null:o===i?a:a=t(i=o,n)}}function hW(e,t,n){var i,r,a;return function(){var o=Ho(this,e),u=n(this),d=u+"";return u==null&&(d=u=(this.style.removeProperty(e),Ho(this,e))),o===d?null:o===i&&d===r?a:(r=d,a=t(i=o,u))}}function pW(e,t){var n,i,r,a="style."+t,o="end."+a,u;return function(){var d=Pr(this,e),h=d.on,g=d.value[a]==null?u||(u=RA(t)):void 0;(h!==n||r!==g)&&(i=(n=h).copy()).on(o,r=g),d.on=i}}function mW(e,t,n){var i=(e+="")=="transform"?gY:OA;return t==null?this.styleTween(e,dW(e,i)).on("end.style."+e,RA(e)):typeof t=="function"?this.styleTween(e,hW(e,i,f0(this,"style."+e,t))).each(pW(this._id,e)):this.styleTween(e,fW(e,i,t),n).on("end.style."+e,null)}function gW(e,t,n){return function(i){this.style.setProperty(e,t.call(this,i),n)}}function yW(e,t,n){var i,r;function a(){var o=t.apply(this,arguments);return o!==r&&(i=(r=o)&&gW(e,o,n)),i}return a._value=t,a}function bW(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,yW(e,t,n??""))}function xW(e){return function(){this.textContent=e}}function vW(e){return function(){var t=e(this);this.textContent=t??""}}function wW(e){return this.tween("text",typeof e=="function"?vW(f0(this,"text",e)):xW(e==null?"":e+""))}function kW(e){return function(t){this.textContent=e.call(this,t)}}function EW(e){var t,n;function i(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&kW(r)),t}return i._value=e,i}function SW(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,EW(e))}function NW(){for(var e=this._name,t=this._id,n=LA(),i=this._groups,r=i.length,a=0;a<r;++a)for(var o=i[a],u=o.length,d,h=0;h<u;++h)if(d=o[h]){var g=br(d,t);Ep(d,e,n,h,o,{time:g.time+g.delay+g.duration,delay:0,duration:g.duration,ease:g.ease})}return new xs(i,this._parents,e,n)}function _W(){var e,t,n=this,i=n._id,r=n.size();return new Promise(function(a,o){var u={value:o},d={value:function(){--r===0&&a()}};n.each(function(){var h=Pr(this,i),g=h.on;g!==e&&(t=(e=g).copy(),t._.cancel.push(u),t._.interrupt.push(u),t._.end.push(d)),h.on=t}),r===0&&a()})}var jW=0;function xs(e,t,n,i){this._groups=e,this._parents=t,this._name=n,this._id=i}function LA(){return++jW}var as=cd.prototype;xs.prototype={constructor:xs,select:lW,selectAll:oW,selectChild:as.selectChild,selectChildren:as.selectChildren,filter:eW,merge:tW,selection:uW,transition:NW,call:as.call,nodes:as.nodes,node:as.node,size:as.size,empty:as.empty,each:as.each,on:rW,attr:PY,attrTween:qY,style:mW,styleTween:bW,text:wW,textTween:SW,remove:aW,tween:MY,delay:GY,duration:WY,ease:XY,easeVarying:JY,end:_W,[Symbol.iterator]:as[Symbol.iterator]};function CW(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var AW={time:null,delay:0,duration:250,ease:CW};function TW(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 MW(e){var t,n;e instanceof xs?(t=e._id,e=e._name):(t=LA(),(n=AW).time=u0(),e=e==null?null:e+"");for(var i=this._groups,r=i.length,a=0;a<r;++a)for(var o=i[a],u=o.length,d,h=0;h<u;++h)(d=o[h])&&Ep(d,e,t,h,o,n||TW(d,t));return new xs(i,this._parents,e,t)}cd.prototype.interrupt=CY;cd.prototype.transition=MW;const Zf=e=>()=>e;function DW(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 hs(e,t,n){this.k=e,this.x=t,this.y=n}hs.prototype={constructor:hs,scale:function(e){return e===1?this:new hs(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new hs(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 Sp=new hs(1,0,0);zA.prototype=hs.prototype;function zA(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Sp;return e.__zoom}function Ty(e){e.stopImmediatePropagation()}function cu(e){e.preventDefault(),e.stopImmediatePropagation()}function OW(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function RW(){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 JS(){return this.__zoom||Sp}function LW(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function zW(){return navigator.maxTouchPoints||"ontouchstart"in this}function IW(e,t,n){var i=e.invertX(t[0][0])-n[0][0],r=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(r>i?(i+r)/2:Math.min(0,i)||Math.max(0,r),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function IA(){var e=OW,t=RW,n=IW,i=LW,r=zW,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],u=250,d=ph,h=vp("start","zoom","end"),g,p,y,b=500,w=150,v=0,N=10;function k(M){M.property("__zoom",JS).on("wheel.zoom",O,{passive:!1}).on("mousedown.zoom",B).on("dblclick.zoom",P).filter(r).on("touchstart.zoom",F).on("touchmove.zoom",U).on("touchend.zoom touchcancel.zoom",V).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}k.transform=function(M,H,$,K){var W=M.selection?M.selection():M;W.property("__zoom",JS),M!==W?C(M,H,$,K):W.interrupt().each(function(){T(this,arguments).event(K).start().zoom(null,typeof H=="function"?H.apply(this,arguments):H).end()})},k.scaleBy=function(M,H,$,K){k.scaleTo(M,function(){var W=this.__zoom.k,Y=typeof H=="function"?H.apply(this,arguments):H;return W*Y},$,K)},k.scaleTo=function(M,H,$,K){k.transform(M,function(){var W=t.apply(this,arguments),Y=this.__zoom,I=$==null?_(W):typeof $=="function"?$.apply(this,arguments):$,L=Y.invert(I),G=typeof H=="function"?H.apply(this,arguments):H;return n(S(A(Y,G),I,L),W,o)},$,K)},k.translateBy=function(M,H,$,K){k.transform(M,function(){return n(this.__zoom.translate(typeof H=="function"?H.apply(this,arguments):H,typeof $=="function"?$.apply(this,arguments):$),t.apply(this,arguments),o)},null,K)},k.translateTo=function(M,H,$,K,W){k.transform(M,function(){var Y=t.apply(this,arguments),I=this.__zoom,L=K==null?_(Y):typeof K=="function"?K.apply(this,arguments):K;return n(Sp.translate(L[0],L[1]).scale(I.k).translate(typeof H=="function"?-H.apply(this,arguments):-H,typeof $=="function"?-$.apply(this,arguments):-$),Y,o)},K,W)};function A(M,H){return H=Math.max(a[0],Math.min(a[1],H)),H===M.k?M:new hs(H,M.x,M.y)}function S(M,H,$){var K=H[0]-$[0]*M.k,W=H[1]-$[1]*M.k;return K===M.x&&W===M.y?M:new hs(M.k,K,W)}function _(M){return[(+M[0][0]+ +M[1][0])/2,(+M[0][1]+ +M[1][1])/2]}function C(M,H,$,K){M.on("start.zoom",function(){T(this,arguments).event(K).start()}).on("interrupt.zoom end.zoom",function(){T(this,arguments).event(K).end()}).tween("zoom",function(){var W=this,Y=arguments,I=T(W,Y).event(K),L=t.apply(W,Y),G=$==null?_(L):typeof $=="function"?$.apply(W,Y):$,z=Math.max(L[1][0]-L[0][0],L[1][1]-L[0][1]),te=W.__zoom,me=typeof H=="function"?H.apply(W,Y):H,ye=d(te.invert(G).concat(z/te.k),me.invert(G).concat(z/me.k));return function(Se){if(Se===1)Se=me;else{var re=ye(Se),he=z/re[2];Se=new hs(he,G[0]-re[0]*he,G[1]-re[1]*he)}I.zoom(null,Se)}})}function T(M,H,$){return!$&&M.__zooming||new R(M,H)}function R(M,H){this.that=M,this.args=H,this.active=0,this.sourceEvent=null,this.extent=t.apply(M,H),this.taps=0}R.prototype={event:function(M){return M&&(this.sourceEvent=M),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(M,H){return this.mouse&&M!=="mouse"&&(this.mouse[1]=H.invert(this.mouse[0])),this.touch0&&M!=="touch"&&(this.touch0[1]=H.invert(this.touch0[0])),this.touch1&&M!=="touch"&&(this.touch1[1]=H.invert(this.touch1[0])),this.that.__zoom=H,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(M){var H=_i(this.that).datum();h.call(M,this.that,new DW(M,{sourceEvent:this.sourceEvent,target:k,transform:this.that.__zoom,dispatch:h}),H)}};function O(M,...H){if(!e.apply(this,arguments))return;var $=T(this,H).event(M),K=this.__zoom,W=Math.max(a[0],Math.min(a[1],K.k*Math.pow(2,i.apply(this,arguments)))),Y=sr(M);if($.wheel)($.mouse[0][0]!==Y[0]||$.mouse[0][1]!==Y[1])&&($.mouse[1]=K.invert($.mouse[0]=Y)),clearTimeout($.wheel);else{if(K.k===W)return;$.mouse=[Y,K.invert(Y)],yh(this),$.start()}cu(M),$.wheel=setTimeout(I,w),$.zoom("mouse",n(S(A(K,W),$.mouse[0],$.mouse[1]),$.extent,o));function I(){$.wheel=null,$.end()}}function B(M,...H){if(y||!e.apply(this,arguments))return;var $=M.currentTarget,K=T(this,H,!0).event(M),W=_i(M.view).on("mousemove.zoom",G,!0).on("mouseup.zoom",z,!0),Y=sr(M,$),I=M.clientX,L=M.clientY;vA(M.view),Ty(M),K.mouse=[Y,this.__zoom.invert(Y)],yh(this),K.start();function G(te){if(cu(te),!K.moved){var me=te.clientX-I,ye=te.clientY-L;K.moved=me*me+ye*ye>v}K.event(te).zoom("mouse",n(S(K.that.__zoom,K.mouse[0]=sr(te,$),K.mouse[1]),K.extent,o))}function z(te){W.on("mousemove.zoom mouseup.zoom",null),wA(te.view,K.moved),cu(te),K.event(te).end()}}function P(M,...H){if(e.apply(this,arguments)){var $=this.__zoom,K=sr(M.changedTouches?M.changedTouches[0]:M,this),W=$.invert(K),Y=$.k*(M.shiftKey?.5:2),I=n(S(A($,Y),K,W),t.apply(this,H),o);cu(M),u>0?_i(this).transition().duration(u).call(C,I,K,M):_i(this).call(k.transform,I,K,M)}}function F(M,...H){if(e.apply(this,arguments)){var $=M.touches,K=$.length,W=T(this,H,M.changedTouches.length===K).event(M),Y,I,L,G;for(Ty(M),I=0;I<K;++I)L=$[I],G=sr(L,this),G=[G,this.__zoom.invert(G),L.identifier],W.touch0?!W.touch1&&W.touch0[2]!==G[2]&&(W.touch1=G,W.taps=0):(W.touch0=G,Y=!0,W.taps=1+!!g);g&&(g=clearTimeout(g)),Y&&(W.taps<2&&(p=G[0],g=setTimeout(function(){g=null},b)),yh(this),W.start())}}function U(M,...H){if(this.__zooming){var $=T(this,H).event(M),K=M.changedTouches,W=K.length,Y,I,L,G;for(cu(M),Y=0;Y<W;++Y)I=K[Y],L=sr(I,this),$.touch0&&$.touch0[2]===I.identifier?$.touch0[0]=L:$.touch1&&$.touch1[2]===I.identifier&&($.touch1[0]=L);if(I=$.that.__zoom,$.touch1){var z=$.touch0[0],te=$.touch0[1],me=$.touch1[0],ye=$.touch1[1],Se=(Se=me[0]-z[0])*Se+(Se=me[1]-z[1])*Se,re=(re=ye[0]-te[0])*re+(re=ye[1]-te[1])*re;I=A(I,Math.sqrt(Se/re)),L=[(z[0]+me[0])/2,(z[1]+me[1])/2],G=[(te[0]+ye[0])/2,(te[1]+ye[1])/2]}else if($.touch0)L=$.touch0[0],G=$.touch0[1];else return;$.zoom("touch",n(S(I,L,G),$.extent,o))}}function V(M,...H){if(this.__zooming){var $=T(this,H).event(M),K=M.changedTouches,W=K.length,Y,I;for(Ty(M),y&&clearTimeout(y),y=setTimeout(function(){y=null},b),Y=0;Y<W;++Y)I=K[Y],$.touch0&&$.touch0[2]===I.identifier?delete $.touch0:$.touch1&&$.touch1[2]===I.identifier&&delete $.touch1;if($.touch1&&!$.touch0&&($.touch0=$.touch1,delete $.touch1),$.touch0)$.touch0[1]=this.__zoom.invert($.touch0[0]);else if($.end(),$.taps===2&&(I=sr(I,this),Math.hypot(p[0]-I[0],p[1]-I[1])<N)){var L=_i(this).on("dblclick.zoom");L&&L.apply(this,arguments)}}}return k.wheelDelta=function(M){return arguments.length?(i=typeof M=="function"?M:Zf(+M),k):i},k.filter=function(M){return arguments.length?(e=typeof M=="function"?M:Zf(!!M),k):e},k.touchable=function(M){return arguments.length?(r=typeof M=="function"?M:Zf(!!M),k):r},k.extent=function(M){return arguments.length?(t=typeof M=="function"?M:Zf([[+M[0][0],+M[0][1]],[+M[1][0],+M[1][1]]]),k):t},k.scaleExtent=function(M){return arguments.length?(a[0]=+M[0],a[1]=+M[1],k):[a[0],a[1]]},k.translateExtent=function(M){return arguments.length?(o[0][0]=+M[0][0],o[1][0]=+M[1][0],o[0][1]=+M[0][1],o[1][1]=+M[1][1],k):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},k.constrain=function(M){return arguments.length?(n=M,k):n},k.duration=function(M){return arguments.length?(u=+M,k):u},k.interpolate=function(M){return arguments.length?(d=M,k):d},k.on=function(){var M=h.on.apply(h,arguments);return M===h?k:M},k.clickDistance=function(M){return arguments.length?(v=(M=+M)*M,k):Math.sqrt(v)},k.tapDistance=function(M){return arguments.length?(N=+M,k):N},k}const hr={error001:(e="react")=>`Seems like you have not used ${e==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id: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.",error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},Pu=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],PA=["Enter"," ","Escape"],BA={"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 Go;(function(e){e.Strict="strict",e.Loose="loose"})(Go||(Go={}));var ul;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(ul||(ul={}));var Bu;(function(e){e.Partial="partial",e.Full="full"})(Bu||(Bu={}));const $A={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var ca;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(ca||(ca={}));var Kh;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Kh||(Kh={}));var Ke;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Ke||(Ke={}));const eN={[Ke.Left]:Ke.Right,[Ke.Right]:Ke.Left,[Ke.Top]:Ke.Bottom,[Ke.Bottom]:Ke.Top};function UA(e){return e===null?null:e?"valid":"invalid"}const FA=e=>"id"in e&&"source"in e&&"target"in e,PW=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),h0=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),dd=(e,t=[0,0])=>{const{width:n,height:i}=ws(e),r=e.origin??t,a=n*r[0],o=i*r[1];return{x:e.position.x-a,y:e.position.y-o}},BW=(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 a=typeof r=="string";let o=!t.nodeLookup&&!a?r:void 0;t.nodeLookup&&(o=a?t.nodeLookup.get(r):h0(r)?r:t.nodeLookup.get(r.id));const u=o?Gh(o,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Np(i,u)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return _p(n)},fd=(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=Np(n,Gh(r)),i=!0)}),i?_p(n):{x:0,y:0,width:0,height:0}},p0=(e,t,[n,i,r]=[0,0,1],a=!1,o=!1)=>{const u=(t.x-n)/r,d=(t.y-i)/r,h=t.width/r,g=t.height/r,p=[];for(const y of e.values()){const{measured:b,selectable:w=!0,hidden:v=!1}=y;if(o&&!w||v)continue;const N=b.width??y.width??y.initialWidth??0,k=b.height??y.height??y.initialHeight??0,{x:A,y:S}=y.internals.positionAbsolute,_=GA(u,d,h,g,A,S,N,k),C=N*k,T=a&&_>0;(!y.internals.handleBounds||T||_>=C||y.dragging)&&p.push(y)}return p},$W=(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 UW(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 FW({nodes:e,width:t,height:n,panZoom:i,minZoom:r,maxZoom:a},o){if(e.size===0)return!0;const u=UW(e,o),d=fd(u),h=g0(d,t,n,(o==null?void 0:o.minZoom)??r,(o==null?void 0:o.maxZoom)??a,(o==null?void 0:o.padding)??.1);return await i.setViewport(h,{duration:o==null?void 0:o.duration,ease:o==null?void 0:o.ease,interpolate:o==null?void 0:o.interpolate}),!0}function qA({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:i=[0,0],nodeExtent:r,onError:a}){const o=n.get(e),u=o.parentId?n.get(o.parentId):void 0,{x:d,y:h}=u?u.internals.positionAbsolute:{x:0,y:0},g=o.origin??i;let p=o.extent||r;if(o.extent==="parent"&&!o.expandParent)if(!u)a==null||a("005",hr.error005());else{const b=u.measured.width,w=u.measured.height;b&&w&&(p=[[d,h],[d+b,h+w]])}else u&&xl(o.extent)&&(p=[[o.extent[0][0]+d,o.extent[0][1]+h],[o.extent[1][0]+d,o.extent[1][1]+h]]);const y=xl(p)?bl(t,p,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&(a==null||a("015",hr.error015())),{position:{x:y.x-d+(o.measured.width??0)*g[0],y:y.y-h+(o.measured.height??0)*g[1]},positionAbsolute:y}}async function qW({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:i,onBeforeDelete:r}){const a=new Set(e.map(y=>y.id)),o=[];for(const y of n){if(y.deletable===!1)continue;const b=a.has(y.id),w=!b&&y.parentId&&o.find(v=>v.id===y.parentId);(b||w)&&o.push(y)}const u=new Set(t.map(y=>y.id)),d=i.filter(y=>y.deletable!==!1),g=$W(o,d);for(const y of d)u.has(y.id)&&!g.find(w=>w.id===y.id)&&g.push(y);if(!r)return{edges:g,nodes:o};const p=await r({nodes:o,edges:g});return typeof p=="boolean"?p?{edges:g,nodes:o}:{edges:[],nodes:[]}:p}const Vo=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),bl=(e={x:0,y:0},t,n)=>({x:Vo(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Vo(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function HA(e,t,n){const{width:i,height:r}=ws(n),{x:a,y:o}=n.internals.positionAbsolute;return bl(e,[[a,o],[a+i,o+r]],t)}const tN=(e,t,n)=>e<t?Vo(Math.abs(e-t),1,t)/t:e>n?-Vo(Math.abs(e-n),1,t)/t:0,m0=(e,t,n=15,i=40)=>{const r=tN(e.x,i,t.width-i)*n,a=tN(e.y,i,t.height-i)*n;return[r,a]},Np=(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)}),Pb=({x:e,y:t,width:n,height:i})=>({x:e,y:t,x2:e+n,y2:t+i}),_p=({x:e,y:t,x2:n,y2:i})=>({x:e,y:t,width:n-e,height:i-t}),$u=(e,t=[0,0])=>{var r,a;const{x:n,y:i}=h0(e)?e.internals.positionAbsolute:dd(e,t);return{x:n,y:i,width:((r=e.measured)==null?void 0:r.width)??e.width??e.initialWidth??0,height:((a=e.measured)==null?void 0:a.height)??e.height??e.initialHeight??0}},Gh=(e,t=[0,0])=>{var r,a;const{x:n,y:i}=h0(e)?e.internals.positionAbsolute:dd(e,t);return{x:n,y:i,x2:n+(((r=e.measured)==null?void 0:r.width)??e.width??e.initialWidth??0),y2:i+(((a=e.measured)==null?void 0:a.height)??e.height??e.initialHeight??0)}},KA=(e,t)=>_p(Np(Pb(e),Pb(t))),GA=(e,t,n,i,r,a,o,u)=>{const d=Math.max(0,Math.min(e+n,r+o)-Math.max(e,r)),h=Math.max(0,Math.min(t+i,a+u)-Math.max(t,a));return Math.ceil(d*h)},Vh=(e,t)=>GA(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),nN=e=>or(e.width)&&or(e.height)&&or(e.x)&&or(e.y),or=e=>!isNaN(e)&&isFinite(e),VA=(e,t)=>(n,i)=>{},hd=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),pd=({x:e,y:t},[n,i,r],a=!1,o=[1,1])=>{const u={x:(e-n)/r,y:(t-i)/r};return a?hd(u,o):u},Yo=({x:e,y:t},[n,i,r])=>({x:e*r+n,y:t*r+i});function fo(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(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function HW(e,t,n){if(typeof e=="string"||typeof e=="number"){const i=fo(e,n),r=fo(e,t);return{top:i,right:r,bottom:i,left:r,x:r*2,y:i*2}}if(typeof e=="object"){const i=fo(e.top??e.y??0,n),r=fo(e.bottom??e.y??0,n),a=fo(e.left??e.x??0,t),o=fo(e.right??e.x??0,t);return{top:i,right:o,bottom:r,left:a,x:a+o,y:i+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function KW(e,t,n,i,r,a){const{x:o,y:u}=Yo(e,[t,n,i]),{x:d,y:h}=Yo({x:e.x+e.width,y:e.y+e.height},[t,n,i]),g=r-d,p=a-h;return{left:Math.floor(o),top:Math.floor(u),right:Math.floor(g),bottom:Math.floor(p)}}const g0=(e,t,n,i,r,a)=>{const o=HW(a,t,n),u=(t-o.x)/e.width,d=(n-o.y)/e.height,h=Math.min(u,d),g=Vo(h,i,r),p=e.x+e.width/2,y=e.y+e.height/2,b=t/2-p*g,w=n/2-y*g,v=KW(e,b,w,g,t,n),N={left:Math.min(v.left-o.left,0),top:Math.min(v.top-o.top,0),right:Math.min(v.right-o.right,0),bottom:Math.min(v.bottom-o.bottom,0)};return{x:b-N.left+N.right,y:w-N.top+N.bottom,zoom:g}},Uu=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function xl(e){return e!=null&&e!=="parent"}function ws(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 YA(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 WA(e,t={width:0,height:0},n,i,r){const a={...e},o=i.get(n);if(o){const u=o.origin||r;a.x+=o.internals.positionAbsolute.x-(t.width??0)*u[0],a.y+=o.internals.positionAbsolute.y-(t.height??0)*u[1]}return a}function iN(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function GW(){let e,t;return{promise:new Promise((i,r)=>{e=i,t=r}),resolve:e,reject:t}}function VW(e){return{...BA,...e||{}}}function Eu(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:i,containerBounds:r}){const{x:a,y:o}=cr(e),u=pd({x:a-((r==null?void 0:r.left)??0),y:o-((r==null?void 0:r.top)??0)},i),{x:d,y:h}=n?hd(u,t):u;return{xSnapped:d,ySnapped:h,...u}}const y0=e=>({width:e.offsetWidth,height:e.offsetHeight}),QA=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},YW=["INPUT","SELECT","TEXTAREA"];function XA(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:YW.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const ZA=e=>"clientX"in e,cr=(e,t)=>{var a,o;const n=ZA(e),i=n?e.clientX:(a=e.touches)==null?void 0:a[0].clientX,r=n?e.clientY:(o=e.touches)==null?void 0:o[0].clientY;return{x:i-((t==null?void 0:t.left)??0),y:r-((t==null?void 0:t.top)??0)}},rN=(e,t,n,i,r)=>{const a=t.querySelectorAll(`.${e}`);return!a||!a.length?null:Array.from(a).map(o=>{const u=o.getBoundingClientRect();return{id:o.getAttribute("data-handleid"),type:e,nodeId:r,position:o.getAttribute("data-handlepos"),x:(u.left-n.left)/i,y:(u.top-n.top)/i,...y0(o)}})};function JA({sourceX:e,sourceY:t,targetX:n,targetY:i,sourceControlX:r,sourceControlY:a,targetControlX:o,targetControlY:u}){const d=e*.125+r*.375+o*.375+n*.125,h=t*.125+a*.375+u*.375+i*.125,g=Math.abs(d-e),p=Math.abs(h-t);return[d,h,g,p]}function Jf(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function sN({pos:e,x1:t,y1:n,x2:i,y2:r,c:a}){switch(e){case Ke.Left:return[t-Jf(t-i,a),n];case Ke.Right:return[t+Jf(i-t,a),n];case Ke.Top:return[t,n-Jf(n-r,a)];case Ke.Bottom:return[t,n+Jf(r-n,a)]}}function eT({sourceX:e,sourceY:t,sourcePosition:n=Ke.Bottom,targetX:i,targetY:r,targetPosition:a=Ke.Top,curvature:o=.25}){const[u,d]=sN({pos:n,x1:e,y1:t,x2:i,y2:r,c:o}),[h,g]=sN({pos:a,x1:i,y1:r,x2:e,y2:t,c:o}),[p,y,b,w]=JA({sourceX:e,sourceY:t,targetX:i,targetY:r,sourceControlX:u,sourceControlY:d,targetControlX:h,targetControlY:g});return[`M${e},${t} C${u},${d} ${h},${g} ${i},${r}`,p,y,b,w]}function tT({sourceX:e,sourceY:t,targetX:n,targetY:i}){const r=Math.abs(n-e)/2,a=n<e?n+r:n-r,o=Math.abs(i-t)/2,u=i<t?i+o:i-o;return[a,u,r,o]}function WW({sourceNode:e,targetNode:t,selected:n=!1,zIndex:i=0,elevateOnSelect:r=!1,zIndexMode:a="basic"}){if(a==="manual")return i;const o=r&&n?i+1e3:i,u=Math.max(e.parentId||r&&e.selected?e.internals.z:0,t.parentId||r&&t.selected?t.internals.z:0);return o+u}function QW({sourceNode:e,targetNode:t,width:n,height:i,transform:r}){const a=Np(Gh(e),Gh(t));a.x===a.x2&&(a.x2+=1),a.y===a.y2&&(a.y2+=1);const o={x:-r[0]/r[2],y:-r[1]/r[2],width:n/r[2],height:i/r[2]};return Vh(o,_p(a))>0}const XW=({source:e,sourceHandle:t,target:n,targetHandle:i})=>`xy-edge__${e}${t||""}-${n}${i||""}`,ZW=(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)),JW=(e,t,n={})=>{var a;if(!e.source||!e.target)return(a=n.onError)==null||a.call(n,"006",hr.error006()),t;const i=n.getEdgeId||XW;let r;return FA(e)?r={...e}:r={...e,id:i(e)},ZW(r,t)?t:(r.sourceHandle===null&&delete r.sourceHandle,r.targetHandle===null&&delete r.targetHandle,t.concat(r))};function nT({sourceX:e,sourceY:t,targetX:n,targetY:i}){const[r,a,o,u]=tT({sourceX:e,sourceY:t,targetX:n,targetY:i});return[`M ${e},${t}L ${n},${i}`,r,a,o,u]}const aN={[Ke.Left]:{x:-1,y:0},[Ke.Right]:{x:1,y:0},[Ke.Top]:{x:0,y:-1},[Ke.Bottom]:{x:0,y:1}},eQ=({source:e,sourcePosition:t=Ke.Bottom,target:n})=>t===Ke.Left||t===Ke.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},lN=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function tQ({source:e,sourcePosition:t=Ke.Bottom,target:n,targetPosition:i=Ke.Top,center:r,offset:a,stepPosition:o}){const u=aN[t],d=aN[i],h={x:e.x+u.x*a,y:e.y+u.y*a},g={x:n.x+d.x*a,y:n.y+d.y*a},p=eQ({source:h,sourcePosition:t,target:g}),y=p.x!==0?"x":"y",b=p[y];let w=[],v,N;const k={x:0,y:0},A={x:0,y:0},[,,S,_]=tT({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(u[y]*d[y]===-1){y==="x"?(v=r.x??h.x+(g.x-h.x)*o,N=r.y??(h.y+g.y)/2):(v=r.x??(h.x+g.x)/2,N=r.y??h.y+(g.y-h.y)*o);const O=[{x:v,y:h.y},{x:v,y:g.y}],B=[{x:h.x,y:N},{x:g.x,y:N}];u[y]===b?w=y==="x"?O:B:w=y==="x"?B:O}else{const O=[{x:h.x,y:g.y}],B=[{x:g.x,y:h.y}];if(y==="x"?w=u.x===b?B:O:w=u.y===b?O:B,t===i){const M=Math.abs(e[y]-n[y]);if(M<=a){const H=Math.min(a-1,a-M);u[y]===b?k[y]=(h[y]>e[y]?-1:1)*H:A[y]=(g[y]>n[y]?-1:1)*H}}if(t!==i){const M=y==="x"?"y":"x",H=u[y]===d[M],$=h[M]>g[M],K=h[M]<g[M];(u[y]===1&&(!H&&$||H&&K)||u[y]!==1&&(!H&&K||H&&$))&&(w=y==="x"?O:B)}const P={x:h.x+k.x,y:h.y+k.y},F={x:g.x+A.x,y:g.y+A.y},U=Math.max(Math.abs(P.x-w[0].x),Math.abs(F.x-w[0].x)),V=Math.max(Math.abs(P.y-w[0].y),Math.abs(F.y-w[0].y));U>=V?(v=(P.x+F.x)/2,N=w[0].y):(v=w[0].x,N=(P.y+F.y)/2)}const C={x:h.x+k.x,y:h.y+k.y},T={x:g.x+A.x,y:g.y+A.y};return[[e,...C.x!==w[0].x||C.y!==w[0].y?[C]:[],...w,...T.x!==w[w.length-1].x||T.y!==w[w.length-1].y?[T]:[],n],v,N,S,_]}function nQ(e,t,n,i){const r=Math.min(lN(e,t)/2,lN(t,n)/2,i),{x:a,y:o}=t;if(e.x===a&&a===n.x||e.y===o&&o===n.y)return`L${a} ${o}`;if(e.y===o){const h=e.x<n.x?-1:1,g=e.y<n.y?1:-1;return`L ${a+r*h},${o}Q ${a},${o} ${a},${o+r*g}`}const u=e.x<n.x?1:-1,d=e.y<n.y?-1:1;return`L ${a},${o+r*d}Q ${a},${o} ${a+r*u},${o}`}function Bb({sourceX:e,sourceY:t,sourcePosition:n=Ke.Bottom,targetX:i,targetY:r,targetPosition:a=Ke.Top,borderRadius:o=5,centerX:u,centerY:d,offset:h=20,stepPosition:g=.5}){const[p,y,b,w,v]=tQ({source:{x:e,y:t},sourcePosition:n,target:{x:i,y:r},targetPosition:a,center:{x:u,y:d},offset:h,stepPosition:g});let N=`M${p[0].x} ${p[0].y}`;for(let k=1;k<p.length-1;k++)N+=nQ(p[k-1],p[k],p[k+1],o);return N+=`L${p[p.length-1].x} ${p[p.length-1].y}`,[N,y,b,w,v]}function oN(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function iQ(e){var p;const{sourceNode:t,targetNode:n}=e;if(!oN(t)||!oN(n))return null;const i=t.internals.handleBounds||cN(t.handles),r=n.internals.handleBounds||cN(n.handles),a=uN((i==null?void 0:i.source)??[],e.sourceHandle),o=uN(e.connectionMode===Go.Strict?(r==null?void 0:r.target)??[]:((r==null?void 0:r.target)??[]).concat((r==null?void 0:r.source)??[]),e.targetHandle);if(!a||!o)return(p=e.onError)==null||p.call(e,"008",hr.error008(a?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const u=(a==null?void 0:a.position)||Ke.Bottom,d=(o==null?void 0:o.position)||Ke.Top,h=vl(t,a,u),g=vl(n,o,d);return{sourceX:h.x,sourceY:h.y,targetX:g.x,targetY:g.y,sourcePosition:u,targetPosition:d}}function cN(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 vl(e,t,n=Ke.Left,i=!1){const r=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,a=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:o,height:u}=t??ws(e);if(i)return{x:r+o/2,y:a+u/2};switch((t==null?void 0:t.position)??n){case Ke.Top:return{x:r+o/2,y:a};case Ke.Right:return{x:r+o,y:a+u/2};case Ke.Bottom:return{x:r+o/2,y:a+u};case Ke.Left:return{x:r,y:a+u/2}}}function uN(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function $b(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(i=>`${i}=${e[i]}`).join("&")}`:""}function rQ(e,{id:t,defaultColor:n,defaultMarkerStart:i,defaultMarkerEnd:r}){const a=new Set;return e.reduce((o,u)=>([u.markerStart||i,u.markerEnd||r].forEach(d=>{if(d&&typeof d=="object"){const h=$b(d,t);a.has(h)||(o.push({id:h,color:d.color||n,...d}),a.add(h))}}),o),[]).sort((o,u)=>o.id.localeCompare(u.id))}const iT=1e3,sQ=10,b0={nodeOrigin:[0,0],nodeExtent:Pu,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},aQ={...b0,checkEquality:!0};function x0(e,t){const n={...e};for(const i in t)t[i]!==void 0&&(n[i]=t[i]);return n}function lQ(e,t,n){const i=x0(b0,n);for(const r of e.values())if(r.parentId)w0(r,e,t,i);else{const a=dd(r,i.nodeOrigin),o=xl(r.extent)?r.extent:i.nodeExtent,u=bl(a,o,ws(r));r.internals.positionAbsolute=u}}function oQ(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 a={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(a):r.type==="target"&&i.push(a)}return{source:n,target:i}}function v0(e){return e==="manual"}function Ub(e,t,n,i={}){var g,p;const r=x0(aQ,i),a={i:0},o=new Map(t),u=r!=null&&r.elevateNodesOnSelect&&!v0(r.zIndexMode)?iT:0;let d=e.length>0,h=!1;t.clear(),n.clear();for(const y of e){let b=o.get(y.id);if(r.checkEquality&&y===(b==null?void 0:b.internals.userNode))t.set(y.id,b);else{const w=dd(y,r.nodeOrigin),v=xl(y.extent)?y.extent:r.nodeExtent,N=bl(w,v,ws(y));b={...r.defaults,...y,measured:{width:(g=y.measured)==null?void 0:g.width,height:(p=y.measured)==null?void 0:p.height},internals:{positionAbsolute:N,handleBounds:oQ(y,b),z:rT(y,u,r.zIndexMode),userNode:y}},t.set(y.id,b)}(b.measured===void 0||b.measured.width===void 0||b.measured.height===void 0)&&!b.hidden&&(d=!1),y.parentId&&w0(b,t,n,i,a),h||(h=y.selected??!1)}return{nodesInitialized:d,hasSelectedNodes:h}}function cQ(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 w0(e,t,n,i,r){const{elevateNodesOnSelect:a,nodeOrigin:o,nodeExtent:u,zIndexMode:d}=x0(b0,i),h=e.parentId,g=t.get(h);if(!g){console.warn(`Parent node ${h} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}cQ(e,n),r&&!g.parentId&&g.internals.rootParentIndex===void 0&&d==="auto"&&(g.internals.rootParentIndex=++r.i,g.internals.z=g.internals.z+r.i*sQ),r&&g.internals.rootParentIndex!==void 0&&(r.i=g.internals.rootParentIndex);const p=a&&!v0(d)?iT:0,{x:y,y:b,z:w}=uQ(e,g,o,u,p,d),{positionAbsolute:v}=e.internals,N=y!==v.x||b!==v.y;(N||w!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:N?{x:y,y:b}:v,z:w}})}function rT(e,t,n){const i=or(e.zIndex)?e.zIndex:0;return v0(n)?i:i+(e.selected?t:0)}function uQ(e,t,n,i,r,a){const{x:o,y:u}=t.internals.positionAbsolute,d=ws(e),h=dd(e,n),g=xl(e.extent)?bl(h,e.extent,d):h;let p=bl({x:o+g.x,y:u+g.y},i,d);e.extent==="parent"&&(p=HA(p,d,t));const y=rT(e,r,a),b=t.internals.z??0;return{x:p.x,y:p.y,z:b>=y?b+1:y}}function k0(e,t,n,i=[0,0]){var o;const r=[],a=new Map;for(const u of e){const d=t.get(u.parentId);if(!d)continue;const h=((o=a.get(u.parentId))==null?void 0:o.expandedRect)??$u(d),g=KA(h,u.rect);a.set(u.parentId,{expandedRect:g,parent:d})}return a.size>0&&a.forEach(({expandedRect:u,parent:d},h)=>{var S;const g=d.internals.positionAbsolute,p=ws(d),y=d.origin??i,b=u.x<g.x?Math.round(Math.abs(g.x-u.x)):0,w=u.y<g.y?Math.round(Math.abs(g.y-u.y)):0,v=Math.max(p.width,Math.round(u.width)),N=Math.max(p.height,Math.round(u.height)),k=(v-p.width)*y[0],A=(N-p.height)*y[1];(b>0||w>0||k||A)&&(r.push({id:h,type:"position",position:{x:d.position.x-b+k,y:d.position.y-w+A}}),(S=n.get(h))==null||S.forEach(_=>{e.some(C=>C.id===_.id)||r.push({id:_.id,type:"position",position:{x:_.position.x+b,y:_.position.y+w}})})),(p.width<u.width||p.height<u.height||b||w)&&r.push({id:h,type:"dimensions",setAttributes:!0,dimensions:{width:v+(b?y[0]*b-k:0),height:N+(w?y[1]*w-A:0)}})}),r}function dQ(e,t,n,i,r,a,o){const u=i==null?void 0:i.querySelector(".xyflow__viewport");let d=!1;if(!u)return{changes:[],updatedInternals:d};const h=[],g=window.getComputedStyle(u),{m22:p}=new window.DOMMatrixReadOnly(g.transform),y=[];for(const b of e.values()){const w=t.get(b.id);if(!w)continue;if(w.hidden){t.set(w.id,{...w,internals:{...w.internals,handleBounds:void 0}}),d=!0;continue}const v=y0(b.nodeElement),N=w.measured.width!==v.width||w.measured.height!==v.height;if(!!(v.width&&v.height&&(N||!w.internals.handleBounds||b.force))){const A=b.nodeElement.getBoundingClientRect(),S=xl(w.extent)?w.extent:a;let{positionAbsolute:_}=w.internals;w.parentId&&w.extent==="parent"?_=HA(_,v,t.get(w.parentId)):S&&(_=bl(_,S,v));const C={...w,measured:v,internals:{...w.internals,positionAbsolute:_,handleBounds:{source:rN("source",b.nodeElement,A,p,w.id),target:rN("target",b.nodeElement,A,p,w.id)}}};t.set(w.id,C),w.parentId&&w0(C,t,n,{nodeOrigin:r,zIndexMode:o}),d=!0,N&&(h.push({id:w.id,type:"dimensions",dimensions:v}),w.expandParent&&w.parentId&&y.push({id:w.id,parentId:w.parentId,rect:$u(C,r)}))}}if(y.length>0){const b=k0(y,t,n,r);h.push(...b)}return{changes:h,updatedInternals:d}}async function fQ({delta:e,panZoom:t,transform:n,translateExtent:i,width:r,height:a}){if(!t||!e.x&&!e.y)return!1;const o=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[r,a]],i);return!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2])}function dN(e,t,n,i,r,a){let o=r;const u=i.get(o)||new Map;i.set(o,u.set(n,t)),o=`${r}-${e}`;const d=i.get(o)||new Map;if(i.set(o,d.set(n,t)),a){o=`${r}-${e}-${a}`;const h=i.get(o)||new Map;i.set(o,h.set(n,t))}}function sT(e,t,n){e.clear(),t.clear();for(const i of n){const{source:r,target:a,sourceHandle:o=null,targetHandle:u=null}=i,d={edgeId:i.id,source:r,target:a,sourceHandle:o,targetHandle:u},h=`${r}-${o}--${a}-${u}`,g=`${a}-${u}--${r}-${o}`;dN("source",d,g,e,r,o),dN("target",d,h,e,a,u),t.set(i.id,i)}}function aT(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:aT(n,t):!1}function fN(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 hQ(e,t,n,i){const r=new Map;for(const[a,o]of e)if((o.selected||o.id===i)&&(!o.parentId||!aT(o,e))&&(o.draggable||t&&typeof o.draggable>"u")){const u=e.get(a);u&&r.set(a,{id:a,position:u.position||{x:0,y:0},distance:{x:n.x-u.internals.positionAbsolute.x,y:n.y-u.internals.positionAbsolute.y},extent:u.extent,parentId:u.parentId,origin:u.origin,expandParent:u.expandParent,internals:{positionAbsolute:u.internals.positionAbsolute||{x:0,y:0}},measured:{width:u.measured.width??0,height:u.measured.height??0}})}return r}function My({nodeId:e,dragItems:t,nodeLookup:n,dragging:i=!0}){var o,u,d;const r=[];for(const[h,g]of t){const p=(o=n.get(h))==null?void 0:o.internals.userNode;p&&r.push({...p,position:g.position,dragging:i})}if(!e)return[r[0],r];const a=(u=n.get(e))==null?void 0:u.internals.userNode;return[a?{...a,position:((d=t.get(e))==null?void 0:d.position)||a.position,dragging:i}:r[0],r]}function pQ({dragItems:e,snapGrid:t,x:n,y:i}){const r=e.values().next().value;if(!r)return null;const a={x:n-r.distance.x,y:i-r.distance.y},o=hd(a,t);return{x:o.x-a.x,y:o.y-a.y}}function mQ({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:i,onDragStop:r}){let a={x:null,y:null},o=0,u=new Map,d=!1,h={x:0,y:0},g=null,p=!1,y=null,b=!1,w=!1,v=null;function N({noDragClassName:A,handleSelector:S,domNode:_,isSelectable:C,nodeId:T,nodeClickDistance:R=0}){y=_i(_);function O({x:U,y:V}){const{nodeLookup:M,nodeExtent:H,snapGrid:$,snapToGrid:K,nodeOrigin:W,onNodeDrag:Y,onSelectionDrag:I,onError:L,updateNodePositions:G}=t();a={x:U,y:V};let z=!1;const te=u.size>1,me=te&&H?Pb(fd(u)):null,ye=te&&K?pQ({dragItems:u,snapGrid:$,x:U,y:V}):null;for(const[Se,re]of u){if(!M.has(Se))continue;let he={x:U-re.distance.x,y:V-re.distance.y};K&&(he=ye?{x:Math.round(he.x+ye.x),y:Math.round(he.y+ye.y)}:hd(he,$));let se=null;if(te&&H&&!re.extent&&me){const{positionAbsolute:le}=re.internals,Ce=le.x-me.x+H[0][0],Me=le.x+re.measured.width-me.x2+H[1][0],_e=le.y-me.y+H[0][1],Qe=le.y+re.measured.height-me.y2+H[1][1];se=[[Ce,_e],[Me,Qe]]}const{position:J,positionAbsolute:ke}=qA({nodeId:Se,nextPosition:he,nodeLookup:M,nodeExtent:se||H,nodeOrigin:W,onError:L});z=z||re.position.x!==J.x||re.position.y!==J.y,re.position=J,re.internals.positionAbsolute=ke}if(w=w||z,!!z&&(G(u,!0),v&&(i||Y||!T&&I))){const[Se,re]=My({nodeId:T,dragItems:u,nodeLookup:M});i==null||i(v,u,Se,re),Y==null||Y(v,Se,re),T||I==null||I(v,re)}}async function B(){if(!g)return;const{transform:U,panBy:V,autoPanSpeed:M,autoPanOnNodeDrag:H}=t();if(!H){d=!1,cancelAnimationFrame(o);return}const[$,K]=m0(h,g,M);($!==0||K!==0)&&(a.x=(a.x??0)-$/U[2],a.y=(a.y??0)-K/U[2],await V({x:$,y:K})&&O(a)),o=requestAnimationFrame(B)}function P(U){var te;const{nodeLookup:V,multiSelectionActive:M,nodesDraggable:H,transform:$,snapGrid:K,snapToGrid:W,selectNodesOnDrag:Y,onNodeDragStart:I,onSelectionDragStart:L,unselectNodesAndEdges:G}=t();p=!0,(!Y||!C)&&!M&&T&&((te=V.get(T))!=null&&te.selected||G()),C&&Y&&T&&(e==null||e(T));const z=Eu(U.sourceEvent,{transform:$,snapGrid:K,snapToGrid:W,containerBounds:g});if(a=z,u=hQ(V,H,z,T),u.size>0&&(n||I||!T&&L)){const[me,ye]=My({nodeId:T,dragItems:u,nodeLookup:V});n==null||n(U.sourceEvent,u,me,ye),I==null||I(U.sourceEvent,me,ye),T||L==null||L(U.sourceEvent,ye)}}const F=kA().clickDistance(R).on("start",U=>{const{domNode:V,nodeDragThreshold:M,transform:H,snapGrid:$,snapToGrid:K}=t();g=(V==null?void 0:V.getBoundingClientRect())||null,b=!1,w=!1,v=U.sourceEvent,M===0&&P(U),a=Eu(U.sourceEvent,{transform:H,snapGrid:$,snapToGrid:K,containerBounds:g}),h=cr(U.sourceEvent,g)}).on("drag",U=>{const{autoPanOnNodeDrag:V,transform:M,snapGrid:H,snapToGrid:$,nodeDragThreshold:K,nodeLookup:W}=t(),Y=Eu(U.sourceEvent,{transform:M,snapGrid:H,snapToGrid:$,containerBounds:g});if(v=U.sourceEvent,(U.sourceEvent.type==="touchmove"&&U.sourceEvent.touches.length>1||T&&!W.has(T))&&(b=!0),!b){if(!d&&V&&p&&(d=!0,B()),!p){const I=cr(U.sourceEvent,g),L=I.x-h.x,G=I.y-h.y;Math.sqrt(L*L+G*G)>K&&P(U)}(a.x!==Y.xSnapped||a.y!==Y.ySnapped)&&u&&p&&(h=cr(U.sourceEvent,g),O(Y))}}).on("end",U=>{if(!p||b){b&&u.size>0&&t().updateNodePositions(u,!1);return}if(d=!1,p=!1,cancelAnimationFrame(o),u.size>0){const{nodeLookup:V,updateNodePositions:M,onNodeDragStop:H,onSelectionDragStop:$}=t();if(w&&(M(u,!1),w=!1),r||H||!T&&$){const[K,W]=My({nodeId:T,dragItems:u,nodeLookup:V,dragging:!1});r==null||r(U.sourceEvent,u,K,W),H==null||H(U.sourceEvent,K,W),T||$==null||$(U.sourceEvent,W)}}}).filter(U=>{const V=U.target;return!U.button&&(!A||!fN(V,`.${A}`,_))&&(!S||fN(V,S,_))});y.call(F)}function k(){y==null||y.on(".drag",null)}return{update:N,destroy:k}}function gQ(e,t,n){const i=[],r={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const a of t.values())Vh(r,$u(a))>0&&i.push(a);return i}const yQ=250;function bQ(e,t,n,i){var u,d;let r=[],a=1/0;const o=gQ(e,n,t+yQ);for(const h of o){const g=[...((u=h.internals.handleBounds)==null?void 0:u.source)??[],...((d=h.internals.handleBounds)==null?void 0:d.target)??[]];for(const p of g){if(i.nodeId===p.nodeId&&i.type===p.type&&i.id===p.id)continue;const{x:y,y:b}=vl(h,p,p.position,!0),w=Math.sqrt(Math.pow(y-e.x,2)+Math.pow(b-e.y,2));w>t||(w<a?(r=[{...p,x:y,y:b}],a=w):w===a&&r.push({...p,x:y,y:b}))}}if(!r.length)return null;if(r.length>1){const h=i.type==="source"?"target":"source";return r.find(g=>g.type===h)??r[0]}return r[0]}function lT(e,t,n,i,r,a=!1){var h,g,p;const o=i.get(e);if(!o)return null;const u=r==="strict"?(h=o.internals.handleBounds)==null?void 0:h[t]:[...((g=o.internals.handleBounds)==null?void 0:g.source)??[],...((p=o.internals.handleBounds)==null?void 0:p.target)??[]],d=(n?u==null?void 0:u.find(y=>y.id===n):u==null?void 0:u[0])??null;return d&&a?{...d,...vl(o,d,d.position,!0)}:d}function oT(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function xQ(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const cT=()=>!0;function vQ(e,{connectionMode:t,connectionRadius:n,handleId:i,nodeId:r,edgeUpdaterType:a,isTarget:o,domNode:u,nodeLookup:d,lib:h,autoPanOnConnect:g,flowId:p,panBy:y,cancelConnection:b,onConnectStart:w,onConnect:v,onConnectEnd:N,isValidConnection:k=cT,onReconnectEnd:A,updateConnection:S,getTransform:_,getFromHandle:C,autoPanSpeed:T,dragThreshold:R=1,handleDomNode:O}){const B=QA(e.target);let P=0,F;const{x:U,y:V}=cr(e),M=oT(a,O),H=u==null?void 0:u.getBoundingClientRect();let $=!1;if(!H||!M)return;const K=lT(r,M,i,d,t);if(!K)return;let W=cr(e,H),Y=!1,I=null,L=!1,G=null;function z(){if(!g||!H)return;const[J,ke]=m0(W,H,T);y({x:J,y:ke}),P=requestAnimationFrame(z)}const te={...K,nodeId:r,type:M,position:K.position},me=d.get(r);let Se={inProgress:!0,isValid:null,from:vl(me,te,Ke.Left,!0),fromHandle:te,fromPosition:te.position,fromNode:me,to:W,toHandle:null,toPosition:eN[te.position],toNode:null,pointer:W};function re(){$=!0,S(Se),w==null||w(e,{nodeId:r,handleId:i,handleType:M})}R===0&&re();function he(J){if(!$){const{x:Qe,y:Ue}=cr(J),ue=Qe-U,we=Ue-V;if(!(ue*ue+we*we>R*R))return;re()}if(!C()||!te){se(J);return}const ke=_();W=cr(J,H),F=bQ(pd(W,ke,!1,[1,1]),n,d,te),Y||(z(),Y=!0);const le=uT(J,{handle:F,connectionMode:t,fromNodeId:r,fromHandleId:i,fromType:o?"target":"source",isValidConnection:k,doc:B,lib:h,flowId:p,nodeLookup:d});G=le.handleDomNode,I=le.connection,L=xQ(!!F,le.isValid);const Ce=d.get(r),Me=Ce?vl(Ce,te,Ke.Left,!0):Se.from,_e={...Se,from:Me,isValid:L,to:le.toHandle&&L?Yo({x:le.toHandle.x,y:le.toHandle.y},ke):W,toHandle:le.toHandle,toPosition:L&&le.toHandle?le.toHandle.position:eN[te.position],toNode:le.toHandle?d.get(le.toHandle.nodeId):null,pointer:W};S(_e),Se=_e}function se(J){if(!("touches"in J&&J.touches.length>0)){if($){(F||G)&&I&&L&&(v==null||v(I));const{inProgress:ke,...le}=Se,Ce={...le,toPosition:Se.toHandle?Se.toPosition:null};N==null||N(J,Ce),a&&(A==null||A(J,Ce))}b(),cancelAnimationFrame(P),Y=!1,L=!1,I=null,G=null,B.removeEventListener("mousemove",he),B.removeEventListener("mouseup",se),B.removeEventListener("touchmove",he),B.removeEventListener("touchend",se)}}B.addEventListener("mousemove",he),B.addEventListener("mouseup",se),B.addEventListener("touchmove",he),B.addEventListener("touchend",se)}function uT(e,{handle:t,connectionMode:n,fromNodeId:i,fromHandleId:r,fromType:a,doc:o,lib:u,flowId:d,isValidConnection:h=cT,nodeLookup:g}){const p=a==="target",y=t?o.querySelector(`.${u}-flow__handle[data-id="${d}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:b,y:w}=cr(e),v=o.elementFromPoint(b,w),N=v!=null&&v.classList.contains(`${u}-flow__handle`)?v:y,k={handleDomNode:N,isValid:!1,connection:null,toHandle:null};if(N){const A=oT(void 0,N),S=N.getAttribute("data-nodeid"),_=N.getAttribute("data-handleid"),C=N.classList.contains("connectable"),T=N.classList.contains("connectableend");if(!S||!A)return k;const R={source:p?S:i,sourceHandle:p?_:r,target:p?i:S,targetHandle:p?r:_};k.connection=R;const B=C&&T&&(n===Go.Strict?p&&A==="source"||!p&&A==="target":S!==i||_!==r);k.isValid=B&&h(R),k.toHandle=lT(S,A,_,g,n,!0)}return k}const Fb={onPointerDown:vQ,isValid:uT};function wQ({domNode:e,panZoom:t,getTransform:n,getViewScale:i}){const r=_i(e);function a({translateExtent:u,width:d,height:h,zoomStep:g=1,pannable:p=!0,zoomable:y=!0,inversePan:b=!1}){const w=S=>{if(S.sourceEvent.type!=="wheel"||!t)return;const _=n(),C=S.sourceEvent.ctrlKey&&Uu()?10:1,T=-S.sourceEvent.deltaY*(S.sourceEvent.deltaMode===1?.05:S.sourceEvent.deltaMode?1:.002)*g,R=_[2]*Math.pow(2,T*C);t.scaleTo(R)};let v=[0,0];const N=S=>{(S.sourceEvent.type==="mousedown"||S.sourceEvent.type==="touchstart")&&(v=[S.sourceEvent.clientX??S.sourceEvent.touches[0].clientX,S.sourceEvent.clientY??S.sourceEvent.touches[0].clientY])},k=S=>{const _=n();if(S.sourceEvent.type!=="mousemove"&&S.sourceEvent.type!=="touchmove"||!t)return;const C=[S.sourceEvent.clientX??S.sourceEvent.touches[0].clientX,S.sourceEvent.clientY??S.sourceEvent.touches[0].clientY],T=[C[0]-v[0],C[1]-v[1]];v=C;const R=i()*Math.max(_[2],Math.log(_[2]))*(b?-1:1),O={x:_[0]-T[0]*R,y:_[1]-T[1]*R},B=[[0,0],[d,h]];t.setViewportConstrained({x:O.x,y:O.y,zoom:_[2]},B,u)},A=IA().on("start",N).on("zoom",p?k:null).on("zoom.wheel",y?w:null);r.call(A,{})}function o(){r.on("zoom",null)}return{update:a,destroy:o,pointer:sr}}const jp=e=>({x:e.x,y:e.y,zoom:e.k}),Dy=({x:e,y:t,zoom:n})=>Sp.translate(e,t).scale(n),wo=(e,t)=>e.target.closest(`.${t}`),dT=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),kQ=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Oy=(e,t=0,n=kQ,i=()=>{})=>{const r=typeof t=="number"&&t>0;return r||i(),r?e.transition().duration(t).ease(n).on("end",i):e},fT=e=>{const t=e.ctrlKey&&Uu()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function EQ({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:i,panOnScrollMode:r,panOnScrollSpeed:a,zoomOnPinch:o,onPanZoomStart:u,onPanZoom:d,onPanZoomEnd:h}){return g=>{if(wo(g,t))return g.ctrlKey&&g.preventDefault(),!1;g.preventDefault(),g.stopImmediatePropagation();const p=n.property("__zoom").k||1;if(g.ctrlKey&&o){const N=sr(g),k=fT(g),A=p*Math.pow(2,k);i.scaleTo(n,A,N,g);return}const y=g.deltaMode===1?20:1;let b=r===ul.Vertical?0:g.deltaX*y,w=r===ul.Horizontal?0:g.deltaY*y;!Uu()&&g.shiftKey&&r!==ul.Vertical&&(b=g.deltaY*y,w=0),i.translateBy(n,-(b/p)*a,-(w/p)*a,{internal:!0});const v=jp(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(d==null||d(g,v),e.panScrollTimeout=setTimeout(()=>{h==null||h(g,v),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,u==null||u(g,v))}}function SQ({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(i,r){const a=i.type==="wheel",o=!t&&a&&!i.ctrlKey,u=wo(i,e);if(i.ctrlKey&&a&&u&&i.preventDefault(),o||u)return null;i.preventDefault(),n.call(this,i,r)}}function NQ({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return i=>{var a,o,u;if((a=i.sourceEvent)!=null&&a.internal)return;const r=jp(i.transform);e.mouseButton=((o=i.sourceEvent)==null?void 0:o.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=r,((u=i.sourceEvent)==null?void 0:u.type)==="mousedown"&&t(!0),n&&(n==null||n(i.sourceEvent,r))}}function _Q({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:i,onPanZoom:r}){return a=>{var o,u;e.usedRightMouseButton=!!(n&&dT(t,e.mouseButton??0)),(o=a.sourceEvent)!=null&&o.sync||i([a.transform.x,a.transform.y,a.transform.k]),r&&!((u=a.sourceEvent)!=null&&u.internal)&&(r==null||r(a.sourceEvent,jp(a.transform)))}}function jQ({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:i,onPanZoomEnd:r,onPaneContextMenu:a}){return o=>{var u;if(!((u=o.sourceEvent)!=null&&u.internal)&&(e.isZoomingOrPanning=!1,a&&dT(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&a(o.sourceEvent),e.usedRightMouseButton=!1,i(!1),r)){const d=jp(o.transform);e.prevViewport=d,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{r==null||r(o.sourceEvent,d)},n?150:0)}}}function CQ({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:i,panOnScroll:r,zoomOnDoubleClick:a,userSelectionActive:o,noWheelClassName:u,noPanClassName:d,lib:h,connectionInProgress:g}){return p=>{var N;const y=e||t,b=n&&p.ctrlKey,w=p.type==="wheel";if(p.button===1&&p.type==="mousedown"&&(wo(p,`${h}-flow__node`)||wo(p,`${h}-flow__edge`)))return!0;if(!i&&!y&&!r&&!a&&!n||o||g&&!w||wo(p,u)&&w||wo(p,d)&&(!w||r&&w&&!e)||!n&&p.ctrlKey&&w)return!1;if(!n&&p.type==="touchstart"&&((N=p.touches)==null?void 0:N.length)>1)return p.preventDefault(),!1;if(!y&&!r&&!b&&w||!i&&(p.type==="mousedown"||p.type==="touchstart")||Array.isArray(i)&&!i.includes(p.button)&&p.type==="mousedown")return!1;const v=Array.isArray(i)&&i.includes(p.button)||!p.button||p.button<=1;return(!p.ctrlKey||w)&&v}}function AQ({domNode:e,minZoom:t,maxZoom:n,translateExtent:i,viewport:r,onPanZoom:a,onPanZoomStart:o,onPanZoomEnd:u,onDraggingChange:d}){const h={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},g=e.getBoundingClientRect(),p=IA().scaleExtent([t,n]).translateExtent(i),y=_i(e).call(p);A({x:r.x,y:r.y,zoom:Vo(r.zoom,t,n)},[[0,0],[g.width,g.height]],i);const b=y.on("wheel.zoom"),w=y.on("dblclick.zoom");p.wheelDelta(fT);async function v(F,U){return y?new Promise(V=>{p==null||p.interpolate((U==null?void 0:U.interpolate)==="linear"?ku:ph).transform(Oy(y,U==null?void 0:U.duration,U==null?void 0:U.ease,()=>V(!0)),F)}):!1}function N({noWheelClassName:F,noPanClassName:U,onPaneContextMenu:V,userSelectionActive:M,panOnScroll:H,panOnDrag:$,panOnScrollMode:K,panOnScrollSpeed:W,preventScrolling:Y,zoomOnPinch:I,zoomOnScroll:L,zoomOnDoubleClick:G,zoomActivationKeyPressed:z,lib:te,onTransformChange:me,connectionInProgress:ye,paneClickDistance:Se,selectionOnDrag:re}){M&&!h.isZoomingOrPanning&&k();const he=H&&!z&&!M;p.clickDistance(re?1/0:!or(Se)||Se<0?0:Se);const se=he?EQ({zoomPanValues:h,noWheelClassName:F,d3Selection:y,d3Zoom:p,panOnScrollMode:K,panOnScrollSpeed:W,zoomOnPinch:I,onPanZoomStart:o,onPanZoom:a,onPanZoomEnd:u}):SQ({noWheelClassName:F,preventScrolling:Y,d3ZoomHandler:b});y.on("wheel.zoom",se,{passive:!1});const J=NQ({zoomPanValues:h,onDraggingChange:d,onPanZoomStart:o});p.on("start",J);const ke=_Q({zoomPanValues:h,panOnDrag:$,onPaneContextMenu:!!V,onPanZoom:a,onTransformChange:me});p.on("zoom",ke);const le=jQ({zoomPanValues:h,panOnDrag:$,panOnScroll:H,onPaneContextMenu:V,onPanZoomEnd:u,onDraggingChange:d});p.on("end",le);const Ce=CQ({zoomActivationKeyPressed:z,panOnDrag:$,zoomOnScroll:L,panOnScroll:H,zoomOnDoubleClick:G,zoomOnPinch:I,userSelectionActive:M,noPanClassName:U,noWheelClassName:F,lib:te,connectionInProgress:ye});p.filter(Ce),G?y.on("dblclick.zoom",w):y.on("dblclick.zoom",null)}function k(){p.on("zoom",null)}async function A(F,U,V){const M=Dy(F),H=p==null?void 0:p.constrain()(M,U,V);return H&&await v(H),H}async function S(F,U){const V=Dy(F);return await v(V,U),V}function _(F){if(y){const U=Dy(F),V=y.property("__zoom");(V.k!==F.zoom||V.x!==F.x||V.y!==F.y)&&(p==null||p.transform(y,U,null,{sync:!0}))}}function C(){const F=y?zA(y.node()):{x:0,y:0,k:1};return{x:F.x,y:F.y,zoom:F.k}}async function T(F,U){return y?new Promise(V=>{p==null||p.interpolate((U==null?void 0:U.interpolate)==="linear"?ku:ph).scaleTo(Oy(y,U==null?void 0:U.duration,U==null?void 0:U.ease,()=>V(!0)),F)}):!1}async function R(F,U){return y?new Promise(V=>{p==null||p.interpolate((U==null?void 0:U.interpolate)==="linear"?ku:ph).scaleBy(Oy(y,U==null?void 0:U.duration,U==null?void 0:U.ease,()=>V(!0)),F)}):!1}function O(F){p==null||p.scaleExtent(F)}function B(F){p==null||p.translateExtent(F)}function P(F){const U=!or(F)||F<0?0:F;p==null||p.clickDistance(U)}return{update:N,destroy:k,setViewport:S,setViewportConstrained:A,getViewport:C,scaleTo:T,scaleBy:R,setScaleExtent:O,setTranslateExtent:B,syncViewport:_,setClickDistance:P}}var Wo;(function(e){e.Line="line",e.Handle="handle"})(Wo||(Wo={}));function TQ({width:e,prevWidth:t,height:n,prevHeight:i,affectsX:r,affectsY:a}){const o=e-t,u=n-i,d=[o>0?1:o<0?-1:0,u>0?1:u<0?-1:0];return o&&r&&(d[0]=d[0]*-1),u&&a&&(d[1]=d[1]*-1),d}function hN(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 sa(e,t){return Math.max(0,t-e)}function aa(e,t){return Math.max(0,e-t)}function eh(e,t,n){return Math.max(0,t-e,e-n)}function pN(e,t){return e?!t:t}function MQ(e,t,n,i,r,a,o,u){let{affectsX:d,affectsY:h}=t;const{isHorizontal:g,isVertical:p}=t,y=g&&p,{xSnapped:b,ySnapped:w}=n,{minWidth:v,maxWidth:N,minHeight:k,maxHeight:A}=i,{x:S,y:_,width:C,height:T,aspectRatio:R}=e;let O=Math.floor(g?b-e.pointerX:0),B=Math.floor(p?w-e.pointerY:0);const P=C+(d?-O:O),F=T+(h?-B:B),U=-a[0]*C,V=-a[1]*T;let M=eh(P,v,N),H=eh(F,k,A);if(o){let W=0,Y=0;d&&O<0?W=sa(S+O+U,o[0][0]):!d&&O>0&&(W=aa(S+P+U,o[1][0])),h&&B<0?Y=sa(_+B+V,o[0][1]):!h&&B>0&&(Y=aa(_+F+V,o[1][1])),M=Math.max(M,W),H=Math.max(H,Y)}if(u){let W=0,Y=0;d&&O>0?W=aa(S+O,u[0][0]):!d&&O<0&&(W=sa(S+P,u[1][0])),h&&B>0?Y=aa(_+B,u[0][1]):!h&&B<0&&(Y=sa(_+F,u[1][1])),M=Math.max(M,W),H=Math.max(H,Y)}if(r){if(g){const W=eh(P/R,k,A)*R;if(M=Math.max(M,W),o){let Y=0;!d&&!h||d&&!h&&y?Y=aa(_+V+P/R,o[1][1])*R:Y=sa(_+V+(d?O:-O)/R,o[0][1])*R,M=Math.max(M,Y)}if(u){let Y=0;!d&&!h||d&&!h&&y?Y=sa(_+P/R,u[1][1])*R:Y=aa(_+(d?O:-O)/R,u[0][1])*R,M=Math.max(M,Y)}}if(p){const W=eh(F*R,v,N)/R;if(H=Math.max(H,W),o){let Y=0;!d&&!h||h&&!d&&y?Y=aa(S+F*R+U,o[1][0])/R:Y=sa(S+(h?B:-B)*R+U,o[0][0])/R,H=Math.max(H,Y)}if(u){let Y=0;!d&&!h||h&&!d&&y?Y=sa(S+F*R,u[1][0])/R:Y=aa(S+(h?B:-B)*R,u[0][0])/R,H=Math.max(H,Y)}}}B=B+(B<0?H:-H),O=O+(O<0?M:-M),r&&(y?P>F*R?B=(pN(d,h)?-O:O)/R:O=(pN(d,h)?-B:B)*R:g?(B=O/R,h=d):(O=B*R,d=h));const $=d?S+O:S,K=h?_+B:_;return{width:C+(d?-O:O),height:T+(h?-B:B),x:a[0]*O*(d?-1:1)+$,y:a[1]*B*(h?-1:1)+K}}const hT={width:0,height:0,x:0,y:0},DQ={...hT,pointerX:0,pointerY:0,aspectRatio:1};function OQ(e,t,n){const i=t.position.x+e.position.x,r=t.position.y+e.position.y,a=e.measured.width??0,o=e.measured.height??0,u=n[0]*a,d=n[1]*o;return[[i-u,r-d],[i+a-u,r+o-d]]}function RQ({domNode:e,nodeId:t,getStoreItems:n,onChange:i,onEnd:r}){const a=_i(e);let o={controlDirection:hN("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function u({controlPosition:h,boundaries:g,keepAspectRatio:p,resizeDirection:y,onResizeStart:b,onResize:w,onResizeEnd:v,shouldResize:N}){let k={...hT},A={...DQ};o={boundaries:g,resizeDirection:y,keepAspectRatio:p,controlDirection:hN(h)};let S,_=null,C=[],T,R,O,B=!1;const P=kA().on("start",F=>{const{nodeLookup:U,transform:V,snapGrid:M,snapToGrid:H,nodeOrigin:$,paneDomNode:K}=n();if(S=U.get(t),!S)return;_=(K==null?void 0:K.getBoundingClientRect())??null;const{xSnapped:W,ySnapped:Y}=Eu(F.sourceEvent,{transform:V,snapGrid:M,snapToGrid:H,containerBounds:_});k={width:S.measured.width??0,height:S.measured.height??0,x:S.position.x??0,y:S.position.y??0},A={...k,pointerX:W,pointerY:Y,aspectRatio:k.width/k.height},T=void 0,R=xl(S.extent)?S.extent:void 0,S.parentId&&(S.extent==="parent"||S.expandParent)&&(T=U.get(S.parentId)),T&&S.extent==="parent"&&(R=[[0,0],[T.measured.width,T.measured.height]]),C=[],O=void 0;for(const[I,L]of U)if(L.parentId===t&&(C.push({id:I,position:{...L.position},extent:L.extent}),L.extent==="parent"||L.expandParent)){const G=OQ(L,S,L.origin??$);O?O=[[Math.min(G[0][0],O[0][0]),Math.min(G[0][1],O[0][1])],[Math.max(G[1][0],O[1][0]),Math.max(G[1][1],O[1][1])]]:O=G}b==null||b(F,{...k})}).on("drag",F=>{const{transform:U,snapGrid:V,snapToGrid:M,nodeOrigin:H}=n(),$=Eu(F.sourceEvent,{transform:U,snapGrid:V,snapToGrid:M,containerBounds:_}),K=[];if(!S)return;const{x:W,y:Y,width:I,height:L}=k,G={},z=S.origin??H,{width:te,height:me,x:ye,y:Se}=MQ(A,o.controlDirection,$,o.boundaries,o.keepAspectRatio,z,R,O),re=te!==I,he=me!==L,se=ye!==W&&re,J=Se!==Y&&he;if(!se&&!J&&!re&&!he)return;if((se||J||z[0]===1||z[1]===1)&&(G.x=se?ye:k.x,G.y=J?Se:k.y,k.x=G.x,k.y=G.y,C.length>0)){const Me=ye-W,_e=Se-Y;for(const Qe of C)Qe.position={x:Qe.position.x-Me+z[0]*(te-I),y:Qe.position.y-_e+z[1]*(me-L)},K.push(Qe)}if((re||he)&&(G.width=re&&(!o.resizeDirection||o.resizeDirection==="horizontal")?te:k.width,G.height=he&&(!o.resizeDirection||o.resizeDirection==="vertical")?me:k.height,k.width=G.width,k.height=G.height),T&&S.expandParent){const Me=z[0]*(G.width??0);G.x&&G.x<Me&&(k.x=Me,A.x=A.x-(G.x-Me));const _e=z[1]*(G.height??0);G.y&&G.y<_e&&(k.y=_e,A.y=A.y-(G.y-_e))}const ke=TQ({width:k.width,prevWidth:I,height:k.height,prevHeight:L,affectsX:o.controlDirection.affectsX,affectsY:o.controlDirection.affectsY}),le={...k,direction:ke};(N==null?void 0:N(F,le))!==!1&&(B=!0,w==null||w(F,le),i(G,K))}).on("end",F=>{B&&(v==null||v(F,{...k}),r==null||r({...k}),B=!1)});a.call(P)}function d(){a.on(".drag",null)}return{update:u,destroy:d}}var Ry={exports:{}},Ly={},zy={exports:{}},Iy={};/**
|
|
790
|
+
* @license React
|
|
791
|
+
* use-sync-external-store-shim.production.js
|
|
792
|
+
*
|
|
793
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
794
|
+
*
|
|
795
|
+
* This source code is licensed under the MIT license found in the
|
|
796
|
+
* LICENSE file in the root directory of this source tree.
|
|
797
|
+
*/var mN;function LQ(){if(mN)return Iy;mN=1;var e=Wu();function t(p,y){return p===y&&(p!==0||1/p===1/y)||p!==p&&y!==y}var n=typeof Object.is=="function"?Object.is:t,i=e.useState,r=e.useEffect,a=e.useLayoutEffect,o=e.useDebugValue;function u(p,y){var b=y(),w=i({inst:{value:b,getSnapshot:y}}),v=w[0].inst,N=w[1];return a(function(){v.value=b,v.getSnapshot=y,d(v)&&N({inst:v})},[p,b,y]),r(function(){return d(v)&&N({inst:v}),p(function(){d(v)&&N({inst:v})})},[p]),o(b),b}function d(p){var y=p.getSnapshot;p=p.value;try{var b=y();return!n(p,b)}catch{return!0}}function h(p,y){return y()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:u;return Iy.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:g,Iy}var gN;function zQ(){return gN||(gN=1,zy.exports=LQ()),zy.exports}/**
|
|
798
|
+
* @license React
|
|
799
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
800
|
+
*
|
|
801
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
802
|
+
*
|
|
803
|
+
* This source code is licensed under the MIT license found in the
|
|
804
|
+
* LICENSE file in the root directory of this source tree.
|
|
805
|
+
*/var yN;function IQ(){if(yN)return Ly;yN=1;var e=Wu(),t=zQ();function n(h,g){return h===g&&(h!==0||1/h===1/g)||h!==h&&g!==g}var i=typeof Object.is=="function"?Object.is:n,r=t.useSyncExternalStore,a=e.useRef,o=e.useEffect,u=e.useMemo,d=e.useDebugValue;return Ly.useSyncExternalStoreWithSelector=function(h,g,p,y,b){var w=a(null);if(w.current===null){var v={hasValue:!1,value:null};w.current=v}else v=w.current;w=u(function(){function k(T){if(!A){if(A=!0,S=T,T=y(T),b!==void 0&&v.hasValue){var R=v.value;if(b(R,T))return _=R}return _=T}if(R=_,i(S,T))return R;var O=y(T);return b!==void 0&&b(R,O)?(S=T,R):(S=T,_=O)}var A=!1,S,_,C=p===void 0?null:p;return[function(){return k(g())},C===null?void 0:function(){return k(C())}]},[g,p,y,b]);var N=r(h,w[0],w[1]);return o(function(){v.hasValue=!0,v.value=N},[N]),d(N),N},Ly}var bN;function PQ(){return bN||(bN=1,Ry.exports=IQ()),Ry.exports}var BQ=PQ();const $Q=Yu(BQ),UQ={},xN=e=>{let t;const n=new Set,i=(g,p)=>{const y=typeof g=="function"?g(t):g;if(!Object.is(y,t)){const b=t;t=p??(typeof y!="object"||y===null)?y:Object.assign({},t,y),n.forEach(w=>w(t,b))}},r=()=>t,d={setState:i,getState:r,getInitialState:()=>h,subscribe:g=>(n.add(g),()=>n.delete(g)),destroy:()=>{(UQ?"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()}},h=t=e(i,r,d);return d},FQ=e=>e?xN(e):xN,{useDebugValue:qQ}=oO,{useSyncExternalStoreWithSelector:HQ}=$Q,KQ=e=>e;function pT(e,t=KQ,n){const i=HQ(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return qQ(i),i}const vN=(e,t)=>{const n=FQ(e),i=(r,a=t)=>pT(n,r,a);return Object.assign(i,n),i},GQ=(e,t)=>e?vN(e,t):vN;function tn(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 Cp=j.createContext(null),VQ=Cp.Provider,mT=hr.error001("react");function Nt(e,t){const n=j.useContext(Cp);if(n===null)throw new Error(mT);return pT(n,e,t)}function nn(){const e=j.useContext(Cp);if(e===null)throw new Error(mT);return j.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const wN={display:"none"},YQ={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},gT="react-flow__node-desc",yT="react-flow__edge-desc",WQ="react-flow__aria-live",QQ=e=>e.ariaLiveMessage,XQ=e=>e.ariaLabelConfig;function ZQ({rfId:e}){const t=Nt(QQ);return c.jsx("div",{id:`${WQ}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:YQ,children:t})}function JQ({rfId:e,disableKeyboardA11y:t}){const n=Nt(XQ);return c.jsxs(c.Fragment,{children:[c.jsx("div",{id:`${gT}-${e}`,style:wN,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),c.jsx("div",{id:`${yT}-${e}`,style:wN,children:n["edge.a11yDescription.default"]}),!t&&c.jsx(ZQ,{rfId:e})]})}const Ap=j.forwardRef(({position:e="top-left",children:t,className:n,style:i,...r},a)=>{const o=`${e}`.split("-");return c.jsx("div",{className:_n(["react-flow__panel",n,...o]),style:i,ref:a,...r,children:t})});Ap.displayName="Panel";const kN="https://reactflow.dev?utm_source=attribution";function eX({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:c.jsx(Ap,{position:t,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${kN}`,children:c.jsx("a",{href:kN,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const tX=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}},th=e=>e.id;function nX(e,t){return tn(e.selectedNodes.map(th),t.selectedNodes.map(th))&&tn(e.selectedEdges.map(th),t.selectedEdges.map(th))}function iX({onSelectionChange:e}){const t=nn(),{selectedNodes:n,selectedEdges:i}=Nt(tX,nX);return j.useEffect(()=>{const r={nodes:n,edges:i};e==null||e(r),t.getState().onSelectionChangeHandlers.forEach(a=>a(r))},[n,i,e]),null}const rX=e=>!!e.onSelectionChangeHandlers;function sX({onSelectionChange:e}){const t=Nt(rX);return e||t?c.jsx(iX,{onSelectionChange:e}):null}const bT=[0,0],aX={x:0,y:0,zoom:1},lX=["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"],EN=[...lX,"rfId"],oX=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}),SN={translateExtent:Pu,nodeOrigin:bT,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function cX(e){const{setNodes:t,setEdges:n,setMinZoom:i,setMaxZoom:r,setTranslateExtent:a,setNodeExtent:o,reset:u,setDefaultNodesAndEdges:d}=Nt(oX,tn),h=nn();j.useEffect(()=>(d(e.defaultNodes,e.defaultEdges),()=>{g.current=SN,u()}),[]);const g=j.useRef(SN);return j.useEffect(()=>{for(const p of EN){const y=e[p],b=g.current[p];y!==b&&(typeof e[p]>"u"||(p==="nodes"?t(y):p==="edges"?n(y):p==="minZoom"?i(y):p==="maxZoom"?r(y):p==="translateExtent"?a(y):p==="nodeExtent"?o(y):p==="ariaLabelConfig"?h.setState({ariaLabelConfig:VW(y)}):p==="fitView"?h.setState({fitViewQueued:y}):p==="fitViewOptions"?h.setState({fitViewOptions:y}):h.setState({[p]:y})))}g.current=e},EN.map(p=>e[p])),null}function NN(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function uX(e){var i;const[t,n]=j.useState(e==="system"?null:e);return j.useEffect(()=>{if(e!=="system"){n(e);return}const r=NN(),a=()=>n(r!=null&&r.matches?"dark":"light");return a(),r==null||r.addEventListener("change",a),()=>{r==null||r.removeEventListener("change",a)}},[e]),t!==null?t:(i=NN())!=null&&i.matches?"dark":"light"}const _N=typeof document<"u"?document:null;function Fu(e=null,t={target:_N,actInsideInputWithModifier:!0}){const[n,i]=j.useState(!1),r=j.useRef(!1),a=j.useRef(new Set([])),[o,u]=j.useMemo(()=>{if(e!==null){const h=(Array.isArray(e)?e:[e]).filter(p=>typeof p=="string").map(p=>p.replace("+",`
|
|
806
|
+
`).replace(`
|
|
807
|
+
|
|
808
|
+
`,`
|
|
809
|
+
+`).split(`
|
|
810
|
+
`)),g=h.reduce((p,y)=>p.concat(...y),[]);return[h,g]}return[[],[]]},[e]);return j.useEffect(()=>{const d=(t==null?void 0:t.target)??_N,h=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const g=b=>{var N,k;if(r.current=b.ctrlKey||b.metaKey||b.shiftKey||b.altKey,(!r.current||r.current&&!h)&&XA(b))return!1;const v=CN(b.code,u);if(a.current.add(b[v]),jN(o,a.current,!1)){const A=((k=(N=b.composedPath)==null?void 0:N.call(b))==null?void 0:k[0])||b.target,S=(A==null?void 0:A.nodeName)==="BUTTON"||(A==null?void 0:A.nodeName)==="A";t.preventDefault!==!1&&(r.current||!S)&&b.preventDefault(),i(!0)}},p=b=>{const w=CN(b.code,u);jN(o,a.current,!0)?(i(!1),a.current.clear()):a.current.delete(b[w]),b.key==="Meta"&&a.current.clear(),r.current=!1},y=()=>{a.current.clear(),i(!1)};return d==null||d.addEventListener("keydown",g),d==null||d.addEventListener("keyup",p),window.addEventListener("blur",y),window.addEventListener("contextmenu",y),()=>{d==null||d.removeEventListener("keydown",g),d==null||d.removeEventListener("keyup",p),window.removeEventListener("blur",y),window.removeEventListener("contextmenu",y)}}},[e,i]),n}function jN(e,t,n){return e.filter(i=>n||i.length===t.size).some(i=>i.every(r=>t.has(r)))}function CN(e,t){return t.includes(e)?"code":"key"}const dX=()=>{const e=nn();return j.useMemo(()=>({zoomIn:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{const{panZoom:i}=e.getState();return i?i.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[i,r,a],panZoom:o}=e.getState();return o?(await o.setViewport({x:t.x??i,y:t.y??r,zoom:t.zoom??a},n),!0):!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:a,maxZoom:o,panZoom:u}=e.getState(),d=g0(t,i,r,a,o,(n==null?void 0:n.padding)??.1);return u?(await u.setViewport(d,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{const{transform:i,snapGrid:r,snapToGrid:a,domNode:o}=e.getState();if(!o)return t;const{x:u,y:d}=o.getBoundingClientRect(),h={x:t.x-u,y:t.y-d},g=n.snapGrid??r,p=n.snapToGrid??a;return pd(h,i,p,g)},flowToScreenPosition:t=>{const{transform:n,domNode:i}=e.getState();if(!i)return t;const{x:r,y:a}=i.getBoundingClientRect(),o=Yo(t,n);return{x:o.x+r,y:o.y+a}}}),[])};function xT(e,t){const n=[],i=new Map,r=[];for(const a of e)if(a.type==="add"){r.push(a);continue}else if(a.type==="remove"||a.type==="replace")i.set(a.id,[a]);else{const o=i.get(a.id);o?o.push(a):i.set(a.id,[a])}for(const a of t){const o=i.get(a.id);if(!o){n.push(a);continue}if(o[0].type==="remove")continue;if(o[0].type==="replace"){n.push({...o[0].item});continue}const u={...a};for(const d of o)fX(d,u);n.push(u)}return r.length&&r.forEach(a=>{a.index!==void 0?n.splice(a.index,0,{...a.item}):n.push({...a.item})}),n}function fX(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 vT(e,t){return xT(e,t)}function wT(e,t){return xT(e,t)}function Ya(e,t){return{id:e,type:"select",selected:t}}function ko(e,t=new Set,n=!1){const i=[];for(const[r,a]of e){const o=t.has(r);!(a.selected===void 0&&!o)&&a.selected!==o&&(n&&(a.selected=o),i.push(Ya(a.id,o)))}return i}function AN({items:e=[],lookup:t}){var r;const n=[],i=new Map(e.map(a=>[a.id,a]));for(const[a,o]of e.entries()){const u=t.get(o.id),d=((r=u==null?void 0:u.internals)==null?void 0:r.userNode)??u;d!==void 0&&d!==o&&n.push({id:o.id,item:o,type:"replace"}),d===void 0&&n.push({item:o,type:"add",index:a})}for(const[a]of t)i.get(a)===void 0&&n.push({id:a,type:"remove"});return n}function TN(e){return{id:e.id,type:"remove"}}const hX=VA();function pX(e,t,n={}){return JW(e,t,{...n,onError:n.onError??hX})}const MN=e=>PW(e),mX=e=>FA(e);function kT(e){return j.forwardRef(e)}const gX=typeof window<"u"?j.useLayoutEffect:j.useEffect;function DN(e){const[t,n]=j.useState(BigInt(0)),[i]=j.useState(()=>yX(()=>n(r=>r+BigInt(1))));return gX(()=>{const r=i.get();r.length&&(e(r),i.reset())},[t]),i}function yX(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const ET=j.createContext(null);function bX({children:e}){const t=nn(),n=j.useCallback(u=>{const{nodes:d=[],setNodes:h,hasDefaultNodes:g,onNodesChange:p,nodeLookup:y,fitViewQueued:b,onNodesChangeMiddlewareMap:w}=t.getState();let v=d;for(const k of u)v=typeof k=="function"?k(v):k;let N=AN({items:v,lookup:y});for(const k of w.values())N=k(N);g&&h(v),N.length>0?p==null||p(N):b&&window.requestAnimationFrame(()=>{const{fitViewQueued:k,nodes:A,setNodes:S}=t.getState();k&&S(A)})},[]),i=DN(n),r=j.useCallback(u=>{const{edges:d=[],setEdges:h,hasDefaultEdges:g,onEdgesChange:p,edgeLookup:y}=t.getState();let b=d;for(const w of u)b=typeof w=="function"?w(b):w;g?h(b):p&&p(AN({items:b,lookup:y}))},[]),a=DN(r),o=j.useMemo(()=>({nodeQueue:i,edgeQueue:a}),[]);return c.jsx(ET.Provider,{value:o,children:e})}function xX(){const e=j.useContext(ET);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const vX=e=>!!e.panZoom;function Tp(){const e=dX(),t=nn(),n=xX(),i=Nt(vX),r=j.useMemo(()=>{const a=p=>t.getState().nodeLookup.get(p),o=p=>{n.nodeQueue.push(p)},u=p=>{n.edgeQueue.push(p)},d=p=>{var k,A;const{nodeLookup:y,nodeOrigin:b}=t.getState(),w=MN(p)?p:y.get(p.id),v=w.parentId?WA(w.position,w.measured,w.parentId,y,b):w.position,N={...w,position:v,width:((k=w.measured)==null?void 0:k.width)??w.width,height:((A=w.measured)==null?void 0:A.height)??w.height};return $u(N)},h=(p,y,b={replace:!1})=>{o(w=>w.map(v=>{if(v.id===p){const N=typeof y=="function"?y(v):y;return b.replace&&MN(N)?N:{...v,...N}}return v}))},g=(p,y,b={replace:!1})=>{u(w=>w.map(v=>{if(v.id===p){const N=typeof y=="function"?y(v):y;return b.replace&&mX(N)?N:{...v,...N}}return v}))};return{getNodes:()=>t.getState().nodes.map(p=>({...p})),getNode:p=>{var y;return(y=a(p))==null?void 0:y.internals.userNode},getInternalNode:a,getEdges:()=>{const{edges:p=[]}=t.getState();return p.map(y=>({...y}))},getEdge:p=>t.getState().edgeLookup.get(p),setNodes:o,setEdges:u,addNodes:p=>{const y=Array.isArray(p)?p:[p];n.nodeQueue.push(b=>[...b,...y])},addEdges:p=>{const y=Array.isArray(p)?p:[p];n.edgeQueue.push(b=>[...b,...y])},toObject:()=>{const{nodes:p=[],edges:y=[],transform:b}=t.getState(),[w,v,N]=b;return{nodes:p.map(k=>({...k})),edges:y.map(k=>({...k})),viewport:{x:w,y:v,zoom:N}}},deleteElements:async({nodes:p=[],edges:y=[]})=>{const{nodes:b,edges:w,onNodesDelete:v,onEdgesDelete:N,triggerNodeChanges:k,triggerEdgeChanges:A,onDelete:S,onBeforeDelete:_}=t.getState(),{nodes:C,edges:T}=await qW({nodesToRemove:p,edgesToRemove:y,nodes:b,edges:w,onBeforeDelete:_}),R=T.length>0,O=C.length>0;if(R){const B=T.map(TN);N==null||N(T),A(B)}if(O){const B=C.map(TN);v==null||v(C),k(B)}return(O||R)&&(S==null||S({nodes:C,edges:T})),{deletedNodes:C,deletedEdges:T}},getIntersectingNodes:(p,y=!0,b)=>{const w=nN(p),v=w?p:d(p),N=b!==void 0;return v?(b||t.getState().nodes).filter(k=>{const A=t.getState().nodeLookup.get(k.id);if(A&&!w&&(k.id===p.id||!A.internals.positionAbsolute))return!1;const S=$u(N?k:A),_=Vh(S,v);return y&&_>0||_>=S.width*S.height||_>=v.width*v.height}):[]},isNodeIntersecting:(p,y,b=!0)=>{const v=nN(p)?p:d(p);if(!v)return!1;const N=Vh(v,y);return b&&N>0||N>=y.width*y.height||N>=v.width*v.height},updateNode:h,updateNodeData:(p,y,b={replace:!1})=>{h(p,w=>{const v=typeof y=="function"?y(w):y;return b.replace?{...w,data:v}:{...w,data:{...w.data,...v}}},b)},updateEdge:g,updateEdgeData:(p,y,b={replace:!1})=>{g(p,w=>{const v=typeof y=="function"?y(w):y;return b.replace?{...w,data:v}:{...w,data:{...w.data,...v}}},b)},getNodesBounds:p=>{const{nodeLookup:y,nodeOrigin:b}=t.getState();return BW(p,{nodeLookup:y,nodeOrigin:b})},getHandleConnections:({type:p,id:y,nodeId:b})=>{var w;return Array.from(((w=t.getState().connectionLookup.get(`${b}-${p}${y?`-${y}`:""}`))==null?void 0:w.values())??[])},getNodeConnections:({type:p,handleId:y,nodeId:b})=>{var w;return Array.from(((w=t.getState().connectionLookup.get(`${b}${p?y?`-${p}-${y}`:`-${p}`:""}`))==null?void 0:w.values())??[])},fitView:async p=>{const y=t.getState().fitViewResolver??GW();return t.setState({fitViewQueued:!0,fitViewOptions:p,fitViewResolver:y}),n.nodeQueue.push(b=>[...b]),y.promise}}},[]);return j.useMemo(()=>({...r,...e,viewportInitialized:i}),[i])}const ON=e=>e.selected,wX=typeof window<"u"?window:void 0;function kX({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=nn(),{deleteElements:i}=Tp(),r=Fu(e,{actInsideInputWithModifier:!1}),a=Fu(t,{target:wX});j.useEffect(()=>{if(r){const{edges:o,nodes:u}=n.getState();i({nodes:u.filter(ON),edges:o.filter(ON)}),n.setState({nodesSelectionActive:!1})}},[r]),j.useEffect(()=>{n.setState({multiSelectionActive:a})},[a])}function EX(e){const t=nn();j.useEffect(()=>{const n=()=>{var r,a,o,u;if(!e.current||!(((a=(r=e.current).checkVisibility)==null?void 0:a.call(r))??!0))return!1;const i=y0(e.current);(i.height===0||i.width===0)&&((u=(o=t.getState()).onError)==null||u.call(o,"004",hr.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 Mp={position:"absolute",width:"100%",height:"100%",top:0,left:0},SX=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function NX({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:i=!1,panOnScrollSpeed:r=.5,panOnScrollMode:a=ul.Free,zoomOnDoubleClick:o=!0,panOnDrag:u=!0,defaultViewport:d,translateExtent:h,minZoom:g,maxZoom:p,zoomActivationKeyCode:y,preventScrolling:b=!0,children:w,noWheelClassName:v,noPanClassName:N,onViewportChange:k,isControlledViewport:A,paneClickDistance:S,selectionOnDrag:_}){const C=nn(),T=j.useRef(null),{userSelectionActive:R,lib:O,connectionInProgress:B}=Nt(SX,tn),P=Fu(y),F=j.useRef();EX(T);const U=j.useCallback(V=>{k==null||k({x:V[0],y:V[1],zoom:V[2]}),A||C.setState({transform:V})},[k,A]);return j.useEffect(()=>{if(T.current){F.current=AQ({domNode:T.current,minZoom:g,maxZoom:p,translateExtent:h,viewport:d,onDraggingChange:$=>C.setState(K=>K.paneDragging===$?K:{paneDragging:$}),onPanZoomStart:($,K)=>{const{onViewportChangeStart:W,onMoveStart:Y}=C.getState();Y==null||Y($,K),W==null||W(K)},onPanZoom:($,K)=>{const{onViewportChange:W,onMove:Y}=C.getState();Y==null||Y($,K),W==null||W(K)},onPanZoomEnd:($,K)=>{const{onViewportChangeEnd:W,onMoveEnd:Y}=C.getState();Y==null||Y($,K),W==null||W(K)}});const{x:V,y:M,zoom:H}=F.current.getViewport();return C.setState({panZoom:F.current,transform:[V,M,H],domNode:T.current.closest(".react-flow")}),()=>{var $;($=F.current)==null||$.destroy()}}},[]),j.useEffect(()=>{var V;(V=F.current)==null||V.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:i,panOnScrollSpeed:r,panOnScrollMode:a,zoomOnDoubleClick:o,panOnDrag:u,zoomActivationKeyPressed:P,preventScrolling:b,noPanClassName:N,userSelectionActive:R,noWheelClassName:v,lib:O,onTransformChange:U,connectionInProgress:B,selectionOnDrag:_,paneClickDistance:S})},[e,t,n,i,r,a,o,u,P,b,N,R,v,O,U,B,_,S]),c.jsx("div",{className:"react-flow__renderer",ref:T,style:Mp,children:w})}const _X=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function jX(){const{userSelectionActive:e,userSelectionRect:t}=Nt(_X,tn);return e&&t?c.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 Py=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},CX=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function AX({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Bu.Full,panOnDrag:i,autoPanOnSelection:r,paneClickDistance:a,selectionOnDrag:o,onSelectionStart:u,onSelectionEnd:d,onPaneClick:h,onPaneContextMenu:g,onPaneScroll:p,onPaneMouseEnter:y,onPaneMouseMove:b,onPaneMouseLeave:w,children:v}){const N=j.useRef(0),k=nn(),{userSelectionActive:A,elementsSelectable:S,dragging:_,panBy:C,autoPanSpeed:T}=Nt(CX,tn),R=S&&(e||A),O=j.useRef(null),B=j.useRef(),P=j.useRef(new Set),F=j.useRef(new Set),U=j.useRef(!1),V=j.useRef(!1),M=j.useRef({x:0,y:0}),H=j.useRef(!1),$=re=>{if(V.current||U.current||k.getState().connection.inProgress){V.current=!1,U.current=!1;return}h==null||h(re),k.getState().resetSelectedElements(),k.setState({nodesSelectionActive:!1})},K=re=>{if(Array.isArray(i)&&(i!=null&&i.includes(2))){re.preventDefault();return}g==null||g(re)},W=p?re=>p(re):void 0,Y=re=>{V.current&&(re.stopPropagation(),V.current=!1)},I=re=>{var Qe,Ue;const{domNode:he,transform:se}=k.getState();if(B.current=he==null?void 0:he.getBoundingClientRect(),!B.current)return;const J=re.target===O.current;if(!J&&!!re.target.closest(".nokey")||!e||!(o&&J||t)||re.button!==0||!re.isPrimary)return;(Ue=(Qe=re.target)==null?void 0:Qe.setPointerCapture)==null||Ue.call(Qe,re.pointerId),V.current=!1;const{x:Ce,y:Me}=cr(re.nativeEvent,B.current),_e=pd({x:Ce,y:Me},se);k.setState({userSelectionRect:{width:0,height:0,startX:_e.x,startY:_e.y,x:Ce,y:Me}}),J||(re.stopPropagation(),re.preventDefault())};function L(re,he){const{userSelectionRect:se}=k.getState();if(!se)return;const{transform:J,nodeLookup:ke,edgeLookup:le,connectionLookup:Ce,triggerNodeChanges:Me,triggerEdgeChanges:_e,defaultEdgeOptions:Qe}=k.getState(),Ue={x:se.startX,y:se.startY},{x:ue,y:we}=Yo(Ue,J),xe={startX:Ue.x,startY:Ue.y,x:re<ue?re:ue,y:he<we?he:we,width:Math.abs(re-ue),height:Math.abs(he-we)},pe=P.current,Ne=F.current;P.current=new Set(p0(ke,xe,J,n===Bu.Partial,!0).map(He=>He.id)),F.current=new Set;const je=(Qe==null?void 0:Qe.selectable)??!0;for(const He of P.current){const ne=Ce.get(He);if(ne)for(const{edgeId:de}of ne.values()){const Le=le.get(de);Le&&(Le.selectable??je)&&F.current.add(de)}}if(!iN(pe,P.current)){const He=ko(ke,P.current,!0);Me(He)}if(!iN(Ne,F.current)){const He=ko(le,F.current);_e(He)}k.setState({userSelectionRect:xe,userSelectionActive:!0,nodesSelectionActive:!1})}function G(){if(!r||!B.current)return;const[re,he]=m0(M.current,B.current,T);C({x:re,y:he}).then(se=>{if(!V.current||!se){N.current=requestAnimationFrame(G);return}const{x:J,y:ke}=M.current;L(J,ke),N.current=requestAnimationFrame(G)})}const z=()=>{cancelAnimationFrame(N.current),N.current=0,H.current=!1};j.useEffect(()=>()=>z(),[]);const te=re=>{const{userSelectionRect:he,transform:se,resetSelectedElements:J}=k.getState();if(!B.current||!he)return;const{x:ke,y:le}=cr(re.nativeEvent,B.current);M.current={x:ke,y:le};const Ce=Yo({x:he.startX,y:he.startY},se);if(!V.current){const Me=t?0:a;if(Math.hypot(ke-Ce.x,le-Ce.y)<=Me)return;J(),u==null||u(re)}V.current=!0,H.current||(G(),H.current=!0),L(ke,le)},me=re=>{var he,se;if(!R){re.target===O.current&&k.getState().connection.inProgress&&(U.current=!0);return}re.button===0&&((se=(he=re.target)==null?void 0:he.releasePointerCapture)==null||se.call(he,re.pointerId),!A&&re.target===O.current&&k.getState().userSelectionRect&&($==null||$(re)),k.setState({userSelectionActive:!1,userSelectionRect:null}),V.current&&(d==null||d(re),k.setState({nodesSelectionActive:P.current.size>0})),z())},ye=re=>{var he,se;(se=(he=re.target)==null?void 0:he.releasePointerCapture)==null||se.call(he,re.pointerId),z()},Se=i===!0||Array.isArray(i)&&i.includes(0);return c.jsxs("div",{className:_n(["react-flow__pane",{draggable:Se,dragging:_,selection:e}]),onClick:R?void 0:Py($,O),onContextMenu:Py(K,O),onWheel:Py(W,O),onPointerEnter:R?void 0:y,onPointerMove:R?te:b,onPointerUp:me,onPointerCancel:R?ye:void 0,onPointerDownCapture:R?I:void 0,onClickCapture:R?Y:void 0,onPointerLeave:w,ref:O,style:Mp,children:[v,c.jsx(jX,{})]})}function qb({id:e,store:t,unselect:n=!1,nodeRef:i}){const{addSelectedNodes:r,unselectNodesAndEdges:a,multiSelectionActive:o,nodeLookup:u,onError:d}=t.getState(),h=u.get(e);if(!h){d==null||d("012",hr.error012(e));return}t.setState({nodesSelectionActive:!1}),h.selected?(n||h.selected&&o)&&(a({nodes:[h],edges:[]}),requestAnimationFrame(()=>{var g;return(g=i==null?void 0:i.current)==null?void 0:g.blur()})):r([e])}function ST({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:i,nodeId:r,isSelectable:a,nodeClickDistance:o}){const u=nn(),[d,h]=j.useState(!1),g=j.useRef();return j.useEffect(()=>{g.current=mQ({getStoreItems:()=>u.getState(),onNodeMouseDown:p=>{qb({id:p,store:u,nodeRef:e})},onDragStart:()=>{h(!0)},onDragStop:()=>{h(!1)}})},[]),j.useEffect(()=>{if(!(t||!e.current||!g.current))return g.current.update({noDragClassName:n,handleSelector:i,domNode:e.current,isSelectable:a,nodeId:r,nodeClickDistance:o}),()=>{var p;(p=g.current)==null||p.destroy()}},[n,i,t,a,e,r,o]),d}const TX=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function NT(){const e=nn();return j.useCallback(n=>{const{nodeExtent:i,snapToGrid:r,snapGrid:a,nodesDraggable:o,onError:u,updateNodePositions:d,nodeLookup:h,nodeOrigin:g}=e.getState(),p=new Map,y=TX(o),b=r?a[0]:5,w=r?a[1]:5,v=n.direction.x*b*n.factor,N=n.direction.y*w*n.factor;for(const[,k]of h){if(!y(k))continue;let A={x:k.internals.positionAbsolute.x+v,y:k.internals.positionAbsolute.y+N};r&&(A=hd(A,a));const{position:S,positionAbsolute:_}=qA({nodeId:k.id,nextPosition:A,nodeLookup:h,nodeExtent:i,nodeOrigin:g,onError:u});k.position=S,k.internals.positionAbsolute=_,p.set(k.id,k)}d(p)},[])}const E0=j.createContext(null),MX=E0.Provider;E0.Consumer;const _T=()=>j.useContext(E0),DX=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),jT=j.createContext(null);function OX({children:e}){const t=Nt(DX,tn);return c.jsx(jT.Provider,{value:t,children:e})}function RX(){const e=j.useContext(jT);if(!e)throw new Error("useHandleConfig must be used within a HandleConfigProvider");return e}const LX={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},zX=(e,t,n)=>i=>{const{connectionClickStartHandle:r,connectionMode:a,connection:o}=i,{fromHandle:u,toHandle:d,isValid:h}=o;if(!u&&!r)return LX;const g=(d==null?void 0:d.nodeId)===e&&(d==null?void 0:d.id)===t&&(d==null?void 0:d.type)===n;return{connectingFrom:(u==null?void 0:u.nodeId)===e&&(u==null?void 0:u.id)===t&&(u==null?void 0:u.type)===n,connectingTo:g,clickConnecting:(r==null?void 0:r.nodeId)===e&&(r==null?void 0:r.id)===t&&(r==null?void 0:r.type)===n,isPossibleEndHandle:a===Go.Strict?(u==null?void 0:u.type)!==n:e!==(u==null?void 0:u.nodeId)||t!==(u==null?void 0:u.id),connectionInProcess:!!u,clickConnectionInProcess:!!r,valid:g&&h}};function IX({type:e="source",position:t=Ke.Top,isValidConnection:n,isConnectable:i=!0,isConnectableStart:r=!0,isConnectableEnd:a=!0,id:o,onConnect:u,children:d,className:h,onMouseDown:g,onTouchStart:p,...y},b){var H,$;const w=o||null,v=e==="target",N=nn(),k=_T(),{connectOnClick:A,noPanClassName:S,rfId:_}=RX(),{connectingFrom:C,connectingTo:T,clickConnecting:R,isPossibleEndHandle:O,connectionInProcess:B,clickConnectionInProcess:P,valid:F}=Nt(zX(k,w,e),tn);k||($=(H=N.getState()).onError)==null||$.call(H,"010",hr.error010());const U=K=>{const{defaultEdgeOptions:W,onConnect:Y,hasDefaultEdges:I}=N.getState(),L={...W,...K};if(I){const{edges:G,setEdges:z,onError:te}=N.getState();z(pX(L,G,{onError:te}))}Y==null||Y(L),u==null||u(L)},V=K=>{if(!k)return;const W=ZA(K.nativeEvent);if(r&&(W&&K.button===0||!W)){const Y=N.getState();Fb.onPointerDown(K.nativeEvent,{handleDomNode:K.currentTarget,autoPanOnConnect:Y.autoPanOnConnect,connectionMode:Y.connectionMode,connectionRadius:Y.connectionRadius,domNode:Y.domNode,nodeLookup:Y.nodeLookup,lib:Y.lib,isTarget:v,handleId:w,nodeId:k,flowId:Y.rfId,panBy:Y.panBy,cancelConnection:Y.cancelConnection,onConnectStart:Y.onConnectStart,onConnectEnd:(...I)=>{var L,G;return(G=(L=N.getState()).onConnectEnd)==null?void 0:G.call(L,...I)},updateConnection:Y.updateConnection,onConnect:U,isValidConnection:n||((...I)=>{var L,G;return((G=(L=N.getState()).isValidConnection)==null?void 0:G.call(L,...I))??!0}),getTransform:()=>N.getState().transform,getFromHandle:()=>N.getState().connection.fromHandle,autoPanSpeed:Y.autoPanSpeed,dragThreshold:Y.connectionDragThreshold})}W?g==null||g(K):p==null||p(K)},M=K=>{const{onClickConnectStart:W,onClickConnectEnd:Y,connectionClickStartHandle:I,connectionMode:L,isValidConnection:G,lib:z,rfId:te,nodeLookup:me,connection:ye}=N.getState();if(!k||!I&&!r)return;if(!I){W==null||W(K.nativeEvent,{nodeId:k,handleId:w,handleType:e}),N.setState({connectionClickStartHandle:{nodeId:k,type:e,id:w}});return}const Se=QA(K.target),re=n||G,{connection:he,isValid:se}=Fb.isValid(K.nativeEvent,{handle:{nodeId:k,id:w,type:e},connectionMode:L,fromNodeId:I.nodeId,fromHandleId:I.id||null,fromType:I.type,isValidConnection:re,flowId:te,doc:Se,lib:z,nodeLookup:me});se&&he&&U(he);const J=structuredClone(ye);delete J.inProgress,J.toPosition=J.toHandle?J.toHandle.position:null,Y==null||Y(K,J),N.setState({connectionClickStartHandle:null})};return c.jsx("div",{"data-handleid":w,"data-nodeid":k,"data-handlepos":t,"data-id":`${_}-${k}-${w}-${e}`,className:_n(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",S,h,{source:!v,target:v,connectable:i,connectablestart:r,connectableend:a,clickconnecting:R,connectingfrom:C,connectingto:T,valid:F,connectionindicator:i&&(!B||O)&&(B||P?a:r)}]),onMouseDown:V,onTouchStart:V,onClick:A?M:void 0,ref:b,...y,children:d})}const Dr=j.memo(kT(IX));function PX({data:e,isConnectable:t,sourcePosition:n=Ke.Bottom}){return c.jsxs(c.Fragment,{children:[e==null?void 0:e.label,c.jsx(Dr,{type:"source",position:n,isConnectable:t})]})}function BX({data:e,isConnectable:t,targetPosition:n=Ke.Top,sourcePosition:i=Ke.Bottom}){return c.jsxs(c.Fragment,{children:[c.jsx(Dr,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,c.jsx(Dr,{type:"source",position:i,isConnectable:t})]})}function $X(){return null}function UX({data:e,isConnectable:t,targetPosition:n=Ke.Top}){return c.jsxs(c.Fragment,{children:[c.jsx(Dr,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Yh={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},RN={input:PX,default:BX,output:UX,group:$X};function FX(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 qX=e=>{const{width:t,height:n,x:i,y:r}=fd(e.nodeLookup,{filter:a=>!!a.selected});return{width:or(t)?t:null,height:or(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 HX({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const i=nn(),{width:r,height:a,transformString:o,userSelectionActive:u}=Nt(qX,tn),d=NT(),h=j.useRef(null);j.useEffect(()=>{var b;n||(b=h.current)==null||b.focus({preventScroll:!0})},[n]);const g=!u&&r!==null&&a!==null;if(ST({nodeRef:h,disabled:!g}),!g)return null;const p=e?b=>{const w=i.getState().nodes.filter(v=>v.selected);e(b,w)}:void 0,y=b=>{Object.prototype.hasOwnProperty.call(Yh,b.key)&&(b.preventDefault(),d({direction:Yh[b.key],factor:b.shiftKey?4:1}))};return c.jsx("div",{className:_n(["react-flow__nodesselection","react-flow__container",t]),style:{transform:o},children:c.jsx("div",{ref:h,className:"react-flow__nodesselection-rect",onContextMenu:p,tabIndex:n?void 0:-1,onKeyDown:n?void 0:y,style:{width:r,height:a}})})}const LN=typeof window<"u"?window:void 0,KX=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function CT({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:r,onPaneContextMenu:a,onPaneScroll:o,paneClickDistance:u,deleteKeyCode:d,selectionKeyCode:h,selectionOnDrag:g,selectionMode:p,onSelectionStart:y,onSelectionEnd:b,multiSelectionKeyCode:w,panActivationKeyCode:v,zoomActivationKeyCode:N,elementsSelectable:k,zoomOnScroll:A,zoomOnPinch:S,panOnScroll:_,panOnScrollSpeed:C,panOnScrollMode:T,zoomOnDoubleClick:R,panOnDrag:O,autoPanOnSelection:B,defaultViewport:P,translateExtent:F,minZoom:U,maxZoom:V,preventScrolling:M,onSelectionContextMenu:H,noWheelClassName:$,noPanClassName:K,disableKeyboardA11y:W,onViewportChange:Y,isControlledViewport:I}){const{nodesSelectionActive:L,userSelectionActive:G}=Nt(KX,tn),z=Fu(h,{target:LN}),te=Fu(v,{target:LN}),me=te||O,ye=te||_,Se=g&&me!==!0,re=z||G||Se;return kX({deleteKeyCode:d,multiSelectionKeyCode:w}),c.jsx(NX,{onPaneContextMenu:a,elementsSelectable:k,zoomOnScroll:A,zoomOnPinch:S,panOnScroll:ye,panOnScrollSpeed:C,panOnScrollMode:T,zoomOnDoubleClick:R,panOnDrag:!z&&me,defaultViewport:P,translateExtent:F,minZoom:U,maxZoom:V,zoomActivationKeyCode:N,preventScrolling:M,noWheelClassName:$,noPanClassName:K,onViewportChange:Y,isControlledViewport:I,paneClickDistance:u,selectionOnDrag:Se,children:c.jsxs(AX,{onSelectionStart:y,onSelectionEnd:b,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:r,onPaneContextMenu:a,onPaneScroll:o,panOnDrag:me,autoPanOnSelection:B,isSelecting:!!re,selectionMode:p,selectionKeyPressed:z,paneClickDistance:u,selectionOnDrag:Se,children:[e,L&&c.jsx(HX,{onSelectionContextMenu:H,noPanClassName:K,disableKeyboardA11y:W})]})})}CT.displayName="FlowRenderer";const GX=j.memo(CT),VX=e=>t=>e?p0(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 YX(e){return Nt(j.useCallback(VX(e),[e]),tn)}const WX=e=>e.updateNodeInternals;function QX(){const e=Nt(WX),[t]=j.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const i=new Map;n.forEach(r=>{const a=r.target.getAttribute("data-id");i.set(a,{id:a,nodeElement:r.target,force:!0})}),e(i)}));return j.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function XX({node:e,nodeType:t,hasDimensions:n,resizeObserver:i}){const r=nn(),a=j.useRef(null),o=j.useRef(null),u=j.useRef(e.sourcePosition),d=j.useRef(e.targetPosition),h=j.useRef(t),g=n&&!!e.internals.handleBounds;return j.useEffect(()=>{a.current&&!e.hidden&&(!g||o.current!==a.current)&&(o.current&&(i==null||i.unobserve(o.current)),i==null||i.observe(a.current),o.current=a.current)},[g,e.hidden]),j.useEffect(()=>()=>{o.current&&(i==null||i.unobserve(o.current),o.current=null)},[]),j.useEffect(()=>{if(a.current){const p=h.current!==t,y=u.current!==e.sourcePosition,b=d.current!==e.targetPosition;(p||y||b)&&(h.current=t,u.current=e.sourcePosition,d.current=e.targetPosition,r.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:a.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),a}function ZX({id:e,onClick:t,onMouseEnter:n,onMouseMove:i,onMouseLeave:r,onContextMenu:a,onDoubleClick:o,nodesDraggable:u,elementsSelectable:d,nodesConnectable:h,nodesFocusable:g,resizeObserver:p,noDragClassName:y,noPanClassName:b,disableKeyboardA11y:w,rfId:v,nodeTypes:N,nodeClickDistance:k,onError:A}){const{node:S,internals:_,isParent:C}=Nt(re=>{const he=re.nodeLookup.get(e),se=re.parentLookup.has(e);return{node:he,internals:he.internals,isParent:se}},tn);let T=S.type||"default",R=(N==null?void 0:N[T])||RN[T];R===void 0&&(A==null||A("003",hr.error003(T)),T="default",R=(N==null?void 0:N.default)||RN.default);const O=!!(S.draggable||u&&typeof S.draggable>"u"),B=!!(S.selectable||d&&typeof S.selectable>"u"),P=!!(S.connectable||h&&typeof S.connectable>"u"),F=!!(S.focusable||g&&typeof S.focusable>"u"),U=nn(),V=YA(S),M=XX({node:S,nodeType:T,hasDimensions:V,resizeObserver:p}),H=ST({nodeRef:M,disabled:S.hidden||!O,noDragClassName:y,handleSelector:S.dragHandle,nodeId:e,isSelectable:B,nodeClickDistance:k}),$=NT();if(S.hidden)return null;const K=ws(S),W=FX(S),Y=B||O||t||n||i||r,I=n?re=>n(re,{..._.userNode}):void 0,L=i?re=>i(re,{..._.userNode}):void 0,G=r?re=>r(re,{..._.userNode}):void 0,z=a?re=>a(re,{..._.userNode}):void 0,te=o?re=>o(re,{..._.userNode}):void 0,me=re=>{const{selectNodesOnDrag:he,nodeDragThreshold:se}=U.getState();B&&(!he||!O||se>0)&&qb({id:e,store:U,nodeRef:M}),t&&t(re,{..._.userNode})},ye=re=>{if(!(XA(re.nativeEvent)||w)){if(PA.includes(re.key)&&B){const he=re.key==="Escape";qb({id:e,store:U,unselect:he,nodeRef:M})}else if(O&&S.selected&&Object.prototype.hasOwnProperty.call(Yh,re.key)){re.preventDefault();const{ariaLabelConfig:he}=U.getState();U.setState({ariaLiveMessage:he["node.a11yDescription.ariaLiveMessage"]({direction:re.key.replace("Arrow","").toLowerCase(),x:~~_.positionAbsolute.x,y:~~_.positionAbsolute.y})}),$({direction:Yh[re.key],factor:re.shiftKey?4:1})}}},Se=()=>{var Ce;if(w||!((Ce=M.current)!=null&&Ce.matches(":focus-visible")))return;const{transform:re,width:he,height:se,autoPanOnNodeFocus:J,setCenter:ke}=U.getState();if(!J)return;p0(new Map([[e,S]]),{x:0,y:0,width:he,height:se},re,!0).length>0||ke(S.position.x+K.width/2,S.position.y+K.height/2,{zoom:re[2]})};return c.jsx("div",{className:_n(["react-flow__node",`react-flow__node-${T}`,{[b]:O},S.className,{selected:S.selected,selectable:B,parent:C,draggable:O,dragging:H}]),ref:M,style:{zIndex:_.z,transform:`translate(${_.positionAbsolute.x}px,${_.positionAbsolute.y}px)`,pointerEvents:Y?"all":"none",visibility:V?"visible":"hidden",...S.style,...W},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:I,onMouseMove:L,onMouseLeave:G,onContextMenu:z,onClick:me,onDoubleClick:te,onKeyDown:F?ye:void 0,tabIndex:F?0:void 0,onFocus:F?Se:void 0,role:S.ariaRole??(F?"group":void 0),"aria-roledescription":"node","aria-describedby":w?void 0:`${gT}-${v}`,"aria-label":S.ariaLabel,...S.domAttributes,children:c.jsx(MX,{value:e,children:c.jsx(R,{id:e,data:S.data,type:T,positionAbsoluteX:_.positionAbsolute.x,positionAbsoluteY:_.positionAbsolute.y,selected:S.selected??!1,selectable:B,draggable:O,deletable:S.deletable??!0,isConnectable:P,sourcePosition:S.sourcePosition,targetPosition:S.targetPosition,dragging:H,dragHandle:S.dragHandle,zIndex:_.z,parentId:S.parentId,...K})})})}var JX=j.memo(ZX);const eZ=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function AT(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:i,elementsSelectable:r,onError:a}=Nt(eZ,tn),o=YX(e.onlyRenderVisibleElements),u=QX();return c.jsx("div",{className:"react-flow__nodes",style:Mp,children:o.map(d=>c.jsx(JX,{id:d,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:u,nodesDraggable:t,nodesConnectable:n,nodesFocusable:i,elementsSelectable:r,nodeClickDistance:e.nodeClickDistance,onError:a},d))})}AT.displayName="NodeRenderer";const tZ=j.memo(AT);function nZ(e){return Nt(j.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 a=n.nodeLookup.get(r.source),o=n.nodeLookup.get(r.target);a&&o&&QW({sourceNode:a,targetNode:o,width:n.width,height:n.height,transform:n.transform})&&i.push(r.id)}return i},[e]),tn)}const iZ=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return c.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},rZ=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return c.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},zN={[Kh.Arrow]:iZ,[Kh.ArrowClosed]:rZ};function sZ(e){const t=nn();return j.useMemo(()=>{var r,a;return Object.prototype.hasOwnProperty.call(zN,e)?zN[e]:((a=(r=t.getState()).onError)==null||a.call(r,"009",hr.error009(e)),null)},[e])}const aZ=({id:e,type:t,color:n,width:i=12.5,height:r=12.5,markerUnits:a="strokeWidth",strokeWidth:o,orient:u="auto-start-reverse"})=>{const d=sZ(t);return d?c.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${i}`,markerHeight:`${r}`,viewBox:"-10 -10 20 20",markerUnits:a,orient:u,refX:"0",refY:"0",children:c.jsx(d,{color:n,strokeWidth:o})}):null},TT=({defaultColor:e,rfId:t})=>{const n=Nt(a=>a.edges),i=Nt(a=>a.defaultEdgeOptions),r=j.useMemo(()=>rQ(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?c.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:c.jsx("defs",{children:r.map(a=>c.jsx(aZ,{id:a.id,type:a.type,color:a.color,width:a.width,height:a.height,markerUnits:a.markerUnits,strokeWidth:a.strokeWidth,orient:a.orient},a.id))})}):null};TT.displayName="MarkerDefinitions";var lZ=j.memo(TT);function MT({x:e,y:t,label:n,labelStyle:i,labelShowBg:r=!0,labelBgStyle:a,labelBgPadding:o=[2,4],labelBgBorderRadius:u=2,children:d,className:h,...g}){const[p,y]=j.useState({x:1,y:0,width:0,height:0}),b=_n(["react-flow__edge-textwrapper",h]),w=j.useRef(null);return j.useEffect(()=>{if(w.current){const v=w.current.getBBox();y({x:v.x,y:v.y,width:v.width,height:v.height})}},[n]),n?c.jsxs("g",{transform:`translate(${e-p.width/2} ${t-p.height/2})`,className:b,visibility:p.width?"visible":"hidden",...g,children:[r&&c.jsx("rect",{width:p.width+2*o[0],x:-o[0],y:-o[1],height:p.height+2*o[1],className:"react-flow__edge-textbg",style:a,rx:u,ry:u}),c.jsx("text",{className:"react-flow__edge-text",y:p.height/2,dy:"0.3em",ref:w,style:i,children:n}),d]}):null}MT.displayName="EdgeText";const oZ=j.memo(MT);function Dp({path:e,labelX:t,labelY:n,label:i,labelStyle:r,labelShowBg:a,labelBgStyle:o,labelBgPadding:u,labelBgBorderRadius:d,interactionWidth:h=20,...g}){return c.jsxs(c.Fragment,{children:[c.jsx("path",{...g,d:e,fill:"none",className:_n(["react-flow__edge-path",g.className])}),h?c.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:h,className:"react-flow__edge-interaction"}):null,i&&or(t)&&or(n)?c.jsx(oZ,{x:t,y:n,label:i,labelStyle:r,labelShowBg:a,labelBgStyle:o,labelBgPadding:u,labelBgBorderRadius:d}):null]})}function IN({pos:e,x1:t,y1:n,x2:i,y2:r}){return e===Ke.Left||e===Ke.Right?[.5*(t+i),n]:[t,.5*(n+r)]}function DT({sourceX:e,sourceY:t,sourcePosition:n=Ke.Bottom,targetX:i,targetY:r,targetPosition:a=Ke.Top}){const[o,u]=IN({pos:n,x1:e,y1:t,x2:i,y2:r}),[d,h]=IN({pos:a,x1:i,y1:r,x2:e,y2:t}),[g,p,y,b]=JA({sourceX:e,sourceY:t,targetX:i,targetY:r,sourceControlX:o,sourceControlY:u,targetControlX:d,targetControlY:h});return[`M${e},${t} C${o},${u} ${d},${h} ${i},${r}`,g,p,y,b]}function OT(e){return j.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:a,sourcePosition:o,targetPosition:u,label:d,labelStyle:h,labelShowBg:g,labelBgStyle:p,labelBgPadding:y,labelBgBorderRadius:b,style:w,markerEnd:v,markerStart:N,interactionWidth:k})=>{const[A,S,_]=DT({sourceX:n,sourceY:i,sourcePosition:o,targetX:r,targetY:a,targetPosition:u}),C=e.isInternal?void 0:t;return c.jsx(Dp,{id:C,path:A,labelX:S,labelY:_,label:d,labelStyle:h,labelShowBg:g,labelBgStyle:p,labelBgPadding:y,labelBgBorderRadius:b,style:w,markerEnd:v,markerStart:N,interactionWidth:k})})}const cZ=OT({isInternal:!1}),RT=OT({isInternal:!0});cZ.displayName="SimpleBezierEdge";RT.displayName="SimpleBezierEdgeInternal";function LT(e){return j.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:a,label:o,labelStyle:u,labelShowBg:d,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:p,style:y,sourcePosition:b=Ke.Bottom,targetPosition:w=Ke.Top,markerEnd:v,markerStart:N,pathOptions:k,interactionWidth:A})=>{const[S,_,C]=Bb({sourceX:n,sourceY:i,sourcePosition:b,targetX:r,targetY:a,targetPosition:w,borderRadius:k==null?void 0:k.borderRadius,offset:k==null?void 0:k.offset,stepPosition:k==null?void 0:k.stepPosition}),T=e.isInternal?void 0:t;return c.jsx(Dp,{id:T,path:S,labelX:_,labelY:C,label:o,labelStyle:u,labelShowBg:d,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:p,style:y,markerEnd:v,markerStart:N,interactionWidth:A})})}const zT=LT({isInternal:!1}),IT=LT({isInternal:!0});zT.displayName="SmoothStepEdge";IT.displayName="SmoothStepEdgeInternal";function PT(e){return j.memo(({id:t,...n})=>{var r;const i=e.isInternal?void 0:t;return c.jsx(zT,{...n,id:i,pathOptions:j.useMemo(()=>{var a;return{borderRadius:0,offset:(a=n.pathOptions)==null?void 0:a.offset}},[(r=n.pathOptions)==null?void 0:r.offset])})})}const uZ=PT({isInternal:!1}),BT=PT({isInternal:!0});uZ.displayName="StepEdge";BT.displayName="StepEdgeInternal";function $T(e){return j.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:a,label:o,labelStyle:u,labelShowBg:d,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:p,style:y,markerEnd:b,markerStart:w,interactionWidth:v})=>{const[N,k,A]=nT({sourceX:n,sourceY:i,targetX:r,targetY:a}),S=e.isInternal?void 0:t;return c.jsx(Dp,{id:S,path:N,labelX:k,labelY:A,label:o,labelStyle:u,labelShowBg:d,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:p,style:y,markerEnd:b,markerStart:w,interactionWidth:v})})}const dZ=$T({isInternal:!1}),UT=$T({isInternal:!0});dZ.displayName="StraightEdge";UT.displayName="StraightEdgeInternal";function FT(e){return j.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:a,sourcePosition:o=Ke.Bottom,targetPosition:u=Ke.Top,label:d,labelStyle:h,labelShowBg:g,labelBgStyle:p,labelBgPadding:y,labelBgBorderRadius:b,style:w,markerEnd:v,markerStart:N,pathOptions:k,interactionWidth:A})=>{const[S,_,C]=eT({sourceX:n,sourceY:i,sourcePosition:o,targetX:r,targetY:a,targetPosition:u,curvature:k==null?void 0:k.curvature}),T=e.isInternal?void 0:t;return c.jsx(Dp,{id:T,path:S,labelX:_,labelY:C,label:d,labelStyle:h,labelShowBg:g,labelBgStyle:p,labelBgPadding:y,labelBgBorderRadius:b,style:w,markerEnd:v,markerStart:N,interactionWidth:A})})}const fZ=FT({isInternal:!1}),qT=FT({isInternal:!0});fZ.displayName="BezierEdge";qT.displayName="BezierEdgeInternal";const PN={default:qT,straight:UT,step:BT,smoothstep:IT,simplebezier:RT},BN={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},hZ=(e,t,n)=>n===Ke.Left?e-t:n===Ke.Right?e+t:e,pZ=(e,t,n)=>n===Ke.Top?e-t:n===Ke.Bottom?e+t:e,$N="react-flow__edgeupdater";function UN({position:e,centerX:t,centerY:n,radius:i=10,onMouseDown:r,onMouseEnter:a,onMouseOut:o,type:u}){return c.jsx("circle",{onMouseDown:r,onMouseEnter:a,onMouseOut:o,className:_n([$N,`${$N}-${u}`]),cx:hZ(t,i,e),cy:pZ(n,i,e),r:i,stroke:"transparent",fill:"transparent"})}function mZ({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:i,sourceY:r,targetX:a,targetY:o,sourcePosition:u,targetPosition:d,onReconnect:h,onReconnectStart:g,onReconnectEnd:p,setReconnecting:y,setUpdateHover:b}){const w=nn(),v=(_,C)=>{if(_.button!==0)return;const{autoPanOnConnect:T,domNode:R,connectionMode:O,connectionRadius:B,lib:P,onConnectStart:F,cancelConnection:U,nodeLookup:V,rfId:M,panBy:H,updateConnection:$}=w.getState(),K=C.type==="target",W=(L,G)=>{y(!1),p==null||p(L,n,C.type,G)},Y=L=>h==null?void 0:h(n,L),I=(L,G)=>{y(!0),g==null||g(_,n,C.type),F==null||F(L,G)};Fb.onPointerDown(_.nativeEvent,{autoPanOnConnect:T,connectionMode:O,connectionRadius:B,domNode:R,handleId:C.id,nodeId:C.nodeId,nodeLookup:V,isTarget:K,edgeUpdaterType:C.type,lib:P,flowId:M,cancelConnection:U,panBy:H,isValidConnection:(...L)=>{var G,z;return((z=(G=w.getState()).isValidConnection)==null?void 0:z.call(G,...L))??!0},onConnect:Y,onConnectStart:I,onConnectEnd:(...L)=>{var G,z;return(z=(G=w.getState()).onConnectEnd)==null?void 0:z.call(G,...L)},onReconnectEnd:W,updateConnection:$,getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,dragThreshold:w.getState().connectionDragThreshold,handleDomNode:_.currentTarget})},N=_=>v(_,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),k=_=>v(_,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),A=()=>b(!0),S=()=>b(!1);return c.jsxs(c.Fragment,{children:[(e===!0||e==="source")&&c.jsx(UN,{position:u,centerX:i,centerY:r,radius:t,onMouseDown:N,onMouseEnter:A,onMouseOut:S,type:"source"}),(e===!0||e==="target")&&c.jsx(UN,{position:d,centerX:a,centerY:o,radius:t,onMouseDown:k,onMouseEnter:A,onMouseOut:S,type:"target"})]})}function gZ({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:i,onClick:r,onDoubleClick:a,onContextMenu:o,onMouseEnter:u,onMouseMove:d,onMouseLeave:h,reconnectRadius:g,onReconnect:p,onReconnectStart:y,onReconnectEnd:b,rfId:w,edgeTypes:v,noPanClassName:N,onError:k,disableKeyboardA11y:A}){let S=Nt(ke=>ke.edgeLookup.get(e));const _=Nt(ke=>ke.defaultEdgeOptions);S=_?{..._,...S}:S;let C=S.type||"default",T=(v==null?void 0:v[C])||PN[C];T===void 0&&(k==null||k("011",hr.error011(C)),C="default",T=(v==null?void 0:v.default)||PN.default);const R=!!(S.focusable||t&&typeof S.focusable>"u"),O=typeof p<"u"&&(S.reconnectable||n&&typeof S.reconnectable>"u"),B=!!(S.selectable||i&&typeof S.selectable>"u"),P=j.useRef(null),[F,U]=j.useState(!1),[V,M]=j.useState(!1),H=nn(),{zIndex:$=S.zIndex,sourceX:K,sourceY:W,targetX:Y,targetY:I,sourcePosition:L,targetPosition:G}=Nt(j.useCallback(ke=>{const le=ke.nodeLookup.get(S.source),Ce=ke.nodeLookup.get(S.target);if(!le||!Ce)return BN;const Me=iQ({id:e,sourceNode:le,targetNode:Ce,sourceHandle:S.sourceHandle||null,targetHandle:S.targetHandle||null,connectionMode:ke.connectionMode,onError:k}),_e=WW({selected:S.selected,zIndex:S.zIndex,sourceNode:le,targetNode:Ce,elevateOnSelect:ke.elevateEdgesOnSelect,zIndexMode:ke.zIndexMode});return{...Me||BN,zIndex:_e}},[S.source,S.target,S.sourceHandle,S.targetHandle,S.selected,S.zIndex]),tn),z=j.useMemo(()=>S.markerStart?`url('#${$b(S.markerStart,w)}')`:void 0,[S.markerStart,w]),te=j.useMemo(()=>S.markerEnd?`url('#${$b(S.markerEnd,w)}')`:void 0,[S.markerEnd,w]);if(S.hidden||K===null||W===null||Y===null||I===null)return null;const me=ke=>{var _e;const{addSelectedEdges:le,unselectNodesAndEdges:Ce,multiSelectionActive:Me}=H.getState();B&&(H.setState({nodesSelectionActive:!1}),S.selected&&Me?(Ce({nodes:[],edges:[S]}),(_e=P.current)==null||_e.blur()):le([e])),r&&r(ke,S)},ye=a?ke=>{a(ke,{...S})}:void 0,Se=o?ke=>{o(ke,{...S})}:void 0,re=u?ke=>{u(ke,{...S})}:void 0,he=d?ke=>{d(ke,{...S})}:void 0,se=h?ke=>{h(ke,{...S})}:void 0,J=ke=>{var le;if(!A&&PA.includes(ke.key)&&B){const{unselectNodesAndEdges:Ce,addSelectedEdges:Me}=H.getState();ke.key==="Escape"?((le=P.current)==null||le.blur(),Ce({edges:[S]})):Me([e])}};return c.jsx("svg",{style:{zIndex:$},children:c.jsxs("g",{className:_n(["react-flow__edge",`react-flow__edge-${C}`,S.className,N,{selected:S.selected,animated:S.animated,inactive:!B&&!r,updating:F,selectable:B}]),onClick:me,onDoubleClick:ye,onContextMenu:Se,onMouseEnter:re,onMouseMove:he,onMouseLeave:se,onKeyDown:R?J:void 0,tabIndex:R?0:void 0,role:S.ariaRole??(R?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":S.ariaLabel===null?void 0:S.ariaLabel||`Edge from ${S.source} to ${S.target}`,"aria-describedby":R?`${yT}-${w}`:void 0,ref:P,...S.domAttributes,children:[!V&&c.jsx(T,{id:e,source:S.source,target:S.target,type:S.type,selected:S.selected,animated:S.animated,selectable:B,deletable:S.deletable??!0,label:S.label,labelStyle:S.labelStyle,labelShowBg:S.labelShowBg,labelBgStyle:S.labelBgStyle,labelBgPadding:S.labelBgPadding,labelBgBorderRadius:S.labelBgBorderRadius,sourceX:K,sourceY:W,targetX:Y,targetY:I,sourcePosition:L,targetPosition:G,data:S.data,style:S.style,sourceHandleId:S.sourceHandle,targetHandleId:S.targetHandle,markerStart:z,markerEnd:te,pathOptions:"pathOptions"in S?S.pathOptions:void 0,interactionWidth:S.interactionWidth}),O&&c.jsx(mZ,{edge:S,isReconnectable:O,reconnectRadius:g,onReconnect:p,onReconnectStart:y,onReconnectEnd:b,sourceX:K,sourceY:W,targetX:Y,targetY:I,sourcePosition:L,targetPosition:G,setUpdateHover:U,setReconnecting:M})]})})}var yZ=j.memo(gZ);const bZ=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function HT({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:i,noPanClassName:r,onReconnect:a,onEdgeContextMenu:o,onEdgeMouseEnter:u,onEdgeMouseMove:d,onEdgeMouseLeave:h,onEdgeClick:g,reconnectRadius:p,onEdgeDoubleClick:y,onReconnectStart:b,onReconnectEnd:w,disableKeyboardA11y:v}){const{edgesFocusable:N,edgesReconnectable:k,elementsSelectable:A,onError:S}=Nt(bZ,tn),_=nZ(t);return c.jsxs("div",{className:"react-flow__edges",children:[c.jsx(lZ,{defaultColor:e,rfId:n}),_.map(C=>c.jsx(yZ,{id:C,edgesFocusable:N,edgesReconnectable:k,elementsSelectable:A,noPanClassName:r,onReconnect:a,onContextMenu:o,onMouseEnter:u,onMouseMove:d,onMouseLeave:h,onClick:g,reconnectRadius:p,onDoubleClick:y,onReconnectStart:b,onReconnectEnd:w,rfId:n,onError:S,edgeTypes:i,disableKeyboardA11y:v},C))]})}HT.displayName="EdgeRenderer";const xZ=j.memo(HT),vZ=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function wZ({children:e}){const t=Nt(vZ);return c.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function kZ(e){const t=Tp(),n=j.useRef(!1);j.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const EZ=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function SZ(e){const t=Nt(EZ),n=nn();return j.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function NZ(e){return e.connection.inProgress?{...e.connection,to:pd(e.connection.to,e.transform)}:{...e.connection}}function _Z(e){return NZ}function jZ(e){const t=_Z();return Nt(t,tn)}const CZ=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function AZ({containerStyle:e,style:t,type:n,component:i}){const{nodesConnectable:r,width:a,height:o,isValid:u,inProgress:d}=Nt(CZ,tn);return!(a&&r&&d)?null:c.jsx("svg",{style:e,width:a,height:o,className:"react-flow__connectionline react-flow__container",children:c.jsx("g",{className:_n(["react-flow__connection",UA(u)]),children:c.jsx(KT,{style:t,type:n,CustomComponent:i,isValid:u})})})}const KT=({style:e,type:t=ca.Bezier,CustomComponent:n,isValid:i})=>{const{inProgress:r,from:a,fromNode:o,fromHandle:u,fromPosition:d,to:h,toNode:g,toHandle:p,toPosition:y,pointer:b}=jZ();if(!r)return;if(n)return c.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:o,fromHandle:u,fromX:a.x,fromY:a.y,toX:h.x,toY:h.y,fromPosition:d,toPosition:y,connectionStatus:UA(i),toNode:g,toHandle:p,pointer:b});let w="";const v={sourceX:a.x,sourceY:a.y,sourcePosition:d,targetX:h.x,targetY:h.y,targetPosition:y};switch(t){case ca.Bezier:[w]=eT(v);break;case ca.SimpleBezier:[w]=DT(v);break;case ca.Step:[w]=Bb({...v,borderRadius:0});break;case ca.SmoothStep:[w]=Bb(v);break;default:[w]=nT(v)}return c.jsx("path",{d:w,fill:"none",className:"react-flow__connection-path",style:e})};KT.displayName="ConnectionLine";const TZ={};function FN(e=TZ){j.useRef(e),nn(),j.useEffect(()=>{},[e])}function MZ(){nn(),j.useRef(!1),j.useEffect(()=>{},[])}function GT({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:i,onEdgeClick:r,onNodeDoubleClick:a,onEdgeDoubleClick:o,onNodeMouseEnter:u,onNodeMouseMove:d,onNodeMouseLeave:h,onNodeContextMenu:g,onSelectionContextMenu:p,onSelectionStart:y,onSelectionEnd:b,connectionLineType:w,connectionLineStyle:v,connectionLineComponent:N,connectionLineContainerStyle:k,selectionKeyCode:A,selectionOnDrag:S,selectionMode:_,multiSelectionKeyCode:C,panActivationKeyCode:T,zoomActivationKeyCode:R,deleteKeyCode:O,onlyRenderVisibleElements:B,elementsSelectable:P,defaultViewport:F,translateExtent:U,minZoom:V,maxZoom:M,preventScrolling:H,defaultMarkerColor:$,zoomOnScroll:K,zoomOnPinch:W,panOnScroll:Y,panOnScrollSpeed:I,panOnScrollMode:L,zoomOnDoubleClick:G,panOnDrag:z,autoPanOnSelection:te,onPaneClick:me,onPaneMouseEnter:ye,onPaneMouseMove:Se,onPaneMouseLeave:re,onPaneScroll:he,onPaneContextMenu:se,paneClickDistance:J,nodeClickDistance:ke,onEdgeContextMenu:le,onEdgeMouseEnter:Ce,onEdgeMouseMove:Me,onEdgeMouseLeave:_e,reconnectRadius:Qe,onReconnect:Ue,onReconnectStart:ue,onReconnectEnd:we,noDragClassName:xe,noWheelClassName:pe,noPanClassName:Ne,disableKeyboardA11y:je,nodeExtent:He,rfId:ne,viewport:de,onViewportChange:Le}){return FN(e),FN(t),MZ(),kZ(n),SZ(de),c.jsx(GX,{onPaneClick:me,onPaneMouseEnter:ye,onPaneMouseMove:Se,onPaneMouseLeave:re,onPaneContextMenu:se,onPaneScroll:he,paneClickDistance:J,deleteKeyCode:O,selectionKeyCode:A,selectionOnDrag:S,selectionMode:_,onSelectionStart:y,onSelectionEnd:b,multiSelectionKeyCode:C,panActivationKeyCode:T,zoomActivationKeyCode:R,elementsSelectable:P,zoomOnScroll:K,zoomOnPinch:W,zoomOnDoubleClick:G,panOnScroll:Y,panOnScrollSpeed:I,panOnScrollMode:L,panOnDrag:z,autoPanOnSelection:te,defaultViewport:F,translateExtent:U,minZoom:V,maxZoom:M,onSelectionContextMenu:p,preventScrolling:H,noDragClassName:xe,noWheelClassName:pe,noPanClassName:Ne,disableKeyboardA11y:je,onViewportChange:Le,isControlledViewport:!!de,children:c.jsxs(wZ,{children:[c.jsx(xZ,{edgeTypes:t,onEdgeClick:r,onEdgeDoubleClick:o,onReconnect:Ue,onReconnectStart:ue,onReconnectEnd:we,onlyRenderVisibleElements:B,onEdgeContextMenu:le,onEdgeMouseEnter:Ce,onEdgeMouseMove:Me,onEdgeMouseLeave:_e,reconnectRadius:Qe,defaultMarkerColor:$,noPanClassName:Ne,disableKeyboardA11y:je,rfId:ne}),c.jsx(AZ,{style:v,type:w,component:N,containerStyle:k}),c.jsx("div",{className:"react-flow__edgelabel-renderer"}),c.jsx(tZ,{nodeTypes:e,onNodeClick:i,onNodeDoubleClick:a,onNodeMouseEnter:u,onNodeMouseMove:d,onNodeMouseLeave:h,onNodeContextMenu:g,nodeClickDistance:ke,onlyRenderVisibleElements:B,noPanClassName:Ne,noDragClassName:xe,disableKeyboardA11y:je,nodeExtent:He,rfId:ne}),c.jsx("div",{className:"react-flow__viewport-portal"})]})})}GT.displayName="GraphView";const DZ=j.memo(GT),OZ=VA(),qN=({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:r,height:a,fitView:o,fitViewOptions:u,minZoom:d=.5,maxZoom:h=2,nodeOrigin:g,nodeExtent:p,zIndexMode:y="basic"}={})=>{const b=new Map,w=new Map,v=new Map,N=new Map,k=i??t??[],A=n??e??[],S=g??[0,0],_=p??Pu;sT(v,N,k);const{nodesInitialized:C}=Ub(A,b,w,{nodeOrigin:S,nodeExtent:_,zIndexMode:y});let T=[0,0,1];if(o&&r&&a){const R=fd(b,{filter:F=>!!((F.width||F.initialWidth)&&(F.height||F.initialHeight))}),{x:O,y:B,zoom:P}=g0(R,r,a,d,h,(u==null?void 0:u.padding)??.1);T=[O,B,P]}return{rfId:"1",width:r??0,height:a??0,transform:T,nodes:A,nodesInitialized:C,nodeLookup:b,parentLookup:w,edges:k,edgeLookup:N,connectionLookup:v,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:i!==void 0,panZoom:null,minZoom:d,maxZoom:h,translateExtent:Pu,nodeExtent:_,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Go.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:S,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:o??!1,fitViewOptions:u,fitViewResolver:null,connection:{...$A},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:OZ,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:BA,zIndexMode:y,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},RZ=({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:r,height:a,fitView:o,fitViewOptions:u,minZoom:d,maxZoom:h,nodeOrigin:g,nodeExtent:p,zIndexMode:y})=>GQ((b,w)=>{async function v(){const{nodeLookup:N,panZoom:k,fitViewOptions:A,fitViewResolver:S,width:_,height:C,minZoom:T,maxZoom:R}=w();k&&(await FW({nodes:N,width:_,height:C,panZoom:k,minZoom:T,maxZoom:R},A),S==null||S.resolve(!0),b({fitViewResolver:null}))}return{...qN({nodes:e,edges:t,width:r,height:a,fitView:o,fitViewOptions:u,minZoom:d,maxZoom:h,nodeOrigin:g,nodeExtent:p,defaultNodes:n,defaultEdges:i,zIndexMode:y}),setNodes:N=>{const{nodeLookup:k,parentLookup:A,nodeOrigin:S,elevateNodesOnSelect:_,fitViewQueued:C,zIndexMode:T,nodesSelectionActive:R}=w(),{nodesInitialized:O,hasSelectedNodes:B}=Ub(N,k,A,{nodeOrigin:S,nodeExtent:p,elevateNodesOnSelect:_,checkEquality:!0,zIndexMode:T}),P=R&&B;C&&O?(v(),b({nodes:N,nodesInitialized:O,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:P})):b({nodes:N,nodesInitialized:O,nodesSelectionActive:P})},setEdges:N=>{const{connectionLookup:k,edgeLookup:A}=w();sT(k,A,N),b({edges:N})},setDefaultNodesAndEdges:(N,k)=>{if(N){const{setNodes:A}=w();A(N),b({hasDefaultNodes:!0})}if(k){const{setEdges:A}=w();A(k),b({hasDefaultEdges:!0})}},updateNodeInternals:N=>{const{triggerNodeChanges:k,nodeLookup:A,parentLookup:S,domNode:_,nodeOrigin:C,nodeExtent:T,debug:R,fitViewQueued:O,zIndexMode:B}=w(),{changes:P,updatedInternals:F}=dQ(N,A,S,_,C,T,B);F&&(lQ(A,S,{nodeOrigin:C,nodeExtent:T,zIndexMode:B}),O?(v(),b({fitViewQueued:!1,fitViewOptions:void 0})):b({}),(P==null?void 0:P.length)>0&&(R&&console.log("React Flow: trigger node changes",P),k==null||k(P)))},updateNodePositions:(N,k=!1)=>{const A=[];let S=[];const{nodeLookup:_,triggerNodeChanges:C,connection:T,updateConnection:R,onNodesChangeMiddlewareMap:O}=w();for(const[B,P]of N){const F=_.get(B),U=!!(F!=null&&F.expandParent&&(F!=null&&F.parentId)&&(P!=null&&P.position)),V={id:B,type:"position",position:U?{x:Math.max(0,P.position.x),y:Math.max(0,P.position.y)}:P.position,dragging:k};if(F&&T.inProgress&&T.fromNode.id===F.id){const M=vl(F,T.fromHandle,Ke.Left,!0);R({...T,from:M})}U&&F.parentId&&A.push({id:B,parentId:F.parentId,rect:{...P.internals.positionAbsolute,width:P.measured.width??0,height:P.measured.height??0}}),S.push(V)}if(A.length>0){const{parentLookup:B,nodeOrigin:P}=w(),F=k0(A,_,B,P);S.push(...F)}for(const B of O.values())S=B(S);C(S)},triggerNodeChanges:N=>{const{onNodesChange:k,setNodes:A,nodes:S,hasDefaultNodes:_,debug:C}=w();if(N!=null&&N.length){if(_){const T=vT(N,S);A(T)}C&&console.log("React Flow: trigger node changes",N),k==null||k(N)}},triggerEdgeChanges:N=>{const{onEdgesChange:k,setEdges:A,edges:S,hasDefaultEdges:_,debug:C}=w();if(N!=null&&N.length){if(_){const T=wT(N,S);A(T)}C&&console.log("React Flow: trigger edge changes",N),k==null||k(N)}},addSelectedNodes:N=>{const{multiSelectionActive:k,edgeLookup:A,nodeLookup:S,triggerNodeChanges:_,triggerEdgeChanges:C}=w();if(k){const T=N.map(R=>Ya(R,!0));_(T);return}_(ko(S,new Set([...N]),!0)),C(ko(A))},addSelectedEdges:N=>{const{multiSelectionActive:k,edgeLookup:A,nodeLookup:S,triggerNodeChanges:_,triggerEdgeChanges:C}=w();if(k){const T=N.map(R=>Ya(R,!0));C(T);return}C(ko(A,new Set([...N]))),_(ko(S,new Set,!0))},unselectNodesAndEdges:({nodes:N,edges:k}={})=>{const{edges:A,nodes:S,nodeLookup:_,triggerNodeChanges:C,triggerEdgeChanges:T}=w(),R=N||S,O=k||A,B=[];for(const F of R){if(!F.selected)continue;const U=_.get(F.id);U&&(U.selected=!1),B.push(Ya(F.id,!1))}const P=[];for(const F of O)F.selected&&P.push(Ya(F.id,!1));C(B),T(P)},setMinZoom:N=>{const{panZoom:k,maxZoom:A}=w();k==null||k.setScaleExtent([N,A]),b({minZoom:N})},setMaxZoom:N=>{const{panZoom:k,minZoom:A}=w();k==null||k.setScaleExtent([A,N]),b({maxZoom:N})},setTranslateExtent:N=>{var k;(k=w().panZoom)==null||k.setTranslateExtent(N),b({translateExtent:N})},resetSelectedElements:()=>{const{edges:N,nodes:k,triggerNodeChanges:A,triggerEdgeChanges:S,elementsSelectable:_}=w();if(!_)return;const C=k.reduce((R,O)=>O.selected?[...R,Ya(O.id,!1)]:R,[]),T=N.reduce((R,O)=>O.selected?[...R,Ya(O.id,!1)]:R,[]);A(C),S(T)},setNodeExtent:N=>{const{nodes:k,nodeLookup:A,parentLookup:S,nodeOrigin:_,elevateNodesOnSelect:C,nodeExtent:T,zIndexMode:R}=w();N[0][0]===T[0][0]&&N[0][1]===T[0][1]&&N[1][0]===T[1][0]&&N[1][1]===T[1][1]||(Ub(k,A,S,{nodeOrigin:_,nodeExtent:N,elevateNodesOnSelect:C,checkEquality:!1,zIndexMode:R}),b({nodeExtent:N}))},panBy:N=>{const{transform:k,width:A,height:S,panZoom:_,translateExtent:C}=w();return fQ({delta:N,panZoom:_,transform:k,translateExtent:C,width:A,height:S})},setCenter:async(N,k,A)=>{const{width:S,height:_,maxZoom:C,panZoom:T}=w();if(!T)return!1;const R=typeof(A==null?void 0:A.zoom)<"u"?A.zoom:C;return await T.setViewport({x:S/2-N*R,y:_/2-k*R,zoom:R},{duration:A==null?void 0:A.duration,ease:A==null?void 0:A.ease,interpolate:A==null?void 0:A.interpolate}),!0},cancelConnection:()=>{b({connection:{...$A}})},updateConnection:N=>{b({connection:N})},reset:()=>b({...qN()})}},Object.is);function VT({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:i,initialWidth:r,initialHeight:a,initialMinZoom:o,initialMaxZoom:u,initialFitViewOptions:d,fitView:h,nodeOrigin:g,nodeExtent:p,zIndexMode:y,children:b}){const[w]=j.useState(()=>RZ({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:r,height:a,fitView:h,minZoom:o,maxZoom:u,fitViewOptions:d,nodeOrigin:g,nodeExtent:p,zIndexMode:y}));return c.jsx(VQ,{value:w,children:c.jsx(bX,{children:c.jsx(OX,{children:b})})})}function LZ({children:e,nodes:t,edges:n,defaultNodes:i,defaultEdges:r,width:a,height:o,fitView:u,fitViewOptions:d,minZoom:h,maxZoom:g,nodeOrigin:p,nodeExtent:y,zIndexMode:b}){return j.useContext(Cp)?c.jsx(c.Fragment,{children:e}):c.jsx(VT,{initialNodes:t,initialEdges:n,defaultNodes:i,defaultEdges:r,initialWidth:a,initialHeight:o,fitView:u,initialFitViewOptions:d,initialMinZoom:h,initialMaxZoom:g,nodeOrigin:p,nodeExtent:y,zIndexMode:b,children:e})}const zZ={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function IZ({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,className:r,nodeTypes:a,edgeTypes:o,onNodeClick:u,onEdgeClick:d,onInit:h,onMove:g,onMoveStart:p,onMoveEnd:y,onConnect:b,onConnectStart:w,onConnectEnd:v,onClickConnectStart:N,onClickConnectEnd:k,onNodeMouseEnter:A,onNodeMouseMove:S,onNodeMouseLeave:_,onNodeContextMenu:C,onNodeDoubleClick:T,onNodeDragStart:R,onNodeDrag:O,onNodeDragStop:B,onNodesDelete:P,onEdgesDelete:F,onDelete:U,onSelectionChange:V,onSelectionDragStart:M,onSelectionDrag:H,onSelectionDragStop:$,onSelectionContextMenu:K,onSelectionStart:W,onSelectionEnd:Y,onBeforeDelete:I,connectionMode:L,connectionLineType:G=ca.Bezier,connectionLineStyle:z,connectionLineComponent:te,connectionLineContainerStyle:me,deleteKeyCode:ye="Backspace",selectionKeyCode:Se="Shift",selectionOnDrag:re=!1,selectionMode:he=Bu.Full,panActivationKeyCode:se="Space",multiSelectionKeyCode:J=Uu()?"Meta":"Control",zoomActivationKeyCode:ke=Uu()?"Meta":"Control",snapToGrid:le,snapGrid:Ce,onlyRenderVisibleElements:Me=!1,selectNodesOnDrag:_e,nodesDraggable:Qe,autoPanOnNodeFocus:Ue,nodesConnectable:ue,nodesFocusable:we,nodeOrigin:xe=bT,edgesFocusable:pe,edgesReconnectable:Ne,elementsSelectable:je=!0,defaultViewport:He=aX,minZoom:ne=.5,maxZoom:de=2,translateExtent:Le=Pu,preventScrolling:Ze=!0,nodeExtent:rt,defaultMarkerColor:At="#b1b1b7",zoomOnScroll:$n=!0,zoomOnPinch:fn=!0,panOnScroll:Mt=!1,panOnScrollSpeed:Wt=.5,panOnScrollMode:yt=ul.Free,zoomOnDoubleClick:Ai=!0,panOnDrag:Rn=!0,onPaneClick:_l,onPaneMouseEnter:Br,onPaneMouseMove:ks,onPaneMouseLeave:$r,onPaneScroll:Un,onPaneContextMenu:Z,paneClickDistance:be=1,nodeClickDistance:Re=0,children:it,onReconnect:qt,onReconnectStart:Ot,onReconnectEnd:$e,onEdgeContextMenu:Pe,onEdgeDoubleClick:et,onEdgeMouseEnter:rn,onEdgeMouseMove:Vt,onEdgeMouseLeave:Yi,reconnectRadius:Es=10,onNodesChange:Ss,onEdgesChange:Ti,noDragClassName:sn="nodrag",noWheelClassName:Tn="nowheel",noPanClassName:Wi="nopan",fitView:Ns,fitViewOptions:_a,connectOnClick:_s,attributionPosition:jl,proOptions:Ur,defaultEdgeOptions:ja,elevateNodesOnSelect:Ln=!0,elevateEdgesOnSelect:Qi=!1,disableKeyboardA11y:Xi=!1,autoPanOnConnect:xr,autoPanOnNodeDrag:hn,autoPanOnSelection:Cl=!0,autoPanSpeed:Fr,connectionRadius:Zi,isValidConnection:Ae,onError:Ge,style:ht,id:_t,nodeDragThreshold:an,connectionDragThreshold:Mn,viewport:Wn,onViewportChange:Fn,width:It,height:Qn,colorMode:Al="light",debug:js,onScroll:vr,ariaLabelConfig:Cs,zIndexMode:Tl="basic",...qn},Ca){const Ji=_t||"1",As=uX(Al),jn=j.useCallback(Aa=>{Aa.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),vr==null||vr(Aa)},[vr]);return c.jsx("div",{"data-testid":"rf__wrapper",...qn,onScroll:jn,style:{...ht,...zZ},ref:Ca,className:_n(["react-flow",r,As]),id:_t,role:"application",children:c.jsxs(LZ,{nodes:e,edges:t,width:It,height:Qn,fitView:Ns,fitViewOptions:_a,minZoom:ne,maxZoom:de,nodeOrigin:xe,nodeExtent:rt,zIndexMode:Tl,children:[c.jsx(cX,{nodes:e,edges:t,defaultNodes:n,defaultEdges:i,onConnect:b,onConnectStart:w,onConnectEnd:v,onClickConnectStart:N,onClickConnectEnd:k,nodesDraggable:Qe,autoPanOnNodeFocus:Ue,nodesConnectable:ue,nodesFocusable:we,edgesFocusable:pe,edgesReconnectable:Ne,elementsSelectable:je,elevateNodesOnSelect:Ln,elevateEdgesOnSelect:Qi,minZoom:ne,maxZoom:de,nodeExtent:rt,onNodesChange:Ss,onEdgesChange:Ti,snapToGrid:le,snapGrid:Ce,connectionMode:L,translateExtent:Le,connectOnClick:_s,defaultEdgeOptions:ja,fitView:Ns,fitViewOptions:_a,onNodesDelete:P,onEdgesDelete:F,onDelete:U,onNodeDragStart:R,onNodeDrag:O,onNodeDragStop:B,onSelectionDrag:H,onSelectionDragStart:M,onSelectionDragStop:$,onMove:g,onMoveStart:p,onMoveEnd:y,noPanClassName:Wi,nodeOrigin:xe,rfId:Ji,autoPanOnConnect:xr,autoPanOnNodeDrag:hn,autoPanSpeed:Fr,onError:Ge,connectionRadius:Zi,isValidConnection:Ae,selectNodesOnDrag:_e,nodeDragThreshold:an,connectionDragThreshold:Mn,onBeforeDelete:I,debug:js,ariaLabelConfig:Cs,zIndexMode:Tl}),c.jsx(DZ,{onInit:h,onNodeClick:u,onEdgeClick:d,onNodeMouseEnter:A,onNodeMouseMove:S,onNodeMouseLeave:_,onNodeContextMenu:C,onNodeDoubleClick:T,nodeTypes:a,edgeTypes:o,connectionLineType:G,connectionLineStyle:z,connectionLineComponent:te,connectionLineContainerStyle:me,selectionKeyCode:Se,selectionOnDrag:re,selectionMode:he,deleteKeyCode:ye,multiSelectionKeyCode:J,panActivationKeyCode:se,zoomActivationKeyCode:ke,onlyRenderVisibleElements:Me,defaultViewport:He,translateExtent:Le,minZoom:ne,maxZoom:de,preventScrolling:Ze,zoomOnScroll:$n,zoomOnPinch:fn,zoomOnDoubleClick:Ai,panOnScroll:Mt,panOnScrollSpeed:Wt,panOnScrollMode:yt,panOnDrag:Rn,autoPanOnSelection:Cl,onPaneClick:_l,onPaneMouseEnter:Br,onPaneMouseMove:ks,onPaneMouseLeave:$r,onPaneScroll:Un,onPaneContextMenu:Z,paneClickDistance:be,nodeClickDistance:Re,onSelectionContextMenu:K,onSelectionStart:W,onSelectionEnd:Y,onReconnect:qt,onReconnectStart:Ot,onReconnectEnd:$e,onEdgeContextMenu:Pe,onEdgeDoubleClick:et,onEdgeMouseEnter:rn,onEdgeMouseMove:Vt,onEdgeMouseLeave:Yi,reconnectRadius:Es,defaultMarkerColor:At,noDragClassName:sn,noWheelClassName:Tn,noPanClassName:Wi,rfId:Ji,disableKeyboardA11y:Xi,nodeExtent:rt,viewport:Wn,onViewportChange:Fn}),c.jsx(sX,{onSelectionChange:V}),it,c.jsx(eX,{proOptions:Ur,position:jl}),c.jsx(JQ,{rfId:Ji,disableKeyboardA11y:Xi})]})})}var PZ=kT(IZ);function BZ(e){const[t,n]=j.useState(e),i=j.useCallback(r=>n(a=>vT(r,a)),[]);return[t,n,i]}function $Z(e){const[t,n]=j.useState(e),i=j.useCallback(r=>n(a=>wT(r,a)),[]);return[t,n,i]}function UZ({dimensions:e,lineWidth:t,variant:n,className:i}){return c.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:_n(["react-flow__background-pattern",n,i])})}function FZ({radius:e,className:t}){return c.jsx("circle",{cx:e,cy:e,r:e,className:_n(["react-flow__background-pattern","dots",t])})}var ms;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(ms||(ms={}));const qZ={[ms.Dots]:1,[ms.Lines]:1,[ms.Cross]:6},HZ=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function YT({id:e,variant:t=ms.Dots,gap:n=20,size:i,lineWidth:r=1,offset:a=0,color:o,bgColor:u,style:d,className:h,patternClassName:g}){const p=j.useRef(null),{transform:y,patternId:b}=Nt(HZ,tn),w=i||qZ[t],v=t===ms.Dots,N=t===ms.Cross,k=Array.isArray(n)?n:[n,n],A=[k[0]*y[2]||1,k[1]*y[2]||1],S=w*y[2],_=Array.isArray(a)?a:[a,a],C=N?[S,S]:A,T=[_[0]*y[2]||1+C[0]/2,_[1]*y[2]||1+C[1]/2],R=`${b}${e||""}`;return c.jsxs("svg",{className:_n(["react-flow__background",h]),style:{...d,...Mp,"--xy-background-color-props":u,"--xy-background-pattern-color-props":o},ref:p,"data-testid":"rf__background",children:[c.jsx("pattern",{id:R,x:y[0]%A[0],y:y[1]%A[1],width:A[0],height:A[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${T[0]},-${T[1]})`,children:v?c.jsx(FZ,{radius:S/2,className:g}):c.jsx(UZ,{dimensions:C,lineWidth:r,variant:t,className:g})}),c.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${R})`})]})}YT.displayName="Background";const KZ=j.memo(YT);function GZ(){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:c.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function VZ(){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:c.jsx("path",{d:"M0 0h32v4.2H0z"})})}function YZ(){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:c.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 WZ(){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:c.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 QZ(){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:c.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 nh({children:e,className:t,...n}){return c.jsx("button",{type:"button",className:_n(["react-flow__controls-button",t]),...n,children:e})}const XZ=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function WT({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:i=!0,fitViewOptions:r,onZoomIn:a,onZoomOut:o,onFitView:u,onInteractiveChange:d,className:h,children:g,position:p="bottom-left",orientation:y="vertical","aria-label":b}){const w=nn(),{isInteractive:v,minZoomReached:N,maxZoomReached:k,ariaLabelConfig:A}=Nt(XZ,tn),{zoomIn:S,zoomOut:_,fitView:C}=Tp(),T=()=>{S(),a==null||a()},R=()=>{_(),o==null||o()},O=()=>{C(r),u==null||u()},B=()=>{w.setState({nodesDraggable:!v,nodesConnectable:!v,elementsSelectable:!v}),d==null||d(!v)},P=y==="horizontal"?"horizontal":"vertical";return c.jsxs(Ap,{className:_n(["react-flow__controls",P,h]),position:p,style:e,"data-testid":"rf__controls","aria-label":b??A["controls.ariaLabel"],children:[t&&c.jsxs(c.Fragment,{children:[c.jsx(nh,{onClick:T,className:"react-flow__controls-zoomin",title:A["controls.zoomIn.ariaLabel"],"aria-label":A["controls.zoomIn.ariaLabel"],disabled:k,children:c.jsx(GZ,{})}),c.jsx(nh,{onClick:R,className:"react-flow__controls-zoomout",title:A["controls.zoomOut.ariaLabel"],"aria-label":A["controls.zoomOut.ariaLabel"],disabled:N,children:c.jsx(VZ,{})})]}),n&&c.jsx(nh,{className:"react-flow__controls-fitview",onClick:O,title:A["controls.fitView.ariaLabel"],"aria-label":A["controls.fitView.ariaLabel"],children:c.jsx(YZ,{})}),i&&c.jsx(nh,{className:"react-flow__controls-interactive",onClick:B,title:A["controls.interactive.ariaLabel"],"aria-label":A["controls.interactive.ariaLabel"],children:v?c.jsx(QZ,{}):c.jsx(WZ,{})}),g]})}WT.displayName="Controls";const ZZ=j.memo(WT);function JZ({id:e,x:t,y:n,width:i,height:r,style:a,color:o,strokeColor:u,strokeWidth:d,className:h,borderRadius:g,shapeRendering:p,selected:y,onClick:b}){const{background:w,backgroundColor:v}=a||{},N=o||w||v;return c.jsx("rect",{className:_n(["react-flow__minimap-node",{selected:y},h]),x:t,y:n,rx:g,ry:g,width:i,height:r,style:{fill:N,stroke:u,strokeWidth:d},shapeRendering:p,onClick:b?k=>b(k,e):void 0})}const eJ=j.memo(JZ),tJ=e=>e.nodes.map(t=>t.id),By=e=>e instanceof Function?e:()=>e;function nJ({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:i=5,nodeStrokeWidth:r,nodeComponent:a=eJ,onClick:o}){const u=Nt(tJ,tn),d=By(t),h=By(e),g=By(n),p=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return c.jsx(c.Fragment,{children:u.map(y=>c.jsx(rJ,{id:y,nodeColorFunc:d,nodeStrokeColorFunc:h,nodeClassNameFunc:g,nodeBorderRadius:i,nodeStrokeWidth:r,NodeComponent:a,onClick:o,shapeRendering:p},y))})}function iJ({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:i,nodeBorderRadius:r,nodeStrokeWidth:a,shapeRendering:o,NodeComponent:u,onClick:d}){const{node:h,x:g,y:p,width:y,height:b}=Nt(w=>{const v=w.nodeLookup.get(e);if(!v)return{node:void 0,x:0,y:0,width:0,height:0};const N=v.internals.userNode,{x:k,y:A}=v.internals.positionAbsolute,{width:S,height:_}=ws(N);return{node:N,x:k,y:A,width:S,height:_}},tn);return!h||h.hidden||!YA(h)?null:c.jsx(u,{x:g,y:p,width:y,height:b,style:h.style,selected:!!h.selected,className:i(h),color:t(h),borderRadius:r,strokeColor:n(h),strokeWidth:a,shapeRendering:o,onClick:d,id:h.id})}const rJ=j.memo(iJ);var sJ=j.memo(nJ);const aJ=200,lJ=150,oJ=e=>!e.hidden,cJ=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?KA(fd(e.nodeLookup,{filter:oJ}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},uJ="react-flow__minimap-desc";function QT({style:e,className:t,nodeStrokeColor:n,nodeColor:i,nodeClassName:r="",nodeBorderRadius:a=5,nodeStrokeWidth:o,nodeComponent:u,bgColor:d,maskColor:h,maskStrokeColor:g,maskStrokeWidth:p,position:y="bottom-right",onClick:b,onNodeClick:w,pannable:v=!1,zoomable:N=!1,ariaLabel:k,inversePan:A,zoomStep:S=1,offsetScale:_=5}){const C=nn(),T=j.useRef(null),{boundingRect:R,viewBB:O,rfId:B,panZoom:P,translateExtent:F,flowWidth:U,flowHeight:V,ariaLabelConfig:M}=Nt(cJ,tn),H=(e==null?void 0:e.width)??aJ,$=(e==null?void 0:e.height)??lJ,K=R.width/H,W=R.height/$,Y=Math.max(K,W),I=Y*H,L=Y*$,G=_*Y,z=R.x-(I-R.width)/2-G,te=R.y-(L-R.height)/2-G,me=I+G*2,ye=L+G*2,Se=`${uJ}-${B}`,re=j.useRef(0),he=j.useRef();re.current=Y,j.useEffect(()=>{if(T.current&&P)return he.current=wQ({domNode:T.current,panZoom:P,getTransform:()=>C.getState().transform,getViewScale:()=>re.current}),()=>{var le;(le=he.current)==null||le.destroy()}},[P]),j.useEffect(()=>{var le;(le=he.current)==null||le.update({translateExtent:F,width:U,height:V,inversePan:A,pannable:v,zoomStep:S,zoomable:N})},[v,N,A,S,F,U,V]);const se=b?le=>{var _e;const[Ce,Me]=((_e=he.current)==null?void 0:_e.pointer(le))||[0,0];b(le,{x:Ce,y:Me})}:void 0,J=w?j.useCallback((le,Ce)=>{const Me=C.getState().nodeLookup.get(Ce).internals.userNode;w(le,Me)},[]):void 0,ke=k??M["minimap.ariaLabel"];return c.jsx(Ap,{position:y,style:{...e,"--xy-minimap-background-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-background-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-stroke-color-props":typeof g=="string"?g:void 0,"--xy-minimap-mask-stroke-width-props":typeof p=="number"?p*Y: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 o=="number"?o:void 0},className:_n(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:c.jsxs("svg",{width:H,height:$,viewBox:`${z} ${te} ${me} ${ye}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":Se,ref:T,onClick:se,children:[ke&&c.jsx("title",{id:Se,children:ke}),c.jsx(sJ,{onClick:J,nodeColor:i,nodeStrokeColor:n,nodeBorderRadius:a,nodeClassName:r,nodeStrokeWidth:o,nodeComponent:u}),c.jsx("path",{className:"react-flow__minimap-mask",d:`M${z-G},${te-G}h${me+G*2}v${ye+G*2}h${-me-G*2}z
|
|
811
|
+
M${O.x},${O.y}h${O.width}v${O.height}h${-O.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}QT.displayName="MiniMap";j.memo(QT);const dJ=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,fJ={[Wo.Line]:"right",[Wo.Handle]:"bottom-right"};function hJ({nodeId:e,position:t,variant:n=Wo.Handle,className:i,style:r=void 0,children:a,color:o,minWidth:u=10,minHeight:d=10,maxWidth:h=Number.MAX_VALUE,maxHeight:g=Number.MAX_VALUE,keepAspectRatio:p=!1,resizeDirection:y,autoScale:b=!0,shouldResize:w,onResizeStart:v,onResize:N,onResizeEnd:k}){const A=_T(),S=typeof e=="string"?e:A,_=nn(),C=j.useRef(null),T=n===Wo.Handle,R=Nt(j.useCallback(dJ(T&&b),[T,b]),tn),O=j.useRef(null),B=t??fJ[n];j.useEffect(()=>{if(!(!C.current||!S))return O.current||(O.current=RQ({domNode:C.current,nodeId:S,getStoreItems:()=>{const{nodeLookup:F,transform:U,snapGrid:V,snapToGrid:M,nodeOrigin:H,domNode:$}=_.getState();return{nodeLookup:F,transform:U,snapGrid:V,snapToGrid:M,nodeOrigin:H,paneDomNode:$}},onChange:(F,U)=>{const{triggerNodeChanges:V,nodeLookup:M,parentLookup:H,nodeOrigin:$}=_.getState(),K=[],W={x:F.x,y:F.y},Y=M.get(S);if(Y&&Y.expandParent&&Y.parentId){const I=Y.origin??$,L=F.width??Y.measured.width??0,G=F.height??Y.measured.height??0,z={id:Y.id,parentId:Y.parentId,rect:{width:L,height:G,...WA({x:F.x??Y.position.x,y:F.y??Y.position.y},{width:L,height:G},Y.parentId,M,I)}},te=k0([z],M,H,$);K.push(...te),W.x=F.x?Math.max(I[0]*L,F.x):void 0,W.y=F.y?Math.max(I[1]*G,F.y):void 0}if(W.x!==void 0&&W.y!==void 0){const I={id:S,type:"position",position:{...W}};K.push(I)}if(F.width!==void 0&&F.height!==void 0){const L={id:S,type:"dimensions",resizing:!0,setAttributes:y?y==="horizontal"?"width":"height":!0,dimensions:{width:F.width,height:F.height}};K.push(L)}for(const I of U){const L={...I,type:"position"};K.push(L)}V(K)},onEnd:({width:F,height:U})=>{const V={id:S,type:"dimensions",resizing:!1,dimensions:{width:F,height:U}};_.getState().triggerNodeChanges([V])}})),O.current.update({controlPosition:B,boundaries:{minWidth:u,minHeight:d,maxWidth:h,maxHeight:g},keepAspectRatio:p,resizeDirection:y,onResizeStart:v,onResize:N,onResizeEnd:k,shouldResize:w}),()=>{var F;(F=O.current)==null||F.destroy()}},[B,u,d,h,g,p,v,N,k,w]);const P=B.split("-");return c.jsx("div",{className:_n(["react-flow__resize-control","nodrag",...P,n,i]),ref:C,style:{...r,scale:R,...o&&{[T?"backgroundColor":"borderColor"]:o}},children:a})}j.memo(hJ);function pJ(e){return ct(`/api/smartarrange/${encodeURIComponent(e)}`)}async function mJ(e){const t=await fetch(`/api/smartarrange/${encodeURIComponent(e)}/approve`,{method:"POST"});if(!t.ok)throw new Error(`${t.status}: ${await t.text()}`);return t.json()}const $y=["var(--color-accent-mint)","var(--color-accent-pink)","var(--color-accent-purple)","var(--color-accent-yellow)","var(--color-running-bg)","var(--color-idle-bg)","var(--color-stuck-bg)"];function HN(e,t){return $y[t%$y.length]??$y[0]}const XT={done:"var(--color-cta)",doing:"var(--color-secondary-dark)",todo:"var(--color-text-subtle)",stuck:"var(--color-crashed)"},ho={width:9,height:9,background:"var(--color-bg)",border:"1px solid var(--color-border-light)"},gJ=j.memo(function({data:t,selected:n}){var r;const i=t;return c.jsxs("div",{className:"rounded-2xl border border-[var(--color-border-light)] bg-[var(--color-bg-soft)] overflow-hidden cursor-pointer flex flex-col",style:{width:260,height:158,boxShadow:n?"rgba(255, 255, 255, 0.22) 0 0 0 1px inset":"rgba(255, 255, 255, 0.10) 0 0 0 1px inset"},children:[c.jsx(Dr,{id:"l-t",type:"target",position:Ke.Left,style:ho}),c.jsx(Dr,{id:"r-t",type:"target",position:Ke.Right,style:ho}),c.jsx(Dr,{id:"t-t",type:"target",position:Ke.Top,style:ho}),c.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1.5 border-b border-[var(--color-border-light)]",style:{background:i.color},children:[c.jsxs("span",{className:"font-[family-name:var(--font-mono)] text-xs font-bold text-[var(--color-text)]",children:["#",i.seq]}),c.jsx("span",{className:"text-[11px] text-[var(--color-text)] truncate",children:i.taskLabel}),c.jsx("span",{className:"w-2.5 h-2.5 rounded-full inline-block shrink-0 ml-auto",style:{background:XT[i.status]??"gray"},title:i.status})]}),c.jsxs("div",{className:"px-2.5 py-2 flex-1 min-h-0 overflow-hidden",children:[c.jsx("p",{className:"text-[13px] font-semibold text-[var(--color-text)] leading-snug line-clamp-3",children:i.title}),((r=i.skills)==null?void 0:r.length)>0&&c.jsx("div",{className:"flex flex-wrap gap-1 mt-2 max-h-[46px] overflow-hidden",children:i.skills.slice(0,6).map(a=>c.jsx("span",{className:"text-[10px] font-[family-name:var(--font-mono)] px-1.5 py-0.5 rounded bg-[rgba(255,255,255,0.08)] text-[var(--color-text)]",children:a},a))})]}),c.jsx(Dr,{id:"r-s",type:"source",position:Ke.Right,style:ho}),c.jsx(Dr,{id:"l-s",type:"source",position:Ke.Left,style:ho}),c.jsx(Dr,{id:"b-s",type:"source",position:Ke.Bottom,style:ho})]})});function yJ({card:e,status:t,onClose:n}){var r;const i=Ie();return j.useEffect(()=>{const a=o=>{o.key==="Escape"&&n()};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[n]),c.jsx("div",{role:"dialog","aria-modal":"true",className:"fixed inset-0 z-40 flex items-start justify-center p-6 bg-black/30 overflow-auto",onClick:n,children:c.jsxs("div",{className:"nb-card mt-12 w-full max-w-2xl bg-[var(--color-bg)]",onClick:a=>a.stopPropagation(),children:[c.jsxs("header",{className:"flex items-start justify-between gap-4 mb-4",children:[c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-2 flex-wrap",children:[c.jsxs("span",{className:"font-[family-name:var(--font-mono)] font-bold text-xs px-2 py-0.5 bg-[var(--color-accent-purple)] border-2 border-[var(--color-text)] rounded-full",children:["#",e.seq]}),c.jsxs("span",{className:"font-[family-name:var(--font-mono)] text-xs px-2 py-0.5 bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-full font-semibold",children:[i("arrange.cardTask")," T",e.taskId]}),c.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs px-2 py-0.5 border-2 border-[var(--color-text)] rounded-full font-semibold",children:[c.jsx("span",{className:"w-2.5 h-2.5 rounded-full inline-block border border-[var(--color-text)]",style:{background:XT[t]??"gray"}}),t]})]}),c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-2xl font-bold break-words",children:e.title})]}),c.jsx("button",{onClick:n,className:"nb-btn nb-btn-mint p-2 flex-shrink-0","aria-label":i("arrange.close"),type:"button",children:c.jsx(Jt,{size:14,strokeWidth:3})})]}),c.jsxs("div",{className:"flex flex-col gap-4",children:[e.at&&c.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[c.jsx(q2,{size:14,strokeWidth:2.5}),c.jsx("span",{className:"font-[family-name:var(--font-mono)]",children:e.at})]}),((r=e.skills)==null?void 0:r.length)>0&&c.jsxs("div",{children:[c.jsx("div",{className:"text-sm font-bold mb-1.5",children:i("arrange.cardSkills")}),c.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:e.skills.map(a=>c.jsx(Dx,{name:a},a))})]}),e.prompt&&c.jsxs("div",{children:[c.jsx("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold mb-2 uppercase tracking-wider",children:i("arrange.cardPrompt")}),c.jsx("pre",{className:"text-xs whitespace-pre-wrap font-[family-name:var(--font-mono)] bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-lg p-4 max-h-72 overflow-auto",children:e.prompt})]}),c.jsxs("div",{children:[c.jsx("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold mb-2 uppercase tracking-wider",children:i("arrange.cardLog")}),c.jsxs("pre",{className:"text-xs whitespace-pre-wrap font-[family-name:var(--font-mono)] bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-lg p-4",children:[e.at?`${e.at} [派发] #${e.seq} → ${i("arrange.cardTask")} T${e.taskId}`:"—",`
|
|
812
|
+
${e.at??""} [状态] ${t}`]})]})]})]})})}const bJ=j.memo(function({data:t}){const n=t;return c.jsxs("div",{className:"relative w-full h-full rounded-2xl border-2 border-dashed border-[var(--color-text)]",children:[c.jsx("div",{className:"absolute inset-0 rounded-2xl",style:{background:n.color,opacity:.16}}),c.jsx("span",{className:"absolute top-1.5 left-2.5 px-2 py-0.5 text-[11px] font-bold rounded-md border-2 border-[var(--color-text)] bg-[var(--color-bg)] text-[var(--color-text)] whitespace-nowrap max-w-[90%] truncate",children:n.label})]})}),xJ={card:gJ,laneBox:bJ},S0=260,ZT=S0+36,vJ=200,wJ={todo:"var(--color-text-subtle)",doing:"var(--color-secondary-dark)",done:"var(--color-cta)",rework:"var(--color-secondary-dark)"};function Hb(e,t,n){return e==="doing"&&t<n?"stuck":e}function kJ(e,t){const n=Math.floor(e/t),i=e%t;return{x:(n%2===0?i:t-1-i)*ZT,y:n*vJ}}function EJ(e,t,n){const i=Math.floor(e/n),r=Math.floor(t/n);return i===r?i%2===0?{sourceHandle:"r-s",targetHandle:"l-t"}:{sourceHandle:"l-s",targetHandle:"r-t"}:{sourceHandle:"b-s",targetHandle:"t-t"}}function SJ(e){return e==="done"?{animated:!1,style:{stroke:"var(--color-cta)",strokeWidth:2.5}}:e==="doing"?{animated:!0,style:{stroke:"var(--color-secondary-dark)",strokeWidth:3}}:e==="stuck"?{animated:!1,style:{stroke:"var(--color-crashed)",strokeWidth:2.5,strokeDasharray:"6 4"}}:{animated:!1,style:{stroke:"var(--color-accent-yellow)",strokeWidth:2.5,strokeDasharray:"6 4"}}}const JT=158,KN=S0+60,GN=JT+28,VN=40;function NJ({cards:e,taskMeta:t,view:n,onSelect:i}){const r=j.useRef(null),[a,o]=j.useState(4),u=Tp(),[d,h,g]=BZ([]),[p,y]=$Z([]),b=j.useRef("");return j.useEffect(()=>{const w=r.current;if(!w)return;const v=new ResizeObserver(N=>{var A;const k=((A=N[0])==null?void 0:A.contentRect.width)??800;o(Math.max(1,Math.min(8,Math.floor((k-40)/ZT))))});return v.observe(w),()=>v.disconnect()},[]),j.useEffect(()=>{const w=[...e].sort((T,R)=>T.seq-R.seq),v=`${n}:${a}:${w.length}`,N=b.current!==v;b.current=v;const k=new Map,A=(T,R)=>{var O;if(n==="lane"){const B=((O=t.get(T.taskId))==null?void 0:O.order)??0,P=k.get(T.taskId)??0;return k.set(T.taskId,P+1),{x:B*KN,y:P*GN}}return kJ(R,a)},S=[];if(n==="lane"){const T=new Map;for(const R of w)T.set(R.taskId,(T.get(R.taskId)??0)+1);for(const[R,O]of T){const B=t.get(R),P=(B==null?void 0:B.order)??0;S.push({id:`lane-${R}`,type:"laneBox",position:{x:P*KN-16,y:-VN},data:{label:B!=null&&B.title?`T${R} · ${B.title}`:`T${R}`,color:(B==null?void 0:B.color)??"var(--color-bg-cream)"},style:{width:S0+32,height:VN+(O-1)*GN+JT+14},draggable:!1,selectable:!1,zIndex:0})}}const _=w.length?w[w.length-1].seq:0;h(T=>{const R=new Map(T.map(B=>[B.id,B])),O=w.map((B,P)=>{const F=t.get(B.taskId),U={seq:B.seq,title:B.title,skills:B.skills??[],taskLabel:`T${B.taskId}`,status:Hb(B.status,B.seq,_),color:(F==null?void 0:F.color)??"var(--color-bg-cream)"},V=String(B.seq),M=R.get(V),H=A(B,P);return{...M&&!N?{...M,data:U}:{id:V,type:"card",position:H,data:U},zIndex:1}});return[...S,...O]});const C=[];for(let T=1;T<w.length;T++){const R=w[T-1],O=w[T];if(!R||!O)continue;const B=n==="lane"?R.taskId===O.taskId?{sourceHandle:"b-s",targetHandle:"t-t"}:{sourceHandle:"r-s",targetHandle:"l-t"}:EJ(T-1,T,a);C.push({id:`e${R.seq}-${O.seq}`,source:String(R.seq),target:String(O.seq),...B,...SJ(Hb(O.status,O.seq,_))})}y(C),N&&requestAnimationFrame(()=>u.fitView({padding:.2,maxZoom:1.1,duration:300}))},[e,a,t,n,h,y,u]),c.jsx("div",{ref:r,className:"w-full h-full",children:c.jsxs(PZ,{nodes:d,edges:p,onNodesChange:g,nodeTypes:xJ,onNodeClick:(w,v)=>i(Number(v.id)),fitView:!0,fitViewOptions:{padding:.2,maxZoom:1.1},proOptions:{hideAttribution:!0},minZoom:.15,children:[c.jsx(KZ,{variant:ms.Dots,gap:20,size:1.5,color:"var(--color-border-light)"}),c.jsx(ZZ,{showInteractive:!1})]})})}function _J(){var P,F,U;const e=Ie(),t=Ft(),{alert:n}=dn(),r=(((P=Ve({queryKey:["projects"],queryFn:Ea,refetchInterval:3e3}).data)==null?void 0:P.data)??[]).filter(V=>V.pipelineMode==="smartArrange"),a=r.map(V=>V.name),[o,u]=j.useState(()=>localStorage.getItem("arrange.project")??""),d=o&&a.includes(o)?o:a[0]??"";j.useEffect(()=>{o&&localStorage.setItem("arrange.project",o)},[o]);const h=r.find(V=>V.name===d),g=(h==null?void 0:h.pipelineStatus)==="running",p=Ve({queryKey:["smartarrange",d],queryFn:()=>pJ(d),enabled:!!d,refetchInterval:3e3}),y=Et({mutationFn:()=>mJ(d),onSuccess:()=>t.invalidateQueries({queryKey:["smartarrange",d]}),onError:V=>void n({title:e("arrange.approveErr"),body:V instanceof Error?V.message:String(V)})}),b=Et({mutationFn:()=>_j(d),onSuccess:()=>t.invalidateQueries({queryKey:["projects"]}),onError:V=>void n({title:e("arrange.startErr"),body:V instanceof Error?V.message:String(V)})}),w=Et({mutationFn:()=>jj(d),onSuccess:()=>t.invalidateQueries({queryKey:["projects"]}),onError:V=>void n({title:e("arrange.startErr"),body:V instanceof Error?V.message:String(V)})}),v=(F=p.data)==null?void 0:F.plan,N=j.useMemo(()=>{var V;return((V=p.data)==null?void 0:V.cards)??[]},[(U=p.data)==null?void 0:U.cards]),[k,A]=j.useState(()=>localStorage.getItem("arrange.view")==="lane"?"lane":"free");j.useEffect(()=>{localStorage.setItem("arrange.view",k)},[k]);const S=j.useMemo(()=>{const V=new Map;return((v==null?void 0:v.tasks)??[]).forEach((M,H)=>V.set(M.id,{order:H,status:M.status,color:HN(M.id,H),title:M.title})),V},[v==null?void 0:v.tasks]),[_,C]=j.useState(()=>localStorage.getItem("arrange.panel")!=="0");j.useEffect(()=>{localStorage.setItem("arrange.panel",_?"1":"0")},[_]);const[T,R]=j.useState(null),O=j.useMemo(()=>N.find(V=>V.seq===T),[N,T]),B=N.length?Math.max(...N.map(V=>V.seq)):0;return c.jsxs("div",{className:"flex flex-col gap-4 h-full min-h-0",children:[c.jsxs("header",{className:"flex items-center justify-between gap-3 flex-wrap shrink-0",children:[c.jsxs("div",{className:"flex items-center gap-4 flex-wrap",children:[c.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-3xl font-bold",children:e("arrange.h1")}),d&&c.jsxs("div",{className:"flex items-center gap-2",children:[g?c.jsxs("button",{className:"nb-btn nb-btn-yellow",style:{padding:"6px 12px",fontSize:12},onClick:()=>w.mutate(),disabled:w.isPending,type:"button","aria-label":e("arrange.stop"),children:[w.isPending?c.jsx(Xe,{size:12,strokeWidth:3,className:"animate-spin"}):c.jsx(lx,{size:12,strokeWidth:3}),e("arrange.stop")]}):c.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"6px 12px",fontSize:12},onClick:()=>b.mutate(),disabled:b.isPending,type:"button","aria-label":e("arrange.start"),children:[b.isPending?c.jsx(Xe,{size:12,strokeWidth:3,className:"animate-spin"}):c.jsx(td,{size:12,strokeWidth:3}),e("arrange.start")]}),v&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"nb-status",style:{background:"var(--color-bg-cream)",color:"var(--color-text)"},children:v.status}),c.jsxs("span",{className:"text-sm text-[var(--color-text-muted)]",children:["round ",v.round,"/",v.maxRounds]}),v.status==="awaiting-approval"&&c.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"6px 12px",fontSize:12},onClick:()=>y.mutate(),disabled:y.isPending,type:"button","aria-label":e("arrange.approve"),children:[y.isPending?c.jsx(Xe,{size:12,strokeWidth:3,className:"animate-spin"}):c.jsx(kh,{size:12,strokeWidth:2.5}),e("arrange.approve")]})]})]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[v&&c.jsxs("button",{className:"nb-btn",style:{padding:"6px 10px",fontSize:12},onClick:()=>A(k==="free"?"lane":"free"),type:"button","aria-label":e("arrange.view"),children:[k==="lane"?c.jsx(mz,{size:14,strokeWidth:2.5}):c.jsx(V2,{size:14,strokeWidth:2.5}),e(k==="lane"?"arrange.viewLane":"arrange.viewFree")]}),c.jsxs("select",{className:"nb-input",style:{maxWidth:240},value:d,onChange:V=>u(V.target.value),"aria-label":e("arrange.project"),children:[a.length===0&&c.jsx("option",{value:"",children:"—"}),a.map(V=>c.jsx("option",{value:V,children:V},V))]})]})]}),v?c.jsxs("div",{className:"flex gap-4 flex-1 min-h-0",children:[c.jsxs("div",{className:"relative flex-1 min-h-0 rounded-2xl border-[3px] border-[var(--color-text)] overflow-hidden bg-[var(--color-bg-soft)]",style:{boxShadow:"4px 4px 0 var(--color-text)"},children:[N.length===0?c.jsx("div",{className:"absolute inset-0 grid place-items-center p-6",children:v.status==="running"?c.jsxs("div",{className:"flex flex-col items-center gap-3 text-[var(--color-text-muted)]",children:[c.jsx(Xe,{size:28,strokeWidth:3,className:"animate-spin"}),c.jsx("p",{className:"text-sm",children:e("arrange.orchestrating")})]}):c.jsx("p",{className:"text-[var(--color-text-muted)] text-sm text-center max-w-sm",children:e("arrange.noCards")})}):c.jsx(VT,{children:c.jsx(NJ,{cards:N,taskMeta:S,view:k,onSelect:R})}),!_&&c.jsxs("button",{className:"nb-btn absolute right-3 top-3 z-10",style:{padding:"6px 10px",fontSize:12},onClick:()=>C(!0),type:"button","aria-label":e("arrange.expand"),children:[c.jsx(Jo,{size:14,strokeWidth:3,className:"rotate-180"}),e("arrange.tasks")]})]}),_&&c.jsxs("aside",{className:"w-72 shrink-0 nb-card overflow-hidden flex flex-col gap-2 min-h-0",style:{padding:12},children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-lg font-bold",children:e("arrange.tasks")}),c.jsx("button",{className:"nb-btn",style:{padding:"2px 6px"},onClick:()=>C(!1),type:"button","aria-label":e("arrange.collapse"),children:c.jsx(ez,{size:14,strokeWidth:2.5})})]}),c.jsx("div",{className:"flex-1 min-h-0 overflow-auto",children:v.tasks.length===0?c.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-10 text-[var(--color-text-muted)]",children:[c.jsx(Xe,{size:22,strokeWidth:3,className:"animate-spin"}),c.jsx("p",{className:"text-xs text-center",children:e("arrange.planning")})]}):c.jsx("ul",{className:"flex flex-col gap-2",children:v.tasks.map((V,M)=>c.jsxs("li",{className:"rounded-lg border-2 border-[var(--color-text)] p-2",style:{background:HN(V.id,M)},children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"w-2.5 h-2.5 rounded-full inline-block shrink-0 border border-[var(--color-text)]",style:{background:wJ[V.status]??"gray"}}),c.jsxs("span",{className:"font-bold text-xs text-[var(--color-text)]",children:["T",V.id]}),c.jsxs("span",{className:"text-[11px] ml-auto font-[family-name:var(--font-mono)] text-[var(--color-text)]",children:[V.cardSeqs.length," ",e("arrange.cardsCount")]})]}),c.jsx("p",{className:"text-xs text-[var(--color-text)] mt-1 leading-snug",children:V.title})]},V.id))})})]})]}):c.jsx("section",{className:"nb-card",children:g?c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx(Xe,{size:18,strokeWidth:3,className:"animate-spin"}),c.jsx("p",{className:"text-sm font-bold",children:e("arrange.starting")})]}):c.jsx("p",{className:"text-[var(--color-text-muted)] text-sm",children:e("arrange.none")})}),O&&c.jsx(yJ,{card:O,status:Hb(O.status,O.seq,B),onClose:()=>R(null)})]})}function jJ(){const e=Ie();return c.jsxs("div",{className:"nb-card max-w-2xl mt-12",children:[c.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-4xl font-bold mb-2",children:e("notFound.title")}),c.jsx("p",{className:"text-[var(--color-text-muted)] mb-6",children:e("notFound.body")}),c.jsx(wa,{to:"/",className:"nb-btn nb-btn-mint inline-flex",children:e("notFound.home")})]})}function CJ(){return c.jsx(AI,{children:c.jsxs(XR,{children:[c.jsxs(Sn,{element:c.jsx(Ik,{contentMode:"workspace"}),children:[c.jsx(Sn,{index:!0,element:c.jsx(j5,{})}),c.jsx(Sn,{path:"/projects",element:c.jsx(kE,{})}),c.jsx(Sn,{path:"/projects/:name",element:c.jsx(kE,{})}),c.jsx(Sn,{path:"/board",element:c.jsx(gB,{})}),c.jsx(Sn,{path:"/workers",element:c.jsx(DB,{})}),c.jsx(Sn,{path:"/prompts",element:c.jsx(nK,{})}),c.jsx(Sn,{path:"/chat",element:c.jsx(CS,{})}),c.jsx(Sn,{path:"/chat/:sessionId",element:c.jsx(CS,{})}),c.jsx(Sn,{path:"/arrange",element:c.jsx(_J,{})})]}),c.jsxs(Sn,{element:c.jsx(Ik,{contentMode:"document"}),children:[c.jsx(Sn,{path:"/projects/new",element:c.jsx(Nj,{})}),c.jsx(Sn,{path:"/skills",element:c.jsx(QH,{})}),c.jsx(Sn,{path:"/system",element:c.jsx(lK,{})}),c.jsx(Sn,{path:"/processes",element:c.jsx(CK,{})}),c.jsx(Sn,{path:"/audit",element:c.jsx(DK,{})}),c.jsx(Sn,{path:"/memory",element:c.jsx(BK,{})}),c.jsx(Sn,{path:"/plugins",element:c.jsx(VK,{})}),c.jsx(Sn,{path:"*",element:c.jsx(jJ,{})})]})]})})}CI();Jz();const AJ=new BO({defaultOptions:{queries:{staleTime:3e4,refetchOnWindowFocus:!1}}}),eM=document.getElementById("root");if(!eM)throw new Error("#root not found");pO.createRoot(eM).render(c.jsx(j.StrictMode,{children:c.jsx(Qz,{children:c.jsx($O,{client:AJ,children:c.jsx(k3,{children:c.jsx(I5,{children:c.jsx(CJ,{})})})})})}));
|