@origintrail-official/dkg-node-ui 10.0.24 → 10.0.25

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.
Files changed (40) hide show
  1. package/dist-ui/assets/ActivityFeed-vyl2XdLo.js +99 -0
  2. package/dist-ui/assets/{AgentHub-BO9jGbJl.js → AgentHub-CYfAoOWF.js} +1 -1
  3. package/dist-ui/assets/AgentProfilePage-BjQm0je4.js +1 -0
  4. package/dist-ui/assets/{ApproveWalletsModal-C2Tu29tB.js → ApproveWalletsModal-CzWJ4KyU.js} +3 -3
  5. package/dist-ui/assets/{ContextGraphPrimitives-BqlTIZHy.js → ContextGraphPrimitives-ecppTns4.js} +1 -1
  6. package/dist-ui/assets/{ConvictionDetailView-J-DAKHtP.js → ConvictionDetailView-CuLUhbzR.js} +2 -2
  7. package/dist-ui/assets/MemoryLayerView-Dymg_Zf_.js +2 -0
  8. package/dist-ui/assets/MemoryReadStatus-D4HXCImC.js +1 -0
  9. package/dist-ui/assets/MemoryStackView-Bq8Fbh5W.js +1 -0
  10. package/dist-ui/assets/{Network-DV9K48MH.js → Network-F76S9_1V.js} +1 -1
  11. package/dist-ui/assets/{OnChainProvenanceCard-jxk66g53.js → OnChainProvenanceCard-CCwK3sRG.js} +1 -1
  12. package/dist-ui/assets/{Operations-CNB1BMYg.js → Operations-aVCBUh8u.js} +1 -1
  13. package/dist-ui/assets/ProjectView-Cb1PQ-jm.js +290 -0
  14. package/dist-ui/assets/{PublishingConviction-DbP1i3v0.js → PublishingConviction-BnAJjHL8.js} +2 -2
  15. package/dist-ui/assets/{Settings-I6g3MQCV.js → Settings-rEyPw1oS.js} +1 -1
  16. package/dist-ui/assets/{browserWalletTransaction-CXv612Pn.js → browserWalletTransaction-BJBFRjXx.js} +3 -3
  17. package/dist-ui/assets/{ccip-DY93ay8e.js → ccip-DYOqJfs7.js} +1 -1
  18. package/dist-ui/assets/{index-CIt7zWgM.css → index-CAdbSAQK.css} +1 -1
  19. package/dist-ui/assets/index-HEpqHVfE.js +1143 -0
  20. package/dist-ui/assets/index-_vQ99L0s.js +192 -0
  21. package/dist-ui/assets/{jsonld-32FQRO67-DKLfQ_nD.js → jsonld-32FQRO67-DVqZhSL_.js} +2 -2
  22. package/dist-ui/assets/{jsonld-BgpgXlDQ.js → jsonld-Dpm03cay.js} +1 -1
  23. package/dist-ui/assets/renderer-3d-IRPVRQWX-DjW_h88e.js +5126 -0
  24. package/dist-ui/assets/{shikiHighlighter-BXl6qMQO.js → shikiHighlighter-DL7LOds2.js} +4 -4
  25. package/dist-ui/assets/truncate-BWdqLeqV.js +22 -0
  26. package/dist-ui/assets/{useEntityOnChainReceipt-CUGQNIsP.js → useEntityOnChainReceipt-B_uLyqZc.js} +5 -5
  27. package/dist-ui/index.html +2 -2
  28. package/package.json +4 -4
  29. package/dist-ui/assets/3d-force-graph-DvzZZzFn.js +0 -1015
  30. package/dist-ui/assets/ActivityFeed-B5QxV1dk.js +0 -99
  31. package/dist-ui/assets/AgentProfilePage-DJJTn1WD.js +0 -1
  32. package/dist-ui/assets/MemoryLayerView-BOxI-_TF.js +0 -2
  33. package/dist-ui/assets/MemoryStackView-BTyZZKNm.js +0 -1
  34. package/dist-ui/assets/ProjectView-BP4vNSXI.js +0 -290
  35. package/dist-ui/assets/index-CumB6j2m.js +0 -192
  36. package/dist-ui/assets/index-DW3dBcQk.js +0 -1175
  37. package/dist-ui/assets/renderer-3d-2EVDZII7-BCmzI8Ii.js +0 -2
  38. package/dist-ui/assets/three.module-BXIk8GZS.js +0 -4112
  39. package/dist-ui/assets/truncate-BaiMkAOo.js +0 -1
  40. package/dist-ui/assets/useProjectActivity-BOgGdtS7.js +0 -1
@@ -0,0 +1,1143 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/html-pp8916En.js","assets/javascript-wDzz0qaB.js","assets/css-CLj8gQPS.js","assets/Operations-aVCBUh8u.js","assets/string-DtUow4KV.js","assets/Settings-rEyPw1oS.js","assets/browserWalletTransaction-BJBFRjXx.js","assets/AgentProfilePage-BjQm0je4.js","assets/ActivityFeed-vyl2XdLo.js","assets/MemoryReadStatus-D4HXCImC.js","assets/PublishingConviction-BnAJjHL8.js","assets/ContextGraphPrimitives-ecppTns4.js","assets/ApproveWalletsModal-CzWJ4KyU.js","assets/ConvictionDetailView-CuLUhbzR.js","assets/ProjectView-Cb1PQ-jm.js","assets/truncate-BWdqLeqV.js","assets/useEntityOnChainReceipt-B_uLyqZc.js","assets/MemoryLayerView-Dymg_Zf_.js","assets/MemoryStackView-Bq8Fbh5W.js"])))=>i.map(i=>d[i]);
2
+ var BC=Object.defineProperty;var k0=e=>{throw TypeError(e)};var UC=(e,t,a)=>t in e?BC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a;var At=(e,t,a)=>UC(e,typeof t!="symbol"?t+"":t,a),qf=(e,t,a)=>t.has(e)||k0("Cannot "+a);var De=(e,t,a)=>(qf(e,t,"read from private field"),a?a.call(e):t.get(e)),Ta=(e,t,a)=>t.has(e)?k0("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,a),Ot=(e,t,a,r)=>(qf(e,t,"write to private field"),r?r.call(e,a):t.set(e,a),a),fl=(e,t,a)=>(qf(e,t,"access private method"),a);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const c of s.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&r(c)}).observe(document,{childList:!0,subtree:!0});function a(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(o){if(o.ep)return;o.ep=!0;const s=a(o);fetch(o.href,s)}})();var v9=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ns(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function b9(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var a=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};a.prototype=t.prototype}else a={};return Object.defineProperty(a,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(a,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),a}var Ff={exports:{}},Ao={};/**
3
+ * @license React
4
+ * react-jsx-runtime.production.js
5
+ *
6
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
7
+ *
8
+ * This source code is licensed under the MIT license found in the
9
+ * LICENSE file in the root directory of this source tree.
10
+ */var C0;function HC(){if(C0)return Ao;C0=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function a(r,o,s){var c=null;if(s!==void 0&&(c=""+s),o.key!==void 0&&(c=""+o.key),"key"in o){s={};for(var d in o)d!=="key"&&(s[d]=o[d])}else s=o;return o=s.ref,{$$typeof:e,type:r,key:c,ref:o!==void 0?o:null,props:s}}return Ao.Fragment=t,Ao.jsx=a,Ao.jsxs=a,Ao}var E0;function $C(){return E0||(E0=1,Ff.exports=HC()),Ff.exports}var g=$C(),Gf={exports:{}},Oe={};/**
11
+ * @license React
12
+ * react.production.js
13
+ *
14
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
15
+ *
16
+ * This source code is licensed under the MIT license found in the
17
+ * LICENSE file in the root directory of this source tree.
18
+ */var A0;function qC(){if(A0)return Oe;A0=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),b=Symbol.iterator;function x(L){return L===null||typeof L!="object"?null:(L=b&&L[b]||L["@@iterator"],typeof L=="function"?L:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,A={};function E(L,K,N){this.props=L,this.context=K,this.refs=A,this.updater=N||k}E.prototype.isReactComponent={},E.prototype.setState=function(L,K){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,K,"setState")},E.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function R(){}R.prototype=E.prototype;function _(L,K,N){this.props=L,this.context=K,this.refs=A,this.updater=N||k}var U=_.prototype=new R;U.constructor=_,C(U,E.prototype),U.isPureReactComponent=!0;var I=Array.isArray;function O(){}var P={H:null,A:null,T:null,S:null},Y=Object.prototype.hasOwnProperty;function D(L,K,N){var ue=N.ref;return{$$typeof:e,type:L,key:K,ref:ue!==void 0?ue:null,props:N}}function T(L,K){return D(L.type,K,L.props)}function G(L){return typeof L=="object"&&L!==null&&L.$$typeof===e}function W(L){var K={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(N){return K[N]})}var ae=/\/+/g;function q(L,K){return typeof L=="object"&&L!==null&&L.key!=null?W(""+L.key):K.toString(36)}function Q(L){switch(L.status){case"fulfilled":return L.value;case"rejected":throw L.reason;default:switch(typeof L.status=="string"?L.then(O,O):(L.status="pending",L.then(function(K){L.status==="pending"&&(L.status="fulfilled",L.value=K)},function(K){L.status==="pending"&&(L.status="rejected",L.reason=K)})),L.status){case"fulfilled":return L.value;case"rejected":throw L.reason}}throw L}function F(L,K,N,ue,ge){var me=typeof L;(me==="undefined"||me==="boolean")&&(L=null);var Ee=!1;if(L===null)Ee=!0;else switch(me){case"bigint":case"string":case"number":Ee=!0;break;case"object":switch(L.$$typeof){case e:case t:Ee=!0;break;case y:return Ee=L._init,F(Ee(L._payload),K,N,ue,ge)}}if(Ee)return ge=ge(L),Ee=ue===""?"."+q(L,0):ue,I(ge)?(N="",Ee!=null&&(N=Ee.replace(ae,"$&/")+"/"),F(ge,K,N,"",function(tt){return tt})):ge!=null&&(G(ge)&&(ge=T(ge,N+(ge.key==null||L&&L.key===ge.key?"":(""+ge.key).replace(ae,"$&/")+"/")+Ee)),K.push(ge)),1;Ee=0;var Ue=ue===""?".":ue+":";if(I(L))for(var Re=0;Re<L.length;Re++)ue=L[Re],me=Ue+q(ue,Re),Ee+=F(ue,K,N,me,ge);else if(Re=x(L),typeof Re=="function")for(L=Re.call(L),Re=0;!(ue=L.next()).done;)ue=ue.value,me=Ue+q(ue,Re++),Ee+=F(ue,K,N,me,ge);else if(me==="object"){if(typeof L.then=="function")return F(Q(L),K,N,ue,ge);throw K=String(L),Error("Objects are not valid as a React child (found: "+(K==="[object Object]"?"object with keys {"+Object.keys(L).join(", ")+"}":K)+"). If you meant to render a collection of children, use an array instead.")}return Ee}function ee(L,K,N){if(L==null)return L;var ue=[],ge=0;return F(L,ue,"","",function(me){return K.call(N,me,ge++)}),ue}function ie(L){if(L._status===-1){var K=L._result;K=K(),K.then(function(N){(L._status===0||L._status===-1)&&(L._status=1,L._result=N)},function(N){(L._status===0||L._status===-1)&&(L._status=2,L._result=N)}),L._status===-1&&(L._status=0,L._result=K)}if(L._status===1)return L._result.default;throw L._result}var X=typeof reportError=="function"?reportError:function(L){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var K=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(K))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",L);return}console.error(L)},M={map:ee,forEach:function(L,K,N){ee(L,function(){K.apply(this,arguments)},N)},count:function(L){var K=0;return ee(L,function(){K++}),K},toArray:function(L){return ee(L,function(K){return K})||[]},only:function(L){if(!G(L))throw Error("React.Children.only expected to receive a single React element child.");return L}};return Oe.Activity=m,Oe.Children=M,Oe.Component=E,Oe.Fragment=a,Oe.Profiler=o,Oe.PureComponent=_,Oe.StrictMode=r,Oe.Suspense=p,Oe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=P,Oe.__COMPILER_RUNTIME={__proto__:null,c:function(L){return P.H.useMemoCache(L)}},Oe.cache=function(L){return function(){return L.apply(null,arguments)}},Oe.cacheSignal=function(){return null},Oe.cloneElement=function(L,K,N){if(L==null)throw Error("The argument must be a React element, but you passed "+L+".");var ue=C({},L.props),ge=L.key;if(K!=null)for(me in K.key!==void 0&&(ge=""+K.key),K)!Y.call(K,me)||me==="key"||me==="__self"||me==="__source"||me==="ref"&&K.ref===void 0||(ue[me]=K[me]);var me=arguments.length-2;if(me===1)ue.children=N;else if(1<me){for(var Ee=Array(me),Ue=0;Ue<me;Ue++)Ee[Ue]=arguments[Ue+2];ue.children=Ee}return D(L.type,ge,ue)},Oe.createContext=function(L){return L={$$typeof:c,_currentValue:L,_currentValue2:L,_threadCount:0,Provider:null,Consumer:null},L.Provider=L,L.Consumer={$$typeof:s,_context:L},L},Oe.createElement=function(L,K,N){var ue,ge={},me=null;if(K!=null)for(ue in K.key!==void 0&&(me=""+K.key),K)Y.call(K,ue)&&ue!=="key"&&ue!=="__self"&&ue!=="__source"&&(ge[ue]=K[ue]);var Ee=arguments.length-2;if(Ee===1)ge.children=N;else if(1<Ee){for(var Ue=Array(Ee),Re=0;Re<Ee;Re++)Ue[Re]=arguments[Re+2];ge.children=Ue}if(L&&L.defaultProps)for(ue in Ee=L.defaultProps,Ee)ge[ue]===void 0&&(ge[ue]=Ee[ue]);return D(L,me,ge)},Oe.createRef=function(){return{current:null}},Oe.forwardRef=function(L){return{$$typeof:d,render:L}},Oe.isValidElement=G,Oe.lazy=function(L){return{$$typeof:y,_payload:{_status:-1,_result:L},_init:ie}},Oe.memo=function(L,K){return{$$typeof:f,type:L,compare:K===void 0?null:K}},Oe.startTransition=function(L){var K=P.T,N={};P.T=N;try{var ue=L(),ge=P.S;ge!==null&&ge(N,ue),typeof ue=="object"&&ue!==null&&typeof ue.then=="function"&&ue.then(O,X)}catch(me){X(me)}finally{K!==null&&N.types!==null&&(K.types=N.types),P.T=K}},Oe.unstable_useCacheRefresh=function(){return P.H.useCacheRefresh()},Oe.use=function(L){return P.H.use(L)},Oe.useActionState=function(L,K,N){return P.H.useActionState(L,K,N)},Oe.useCallback=function(L,K){return P.H.useCallback(L,K)},Oe.useContext=function(L){return P.H.useContext(L)},Oe.useDebugValue=function(){},Oe.useDeferredValue=function(L,K){return P.H.useDeferredValue(L,K)},Oe.useEffect=function(L,K){return P.H.useEffect(L,K)},Oe.useEffectEvent=function(L){return P.H.useEffectEvent(L)},Oe.useId=function(){return P.H.useId()},Oe.useImperativeHandle=function(L,K,N){return P.H.useImperativeHandle(L,K,N)},Oe.useInsertionEffect=function(L,K){return P.H.useInsertionEffect(L,K)},Oe.useLayoutEffect=function(L,K){return P.H.useLayoutEffect(L,K)},Oe.useMemo=function(L,K){return P.H.useMemo(L,K)},Oe.useOptimistic=function(L,K){return P.H.useOptimistic(L,K)},Oe.useReducer=function(L,K,N){return P.H.useReducer(L,K,N)},Oe.useRef=function(L){return P.H.useRef(L)},Oe.useState=function(L){return P.H.useState(L)},Oe.useSyncExternalStore=function(L,K,N){return P.H.useSyncExternalStore(L,K,N)},Oe.useTransition=function(){return P.H.useTransition()},Oe.version="19.2.4",Oe}var j0;function Lh(){return j0||(j0=1,Gf.exports=qC()),Gf.exports}var S=Lh();const bn=ns(S);var Vf={exports:{}},jo={},Wf={exports:{}},Yf={};/**
19
+ * @license React
20
+ * scheduler.production.js
21
+ *
22
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
23
+ *
24
+ * This source code is licensed under the MIT license found in the
25
+ * LICENSE file in the root directory of this source tree.
26
+ */var T0;function FC(){return T0||(T0=1,(function(e){function t(F,ee){var ie=F.length;F.push(ee);e:for(;0<ie;){var X=ie-1>>>1,M=F[X];if(0<o(M,ee))F[X]=ee,F[ie]=M,ie=X;else break e}}function a(F){return F.length===0?null:F[0]}function r(F){if(F.length===0)return null;var ee=F[0],ie=F.pop();if(ie!==ee){F[0]=ie;e:for(var X=0,M=F.length,L=M>>>1;X<L;){var K=2*(X+1)-1,N=F[K],ue=K+1,ge=F[ue];if(0>o(N,ie))ue<M&&0>o(ge,N)?(F[X]=ge,F[ue]=ie,X=ue):(F[X]=N,F[K]=ie,X=K);else if(ue<M&&0>o(ge,ie))F[X]=ge,F[ue]=ie,X=ue;else break e}}return ee}function o(F,ee){var ie=F.sortIndex-ee.sortIndex;return ie!==0?ie:F.id-ee.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var c=Date,d=c.now();e.unstable_now=function(){return c.now()-d}}var p=[],f=[],y=1,m=null,b=3,x=!1,k=!1,C=!1,A=!1,E=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;function U(F){for(var ee=a(f);ee!==null;){if(ee.callback===null)r(f);else if(ee.startTime<=F)r(f),ee.sortIndex=ee.expirationTime,t(p,ee);else break;ee=a(f)}}function I(F){if(C=!1,U(F),!k)if(a(p)!==null)k=!0,O||(O=!0,W());else{var ee=a(f);ee!==null&&Q(I,ee.startTime-F)}}var O=!1,P=-1,Y=5,D=-1;function T(){return A?!0:!(e.unstable_now()-D<Y)}function G(){if(A=!1,O){var F=e.unstable_now();D=F;var ee=!0;try{e:{k=!1,C&&(C=!1,R(P),P=-1),x=!0;var ie=b;try{t:{for(U(F),m=a(p);m!==null&&!(m.expirationTime>F&&T());){var X=m.callback;if(typeof X=="function"){m.callback=null,b=m.priorityLevel;var M=X(m.expirationTime<=F);if(F=e.unstable_now(),typeof M=="function"){m.callback=M,U(F),ee=!0;break t}m===a(p)&&r(p),U(F)}else r(p);m=a(p)}if(m!==null)ee=!0;else{var L=a(f);L!==null&&Q(I,L.startTime-F),ee=!1}}break e}finally{m=null,b=ie,x=!1}ee=void 0}}finally{ee?W():O=!1}}}var W;if(typeof _=="function")W=function(){_(G)};else if(typeof MessageChannel<"u"){var ae=new MessageChannel,q=ae.port2;ae.port1.onmessage=G,W=function(){q.postMessage(null)}}else W=function(){E(G,0)};function Q(F,ee){P=E(function(){F(e.unstable_now())},ee)}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(F){F.callback=null},e.unstable_forceFrameRate=function(F){0>F||125<F?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Y=0<F?Math.floor(1e3/F):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(F){switch(b){case 1:case 2:case 3:var ee=3;break;default:ee=b}var ie=b;b=ee;try{return F()}finally{b=ie}},e.unstable_requestPaint=function(){A=!0},e.unstable_runWithPriority=function(F,ee){switch(F){case 1:case 2:case 3:case 4:case 5:break;default:F=3}var ie=b;b=F;try{return ee()}finally{b=ie}},e.unstable_scheduleCallback=function(F,ee,ie){var X=e.unstable_now();switch(typeof ie=="object"&&ie!==null?(ie=ie.delay,ie=typeof ie=="number"&&0<ie?X+ie:X):ie=X,F){case 1:var M=-1;break;case 2:M=250;break;case 5:M=1073741823;break;case 4:M=1e4;break;default:M=5e3}return M=ie+M,F={id:y++,callback:ee,priorityLevel:F,startTime:ie,expirationTime:M,sortIndex:-1},ie>X?(F.sortIndex=ie,t(f,F),a(p)===null&&F===a(f)&&(C?(R(P),P=-1):C=!0,Q(I,ie-X))):(F.sortIndex=M,t(p,F),k||x||(k=!0,O||(O=!0,W()))),F},e.unstable_shouldYield=T,e.unstable_wrapCallback=function(F){var ee=b;return function(){var ie=b;b=ee;try{return F.apply(this,arguments)}finally{b=ie}}}})(Yf)),Yf}var R0;function GC(){return R0||(R0=1,Wf.exports=FC()),Wf.exports}var Kf={exports:{}},un={};/**
27
+ * @license React
28
+ * react-dom.production.js
29
+ *
30
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
31
+ *
32
+ * This source code is licensed under the MIT license found in the
33
+ * LICENSE file in the root directory of this source tree.
34
+ */var N0;function VC(){if(N0)return un;N0=1;var e=Lh();function t(p){var f="https://react.dev/errors/"+p;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)f+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+p+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var r={d:{f:a,r:function(){throw Error(t(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},o=Symbol.for("react.portal");function s(p,f,y){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:m==null?null:""+m,children:p,containerInfo:f,implementation:y}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(p,f){if(p==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return un.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,un.createPortal=function(p,f){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(t(299));return s(p,f,null,y)},un.flushSync=function(p){var f=c.T,y=r.p;try{if(c.T=null,r.p=2,p)return p()}finally{c.T=f,r.p=y,r.d.f()}},un.preconnect=function(p,f){typeof p=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,r.d.C(p,f))},un.prefetchDNS=function(p){typeof p=="string"&&r.d.D(p)},un.preinit=function(p,f){if(typeof p=="string"&&f&&typeof f.as=="string"){var y=f.as,m=d(y,f.crossOrigin),b=typeof f.integrity=="string"?f.integrity:void 0,x=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;y==="style"?r.d.S(p,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:m,integrity:b,fetchPriority:x}):y==="script"&&r.d.X(p,{crossOrigin:m,integrity:b,fetchPriority:x,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},un.preinitModule=function(p,f){if(typeof p=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var y=d(f.as,f.crossOrigin);r.d.M(p,{crossOrigin:y,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&r.d.M(p)},un.preload=function(p,f){if(typeof p=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var y=f.as,m=d(y,f.crossOrigin);r.d.L(p,y,{crossOrigin:m,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},un.preloadModule=function(p,f){if(typeof p=="string")if(f){var y=d(f.as,f.crossOrigin);r.d.m(p,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:y,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else r.d.m(p)},un.requestFormReset=function(p){r.d.r(p)},un.unstable_batchedUpdates=function(p,f){return p(f)},un.useFormState=function(p,f,y){return c.H.useFormState(p,f,y)},un.useFormStatus=function(){return c.H.useHostTransitionStatus()},un.version="19.2.4",un}var _0;function bx(){if(_0)return Kf.exports;_0=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(),Kf.exports=VC(),Kf.exports}/**
35
+ * @license React
36
+ * react-dom-client.production.js
37
+ *
38
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
39
+ *
40
+ * This source code is licensed under the MIT license found in the
41
+ * LICENSE file in the root directory of this source tree.
42
+ */var O0;function WC(){if(O0)return jo;O0=1;var e=GC(),t=Lh(),a=bx();function r(n){var i="https://react.dev/errors/"+n;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)i+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+n+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function s(n){var i=n,l=n;if(n.alternate)for(;i.return;)i=i.return;else{n=i;do i=n,(i.flags&4098)!==0&&(l=i.return),n=i.return;while(n)}return i.tag===3?l:null}function c(n){if(n.tag===13){var i=n.memoizedState;if(i===null&&(n=n.alternate,n!==null&&(i=n.memoizedState)),i!==null)return i.dehydrated}return null}function d(n){if(n.tag===31){var i=n.memoizedState;if(i===null&&(n=n.alternate,n!==null&&(i=n.memoizedState)),i!==null)return i.dehydrated}return null}function p(n){if(s(n)!==n)throw Error(r(188))}function f(n){var i=n.alternate;if(!i){if(i=s(n),i===null)throw Error(r(188));return i!==n?null:n}for(var l=n,u=i;;){var h=l.return;if(h===null)break;var v=h.alternate;if(v===null){if(u=h.return,u!==null){l=u;continue}break}if(h.child===v.child){for(v=h.child;v;){if(v===l)return p(h),n;if(v===u)return p(h),i;v=v.sibling}throw Error(r(188))}if(l.return!==u.return)l=h,u=v;else{for(var w=!1,j=h.child;j;){if(j===l){w=!0,l=h,u=v;break}if(j===u){w=!0,u=h,l=v;break}j=j.sibling}if(!w){for(j=v.child;j;){if(j===l){w=!0,l=v,u=h;break}if(j===u){w=!0,u=v,l=h;break}j=j.sibling}if(!w)throw Error(r(189))}}if(l.alternate!==u)throw Error(r(190))}if(l.tag!==3)throw Error(r(188));return l.stateNode.current===l?n:i}function y(n){var i=n.tag;if(i===5||i===26||i===27||i===6)return n;for(n=n.child;n!==null;){if(i=y(n),i!==null)return i;n=n.sibling}return null}var m=Object.assign,b=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),_=Symbol.for("react.context"),U=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),O=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),Y=Symbol.for("react.lazy"),D=Symbol.for("react.activity"),T=Symbol.for("react.memo_cache_sentinel"),G=Symbol.iterator;function W(n){return n===null||typeof n!="object"?null:(n=G&&n[G]||n["@@iterator"],typeof n=="function"?n:null)}var ae=Symbol.for("react.client.reference");function q(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===ae?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case C:return"Fragment";case E:return"Profiler";case A:return"StrictMode";case I:return"Suspense";case O:return"SuspenseList";case D:return"Activity"}if(typeof n=="object")switch(n.$$typeof){case k:return"Portal";case _:return n.displayName||"Context";case R:return(n._context.displayName||"Context")+".Consumer";case U:var i=n.render;return n=n.displayName,n||(n=i.displayName||i.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case P:return i=n.displayName||null,i!==null?i:q(n.type)||"Memo";case Y:i=n._payload,n=n._init;try{return q(n(i))}catch{}}return null}var Q=Array.isArray,F=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ee=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ie={pending:!1,data:null,method:null,action:null},X=[],M=-1;function L(n){return{current:n}}function K(n){0>M||(n.current=X[M],X[M]=null,M--)}function N(n,i){M++,X[M]=n.current,n.current=i}var ue=L(null),ge=L(null),me=L(null),Ee=L(null);function Ue(n,i){switch(N(me,i),N(ge,n),N(ue,null),i.nodeType){case 9:case 11:n=(n=i.documentElement)&&(n=n.namespaceURI)?Vv(n):0;break;default:if(n=i.tagName,i=i.namespaceURI)i=Vv(i),n=Wv(i,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}K(ue),N(ue,n)}function Re(){K(ue),K(ge),K(me)}function tt(n){n.memoizedState!==null&&N(Ee,n);var i=ue.current,l=Wv(i,n.type);i!==l&&(N(ge,n),N(ue,l))}function It(n){ge.current===n&&(K(ue),K(ge)),Ee.current===n&&(K(Ee),So._currentValue=ie)}var xt,wt;function vt(n){if(xt===void 0)try{throw Error()}catch(l){var i=l.stack.trim().match(/\n( *(at )?)/);xt=i&&i[1]||"",wt=-1<l.stack.indexOf(`
43
+ at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
44
+ `+xt+n+wt}var an=!1;function Be(n,i){if(!n||an)return"";an=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:function(){try{if(i){var ce=function(){throw Error()};if(Object.defineProperty(ce.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ce,[])}catch(ne){var te=ne}Reflect.construct(n,[],ce)}else{try{ce.call()}catch(ne){te=ne}n.call(ce.prototype)}}else{try{throw Error()}catch(ne){te=ne}(ce=n())&&typeof ce.catch=="function"&&ce.catch(function(){})}}catch(ne){if(ne&&te&&typeof ne.stack=="string")return[ne.stack,te.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var h=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");h&&h.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var v=u.DetermineComponentFrameRoot(),w=v[0],j=v[1];if(w&&j){var z=w.split(`
45
+ `),J=j.split(`
46
+ `);for(h=u=0;u<z.length&&!z[u].includes("DetermineComponentFrameRoot");)u++;for(;h<J.length&&!J[h].includes("DetermineComponentFrameRoot");)h++;if(u===z.length||h===J.length)for(u=z.length-1,h=J.length-1;1<=u&&0<=h&&z[u]!==J[h];)h--;for(;1<=u&&0<=h;u--,h--)if(z[u]!==J[h]){if(u!==1||h!==1)do if(u--,h--,0>h||z[u]!==J[h]){var re=`
47
+ `+z[u].replace(" at new "," at ");return n.displayName&&re.includes("<anonymous>")&&(re=re.replace("<anonymous>",n.displayName)),re}while(1<=u&&0<=h);break}}}finally{an=!1,Error.prepareStackTrace=l}return(l=n?n.displayName||n.name:"")?vt(l):""}function ht(n,i){switch(n.tag){case 26:case 27:case 5:return vt(n.type);case 16:return vt("Lazy");case 13:return n.child!==i&&i!==null?vt("Suspense Fallback"):vt("Suspense");case 19:return vt("SuspenseList");case 0:case 15:return Be(n.type,!1);case 11:return Be(n.type.render,!1);case 1:return Be(n.type,!0);case 31:return vt("Activity");default:return""}}function Pt(n){try{var i="",l=null;do i+=ht(n,l),l=n,n=n.return;while(n);return i}catch(u){return`
48
+ Error generating stack: `+u.message+`
49
+ `+u.stack}}var Mt=Object.prototype.hasOwnProperty,he=e.unstable_scheduleCallback,Bt=e.unstable_cancelCallback,Qn=e.unstable_shouldYield,wn=e.unstable_requestPaint,rt=e.unstable_now,fe=e.unstable_getCurrentPriorityLevel,H=e.unstable_ImmediatePriority,le=e.unstable_UserBlockingPriority,pe=e.unstable_NormalPriority,ye=e.unstable_LowPriority,B=e.unstable_IdlePriority,Te=e.log,it=e.unstable_setDisableYieldValue,Pe=null,Xe=null;function We(n){if(typeof Te=="function"&&it(n),Xe&&typeof Xe.setStrictMode=="function")try{Xe.setStrictMode(Pe,n)}catch{}}var Se=Math.clz32?Math.clz32:Ba,Zt=Math.log,lt=Math.LN2;function Ba(n){return n>>>=0,n===0?32:31-(Zt(n)/lt|0)|0}var hi=256,Qi=262144,Nr=4194304;function Ua(n){var i=n&42;if(i!==0)return i;switch(n&-n){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 n&261888;case 262144:case 524288:case 1048576:case 2097152:return n&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function _r(n,i,l){var u=n.pendingLanes;if(u===0)return 0;var h=0,v=n.suspendedLanes,w=n.pingedLanes;n=n.warmLanes;var j=u&134217727;return j!==0?(u=j&~v,u!==0?h=Ua(u):(w&=j,w!==0?h=Ua(w):l||(l=j&~n,l!==0&&(h=Ua(l))))):(j=u&~v,j!==0?h=Ua(j):w!==0?h=Ua(w):l||(l=u&~n,l!==0&&(h=Ua(l)))),h===0?0:i!==0&&i!==h&&(i&v)===0&&(v=h&-h,l=i&-i,v>=l||v===32&&(l&4194048)!==0)?i:h}function Xi(n,i){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&i)===0}function Ou(n,i){switch(n){case 1:case 2:case 4:case 8:case 64:return i+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function us(){var n=Nr;return Nr<<=1,(Nr&62914560)===0&&(Nr=4194304),n}function Ll(n){for(var i=[],l=0;31>l;l++)i.push(n);return i}function Zi(n,i){n.pendingLanes|=i,i!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function Mu(n,i,l,u,h,v){var w=n.pendingLanes;n.pendingLanes=l,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=l,n.entangledLanes&=l,n.errorRecoveryDisabledLanes&=l,n.shellSuspendCounter=0;var j=n.entanglements,z=n.expirationTimes,J=n.hiddenUpdates;for(l=w&~l;0<l;){var re=31-Se(l),ce=1<<re;j[re]=0,z[re]=-1;var te=J[re];if(te!==null)for(J[re]=null,re=0;re<te.length;re++){var ne=te[re];ne!==null&&(ne.lane&=-536870913)}l&=~ce}u!==0&&ds(n,u,0),v!==0&&h===0&&n.tag!==0&&(n.suspendedLanes|=v&~(w&~i))}function ds(n,i,l){n.pendingLanes|=i,n.suspendedLanes&=~i;var u=31-Se(i);n.entangledLanes|=i,n.entanglements[u]=n.entanglements[u]|1073741824|l&261930}function se(n,i){var l=n.entangledLanes|=i;for(n=n.entanglements;l;){var u=31-Se(l),h=1<<u;h&i|n[u]&i&&(n[u]|=i),l&=~h}}function ve(n,i){var l=i&-i;return l=(l&42)!==0?1:ke(l),(l&(n.suspendedLanes|i))!==0?0:l}function ke(n){switch(n){case 2:n=1;break;case 8:n=4;break;case 32:n=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:n=128;break;case 268435456:n=134217728;break;default:n=0}return n}function Me(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function Ke(){var n=ee.p;return n!==0?n:(n=window.event,n===void 0?32:g0(n.type))}function ot(n,i){var l=ee.p;try{return ee.p=n,i()}finally{ee.p=l}}var Ne=Math.random().toString(36).slice(2),we="__reactFiber$"+Ne,_e="__reactProps$"+Ne,cn="__reactContainer$"+Ne,Ha="__reactEvents$"+Ne,zl="__reactListeners$"+Ne,fs="__reactHandles$"+Ne,mi="__reactResources$"+Ne,Sa="__reactMarker$"+Ne;function Or(n){delete n[we],delete n[_e],delete n[Ha],delete n[zl],delete n[fs]}function $a(n){var i=n[we];if(i)return i;for(var l=n.parentNode;l;){if(i=l[cn]||l[we]){if(l=i.alternate,i.child!==null||l!==null&&l.child!==null)for(n=e0(n);n!==null;){if(l=n[we])return l;n=e0(n)}return i}n=l,l=n.parentNode}return null}function Jt(n){if(n=n[we]||n[cn]){var i=n.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return n}return null}function pn(n){var i=n.tag;if(i===5||i===26||i===27||i===6)return n.stateNode;throw Error(r(33))}function Mn(n){var i=n[mi];return i||(i=n[mi]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function Tt(n){n[Sa]=!0}var Sn=new Set,ka={};function hn(n,i){Xn(n,i),Xn(n+"Capture",i)}function Xn(n,i){for(ka[n]=i,n=0;n<i.length;n++)Sn.add(i[n])}var gi=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]*$"),Il={},ps={};function Du(n){return Mt.call(ps,n)?!0:Mt.call(Il,n)?!1:gi.test(n)?ps[n]=!0:(Il[n]=!0,!1)}function mn(n,i,l){if(Du(i))if(l===null)n.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":n.removeAttribute(i);return;case"boolean":var u=i.toLowerCase().slice(0,5);if(u!=="data-"&&u!=="aria-"){n.removeAttribute(i);return}}n.setAttribute(i,""+l)}}function Ji(n,i,l){if(l===null)n.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(i);return}n.setAttribute(i,""+l)}}function kn(n,i,l,u){if(u===null)n.removeAttribute(l);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(l);return}n.setAttributeNS(i,l,""+u)}}function He(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function Kt(n){var i=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function qa(n,i,l){var u=Object.getOwnPropertyDescriptor(n.constructor.prototype,i);if(!n.hasOwnProperty(i)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var h=u.get,v=u.set;return Object.defineProperty(n,i,{configurable:!0,get:function(){return h.call(this)},set:function(w){l=""+w,v.call(this,w)}}),Object.defineProperty(n,i,{enumerable:u.enumerable}),{getValue:function(){return l},setValue:function(w){l=""+w},stopTracking:function(){n._valueTracker=null,delete n[i]}}}}function Lu(n){if(!n._valueTracker){var i=Kt(n)?"checked":"value";n._valueTracker=qa(n,i,""+n[i])}}function Bm(n){if(!n)return!1;var i=n._valueTracker;if(!i)return!0;var l=i.getValue(),u="";return n&&(u=Kt(n)?n.checked?"true":"false":n.value),n=u,n!==l?(i.setValue(n),!0):!1}function hs(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}var Mk=/[\n"\\]/g;function Zn(n){return n.replace(Mk,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function zu(n,i,l,u,h,v,w,j){n.name="",w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?n.type=w:n.removeAttribute("type"),i!=null?w==="number"?(i===0&&n.value===""||n.value!=i)&&(n.value=""+He(i)):n.value!==""+He(i)&&(n.value=""+He(i)):w!=="submit"&&w!=="reset"||n.removeAttribute("value"),i!=null?Iu(n,w,He(i)):l!=null?Iu(n,w,He(l)):u!=null&&n.removeAttribute("value"),h==null&&v!=null&&(n.defaultChecked=!!v),h!=null&&(n.checked=h&&typeof h!="function"&&typeof h!="symbol"),j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?n.name=""+He(j):n.removeAttribute("name")}function Um(n,i,l,u,h,v,w,j){if(v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(n.type=v),i!=null||l!=null){if(!(v!=="submit"&&v!=="reset"||i!=null)){Lu(n);return}l=l!=null?""+He(l):"",i=i!=null?""+He(i):l,j||i===n.value||(n.value=i),n.defaultValue=i}u=u??h,u=typeof u!="function"&&typeof u!="symbol"&&!!u,n.checked=j?n.checked:!!u,n.defaultChecked=!!u,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(n.name=w),Lu(n)}function Iu(n,i,l){i==="number"&&hs(n.ownerDocument)===n||n.defaultValue===""+l||(n.defaultValue=""+l)}function Mr(n,i,l,u){if(n=n.options,i){i={};for(var h=0;h<l.length;h++)i["$"+l[h]]=!0;for(l=0;l<n.length;l++)h=i.hasOwnProperty("$"+n[l].value),n[l].selected!==h&&(n[l].selected=h),h&&u&&(n[l].defaultSelected=!0)}else{for(l=""+He(l),i=null,h=0;h<n.length;h++){if(n[h].value===l){n[h].selected=!0,u&&(n[h].defaultSelected=!0);return}i!==null||n[h].disabled||(i=n[h])}i!==null&&(i.selected=!0)}}function Hm(n,i,l){if(i!=null&&(i=""+He(i),i!==n.value&&(n.value=i),l==null)){n.defaultValue!==i&&(n.defaultValue=i);return}n.defaultValue=l!=null?""+He(l):""}function $m(n,i,l,u){if(i==null){if(u!=null){if(l!=null)throw Error(r(92));if(Q(u)){if(1<u.length)throw Error(r(93));u=u[0]}l=u}l==null&&(l=""),i=l}l=He(i),n.defaultValue=l,u=n.textContent,u===l&&u!==""&&u!==null&&(n.value=u),Lu(n)}function Dr(n,i){if(i){var l=n.firstChild;if(l&&l===n.lastChild&&l.nodeType===3){l.nodeValue=i;return}}n.textContent=i}var Dk=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 qm(n,i,l){var u=i.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?u?n.setProperty(i,""):i==="float"?n.cssFloat="":n[i]="":u?n.setProperty(i,l):typeof l!="number"||l===0||Dk.has(i)?i==="float"?n.cssFloat=l:n[i]=(""+l).trim():n[i]=l+"px"}function Fm(n,i,l){if(i!=null&&typeof i!="object")throw Error(r(62));if(n=n.style,l!=null){for(var u in l)!l.hasOwnProperty(u)||i!=null&&i.hasOwnProperty(u)||(u.indexOf("--")===0?n.setProperty(u,""):u==="float"?n.cssFloat="":n[u]="");for(var h in i)u=i[h],i.hasOwnProperty(h)&&l[h]!==u&&qm(n,h,u)}else for(var v in i)i.hasOwnProperty(v)&&qm(n,v,i[v])}function Pu(n){if(n.indexOf("-")===-1)return!1;switch(n){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 Lk=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"]]),zk=/^[\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(n){return zk.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function Fa(){}var Bu=null;function Uu(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var Lr=null,zr=null;function Gm(n){var i=Jt(n);if(i&&(n=i.stateNode)){var l=n[_e]||null;e:switch(n=i.stateNode,i.type){case"input":if(zu(n,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),i=l.name,l.type==="radio"&&i!=null){for(l=n;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+Zn(""+i)+'"][type="radio"]'),i=0;i<l.length;i++){var u=l[i];if(u!==n&&u.form===n.form){var h=u[_e]||null;if(!h)throw Error(r(90));zu(u,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name)}}for(i=0;i<l.length;i++)u=l[i],u.form===n.form&&Bm(u)}break e;case"textarea":Hm(n,l.value,l.defaultValue);break e;case"select":i=l.value,i!=null&&Mr(n,!!l.multiple,i,!1)}}}var Hu=!1;function Vm(n,i,l){if(Hu)return n(i,l);Hu=!0;try{var u=n(i);return u}finally{if(Hu=!1,(Lr!==null||zr!==null)&&(nc(),Lr&&(i=Lr,n=zr,zr=Lr=null,Gm(i),n)))for(i=0;i<n.length;i++)Gm(n[i])}}function Pl(n,i){var l=n.stateNode;if(l===null)return null;var u=l[_e]||null;if(u===null)return null;l=u[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(n=n.type,u=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!u;break e;default:n=!1}if(n)return null;if(l&&typeof l!="function")throw Error(r(231,i,typeof l));return l}var Ga=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),$u=!1;if(Ga)try{var Bl={};Object.defineProperty(Bl,"passive",{get:function(){$u=!0}}),window.addEventListener("test",Bl,Bl),window.removeEventListener("test",Bl,Bl)}catch{$u=!1}var yi=null,qu=null,gs=null;function Wm(){if(gs)return gs;var n,i=qu,l=i.length,u,h="value"in yi?yi.value:yi.textContent,v=h.length;for(n=0;n<l&&i[n]===h[n];n++);var w=l-n;for(u=1;u<=w&&i[l-u]===h[v-u];u++);return gs=h.slice(n,1<u?1-u:void 0)}function ys(n){var i=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&i===13&&(n=13)):n=i,n===10&&(n=13),32<=n||n===13?n:0}function vs(){return!0}function Ym(){return!1}function Cn(n){function i(l,u,h,v,w){this._reactName=l,this._targetInst=h,this.type=u,this.nativeEvent=v,this.target=w,this.currentTarget=null;for(var j in n)n.hasOwnProperty(j)&&(l=n[j],this[j]=l?l(v):v[j]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?vs:Ym,this.isPropagationStopped=Ym,this}return m(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=vs)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=vs)},persist:function(){},isPersistent:vs}),i}var er={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},bs=Cn(er),Ul=m({},er,{view:0,detail:0}),Ik=Cn(Ul),Fu,Gu,Hl,xs=m({},Ul,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Wu,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==Hl&&(Hl&&n.type==="mousemove"?(Fu=n.screenX-Hl.screenX,Gu=n.screenY-Hl.screenY):Gu=Fu=0,Hl=n),Fu)},movementY:function(n){return"movementY"in n?n.movementY:Gu}}),Km=Cn(xs),Pk=m({},xs,{dataTransfer:0}),Bk=Cn(Pk),Uk=m({},Ul,{relatedTarget:0}),Vu=Cn(Uk),Hk=m({},er,{animationName:0,elapsedTime:0,pseudoElement:0}),$k=Cn(Hk),qk=m({},er,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),Fk=Cn(qk),Gk=m({},er,{data:0}),Qm=Cn(Gk),Vk={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Wk={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"},Yk={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Kk(n){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(n):(n=Yk[n])?!!i[n]:!1}function Wu(){return Kk}var Qk=m({},Ul,{key:function(n){if(n.key){var i=Vk[n.key]||n.key;if(i!=="Unidentified")return i}return n.type==="keypress"?(n=ys(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?Wk[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Wu,charCode:function(n){return n.type==="keypress"?ys(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?ys(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),Xk=Cn(Qk),Zk=m({},xs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Xm=Cn(Zk),Jk=m({},Ul,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Wu}),e2=Cn(Jk),t2=m({},er,{propertyName:0,elapsedTime:0,pseudoElement:0}),n2=Cn(t2),a2=m({},xs,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),i2=Cn(a2),r2=m({},er,{newState:0,oldState:0}),l2=Cn(r2),o2=[9,13,27,32],Yu=Ga&&"CompositionEvent"in window,$l=null;Ga&&"documentMode"in document&&($l=document.documentMode);var s2=Ga&&"TextEvent"in window&&!$l,Zm=Ga&&(!Yu||$l&&8<$l&&11>=$l),Jm=" ",eg=!1;function tg(n,i){switch(n){case"keyup":return o2.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ng(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var Ir=!1;function c2(n,i){switch(n){case"compositionend":return ng(i);case"keypress":return i.which!==32?null:(eg=!0,Jm);case"textInput":return n=i.data,n===Jm&&eg?null:n;default:return null}}function u2(n,i){if(Ir)return n==="compositionend"||!Yu&&tg(n,i)?(n=Wm(),gs=qu=yi=null,Ir=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return Zm&&i.locale!=="ko"?null:i.data;default:return null}}var d2={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 ag(n){var i=n&&n.nodeName&&n.nodeName.toLowerCase();return i==="input"?!!d2[n.type]:i==="textarea"}function ig(n,i,l,u){Lr?zr?zr.push(u):zr=[u]:Lr=u,i=cc(i,"onChange"),0<i.length&&(l=new bs("onChange","change",null,l,u),n.push({event:l,listeners:i}))}var ql=null,Fl=null;function f2(n){Uv(n,0)}function ws(n){var i=pn(n);if(Bm(i))return n}function rg(n,i){if(n==="change")return i}var lg=!1;if(Ga){var Ku;if(Ga){var Qu="oninput"in document;if(!Qu){var og=document.createElement("div");og.setAttribute("oninput","return;"),Qu=typeof og.oninput=="function"}Ku=Qu}else Ku=!1;lg=Ku&&(!document.documentMode||9<document.documentMode)}function sg(){ql&&(ql.detachEvent("onpropertychange",cg),Fl=ql=null)}function cg(n){if(n.propertyName==="value"&&ws(Fl)){var i=[];ig(i,Fl,n,Uu(n)),Vm(f2,i)}}function p2(n,i,l){n==="focusin"?(sg(),ql=i,Fl=l,ql.attachEvent("onpropertychange",cg)):n==="focusout"&&sg()}function h2(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return ws(Fl)}function m2(n,i){if(n==="click")return ws(i)}function g2(n,i){if(n==="input"||n==="change")return ws(i)}function y2(n,i){return n===i&&(n!==0||1/n===1/i)||n!==n&&i!==i}var Dn=typeof Object.is=="function"?Object.is:y2;function Gl(n,i){if(Dn(n,i))return!0;if(typeof n!="object"||n===null||typeof i!="object"||i===null)return!1;var l=Object.keys(n),u=Object.keys(i);if(l.length!==u.length)return!1;for(u=0;u<l.length;u++){var h=l[u];if(!Mt.call(i,h)||!Dn(n[h],i[h]))return!1}return!0}function ug(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function dg(n,i){var l=ug(n);n=0;for(var u;l;){if(l.nodeType===3){if(u=n+l.textContent.length,n<=i&&u>=i)return{node:l,offset:i-n};n=u}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=ug(l)}}function fg(n,i){return n&&i?n===i?!0:n&&n.nodeType===3?!1:i&&i.nodeType===3?fg(n,i.parentNode):"contains"in n?n.contains(i):n.compareDocumentPosition?!!(n.compareDocumentPosition(i)&16):!1:!1}function pg(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var i=hs(n.document);i instanceof n.HTMLIFrameElement;){try{var l=typeof i.contentWindow.location.href=="string"}catch{l=!1}if(l)n=i.contentWindow;else break;i=hs(n.document)}return i}function Xu(n){var i=n&&n.nodeName&&n.nodeName.toLowerCase();return i&&(i==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||i==="textarea"||n.contentEditable==="true")}var v2=Ga&&"documentMode"in document&&11>=document.documentMode,Pr=null,Zu=null,Vl=null,Ju=!1;function hg(n,i,l){var u=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Ju||Pr==null||Pr!==hs(u)||(u=Pr,"selectionStart"in u&&Xu(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),Vl&&Gl(Vl,u)||(Vl=u,u=cc(Zu,"onSelect"),0<u.length&&(i=new bs("onSelect","select",null,i,l),n.push({event:i,listeners:u}),i.target=Pr)))}function tr(n,i){var l={};return l[n.toLowerCase()]=i.toLowerCase(),l["Webkit"+n]="webkit"+i,l["Moz"+n]="moz"+i,l}var Br={animationend:tr("Animation","AnimationEnd"),animationiteration:tr("Animation","AnimationIteration"),animationstart:tr("Animation","AnimationStart"),transitionrun:tr("Transition","TransitionRun"),transitionstart:tr("Transition","TransitionStart"),transitioncancel:tr("Transition","TransitionCancel"),transitionend:tr("Transition","TransitionEnd")},ed={},mg={};Ga&&(mg=document.createElement("div").style,"AnimationEvent"in window||(delete Br.animationend.animation,delete Br.animationiteration.animation,delete Br.animationstart.animation),"TransitionEvent"in window||delete Br.transitionend.transition);function nr(n){if(ed[n])return ed[n];if(!Br[n])return n;var i=Br[n],l;for(l in i)if(i.hasOwnProperty(l)&&l in mg)return ed[n]=i[l];return n}var gg=nr("animationend"),yg=nr("animationiteration"),vg=nr("animationstart"),b2=nr("transitionrun"),x2=nr("transitionstart"),w2=nr("transitioncancel"),bg=nr("transitionend"),xg=new Map,td="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(" ");td.push("scrollEnd");function fa(n,i){xg.set(n,i),hn(i,[n])}var Ss=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n!==null&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)},Jn=[],Ur=0,nd=0;function ks(){for(var n=Ur,i=nd=Ur=0;i<n;){var l=Jn[i];Jn[i++]=null;var u=Jn[i];Jn[i++]=null;var h=Jn[i];Jn[i++]=null;var v=Jn[i];if(Jn[i++]=null,u!==null&&h!==null){var w=u.pending;w===null?h.next=h:(h.next=w.next,w.next=h),u.pending=h}v!==0&&wg(l,h,v)}}function Cs(n,i,l,u){Jn[Ur++]=n,Jn[Ur++]=i,Jn[Ur++]=l,Jn[Ur++]=u,nd|=u,n.lanes|=u,n=n.alternate,n!==null&&(n.lanes|=u)}function ad(n,i,l,u){return Cs(n,i,l,u),Es(n)}function ar(n,i){return Cs(n,null,null,i),Es(n)}function wg(n,i,l){n.lanes|=l;var u=n.alternate;u!==null&&(u.lanes|=l);for(var h=!1,v=n.return;v!==null;)v.childLanes|=l,u=v.alternate,u!==null&&(u.childLanes|=l),v.tag===22&&(n=v.stateNode,n===null||n._visibility&1||(h=!0)),n=v,v=v.return;return n.tag===3?(v=n.stateNode,h&&i!==null&&(h=31-Se(l),n=v.hiddenUpdates,u=n[h],u===null?n[h]=[i]:u.push(i),i.lane=l|536870912),v):null}function Es(n){if(50<mo)throw mo=0,pf=null,Error(r(185));for(var i=n.return;i!==null;)n=i,i=n.return;return n.tag===3?n.stateNode:null}var Hr={};function S2(n,i,l,u){this.tag=n,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ln(n,i,l,u){return new S2(n,i,l,u)}function id(n){return n=n.prototype,!(!n||!n.isReactComponent)}function Va(n,i){var l=n.alternate;return l===null?(l=Ln(n.tag,i,n.key,n.mode),l.elementType=n.elementType,l.type=n.type,l.stateNode=n.stateNode,l.alternate=n,n.alternate=l):(l.pendingProps=i,l.type=n.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=n.flags&65011712,l.childLanes=n.childLanes,l.lanes=n.lanes,l.child=n.child,l.memoizedProps=n.memoizedProps,l.memoizedState=n.memoizedState,l.updateQueue=n.updateQueue,i=n.dependencies,l.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},l.sibling=n.sibling,l.index=n.index,l.ref=n.ref,l.refCleanup=n.refCleanup,l}function Sg(n,i){n.flags&=65011714;var l=n.alternate;return l===null?(n.childLanes=0,n.lanes=i,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=l.childLanes,n.lanes=l.lanes,n.child=l.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=l.memoizedProps,n.memoizedState=l.memoizedState,n.updateQueue=l.updateQueue,n.type=l.type,i=l.dependencies,n.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),n}function As(n,i,l,u,h,v){var w=0;if(u=n,typeof n=="function")id(n)&&(w=1);else if(typeof n=="string")w=jC(n,l,ue.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(n){case D:return n=Ln(31,l,i,h),n.elementType=D,n.lanes=v,n;case C:return ir(l.children,h,v,i);case A:w=8,h|=24;break;case E:return n=Ln(12,l,i,h|2),n.elementType=E,n.lanes=v,n;case I:return n=Ln(13,l,i,h),n.elementType=I,n.lanes=v,n;case O:return n=Ln(19,l,i,h),n.elementType=O,n.lanes=v,n;default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case _:w=10;break e;case R:w=9;break e;case U:w=11;break e;case P:w=14;break e;case Y:w=16,u=null;break e}w=29,l=Error(r(130,n===null?"null":typeof n,"")),u=null}return i=Ln(w,l,i,h),i.elementType=n,i.type=u,i.lanes=v,i}function ir(n,i,l,u){return n=Ln(7,n,u,i),n.lanes=l,n}function rd(n,i,l){return n=Ln(6,n,null,i),n.lanes=l,n}function kg(n){var i=Ln(18,null,null,0);return i.stateNode=n,i}function ld(n,i,l){return i=Ln(4,n.children!==null?n.children:[],n.key,i),i.lanes=l,i.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},i}var Cg=new WeakMap;function ea(n,i){if(typeof n=="object"&&n!==null){var l=Cg.get(n);return l!==void 0?l:(i={value:n,source:i,stack:Pt(i)},Cg.set(n,i),i)}return{value:n,source:i,stack:Pt(i)}}var $r=[],qr=0,js=null,Wl=0,ta=[],na=0,vi=null,Ca=1,Ea="";function Wa(n,i){$r[qr++]=Wl,$r[qr++]=js,js=n,Wl=i}function Eg(n,i,l){ta[na++]=Ca,ta[na++]=Ea,ta[na++]=vi,vi=n;var u=Ca;n=Ea;var h=32-Se(u)-1;u&=~(1<<h),l+=1;var v=32-Se(i)+h;if(30<v){var w=h-h%5;v=(u&(1<<w)-1).toString(32),u>>=w,h-=w,Ca=1<<32-Se(i)+h|l<<h|u,Ea=v+n}else Ca=1<<v|l<<h|u,Ea=n}function od(n){n.return!==null&&(Wa(n,1),Eg(n,1,0))}function sd(n){for(;n===js;)js=$r[--qr],$r[qr]=null,Wl=$r[--qr],$r[qr]=null;for(;n===vi;)vi=ta[--na],ta[na]=null,Ea=ta[--na],ta[na]=null,Ca=ta[--na],ta[na]=null}function Ag(n,i){ta[na++]=Ca,ta[na++]=Ea,ta[na++]=vi,Ca=i.id,Ea=i.overflow,vi=n}var rn=null,St=null,Ye=!1,bi=null,aa=!1,cd=Error(r(519));function xi(n){var i=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Yl(ea(i,n)),cd}function jg(n){var i=n.stateNode,l=n.type,u=n.memoizedProps;switch(i[we]=n,i[_e]=u,l){case"dialog":qe("cancel",i),qe("close",i);break;case"iframe":case"object":case"embed":qe("load",i);break;case"video":case"audio":for(l=0;l<yo.length;l++)qe(yo[l],i);break;case"source":qe("error",i);break;case"img":case"image":case"link":qe("error",i),qe("load",i);break;case"details":qe("toggle",i);break;case"input":qe("invalid",i),Um(i,u.value,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name,!0);break;case"select":qe("invalid",i);break;case"textarea":qe("invalid",i),$m(i,u.value,u.defaultValue,u.children)}l=u.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||i.textContent===""+l||u.suppressHydrationWarning===!0||Fv(i.textContent,l)?(u.popover!=null&&(qe("beforetoggle",i),qe("toggle",i)),u.onScroll!=null&&qe("scroll",i),u.onScrollEnd!=null&&qe("scrollend",i),u.onClick!=null&&(i.onclick=Fa),i=!0):i=!1,i||xi(n,!0)}function Tg(n){for(rn=n.return;rn;)switch(rn.tag){case 5:case 31:case 13:aa=!1;return;case 27:case 3:aa=!0;return;default:rn=rn.return}}function Fr(n){if(n!==rn)return!1;if(!Ye)return Tg(n),Ye=!0,!1;var i=n.tag,l;if((l=i!==3&&i!==27)&&((l=i===5)&&(l=n.type,l=!(l!=="form"&&l!=="button")||Tf(n.type,n.memoizedProps)),l=!l),l&&St&&xi(n),Tg(n),i===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(r(317));St=Jv(n)}else if(i===31){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(r(317));St=Jv(n)}else i===27?(i=St,Di(n.type)?(n=Mf,Mf=null,St=n):St=i):St=rn?ra(n.stateNode.nextSibling):null;return!0}function rr(){St=rn=null,Ye=!1}function ud(){var n=bi;return n!==null&&(Tn===null?Tn=n:Tn.push.apply(Tn,n),bi=null),n}function Yl(n){bi===null?bi=[n]:bi.push(n)}var dd=L(null),lr=null,Ya=null;function wi(n,i,l){N(dd,i._currentValue),i._currentValue=l}function Ka(n){n._currentValue=dd.current,K(dd)}function fd(n,i,l){for(;n!==null;){var u=n.alternate;if((n.childLanes&i)!==i?(n.childLanes|=i,u!==null&&(u.childLanes|=i)):u!==null&&(u.childLanes&i)!==i&&(u.childLanes|=i),n===l)break;n=n.return}}function pd(n,i,l,u){var h=n.child;for(h!==null&&(h.return=n);h!==null;){var v=h.dependencies;if(v!==null){var w=h.child;v=v.firstContext;e:for(;v!==null;){var j=v;v=h;for(var z=0;z<i.length;z++)if(j.context===i[z]){v.lanes|=l,j=v.alternate,j!==null&&(j.lanes|=l),fd(v.return,l,n),u||(w=null);break e}v=j.next}}else if(h.tag===18){if(w=h.return,w===null)throw Error(r(341));w.lanes|=l,v=w.alternate,v!==null&&(v.lanes|=l),fd(w,l,n),w=null}else w=h.child;if(w!==null)w.return=h;else for(w=h;w!==null;){if(w===n){w=null;break}if(h=w.sibling,h!==null){h.return=w.return,w=h;break}w=w.return}h=w}}function Gr(n,i,l,u){n=null;for(var h=i,v=!1;h!==null;){if(!v){if((h.flags&524288)!==0)v=!0;else if((h.flags&262144)!==0)break}if(h.tag===10){var w=h.alternate;if(w===null)throw Error(r(387));if(w=w.memoizedProps,w!==null){var j=h.type;Dn(h.pendingProps.value,w.value)||(n!==null?n.push(j):n=[j])}}else if(h===Ee.current){if(w=h.alternate,w===null)throw Error(r(387));w.memoizedState.memoizedState!==h.memoizedState.memoizedState&&(n!==null?n.push(So):n=[So])}h=h.return}n!==null&&pd(i,n,l,u),i.flags|=262144}function Ts(n){for(n=n.firstContext;n!==null;){if(!Dn(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function or(n){lr=n,Ya=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function ln(n){return Rg(lr,n)}function Rs(n,i){return lr===null&&or(n),Rg(n,i)}function Rg(n,i){var l=i._currentValue;if(i={context:i,memoizedValue:l,next:null},Ya===null){if(n===null)throw Error(r(308));Ya=i,n.dependencies={lanes:0,firstContext:i},n.flags|=524288}else Ya=Ya.next=i;return l}var k2=typeof AbortController<"u"?AbortController:function(){var n=[],i=this.signal={aborted:!1,addEventListener:function(l,u){n.push(u)}};this.abort=function(){i.aborted=!0,n.forEach(function(l){return l()})}},C2=e.unstable_scheduleCallback,E2=e.unstable_NormalPriority,Ut={$$typeof:_,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function hd(){return{controller:new k2,data:new Map,refCount:0}}function Kl(n){n.refCount--,n.refCount===0&&C2(E2,function(){n.controller.abort()})}var Ql=null,md=0,Vr=0,Wr=null;function A2(n,i){if(Ql===null){var l=Ql=[];md=0,Vr=bf(),Wr={status:"pending",value:void 0,then:function(u){l.push(u)}}}return md++,i.then(Ng,Ng),i}function Ng(){if(--md===0&&Ql!==null){Wr!==null&&(Wr.status="fulfilled");var n=Ql;Ql=null,Vr=0,Wr=null;for(var i=0;i<n.length;i++)(0,n[i])()}}function j2(n,i){var l=[],u={status:"pending",value:null,reason:null,then:function(h){l.push(h)}};return n.then(function(){u.status="fulfilled",u.value=i;for(var h=0;h<l.length;h++)(0,l[h])(i)},function(h){for(u.status="rejected",u.reason=h,h=0;h<l.length;h++)(0,l[h])(void 0)}),u}var _g=F.S;F.S=function(n,i){hv=rt(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&A2(n,i),_g!==null&&_g(n,i)};var sr=L(null);function gd(){var n=sr.current;return n!==null?n:mt.pooledCache}function Ns(n,i){i===null?N(sr,sr.current):N(sr,i.pool)}function Og(){var n=gd();return n===null?null:{parent:Ut._currentValue,pool:n}}var Yr=Error(r(460)),yd=Error(r(474)),_s=Error(r(542)),Os={then:function(){}};function Mg(n){return n=n.status,n==="fulfilled"||n==="rejected"}function Dg(n,i,l){switch(l=n[l],l===void 0?n.push(i):l!==i&&(i.then(Fa,Fa),i=l),i.status){case"fulfilled":return i.value;case"rejected":throw n=i.reason,zg(n),n;default:if(typeof i.status=="string")i.then(Fa,Fa);else{if(n=mt,n!==null&&100<n.shellSuspendCounter)throw Error(r(482));n=i,n.status="pending",n.then(function(u){if(i.status==="pending"){var h=i;h.status="fulfilled",h.value=u}},function(u){if(i.status==="pending"){var h=i;h.status="rejected",h.reason=u}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw n=i.reason,zg(n),n}throw ur=i,Yr}}function cr(n){try{var i=n._init;return i(n._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(ur=l,Yr):l}}var ur=null;function Lg(){if(ur===null)throw Error(r(459));var n=ur;return ur=null,n}function zg(n){if(n===Yr||n===_s)throw Error(r(483))}var Kr=null,Xl=0;function Ms(n){var i=Xl;return Xl+=1,Kr===null&&(Kr=[]),Dg(Kr,n,i)}function Zl(n,i){i=i.props.ref,n.ref=i!==void 0?i:null}function Ds(n,i){throw i.$$typeof===b?Error(r(525)):(n=Object.prototype.toString.call(i),Error(r(31,n==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":n)))}function Ig(n){function i(V,$){if(n){var Z=V.deletions;Z===null?(V.deletions=[$],V.flags|=16):Z.push($)}}function l(V,$){if(!n)return null;for(;$!==null;)i(V,$),$=$.sibling;return null}function u(V){for(var $=new Map;V!==null;)V.key!==null?$.set(V.key,V):$.set(V.index,V),V=V.sibling;return $}function h(V,$){return V=Va(V,$),V.index=0,V.sibling=null,V}function v(V,$,Z){return V.index=Z,n?(Z=V.alternate,Z!==null?(Z=Z.index,Z<$?(V.flags|=67108866,$):Z):(V.flags|=67108866,$)):(V.flags|=1048576,$)}function w(V){return n&&V.alternate===null&&(V.flags|=67108866),V}function j(V,$,Z,oe){return $===null||$.tag!==6?($=rd(Z,V.mode,oe),$.return=V,$):($=h($,Z),$.return=V,$)}function z(V,$,Z,oe){var Ce=Z.type;return Ce===C?re(V,$,Z.props.children,oe,Z.key):$!==null&&($.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===Y&&cr(Ce)===$.type)?($=h($,Z.props),Zl($,Z),$.return=V,$):($=As(Z.type,Z.key,Z.props,null,V.mode,oe),Zl($,Z),$.return=V,$)}function J(V,$,Z,oe){return $===null||$.tag!==4||$.stateNode.containerInfo!==Z.containerInfo||$.stateNode.implementation!==Z.implementation?($=ld(Z,V.mode,oe),$.return=V,$):($=h($,Z.children||[]),$.return=V,$)}function re(V,$,Z,oe,Ce){return $===null||$.tag!==7?($=ir(Z,V.mode,oe,Ce),$.return=V,$):($=h($,Z),$.return=V,$)}function ce(V,$,Z){if(typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint")return $=rd(""+$,V.mode,Z),$.return=V,$;if(typeof $=="object"&&$!==null){switch($.$$typeof){case x:return Z=As($.type,$.key,$.props,null,V.mode,Z),Zl(Z,$),Z.return=V,Z;case k:return $=ld($,V.mode,Z),$.return=V,$;case Y:return $=cr($),ce(V,$,Z)}if(Q($)||W($))return $=ir($,V.mode,Z,null),$.return=V,$;if(typeof $.then=="function")return ce(V,Ms($),Z);if($.$$typeof===_)return ce(V,Rs(V,$),Z);Ds(V,$)}return null}function te(V,$,Z,oe){var Ce=$!==null?$.key:null;if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return Ce!==null?null:j(V,$,""+Z,oe);if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case x:return Z.key===Ce?z(V,$,Z,oe):null;case k:return Z.key===Ce?J(V,$,Z,oe):null;case Y:return Z=cr(Z),te(V,$,Z,oe)}if(Q(Z)||W(Z))return Ce!==null?null:re(V,$,Z,oe,null);if(typeof Z.then=="function")return te(V,$,Ms(Z),oe);if(Z.$$typeof===_)return te(V,$,Rs(V,Z),oe);Ds(V,Z)}return null}function ne(V,$,Z,oe,Ce){if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return V=V.get(Z)||null,j($,V,""+oe,Ce);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case x:return V=V.get(oe.key===null?Z:oe.key)||null,z($,V,oe,Ce);case k:return V=V.get(oe.key===null?Z:oe.key)||null,J($,V,oe,Ce);case Y:return oe=cr(oe),ne(V,$,Z,oe,Ce)}if(Q(oe)||W(oe))return V=V.get(Z)||null,re($,V,oe,Ce,null);if(typeof oe.then=="function")return ne(V,$,Z,Ms(oe),Ce);if(oe.$$typeof===_)return ne(V,$,Z,Rs($,oe),Ce);Ds($,oe)}return null}function be(V,$,Z,oe){for(var Ce=null,Ze=null,xe=$,ze=$=0,Ve=null;xe!==null&&ze<Z.length;ze++){xe.index>ze?(Ve=xe,xe=null):Ve=xe.sibling;var Je=te(V,xe,Z[ze],oe);if(Je===null){xe===null&&(xe=Ve);break}n&&xe&&Je.alternate===null&&i(V,xe),$=v(Je,$,ze),Ze===null?Ce=Je:Ze.sibling=Je,Ze=Je,xe=Ve}if(ze===Z.length)return l(V,xe),Ye&&Wa(V,ze),Ce;if(xe===null){for(;ze<Z.length;ze++)xe=ce(V,Z[ze],oe),xe!==null&&($=v(xe,$,ze),Ze===null?Ce=xe:Ze.sibling=xe,Ze=xe);return Ye&&Wa(V,ze),Ce}for(xe=u(xe);ze<Z.length;ze++)Ve=ne(xe,V,ze,Z[ze],oe),Ve!==null&&(n&&Ve.alternate!==null&&xe.delete(Ve.key===null?ze:Ve.key),$=v(Ve,$,ze),Ze===null?Ce=Ve:Ze.sibling=Ve,Ze=Ve);return n&&xe.forEach(function(Bi){return i(V,Bi)}),Ye&&Wa(V,ze),Ce}function je(V,$,Z,oe){if(Z==null)throw Error(r(151));for(var Ce=null,Ze=null,xe=$,ze=$=0,Ve=null,Je=Z.next();xe!==null&&!Je.done;ze++,Je=Z.next()){xe.index>ze?(Ve=xe,xe=null):Ve=xe.sibling;var Bi=te(V,xe,Je.value,oe);if(Bi===null){xe===null&&(xe=Ve);break}n&&xe&&Bi.alternate===null&&i(V,xe),$=v(Bi,$,ze),Ze===null?Ce=Bi:Ze.sibling=Bi,Ze=Bi,xe=Ve}if(Je.done)return l(V,xe),Ye&&Wa(V,ze),Ce;if(xe===null){for(;!Je.done;ze++,Je=Z.next())Je=ce(V,Je.value,oe),Je!==null&&($=v(Je,$,ze),Ze===null?Ce=Je:Ze.sibling=Je,Ze=Je);return Ye&&Wa(V,ze),Ce}for(xe=u(xe);!Je.done;ze++,Je=Z.next())Je=ne(xe,V,ze,Je.value,oe),Je!==null&&(n&&Je.alternate!==null&&xe.delete(Je.key===null?ze:Je.key),$=v(Je,$,ze),Ze===null?Ce=Je:Ze.sibling=Je,Ze=Je);return n&&xe.forEach(function(PC){return i(V,PC)}),Ye&&Wa(V,ze),Ce}function ft(V,$,Z,oe){if(typeof Z=="object"&&Z!==null&&Z.type===C&&Z.key===null&&(Z=Z.props.children),typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case x:e:{for(var Ce=Z.key;$!==null;){if($.key===Ce){if(Ce=Z.type,Ce===C){if($.tag===7){l(V,$.sibling),oe=h($,Z.props.children),oe.return=V,V=oe;break e}}else if($.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===Y&&cr(Ce)===$.type){l(V,$.sibling),oe=h($,Z.props),Zl(oe,Z),oe.return=V,V=oe;break e}l(V,$);break}else i(V,$);$=$.sibling}Z.type===C?(oe=ir(Z.props.children,V.mode,oe,Z.key),oe.return=V,V=oe):(oe=As(Z.type,Z.key,Z.props,null,V.mode,oe),Zl(oe,Z),oe.return=V,V=oe)}return w(V);case k:e:{for(Ce=Z.key;$!==null;){if($.key===Ce)if($.tag===4&&$.stateNode.containerInfo===Z.containerInfo&&$.stateNode.implementation===Z.implementation){l(V,$.sibling),oe=h($,Z.children||[]),oe.return=V,V=oe;break e}else{l(V,$);break}else i(V,$);$=$.sibling}oe=ld(Z,V.mode,oe),oe.return=V,V=oe}return w(V);case Y:return Z=cr(Z),ft(V,$,Z,oe)}if(Q(Z))return be(V,$,Z,oe);if(W(Z)){if(Ce=W(Z),typeof Ce!="function")throw Error(r(150));return Z=Ce.call(Z),je(V,$,Z,oe)}if(typeof Z.then=="function")return ft(V,$,Ms(Z),oe);if(Z.$$typeof===_)return ft(V,$,Rs(V,Z),oe);Ds(V,Z)}return typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint"?(Z=""+Z,$!==null&&$.tag===6?(l(V,$.sibling),oe=h($,Z),oe.return=V,V=oe):(l(V,$),oe=rd(Z,V.mode,oe),oe.return=V,V=oe),w(V)):l(V,$)}return function(V,$,Z,oe){try{Xl=0;var Ce=ft(V,$,Z,oe);return Kr=null,Ce}catch(xe){if(xe===Yr||xe===_s)throw xe;var Ze=Ln(29,xe,null,V.mode);return Ze.lanes=oe,Ze.return=V,Ze}finally{}}}var dr=Ig(!0),Pg=Ig(!1),Si=!1;function vd(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function bd(n,i){n=n.updateQueue,i.updateQueue===n&&(i.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function ki(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function Ci(n,i,l){var u=n.updateQueue;if(u===null)return null;if(u=u.shared,(nt&2)!==0){var h=u.pending;return h===null?i.next=i:(i.next=h.next,h.next=i),u.pending=i,i=Es(n),wg(n,null,l),i}return Cs(n,u,i,l),Es(n)}function Jl(n,i,l){if(i=i.updateQueue,i!==null&&(i=i.shared,(l&4194048)!==0)){var u=i.lanes;u&=n.pendingLanes,l|=u,i.lanes=l,se(n,l)}}function xd(n,i){var l=n.updateQueue,u=n.alternate;if(u!==null&&(u=u.updateQueue,l===u)){var h=null,v=null;if(l=l.firstBaseUpdate,l!==null){do{var w={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};v===null?h=v=w:v=v.next=w,l=l.next}while(l!==null);v===null?h=v=i:v=v.next=i}else h=v=i;l={baseState:u.baseState,firstBaseUpdate:h,lastBaseUpdate:v,shared:u.shared,callbacks:u.callbacks},n.updateQueue=l;return}n=l.lastBaseUpdate,n===null?l.firstBaseUpdate=i:n.next=i,l.lastBaseUpdate=i}var wd=!1;function eo(){if(wd){var n=Wr;if(n!==null)throw n}}function to(n,i,l,u){wd=!1;var h=n.updateQueue;Si=!1;var v=h.firstBaseUpdate,w=h.lastBaseUpdate,j=h.shared.pending;if(j!==null){h.shared.pending=null;var z=j,J=z.next;z.next=null,w===null?v=J:w.next=J,w=z;var re=n.alternate;re!==null&&(re=re.updateQueue,j=re.lastBaseUpdate,j!==w&&(j===null?re.firstBaseUpdate=J:j.next=J,re.lastBaseUpdate=z))}if(v!==null){var ce=h.baseState;w=0,re=J=z=null,j=v;do{var te=j.lane&-536870913,ne=te!==j.lane;if(ne?(Ge&te)===te:(u&te)===te){te!==0&&te===Vr&&(wd=!0),re!==null&&(re=re.next={lane:0,tag:j.tag,payload:j.payload,callback:null,next:null});e:{var be=n,je=j;te=i;var ft=l;switch(je.tag){case 1:if(be=je.payload,typeof be=="function"){ce=be.call(ft,ce,te);break e}ce=be;break e;case 3:be.flags=be.flags&-65537|128;case 0:if(be=je.payload,te=typeof be=="function"?be.call(ft,ce,te):be,te==null)break e;ce=m({},ce,te);break e;case 2:Si=!0}}te=j.callback,te!==null&&(n.flags|=64,ne&&(n.flags|=8192),ne=h.callbacks,ne===null?h.callbacks=[te]:ne.push(te))}else ne={lane:te,tag:j.tag,payload:j.payload,callback:j.callback,next:null},re===null?(J=re=ne,z=ce):re=re.next=ne,w|=te;if(j=j.next,j===null){if(j=h.shared.pending,j===null)break;ne=j,j=ne.next,ne.next=null,h.lastBaseUpdate=ne,h.shared.pending=null}}while(!0);re===null&&(z=ce),h.baseState=z,h.firstBaseUpdate=J,h.lastBaseUpdate=re,v===null&&(h.shared.lanes=0),Ri|=w,n.lanes=w,n.memoizedState=ce}}function Bg(n,i){if(typeof n!="function")throw Error(r(191,n));n.call(i)}function Ug(n,i){var l=n.callbacks;if(l!==null)for(n.callbacks=null,n=0;n<l.length;n++)Bg(l[n],i)}var Qr=L(null),Ls=L(0);function Hg(n,i){n=ii,N(Ls,n),N(Qr,i),ii=n|i.baseLanes}function Sd(){N(Ls,ii),N(Qr,Qr.current)}function kd(){ii=Ls.current,K(Qr),K(Ls)}var zn=L(null),ia=null;function Ei(n){var i=n.alternate;N(Dt,Dt.current&1),N(zn,n),ia===null&&(i===null||Qr.current!==null||i.memoizedState!==null)&&(ia=n)}function Cd(n){N(Dt,Dt.current),N(zn,n),ia===null&&(ia=n)}function $g(n){n.tag===22?(N(Dt,Dt.current),N(zn,n),ia===null&&(ia=n)):Ai()}function Ai(){N(Dt,Dt.current),N(zn,zn.current)}function In(n){K(zn),ia===n&&(ia=null),K(Dt)}var Dt=L(0);function zs(n){for(var i=n;i!==null;){if(i.tag===13){var l=i.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||_f(l)||Of(l)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===n)break;for(;i.sibling===null;){if(i.return===null||i.return===n)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var Qa=0,Le=null,ut=null,Ht=null,Is=!1,Xr=!1,fr=!1,Ps=0,no=0,Zr=null,T2=0;function Nt(){throw Error(r(321))}function Ed(n,i){if(i===null)return!1;for(var l=0;l<i.length&&l<n.length;l++)if(!Dn(n[l],i[l]))return!1;return!0}function Ad(n,i,l,u,h,v){return Qa=v,Le=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,F.H=n===null||n.memoizedState===null?Ey:Hd,fr=!1,v=l(u,h),fr=!1,Xr&&(v=Fg(i,l,u,h)),qg(n),v}function qg(n){F.H=ro;var i=ut!==null&&ut.next!==null;if(Qa=0,Ht=ut=Le=null,Is=!1,no=0,Zr=null,i)throw Error(r(300));n===null||$t||(n=n.dependencies,n!==null&&Ts(n)&&($t=!0))}function Fg(n,i,l,u){Le=n;var h=0;do{if(Xr&&(Zr=null),no=0,Xr=!1,25<=h)throw Error(r(301));if(h+=1,Ht=ut=null,n.updateQueue!=null){var v=n.updateQueue;v.lastEffect=null,v.events=null,v.stores=null,v.memoCache!=null&&(v.memoCache.index=0)}F.H=Ay,v=i(l,u)}while(Xr);return v}function R2(){var n=F.H,i=n.useState()[0];return i=typeof i.then=="function"?ao(i):i,n=n.useState()[0],(ut!==null?ut.memoizedState:null)!==n&&(Le.flags|=1024),i}function jd(){var n=Ps!==0;return Ps=0,n}function Td(n,i,l){i.updateQueue=n.updateQueue,i.flags&=-2053,n.lanes&=~l}function Rd(n){if(Is){for(n=n.memoizedState;n!==null;){var i=n.queue;i!==null&&(i.pending=null),n=n.next}Is=!1}Qa=0,Ht=ut=Le=null,Xr=!1,no=Ps=0,Zr=null}function gn(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ht===null?Le.memoizedState=Ht=n:Ht=Ht.next=n,Ht}function Lt(){if(ut===null){var n=Le.alternate;n=n!==null?n.memoizedState:null}else n=ut.next;var i=Ht===null?Le.memoizedState:Ht.next;if(i!==null)Ht=i,ut=n;else{if(n===null)throw Le.alternate===null?Error(r(467)):Error(r(310));ut=n,n={memoizedState:ut.memoizedState,baseState:ut.baseState,baseQueue:ut.baseQueue,queue:ut.queue,next:null},Ht===null?Le.memoizedState=Ht=n:Ht=Ht.next=n}return Ht}function Bs(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ao(n){var i=no;return no+=1,Zr===null&&(Zr=[]),n=Dg(Zr,n,i),i=Le,(Ht===null?i.memoizedState:Ht.next)===null&&(i=i.alternate,F.H=i===null||i.memoizedState===null?Ey:Hd),n}function Us(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return ao(n);if(n.$$typeof===_)return ln(n)}throw Error(r(438,String(n)))}function Nd(n){var i=null,l=Le.updateQueue;if(l!==null&&(i=l.memoCache),i==null){var u=Le.alternate;u!==null&&(u=u.updateQueue,u!==null&&(u=u.memoCache,u!=null&&(i={data:u.data.map(function(h){return h.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),l===null&&(l=Bs(),Le.updateQueue=l),l.memoCache=i,l=i.data[i.index],l===void 0)for(l=i.data[i.index]=Array(n),u=0;u<n;u++)l[u]=T;return i.index++,l}function Xa(n,i){return typeof i=="function"?i(n):i}function Hs(n){var i=Lt();return _d(i,ut,n)}function _d(n,i,l){var u=n.queue;if(u===null)throw Error(r(311));u.lastRenderedReducer=l;var h=n.baseQueue,v=u.pending;if(v!==null){if(h!==null){var w=h.next;h.next=v.next,v.next=w}i.baseQueue=h=v,u.pending=null}if(v=n.baseState,h===null)n.memoizedState=v;else{i=h.next;var j=w=null,z=null,J=i,re=!1;do{var ce=J.lane&-536870913;if(ce!==J.lane?(Ge&ce)===ce:(Qa&ce)===ce){var te=J.revertLane;if(te===0)z!==null&&(z=z.next={lane:0,revertLane:0,gesture:null,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null}),ce===Vr&&(re=!0);else if((Qa&te)===te){J=J.next,te===Vr&&(re=!0);continue}else ce={lane:0,revertLane:J.revertLane,gesture:null,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null},z===null?(j=z=ce,w=v):z=z.next=ce,Le.lanes|=te,Ri|=te;ce=J.action,fr&&l(v,ce),v=J.hasEagerState?J.eagerState:l(v,ce)}else te={lane:ce,revertLane:J.revertLane,gesture:J.gesture,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null},z===null?(j=z=te,w=v):z=z.next=te,Le.lanes|=ce,Ri|=ce;J=J.next}while(J!==null&&J!==i);if(z===null?w=v:z.next=j,!Dn(v,n.memoizedState)&&($t=!0,re&&(l=Wr,l!==null)))throw l;n.memoizedState=v,n.baseState=w,n.baseQueue=z,u.lastRenderedState=v}return h===null&&(u.lanes=0),[n.memoizedState,u.dispatch]}function Od(n){var i=Lt(),l=i.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=n;var u=l.dispatch,h=l.pending,v=i.memoizedState;if(h!==null){l.pending=null;var w=h=h.next;do v=n(v,w.action),w=w.next;while(w!==h);Dn(v,i.memoizedState)||($t=!0),i.memoizedState=v,i.baseQueue===null&&(i.baseState=v),l.lastRenderedState=v}return[v,u]}function Gg(n,i,l){var u=Le,h=Lt(),v=Ye;if(v){if(l===void 0)throw Error(r(407));l=l()}else l=i();var w=!Dn((ut||h).memoizedState,l);if(w&&(h.memoizedState=l,$t=!0),h=h.queue,Ld(Yg.bind(null,u,h,n),[n]),h.getSnapshot!==i||w||Ht!==null&&Ht.memoizedState.tag&1){if(u.flags|=2048,Jr(9,{destroy:void 0},Wg.bind(null,u,h,l,i),null),mt===null)throw Error(r(349));v||(Qa&127)!==0||Vg(u,i,l)}return l}function Vg(n,i,l){n.flags|=16384,n={getSnapshot:i,value:l},i=Le.updateQueue,i===null?(i=Bs(),Le.updateQueue=i,i.stores=[n]):(l=i.stores,l===null?i.stores=[n]:l.push(n))}function Wg(n,i,l,u){i.value=l,i.getSnapshot=u,Kg(i)&&Qg(n)}function Yg(n,i,l){return l(function(){Kg(i)&&Qg(n)})}function Kg(n){var i=n.getSnapshot;n=n.value;try{var l=i();return!Dn(n,l)}catch{return!0}}function Qg(n){var i=ar(n,2);i!==null&&Rn(i,n,2)}function Md(n){var i=gn();if(typeof n=="function"){var l=n;if(n=l(),fr){We(!0);try{l()}finally{We(!1)}}}return i.memoizedState=i.baseState=n,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xa,lastRenderedState:n},i}function Xg(n,i,l,u){return n.baseState=l,_d(n,ut,typeof u=="function"?u:Xa)}function N2(n,i,l,u,h){if(Fs(n))throw Error(r(485));if(n=i.action,n!==null){var v={payload:h,action:n,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(w){v.listeners.push(w)}};F.T!==null?l(!0):v.isTransition=!1,u(v),l=i.pending,l===null?(v.next=i.pending=v,Zg(i,v)):(v.next=l.next,i.pending=l.next=v)}}function Zg(n,i){var l=i.action,u=i.payload,h=n.state;if(i.isTransition){var v=F.T,w={};F.T=w;try{var j=l(h,u),z=F.S;z!==null&&z(w,j),Jg(n,i,j)}catch(J){Dd(n,i,J)}finally{v!==null&&w.types!==null&&(v.types=w.types),F.T=v}}else try{v=l(h,u),Jg(n,i,v)}catch(J){Dd(n,i,J)}}function Jg(n,i,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(u){ey(n,i,u)},function(u){return Dd(n,i,u)}):ey(n,i,l)}function ey(n,i,l){i.status="fulfilled",i.value=l,ty(i),n.state=l,i=n.pending,i!==null&&(l=i.next,l===i?n.pending=null:(l=l.next,i.next=l,Zg(n,l)))}function Dd(n,i,l){var u=n.pending;if(n.pending=null,u!==null){u=u.next;do i.status="rejected",i.reason=l,ty(i),i=i.next;while(i!==u)}n.action=null}function ty(n){n=n.listeners;for(var i=0;i<n.length;i++)(0,n[i])()}function ny(n,i){return i}function ay(n,i){if(Ye){var l=mt.formState;if(l!==null){e:{var u=Le;if(Ye){if(St){t:{for(var h=St,v=aa;h.nodeType!==8;){if(!v){h=null;break t}if(h=ra(h.nextSibling),h===null){h=null;break t}}v=h.data,h=v==="F!"||v==="F"?h:null}if(h){St=ra(h.nextSibling),u=h.data==="F!";break e}}xi(u)}u=!1}u&&(i=l[0])}}return l=gn(),l.memoizedState=l.baseState=i,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ny,lastRenderedState:i},l.queue=u,l=Sy.bind(null,Le,u),u.dispatch=l,u=Md(!1),v=Ud.bind(null,Le,!1,u.queue),u=gn(),h={state:i,dispatch:null,action:n,pending:null},u.queue=h,l=N2.bind(null,Le,h,v,l),h.dispatch=l,u.memoizedState=n,[i,l,!1]}function iy(n){var i=Lt();return ry(i,ut,n)}function ry(n,i,l){if(i=_d(n,i,ny)[0],n=Hs(Xa)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var u=ao(i)}catch(w){throw w===Yr?_s:w}else u=i;i=Lt();var h=i.queue,v=h.dispatch;return l!==i.memoizedState&&(Le.flags|=2048,Jr(9,{destroy:void 0},_2.bind(null,h,l),null)),[u,v,n]}function _2(n,i){n.action=i}function ly(n){var i=Lt(),l=ut;if(l!==null)return ry(i,l,n);Lt(),i=i.memoizedState,l=Lt();var u=l.queue.dispatch;return l.memoizedState=n,[i,u,!1]}function Jr(n,i,l,u){return n={tag:n,create:l,deps:u,inst:i,next:null},i=Le.updateQueue,i===null&&(i=Bs(),Le.updateQueue=i),l=i.lastEffect,l===null?i.lastEffect=n.next=n:(u=l.next,l.next=n,n.next=u,i.lastEffect=n),n}function oy(){return Lt().memoizedState}function $s(n,i,l,u){var h=gn();Le.flags|=n,h.memoizedState=Jr(1|i,{destroy:void 0},l,u===void 0?null:u)}function qs(n,i,l,u){var h=Lt();u=u===void 0?null:u;var v=h.memoizedState.inst;ut!==null&&u!==null&&Ed(u,ut.memoizedState.deps)?h.memoizedState=Jr(i,v,l,u):(Le.flags|=n,h.memoizedState=Jr(1|i,v,l,u))}function sy(n,i){$s(8390656,8,n,i)}function Ld(n,i){qs(2048,8,n,i)}function O2(n){Le.flags|=4;var i=Le.updateQueue;if(i===null)i=Bs(),Le.updateQueue=i,i.events=[n];else{var l=i.events;l===null?i.events=[n]:l.push(n)}}function cy(n){var i=Lt().memoizedState;return O2({ref:i,nextImpl:n}),function(){if((nt&2)!==0)throw Error(r(440));return i.impl.apply(void 0,arguments)}}function uy(n,i){return qs(4,2,n,i)}function dy(n,i){return qs(4,4,n,i)}function fy(n,i){if(typeof i=="function"){n=n();var l=i(n);return function(){typeof l=="function"?l():i(null)}}if(i!=null)return n=n(),i.current=n,function(){i.current=null}}function py(n,i,l){l=l!=null?l.concat([n]):null,qs(4,4,fy.bind(null,i,n),l)}function zd(){}function hy(n,i){var l=Lt();i=i===void 0?null:i;var u=l.memoizedState;return i!==null&&Ed(i,u[1])?u[0]:(l.memoizedState=[n,i],n)}function my(n,i){var l=Lt();i=i===void 0?null:i;var u=l.memoizedState;if(i!==null&&Ed(i,u[1]))return u[0];if(u=n(),fr){We(!0);try{n()}finally{We(!1)}}return l.memoizedState=[u,i],u}function Id(n,i,l){return l===void 0||(Qa&1073741824)!==0&&(Ge&261930)===0?n.memoizedState=i:(n.memoizedState=l,n=gv(),Le.lanes|=n,Ri|=n,l)}function gy(n,i,l,u){return Dn(l,i)?l:Qr.current!==null?(n=Id(n,l,u),Dn(n,i)||($t=!0),n):(Qa&42)===0||(Qa&1073741824)!==0&&(Ge&261930)===0?($t=!0,n.memoizedState=l):(n=gv(),Le.lanes|=n,Ri|=n,i)}function yy(n,i,l,u,h){var v=ee.p;ee.p=v!==0&&8>v?v:8;var w=F.T,j={};F.T=j,Ud(n,!1,i,l);try{var z=h(),J=F.S;if(J!==null&&J(j,z),z!==null&&typeof z=="object"&&typeof z.then=="function"){var re=j2(z,u);io(n,i,re,Un(n))}else io(n,i,u,Un(n))}catch(ce){io(n,i,{then:function(){},status:"rejected",reason:ce},Un())}finally{ee.p=v,w!==null&&j.types!==null&&(w.types=j.types),F.T=w}}function M2(){}function Pd(n,i,l,u){if(n.tag!==5)throw Error(r(476));var h=vy(n).queue;yy(n,h,i,ie,l===null?M2:function(){return by(n),l(u)})}function vy(n){var i=n.memoizedState;if(i!==null)return i;i={memoizedState:ie,baseState:ie,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xa,lastRenderedState:ie},next:null};var l={};return i.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xa,lastRenderedState:l},next:null},n.memoizedState=i,n=n.alternate,n!==null&&(n.memoizedState=i),i}function by(n){var i=vy(n);i.next===null&&(i=n.alternate.memoizedState),io(n,i.next.queue,{},Un())}function Bd(){return ln(So)}function xy(){return Lt().memoizedState}function wy(){return Lt().memoizedState}function D2(n){for(var i=n.return;i!==null;){switch(i.tag){case 24:case 3:var l=Un();n=ki(l);var u=Ci(i,n,l);u!==null&&(Rn(u,i,l),Jl(u,i,l)),i={cache:hd()},n.payload=i;return}i=i.return}}function L2(n,i,l){var u=Un();l={lane:u,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Fs(n)?ky(i,l):(l=ad(n,i,l,u),l!==null&&(Rn(l,n,u),Cy(l,i,u)))}function Sy(n,i,l){var u=Un();io(n,i,l,u)}function io(n,i,l,u){var h={lane:u,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(Fs(n))ky(i,h);else{var v=n.alternate;if(n.lanes===0&&(v===null||v.lanes===0)&&(v=i.lastRenderedReducer,v!==null))try{var w=i.lastRenderedState,j=v(w,l);if(h.hasEagerState=!0,h.eagerState=j,Dn(j,w))return Cs(n,i,h,0),mt===null&&ks(),!1}catch{}finally{}if(l=ad(n,i,h,u),l!==null)return Rn(l,n,u),Cy(l,i,u),!0}return!1}function Ud(n,i,l,u){if(u={lane:2,revertLane:bf(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Fs(n)){if(i)throw Error(r(479))}else i=ad(n,l,u,2),i!==null&&Rn(i,n,2)}function Fs(n){var i=n.alternate;return n===Le||i!==null&&i===Le}function ky(n,i){Xr=Is=!0;var l=n.pending;l===null?i.next=i:(i.next=l.next,l.next=i),n.pending=i}function Cy(n,i,l){if((l&4194048)!==0){var u=i.lanes;u&=n.pendingLanes,l|=u,i.lanes=l,se(n,l)}}var ro={readContext:ln,use:Us,useCallback:Nt,useContext:Nt,useEffect:Nt,useImperativeHandle:Nt,useLayoutEffect:Nt,useInsertionEffect:Nt,useMemo:Nt,useReducer:Nt,useRef:Nt,useState:Nt,useDebugValue:Nt,useDeferredValue:Nt,useTransition:Nt,useSyncExternalStore:Nt,useId:Nt,useHostTransitionStatus:Nt,useFormState:Nt,useActionState:Nt,useOptimistic:Nt,useMemoCache:Nt,useCacheRefresh:Nt};ro.useEffectEvent=Nt;var Ey={readContext:ln,use:Us,useCallback:function(n,i){return gn().memoizedState=[n,i===void 0?null:i],n},useContext:ln,useEffect:sy,useImperativeHandle:function(n,i,l){l=l!=null?l.concat([n]):null,$s(4194308,4,fy.bind(null,i,n),l)},useLayoutEffect:function(n,i){return $s(4194308,4,n,i)},useInsertionEffect:function(n,i){$s(4,2,n,i)},useMemo:function(n,i){var l=gn();i=i===void 0?null:i;var u=n();if(fr){We(!0);try{n()}finally{We(!1)}}return l.memoizedState=[u,i],u},useReducer:function(n,i,l){var u=gn();if(l!==void 0){var h=l(i);if(fr){We(!0);try{l(i)}finally{We(!1)}}}else h=i;return u.memoizedState=u.baseState=h,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:h},u.queue=n,n=n.dispatch=L2.bind(null,Le,n),[u.memoizedState,n]},useRef:function(n){var i=gn();return n={current:n},i.memoizedState=n},useState:function(n){n=Md(n);var i=n.queue,l=Sy.bind(null,Le,i);return i.dispatch=l,[n.memoizedState,l]},useDebugValue:zd,useDeferredValue:function(n,i){var l=gn();return Id(l,n,i)},useTransition:function(){var n=Md(!1);return n=yy.bind(null,Le,n.queue,!0,!1),gn().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,i,l){var u=Le,h=gn();if(Ye){if(l===void 0)throw Error(r(407));l=l()}else{if(l=i(),mt===null)throw Error(r(349));(Ge&127)!==0||Vg(u,i,l)}h.memoizedState=l;var v={value:l,getSnapshot:i};return h.queue=v,sy(Yg.bind(null,u,v,n),[n]),u.flags|=2048,Jr(9,{destroy:void 0},Wg.bind(null,u,v,l,i),null),l},useId:function(){var n=gn(),i=mt.identifierPrefix;if(Ye){var l=Ea,u=Ca;l=(u&~(1<<32-Se(u)-1)).toString(32)+l,i="_"+i+"R_"+l,l=Ps++,0<l&&(i+="H"+l.toString(32)),i+="_"}else l=T2++,i="_"+i+"r_"+l.toString(32)+"_";return n.memoizedState=i},useHostTransitionStatus:Bd,useFormState:ay,useActionState:ay,useOptimistic:function(n){var i=gn();i.memoizedState=i.baseState=n;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=l,i=Ud.bind(null,Le,!0,l),l.dispatch=i,[n,i]},useMemoCache:Nd,useCacheRefresh:function(){return gn().memoizedState=D2.bind(null,Le)},useEffectEvent:function(n){var i=gn(),l={impl:n};return i.memoizedState=l,function(){if((nt&2)!==0)throw Error(r(440));return l.impl.apply(void 0,arguments)}}},Hd={readContext:ln,use:Us,useCallback:hy,useContext:ln,useEffect:Ld,useImperativeHandle:py,useInsertionEffect:uy,useLayoutEffect:dy,useMemo:my,useReducer:Hs,useRef:oy,useState:function(){return Hs(Xa)},useDebugValue:zd,useDeferredValue:function(n,i){var l=Lt();return gy(l,ut.memoizedState,n,i)},useTransition:function(){var n=Hs(Xa)[0],i=Lt().memoizedState;return[typeof n=="boolean"?n:ao(n),i]},useSyncExternalStore:Gg,useId:xy,useHostTransitionStatus:Bd,useFormState:iy,useActionState:iy,useOptimistic:function(n,i){var l=Lt();return Xg(l,ut,n,i)},useMemoCache:Nd,useCacheRefresh:wy};Hd.useEffectEvent=cy;var Ay={readContext:ln,use:Us,useCallback:hy,useContext:ln,useEffect:Ld,useImperativeHandle:py,useInsertionEffect:uy,useLayoutEffect:dy,useMemo:my,useReducer:Od,useRef:oy,useState:function(){return Od(Xa)},useDebugValue:zd,useDeferredValue:function(n,i){var l=Lt();return ut===null?Id(l,n,i):gy(l,ut.memoizedState,n,i)},useTransition:function(){var n=Od(Xa)[0],i=Lt().memoizedState;return[typeof n=="boolean"?n:ao(n),i]},useSyncExternalStore:Gg,useId:xy,useHostTransitionStatus:Bd,useFormState:ly,useActionState:ly,useOptimistic:function(n,i){var l=Lt();return ut!==null?Xg(l,ut,n,i):(l.baseState=n,[n,l.queue.dispatch])},useMemoCache:Nd,useCacheRefresh:wy};Ay.useEffectEvent=cy;function $d(n,i,l,u){i=n.memoizedState,l=l(u,i),l=l==null?i:m({},i,l),n.memoizedState=l,n.lanes===0&&(n.updateQueue.baseState=l)}var qd={enqueueSetState:function(n,i,l){n=n._reactInternals;var u=Un(),h=ki(u);h.payload=i,l!=null&&(h.callback=l),i=Ci(n,h,u),i!==null&&(Rn(i,n,u),Jl(i,n,u))},enqueueReplaceState:function(n,i,l){n=n._reactInternals;var u=Un(),h=ki(u);h.tag=1,h.payload=i,l!=null&&(h.callback=l),i=Ci(n,h,u),i!==null&&(Rn(i,n,u),Jl(i,n,u))},enqueueForceUpdate:function(n,i){n=n._reactInternals;var l=Un(),u=ki(l);u.tag=2,i!=null&&(u.callback=i),i=Ci(n,u,l),i!==null&&(Rn(i,n,l),Jl(i,n,l))}};function jy(n,i,l,u,h,v,w){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(u,v,w):i.prototype&&i.prototype.isPureReactComponent?!Gl(l,u)||!Gl(h,v):!0}function Ty(n,i,l,u){n=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(l,u),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(l,u),i.state!==n&&qd.enqueueReplaceState(i,i.state,null)}function pr(n,i){var l=i;if("ref"in i){l={};for(var u in i)u!=="ref"&&(l[u]=i[u])}if(n=n.defaultProps){l===i&&(l=m({},l));for(var h in n)l[h]===void 0&&(l[h]=n[h])}return l}function Ry(n){Ss(n)}function Ny(n){console.error(n)}function _y(n){Ss(n)}function Gs(n,i){try{var l=n.onUncaughtError;l(i.value,{componentStack:i.stack})}catch(u){setTimeout(function(){throw u})}}function Oy(n,i,l){try{var u=n.onCaughtError;u(l.value,{componentStack:l.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(h){setTimeout(function(){throw h})}}function Fd(n,i,l){return l=ki(l),l.tag=3,l.payload={element:null},l.callback=function(){Gs(n,i)},l}function My(n){return n=ki(n),n.tag=3,n}function Dy(n,i,l,u){var h=l.type.getDerivedStateFromError;if(typeof h=="function"){var v=u.value;n.payload=function(){return h(v)},n.callback=function(){Oy(i,l,u)}}var w=l.stateNode;w!==null&&typeof w.componentDidCatch=="function"&&(n.callback=function(){Oy(i,l,u),typeof h!="function"&&(Ni===null?Ni=new Set([this]):Ni.add(this));var j=u.stack;this.componentDidCatch(u.value,{componentStack:j!==null?j:""})})}function z2(n,i,l,u,h){if(l.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(i=l.alternate,i!==null&&Gr(i,l,h,!0),l=zn.current,l!==null){switch(l.tag){case 31:case 13:return ia===null?ac():l.alternate===null&&_t===0&&(_t=3),l.flags&=-257,l.flags|=65536,l.lanes=h,u===Os?l.flags|=16384:(i=l.updateQueue,i===null?l.updateQueue=new Set([u]):i.add(u),gf(n,u,h)),!1;case 22:return l.flags|=65536,u===Os?l.flags|=16384:(i=l.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([u])},l.updateQueue=i):(l=i.retryQueue,l===null?i.retryQueue=new Set([u]):l.add(u)),gf(n,u,h)),!1}throw Error(r(435,l.tag))}return gf(n,u,h),ac(),!1}if(Ye)return i=zn.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=h,u!==cd&&(n=Error(r(422),{cause:u}),Yl(ea(n,l)))):(u!==cd&&(i=Error(r(423),{cause:u}),Yl(ea(i,l))),n=n.current.alternate,n.flags|=65536,h&=-h,n.lanes|=h,u=ea(u,l),h=Fd(n.stateNode,u,h),xd(n,h),_t!==4&&(_t=2)),!1;var v=Error(r(520),{cause:u});if(v=ea(v,l),ho===null?ho=[v]:ho.push(v),_t!==4&&(_t=2),i===null)return!0;u=ea(u,l),l=i;do{switch(l.tag){case 3:return l.flags|=65536,n=h&-h,l.lanes|=n,n=Fd(l.stateNode,u,n),xd(l,n),!1;case 1:if(i=l.type,v=l.stateNode,(l.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(Ni===null||!Ni.has(v))))return l.flags|=65536,h&=-h,l.lanes|=h,h=My(h),Dy(h,n,l,u),xd(l,h),!1}l=l.return}while(l!==null);return!1}var Gd=Error(r(461)),$t=!1;function on(n,i,l,u){i.child=n===null?Pg(i,null,l,u):dr(i,n.child,l,u)}function Ly(n,i,l,u,h){l=l.render;var v=i.ref;if("ref"in u){var w={};for(var j in u)j!=="ref"&&(w[j]=u[j])}else w=u;return or(i),u=Ad(n,i,l,w,v,h),j=jd(),n!==null&&!$t?(Td(n,i,h),Za(n,i,h)):(Ye&&j&&od(i),i.flags|=1,on(n,i,u,h),i.child)}function zy(n,i,l,u,h){if(n===null){var v=l.type;return typeof v=="function"&&!id(v)&&v.defaultProps===void 0&&l.compare===null?(i.tag=15,i.type=v,Iy(n,i,v,u,h)):(n=As(l.type,null,u,i,i.mode,h),n.ref=i.ref,n.return=i,i.child=n)}if(v=n.child,!Jd(n,h)){var w=v.memoizedProps;if(l=l.compare,l=l!==null?l:Gl,l(w,u)&&n.ref===i.ref)return Za(n,i,h)}return i.flags|=1,n=Va(v,u),n.ref=i.ref,n.return=i,i.child=n}function Iy(n,i,l,u,h){if(n!==null){var v=n.memoizedProps;if(Gl(v,u)&&n.ref===i.ref)if($t=!1,i.pendingProps=u=v,Jd(n,h))(n.flags&131072)!==0&&($t=!0);else return i.lanes=n.lanes,Za(n,i,h)}return Vd(n,i,l,u,h)}function Py(n,i,l,u){var h=u.children,v=n!==null?n.memoizedState:null;if(n===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.mode==="hidden"){if((i.flags&128)!==0){if(v=v!==null?v.baseLanes|l:l,n!==null){for(u=i.child=n.child,h=0;u!==null;)h=h|u.lanes|u.childLanes,u=u.sibling;u=h&~v}else u=0,i.child=null;return By(n,i,v,l,u)}if((l&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},n!==null&&Ns(i,v!==null?v.cachePool:null),v!==null?Hg(i,v):Sd(),$g(i);else return u=i.lanes=536870912,By(n,i,v!==null?v.baseLanes|l:l,l,u)}else v!==null?(Ns(i,v.cachePool),Hg(i,v),Ai(),i.memoizedState=null):(n!==null&&Ns(i,null),Sd(),Ai());return on(n,i,h,l),i.child}function lo(n,i){return n!==null&&n.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function By(n,i,l,u,h){var v=gd();return v=v===null?null:{parent:Ut._currentValue,pool:v},i.memoizedState={baseLanes:l,cachePool:v},n!==null&&Ns(i,null),Sd(),$g(i),n!==null&&Gr(n,i,u,!0),i.childLanes=h,null}function Vs(n,i){return i=Ys({mode:i.mode,children:i.children},n.mode),i.ref=n.ref,n.child=i,i.return=n,i}function Uy(n,i,l){return dr(i,n.child,null,l),n=Vs(i,i.pendingProps),n.flags|=2,In(i),i.memoizedState=null,n}function I2(n,i,l){var u=i.pendingProps,h=(i.flags&128)!==0;if(i.flags&=-129,n===null){if(Ye){if(u.mode==="hidden")return n=Vs(i,u),i.lanes=536870912,lo(null,n);if(Cd(i),(n=St)?(n=Zv(n,aa),n=n!==null&&n.data==="&"?n:null,n!==null&&(i.memoizedState={dehydrated:n,treeContext:vi!==null?{id:Ca,overflow:Ea}:null,retryLane:536870912,hydrationErrors:null},l=kg(n),l.return=i,i.child=l,rn=i,St=null)):n=null,n===null)throw xi(i);return i.lanes=536870912,null}return Vs(i,u)}var v=n.memoizedState;if(v!==null){var w=v.dehydrated;if(Cd(i),h)if(i.flags&256)i.flags&=-257,i=Uy(n,i,l);else if(i.memoizedState!==null)i.child=n.child,i.flags|=128,i=null;else throw Error(r(558));else if($t||Gr(n,i,l,!1),h=(l&n.childLanes)!==0,$t||h){if(u=mt,u!==null&&(w=ve(u,l),w!==0&&w!==v.retryLane))throw v.retryLane=w,ar(n,w),Rn(u,n,w),Gd;ac(),i=Uy(n,i,l)}else n=v.treeContext,St=ra(w.nextSibling),rn=i,Ye=!0,bi=null,aa=!1,n!==null&&Ag(i,n),i=Vs(i,u),i.flags|=4096;return i}return n=Va(n.child,{mode:u.mode,children:u.children}),n.ref=i.ref,i.child=n,n.return=i,n}function Ws(n,i){var l=i.ref;if(l===null)n!==null&&n.ref!==null&&(i.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(r(284));(n===null||n.ref!==l)&&(i.flags|=4194816)}}function Vd(n,i,l,u,h){return or(i),l=Ad(n,i,l,u,void 0,h),u=jd(),n!==null&&!$t?(Td(n,i,h),Za(n,i,h)):(Ye&&u&&od(i),i.flags|=1,on(n,i,l,h),i.child)}function Hy(n,i,l,u,h,v){return or(i),i.updateQueue=null,l=Fg(i,u,l,h),qg(n),u=jd(),n!==null&&!$t?(Td(n,i,v),Za(n,i,v)):(Ye&&u&&od(i),i.flags|=1,on(n,i,l,v),i.child)}function $y(n,i,l,u,h){if(or(i),i.stateNode===null){var v=Hr,w=l.contextType;typeof w=="object"&&w!==null&&(v=ln(w)),v=new l(u,v),i.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=qd,i.stateNode=v,v._reactInternals=i,v=i.stateNode,v.props=u,v.state=i.memoizedState,v.refs={},vd(i),w=l.contextType,v.context=typeof w=="object"&&w!==null?ln(w):Hr,v.state=i.memoizedState,w=l.getDerivedStateFromProps,typeof w=="function"&&($d(i,l,w,u),v.state=i.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(w=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),w!==v.state&&qd.enqueueReplaceState(v,v.state,null),to(i,u,v,h),eo(),v.state=i.memoizedState),typeof v.componentDidMount=="function"&&(i.flags|=4194308),u=!0}else if(n===null){v=i.stateNode;var j=i.memoizedProps,z=pr(l,j);v.props=z;var J=v.context,re=l.contextType;w=Hr,typeof re=="object"&&re!==null&&(w=ln(re));var ce=l.getDerivedStateFromProps;re=typeof ce=="function"||typeof v.getSnapshotBeforeUpdate=="function",j=i.pendingProps!==j,re||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(j||J!==w)&&Ty(i,v,u,w),Si=!1;var te=i.memoizedState;v.state=te,to(i,u,v,h),eo(),J=i.memoizedState,j||te!==J||Si?(typeof ce=="function"&&($d(i,l,ce,u),J=i.memoizedState),(z=Si||jy(i,l,z,u,te,J,w))?(re||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(i.flags|=4194308)):(typeof v.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=u,i.memoizedState=J),v.props=u,v.state=J,v.context=w,u=z):(typeof v.componentDidMount=="function"&&(i.flags|=4194308),u=!1)}else{v=i.stateNode,bd(n,i),w=i.memoizedProps,re=pr(l,w),v.props=re,ce=i.pendingProps,te=v.context,J=l.contextType,z=Hr,typeof J=="object"&&J!==null&&(z=ln(J)),j=l.getDerivedStateFromProps,(J=typeof j=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(w!==ce||te!==z)&&Ty(i,v,u,z),Si=!1,te=i.memoizedState,v.state=te,to(i,u,v,h),eo();var ne=i.memoizedState;w!==ce||te!==ne||Si||n!==null&&n.dependencies!==null&&Ts(n.dependencies)?(typeof j=="function"&&($d(i,l,j,u),ne=i.memoizedState),(re=Si||jy(i,l,re,u,te,ne,z)||n!==null&&n.dependencies!==null&&Ts(n.dependencies))?(J||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(u,ne,z),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(u,ne,z)),typeof v.componentDidUpdate=="function"&&(i.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof v.componentDidUpdate!="function"||w===n.memoizedProps&&te===n.memoizedState||(i.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||w===n.memoizedProps&&te===n.memoizedState||(i.flags|=1024),i.memoizedProps=u,i.memoizedState=ne),v.props=u,v.state=ne,v.context=z,u=re):(typeof v.componentDidUpdate!="function"||w===n.memoizedProps&&te===n.memoizedState||(i.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||w===n.memoizedProps&&te===n.memoizedState||(i.flags|=1024),u=!1)}return v=u,Ws(n,i),u=(i.flags&128)!==0,v||u?(v=i.stateNode,l=u&&typeof l.getDerivedStateFromError!="function"?null:v.render(),i.flags|=1,n!==null&&u?(i.child=dr(i,n.child,null,h),i.child=dr(i,null,l,h)):on(n,i,l,h),i.memoizedState=v.state,n=i.child):n=Za(n,i,h),n}function qy(n,i,l,u){return rr(),i.flags|=256,on(n,i,l,u),i.child}var Wd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Yd(n){return{baseLanes:n,cachePool:Og()}}function Kd(n,i,l){return n=n!==null?n.childLanes&~l:0,i&&(n|=Bn),n}function Fy(n,i,l){var u=i.pendingProps,h=!1,v=(i.flags&128)!==0,w;if((w=v)||(w=n!==null&&n.memoizedState===null?!1:(Dt.current&2)!==0),w&&(h=!0,i.flags&=-129),w=(i.flags&32)!==0,i.flags&=-33,n===null){if(Ye){if(h?Ei(i):Ai(),(n=St)?(n=Zv(n,aa),n=n!==null&&n.data!=="&"?n:null,n!==null&&(i.memoizedState={dehydrated:n,treeContext:vi!==null?{id:Ca,overflow:Ea}:null,retryLane:536870912,hydrationErrors:null},l=kg(n),l.return=i,i.child=l,rn=i,St=null)):n=null,n===null)throw xi(i);return Of(n)?i.lanes=32:i.lanes=536870912,null}var j=u.children;return u=u.fallback,h?(Ai(),h=i.mode,j=Ys({mode:"hidden",children:j},h),u=ir(u,h,l,null),j.return=i,u.return=i,j.sibling=u,i.child=j,u=i.child,u.memoizedState=Yd(l),u.childLanes=Kd(n,w,l),i.memoizedState=Wd,lo(null,u)):(Ei(i),Qd(i,j))}var z=n.memoizedState;if(z!==null&&(j=z.dehydrated,j!==null)){if(v)i.flags&256?(Ei(i),i.flags&=-257,i=Xd(n,i,l)):i.memoizedState!==null?(Ai(),i.child=n.child,i.flags|=128,i=null):(Ai(),j=u.fallback,h=i.mode,u=Ys({mode:"visible",children:u.children},h),j=ir(j,h,l,null),j.flags|=2,u.return=i,j.return=i,u.sibling=j,i.child=u,dr(i,n.child,null,l),u=i.child,u.memoizedState=Yd(l),u.childLanes=Kd(n,w,l),i.memoizedState=Wd,i=lo(null,u));else if(Ei(i),Of(j)){if(w=j.nextSibling&&j.nextSibling.dataset,w)var J=w.dgst;w=J,u=Error(r(419)),u.stack="",u.digest=w,Yl({value:u,source:null,stack:null}),i=Xd(n,i,l)}else if($t||Gr(n,i,l,!1),w=(l&n.childLanes)!==0,$t||w){if(w=mt,w!==null&&(u=ve(w,l),u!==0&&u!==z.retryLane))throw z.retryLane=u,ar(n,u),Rn(w,n,u),Gd;_f(j)||ac(),i=Xd(n,i,l)}else _f(j)?(i.flags|=192,i.child=n.child,i=null):(n=z.treeContext,St=ra(j.nextSibling),rn=i,Ye=!0,bi=null,aa=!1,n!==null&&Ag(i,n),i=Qd(i,u.children),i.flags|=4096);return i}return h?(Ai(),j=u.fallback,h=i.mode,z=n.child,J=z.sibling,u=Va(z,{mode:"hidden",children:u.children}),u.subtreeFlags=z.subtreeFlags&65011712,J!==null?j=Va(J,j):(j=ir(j,h,l,null),j.flags|=2),j.return=i,u.return=i,u.sibling=j,i.child=u,lo(null,u),u=i.child,j=n.child.memoizedState,j===null?j=Yd(l):(h=j.cachePool,h!==null?(z=Ut._currentValue,h=h.parent!==z?{parent:z,pool:z}:h):h=Og(),j={baseLanes:j.baseLanes|l,cachePool:h}),u.memoizedState=j,u.childLanes=Kd(n,w,l),i.memoizedState=Wd,lo(n.child,u)):(Ei(i),l=n.child,n=l.sibling,l=Va(l,{mode:"visible",children:u.children}),l.return=i,l.sibling=null,n!==null&&(w=i.deletions,w===null?(i.deletions=[n],i.flags|=16):w.push(n)),i.child=l,i.memoizedState=null,l)}function Qd(n,i){return i=Ys({mode:"visible",children:i},n.mode),i.return=n,n.child=i}function Ys(n,i){return n=Ln(22,n,null,i),n.lanes=0,n}function Xd(n,i,l){return dr(i,n.child,null,l),n=Qd(i,i.pendingProps.children),n.flags|=2,i.memoizedState=null,n}function Gy(n,i,l){n.lanes|=i;var u=n.alternate;u!==null&&(u.lanes|=i),fd(n.return,i,l)}function Zd(n,i,l,u,h,v){var w=n.memoizedState;w===null?n.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:u,tail:l,tailMode:h,treeForkCount:v}:(w.isBackwards=i,w.rendering=null,w.renderingStartTime=0,w.last=u,w.tail=l,w.tailMode=h,w.treeForkCount=v)}function Vy(n,i,l){var u=i.pendingProps,h=u.revealOrder,v=u.tail;u=u.children;var w=Dt.current,j=(w&2)!==0;if(j?(w=w&1|2,i.flags|=128):w&=1,N(Dt,w),on(n,i,u,l),u=Ye?Wl:0,!j&&n!==null&&(n.flags&128)!==0)e:for(n=i.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&Gy(n,l,i);else if(n.tag===19)Gy(n,l,i);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===i)break e;for(;n.sibling===null;){if(n.return===null||n.return===i)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}switch(h){case"forwards":for(l=i.child,h=null;l!==null;)n=l.alternate,n!==null&&zs(n)===null&&(h=l),l=l.sibling;l=h,l===null?(h=i.child,i.child=null):(h=l.sibling,l.sibling=null),Zd(i,!1,h,l,v,u);break;case"backwards":case"unstable_legacy-backwards":for(l=null,h=i.child,i.child=null;h!==null;){if(n=h.alternate,n!==null&&zs(n)===null){i.child=h;break}n=h.sibling,h.sibling=l,l=h,h=n}Zd(i,!0,l,null,v,u);break;case"together":Zd(i,!1,null,null,void 0,u);break;default:i.memoizedState=null}return i.child}function Za(n,i,l){if(n!==null&&(i.dependencies=n.dependencies),Ri|=i.lanes,(l&i.childLanes)===0)if(n!==null){if(Gr(n,i,l,!1),(l&i.childLanes)===0)return null}else return null;if(n!==null&&i.child!==n.child)throw Error(r(153));if(i.child!==null){for(n=i.child,l=Va(n,n.pendingProps),i.child=l,l.return=i;n.sibling!==null;)n=n.sibling,l=l.sibling=Va(n,n.pendingProps),l.return=i;l.sibling=null}return i.child}function Jd(n,i){return(n.lanes&i)!==0?!0:(n=n.dependencies,!!(n!==null&&Ts(n)))}function P2(n,i,l){switch(i.tag){case 3:Ue(i,i.stateNode.containerInfo),wi(i,Ut,n.memoizedState.cache),rr();break;case 27:case 5:tt(i);break;case 4:Ue(i,i.stateNode.containerInfo);break;case 10:wi(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,Cd(i),null;break;case 13:var u=i.memoizedState;if(u!==null)return u.dehydrated!==null?(Ei(i),i.flags|=128,null):(l&i.child.childLanes)!==0?Fy(n,i,l):(Ei(i),n=Za(n,i,l),n!==null?n.sibling:null);Ei(i);break;case 19:var h=(n.flags&128)!==0;if(u=(l&i.childLanes)!==0,u||(Gr(n,i,l,!1),u=(l&i.childLanes)!==0),h){if(u)return Vy(n,i,l);i.flags|=128}if(h=i.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),N(Dt,Dt.current),u)break;return null;case 22:return i.lanes=0,Py(n,i,l,i.pendingProps);case 24:wi(i,Ut,n.memoizedState.cache)}return Za(n,i,l)}function Wy(n,i,l){if(n!==null)if(n.memoizedProps!==i.pendingProps)$t=!0;else{if(!Jd(n,l)&&(i.flags&128)===0)return $t=!1,P2(n,i,l);$t=(n.flags&131072)!==0}else $t=!1,Ye&&(i.flags&1048576)!==0&&Eg(i,Wl,i.index);switch(i.lanes=0,i.tag){case 16:e:{var u=i.pendingProps;if(n=cr(i.elementType),i.type=n,typeof n=="function")id(n)?(u=pr(n,u),i.tag=1,i=$y(null,i,n,u,l)):(i.tag=0,i=Vd(null,i,n,u,l));else{if(n!=null){var h=n.$$typeof;if(h===U){i.tag=11,i=Ly(null,i,n,u,l);break e}else if(h===P){i.tag=14,i=zy(null,i,n,u,l);break e}}throw i=q(n)||n,Error(r(306,i,""))}}return i;case 0:return Vd(n,i,i.type,i.pendingProps,l);case 1:return u=i.type,h=pr(u,i.pendingProps),$y(n,i,u,h,l);case 3:e:{if(Ue(i,i.stateNode.containerInfo),n===null)throw Error(r(387));u=i.pendingProps;var v=i.memoizedState;h=v.element,bd(n,i),to(i,u,null,l);var w=i.memoizedState;if(u=w.cache,wi(i,Ut,u),u!==v.cache&&pd(i,[Ut],l,!0),eo(),u=w.element,v.isDehydrated)if(v={element:u,isDehydrated:!1,cache:w.cache},i.updateQueue.baseState=v,i.memoizedState=v,i.flags&256){i=qy(n,i,u,l);break e}else if(u!==h){h=ea(Error(r(424)),i),Yl(h),i=qy(n,i,u,l);break e}else{switch(n=i.stateNode.containerInfo,n.nodeType){case 9:n=n.body;break;default:n=n.nodeName==="HTML"?n.ownerDocument.body:n}for(St=ra(n.firstChild),rn=i,Ye=!0,bi=null,aa=!0,l=Pg(i,null,u,l),i.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(rr(),u===h){i=Za(n,i,l);break e}on(n,i,u,l)}i=i.child}return i;case 26:return Ws(n,i),n===null?(l=i0(i.type,null,i.pendingProps,null))?i.memoizedState=l:Ye||(l=i.type,n=i.pendingProps,u=uc(me.current).createElement(l),u[we]=i,u[_e]=n,sn(u,l,n),Tt(u),i.stateNode=u):i.memoizedState=i0(i.type,n.memoizedProps,i.pendingProps,n.memoizedState),null;case 27:return tt(i),n===null&&Ye&&(u=i.stateNode=t0(i.type,i.pendingProps,me.current),rn=i,aa=!0,h=St,Di(i.type)?(Mf=h,St=ra(u.firstChild)):St=h),on(n,i,i.pendingProps.children,l),Ws(n,i),n===null&&(i.flags|=4194304),i.child;case 5:return n===null&&Ye&&((h=u=St)&&(u=hC(u,i.type,i.pendingProps,aa),u!==null?(i.stateNode=u,rn=i,St=ra(u.firstChild),aa=!1,h=!0):h=!1),h||xi(i)),tt(i),h=i.type,v=i.pendingProps,w=n!==null?n.memoizedProps:null,u=v.children,Tf(h,v)?u=null:w!==null&&Tf(h,w)&&(i.flags|=32),i.memoizedState!==null&&(h=Ad(n,i,R2,null,null,l),So._currentValue=h),Ws(n,i),on(n,i,u,l),i.child;case 6:return n===null&&Ye&&((n=l=St)&&(l=mC(l,i.pendingProps,aa),l!==null?(i.stateNode=l,rn=i,St=null,n=!0):n=!1),n||xi(i)),null;case 13:return Fy(n,i,l);case 4:return Ue(i,i.stateNode.containerInfo),u=i.pendingProps,n===null?i.child=dr(i,null,u,l):on(n,i,u,l),i.child;case 11:return Ly(n,i,i.type,i.pendingProps,l);case 7:return on(n,i,i.pendingProps,l),i.child;case 8:return on(n,i,i.pendingProps.children,l),i.child;case 12:return on(n,i,i.pendingProps.children,l),i.child;case 10:return u=i.pendingProps,wi(i,i.type,u.value),on(n,i,u.children,l),i.child;case 9:return h=i.type._context,u=i.pendingProps.children,or(i),h=ln(h),u=u(h),i.flags|=1,on(n,i,u,l),i.child;case 14:return zy(n,i,i.type,i.pendingProps,l);case 15:return Iy(n,i,i.type,i.pendingProps,l);case 19:return Vy(n,i,l);case 31:return I2(n,i,l);case 22:return Py(n,i,l,i.pendingProps);case 24:return or(i),u=ln(Ut),n===null?(h=gd(),h===null&&(h=mt,v=hd(),h.pooledCache=v,v.refCount++,v!==null&&(h.pooledCacheLanes|=l),h=v),i.memoizedState={parent:u,cache:h},vd(i),wi(i,Ut,h)):((n.lanes&l)!==0&&(bd(n,i),to(i,null,null,l),eo()),h=n.memoizedState,v=i.memoizedState,h.parent!==u?(h={parent:u,cache:u},i.memoizedState=h,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=h),wi(i,Ut,u)):(u=v.cache,wi(i,Ut,u),u!==h.cache&&pd(i,[Ut],l,!0))),on(n,i,i.pendingProps.children,l),i.child;case 29:throw i.pendingProps}throw Error(r(156,i.tag))}function Ja(n){n.flags|=4}function ef(n,i,l,u,h){if((i=(n.mode&32)!==0)&&(i=!1),i){if(n.flags|=16777216,(h&335544128)===h)if(n.stateNode.complete)n.flags|=8192;else if(xv())n.flags|=8192;else throw ur=Os,yd}else n.flags&=-16777217}function Yy(n,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!c0(i))if(xv())n.flags|=8192;else throw ur=Os,yd}function Ks(n,i){i!==null&&(n.flags|=4),n.flags&16384&&(i=n.tag!==22?us():536870912,n.lanes|=i,al|=i)}function oo(n,i){if(!Ye)switch(n.tailMode){case"hidden":i=n.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?n.tail=null:l.sibling=null;break;case"collapsed":l=n.tail;for(var u=null;l!==null;)l.alternate!==null&&(u=l),l=l.sibling;u===null?i||n.tail===null?n.tail=null:n.tail.sibling=null:u.sibling=null}}function kt(n){var i=n.alternate!==null&&n.alternate.child===n.child,l=0,u=0;if(i)for(var h=n.child;h!==null;)l|=h.lanes|h.childLanes,u|=h.subtreeFlags&65011712,u|=h.flags&65011712,h.return=n,h=h.sibling;else for(h=n.child;h!==null;)l|=h.lanes|h.childLanes,u|=h.subtreeFlags,u|=h.flags,h.return=n,h=h.sibling;return n.subtreeFlags|=u,n.childLanes=l,i}function B2(n,i,l){var u=i.pendingProps;switch(sd(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return kt(i),null;case 1:return kt(i),null;case 3:return l=i.stateNode,u=null,n!==null&&(u=n.memoizedState.cache),i.memoizedState.cache!==u&&(i.flags|=2048),Ka(Ut),Re(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(n===null||n.child===null)&&(Fr(i)?Ja(i):n===null||n.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,ud())),kt(i),null;case 26:var h=i.type,v=i.memoizedState;return n===null?(Ja(i),v!==null?(kt(i),Yy(i,v)):(kt(i),ef(i,h,null,u,l))):v?v!==n.memoizedState?(Ja(i),kt(i),Yy(i,v)):(kt(i),i.flags&=-16777217):(n=n.memoizedProps,n!==u&&Ja(i),kt(i),ef(i,h,n,u,l)),null;case 27:if(It(i),l=me.current,h=i.type,n!==null&&i.stateNode!=null)n.memoizedProps!==u&&Ja(i);else{if(!u){if(i.stateNode===null)throw Error(r(166));return kt(i),null}n=ue.current,Fr(i)?jg(i):(n=t0(h,u,l),i.stateNode=n,Ja(i))}return kt(i),null;case 5:if(It(i),h=i.type,n!==null&&i.stateNode!=null)n.memoizedProps!==u&&Ja(i);else{if(!u){if(i.stateNode===null)throw Error(r(166));return kt(i),null}if(v=ue.current,Fr(i))jg(i);else{var w=uc(me.current);switch(v){case 1:v=w.createElementNS("http://www.w3.org/2000/svg",h);break;case 2:v=w.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;default:switch(h){case"svg":v=w.createElementNS("http://www.w3.org/2000/svg",h);break;case"math":v=w.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;case"script":v=w.createElement("div"),v.innerHTML="<script><\/script>",v=v.removeChild(v.firstChild);break;case"select":v=typeof u.is=="string"?w.createElement("select",{is:u.is}):w.createElement("select"),u.multiple?v.multiple=!0:u.size&&(v.size=u.size);break;default:v=typeof u.is=="string"?w.createElement(h,{is:u.is}):w.createElement(h)}}v[we]=i,v[_e]=u;e:for(w=i.child;w!==null;){if(w.tag===5||w.tag===6)v.appendChild(w.stateNode);else if(w.tag!==4&&w.tag!==27&&w.child!==null){w.child.return=w,w=w.child;continue}if(w===i)break e;for(;w.sibling===null;){if(w.return===null||w.return===i)break e;w=w.return}w.sibling.return=w.return,w=w.sibling}i.stateNode=v;e:switch(sn(v,h,u),h){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}u&&Ja(i)}}return kt(i),ef(i,i.type,n===null?null:n.memoizedProps,i.pendingProps,l),null;case 6:if(n&&i.stateNode!=null)n.memoizedProps!==u&&Ja(i);else{if(typeof u!="string"&&i.stateNode===null)throw Error(r(166));if(n=me.current,Fr(i)){if(n=i.stateNode,l=i.memoizedProps,u=null,h=rn,h!==null)switch(h.tag){case 27:case 5:u=h.memoizedProps}n[we]=i,n=!!(n.nodeValue===l||u!==null&&u.suppressHydrationWarning===!0||Fv(n.nodeValue,l)),n||xi(i,!0)}else n=uc(n).createTextNode(u),n[we]=i,i.stateNode=n}return kt(i),null;case 31:if(l=i.memoizedState,n===null||n.memoizedState!==null){if(u=Fr(i),l!==null){if(n===null){if(!u)throw Error(r(318));if(n=i.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(r(557));n[we]=i}else rr(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;kt(i),n=!1}else l=ud(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=l),n=!0;if(!n)return i.flags&256?(In(i),i):(In(i),null);if((i.flags&128)!==0)throw Error(r(558))}return kt(i),null;case 13:if(u=i.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(h=Fr(i),u!==null&&u.dehydrated!==null){if(n===null){if(!h)throw Error(r(318));if(h=i.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(r(317));h[we]=i}else rr(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;kt(i),h=!1}else h=ud(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=h),h=!0;if(!h)return i.flags&256?(In(i),i):(In(i),null)}return In(i),(i.flags&128)!==0?(i.lanes=l,i):(l=u!==null,n=n!==null&&n.memoizedState!==null,l&&(u=i.child,h=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(h=u.alternate.memoizedState.cachePool.pool),v=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(v=u.memoizedState.cachePool.pool),v!==h&&(u.flags|=2048)),l!==n&&l&&(i.child.flags|=8192),Ks(i,i.updateQueue),kt(i),null);case 4:return Re(),n===null&&kf(i.stateNode.containerInfo),kt(i),null;case 10:return Ka(i.type),kt(i),null;case 19:if(K(Dt),u=i.memoizedState,u===null)return kt(i),null;if(h=(i.flags&128)!==0,v=u.rendering,v===null)if(h)oo(u,!1);else{if(_t!==0||n!==null&&(n.flags&128)!==0)for(n=i.child;n!==null;){if(v=zs(n),v!==null){for(i.flags|=128,oo(u,!1),n=v.updateQueue,i.updateQueue=n,Ks(i,n),i.subtreeFlags=0,n=l,l=i.child;l!==null;)Sg(l,n),l=l.sibling;return N(Dt,Dt.current&1|2),Ye&&Wa(i,u.treeForkCount),i.child}n=n.sibling}u.tail!==null&&rt()>ec&&(i.flags|=128,h=!0,oo(u,!1),i.lanes=4194304)}else{if(!h)if(n=zs(v),n!==null){if(i.flags|=128,h=!0,n=n.updateQueue,i.updateQueue=n,Ks(i,n),oo(u,!0),u.tail===null&&u.tailMode==="hidden"&&!v.alternate&&!Ye)return kt(i),null}else 2*rt()-u.renderingStartTime>ec&&l!==536870912&&(i.flags|=128,h=!0,oo(u,!1),i.lanes=4194304);u.isBackwards?(v.sibling=i.child,i.child=v):(n=u.last,n!==null?n.sibling=v:i.child=v,u.last=v)}return u.tail!==null?(n=u.tail,u.rendering=n,u.tail=n.sibling,u.renderingStartTime=rt(),n.sibling=null,l=Dt.current,N(Dt,h?l&1|2:l&1),Ye&&Wa(i,u.treeForkCount),n):(kt(i),null);case 22:case 23:return In(i),kd(),u=i.memoizedState!==null,n!==null?n.memoizedState!==null!==u&&(i.flags|=8192):u&&(i.flags|=8192),u?(l&536870912)!==0&&(i.flags&128)===0&&(kt(i),i.subtreeFlags&6&&(i.flags|=8192)):kt(i),l=i.updateQueue,l!==null&&Ks(i,l.retryQueue),l=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(l=n.memoizedState.cachePool.pool),u=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(u=i.memoizedState.cachePool.pool),u!==l&&(i.flags|=2048),n!==null&&K(sr),null;case 24:return l=null,n!==null&&(l=n.memoizedState.cache),i.memoizedState.cache!==l&&(i.flags|=2048),Ka(Ut),kt(i),null;case 25:return null;case 30:return null}throw Error(r(156,i.tag))}function U2(n,i){switch(sd(i),i.tag){case 1:return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 3:return Ka(Ut),Re(),n=i.flags,(n&65536)!==0&&(n&128)===0?(i.flags=n&-65537|128,i):null;case 26:case 27:case 5:return It(i),null;case 31:if(i.memoizedState!==null){if(In(i),i.alternate===null)throw Error(r(340));rr()}return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 13:if(In(i),n=i.memoizedState,n!==null&&n.dehydrated!==null){if(i.alternate===null)throw Error(r(340));rr()}return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 19:return K(Dt),null;case 4:return Re(),null;case 10:return Ka(i.type),null;case 22:case 23:return In(i),kd(),n!==null&&K(sr),n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 24:return Ka(Ut),null;case 25:return null;default:return null}}function Ky(n,i){switch(sd(i),i.tag){case 3:Ka(Ut),Re();break;case 26:case 27:case 5:It(i);break;case 4:Re();break;case 31:i.memoizedState!==null&&In(i);break;case 13:In(i);break;case 19:K(Dt);break;case 10:Ka(i.type);break;case 22:case 23:In(i),kd(),n!==null&&K(sr);break;case 24:Ka(Ut)}}function so(n,i){try{var l=i.updateQueue,u=l!==null?l.lastEffect:null;if(u!==null){var h=u.next;l=h;do{if((l.tag&n)===n){u=void 0;var v=l.create,w=l.inst;u=v(),w.destroy=u}l=l.next}while(l!==h)}}catch(j){ct(i,i.return,j)}}function ji(n,i,l){try{var u=i.updateQueue,h=u!==null?u.lastEffect:null;if(h!==null){var v=h.next;u=v;do{if((u.tag&n)===n){var w=u.inst,j=w.destroy;if(j!==void 0){w.destroy=void 0,h=i;var z=l,J=j;try{J()}catch(re){ct(h,z,re)}}}u=u.next}while(u!==v)}}catch(re){ct(i,i.return,re)}}function Qy(n){var i=n.updateQueue;if(i!==null){var l=n.stateNode;try{Ug(i,l)}catch(u){ct(n,n.return,u)}}}function Xy(n,i,l){l.props=pr(n.type,n.memoizedProps),l.state=n.memoizedState;try{l.componentWillUnmount()}catch(u){ct(n,i,u)}}function co(n,i){try{var l=n.ref;if(l!==null){switch(n.tag){case 26:case 27:case 5:var u=n.stateNode;break;case 30:u=n.stateNode;break;default:u=n.stateNode}typeof l=="function"?n.refCleanup=l(u):l.current=u}}catch(h){ct(n,i,h)}}function Aa(n,i){var l=n.ref,u=n.refCleanup;if(l!==null)if(typeof u=="function")try{u()}catch(h){ct(n,i,h)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(h){ct(n,i,h)}else l.current=null}function Zy(n){var i=n.type,l=n.memoizedProps,u=n.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":l.autoFocus&&u.focus();break e;case"img":l.src?u.src=l.src:l.srcSet&&(u.srcset=l.srcSet)}}catch(h){ct(n,n.return,h)}}function tf(n,i,l){try{var u=n.stateNode;sC(u,n.type,l,i),u[_e]=i}catch(h){ct(n,n.return,h)}}function Jy(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&Di(n.type)||n.tag===4}function nf(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||Jy(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.tag===27&&Di(n.type)||n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function af(n,i,l){var u=n.tag;if(u===5||u===6)n=n.stateNode,i?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(n,i):(i=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,i.appendChild(n),l=l._reactRootContainer,l!=null||i.onclick!==null||(i.onclick=Fa));else if(u!==4&&(u===27&&Di(n.type)&&(l=n.stateNode,i=null),n=n.child,n!==null))for(af(n,i,l),n=n.sibling;n!==null;)af(n,i,l),n=n.sibling}function Qs(n,i,l){var u=n.tag;if(u===5||u===6)n=n.stateNode,i?l.insertBefore(n,i):l.appendChild(n);else if(u!==4&&(u===27&&Di(n.type)&&(l=n.stateNode),n=n.child,n!==null))for(Qs(n,i,l),n=n.sibling;n!==null;)Qs(n,i,l),n=n.sibling}function ev(n){var i=n.stateNode,l=n.memoizedProps;try{for(var u=n.type,h=i.attributes;h.length;)i.removeAttributeNode(h[0]);sn(i,u,l),i[we]=n,i[_e]=l}catch(v){ct(n,n.return,v)}}var ei=!1,qt=!1,rf=!1,tv=typeof WeakSet=="function"?WeakSet:Set,en=null;function H2(n,i){if(n=n.containerInfo,Af=yc,n=pg(n),Xu(n)){if("selectionStart"in n)var l={start:n.selectionStart,end:n.selectionEnd};else e:{l=(l=n.ownerDocument)&&l.defaultView||window;var u=l.getSelection&&l.getSelection();if(u&&u.rangeCount!==0){l=u.anchorNode;var h=u.anchorOffset,v=u.focusNode;u=u.focusOffset;try{l.nodeType,v.nodeType}catch{l=null;break e}var w=0,j=-1,z=-1,J=0,re=0,ce=n,te=null;t:for(;;){for(var ne;ce!==l||h!==0&&ce.nodeType!==3||(j=w+h),ce!==v||u!==0&&ce.nodeType!==3||(z=w+u),ce.nodeType===3&&(w+=ce.nodeValue.length),(ne=ce.firstChild)!==null;)te=ce,ce=ne;for(;;){if(ce===n)break t;if(te===l&&++J===h&&(j=w),te===v&&++re===u&&(z=w),(ne=ce.nextSibling)!==null)break;ce=te,te=ce.parentNode}ce=ne}l=j===-1||z===-1?null:{start:j,end:z}}else l=null}l=l||{start:0,end:0}}else l=null;for(jf={focusedElem:n,selectionRange:l},yc=!1,en=i;en!==null;)if(i=en,n=i.child,(i.subtreeFlags&1028)!==0&&n!==null)n.return=i,en=n;else for(;en!==null;){switch(i=en,v=i.alternate,n=i.flags,i.tag){case 0:if((n&4)!==0&&(n=i.updateQueue,n=n!==null?n.events:null,n!==null))for(l=0;l<n.length;l++)h=n[l],h.ref.impl=h.nextImpl;break;case 11:case 15:break;case 1:if((n&1024)!==0&&v!==null){n=void 0,l=i,h=v.memoizedProps,v=v.memoizedState,u=l.stateNode;try{var be=pr(l.type,h);n=u.getSnapshotBeforeUpdate(be,v),u.__reactInternalSnapshotBeforeUpdate=n}catch(je){ct(l,l.return,je)}}break;case 3:if((n&1024)!==0){if(n=i.stateNode.containerInfo,l=n.nodeType,l===9)Nf(n);else if(l===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":Nf(n);break;default:n.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((n&1024)!==0)throw Error(r(163))}if(n=i.sibling,n!==null){n.return=i.return,en=n;break}en=i.return}}function nv(n,i,l){var u=l.flags;switch(l.tag){case 0:case 11:case 15:ni(n,l),u&4&&so(5,l);break;case 1:if(ni(n,l),u&4)if(n=l.stateNode,i===null)try{n.componentDidMount()}catch(w){ct(l,l.return,w)}else{var h=pr(l.type,i.memoizedProps);i=i.memoizedState;try{n.componentDidUpdate(h,i,n.__reactInternalSnapshotBeforeUpdate)}catch(w){ct(l,l.return,w)}}u&64&&Qy(l),u&512&&co(l,l.return);break;case 3:if(ni(n,l),u&64&&(n=l.updateQueue,n!==null)){if(i=null,l.child!==null)switch(l.child.tag){case 27:case 5:i=l.child.stateNode;break;case 1:i=l.child.stateNode}try{Ug(n,i)}catch(w){ct(l,l.return,w)}}break;case 27:i===null&&u&4&&ev(l);case 26:case 5:ni(n,l),i===null&&u&4&&Zy(l),u&512&&co(l,l.return);break;case 12:ni(n,l);break;case 31:ni(n,l),u&4&&rv(n,l);break;case 13:ni(n,l),u&4&&lv(n,l),u&64&&(n=l.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(l=Q2.bind(null,l),gC(n,l))));break;case 22:if(u=l.memoizedState!==null||ei,!u){i=i!==null&&i.memoizedState!==null||qt,h=ei;var v=qt;ei=u,(qt=i)&&!v?ai(n,l,(l.subtreeFlags&8772)!==0):ni(n,l),ei=h,qt=v}break;case 30:break;default:ni(n,l)}}function av(n){var i=n.alternate;i!==null&&(n.alternate=null,av(i)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(i=n.stateNode,i!==null&&Or(i)),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}var Et=null,En=!1;function ti(n,i,l){for(l=l.child;l!==null;)iv(n,i,l),l=l.sibling}function iv(n,i,l){if(Xe&&typeof Xe.onCommitFiberUnmount=="function")try{Xe.onCommitFiberUnmount(Pe,l)}catch{}switch(l.tag){case 26:qt||Aa(l,i),ti(n,i,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:qt||Aa(l,i);var u=Et,h=En;Di(l.type)&&(Et=l.stateNode,En=!1),ti(n,i,l),bo(l.stateNode),Et=u,En=h;break;case 5:qt||Aa(l,i);case 6:if(u=Et,h=En,Et=null,ti(n,i,l),Et=u,En=h,Et!==null)if(En)try{(Et.nodeType===9?Et.body:Et.nodeName==="HTML"?Et.ownerDocument.body:Et).removeChild(l.stateNode)}catch(v){ct(l,i,v)}else try{Et.removeChild(l.stateNode)}catch(v){ct(l,i,v)}break;case 18:Et!==null&&(En?(n=Et,Qv(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,l.stateNode),dl(n)):Qv(Et,l.stateNode));break;case 4:u=Et,h=En,Et=l.stateNode.containerInfo,En=!0,ti(n,i,l),Et=u,En=h;break;case 0:case 11:case 14:case 15:ji(2,l,i),qt||ji(4,l,i),ti(n,i,l);break;case 1:qt||(Aa(l,i),u=l.stateNode,typeof u.componentWillUnmount=="function"&&Xy(l,i,u)),ti(n,i,l);break;case 21:ti(n,i,l);break;case 22:qt=(u=qt)||l.memoizedState!==null,ti(n,i,l),qt=u;break;default:ti(n,i,l)}}function rv(n,i){if(i.memoizedState===null&&(n=i.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{dl(n)}catch(l){ct(i,i.return,l)}}}function lv(n,i){if(i.memoizedState===null&&(n=i.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{dl(n)}catch(l){ct(i,i.return,l)}}function $2(n){switch(n.tag){case 31:case 13:case 19:var i=n.stateNode;return i===null&&(i=n.stateNode=new tv),i;case 22:return n=n.stateNode,i=n._retryCache,i===null&&(i=n._retryCache=new tv),i;default:throw Error(r(435,n.tag))}}function Xs(n,i){var l=$2(n);i.forEach(function(u){if(!l.has(u)){l.add(u);var h=X2.bind(null,n,u);u.then(h,h)}})}function An(n,i){var l=i.deletions;if(l!==null)for(var u=0;u<l.length;u++){var h=l[u],v=n,w=i,j=w;e:for(;j!==null;){switch(j.tag){case 27:if(Di(j.type)){Et=j.stateNode,En=!1;break e}break;case 5:Et=j.stateNode,En=!1;break e;case 3:case 4:Et=j.stateNode.containerInfo,En=!0;break e}j=j.return}if(Et===null)throw Error(r(160));iv(v,w,h),Et=null,En=!1,v=h.alternate,v!==null&&(v.return=null),h.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)ov(i,n),i=i.sibling}var pa=null;function ov(n,i){var l=n.alternate,u=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:An(i,n),jn(n),u&4&&(ji(3,n,n.return),so(3,n),ji(5,n,n.return));break;case 1:An(i,n),jn(n),u&512&&(qt||l===null||Aa(l,l.return)),u&64&&ei&&(n=n.updateQueue,n!==null&&(u=n.callbacks,u!==null&&(l=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=l===null?u:l.concat(u))));break;case 26:var h=pa;if(An(i,n),jn(n),u&512&&(qt||l===null||Aa(l,l.return)),u&4){var v=l!==null?l.memoizedState:null;if(u=n.memoizedState,l===null)if(u===null)if(n.stateNode===null){e:{u=n.type,l=n.memoizedProps,h=h.ownerDocument||h;t:switch(u){case"title":v=h.getElementsByTagName("title")[0],(!v||v[Sa]||v[we]||v.namespaceURI==="http://www.w3.org/2000/svg"||v.hasAttribute("itemprop"))&&(v=h.createElement(u),h.head.insertBefore(v,h.querySelector("head > title"))),sn(v,u,l),v[we]=n,Tt(v),u=v;break e;case"link":var w=o0("link","href",h).get(u+(l.href||""));if(w){for(var j=0;j<w.length;j++)if(v=w[j],v.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&v.getAttribute("rel")===(l.rel==null?null:l.rel)&&v.getAttribute("title")===(l.title==null?null:l.title)&&v.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){w.splice(j,1);break t}}v=h.createElement(u),sn(v,u,l),h.head.appendChild(v);break;case"meta":if(w=o0("meta","content",h).get(u+(l.content||""))){for(j=0;j<w.length;j++)if(v=w[j],v.getAttribute("content")===(l.content==null?null:""+l.content)&&v.getAttribute("name")===(l.name==null?null:l.name)&&v.getAttribute("property")===(l.property==null?null:l.property)&&v.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&v.getAttribute("charset")===(l.charSet==null?null:l.charSet)){w.splice(j,1);break t}}v=h.createElement(u),sn(v,u,l),h.head.appendChild(v);break;default:throw Error(r(468,u))}v[we]=n,Tt(v),u=v}n.stateNode=u}else s0(h,n.type,n.stateNode);else n.stateNode=l0(h,u,n.memoizedProps);else v!==u?(v===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):v.count--,u===null?s0(h,n.type,n.stateNode):l0(h,u,n.memoizedProps)):u===null&&n.stateNode!==null&&tf(n,n.memoizedProps,l.memoizedProps)}break;case 27:An(i,n),jn(n),u&512&&(qt||l===null||Aa(l,l.return)),l!==null&&u&4&&tf(n,n.memoizedProps,l.memoizedProps);break;case 5:if(An(i,n),jn(n),u&512&&(qt||l===null||Aa(l,l.return)),n.flags&32){h=n.stateNode;try{Dr(h,"")}catch(be){ct(n,n.return,be)}}u&4&&n.stateNode!=null&&(h=n.memoizedProps,tf(n,h,l!==null?l.memoizedProps:h)),u&1024&&(rf=!0);break;case 6:if(An(i,n),jn(n),u&4){if(n.stateNode===null)throw Error(r(162));u=n.memoizedProps,l=n.stateNode;try{l.nodeValue=u}catch(be){ct(n,n.return,be)}}break;case 3:if(pc=null,h=pa,pa=dc(i.containerInfo),An(i,n),pa=h,jn(n),u&4&&l!==null&&l.memoizedState.isDehydrated)try{dl(i.containerInfo)}catch(be){ct(n,n.return,be)}rf&&(rf=!1,sv(n));break;case 4:u=pa,pa=dc(n.stateNode.containerInfo),An(i,n),jn(n),pa=u;break;case 12:An(i,n),jn(n);break;case 31:An(i,n),jn(n),u&4&&(u=n.updateQueue,u!==null&&(n.updateQueue=null,Xs(n,u)));break;case 13:An(i,n),jn(n),n.child.flags&8192&&n.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Js=rt()),u&4&&(u=n.updateQueue,u!==null&&(n.updateQueue=null,Xs(n,u)));break;case 22:h=n.memoizedState!==null;var z=l!==null&&l.memoizedState!==null,J=ei,re=qt;if(ei=J||h,qt=re||z,An(i,n),qt=re,ei=J,jn(n),u&8192)e:for(i=n.stateNode,i._visibility=h?i._visibility&-2:i._visibility|1,h&&(l===null||z||ei||qt||hr(n)),l=null,i=n;;){if(i.tag===5||i.tag===26){if(l===null){z=l=i;try{if(v=z.stateNode,h)w=v.style,typeof w.setProperty=="function"?w.setProperty("display","none","important"):w.display="none";else{j=z.stateNode;var ce=z.memoizedProps.style,te=ce!=null&&ce.hasOwnProperty("display")?ce.display:null;j.style.display=te==null||typeof te=="boolean"?"":(""+te).trim()}}catch(be){ct(z,z.return,be)}}}else if(i.tag===6){if(l===null){z=i;try{z.stateNode.nodeValue=h?"":z.memoizedProps}catch(be){ct(z,z.return,be)}}}else if(i.tag===18){if(l===null){z=i;try{var ne=z.stateNode;h?Xv(ne,!0):Xv(z.stateNode,!1)}catch(be){ct(z,z.return,be)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===n)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===n)break e;for(;i.sibling===null;){if(i.return===null||i.return===n)break e;l===i&&(l=null),i=i.return}l===i&&(l=null),i.sibling.return=i.return,i=i.sibling}u&4&&(u=n.updateQueue,u!==null&&(l=u.retryQueue,l!==null&&(u.retryQueue=null,Xs(n,l))));break;case 19:An(i,n),jn(n),u&4&&(u=n.updateQueue,u!==null&&(n.updateQueue=null,Xs(n,u)));break;case 30:break;case 21:break;default:An(i,n),jn(n)}}function jn(n){var i=n.flags;if(i&2){try{for(var l,u=n.return;u!==null;){if(Jy(u)){l=u;break}u=u.return}if(l==null)throw Error(r(160));switch(l.tag){case 27:var h=l.stateNode,v=nf(n);Qs(n,v,h);break;case 5:var w=l.stateNode;l.flags&32&&(Dr(w,""),l.flags&=-33);var j=nf(n);Qs(n,j,w);break;case 3:case 4:var z=l.stateNode.containerInfo,J=nf(n);af(n,J,z);break;default:throw Error(r(161))}}catch(re){ct(n,n.return,re)}n.flags&=-3}i&4096&&(n.flags&=-4097)}function sv(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var i=n;sv(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),n=n.sibling}}function ni(n,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)nv(n,i.alternate,i),i=i.sibling}function hr(n){for(n=n.child;n!==null;){var i=n;switch(i.tag){case 0:case 11:case 14:case 15:ji(4,i,i.return),hr(i);break;case 1:Aa(i,i.return);var l=i.stateNode;typeof l.componentWillUnmount=="function"&&Xy(i,i.return,l),hr(i);break;case 27:bo(i.stateNode);case 26:case 5:Aa(i,i.return),hr(i);break;case 22:i.memoizedState===null&&hr(i);break;case 30:hr(i);break;default:hr(i)}n=n.sibling}}function ai(n,i,l){for(l=l&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var u=i.alternate,h=n,v=i,w=v.flags;switch(v.tag){case 0:case 11:case 15:ai(h,v,l),so(4,v);break;case 1:if(ai(h,v,l),u=v,h=u.stateNode,typeof h.componentDidMount=="function")try{h.componentDidMount()}catch(J){ct(u,u.return,J)}if(u=v,h=u.updateQueue,h!==null){var j=u.stateNode;try{var z=h.shared.hiddenCallbacks;if(z!==null)for(h.shared.hiddenCallbacks=null,h=0;h<z.length;h++)Bg(z[h],j)}catch(J){ct(u,u.return,J)}}l&&w&64&&Qy(v),co(v,v.return);break;case 27:ev(v);case 26:case 5:ai(h,v,l),l&&u===null&&w&4&&Zy(v),co(v,v.return);break;case 12:ai(h,v,l);break;case 31:ai(h,v,l),l&&w&4&&rv(h,v);break;case 13:ai(h,v,l),l&&w&4&&lv(h,v);break;case 22:v.memoizedState===null&&ai(h,v,l),co(v,v.return);break;case 30:break;default:ai(h,v,l)}i=i.sibling}}function lf(n,i){var l=null;n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(l=n.memoizedState.cachePool.pool),n=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(n=i.memoizedState.cachePool.pool),n!==l&&(n!=null&&n.refCount++,l!=null&&Kl(l))}function of(n,i){n=null,i.alternate!==null&&(n=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==n&&(i.refCount++,n!=null&&Kl(n))}function ha(n,i,l,u){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)cv(n,i,l,u),i=i.sibling}function cv(n,i,l,u){var h=i.flags;switch(i.tag){case 0:case 11:case 15:ha(n,i,l,u),h&2048&&so(9,i);break;case 1:ha(n,i,l,u);break;case 3:ha(n,i,l,u),h&2048&&(n=null,i.alternate!==null&&(n=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==n&&(i.refCount++,n!=null&&Kl(n)));break;case 12:if(h&2048){ha(n,i,l,u),n=i.stateNode;try{var v=i.memoizedProps,w=v.id,j=v.onPostCommit;typeof j=="function"&&j(w,i.alternate===null?"mount":"update",n.passiveEffectDuration,-0)}catch(z){ct(i,i.return,z)}}else ha(n,i,l,u);break;case 31:ha(n,i,l,u);break;case 13:ha(n,i,l,u);break;case 23:break;case 22:v=i.stateNode,w=i.alternate,i.memoizedState!==null?v._visibility&2?ha(n,i,l,u):uo(n,i):v._visibility&2?ha(n,i,l,u):(v._visibility|=2,el(n,i,l,u,(i.subtreeFlags&10256)!==0||!1)),h&2048&&lf(w,i);break;case 24:ha(n,i,l,u),h&2048&&of(i.alternate,i);break;default:ha(n,i,l,u)}}function el(n,i,l,u,h){for(h=h&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var v=n,w=i,j=l,z=u,J=w.flags;switch(w.tag){case 0:case 11:case 15:el(v,w,j,z,h),so(8,w);break;case 23:break;case 22:var re=w.stateNode;w.memoizedState!==null?re._visibility&2?el(v,w,j,z,h):uo(v,w):(re._visibility|=2,el(v,w,j,z,h)),h&&J&2048&&lf(w.alternate,w);break;case 24:el(v,w,j,z,h),h&&J&2048&&of(w.alternate,w);break;default:el(v,w,j,z,h)}i=i.sibling}}function uo(n,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var l=n,u=i,h=u.flags;switch(u.tag){case 22:uo(l,u),h&2048&&lf(u.alternate,u);break;case 24:uo(l,u),h&2048&&of(u.alternate,u);break;default:uo(l,u)}i=i.sibling}}var fo=8192;function tl(n,i,l){if(n.subtreeFlags&fo)for(n=n.child;n!==null;)uv(n,i,l),n=n.sibling}function uv(n,i,l){switch(n.tag){case 26:tl(n,i,l),n.flags&fo&&n.memoizedState!==null&&TC(l,pa,n.memoizedState,n.memoizedProps);break;case 5:tl(n,i,l);break;case 3:case 4:var u=pa;pa=dc(n.stateNode.containerInfo),tl(n,i,l),pa=u;break;case 22:n.memoizedState===null&&(u=n.alternate,u!==null&&u.memoizedState!==null?(u=fo,fo=16777216,tl(n,i,l),fo=u):tl(n,i,l));break;default:tl(n,i,l)}}function dv(n){var i=n.alternate;if(i!==null&&(n=i.child,n!==null)){i.child=null;do i=n.sibling,n.sibling=null,n=i;while(n!==null)}}function po(n){var i=n.deletions;if((n.flags&16)!==0){if(i!==null)for(var l=0;l<i.length;l++){var u=i[l];en=u,pv(u,n)}dv(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)fv(n),n=n.sibling}function fv(n){switch(n.tag){case 0:case 11:case 15:po(n),n.flags&2048&&ji(9,n,n.return);break;case 3:po(n);break;case 12:po(n);break;case 22:var i=n.stateNode;n.memoizedState!==null&&i._visibility&2&&(n.return===null||n.return.tag!==13)?(i._visibility&=-3,Zs(n)):po(n);break;default:po(n)}}function Zs(n){var i=n.deletions;if((n.flags&16)!==0){if(i!==null)for(var l=0;l<i.length;l++){var u=i[l];en=u,pv(u,n)}dv(n)}for(n=n.child;n!==null;){switch(i=n,i.tag){case 0:case 11:case 15:ji(8,i,i.return),Zs(i);break;case 22:l=i.stateNode,l._visibility&2&&(l._visibility&=-3,Zs(i));break;default:Zs(i)}n=n.sibling}}function pv(n,i){for(;en!==null;){var l=en;switch(l.tag){case 0:case 11:case 15:ji(8,l,i);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var u=l.memoizedState.cachePool.pool;u!=null&&u.refCount++}break;case 24:Kl(l.memoizedState.cache)}if(u=l.child,u!==null)u.return=l,en=u;else e:for(l=n;en!==null;){u=en;var h=u.sibling,v=u.return;if(av(u),u===l){en=null;break e}if(h!==null){h.return=v,en=h;break e}en=v}}}var q2={getCacheForType:function(n){var i=ln(Ut),l=i.data.get(n);return l===void 0&&(l=n(),i.data.set(n,l)),l},cacheSignal:function(){return ln(Ut).controller.signal}},F2=typeof WeakMap=="function"?WeakMap:Map,nt=0,mt=null,$e=null,Ge=0,st=0,Pn=null,Ti=!1,nl=!1,sf=!1,ii=0,_t=0,Ri=0,mr=0,cf=0,Bn=0,al=0,ho=null,Tn=null,uf=!1,Js=0,hv=0,ec=1/0,tc=null,Ni=null,Qt=0,_i=null,il=null,ri=0,df=0,ff=null,mv=null,mo=0,pf=null;function Un(){return(nt&2)!==0&&Ge!==0?Ge&-Ge:F.T!==null?bf():Ke()}function gv(){if(Bn===0)if((Ge&536870912)===0||Ye){var n=Qi;Qi<<=1,(Qi&3932160)===0&&(Qi=262144),Bn=n}else Bn=536870912;return n=zn.current,n!==null&&(n.flags|=32),Bn}function Rn(n,i,l){(n===mt&&(st===2||st===9)||n.cancelPendingCommit!==null)&&(rl(n,0),Oi(n,Ge,Bn,!1)),Zi(n,l),((nt&2)===0||n!==mt)&&(n===mt&&((nt&2)===0&&(mr|=l),_t===4&&Oi(n,Ge,Bn,!1)),ja(n))}function yv(n,i,l){if((nt&6)!==0)throw Error(r(327));var u=!l&&(i&127)===0&&(i&n.expiredLanes)===0||Xi(n,i),h=u?W2(n,i):mf(n,i,!0),v=u;do{if(h===0){nl&&!u&&Oi(n,i,0,!1);break}else{if(l=n.current.alternate,v&&!G2(l)){h=mf(n,i,!1),v=!1;continue}if(h===2){if(v=i,n.errorRecoveryDisabledLanes&v)var w=0;else w=n.pendingLanes&-536870913,w=w!==0?w:w&536870912?536870912:0;if(w!==0){i=w;e:{var j=n;h=ho;var z=j.current.memoizedState.isDehydrated;if(z&&(rl(j,w).flags|=256),w=mf(j,w,!1),w!==2){if(sf&&!z){j.errorRecoveryDisabledLanes|=v,mr|=v,h=4;break e}v=Tn,Tn=h,v!==null&&(Tn===null?Tn=v:Tn.push.apply(Tn,v))}h=w}if(v=!1,h!==2)continue}}if(h===1){rl(n,0),Oi(n,i,0,!0);break}e:{switch(u=n,v=h,v){case 0:case 1:throw Error(r(345));case 4:if((i&4194048)!==i)break;case 6:Oi(u,i,Bn,!Ti);break e;case 2:Tn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((i&62914560)===i&&(h=Js+300-rt(),10<h)){if(Oi(u,i,Bn,!Ti),_r(u,0,!0)!==0)break e;ri=i,u.timeoutHandle=Yv(vv.bind(null,u,l,Tn,tc,uf,i,Bn,mr,al,Ti,v,"Throttled",-0,0),h);break e}vv(u,l,Tn,tc,uf,i,Bn,mr,al,Ti,v,null,-0,0)}}break}while(!0);ja(n)}function vv(n,i,l,u,h,v,w,j,z,J,re,ce,te,ne){if(n.timeoutHandle=-1,ce=i.subtreeFlags,ce&8192||(ce&16785408)===16785408){ce={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Fa},uv(i,v,ce);var be=(v&62914560)===v?Js-rt():(v&4194048)===v?hv-rt():0;if(be=RC(ce,be),be!==null){ri=v,n.cancelPendingCommit=be(Av.bind(null,n,i,v,l,u,h,w,j,z,re,ce,null,te,ne)),Oi(n,v,w,!J);return}}Av(n,i,v,l,u,h,w,j,z)}function G2(n){for(var i=n;;){var l=i.tag;if((l===0||l===11||l===15)&&i.flags&16384&&(l=i.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var u=0;u<l.length;u++){var h=l[u],v=h.getSnapshot;h=h.value;try{if(!Dn(v(),h))return!1}catch{return!1}}if(l=i.child,i.subtreeFlags&16384&&l!==null)l.return=i,i=l;else{if(i===n)break;for(;i.sibling===null;){if(i.return===null||i.return===n)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function Oi(n,i,l,u){i&=~cf,i&=~mr,n.suspendedLanes|=i,n.pingedLanes&=~i,u&&(n.warmLanes|=i),u=n.expirationTimes;for(var h=i;0<h;){var v=31-Se(h),w=1<<v;u[v]=-1,h&=~w}l!==0&&ds(n,l,i)}function nc(){return(nt&6)===0?(go(0),!1):!0}function hf(){if($e!==null){if(st===0)var n=$e.return;else n=$e,Ya=lr=null,Rd(n),Kr=null,Xl=0,n=$e;for(;n!==null;)Ky(n.alternate,n),n=n.return;$e=null}}function rl(n,i){var l=n.timeoutHandle;l!==-1&&(n.timeoutHandle=-1,dC(l)),l=n.cancelPendingCommit,l!==null&&(n.cancelPendingCommit=null,l()),ri=0,hf(),mt=n,$e=l=Va(n.current,null),Ge=i,st=0,Pn=null,Ti=!1,nl=Xi(n,i),sf=!1,al=Bn=cf=mr=Ri=_t=0,Tn=ho=null,uf=!1,(i&8)!==0&&(i|=i&32);var u=n.entangledLanes;if(u!==0)for(n=n.entanglements,u&=i;0<u;){var h=31-Se(u),v=1<<h;i|=n[h],u&=~v}return ii=i,ks(),l}function bv(n,i){Le=null,F.H=ro,i===Yr||i===_s?(i=Lg(),st=3):i===yd?(i=Lg(),st=4):st=i===Gd?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Pn=i,$e===null&&(_t=1,Gs(n,ea(i,n.current)))}function xv(){var n=zn.current;return n===null?!0:(Ge&4194048)===Ge?ia===null:(Ge&62914560)===Ge||(Ge&536870912)!==0?n===ia:!1}function wv(){var n=F.H;return F.H=ro,n===null?ro:n}function Sv(){var n=F.A;return F.A=q2,n}function ac(){_t=4,Ti||(Ge&4194048)!==Ge&&zn.current!==null||(nl=!0),(Ri&134217727)===0&&(mr&134217727)===0||mt===null||Oi(mt,Ge,Bn,!1)}function mf(n,i,l){var u=nt;nt|=2;var h=wv(),v=Sv();(mt!==n||Ge!==i)&&(tc=null,rl(n,i)),i=!1;var w=_t;e:do try{if(st!==0&&$e!==null){var j=$e,z=Pn;switch(st){case 8:hf(),w=6;break e;case 3:case 2:case 9:case 6:zn.current===null&&(i=!0);var J=st;if(st=0,Pn=null,ll(n,j,z,J),l&&nl){w=0;break e}break;default:J=st,st=0,Pn=null,ll(n,j,z,J)}}V2(),w=_t;break}catch(re){bv(n,re)}while(!0);return i&&n.shellSuspendCounter++,Ya=lr=null,nt=u,F.H=h,F.A=v,$e===null&&(mt=null,Ge=0,ks()),w}function V2(){for(;$e!==null;)kv($e)}function W2(n,i){var l=nt;nt|=2;var u=wv(),h=Sv();mt!==n||Ge!==i?(tc=null,ec=rt()+500,rl(n,i)):nl=Xi(n,i);e:do try{if(st!==0&&$e!==null){i=$e;var v=Pn;t:switch(st){case 1:st=0,Pn=null,ll(n,i,v,1);break;case 2:case 9:if(Mg(v)){st=0,Pn=null,Cv(i);break}i=function(){st!==2&&st!==9||mt!==n||(st=7),ja(n)},v.then(i,i);break e;case 3:st=7;break e;case 4:st=5;break e;case 7:Mg(v)?(st=0,Pn=null,Cv(i)):(st=0,Pn=null,ll(n,i,v,7));break;case 5:var w=null;switch($e.tag){case 26:w=$e.memoizedState;case 5:case 27:var j=$e;if(w?c0(w):j.stateNode.complete){st=0,Pn=null;var z=j.sibling;if(z!==null)$e=z;else{var J=j.return;J!==null?($e=J,ic(J)):$e=null}break t}}st=0,Pn=null,ll(n,i,v,5);break;case 6:st=0,Pn=null,ll(n,i,v,6);break;case 8:hf(),_t=6;break e;default:throw Error(r(462))}}Y2();break}catch(re){bv(n,re)}while(!0);return Ya=lr=null,F.H=u,F.A=h,nt=l,$e!==null?0:(mt=null,Ge=0,ks(),_t)}function Y2(){for(;$e!==null&&!Qn();)kv($e)}function kv(n){var i=Wy(n.alternate,n,ii);n.memoizedProps=n.pendingProps,i===null?ic(n):$e=i}function Cv(n){var i=n,l=i.alternate;switch(i.tag){case 15:case 0:i=Hy(l,i,i.pendingProps,i.type,void 0,Ge);break;case 11:i=Hy(l,i,i.pendingProps,i.type.render,i.ref,Ge);break;case 5:Rd(i);default:Ky(l,i),i=$e=Sg(i,ii),i=Wy(l,i,ii)}n.memoizedProps=n.pendingProps,i===null?ic(n):$e=i}function ll(n,i,l,u){Ya=lr=null,Rd(i),Kr=null,Xl=0;var h=i.return;try{if(z2(n,h,i,l,Ge)){_t=1,Gs(n,ea(l,n.current)),$e=null;return}}catch(v){if(h!==null)throw $e=h,v;_t=1,Gs(n,ea(l,n.current)),$e=null;return}i.flags&32768?(Ye||u===1?n=!0:nl||(Ge&536870912)!==0?n=!1:(Ti=n=!0,(u===2||u===9||u===3||u===6)&&(u=zn.current,u!==null&&u.tag===13&&(u.flags|=16384))),Ev(i,n)):ic(i)}function ic(n){var i=n;do{if((i.flags&32768)!==0){Ev(i,Ti);return}n=i.return;var l=B2(i.alternate,i,ii);if(l!==null){$e=l;return}if(i=i.sibling,i!==null){$e=i;return}$e=i=n}while(i!==null);_t===0&&(_t=5)}function Ev(n,i){do{var l=U2(n.alternate,n);if(l!==null){l.flags&=32767,$e=l;return}if(l=n.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!i&&(n=n.sibling,n!==null)){$e=n;return}$e=n=l}while(n!==null);_t=6,$e=null}function Av(n,i,l,u,h,v,w,j,z){n.cancelPendingCommit=null;do rc();while(Qt!==0);if((nt&6)!==0)throw Error(r(327));if(i!==null){if(i===n.current)throw Error(r(177));if(v=i.lanes|i.childLanes,v|=nd,Mu(n,l,v,w,j,z),n===mt&&($e=mt=null,Ge=0),il=i,_i=n,ri=l,df=v,ff=h,mv=u,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(n.callbackNode=null,n.callbackPriority=0,Z2(pe,function(){return _v(),null})):(n.callbackNode=null,n.callbackPriority=0),u=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||u){u=F.T,F.T=null,h=ee.p,ee.p=2,w=nt,nt|=4;try{H2(n,i,l)}finally{nt=w,ee.p=h,F.T=u}}Qt=1,jv(),Tv(),Rv()}}function jv(){if(Qt===1){Qt=0;var n=_i,i=il,l=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||l){l=F.T,F.T=null;var u=ee.p;ee.p=2;var h=nt;nt|=4;try{ov(i,n);var v=jf,w=pg(n.containerInfo),j=v.focusedElem,z=v.selectionRange;if(w!==j&&j&&j.ownerDocument&&fg(j.ownerDocument.documentElement,j)){if(z!==null&&Xu(j)){var J=z.start,re=z.end;if(re===void 0&&(re=J),"selectionStart"in j)j.selectionStart=J,j.selectionEnd=Math.min(re,j.value.length);else{var ce=j.ownerDocument||document,te=ce&&ce.defaultView||window;if(te.getSelection){var ne=te.getSelection(),be=j.textContent.length,je=Math.min(z.start,be),ft=z.end===void 0?je:Math.min(z.end,be);!ne.extend&&je>ft&&(w=ft,ft=je,je=w);var V=dg(j,je),$=dg(j,ft);if(V&&$&&(ne.rangeCount!==1||ne.anchorNode!==V.node||ne.anchorOffset!==V.offset||ne.focusNode!==$.node||ne.focusOffset!==$.offset)){var Z=ce.createRange();Z.setStart(V.node,V.offset),ne.removeAllRanges(),je>ft?(ne.addRange(Z),ne.extend($.node,$.offset)):(Z.setEnd($.node,$.offset),ne.addRange(Z))}}}}for(ce=[],ne=j;ne=ne.parentNode;)ne.nodeType===1&&ce.push({element:ne,left:ne.scrollLeft,top:ne.scrollTop});for(typeof j.focus=="function"&&j.focus(),j=0;j<ce.length;j++){var oe=ce[j];oe.element.scrollLeft=oe.left,oe.element.scrollTop=oe.top}}yc=!!Af,jf=Af=null}finally{nt=h,ee.p=u,F.T=l}}n.current=i,Qt=2}}function Tv(){if(Qt===2){Qt=0;var n=_i,i=il,l=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||l){l=F.T,F.T=null;var u=ee.p;ee.p=2;var h=nt;nt|=4;try{nv(n,i.alternate,i)}finally{nt=h,ee.p=u,F.T=l}}Qt=3}}function Rv(){if(Qt===4||Qt===3){Qt=0,wn();var n=_i,i=il,l=ri,u=mv;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Qt=5:(Qt=0,il=_i=null,Nv(n,n.pendingLanes));var h=n.pendingLanes;if(h===0&&(Ni=null),Me(l),i=i.stateNode,Xe&&typeof Xe.onCommitFiberRoot=="function")try{Xe.onCommitFiberRoot(Pe,i,void 0,(i.current.flags&128)===128)}catch{}if(u!==null){i=F.T,h=ee.p,ee.p=2,F.T=null;try{for(var v=n.onRecoverableError,w=0;w<u.length;w++){var j=u[w];v(j.value,{componentStack:j.stack})}}finally{F.T=i,ee.p=h}}(ri&3)!==0&&rc(),ja(n),h=n.pendingLanes,(l&261930)!==0&&(h&42)!==0?n===pf?mo++:(mo=0,pf=n):mo=0,go(0)}}function Nv(n,i){(n.pooledCacheLanes&=i)===0&&(i=n.pooledCache,i!=null&&(n.pooledCache=null,Kl(i)))}function rc(){return jv(),Tv(),Rv(),_v()}function _v(){if(Qt!==5)return!1;var n=_i,i=df;df=0;var l=Me(ri),u=F.T,h=ee.p;try{ee.p=32>l?32:l,F.T=null,l=ff,ff=null;var v=_i,w=ri;if(Qt=0,il=_i=null,ri=0,(nt&6)!==0)throw Error(r(331));var j=nt;if(nt|=4,fv(v.current),cv(v,v.current,w,l),nt=j,go(0,!1),Xe&&typeof Xe.onPostCommitFiberRoot=="function")try{Xe.onPostCommitFiberRoot(Pe,v)}catch{}return!0}finally{ee.p=h,F.T=u,Nv(n,i)}}function Ov(n,i,l){i=ea(l,i),i=Fd(n.stateNode,i,2),n=Ci(n,i,2),n!==null&&(Zi(n,2),ja(n))}function ct(n,i,l){if(n.tag===3)Ov(n,n,l);else for(;i!==null;){if(i.tag===3){Ov(i,n,l);break}else if(i.tag===1){var u=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(Ni===null||!Ni.has(u))){n=ea(l,n),l=My(2),u=Ci(i,l,2),u!==null&&(Dy(l,u,i,n),Zi(u,2),ja(u));break}}i=i.return}}function gf(n,i,l){var u=n.pingCache;if(u===null){u=n.pingCache=new F2;var h=new Set;u.set(i,h)}else h=u.get(i),h===void 0&&(h=new Set,u.set(i,h));h.has(l)||(sf=!0,h.add(l),n=K2.bind(null,n,i,l),i.then(n,n))}function K2(n,i,l){var u=n.pingCache;u!==null&&u.delete(i),n.pingedLanes|=n.suspendedLanes&l,n.warmLanes&=~l,mt===n&&(Ge&l)===l&&(_t===4||_t===3&&(Ge&62914560)===Ge&&300>rt()-Js?(nt&2)===0&&rl(n,0):cf|=l,al===Ge&&(al=0)),ja(n)}function Mv(n,i){i===0&&(i=us()),n=ar(n,i),n!==null&&(Zi(n,i),ja(n))}function Q2(n){var i=n.memoizedState,l=0;i!==null&&(l=i.retryLane),Mv(n,l)}function X2(n,i){var l=0;switch(n.tag){case 31:case 13:var u=n.stateNode,h=n.memoizedState;h!==null&&(l=h.retryLane);break;case 19:u=n.stateNode;break;case 22:u=n.stateNode._retryCache;break;default:throw Error(r(314))}u!==null&&u.delete(i),Mv(n,l)}function Z2(n,i){return he(n,i)}var lc=null,ol=null,yf=!1,oc=!1,vf=!1,Mi=0;function ja(n){n!==ol&&n.next===null&&(ol===null?lc=ol=n:ol=ol.next=n),oc=!0,yf||(yf=!0,eC())}function go(n,i){if(!vf&&oc){vf=!0;do for(var l=!1,u=lc;u!==null;){if(n!==0){var h=u.pendingLanes;if(h===0)var v=0;else{var w=u.suspendedLanes,j=u.pingedLanes;v=(1<<31-Se(42|n)+1)-1,v&=h&~(w&~j),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(l=!0,Iv(u,v))}else v=Ge,v=_r(u,u===mt?v:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(v&3)===0||Xi(u,v)||(l=!0,Iv(u,v));u=u.next}while(l);vf=!1}}function J2(){Dv()}function Dv(){oc=yf=!1;var n=0;Mi!==0&&uC()&&(n=Mi);for(var i=rt(),l=null,u=lc;u!==null;){var h=u.next,v=Lv(u,i);v===0?(u.next=null,l===null?lc=h:l.next=h,h===null&&(ol=l)):(l=u,(n!==0||(v&3)!==0)&&(oc=!0)),u=h}Qt!==0&&Qt!==5||go(n),Mi!==0&&(Mi=0)}function Lv(n,i){for(var l=n.suspendedLanes,u=n.pingedLanes,h=n.expirationTimes,v=n.pendingLanes&-62914561;0<v;){var w=31-Se(v),j=1<<w,z=h[w];z===-1?((j&l)===0||(j&u)!==0)&&(h[w]=Ou(j,i)):z<=i&&(n.expiredLanes|=j),v&=~j}if(i=mt,l=Ge,l=_r(n,n===i?l:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),u=n.callbackNode,l===0||n===i&&(st===2||st===9)||n.cancelPendingCommit!==null)return u!==null&&u!==null&&Bt(u),n.callbackNode=null,n.callbackPriority=0;if((l&3)===0||Xi(n,l)){if(i=l&-l,i===n.callbackPriority)return i;switch(u!==null&&Bt(u),Me(l)){case 2:case 8:l=le;break;case 32:l=pe;break;case 268435456:l=B;break;default:l=pe}return u=zv.bind(null,n),l=he(l,u),n.callbackPriority=i,n.callbackNode=l,i}return u!==null&&u!==null&&Bt(u),n.callbackPriority=2,n.callbackNode=null,2}function zv(n,i){if(Qt!==0&&Qt!==5)return n.callbackNode=null,n.callbackPriority=0,null;var l=n.callbackNode;if(rc()&&n.callbackNode!==l)return null;var u=Ge;return u=_r(n,n===mt?u:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),u===0?null:(yv(n,u,i),Lv(n,rt()),n.callbackNode!=null&&n.callbackNode===l?zv.bind(null,n):null)}function Iv(n,i){if(rc())return null;yv(n,i,!0)}function eC(){fC(function(){(nt&6)!==0?he(H,J2):Dv()})}function bf(){if(Mi===0){var n=Vr;n===0&&(n=hi,hi<<=1,(hi&261888)===0&&(hi=256)),Mi=n}return Mi}function Pv(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:ms(""+n)}function Bv(n,i){var l=i.ownerDocument.createElement("input");return l.name=i.name,l.value=i.value,n.id&&l.setAttribute("form",n.id),i.parentNode.insertBefore(l,i),n=new FormData(n),l.parentNode.removeChild(l),n}function tC(n,i,l,u,h){if(i==="submit"&&l&&l.stateNode===h){var v=Pv((h[_e]||null).action),w=u.submitter;w&&(i=(i=w[_e]||null)?Pv(i.formAction):w.getAttribute("formAction"),i!==null&&(v=i,w=null));var j=new bs("action","action",null,u,h);n.push({event:j,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(Mi!==0){var z=w?Bv(h,w):new FormData(h);Pd(l,{pending:!0,data:z,method:h.method,action:v},null,z)}}else typeof v=="function"&&(j.preventDefault(),z=w?Bv(h,w):new FormData(h),Pd(l,{pending:!0,data:z,method:h.method,action:v},v,z))},currentTarget:h}]})}}for(var xf=0;xf<td.length;xf++){var wf=td[xf],nC=wf.toLowerCase(),aC=wf[0].toUpperCase()+wf.slice(1);fa(nC,"on"+aC)}fa(gg,"onAnimationEnd"),fa(yg,"onAnimationIteration"),fa(vg,"onAnimationStart"),fa("dblclick","onDoubleClick"),fa("focusin","onFocus"),fa("focusout","onBlur"),fa(b2,"onTransitionRun"),fa(x2,"onTransitionStart"),fa(w2,"onTransitionCancel"),fa(bg,"onTransitionEnd"),Xn("onMouseEnter",["mouseout","mouseover"]),Xn("onMouseLeave",["mouseout","mouseover"]),Xn("onPointerEnter",["pointerout","pointerover"]),Xn("onPointerLeave",["pointerout","pointerover"]),hn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),hn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),hn("onBeforeInput",["compositionend","keypress","textInput","paste"]),hn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),hn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),hn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var yo="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(" "),iC=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(yo));function Uv(n,i){i=(i&4)!==0;for(var l=0;l<n.length;l++){var u=n[l],h=u.event;u=u.listeners;e:{var v=void 0;if(i)for(var w=u.length-1;0<=w;w--){var j=u[w],z=j.instance,J=j.currentTarget;if(j=j.listener,z!==v&&h.isPropagationStopped())break e;v=j,h.currentTarget=J;try{v(h)}catch(re){Ss(re)}h.currentTarget=null,v=z}else for(w=0;w<u.length;w++){if(j=u[w],z=j.instance,J=j.currentTarget,j=j.listener,z!==v&&h.isPropagationStopped())break e;v=j,h.currentTarget=J;try{v(h)}catch(re){Ss(re)}h.currentTarget=null,v=z}}}}function qe(n,i){var l=i[Ha];l===void 0&&(l=i[Ha]=new Set);var u=n+"__bubble";l.has(u)||(Hv(i,n,2,!1),l.add(u))}function Sf(n,i,l){var u=0;i&&(u|=4),Hv(l,n,u,i)}var sc="_reactListening"+Math.random().toString(36).slice(2);function kf(n){if(!n[sc]){n[sc]=!0,Sn.forEach(function(l){l!=="selectionchange"&&(iC.has(l)||Sf(l,!1,n),Sf(l,!0,n))});var i=n.nodeType===9?n:n.ownerDocument;i===null||i[sc]||(i[sc]=!0,Sf("selectionchange",!1,i))}}function Hv(n,i,l,u){switch(g0(i)){case 2:var h=OC;break;case 8:h=MC;break;default:h=Pf}l=h.bind(null,i,l,n),h=void 0,!$u||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(h=!0),u?h!==void 0?n.addEventListener(i,l,{capture:!0,passive:h}):n.addEventListener(i,l,!0):h!==void 0?n.addEventListener(i,l,{passive:h}):n.addEventListener(i,l,!1)}function Cf(n,i,l,u,h){var v=u;if((i&1)===0&&(i&2)===0&&u!==null)e:for(;;){if(u===null)return;var w=u.tag;if(w===3||w===4){var j=u.stateNode.containerInfo;if(j===h)break;if(w===4)for(w=u.return;w!==null;){var z=w.tag;if((z===3||z===4)&&w.stateNode.containerInfo===h)return;w=w.return}for(;j!==null;){if(w=$a(j),w===null)return;if(z=w.tag,z===5||z===6||z===26||z===27){u=v=w;continue e}j=j.parentNode}}u=u.return}Vm(function(){var J=v,re=Uu(l),ce=[];e:{var te=xg.get(n);if(te!==void 0){var ne=bs,be=n;switch(n){case"keypress":if(ys(l)===0)break e;case"keydown":case"keyup":ne=Xk;break;case"focusin":be="focus",ne=Vu;break;case"focusout":be="blur",ne=Vu;break;case"beforeblur":case"afterblur":ne=Vu;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ne=Km;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ne=Bk;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ne=e2;break;case gg:case yg:case vg:ne=$k;break;case bg:ne=n2;break;case"scroll":case"scrollend":ne=Ik;break;case"wheel":ne=i2;break;case"copy":case"cut":case"paste":ne=Fk;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ne=Xm;break;case"toggle":case"beforetoggle":ne=l2}var je=(i&4)!==0,ft=!je&&(n==="scroll"||n==="scrollend"),V=je?te!==null?te+"Capture":null:te;je=[];for(var $=J,Z;$!==null;){var oe=$;if(Z=oe.stateNode,oe=oe.tag,oe!==5&&oe!==26&&oe!==27||Z===null||V===null||(oe=Pl($,V),oe!=null&&je.push(vo($,oe,Z))),ft)break;$=$.return}0<je.length&&(te=new ne(te,be,null,l,re),ce.push({event:te,listeners:je}))}}if((i&7)===0){e:{if(te=n==="mouseover"||n==="pointerover",ne=n==="mouseout"||n==="pointerout",te&&l!==Bu&&(be=l.relatedTarget||l.fromElement)&&($a(be)||be[cn]))break e;if((ne||te)&&(te=re.window===re?re:(te=re.ownerDocument)?te.defaultView||te.parentWindow:window,ne?(be=l.relatedTarget||l.toElement,ne=J,be=be?$a(be):null,be!==null&&(ft=s(be),je=be.tag,be!==ft||je!==5&&je!==27&&je!==6)&&(be=null)):(ne=null,be=J),ne!==be)){if(je=Km,oe="onMouseLeave",V="onMouseEnter",$="mouse",(n==="pointerout"||n==="pointerover")&&(je=Xm,oe="onPointerLeave",V="onPointerEnter",$="pointer"),ft=ne==null?te:pn(ne),Z=be==null?te:pn(be),te=new je(oe,$+"leave",ne,l,re),te.target=ft,te.relatedTarget=Z,oe=null,$a(re)===J&&(je=new je(V,$+"enter",be,l,re),je.target=Z,je.relatedTarget=ft,oe=je),ft=oe,ne&&be)t:{for(je=rC,V=ne,$=be,Z=0,oe=V;oe;oe=je(oe))Z++;oe=0;for(var Ce=$;Ce;Ce=je(Ce))oe++;for(;0<Z-oe;)V=je(V),Z--;for(;0<oe-Z;)$=je($),oe--;for(;Z--;){if(V===$||$!==null&&V===$.alternate){je=V;break t}V=je(V),$=je($)}je=null}else je=null;ne!==null&&$v(ce,te,ne,je,!1),be!==null&&ft!==null&&$v(ce,ft,be,je,!0)}}e:{if(te=J?pn(J):window,ne=te.nodeName&&te.nodeName.toLowerCase(),ne==="select"||ne==="input"&&te.type==="file")var Ze=rg;else if(ag(te))if(lg)Ze=g2;else{Ze=h2;var xe=p2}else ne=te.nodeName,!ne||ne.toLowerCase()!=="input"||te.type!=="checkbox"&&te.type!=="radio"?J&&Pu(J.elementType)&&(Ze=rg):Ze=m2;if(Ze&&(Ze=Ze(n,J))){ig(ce,Ze,l,re);break e}xe&&xe(n,te,J),n==="focusout"&&J&&te.type==="number"&&J.memoizedProps.value!=null&&Iu(te,"number",te.value)}switch(xe=J?pn(J):window,n){case"focusin":(ag(xe)||xe.contentEditable==="true")&&(Pr=xe,Zu=J,Vl=null);break;case"focusout":Vl=Zu=Pr=null;break;case"mousedown":Ju=!0;break;case"contextmenu":case"mouseup":case"dragend":Ju=!1,hg(ce,l,re);break;case"selectionchange":if(v2)break;case"keydown":case"keyup":hg(ce,l,re)}var ze;if(Yu)e:{switch(n){case"compositionstart":var Ve="onCompositionStart";break e;case"compositionend":Ve="onCompositionEnd";break e;case"compositionupdate":Ve="onCompositionUpdate";break e}Ve=void 0}else Ir?tg(n,l)&&(Ve="onCompositionEnd"):n==="keydown"&&l.keyCode===229&&(Ve="onCompositionStart");Ve&&(Zm&&l.locale!=="ko"&&(Ir||Ve!=="onCompositionStart"?Ve==="onCompositionEnd"&&Ir&&(ze=Wm()):(yi=re,qu="value"in yi?yi.value:yi.textContent,Ir=!0)),xe=cc(J,Ve),0<xe.length&&(Ve=new Qm(Ve,n,null,l,re),ce.push({event:Ve,listeners:xe}),ze?Ve.data=ze:(ze=ng(l),ze!==null&&(Ve.data=ze)))),(ze=s2?c2(n,l):u2(n,l))&&(Ve=cc(J,"onBeforeInput"),0<Ve.length&&(xe=new Qm("onBeforeInput","beforeinput",null,l,re),ce.push({event:xe,listeners:Ve}),xe.data=ze)),tC(ce,n,J,l,re)}Uv(ce,i)})}function vo(n,i,l){return{instance:n,listener:i,currentTarget:l}}function cc(n,i){for(var l=i+"Capture",u=[];n!==null;){var h=n,v=h.stateNode;if(h=h.tag,h!==5&&h!==26&&h!==27||v===null||(h=Pl(n,l),h!=null&&u.unshift(vo(n,h,v)),h=Pl(n,i),h!=null&&u.push(vo(n,h,v))),n.tag===3)return u;n=n.return}return[]}function rC(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function $v(n,i,l,u,h){for(var v=i._reactName,w=[];l!==null&&l!==u;){var j=l,z=j.alternate,J=j.stateNode;if(j=j.tag,z!==null&&z===u)break;j!==5&&j!==26&&j!==27||J===null||(z=J,h?(J=Pl(l,v),J!=null&&w.unshift(vo(l,J,z))):h||(J=Pl(l,v),J!=null&&w.push(vo(l,J,z)))),l=l.return}w.length!==0&&n.push({event:i,listeners:w})}var lC=/\r\n?/g,oC=/\u0000|\uFFFD/g;function qv(n){return(typeof n=="string"?n:""+n).replace(lC,`
50
+ `).replace(oC,"")}function Fv(n,i){return i=qv(i),qv(n)===i}function dt(n,i,l,u,h,v){switch(l){case"children":typeof u=="string"?i==="body"||i==="textarea"&&u===""||Dr(n,u):(typeof u=="number"||typeof u=="bigint")&&i!=="body"&&Dr(n,""+u);break;case"className":Ji(n,"class",u);break;case"tabIndex":Ji(n,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":Ji(n,l,u);break;case"style":Fm(n,u,v);break;case"data":if(i!=="object"){Ji(n,"data",u);break}case"src":case"href":if(u===""&&(i!=="a"||l!=="href")){n.removeAttribute(l);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){n.removeAttribute(l);break}u=ms(""+u),n.setAttribute(l,u);break;case"action":case"formAction":if(typeof u=="function"){n.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof v=="function"&&(l==="formAction"?(i!=="input"&&dt(n,i,"name",h.name,h,null),dt(n,i,"formEncType",h.formEncType,h,null),dt(n,i,"formMethod",h.formMethod,h,null),dt(n,i,"formTarget",h.formTarget,h,null)):(dt(n,i,"encType",h.encType,h,null),dt(n,i,"method",h.method,h,null),dt(n,i,"target",h.target,h,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){n.removeAttribute(l);break}u=ms(""+u),n.setAttribute(l,u);break;case"onClick":u!=null&&(n.onclick=Fa);break;case"onScroll":u!=null&&qe("scroll",n);break;case"onScrollEnd":u!=null&&qe("scrollend",n);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(r(61));if(l=u.__html,l!=null){if(h.children!=null)throw Error(r(60));n.innerHTML=l}}break;case"multiple":n.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":n.muted=u&&typeof u!="function"&&typeof u!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(u==null||typeof u=="function"||typeof u=="boolean"||typeof u=="symbol"){n.removeAttribute("xlink:href");break}l=ms(""+u),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":u!=null&&typeof u!="function"&&typeof u!="symbol"?n.setAttribute(l,""+u):n.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":u&&typeof u!="function"&&typeof u!="symbol"?n.setAttribute(l,""):n.removeAttribute(l);break;case"capture":case"download":u===!0?n.setAttribute(l,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?n.setAttribute(l,u):n.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?n.setAttribute(l,u):n.removeAttribute(l);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?n.removeAttribute(l):n.setAttribute(l,u);break;case"popover":qe("beforetoggle",n),qe("toggle",n),mn(n,"popover",u);break;case"xlinkActuate":kn(n,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":kn(n,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":kn(n,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":kn(n,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":kn(n,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":kn(n,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":kn(n,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":kn(n,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":kn(n,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":mn(n,"is",u);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=Lk.get(l)||l,mn(n,l,u))}}function Ef(n,i,l,u,h,v){switch(l){case"style":Fm(n,u,v);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(r(61));if(l=u.__html,l!=null){if(h.children!=null)throw Error(r(60));n.innerHTML=l}}break;case"children":typeof u=="string"?Dr(n,u):(typeof u=="number"||typeof u=="bigint")&&Dr(n,""+u);break;case"onScroll":u!=null&&qe("scroll",n);break;case"onScrollEnd":u!=null&&qe("scrollend",n);break;case"onClick":u!=null&&(n.onclick=Fa);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ka.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(h=l.endsWith("Capture"),i=l.slice(2,h?l.length-7:void 0),v=n[_e]||null,v=v!=null?v[l]:null,typeof v=="function"&&n.removeEventListener(i,v,h),typeof u=="function")){typeof v!="function"&&v!==null&&(l in n?n[l]=null:n.hasAttribute(l)&&n.removeAttribute(l)),n.addEventListener(i,u,h);break e}l in n?n[l]=u:u===!0?n.setAttribute(l,""):mn(n,l,u)}}}function sn(n,i,l){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":qe("error",n),qe("load",n);var u=!1,h=!1,v;for(v in l)if(l.hasOwnProperty(v)){var w=l[v];if(w!=null)switch(v){case"src":u=!0;break;case"srcSet":h=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,i));default:dt(n,i,v,w,l,null)}}h&&dt(n,i,"srcSet",l.srcSet,l,null),u&&dt(n,i,"src",l.src,l,null);return;case"input":qe("invalid",n);var j=v=w=h=null,z=null,J=null;for(u in l)if(l.hasOwnProperty(u)){var re=l[u];if(re!=null)switch(u){case"name":h=re;break;case"type":w=re;break;case"checked":z=re;break;case"defaultChecked":J=re;break;case"value":v=re;break;case"defaultValue":j=re;break;case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(r(137,i));break;default:dt(n,i,u,re,l,null)}}Um(n,v,j,z,J,w,h,!1);return;case"select":qe("invalid",n),u=w=v=null;for(h in l)if(l.hasOwnProperty(h)&&(j=l[h],j!=null))switch(h){case"value":v=j;break;case"defaultValue":w=j;break;case"multiple":u=j;default:dt(n,i,h,j,l,null)}i=v,l=w,n.multiple=!!u,i!=null?Mr(n,!!u,i,!1):l!=null&&Mr(n,!!u,l,!0);return;case"textarea":qe("invalid",n),v=h=u=null;for(w in l)if(l.hasOwnProperty(w)&&(j=l[w],j!=null))switch(w){case"value":u=j;break;case"defaultValue":h=j;break;case"children":v=j;break;case"dangerouslySetInnerHTML":if(j!=null)throw Error(r(91));break;default:dt(n,i,w,j,l,null)}$m(n,u,h,v);return;case"option":for(z in l)if(l.hasOwnProperty(z)&&(u=l[z],u!=null))switch(z){case"selected":n.selected=u&&typeof u!="function"&&typeof u!="symbol";break;default:dt(n,i,z,u,l,null)}return;case"dialog":qe("beforetoggle",n),qe("toggle",n),qe("cancel",n),qe("close",n);break;case"iframe":case"object":qe("load",n);break;case"video":case"audio":for(u=0;u<yo.length;u++)qe(yo[u],n);break;case"image":qe("error",n),qe("load",n);break;case"details":qe("toggle",n);break;case"embed":case"source":case"link":qe("error",n),qe("load",n);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(J in l)if(l.hasOwnProperty(J)&&(u=l[J],u!=null))switch(J){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,i));default:dt(n,i,J,u,l,null)}return;default:if(Pu(i)){for(re in l)l.hasOwnProperty(re)&&(u=l[re],u!==void 0&&Ef(n,i,re,u,l,void 0));return}}for(j in l)l.hasOwnProperty(j)&&(u=l[j],u!=null&&dt(n,i,j,u,l,null))}function sC(n,i,l,u){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var h=null,v=null,w=null,j=null,z=null,J=null,re=null;for(ne in l){var ce=l[ne];if(l.hasOwnProperty(ne)&&ce!=null)switch(ne){case"checked":break;case"value":break;case"defaultValue":z=ce;default:u.hasOwnProperty(ne)||dt(n,i,ne,null,u,ce)}}for(var te in u){var ne=u[te];if(ce=l[te],u.hasOwnProperty(te)&&(ne!=null||ce!=null))switch(te){case"type":v=ne;break;case"name":h=ne;break;case"checked":J=ne;break;case"defaultChecked":re=ne;break;case"value":w=ne;break;case"defaultValue":j=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(r(137,i));break;default:ne!==ce&&dt(n,i,te,ne,u,ce)}}zu(n,w,j,z,J,re,v,h);return;case"select":ne=w=j=te=null;for(v in l)if(z=l[v],l.hasOwnProperty(v)&&z!=null)switch(v){case"value":break;case"multiple":ne=z;default:u.hasOwnProperty(v)||dt(n,i,v,null,u,z)}for(h in u)if(v=u[h],z=l[h],u.hasOwnProperty(h)&&(v!=null||z!=null))switch(h){case"value":te=v;break;case"defaultValue":j=v;break;case"multiple":w=v;default:v!==z&&dt(n,i,h,v,u,z)}i=j,l=w,u=ne,te!=null?Mr(n,!!l,te,!1):!!u!=!!l&&(i!=null?Mr(n,!!l,i,!0):Mr(n,!!l,l?[]:"",!1));return;case"textarea":ne=te=null;for(j in l)if(h=l[j],l.hasOwnProperty(j)&&h!=null&&!u.hasOwnProperty(j))switch(j){case"value":break;case"children":break;default:dt(n,i,j,null,u,h)}for(w in u)if(h=u[w],v=l[w],u.hasOwnProperty(w)&&(h!=null||v!=null))switch(w){case"value":te=h;break;case"defaultValue":ne=h;break;case"children":break;case"dangerouslySetInnerHTML":if(h!=null)throw Error(r(91));break;default:h!==v&&dt(n,i,w,h,u,v)}Hm(n,te,ne);return;case"option":for(var be in l)if(te=l[be],l.hasOwnProperty(be)&&te!=null&&!u.hasOwnProperty(be))switch(be){case"selected":n.selected=!1;break;default:dt(n,i,be,null,u,te)}for(z in u)if(te=u[z],ne=l[z],u.hasOwnProperty(z)&&te!==ne&&(te!=null||ne!=null))switch(z){case"selected":n.selected=te&&typeof te!="function"&&typeof te!="symbol";break;default:dt(n,i,z,te,u,ne)}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 je in l)te=l[je],l.hasOwnProperty(je)&&te!=null&&!u.hasOwnProperty(je)&&dt(n,i,je,null,u,te);for(J in u)if(te=u[J],ne=l[J],u.hasOwnProperty(J)&&te!==ne&&(te!=null||ne!=null))switch(J){case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(r(137,i));break;default:dt(n,i,J,te,u,ne)}return;default:if(Pu(i)){for(var ft in l)te=l[ft],l.hasOwnProperty(ft)&&te!==void 0&&!u.hasOwnProperty(ft)&&Ef(n,i,ft,void 0,u,te);for(re in u)te=u[re],ne=l[re],!u.hasOwnProperty(re)||te===ne||te===void 0&&ne===void 0||Ef(n,i,re,te,u,ne);return}}for(var V in l)te=l[V],l.hasOwnProperty(V)&&te!=null&&!u.hasOwnProperty(V)&&dt(n,i,V,null,u,te);for(ce in u)te=u[ce],ne=l[ce],!u.hasOwnProperty(ce)||te===ne||te==null&&ne==null||dt(n,i,ce,te,u,ne)}function Gv(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function cC(){if(typeof performance.getEntriesByType=="function"){for(var n=0,i=0,l=performance.getEntriesByType("resource"),u=0;u<l.length;u++){var h=l[u],v=h.transferSize,w=h.initiatorType,j=h.duration;if(v&&j&&Gv(w)){for(w=0,j=h.responseEnd,u+=1;u<l.length;u++){var z=l[u],J=z.startTime;if(J>j)break;var re=z.transferSize,ce=z.initiatorType;re&&Gv(ce)&&(z=z.responseEnd,w+=re*(z<j?1:(j-J)/(z-J)))}if(--u,i+=8*(v+w)/(h.duration/1e3),n++,10<n)break}}if(0<n)return i/n/1e6}return navigator.connection&&(n=navigator.connection.downlink,typeof n=="number")?n:5}var Af=null,jf=null;function uc(n){return n.nodeType===9?n:n.ownerDocument}function Vv(n){switch(n){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Wv(n,i){if(n===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return n===1&&i==="foreignObject"?0:n}function Tf(n,i){return n==="textarea"||n==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var Rf=null;function uC(){var n=window.event;return n&&n.type==="popstate"?n===Rf?!1:(Rf=n,!0):(Rf=null,!1)}var Yv=typeof setTimeout=="function"?setTimeout:void 0,dC=typeof clearTimeout=="function"?clearTimeout:void 0,Kv=typeof Promise=="function"?Promise:void 0,fC=typeof queueMicrotask=="function"?queueMicrotask:typeof Kv<"u"?function(n){return Kv.resolve(null).then(n).catch(pC)}:Yv;function pC(n){setTimeout(function(){throw n})}function Di(n){return n==="head"}function Qv(n,i){var l=i,u=0;do{var h=l.nextSibling;if(n.removeChild(l),h&&h.nodeType===8)if(l=h.data,l==="/$"||l==="/&"){if(u===0){n.removeChild(h),dl(i);return}u--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")u++;else if(l==="html")bo(n.ownerDocument.documentElement);else if(l==="head"){l=n.ownerDocument.head,bo(l);for(var v=l.firstChild;v;){var w=v.nextSibling,j=v.nodeName;v[Sa]||j==="SCRIPT"||j==="STYLE"||j==="LINK"&&v.rel.toLowerCase()==="stylesheet"||l.removeChild(v),v=w}}else l==="body"&&bo(n.ownerDocument.body);l=h}while(l);dl(i)}function Xv(n,i){var l=n;n=0;do{var u=l.nextSibling;if(l.nodeType===1?i?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(i?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),u&&u.nodeType===8)if(l=u.data,l==="/$"){if(n===0)break;n--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||n++;l=u}while(l)}function Nf(n){var i=n.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var l=i;switch(i=i.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":Nf(l),Or(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}n.removeChild(l)}}function hC(n,i,l,u){for(;n.nodeType===1;){var h=l;if(n.nodeName.toLowerCase()!==i.toLowerCase()){if(!u&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(u){if(!n[Sa])switch(i){case"meta":if(!n.hasAttribute("itemprop"))break;return n;case"link":if(v=n.getAttribute("rel"),v==="stylesheet"&&n.hasAttribute("data-precedence"))break;if(v!==h.rel||n.getAttribute("href")!==(h.href==null||h.href===""?null:h.href)||n.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin)||n.getAttribute("title")!==(h.title==null?null:h.title))break;return n;case"style":if(n.hasAttribute("data-precedence"))break;return n;case"script":if(v=n.getAttribute("src"),(v!==(h.src==null?null:h.src)||n.getAttribute("type")!==(h.type==null?null:h.type)||n.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin))&&v&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}else if(i==="input"&&n.type==="hidden"){var v=h.name==null?null:""+h.name;if(h.type==="hidden"&&n.getAttribute("name")===v)return n}else return n;if(n=ra(n.nextSibling),n===null)break}return null}function mC(n,i,l){if(i==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!l||(n=ra(n.nextSibling),n===null))return null;return n}function Zv(n,i){for(;n.nodeType!==8;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!i||(n=ra(n.nextSibling),n===null))return null;return n}function _f(n){return n.data==="$?"||n.data==="$~"}function Of(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState!=="loading"}function gC(n,i){var l=n.ownerDocument;if(n.data==="$~")n._reactRetry=i;else if(n.data!=="$?"||l.readyState!=="loading")i();else{var u=function(){i(),l.removeEventListener("DOMContentLoaded",u)};l.addEventListener("DOMContentLoaded",u),n._reactRetry=u}}function ra(n){for(;n!=null;n=n.nextSibling){var i=n.nodeType;if(i===1||i===3)break;if(i===8){if(i=n.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return n}var Mf=null;function Jv(n){n=n.nextSibling;for(var i=0;n;){if(n.nodeType===8){var l=n.data;if(l==="/$"||l==="/&"){if(i===0)return ra(n.nextSibling);i--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||i++}n=n.nextSibling}return null}function e0(n){n=n.previousSibling;for(var i=0;n;){if(n.nodeType===8){var l=n.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(i===0)return n;i--}else l!=="/$"&&l!=="/&"||i++}n=n.previousSibling}return null}function t0(n,i,l){switch(i=uc(l),n){case"html":if(n=i.documentElement,!n)throw Error(r(452));return n;case"head":if(n=i.head,!n)throw Error(r(453));return n;case"body":if(n=i.body,!n)throw Error(r(454));return n;default:throw Error(r(451))}}function bo(n){for(var i=n.attributes;i.length;)n.removeAttributeNode(i[0]);Or(n)}var la=new Map,n0=new Set;function dc(n){return typeof n.getRootNode=="function"?n.getRootNode():n.nodeType===9?n:n.ownerDocument}var li=ee.d;ee.d={f:yC,r:vC,D:bC,C:xC,L:wC,m:SC,X:CC,S:kC,M:EC};function yC(){var n=li.f(),i=nc();return n||i}function vC(n){var i=Jt(n);i!==null&&i.tag===5&&i.type==="form"?by(i):li.r(n)}var sl=typeof document>"u"?null:document;function a0(n,i,l){var u=sl;if(u&&typeof i=="string"&&i){var h=Zn(i);h='link[rel="'+n+'"][href="'+h+'"]',typeof l=="string"&&(h+='[crossorigin="'+l+'"]'),n0.has(h)||(n0.add(h),n={rel:n,crossOrigin:l,href:i},u.querySelector(h)===null&&(i=u.createElement("link"),sn(i,"link",n),Tt(i),u.head.appendChild(i)))}}function bC(n){li.D(n),a0("dns-prefetch",n,null)}function xC(n,i){li.C(n,i),a0("preconnect",n,i)}function wC(n,i,l){li.L(n,i,l);var u=sl;if(u&&n&&i){var h='link[rel="preload"][as="'+Zn(i)+'"]';i==="image"&&l&&l.imageSrcSet?(h+='[imagesrcset="'+Zn(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(h+='[imagesizes="'+Zn(l.imageSizes)+'"]')):h+='[href="'+Zn(n)+'"]';var v=h;switch(i){case"style":v=cl(n);break;case"script":v=ul(n)}la.has(v)||(n=m({rel:"preload",href:i==="image"&&l&&l.imageSrcSet?void 0:n,as:i},l),la.set(v,n),u.querySelector(h)!==null||i==="style"&&u.querySelector(xo(v))||i==="script"&&u.querySelector(wo(v))||(i=u.createElement("link"),sn(i,"link",n),Tt(i),u.head.appendChild(i)))}}function SC(n,i){li.m(n,i);var l=sl;if(l&&n){var u=i&&typeof i.as=="string"?i.as:"script",h='link[rel="modulepreload"][as="'+Zn(u)+'"][href="'+Zn(n)+'"]',v=h;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=ul(n)}if(!la.has(v)&&(n=m({rel:"modulepreload",href:n},i),la.set(v,n),l.querySelector(h)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(wo(v)))return}u=l.createElement("link"),sn(u,"link",n),Tt(u),l.head.appendChild(u)}}}function kC(n,i,l){li.S(n,i,l);var u=sl;if(u&&n){var h=Mn(u).hoistableStyles,v=cl(n);i=i||"default";var w=h.get(v);if(!w){var j={loading:0,preload:null};if(w=u.querySelector(xo(v)))j.loading=5;else{n=m({rel:"stylesheet",href:n,"data-precedence":i},l),(l=la.get(v))&&Df(n,l);var z=w=u.createElement("link");Tt(z),sn(z,"link",n),z._p=new Promise(function(J,re){z.onload=J,z.onerror=re}),z.addEventListener("load",function(){j.loading|=1}),z.addEventListener("error",function(){j.loading|=2}),j.loading|=4,fc(w,i,u)}w={type:"stylesheet",instance:w,count:1,state:j},h.set(v,w)}}}function CC(n,i){li.X(n,i);var l=sl;if(l&&n){var u=Mn(l).hoistableScripts,h=ul(n),v=u.get(h);v||(v=l.querySelector(wo(h)),v||(n=m({src:n,async:!0},i),(i=la.get(h))&&Lf(n,i),v=l.createElement("script"),Tt(v),sn(v,"link",n),l.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},u.set(h,v))}}function EC(n,i){li.M(n,i);var l=sl;if(l&&n){var u=Mn(l).hoistableScripts,h=ul(n),v=u.get(h);v||(v=l.querySelector(wo(h)),v||(n=m({src:n,async:!0,type:"module"},i),(i=la.get(h))&&Lf(n,i),v=l.createElement("script"),Tt(v),sn(v,"link",n),l.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},u.set(h,v))}}function i0(n,i,l,u){var h=(h=me.current)?dc(h):null;if(!h)throw Error(r(446));switch(n){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(i=cl(l.href),l=Mn(h).hoistableStyles,u=l.get(i),u||(u={type:"style",instance:null,count:0,state:null},l.set(i,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){n=cl(l.href);var v=Mn(h).hoistableStyles,w=v.get(n);if(w||(h=h.ownerDocument||h,w={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(n,w),(v=h.querySelector(xo(n)))&&!v._p&&(w.instance=v,w.state.loading=5),la.has(n)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},la.set(n,l),v||AC(h,n,l,w.state))),i&&u===null)throw Error(r(528,""));return w}if(i&&u!==null)throw Error(r(529,""));return null;case"script":return i=l.async,l=l.src,typeof l=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=ul(l),l=Mn(h).hoistableScripts,u=l.get(i),u||(u={type:"script",instance:null,count:0,state:null},l.set(i,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,n))}}function cl(n){return'href="'+Zn(n)+'"'}function xo(n){return'link[rel="stylesheet"]['+n+"]"}function r0(n){return m({},n,{"data-precedence":n.precedence,precedence:null})}function AC(n,i,l,u){n.querySelector('link[rel="preload"][as="style"]['+i+"]")?u.loading=1:(i=n.createElement("link"),u.preload=i,i.addEventListener("load",function(){return u.loading|=1}),i.addEventListener("error",function(){return u.loading|=2}),sn(i,"link",l),Tt(i),n.head.appendChild(i))}function ul(n){return'[src="'+Zn(n)+'"]'}function wo(n){return"script[async]"+n}function l0(n,i,l){if(i.count++,i.instance===null)switch(i.type){case"style":var u=n.querySelector('style[data-href~="'+Zn(l.href)+'"]');if(u)return i.instance=u,Tt(u),u;var h=m({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return u=(n.ownerDocument||n).createElement("style"),Tt(u),sn(u,"style",h),fc(u,l.precedence,n),i.instance=u;case"stylesheet":h=cl(l.href);var v=n.querySelector(xo(h));if(v)return i.state.loading|=4,i.instance=v,Tt(v),v;u=r0(l),(h=la.get(h))&&Df(u,h),v=(n.ownerDocument||n).createElement("link"),Tt(v);var w=v;return w._p=new Promise(function(j,z){w.onload=j,w.onerror=z}),sn(v,"link",u),i.state.loading|=4,fc(v,l.precedence,n),i.instance=v;case"script":return v=ul(l.src),(h=n.querySelector(wo(v)))?(i.instance=h,Tt(h),h):(u=l,(h=la.get(v))&&(u=m({},l),Lf(u,h)),n=n.ownerDocument||n,h=n.createElement("script"),Tt(h),sn(h,"link",u),n.head.appendChild(h),i.instance=h);case"void":return null;default:throw Error(r(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(u=i.instance,i.state.loading|=4,fc(u,l.precedence,n));return i.instance}function fc(n,i,l){for(var u=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),h=u.length?u[u.length-1]:null,v=h,w=0;w<u.length;w++){var j=u[w];if(j.dataset.precedence===i)v=j;else if(v!==h)break}v?v.parentNode.insertBefore(n,v.nextSibling):(i=l.nodeType===9?l.head:l,i.insertBefore(n,i.firstChild))}function Df(n,i){n.crossOrigin==null&&(n.crossOrigin=i.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=i.referrerPolicy),n.title==null&&(n.title=i.title)}function Lf(n,i){n.crossOrigin==null&&(n.crossOrigin=i.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=i.referrerPolicy),n.integrity==null&&(n.integrity=i.integrity)}var pc=null;function o0(n,i,l){if(pc===null){var u=new Map,h=pc=new Map;h.set(l,u)}else h=pc,u=h.get(l),u||(u=new Map,h.set(l,u));if(u.has(n))return u;for(u.set(n,null),l=l.getElementsByTagName(n),h=0;h<l.length;h++){var v=l[h];if(!(v[Sa]||v[we]||n==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var w=v.getAttribute(i)||"";w=n+w;var j=u.get(w);j?j.push(v):u.set(w,[v])}}return u}function s0(n,i,l){n=n.ownerDocument||n,n.head.insertBefore(l,i==="title"?n.querySelector("head > title"):null)}function jC(n,i,l){if(l===1||i.itemProp!=null)return!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;switch(i.rel){case"stylesheet":return n=i.disabled,typeof i.precedence=="string"&&n==null;default:return!0}case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function c0(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function TC(n,i,l,u){if(l.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var h=cl(u.href),v=i.querySelector(xo(h));if(v){i=v._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(n.count++,n=hc.bind(n),i.then(n,n)),l.state.loading|=4,l.instance=v,Tt(v);return}v=i.ownerDocument||i,u=r0(u),(h=la.get(h))&&Df(u,h),v=v.createElement("link"),Tt(v);var w=v;w._p=new Promise(function(j,z){w.onload=j,w.onerror=z}),sn(v,"link",u),l.instance=v}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(l,i),(i=l.state.preload)&&(l.state.loading&3)===0&&(n.count++,l=hc.bind(n),i.addEventListener("load",l),i.addEventListener("error",l))}}var zf=0;function RC(n,i){return n.stylesheets&&n.count===0&&gc(n,n.stylesheets),0<n.count||0<n.imgCount?function(l){var u=setTimeout(function(){if(n.stylesheets&&gc(n,n.stylesheets),n.unsuspend){var v=n.unsuspend;n.unsuspend=null,v()}},6e4+i);0<n.imgBytes&&zf===0&&(zf=62500*cC());var h=setTimeout(function(){if(n.waitingForImages=!1,n.count===0&&(n.stylesheets&&gc(n,n.stylesheets),n.unsuspend)){var v=n.unsuspend;n.unsuspend=null,v()}},(n.imgBytes>zf?50:800)+i);return n.unsuspend=l,function(){n.unsuspend=null,clearTimeout(u),clearTimeout(h)}}:null}function hc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)gc(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var mc=null;function gc(n,i){n.stylesheets=null,n.unsuspend!==null&&(n.count++,mc=new Map,i.forEach(NC,n),mc=null,hc.call(n))}function NC(n,i){if(!(i.state.loading&4)){var l=mc.get(n);if(l)var u=l.get(null);else{l=new Map,mc.set(n,l);for(var h=n.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<h.length;v++){var w=h[v];(w.nodeName==="LINK"||w.getAttribute("media")!=="not all")&&(l.set(w.dataset.precedence,w),u=w)}u&&l.set(null,u)}h=i.instance,w=h.getAttribute("data-precedence"),v=l.get(w)||u,v===u&&l.set(null,h),l.set(w,h),this.count++,u=hc.bind(this),h.addEventListener("load",u),h.addEventListener("error",u),v?v.parentNode.insertBefore(h,v.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(h,n.firstChild)),i.state.loading|=4}}var So={$$typeof:_,Provider:null,Consumer:null,_currentValue:ie,_currentValue2:ie,_threadCount:0};function _C(n,i,l,u,h,v,w,j,z){this.tag=1,this.containerInfo=n,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=Ll(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ll(0),this.hiddenUpdates=Ll(null),this.identifierPrefix=u,this.onUncaughtError=h,this.onCaughtError=v,this.onRecoverableError=w,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=z,this.incompleteTransitions=new Map}function u0(n,i,l,u,h,v,w,j,z,J,re,ce){return n=new _C(n,i,l,w,z,J,re,ce,j),i=1,v===!0&&(i|=24),v=Ln(3,null,null,i),n.current=v,v.stateNode=n,i=hd(),i.refCount++,n.pooledCache=i,i.refCount++,v.memoizedState={element:u,isDehydrated:l,cache:i},vd(v),n}function d0(n){return n?(n=Hr,n):Hr}function f0(n,i,l,u,h,v){h=d0(h),u.context===null?u.context=h:u.pendingContext=h,u=ki(i),u.payload={element:l},v=v===void 0?null:v,v!==null&&(u.callback=v),l=Ci(n,u,i),l!==null&&(Rn(l,n,i),Jl(l,n,i))}function p0(n,i){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var l=n.retryLane;n.retryLane=l!==0&&l<i?l:i}}function If(n,i){p0(n,i),(n=n.alternate)&&p0(n,i)}function h0(n){if(n.tag===13||n.tag===31){var i=ar(n,67108864);i!==null&&Rn(i,n,67108864),If(n,67108864)}}function m0(n){if(n.tag===13||n.tag===31){var i=Un();i=ke(i);var l=ar(n,i);l!==null&&Rn(l,n,i),If(n,i)}}var yc=!0;function OC(n,i,l,u){var h=F.T;F.T=null;var v=ee.p;try{ee.p=2,Pf(n,i,l,u)}finally{ee.p=v,F.T=h}}function MC(n,i,l,u){var h=F.T;F.T=null;var v=ee.p;try{ee.p=8,Pf(n,i,l,u)}finally{ee.p=v,F.T=h}}function Pf(n,i,l,u){if(yc){var h=Bf(u);if(h===null)Cf(n,i,u,vc,l),y0(n,u);else if(LC(h,n,i,l,u))u.stopPropagation();else if(y0(n,u),i&4&&-1<DC.indexOf(n)){for(;h!==null;){var v=Jt(h);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var w=Ua(v.pendingLanes);if(w!==0){var j=v;for(j.pendingLanes|=2,j.entangledLanes|=2;w;){var z=1<<31-Se(w);j.entanglements[1]|=z,w&=~z}ja(v),(nt&6)===0&&(ec=rt()+500,go(0))}}break;case 31:case 13:j=ar(v,2),j!==null&&Rn(j,v,2),nc(),If(v,2)}if(v=Bf(u),v===null&&Cf(n,i,u,vc,l),v===h)break;h=v}h!==null&&u.stopPropagation()}else Cf(n,i,u,null,l)}}function Bf(n){return n=Uu(n),Uf(n)}var vc=null;function Uf(n){if(vc=null,n=$a(n),n!==null){var i=s(n);if(i===null)n=null;else{var l=i.tag;if(l===13){if(n=c(i),n!==null)return n;n=null}else if(l===31){if(n=d(i),n!==null)return n;n=null}else if(l===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;n=null}else i!==n&&(n=null)}}return vc=n,null}function g0(n){switch(n){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(fe()){case H:return 2;case le:return 8;case pe:case ye:return 32;case B:return 268435456;default:return 32}default:return 32}}var Hf=!1,Li=null,zi=null,Ii=null,ko=new Map,Co=new Map,Pi=[],DC="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 y0(n,i){switch(n){case"focusin":case"focusout":Li=null;break;case"dragenter":case"dragleave":zi=null;break;case"mouseover":case"mouseout":Ii=null;break;case"pointerover":case"pointerout":ko.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Co.delete(i.pointerId)}}function Eo(n,i,l,u,h,v){return n===null||n.nativeEvent!==v?(n={blockedOn:i,domEventName:l,eventSystemFlags:u,nativeEvent:v,targetContainers:[h]},i!==null&&(i=Jt(i),i!==null&&h0(i)),n):(n.eventSystemFlags|=u,i=n.targetContainers,h!==null&&i.indexOf(h)===-1&&i.push(h),n)}function LC(n,i,l,u,h){switch(i){case"focusin":return Li=Eo(Li,n,i,l,u,h),!0;case"dragenter":return zi=Eo(zi,n,i,l,u,h),!0;case"mouseover":return Ii=Eo(Ii,n,i,l,u,h),!0;case"pointerover":var v=h.pointerId;return ko.set(v,Eo(ko.get(v)||null,n,i,l,u,h)),!0;case"gotpointercapture":return v=h.pointerId,Co.set(v,Eo(Co.get(v)||null,n,i,l,u,h)),!0}return!1}function v0(n){var i=$a(n.target);if(i!==null){var l=s(i);if(l!==null){if(i=l.tag,i===13){if(i=c(l),i!==null){n.blockedOn=i,ot(n.priority,function(){m0(l)});return}}else if(i===31){if(i=d(l),i!==null){n.blockedOn=i,ot(n.priority,function(){m0(l)});return}}else if(i===3&&l.stateNode.current.memoizedState.isDehydrated){n.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}n.blockedOn=null}function bc(n){if(n.blockedOn!==null)return!1;for(var i=n.targetContainers;0<i.length;){var l=Bf(n.nativeEvent);if(l===null){l=n.nativeEvent;var u=new l.constructor(l.type,l);Bu=u,l.target.dispatchEvent(u),Bu=null}else return i=Jt(l),i!==null&&h0(i),n.blockedOn=l,!1;i.shift()}return!0}function b0(n,i,l){bc(n)&&l.delete(i)}function zC(){Hf=!1,Li!==null&&bc(Li)&&(Li=null),zi!==null&&bc(zi)&&(zi=null),Ii!==null&&bc(Ii)&&(Ii=null),ko.forEach(b0),Co.forEach(b0)}function xc(n,i){n.blockedOn===i&&(n.blockedOn=null,Hf||(Hf=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,zC)))}var wc=null;function x0(n){wc!==n&&(wc=n,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){wc===n&&(wc=null);for(var i=0;i<n.length;i+=3){var l=n[i],u=n[i+1],h=n[i+2];if(typeof u!="function"){if(Uf(u||l)===null)continue;break}var v=Jt(l);v!==null&&(n.splice(i,3),i-=3,Pd(v,{pending:!0,data:h,method:l.method,action:u},u,h))}}))}function dl(n){function i(z){return xc(z,n)}Li!==null&&xc(Li,n),zi!==null&&xc(zi,n),Ii!==null&&xc(Ii,n),ko.forEach(i),Co.forEach(i);for(var l=0;l<Pi.length;l++){var u=Pi[l];u.blockedOn===n&&(u.blockedOn=null)}for(;0<Pi.length&&(l=Pi[0],l.blockedOn===null);)v0(l),l.blockedOn===null&&Pi.shift();if(l=(n.ownerDocument||n).$$reactFormReplay,l!=null)for(u=0;u<l.length;u+=3){var h=l[u],v=l[u+1],w=h[_e]||null;if(typeof v=="function")w||x0(l);else if(w){var j=null;if(v&&v.hasAttribute("formAction")){if(h=v,w=v[_e]||null)j=w.formAction;else if(Uf(h)!==null)continue}else j=w.action;typeof j=="function"?l[u+1]=j:(l.splice(u,3),u-=3),x0(l)}}}function w0(){function n(v){v.canIntercept&&v.info==="react-transition"&&v.intercept({handler:function(){return new Promise(function(w){return h=w})},focusReset:"manual",scroll:"manual"})}function i(){h!==null&&(h(),h=null),u||setTimeout(l,20)}function l(){if(!u&&!navigation.transition){var v=navigation.currentEntry;v&&v.url!=null&&navigation.navigate(v.url,{state:v.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var u=!1,h=null;return navigation.addEventListener("navigate",n),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(l,100),function(){u=!0,navigation.removeEventListener("navigate",n),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),h!==null&&(h(),h=null)}}}function $f(n){this._internalRoot=n}Sc.prototype.render=$f.prototype.render=function(n){var i=this._internalRoot;if(i===null)throw Error(r(409));var l=i.current,u=Un();f0(l,u,n,i,null,null)},Sc.prototype.unmount=$f.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var i=n.containerInfo;f0(n.current,2,null,n,null,null),nc(),i[cn]=null}};function Sc(n){this._internalRoot=n}Sc.prototype.unstable_scheduleHydration=function(n){if(n){var i=Ke();n={blockedOn:null,target:n,priority:i};for(var l=0;l<Pi.length&&i!==0&&i<Pi[l].priority;l++);Pi.splice(l,0,n),l===0&&v0(n)}};var S0=t.version;if(S0!=="19.2.4")throw Error(r(527,S0,"19.2.4"));ee.findDOMNode=function(n){var i=n._reactInternals;if(i===void 0)throw typeof n.render=="function"?Error(r(188)):(n=Object.keys(n).join(","),Error(r(268,n)));return n=f(i),n=n!==null?y(n):null,n=n===null?null:n.stateNode,n};var IC={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:F,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var kc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!kc.isDisabled&&kc.supportsFiber)try{Pe=kc.inject(IC),Xe=kc}catch{}}return jo.createRoot=function(n,i){if(!o(n))throw Error(r(299));var l=!1,u="",h=Ry,v=Ny,w=_y;return i!=null&&(i.unstable_strictMode===!0&&(l=!0),i.identifierPrefix!==void 0&&(u=i.identifierPrefix),i.onUncaughtError!==void 0&&(h=i.onUncaughtError),i.onCaughtError!==void 0&&(v=i.onCaughtError),i.onRecoverableError!==void 0&&(w=i.onRecoverableError)),i=u0(n,1,!1,null,null,l,u,null,h,v,w,w0),n[cn]=i.current,kf(n),new $f(i)},jo.hydrateRoot=function(n,i,l){if(!o(n))throw Error(r(299));var u=!1,h="",v=Ry,w=Ny,j=_y,z=null;return l!=null&&(l.unstable_strictMode===!0&&(u=!0),l.identifierPrefix!==void 0&&(h=l.identifierPrefix),l.onUncaughtError!==void 0&&(v=l.onUncaughtError),l.onCaughtError!==void 0&&(w=l.onCaughtError),l.onRecoverableError!==void 0&&(j=l.onRecoverableError),l.formState!==void 0&&(z=l.formState)),i=u0(n,1,!0,i,l??null,u,h,z,v,w,j,w0),i.context=d0(null),l=i.current,u=Un(),u=ke(u),h=ki(u),h.callback=null,Ci(l,h,u),l=u,i.current.lanes=l,Zi(i,l),ja(i),n[cn]=i.current,kf(n),new Sc(i)},jo.version="19.2.4",jo}var M0;function YC(){if(M0)return Vf.exports;M0=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Vf.exports=WC(),Vf.exports}var KC=YC();/**
51
+ * react-router v7.17.0
52
+ *
53
+ * Copyright (c) Remix Software Inc.
54
+ *
55
+ * This source code is licensed under the MIT license found in the
56
+ * LICENSE.md file in the root directory of this source tree.
57
+ *
58
+ * @license MIT
59
+ */var D0="popstate";function L0(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function QC(e={}){function t(r,o){var f;let s=(f=o.state)==null?void 0:f.masked,{pathname:c,search:d,hash:p}=s||r.location;return Zp("",{pathname:c,search:d,hash:p},o.state&&o.state.usr||null,o.state&&o.state.key||"default",s?{pathname:r.location.pathname,search:r.location.search,hash:r.location.hash}:void 0)}function a(r,o){return typeof o=="string"?o:Wo(o)}return ZC(t,a,null,e)}function jt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function xa(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function XC(){return Math.random().toString(36).substring(2,10)}function z0(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Zp(e,t,a=null,r,o){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Al(t):t,state:a,key:t&&t.key||r||XC(),mask:o}}function Wo({pathname:e="/",search:t="",hash:a=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),a&&a!=="#"&&(e+=a.charAt(0)==="#"?a:"#"+a),e}function Al(e){let t={};if(e){let a=e.indexOf("#");a>=0&&(t.hash=e.substring(a),e=e.substring(0,a));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function ZC(e,t,a,r={}){let{window:o=document.defaultView,v5Compat:s=!1}=r,c=o.history,d="POP",p=null,f=y();f==null&&(f=0,c.replaceState({...c.state,idx:f},""));function y(){return(c.state||{idx:null}).idx}function m(){d="POP";let A=y(),E=A==null?null:A-f;f=A,p&&p({action:d,location:C.location,delta:E})}function b(A,E){d="PUSH";let R=L0(A)?A:Zp(C.location,A,E);f=y()+1;let _=z0(R,f),U=C.createHref(R.mask||R);try{c.pushState(_,"",U)}catch(I){if(I instanceof DOMException&&I.name==="DataCloneError")throw I;o.location.assign(U)}s&&p&&p({action:d,location:C.location,delta:1})}function x(A,E){d="REPLACE";let R=L0(A)?A:Zp(C.location,A,E);f=y();let _=z0(R,f),U=C.createHref(R.mask||R);c.replaceState(_,"",U),s&&p&&p({action:d,location:C.location,delta:0})}function k(A){return JC(o,A)}let C={get action(){return d},get location(){return e(o,c)},listen(A){if(p)throw new Error("A history only accepts one active listener");return o.addEventListener(D0,m),p=A,()=>{o.removeEventListener(D0,m),p=null}},createHref(A){return t(o,A)},createURL:k,encodeLocation(A){let E=k(A);return{pathname:E.pathname,search:E.search,hash:E.hash}},push:b,replace:x,go(A){return c.go(A)}};return C}function JC(e,t,a=!1){let r="http://localhost";e&&(r=e.location.origin!=="null"?e.location.origin:e.location.href),jt(r,"No window.location.(origin|href) available to create URL");let o=typeof t=="string"?t:Wo(t);return o=o.replace(/ $/,"%20"),!a&&o.startsWith("//")&&(o=r+o),new URL(o,r)}function xx(e,t,a="/"){return eE(e,t,a,!1)}function eE(e,t,a,r,o){let s=typeof t=="string"?Al(t):t,c=di(s.pathname||"/",a);if(c==null)return null;let d=tE(e),p=null,f=pE(c);for(let y=0;p==null&&y<d.length;++y)p=dE(d[y],f,r);return p}function tE(e){let t=wx(e);return nE(t),t}function wx(e,t=[],a=[],r="",o=!1){let s=(c,d,p=o,f)=>{let y={relativePath:f===void 0?c.path||"":f,caseSensitive:c.caseSensitive===!0,childrenIndex:d,route:c};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(r)&&p)return;jt(y.relativePath.startsWith(r),`Absolute route path "${y.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),y.relativePath=y.relativePath.slice(r.length)}let m=ya([r,y.relativePath]),b=a.concat(y);c.children&&c.children.length>0&&(jt(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${m}".`),wx(c.children,t,b,m,p)),!(c.path==null&&!c.index)&&t.push({path:m,score:cE(m,c.index),routesMeta:b})};return e.forEach((c,d)=>{var p;if(c.path===""||!((p=c.path)!=null&&p.includes("?")))s(c,d);else for(let f of Sx(c.path))s(c,d,!0,f)}),t}function Sx(e){let t=e.split("/");if(t.length===0)return[];let[a,...r]=t,o=a.endsWith("?"),s=a.replace(/\?$/,"");if(r.length===0)return o?[s,""]:[s];let c=Sx(r.join("/")),d=[];return d.push(...c.map(p=>p===""?s:[s,p].join("/"))),o&&d.push(...c),d.map(p=>e.startsWith("/")&&p===""?"/":p)}function nE(e){e.sort((t,a)=>t.score!==a.score?a.score-t.score:uE(t.routesMeta.map(r=>r.childrenIndex),a.routesMeta.map(r=>r.childrenIndex)))}var aE=/^:[\w-]+$/,iE=3,rE=2,lE=1,oE=10,sE=-2,I0=e=>e==="*";function cE(e,t){let a=e.split("/"),r=a.length;return a.some(I0)&&(r+=sE),t&&(r+=rE),a.filter(o=>!I0(o)).reduce((o,s)=>o+(aE.test(s)?iE:s===""?lE:oE),r)}function uE(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function dE(e,t,a=!1){let{routesMeta:r}=e,o={},s="/",c=[];for(let d=0;d<r.length;++d){let p=r[d],f=d===r.length-1,y=s==="/"?t:t.slice(s.length)||"/",m=Yc({path:p.relativePath,caseSensitive:p.caseSensitive,end:f},y),b=p.route;if(!m&&f&&a&&!r[r.length-1].route.index&&(m=Yc({path:p.relativePath,caseSensitive:p.caseSensitive,end:!1},y)),!m)return null;Object.assign(o,m.params),c.push({params:o,pathname:ya([s,m.pathname]),pathnameBase:yE(ya([s,m.pathnameBase])),route:b}),m.pathnameBase!=="/"&&(s=ya([s,m.pathnameBase]))}return c}function Yc(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[a,r]=fE(e.path,e.caseSensitive,e.end),o=t.match(a);if(!o)return null;let s=o[0],c=s.replace(/(.)\/+$/,"$1"),d=o.slice(1);return{params:r.reduce((f,{paramName:y,isOptional:m},b)=>{if(y==="*"){let k=d[b]||"";c=s.slice(0,s.length-k.length).replace(/(.)\/+$/,"$1")}const x=d[b];return m&&!x?f[y]=void 0:f[y]=(x||"").replace(/%2F/g,"/"),f},{}),pathname:s,pathnameBase:c,pattern:e}}function fE(e,t=!1,a=!0){xa(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 r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,d,p,f,y)=>{if(r.push({paramName:d,isOptional:p!=null}),p){let m=y.charAt(f+c.length);return m&&m!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function pE(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return xa(!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 di(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let a=t.endsWith("/")?t.length-1:t.length,r=e.charAt(a);return r&&r!=="/"?null:e.slice(a)||"/"}var hE=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function mE(e,t="/"){let{pathname:a,search:r="",hash:o=""}=typeof e=="string"?Al(e):e,s;return a?(a=kx(a),a.startsWith("/")?s=P0(a.substring(1),"/"):s=P0(a,t)):s=t,{pathname:s,search:vE(r),hash:bE(o)}}function P0(e,t){let a=Kc(t).split("/");return e.split("/").forEach(o=>{o===".."?a.length>1&&a.pop():o!=="."&&a.push(o)}),a.length>1?a.join("/"):"/"}function Qf(e,t,a,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${a}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function gE(e){return e.filter((t,a)=>a===0||t.route.path&&t.route.path.length>0)}function zh(e){let t=gE(e);return t.map((a,r)=>r===t.length-1?a.pathname:a.pathnameBase)}function vu(e,t,a,r=!1){let o;typeof e=="string"?o=Al(e):(o={...e},jt(!o.pathname||!o.pathname.includes("?"),Qf("?","pathname","search",o)),jt(!o.pathname||!o.pathname.includes("#"),Qf("#","pathname","hash",o)),jt(!o.search||!o.search.includes("#"),Qf("#","search","hash",o)));let s=e===""||o.pathname==="",c=s?"/":o.pathname,d;if(c==null)d=a;else{let m=t.length-1;if(!r&&c.startsWith("..")){let b=c.split("/");for(;b[0]==="..";)b.shift(),m-=1;o.pathname=b.join("/")}d=m>=0?t[m]:"/"}let p=mE(o,d),f=c&&c!=="/"&&c.endsWith("/"),y=(s||c===".")&&a.endsWith("/");return!p.pathname.endsWith("/")&&(f||y)&&(p.pathname+="/"),p}var kx=e=>e.replace(/\/\/+/g,"/"),ya=e=>kx(e.join("/")),Kc=e=>e.replace(/\/+$/,""),yE=e=>Kc(e).replace(/^\/*/,"/"),vE=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,bE=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,xE=class{constructor(e,t,a,r=!1){this.status=e,this.statusText=t||"",this.internal=r,a instanceof Error?(this.data=a.toString(),this.error=a):this.data=a}};function wE(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function SE(e){let t=e.map(a=>a.route.path).filter(Boolean);return ya(t)||"/"}var Cx=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ex(e,t){let a=e;if(typeof a!="string"||!hE.test(a))return{absoluteURL:void 0,isExternal:!1,to:a};let r=a,o=!1;if(Cx)try{let s=new URL(window.location.href),c=a.startsWith("//")?new URL(s.protocol+a):new URL(a),d=di(c.pathname,t);c.origin===s.origin&&d!=null?a=d+c.search+c.hash:o=!0}catch{xa(!1,`<Link to="${a}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:o,to:a}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Ax=["POST","PUT","PATCH","DELETE"];new Set(Ax);var kE=["GET",...Ax];new Set(kE);var jl=S.createContext(null);jl.displayName="DataRouter";var bu=S.createContext(null);bu.displayName="DataRouterState";var jx=S.createContext(!1);function CE(){return S.useContext(jx)}var Tx=S.createContext({isTransitioning:!1});Tx.displayName="ViewTransition";var EE=S.createContext(new Map);EE.displayName="Fetchers";var AE=S.createContext(null);AE.displayName="Await";var Kn=S.createContext(null);Kn.displayName="Navigation";var as=S.createContext(null);as.displayName="Location";var Ia=S.createContext({outlet:null,matches:[],isDataRoute:!1});Ia.displayName="Route";var Ih=S.createContext(null);Ih.displayName="RouteError";var Rx="REACT_ROUTER_ERROR",jE="REDIRECT",TE="ROUTE_ERROR_RESPONSE";function RE(e){if(e.startsWith(`${Rx}:${jE}:{`))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 NE(e){if(e.startsWith(`${Rx}:${TE}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new xE(t.status,t.statusText,t.data)}catch{}}function _E(e,{relative:t}={}){jt(Tl(),"useHref() may be used only in the context of a <Router> component.");let{basename:a,navigator:r}=S.useContext(Kn),{hash:o,pathname:s,search:c}=is(e,{relative:t}),d=s;return a!=="/"&&(d=s==="/"?a:ya([a,s])),r.createHref({pathname:d,search:c,hash:o})}function Tl(){return S.useContext(as)!=null}function wa(){return jt(Tl(),"useLocation() may be used only in the context of a <Router> component."),S.useContext(as).location}var Nx="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function _x(e){S.useContext(Kn).static||S.useLayoutEffect(e)}function Ph(){let{isDataRoute:e}=S.useContext(Ia);return e?FE():OE()}function OE(){jt(Tl(),"useNavigate() may be used only in the context of a <Router> component.");let e=S.useContext(jl),{basename:t,navigator:a}=S.useContext(Kn),{matches:r}=S.useContext(Ia),{pathname:o}=wa(),s=JSON.stringify(zh(r)),c=S.useRef(!1);return _x(()=>{c.current=!0}),S.useCallback((p,f={})=>{if(xa(c.current,Nx),!c.current)return;if(typeof p=="number"){a.go(p);return}let y=vu(p,JSON.parse(s),o,f.relative==="path");e==null&&t!=="/"&&(y.pathname=y.pathname==="/"?t:ya([t,y.pathname])),(f.replace?a.replace:a.push)(y,f.state,f)},[t,a,s,o,e])}S.createContext(null);function is(e,{relative:t}={}){let{matches:a}=S.useContext(Ia),{pathname:r}=wa(),o=JSON.stringify(zh(a));return S.useMemo(()=>vu(e,JSON.parse(o),r,t==="path"),[e,o,r,t])}function ME(e,t){return Ox(e,t)}function Ox(e,t,a){var A;jt(Tl(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=S.useContext(Kn),{matches:o}=S.useContext(Ia),s=o[o.length-1],c=s?s.params:{},d=s?s.pathname:"/",p=s?s.pathnameBase:"/",f=s&&s.route;{let E=f&&f.path||"";Dx(d,!f||E.endsWith("*")||E.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${d}" (under <Route path="${E}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
60
+
61
+ Please change the parent <Route path="${E}"> to <Route path="${E==="/"?"*":`${E}/*`}">.`)}let y=wa(),m;if(t){let E=typeof t=="string"?Al(t):t;jt(p==="/"||((A=E.pathname)==null?void 0:A.startsWith(p)),`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 "${p}" but pathname "${E.pathname}" was given in the \`location\` prop.`),m=E}else m=y;let b=m.pathname||"/",x=b;if(p!=="/"){let E=p.replace(/^\//,"").split("/");x="/"+b.replace(/^\//,"").split("/").slice(E.length).join("/")}let k=a&&a.state.matches.length?a.state.matches.map(E=>Object.assign(E,{route:a.manifest[E.route.id]||E.route})):xx(e,{pathname:x});xa(f||k!=null,`No routes matched location "${m.pathname}${m.search}${m.hash}" `),xa(k==null||k[k.length-1].route.element!==void 0||k[k.length-1].route.Component!==void 0||k[k.length-1].route.lazy!==void 0,`Matched leaf route at location "${m.pathname}${m.search}${m.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 C=PE(k&&k.map(E=>Object.assign({},E,{params:Object.assign({},c,E.params),pathname:ya([p,r.encodeLocation?r.encodeLocation(E.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathname]),pathnameBase:E.pathnameBase==="/"?p:ya([p,r.encodeLocation?r.encodeLocation(E.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathnameBase])})),o,a);return t&&C?S.createElement(as.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...m},navigationType:"POP"}},C):C}function DE(){let e=qE(),t=wE(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),a=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:r},s={padding:"2px 4px",backgroundColor:r},c=null;return console.error("Error handled by React Router default ErrorBoundary:",e),c=S.createElement(S.Fragment,null,S.createElement("p",null,"💿 Hey developer 👋"),S.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",S.createElement("code",{style:s},"ErrorBoundary")," or"," ",S.createElement("code",{style:s},"errorElement")," prop on your route.")),S.createElement(S.Fragment,null,S.createElement("h2",null,"Unexpected Application Error!"),S.createElement("h3",{style:{fontStyle:"italic"}},t),a?S.createElement("pre",{style:o},a):null,c)}var LE=S.createElement(DE,null),Mx=class extends S.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 a=NE(e.digest);a&&(e=a)}let t=e!==void 0?S.createElement(Ia.Provider,{value:this.props.routeContext},S.createElement(Ih.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?S.createElement(zE,{error:e},t):t}};Mx.contextType=jx;var Xf=new WeakMap;function zE({children:e,error:t}){let{basename:a}=S.useContext(Kn);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=RE(t.digest);if(r){let o=Xf.get(t);if(o)throw o;let s=Ex(r.location,a);if(Cx&&!Xf.get(t))if(s.isExternal||r.reloadDocument)window.location.href=s.absoluteURL||s.to;else{const c=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(s.to,{replace:r.replace}));throw Xf.set(t,c),c}return S.createElement("meta",{httpEquiv:"refresh",content:`0;url=${s.absoluteURL||s.to}`})}}return e}function IE({routeContext:e,match:t,children:a}){let r=S.useContext(jl);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),S.createElement(Ia.Provider,{value:e},a)}function PE(e,t=[],a){let r=a==null?void 0:a.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let o=e,s=r==null?void 0:r.errors;if(s!=null){let y=o.findIndex(m=>m.route.id&&(s==null?void 0:s[m.route.id])!==void 0);jt(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(s).join(",")}`),o=o.slice(0,Math.min(o.length,y+1))}let c=!1,d=-1;if(a&&r){c=r.renderFallback;for(let y=0;y<o.length;y++){let m=o[y];if((m.route.HydrateFallback||m.route.hydrateFallbackElement)&&(d=y),m.route.id){let{loaderData:b,errors:x}=r,k=m.route.loader&&!b.hasOwnProperty(m.route.id)&&(!x||x[m.route.id]===void 0);if(m.route.lazy||k){a.isStatic&&(c=!0),d>=0?o=o.slice(0,d+1):o=[o[0]];break}}}}let p=a==null?void 0:a.onError,f=r&&p?(y,m)=>{var b,x;p(y,{location:r.location,params:((x=(b=r.matches)==null?void 0:b[0])==null?void 0:x.params)??{},pattern:SE(r.matches),errorInfo:m})}:void 0;return o.reduceRight((y,m,b)=>{let x,k=!1,C=null,A=null;r&&(x=s&&m.route.id?s[m.route.id]:void 0,C=m.route.errorElement||LE,c&&(d<0&&b===0?(Dx("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),k=!0,A=null):d===b&&(k=!0,A=m.route.hydrateFallbackElement||null)));let E=t.concat(o.slice(0,b+1)),R=()=>{let _;return x?_=C:k?_=A:m.route.Component?_=S.createElement(m.route.Component,null):m.route.element?_=m.route.element:_=y,S.createElement(IE,{match:m,routeContext:{outlet:y,matches:E,isDataRoute:r!=null},children:_})};return r&&(m.route.ErrorBoundary||m.route.errorElement||b===0)?S.createElement(Mx,{location:r.location,revalidation:r.revalidation,component:C,error:x,children:R(),routeContext:{outlet:null,matches:E,isDataRoute:!0},onError:f}):R()},null)}function Bh(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function BE(e){let t=S.useContext(jl);return jt(t,Bh(e)),t}function UE(e){let t=S.useContext(bu);return jt(t,Bh(e)),t}function HE(e){let t=S.useContext(Ia);return jt(t,Bh(e)),t}function Uh(e){let t=HE(e),a=t.matches[t.matches.length-1];return jt(a.route.id,`${e} can only be used on routes that contain a unique "id"`),a.route.id}function $E(){return Uh("useRouteId")}function qE(){var r;let e=S.useContext(Ih),t=UE("useRouteError"),a=Uh("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[a]}function FE(){let{router:e}=BE("useNavigate"),t=Uh("useNavigate"),a=S.useRef(!1);return _x(()=>{a.current=!0}),S.useCallback(async(o,s={})=>{xa(a.current,Nx),a.current&&(typeof o=="number"?await e.navigate(o):await e.navigate(o,{fromRouteId:t,...s}))},[e,t])}var B0={};function Dx(e,t,a){!t&&!B0[e]&&(B0[e]=!0,xa(!1,a))}S.memo(GE);function GE({routes:e,manifest:t,future:a,state:r,isStatic:o,onError:s}){return Ox(e,void 0,{manifest:t,state:r,isStatic:o,onError:s})}function Po({to:e,replace:t,state:a,relative:r}){jt(Tl(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o}=S.useContext(Kn);xa(!o,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:s}=S.useContext(Ia),{pathname:c}=wa(),d=Ph(),p=vu(e,zh(s),c,r==="path"),f=JSON.stringify(p);return S.useEffect(()=>{d(JSON.parse(f),{replace:t,state:a,relative:r})},[d,f,r,t,a]),null}function $i(e){jt(!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 VE({basename:e="/",children:t=null,location:a,navigationType:r="POP",navigator:o,static:s=!1,useTransitions:c}){jt(!Tl(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let d=e.replace(/^\/*/,"/"),p=S.useMemo(()=>({basename:d,navigator:o,static:s,useTransitions:c,future:{}}),[d,o,s,c]);typeof a=="string"&&(a=Al(a));let{pathname:f="/",search:y="",hash:m="",state:b=null,key:x="default",mask:k}=a,C=S.useMemo(()=>{let A=di(f,d);return A==null?null:{location:{pathname:A,search:y,hash:m,state:b,key:x,mask:k},navigationType:r}},[d,f,y,m,b,x,r,k]);return xa(C!=null,`<Router basename="${d}"> is not able to match the URL "${f}${y}${m}" because it does not start with the basename, so the <Router> won't render anything.`),C==null?null:S.createElement(Kn.Provider,{value:p},S.createElement(as.Provider,{children:t,value:C}))}function WE({children:e,location:t}){return ME(Jp(e),t)}function Jp(e,t=[]){let a=[];return S.Children.forEach(e,(r,o)=>{if(!S.isValidElement(r))return;let s=[...t,o];if(r.type===S.Fragment){a.push.apply(a,Jp(r.props.children,s));return}jt(r.type===$i,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),jt(!r.props.index||!r.props.children,"An index route cannot have child routes.");let c={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(c.children=Jp(r.props.children,s)),a.push(c)}),a}var Pc="get",Bc="application/x-www-form-urlencoded";function xu(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function YE(e){return xu(e)&&e.tagName.toLowerCase()==="button"}function KE(e){return xu(e)&&e.tagName.toLowerCase()==="form"}function QE(e){return xu(e)&&e.tagName.toLowerCase()==="input"}function XE(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function ZE(e,t){return e.button===0&&(!t||t==="_self")&&!XE(e)}var Cc=null;function JE(){if(Cc===null)try{new FormData(document.createElement("form"),0),Cc=!1}catch{Cc=!0}return Cc}var eA=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Zf(e){return e!=null&&!eA.has(e)?(xa(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Bc}"`),null):e}function tA(e,t){let a,r,o,s,c;if(KE(e)){let d=e.getAttribute("action");r=d?di(d,t):null,a=e.getAttribute("method")||Pc,o=Zf(e.getAttribute("enctype"))||Bc,s=new FormData(e)}else if(YE(e)||QE(e)&&(e.type==="submit"||e.type==="image")){let d=e.form;if(d==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let p=e.getAttribute("formaction")||d.getAttribute("action");if(r=p?di(p,t):null,a=e.getAttribute("formmethod")||d.getAttribute("method")||Pc,o=Zf(e.getAttribute("formenctype"))||Zf(d.getAttribute("enctype"))||Bc,s=new FormData(d,e),!JE()){let{name:f,type:y,value:m}=e;if(y==="image"){let b=f?`${f}.`:"";s.append(`${b}x`,"0"),s.append(`${b}y`,"0")}else f&&s.append(f,m)}}else{if(xu(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');a=Pc,r=null,o=Bc,c=e}return s&&o==="text/plain"&&(c=s,s=void 0),{action:r,method:a.toLowerCase(),encType:o,formData:s,body:c}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Hh(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Lx(e,t,a,r){let o=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return a?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${r}`:o.pathname=`${o.pathname}.${r}`:o.pathname==="/"?o.pathname=`_root.${r}`:t&&di(o.pathname,t)==="/"?o.pathname=`${Kc(t)}/_root.${r}`:o.pathname=`${Kc(o.pathname)}.${r}`,o}async function nA(e,t){if(e.id in t)return t[e.id];try{let a=await import(e.module);return t[e.id]=a,a}catch(a){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(a),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function aA(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 iA(e,t,a){let r=await Promise.all(e.map(async o=>{let s=t.routes[o.route.id];if(s){let c=await nA(s,a);return c.links?c.links():[]}return[]}));return sA(r.flat(1).filter(aA).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function U0(e,t,a,r,o,s){let c=(p,f)=>a[f]?p.route.id!==a[f].route.id:!0,d=(p,f)=>{var y;return a[f].pathname!==p.pathname||((y=a[f].route.path)==null?void 0:y.endsWith("*"))&&a[f].params["*"]!==p.params["*"]};return s==="assets"?t.filter((p,f)=>c(p,f)||d(p,f)):s==="data"?t.filter((p,f)=>{var m;let y=r.routes[p.route.id];if(!y||!y.hasLoader)return!1;if(c(p,f)||d(p,f))return!0;if(p.route.shouldRevalidate){let b=p.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:((m=a[0])==null?void 0:m.params)||{},nextUrl:new URL(e,window.origin),nextParams:p.params,defaultShouldRevalidate:!0});if(typeof b=="boolean")return b}return!0}):[]}function rA(e,t,{includeHydrateFallback:a}={}){return lA(e.map(r=>{let o=t.routes[r.route.id];if(!o)return[];let s=[o.module];return o.clientActionModule&&(s=s.concat(o.clientActionModule)),o.clientLoaderModule&&(s=s.concat(o.clientLoaderModule)),a&&o.hydrateFallbackModule&&(s=s.concat(o.hydrateFallbackModule)),o.imports&&(s=s.concat(o.imports)),s}).flat(1))}function lA(e){return[...new Set(e)]}function oA(e){let t={},a=Object.keys(e).sort();for(let r of a)t[r]=e[r];return t}function sA(e,t){let a=new Set;return new Set(t),e.reduce((r,o)=>{let s=JSON.stringify(oA(o));return a.has(s)||(a.add(s),r.push({key:s,link:o})),r},[])}function $h(){let e=S.useContext(jl);return Hh(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function cA(){let e=S.useContext(bu);return Hh(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var qh=S.createContext(void 0);qh.displayName="FrameworkContext";function Fh(){let e=S.useContext(qh);return Hh(e,"You must render this element inside a <HydratedRouter> element"),e}function uA(e,t){let a=S.useContext(qh),[r,o]=S.useState(!1),[s,c]=S.useState(!1),{onFocus:d,onBlur:p,onMouseEnter:f,onMouseLeave:y,onTouchStart:m}=t,b=S.useRef(null);S.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let C=E=>{E.forEach(R=>{c(R.isIntersecting)})},A=new IntersectionObserver(C,{threshold:.5});return b.current&&A.observe(b.current),()=>{A.disconnect()}}},[e]),S.useEffect(()=>{if(r){let C=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(C)}}},[r]);let x=()=>{o(!0)},k=()=>{o(!1),c(!1)};return a?e!=="intent"?[s,b,{}]:[s,b,{onFocus:To(d,x),onBlur:To(p,k),onMouseEnter:To(f,x),onMouseLeave:To(y,k),onTouchStart:To(m,x)}]:[!1,b,{}]}function To(e,t){return a=>{e&&e(a),a.defaultPrevented||t(a)}}function dA({page:e,...t}){let a=CE(),{router:r}=$h(),o=S.useMemo(()=>xx(r.routes,e,r.basename),[r.routes,e,r.basename]);return o?a?S.createElement(pA,{page:e,matches:o,...t}):S.createElement(hA,{page:e,matches:o,...t}):null}function fA(e){let{manifest:t,routeModules:a}=Fh(),[r,o]=S.useState([]);return S.useEffect(()=>{let s=!1;return iA(e,t,a).then(c=>{s||o(c)}),()=>{s=!0}},[e,t,a]),r}function pA({page:e,matches:t,...a}){let r=wa(),{future:o}=Fh(),{basename:s}=$h(),c=S.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let d=Lx(e,s,o.v8_trailingSlashAwareDataRequests,"rsc"),p=!1,f=[];for(let y of t)typeof y.route.shouldRevalidate=="function"?p=!0:f.push(y.route.id);return p&&f.length>0&&d.searchParams.set("_routes",f.join(",")),[d.pathname+d.search]},[s,o.v8_trailingSlashAwareDataRequests,e,r,t]);return S.createElement(S.Fragment,null,c.map(d=>S.createElement("link",{key:d,rel:"prefetch",as:"fetch",href:d,...a})))}function hA({page:e,matches:t,...a}){let r=wa(),{future:o,manifest:s,routeModules:c}=Fh(),{basename:d}=$h(),{loaderData:p,matches:f}=cA(),y=S.useMemo(()=>U0(e,t,f,s,r,"data"),[e,t,f,s,r]),m=S.useMemo(()=>U0(e,t,f,s,r,"assets"),[e,t,f,s,r]),b=S.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let C=new Set,A=!1;if(t.forEach(R=>{var U;let _=s.routes[R.route.id];!_||!_.hasLoader||(!y.some(I=>I.route.id===R.route.id)&&R.route.id in p&&((U=c[R.route.id])!=null&&U.shouldRevalidate)||_.hasClientLoader?A=!0:C.add(R.route.id))}),C.size===0)return[];let E=Lx(e,d,o.v8_trailingSlashAwareDataRequests,"data");return A&&C.size>0&&E.searchParams.set("_routes",t.filter(R=>C.has(R.route.id)).map(R=>R.route.id).join(",")),[E.pathname+E.search]},[d,o.v8_trailingSlashAwareDataRequests,p,r,s,y,t,e,c]),x=S.useMemo(()=>rA(m,s),[m,s]),k=fA(m);return S.createElement(S.Fragment,null,b.map(C=>S.createElement("link",{key:C,rel:"prefetch",as:"fetch",href:C,...a})),x.map(C=>S.createElement("link",{key:C,rel:"modulepreload",href:C,...a})),k.map(({key:C,link:A})=>S.createElement("link",{key:C,nonce:a.nonce,...A,crossOrigin:A.crossOrigin??a.crossOrigin})))}function mA(...e){return t=>{e.forEach(a=>{typeof a=="function"?a(t):a!=null&&(a.current=t)})}}var gA=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{gA&&(window.__reactRouterVersion="7.17.0")}catch{}function yA({basename:e,children:t,useTransitions:a,window:r}){let o=S.useRef();o.current==null&&(o.current=QC({window:r,v5Compat:!0}));let s=o.current,[c,d]=S.useState({action:s.action,location:s.location}),p=S.useCallback(f=>{a===!1?d(f):S.startTransition(()=>d(f))},[a]);return S.useLayoutEffect(()=>s.listen(p),[s,p]),S.createElement(VE,{basename:e,children:t,location:c.location,navigationType:c.action,navigator:s,useTransitions:a})}var zx=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ix=S.forwardRef(function({onClick:t,discover:a="render",prefetch:r="none",relative:o,reloadDocument:s,replace:c,mask:d,state:p,target:f,to:y,preventScrollReset:m,viewTransition:b,defaultShouldRevalidate:x,...k},C){let{basename:A,navigator:E,useTransitions:R}=S.useContext(Kn),_=typeof y=="string"&&zx.test(y),U=Ex(y,A);y=U.to;let I=_E(y,{relative:o}),O=wa(),P=null;if(d){let Q=vu(d,[],O.mask?O.mask.pathname:"/",!0);A!=="/"&&(Q.pathname=Q.pathname==="/"?A:ya([A,Q.pathname])),P=E.createHref(Q)}let[Y,D,T]=uA(r,k),G=wA(y,{replace:c,mask:d,state:p,target:f,preventScrollReset:m,relative:o,viewTransition:b,defaultShouldRevalidate:x,useTransitions:R});function W(Q){t&&t(Q),Q.defaultPrevented||G(Q)}let ae=!(U.isExternal||s),q=S.createElement("a",{...k,...T,href:(ae?P:void 0)||U.absoluteURL||I,onClick:ae?W:t,ref:mA(C,D),target:f,"data-discover":!_&&a==="render"?"true":void 0});return Y&&!_?S.createElement(S.Fragment,null,q,S.createElement(dA,{page:I})):q});Ix.displayName="Link";var vA=S.forwardRef(function({"aria-current":t="page",caseSensitive:a=!1,className:r="",end:o=!1,style:s,to:c,viewTransition:d,children:p,...f},y){let m=is(c,{relative:f.relative}),b=wa(),x=S.useContext(bu),{navigator:k,basename:C}=S.useContext(Kn),A=x!=null&&AA(m)&&d===!0,E=k.encodeLocation?k.encodeLocation(m).pathname:m.pathname,R=b.pathname,_=x&&x.navigation&&x.navigation.location?x.navigation.location.pathname:null;a||(R=R.toLowerCase(),_=_?_.toLowerCase():null,E=E.toLowerCase()),_&&C&&(_=di(_,C)||_);const U=E!=="/"&&E.endsWith("/")?E.length-1:E.length;let I=R===E||!o&&R.startsWith(E)&&R.charAt(U)==="/",O=_!=null&&(_===E||!o&&_.startsWith(E)&&_.charAt(E.length)==="/"),P={isActive:I,isPending:O,isTransitioning:A},Y=I?t:void 0,D;typeof r=="function"?D=r(P):D=[r,I?"active":null,O?"pending":null,A?"transitioning":null].filter(Boolean).join(" ");let T=typeof s=="function"?s(P):s;return S.createElement(Ix,{...f,"aria-current":Y,className:D,ref:y,style:T,to:c,viewTransition:d},typeof p=="function"?p(P):p)});vA.displayName="NavLink";var bA=S.forwardRef(({discover:e="render",fetcherKey:t,navigate:a,reloadDocument:r,replace:o,state:s,method:c=Pc,action:d,onSubmit:p,relative:f,preventScrollReset:y,viewTransition:m,defaultShouldRevalidate:b,...x},k)=>{let{useTransitions:C}=S.useContext(Kn),A=CA(),E=EA(d,{relative:f}),R=c.toLowerCase()==="get"?"get":"post",_=typeof d=="string"&&zx.test(d),U=I=>{if(p&&p(I),I.defaultPrevented)return;I.preventDefault();let O=I.nativeEvent.submitter,P=(O==null?void 0:O.getAttribute("formmethod"))||c,Y=()=>A(O||I.currentTarget,{fetcherKey:t,method:P,navigate:a,replace:o,state:s,relative:f,preventScrollReset:y,viewTransition:m,defaultShouldRevalidate:b});C&&a!==!1?S.startTransition(()=>Y()):Y()};return S.createElement("form",{ref:k,method:R,action:E,onSubmit:r?p:U,...x,"data-discover":!_&&e==="render"?"true":void 0})});bA.displayName="Form";function xA(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Px(e){let t=S.useContext(jl);return jt(t,xA(e)),t}function wA(e,{target:t,replace:a,mask:r,state:o,preventScrollReset:s,relative:c,viewTransition:d,defaultShouldRevalidate:p,useTransitions:f}={}){let y=Ph(),m=wa(),b=is(e,{relative:c});return S.useCallback(x=>{if(ZE(x,t)){x.preventDefault();let k=a!==void 0?a:Wo(m)===Wo(b),C=()=>y(e,{replace:k,mask:r,state:o,preventScrollReset:s,relative:c,viewTransition:d,defaultShouldRevalidate:p});f?S.startTransition(()=>C()):C()}},[m,y,b,a,r,o,t,e,s,c,d,p,f])}var SA=0,kA=()=>`__${String(++SA)}__`;function CA(){let{router:e}=Px("useSubmit"),{basename:t}=S.useContext(Kn),a=$E(),r=e.fetch,o=e.navigate;return S.useCallback(async(s,c={})=>{let{action:d,method:p,encType:f,formData:y,body:m}=tA(s,t);if(c.navigate===!1){let b=c.fetcherKey||kA();await r(b,a,c.action||d,{defaultShouldRevalidate:c.defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:y,body:m,formMethod:c.method||p,formEncType:c.encType||f,flushSync:c.flushSync})}else await o(c.action||d,{defaultShouldRevalidate:c.defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:y,body:m,formMethod:c.method||p,formEncType:c.encType||f,replace:c.replace,state:c.state,fromRouteId:a,flushSync:c.flushSync,viewTransition:c.viewTransition})},[r,o,t,a])}function EA(e,{relative:t}={}){let{basename:a}=S.useContext(Kn),r=S.useContext(Ia);jt(r,"useFormAction must be used inside a RouteContext");let[o]=r.matches.slice(-1),s={...is(e||".",{relative:t})},c=wa();if(e==null){s.search=c.search;let d=new URLSearchParams(s.search),p=d.getAll("index");if(p.some(y=>y==="")){d.delete("index"),p.filter(m=>m).forEach(m=>d.append("index",m));let y=d.toString();s.search=y?`?${y}`:""}}return(!e||e===".")&&o.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),a!=="/"&&(s.pathname=s.pathname==="/"?a:ya([a,s.pathname])),Wo(s)}function AA(e,{relative:t}={}){let a=S.useContext(Tx);jt(a!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Px("useViewTransitionState"),o=is(e,{relative:t});if(!a.isTransitioning)return!1;let s=di(a.currentLocation.pathname,r)||a.currentLocation.pathname,c=di(a.nextLocation.pathname,r)||a.nextLocation.pathname;return Yc(o.pathname,c)!=null||Yc(o.pathname,s)!=null}var jA=bx();const TA="modulepreload",RA=function(e){return"/ui/"+e},H0={},at=function(t,a,r){let o=Promise.resolve();if(a&&a.length>0){let c=function(f){return Promise.all(f.map(y=>Promise.resolve(y).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};document.getElementsByTagName("link");const d=document.querySelector("meta[property=csp-nonce]"),p=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));o=c(a.map(f=>{if(f=RA(f),f in H0)return;H0[f]=!0;const y=f.endsWith(".css"),m=y?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${m}`))return;const b=document.createElement("link");if(b.rel=y?"stylesheet":TA,y||(b.as="script"),b.crossOrigin="",b.href=f,p&&b.setAttribute("nonce",p),document.head.appendChild(b),y)return new Promise((x,k)=>{b.addEventListener("load",x),b.addEventListener("error",()=>k(new Error(`Unable to preload CSS for ${f}`)))})}))}function s(c){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=c,window.dispatchEvent(d),!d.defaultPrevented)throw c}return o.then(c=>{for(const d of c||[])d.status==="rejected"&&s(d.reason);return t().catch(s)})},$0=e=>{let t;const a=new Set,r=(f,y)=>{const m=typeof f=="function"?f(t):f;if(!Object.is(m,t)){const b=t;t=y??(typeof m!="object"||m===null)?m:Object.assign({},t,m),a.forEach(x=>x(t,b))}},o=()=>t,d={setState:r,getState:o,getInitialState:()=>p,subscribe:f=>(a.add(f),()=>a.delete(f))},p=t=e(r,o,d);return d},NA=(e=>e?$0(e):$0),_A=e=>e;function OA(e,t=_A){const a=bn.useSyncExternalStore(e.subscribe,bn.useCallback(()=>t(e.getState()),[e,t]),bn.useCallback(()=>t(e.getInitialState()),[e,t]));return bn.useDebugValue(a),a}const q0=e=>{const t=NA(e),a=r=>OA(t,r);return Object.assign(a,t),a},Cr=(e=>e?q0(e):q0),Bx="dkg-layout",MA=260,Ra={leftCollapsed:!1,rightCollapsed:!1,bottomCollapsed:!0,leftSectionMyProjectsOpen:!0,leftSectionIntegrationsOpen:!1,leftWidth:240,rightWidth:360,bottomHeight:MA},Ux=140,Hx=400,$x=200,qx=500,Fx=120,Qc=600,DA=240;function LA(e,t){if(typeof document>"u")return t;const a=getComputedStyle(document.documentElement).getPropertyValue(e).trim(),r=parseFloat(a);return Number.isFinite(r)?r:t}function Xc(){const e=LA("--header-h",44),t=typeof window<"u"&&window.innerHeight?window.innerHeight:0;if(!t)return Qc;const a=t-e-DA;return Math.max(0,Math.min(Qc,a))}function Uc(e,t,a){return Math.max(t,Math.min(a,e))}function Jf(e,t,a,r){return typeof e!="number"||!Number.isFinite(e)?t:Uc(e,a,r)}function zA(){try{const e=localStorage.getItem(Bx);if(!e)return Ra;const t=JSON.parse(e);return{leftCollapsed:typeof t.leftCollapsed=="boolean"?t.leftCollapsed:Ra.leftCollapsed,rightCollapsed:typeof t.rightCollapsed=="boolean"?t.rightCollapsed:Ra.rightCollapsed,bottomCollapsed:typeof t.bottomCollapsed=="boolean"?t.bottomCollapsed:Ra.bottomCollapsed,leftSectionMyProjectsOpen:typeof t.leftSectionMyProjectsOpen=="boolean"?t.leftSectionMyProjectsOpen:Ra.leftSectionMyProjectsOpen,leftSectionIntegrationsOpen:typeof t.leftSectionIntegrationsOpen=="boolean"?t.leftSectionIntegrationsOpen:Ra.leftSectionIntegrationsOpen,leftWidth:Jf(t.leftWidth,Ra.leftWidth,Ux,Hx),rightWidth:Jf(t.rightWidth,Ra.rightWidth,$x,qx),bottomHeight:Jf(t.bottomHeight,Ra.bottomHeight,Fx,Qc)}}catch{return Ra}}let Ec=null;function oi(e){Ec&&clearTimeout(Ec),Ec=setTimeout(()=>{Ec=null;try{localStorage.setItem(Bx,JSON.stringify(e))}catch{}},150)}function si(e){return{leftCollapsed:e.leftCollapsed,rightCollapsed:e.rightCollapsed,bottomCollapsed:e.bottomCollapsed,leftSectionMyProjectsOpen:e.leftSectionMyProjectsOpen,leftSectionIntegrationsOpen:e.leftSectionIntegrationsOpen,leftWidth:e.leftWidth,rightWidth:e.rightWidth,bottomHeight:e.bottomHeight}}const Ui=zA(),Vn=Cr((e,t)=>({leftCollapsed:Ui.leftCollapsed,rightCollapsed:Ui.rightCollapsed,bottomCollapsed:Ui.bottomCollapsed,bottomMaximised:!1,leftSectionMyProjectsOpen:Ui.leftSectionMyProjectsOpen,leftSectionIntegrationsOpen:Ui.leftSectionIntegrationsOpen,theme:localStorage.getItem("dkg-theme")||"dark",leftWidth:Ui.leftWidth,rightWidth:Ui.rightWidth,bottomHeight:Ui.bottomHeight,toggleLeft:()=>{e(a=>({leftCollapsed:!a.leftCollapsed})),oi(si(t()))},toggleRight:()=>{e(a=>({rightCollapsed:!a.rightCollapsed})),oi(si(t()))},toggleBottom:()=>{e(a=>({bottomCollapsed:!a.bottomCollapsed,bottomMaximised:!1})),oi(si(t()))},toggleBottomMaximised:()=>{e(a=>({bottomMaximised:!a.bottomMaximised,bottomCollapsed:!1})),oi(si(t()))},toggleLeftSectionMyProjects:()=>{e(a=>({leftSectionMyProjectsOpen:!a.leftSectionMyProjectsOpen})),oi(si(t()))},toggleLeftSectionIntegrations:()=>{e(a=>({leftSectionIntegrationsOpen:!a.leftSectionIntegrationsOpen})),oi(si(t()))},setTheme:a=>{localStorage.setItem("dkg-theme",a),e({theme:a})},setLeftWidth:a=>{e({leftWidth:Uc(a,Ux,Hx)}),oi(si(t()))},setRightWidth:a=>{e({rightWidth:Uc(a,$x,qx)}),oi(si(t()))},setBottomHeight:a=>{const r=Math.min(Fx,Xc());e({bottomHeight:Uc(a,r,Qc)}),oi(si(t()))}})),Gh=Cr(e=>({agents:[],activeAgentName:null,nodeStatus:null,setAgents:t=>e({agents:t}),setActiveAgent:t=>e({activeAgentName:t}),setNodeStatus:t=>e({nodeStatus:t})})),IA=[{id:"dashboard",label:"Dashboard",closable:!1}],xn=Cr((e,t)=>({tabs:IA,activeTabId:"dashboard",openTab:a=>{const{tabs:r}=t();r.find(o=>o.id===a.id)?e({activeTabId:a.id}):e({tabs:[...r,a],activeTabId:a.id})},closeTab:a=>{var d;const{tabs:r,activeTabId:o}=t(),s=r.filter(p=>p.id!==a);if(s.length===0)return;const c=o===a?((d=s[Math.max(0,r.findIndex(p=>p.id===a)-1)])==null?void 0:d.id)??s[0].id:o;e({tabs:s,activeTabId:c})},setActiveTab:a=>e({activeTabId:a})}));function Uo(){var a,r;if(typeof((a=globalThis.crypto)==null?void 0:a.randomUUID)=="function")return globalThis.crypto.randomUUID();if(typeof((r=globalThis.crypto)==null?void 0:r.getRandomValues)!="function")throw new Error("This browser cannot generate a secure request ID.");const e=globalThis.crypto.getRandomValues(new Uint8Array(16));e[6]=e[6]&15|64,e[8]=e[8]&63|128;const t=Array.from(e,o=>o.toString(16).padStart(2,"0")).join("");return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}class F0{constructor(t,a=()=>!0){At(this,"maxEntries");At(this,"shouldAdmit");At(this,"entries",new Map);if(this.maxEntries=t,this.shouldAdmit=a,!Number.isSafeInteger(t)||t<1)throw new RangeError("maxEntries must be a positive safe integer")}get size(){return this.entries.size}has(t){return this.entries.has(t)}get(t){if(!this.entries.has(t))return;const a=this.entries.get(t);return this.entries.delete(t),this.entries.set(t,a),a}delete(t){return this.entries.delete(t)}clear(){this.entries.clear()}set(t,a){if(!this.shouldAdmit(t)||(this.entries.delete(t),this.entries.set(t,a),this.entries.size<=this.maxEntries))return;const r=this.entries.keys().next();r.done||this.entries.delete(r.value)}}const PA=256,eh=64*1024,BA=4,UA=2*1024*1024;function HA(){return{small:new F0(PA,e=>e.length<=eh),large:new F0(BA,e=>e.length>eh&&e.length<=UA)}}class $A{constructor(){At(this,"tiers",HA())}tierFor(t){return t.length<=eh?"small":"large"}get(t){return this.tiers[this.tierFor(t)].get(t)}set(t,a){const r=this.tierFor(t);r==="large"&&!a.largeCacheable||this.tiers[r].set(t,a)}}function qA(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function th(e){return e<=1114111&&!(e>=55296&&e<=57343)}function Vt(e,t){if(t<0||t>=e.length)return null;const a=e.charCodeAt(t);if(a!==92){const d=e.codePointAt(t);return d===void 0||!th(d)?null:{codePoint:d,rawWidth:d>65535?2:1}}const r=e[t+1];if(r!=="u"&&r!=="U")return{codePoint:a,rawWidth:1};const o=r==="u"?4:8,s=t+2+o;if(s>e.length)return null;let c=0;for(let d=t+2;d<s;d++){const p=e.charCodeAt(d);if(!qA(p))return null;c=c*16+Number.parseInt(e[d],16)}return th(c)?{codePoint:c,rawWidth:2+o}:null}function Gx(e){return e>=65&&e<=90||e>=97&&e<=122||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=767||e>=880&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}function wu(e){return e===95||Gx(e)}function FA(e){return wu(e)||e===45||e>=48&&e<=57||e===183||e>=768&&e<=879||e>=8255&&e<=8256}function Rl(e,t,a){const r=Vt(e,t);return r&&a(r.codePoint)?r.rawWidth:0}function Vx(e,t){return Rl(e,t,Gx)}function GA(e,t){return Rl(e,t,wu)}function Zc(e,t){return Rl(e,t,FA)}function nh(e,t){return Rl(e,t,a=>a>=48&&a<=57)}function VA(e){return wu(e)||e>=48&&e<=57}function WA(e){return wu(e)||e>=48&&e<=57||e===183||e>=768&&e<=879||e>=8255&&e<=8256}function YA(e,t){return Rl(e,t,VA)}function G0(e,t){return Rl(e,t,WA)}function KA(e,t){const a=Vt(e,t);if(!a||a.codePoint!==63&&a.codePoint!==36)return null;let r=t+a.rawWidth;const o=YA(e,r);if(!o)return null;r+=o;let s=G0(e,r);for(;s;)r+=s,s=G0(e,r);return r}function QA(e,t,a){const r=Vt(e,t);return(r==null?void 0:r.codePoint)===a?r.rawWidth:0}function XA(e,t){const a=Vt(e,t);if(!a||a.codePoint!==34&&a.codePoint!==39)return null;const r=a.codePoint,o=a.rawWidth>1,s=m=>{if(o)return QA(e,m,r);const b=e.codePointAt(m);return b===r?b>65535?2:1:0};let c=t+a.rawWidth;const d=s(c),p=d?s(c+d):0,f=d>0&&p>0;f&&(c+=d+p);let y=!1;for(;c<e.length;){if(!o&&e.charCodeAt(c)===92){if(e[c+1]==="u"||e[c+1]==="U"){const E=Vt(e,c);E||(y=!0),c+=(E==null?void 0:E.rawWidth)??1;continue}const A=e.codePointAt(c+1);c+=1+(A!==void 0&&A>65535?2:1);continue}const m=Vt(e,c);if(!m){y=!0,c++;continue}if(m.codePoint===92){const A=Vt(e,c+m.rawWidth);c+=m.rawWidth+((A==null?void 0:A.rawWidth)??0);continue}const b=s(c);if(!b){c+=m.rawWidth;continue}if(!f)return{end:c+b,closed:!0,malformedUchar:y};const x=c+b,k=s(x),C=k?s(x+k):0;if(k&&C)return{end:x+k+C,closed:!0,malformedUchar:y};c+=m.rawWidth}return{end:e.length,closed:!1,malformedUchar:y}}function V0(e){return e>32&&e!==60&&e!==62&&e!==34&&e!==123&&e!==125&&e!==124&&e!==94&&e!==96&&e!==92}function ZA(e,t,a){let r=t;if(!a){let s=null,c=t;for(;r<e.length;){const d=e.charCodeAt(r);if(d===62)return{end:r+1,logicalValue:s===null?e.slice(t,r):[...s,e.slice(c,r)].join("")};if(d===92){const f=Vt(e,r);if(!f||e[r+1]!=="u"&&e[r+1]!=="U")return null;s??(s=[]),s.push(e.slice(c,r),String.fromCodePoint(f.codePoint)),r+=f.rawWidth,c=r;continue}const p=e.codePointAt(r);if(p===void 0||!th(p)||!V0(p))return null;r+=p>65535?2:1}return null}const o=[];for(;r<e.length;){const s=Vt(e,r);if(!s)return null;if(s.codePoint===62)return{end:r+s.rawWidth,logicalValue:o.join("")};if(!V0(s.codePoint))return null;o.push(String.fromCodePoint(s.codePoint)),r+=s.rawWidth}return null}function JA(e,t){const a=Vt(e,t);return!a||a.codePoint!==60?null:ZA(e,t+a.rawWidth,a.rawWidth>1)}function Yo(e,t,a){const r=Vt(e,t);return(r==null?void 0:r.codePoint)===a?r.rawWidth:0}function W0(e,t){const a=Vt(e,t);return a&&(a.codePoint>=48&&a.codePoint<=57||a.codePoint>=65&&a.codePoint<=70||a.codePoint>=97&&a.codePoint<=102)?a.rawWidth:0}function Wx(e,t){const a=Vt(e,t);if(!a)return 0;if(a.codePoint===37){const s=W0(e,t+a.rawWidth);if(!s)return 0;const c=W0(e,t+a.rawWidth+s);return c?a.rawWidth+s+c:0}if(a.codePoint!==92)return 0;const r=Vt(e,t+a.rawWidth);if(!r)return 0;const o=String.fromCodePoint(r.codePoint);return"_~.-!$&'()*+,;=/?#@%".includes(o)?a.rawWidth+r.rawWidth:0}function ej(e,t){return GA(e,t)||nh(e,t)||Yo(e,t,58)||Wx(e,t)}function tj(e,t){return Zc(e,t)||Yo(e,t,58)||Wx(e,t)}function Y0(e,t){let a=t,r=ej(e,a);if(!r)return a;a+=r;let o=a;for(;a<e.length;){if(r=tj(e,a),r){a+=r,o=a;continue}const s=Yo(e,a,46);if(s){a+=s;continue}break}return o}function nj(e,t){const a=Vx(e,t);if(!a)return;let r=t+a,o=r;for(;r<e.length;){const c=Zc(e,r);if(c){r+=c,o=r;continue}const d=Yo(e,r,46);if(d){r+=d;continue}break}const s=Yo(e,r,58);return s&&r===o?{end:r+s}:void 0}function aj(e){return/\s/u.test(String.fromCodePoint(e))}function ep(e,t,a){for(let r=t;r<a;r++)e[r]=" "}function ij(e,t,a){const r=[];let o=t;for(;o<a;){const s=Vt(e,o);if(!s||o+s.rawWidth>a)return null;r.push(String.fromCodePoint(s.codePoint)),o+=s.rawWidth}return r.join("")}function tp(e,t){let a=t,r=0,o=nh(e,a);for(;o>0;)a+=o,r++,o=nh(e,a);return{end:a,count:r}}function rj(e,t){let a=t;const r=Vt(e,a);((r==null?void 0:r.codePoint)===43||(r==null?void 0:r.codePoint)===45)&&(a+=r.rawWidth);const o=tp(e,a);a=o.end;const s=a,c=Vt(e,a);let d=0,p=!1;if((c==null?void 0:c.codePoint)===46){p=!0;const y=tp(e,a+c.rawWidth);a=y.end,d=y.count}if(o.count===0&&d===0)return null;const f=Vt(e,a);if((f==null?void 0:f.codePoint)===69||(f==null?void 0:f.codePoint)===101){let y=a+f.rawWidth;const m=Vt(e,y);((m==null?void 0:m.codePoint)===43||(m==null?void 0:m.codePoint)===45)&&(y+=m.rawWidth);const b=tp(e,y);if(b.count>0)return b.end}return p&&d===0?o.count>0?s:null:a}function Ro(e,t,a,r,o=ij(t,a,r)){if(o===null)return null;const s={raw:t.slice(a,r),logicalValue:o,start:a,end:r};return e==="word"?{kind:e,...s,upper:o.toUpperCase()}:{kind:e,...s}}function lj(e){return e?e.kind==="variable"||e.kind==="prefixed-name"||e.kind==="number"||e.kind==="iri"||e.kind==="string"?!0:e.kind==="word"?e.upper==="TRUE"||e.upper==="FALSE":e.logicalValue===")":!1}function oj(e,t){return!(t[t.length-1]==="("&&lj(e[e.length-1]))}function sj(e,t){if(t==="("||t==="{"){e.push(t);return}const a=t===")"?"(":t==="}"?"{":void 0;a!==void 0&&e[e.length-1]===a&&e.pop()}function cj(e){var r;const t=[];let a=0;for(;a<e.length;){const o=e[a];if((o==null?void 0:o.kind)!=="word")break;if(o.upper==="BASE"&&((r=e[a+1])==null?void 0:r.kind)==="iri"){a+=2;continue}if(o.upper!=="PREFIX")break;const s=e[a+1],c=e[a+2];if((s==null?void 0:s.kind)!=="prefixed-name"||o.end===s.start||(c==null?void 0:c.kind)!=="iri"||s.logicalValue.indexOf(":")!==s.logicalValue.length-1)break;t.push(s.logicalValue.slice(0,-1)),a+=3}return{endTokenIndex:a,declaredPrefixes:t}}function K0(e){const t=e.split(""),a=[],r=[],o=[];let s=!1,c=0;for(;c<e.length;){const f=Vt(e,c);if(!f)return null;if(aj(f.codePoint)){a.push(String.fromCodePoint(f.codePoint)),c+=f.rawWidth;continue}if(f.codePoint===35){const k=c;c+=f.rawWidth;const C=c;for(;c<e.length&&e[c]!==`
62
+ `&&e[c]!=="\r";)c++;a.push(String.fromCodePoint(f.codePoint),e.slice(C,c)),ep(t,k,c);continue}if(f.codePoint===34||f.codePoint===39){const k=c,C=XA(e,k);if(!C){a.push(String.fromCodePoint(f.codePoint)),c+=f.rawWidth;continue}if(C.malformedUchar)return null;c=C.end,a.push(e.slice(k,c)),ep(t,k,c),r.push({kind:"string",raw:e.slice(k,c),start:k,end:c}),C.closed||(s=!0);continue}if(f.codePoint===60&&oj(r,o)){const k=JA(e,c);if(k!==null){const C=c;c=k.end,a.push(e.slice(C,c)),ep(t,C,c),r.push({kind:"iri",raw:e.slice(C,c),logicalValue:k.logicalValue,start:C,end:c});continue}}if(f.codePoint===63||f.codePoint===36){const k=KA(e,c);if(k!==null){const C=c;c=k;const A=Ro("variable",e,C,c);if(!A)return null;r.push(A),a.push(A.logicalValue);continue}}const y=rj(e,c);if(y!==null){const k=c;c=y;const C=Ro("number",e,k,c);if(!C)return null;r.push(C),a.push(C.logicalValue);continue}if(f.codePoint===58){const k=c;c=Y0(e,c+f.rawWidth);const C=Ro("prefixed-name",e,k,c);if(!C)return null;r.push(C),a.push(C.logicalValue);continue}const m=Vx(e,c);if(m){const k=c,C=nj(e,c);let A;if(C)A="prefixed-name",c=Y0(e,C.end);else{A="word",c+=m;let R=Zc(e,c);for(;R;)c+=R,R=Zc(e,c)}const E=Ro(A,e,k,c);if(!E)return null;r.push(E),a.push(E.logicalValue);continue}const b=c;c+=f.rawWidth;const x=Ro("symbol",e,b,c,String.fromCodePoint(f.codePoint));if(!x)return null;r.push(x),a.push(x.logicalValue),sj(o,x.logicalValue)}const d=t.join(""),p=new Set;for(const f of r)f.kind==="word"&&p.add(f.upper);return{masked:d,materialized:a.join(""),tokens:r,unterminated:s,wordTokens:p,prologue:cj(r)}}function Q0(e){return{status:"malformed-uchar",source:e,masked:" ".repeat(e.length),materialized:e,tokens:[],unterminated:!1,wordTokens:new Set,prologue:{endTokenIndex:0,declaredPrefixes:[]}}}function uj(e,t){return e.unterminated!==t.unterminated||e.tokens.length!==t.tokens.length?!1:e.tokens.every((a,r)=>{const o=t.tokens[r];return(o==null?void 0:o.kind)!==a.kind?!1:a.kind==="string"?o.raw===a.raw:o.kind==="string"?!1:o.logicalValue===a.logicalValue})}function dj(e){const t=K0(e);if(t===null)return Q0(e);if(t.materialized!==e){const a=K0(t.materialized);if(a===null||a.materialized!==t.materialized||!uj(t,a))return Q0(e)}return{status:"valid",source:e,masked:t.masked,materialized:t.materialized,tokens:t.tokens,unterminated:t.unterminated,wordTokens:new Set(t.wordTokens),prologue:t.prologue}}function np(e,t,a){const r=[],o=Array(e.length).fill(-1),s=[],c=[];let d=0,p=!0;for(let f=0;f<e.length;f++){r.push(d);const y=e[f];if(y.kind!=="symbol")continue;if(y.logicalValue===t){c.push(f),d++;continue}if(y.logicalValue!==a)continue;const m=c.pop();m===void 0?p=!1:(o[m]=f,o[f]=m,s.push({openingTokenIndex:m,closingTokenIndex:f,depth:r[m]})),d--}return Object.freeze({depthBefore:Object.freeze(r),matchingTokenIndexes:Object.freeze(o),ranges:Object.freeze(s.sort((f,y)=>f.openingTokenIndex-y.openingTokenIndex)),balanced:p&&c.length===0&&d===0})}function fj(e){const{tokens:t}=e,a=np(t,"{","}"),r=np(t,"(",")"),o=np(t,"[","]");return Object.freeze({braces:a,parentheses:r,brackets:o,balanced:a.balanced&&r.balanced&&o.balanced})}function X0(e,t,a=0,r=e.depthBefore.length){const o=[];for(let s=a;s<r;s++)e.depthBefore[s]===t&&o.push(s);return o}function pj(e,t){let a=!1,r=!1,o=!1,s=e.source.length;for(const[c,d]of e.tokens.entries()){if(d.kind!=="word"||t.braces.depthBefore[c]!==0)continue;d.upper==="LIMIT"&&(a=!0),d.upper==="OFFSET"&&(r=!0),d.upper==="VALUES"&&(s=Math.min(s,d.start));const p=e.tokens[c+1];d.upper==="ORDER"&&(p==null?void 0:p.kind)==="word"&&p.upper==="BY"&&(o=!0)}return{hasLimit:a,hasOffset:r,hasOrderBy:o,insertionOffset:s}}function Yx(e){return(e==null?void 0:e.kind)==="iri"?e.logicalValue:null}function hj(e){const t=new Map;for(let a=0;a+2<e.prologue.endTokenIndex;a++){const r=e.tokens[a],o=e.tokens[a+1],s=e.tokens[a+2];if((r==null?void 0:r.kind)!=="word"||r.upper!=="PREFIX"||(o==null?void 0:o.kind)!=="prefixed-name"||!o.logicalValue.endsWith(":"))continue;const c=Yx(s);c!==null&&t.set(o.logicalValue.slice(0,-1),c),a+=2}return t}function mj(e,t){const{tokens:a}=e,r=[];let o=-1;for(const f of X0(t.braces,0)){const y=a[f];if((y==null?void 0:y.kind)==="word"&&y.upper==="WHERE"){const m=a[f+1];if((m==null?void 0:m.kind)!=="symbol"||m.logicalValue!=="{")return null;o=f+1;break}(y==null?void 0:y.kind)==="symbol"&&y.logicalValue==="{"&&r.push(f)}const s=o>=0?o:t.braces.balanced?r.at(-1)??-1:-1;if(s<0)return null;const c=t.braces.matchingTokenIndexes[s]??-1;if(c<0)return null;const d=t.braces.depthBefore[s]+1,p=X0(t.braces,d,s+1,c).some(f=>{const y=a[f];return(y==null?void 0:y.kind)==="word"&&y.upper==="UNION"});return{openStart:a[s].start,openEnd:a[s].end,close:a[c].start,hasUnion:p,openingTokenIndex:s,closingTokenIndex:c}}function Z0(e,t,a){const r=[],o=new Set;for(let s=t;s<a;s++){const c=e.tokens[s];if((c==null?void 0:c.kind)!=="variable")continue;const d=c.logicalValue.slice(1);o.has(d)||(o.add(d),r.push({source:c.raw,logicalName:d}))}return r}function gj(e){const t=fj(e),a=mj(e,t),r=e.tokens[e.prologue.endTokenIndex],o=hj(e),s=t.braces.depthBefore,c=[],d=[],p=new Set;let f=!1,y=!1;for(let m=0;m<e.tokens.length;m++){const b=e.tokens[m];if(b.kind!=="word"||(b.upper==="FROM"&&(f=!0),b.upper==="SERVICE"&&(y=!0),b.upper!=="GRAPH"))continue;const x=e.tokens[m+1];if((x==null?void 0:x.kind)==="variable"){const C={source:x.raw,logicalName:x.logicalValue.slice(1)};c.push({kind:"variable",variable:C,keywordTokenIndex:m,targetTokenIndex:m+1,braceDepth:s[m]}),p.has(C.logicalName)||(p.add(C.logicalName),d.push(C));continue}const k=Yx(x);if(k!==null){c.push({kind:"iri",iri:k,keywordTokenIndex:m,targetTokenIndex:m+1,braceDepth:s[m]});continue}if((x==null?void 0:x.kind)==="prefixed-name"){const C=x.logicalValue.indexOf(":"),A=o.get(x.logicalValue.slice(0,C));if(C>=0&&A!==void 0){c.push({kind:"iri",iri:`${A}${x.logicalValue.slice(C+1)}`,keywordTokenIndex:m,targetTokenIndex:m+1,braceDepth:s[m]});continue}}c.push({kind:"invalid",keywordTokenIndex:m,targetTokenIndex:m+1,braceDepth:s[m]})}return{source:e.source,prepared:e,structure:t,operation:(r==null?void 0:r.kind)==="word"?r.upper:null,where:a,queryVariables:Z0(e,0,e.tokens.length),whereVariables:a?Z0(e,a.openingTokenIndex+1,a.closingTokenIndex):[],prefixes:o,hasDatasetClause:f,hasServiceClause:y,solutionModifiers:pj(e,t),hasGraphClause:c.length>0,graphTargets:c,graphVariables:d}}const yj=["SELECT","CONSTRUCT","ASK","DESCRIBE"],Kx=["INSERT","DELETE","LOAD","CLEAR","DROP","CREATE","COPY","MOVE","ADD"],vj=[...Kx,"WITH"],J0=new $A,bj=new Set(Kx),xj=new Set(vj),wj=new Set(yj);function Sj(e){const{operation:t}=e;return t===null?"UNKNOWN":Qx(t)||Xx(t)?t:"UNKNOWN"}function Qx(e){return wj.has(e)}function Xx(e){return xj.has(e)}function kj(e){return Qx(e)?{kind:"read",form:e}:Xx(e)?{kind:"update"}:{kind:"unknown"}}function ap(e){return{operation:kj(e.form),mutatingKeyword:e.mutatingKeyword}}function e1(e){if(e.status!=="valid")return Object.freeze({facts:Object.freeze({form:"UNKNOWN",mutatingKeyword:null}),largeCacheable:!1});const t=gj(e),a=Sj(t),r=e.tokens.find(o=>o.kind==="word"&&bj.has(o.upper));return Object.freeze({facts:Object.freeze({form:a,mutatingKeyword:(r==null?void 0:r.kind)==="word"?r.raw:null}),largeCacheable:a!=="UNKNOWN"&&!e.unterminated&&t.structure.balanced})}function Cj(e){if(typeof e!="string")return ap(e1(e).facts);const t=J0.get(e);if(t)return ap(t.facts);const a=e1(dj(e));return J0.set(e,a),ap(a.facts)}function Zx(e){return Cj(e).operation}const Jc="dkg.apiToken",Ej="/api/agent/identity";let Vh;const ah=new Set;function Jx(){if(!(typeof window>"u"))try{return window.sessionStorage.getItem(Jc)||void 0}catch{return}}function Wh(){if(!(typeof window>"u"))return window.__DKG_TOKEN__||void 0}function ew(){return Vh??Jx()}function Er(){return Wh()??ew()}function Aj(){return Wh()!==void 0}function jj(){const e=Er();return e!==void 0&&(e===Wh()||e===Jx())}function Tj(e){const t=e.trim();if(!t||typeof window>"u")return!1;Vh=t;try{return window.sessionStorage.setItem(Jc,t),!0}catch{try{window.sessionStorage.removeItem(Jc)}catch{}for(const a of ah)try{a()}catch{}return!1}}function Rj(){if(Vh=void 0,!(typeof window>"u"))try{window.sessionStorage.removeItem(Jc)}catch{}}function Nj(e){return ah.add(e),()=>{ah.delete(e)}}async function _j(e=fetch){const t=Er();try{const a=await e(Ej,{headers:t?{Authorization:`Bearer ${t}`}:{},cache:"no-store"});return a.status===401?"required":a.ok?"accepted":"unknown"}catch{return"unknown"}}const da="";function Rt(){const e=Er();return e?{Authorization:`Bearer ${e}`}:{}}class Wt extends Error{constructor(a,r,o){super(r??`HTTP ${a}`);At(this,"status");At(this,"body");this.status=a,this.body=o}}async function Yh(e,t={},a=1e4){try{return await fetch(e,{...t,signal:AbortSignal.timeout(a)})}catch(r){throw r instanceof Error&&r.name==="TimeoutError"?new Error(`Request timed out after ${Math.round(a/1e3)}s`):r}}const tw=24e4;class nw extends Error{constructor(a){super(a);At(this,"outcomeUnknown",!0);this.name="OutcomeUnknownError"}}async function aw(e,t,a){const r=new AbortController,o=setTimeout(()=>r.abort(),tw);try{const s=await fetch(`${da}${e}`,{...t,signal:r.signal});if(!s.ok){const c=await s.json().catch(()=>({})),d=(c==null?void 0:c.error)??`HTTP ${s.status}`;throw new Wt(s.status,d,c)}return await s.json()}catch(s){throw r.signal.aborted&&!(s instanceof Wt)?new nw(a):s}finally{clearTimeout(o)}}function iw(e,t,a){return aw(e,{method:"POST",headers:{"Content-Type":"application/json",...Rt()},body:JSON.stringify(t)},a)}async function et(e){const t=await fetch(`${da}${e}`,{headers:Rt()});if(!t.ok){const a=await t.json().catch(()=>({})),r=(a==null?void 0:a.error)??`HTTP ${t.status}`;throw new Wt(t.status,r,a)}return t.json()}async function Nl(e){const t=await fetch(`${da}${e}`,{headers:Rt()});if(!t.ok){const a=await t.json().catch(()=>({})),r=(a==null?void 0:a.error)??`HTTP ${t.status}`;throw new Wt(t.status,r,a)}return t.json()}async function Kh(e,t){const a=await Yh(`${da}${e}`,{headers:Rt()},t);if(!a.ok){const r=await a.json().catch(()=>({})),o=(r==null?void 0:r.error)??`HTTP ${a.status}`;throw new Wt(a.status,o,r)}return a.json()}async function nn(e,t){const a=await fetch(`${da}${e}`,{method:"POST",headers:{"Content-Type":"application/json",...Rt()},body:JSON.stringify(t)});if(!a.ok){const r=await a.json().catch(()=>({})),o=(r==null?void 0:r.error)??`HTTP ${a.status}`;throw new Wt(a.status,o,r)}return a.json()}async function Qh(e,t){const a=await fetch(`${da}${e}`,{method:"PUT",headers:{"Content-Type":"application/json",...Rt()},body:JSON.stringify(t)});if(!a.ok){const r=await a.json().catch(()=>({})),o=(r==null?void 0:r.error)??`HTTP ${a.status}`;throw new Error(o)}return a.json()}async function Oj(e){const t=await fetch(`${da}${e}`,{method:"DELETE",headers:Rt()});if(!t.ok){const a=await t.json().catch(()=>({})),r=(a==null?void 0:a.error)??`HTTP ${t.status}`;throw new Wt(t.status,r,a)}return t.json()}async function Mj(e,t){if(!t)return await e(void 0);if(t.aborted)return null;let a;const r=new Promise(o=>{a=()=>o(null),t.addEventListener("abort",a,{once:!0})});try{return await Promise.race([e(t),r])}finally{t.removeEventListener("abort",a)}}const Dj=6e4,Lj=8*1024*1024;class ih extends Error{constructor(t){super(`Query response exceeded ${t} bytes. Use a narrower query to inspect further data.`),this.maxBytes=t,this.name="QueryResponseLimitError"}}async function zj(e,t,a,r){var f,y;for(const m of[a.timeoutMs,a.maxResponseBytes])if(m!==null&&(!Number.isFinite(m)||m<=0))throw new RangeError("Query budgets must be positive and finite, or explicitly null.");const o=new AbortController;let s;const c=a.timeoutMs===null?void 0:setTimeout(()=>{o.abort(new Error(`Request timed out after ${Math.round(a.timeoutMs/1e3)}s`))},a.timeoutMs),d=async m=>{const b=await Mj(async()=>({value:await m()}),o.signal);if(b===null)throw o.signal.reason;return b.value},p=m=>{if(a.maxResponseBytes!==null&&m>a.maxResponseBytes){const b=new ih(a.maxResponseBytes);throw o.abort(b),b}};try{const m=await d(()=>fetch(e,{...t,signal:o.signal}));r(m);const b=(f=m.headers)==null?void 0:f.get("Content-Length");if(b&&Number.isFinite(Number(b))&&p(Number(b)),!((y=m.body)!=null&&y.getReader)){const R=await d(()=>m.json());return p(new TextEncoder().encode(JSON.stringify(R)).byteLength),{response:m,body:R}}s=m.body.getReader();const x=[];let k=0;for(;;){const R=s,{value:_,done:U}=await d(()=>R.read());if(U)break;k+=_.byteLength,p(k),x.push(_)}const C=new Uint8Array(k);let A=0;for(const R of x)C.set(R,A),A+=R.byteLength;const E=new TextDecoder().decode(C);try{return{response:m,body:JSON.parse(E)}}catch(R){if(!m.ok&&R instanceof SyntaxError)return{response:m,body:{}};throw R}}finally{c!==void 0&&clearTimeout(c),o.signal.aborted&&(s==null||s.cancel(o.signal.reason).catch(()=>{}));try{s==null||s.releaseLock()}catch{}}}class Ij{constructor(t=32*1024*1024,a=64){At(this,"entries",new Map);At(this,"bytes",0);this.maxBytes=t,this.maxEntries=a}get(t,a){const r=this.entries.get(t);if(r){if(Date.now()-r.at>=a){this.remove(t);return}return this.entries.delete(t),this.entries.set(t,r),r.value}}set(t,a,r){const o=JSON.stringify(a).length*2;if(this.remove(t),!(o>this.maxBytes)){for(;this.entries.size>=this.maxEntries||this.bytes+o>this.maxBytes;)this.remove(this.entries.keys().next().value);this.entries.set(t,{value:a,at:Date.now(),bytes:o,scope:r}),this.bytes+=o}}invalidate(t){for(const[a,r]of this.entries)(!t||r.scope===t)&&this.remove(a)}remove(t){const a=this.entries.get(t);a&&(this.bytes-=a.bytes),this.entries.delete(t)}}class rw{constructor(t,a){At(this,"values");At(this,"requests",new Map);this.values=new Ij(t,a)}run(t,a,r){var p;const o=a.maxAgeMs>0?this.values.get(t,a.maxAgeMs):void 0;if(o!==void 0)return Promise.resolve(o);const s=(p=this.requests.get(t))==null?void 0:p.promise;if(s)return s;const c={scope:a.scope},d=()=>this.requests.get(t)===c;this.requests.set(t,c);try{return c.promise=r(d).then(f=>(a.maxAgeMs>0&&d()&&this.values.set(t,f,a.scope),f)).finally(()=>{d()&&this.requests.delete(t)}),c.promise}catch(f){return d()&&this.requests.delete(t),Promise.reject(f)}}invalidate(t){this.values.invalidate(t);for(const[a,r]of this.requests)(!t||r.scope===t)&&this.requests.delete(a)}}const lw=300*1e3,Pj=6e4;function Bj(e,t){var d;const a=e&&typeof e=="object"&&!Array.isArray(e)?e:{},r=a.result??a.results,o=r&&typeof r=="object"&&!Array.isArray(r)?r:{};if(o.type==="boolean"&&typeof o.value=="boolean")return{result:{type:"boolean",value:o.value}};if(o.type==="quads"&&Array.isArray(o.quads))return{result:{type:"quads",quads:o.quads}};if(o.type==="bindings"&&Array.isArray(o.bindings))return{result:{type:"bindings",bindings:o.bindings}};const s=Zx(t),c=Array.isArray(o.bindings)?o.bindings:[];if(s.kind==="read"&&s.form==="ASK"){const p=(d=c[0])==null?void 0:d.result,f=p&&typeof p=="object"&&!Array.isArray(p)?p.value:p;return{result:{type:"boolean",value:String(f).toLowerCase()==="true"}}}return s.kind==="read"&&(s.form==="CONSTRUCT"||s.form==="DESCRIBE")?{result:{type:"quads",quads:Array.isArray(o.quads)?o.quads:[]}}:{result:{type:"bindings",bindings:c}}}const rh=new rw(2*1024*1024,1),ow=new rw;let eu="";function va(e){rh.invalidate(),ow.invalidate(e||void 0)}function sw(e,t={}){const a=Rt(),r=JSON.stringify(a);r!==eu&&(va(),eu=r);const o=String(e.contextGraphId??""),s=JSON.stringify(e),c=t.timeoutMs===void 0?Dj:t.timeoutMs,d=t.maxResponseBytes===void 0?Lj:t.maxResponseBytes,p=JSON.stringify([r,s,c,d]),f=t.maxAgeMs??0,y=Zx(String(e.sparql??"")).kind,m=f>0&&y==="read",b={method:"POST",headers:{"Content-Type":"application/json",...a},body:s};return ow.run(p,{scope:o,maxAgeMs:m?f:0},async x=>{const{response:k,body:C}=await zj(`${da}/api/query`,b,{timeoutMs:c,maxResponseBytes:d},E=>{x()&&(E.status===401||E.status===403)&&va()});if(!k.ok){const E=C,R=(E==null?void 0:E.error)??`HTTP ${k.status}`;throw new Wt(k.status,R,E)}const A=Bj(C,String(e.sparql??""));if(r!==JSON.stringify(Rt()))throw new Wt(401,"The session changed while loading data.");return y!=="read"&&va(o||void 0),A})}const Uj=(e,t={},a={})=>sw({sparql:e,...t},a);async function Xh(e={}){const t=JSON.stringify(Rt());return t!==eu&&(va(),eu=t),e.fresh&&rh.invalidate(),rh.run(t,{maxAgeMs:lw},a=>Kh("/api/context-graph/list",Pj).then(r=>{if(t!==JSON.stringify(Rt()))throw new Wt(401,"The session changed while loading data.");return{contextGraphs:(r.contextGraphs??[]).filter(s=>!s.isSystem)}}).catch(r=>{throw a()&&r instanceof Wt&&(r.status===401||r.status===403)&&va(),r}))}const t1=(e,t,a)=>{const r=new URLSearchParams;t&&r.set("key",t),a!=null&&a.extended&&r.set("extended","1");const o=r.toString();return Nl(`/api/pca/${encodeURIComponent(e)}${o?`?${o}`:""}`).then(s=>a!=null&&a.extended?{...s,extendedRequested:!0}:s)},x9=e=>nn("/api/pca",{tokens:e.tokens,primaryNode:e.primaryNode}),w9=(e,t)=>nn(`/api/pca/${encodeURIComponent(e)}/agent`,{agent:t}),S9=(e,t)=>Oj(`/api/pca/${encodeURIComponent(e)}/agent/${encodeURIComponent(t)}`),k9=(e,t)=>nn(`/api/pca/${encodeURIComponent(e)}/funds`,{tokens:t}),C9=e=>nn(`/api/pca/${encodeURIComponent(e)}/settle`,{}),E9=e=>Nl(`/api/pca/${encodeURIComponent(e)}/agents`),A9=e=>Nl(`/api/pca/agent/${encodeURIComponent(e)}`),j9=e=>Nl("/api/pca/mine?hydrate=1"),T9=e=>Nl(`/api/pca/designatable-nodes${e!=null&&e.fresh?"?fresh=1":""}`),Hj=()=>Nl("/api/pca/contracts");function cw(e){var a;if(!(e instanceof Wt))return!1;const t=(a=e.body)==null?void 0:a.code;return typeof t=="string"&&(t.startsWith("RPC_")||t==="TIMEOUT")}function R9(e){return e instanceof Wt&&e.status===503&&!cw(e)}function N9(e){if(!(e instanceof Wt)||e.status!==503)return!1;const t=e.body;return(t==null?void 0:t.code)==="PCA_LOOKUP_READ_FAILED"||(t==null?void 0:t.error)==="PCA_LOOKUP_READ_FAILED"}const $j=["PrimaryNodeNotInShardingTable","PrimaryNodeUnchanged","PrimaryNodeChangeRateLimited","ZeroPrimaryNode","InvalidAmount","ZeroAgentAddress","TokenTransferFailed","NotAccountOwner","AgentAlreadyRegistered","AgentNotRegistered","AgentCapReached","AccountExpired","AccountAlreadyFullySettled","UnknownAccount"];function _9(e,t={}){if(!(e instanceof Wt))return null;const a=e.status,r=e.body??{},o=typeof r.error=="string"&&r.error.length>0?r.error:e.message,s=t.accountId?`PCA #${t.accountId}`:"this Publisher Conviction Account",c=r.existingAccountId!=null?String(r.existingAccountId):void 0;if(cw(e))return{code:"ServerError",status:a,message:"The chain RPC is temporarily unavailable — try again."};if(a===503)return{code:"FEATURE_UNAVAILABLE",status:a,message:"Publisher Conviction Accounts aren't available on this network."};const d=$j.find(p=>new RegExp(`\\b${p}\\b`).test(o));if(d){let p;switch(d){case"InvalidAmount":p="Enter a TRAC amount greater than 0.";break;case"PrimaryNodeNotInShardingTable":p="That primary node isn't a staked node in the sharding table.";break;case"ZeroPrimaryNode":p="Choose a staked node as the primary node.";break;case"PrimaryNodeUnchanged":p="That's already this account's primary node.";break;case"PrimaryNodeChangeRateLimited":p="The primary node was changed too recently — try again later.";break;case"ZeroAgentAddress":p="Enter a valid operational wallet address.";break;case"TokenTransferFailed":p="The TRAC transfer failed — check the owner wallet's TRAC balance and allowance.";break;case"NotAccountOwner":p=`This node isn't the owner of ${s}, so it can't manage it.`;break;case"UnknownAccount":p=`${s} doesn't exist.`;break;case"AgentAlreadyRegistered":p=c?`This operational wallet is already an approved publishing wallet on PCA #${c} — deregister it there first.`:"This operational wallet is already approved on another PCA — deregister it there first.";break;case"AgentNotRegistered":p=`This operational wallet isn't an approved publishing wallet on ${s}.`;break;case"AgentCapReached":p=`${s} already has the maximum 100 approved publishing wallets.`;break;case"AccountExpired":p=`${s} has expired.`;break;case"AccountAlreadyFullySettled":p=`${s} is already fully settled.`;break;default:p=o}return{code:d,status:a,message:p,...c?{existingAccountId:c}:{}}}return a===404?{code:"UnknownAccount",status:a,message:`${s} doesn't exist.`}:a===403?{code:"NotAccountOwner",status:a,message:`This node isn't the owner of ${s}, so it can't manage it.`}:a===400?{code:"BadRequest",status:a,message:o}:a===409?{code:"Conflict",status:a,message:o}:a>=500?{code:"ServerError",status:a,message:"Something went wrong talking to the chain — try again."}:{code:"Unknown",status:a,message:o}}var Xt;(function(e){e.WorkingMemory="WM",e.SharedWorkingMemory="SWM",e.VerifiableMemory="VM"})(Xt||(Xt={}));function ip(e){switch(e){case Xt.WorkingMemory:return"_working_memory";case Xt.SharedWorkingMemory:return"_shared_memory";case Xt.VerifiableMemory:return"_verifiable_memory"}}var n1;(function(e){e[e.SelfAttested=0]="SelfAttested",e[e.Endorsed=1]="Endorsed",e[e.PartiallyVerified=2]="PartiallyVerified",e[e.ConsensusVerified=3]="ConsensusVerified"})(n1||(n1={}));var a1;(function(e){e.CREATE="CREATE",e.UPDATE="UPDATE"})(a1||(a1={}));Xt.WorkingMemory,Xt.SharedWorkingMemory,Xt.VerifiableMemory,Xt.VerifiableMemory;Xt.WorkingMemory,Xt.SharedWorkingMemory,Xt.SharedWorkingMemory,Xt.VerifiableMemory;const O9=["working-memory","shared-working-memory","verifiable-memory"],qj=(1n<<72n)-1n;qj.toString();class Fj extends Error{constructor(t){super(t),this.name="UnsafeSparqlValueError"}}const Gj=/[<>"{}|\\^`\x00-\x20]/,Vj=/^[a-zA-Z][a-zA-Z0-9+.-]*:[^\s<>"{}|\\^`\x00-\x20]+$/;function Wj(e){if(!e||Gj.test(e))throw new Fj(`Unsafe or empty IRI value: ${e}`);return e}function Yj(e){return e?Vj.test(e):!1}function Ma(e){return Wj(e),`<${e}>`}function Zh(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}function M9(e){return`"${Zh(e)}"`}function D9(e){const t="did:dkg:context-graph:";if(!e.startsWith(t))return;const a=e.slice(t.length).split("/");if(a.length<4)return;const r=a[a.length-1],o=a[a.length-2];if(a[a.length-3]!=="assertion"||r.length===0||o.length===0)return;const s=a.slice(0,a.length-3).join("/");return s.length===0?void 0:{scope:s,agentAddress:o,name:r}}ip(Xt.WorkingMemory),Xt.WorkingMemory,ip(Xt.SharedWorkingMemory),Xt.SharedWorkingMemory,ip(Xt.VerifiableMemory),Xt.VerifiableMemory;function L9(e,t){return`did:dkg:context-graph:${e}/${t}`}function z9(e){return!e||e.length===0?{valid:!1,reason:"Sub-graph name cannot be empty"}:e.startsWith("_")?{valid:!1,reason:'Sub-graph names starting with "_" are reserved for protocol graphs'}:e.includes("/")?{valid:!1,reason:'Sub-graph names cannot contain "/"'}:/[<>"{}|^`\\\s]/.test(e)?{valid:!1,reason:"Sub-graph name contains characters unsafe for IRIs"}:e==="context"||e==="assertion"||e==="draft"?{valid:!1,reason:`"${e}" is a reserved path segment`}:{valid:!0}}function Jh(e){if(!e)return"";const t=e.match(/^"([\s\S]*)"(?:\^\^<[^>]+>)?(?:@[A-Za-z0-9-]+)?$/);if(!t)return e;try{return JSON.parse(`"${t[1]}"`)}catch{return t[1]}}function uw(e){return e!==null&&typeof e=="object"&&"value"in e?e:void 0}function em(e){const t=uw(e);if(t)return String(t.value);if(e==null)return;const a=String(e);return a.startsWith("<")&&a.endsWith(">")?a.slice(1,-1):Jh(a)}function Kj(e){const t=uw(e);if(!t)return e==null?void 0:String(e);if(t.type==="bnode")return`_:${t.value.replace(/^_:/,"")}`;if(t.type==="literal"||t.type==="typed-literal"){const a=JSON.stringify(t.value);return t["xml:lang"]?`${a}@${t["xml:lang"]}`:t.datatype?`${a}^^<${t.datatype}>`:a}return String(t.value)}const i1="did:dkg:context-graph:",Qj=6e4;function tm(e){return`${e} got no response within ${tw/6e4} minutes. The outcome is unknown: the node keeps working after the page stops waiting, so it may still complete. Check the Knowledge Asset's history before retrying.`}function dw(e){const t=e.trim();return t.startsWith(i1)?t.slice(i1.length):t}class tu extends Error{constructor(a,r={}){super(a);At(this,"status");At(this,"code");At(this,"source");At(this,"details");At(this,"correlationId");At(this,"timeoutMs");At(this,"target");At(this,"route");At(this,"integrationId");At(this,"retryable");At(this,"text");At(this,"timedOut");this.name="LocalAgentApiError",Object.assign(this,r)}}const Xj=()=>et("/api/status"),I9=()=>et("/api/settings/retention"),P9=e=>Qh("/api/settings/retention",{retentionDays:e}),B9=()=>et("/api/settings/telemetry"),U9=e=>Qh("/api/settings/telemetry",{enabled:e}),Zj=()=>et("/api/connections"),Jj=(e,t=1e4)=>Yh(`${da}/api/connect`,{method:"POST",headers:{"Content-Type":"application/json",...Rt()},body:JSON.stringify({multiaddr:e})},t).then(async a=>{if(!a.ok){const r=await a.json().catch(()=>({})),o=(r==null?void 0:r.error)??`HTTP ${a.status}`;throw new Error(o)}return a.json()}),eT=(e,t=2e4)=>Yh(`${da}/api/connect`,{method:"POST",headers:{"Content-Type":"application/json",...Rt()},body:JSON.stringify({peerId:e})},t).then(async a=>{if(!a.ok){const r=await a.json().catch(()=>({})),o=(r==null?void 0:r.error)??`HTTP ${a.status}`;throw new Error(o)}return a.json()}),fw=()=>et("/api/agents"),tT=()=>et("/api/metrics"),H9=(e,t,a=300)=>et(`/api/metrics/history?from=${e}&to=${t}&maxPoints=${a}`),nT=(e={})=>{const t=new URLSearchParams({...e,phases:"1"}).toString();return et(`/api/operations?${t}`)},$9=e=>et(`/api/operations/${e}`),q9=e=>{const t=e?`?periodMs=${e}`:"";return et(`/api/error-hotspots${t}`)},F9=(e={})=>{const t=new URLSearchParams;e.phase&&t.set("phase",e.phase),e.operationName&&t.set("operationName",e.operationName),e.periodMs&&t.set("periodMs",String(e.periodMs)),e.q&&t.set("q",e.q),e.limit&&t.set("limit",String(e.limit));const a=t.toString();return et(`/api/failed-operations${a?"?"+a:""}`)},G9=e=>et(`/api/replication/summary${e?`?periodMs=${e}`:""}`),V9=e=>et(`/api/replication/per-cg${e?`?periodMs=${e}`:""}`),W9=(e={})=>{const t=new URLSearchParams;e.periodMs&&t.set("periodMs",String(e.periodMs)),e.bucketMs&&t.set("bucketMs",String(e.bucketMs)),e.cg&&t.set("cg",e.cg);const a=t.toString();return et(`/api/replication/timeline${a?"?"+a:""}`)},Y9=()=>et("/api/replication/cursors"),K9=(e,t=100)=>et(`/api/replication/events?cg=${encodeURIComponent(e)}&limit=${t}`),Q9=e=>et(`/api/success-rates?periodMs=${e}`),X9=(e,t)=>{const a=`periodMs=${e}${t?`&bucketMs=${t}`:""}`;return et(`/api/per-type-stats?${a}`)},aT=(e={})=>{const t=new URLSearchParams;e.lines&&t.set("lines",String(e.lines)),e.q&&t.set("q",e.q);const a=t.toString();return et(`/api/node-log${a?"?"+a:""}`)},Su=()=>et("/api/agent/identity");async function iT(e,t,a,r){const o=new AbortController,s=setTimeout(()=>o.abort(),3e4);try{const c=await fetch(`${da}/api/context-graph/create`,{method:"POST",headers:{"Content-Type":"application/json",...Rt()},body:JSON.stringify({id:e,name:t,description:a,...r!=null&&r.register?{register:!0}:{},...r!=null&&r.allowedAgents?{allowedAgents:r.allowedAgents}:{},...(r==null?void 0:r.accessPolicy)!==void 0?{accessPolicy:r.accessPolicy}:{},...(r==null?void 0:r.publishPolicy)!==void 0?{publishPolicy:r.publishPolicy}:{}}),signal:o.signal});if(!c.ok){const p=await c.json().catch(()=>({}));throw new Error((p==null?void 0:p.error)??`HTTP ${c.status}`)}const d=await c.json();return va(e),d}catch(c){throw c.name==="AbortError"?new Error("Creating project is taking longer than expected — it may still complete in the background. Refresh the page in a moment."):c}finally{clearTimeout(s)}}const Z9=(e,t)=>nn(`/api/context-graph/${encodeURIComponent(e)}/remove-participant`,{agentAddress:t}),rT=e=>et(`/api/context-graph/${encodeURIComponent(e)}/participants`),lT=e=>nn(`/api/context-graph/${encodeURIComponent(e)}/sign-join`,{}),oT=(e,t)=>nn(`/api/context-graph/${encodeURIComponent(e)}/request-join`,t).then(a=>(va(e),a)),J9=e=>et(`/api/context-graph/${encodeURIComponent(e)}/join-requests`),sT=(e,t)=>nn(`/api/context-graph/${encodeURIComponent(e)}/approve-join`,{agentAddress:t}),cT=(e,t)=>nn(`/api/context-graph/${encodeURIComponent(e)}/reject-join`,{agentAddress:t}),uT={md:"text/markdown",markdown:"text/markdown",txt:"text/plain",csv:"text/csv",json:"application/json",xml:"application/xml",yaml:"text/yaml",yml:"text/yaml",pdf:"application/pdf",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",doc:"application/msword",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation",epub:"application/epub+zip",ttl:"text/turtle",rdf:"application/rdf+xml",owl:"application/rdf+xml",html:"text/html",htm:"text/html",py:"text/x-python",ts:"text/typescript",js:"text/javascript",tsx:"text/typescript",jsx:"text/javascript",java:"text/x-java",go:"text/x-go",rs:"text/x-rust",c:"text/x-c",cpp:"text/x-c++",h:"text/x-c",png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",webp:"image/webp"};function dT(e){var a;if(e.type&&e.type!=="application/octet-stream")return e.type;const t=((a=e.name.split(".").pop())==null?void 0:a.toLowerCase())??"";return uT[t]}async function fT(e,t,a,r){const o=new FormData;o.append("file",a),o.append("contextGraphId",t);const s=dT(a);return s&&o.append("contentType",s),aw(`/api/knowledge-assets/${encodeURIComponent(e)}/wm/import-file`,{method:"POST",headers:Rt(),body:o},tm(`Importing "${a.name}" into "${e}"`))}const eP=(e,t)=>nn("/api/profile/query-catalog/write",{contextGraphId:e,quads:t}),tP=e=>nn("/api/profile/query-catalog/read",{contextGraphId:e}),pT=new Set(["clearAfter","publishEpochs","publisherNodeIdentityIdOverride"]),hT=e=>{if(typeof e=="string"&&/^\d+$/.test(e))return e;throw new Error("publisherNodeIdentityIdOverride must be passed as a decimal string")},mT=(e,t=[])=>{if(!e)return;const a=Object.keys(e).filter(s=>!pT.has(s)&&!t.includes(s));if(a.length>0)throw new Error(`Unsupported finalized publish option(s): ${a.join(", ")}`);const r={};e.clearAfter!==void 0&&(r.clearSharedMemoryAfter=e.clearAfter),e.publishEpochs!==void 0&&(r.publishEpochs=e.publishEpochs);const o=e.publisherNodeIdentityIdOverride;return o!==void 0&&(r.publisherNodeIdentityIdOverride=hT(o)),Object.keys(r).length>0?r:void 0};function gT(e){const t=e;if(Array.isArray(t.entities))throw Object.assign(new Error("Knowledge Assets are shared atomically; root-entity selection is not supported"),{code:"KA_ATOMIC_SHARE_REQUIRED"});if(t.entities!==void 0&&t.entities!=="all")throw Object.assign(new Error("Knowledge Assets are shared atomically; omit entities to share the complete asset"),{code:"KA_ATOMIC_SHARE_REQUIRED"});if(t.skipSeal===!0)throw Object.assign(new Error("Knowledge Assets are always sealed before sharing"),{code:"UNSEALED_SHARE_BLOCKED"});if(t.skipSeal!==void 0&&t.skipSeal!==!1)throw new TypeError("skipSeal must be false or omitted");if(t.awaitCuratorAck!==void 0&&typeof t.awaitCuratorAck!="boolean")throw new TypeError("awaitCuratorAck must be a boolean when supplied");return{...t.subGraphName?{subGraphName:t.subGraphName}:{},awaitCuratorAck:t.awaitCuratorAck??!0}}const yT=(e,t,a={})=>{const r=gT(a);return iw(`/api/knowledge-assets/${encodeURIComponent(t)}/swm/share`,{contextGraphId:dw(e),...r.subGraphName?{subGraphName:r.subGraphName}:{},awaitCuratorAck:r.awaitCuratorAck},tm(`Sharing "${t}"`))},vT=(e,t,a={})=>{const r=mT(a,["subGraphName"]);return iw(`/api/knowledge-assets/${encodeURIComponent(t)}/vm/publish`,{contextGraphId:dw(e),...a.subGraphName?{subGraphName:a.subGraphName}:{},...r?{options:r}:{}},tm(`Publishing "${t}"`))};async function nP(e,t){let a=0,r=0,o;const s=[],c=[];let d=null,p=0n,f=0n,y=0n,m=0n,b,x=!0,k=!0;for(const A of t)try{const E=await vT(e,A.name,A.subGraph?{subGraphName:A.subGraph}:{});a+=1,E.contextGraphError&&(r+=1,o===void 0&&(o=E.contextGraphError));const R=E;(!d||R.status==="confirmed"&&R.txHash&&!R.contextGraphError)&&(d=R);const _=R.convictionCostCovered;if(_)try{p+=BigInt(_.baseCost),f+=BigInt(_.discountedCost),y+=BigInt(_.drawnFromEpoch),m+=BigInt(_.drawnFromTopUp),b?(_.accountId!==b.accountId&&(x=!1),_.epoch!==b.epoch&&(k=!1)):b=_}catch{}}catch(E){const R=(E==null?void 0:E.message)??"publish failed",_={name:A.name,...A.subGraph?{subGraph:A.subGraph}:{},error:R};E instanceof nw?c.push(_):s.push(_)}const C=b?{...x&&b.accountId?{accountId:b.accountId}:{},...k&&b.epoch!=null?{epoch:b.epoch}:{},baseCost:p.toString(),discountedCost:f.toString(),drawnFromEpoch:y.toString(),drawnFromTopUp:m.toString()}:void 0;return{published:a,total:t.length,partial:r,partialError:o,failures:s,...c.length>0?{outcomeUnknown:c}:{},sample:d,convictionCostCovered:C}}function aP(e){var a;const t=((a=e.outcomeUnknown)==null?void 0:a.length)??0;if(t!==0)return`${t} knowledge asset${t===1?"":"s"}: publish outcome unknown — the node may still publish ${t===1?"it":"them"}. Check the history before publishing again.`}const iP=(e,t,a,r)=>{if(Array.isArray(a))throw Object.assign(new Error("Knowledge Assets are shared atomically; root-entity selection is not supported"),{code:"KA_ATOMIC_SHARE_REQUIRED"});if(typeof a=="string"&&a!=="all")throw Object.assign(new Error("Knowledge Assets are shared atomically; omit entities to share the complete asset"),{code:"KA_ATOMIC_SHARE_REQUIRED"});const o=a===void 0||typeof a=="string"?{subGraphName:r}:{...a,subGraphName:a.subGraphName??r};return yT(e,t,o)};function rP(e,t){return t.promotedCount>0?{kind:"success",promotedCount:t.promotedCount,message:`Shared the complete Knowledge Asset ${e} to Shared Working Memory (${t.promotedCount} triple${t.promotedCount===1?"":"s"}).`}:{kind:"noop",message:`${e} was not newly shared. Its complete Knowledge Asset may already be in Shared Working Memory, or its content is still being committed — refresh and try again.`}}function lP(e,t){if(t instanceof Wt&&t.status===413){const a=t.body;if((a==null?void 0:a.code)==="SWM_GOSSIP_PAYLOAD_TOO_LARGE")return{kind:"payload-too-large",actualBytes:typeof a.actualBytes=="number"?a.actualBytes:void 0,limitBytes:typeof a.limitBytes=="number"?a.limitBytes:void 0,message:`${e} is too large to share atomically. Split its content into smaller Knowledge Assets before sharing.`}}if(t instanceof Wt&&t.status===409){const a=t.body;if((a==null?void 0:a.code)==="ASSERTION_NOT_PERSISTED"){const r=typeof a.expectedTripleCount=="number"?a.expectedTripleCount:void 0;return{kind:"not-persisted",expectedTripleCount:r,message:r?`${e} was imported with ${r} extracted triple${r===1?"":"s"} but the data graph is empty. Re-import the source file (or re-write the assertion) before promoting.`:`${e}'s data graph is empty but its extraction metadata says it should hold content. Re-import the source file before promoting.`}}}return null}const oP=(e,t,a)=>{const r=new URLSearchParams({contextGraphId:t});return a&&r.set("subGraphName",a),et(`/api/knowledge-assets/${encodeURIComponent(e)}/wm/extraction-status?${r}`)};function bT(e,t){const a=e.startsWith("sha256:")||e.startsWith("keccak256:")?e:`sha256:${e}`,r=t?`?contentType=${encodeURIComponent(t)}`:"";return`${da}/api/file/${encodeURIComponent(a)}${r}`}const sP="binding incomplete";function cP(e){const t="Published on-chain, but linking it into the context graph did not complete, so context-graph views may be incomplete.";return e?`${t} (${e})`:t}const xT=(e=20)=>et(`/api/memory/sessions?limit=${e}`),wT=(e,t={})=>{const a=new URLSearchParams;t.limit&&Number.isInteger(t.limit)&&t.limit>0&&a.set("limit",String(t.limit)),(t.order==="desc"||t.order==="asc")&&a.set("order",t.order);const r=a.toString();return et(`/api/memory/sessions/${encodeURIComponent(e)}${r?`?${r}`:""}`)};function pw(e,t){var a,r,o;return{text:e,correlationId:(t==null?void 0:t.correlationId)??Uo(),...t!=null&&t.identity?{identity:t.identity}:{},...t!=null&&t.sessionId?{sessionId:t.sessionId}:{},...t!=null&&t.profile?{profile:t.profile}:{},...t!=null&&t.persistUserMessage?{persistUserMessage:t.persistUserMessage}:{},...(a=t==null?void 0:t.attachments)!=null&&a.length?{attachmentRefs:t.attachments}:{},...(r=t==null?void 0:t.attachmentImportResults)!=null&&r.length?{attachmentImportResults:t.attachmentImportResults}:{},...(o=t==null?void 0:t.contextEntries)!=null&&o.length?{contextEntries:t.contextEntries}:{},...t!=null&&t.contextGraphId?{contextGraphId:t.contextGraphId}:{}}}async function ST(e,t={}){var m;const a=await fetch("/api/openclaw-channel/stream",{method:"POST",headers:{"Content-Type":"application/json",Accept:"text/event-stream",...Rt()},body:JSON.stringify(pw(e,t)),signal:t.signal});if(!a.ok){const b=await a.json().catch(()=>({}));throw Ko(b,`Request failed (${a.status})`,a.status)}const r=(a.headers.get("content-type")??"").toLowerCase();if(!a.body||!r.includes("text/event-stream")){const b=await a.json();return(m=t.onEvent)==null||m.call(t,{type:"final",...b}),b}const o=a.body.getReader(),s=new TextDecoder;let c="",d,p;const f=b=>{var x;(x=t.onEvent)==null||x.call(t,b),b.type==="error"?p=Ko(b,b.error||"Stream failed"):b.type==="final"&&(d={text:b.text,correlationId:b.correlationId,...b.sessionId?{sessionId:b.sessionId}:{},...b.turnId?{turnId:b.turnId}:{}})},y=b=>{let x=c.indexOf(`
63
+ `);for(;x!==-1;){const k=c.slice(0,x).trim();if(c=c.slice(x+1),x=c.indexOf(`
64
+ `),!k.startsWith("data:"))continue;const C=k.slice(5).trim();if(C){try{f(JSON.parse(C))}catch{}if(p)return}}if(b&&c.trim().startsWith("data:")){const k=c.trim().slice(5).trim();if(!k)return;try{f(JSON.parse(k))}catch{}c=""}};for(;;){const{done:b,value:x}=await o.read();if(b||(c+=s.decode(x,{stream:!0}),y(!1),p))break;if(d)return o.cancel().catch(()=>{}),d}if(c+=s.decode(),y(!0),p)throw p;if(!d)throw new Error("Stream ended without final payload");return d}const kT=()=>et("/api/openclaw-channel/health");async function hw(e,t,a={}){var x;const r=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json",Accept:"text/event-stream",...Rt()},body:JSON.stringify(pw(t,a)),signal:a.signal});if(!r.ok){const k=await r.json().catch(()=>({}));throw Ko(k,`Request failed (${r.status})`,r.status)}const o=(r.headers.get("content-type")??"").toLowerCase();if(!r.body||!o.includes("text/event-stream")){const k=await r.json();return(x=a.onEvent)==null||x.call(a,{type:"final",...k}),k}const s=r.body.getReader(),c=new TextDecoder;let d="",p,f;const y=k=>k.type==="delta"?{type:"text_delta",delta:k.text??""}:k,m=k=>{var C;(C=a.onEvent)==null||C.call(a,k),k.type==="error"?f=Ko(k,k.error||"Stream failed"):k.type==="final"&&(p={text:k.text,correlationId:k.correlationId,...k.sessionId?{sessionId:k.sessionId}:{},...k.turnId?{turnId:k.turnId}:{}})},b=k=>{let C=d.indexOf(`
65
+ `);for(;C!==-1;){const A=d.slice(0,C).trim();if(d=d.slice(C+1),C=d.indexOf(`
66
+ `),!A.startsWith("data:"))continue;const E=A.slice(5).trim();if(E){try{m(y(JSON.parse(E)))}catch{}if(f)return}}if(k&&d.trim().startsWith("data:")){const A=d.trim().slice(5).trim();if(!A)return;try{m(y(JSON.parse(A)))}catch{}d=""}};for(;;){const{done:k,value:C}=await s.read();if(k||(d+=c.decode(C,{stream:!0}),b(!1),f))break;if(p)return s.cancel().catch(()=>{}),p}if(d+=c.decode(),b(!0),f)throw f;if(!p)throw new Error("Stream ended without final payload");return p}const CT=(e,t={})=>hw("/api/hermes-channel/stream",e,t),ET=()=>et("/api/hermes-channel/health"),AT=(e,t={})=>hw("/api/prime-agent-channel/stream",e,t),jT=()=>et("/api/prime-agent-channel/health");function TT(e){return{...e,detected:typeof e.detected=="boolean"?e.detected:e.ready===!0}}const RT=async()=>TT(await et("/api/local-llm/health"));async function NT(e,t){const a=(t==null?void 0:t.correlationId)??Uo(),r=await fetch("/api/local-llm/chat",{method:"POST",headers:{"Content-Type":"application/json",...Rt()},body:JSON.stringify({message:e,sessionId:"local-llm:dkg-ui",...t!=null&&t.contextGraphId?{contextGraphId:t.contextGraphId}:{}}),signal:t==null?void 0:t.signal});if(!r.ok){const s=await r.json().catch(()=>({}));throw Ko(s,`Request failed (${r.status})`,r.status)}return{...await r.json(),correlationId:a,turnId:a}}async function _T(e,t={}){var r;const a=await NT(e,t);return(r=t.onEvent)==null||r.call(t,{type:"final",...a}),a}const OT=()=>nn("/api/local-llm/session/clear",{});function MT(e,t){if(!e||typeof e!="object"||Array.isArray(e))return t;const a=e,r=typeof a.error=="string"&&a.error.trim()?a.error.trim():t;if(a.details===void 0||a.details===null)return r;const o=typeof a.details=="string"?a.details.trim():JSON.stringify(a.details);return!o||o===r?r:`${r}: ${o}`}function Ko(e,t,a){if(!e||typeof e!="object"||Array.isArray(e))return new tu(t,{status:a});const r=e,o=MT(r,t),s=f=>{const y=r[f];return typeof y=="string"&&y.trim()?y.trim():void 0},c=f=>{const y=r[f];return typeof y=="number"&&Number.isFinite(y)?y:void 0},d=f=>{const y=r[f];return typeof y=="boolean"?y:void 0},p=typeof r.text=="string"&&r.text.trim()?r.text:void 0;return new tu(o,{status:a,code:s("code"),source:s("source"),details:s("details"),correlationId:s("correlationId"),timeoutMs:c("timeoutMs"),target:s("target"),route:s("route"),integrationId:s("integrationId"),retryable:d("retryable"),text:p,timedOut:d("timedOut")})}const ku={"local-llm":{connectSupported:!1,chatSupported:!0,defaultSessionId:()=>"local-llm:dkg-ui",resolveChatContext:()=>({}),fetchHealth:RT,isVisible:({health:e})=>e===null||e.configured!==!1||e.detected===!0,streamChat:_T},openclaw:{connectSupported:!0,chatSupported:!0,defaultSessionId:({integrationId:e})=>`${e}:dkg-ui`,resolveChatContext:({integrationId:e,sessionId:t})=>{if(!t)return{};const a=`${e}:dkg-ui:`;if(!t.startsWith(a))return{};const r=t.slice(a.length).trim();return r?{identity:r}:{}},fetchHealth:kT,streamChat:ST},hermes:{connectSupported:!0,chatSupported:!0,defaultSessionId:({integrationId:e,record:t,health:a})=>PT(e,t,a),resolveChatContext:({sessionId:e,profile:t})=>({...e?{sessionId:e}:{},...t?{profile:t}:{}}),fetchHealth:ET,streamChat:CT},"prime-agent":{connectSupported:!0,chatSupported:!0,defaultSessionId:({record:e,health:t})=>UT(e,t),resolveChatContext:({sessionId:e,liveSession:t})=>{if(!t)return{};if(e&&t.sessionId!==e)throw new Error("Prime Agent live session does not match the selected conversation");return{sessionId:t.rawSessionId}},fetchHealth:jT,streamChat:AT}};function br(e){var a,r;const t=e.trim().toLowerCase();return((r=(a=ku[t])==null?void 0:a.defaultSessionId)==null?void 0:r.call(a,{integrationId:t}))??null}function DT(e,t){return t!=null&&t.trim()?t.trim():br(e)}async function LT(e,t=50){const a=r=>{if(r.turnId)return`urn:dkg:chat:turn:${encodeURIComponent(r.turnId)}:${encodeURIComponent(r.author)}`;const o=`${e}
67
+ ${r.author}
68
+ ${r.ts}
69
+ ${r.text}`;let s=2166136261;for(let c=0;c<o.length;c+=1)s^=o.charCodeAt(c),s=Math.imul(s,16777619);return`urn:dkg:chat:session:${encodeURIComponent(e)}:message:${(s>>>0).toString(16)}`};try{return[...(await wT(e,{limit:t,order:"desc"})).messages].reverse().map(o=>({uri:o.uri||a(o),text:o.text,author:o.author,ts:o.ts,turnId:o.turnId,persistStatus:o.persistStatus,failureReason:o.failureReason,attachmentRefs:o.attachmentRefs,toolCalls:o.toolCalls}))}catch(r){if(r instanceof Wt&&r.status===404)return[];throw r}}function zT(e){var t,a,r;return!!((t=e.transport)!=null&&t.bridgeUrl||(a=e.transport)!=null&&a.gatewayUrl||(r=e.transport)!=null&&r.healthUrl)}function nu(...e){for(const t of e)if(typeof t=="string"&&t.trim())return t.trim();return null}function IT(e){return e.trim().toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"")||nm(e)}function nm(e){let t=2166136261;for(let a=0;a<e.length;a+=1)t^=e.charCodeAt(a),t=Math.imul(t,16777619);return(t>>>0).toString(36)}function PT(e,t,a){const r=(t==null?void 0:t.metadata)??{},o=nu(a==null?void 0:a.profile,r.profileName,r.profile),s=nu(r.hermesHome),c=s?null:BT(t),d=[o?`profile-${IT(o)}`:null,s?`home-${nm(s)}`:null,c].filter(p=>p!=null);return d.length?`${e}:dkg-ui:${d.join(":")}`:`${e}:dkg-ui`}function BT(e){const t=e==null?void 0:e.transport;if(!t)return null;const a=[t.kind,t.bridgeUrl,t.gatewayUrl,t.healthUrl].filter(r=>typeof r=="string"&&r.trim().length>0);return a.length?`transport-${nm(a.join("|"))}`:null}function UT(e,t){var a,r,o;return nu((a=e==null?void 0:e.metadata)==null?void 0:a.activeMemorySessionId,(o=(r=t==null?void 0:t.sessions)==null?void 0:r[0])==null?void 0:o.memorySessionId)??void 0}function HT(e){return e?typeof e=="string"?e:[e.provider,e.mode,e.status].filter(Boolean).join(" / ")||null:null}function $T(e,t){if(e==="degraded")return!0;const a=String((t==null?void 0:t.status)??"").toLowerCase(),r=t==null?void 0:t.memory;return a.includes("degraded")||a.includes("conflict")||typeof r=="object"&&r!=null&&r.conflict===!0}function mw(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function r1(e){if(!mw(e))return-1;let t=e.ok===!1?100:0;return e.profile&&(t+=10),e.memory&&(t+=10),e.status&&(t+=10),e.error&&(t+=10),e.ok===!0&&(t+=1),t}function qT(e){if(e.target==="bridge")return{target:"bridge",details:e.bridge};if(e.target==="gateway")return{target:"gateway",details:e.gateway};const t=r1(e.bridge),a=r1(e.gateway);return t<0&&a<0?{}:t>=a?{target:"bridge",details:e.bridge}:{target:"gateway",details:e.gateway}}function FT(e){if(!e)return null;const{target:t,details:a}=qT(e);if(!mw(a))return e;const r=typeof a.ok=="boolean"?a.ok:void 0;return{...a,...e,ok:e.ok===!1?!1:r??e.ok,target:e.target??t,profile:e.profile??a.profile,memory:e.memory??a.memory,status:e.status??a.status,error:e.error??a.error}}function GT(e,t){if(String(e.id??"").toLowerCase()!=="hermes")return null;const a=t==null?void 0:t.profile,r=a?`profile ${a}`:"the configured profile",o=HT(t==null?void 0:t.memory),s=typeof(t==null?void 0:t.memory)=="object"&&t.memory!=null?t.memory:null;return(s==null?void 0:s.conflict)===!0||String((t==null?void 0:t.status)??"").toLowerCase().includes("conflict")?`${e.name} ${r} has a memory provider conflict${o?` (${o})`:""}.`:t!=null&&t.ok?`${e.name} ${r} is connected${o?` with ${o} memory`:""}.`:t!=null&&t.status?`${e.name} ${r} reports ${t.status}${o?` (${o})`:""}.`:null}async function am(e){var P,Y,D,T,G,W,ae,q,Q,F,ee,ie,X,M,L,K,N;const t=String(e.id??"").toLowerCase(),a=ku[t],r=((P=e.capabilities)==null?void 0:P.localChat)===!0&&(a==null?void 0:a.chatSupported)===!0,o=r&&((Y=e.capabilities)==null?void 0:Y.chatAttachments)===!0,s=((D=e.capabilities)==null?void 0:D.connectFromUi)===!0&&(a==null?void 0:a.connectSupported)===!0,c=e.enabled===!0,d=(T=e.runtime)==null?void 0:T.status,p=c&&r&&(a!=null&&a.fetchHealth)?FT(await a.fetchHealth().catch(()=>null)):null;if(((G=a==null?void 0:a.isVisible)==null?void 0:G.call(a,{health:p}))===!1)return null;const f=$T(d,p),y=(p==null?void 0:p.ok)===!0&&!f,m=y,x=c&&r&&(t==="local-llm"&&c&&r||y||d==="connecting"||d==="degraded"||((W=e.runtime)==null?void 0:W.ready)===!0||zT(e)),k=GT(e,p),C=(ae=a==null?void 0:a.defaultSessionId)==null?void 0:ae.call(a,{integrationId:t,record:e,health:p}),A=t==="prime-agent"&&(p==null?void 0:p.busy)===!0&&p.clientConnected===!1,E=t==="prime-agent"&&Array.isArray(p==null?void 0:p.sessions)?p.sessions.filter(ue=>typeof(ue==null?void 0:ue.rawSessionId)=="string"&&ue.rawSessionId.trim()&&typeof ue.memorySessionId=="string"&&ue.memorySessionId.trim()).map(ue=>({...ue,sessionId:ue.memorySessionId.trim(),rawSessionId:ue.rawSessionId.trim()})):void 0,R=t==="hermes"?nu(p==null?void 0:p.profile,(q=e.metadata)==null?void 0:q.profileName,(Q=e.metadata)==null?void 0:Q.profile)??void 0:void 0;let _,U,I;x&&f?(_="degraded",U="Degraded",I=k??(p==null?void 0:p.error)??((F=e.runtime)==null?void 0:F.lastError)??`${e.name} is attached to this node, but one capability is degraded.`):x&&((ee=e.runtime)==null?void 0:ee.status)==="connecting"?(_="connecting",U="Connecting",I=((ie=e.runtime)==null?void 0:ie.lastError)??`${e.name} is registered and still starting up.`):m?(_="chat_ready",U=A?"Still working":p!=null&&p.busy?"Working":"Chat ready",I=A?`${e.name} is still working after the browser stream disconnected. Wait for it to finish before sending another message.`:p!=null&&p.busy?`${e.name} is working on the current turn.`:`${e.name} is connected to this node and ready for chat.`):x?(_="bridge_offline",U="Bridge offline",I=k??(p==null?void 0:p.error)??((X=e.runtime)==null?void 0:X.lastError)??`${e.name} is attached to this node, but it is not responding right now.`):a?(_="available",U=s?"Ready to connect":"Awaiting chat bridge",I=c?`${e.name} is registered, but this panel is waiting for the framework chat bridge.`:((M=e.runtime)==null?void 0:M.lastError)??`Use the node-served skill plus ${e.name} onboarding to attach an existing local agent.`):(_="coming_soon",U=c?"Registered, panel pending":"Next integration",I=c?`${e.name} is registered on the node, but the right-panel chat bridge is not wired yet.`:"The local-agent registry is in place so this framework can plug into the same side-panel flow next.");const O=m?"Connected":_==="connecting"?"Connecting":_==="degraded"?"Degraded":x?"Unavailable":s?"Ready to connect":"Coming next";return{id:t,name:e.name,framework:e.name,description:e.description,defaultSessionId:C,profile:R,chatSupported:r,chatAttachments:o,connectSupported:s,configured:c,detected:c||(p==null?void 0:p.detected)===!0||y,persistentChat:x,chatReady:y,bridgeOnline:m,bridgeStatusLabel:O,status:_,statusLabel:U,detail:I,error:y?void 0:(p==null?void 0:p.error)??((L=e.runtime)==null?void 0:L.lastError)??void 0,target:p==null?void 0:p.target,source:c||a?"live":"planned",...typeof((K=e.metadata)==null?void 0:K.sessionCount)=="number"?{sessionCount:e.metadata.sessionCount}:{},...typeof((N=e.metadata)==null?void 0:N.activeSessionId)=="string"?{activeSessionId:e.metadata.activeSessionId}:{},...E!=null&&E.length?{liveSessions:E}:{},...typeof(p==null?void 0:p.busy)=="boolean"?{busy:p.busy}:{}}}async function Cu(){const e=await et("/api/local-agent-integrations"),a=(await Promise.all((e.integrations??[]).map(am))).filter(r=>r!==null);return a.sort((r,o)=>{const s=r.id==="openclaw"?0:1,c=o.id==="openclaw"?0:1;return s!==c?s-c:r.persistentChat!==o.persistentChat?r.persistentChat?-1:1:r.name.localeCompare(o.name)}),{integrations:a}}async function VT(e){const t=e.trim().toLowerCase(),a=ku[t];if(!(a!=null&&a.connectSupported))throw new Error(`${e} local connect is not available yet.`);const r=await nn("/api/local-agent-integrations/connect",{id:t,metadata:{source:"node-ui"}}),o=r.integration?await am(r.integration):(await Cu()).integrations.find(s=>s.id===t);if(!o)throw new Error(`Missing local agent integration: ${t}`);return{integration:o,notice:r.notice}}async function WT(e){const t=e.trim().toLowerCase();await Qh(`/api/local-agent-integrations/${encodeURIComponent(t)}`,{enabled:!1,runtime:{status:"disconnected",ready:!1,lastError:null}})}async function YT(e){const t=e.trim().toLowerCase(),a=await nn(`/api/local-agent-integrations/${encodeURIComponent(t)}/refresh`,{}),r=a.integration?await am(a.integration):(await Cu()).integrations.find(o=>o.id===t);if(!r)throw new Error(`Missing local agent integration: ${t}`);return{integration:r,notice:a.notice}}async function l1(e,t=50,a={}){if(e.trim().toLowerCase()==="local-llm")return[];const r=DT(e,a.sessionId);return r?LT(r,t):[]}async function KT(e){var a;const t=(a=e.sessionId)==null?void 0:a.trim();if(!t)throw new Error("Missing Hermes session id");return nn("/api/hermes-channel/persist-turn",{sessionId:t,userMessage:e.userMessage,assistantReply:e.assistantReply??"",correlationId:e.correlationId,attachmentRefs:e.attachments,persistenceState:"failed",failureReason:e.failureReason,contextGraphId:e.contextGraphId,profile:e.profile,metadata:{source:"node-ui-failed-turn"}})}async function QT(e,t){if(e.trim().toLowerCase()==="hermes")return KT(t);throw new Error(`${e} local chat persistence is not available yet.`)}async function XT(e,t,a={}){const r=e.trim().toLowerCase(),o=ku[r];if(o!=null&&o.streamChat){const{sessionId:s,liveSession:c,profile:d,...p}=a,f=(y,m)=>{var b;return{...p,...(b=o.resolveChatContext)==null?void 0:b.call(o,{integrationId:r,sessionId:y,liveSession:m,profile:d})}};try{return await o.streamChat(t,f(s,c))}catch(y){if(r==="prime-agent"&&c&&y instanceof tu&&y.code==="PRIME_AGENT_NO_SESSION")return o.streamChat(t,f());throw y}}throw new Error(`${e} local chat is not available yet.`)}const ZT=()=>et("/api/economics"),gw=()=>et("/api/wallets/balances"),uP=()=>nn("/api/shutdown",{}),JT=(e,t)=>nn("/api/subscribe",{contextGraphId:e,syncMode:(t==null?void 0:t.syncMode)??"on-demand"}).then(a=>(va(e),a)),eR=()=>Kh("/api/notifications",6e4),yw=e=>nn("/api/notifications/read",e?{ids:e}:{}),tR=e=>Kh(`/api/sub-graph/list?contextGraphId=${encodeURIComponent(e)}`,Qj),nR={name:"my-dkg-node",networkName:"DKG Mainnet",connectedPeers:12,synced:!0,version:"10.0.0-rc"},aR={total_kcs:1842,confirmed_kcs:1623,tentative_kcs:219},iR={agents:[{name:"my-dkg-node",peerId:"QmYourNode123",connectionStatus:"self"},{name:"research-agent",peerId:"QmResearch456",connectionStatus:"connected",lastSeen:Date.now()},{name:"data-curator",peerId:"QmCurator789",connectionStatus:"connected",lastSeen:Date.now()-6e4},{name:"pharma-bot",peerId:"QmPharma012",connectionStatus:"discovered",lastSeen:Date.now()-3e5}]},rR={contextGraphs:[{id:"cg:pharma-drug-interactions",name:"Pharma Drug Interactions",description:"Drug interaction knowledge graph for clinical decision support",assetCount:227,agentCount:3,callerInvolved:!0,curator:"did:dkg:agent:0x1111111111111111111111111111111111111111"},{id:"cg:climate-science",name:"Climate Science",description:"Climate research data and projections",assetCount:45,agentCount:2,callerInvolved:!0,curator:"did:dkg:agent:0x1111111111111111111111111111111111111111"},{id:"cg:supply-chain-eu",name:"EU Supply Chain",description:"European supply chain provenance tracking",assetCount:89,agentCount:1,callerInvolved:!0,curator:"did:dkg:agent:0x5555555555555555555555555555555555555555"}]},lR={"cg:pharma-drug-interactions":{contextGraphId:"cg:pharma-drug-interactions",allowedAgents:["0x2222222222222222222222222222222222222222","0x3333333333333333333333333333333333333333"]},"cg:climate-science":{contextGraphId:"cg:climate-science",allowedAgents:["0x4444444444444444444444444444444444444444"]},"cg:supply-chain-eu":{contextGraphId:"cg:supply-chain-eu",allowedAgents:[]}},oR={operations:[{id:"op-1",name:"publish",status:"completed",startedAt:Date.now()-12e4},{id:"op-2",name:"query",status:"completed",startedAt:Date.now()-3e5},{id:"op-3",name:"publish",status:"completed",startedAt:Date.now()-6e5},{id:"op-4",name:"chat",status:"completed",startedAt:Date.now()-9e5},{id:"op-5",name:"sync",status:"failed",startedAt:Date.now()-18e5},{id:"op-6",name:"publish",status:"completed",startedAt:Date.now()-36e5}],total:6},sR={periods:[{label:"24h",publishCount:3,successCount:3,totalGasEth:7e-4,totalTrac:9.1,avgGasEth:23e-5,avgTrac:3.03},{label:"7d",publishCount:14,successCount:12,totalGasEth:.0034,totalTrac:42.5,avgGasEth:24e-5,avgTrac:3.04},{label:"30d",publishCount:47,successCount:43,totalGasEth:.012,totalTrac:156.8,avgGasEth:26e-5,avgTrac:3.34}]},cR={agentAddress:"0x1111111111111111111111111111111111111111",agentDid:"did:dkg:agent:0x1111111111111111111111111111111111111111",name:"mock-node-agent",framework:"mock",peerId:"QmMockNodeAgentPeer000000000000000000000000",nodeIdentityId:"mock-node-identity"},uR={wallets:["0xA1b2C3d4E5f60718293a4B5c6D7e8F9012345678","0xB2c3D4e5F60718293a4B5c6D7e8F90123456789a","0xC3d4E5f60718293a4B5c6D7e8F90123456789aB1"],balances:[{address:"0xA1b2C3d4E5f60718293a4B5c6D7e8F9012345678",eth:"0.842",trac:"1250.50",symbol:"TRAC"},{address:"0xB2c3D4e5F60718293a4B5c6D7e8F90123456789a",eth:"0.310",trac:"480.00",symbol:"TRAC"},{address:"0xC3d4E5f60718293a4B5c6D7e8F90123456789aB1",eth:"0.005",trac:"0.00",symbol:"TRAC"}],chainId:"8453",rpcUrl:"https://mock.rpc",symbol:"TRAC"},dR={notifications:[{type:"join_request",id:101,ts:Date.now()-12e4,read:0,contextGraphId:"cg:pharma-drug-interactions",meta:{contextGraphName:"Pharma Drug Interactions",agentAddress:"0xab12cd34ef56ab78cd90ab12cd34ef56ab78cd90",agentName:"research-agent"}},{type:"assertion_activity",id:"activity:cg:pharma-drug-interactions:promoted:29812",ts:Date.now()-3e5,read:0,contextGraphId:"cg:pharma-drug-interactions",meta:{contextGraphName:"Pharma Drug Interactions",kind:"promoted",count:3,actorAgentDid:"did:dkg:agent:0xdana00000000000000000000000000000000dana",actorAgentName:"Dana",soleAuthor:!0}},{type:"join_approved",id:102,ts:Date.now()-9e5,read:1,contextGraphId:"cg:climate-arctic",meta:{contextGraphName:"Arctic Climate",agentAddress:"0x0000000000000000000000000000000000000001"}}],badgeCount:2},fR={lines:["[2026-04-11 10:30:01] INFO Node started on port 8900","[2026-04-11 10:30:02] INFO Connected to DKG mainnet","[2026-04-11 10:30:03] INFO Discovered 12 peers","[2026-04-11 10:30:05] INFO Syncing context graph cg:pharma-drug-interactions","[2026-04-11 10:30:08] INFO Sync complete: 227 assets, 3 agents","[2026-04-11 10:30:15] INFO Agent research-agent connected via libp2p","[2026-04-11 10:31:00] INFO Publish operation started: warfarin-aspirin-001","[2026-04-11 10:31:12] INFO Triple store updated: +34 triples","[2026-04-11 10:31:15] INFO Publish complete: warfarin-aspirin-001 → Verifiable Memory","[2026-04-11 10:32:00] DEBUG SPARQL query executed in 23ms (42 results)","[2026-04-11 10:33:00] INFO Gossip: received 3 proposals from data-curator","[2026-04-11 10:34:00] INFO SWM cleanup: 0 expired triples removed","[2026-04-11 10:35:00] INFO Heartbeat: 12 peers, 1842 KAs, memory 245MB"],totalSize:13},pR={sessions:[{session:"sess-abc123",messages:[{author:"user",text:"What drug interactions should I know about warfarin?",ts:"2026-04-11T10:00:00Z"},{author:"assistant",text:"Warfarin has significant interactions with aspirin, NSAIDs, and several antibiotics. The most critical ones involve...",ts:"2026-04-11T10:00:05Z"}]},{session:"sess-def456",messages:[{author:"user",text:"Summarize the latest climate data for Arctic ice",ts:"2026-04-10T14:00:00Z"},{author:"assistant",text:"Based on the latest projections in the verifiable memory...",ts:"2026-04-10T14:00:03Z"}]}]},hR={"cg:pharma-drug-interactions":{contextGraphId:"cg:pharma-drug-interactions",subGraphs:[{name:"interactions",uri:"did:dkg:context-graph:cg:pharma-drug-interactions/interactions",description:"Pairwise drug interaction records",createdBy:"did:dkg:agent:0x1111111111111111111111111111111111111111",createdAt:"2026-04-02T09:15:00Z",entityCount:148,tripleCount:1721},{name:"contraindications",uri:"did:dkg:context-graph:cg:pharma-drug-interactions/contraindications",createdBy:"did:dkg:agent:0x2222222222222222222222222222222222222222",createdAt:"2026-04-05T16:40:00Z",entityCount:79,tripleCount:604}]},"cg:climate-science":{contextGraphId:"cg:climate-science",subGraphs:[{name:"arctic-ice",uri:"did:dkg:context-graph:cg:climate-science/arctic-ice",description:"Sea-ice extent projections",createdBy:"did:dkg:agent:0x3333333333333333333333333333333333333333",createdAt:"2026-04-11T08:05:00Z",entityCount:32,tripleCount:410}]}};function Hn(e,t=50){return new Promise(a=>setTimeout(()=>a(e),t))}const $n={fetchStatus:()=>Hn(nR),fetchMetrics:()=>Hn(aR),fetchAgents:()=>Hn(iR),fetchContextGraphs:()=>Hn(rR),fetchOperationsWithPhases:()=>Hn(oR),fetchEconomics:()=>Hn(sR),fetchWalletsBalances:()=>Hn(uR),fetchCurrentAgent:()=>Hn(cR),listParticipants:e=>Hn(lR[e]??{contextGraphId:e,allowedAgents:[]}),fetchSubGraphs:e=>Hn(hR[e]??{contextGraphId:e,subGraphs:[]}),fetchNotificationsFeed:()=>Hn(dR),fetchNodeLog:()=>Hn(fR),fetchMemorySessions:()=>Hn(pR)};let ci=null,No=null;const mR=5e3,o1=2,gR=250,lh=new Set;function s1(){return ci===!0}function yR(e){return lh.add(e),e(ci===!0),()=>{lh.delete(e)}}function vR(){const e=Er();return e?{Authorization:`Bearer ${e}`}:{}}function bR(e){return new Promise(t=>setTimeout(t,e))}async function xR(){for(let e=1;e<=o1;e+=1){try{const t=await fetch("/api/status",{cache:"no-store",headers:vR(),signal:AbortSignal.timeout(mR)});if(t.ok||t.status===401)return!1}catch{}e<o1&&await bR(gR)}return!0}async function vw(){if(ci!==null)return ci;if(No)return No;No=(async()=>(ci=await xR(),typeof window<"u"&&(window.__DKG_USING_MOCKS__=ci,ci&&console.warn("[dkg-ui] /api/status unreachable (timeout/5xx/network) — falling back to demo (mock) data. The UI is NOT showing live node state.")),lh.forEach(e=>e(ci)),ci))();try{return await No}finally{No=null}}async function qn(e,t){return await vw()?t():e()}const Wn={fetchStatus:()=>qn(Xj,$n.fetchStatus),fetchMetrics:()=>qn(tT,$n.fetchMetrics),fetchAgents:()=>qn(fw,$n.fetchAgents),fetchContextGraphs:()=>qn(Xh,$n.fetchContextGraphs),fetchOperationsWithPhases:e=>qn(()=>nT(e),$n.fetchOperationsWithPhases),fetchEconomics:()=>qn(ZT,$n.fetchEconomics),fetchWalletsBalances:()=>qn(gw,$n.fetchWalletsBalances),fetchCurrentAgent:()=>qn(Su,$n.fetchCurrentAgent),listParticipants:e=>qn(()=>rT(e),()=>$n.listParticipants(e)),fetchSubGraphs:e=>qn(()=>tR(e),()=>$n.fetchSubGraphs(e)),fetchNotificationsFeed:()=>qn(eR,$n.fetchNotificationsFeed),fetchNodeLog:e=>qn(()=>aT(e),$n.fetchNodeLog),fetchMemorySessions:e=>qn(()=>xT(e),$n.fetchMemorySessions),markNotificationsRead:yw,executeQuery:Uj},wR=6e4;let Vi={data:null,loading:!0,error:null},_a=null,Ho=null,Bo=0,Gi="";const au=new Set;function xr(){const e=Er();return e?`Bearer ${e}`:""}function Hc(e){Gi=e,Vi={data:null,loading:!0,error:null}}function rp(){const e=xr();return e!==Gi&&Hc(e),Vi}function $c(){for(const e of au)e()}function lp(e){Vi=e,$c()}function iu(){const e=Bo,t=xr();if((_a==null?void 0:_a.authKey)===t)return _a.promise;t!==Gi?(Hc(t),$c()):lp({...Vi,loading:!0,error:null});const a=Wn.fetchCurrentAgent().then(r=>{if(e===Bo){if(t!==xr()){const o=xr(),s=Gi!==o||Vi.loading;Gi!==o&&(Hc(o),$c()),s&&iu();return}lp({data:r,loading:!1,error:null})}}).catch(r=>{if(e===Bo){if(t!==xr()){const o=xr(),s=Gi!==o||Vi.loading;Gi!==o&&(Hc(o),$c()),s&&iu();return}lp({data:Vi.data,loading:!1,error:r instanceof Error?r.message:"Failed to load current agent"})}}).finally(()=>{e===Bo&&(_a==null?void 0:_a.promise)===a&&(_a=null)});return _a={authKey:t,promise:a},a}function SR(){iu(),!Ho&&(Ho=setInterval(()=>{iu()},wR))}function kR(){au.size>0||!Ho||(clearInterval(Ho),Ho=null,Bo+=1,_a=null,Vi={data:null,loading:!0,error:null},Gi=xr())}function im(){const[e,t]=S.useState(rp);return S.useEffect(()=>{const a=()=>t(rp());return au.add(a),t(rp()),SR(),()=>{au.delete(a),kR()}},[]),e}const ga=Cr(e=>({contextGraphs:[],loading:!1,activeProjectId:null,setContextGraphs:t=>e({contextGraphs:t}),setLoading:t=>e({loading:t}),setActiveProject:t=>e({activeProjectId:t})}));var Da,sa,ma,Sl,zt,ui,Gn,ts,za,qc,xw,ww;class bw{constructor(t){Ta(this,za);Ta(this,Da);Ta(this,sa,!1);Ta(this,ma,!1);Ta(this,Sl,!1);Ta(this,zt,null);Ta(this,ui,null);Ta(this,Gn,null);Ta(this,ts,null);Ot(this,Da,t)}get running(){return De(this,Sl)}get closed(){return De(this,sa)}get scheduled(){return De(this,zt)!==null}owns(t){var a;return((a=De(this,ui))==null?void 0:a.signal)===t&&!t.aborted}request(){return De(this,sa)||De(this,Gn)!==null&&De(this,Da).requestWhileRunning==="drop"?!1:(Ot(this,ma,!0),fl(this,za,qc).call(this),!0)}schedule(t=0){var a,r;return De(this,sa)||De(this,zt)!==null||De(this,Gn)!==null?!1:(Ot(this,zt,setTimeout(()=>{Ot(this,zt,null),this.request()},Math.max(0,t))),(r=(a=De(this,zt)).unref)==null||r.call(a),!0)}invalidateAndRequest(t){var a;return De(this,sa)?!1:(Ot(this,ma,!0),De(this,zt)!==null&&(clearTimeout(De(this,zt)),Ot(this,zt,null)),(a=De(this,ui))==null||a.abort(new Error(t)),fl(this,za,qc).call(this),!0)}async whenIdle(){for(;De(this,Gn)!==null;){const t=De(this,Gn);if(await t,De(this,Gn)===t)return}}async close(){var a,r;Ot(this,sa,!0),Ot(this,ma,!1),De(this,zt)!==null&&(clearTimeout(De(this,zt)),Ot(this,zt,null));const t=new Error(De(this,Da).closingMessage);t.name="AbortError",Ot(this,ts,t),(a=De(this,ui))==null||a.abort(t),await((r=De(this,Gn))==null?void 0:r.catch(()=>{}))}}Da=new WeakMap,sa=new WeakMap,ma=new WeakMap,Sl=new WeakMap,zt=new WeakMap,ui=new WeakMap,Gn=new WeakMap,ts=new WeakMap,za=new WeakSet,qc=function(){if(De(this,sa)||De(this,Gn)!==null||!De(this,ma))return;let t="rearm";const a=fl(this,za,ww).call(this).then(r=>{t=r}).catch(r=>{r!==De(this,ts)&&De(this,Da).onError(r)}).finally(()=>{if(De(this,Gn)===a&&Ot(this,Gn,null),!De(this,sa)){if(De(this,ma)){fl(this,za,qc).call(this);return}Ot(this,ma,!1),t==="rearm"?fl(this,za,xw).call(this):De(this,zt)!==null&&(clearTimeout(De(this,zt)),Ot(this,zt,null))}});Ot(this,Gn,a)},xw=function(){var a,r;const t=De(this,Da).retryIntervalMs??0;t<=0||De(this,zt)!==null||De(this,sa)||(Ot(this,zt,setTimeout(()=>{var o,s;Ot(this,zt,null),(s=(o=De(this,Da)).beforePeriodicPass)==null||s.call(o),this.request()},t)),(r=(a=De(this,zt)).unref)==null||r.call(a))},ww=async function(){const t=new AbortController;let a="rearm";Ot(this,ui,t),Ot(this,Sl,!0);try{for(;!De(this,sa)&&!t.signal.aborted&&De(this,ma);)Ot(this,ma,!1),a=await De(this,Da).runPass(t.signal)??"rearm";return a}finally{De(this,ui)===t&&Ot(this,ui,null),Ot(this,Sl,!1)}};const yl=new Set;let tn=null,Fc=null;const CR=350;function c1(e){return e==="wm"||e==="swm"||e==="vm"}function ER(e){const t=e.layers;return Array.isArray(t)?t.filter(c1):c1(e.layer)?[e.layer]:[]}function AR(e,t,a){if(!t||e.contextGraphId!==t)return!1;if(!a||a.length===0)return!0;const r=ER(e);return r.length===0?!0:a.some(o=>r.includes(o))}function Sw(){if(tn)return;const e=Er(),t=e?`/api/events?token=${encodeURIComponent(e)}`:"/api/events";tn=new EventSource(t);const a=r=>o=>{let s={};try{s=JSON.parse(o.data)}catch{}r==="memory_graph_changed"&&typeof s.contextGraphId=="string"&&va(s.contextGraphId),(r==="connected"||r==="join_rejected"||r==="join_approved"||r==="project_synced")&&va();const c={type:r,data:s};for(const d of yl)try{d(c)}catch{}};tn.addEventListener("join_request",a("join_request")),tn.addEventListener("join_approved",a("join_approved")),tn.addEventListener("join_rejected",a("join_rejected")),tn.addEventListener("project_synced",a("project_synced")),tn.addEventListener("memory_graph_changed",a("memory_graph_changed")),tn.addEventListener("notification",a("notification")),tn.addEventListener("connected",a("connected")),tn.onerror=()=>{tn==null||tn.close(),tn=null,yl.size>0&&(Fc=setTimeout(Sw,3e3))}}function jR(){Fc&&(clearTimeout(Fc),Fc=null),tn==null||tn.close(),tn=null}function TR(e){return yl.add(e),yl.size===1&&Sw(),()=>{yl.delete(e),yl.size===0&&jR()}}function _l(e){const t=S.useRef(e);t.current=e,S.useEffect(()=>TR(a=>t.current(a)),[])}function RR(e,t,a={}){var p;const r=S.useRef(t),o=S.useRef(null);r.current=t;const s=a.debounceMs??CR,c=S.useMemo(()=>a.layers??[],[(p=a.layers)==null?void 0:p.join("|")]),d=S.useCallback(()=>{o.current&&(clearTimeout(o.current),o.current=null)},[]);_l(S.useCallback(f=>{f.type==="memory_graph_changed"&&AR(f.data,e,c)&&(d(),o.current=setTimeout(()=>{o.current=null,r.current(f.data)},s))},[d,e,s,c])),S.useEffect(()=>d,[d])}function rs(e,t,a={}){const r=S.useRef(e);r.current=e;const o=S.useRef(a);o.current=a,S.useEffect(()=>{if(t<=0)return;let s=null,c=!1;const d=()=>{s||c||(s=setInterval(()=>r.current(),t))},p=()=>{s&&(clearInterval(s),s=null)},f=()=>{if(document.hidden){p();return}r.current(),d()};return o.current.runImmediately!==!1&&!document.hidden&&r.current(),document.hidden||d(),document.addEventListener("visibilitychange",f),()=>{c=!0,document.removeEventListener("visibilitychange",f),p()}},[t])}const NR="No pending join request found";function _R(e){const t=[];for(const a of e)a.type==="join_request"&&t.push({id:a.id,cgId:a.contextGraphId,contextGraphName:a.meta.contextGraphName,agentAddress:a.meta.agentAddress,agentName:a.meta.agentName,ts:a.ts,read:a.read===1});return t.sort((a,r)=>r.ts-a.ts),t}function OR(e){const t=[];for(const a of e)a.type==="assertion_activity"?t.push({kind:"digest",id:a.id,cgId:a.contextGraphId,contextGraphName:a.meta.contextGraphName,event:a.meta.kind,count:a.meta.count,...a.meta.soleAuthor&&a.meta.actorAgentDid?{actorAgentDid:a.meta.actorAgentDid,actorAgentName:a.meta.actorAgentName}:{},...a.meta.bySelf?{bySelf:!0}:{},ts:a.ts,read:a.read===1}):a.type==="join_approved"||a.type==="join_rejected"?t.push({kind:a.type,id:a.id,cgId:a.contextGraphId,contextGraphName:a.meta.contextGraphName,ts:a.ts,read:a.read===1}):a.type==="pca_cost_covered"&&t.push({kind:"pca_cost_covered",id:a.id,cgId:a.contextGraphId,contextGraphName:a.meta.contextGraphName,covered:a.meta,publisherAddress:a.meta.publisherAddress,ts:a.ts,read:a.read===1});return t.sort((a,r)=>r.ts-a.ts),t}function u1(e){return e.filter(t=>t.type!=="join_request"&&t.read===0).map(t=>t.id)}function d1(e){const t=e instanceof Error?e.message:String(e);if(t.includes(NR))return{ok:!0,alreadyHandled:!0};const a=/context graph creator|manage (invitations|join requests)|curator/i.test(t);return{ok:!1,error:t,roleError:a}}function MR(){const[e,t]=S.useState(null),[a,r]=S.useState("loading"),[o,s]=S.useState(!1),c=S.useRef(!1),d=S.useRef(null);S.useEffect(()=>{const U=new bw({closingMessage:"Notification feed unmounted",runPass:async I=>{const O=await Wn.fetchNotificationsFeed();I.aborted||(c.current=!0,t(O),s(!1),r(O.scopeUnknown?"identity-pending":"ready"))},onError:()=>{U.closed||(c.current?s(!0):r("error"))}});return d.current=U,()=>{d.current=null,U.close()}},[]);const p=S.useCallback(()=>{var U;(U=d.current)==null||U.request()},[]);rs(p,6e4);const f=S.useRef(null),y=S.useCallback(()=>{f.current&&clearTimeout(f.current),f.current=setTimeout(()=>{f.current=null,p()},400)},[p]);S.useEffect(()=>()=>{f.current&&clearTimeout(f.current)},[]),_l(S.useCallback(U=>{U.type==="notification"&&y()},[y]));const m=S.useMemo(()=>_R((e==null?void 0:e.notifications)??[]),[e]),b=S.useMemo(()=>OR((e==null?void 0:e.notifications)??[]),[e]),x=(e==null?void 0:e.badgeCount)??0,k=S.useMemo(()=>u1((e==null?void 0:e.notifications)??[]).length>0,[e]),C=S.useCallback(U=>{U.length!==0&&(t(I=>{if(!I)return I;const O=new Set(U.map(String));return{...I,notifications:I.notifications.map(P=>O.has(String(P.id))?{...P,read:1}:P)}}),yw(U).then(p).catch(()=>{}))},[p]),A=S.useCallback(()=>{C(u1((e==null?void 0:e.notifications)??[]))},[e,C]),E=S.useCallback(async(U,I)=>{try{return await sT(U,I),p(),{ok:!0}}catch(O){const P=d1(O);return P.ok&&P.alreadyHandled&&p(),P}},[p]),R=S.useCallback(async(U,I)=>{try{return await cT(U,I),p(),{ok:!0}}catch(O){const P=d1(O);return P.ok&&P.alreadyHandled&&p(),P}},[p]),_=S.useCallback(()=>{s(!1),r(c.current?"ready":"loading"),p()},[p]);return{joinRequests:m,activity:b,unread:x,hasInformationalUnread:k,status:a,refreshError:o,partialActivityError:!1,approve:E,deny:R,markSeen:C,markAllInformationalSeen:A,retry:_}}const DR="dkg-pca",LR=150;function zR(e){return[String(e.chainId).toLowerCase(),e.nft.toLowerCase(),e.token.toLowerCase()].join(":")}function qi(e){return e?`${DR}:${e}`:null}const op={trackedIds:[],createPending:null,topUpPending:{}};function $o(e){return typeof e=="string"&&/^\d+$/.test(e)}function IR(e){if(!Array.isArray(e))return[];const t=new Set,a=[];for(const r of e)$o(r)&&!t.has(r)&&(t.add(r),a.push(r));return a}function PR(e){if(e==null||typeof e!="object")return null;const t=e;return typeof t.ownerEoa!="string"||t.ownerEoa.length===0||typeof t.submittedAt!="number"||!Number.isFinite(t.submittedAt)?null:{ownerEoa:t.ownerEoa,submittedAt:t.submittedAt,...typeof t.txHash=="string"&&t.txHash.length>0?{txHash:t.txHash}:{}}}function BR(e){if(e==null||typeof e!="object")return{};const t={};for(const[a,r]of Object.entries(e)){if(!$o(a)||r==null||typeof r!="object")continue;const o=r;o.accountId===a&&(typeof o.ownerEoa!="string"||o.ownerEoa.length===0||typeof o.txHash!="string"||o.txHash.length===0||typeof o.submittedAt!="number"||!Number.isFinite(o.submittedAt)||(t[a]={accountId:a,ownerEoa:o.ownerEoa,txHash:o.txHash,submittedAt:o.submittedAt,...typeof o.tokens=="string"?{tokens:o.tokens}:{},...typeof o.previousTopUpBufferTrac=="string"?{previousTopUpBufferTrac:o.previousTopUpBufferTrac}:{}}))}return t}function kw(e){const t=qi(e);if(!t)return{...op};try{const a=localStorage.getItem(t);if(!a)return{...op};const r=JSON.parse(a);return{trackedIds:IR(r.trackedIds),createPending:PR(r.createPending),topUpPending:BR(r.topUpPending)}}catch{return{...op}}}let La=null;function Ac(e,t){e&&(La&&clearTimeout(La),La=setTimeout(()=>{La=null;try{localStorage.setItem(e,JSON.stringify(t))}catch{}},LR))}function sp(e,t){if(La&&(clearTimeout(La),La=null),!e)return!1;try{return localStorage.setItem(e,JSON.stringify(t)),!0}catch{return!1}}function gr(e){return{trackedIds:e.trackedIds,createPending:e.createPending,topUpPending:e.topUpPending}}const jc=kw(null),oh=Cr((e,t)=>({scopeKey:null,trackedIds:jc.trackedIds,createPending:jc.createPending,topUpPending:jc.topUpPending,createPendingPersisted:jc.createPending!=null,setScope:a=>{if(t().scopeKey===a)return;La&&(clearTimeout(La),La=null);const r=kw(a);e({scopeKey:a,trackedIds:r.trackedIds,createPending:r.createPending,topUpPending:r.topUpPending,createPendingPersisted:r.createPending!=null})},trackAccount:a=>{$o(a)&&(e(r=>r.trackedIds.includes(a)?r:{trackedIds:[...r.trackedIds,a]}),Ac(qi(t().scopeKey),gr(t())))},untrackAccount:a=>{e(r=>r.trackedIds.includes(a)?{trackedIds:r.trackedIds.filter(o=>o!==a)}:r),Ac(qi(t().scopeKey),gr(t()))},isTracked:a=>t().trackedIds.includes(a),setCreatePending:a=>{e({createPending:a});const r=sp(qi(t().scopeKey),gr(t()));return e({createPendingPersisted:r}),r},clearCreatePending:()=>{e({createPending:null,createPendingPersisted:!1}),Ac(qi(t().scopeKey),gr(t()))},setTopUpPending:a=>{$o(a.accountId)&&(e(r=>({topUpPending:{...r.topUpPending,[a.accountId]:a}})),sp(qi(t().scopeKey),gr(t())))},clearTopUpPending:a=>{e(r=>{if(!r.topUpPending[a])return r;const o={...r.topUpPending};return delete o[a],{topUpPending:o}}),Ac(qi(t().scopeKey),gr(t()))},finishCreate:a=>{e(r=>({createPending:null,createPendingPersisted:!1,trackedIds:$o(a)&&!r.trackedIds.includes(a)?[...r.trackedIds,a]:r.trackedIds})),sp(qi(t().scopeKey),gr(t()))}}));function cp(e){if(!e)return!1;try{return BigInt(e)>0n}catch{return!1}}function Cw(e,t=Math.floor(Date.now()/1e3)){const{expiresAtTimestamp:a}=e;return typeof a=="number"&&a>0&&t>=a}function Ew(e,t){return Cw(e,t)||!!e.fullySwept}function rm(e){return cp(e.topUpBuffer)?!0:e.remainingAllowance!==void 0?cp(e.remainingAllowance):e.extendedRequested?null:cp(e.baseEpochAllowance)}function UR(e){return rm(e)===!0}function HR(e){return e.remainingAllowance!==void 0&&rm(e)===!1}const Aw=90,jw=10080*60;function $R(e,t=Math.floor(Date.now()/1e3)){const{expiresAtTimestamp:a,fullySwept:r,agentCount:o}=e,s=typeof a=="number"&&a>0;return Cw(e,t)?"expired":r?"swept":HR(e)?"insolvent":typeof o=="number"&&o>=Aw?"cap-near":s&&a-t<=jw?"expiring":"healthy"}function qR(e,t){return!Ew(e,t)&&UR(e)}function FR(e){return(e==null?void 0:e.adapterSupported)===!1?null:(e==null?void 0:e.registered)??null}function GR(e,t){var c;const a=FR(e.probedKey);if(a===null)return{outcome:"inconclusive",registered:null,adapterUnsupported:((c=e.probedKey)==null?void 0:c.adapterSupported)===!1};if(a===!1)return{outcome:"unregistered",registered:!1};const r=Ew(e,t),o=rm(e);if(o===null)return{outcome:"inconclusive",registered:null,adapterUnsupported:!1};const s=o;return!r&&s?{outcome:"covers",registered:!0}:{outcome:"uncovered",registered:!0,dead:r,hasBudget:s}}const f1=(e,t)=>!!e&&!!t&&e.toLowerCase()===t.toLowerCase();async function VR(e,t){const a={accountId:e,snapshot:null,error:null,notFound:!1,classification:"unknown",ownerIsPrimaryWallet:!1,health:null,walletProbes:[],approvedCount:0,walletCount:t.length,probesInconclusive:!1};let r;try{r=await t1(e,void 0,{extended:!0})}catch(f){return{...a,error:f,notFound:f instanceof Wt&&f.status===404}}const o=await Promise.all(t.map(f=>t1(e,f,{extended:!0}).then(y=>({wallet:f,registered:GR(y).registered})).catch(()=>({wallet:f,registered:null})))),s=o.filter(f=>f.registered===!0).length,c=o.some(f=>f.registered===null),p=t.some(f=>f1(f,r.owner))?"owned":s>0?"approved":"unknown";return{accountId:e,snapshot:r,error:null,notFound:!1,classification:p,ownerIsPrimaryWallet:f1(t[0],r.owner),health:$R(r),walletProbes:o,approvedCount:s,walletCount:t.length,probesInconclusive:c}}const vl=new Map;function p1(e){for(const t of e.subs)t()}async function ru(e){const t=++e.seq;if(e.ids.length===0){if(t!==e.seq)return;e.data={wallets:[],walletsError:!1,accounts:[]},e.error=null,e.loading=!1,p1(e);return}try{const a=await gw().catch(()=>null),r=(a==null?void 0:a.wallets)??[],o=!a||!!a.error,s=await Promise.all(e.ids.map(c=>VR(c,r)));if(t!==e.seq)return;e.data={wallets:r,walletsError:o,accounts:s},e.error=null}catch(a){if(t!==e.seq)return;e.error=(a==null?void 0:a.message)??"Failed to resolve PCAs."}finally{t===e.seq&&(e.loading=!1,p1(e))}}function up(e){e.timer||e.intervalMs<=0||typeof document<"u"&&document.hidden||(e.timer=setInterval(()=>ru(e),e.intervalMs))}function dp(e){e.timer&&(clearInterval(e.timer),e.timer=null)}function WR(e,t,a,r){let o=vl.get(e);const s=!o;if(o||(o={ids:t,data:null,loading:!0,error:null,subs:new Set,timer:null,intervalMs:a,onVisibility:null,seq:0},vl.set(e,o)),o.subs.add(r),s){const c=o,d=()=>{typeof document>"u"||(document.hidden?dp(c):(ru(c),up(c)))};o.onVisibility=d,typeof document<"u"&&document.addEventListener("visibilitychange",d),ru(o),up(o)}else a<o.intervalMs&&(o.intervalMs=a,dp(o),up(o));return()=>{const c=vl.get(e);c&&(c.subs.delete(r),c.subs.size===0&&(dp(c),c.onVisibility&&typeof document<"u"&&document.removeEventListener("visibilitychange",c.onVisibility),vl.delete(e)))}}const YR=[];function Tw(e=3e4,t=[]){var C,A,E;const a=oh(R=>R.trackedIds),r=t.join(","),o=S.useMemo(()=>[...a,...t.filter(R=>!a.includes(R))],[a.join(","),r]),s=o.join(","),[,c]=S.useReducer(R=>R+1,0);S.useEffect(()=>WR(s,o,e,c),[s,e]);const d=vl.get(s),p=((C=d==null?void 0:d.data)==null?void 0:C.accounts)??YR,f=d?d.loading:!0,y=(d==null?void 0:d.error)??null,{bestCoveringDiscountBps:m,covered:b}=S.useMemo(()=>{let R=null;for(const _ of p){if(!_.snapshot||_.approvedCount<=0||!qR(_.snapshot))continue;const U=_.snapshot.discountBps;typeof U=="number"&&(R==null||U>R)&&(R=U)}return{bestCoveringDiscountBps:R,covered:R!=null}},[p]),x=((A=d==null?void 0:d.data)==null?void 0:A.wallets)??[],k=((E=d==null?void 0:d.data)==null?void 0:E.walletsError)??!1;return{accounts:p,wallets:x,walletsError:k,walletsInconclusive:k&&x.length===0,loading:f,error:y,refresh:()=>{const R=vl.get(s);R&&ru(R)},bestCoveringDiscountBps:m,covered:b}}let fp=null;function Rw(){const e=oh(a=>a.scopeKey),t=oh(a=>a.setScope);S.useEffect(()=>{e||fp||(fp=Hj().then(a=>{t(zR(a))}).catch(()=>{}).finally(()=>{fp=null}))},[e,t])}function KR(){Rw();const{accounts:e}=Tw(3e4);return S.useMemo(()=>{const t=[],a=Math.floor(Date.now()/1e3);for(const r of e){const o=r.snapshot;if(!o)continue;const s=r.accountId,c=typeof o.expiresAtTimestamp=="number"&&o.expiresAtTimestamp>0,d=c&&a>=o.expiresAtTimestamp;d?t.push({id:`pca-${s}-expired`,accountId:s,kind:"expired",severity:"danger",title:`PCA #${s} has expired`,message:"Publishes no longer get its discount. Create a replacement account to keep saving."}):c&&o.expiresAtTimestamp-a<=jw&&t.push({id:`pca-${s}-expiring`,accountId:s,kind:"expiring",severity:"warn",title:`PCA #${s} is expiring soon`,message:"Top-up can’t extend the lock period — plan a replacement before it expires."}),o.fullySwept&&t.push({id:`pca-${s}-swept`,accountId:s,kind:"swept",severity:"warn",title:`PCA #${s} is fully swept`,message:"Its epoch budgets have been swept to the staker reward pool."}),typeof o.agentCount=="number"&&o.agentCount>=Aw&&t.push({id:`pca-${s}-cap`,accountId:s,kind:"cap-near",severity:"warn",title:`PCA #${s} is near the 100-wallet cap`,message:"Deregister unused wallets to make room before approving more."}),r.classification==="owned"&&r.approvedCount===0&&!r.probesInconclusive&&!d&&t.push({id:`pca-${s}-fallthrough`,accountId:s,kind:"fallthrough",severity:"warn",title:`PCA #${s} discounts nothing yet`,message:"Publishes from this node pay the direct cost until you approve this node’s operational wallets."})}return t},[e])}function Qo(e,t=new Date){if(e==null||e==="")return"";const a=e instanceof Date?e:new Date(e);if(Number.isNaN(a.getTime()))return"";if(a.toDateString()===t.toDateString())return a.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"});const o=new Date(t);if(o.setDate(t.getDate()-1),a.toDateString()===o.toDateString())return`Yesterday ${a.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}`;const s=t.getTime()-a.getTime();return s>=0&&s<10080*60*1e3?`${a.toLocaleDateString(void 0,{weekday:"short"})} ${a.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}`:a.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}/**
70
+ * @license lucide-react v1.14.0 - ISC
71
+ *
72
+ * This source code is licensed under the ISC license.
73
+ * See the LICENSE file in the root directory of this source tree.
74
+ */const Nw=(...e)=>e.filter((t,a,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===a).join(" ").trim();/**
75
+ * @license lucide-react v1.14.0 - ISC
76
+ *
77
+ * This source code is licensed under the ISC license.
78
+ * See the LICENSE file in the root directory of this source tree.
79
+ */const QR=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
80
+ * @license lucide-react v1.14.0 - ISC
81
+ *
82
+ * This source code is licensed under the ISC license.
83
+ * See the LICENSE file in the root directory of this source tree.
84
+ */const XR=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,a,r)=>r?r.toUpperCase():a.toLowerCase());/**
85
+ * @license lucide-react v1.14.0 - ISC
86
+ *
87
+ * This source code is licensed under the ISC license.
88
+ * See the LICENSE file in the root directory of this source tree.
89
+ */const h1=e=>{const t=XR(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
90
+ * @license lucide-react v1.14.0 - ISC
91
+ *
92
+ * This source code is licensed under the ISC license.
93
+ * See the LICENSE file in the root directory of this source tree.
94
+ */var pp={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"};/**
95
+ * @license lucide-react v1.14.0 - ISC
96
+ *
97
+ * This source code is licensed under the ISC license.
98
+ * See the LICENSE file in the root directory of this source tree.
99
+ */const ZR=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},JR=S.createContext({}),eN=()=>S.useContext(JR),tN=S.forwardRef(({color:e,size:t,strokeWidth:a,absoluteStrokeWidth:r,className:o="",children:s,iconNode:c,...d},p)=>{const{size:f=24,strokeWidth:y=2,absoluteStrokeWidth:m=!1,color:b="currentColor",className:x=""}=eN()??{},k=r??m?Number(a??y)*24/Number(t??f):a??y;return S.createElement("svg",{ref:p,...pp,width:t??f??pp.width,height:t??f??pp.height,stroke:e??b,strokeWidth:k,className:Nw("lucide",x,o),...!s&&!ZR(d)&&{"aria-hidden":"true"},...d},[...c.map(([C,A])=>S.createElement(C,A)),...Array.isArray(s)?s:[s]])});/**
100
+ * @license lucide-react v1.14.0 - ISC
101
+ *
102
+ * This source code is licensed under the ISC license.
103
+ * See the LICENSE file in the root directory of this source tree.
104
+ */const Yt=(e,t)=>{const a=S.forwardRef(({className:r,...o},s)=>S.createElement(tN,{ref:s,iconNode:t,className:Nw(`lucide-${QR(h1(e))}`,`lucide-${e}`,r),...o}));return a.displayName=h1(e),a};/**
105
+ * @license lucide-react v1.14.0 - ISC
106
+ *
107
+ * This source code is licensed under the ISC license.
108
+ * See the LICENSE file in the root directory of this source tree.
109
+ */const nN=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],aN=Yt("arrow-down",nN);/**
110
+ * @license lucide-react v1.14.0 - ISC
111
+ *
112
+ * This source code is licensed under the ISC license.
113
+ * See the LICENSE file in the root directory of this source tree.
114
+ */const iN=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],rN=Yt("arrow-up",iN);/**
115
+ * @license lucide-react v1.14.0 - ISC
116
+ *
117
+ * This source code is licensed under the ISC license.
118
+ * See the LICENSE file in the root directory of this source tree.
119
+ */const lN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}]],oN=Yt("ban",lN);/**
120
+ * @license lucide-react v1.14.0 - ISC
121
+ *
122
+ * This source code is licensed under the ISC license.
123
+ * See the LICENSE file in the root directory of this source tree.
124
+ */const sN=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],cN=Yt("check",sN);/**
125
+ * @license lucide-react v1.14.0 - ISC
126
+ *
127
+ * This source code is licensed under the ISC license.
128
+ * See the LICENSE file in the root directory of this source tree.
129
+ */const uN=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],dN=Yt("chevron-down",uN);/**
130
+ * @license lucide-react v1.14.0 - ISC
131
+ *
132
+ * This source code is licensed under the ISC license.
133
+ * See the LICENSE file in the root directory of this source tree.
134
+ */const fN=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],sh=Yt("chevron-right",fN);/**
135
+ * @license lucide-react v1.14.0 - ISC
136
+ *
137
+ * This source code is licensed under the ISC license.
138
+ * See the LICENSE file in the root directory of this source tree.
139
+ */const pN=[["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"}]],hN=Yt("copy",pN);/**
140
+ * @license lucide-react v1.14.0 - ISC
141
+ *
142
+ * This source code is licensed under the ISC license.
143
+ * See the LICENSE file in the root directory of this source tree.
144
+ */const mN=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],gN=Yt("ellipsis",mN);/**
145
+ * @license lucide-react v1.14.0 - ISC
146
+ *
147
+ * This source code is licensed under the ISC license.
148
+ * See the LICENSE file in the root directory of this source tree.
149
+ */const yN=[["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"}]],vN=Yt("folder",yN);/**
150
+ * @license lucide-react v1.14.0 - ISC
151
+ *
152
+ * This source code is licensed under the ISC license.
153
+ * See the LICENSE file in the root directory of this source tree.
154
+ */const bN=[["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"}]],xN=Yt("globe",bN);/**
155
+ * @license lucide-react v1.14.0 - ISC
156
+ *
157
+ * This source code is licensed under the ISC license.
158
+ * See the LICENSE file in the root directory of this source tree.
159
+ */const wN=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],SN=Yt("loader-circle",wN);/**
160
+ * @license lucide-react v1.14.0 - ISC
161
+ *
162
+ * This source code is licensed under the ISC license.
163
+ * See the LICENSE file in the root directory of this source tree.
164
+ */const kN=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],CN=Yt("lock",kN);/**
165
+ * @license lucide-react v1.14.0 - ISC
166
+ *
167
+ * This source code is licensed under the ISC license.
168
+ * See the LICENSE file in the root directory of this source tree.
169
+ */const EN=[["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"}]],AN=Yt("paperclip",EN);/**
170
+ * @license lucide-react v1.14.0 - ISC
171
+ *
172
+ * This source code is licensed under the ISC license.
173
+ * See the LICENSE file in the root directory of this source tree.
174
+ */const jN=[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]],m1=Yt("share-2",jN);/**
175
+ * @license lucide-react v1.14.0 - ISC
176
+ *
177
+ * This source code is licensed under the ISC license.
178
+ * See the LICENSE file in the root directory of this source tree.
179
+ */const TN=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],RN=Yt("square",TN);/**
180
+ * @license lucide-react v1.14.0 - ISC
181
+ *
182
+ * This source code is licensed under the ISC license.
183
+ * See the LICENSE file in the root directory of this source tree.
184
+ */const NN=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],_N=Yt("trending-up",NN);/**
185
+ * @license lucide-react v1.14.0 - ISC
186
+ *
187
+ * This source code is licensed under the ISC license.
188
+ * See the LICENSE file in the root directory of this source tree.
189
+ */const ON=[["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"}]],MN=Yt("upload",ON);/**
190
+ * @license lucide-react v1.14.0 - ISC
191
+ *
192
+ * This source code is licensed under the ISC license.
193
+ * See the LICENSE file in the root directory of this source tree.
194
+ */const DN=[["path",{d:"M18 21a8 8 0 0 0-16 0",key:"3ypg7q"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3",key:"10s06x"}]],LN=Yt("users-round",DN);/**
195
+ * @license lucide-react v1.14.0 - ISC
196
+ *
197
+ * This source code is licensed under the ISC license.
198
+ * See the LICENSE file in the root directory of this source tree.
199
+ */const zN=[["path",{d:"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1",key:"18etb6"}],["path",{d:"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4",key:"xoc0q4"}]],IN=Yt("wallet",zN);/**
200
+ * @license lucide-react v1.14.0 - ISC
201
+ *
202
+ * This source code is licensed under the ISC license.
203
+ * See the LICENSE file in the root directory of this source tree.
204
+ */const PN=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],BN=Yt("x",PN),hp={1:"ETH",8453:"ETH",84532:"ETH",11155111:"ETH",31337:"ETH",100:"xDAI",10200:"xDAI",2043:"NEURO",20430:"NEURO"};function _w(e){var r;if(e==null)return"ETH";const t=String(e);if(hp[t])return hp[t];const a=(r=t.match(/(\d+)\s*$/))==null?void 0:r[1];return a&&hp[a]||"ETH"}const mp="—";function UN(e,t=2){if(e==null)return mp;let a;if(typeof e=="number")a=e;else{const s=String(e).trim();if(!/^[+-]?(\d+\.?\d*|\.\d+)([eE][+-]?\d+)?$/.test(s))return mp;a=Number(s)}if(!Number.isFinite(a))return mp;const r=Math.abs(a),o=r>0&&r<10?t:0;return new Intl.NumberFormat("en-US",{minimumFractionDigits:0,maximumFractionDigits:o}).format(a)}function HN(e,t=2){if(e==null||e==="")return"—";let a;try{a=BigInt(e)}catch{return"—"}const r=a<0n;r&&(a=-a);const o=10n**18n,s=a/o,c=(a%o+o).toString().slice(1).slice(0,t);return UN(`${r?"-":""}${s}.${c||"0"}`,t)}const $N=new Set(["84532","11155111","31337","10200","20430"]);function dP(e){if(e==null)return!1;const t=String(e),a=t.includes(":")?t.split(":").pop():t;return $N.has(a)}function fP(e,t=Math.floor(Date.now()/1e3)){if(!e||e<=0)return"Expiry unknown";const a=e-t,r=Math.round(Math.abs(a)/86400);return a<=0?r===0?"Expired today":`Expired ~${r} day${r===1?"":"s"} ago`:`Expires in ~${r} day${r===1?"":"s"}`}function Ow(e){if(!e)return null;let t,a;try{t=BigInt(e.baseCost),a=BigInt(e.discountedCost)}catch{return null}return t<=0n||a<0n||a>=t?null:Number(((t-a)*10000n+t/2n)/t)}function pP({convictionCostCovered:e,className:t=""}){const a=Ow(e);if(e==null||a==null)return null;const r=(a/100).toFixed(a%100===0?0:1),o=e.accountId?`via PCA #${e.accountId}`:"across multiple PCAs";return g.jsxs("span",{className:["badge","badge-success","v10-pca-discount-applied",t].filter(Boolean).join(" "),"data-testid":"pca-discount-badge",role:"status",children:[g.jsx("span",{"aria-hidden":"true",children:"◉ "}),"Discount applied — −",r,"% ",o]})}const lu=new Map,ch=new Set;let g1=!1;function qN(){const e=[...lu.values()];for(const t of ch)t(e)}function FN(e){const t=e.detail;lu.has(t.info.uuid)||(lu.set(t.info.uuid,t),qN())}function GN(){g1||typeof window>"u"||(g1=!0,window.addEventListener("eip6963:announceProvider",FN),window.dispatchEvent(new Event("eip6963:requestProvider")))}function VN(e){return ch.add(e),e([...lu.values()]),()=>{ch.delete(e)}}function lm(e){var r;if(typeof e=="number")return e;const t=(r=String(e).match(/(\d+)\s*$/))==null?void 0:r[1],a=t?Number(t):NaN;if(!Number.isFinite(a))throw new Error(`Unrecognized chainId: ${e}`);return a}function WN(e){return`0x${lm(e).toString(16)}`}const om="dkg-node-ui:wallet-provider-rdns";function YN(e){var t;try{(t=globalThis.localStorage)==null||t.setItem(om,e)}catch{}}function KN(){var e;try{return((e=globalThis.localStorage)==null?void 0:e.getItem(om))??null}catch{return null}}function y1(){var e;try{(e=globalThis.localStorage)==null||e.removeItem(om)}catch{}}function QN(e){return(e.walletRpcUrls??[]).filter(t=>/^https?:\/\//i.test(t))}async function XN(e,t){const a=WN(t.chainId);try{await e.request({method:"wallet_switchEthereumChain",params:[{chainId:a}]})}catch(r){if((r==null?void 0:r.code)!==4902)throw r;const o=_w(t.chainId),s=QN(t);if(s.length===0)throw new Error("Wallet does not know this chain and the node did not provide wallet-public RPC URLs. Add the network in your wallet, then try again.");await e.request({method:"wallet_addEthereumChain",params:[{chainId:a,chainName:`chain-${lm(t.chainId)}`,nativeCurrency:{name:o,symbol:o,decimals:18},rpcUrls:s}]}),await e.request({method:"wallet_switchEthereumChain",params:[{chainId:a}]})}}const Mw=new Set(["app.phantom"]),ZN=300;function JN(e){return e.filter(t=>!Mw.has(t.info.rdns))}function e4(e,t){if(!t)return null;const a=e.filter(r=>r.info.rdns===t);return a.length===1?a[0]:null}function hP(e){return e.address!=null&&e.expectedChainId!=null&&e.chainId!==e.expectedChainId}let Tc=!1,Rc=null,v1=!1;const mP=Cr((e,t)=>{function a(o){o.on&&(o.on("accountsChanged",(...s)=>{const c=s[0],d=(c==null?void 0:c[0])??null;if(d===null){t().disconnect();return}e({address:d})}),o.on("chainChanged",(...s)=>{e({chainId:parseInt(s[0],16)})}),o.on("disconnect",()=>t().disconnect()))}async function r(o){const s=o.provider;try{const c=await s.request({method:"eth_accounts"});if(c.length===0){y1();return}const d=await s.request({method:"eth_chainId"});a(s),e({provider:s,providerInfo:o.info,address:c[0],chainId:parseInt(d,16)})}catch(c){console.warn("[wallet] silent reconnect failed",c)}}return{discovered:[],unsupported:[],provider:null,providerInfo:null,address:null,chainId:null,expectedChainId:null,bootstrap:null,setBootstrap(o){e({bootstrap:o,expectedChainId:lm(o.chainId)})},initWallet(){if(typeof window>"u"||(GN(),v1))return;v1=!0;const o=KN();VN(s=>{e({discovered:JN(s),unsupported:s.filter(c=>Mw.has(c.info.rdns))}),!(!o||Tc)&&(Rc&&clearTimeout(Rc),Rc=setTimeout(()=>{if(Rc=null,Tc)return;const c=e4(t().discovered,o);c&&(Tc=!0,r(c))},ZN))})},async connect(o){const s=o.provider,c=await s.request({method:"eth_requestAccounts"}),d=await s.request({method:"eth_chainId"});a(s),e({provider:s,providerInfo:o.info,address:c[0]??null,chainId:parseInt(d,16)}),YN(o.info.rdns),Tc=!1},disconnect(){e({provider:null,providerInfo:null,address:null,chainId:null}),y1()},async switchToExpectedChain(){const{provider:o,bootstrap:s}=t();if(!o)throw new Error("Wallet not connected.");if(!s)throw new Error("Chain not bootstrapped.");await XN(o,s)}}});function sm(e,t){return e&&e.trim()?e:t.length>20?`${t.slice(0,16)}…`:t}function b1(e){return e.length>12?`${e.slice(0,6)}…${e.slice(-4)}`:e}function t4({item:e,onApprove:t,onDeny:a,onOpen:r}){var y;const[o,s]=S.useState({kind:"idle"}),c=sm(e.contextGraphName,e.cgId),d=((y=e.agentName)==null?void 0:y.trim())||b1(e.agentAddress),p=async m=>{s({kind:"working",action:m});const x=await(m==="approve"?t:a)(e.cgId,e.agentAddress);if(x.ok){const k=x.alreadyHandled?"Already handled":m==="approve"?`Approved — ${d} can now access ${c}`:`Request from ${d} declined`;s({kind:"done",label:k})}else{const k=x.roleError?`You're no longer the curator of ${c}`:m==="approve"?"Couldn’t approve":"Couldn’t deny";s({kind:"error",action:m,message:k})}};if(o.kind==="done")return g.jsxs("div",{className:"v10-notif-row v10-notif-row-terminal",role:"status","aria-live":"polite",children:[g.jsx("span",{className:"v10-notif-glyph","aria-hidden":"true",children:"✓"}),g.jsx("span",{className:"v10-notif-terminal-text",children:o.label})]});const f=o.kind==="working";return g.jsxs("div",{className:"v10-notif-row v10-notif-row-join",children:[g.jsx("span",{className:"v10-notif-glyph v10-notif-glyph-join","aria-hidden":"true",children:"🔑"}),g.jsxs("div",{className:"v10-notif-row-body",children:[g.jsx("div",{className:"v10-notif-row-title",children:"Join request"}),g.jsxs("div",{className:"v10-notif-row-detail",children:[g.jsx("span",{className:"v10-notif-actor",children:d})," wants to join"," ",g.jsx("button",{type:"button",className:"v10-notif-cg-link",onClick:()=>r(e.cgId),title:`Open ${c}`,children:c})]}),g.jsxs("div",{className:"v10-notif-row-sub",children:[g.jsx("span",{className:"v10-notif-addr",title:e.agentAddress,children:b1(e.agentAddress)}),g.jsx("span",{className:"v10-notif-dot",children:"·"}),g.jsx("span",{className:"v10-notif-time",title:new Date(e.ts).toLocaleString(),children:Qo(e.ts)})]}),o.kind==="error"&&g.jsxs("div",{className:"v10-notif-row-error",role:"status","aria-live":"polite",children:[o.message," ",g.jsx("button",{type:"button",className:"v10-notif-retry",onClick:()=>p(o.action),children:"Retry"})]}),g.jsx("span",{className:"v10-sr-only",role:"status","aria-live":"polite",children:f?o.action==="approve"?"Approving…":"Denying…":""})]}),g.jsx("div",{className:"v10-notif-row-actions",children:o.kind==="confirming-deny"?g.jsxs("span",{className:"v10-notif-deny-confirm",role:"group","aria-label":"Confirm deny",onKeyDown:m=>{m.key==="Escape"&&(m.stopPropagation(),s({kind:"idle"}))},onBlur:m=>{m.currentTarget.contains(m.relatedTarget)||s({kind:"idle"})},children:[g.jsx("span",{className:"v10-notif-deny-confirm-label",children:"Deny?"}),g.jsx("button",{type:"button",className:"v10-notif-btn v10-notif-btn-deny",onClick:()=>p("deny"),"aria-label":`Confirm deny join request from ${d} for ${c}`,children:"Yes"}),g.jsx("button",{type:"button",className:"v10-notif-btn v10-notif-btn-ghost",onClick:()=>s({kind:"idle"}),autoFocus:!0,children:"Cancel"})]}):g.jsxs(g.Fragment,{children:[g.jsx("button",{type:"button",className:"v10-notif-btn v10-notif-btn-approve",onClick:()=>p("approve"),disabled:f,"aria-label":`Approve join request from ${d} for ${c}`,children:f&&o.action==="approve"?"…":"Approve"}),g.jsx("button",{type:"button",className:"v10-notif-btn v10-notif-btn-ghost",onClick:()=>s({kind:"confirming-deny"}),disabled:f,"aria-label":`Deny join request from ${d} for ${c}`,children:f&&o.action==="deny"?"…":"Deny"})]})})]})}const n4={created:"+",promoted:"⇡",published:"◉"};function a4(e,t,a){const r=t,o=r===1?"assertion":"assertions";return e==="created"?a?`${a} added ${r} ${o}`:`${r} new ${o} added`:e==="promoted"?a?`${a} promoted ${r} ${o}`:`${r} ${o} promoted`:a?`${a} published ${r} ${o} to Verifiable Memory`:`${r} ${o} published to Verifiable Memory`}function i4({item:e,onOpen:t}){var d;const a=sm(e.contextGraphName,e.cgId),r=e.bySelf?"You":((d=e.actorAgentName)==null?void 0:d.trim())||void 0,o=a4(e.event,e.count,r),s=Qo(e.ts),c=`${o} in ${a}${s?`, ${s}`:""}. Open ${a} recent activity.`;return g.jsxs("button",{type:"button",className:`v10-notif-row v10-notif-row-activity v10-notif-activity-${e.event}${e.bySelf?" v10-notif-by-self":""}${e.read?"":" v10-notif-unread"}`,onClick:()=>t(e.cgId),title:`Open ${a} · recent activity`,"aria-label":c,children:[g.jsx("span",{className:`v10-notif-glyph v10-notif-glyph-${e.event}`,"aria-hidden":"true",children:n4[e.event]}),g.jsx("span",{className:"v10-notif-row-body","aria-hidden":"true",children:g.jsxs("span",{className:"v10-notif-row-detail",children:[o," in ",g.jsx("span",{className:"v10-notif-cg-name",children:a})]})}),g.jsx("span",{className:"v10-notif-time","aria-hidden":"true",title:new Date(e.ts).toLocaleString(),children:s})]})}function r4({item:e,onOpen:t}){const a=sm(e.contextGraphName,e.cgId),r=e.kind==="join_approved",o=g.jsxs(g.Fragment,{children:[g.jsx("span",{className:`v10-notif-glyph ${r?"v10-notif-glyph-approved":"v10-notif-glyph-rejected"}`,"aria-hidden":"true",children:r?"✓":"✕"}),g.jsxs("span",{className:"v10-notif-row-body",children:[g.jsx("span",{className:"v10-notif-row-title",children:r?"Request approved":"Request declined"}),g.jsx("span",{className:"v10-notif-row-detail",children:r?g.jsxs(g.Fragment,{children:["You can now access ",g.jsx("span",{className:"v10-notif-cg-name",children:a})]}):g.jsxs(g.Fragment,{children:["Your request to join ",g.jsx("span",{className:"v10-notif-cg-name",children:a})," wasn’t approved"]})})]}),g.jsx("span",{className:"v10-notif-time",title:new Date(e.ts).toLocaleString(),children:Qo(e.ts)})]});if(r){const s=Qo(e.ts);return g.jsx("button",{type:"button",className:`v10-notif-row v10-notif-row-confirm v10-notif-confirm-approved${e.read?"":" v10-notif-unread"}`,onClick:()=>t(e.cgId),title:`Open ${a}`,"aria-label":`Request approved: you can now access ${a}${s?`, ${s}`:""}. Open ${a}.`,children:o})}return g.jsx("div",{className:`v10-notif-row v10-notif-row-confirm v10-notif-confirm-rejected${e.read?"":" v10-notif-unread"}`,"aria-disabled":"true",children:o})}function l4({item:e}){var f;const t=Ow(e.covered),a=t!=null?(t/100).toFixed(t%100===0?0:1):null;let r=null;try{const y=BigInt(e.covered.baseCost),m=BigInt(e.covered.discountedCost);y>0n&&m>=0n&&m<y&&(r=HN((y-m).toString()))}catch{r=null}const o=`PCA #${e.covered.accountId}`,s=(f=e.contextGraphName)!=null&&f.trim()?` in ${e.contextGraphName.trim()}`:"",c=a!=null?"Publishing discount applied":"Publishing fee covered",d=a!=null?`−${a}% via ${o}${r?` · saved ${r} TRAC`:""}${s}`:`via ${o}${s}`,p=Qo(e.ts);return g.jsxs("div",{className:`v10-notif-row v10-notif-row-confirm v10-notif-pca-discount${e.read?"":" v10-notif-unread"}`,role:"status","aria-label":`${c}, ${d}${p?`, ${p}`:""}.`,children:[g.jsx("span",{className:"v10-notif-glyph v10-notif-glyph-approved","aria-hidden":"true",children:"◉"}),g.jsxs("span",{className:"v10-notif-row-body","aria-hidden":"true",children:[g.jsx("span",{className:"v10-notif-row-title",children:c}),g.jsx("span",{className:"v10-notif-row-detail",children:d})]}),g.jsx("span",{className:"v10-notif-time","aria-hidden":"true",title:new Date(e.ts).toLocaleString(),children:p})]})}function o4({feed:e,onOpenContextGraph:t,pcaAlerts:a=[],onOpenPca:r,id:o,paneRef:s}){const{joinRequests:c,activity:d,status:p,refreshError:f,partialActivityError:y,hasInformationalUnread:m,approve:b,deny:x,markSeen:k,markAllInformationalSeen:C}=e,A=(I,O)=>{k([O]),t(I)},E=c.length>0,R=d.length>0,_=a.length>0,U=!E&&!R&&!_;return g.jsxs("div",{className:"v10-notif-pane",role:"region","aria-label":"Notifications",id:o,ref:s,tabIndex:-1,children:[g.jsxs("div",{className:"v10-notif-pane-titlebar",children:[g.jsx("div",{className:"v10-notif-pane-title",children:"Notifications"}),m&&g.jsx("button",{type:"button",className:"v10-notif-pane-markread",onClick:C,title:"Mark informational notifications as read",children:"Mark all read"})]}),g.jsxs("div",{className:"v10-notif-pane-body",children:[_&&g.jsxs("section",{className:"v10-notif-section v10-notif-section-pca","aria-label":"Publisher Conviction",children:[g.jsxs("div",{className:"v10-notif-section-head",children:[g.jsx("span",{className:"v10-notif-section-label",children:"Publisher Conviction"}),g.jsx("span",{className:"v10-notif-section-count",children:a.length})]}),g.jsx("div",{className:"v10-notif-section-rows",children:a.map(I=>g.jsxs("div",{className:"v10-pca-alert-row","data-severity":I.severity,"data-testid":"pca-bell-alert",role:I.severity==="danger"?"alert":"status",children:[g.jsx("div",{className:"v10-pca-alert-title",children:I.title}),g.jsx("div",{className:"v10-pca-alert-msg",children:I.message}),r&&g.jsxs("button",{type:"button",className:"v10-pca-alert-action",onClick:()=>r(I.accountId),children:["Manage PCA #",I.accountId]})]},I.id))})]}),p==="identity-pending"?g.jsx("div",{className:"v10-notif-pane-state",role:"status",children:"Verifying access…"}):p==="loading"&&U?g.jsx("div",{className:"v10-notif-pane-state",role:"status",children:"Loading notifications…"}):p==="error"&&U?g.jsxs("div",{className:"v10-notif-pane-error",role:"status","aria-live":"polite",children:["Couldn’t load notifications."," ",g.jsx("button",{type:"button",className:"v10-notif-retry",onClick:e.retry,children:"Retry"})]}):U?g.jsxs("div",{className:"v10-notif-pane-empty",role:"status",children:[g.jsx("div",{className:"v10-notif-pane-empty-lead",children:"You’re all caught up."}),g.jsx("div",{className:"v10-notif-pane-empty-sub",children:"Join requests, approvals, and new activity in your context graphs will show up here."})]}):g.jsxs(g.Fragment,{children:[f&&g.jsxs("div",{className:"v10-notif-pane-error v10-notif-pane-error-inline",role:"status","aria-live":"polite",children:["Couldn’t refresh notifications."," ",g.jsx("button",{type:"button",className:"v10-notif-retry",onClick:e.retry,children:"Retry"})]}),E&&g.jsxs("section",{className:"v10-notif-section v10-notif-section-action","aria-label":"Needs your action",children:[g.jsxs("div",{className:"v10-notif-section-head",children:[g.jsx("span",{className:"v10-notif-section-label",children:"Needs your action"}),g.jsx("span",{className:"v10-notif-section-count",children:c.length})]}),g.jsx("div",{className:"v10-notif-section-rows",children:c.map(I=>g.jsx(t4,{item:I,onApprove:b,onDeny:x,onOpen:t},I.id))})]}),g.jsxs("section",{className:"v10-notif-section v10-notif-section-activity","aria-label":"Activity",children:[g.jsx("div",{className:"v10-notif-section-head",children:g.jsx("span",{className:"v10-notif-section-label",children:"Activity"})}),y&&g.jsx("div",{className:"v10-notif-pane-error v10-notif-pane-error-inline",role:"status","aria-live":"polite",children:"Recent activity couldn’t load."}),R?g.jsx("div",{className:"v10-notif-section-rows",children:d.map(I=>I.kind==="digest"?g.jsx(i4,{item:I,onOpen:O=>A(O,I.id)},I.id):I.kind==="pca_cost_covered"?g.jsx(l4,{item:I},I.id):g.jsx(r4,{item:I,onOpen:O=>A(O,I.id)},I.id))}):!y&&g.jsx("div",{className:"v10-notif-section-empty",children:"No recent activity."})]})]})]})]})}const s4=g.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[g.jsx("path",{d:"M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"}),g.jsx("path",{d:"M13.73 21a2 2 0 0 1-3.46 0"})]}),x1="v10-notifications-pane";function c4(){const e=MR(),t=KR(),[a,r]=S.useState(!1),o=S.useRef(null),s=S.useRef(null),c=ga(x=>x.setActiveProject),{openTab:d}=xn(),p=S.useRef(null),f=S.useCallback((x=!1)=>{var k;r(!1),x&&((k=s.current)==null||k.focus())},[]);S.useEffect(()=>{if(!a)return;const x=k=>{o.current&&!o.current.contains(k.target)&&f()};return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[a,f]),S.useEffect(()=>{if(!a)return;const x=p.current;if(!x)return;const k=x.querySelector(".v10-notif-section-action .v10-notif-btn-approve"),C=x.querySelector(".v10-notif-section-rows button, .v10-notif-section-rows a[href]"),A=x.querySelector('button:not(.v10-notif-pane-markread), [href], [tabindex]:not([tabindex="-1"])');(k??C??A??x).focus()},[a]);const y=S.useCallback(x=>{c(x),d({id:`project:${x}`,label:x.slice(0,16),closable:!0}),f()},[c,d,f]),m=S.useCallback(x=>{d({id:`conviction:${x}`,label:`PCA #${x}`,closable:!0}),f()},[d,f]),b=e.unread+t.length;return g.jsxs("div",{className:"v10-header-notif-wrap",ref:o,onKeyDown:a?x=>{x.key==="Escape"&&(x.stopPropagation(),f(!0))}:void 0,children:[g.jsxs("button",{ref:s,className:"v10-header-icon-btn",onClick:()=>r(x=>!x),title:b>0?`Notifications (${b} unread)`:"Notifications","aria-label":b>0?`Notifications, ${b} unread`:"Notifications","aria-haspopup":"dialog","aria-expanded":a,"aria-controls":a?x1:void 0,children:[s4,b>0&&g.jsx("span",{className:"v10-header-notif-badge",children:b})]}),a&&g.jsx(o4,{id:x1,paneRef:p,feed:e,onOpenContextGraph:y,pcaAlerts:t,onOpenPca:m})]})}function u4(e,t,a,r,o){const s=[e?"Synced with the network":"Syncing with the network",`${t} peer${t===1?"":"s"} (${a} direct, ${r} relayed)`];return o>0&&s.push(`Uptime ${d4(o)}`),s.join(`
205
+ `)}function d4(e){const t=Math.max(0,Math.floor(e/1e3)),a=Math.floor(t/86400),r=Math.floor(t%86400/3600),o=Math.floor(t%3600/60),s=[];return a>0&&s.push(`${a}d`),(r>0||a>0)&&s.push(`${r}h`),s.push(`${o}m`),s.join(" ")}const f4=g.jsx("span",{className:"v10-header-ot-wordmark",children:g.jsxs("svg",{width:"60",height:"13",viewBox:"0 0 180 40",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0,children:[g.jsx("path",{d:"M55.0428 28.0111C59.7903 28.0111 62.6388 24.531 62.6388 20.3908C62.6388 16.2806 59.7903 12.8005 55.0428 12.8005C50.325 12.8005 47.4766 16.2806 47.4766 20.3908C47.4766 24.531 50.325 28.0111 55.0428 28.0111ZM55.0428 24.621C52.6988 24.621 51.3932 22.6709 51.3932 20.3908C51.3932 18.1407 52.6988 16.1906 55.0428 16.1906C57.3869 16.1906 58.7221 18.1407 58.7221 20.3908C58.7221 22.6709 57.3869 24.621 55.0428 24.621Z",fill:"currentColor"}),g.jsx("path",{d:"M65.4344 27.6511H69.2027V18.0807C69.8258 17.1507 71.4874 16.4606 72.7336 16.4606C73.149 16.4606 73.5051 16.4906 73.7721 16.5507V12.8305C71.9918 12.8305 70.2115 13.8505 69.2027 15.1406V13.1605H65.4344V27.6511Z",fill:"currentColor"}),g.jsx("path",{d:"M77.9959 11.0304C79.2421 11.0304 80.251 10.0104 80.251 8.75031C80.251 7.49026 79.2421 6.47021 77.9959 6.47021C76.7794 6.47021 75.7409 7.49026 75.7409 8.75031C75.7409 10.0104 76.7794 11.0304 77.9959 11.0304ZM76.1266 27.6511H79.8949V13.1605H76.1266V27.6511Z",fill:"currentColor"}),g.jsx("path",{d:"M83.3347 31.3713C85.115 32.9614 87.0437 33.5314 89.5064 33.5314C93.0373 33.5314 97.2507 32.1813 97.2507 26.6611V13.1605H93.4527V15.0206C92.2955 13.5505 90.7526 12.8005 89.0317 12.8005C85.4117 12.8005 82.7116 15.4406 82.7116 20.1808C82.7116 25.011 85.4414 27.5611 89.0317 27.5611C90.7823 27.5611 92.3252 26.7211 93.4527 25.281V26.7511C93.4527 29.6012 91.3164 30.4113 89.5064 30.4113C87.6964 30.4113 86.1832 29.9012 85.026 28.6112L83.3347 31.3713ZM93.4527 22.5209C92.8296 23.4509 91.4647 24.171 90.2185 24.171C88.0822 24.171 86.5986 22.6709 86.5986 20.1808C86.5986 17.6907 88.0822 16.1906 90.2185 16.1906C91.4647 16.1906 92.8296 16.8807 93.4527 17.8407V22.5209Z",fill:"currentColor"}),g.jsx("path",{d:"M102.857 11.0304C104.104 11.0304 105.113 10.0104 105.113 8.75031C105.113 7.49026 104.104 6.47021 102.857 6.47021C101.641 6.47021 100.602 7.49026 100.602 8.75031C100.602 10.0104 101.641 11.0304 102.857 11.0304ZM100.988 27.6511H104.756V13.1605H100.988V27.6511Z",fill:"currentColor"}),g.jsx("path",{d:"M118.166 27.6511H121.934V17.4207C121.934 14.6006 120.421 12.8005 117.276 12.8005C114.932 12.8005 113.181 13.9405 112.261 15.0506V13.1605H108.493V27.6511H112.261V17.9007C112.884 17.0307 114.042 16.1906 115.525 16.1906C117.127 16.1906 118.166 16.8807 118.166 18.8908V27.6511Z",fill:"currentColor"}),g.jsx("path",{d:"M130.483 28.0111C132.055 28.0111 133.064 27.5911 133.628 27.0811L132.827 24.201C132.619 24.411 132.085 24.621 131.521 24.621C130.69 24.621 130.216 23.931 130.216 23.0309V16.4906H133.123V13.1605H130.216V9.20033H126.418V13.1605H124.044V16.4906H126.418V24.051C126.418 26.6311 127.842 28.0111 130.483 28.0111Z",fill:"currentColor"}),g.jsx("path",{d:"M135.702 27.6511H139.47V18.0807C140.093 17.1507 141.755 16.4606 143.001 16.4606C143.416 16.4606 143.772 16.4906 144.039 16.5507V12.8305C142.259 12.8305 140.479 13.8505 139.47 15.1406V13.1605H135.702V27.6511Z",fill:"currentColor"}),g.jsx("path",{d:"M156.245 27.6511H160.043V13.1605H156.245V15.0206C155.117 13.5505 153.515 12.8005 151.824 12.8005C148.174 12.8005 145.474 15.6806 145.474 20.4208C145.474 25.251 148.204 28.0111 151.824 28.0111C153.545 28.0111 155.117 27.2311 156.245 25.8211V27.6511ZM156.245 22.9709C155.592 23.931 154.257 24.621 152.981 24.621C150.845 24.621 149.361 22.9109 149.361 20.4208C149.361 17.9007 150.845 16.2206 152.981 16.2206C154.257 16.2206 155.592 16.9107 156.245 17.8707V22.9709Z",fill:"currentColor"}),g.jsx("path",{d:"M165.649 11.0304C166.895 11.0304 167.904 10.0104 167.904 8.75031C167.904 7.49026 166.895 6.47021 165.649 6.47021C164.432 6.47021 163.394 7.49026 163.394 8.75031C163.394 10.0104 164.432 11.0304 165.649 11.0304ZM163.78 27.6511H167.548V13.1605H163.78V27.6511Z",fill:"currentColor"}),g.jsx("path",{d:"M175.32 28.0111C176.863 28.0111 177.871 27.5911 178.435 27.0811L177.634 24.201C177.456 24.411 176.922 24.621 176.358 24.621C175.527 24.621 175.053 23.931 175.053 23.0309V7.64026H171.284V24.051C171.284 26.6311 172.679 28.0111 175.32 28.0111Z",fill:"currentColor"}),g.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19.781 9.94781C14.2903 9.94781 9.8385 14.4484 9.8385 20.0008C9.8385 25.5525 14.2903 30.0531 19.781 30.0531C22.833 30.0531 25.5632 28.6622 27.3869 26.4736L34.9141 32.8796C31.2855 37.2341 25.8532 40.0016 19.781 40.0016C8.85592 40.0016 0 31.0467 0 20.0008C0 8.95432 8.85592 0 19.781 0V9.94781ZM36.8737 30.0724L28.3719 25.0628C28.662 24.5606 28.9105 24.0308 29.112 23.4781L38.3464 26.9194C37.9453 28.0192 37.4508 29.0732 36.8737 30.0724ZM29.7216 20.0007H39.5609C39.5609 18.8159 39.4583 17.6554 39.2628 16.5272L29.5719 18.2549C29.6701 18.822 29.7216 19.4053 29.7216 20.0007ZM34.988 7.20831L27.425 13.5712C27.0546 13.1215 26.646 12.7054 26.2045 12.3272L32.5596 4.73338C33.4381 5.4858 34.251 6.31374 34.988 7.20831Z",fill:"currentColor"})]})}),p4=g.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[g.jsx("circle",{cx:"12",cy:"12",r:"5"}),g.jsx("line",{x1:"12",y1:"1",x2:"12",y2:"3"}),g.jsx("line",{x1:"12",y1:"21",x2:"12",y2:"23"}),g.jsx("line",{x1:"4.22",y1:"4.22",x2:"5.64",y2:"5.64"}),g.jsx("line",{x1:"18.36",y1:"18.36",x2:"19.78",y2:"19.78"}),g.jsx("line",{x1:"1",y1:"12",x2:"3",y2:"12"}),g.jsx("line",{x1:"21",y1:"12",x2:"23",y2:"12"}),g.jsx("line",{x1:"4.22",y1:"19.78",x2:"5.64",y2:"18.36"}),g.jsx("line",{x1:"18.36",y1:"5.64",x2:"19.78",y2:"4.22"})]}),h4=g.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:g.jsx("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})}),m4=g.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[g.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),g.jsx("line",{x1:"9",y1:"3",x2:"9",y2:"21"})]}),g4=g.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[g.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),g.jsx("line",{x1:"15",y1:"3",x2:"15",y2:"21"})]}),y4=g.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[g.jsx("circle",{cx:"12",cy:"12",r:"3"}),g.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09a1.65 1.65 0 0 0-1-1.51 1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09a1.65 1.65 0 0 0 1.51-1 1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"})]}),v4=g.jsx("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:g.jsx("polyline",{points:"22 12 18 12 15 21 9 3 6 12 2 12"})}),b4=g.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[g.jsx("path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.78 4.78 4 4 0 0 1-6.74 0 4 4 0 0 1-4.78-4.78 4 4 0 0 1 0-6.75z"}),g.jsx("line",{x1:"15",y1:"9",x2:"9",y2:"15"}),g.jsx("circle",{cx:"9.5",cy:"9.5",r:".5"}),g.jsx("circle",{cx:"14.5",cy:"14.5",r:".5"})]});function x4(){var A,E;const{theme:e,setTheme:t,leftCollapsed:a,toggleLeft:r,rightCollapsed:o,toggleRight:s}=Vn(),c=Gh(R=>R.nodeStatus),d=im().data,{openTab:p}=xn(),f=(c==null?void 0:c.connectedPeers)??(c==null?void 0:c.peerCount)??0,y=((A=c==null?void 0:c.connections)==null?void 0:A.direct)??0,m=((E=c==null?void 0:c.connections)==null?void 0:E.relayed)??0,b=(c==null?void 0:c.uptimeMs)??0,k=c!=null&&(c==null?void 0:c.synced)!==!1,C=u4(k,f,y,m,b);return g.jsxs("header",{className:"v10-header",children:[g.jsxs("div",{className:"v10-header-logo",children:[g.jsxs("span",{className:"v10-header-logo-text",children:["DKG ",g.jsx("span",{className:"v10-header-logo-version",children:"v10"})]}),g.jsxs("div",{className:"v10-header-logo-ot","aria-label":"Powered by OriginTrail",children:[g.jsx("span",{className:"v10-header-logo-ot-by",children:"powered by"}),f4]})]}),g.jsx("button",{className:`v10-header-icon-btn ${a?"":"active-toggle"}`,onClick:r,title:"Toggle sidebar",children:m4}),g.jsx("div",{className:"v10-header-sep"}),g.jsxs("div",{className:"v10-header-agent-switcher",title:d?`${d.agentDid}
206
+ ${d.agentAddress}`:void 0,children:[g.jsx("span",{className:"v10-header-agent-dot"}),g.jsx("span",{className:"v10-header-agent-name",children:(d!=null&&d.name&&d.name!=="**"?d.name:null)||(c==null?void 0:c.name)||"Agent"}),(d==null?void 0:d.agentAddress)&&g.jsxs("span",{className:"v10-header-agent-addr",children:[d.agentAddress.slice(0,6),"…",d.agentAddress.slice(-4)]})]}),g.jsx("div",{className:"v10-header-spacer"}),g.jsxs("div",{className:"v10-header-meta",title:C,children:[g.jsx("span",{className:`v10-header-status-dot ${k?"online":"offline"}`}),g.jsx("span",{children:k?"synced":"syncing"}),g.jsx("span",{className:"v10-header-meta-sep",children:"·"}),g.jsxs("span",{children:[f," peer",f!==1?"s":""]})]}),g.jsxs("div",{className:"v10-header-actions",children:[g.jsx(c4,{}),g.jsx("button",{className:"v10-header-icon-btn",onClick:()=>p({id:"operations",label:"Observability",closable:!0}),title:"Observability",children:v4}),g.jsx("button",{className:"v10-header-icon-btn","data-testid":"pca-launch-btn",onClick:()=>p({id:"conviction",label:"Publisher Conviction",closable:!0}),title:"Publisher Conviction - publishing discounts",children:b4}),g.jsx("button",{className:"v10-header-icon-btn",onClick:()=>p({id:"settings",label:"Settings",closable:!0}),title:"Settings",children:y4}),g.jsx("button",{className:"v10-header-icon-btn",onClick:()=>t(e==="dark"?"light":"dark"),title:e==="dark"?"Switch to light mode":"Switch to dark mode",children:e==="dark"?p4:h4}),g.jsx("button",{className:`v10-header-icon-btn ${o?"":"active-toggle"}`,onClick:s,title:"Toggle agent panel",children:g4})]})]})}function w4(){const e=localStorage.getItem("dkg-journey-stage");return e==="1"?1:e==="2"?2:0}const cm=Cr((e,t)=>({stage:w4(),setStage:a=>{localStorage.setItem("dkg-journey-stage",String(a)),e({stage:a})},advance:()=>{const a=Math.min(t().stage+1,2);localStorage.setItem("dkg-journey-stage",String(a)),e({stage:a})}})),S4=`@prefix owl: <http://www.w3.org/2002/07/owl#> .
207
+ @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
208
+ @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
209
+ @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
210
+ @prefix dcterms: <http://purl.org/dc/terms/> .
211
+ @prefix schema: <http://schema.org/> .
212
+ @prefix foaf: <http://xmlns.com/foaf/0.1/> .
213
+ @prefix prov: <http://www.w3.org/ns/prov#> .
214
+ @prefix skos: <http://www.w3.org/2004/02/skos/core#> .
215
+ @prefix bibo: <http://purl.org/ontology/bibo/> .
216
+ @prefix fabio: <http://purl.org/spar/fabio/> .
217
+ @prefix cito: <http://purl.org/spar/cito/> .
218
+ @prefix frbr: <http://purl.org/vocab/frbr/core#> .
219
+
220
+ @prefix chat: <http://dkg.io/ontology/chat/> .
221
+ @prefix dkg: <http://dkg.io/ontology/> .
222
+ @prefix : <http://dkg.io/ontology/book-research/> .
223
+
224
+ <http://dkg.io/ontology/book-research/>
225
+ a owl:Ontology ;
226
+ dcterms:title "DKG Book Research Project Ontology (v1)" ;
227
+ dcterms:description """Starter ontology for projects that research and
228
+ write books, papers, or long-form non-fiction. Built on schema.org +
229
+ BIBO + the SPAR family (FaBiO, CiTO) + FRBR + SKOS so it composes with
230
+ existing scholarly publishing infrastructure.""" ;
231
+ owl:versionInfo "1.0.0" ;
232
+ dcterms:created "2026-04-18"^^xsd:date ;
233
+ owl:imports
234
+ <http://schema.org/> , <http://purl.org/dc/terms/> ,
235
+ <http://www.w3.org/ns/prov#> , <http://xmlns.com/foaf/0.1/> ,
236
+ <http://www.w3.org/2004/02/skos/core#> ,
237
+ <http://purl.org/ontology/bibo/> ,
238
+ <http://purl.org/spar/fabio/> ,
239
+ <http://purl.org/spar/cito/> ,
240
+ <http://purl.org/vocab/frbr/core#> .
241
+
242
+ # ─── Universal annotation predicates (shared across all starters) ───
243
+ chat:topic a owl:DatatypeProperty ; rdfs:domain chat:Turn ; rdfs:range xsd:string .
244
+ chat:mentions a owl:ObjectProperty ; rdfs:domain chat:Turn ; rdfs:subPropertyOf schema:mentions .
245
+ chat:examines a owl:ObjectProperty ; rdfs:domain chat:Turn ; rdfs:range owl:Thing .
246
+ chat:proposes a owl:ObjectProperty ; rdfs:domain chat:Turn ; rdfs:range owl:Thing .
247
+ chat:concludes a owl:ObjectProperty ; rdfs:domain chat:Turn ; rdfs:range :Finding .
248
+ chat:asks a owl:ObjectProperty ; rdfs:domain chat:Turn ; rdfs:range :Question .
249
+
250
+ # ─── Universal annotation entities ──────────────────────────────────
251
+ :Concept rdfs:subClassOf skos:Concept .
252
+ :Topic rdfs:subClassOf skos:Concept .
253
+ :Question rdfs:subClassOf schema:Question .
254
+ :Finding rdfs:subClassOf prov:Entity .
255
+
256
+ # ─── Book-research specific ─────────────────────────────────────────
257
+
258
+ :Hypothesis a owl:Class ;
259
+ rdfs:label "Hypothesis" ;
260
+ rdfs:comment "A claim under investigation. Supersedes when refuted; promotes to a Finding when supported." ;
261
+ rdfs:subClassOf prov:Entity .
262
+
263
+ :Argument a owl:Class ;
264
+ rdfs:label "Argument" ;
265
+ rdfs:comment "A reasoned position taken on a Hypothesis or other entity." ;
266
+ rdfs:subClassOf prov:Entity .
267
+
268
+ :Counterexample a owl:Class ;
269
+ rdfs:label "Counterexample" ;
270
+ rdfs:comment "Evidence that refutes a Hypothesis or Argument." ;
271
+ rdfs:subClassOf prov:Entity .
272
+
273
+ :Quote a owl:Class ;
274
+ rdfs:label "Quote" ;
275
+ rdfs:comment "Verbatim passage extracted from a source. Subclass of bibo:Quote so it composes with bibliographic tools." ;
276
+ rdfs:subClassOf bibo:Quote .
277
+
278
+ :supports a owl:ObjectProperty ;
279
+ rdfs:label "supports" ;
280
+ rdfs:comment "An Argument or Quote supports a Hypothesis." ;
281
+ rdfs:subPropertyOf cito:agreesWith .
282
+
283
+ :refutes a owl:ObjectProperty ;
284
+ rdfs:label "refutes" ;
285
+ rdfs:comment "An Argument, Counterexample, or Quote refutes a Hypothesis." ;
286
+ rdfs:subPropertyOf cito:disagreesWith .
287
+
288
+ :cites a owl:ObjectProperty ;
289
+ rdfs:label "cites" ;
290
+ rdfs:subPropertyOf cito:cites ;
291
+ rdfs:range bibo:Document .
292
+
293
+ # ─── URI patterns ───────────────────────────────────────────────────
294
+ :UriPattern rdfs:label "URI minting pattern" .
295
+
296
+ :concept-pattern a :UriPattern ; skos:notation "urn:dkg:concept:<slug>" .
297
+ :topic-pattern a :UriPattern ; skos:notation "urn:dkg:topic:<slug>" .
298
+ :question-pattern a :UriPattern ; skos:notation "urn:dkg:question:<slug>" .
299
+ :finding-pattern a :UriPattern ; skos:notation "urn:dkg:finding:<slug>" .
300
+ :hypothesis-pattern a :UriPattern ; skos:notation "urn:dkg:hypothesis:<slug>" .
301
+ :argument-pattern a :UriPattern ; skos:notation "urn:dkg:argument:<slug>" .
302
+ :quote-pattern a :UriPattern ; skos:notation "urn:dkg:quote:<slug>" .
303
+ :citation-pattern a :UriPattern ; skos:notation "urn:dkg:citation:<slug>" ;
304
+ skos:definition "Bibliographic citation; aligned with bibo:Document via cito:cites." .
305
+
306
+ :slug-normalisation a skos:Note ;
307
+ skos:definition "Lowercase → ASCII-fold → strip stopwords (the/a/an/of/for/and/or/to/in/on/with) → hyphenate → ≤60 chars. Apply BEFORE comparing free-text recall results (\`dkg_memory_search\`) to decide reuse-vs-mint." .
308
+ `,k4=`@prefix owl: <http://www.w3.org/2002/07/owl#> .
309
+ @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
310
+ @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
311
+ @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
312
+ @prefix dcterms: <http://purl.org/dc/terms/> .
313
+ @prefix schema: <http://schema.org/> .
314
+ @prefix foaf: <http://xmlns.com/foaf/0.1/> .
315
+ @prefix prov: <http://www.w3.org/ns/prov#> .
316
+ @prefix skos: <http://www.w3.org/2004/02/skos/core#> .
317
+ @prefix doap: <http://usefulinc.com/ns/doap#> .
318
+
319
+ # DKG project namespaces — v1 ontology for any "coding project"
320
+ # context graph. Imports widely-adopted Linked Data vocabs first;
321
+ # only declares extensions for genuinely net-new concepts.
322
+ @prefix chat: <http://dkg.io/ontology/chat/> .
323
+ @prefix code: <http://dkg.io/ontology/code/> .
324
+ @prefix github: <http://dkg.io/ontology/github/> .
325
+ @prefix decisions: <http://dkg.io/ontology/decisions/> .
326
+ @prefix tasks: <http://dkg.io/ontology/tasks/> .
327
+ @prefix agent: <http://dkg.io/ontology/agent/> .
328
+ @prefix dkg: <http://dkg.io/ontology/> .
329
+
330
+ @prefix : <http://dkg.io/ontology/coding-project/> .
331
+
332
+ # ─── Ontology header ────────────────────────────────────────────────
333
+ <http://dkg.io/ontology/coding-project/>
334
+ a owl:Ontology ;
335
+ dcterms:title "DKG Coding Project Ontology (v1)" ;
336
+ dcterms:description """The starter ontology for any DKG context graph that
337
+ represents a software project — its decisions, tasks, code structure, GitHub
338
+ activity, agents, and chat. Designed to be \`owl:imports\`-ed by per-project
339
+ ontologies, which add their own extensions on top.
340
+
341
+ Every predicate is either reused from a globally-adopted vocabulary
342
+ (schema.org, DCTerms, PROV-O, FOAF, SKOS, DOAP) or declared here as a
343
+ project-specific extension. Companion document \`agent-guide.md\` translates
344
+ this formal model into operational instructions for AI coding agents.""" ;
345
+ dcterms:creator "branarakic" ;
346
+ owl:versionInfo "1.0.0" ;
347
+ dcterms:created "2026-04-18"^^xsd:date ;
348
+ owl:imports
349
+ <http://schema.org/> ,
350
+ <http://purl.org/dc/terms/> ,
351
+ <http://www.w3.org/ns/prov#> ,
352
+ <http://xmlns.com/foaf/0.1/> ,
353
+ <http://www.w3.org/2004/02/skos/core#> ,
354
+ <http://usefulinc.com/ns/doap#> .
355
+
356
+ # ─── Section 1 — Universal annotation primitives ────────────────────
357
+ # Predicates expressing what each chat turn was ABOUT — written into
358
+ # the project's \`chat\` sub-graph by the capture-chat hook (and later
359
+ # read by \`dkg_query\` / \`dkg_memory_search\`). These predicates apply
360
+ # to ANY project type, not just coding.
361
+
362
+ chat:topic
363
+ a owl:DatatypeProperty ;
364
+ rdfs:label "topic" ;
365
+ rdfs:comment "Free-text topical bucket the chat turn lives under. Multiple per turn; emit liberally. Renderer can use these to cluster the activity feed." ;
366
+ rdfs:domain chat:Turn ;
367
+ rdfs:range xsd:string .
368
+
369
+ chat:mentions
370
+ a owl:ObjectProperty ;
371
+ rdfs:label "mentions" ;
372
+ rdfs:comment "An entity the chat turn referenced. The most common edge in the graph. To find existing entities to reuse before minting fresh URIs, use \`dkg_memory_search\` (free-text recall across WM/SWM/VM)." ;
373
+ rdfs:domain chat:Turn ;
374
+ rdfs:range owl:Thing ;
375
+ rdfs:subPropertyOf schema:mentions .
376
+
377
+ chat:examines
378
+ a owl:ObjectProperty ;
379
+ rdfs:label "examines" ;
380
+ rdfs:comment "Entity the chat turn walked through in detail (vs just mentioning in passing). Implies the agent or operator is ANALYSING the entity, not merely citing it." ;
381
+ rdfs:domain chat:Turn ;
382
+ rdfs:range owl:Thing .
383
+
384
+ chat:proposes
385
+ a owl:ObjectProperty ;
386
+ rdfs:label "proposes" ;
387
+ rdfs:comment "An idea/decision/task the chat turn put forward. Often points at a freshly-minted Decision or Task entity created in the same write batch." ;
388
+ rdfs:domain chat:Turn ;
389
+ rdfs:range owl:Thing .
390
+
391
+ chat:concludes
392
+ a owl:ObjectProperty ;
393
+ rdfs:label "concludes" ;
394
+ rdfs:comment "A Finding entity the chat turn produced — a claim worth preserving as a first-class node, separate from the turn body." ;
395
+ rdfs:domain chat:Turn ;
396
+ rdfs:range :Finding .
397
+
398
+ chat:asks
399
+ a owl:ObjectProperty ;
400
+ rdfs:label "asks" ;
401
+ rdfs:comment "A Question entity the chat turn left open. Tracking these lets a future query surface 'what did we never resolve?'." ;
402
+ rdfs:domain chat:Turn ;
403
+ rdfs:range :Question .
404
+
405
+ # ─── Section 2 — Universal annotation entity classes ────────────────
406
+
407
+ :Concept
408
+ a owl:Class ;
409
+ rdfs:label "Concept" ;
410
+ rdfs:comment "A free-text concept emerging from chat that doesn't fit into a more specific class. Aligned with skos:Concept so it composes with any knowledge organisation system." ;
411
+ rdfs:subClassOf skos:Concept .
412
+
413
+ :Topic
414
+ a owl:Class ;
415
+ rdfs:label "Topic" ;
416
+ rdfs:comment "A broad topical bucket grouping related concepts/turns/entities. URI pattern: urn:dkg:topic:<slug>." ;
417
+ rdfs:subClassOf skos:Concept .
418
+
419
+ :Question
420
+ a owl:Class ;
421
+ rdfs:label "Question" ;
422
+ rdfs:comment "An open question raised in chat that hasn't been answered yet. URI pattern: urn:dkg:question:<slug>. Resolved by linking a chat:Turn or :Finding via :answers." ;
423
+ rdfs:subClassOf schema:Question .
424
+
425
+ :Finding
426
+ a owl:Class ;
427
+ rdfs:label "Finding" ;
428
+ rdfs:comment "A claim or observation worth preserving as a first-class entity, separate from the chat turn that produced it. URI pattern: urn:dkg:finding:<slug>. Findings can be cited by future Decisions, Tasks, and chat turns." ;
429
+ rdfs:subClassOf prov:Entity .
430
+
431
+ :answers
432
+ a owl:ObjectProperty ;
433
+ rdfs:label "answers" ;
434
+ rdfs:comment "Links a Finding (or chat turn) to the Question it resolves." ;
435
+ rdfs:domain owl:Thing ;
436
+ rdfs:range :Question .
437
+
438
+ :supersedes
439
+ a owl:ObjectProperty ;
440
+ rdfs:label "supersedes" ;
441
+ rdfs:comment "This entity replaces an older one (e.g. a revised Finding supersedes an earlier one)." ;
442
+ rdfs:range owl:Thing ;
443
+ owl:inverseOf prov:wasRevisionOf .
444
+
445
+ # ─── Section 3 — Coding-project-specific classes ────────────────────
446
+ # Formalises the predicates already used informally in
447
+ # scripts/lib/ontology.mjs, anchoring them in PROV-O and schema.org.
448
+
449
+ decisions:Decision
450
+ a owl:Class ;
451
+ rdfs:label "Decision" ;
452
+ rdfs:comment "An architectural decision the project made — context, outcome, consequences. Modelled as a prov:Activity because it represents a deliberate act of choosing." ;
453
+ rdfs:subClassOf prov:Activity, schema:Action .
454
+
455
+ decisions:context
456
+ a owl:DatatypeProperty ;
457
+ rdfs:label "context" ;
458
+ rdfs:domain decisions:Decision ;
459
+ rdfs:range xsd:string ;
460
+ rdfs:comment "Why this decision was being made — problem, constraints, alternatives considered." .
461
+
462
+ decisions:outcome
463
+ a owl:DatatypeProperty ;
464
+ rdfs:label "outcome" ;
465
+ rdfs:domain decisions:Decision ;
466
+ rdfs:range xsd:string ;
467
+ rdfs:comment "The chosen direction — the decision itself, in one paragraph." .
468
+
469
+ decisions:consequences
470
+ a owl:DatatypeProperty ;
471
+ rdfs:label "consequences" ;
472
+ rdfs:domain decisions:Decision ;
473
+ rdfs:range xsd:string ;
474
+ rdfs:comment "What this implies going forward — trade-offs, follow-ups." .
475
+
476
+ decisions:status
477
+ a owl:DatatypeProperty ;
478
+ rdfs:label "status" ;
479
+ rdfs:domain decisions:Decision ;
480
+ rdfs:range xsd:string ;
481
+ rdfs:comment "One of: proposed | accepted | rejected | superseded." .
482
+
483
+ tasks:Task
484
+ a owl:Class ;
485
+ rdfs:label "Task" ;
486
+ rdfs:comment "A piece of planned or in-flight work on the project." ;
487
+ rdfs:subClassOf schema:Action .
488
+
489
+ tasks:status
490
+ a owl:DatatypeProperty ;
491
+ rdfs:label "status" ;
492
+ rdfs:domain tasks:Task ;
493
+ rdfs:range xsd:string ;
494
+ rdfs:comment "One of: todo | in_progress | blocked | done | cancelled." .
495
+
496
+ tasks:priority
497
+ a owl:DatatypeProperty ;
498
+ rdfs:label "priority" ;
499
+ rdfs:domain tasks:Task ;
500
+ rdfs:range xsd:string ;
501
+ rdfs:comment "One of: p0 | p1 | p2 | p3." .
502
+
503
+ tasks:relatedDecision
504
+ a owl:ObjectProperty ;
505
+ rdfs:label "related decision" ;
506
+ rdfs:domain tasks:Task ;
507
+ rdfs:range decisions:Decision ;
508
+ rdfs:comment "The Decision this task implements or follows from." .
509
+
510
+ tasks:dependsOn
511
+ a owl:ObjectProperty ;
512
+ rdfs:label "depends on" ;
513
+ rdfs:domain tasks:Task ;
514
+ rdfs:range tasks:Task .
515
+
516
+ tasks:touches
517
+ a owl:ObjectProperty ;
518
+ rdfs:label "touches" ;
519
+ rdfs:domain tasks:Task ;
520
+ rdfs:range owl:Thing ;
521
+ rdfs:comment "A code:File or code:Package this task edits." .
522
+
523
+ # Code structure — aligned with schema:SoftwareSourceCode + DOAP.
524
+
525
+ code:Package
526
+ a owl:Class ;
527
+ rdfs:label "Package" ;
528
+ rdfs:subClassOf doap:Project, schema:SoftwareApplication .
529
+
530
+ code:File
531
+ a owl:Class ;
532
+ rdfs:label "Source file" ;
533
+ rdfs:subClassOf schema:SoftwareSourceCode .
534
+
535
+ code:Function a owl:Class ; rdfs:label "Function" .
536
+ code:Class a owl:Class ; rdfs:label "Class" .
537
+ code:Interface a owl:Class ; rdfs:label "Interface" .
538
+
539
+ # GitHub — minimal aliasing onto schema.org where sensible.
540
+
541
+ github:Repository
542
+ a owl:Class ;
543
+ rdfs:label "GitHub repository" ;
544
+ rdfs:subClassOf schema:SoftwareSourceCode, doap:Project .
545
+
546
+ github:PullRequest
547
+ a owl:Class ;
548
+ rdfs:label "Pull request" ;
549
+ rdfs:subClassOf schema:CreativeWork .
550
+
551
+ github:Issue
552
+ a owl:Class ;
553
+ rdfs:label "GitHub issue" ;
554
+ rdfs:subClassOf schema:Question, schema:CreativeWork .
555
+
556
+ # ─── Section 4 — Chat sub-graph classes ─────────────────────────────
557
+
558
+ chat:Session
559
+ a owl:Class ;
560
+ rdfs:label "Chat session" ;
561
+ rdfs:comment "One conversation between an operator and their coding assistant (Cursor window, Claude Code thread, etc.)." ;
562
+ rdfs:subClassOf schema:Conversation .
563
+
564
+ chat:Turn
565
+ a owl:Class ;
566
+ rdfs:label "Chat turn" ;
567
+ rdfs:comment "One user-prompt + assistant-response pair within a Session. Carries provenance via prov:wasAttributedTo." ;
568
+ rdfs:subClassOf schema:Message, prov:Entity .
569
+
570
+ chat:userPrompt a owl:DatatypeProperty ; rdfs:domain chat:Turn ; rdfs:range xsd:string .
571
+ chat:assistantResponse a owl:DatatypeProperty ; rdfs:domain chat:Turn ; rdfs:range xsd:string .
572
+ chat:turnIndex a owl:DatatypeProperty ; rdfs:domain chat:Turn ; rdfs:range xsd:integer .
573
+ chat:inSession a owl:ObjectProperty ; rdfs:domain chat:Turn ; rdfs:range chat:Session .
574
+ chat:speakerTool a owl:DatatypeProperty ; rdfs:range xsd:string ;
575
+ rdfs:comment "Identifier of the coding assistant that produced the turn (e.g. 'cursor', 'claude-code')." .
576
+ chat:privacy a owl:DatatypeProperty ; rdfs:domain chat:Session ; rdfs:range xsd:string ;
577
+ rdfs:comment "One of: private | team | public. Controls auto-promote behaviour of the capture hook." .
578
+
579
+ # ─── Section 5 — Agent identity ─────────────────────────────────────
580
+
581
+ agent:Agent
582
+ a owl:Class ;
583
+ rdfs:label "Agent" ;
584
+ rdfs:subClassOf prov:Agent, foaf:Agent .
585
+
586
+ agent:HumanAgent rdfs:subClassOf agent:Agent, foaf:Person .
587
+ agent:AIAgent rdfs:subClassOf agent:Agent, schema:SoftwareApplication .
588
+
589
+ agent:framework
590
+ a owl:DatatypeProperty ;
591
+ rdfs:label "framework" ;
592
+ rdfs:domain agent:AIAgent ;
593
+ rdfs:range xsd:string ;
594
+ rdfs:comment "Name of the agent runtime — 'cursor', 'claude-code', 'openclaw', 'hermes', etc." .
595
+
596
+ agent:operator
597
+ a owl:ObjectProperty ;
598
+ rdfs:label "operator" ;
599
+ rdfs:domain agent:AIAgent ;
600
+ rdfs:range agent:HumanAgent ;
601
+ rdfs:comment "The human operator who runs and is responsible for this AI agent." .
602
+
603
+ # ─── Section 6 — URI minting conventions (machine-readable) ─────────
604
+ # These are encoded as SKOS notes so an agent reading the ontology can
605
+ # pull them out programmatically. The agent guide repeats them in
606
+ # prose for human readability.
607
+
608
+ :UriPattern
609
+ a owl:Class ;
610
+ rdfs:label "URI minting pattern" ;
611
+ rdfs:comment "Documents the URI shape the agent should produce when minting a new entity of a given type." .
612
+
613
+ :concept-pattern a :UriPattern ;
614
+ skos:notation "urn:dkg:concept:<slug>" ;
615
+ skos:definition "Free-text concept; aligned with skos:Concept." .
616
+ :topic-pattern a :UriPattern ;
617
+ skos:notation "urn:dkg:topic:<slug>" ;
618
+ skos:definition "Broad topical bucket grouping related entities." .
619
+ :question-pattern a :UriPattern ;
620
+ skos:notation "urn:dkg:question:<slug>" ;
621
+ skos:definition "An open question awaiting an answer." .
622
+ :finding-pattern a :UriPattern ;
623
+ skos:notation "urn:dkg:finding:<slug>" ;
624
+ skos:definition "A claim or observation worth preserving as a first-class node." .
625
+ :decision-pattern a :UriPattern ;
626
+ skos:notation "urn:dkg:decision:<slug>" ;
627
+ skos:definition "An architectural decision (coding-project specific)." .
628
+ :task-pattern a :UriPattern ;
629
+ skos:notation "urn:dkg:task:<slug>" ;
630
+ skos:definition "A piece of planned or in-flight work (coding-project specific)." .
631
+
632
+ # ─── Section 7 — Slug normalisation rule (deterministic) ────────────
633
+
634
+ :slug-normalisation a skos:Note ;
635
+ skos:prefLabel "slug normalisation" ;
636
+ skos:definition """To compute the canonical slug from a free-text label:
637
+ 1. Lowercase.
638
+ 2. Apply Unicode NFKD then strip combining marks (ASCII fold).
639
+ 3. Strip common stopwords (the / a / an / of / for / and / or / to / in / on / with).
640
+ 4. Replace any run of non-[a-z0-9] with a single hyphen.
641
+ 5. Trim leading/trailing hyphens.
642
+ 6. Truncate to 60 characters max.
643
+
644
+ Example: "the Tree-Sitter library", "Tree sitter", "TREE_SITTER" all
645
+ normalise to "tree-sitter". Always apply this BEFORE comparing free-text
646
+ recall results (\`dkg_memory_search\`) in the look-before-mint protocol.""" .
647
+ `,C4=`@prefix owl: <http://www.w3.org/2002/07/owl#> .
648
+ @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
649
+ @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
650
+ @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
651
+ @prefix dcterms: <http://purl.org/dc/terms/> .
652
+ @prefix schema: <http://schema.org/> .
653
+ @prefix foaf: <http://xmlns.com/foaf/0.1/> .
654
+ @prefix prov: <http://www.w3.org/ns/prov#> .
655
+ @prefix skos: <http://www.w3.org/2004/02/skos/core#> .
656
+ @prefix bibo: <http://purl.org/ontology/bibo/> .
657
+
658
+ @prefix chat: <http://dkg.io/ontology/chat/> .
659
+ @prefix : <http://dkg.io/ontology/narrative-writing/> .
660
+
661
+ <http://dkg.io/ontology/narrative-writing/>
662
+ a owl:Ontology ;
663
+ dcterms:title "DKG Narrative Writing Project Ontology (v1)" ;
664
+ dcterms:description """Starter for fiction or narrative non-fiction
665
+ projects: novels, screenplays, biographies. Tracks Characters, Scenes,
666
+ Plot Points, Themes, and the relationships between them.""" ;
667
+ owl:versionInfo "1.0.0" ;
668
+ dcterms:created "2026-04-18"^^xsd:date ;
669
+ owl:imports
670
+ <http://schema.org/> , <http://purl.org/dc/terms/> ,
671
+ <http://xmlns.com/foaf/0.1/> ,
672
+ <http://www.w3.org/2004/02/skos/core#> ,
673
+ <http://purl.org/ontology/bibo/> .
674
+
675
+ # ─── Universal annotation predicates ────────────────────────────────
676
+ chat:topic a owl:DatatypeProperty ; rdfs:domain chat:Turn ; rdfs:range xsd:string .
677
+ chat:mentions a owl:ObjectProperty ; rdfs:domain chat:Turn ; rdfs:subPropertyOf schema:mentions .
678
+ chat:examines a owl:ObjectProperty ; rdfs:domain chat:Turn .
679
+ chat:proposes a owl:ObjectProperty ; rdfs:domain chat:Turn .
680
+ chat:concludes a owl:ObjectProperty ; rdfs:domain chat:Turn ; rdfs:range :Finding .
681
+ chat:asks a owl:ObjectProperty ; rdfs:domain chat:Turn ; rdfs:range :Question .
682
+
683
+ # ─── Universal annotation entities ──────────────────────────────────
684
+ :Concept rdfs:subClassOf skos:Concept .
685
+ :Topic rdfs:subClassOf skos:Concept .
686
+ :Question rdfs:subClassOf schema:Question .
687
+ :Finding rdfs:subClassOf prov:Entity .
688
+
689
+ # ─── Narrative-writing-specific ─────────────────────────────────────
690
+
691
+ :Character a owl:Class ;
692
+ rdfs:label "Character" ;
693
+ rdfs:comment "A character in the narrative — fictional or historical." ;
694
+ rdfs:subClassOf foaf:Person, schema:Person .
695
+
696
+ :Scene a owl:Class ;
697
+ rdfs:label "Scene" ;
698
+ rdfs:comment "A discrete unit of narrative action — a single place/time/event in the story." ;
699
+ rdfs:subClassOf schema:Event .
700
+
701
+ :PlotPoint a owl:Class ;
702
+ rdfs:label "Plot point" ;
703
+ rdfs:comment "A structural moment in the narrative arc (inciting incident, climax, resolution, etc.)." .
704
+
705
+ :Theme a owl:Class ;
706
+ rdfs:label "Theme" ;
707
+ rdfs:comment "A unifying idea explored across the narrative." ;
708
+ rdfs:subClassOf skos:Concept .
709
+
710
+ :Setting a owl:Class ;
711
+ rdfs:label "Setting" ;
712
+ rdfs:comment "A place + time context within which Scenes occur." .
713
+
714
+ :appearsIn a owl:ObjectProperty ;
715
+ rdfs:label "appears in" ;
716
+ rdfs:domain :Character ;
717
+ rdfs:range :Scene .
718
+
719
+ :setIn a owl:ObjectProperty ;
720
+ rdfs:label "set in" ;
721
+ rdfs:domain :Scene ;
722
+ rdfs:range :Setting .
723
+
724
+ :develops a owl:ObjectProperty ;
725
+ rdfs:label "develops" ;
726
+ rdfs:comment "A Scene or PlotPoint develops a Theme or a Character arc." ;
727
+ rdfs:range owl:Thing .
728
+
729
+ :precedes a owl:ObjectProperty ;
730
+ rdfs:label "precedes" ;
731
+ rdfs:domain :Scene ;
732
+ rdfs:range :Scene .
733
+
734
+ # ─── URI patterns ───────────────────────────────────────────────────
735
+ :UriPattern rdfs:label "URI minting pattern" .
736
+
737
+ :concept-pattern a :UriPattern ; skos:notation "urn:dkg:concept:<slug>" .
738
+ :topic-pattern a :UriPattern ; skos:notation "urn:dkg:topic:<slug>" .
739
+ :question-pattern a :UriPattern ; skos:notation "urn:dkg:question:<slug>" .
740
+ :character-pattern a :UriPattern ; skos:notation "urn:dkg:character:<slug>" .
741
+ :scene-pattern a :UriPattern ; skos:notation "urn:dkg:scene:<slug>" .
742
+ :plotpoint-pattern a :UriPattern ; skos:notation "urn:dkg:plotpoint:<slug>" .
743
+ :theme-pattern a :UriPattern ; skos:notation "urn:dkg:theme:<slug>" .
744
+ :setting-pattern a :UriPattern ; skos:notation "urn:dkg:setting:<slug>" .
745
+
746
+ :slug-normalisation a skos:Note ;
747
+ skos:definition "Lowercase → ASCII-fold → strip stopwords → hyphenate → ≤60 chars." .
748
+ `,E4=`@prefix owl: <http://www.w3.org/2002/07/owl#> .
749
+ @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
750
+ @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
751
+ @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
752
+ @prefix dcterms: <http://purl.org/dc/terms/> .
753
+ @prefix schema: <http://schema.org/> .
754
+ @prefix foaf: <http://xmlns.com/foaf/0.1/> .
755
+ @prefix prov: <http://www.w3.org/ns/prov#> .
756
+ @prefix skos: <http://www.w3.org/2004/02/skos/core#> .
757
+ @prefix time: <http://www.w3.org/2006/time#> .
758
+
759
+ @prefix chat: <http://dkg.io/ontology/chat/> .
760
+ @prefix : <http://dkg.io/ontology/pkm/> .
761
+
762
+ <http://dkg.io/ontology/pkm/>
763
+ a owl:Ontology ;
764
+ dcterms:title "DKG Personal Knowledge Management Ontology (v1)" ;
765
+ dcterms:description """Starter for personal/team knowledge gardens.
766
+ Notes, highlights, questions, insights — the daily-driver vocabulary
767
+ of an Obsidian/Roam-style PKM workflow, but graph-native and shareable
768
+ with teammates' agents.""" ;
769
+ owl:versionInfo "1.0.0" ;
770
+ dcterms:created "2026-04-18"^^xsd:date ;
771
+ owl:imports
772
+ <http://schema.org/> , <http://purl.org/dc/terms/> ,
773
+ <http://xmlns.com/foaf/0.1/> ,
774
+ <http://www.w3.org/2004/02/skos/core#> ,
775
+ <http://www.w3.org/2006/time#> .
776
+
777
+ # ─── Universal annotation predicates ────────────────────────────────
778
+ chat:topic a owl:DatatypeProperty ; rdfs:domain chat:Turn ; rdfs:range xsd:string .
779
+ chat:mentions a owl:ObjectProperty ; rdfs:domain chat:Turn ; rdfs:subPropertyOf schema:mentions .
780
+ chat:examines a owl:ObjectProperty ; rdfs:domain chat:Turn .
781
+ chat:proposes a owl:ObjectProperty ; rdfs:domain chat:Turn .
782
+ chat:concludes a owl:ObjectProperty ; rdfs:domain chat:Turn ; rdfs:range :Insight .
783
+ chat:asks a owl:ObjectProperty ; rdfs:domain chat:Turn ; rdfs:range :Question .
784
+
785
+ # ─── Universal annotation entities ──────────────────────────────────
786
+ :Concept rdfs:subClassOf skos:Concept .
787
+ :Topic rdfs:subClassOf skos:Concept .
788
+ :Question rdfs:subClassOf schema:Question .
789
+ :Finding rdfs:subClassOf prov:Entity .
790
+
791
+ # ─── PKM-specific ────────────────────────────────────────────────────
792
+
793
+ :Note a owl:Class ;
794
+ rdfs:label "Note" ;
795
+ rdfs:comment "An atomic note — a single self-contained thought worth capturing. The fundamental unit of a PKM graph." ;
796
+ rdfs:subClassOf schema:CreativeWork .
797
+
798
+ :Highlight a owl:Class ;
799
+ rdfs:label "Highlight" ;
800
+ rdfs:comment "A passage of text marked as significant from a source (article, book, transcript). Carries provenance back to the source." ;
801
+ rdfs:subClassOf schema:Quotation .
802
+
803
+ :Insight a owl:Class ;
804
+ rdfs:label "Insight" ;
805
+ rdfs:comment "A connection or realisation that synthesises across multiple Notes/Highlights. Promotes from a chat turn via chat:concludes." ;
806
+ rdfs:subClassOf prov:Entity .
807
+
808
+ :relatedTo a owl:ObjectProperty ;
809
+ rdfs:label "related to" ;
810
+ rdfs:subPropertyOf skos:related .
811
+
812
+ :references a owl:ObjectProperty ;
813
+ rdfs:label "references" ;
814
+ rdfs:subPropertyOf dcterms:references .
815
+
816
+ :source a owl:ObjectProperty ;
817
+ rdfs:label "source" ;
818
+ rdfs:domain :Highlight ;
819
+ rdfs:range schema:CreativeWork ;
820
+ rdfs:comment "Where a Highlight was extracted from." ;
821
+ rdfs:subPropertyOf dcterms:source .
822
+
823
+ # ─── URI patterns ───────────────────────────────────────────────────
824
+ :UriPattern rdfs:label "URI minting pattern" .
825
+
826
+ :concept-pattern a :UriPattern ; skos:notation "urn:dkg:concept:<slug>" .
827
+ :topic-pattern a :UriPattern ; skos:notation "urn:dkg:topic:<slug>" .
828
+ :question-pattern a :UriPattern ; skos:notation "urn:dkg:question:<slug>" .
829
+ :finding-pattern a :UriPattern ; skos:notation "urn:dkg:finding:<slug>" .
830
+ :note-pattern a :UriPattern ; skos:notation "urn:dkg:note:<slug>" .
831
+ :highlight-pattern a :UriPattern ; skos:notation "urn:dkg:highlight:<slug>" .
832
+ :insight-pattern a :UriPattern ; skos:notation "urn:dkg:insight:<slug>" .
833
+
834
+ :slug-normalisation a skos:Note ;
835
+ skos:definition "Lowercase → ASCII-fold → strip stopwords → hyphenate → ≤60 chars." .
836
+ `,A4=`@prefix owl: <http://www.w3.org/2002/07/owl#> .
837
+ @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
838
+ @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
839
+ @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
840
+ @prefix dcterms: <http://purl.org/dc/terms/> .
841
+ @prefix schema: <http://schema.org/> .
842
+ @prefix prov: <http://www.w3.org/ns/prov#> .
843
+ @prefix skos: <http://www.w3.org/2004/02/skos/core#> .
844
+ @prefix dcat: <http://www.w3.org/ns/dcat#> .
845
+ @prefix fabio: <http://purl.org/spar/fabio/> .
846
+ @prefix time: <http://www.w3.org/2006/time#> .
847
+
848
+ @prefix chat: <http://dkg.io/ontology/chat/> .
849
+ @prefix : <http://dkg.io/ontology/scientific-research/> .
850
+
851
+ <http://dkg.io/ontology/scientific-research/>
852
+ a owl:Ontology ;
853
+ dcterms:title "DKG Scientific Research Project Ontology (v1)" ;
854
+ dcterms:description """Starter for empirical scientific research:
855
+ hypotheses → experiments → results → reproducibility chains. Composes
856
+ with FaBiO for scholarly works, DCAT for datasets, PROV-O for
857
+ provenance, OWL Time for sequencing.""" ;
858
+ owl:versionInfo "1.0.0" ;
859
+ dcterms:created "2026-04-18"^^xsd:date ;
860
+ owl:imports
861
+ <http://schema.org/> , <http://purl.org/dc/terms/> ,
862
+ <http://www.w3.org/ns/prov#> ,
863
+ <http://www.w3.org/2004/02/skos/core#> ,
864
+ <http://www.w3.org/ns/dcat#> ,
865
+ <http://purl.org/spar/fabio/> ,
866
+ <http://www.w3.org/2006/time#> .
867
+
868
+ # ─── Universal annotation predicates ────────────────────────────────
869
+ chat:topic a owl:DatatypeProperty ; rdfs:domain chat:Turn ; rdfs:range xsd:string .
870
+ chat:mentions a owl:ObjectProperty ; rdfs:domain chat:Turn ; rdfs:subPropertyOf schema:mentions .
871
+ chat:examines a owl:ObjectProperty ; rdfs:domain chat:Turn .
872
+ chat:proposes a owl:ObjectProperty ; rdfs:domain chat:Turn .
873
+ chat:concludes a owl:ObjectProperty ; rdfs:domain chat:Turn ; rdfs:range :Result .
874
+ chat:asks a owl:ObjectProperty ; rdfs:domain chat:Turn ; rdfs:range :Question .
875
+
876
+ # ─── Universal annotation entities ──────────────────────────────────
877
+ :Concept rdfs:subClassOf skos:Concept .
878
+ :Topic rdfs:subClassOf skos:Concept .
879
+ :Question rdfs:subClassOf schema:Question .
880
+ :Finding rdfs:subClassOf prov:Entity .
881
+
882
+ # ─── Scientific-research-specific ───────────────────────────────────
883
+
884
+ :Hypothesis a owl:Class ;
885
+ rdfs:label "Hypothesis" ;
886
+ rdfs:comment "A testable claim. Linked to Experiments via :testedBy and to Results via :supportedBy / :refutedBy." ;
887
+ rdfs:subClassOf prov:Entity .
888
+
889
+ :Experiment a owl:Class ;
890
+ rdfs:label "Experiment" ;
891
+ rdfs:comment "A defined procedure executed to test a Hypothesis. Subclass of prov:Activity for full provenance." ;
892
+ rdfs:subClassOf prov:Activity .
893
+
894
+ :Method a owl:Class ;
895
+ rdfs:label "Method" ;
896
+ rdfs:comment "A reusable methodology applied within Experiments." ;
897
+ rdfs:subClassOf prov:Plan .
898
+
899
+ :Result a owl:Class ;
900
+ rdfs:label "Result" ;
901
+ rdfs:comment "An outcome produced by an Experiment — quantitative or qualitative." ;
902
+ rdfs:subClassOf prov:Entity .
903
+
904
+ :Dataset a owl:Class ;
905
+ rdfs:label "Dataset" ;
906
+ rdfs:comment "An input or output dataset for an Experiment. Aligned with DCAT." ;
907
+ rdfs:subClassOf dcat:Dataset .
908
+
909
+ :testedBy a owl:ObjectProperty ;
910
+ rdfs:label "tested by" ;
911
+ rdfs:domain :Hypothesis ;
912
+ rdfs:range :Experiment .
913
+
914
+ :supportedBy a owl:ObjectProperty ;
915
+ rdfs:label "supported by" ;
916
+ rdfs:domain :Hypothesis ;
917
+ rdfs:range :Result .
918
+
919
+ :refutedBy a owl:ObjectProperty ;
920
+ rdfs:label "refuted by" ;
921
+ rdfs:domain :Hypothesis ;
922
+ rdfs:range :Result .
923
+
924
+ :usesDataset a owl:ObjectProperty ;
925
+ rdfs:label "uses dataset" ;
926
+ rdfs:domain :Experiment ;
927
+ rdfs:range :Dataset .
928
+
929
+ :reproducedBy a owl:ObjectProperty ;
930
+ rdfs:label "reproduced by" ;
931
+ rdfs:domain :Experiment ;
932
+ rdfs:range :Experiment ;
933
+ rdfs:comment "An Experiment that successfully reproduced this one's Results." .
934
+
935
+ # ─── URI patterns ───────────────────────────────────────────────────
936
+ :UriPattern rdfs:label "URI minting pattern" .
937
+
938
+ :concept-pattern a :UriPattern ; skos:notation "urn:dkg:concept:<slug>" .
939
+ :topic-pattern a :UriPattern ; skos:notation "urn:dkg:topic:<slug>" .
940
+ :question-pattern a :UriPattern ; skos:notation "urn:dkg:question:<slug>" .
941
+ :finding-pattern a :UriPattern ; skos:notation "urn:dkg:finding:<slug>" .
942
+ :hypothesis-pattern a :UriPattern ; skos:notation "urn:dkg:hypothesis:<slug>" .
943
+ :experiment-pattern a :UriPattern ; skos:notation "urn:dkg:experiment:<slug>" .
944
+ :method-pattern a :UriPattern ; skos:notation "urn:dkg:method:<slug>" .
945
+ :result-pattern a :UriPattern ; skos:notation "urn:dkg:result:<slug>" .
946
+ :dataset-pattern a :UriPattern ; skos:notation "urn:dkg:dataset:<slug>" .
947
+
948
+ :slug-normalisation a skos:Note ;
949
+ skos:definition "Lowercase → ASCII-fold → strip stopwords → hyphenate → ≤60 chars." .
950
+ `,j4=`# Book-research agent guide
951
+
952
+ This starter ships an RDF ontology for **book-research projects** —
953
+ research notebooks anchored in scholarly sources (citations, quotes,
954
+ arguments, hypotheses). The formal schema lives in \`ontology.ttl\`
955
+ alongside this guide.
956
+
957
+ For V10 MCP tool usage, see
958
+ [\`packages/cli/skills/dkg-node/SKILL.md\`](../../../../cli/skills/dkg-node/SKILL.md).
959
+ The tool surface to use against this ontology:
960
+
961
+ - \`dkg_knowledge_asset_create\` + \`dkg_knowledge_asset_write\` — populate (WM)
962
+ - \`dkg_knowledge_asset_finalize\` — seal the draft (the "git commit")
963
+ - \`dkg_knowledge_asset_share\` — share with peers (SWM)
964
+ - \`dkg_knowledge_asset_publish\` — mint on chain (VM); returns the asset's UAL
965
+ - \`dkg_query\` — SPARQL read; \`dkg_memory_search\` — free-text recall
966
+
967
+ The longer per-domain agent-guide walkthrough format will return when
968
+ the V10 ontology endpoint and per-project annotation workflow stabilise.
969
+ `,T4=`# Coding-project agent guide
970
+
971
+ This starter ships an RDF ontology for **coding projects** —
972
+ shared project memory for AI coding agents (decisions, tasks, code
973
+ references, GitHub activity, chat turns). The formal schema lives in
974
+ \`ontology.ttl\` alongside this guide.
975
+
976
+ For V10 MCP tool usage, see
977
+ [\`packages/cli/skills/dkg-node/SKILL.md\`](../../../../cli/skills/dkg-node/SKILL.md).
978
+ The tool surface to use against this ontology:
979
+
980
+ - \`dkg_knowledge_asset_create\` + \`dkg_knowledge_asset_write\` — populate (WM)
981
+ - \`dkg_knowledge_asset_finalize\` — seal the draft (the "git commit")
982
+ - \`dkg_knowledge_asset_share\` — share with peers (SWM)
983
+ - \`dkg_knowledge_asset_publish\` — mint on chain (VM); returns the asset's UAL
984
+ - \`dkg_query\` — SPARQL read; \`dkg_memory_search\` — free-text recall
985
+
986
+ The longer per-domain agent-guide walkthrough format will return when
987
+ the V10 ontology endpoint and per-project annotation workflow stabilise.
988
+ `,R4=`# Narrative-writing agent guide
989
+
990
+ This starter ships an RDF ontology for **narrative-writing projects** —
991
+ the structural elements of long-form narrative (Characters, Scenes,
992
+ PlotPoints, Themes, Settings) and their relationships. The formal
993
+ schema lives in \`ontology.ttl\` alongside this guide.
994
+
995
+ For V10 MCP tool usage, see
996
+ [\`packages/cli/skills/dkg-node/SKILL.md\`](../../../../cli/skills/dkg-node/SKILL.md).
997
+ The tool surface to use against this ontology:
998
+
999
+ - \`dkg_knowledge_asset_create\` + \`dkg_knowledge_asset_write\` — populate (WM)
1000
+ - \`dkg_knowledge_asset_finalize\` — seal the draft (the "git commit")
1001
+ - \`dkg_knowledge_asset_share\` — share with peers (SWM)
1002
+ - \`dkg_knowledge_asset_publish\` — mint on chain (VM); returns the asset's UAL
1003
+ - \`dkg_query\` — SPARQL read; \`dkg_memory_search\` — free-text recall
1004
+
1005
+ The longer per-domain agent-guide walkthrough format will return when
1006
+ the V10 ontology endpoint and per-project annotation workflow stabilise.
1007
+ `,N4=`# PKM agent guide
1008
+
1009
+ This starter ships an RDF ontology for **PKM (Personal Knowledge
1010
+ Management) projects** — Notes, Highlights, Insights, and the links
1011
+ that grow a knowledge garden organically. The formal schema lives in
1012
+ \`ontology.ttl\` alongside this guide.
1013
+
1014
+ For V10 MCP tool usage, see
1015
+ [\`packages/cli/skills/dkg-node/SKILL.md\`](../../../../cli/skills/dkg-node/SKILL.md).
1016
+ The tool surface to use against this ontology:
1017
+
1018
+ - \`dkg_knowledge_asset_create\` + \`dkg_knowledge_asset_write\` — populate (WM)
1019
+ - \`dkg_knowledge_asset_finalize\` — seal the draft (the "git commit")
1020
+ - \`dkg_knowledge_asset_share\` — share with peers (SWM)
1021
+ - \`dkg_knowledge_asset_publish\` — mint on chain (VM); returns the asset's UAL
1022
+ - \`dkg_query\` — SPARQL read; \`dkg_memory_search\` — free-text recall
1023
+
1024
+ The longer per-domain agent-guide walkthrough format will return when
1025
+ the V10 ontology endpoint and per-project annotation workflow stabilise.
1026
+ `,_4=`# Scientific-research agent guide
1027
+
1028
+ This starter ships an RDF ontology for **scientific-research projects** —
1029
+ the empirical research arc (Hypotheses → Experiments → Results →
1030
+ Reproducibility chains), anchored in PROV-O and FaBiO so the graph
1031
+ composes with existing scholarly publishing infrastructure. The formal
1032
+ schema lives in \`ontology.ttl\` alongside this guide.
1033
+
1034
+ For V10 MCP tool usage, see
1035
+ [\`packages/cli/skills/dkg-node/SKILL.md\`](../../../../cli/skills/dkg-node/SKILL.md).
1036
+ The tool surface to use against this ontology:
1037
+
1038
+ - \`dkg_knowledge_asset_create\` + \`dkg_knowledge_asset_write\` — populate (WM)
1039
+ - \`dkg_knowledge_asset_finalize\` — seal the draft (the "git commit")
1040
+ - \`dkg_knowledge_asset_share\` — share with peers (SWM)
1041
+ - \`dkg_knowledge_asset_publish\` — mint on chain (VM); returns the asset's UAL
1042
+ - \`dkg_query\` — SPARQL read; \`dkg_memory_search\` — free-text recall
1043
+
1044
+ The longer per-domain agent-guide walkthrough format will return when
1045
+ the V10 ontology endpoint and per-project annotation workflow stabilise.
1046
+ `,pt={rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",schema:"http://schema.org/",dcterms:"http://purl.org/dc/terms/",xsd:"http://www.w3.org/2001/XMLSchema#",prov:"http://www.w3.org/ns/prov#",owl:"http://www.w3.org/2002/07/owl#"};function Fi(e){if(!Yj(e))throw new Error(`Invalid /wm/write IRI object: ${e}`);return e}function oa(e){return`"${Zh(e)}"`}function Nc(e,t){return`"${Zh(e)}"^^<${Fi(t)}>`}function O4({contextGraphId:e,starterSlug:t,ttl:a,guide:r,nowIso:o=new Date().toISOString()}){if(!e)throw new Error("contextGraphId is required");if(!t)throw new Error("starterSlug is required");const s=Fi(`urn:dkg:project:${e}:ontology`),c=Fi(`${s}:agent-guide`),d=[{subject:s,predicate:pt.rdf+"type",object:Fi(pt.owl+"Ontology")},{subject:s,predicate:pt.rdf+"type",object:Fi(pt.prov+"Entity")},{subject:s,predicate:pt.rdfs+"label",object:oa(`Project ontology — ${e}`)},{subject:s,predicate:pt.schema+"name",object:oa(`Project ontology — ${e}`)},{subject:s,predicate:pt.dcterms+"title",object:oa(`Project ontology — ${e}`)},{subject:s,predicate:pt.dcterms+"description",object:oa(`The active ontology for context graph ${e}, derived from the '${t}' starter.`)},{subject:s,predicate:pt.dcterms+"created",object:Nc(o,pt.xsd+"dateTime")},{subject:s,predicate:pt.dcterms+"modified",object:Nc(o,pt.xsd+"dateTime")},{subject:s,predicate:pt.dcterms+"source",object:oa(t)},{subject:s,predicate:pt.schema+"encodingFormat",object:oa("text/turtle")},{subject:s,predicate:pt.schema+"text",object:oa(a)},{subject:s,predicate:pt.dcterms+"references",object:Fi(c)},{subject:c,predicate:pt.rdf+"type",object:Fi(pt.schema+"DigitalDocument")},{subject:c,predicate:pt.rdfs+"label",object:oa(`Agent guide — ${e} ontology`)},{subject:c,predicate:pt.schema+"name",object:oa(`Agent guide — ${e} ontology`)},{subject:c,predicate:pt.dcterms+"title",object:oa(`Agent guide — ${e} ontology`)},{subject:c,predicate:pt.dcterms+"created",object:Nc(o,pt.xsd+"dateTime")},{subject:c,predicate:pt.dcterms+"modified",object:Nc(o,pt.xsd+"dateTime")},{subject:c,predicate:pt.schema+"encodingFormat",object:oa("text/markdown")},{subject:c,predicate:pt.schema+"text",object:oa(r)},{subject:c,predicate:pt.schema+"about",object:Fi(s)}];return{ontologyUri:s,guideUri:c,quads:d}}async function _c(e,t){const a=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json",...Rt()},body:JSON.stringify(t)});if(!a.ok){const r=await a.json().catch(()=>({})),o=(r==null?void 0:r.error)??`HTTP ${a.status}`;throw new Error(o)}return a.json()}const M4=Object.assign({"../../../../mcp-dkg/templates/ontologies/book-research/ontology.ttl":S4,"../../../../mcp-dkg/templates/ontologies/coding-project/ontology.ttl":k4,"../../../../mcp-dkg/templates/ontologies/narrative-writing/ontology.ttl":C4,"../../../../mcp-dkg/templates/ontologies/pkm/ontology.ttl":E4,"../../../../mcp-dkg/templates/ontologies/scientific-research/ontology.ttl":A4}),D4=Object.assign({"../../../../mcp-dkg/templates/ontologies/book-research/agent-guide.md":j4,"../../../../mcp-dkg/templates/ontologies/coding-project/agent-guide.md":T4,"../../../../mcp-dkg/templates/ontologies/narrative-writing/agent-guide.md":R4,"../../../../mcp-dkg/templates/ontologies/pkm/agent-guide.md":N4,"../../../../mcp-dkg/templates/ontologies/scientific-research/agent-guide.md":_4});function L4(){const e={};for(const[t,a]of Object.entries(M4)){const r=t.match(/ontologies\/([^/]+)\/ontology\.ttl$/);if(!r)continue;const o=r[1];e[o]={ttl:a,guide:""}}for(const[t,a]of Object.entries(D4)){const r=t.match(/ontologies\/([^/]+)\/agent-guide\.md$/);if(!r)continue;const o=r[1];e[o]&&(e[o].guide=a)}return e}const um=L4(),z4=[{slug:"coding-project",displayName:"Coding project",description:"Software projects: decisions, tasks, code, GitHub. The v1 reference ontology."},{slug:"book-research",displayName:"Book / paper research",description:"Long-form non-fiction: hypotheses, arguments, citations, quotes. Built on BIBO + SPAR."},{slug:"pkm",displayName:"Personal knowledge management",description:"Notes, highlights, insights — daily-driver PKM workflow. Composes with SKOS."},{slug:"scientific-research",displayName:"Scientific research",description:"Empirical research: hypotheses → experiments → results → reproducibility. Built on PROV-O + DCAT + FaBiO."},{slug:"narrative-writing",displayName:"Narrative writing",description:"Fiction or narrative non-fiction: characters, scenes, plot points, themes."}];function I4(){return z4.filter(e=>um[e.slug])}function P4(e){return um[e]??null}async function B4(e,t){const a=P4(t);if(!a)throw new Error(`Unknown ontology starter '${t}'. Available: ${Object.keys(um).join(", ")}`);if(!a.ttl||!a.guide)throw new Error(`Starter '${t}' is missing ontology.ttl or agent-guide.md.`);await _c("/api/sub-graph/create",{contextGraphId:e,subGraphName:"meta"}).catch(d=>{if(!String((d==null?void 0:d.message)??d).includes("already exists"))throw d});const{ontologyUri:r,guideUri:o,quads:s}=O4({contextGraphId:e,starterSlug:t,ttl:a.ttl,guide:a.guide});await _c("/api/knowledge-assets/project-ontology/wm/discard",{contextGraphId:e,subGraphName:"meta"}).catch(d=>{const p=String((d==null?void 0:d.message)??d);if(!/404|not found/i.test(p))throw d}),await _c("/api/knowledge-assets/project-ontology/wm/write",{contextGraphId:e,subGraphName:"meta",quads:s});const c=await _c("/api/knowledge-assets/project-ontology/swm/share",{contextGraphId:e,subGraphName:"meta"});if(!c.swmShared||!c.sealed||!c.publishReady)throw new Error("Project ontology atomic share did not reach Shared Working Memory");return{ontologyUri:r,guideUri:o,tripleCount:s.length}}async function dm(e,t){const a=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json",...Rt()},body:JSON.stringify(t)}),r=await a.text();let o;if(r)try{o=JSON.parse(r)}catch{o={raw:r}}if(!a.ok){const s=(o==null?void 0:o.error)??`HTTP ${a.status}`;throw new Error(typeof s=="string"?s:JSON.stringify(s))}return o}function U4(e,t={}){return dm(`/api/context-graph/${encodeURIComponent(e)}/manifest/publish`,t)}function H4(e,t){return dm(`/api/context-graph/${encodeURIComponent(e)}/manifest/plan-install`,t)}function $4(e,t){return dm(`/api/context-graph/${encodeURIComponent(e)}/manifest/install`,t)}const w1="dkg.wireWorkspace.parentDir",S1="dkg.wireWorkspace.nickname",k1="dkg.wireWorkspace.tools",gp=[{value:"cursor",label:"Cursor",description:"Wires .cursor/mcp.json + hooks + rules into the workspace."},{value:"claude-code",label:"Claude Code",description:"Merges hooks into ~/.claude/settings.json. Requires Claude Code installed."},{value:"both",label:"Both Cursor and Claude Code",description:"Wires both tools so either can operate on this project."},{value:"cursor",label:"Codex (coming soon)",description:"Codex CLI integration isn't shipped yet — pick another tool for now.",disabled:!0,comingSoon:!0}];function q4(e,t){const a=t.split("/"),r=a[a.length-1]??"";return r||(e??"project").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")}function F4(e){if(!e)return"";const t=e.hostname.replace(/\.local$/,"").replace(/-/g," ");return`${e.username} @ ${t}`}function C1(e){return e==="both"?["cursor","claude-code"]:[e]}function Dw({contextGraphId:e,projectName:t,defaultAgentNickname:a,onDone:r,onCancel:o,variant:s}){var ae;const c=S.useMemo(()=>q4(t,e),[t,e]),[d,p]=S.useState(null),[f,y]=S.useState(null),[m,b]=S.useState(""),[x,k]=S.useState(""),[C,A]=S.useState("cursor"),[E,R]=S.useState(!1),[_,U]=S.useState(null),[I,O]=S.useState(null),[P,Y]=S.useState(null);S.useEffect(()=>{let q=!1;return(async()=>{try{const[Q,F]=await Promise.all([fetch("/api/host/info",{headers:Rt()}).then(X=>X.ok?X.json():null),Su().catch(()=>null)]);if(q)return;if(Q){p(Q);const X=typeof window<"u"&&window.localStorage.getItem(w1)||Q.defaultWorkspaceParent;b(`${X}/${c}`)}F&&y(F);const ee=typeof window<"u"&&window.localStorage.getItem(S1);a?k(a):ee?k(ee):Q&&k(F4(Q));const ie=typeof window<"u"&&window.localStorage.getItem(k1);ie&&(ie==="cursor"||ie==="claude-code"||ie==="both")&&A(ie)}catch(Q){q||console.warn("[WireWorkspacePanel] host info / identity fetch failed:",Q)}})(),()=>{q=!0}},[c,a]);function D(q){typeof window>"u"||(window.localStorage.setItem(w1,q),x&&window.localStorage.setItem(S1,x),window.localStorage.setItem(k1,C))}async function T(){R(!0),U(null);try{const q=m.trim();if(!q||q.startsWith("~"))throw new Error("Workspace path must be an absolute path (start with `/`). The daemon will create the directory if it does not exist.");const Q=await H4(e,{workspaceRoot:q,agentNickname:x.trim(),tools:C1(C)});O(Q);const F=q.lastIndexOf("/");F>0&&D(q.slice(0,F))}catch(q){U((q==null?void 0:q.message)||"Preview failed")}finally{R(!1)}}async function G(){R(!0),U(null);try{const q=m.trim(),Q=await $4(e,{workspaceRoot:q,agentNickname:x.trim(),tools:C1(C)});Y(Q)}catch(q){U((q==null?void 0:q.message)||"Install failed")}finally{R(!1)}}if(P)return g.jsxs("div",{children:[g.jsxs("div",{style:{padding:"12px 14px",borderRadius:8,marginBottom:14,fontSize:12,background:"rgba(34, 197, 94, 0.08)",border:"1px solid rgba(34, 197, 94, 0.25)",color:"var(--accent-green)"},children:[g.jsx("div",{style:{fontWeight:600,marginBottom:6},children:"Workspace wired."}),"Open ",g.jsx("code",{style:{fontFamily:"var(--font-mono)"},children:m})," in ",C==="claude-code"?"Claude Code":C==="both"?"Cursor or Claude Code":"Cursor",". On the first chat, your agent will see the project ontology",s==="join"?", tasks, and decisions":" you publish via the canonical assertion-write flow","."]}),g.jsx("div",{style:{fontSize:11,color:"var(--text-secondary)",marginBottom:8},children:"Files written:"}),g.jsxs("pre",{style:{fontSize:10,fontFamily:"var(--font-mono)",maxHeight:200,overflow:"auto",padding:10,borderRadius:6,background:"var(--bg-secondary)",border:"1px solid var(--border-primary)",margin:0},children:[P.written.map(q=>`${q.action.padEnd(9)} ${q.absPath} (${q.bytesWritten.toLocaleString()} bytes)`).join(`
1047
+ `),P.skipped.length?`
1048
+
1049
+ Skipped:
1050
+ `+P.skipped.map(q=>` - ${q}`).join(`
1051
+ `):"",P.warnings.length?`
1052
+
1053
+ Warnings:
1054
+ `+P.warnings.map(q=>` - ${q}`).join(`
1055
+ `):""]}),g.jsx("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:14},children:g.jsx("button",{className:"v10-modal-btn primary",onClick:r,children:"Done"})})]});if(I)return g.jsxs("div",{children:[_&&g.jsx("div",{className:"v10-modal-error",style:{marginBottom:12},children:_}),g.jsx("div",{style:{marginBottom:10,fontSize:11,color:"var(--text-secondary)"},children:"Review the install plan. Files are only written when you click Install."}),g.jsx("pre",{style:{fontSize:10,fontFamily:"var(--font-mono)",maxHeight:320,overflow:"auto",padding:12,borderRadius:6,background:"var(--bg-secondary)",border:"1px solid var(--border-primary)",margin:0,whiteSpace:"pre-wrap"},children:I.markdown}),g.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:14,gap:10},children:[g.jsx("button",{className:"v10-modal-btn",onClick:()=>{O(null),U(null)},disabled:E,children:"← Back"}),g.jsxs("div",{style:{display:"flex",gap:8},children:[g.jsx("button",{className:"v10-modal-btn",onClick:r,disabled:E,children:"Skip for now"}),g.jsx("button",{className:"v10-modal-btn primary",onClick:G,disabled:E,children:E?"Installing…":"Install"})]})]})]});const W=((ae=gp.find(q=>q.value===C&&!q.disabled))==null?void 0:ae.description)??gp[0].description;return g.jsxs("div",{children:[g.jsxs("div",{style:{padding:"10px 14px",borderRadius:8,marginBottom:14,fontSize:12,background:"rgba(59, 130, 246, 0.08)",border:"1px solid rgba(59, 130, 246, 0.25)",color:"var(--accent-primary, #3b82f6)"},children:[g.jsx("div",{style:{fontWeight:600,marginBottom:4},children:s==="create"?"Wire your local workspace":"Wire this project locally"}),s==="create"?"Choose a directory for the new project and which coding tool you want it wired for. The daemon will populate the workspace with the right config files so your agent can join the project from turn one.":"Choose a local directory for this project and which coding tool you want it wired for. The daemon will populate the workspace with the right config files so your agent can collaborate on this project."]}),_&&g.jsx("div",{className:"v10-modal-error",style:{marginBottom:12},children:_}),g.jsxs("div",{className:"v10-form-group",children:[g.jsx("label",{className:"v10-form-label",children:"Workspace path"}),g.jsx("input",{className:"v10-form-input",type:"text",value:m,onChange:q=>b(q.target.value),placeholder:d?`${d.defaultWorkspaceParent}/${c}`:"/Users/you/code/project",spellCheck:!1,style:{fontFamily:"var(--font-mono)",fontSize:12}}),g.jsxs("div",{style:{fontSize:10,color:"var(--text-tertiary)",marginTop:4},children:["Absolute path. Created if it doesn't exist. Daemon writes only inside this dir (plus optionally ",g.jsx("code",{children:"~/.claude/settings.json"})," if Claude Code is selected).",d&&g.jsxs(g.Fragment,{children:[" Defaulted from your ",g.jsx("code",{children:"$HOME"})," = ",g.jsx("code",{children:d.homedir}),"."]})]})]}),g.jsxs("div",{className:"v10-form-group",children:[g.jsx("label",{className:"v10-form-label",children:"Coding tool to wire"}),g.jsx("select",{className:"v10-form-select",value:C,onChange:q=>A(q.target.value),children:gp.map((q,Q)=>g.jsx("option",{value:q.disabled?"__disabled__":q.value,disabled:q.disabled,children:q.label},`${q.label}-${Q}`))}),g.jsx("div",{style:{fontSize:10,color:"var(--text-tertiary)",marginTop:4},children:W})]}),g.jsxs("div",{className:"v10-form-group",children:[g.jsx("label",{className:"v10-form-label",children:"Your agent identity"}),g.jsx("input",{className:"v10-form-input",type:"text",value:f?`urn:dkg:agent:${f.agentAddress.toLowerCase()}`:"fetching…",disabled:!0,spellCheck:!1,style:{fontFamily:"var(--font-mono)",fontSize:11,opacity:.75}}),g.jsxs("div",{style:{fontSize:10,color:"var(--text-tertiary)",marginTop:4},children:["Cryptographic URI derived from this node's wallet address. Same on every project on this machine. Attribution (",g.jsx("code",{children:"prov:wasAttributedTo"}),") on every chat turn uses this URI."]})]}),g.jsxs("div",{className:"v10-form-group",children:[g.jsx("label",{className:"v10-form-label",children:"Nickname for this agent"}),g.jsx("input",{className:"v10-form-input",type:"text",value:x,onChange:q=>k(q.target.value),placeholder:"e.g. Alice on laptop 1",spellCheck:!1,maxLength:80}),g.jsx("div",{style:{fontSize:10,color:"var(--text-tertiary)",marginTop:4},children:"Free-form human label rendered as the agent's name in chips, lists, and rdfs:label triples. Doesn't affect attribution — only changes how you appear to others."})]}),g.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:14,gap:10},children:[o?g.jsx("button",{className:"v10-modal-btn",onClick:o,disabled:E,children:"Cancel"}):g.jsx("button",{className:"v10-modal-btn",onClick:r,disabled:E,children:"Skip for now"}),g.jsx("button",{className:"v10-modal-btn primary",onClick:T,disabled:E||!m.trim()||!x.trim(),children:E?"Loading preview…":"Preview install"})]})]})}const E1='button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), iframe, [tabindex]:not([tabindex="-1"])';function ou(e,t){const a=S.useRef(null),r=S.useRef(null);S.useEffect(()=>{if(e)return r.current=document.activeElement??null,queueMicrotask(()=>{const s=a.current;if(!s)return;const c=s.querySelector(E1),p=s.querySelector("[autofocus]")??c;p?p.focus():(s.hasAttribute("tabindex")||s.setAttribute("tabindex","-1"),s.focus())}),()=>{var s,c;(c=(s=r.current)==null?void 0:s.focus)==null||c.call(s)}},[e]),S.useEffect(()=>{if(!e)return;const s=c=>{if(c.key==="Escape"){c.stopPropagation(),t();return}if(c.key!=="Tab")return;const d=a.current;if(!d)return;const p=Array.from(d.querySelectorAll(E1)).filter(b=>b.offsetParent!==null||b===document.activeElement);if(p.length===0){c.preventDefault(),d.hasAttribute("tabindex")||d.setAttribute("tabindex","-1"),d.focus();return}const f=p[0],y=p[p.length-1],m=document.activeElement;if(m===d){c.preventDefault(),(c.shiftKey?y:f).focus();return}c.shiftKey&&m===f?(c.preventDefault(),y.focus()):!c.shiftKey&&m===y&&(c.preventDefault(),f.focus())};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[e,t]);const o=S.useCallback(s=>{s.target===s.currentTarget&&t()},[t]);return{dialogRef:a,onBackdropClick:o}}const kl=80,G4=/<\/?[a-z][^>]*>/i,V4=/[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F]/g,W4=/[a-z0-9]/i;function Y4(e){let t="",a=0;for(;a<e.length;){if(e.charCodeAt(a)===60){const o=e.charCodeAt(a+1);if(o>=65&&o<=90||o>=97&&o<=122||o===47){const c=e.indexOf(">",a+1);if(c===-1)break;a=c+1;continue}}t+=e[a],a+=1}return t}function Lw(e){if(typeof e!="string")return"";let t=Y4(e);return t=t.replace(/[<>]/g,""),t=t.replace(V4,""),t=t.replace(/\s+/g," "),t=t.trim(),t.length>kl&&(t=t.slice(0,kl)),t}function A1(e){const t=Lw(e);return t?W4.test(t)?G4.test(e)?"HTML tags are not allowed in the name — they have been stripped automatically.":/[<>]/.test(e)?"Angle brackets (< or >) are not allowed in the name — they and any text consumed by an unclosed tag have been stripped automatically.":e.length>kl?`Name was trimmed to ${kl} characters (was ${e.length}).`:null:"Name must contain at least one letter or digit.":"Enter a name with at least one letter or digit."}function j1(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")}function K4({open:e,onClose:t}){var rt,fe;const[a,r]=S.useState(""),[o,s]=S.useState(""),[c,d]=S.useState("curated"),[p,f]=S.useState("curator-only"),[y,m]=S.useState(!1),[b,x]=S.useState("community"),k=I4(),[C,A]=S.useState(((rt=k[0])==null?void 0:rt.slug)??"coding-project"),[E,R]=S.useState(!1),[_,U]=S.useState("off"),[I,O]=S.useState("7d"),[P,Y]=S.useState("100k"),[D,T]=S.useState(!1),[G,W]=S.useState(""),[ae,q]=S.useState(null),[Q,F]=S.useState(null),[ee,ie]=S.useState(null),[X,M]=S.useState(null),[L,K]=S.useState(""),[N,ue]=S.useState(!0),[ge,me]=S.useState(!1),{setContextGraphs:Ee,contextGraphs:Ue,setActiveProject:Re}=ga(),{openTab:tt}=xn(),{setStage:It,stage:xt}=cm(),wt=()=>{ue(!0),me(!1),Su().then(H=>{ie(H.agentAddress),me(!1)}).catch(()=>{ie(null),me(!0)}).finally(()=>ue(!1))};S.useEffect(()=>{e&&(F(null),wt())},[e]);const vt=ou(e&&!X,t),an=ou(e&&!!X,()=>{M(null),K(""),F(null),r(""),s(""),t()});if(!e)return null;const Be=Lw(a),ht=j1(Be),Pt=ee&&ht?`${ee}/${ht}`:ht?`<agent-address>/${ht}`:"",Mt=a?A1(a):null,he=H=>{r(H)},Bt=async()=>{const H=Be;if(!H||Mt)return;T(!0),q(null),F(null),W(y?"Registering context graph on the network…":"Creating context graph locally…");const le=j1(H);if(!ee){q("Agent identity is still loading. Please wait a moment and try again."),T(!1);return}const pe=`${ee}/${le}`;try{const ye=setTimeout(()=>W(y?"On-chain registration in progress — this can take up to 30s…":"Setting up local context graph…"),5e3),B=c==="curated"?1:0,Te=p==="curator-only"?0:1,it=c==="curated"?{accessPolicy:B,publishPolicy:Te,allowedAgents:ee?[ee]:[],register:y}:{accessPolicy:B,publishPolicy:Te,register:y},Pe=await iT(pe,H,o.trim()||void 0,it);if(clearTimeout(ye),y&&Pe.registered===!1){const Se=`On-chain registration failed: ${Pe.registerError??"unknown error"}. Project is created locally and usable for everything except Verifiable Memory publishing. Retry registration from the project's Settings when ready.`;console.warn("[CreateProjectModal]",Se),F(Se)}if(b==="community"||b==="agent")try{W(`Installing '${C}' ontology…`),await B4(Pe.created,C)}catch(Se){console.warn("[CreateProjectModal] ontology install failed:",Se),W(`Context graph created, but ontology install failed: ${(Se==null?void 0:Se.message)??Se}`)}let Xe=!0;try{W("Publishing context graph manifest…"),await U4(Pe.created,{})}catch(Se){Xe=!1,console.warn("[CreateProjectModal] manifest publish failed:",Se),W(`Context graph created, but manifest publish failed: ${(Se==null?void 0:Se.message)??Se}`)}W("Refreshing context graph list…");const{contextGraphs:We}=await Xh();Ee(We??[]),Re(Pe.created),tt({id:`project:${Pe.created}`,label:H,closable:!0}),xt<2&&It(2),Xe?(K(H),M(Pe.created),W("")):setTimeout(()=>{r(""),s(""),W(""),t()},2500)}catch(ye){const B=(ye==null?void 0:ye.message)||"Failed to create context graph";B.includes("already exists")||B.includes("409")?q("A context graph with this ID already exists. Try a different name."):(B.includes("taking longer"),q(B)),W("")}finally{T(!1)}},Qn=Ue.length===0;function wn(){M(null),K(""),F(null),r(""),s(""),t()}return X?g.jsx("div",{className:"v10-modal-overlay",onClick:an.onBackdropClick,role:"presentation",children:g.jsxs("div",{className:"v10-modal-box",ref:an.dialogRef,role:"dialog","aria-modal":"true","aria-labelledby":"dkg-wire-modal-title",children:[g.jsx("button",{type:"button",className:"v10-modal-close",onClick:wn,"aria-label":"Close wire workspace dialog",title:"Close (Esc)",style:{position:"absolute",top:12,right:12,background:"none",border:"none",color:"var(--text-tertiary)",cursor:"pointer",fontSize:18,lineHeight:1,padding:4},children:"×"}),g.jsxs("div",{className:"v10-modal-header",children:[g.jsxs("div",{id:"dkg-wire-modal-title",className:"v10-modal-title",children:["Wire workspace for ",L]}),g.jsx("div",{className:"v10-modal-subtitle",children:"Context graph created. Now wire a local workspace so you can plan it from your own Cursor."})]}),g.jsxs("div",{className:"v10-modal-body",children:[Q&&g.jsx("div",{className:"v10-modal-warning",children:Q}),g.jsx(Dw,{contextGraphId:X,projectName:L,variant:"create",onDone:wn})]})]})}):g.jsx("div",{className:"v10-modal-overlay",onClick:vt.onBackdropClick,role:"presentation",children:g.jsxs("div",{className:"v10-modal-box",ref:vt.dialogRef,role:"dialog","aria-modal":"true","aria-labelledby":"dkg-create-cg-title","aria-describedby":"dkg-create-cg-subtitle",children:[g.jsx("button",{type:"button",className:"v10-modal-close",onClick:t,"aria-label":"Close create context graph dialog",title:"Close (Esc)",style:{position:"absolute",top:12,right:12,background:"none",border:"none",color:"var(--text-tertiary)",cursor:"pointer",fontSize:18,lineHeight:1,padding:4,zIndex:1},children:"×"}),g.jsxs("div",{className:"v10-modal-header",children:[g.jsx("div",{id:"dkg-create-cg-title",className:"v10-modal-title",children:"Create New Context Graph"}),g.jsx("div",{id:"dkg-create-cg-subtitle",className:"v10-modal-subtitle",children:"A context graph gives your agent structured memory — a place to draft, share, and publish knowledge."})]}),g.jsxs("div",{className:"v10-modal-body",children:[ae&&g.jsx("div",{className:"v10-modal-error",children:ae}),Q&&g.jsx("div",{className:"v10-modal-warning",children:Q}),Qn&&g.jsxs("div",{className:"v10-modal-tip",children:[g.jsx("div",{className:"v10-modal-tip-title",children:"First context graph tip"}),"This is your agent's first memory space. Consider importing any existing knowledge your agent has — notes, documents, conversation logs — so it can build on what it already knows."]}),g.jsxs("div",{className:"v10-form-group",children:[g.jsx("label",{className:"v10-form-label",htmlFor:"dkg-cg-name",children:"Context Graph Name"}),g.jsx("input",{id:"dkg-cg-name",name:"dkg-cg-name",className:"v10-form-input",type:"text",placeholder:"e.g. Pharma Drug Interactions",value:a,onChange:H=>he(H.target.value),autoFocus:!0,maxLength:kl,"aria-invalid":Mt?"true":"false","aria-describedby":"dkg-cg-name-help",autoComplete:"off",spellCheck:!0}),g.jsx("div",{id:"dkg-cg-name-help",style:{marginTop:4,fontSize:11,color:Mt?"var(--red, #f87171)":"var(--text-tertiary)",fontFamily:"var(--font-mono)"},children:Mt||(Pt?`ID: did:dkg:context-graph:${Pt}`:`${a.length}/${kl} characters`)})]}),g.jsxs("div",{className:"v10-form-group",children:[g.jsx("label",{className:"v10-form-label",htmlFor:"dkg-cg-description",children:"Description"}),g.jsx("textarea",{id:"dkg-cg-description",name:"dkg-cg-description",className:"v10-form-textarea",placeholder:"What should your agent remember? Describe the domain, goals, or context...",value:o,onChange:H=>s(H.target.value),"aria-label":"Context graph description"})]}),g.jsx("div",{className:"v10-form-divider"}),g.jsxs("div",{className:"v10-form-group",children:[g.jsx("label",{className:"v10-form-label",children:"Sharing"}),g.jsxs("div",{className:"v10-form-radio-group",children:[g.jsxs("label",{className:"v10-form-radio",children:[g.jsx("input",{type:"radio",checked:c==="curated",onChange:()=>d("curated")}),"Invite-only — only invited agents can read and subscribe"]}),g.jsxs("label",{className:"v10-form-radio",children:[g.jsx("input",{type:"radio",checked:c==="public",onChange:()=>d("public")}),"Open — publicly discoverable; anyone can subscribe"]})]})]}),g.jsxs("div",{className:"v10-form-group",children:[g.jsx("label",{className:"v10-form-label",children:"Contribution"}),g.jsxs("div",{className:"v10-form-radio-group",children:[g.jsxs("label",{className:"v10-form-radio",children:[g.jsx("input",{type:"radio",checked:p==="curator-only",onChange:()=>f("curator-only")}),"Curators-only — only the curator may publish to Verifiable Memory"]}),g.jsxs("label",{className:"v10-form-radio",children:[g.jsx("input",{type:"radio",checked:p==="open",onChange:()=>f("open")}),"Open — any wallet may publish to Verifiable Memory (not just members)"]})]}),c==="curated"&&p==="open"&&g.jsxs("div",{style:{marginTop:6,fontSize:11,color:"var(--text-tertiary)"},children:["Note: an invite-only sharing graph with open contribution still lets ",g.jsx("em",{children:"any"})," wallet publish to Verifiable Memory — the on-chain publish check is not gated by the allowlist. See SPEC_CG_MEMORY_MODEL §2.5."]})]}),g.jsxs("div",{className:"v10-form-group",children:[g.jsx("label",{className:"v10-form-label",children:"On-chain registration"}),g.jsxs("label",{className:"v10-form-radio",style:{display:"flex",alignItems:"flex-start",gap:8},children:[g.jsx("input",{type:"checkbox",checked:y,onChange:H=>m(H.target.checked),style:{marginTop:3}}),g.jsxs("span",{children:["Register on chain now (required for Verifiable Memory publishing)",g.jsx("div",{style:{fontSize:11,color:"var(--text-tertiary)",marginTop:4},children:"Off by default — the project is created locally and can be registered later from its Settings tab when your wallet is funded and a working RPC is configured."})]})]})]}),g.jsxs("div",{className:"v10-form-group",children:[g.jsx("label",{className:"v10-form-label",children:"Ontology"}),g.jsxs("div",{className:"v10-form-radio-group",children:[g.jsxs("label",{className:"v10-form-radio",children:[g.jsx("input",{type:"radio",checked:b==="community",onChange:()=>x("community")}),"Choose a starter — install one of the bundled context-graph-type ontologies"]}),b==="community"&&g.jsxs("div",{style:{marginLeft:24,marginTop:4,marginBottom:8},children:[g.jsx("select",{className:"v10-form-select",value:C,onChange:H=>A(H.target.value),children:k.map(H=>g.jsx("option",{value:H.slug,children:H.displayName},H.slug))}),g.jsx("div",{style:{marginTop:6,fontSize:11,color:"var(--text-tertiary)"},children:(fe=k.find(H=>H.slug===C))==null?void 0:fe.description})]}),g.jsxs("label",{className:"v10-form-radio",children:[g.jsx("input",{type:"radio",checked:b==="agent",onChange:()=>x("agent")}),"Let agent decide — defaults to the closest starter (v1)"]}),b==="agent"&&g.jsxs("div",{className:"v10-form-radio-desc",style:{marginLeft:24,marginTop:4,marginBottom:8},children:["v1 installs the ",g.jsx("code",{children:C})," starter as a sensible default. A future release will have the agent draft a context-graph-specific ontology by extending the closest starter from the context graph description."]}),g.jsxs("label",{className:"v10-form-radio",style:{opacity:.5},children:[g.jsx("input",{type:"radio",checked:b==="upload",onChange:()=>x("upload"),disabled:!0}),"Upload an ontology file (.ttl, .owl, .rdf) ",g.jsx("span",{style:{fontSize:10,fontWeight:400,color:"var(--text-tertiary)"},children:"(coming soon)"})]})]})]}),g.jsxs("div",{className:"v10-form-advanced-toggle",onClick:()=>R(!E),children:[g.jsx("span",{className:`v10-form-adv-chevron ${E?"open":""}`,children:"▸"}),g.jsx("span",{children:"Advanced settings"})]}),E&&g.jsxs("div",{className:"v10-form-advanced-body",style:{opacity:.5,pointerEvents:"none"},children:[g.jsxs("div",{className:"v10-form-group",children:[g.jsxs("label",{className:"v10-form-label",children:["Consensus Quorum ",g.jsx("span",{style:{fontSize:10,fontWeight:400,color:"var(--text-tertiary)"},children:"(coming soon)"})]}),g.jsxs("select",{className:"v10-form-select",value:_,disabled:!0,children:[g.jsx("option",{value:"off",children:"Off — no consensus verification required"}),g.jsx("option",{value:"2of3",children:"2 of 3 — lightweight consensus"}),g.jsx("option",{value:"3of5",children:"3 of 5 — standard consensus (recommended for teams)"}),g.jsx("option",{value:"custom",children:"Custom — set your own M of N"})]})]}),g.jsxs("div",{className:"v10-form-group",children:[g.jsxs("label",{className:"v10-form-label",children:["SWM TTL ",g.jsx("span",{style:{fontSize:10,fontWeight:400,color:"var(--text-tertiary)"},children:"(coming soon)"})]}),g.jsxs("select",{className:"v10-form-select",value:I,disabled:!0,children:[g.jsx("option",{value:"7d",children:"7 days (default)"}),g.jsx("option",{value:"1h",children:"1 hour"}),g.jsx("option",{value:"1d",children:"1 day"}),g.jsx("option",{value:"30d",children:"30 days"})]})]}),g.jsxs("div",{className:"v10-form-group",style:{marginBottom:0},children:[g.jsxs("label",{className:"v10-form-label",children:["SWM Size Cap ",g.jsx("span",{style:{fontSize:10,fontWeight:400,color:"var(--text-tertiary)"},children:"(coming soon)"})]}),g.jsxs("select",{className:"v10-form-select",value:P,disabled:!0,children:[g.jsx("option",{value:"100k",children:"100K triples (default)"}),g.jsx("option",{value:"10k",children:"10K triples"}),g.jsx("option",{value:"1m",children:"1M triples"})]})]})]})]}),g.jsxs("div",{className:"v10-modal-footer",children:[g.jsx("button",{className:"v10-modal-btn",onClick:t,children:"Cancel"}),ge&&g.jsx("button",{className:"v10-modal-btn",onClick:wt,disabled:N,children:N?"Retrying…":"Retry Loading Agent"}),g.jsx("button",{className:"v10-modal-btn primary",onClick:Bt,disabled:!a.trim()||!!A1(a)||D||!ee||N,children:D?G||"Creating…":ee?"Create Context Graph":ge?"Agent unavailable":"Loading agent…"})]})]})})}function fm(e){return{agentDid:e.agentDid,peerId:e.peerId}}function su(e){if(!(e!=null&&e.trim()))return"unknown";const t=e.trim().replace(/^["']|["']$/g,"").toLowerCase();return t==="private"?"private":t==="public"?"public":"unknown"}function Wi(e){let t=e.trim().replace(/^["']|["']$/g,"");t.startsWith("<")&&t.endsWith(">")&&(t=t.slice(1,-1));const a="did:dkg:agent:";if(t.length>=a.length&&t.slice(0,a.length).toLowerCase()===a.toLowerCase()){const o=t.slice(a.length),s=/^(0x[a-fA-F0-9]{40})$/i.exec(o);return s?`${a}${s[1].toLowerCase()}`:`${a}${o}`}return/^0x[a-fA-F0-9]{40}$/.exec(t)?`${a}${t.toLowerCase()}`:t.toLowerCase()}function Eu(e,t){var a,r;return e.callerInvolved===!0?!0:e.callerInvolved===!1||!((a=t==null?void 0:t.agentDid)!=null&&a.trim())?!1:!!((r=e.curator)!=null&&r.trim()&&Wi(e.curator)===Wi(t.agentDid))}function Q4(e,t,a){const r=e.filter(o=>Eu(o,t));if(a&&!r.some(o=>o.id===a)){const o=e.find(s=>s.id===a);if(o)return[o,...r]}return r}function X4(e,t){return!(Eu(e,t)||su(e.accessPolicy)!=="public")}function Z4(e){return e.subscribed===!0||e.synced===!0?"project":"catalogue"}function J4(e){return e.alreadyMember===!0||e.autoApproved===!0||e.status==="approved"||e.status==="already-member"}const T1=/^(?:Qm[1-9A-HJ-NP-Za-km-z]{44}|12D3Koo[1-9A-HJ-NP-Za-km-z]{45,53})$/;function e3(e){var x;const t=e.trim().replace(/\\n/g,`
1056
+ `),a=t.split(`
1057
+ `).map(k=>k.trim()).filter(Boolean),r=a[0]??"",o=a.slice(1).join(" ").trim(),s=t.match(/(?:^|\s)(\/(?:ip4|ip6|dns|dns4|dns6|dnsaddr)\/\S+)/),c=((x=s==null?void 0:s[1])==null?void 0:x.replace(/\s+/g,""))??null,d=o.replace(/\s+/g,""),p=d.startsWith("/")?d:c;let f=null;if(p){const k=p.match(/\/p2p\/([^/]+)$/);k&&T1.test(k[1])&&(f=k[1])}else for(const k of[o,...a.slice(1)]){const C=k.trim();if(T1.test(C)){f=C;break}}let y=r;c&&y.includes(c)&&(y=y.replace(c,"")),y=y.replace(/\s*@\s*$/,"").trim();const b=(a.length>1||o.length>0)&&f===null&&p===null;return{cgId:y,curatorPeerId:f,legacyMultiaddr:p,hasUnparsedExtra:b}}function t3(e,t){return!e.hasUnparsedExtra&&t.some(a=>a.id===e.cgId&&su(a.accessPolicy)==="public")}function R1(e,t){const a=e3(e);return t3(a,t)?{kind:"publicSubscribe",invite:a,validationError:_1(a,{allowBareContextGraphId:!0}),idleLabel:"Subscribe",sendingLabel:"Subscribing…"}:{kind:"privateJoin",invite:a,validationError:_1(a),idleLabel:"Request to Join",sendingLabel:"Sending request…"}}async function N1(e){if(e.curatorPeerId){await eT(e.curatorPeerId).catch(()=>{});return}e.legacyMultiaddr&&(console.warn("[DKG] This invite uses a legacy multiaddr (deprecated). Ask the curator to regenerate using the current Share Context Graph modal — V10 invites carry a peer id and resolve via DHT, so they survive relay rotations."),await Jj(e.legacyMultiaddr).catch(()=>{}))}function _1(e,t={}){if(!e.cgId)return"Missing context graph ID";if(e.hasUnparsedExtra)return"Invite contains a second line that is not a valid peer ID (12D3Koo…) or multiaddr (/ip4/…). Check for typos.";if(!e.curatorPeerId&&!e.legacyMultiaddr&&!t.allowBareContextGraphId)return"This invite is missing the curator peer id. Ask the curator to regenerate the invite from the Share Context Graph dialog.";if(e.legacyMultiaddr){if(!e.legacyMultiaddr.startsWith("/"))return"Invalid curator multiaddr";if(!e.legacyMultiaddr.includes("/p2p/"))return"Curator multiaddr is missing peer ID"}return null}function n3(e){if(e instanceof Wt&&e.status===502){const t=a3(e.body);if(t.length===0)return"Request signed, but we couldn't deliver it to any reachable curator. Try again in a moment once your node has discovered more peers, or ask the curator for an updated invite.";const a=t.join("; "),r=t.some(i3),o=r?"Curator rejected this join request.":"Couldn't deliver this join request to the curator.",s=r3(a,r);return s?`${o} Reason: ${a}. ${s}`:`${o} Reason: ${a}.`}return e instanceof Error&&e.message?e.message:"Failed to send join request"}function a3(e){if(!e||typeof e!="object")return[];const t=e.errors;return Array.isArray(t)?t.filter(a=>typeof a=="string"&&a.length>0):[]}function i3(e){const t=e.replace(/^[^:]+:\s*/,"").trim();return!(!t||/^dial failed\b/i.test(t)||/^not curator$/i.test(t))}function r3(e,t){return t?/scope mismatch/i.test(e)?"This usually means your daemon's network config has a stale ContextGraphsHub address — pull the latest release (or `git pull && pnpm install && pnpm run build:runtime`) and try again.":/unknown CG/i.test(e)?"The curator doesn't recognise this context graph id — double-check the invite, or ask the curator to share an updated one.":null:/not curator/i.test(e)?"Your node reached other peers, but none of them curate this context graph. Make sure the curator's daemon is online and the invite carries the right curator peer id.":null}function l3({open:e,onClose:t,initialContextGraphId:a}){const[r,o]=S.useState(a??""),[s,c]=S.useState("idle"),[d,p]=S.useState(null),[f,y]=S.useState(null),[m,b]=S.useState(!1),[x,k]=S.useState(null),[C,A]=S.useState(""),{contextGraphs:E,setContextGraphs:R,setActiveProject:_}=ga(),{openTab:U}=xn();S.useEffect(()=>{a&&o(a)},[a]),S.useEffect(()=>{e||(o(a??""),p(null),c("idle"),y(null),b(!1))},[e,a]);const I=S.useCallback(ie=>{_(ie.id),U({id:`project:${ie.id}`,label:ie.name||ie.id,closable:!0})},[_,U]),O=S.useCallback(async(ie,X)=>{const{contextGraphs:M}=await Xh({fresh:!0}),L=M??[];R(L);const K=L.find(N=>N.id===ie)??X;return K&&I(K),K},[R,I]),P=S.useCallback(async ie=>{c("approved");try{const X=await O(ie);X&&(A(X.name??ie),k(ie))}catch{}},[O]),Y=S.useCallback(ie=>{var M;if(!(!f||ie.type!=="join_approved"&&ie.type!=="join_rejected"||((M=ie.data)==null?void 0:M.contextGraphId)!==f)){if(ie.type==="join_rejected"){c("rejected");return}P(f)}},[f,P]);_l(Y);const D=ou(e&&!x,t),T=ou(e&&!!x,()=>{k(null),A(""),t()});if(!e)return null;const G=async()=>{const ie=R1(r,E);if(ie.validationError){p(ie.validationError);return}const{cgId:X,curatorPeerId:M}=ie.invite;if(p(null),ie.kind==="publicSubscribe"){c("sending");try{const K=E.find(N=>N.id===X);await N1(ie.invite),await JT(X,{syncMode:m?"always-on":"on-demand"}),await O(X,K),t()}catch(K){p(K instanceof Error?K.message:"Could not subscribe to this public context graph."),c("idle")}return}const L=E.find(K=>K.id===X);if(L){I(L),t();return}c("sending");try{await N1(ie.invite);const K=await lT(X),N=await Su().then(ge=>ge.name).catch(()=>{}),ue=await oT(X,{delegation:K.delegation,agentName:N,curatorPeerId:M??void 0});if(y(X),J4(ue)){await P(X);return}c("pending")}catch(K){p(n3(K)),c("idle")}};function W(){k(null),A(""),t()}if(x)return g.jsx("div",{className:"v10-modal-overlay",onClick:T.onBackdropClick,role:"presentation",children:g.jsxs("div",{className:"v10-modal-box",ref:T.dialogRef,role:"dialog","aria-modal":"true","aria-labelledby":"dkg-join-wire-title",children:[g.jsx("button",{type:"button",className:"v10-modal-close",onClick:W,"aria-label":"Close wire workspace dialog",title:"Close (Esc)",style:{position:"absolute",top:12,right:12,background:"none",border:"none",color:"var(--text-tertiary)",cursor:"pointer",fontSize:18,lineHeight:1,padding:4,zIndex:1},children:"×"}),g.jsxs("div",{className:"v10-modal-header",children:[g.jsxs("div",{id:"dkg-join-wire-title",className:"v10-modal-title",children:["Wire workspace for ",C]}),g.jsx("div",{className:"v10-modal-subtitle",children:"Curator approved. Now wire a local workspace so this Cursor can collaborate on the context graph."})]}),g.jsx("div",{className:"v10-modal-body",children:g.jsx(Dw,{contextGraphId:x,projectName:C,variant:"join",onDone:W})})]})});const ae=s==="sending",q=s==="pending",Q=s==="approved",F=s==="rejected",ee=R1(r,E);return g.jsx("div",{className:"v10-modal-overlay",onClick:D.onBackdropClick,role:"presentation",children:g.jsxs("div",{className:"v10-modal-box",ref:D.dialogRef,role:"dialog","aria-modal":"true","aria-labelledby":"dkg-join-cg-title","aria-describedby":"dkg-join-cg-subtitle",children:[g.jsx("button",{type:"button",className:"v10-modal-close",onClick:t,"aria-label":"Close join context graph dialog",title:"Close (Esc)",style:{position:"absolute",top:12,right:12,background:"none",border:"none",color:"var(--text-tertiary)",cursor:"pointer",fontSize:18,lineHeight:1,padding:4,zIndex:1},children:"×"}),g.jsxs("div",{className:"v10-modal-header",children:[g.jsx("div",{id:"dkg-join-cg-title",className:"v10-modal-title",children:"Join a Context Graph"}),g.jsx("div",{id:"dkg-join-cg-subtitle",className:"v10-modal-subtitle",children:"Enter a discovered public Context Graph ID to subscribe, or paste a curator invite for a private graph."})]}),g.jsxs("div",{className:"v10-modal-body",children:[d&&g.jsx("div",{className:"v10-modal-error",children:d}),q&&g.jsx("div",{style:{padding:"10px 14px",borderRadius:8,marginBottom:16,fontSize:12,background:"rgba(59, 130, 246, 0.08)",border:"1px solid rgba(59, 130, 246, 0.25)",color:"var(--accent-primary, #3b82f6)"},children:"Join request sent. Waiting for the curator to approve — this modal will move forward automatically once they do."}),Q&&g.jsx("div",{style:{padding:"10px 14px",borderRadius:8,marginBottom:16,fontSize:12,background:"rgba(34, 197, 94, 0.08)",border:"1px solid rgba(34, 197, 94, 0.25)",color:"var(--accent-green)"},children:"Approved! Loading context graph…"}),F&&g.jsx("div",{style:{padding:"10px 14px",borderRadius:8,marginBottom:16,fontSize:12,background:"rgba(245, 158, 11, 0.08)",border:"1px solid rgba(245, 158, 11, 0.25)",color:"var(--accent-warning, #f59e0b)"},children:"The curator declined this join request."}),g.jsxs("div",{className:"v10-form-group",children:[g.jsx("label",{className:"v10-form-label",htmlFor:"dkg-cg-invite",children:"Context Graph ID or Invite Code"}),g.jsx("textarea",{id:"dkg-cg-invite",name:"dkg-cg-invite",className:"v10-form-textarea",placeholder:`Public: paste a Context Graph ID
1058
+
1059
+ Private: paste the curator invite
1060
+ my-context-graph-abc123
1061
+ 12D3KooW...`,value:r,onChange:ie=>o(ie.target.value),autoFocus:!0,rows:3,disabled:ae||q||Q,style:{fontFamily:"var(--font-mono)",fontSize:11},"aria-label":"Context graph invite code",autoComplete:"off",spellCheck:!1})]}),ee.kind==="publicSubscribe"&&g.jsxs("label",{style:{display:"flex",alignItems:"flex-start",gap:8,fontSize:12,color:"var(--text-secondary)",cursor:ae?"default":"pointer"},children:[g.jsx("input",{type:"checkbox",checked:m,onChange:ie=>b(ie.target.checked),disabled:ae,"aria-label":"Keep this Context Graph synchronized after restart"}),g.jsxs("span",{children:["Keep synchronized after restart",g.jsx("span",{style:{display:"block",color:"var(--text-tertiary)",marginTop:2},children:"Off by default. This node otherwise syncs the graph only when you open it."})]})]})]}),g.jsxs("div",{className:"v10-modal-footer",children:[g.jsx("button",{className:"v10-modal-btn",onClick:t,children:q||Q?"Close":"Cancel"}),g.jsx("button",{className:"v10-modal-btn primary",onClick:G,disabled:!r.trim()||ae||q||Q,children:ae?ee.sendingLabel:q?"Awaiting approval…":Q?"Approved":ee.idleLabel})]})]})})}const zw="v10:hiddenProjectIds",uh="v10:hidden-projects-change";function yp(){try{const e=localStorage.getItem(zw);if(!e)return new Set;const t=JSON.parse(e);return new Set(Array.isArray(t)?t:[])}catch{return new Set}}function O1(e){try{localStorage.setItem(zw,JSON.stringify([...e])),window.dispatchEvent(new Event(uh))}catch{}}function Iw(){const[e,t]=S.useState(()=>yp());S.useEffect(()=>{const o=()=>t(yp());return window.addEventListener(uh,o),window.addEventListener("storage",o),()=>{window.removeEventListener(uh,o),window.removeEventListener("storage",o)}},[]);const a=S.useCallback(o=>{const s=new Set(yp());s.add(o),O1(s)},[]),r=S.useCallback(()=>{O1(new Set)},[]);return{hidden:e,hide:a,unhideAll:r}}function M1({cg:e,isActive:t,onSelect:a,onHide:r}){return g.jsx("div",{className:"v10-tree-section",children:g.jsxs("div",{className:`v10-tree-section-header ${t?"active":""}`,onClick:a,children:[g.jsx("span",{className:"v10-tree-project-dot"}),g.jsx("span",{className:"v10-tree-section-label",children:e.name||e.id.slice(0,16)}),g.jsx("button",{type:"button",className:"v10-tree-hide-btn",title:"Hide this context graph from the sidebar (reversible)",onClick:o=>{o.stopPropagation(),r()},children:"×"})]})})}function o3({cg:e,isBrowsing:t,onBrowse:a,onSubscribe:r,onHide:o}){const s=e.name||e.id.slice(0,16);return g.jsx("div",{className:"v10-tree-section",children:g.jsxs("div",{className:`v10-tree-section-header catalogue ${t?"active":""}`,children:[g.jsx("span",{className:"v10-tree-project-dot"}),g.jsx("span",{className:"v10-tree-section-label",children:s}),g.jsx("button",{type:"button",className:"v10-tree-catalogue-btn","aria-label":`Browse ${s}`,onClick:a,children:"Browse"}),g.jsx("button",{type:"button",className:"v10-tree-catalogue-btn primary","aria-label":`Subscribe to ${s}`,onClick:r,children:"Subscribe"}),g.jsx("button",{type:"button",className:"v10-tree-hide-btn",title:"Hide this context graph from the sidebar (reversible)",onClick:o,children:"×"})]})})}function s3(e){switch(e){case"chat_ready":return"var(--accent-green, #22c55e)";case"connecting":return"var(--accent-yellow, #eab308)";case"degraded":case"bridge_offline":return"var(--accent-orange, #f97316)";case"available":case"coming_soon":default:return"var(--text-tertiary, #6b7280)"}}function c3(){const[e,t]=S.useState([]),[a,r]=S.useState(null),o=S.useCallback(()=>{Cu().then(s=>{t(s.integrations),r(null)}).catch(s=>r(s.message))},[]);return rs(o,3e4),g.jsxs("div",{className:"v10-tree-items",style:{display:"block"},children:[g.jsx("div",{style:{fontSize:11,fontWeight:600,color:"var(--text-tertiary)",textTransform:"uppercase",letterSpacing:.5,padding:"6px 12px 2px 24px"},children:"Agents"}),a&&g.jsx("div",{style:{fontSize:11,color:"var(--accent-orange, #f97316)",padding:"4px 12px 4px 24px"},children:a}),!a&&e.length===0&&g.jsx("div",{style:{fontSize:11,color:"var(--text-tertiary)",padding:"4px 12px 4px 24px",fontStyle:"italic"},children:"No agents detected."}),e.map(s=>g.jsxs("div",{className:"v10-tree-item",title:s.detail,style:{cursor:"default"},children:[g.jsx("span",{"aria-label":s.statusLabel,style:{width:7,height:7,borderRadius:"50%",background:s3(s.status),flexShrink:0}}),g.jsx("span",{className:"v10-tree-item-label",children:s.name}),g.jsx("span",{style:{fontSize:11,color:"var(--text-tertiary)",marginLeft:4},children:s.statusLabel})]},s.id))]})}function u3(){const e=Vn(X=>X.leftSectionMyProjectsOpen),t=Vn(X=>X.leftSectionIntegrationsOpen),a=Vn(X=>X.toggleLeftSectionMyProjects),r=Vn(X=>X.toggleLeftSectionIntegrations),o=S.useId(),s=S.useId(),{openTab:c,activeTabId:d,setActiveTab:p}=xn(),{contextGraphs:f,setContextGraphs:y,setLoading:m,activeProjectId:b,setActiveProject:x}=ga(),k=cm(X=>X.stage),[C,A]=S.useState("explorer"),{hidden:E,hide:R,unhideAll:_}=Iw(),U=im().data,I=U?fm(U):null,O=f.filter(X=>!E.has(X.id)),P=O.filter(X=>Eu(X,I)),Y=O.filter(X=>X4(X,I)),D=f.length-O.length,[T,G]=S.useState(!1),[W,ae]=S.useState(!1),[q,Q]=S.useState(),F=S.useCallback(X=>{Q(X),ae(!0)},[]),ee=S.useCallback(()=>{ae(!1),Q(void 0)},[]),ie=S.useCallback(()=>{m(!0),Wn.fetchContextGraphs().then(({contextGraphs:X})=>y(X??[])).catch(()=>{}).finally(()=>m(!1))},[y,m]);return rs(ie,6e4),_l(S.useCallback(X=>{(X.type==="join_approved"||X.type==="project_synced")&&ie()},[ie])),g.jsxs("div",{className:"v10-panel-left",children:[g.jsxs("div",{style:{display:"flex",gap:4,padding:"8px 8px 4px"},children:[g.jsx("button",{className:"v10-new-project-btn",onClick:()=>G(!0),children:"+ New Context Graph"}),g.jsx("button",{className:"v10-new-project-btn",onClick:()=>F(),children:"↗ Join Context Graph"})]}),g.jsxs("div",{className:"v10-tree-header",children:[g.jsx("button",{className:`v10-tree-mode-btn ${C==="explorer"?"active":""}`,onClick:()=>A("explorer"),children:"Context Graphs"}),g.jsx("button",{className:`v10-tree-mode-btn ${C==="oracle"?"active":""}`,onClick:()=>A("oracle"),children:"Context Oracle"})]}),C==="explorer"&&g.jsxs("div",{className:"v10-tree-content",children:[g.jsxs("div",{className:`v10-tree-dashboard ${d==="dashboard"?"active":""}`,onClick:()=>{p("dashboard"),x(null)},children:[g.jsx("span",{children:"▦"})," Dashboard"]}),f.length===0&&k<=1&&g.jsxs("div",{className:"v10-journey-empty-card",children:[g.jsx("div",{className:"v10-jec-title",children:"No context graphs yet"}),g.jsx("div",{className:"v10-jec-hint",children:k===0?"Connect an agent to get started.":"Create your first context graph to give your agent structured memory."}),k===1&&g.jsx("button",{className:"v10-new-project-btn",style:{margin:0},onClick:()=>G(!0),children:"+ Create First Context Graph"})]}),(f.length>0||k>=2)&&g.jsxs("div",{className:"v10-peer-group",children:[g.jsxs("button",{type:"button",className:"v10-peer-group-header","aria-expanded":e,"aria-controls":o,onClick:a,children:[g.jsx(sh,{size:14,className:`v10-peer-group-chevron ${e?"expanded":""}`,"aria-hidden":"true"}),g.jsx("span",{className:"v10-peer-group-label",children:"My Context Graphs"})]}),e&&g.jsx("div",{id:o,className:"v10-peer-group-body",children:P.length===0?g.jsx("div",{className:"v10-tree-item",style:{cursor:"default",color:"var(--text-tertiary)",fontStyle:"italic"},children:g.jsx("span",{className:"v10-tree-item-label",children:"No context graphs in this view yet."})}):P.map(X=>g.jsx(M1,{cg:X,isActive:b===X.id,onSelect:()=>{x(X.id),c({id:`project:${X.id}`,label:X.name||X.id.slice(0,16),closable:!0})},onHide:()=>{R(X.id),b===X.id&&x(null)}},X.id))})]}),D>0&&g.jsxs("button",{type:"button",className:"v10-tree-show-hidden",onClick:_,title:"Restore all context graphs dismissed from the sidebar",children:["↺ Show ",D," hidden context graph",D!==1?"s":""]}),k>=1&&g.jsxs("div",{className:"v10-peer-group",children:[g.jsxs("button",{type:"button",className:"v10-peer-group-header","aria-expanded":t,"aria-controls":s,onClick:r,children:[g.jsx(sh,{size:14,className:`v10-peer-group-chevron ${t?"expanded":""}`,"aria-hidden":"true"}),g.jsx("span",{className:"v10-peer-group-label",children:"Integrations"})]}),t&&g.jsx("div",{id:s,className:"v10-peer-group-body",children:g.jsx(c3,{})})]})]}),C==="oracle"&&g.jsxs("div",{className:"v10-tree-content",children:[Y.length>0&&g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"v10-tree-group-label",children:"Context Oracle"}),Y.map(X=>{const M=()=>{R(X.id),b===X.id&&x(null)};return Z4(X)==="catalogue"?g.jsx(o3,{cg:X,isBrowsing:d===`project:${X.id}`,onBrowse:()=>{x(null),c({id:`project:${X.id}`,label:X.name||X.id.slice(0,16),closable:!0})},onSubscribe:()=>F(X.id),onHide:M},X.id):g.jsx(M1,{cg:X,isActive:b===X.id,onSelect:()=>{x(X.id),c({id:`project:${X.id}`,label:X.name||X.id.slice(0,16),closable:!0})},onHide:M},X.id)})]}),Y.length===0&&g.jsxs("p",{style:{fontSize:12,color:"var(--text-tertiary)",padding:"20px 12px",textAlign:"center",lineHeight:1.5},children:["No discovered public Context Graphs yet. Public graphs appear here as soon as your node discovers them; use ",g.jsx("strong",{children:"Join Context Graph"})," to subscribe by ID."]}),D>0&&g.jsxs("button",{type:"button",className:"v10-tree-show-hidden",onClick:_,title:"Restore all context graphs dismissed from the sidebar",children:["↺ Show ",D," hidden context graph",D!==1?"s":""]})]}),g.jsx(K4,{open:T,onClose:()=>G(!1)}),g.jsx(l3,{open:W,onClose:ee,initialContextGraphId:q})]})}const d3=[/failed to fetch dynamically imported module/i,/error loading dynamically imported module/i,/importing a module script failed/i,/loading (?:css )?chunk [^ ]+ failed/i];function Pw(e,t=0){if(!(!(e instanceof Error)||t>4))return e.name==="ChunkLoadError"||e.code==="CSS_CHUNK_LOAD_FAILED"||d3.some(a=>a.test(e.message))?e:Pw(e.cause,t+1)}function f3(){return g.jsxs("div",{className:"lazy-spinner",role:"alert",children:[g.jsx("p",{children:"This view could not be opened. Reload the page to try again."}),g.jsx("button",{type:"button",onClick:()=>window.location.reload(),children:"Reload page"})]})}function fi(e,t){function a(s){return g.jsx(f3,{})}const r=bn.lazy(async()=>{try{return{default:await e()}}catch(s){const c=Pw(s);if(!c)throw s;return console.error("Failed to load a lazy view chunk.",c),{default:a}}});function o(s){const c=typeof t=="function"?t(s):t;return g.jsx(S.Suspense,{fallback:g.jsxs("div",{className:"lazy-spinner",children:["Loading ",c,"..."]}),children:g.jsx(r,{...s})})}return o}const Bw="__dkg_401_reloaded";function p3(){try{return window.sessionStorage.getItem(Bw)==="1"}catch{return!0}}function h3(){try{return window.sessionStorage.setItem(Bw,"1"),!0}catch{return!1}}function vp(e,t=[],a=0,r={}){const{scope:o,retention:s="keep",enabled:c=!0}=r,[d,p]=S.useState(null),[f,y]=S.useState(!0),[m,b]=S.useState(null),x=S.useRef(o),k=S.useRef(!0),C=S.useRef(0),A=S.useRef(null),E=S.useCallback(async(R=!0)=>{if(!c||!R&&A.current!==null)return;const _=++C.current;A.current=_;try{const U=await e();k.current&&_===C.current&&(p({scope:o,value:U}),b(null))}catch(U){if(k.current&&_===C.current){if((U==null?void 0:U.status)===401){const I=Er()!==void 0;if(I&&jj()&&!p3()&&h3()){window.location.reload();return}b({scope:o,message:I?"Authentication expired — please refresh the page.":"API token required — enter it at the top of the page."});return}b({scope:o,message:U.message})}}finally{A.current===_&&(A.current=null),k.current&&_===C.current&&y(!1)}},[c,o,...t]);return S.useEffect(()=>{C.current++,k.current=!0,x.current=o,y(c),c&&E();let R=null;const _=()=>{!c||a<=0||R||(R=setInterval(()=>{E(!1)},a))},U=()=>{R&&(clearInterval(R),R=null)},I=()=>{typeof document>"u"||(document.hidden?U():(E(!1),_()))};return(typeof document>"u"||!document.hidden)&&_(),c&&typeof document<"u"&&document.addEventListener("visibilitychange",I),()=>{C.current++,A.current=null,k.current=!1,U(),typeof document<"u"&&document.removeEventListener("visibilitychange",I)}},[E,a]),{data:s==="scope"&&(d==null?void 0:d.scope)!==o?null:(d==null?void 0:d.value)??null,loading:c&&(f||s==="scope"&&x.current!==o),error:s==="scope"&&(m==null?void 0:m.scope)!==o?null:(m==null?void 0:m.message)??null,refresh:E}}function gP(e){return e==null?"—":e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:e<1073741824?`${(e/1048576).toFixed(1)} MB`:`${(e/1073741824).toFixed(2)} GB`}function D1(e){if(e==null)return"—";if(e<1e3)return`${Math.round(e)}ms`;if(e<6e4)return`${(e/1e3).toFixed(1)}s`;if(e<36e5)return`${Math.floor(e/6e4)}m ${Math.floor(e%6e4/1e3)}s`;const t=Math.floor(e/36e5),a=Math.floor(e%36e5/6e4);return`${t}h ${a}m`}function m3(e,t=new Date){if(e==null||e==="")return"—";const a=e instanceof Date?e:new Date(e);if(Number.isNaN(a.getTime()))return"—";if(a.toDateString()===t.toDateString())return a.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"});const r=new Date(t);if(r.setDate(t.getDate()-1),a.toDateString()===r.toDateString())return`Yesterday ${a.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`;const o=t.getTime()-a.getTime();return o>=0&&o<10080*60*1e3?`${a.toLocaleDateString(void 0,{weekday:"short"})} ${a.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:a.toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function L1(e,t=8){return e?e.length<=t*2?e:e.slice(0,t)+"..."+e.slice(-4):"—"}function g3(){const e=ga(m=>m.contextGraphs),t=ga(m=>m.setContextGraphs),{hidden:a}=Iw(),[r,o]=S.useState(null),[s,c]=S.useState(!0),[d,p]=S.useState(()=>e.length===0),f=S.useCallback(()=>{Wn.fetchContextGraphs().then(({contextGraphs:m})=>t(m??[])).catch(()=>{}).finally(()=>p(!1))},[t]);return S.useEffect(()=>{f();const m=setInterval(f,6e4);return()=>clearInterval(m)},[f]),_l(S.useCallback(m=>{m.type!=="join_approved"&&m.type!=="join_rejected"&&m.type!=="project_synced"||f()},[f])),S.useEffect(()=>{let m=!0;return c(!0),Wn.fetchCurrentAgent().then(b=>{m&&o(fm(b))}).catch(()=>{}).finally(()=>{m&&c(!1)}),()=>{m=!1}},[e]),{myCgs:S.useMemo(()=>e.filter(m=>!a.has(m.id)).filter(m=>Eu(m,r)),[e,a,r]),identity:r,identityLoading:s,cgsLoading:d}}const y3="http://dkg.io/ontology/profile/QueryCatalog";function Uw(e,t=!1){const a=`did:dkg:context-graph:${e}`,r=`STRSTARTS(STR(?g), ${JSON.stringify(a+"/")})`,o=`STR(?g) != ${JSON.stringify(a+"/meta")} && !CONTAINS(STR(?g), "/meta/") && !STRENDS(STR(?g), "/_meta")`;return[{key:"wm",layer:"working",graphFilter:`${r} &&
1062
+ (CONTAINS(STR(?g), "/assertion/") || CONTAINS(STR(?g), "/_working_memory/")) &&
1063
+ ${o}`},{key:"swm",layer:"shared",graphFilter:`${r} &&
1064
+ (STRENDS(STR(?g), "/_shared_memory") || CONTAINS(STR(?g), "/_shared_memory/")) &&
1065
+ STR(?g) != ${JSON.stringify(a+"/meta/_shared_memory")} &&
1066
+ !CONTAINS(STR(?g), "/meta/") && !CONTAINS(STR(?g), "/_shared_memory/staging/")`,predicateFilter:"?p != <http://dkg.io/ontology/workspaceOwner>"},{key:"vm",layer:"verified",graphFilter:`(STR(?g) = ${JSON.stringify(a)} || ${r}) &&
1067
+ !CONTAINS(STR(?g), "/assertion/") && !CONTAINS(STR(?g), "/_working_memory") &&
1068
+ !CONTAINS(STR(?g), "/_shared_memory") && !CONTAINS(STR(?g), "_verifiable_memory_meta") &&
1069
+ ${o} &&
1070
+ !CONTAINS(STR(?g), "/_private") && !CONTAINS(STR(?g), "/_rules")`},...t?["wm","swm"].map(s=>({key:`catalog-${s}`,layer:s==="wm"?"working":"shared",catalog:!0,graphFilter:s==="wm"?`(STRSTARTS(STR(?g), ${JSON.stringify(a+"/meta/assertion/")}) ||
1071
+ STRSTARTS(STR(?g), ${JSON.stringify(a+"/meta/_working_memory/")}))`:`STRSTARTS(STR(?g), ${JSON.stringify(a+"/meta/_shared_memory/")}) ||
1072
+ STR(?g) = ${JSON.stringify(a+"/meta/_shared_memory")}`})):[]]}function v3(e,t,a=!1){return Uw(e,a).filter(r=>!t||r.key===t||r.key===`catalog-${t}`)}function bl(e,t){var s;const a=e.predicateFilter?`FILTER(${e.predicateFilter})`:"",r=`${t.pattern??"?s ?p ?o"} ${a}`,o=t.inventory?`FILTER EXISTS { ${r} }`:r;return`SELECT ${t.projection??"?s ?p ?o ?g"} WHERE {
1073
+ ${(s=t.graphs)!=null&&s.length?`VALUES ?g { ${t.graphs.map(Ma).join(" ")} }`:""}
1074
+ GRAPH ?g {
1075
+ ${e.catalog?`?catalog a <${y3}> .`:""}
1076
+ ${o}
1077
+ }
1078
+ FILTER(${e.graphFilter})
1079
+ ${t.filters??""}
1080
+ ${t.bindings??""}
1081
+ } ${t.order?`ORDER BY ${t.order}`:""} LIMIT ${t.limit}`}function Gc(e){const t=Gt(e);return!t||t.startsWith('"')||/\s/.test(t)?!1:t.startsWith("_:")?!0:/^[A-Za-z][A-Za-z0-9+.-]*:/.test(t)}function Gt(e){const t=e.trim();return t.startsWith('"')?t:t.startsWith("<")&&t.endsWith(">")?t.slice(1,-1):t}const bp=5e3;function b3(e,t){const a=`did:dkg:context-graph:${t}/`;if(!e.startsWith(a))return;const r=e.slice(a.length),o=r.indexOf("/"),s=o>=0?r.slice(0,o):r;if(!(!s||s.startsWith("_")||s==="assertion"||s==="meta"))return s}const Xo=[{key:"graph",variable:"?__g",expression:"STR(?g)"},{key:"subject",variable:"?__s",expression:'CONCAT("I:", STR(?s))'},{key:"predicate",variable:"?__p",expression:"STR(?p)"},{key:"objectKind",variable:"?__kind",expression:'IF(isIRI(?o), "I", "L")'},{key:"object",variable:"?__o",expression:"STR(?o)"},{key:"language",variable:"?__lang",expression:'IF(isLiteral(?o), LANG(?o), "")'},{key:"datatype",variable:"?__datatype",expression:'IF(isLiteral(?o), STR(DATATYPE(?o)), "")'}],Hw="Memory preview limit reached. Some relationships remain unloaded. Use a narrower query to inspect them.";function cu(e,t,a,r={},o=6e4){return sw({sparql:a,contextGraphId:t,...r,...e.layer==="shared"?{includeSharedMemory:!0}:{}},{maxAgeMs:lw,timeoutMs:o})}const z1=Xo.map(e=>e.variable).join(" "),x3=Xo.map(e=>`BIND(${e.expression} AS ${e.variable})`).join(`
1082
+ `);function w3(e){const t=new Map;for(const a of Xo){const r=em(e[a.variable.slice(1)]);if(r===void 0)throw new Error("Memory query omitted its continuation key");t.set(a.key,r)}return{kind:"row",key:t}}function dh(e,t){const a=e.key.get(t);if(a===void 0)throw new Error("Memory cursor omitted its continuation key");return a}const I1=e=>e.kind==="row"?dh(e,"graph"):e.graph,P1=new WeakMap;let S3=0;function pm(e){const t=em(e.g);if(!t)throw new Error("Memory query omitted its source graph");return Gt(t)}function fh(e,t,a=e){return e.flatMap(r=>{const o=pm(r),s=f=>{const y=Kj(f)??"";if(!y.startsWith("_:"))return y;let m=P1.get(a);m||(m={id:++S3,nodes:new Map},P1.set(a,m));let b=m.nodes.get(y);return b||(b=`_:response-${m.id}-node-${m.nodes.size+1}`,m.nodes.set(y,b)),b},c=s(r.s),d=em(r.p)??"",p=s(r.o);return c&&d&&p?[{subject:c,predicate:d,object:p,graph:o,subGraph:b3(o,t)}]:[]})}function k3(e){return(e==null?void 0:e.kind)!=="row"?"":`FILTER(${Xo.map((t,a)=>`(${[...Xo.slice(0,a).map(o=>`${o.variable} = ${JSON.stringify(dh(e,o.key))}`),`${t.variable} > ${JSON.stringify(dh(e,t.key))}`].join(" && ")})`).join(" || ")})`}async function $w(e,t,a={}){var r;try{const{layerLimit:o=bp,cursor:s,signal:c,...d}=a,p=Math.max(1,Math.min(bp,Math.trunc(o)||bp)),f=()=>c==null?void 0:c.throwIfAborted(),y=async I=>{var P;f();const O=await cu(e,t,I,d);return f(),((P=O.result)==null?void 0:P.bindings)??[]},m=async(I,O)=>{let P=O;for(;;)try{return{rows:await y(I(P)),limit:P}}catch(Y){if(!(Y instanceof ih)||P===1)throw Y;P=Math.max(1,Math.floor(P/2))}},b=[],x=new Set((s==null?void 0:s.capturedBlankGraphs)??[]),k=I=>I.filter(O=>!x.delete(O)),C=(I,O=I)=>{b.push(...fh(I,t,O))};let A,E;if((s==null?void 0:s.kind)==="blank-graphs")A=[...s.graphs],E=s.resume;else{const I=await y(bl(e,{projection:"DISTINCT ?g",inventory:!0,order:"STR(?g)",limit:6,filters:s?`FILTER(STR(?g) ${s.kind==="after-graph"?">":">="} ${JSON.stringify(I1(s))})`:""})),O=[...new Set(I.map(pm))],P=O.slice(0,5);if(!P.length)return{ok:!0,triples:b,omittedRelationships:!1};const{rows:Y,limit:D}=await m(ae=>bl(e,{projection:`?s ?p ?o ?g ${z1}`,graphs:P,filters:`FILTER(!isBlank(?s) && !isBlank(?o)) ${k3(s)}`,bindings:x3,order:z1,limit:ae}),p),T=Y.slice(0,D);C(T,Y);const G=T.length>=D,W=G?w3(T.at(-1)):void 0;A=G?P.slice(0,P.indexOf(I1(W))):P,E=W??(O.length>5?{kind:"after-graph",graph:P.at(-1)}:void 0)}A=k(A);let R=!1;for(;A.length&&b.length<p;){const I=p-b.length,O=T=>m(G=>bl(e,{graphs:T,filters:"FILTER(isBlank(?s) || isBlank(?o))",limit:G}),I+1);let P=await O(A);if(!P.rows.length){A=[];break}f();let Y=await ph(e,t,A,d,c);Y.graphs.length!==A.length&&(P=await O(Y.graphs));const D=()=>P.rows.length<=I&&(P.limit===I+1||P.rows.length<P.limit);if(!D()&&b.length)break;!D()&&A.length>1&&(Y=await ph(e,t,[A[0]],d,c),P=await O(Y.graphs)),f(),C(P.rows.slice(0,I),P.rows),R||(R=Y.partial||!D());for(const T of Y.graphs)x.add(T);A=k(A)}const _=A.length?{kind:"blank-graphs",graphs:A,resume:E}:E,U=_&&x.size?{..._,capturedBlankGraphs:[...x]}:_;return!b.length&&!A.length&&E?$w(e,t,{...a,cursor:U}):{ok:!0,triples:b,nextCursor:U,omittedRelationships:R}}catch(o){return{ok:!1,reason:(r=a.signal)!=null&&r.aborted?"cancelled":o instanceof ih?"response-limit":"unavailable"}}}const yr=1e3,C3=5;async function ph(e,t,a,r={includeContextGraphPartitions:!0},o){var c;let s=a;for(let d=0;d<C3;d++){o==null||o.throwIfAborted();const p=await cu(e,t,bl(e,{projection:"DISTINCT ?g",limit:1,pattern:`{
1083
+ { ?b ?p ?o } UNION { ?s ?p ?b }
1084
+ FILTER(isBlank(?b))
1085
+ }`,filters:`VALUES ?known { ${s.map(Ma).join(" ")} }
1086
+ GRAPH ?known {
1087
+ { ?b ?knownP ?knownO } UNION { ?knownS ?knownP ?b }
1088
+ FILTER(isBlank(?b))
1089
+ }
1090
+ FILTER(?g NOT IN (${s.map(Ma).join(", ")}))`}),r,1e4);o==null||o.throwIfAborted();const f=(((c=p.result)==null?void 0:c.bindings)??[]).map(pm),y=[...new Set([...s,...f])];if(y.length===s.length)return{graphs:s,partial:!1};s=y}return{graphs:s,partial:!0}}async function yP(e,t,a,r=!1){const o=Gt(t),s=v3(e,a,r),c=await Promise.all(s.map(async d=>{var R,_;const p=`{
1091
+ { ${Ma(o)} ?p ?o BIND(${Ma(o)} AS ?s) }
1092
+ UNION { ?s ?p ${Ma(o)} BIND(${Ma(o)} AS ?o) FILTER(?s != ${Ma(o)}) }
1093
+ }`,y=((R=(await cu(d,e,bl(d,{pattern:p,limit:yr+1}),{includeContextGraphPartitions:!0})).result)==null?void 0:R.bindings)??[],m=fh(y.slice(0,yr),e,y),b=U=>U.subject.startsWith("_:")||U.object.startsWith("_:"),x=[...new Set(m.filter(b).map(U=>U.graph))];if(!x.length)return{truncated:y.length>yr,triples:m,blankGraphs:[]};const k=await ph(d,e,x),C=k.graphs,E=((_=(await cu(d,e,bl(d,{graphs:C,filters:"FILTER(isBlank(?s) || isBlank(?o))",limit:yr+1,order:`IF(?s = ${Ma(o)} || ?o = ${Ma(o)}, 0, 1)`}),{includeContextGraphPartitions:!0})).result)==null?void 0:_.bindings)??[];return{truncated:k.partial||y.length>yr||E.length>yr,blankGraphs:C,triples:[...m.filter(U=>!b(U)),...fh(E.slice(0,yr),e,E)]}}));return{triples:c.flatMap((d,p)=>d.triples.map(f=>({...f,layer:s[p].layer}))),partial:c.some(d=>d.truncated),blankGraphs:c.flatMap(d=>d.blankGraphs)}}const E3="Could not load more graph data. Retry to continue from the last loaded page.",B1=e=>({definition:e,pages:[],read:{kind:"loading"}});function qw(e){var a;const t=!!((a=e.pages.at(-1))!=null&&a.nextCursor);if(e.read.kind!=="failed")return{canContinue:t,canRetry:!1};switch(e.read.reason){case"unavailable":return{canContinue:t,canRetry:!0};case"response-limit":case"cancelled":return{canContinue:!1,canRetry:!1}}}const U1=e=>qw(e).canContinue;function A3(e){return e.read.kind!=="failed"||e.read.mode!=="append"||e.read.reason==="cancelled"?null:e.read.reason==="response-limit"?Hw:E3}function j3(e,t){return{...e,pages:[...e.pages,t],read:{kind:"ready"}}}async function T3(e,t,a,r){const o=t==="refresh"?Math.max(1,e.pages.length):1;let s={...e,pages:t==="refresh"?[]:e.pages,read:{kind:"ready"}};for(let c=0;c<o&&!r.aborted;c++){const d=s.pages.at(-1);if(d&&!d.nextCursor)break;const p=await $w(e.definition,a,{includeContextGraphPartitions:!0,cursor:d==null?void 0:d.nextCursor,signal:r});if(!p.ok)return{...s,read:{kind:"failed",reason:p.reason,mode:t},pages:t==="refresh"&&e.pages.length?e.pages:s.pages};s=j3(s,p)}return s}function R3(e,t){const a=JSON.stringify([e,t]),r=S.useMemo(()=>Uw(e,t),[e,t]),[o,s]=S.useState({key:"",contextGraphId:"",sources:[],loading:!0}),c=S.useRef(o),d=S.useRef(null),p=S.useCallback(O=>{c.current=O,s(O)},[]);S.useEffect(()=>{const O=new bw({closingMessage:"Memory graph scope closed",runPass:async Y=>{const D=P.mode;P.mode="refresh";const T=c.current,G=r.map(ae=>T.contextGraphId===e?T.sources.find(q=>q.definition.key===ae.key)??B1(ae):B1(ae));if(D==="append"&&!G.some(U1))return;p({key:a,contextGraphId:e,sources:G,loading:!0});const W=await Promise.all(G.map(ae=>D==="append"&&!U1(ae)?ae:T3(ae,D,e,Y)));Y.aborted||p({key:a,contextGraphId:e,sources:W,loading:!1})},onError:()=>{O.closed||p({...c.current,loading:!1,sources:c.current.sources.map(Y=>({...Y,read:{kind:"failed",reason:"unavailable",mode:"refresh"}}))})}}),P={key:a,mode:"refresh",task:O};return d.current=P,e?P.task.request():p({key:a,contextGraphId:e,sources:[],loading:!1}),()=>{d.current=null,P.task.close()}},[e,r,a,p]);const f=S.useCallback(O=>{const P=d.current;!P||P.key!==a||!e||O==="append"&&P.task.running||(P.mode=O,P.task.request())},[a,e]);RR(e,()=>f("refresh"));const y=o.key===a,m=S.useMemo(()=>y?o.sources.flatMap(O=>O.pages.flatMap(P=>P.triples.map(Y=>({...Y,layer:O.definition.layer})))):[],[o.sources,y]),b=O=>{const P=y?o.sources.filter(Y=>Y.definition.layer===O):[];return P.length?P.some(Y=>Y.read.kind==="failed")?"error":o.loading?"loading":"ok":e?"loading":"ok"},x={wm:b("working"),swm:b("shared"),vm:b("verified")},k=y?o.sources:[],C=k.map(qw),A=C.some(O=>O.canContinue),E=C.some(O=>O.canRetry),R=k.some(O=>O.read.kind==="failed"&&O.read.reason==="response-limit"||O.pages.some(P=>P.omittedRelationships)),_=Object.values(x).filter(O=>O==="error").length,U=S.useCallback(()=>{va(e),f("refresh")},[e,f]),I=S.useCallback(()=>{f("append")},[f]);return{triples:m,layerStatus:x,hasMore:A,canRetry:E,loading:!y||o.loading,partial:A||R||_>0,error:_===3?"Failed to load memory data":null,pageError:k.map(A3).find(Boolean)??null,limitMessage:R?Hw:null,refresh:U,loadMore:I}}const Fw=["http://schema.org/name","http://www.w3.org/2000/01/rdf-schema#label","http://purl.org/dc/terms/title","http://purl.org/dc/elements/1.1/title","http://xmlns.com/foaf/0.1/name"];function N3(e={}){const t={predicates:[...e.extraPredicates??[],...Fw]};return e.minZoomForLabels!==void 0&&(t.minZoomForLabels=e.minZoomForLabels),t}const H1="http://www.w3.org/1999/02/22-rdf-syntax-ns#type";function xl(e){if(!e)return"—";if(e.startsWith('"'))return Jh(e);const t=e.lastIndexOf("#"),a=e.lastIndexOf("/"),r=Math.max(t,a);return r>=0?e.slice(r+1):e}function _3(e){const t=e.lastIndexOf("#"),a=e.lastIndexOf("/"),r=e.lastIndexOf(":"),o=Math.max(t,a,r),s=o>=0?e.slice(o+1):e;try{return decodeURIComponent(s)}catch{return s}}function O3(e){const t=_3(e).trim();return t?(/^[0-9a-f-]{16,}$/i.test(t)?t.replace(/-/g,"").slice(0,12):t).replace(/[_-]+/g," ").trim():""}function M3(e,t){return e===t&&/^urn:dkg:extraction:[^\s]+$/i.test(t)}function D3(e,t){return e===t&&Gc(t)}function L3(e){const t=O3(e.uri),a=e.types.map(xl).find(r=>r&&r!=="Thing"&&r!=="Entity");return/^urn:dkg:extraction:[^\s]+$/i.test(e.uri)?t?`Extraction ${t}`:"Extraction":a?t&&t!==a?`${a} ${t}`:a:t||xl(e.uri)}function z3(e){for(const a of Fw){const r=e.properties.get(a),o=r==null?void 0:r.find(s=>s.trim().length>0);if(o)return o}const t=xl(e.uri);return e.label&&(e.label!==t||!D3(e.label,e.uri))&&!M3(e.label,e.uri)?e.label:L3(e)}function I3(e){var p;const t=new Map,a=new Map,r=new Map,o=new Map,s=new Map;function c(f,y,m){let b=o.get(f);b||(b=new Map,o.set(f,b));let x=b.get(y);if(x||(x=new Set,b.set(y,x)),x.has(m))return!1;x.add(m);let k=s.get(f);return k||(k={working:0,shared:0,verified:0},s.set(f,k)),k[y]++,!0}function d(f){const y=Gt(f);let m=t.get(y);return m||(m={uri:y,label:xl(y),types:[],trustLevel:"working",layers:new Set,subGraphs:new Set,properties:new Map,connections:[],tripleCount:0},t.set(y,m)),m}for(const f of e){const y=d(f.subject);if(y.layers.add(f.layer),f.subGraph&&y.subGraphs.add(f.subGraph),f.predicate===H1){const m=Gt(f.object);y.types.includes(m)||y.types.push(m)}else if(Gc(f.object)){const m=Gt(f.object),b=d(m);b.layers.add(f.layer),f.subGraph&&b.subGraphs.add(f.subGraph);const x=a.get(y.uri)??new Set,k=`${f.predicate}\0${m}`;x.has(k)||(x.add(k),a.set(y.uri,x),y.connections.push({predicate:f.predicate,targetUri:m,targetLabel:xl(m)}))}else{const m=r.get(y.uri)??new Set,b=`${f.predicate}\0${f.object}`;if(!m.has(b)){m.add(b),r.set(y.uri,m);const x=y.properties.get(f.predicate)??[];x.push(Jh(f.object)),y.properties.set(f.predicate,x)}}}for(const f of t.values())f.label=z3(f),f.layers.has("verified")?f.trustLevel="verified":f.layers.has("shared")?f.trustLevel="shared":f.trustLevel="working";for(const f of e){const y=Gt(f.subject),m=t.get(y);if(m&&m.trustLevel!==f.layer)continue;const b=Gc(f.object)?Gt(f.object):f.object,x=Gc(f.object);if(x){const C=t.get(b);if(C&&C.trustLevel!==f.layer)continue}const k=`${y}\0${f.predicate}\0${b}`;if(m&&c(m.uri,f.layer,k),f.predicate===H1){if(b!==y){const C=t.get(b);C&&c(C.uri,f.layer,k)}}else if(x&&b!==y){const C=t.get(b);C&&c(C.uri,f.layer,k)}}for(const f of t.values()){const y=s.get(f.uri);f.tripleCount=y?y[f.trustLevel]:0}for(const f of t.values())for(const y of f.connections)y.targetLabel=((p=t.get(y.targetUri))==null?void 0:p.label)??xl(y.targetUri);return t}const P3=I3;function B3(e){return e.types.length>0||e.properties.size>0||e.connections.length>0}function U3(e,t){const{triples:a,error:r,...o}=R3(e,(t==null?void 0:t.includeQueryCatalog)??!1),s=S.useMemo(()=>P3(a),[a]),c=S.useMemo(()=>[...s.values()].filter(B3).sort((y,m)=>{const b={verified:0,shared:1,working:2},x=b[y.trustLevel]-b[m.trustLevel];if(x!==0)return x;const k=y.tripleCount??0,C=m.tripleCount??0;return C!==k?C-k:y.label.localeCompare(m.label)}),[s]),d=S.useMemo(()=>{const y=new Set;return a.filter(m=>{const b=`${m.subject}|${m.predicate}|${m.object}`;return y.has(b)?!1:(y.add(b),!0)}).map(({subject:m,predicate:b,object:x,subGraph:k})=>({subject:m,predicate:b,object:x,subGraph:k}))},[a]),p=S.useMemo(()=>{const y=new Map;for(const[m,b]of s)y.set(m,b.trustLevel);return y},[s]),f=S.useMemo(()=>{let y=0,m=0,b=0;for(const x of c)x.trustLevel==="verified"?b++:x.trustLevel==="shared"?m++:y++;return{wm:y,swm:m,vm:b,total:c.length}},[c]);return{entities:s,entityList:c,allTriples:a,graphTriples:d,trustMap:p,counts:f,...o,error:t!=null&&t.signalErrors?r:null}}const ls="http://dkg.io/viz/",Gw=`${ls}OnChainAnchor`,Vw=`${ls}AgentIdentity`,Ww=`${ls}anchoredIn`,Yw=`${ls}signedBy`,Kw=`${ls}consensus`,$1="http://www.w3.org/1999/02/22-rdf-syntax-ns#type",q1="http://schema.org/name",F1="http://schema.org/description";function _o(e){if(e!=null)return typeof e=="string"?e.startsWith('"')?e.replace(/^"/,"").replace(/"(\^\^<[^>]*>)?$/,""):e:typeof e=="object"&&e!==null&&"value"in e?String(e.value):String(e)}function H3(e){const t=e.opId.slice(0,10);try{const r=new Date(e.publishedAt).toISOString().slice(11,16);return`anchor ${t} · ${r}UTC`}catch{return`anchor ${t}`}}function $3(e){if(e.startsWith("did:dkg:agent:")){const t=e.slice(14);return t.startsWith("0x")?t.slice(0,6)+"…"+t.slice(-4):t.slice(0,6)+"…"+t.slice(-6)}return e.length>18?e.slice(0,8)+"…"+e.slice(-6):e}function q3(e){return`PREFIX dkg: <http://dkg.io/ontology/>
1094
+ PREFIX prov: <http://www.w3.org/ns/prov#>
1095
+ SELECT ?op ?root ?agent ?publishedAt ?g WHERE {
1096
+ GRAPH ?g {
1097
+ ?op a dkg:WorkspaceOperation ;
1098
+ dkg:rootEntity ?root ;
1099
+ dkg:publishedAt ?publishedAt ;
1100
+ prov:wasAttributedTo ?agent .
1101
+ }
1102
+ FILTER(
1103
+ STRSTARTS(STR(?g), "${`did:dkg:context-graph:${e}/`}") &&
1104
+ CONTAINS(STR(?g), "_shared_memory_meta")
1105
+ )
1106
+ } ORDER BY ?publishedAt LIMIT 2000`}function F3(e,t){const a=`did:dkg:context-graph:${t}/`;if(!e.startsWith(a))return;const r=e.slice(a.length),o=r.indexOf("/");if(o<0)return;const s=r.slice(0,o);if(!(!s||s.startsWith("_")))return s}function G3(e){const t=e.lastIndexOf(":");return t>=0?e.slice(t+1):e}function V3(e,t){const a=[],r=new Set;for(const o of e){const s=t?o.roots.filter(d=>t.has(d)):o.roots;if(s.length===0)continue;const c=`urn:dkg:viz:anchor:${o.opId}`;a.push({subject:c,predicate:$1,object:Gw,subGraph:o.subGraph}),a.push({subject:c,predicate:q1,object:`"${H3(o)}"`,subGraph:o.subGraph}),a.push({subject:c,predicate:F1,object:`"Published ${o.roots.length} KA${o.roots.length===1?"":"s"} · ${new Date(o.publishedAt).toISOString()}"`,subGraph:o.subGraph});for(const d of s)a.push({subject:d,predicate:Ww,object:c,subGraph:o.subGraph}),a.push({subject:d,predicate:Kw,object:`"${o.agents.length}-of-${o.agents.length}"`,subGraph:o.subGraph});for(const d of o.agents){const p=d.startsWith("did:")||d.startsWith("12D3")?d:`did:dkg:agent:${d}`,f=`urn:dkg:viz:agent:${encodeURIComponent(p)}`;a.push({subject:c,predicate:Yw,object:f,subGraph:o.subGraph}),r.has(f)||(r.add(f),a.push({subject:f,predicate:$1,object:Vw,subGraph:o.subGraph}),a.push({subject:f,predicate:q1,object:`"${$3(p)}"`,subGraph:o.subGraph}),a.push({subject:f,predicate:F1,object:`"${p}"`,subGraph:o.subGraph}))}}return a}function vP(e,t){const[a,r]=S.useState([]),[o,s]=S.useState(!1),[c,d]=S.useState(null),p=S.useRef(0);S.useEffect(()=>{if(!e){r([]),s(!1);return}const b=++p.current;s(!0),d(null),(async()=>{var x;try{const k=await fetch("/api/query",{method:"POST",headers:{"Content-Type":"application/json",...Rt()},body:JSON.stringify({sparql:q3(e)})});if(!k.ok)throw new Error(`SPARQL query failed: ${k.status}`);const C=await k.json(),A=((x=C==null?void 0:C.result)==null?void 0:x.bindings)??[],E=new Map;for(const R of A){const _=_o(R.op),U=_o(R.root),I=_o(R.agent),O=_o(R.publishedAt),P=_o(R.g);if(!_||!U||!I||!O)continue;let Y=E.get(_);Y||(Y={opId:G3(_),opUri:_,agents:[],roots:[],publishedAt:O,subGraph:P?F3(P,e):void 0},E.set(_,Y)),Y.roots.includes(U)||Y.roots.push(U),Y.agents.includes(I)||Y.agents.push(I)}if(b!==p.current)return;r([...E.values()].sort((R,_)=>_.publishedAt.localeCompare(R.publishedAt)))}catch(k){if(b!==p.current)return;d((k==null?void 0:k.message)??"Failed to load anchors"),r([])}finally{b===p.current&&s(!1)}})()},[e]);const f=S.useMemo(()=>{if(!t)return null;const b=[];if(t instanceof Set)for(const x of t)b.push(x);else for(const x of t)b.push(x);return b.sort(),b.join("|")},[t]),y=S.useMemo(()=>f==null?null:new Set(f.length===0?[]:f.split("|")),[f]),m=S.useMemo(()=>V3(a,y),[a,y]);return{anchors:a,decorationTriples:m,loading:o,error:c}}const Qw={wm:{icon:"◇",color:"#64748b",title:"Working Memory",desc:"Private agent scratchpad — ephemeral, fast local storage",trustLabel:"Working",trustLevel:"working"},swm:{icon:"◈",color:"#f59e0b",title:"Shared Working Memory",desc:"Team workspace — shared proposals, TTL-bounded",trustLabel:"Shared",trustLevel:"shared"},vm:{icon:"◉",color:"#22c55e",title:"Verifiable Memory",desc:"Endorsed, published, on-chain knowledge",trustLabel:"Verifiable",trustLevel:"verified"}};function bP(e,t=2){const a=e==="working"?"wm":e==="shared"?"swm":e==="verified"?"vm":e,r=t!==1;return a==="vm"?r?"Knowledge Assets":"Knowledge Asset":r?"Entities":"Entity"}const xP={label:"Stored triples (data + provenance)",tooltip:"Publication adds provenance to the data. Raw triple counts can change between memory layers without losing entities."};function wP(e){return e.activeSubGraph?!1:e.activeLayer==="swm"}const SP={verified:"#22c55e",shared:"#f59e0b",working:"#64748b"},pl={Person:{icon:"👤",group:"People"},SoftwareApplication:{icon:"💻",group:"Software"},SoftwareSourceCode:{icon:"📦",group:"Code"},Organization:{icon:"🏢",group:"Organizations"},Event:{icon:"📅",group:"Events"},ChooseAction:{icon:"⚡",group:"Decisions"},DefinedTerm:{icon:"📘",group:"Concepts"},CreativeWork:{icon:"📄",group:"Documents"},Product:{icon:"🪙",group:"Products"},ConversationTurn:{icon:"💬",group:"Conversations"},Thing:{icon:"◆",group:"Other"},Package:{icon:"📦",group:"Packages"},File:{icon:"📄",group:"Files"},Class:{icon:"🔷",group:"Classes"},Interface:{icon:"🔶",group:"Interfaces"},Function:{icon:"ƒ",group:"Functions"},TypeAlias:{icon:"🏷️",group:"Types"},Enum:{icon:"🔢",group:"Enums"},ExternalModule:{icon:"🌐",group:"External Modules"}},W3="http://www.w3.org/ns/prov#wasAttributedTo",Ol="http://dkg.io/ontology/agent/",Y3=Ol+"createdBy",K3=Ol+"promotedBy",Q3=Ol+"publishedBy",X3=Ol+"createdAt",Z3=Ol+"promotedAt",J3=Ol+"publishedAt";function e_(e){for(const t of e.connections)if(t.predicate===W3)return t.targetUri;return null}function kP(e,t){const a=t==="created"?Y3:t==="promoted"?K3:Q3;for(const r of e.connections)if(r.predicate===a)return r.targetUri;return e_(e)}function CP(e,t){const a=t==="created"?X3:t==="promoted"?Z3:J3,r=e.properties.get(a);return(r==null?void 0:r[0])??null}function G1(e){const t=e.lastIndexOf("#"),a=e.lastIndexOf("/"),r=Math.max(t,a);return r>=0?e.slice(r+1):e}function EP(e){const t=e.lastIndexOf("#"),a=e.lastIndexOf("/"),r=Math.max(t,a);return(r>=0?e.slice(r+1):e).replace(/([a-z])([A-Z])/g,"$1 $2").replace(/_/g," ")}function AP(e,t){var o,s;if(t)for(const c of e.types){const d=t.forType(c),p=G1(c),f=d.label??p;if(d.icon||d.color||d.label)return{icon:d.icon??((o=pl[p])==null?void 0:o.icon)??pl.Thing.icon,group:d.label??((s=pl[p])==null?void 0:s.group)??pl.Thing.group,color:d.color,type:f}}const a=e.types[0]?G1(e.types[0]):"Entity";return{...pl[a]??pl.Thing,type:a}}const _n="http://dkg.io/ontology/code/",t_={[_n+"Package"]:"#a855f7",[_n+"File"]:"#3b82f6",[_n+"Class"]:"#22c55e",[_n+"Interface"]:"#06b6d4",[_n+"Function"]:"#f59e0b",[_n+"TypeAlias"]:"#ec4899",[_n+"Enum"]:"#ef4444",[_n+"ExternalModule"]:"#64748b",[Gw]:"#f5a524",[Vw]:"#c084fc"},n_={[_n+"imports"]:"#60a5fa",[_n+"contains"]:"#a855f7",[_n+"definedIn"]:"#3b82f6",[_n+"exports"]:"#f59e0b",[_n+"extends"]:"#22c55e",[_n+"implements"]:"#06b6d4",[Ww]:"#f5a524",[Yw]:"#c084fc",[Kw]:"#22c55e"};function a_(e){return{"https://schema.org/":e,"http://www.w3.org/ns/prov#":e,"http://xmlns.com/foaf/0.1/":e,"http://purl.org/dc/terms/":e}}function jP(e,t){const{color:a}=Qw[e],r=e==="vm";return{labelMode:"humanized",renderer:"2d",labels:N3({minZoomForLabels:r?.2:.3}),style:{classColors:t_,predicateColors:n_,namespaceColors:a_(a),...t&&Object.keys(t).length>0?{nodeColors:t}:{},defaultNodeColor:a,defaultEdgeColor:r?"#4ade80":"#64748b",edgeWidth:r?1.8:1.2,fontSize:r?12:11,gradient:!0,gradientIntensity:r?.65:.4},hexagon:{baseSize:r?13:11,minSize:r?8:7,maxSize:r?42:28,scaleWithDegree:!0},focus:{maxNodes:3e3,hops:999}}}function TP(e){const t=["http://schema.org/description","http://schema.org/text"];for(const a of t){const r=e.properties.get(a);if(r!=null&&r[0])return r[0]}return null}function RP(e,t,a=2){const r=d=>Gt(d.subject),o=d=>Gt(d.object),s=new Set([e]);let c=new Set([e]);for(let d=0;d<a;d++){const p=new Set;for(const f of t){const y=r(f),m=o(f);c.has(y)&&!s.has(m)&&p.add(m),c.has(m)&&!s.has(y)&&p.add(y)}for(const f of p)s.add(f);if(c=p,c.size===0)break}return t.filter(d=>s.has(r(d))&&s.has(o(d)))}function NP(e,t){const a=t.lastIndexOf("/"),r=t.lastIndexOf("#"),o=t.lastIndexOf(":"),s=Math.max(a,r,o),c=s>=0?t.slice(s+1):t,d=(()=>{try{return decodeURIComponent(c)}catch{return c}})();if(/^urn:dkg:extraction:[^\s]+$/i.test(t)){const p=d.replace(/-/g,"").replace(/_+/g," ").slice(0,12).trim();return p?`Extraction ${p}`:"Extraction"}return d||t}function hm(e){const t=e.trim();return!t||t.startsWith('"')?!1:t.startsWith("_:")||t.startsWith("<")&&t.endsWith(">")?!0:/\s/.test(t)?!1:/^[A-Za-z][A-Za-z0-9+.-]*:/.test(t)}function _P(e,t){return!t.isRoot&&e.subGraph===t.slug?!0:e.subGraph?!1:t.scopedUris.has(e.subject)?!0:t.requireResourceObject?hm(e.object)&&t.scopedUris.has(e.object):t.scopedUris.has(e.object)}function Xw(e,t){const a=t.get(Gt(e.subject));return a!==void 0&&a.trustLevel!==e.layer}function Zw(e,t){if(!hm(e.object))return!1;const a=t.get(Gt(e.object));return a!==void 0&&a.trustLevel!==e.layer}function Jw(e,t){return Xw(e,t)||Zw(e,t)}function eS(e,t){return Xw(e,t)&&Zw(e,t)}function i_(e,t){const a=new Set,r=[];for(const o of e){if(eS(o,t))continue;const s=`${Gt(o.subject)}|${o.predicate}|${Gt(o.object)}`;a.has(s)||(a.add(s),r.push(o))}return r}function OP(e){return S.useMemo(()=>{const t=i_(e.allTriples,e.entities);return{triples:t,total:t.length}},[e.allTriples,e.entities])}function r_(e){return S.useMemo(()=>{const t=new Set,a=new Set,r=new Set,o=new Set;let s=0,c=0,d=0,p=0;for(const f of e.allTriples){const y=`${Gt(f.subject)}|${f.predicate}|${Gt(f.object)}`;!eS(f,e.entities)&&!o.has(y)&&(o.add(y),p++),Jw(f,e.entities)||(f.layer==="working"&&!t.has(y)?(t.add(y),s++):f.layer==="shared"&&!a.has(y)?(a.add(y),c++):f.layer==="verified"&&!r.has(y)&&(r.add(y),d++))}return{wm:s,swm:c,vm:d,canonical:p}},[e.allTriples,e.entities])}function MP(e,t){const a=Qw[t].trustLevel;return S.useMemo(()=>{const r=new Set,o=[];for(const s of e.allTriples){if(s.layer!==a||Jw(s,e.entities))continue;const c=`${Gt(s.subject)}|${s.predicate}|${Gt(s.object)}`;r.has(c)||(r.add(c),o.push(s))}return o},[e.allTriples,e.entities,a])}const l_="http://www.w3.org/1999/02/22-rdf-syntax-ns#type";function o_(e){const t=e.trim();return(t.startsWith("<")&&t.endsWith(">")?t.slice(1,-1):t)===l_}function DP(e,t,a){const r=[],o=a==null?void 0:a.focalSubjects;for(const s of e){const c=Gt(s.subject);!t.has(c)&&!(o!=null&&o.has(c))||hm(s.object)&&!o_(s.predicate)&&!t.has(Gt(s.object))||r.push(s)}return r}const LP="http://dkg.io/ontology/sourceContentType",zP="http://dkg.io/ontology/markdownForm",IP="http://dkg.io/ontology/sourceFile",PP="http://dkg.io/ontology/size";function BP(e){const t=e.replace(/^"|"$/g,"").replace(/^"(.+)"(?:@\w+|\^\^.+)?$/,"$1"),a=new Date(t);return Number.isFinite(a.getTime())?a.toLocaleString(void 0,{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"}):t}function UP(e){const[t,a]=e.split("-"),r=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],o=Math.max(0,Math.min(11,parseInt(a,10)-1));return`${r[o]} ${t}`}function HP(e,t){const a=e.properties.get(t),r=a==null?void 0:a[0];if(!r)return null;const o=r.replace(/^"|"$/g,"").replace(/^"(.+)"(?:@\w+|\^\^.+)?$/,"$1"),s=Date.parse(o);return Number.isNaN(s)?null:s}function $P(e){const t=Date.now()-e;if(t<0)return"just now";const a=Math.floor(t/1e3);if(a<45)return"just now";const r=Math.floor(a/60);if(r<60)return`${r}m ago`;const o=Math.floor(r/60);if(o<24)return`${o}h ago`;const s=Math.floor(o/24);return s<30?`${s}d ago`:new Date(e).toISOString().slice(0,10)}function s_(e,t=6){if(e==null||e==="")return"—";const a=typeof e=="number"?e:parseFloat(String(e));if(!Number.isFinite(a))return"—";if(a===0)return"0";const o=a.toFixed(t).replace(/\.?0+$/,"");return a>0&&Number(o)===0?`< ${1/Math.pow(10,t)}`:o}function c_(e){if(!(e==null||e===""))return`Exact balance: ${e} (full precision from chain)`}function u_(e){if(e==null)return"—";const t=e/100;return`${t%1===0?t.toFixed(0):t.toFixed(1)}%`}function d_(){Rw();const e=Gh(s=>{var c;return(c=s.nodeStatus)==null?void 0:c.nodeRole}),t=xn(s=>s.openTab),{covered:a,bestCoveringDiscountBps:r,walletsInconclusive:o}=Tw();return g.jsxs("div",{className:"v10-ws-pca",children:[g.jsx("span",{className:"v10-ws-pca-label",children:"Publishing discount"}),g.jsx("span",{className:"v10-ws-pca-value","data-covered":a,children:o?"Couldn’t verify your wallets — retry":a?`${u_(r)} discount`:"None — publishing at the direct cost"}),g.jsxs("button",{type:"button",className:"v10-ws-pca-cta",onClick:()=>t({id:"conviction",label:"Publisher Conviction",closable:!0}),children:[e==="edge"?"Get added to a PCA":"Set up PCA"," ->"]})]})}function f_(e){const t=e.sizePartial&&!e.sizeApprox,a=e.sizeApprox&&!e.triplesUnknown?"~":"",r=t?"+":"",o=e.triplesUnknown?"Knowledge Assets (summary)":e.sizeApprox?"entities / KA · approx.":t?"entities loaded":"entities / Knowledge Assets",s=e.triplesUnknown?"Live entity count unavailable — showing the published Knowledge-Asset summary (not the full WM/SWM/VM entity total)":e.sizeApprox?"Some context graphs reported only their Knowledge-Asset summary — this total mixes summary and live counts and is approximate":void 0;return{entityValue:`${a}${e.entities.total.toLocaleString()}${r}`,entityLabel:o,entityTitle:s,tripleValue:e.triplesUnknown?"—":`${e.sizePartial||e.sizeApprox?"~":""}${e.triples.total.toLocaleString()}`,tripleLabel:t?"triples preview":"triples",showLayerBars:!e.triplesUnknown&&!e.sizeApprox}}const p_="Context graphs you created or joined — scoped knowledge domains with configurable access (private, curated and peer-shared, or public) where agents build and collaborate on shared context with verifiable provenance.",hh=[{key:"wm",label:"Working Memory",short:"WM",color:"var(--layer-working)",desc:"Private agent drafts — free, self-attested, persists locally."},{key:"swm",label:"Shared Working Memory",short:"SWM",color:"var(--layer-shared)",desc:"Team proposals — free, gossip-replicated across context-graph peers."},{key:"vm",label:"Verifiable Memory",short:"VM",color:"var(--layer-verified)",desc:"On-chain knowledge — permanent, verifiable, requires TRAC to publish."}],Oc={1:"Ethereum",8453:"Base",84532:"Base Sepolia",100:"Gnosis",10200:"Chiado",2043:"NeuroWeb",20430:"NeuroWeb Testnet"};function xp(e){var o;const t=_w(e);if(e==null)return{name:"Unknown chain",gas:t};const a=String(e);if(Oc[a])return{name:Oc[a],gas:t};const r=(o=a.match(/(\d+)\s*$/))==null?void 0:o[1];return r&&Oc[r]?{name:Oc[r],gas:t}:{name:r?`Chain ${r}`:`Chain ${a}`,gas:t}}function wp(e){return e<1e3?String(e):e<1e6?`${(e/1e3).toFixed(e<1e4?1:0)}k`.replace(".0",""):`${(e/1e6).toFixed(1)}M`.replace(".0","")}function Sp({label:e,value:t,sub:a,accentColor:r,children:o,icon:s,className:c}){return g.jsxs("div",{className:`stat-card v10-anim-mount${c?` ${c}`:""}`,children:[r&&g.jsx("div",{className:"accent",style:{background:r}}),g.jsxs("div",{className:"stat-label",children:[s,e]}),t!=null&&t!==""&&g.jsx("div",{className:"stat-value",children:t}),o,a!=null&&a!==""&&g.jsx("div",{className:"stat-sub",children:a})]})}function V1({counts:e}){const t=e.wm+e.swm+e.vm,a=hh.map(r=>`${r.short} ${e[r.key]}`).join(" · ");return g.jsx("div",{className:"v10-layerbar","aria-label":a,children:t===0?g.jsx("span",{className:"v10-layerbar-empty"}):hh.map(r=>{const o=e[r.key]/t*100;return o<=0?null:g.jsx("span",{className:"v10-layerbar-seg",title:`${r.label} (${e[r.key]}) — ${r.desc}`,style:{width:`${o}%`,background:r.color}},r.key)})})}function h_(){return g.jsx("div",{className:"v10-layer-legend",children:hh.map(e=>g.jsxs("span",{className:"v10-layer-legend-item",title:`${e.label} — ${e.desc}`,children:[g.jsx("span",{className:"v10-layer-legend-dot",style:{background:e.color}}),e.short]},e.key))})}function m_({curator:e,joined:t,refreshing:a}){const r=e+t,o=`Curator ${e} · Joined ${t}`,s="var(--accent-green)",c="var(--text-secondary)";return g.jsxs("div",{className:`v10-cg-rolesplit${a?" is-refreshing":""}`,title:a?"Refreshing — agent identity is being re-checked":void 0,"aria-busy":a||void 0,children:[g.jsx("div",{className:"v10-layerbar","aria-label":o,children:r===0?g.jsx("span",{className:"v10-layerbar-empty"}):g.jsxs(g.Fragment,{children:[e>0&&g.jsx("span",{className:"v10-layerbar-seg",title:`Curator (${e}) — context graphs you created and curate`,style:{width:`${e/r*100}%`,background:s}}),t>0&&g.jsx("span",{className:"v10-layerbar-seg",title:`Joined (${t}) — context graphs you joined as a member`,style:{width:`${t/r*100}%`,background:c}})]})}),g.jsxs("div",{className:"v10-layer-legend",children:[g.jsxs("span",{className:"v10-layer-legend-item",title:"Curator — context graphs you created and curate",children:[g.jsx("span",{className:"v10-layer-legend-dot",style:{background:s}}),"Curator ",e]}),g.jsxs("span",{className:"v10-layer-legend-item",title:"Joined — context graphs you joined as a member",children:[g.jsx("span",{className:"v10-layer-legend-dot",style:{background:c}}),"Joined ",t]})]})]})}function g_({cg:e,identity:t,onReport:a,onOpen:r}){var P,Y;const o=U3(e.id,{signalErrors:!0}),[s,c]=S.useState(null),[d,p]=S.useState(!1),f=s===null&&!d,y=S.useRef(!0),m=S.useRef(0),b=S.useCallback(()=>{const D=++m.current;Wn.listParticipants(e.id).then(T=>{y.current&&D===m.current&&(c((T.allowedAgents??[]).map(Wi)),p(!1))}).catch(()=>{y.current&&D===m.current&&(c(null),p(!0))})},[e.id]);S.useEffect(()=>{y.current=!0,c(null),p(!1),b();const D=setInterval(b,3e4);return()=>{y.current=!1,clearInterval(D)}},[b]),_l(S.useCallback(D=>{var G,W;if(D.type!=="join_approved"&&D.type!=="join_rejected"&&D.type!=="project_synced")return;const T=((G=D.data)==null?void 0:G.contextGraphId)??((W=D.data)==null?void 0:W.projectId);T&&T!==e.id||b()},[e.id,b]));const x=su(e.accessPolicy)==="public",k=S.useMemo(()=>{var W;if(x)return null;const D=(W=e.curator)==null?void 0:W.trim(),T=D?Wi(D):null;if(s===null)return d&&T?[T]:null;const G=new Set(s);return T&&G.add(T),[...G]},[s,d,e.curator,x]),C=Number.isFinite(e.assetCount??e.assets)?e.assetCount??e.assets:0,A=S.useMemo(()=>{if(o.error)return{wm:0,swm:0,vm:0,total:C};const D=new Set(o.allTriples.map(T=>T.subject)).size;return{wm:o.counts.wm,swm:o.counts.swm,vm:o.counts.vm,total:D}},[o.error,o.allTriples,o.counts.wm,o.counts.swm,o.counts.vm,C]),E=r_(o),R=S.useMemo(()=>({wm:E.wm,swm:E.swm,vm:E.vm,total:E.canonical}),[E]),_=[o.loading?1:0,o.error?1:0,o.partial?1:0,f?1:0,d?1:0,x?1:0,A.wm,A.swm,A.vm,A.total,R.wm,R.swm,R.vm,R.total,k?k.slice().sort().join(","):"∅"].join("|");S.useEffect(()=>{a(e.id,{entities:A,triples:R,agents:k??[],sizeLoading:o.loading,sizeError:!!o.error||o.partial,sizeFallback:!!o.error,agentsLoading:f,agentsError:d,agentsUnknown:x,sig:_})},[e.id,_]);const U=su(e.accessPolicy),I=U==="private"?"Curated":U==="public"?"Public":"Unknown",O=!!((P=e.curator)!=null&&P.trim()&&((Y=t==null?void 0:t.agentDid)!=null&&Y.trim())&&Wi(e.curator)===Wi(t.agentDid));return g.jsxs("button",{className:"v10-cg-row",onClick:()=>r(e),children:[g.jsx("span",{className:"v10-cg-cell v10-cg-name",children:e.name||e.id.slice(0,16)}),g.jsx("span",{className:"v10-cg-cell v10-cg-type",title:`${I} context graph`,"aria-label":`${I} context graph`,children:U==="private"?g.jsx(CN,{size:13,"aria-hidden":"true"}):U==="public"?g.jsx(xN,{size:13,"aria-hidden":"true"}):g.jsx("span",{className:"v10-cg-dim",children:"—"})}),g.jsx("span",{className:"v10-cg-cell v10-cg-size",children:o.loading?g.jsx("span",{className:"v10-stat-loading",children:"loading…"}):o.error?g.jsxs("span",{title:"Live entity count unavailable — showing the published Knowledge-Asset summary, not the full WM/SWM/VM entity total",children:[wp(A.total)," ",g.jsx("span",{className:"v10-cg-dim",children:"KA (summary)"})," · ",g.jsx("span",{className:"v10-cg-dim",children:"— triples"})]}):o.partial?g.jsxs("span",{title:"Loaded preview only — some memory layers are capped or unavailable; total triples may increase or decrease as layers load",children:[A.total.toLocaleString(),"+ ",g.jsx("span",{className:"v10-cg-dim",children:"entities"})," · ~",R.total.toLocaleString()," ",g.jsx("span",{className:"v10-cg-dim",children:"triples · loaded preview"})]}):g.jsxs(g.Fragment,{children:[wp(A.total)," ",g.jsx("span",{className:"v10-cg-dim",children:"entities"})," · ",wp(R.total)," ",g.jsx("span",{className:"v10-cg-dim",children:"triples"})]})}),g.jsx("span",{className:"v10-cg-cell v10-cg-agents",children:k===null?g.jsx("span",{className:"v10-cg-dim",children:"—"}):d?g.jsxs("span",{title:"Participant list unavailable — curator-only lower bound",children:["~",k.length]}):k.length}),g.jsx("span",{className:"v10-cg-cell v10-cg-role",children:g.jsx("span",{className:`v10-cg-badge v10-cg-badge-${O?"curator":"joined"}`,children:O?"CURATOR":"JOINED"})})]})}const W1={wm:0,swm:0,vm:0,total:0};function y_(){var P,Y;const{data:e}=vp(Wn.fetchStatus,[],1e4),{data:t}=vp(Wn.fetchEconomics,[],6e4),{data:a,loading:r,error:o}=vp(Wn.fetchWalletsBalances,[],3e4),{openTab:s}=xn(),{setActiveProject:c}=ga(),{myCgs:d,identity:p,identityLoading:f,cgsLoading:y}=g3(),m=(f||y)&&d.length===0,[b,x]=S.useState({}),k=S.useCallback((D,T)=>{x(G=>{var W;return((W=G[D])==null?void 0:W.sig)===T.sig?G:{...G,[D]:T}})},[]);S.useEffect(()=>{const D=new Set(d.map(T=>T.id));x(T=>{const G=Object.keys(T);if(G.every(ae=>D.has(ae)))return T;const W={};for(const ae of G)D.has(ae)&&(W[ae]=T[ae]);return W})},[d]);const C=S.useMemo(()=>{const D={...W1},T={...W1},G=new Set;let W=!1,ae=!1,q=!1,Q=!1,F=!1;for(const ie of d){const X=b[ie.id];if(!X){W=!0,ae=!0;continue}X.sizeLoading&&(W=!0),X.agentsLoading&&(ae=!0),X.sizeError&&(q=!0),X.sizeFallback&&(F=!0),(X.agentsError||X.agentsUnknown)&&(Q=!0);for(const M of["wm","swm","vm","total"])D[M]+=X.entities[M],T[M]+=X.triples[M];for(const M of X.agents)G.add(M)}const ee=d.length>0;return{entities:D,triples:T,agentCount:G.size,sizeLoading:ee&&W,agentsLoading:ee&&ae,sizePartial:q,agentsPartial:Q,triplesUnknown:ee&&q&&T.total===0,sizeApprox:ee&&F,hasCgs:ee}},[d,b]),A=f_(C),E=S.useMemo(()=>{var W,ae;const D=(W=p==null?void 0:p.agentDid)!=null&&W.trim()?Wi(p.agentDid):null;let T=0,G=0;for(const q of d)!!(D&&((ae=q.curator)!=null&&ae.trim())&&Wi(q.curator)===D)?T++:G++;return{curator:T,joined:G}},[d,p]),R=[{label:"24h",display:"Last 24h"},{label:"7d",display:"Last 7d"},{label:"30d",display:"Last 30d"}],_=D=>{if(D==null||typeof D=="string"&&D.trim()==="")return"—";const T=Number(D);return isFinite(T)?T.toLocaleString(void 0,{maximumFractionDigits:T>=1e3?0:2}):String(D)},U=R.map(D=>{var G;const T=(G=t==null?void 0:t.periods)==null?void 0:G.find(W=>W.label===D.label);return{display:D.display,publishes:T?String(T.publishCount):"—",trac:T?_(T.totalTrac):"—"}});a!=null&&a.symbol;const I=(a==null?void 0:a.balances)??[],O=D=>D.length>12?`${D.slice(0,6)}…${D.slice(-4)}`:D;return g.jsxs("div",{className:"v10-dashboard",children:[g.jsxs("div",{className:"v10-dash-header",children:[g.jsx("h1",{className:"v10-dash-title",children:"Dashboard"}),g.jsxs("p",{className:"v10-dash-subtitle",children:[(e==null?void 0:e.name)||"DKG Node"," · ",(e==null?void 0:e.networkName)||"network",(a==null?void 0:a.chainId)!=null?` · ${xp(a.chainId).name}`:""]})]}),g.jsxs("div",{className:"v10-dash-stats v10-dash-stats-3",children:[g.jsx(Sp,{label:"My Context Graphs",className:"v10-stat-tight",icon:g.jsx(m1,{size:13,"aria-hidden":!0}),value:m?g.jsx("span",{className:"v10-stat-loading",children:"loading…"}):d.length,accentColor:"var(--accent-blue)",sub:p_,children:C.hasCgs&&!m?g.jsx(m_,{curator:E.curator,joined:E.joined,refreshing:f}):null}),g.jsxs(Sp,{label:"Context Graph Size",icon:g.jsx(_N,{size:13,"aria-hidden":!0}),className:"v10-stat-tight",accentColor:"var(--accent-green)",children:[C.hasCgs?C.sizeLoading?g.jsx("div",{className:"v10-stat-loading",children:"loading…"}):g.jsxs("div",{className:"v10-cg-size-detail",children:[g.jsxs("div",{className:"v10-cg-size-metric",children:[g.jsxs("div",{className:"v10-cg-size-num",children:[g.jsx("span",{className:"v10-cg-size-big",children:A.entityValue}),g.jsx("span",{className:"v10-cg-dim",title:A.entityTitle,children:A.entityLabel})]}),A.showLayerBars?g.jsx(V1,{counts:C.entities}):null]}),g.jsxs("div",{className:"v10-cg-size-metric",children:[g.jsxs("div",{className:"v10-cg-size-num",children:[g.jsx("span",{className:"v10-cg-size-big",children:A.tripleValue}),g.jsx("span",{className:"v10-cg-dim",children:A.tripleLabel})]}),A.showLayerBars?g.jsx(V1,{counts:C.triples}):null]}),g.jsx(h_,{})]}):g.jsx("div",{className:"v10-stat-empty",children:"—"}),g.jsx("div",{className:"stat-sub",children:C.hasCgs?C.sizePartial?"Partial preview — some memory layers are capped or unavailable. Context graphs may contain more entities; triple totals may increase or decrease as layers load.":"Totals across all your context graphs, summed over Working, Shared Working & Verifiable Memory. Knowledge Assets are entities that have been published to Verifiable Memory.":"No context graphs yet."})]}),g.jsx(Sp,{label:"Collaborating Agents",icon:g.jsx(LN,{size:13,"aria-hidden":!0}),value:C.hasCgs?C.agentsLoading?g.jsx("span",{className:"v10-stat-loading",children:"loading…"}):C.agentsPartial?`~${C.agentCount}`:C.agentCount:g.jsx("span",{className:"v10-stat-empty",children:"—"}),sub:C.hasCgs?C.agentsPartial?"Some context graphs could not report agents; count is partial.":"Unique agents — your own and others' — allow-listed and collaborating across your context graphs.":"No context graphs yet.",accentColor:"var(--purple)"})]}),g.jsxs("div",{className:"v10-dash-grid v10-dash-grid-2",children:[g.jsxs("div",{className:"v10-dash-section v10-dash-section-wide v10-anim-mount",children:[g.jsxs("div",{className:"v10-dash-section-header",children:[g.jsxs("div",{className:"v10-dash-section-title",children:[g.jsx(m1,{size:13,"aria-hidden":!0}),g.jsx("h3",{children:"My Context Graphs"})]}),g.jsx("span",{className:"v10-dash-section-badge",children:d.length})]}),m?g.jsx("p",{className:"v10-cg-empty",children:"Loading context graphs…"}):d.length===0?g.jsx("p",{className:"v10-cg-empty",children:"No context graphs yet — create or join one from the sidebar."}):g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"v10-cg-colhead",children:[g.jsx("span",{className:"v10-cg-cell v10-cg-name",children:"Name"}),g.jsx("span",{className:"v10-cg-cell v10-cg-type",children:"Type"}),g.jsx("span",{className:"v10-cg-cell v10-cg-size",children:"Size"}),g.jsx("span",{className:"v10-cg-cell v10-cg-agents",title:"Agents allow-listed with access to this context graph",children:"Agents"}),g.jsx("span",{className:"v10-cg-cell v10-cg-role",children:"Role"})]}),g.jsx("div",{className:"v10-cg-list",children:d.map(D=>g.jsx(g_,{cg:D,identity:p,onReport:k,onOpen:T=>{c(T.id),s({id:`project:${T.id}`,label:T.name||T.id.slice(0,12),closable:!0})}},D.id))})]})]}),g.jsxs("div",{className:"v10-dash-section v10-anim-mount",children:[g.jsx("div",{className:"v10-dash-section-header",children:g.jsxs("div",{className:"v10-dash-section-title",children:[g.jsx(IN,{size:13,"aria-hidden":!0}),g.jsx("h3",{children:"Wallets and Spending"})]})}),(a==null?void 0:a.chainId)!=null?g.jsxs("div",{className:"v10-ws-chain-row",children:[g.jsx("span",{className:"v10-ws-chain-label",children:"Chain"}),g.jsx("span",{className:"v10-ws-chain-value",children:xp(a.chainId).name})]}):null,g.jsx("div",{className:"v10-ws-subhead",children:"Node wallets"}),r&&!a?g.jsx("p",{className:"v10-cg-empty",children:"Loading wallets…"}):I.length>0?g.jsxs("div",{className:"v10-ws-wtable",children:[g.jsxs("div",{className:"v10-ws-wrow v10-ws-whead",children:[g.jsx("span",{children:"Wallet"}),g.jsx("span",{children:"TRAC"}),g.jsxs("span",{children:["Gas (",xp(a==null?void 0:a.chainId).gas,")"]})]}),I.map(D=>g.jsxs("div",{className:"v10-ws-wrow",children:[g.jsx("span",{className:"v10-ws-addr",title:D.address,children:O(D.address)}),g.jsx("span",{className:"v10-ws-bal",children:_(D.trac)}),g.jsx("span",{className:"v10-ws-bal-sec",title:c_(D.eth),children:s_(D.eth)})]},D.address))]}):(((P=a==null?void 0:a.wallets)==null?void 0:P.length)??0)>0?g.jsx("ul",{className:"v10-ws-wallets",children:((a==null?void 0:a.wallets)??[]).map(D=>g.jsxs("li",{className:"v10-ws-wallet",children:[g.jsx("span",{className:"v10-ws-addr",title:D,children:O(D)}),g.jsx("span",{className:"v10-cg-dim",children:"—"})]},D))}):a!=null&&a.error||o?g.jsx("p",{className:"v10-cg-empty",children:"Wallet balances unavailable."}):g.jsx("p",{className:"v10-cg-empty",children:"No node wallets found."}),(a!=null&&a.error||o)&&(I.length>0||(((Y=a==null?void 0:a.wallets)==null?void 0:Y.length)??0)>0)?g.jsx("p",{className:"v10-ws-note",children:"Balances may be stale — the chain/RPC reported an error."}):null,g.jsx("div",{className:"v10-ws-subhead",children:"Spending"}),g.jsxs("div",{className:"v10-ws-spend",children:[g.jsxs("div",{className:"v10-ws-spend-head",children:[g.jsx("span",{children:"Period"}),g.jsx("span",{title:"Publishes to Verifiable Memory that spent TRAC on-chain. Free SWM/local/testnet publishes are not counted (they don't burn TRAC).",children:"Publishes to VM"}),g.jsx("span",{children:"TRAC"})]}),U.map(D=>g.jsxs("div",{className:"v10-ws-spend-row",children:[g.jsx("span",{className:"v10-cg-dim",children:D.display}),g.jsx("span",{className:"v10-ws-spend-val",children:D.publishes}),g.jsx("span",{className:"v10-ws-spend-val",children:D.trac})]},D.display))]}),g.jsx(d_,{})]})]})]})}const mm="context-graph-primer",v_={id:mm,label:"What is a Context Graph?",closable:!0},b_=[{title:"Memory layers",body:"Working Memory is private staging, Shared Working Memory is the collaborative review layer, and Verifiable Memory is the published on-chain layer. Counts show where entities live now."},{title:"Subgraphs",body:"Subgraphs organize the same Context Graph by topic or source. They cut across memory layers, so a subgraph can contain Working, Shared Working, and Verifiable Memory at the same time."},{title:"Entities and Knowledge Assets",body:"Working Memory and Shared Working Memory contain entities. When published, an assertion/triple bundle is anchored as a Knowledge Asset in Verifiable Memory, giving included entities on-chain provenance."},{title:"Assertions",body:"Assertions are batches of triples that explain how entities entered or moved through the Context Graph. They are useful for reviewing provenance and lifecycle state."},{title:"Roles",body:"A curator controls access and publication policy. A participant can collaborate inside the Context Graph according to that policy."}];function x_(){const e=xn(a=>a.closeTab),t=bn.useCallback(()=>e(mm),[e]);return bn.useEffect(()=>{const a=r=>{r.key==="Escape"&&(r.preventDefault(),t())};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[t]),g.jsxs("div",{className:"v10-primer-view",children:[g.jsxs("header",{className:"v10-primer-header",children:[g.jsx("button",{type:"button",className:"v10-primer-back",onClick:t,"aria-label":"Close primer and return to the previous tab",children:"← Back"}),g.jsx("p",{className:"v10-primer-kicker",children:"Context Graph Primer"}),g.jsx("h1",{children:"What is a Context Graph?"}),g.jsx("p",{children:"A Context Graph is a shared knowledge workspace where agents stage, review, organize, and publish structured memory."})]}),g.jsxs("section",{className:"v10-primer-pipeline","aria-label":"Context Graph pipeline",children:[g.jsx("span",{className:"wm",children:"Working Memory"}),g.jsx("span",{className:"connector","aria-hidden":"true"}),g.jsx("span",{className:"swm",children:"Shared Working Memory"}),g.jsx("span",{className:"connector","aria-hidden":"true"}),g.jsx("span",{className:"vm",children:"Verifiable Memory"})]}),g.jsx("div",{className:"v10-primer-sections",children:b_.map(a=>g.jsxs("section",{className:"v10-primer-section",children:[g.jsx("h2",{children:a.title}),g.jsx("p",{children:a.body})]},a.title))})]})}const gm="doc:";function qP(e,t,a){return`${gm}${e}|${t}|${a}`}function FP(e,t,a){return e?{ref:e,contentType:"text/markdown"}:t?{ref:t,contentType:a}:{ref:void 0,contentType:a}}function w_(e){const t=e.slice(gm.length),a=t.indexOf("|"),r=t.lastIndexOf("|");return a<0?{docRef:t,contentType:""}:{docRef:t.slice(a+1,r),contentType:t.slice(r+1)}}function S_(e,t){const a=t||{};return(e[e.length-1]===""?[...e,""]:e).join((a.padRight?" ":"")+","+(a.padLeft===!1?"":" ")).trim()}const k_=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,C_=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,E_={};function Y1(e,t){return(E_.jsx?C_:k_).test(e)}const A_=/[ \t\n\f\r]/g;function j_(e){return typeof e=="object"?e.type==="text"?K1(e.value):!1:K1(e)}function K1(e){return e.replace(A_,"")===""}class os{constructor(t,a,r){this.normal=a,this.property=t,r&&(this.space=r)}}os.prototype.normal={};os.prototype.property={};os.prototype.space=void 0;function tS(e,t){const a={},r={};for(const o of e)Object.assign(a,o.property),Object.assign(r,o.normal);return new os(a,r,t)}function mh(e){return e.toLowerCase()}class On{constructor(t,a){this.attribute=a,this.property=t}}On.prototype.attribute="";On.prototype.booleanish=!1;On.prototype.boolean=!1;On.prototype.commaOrSpaceSeparated=!1;On.prototype.commaSeparated=!1;On.prototype.defined=!1;On.prototype.mustUseProperty=!1;On.prototype.number=!1;On.prototype.overloadedBoolean=!1;On.prototype.property="";On.prototype.spaceSeparated=!1;On.prototype.space=void 0;let T_=0;const Ie=Ar(),Ft=Ar(),gh=Ar(),de=Ar(),bt=Ar(),wl=Ar(),Fn=Ar();function Ar(){return 2**++T_}const yh=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ie,booleanish:Ft,commaOrSpaceSeparated:Fn,commaSeparated:wl,number:de,overloadedBoolean:gh,spaceSeparated:bt},Symbol.toStringTag,{value:"Module"})),kp=Object.keys(yh);class ym extends On{constructor(t,a,r,o){let s=-1;if(super(t,a),Q1(this,"space",o),typeof r=="number")for(;++s<kp.length;){const c=kp[s];Q1(this,kp[s],(r&yh[c])===yh[c])}}}ym.prototype.defined=!0;function Q1(e,t,a){a&&(e[t]=a)}function Ml(e){const t={},a={};for(const[r,o]of Object.entries(e.properties)){const s=new ym(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,a[mh(r)]=r,a[mh(s.attribute)]=r}return new os(t,a,e.space)}const nS=Ml({properties:{ariaActiveDescendant:null,ariaAtomic:Ft,ariaAutoComplete:null,ariaBusy:Ft,ariaChecked:Ft,ariaColCount:de,ariaColIndex:de,ariaColSpan:de,ariaControls:bt,ariaCurrent:null,ariaDescribedBy:bt,ariaDetails:null,ariaDisabled:Ft,ariaDropEffect:bt,ariaErrorMessage:null,ariaExpanded:Ft,ariaFlowTo:bt,ariaGrabbed:Ft,ariaHasPopup:null,ariaHidden:Ft,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:bt,ariaLevel:de,ariaLive:null,ariaModal:Ft,ariaMultiLine:Ft,ariaMultiSelectable:Ft,ariaOrientation:null,ariaOwns:bt,ariaPlaceholder:null,ariaPosInSet:de,ariaPressed:Ft,ariaReadOnly:Ft,ariaRelevant:null,ariaRequired:Ft,ariaRoleDescription:bt,ariaRowCount:de,ariaRowIndex:de,ariaRowSpan:de,ariaSelected:Ft,ariaSetSize:de,ariaSort:null,ariaValueMax:de,ariaValueMin:de,ariaValueNow:de,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function aS(e,t){return t in e?e[t]:t}function iS(e,t){return aS(e,t.toLowerCase())}const R_=Ml({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:wl,acceptCharset:bt,accessKey:bt,action:null,allow:null,allowFullScreen:Ie,allowPaymentRequest:Ie,allowUserMedia:Ie,alt:null,as:null,async:Ie,autoCapitalize:null,autoComplete:bt,autoFocus:Ie,autoPlay:Ie,blocking:bt,capture:null,charSet:null,checked:Ie,cite:null,className:bt,cols:de,colSpan:null,content:null,contentEditable:Ft,controls:Ie,controlsList:bt,coords:de|wl,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ie,defer:Ie,dir:null,dirName:null,disabled:Ie,download:gh,draggable:Ft,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ie,formTarget:null,headers:bt,height:de,hidden:gh,high:de,href:null,hrefLang:null,htmlFor:bt,httpEquiv:bt,id:null,imageSizes:null,imageSrcSet:null,inert:Ie,inputMode:null,integrity:null,is:null,isMap:Ie,itemId:null,itemProp:bt,itemRef:bt,itemScope:Ie,itemType:bt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ie,low:de,manifest:null,max:null,maxLength:de,media:null,method:null,min:null,minLength:de,multiple:Ie,muted:Ie,name:null,nonce:null,noModule:Ie,noValidate:Ie,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:Ie,optimum:de,pattern:null,ping:bt,placeholder:null,playsInline:Ie,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ie,referrerPolicy:null,rel:bt,required:Ie,reversed:Ie,rows:de,rowSpan:de,sandbox:bt,scope:null,scoped:Ie,seamless:Ie,selected:Ie,shadowRootClonable:Ie,shadowRootDelegatesFocus:Ie,shadowRootMode:null,shape:null,size:de,sizes:null,slot:null,span:de,spellCheck:Ft,src:null,srcDoc:null,srcLang:null,srcSet:null,start:de,step:null,style:null,tabIndex:de,target:null,title:null,translate:null,type:null,typeMustMatch:Ie,useMap:null,value:Ft,width:de,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:bt,axis:null,background:null,bgColor:null,border:de,borderColor:null,bottomMargin:de,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ie,declare:Ie,event:null,face:null,frame:null,frameBorder:null,hSpace:de,leftMargin:de,link:null,longDesc:null,lowSrc:null,marginHeight:de,marginWidth:de,noResize:Ie,noHref:Ie,noShade:Ie,noWrap:Ie,object:null,profile:null,prompt:null,rev:null,rightMargin:de,rules:null,scheme:null,scrolling:Ft,standby:null,summary:null,text:null,topMargin:de,valueType:null,version:null,vAlign:null,vLink:null,vSpace:de,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ie,disableRemotePlayback:Ie,prefix:null,property:null,results:de,security:null,unselectable:null},space:"html",transform:iS}),N_=Ml({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:Fn,accentHeight:de,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:de,amplitude:de,arabicForm:null,ascent:de,attributeName:null,attributeType:null,azimuth:de,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:de,by:null,calcMode:null,capHeight:de,className:bt,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:de,diffuseConstant:de,direction:null,display:null,dur:null,divisor:de,dominantBaseline:null,download:Ie,dx:null,dy:null,edgeMode:null,editable:null,elevation:de,enableBackground:null,end:null,event:null,exponent:de,externalResourcesRequired:null,fill:null,fillOpacity:de,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:wl,g2:wl,glyphName:wl,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:de,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:de,horizOriginX:de,horizOriginY:de,id:null,ideographic:de,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:de,k:de,k1:de,k2:de,k3:de,k4:de,kernelMatrix:Fn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:de,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:de,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:de,overlineThickness:de,paintOrder:null,panose1:null,path:null,pathLength:de,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:bt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:de,pointsAtY:de,pointsAtZ:de,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Fn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Fn,rev:Fn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Fn,requiredFeatures:Fn,requiredFonts:Fn,requiredFormats:Fn,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:de,specularExponent:de,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:de,strikethroughThickness:de,string:null,stroke:null,strokeDashArray:Fn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:de,strokeOpacity:de,strokeWidth:null,style:null,surfaceScale:de,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Fn,tabIndex:de,tableValues:null,target:null,targetX:de,targetY:de,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Fn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:de,underlineThickness:de,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:de,values:null,vAlphabetic:de,vMathematical:de,vectorEffect:null,vHanging:de,vIdeographic:de,version:null,vertAdvY:de,vertOriginX:de,vertOriginY:de,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:de,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:aS}),rS=Ml({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()}}),lS=Ml({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:iS}),oS=Ml({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),__={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"},O_=/[A-Z]/g,X1=/-[a-z]/g,M_=/^data[-\w.:]+$/i;function D_(e,t){const a=mh(t);let r=t,o=On;if(a in e.normal)return e.property[e.normal[a]];if(a.length>4&&a.slice(0,4)==="data"&&M_.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(X1,z_);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!X1.test(s)){let c=s.replace(O_,L_);c.charAt(0)!=="-"&&(c="-"+c),t="data"+c}}o=ym}return new o(r,t)}function L_(e){return"-"+e.toLowerCase()}function z_(e){return e.charAt(1).toUpperCase()}const I_=tS([nS,R_,rS,lS,oS],"html"),vm=tS([nS,N_,rS,lS,oS],"svg");function P_(e){return e.join(" ").trim()}var hl={},Cp,Z1;function B_(){if(Z1)return Cp;Z1=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,a=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,d=/^\s+|\s+$/g,p=`
1107
+ `,f="/",y="*",m="",b="comment",x="declaration";function k(A,E){if(typeof A!="string")throw new TypeError("First argument must be a string");if(!A)return[];E=E||{};var R=1,_=1;function U(q){var Q=q.match(t);Q&&(R+=Q.length);var F=q.lastIndexOf(p);_=~F?q.length-F:_+q.length}function I(){var q={line:R,column:_};return function(Q){return Q.position=new O(q),D(),Q}}function O(q){this.start=q,this.end={line:R,column:_},this.source=E.source}O.prototype.content=A;function P(q){var Q=new Error(E.source+":"+R+":"+_+": "+q);if(Q.reason=q,Q.filename=E.source,Q.line=R,Q.column=_,Q.source=A,!E.silent)throw Q}function Y(q){var Q=q.exec(A);if(Q){var F=Q[0];return U(F),A=A.slice(F.length),Q}}function D(){Y(a)}function T(q){var Q;for(q=q||[];Q=G();)Q!==!1&&q.push(Q);return q}function G(){var q=I();if(!(f!=A.charAt(0)||y!=A.charAt(1))){for(var Q=2;m!=A.charAt(Q)&&(y!=A.charAt(Q)||f!=A.charAt(Q+1));)++Q;if(Q+=2,m===A.charAt(Q-1))return P("End of comment missing");var F=A.slice(2,Q-2);return _+=2,U(F),A=A.slice(Q),_+=2,q({type:b,comment:F})}}function W(){var q=I(),Q=Y(r);if(Q){if(G(),!Y(o))return P("property missing ':'");var F=Y(s),ee=q({type:x,property:C(Q[0].replace(e,m)),value:F?C(F[0].replace(e,m)):m});return Y(c),ee}}function ae(){var q=[];T(q);for(var Q;Q=W();)Q!==!1&&(q.push(Q),T(q));return q}return D(),ae()}function C(A){return A?A.replace(d,m):m}return Cp=k,Cp}var J1;function U_(){if(J1)return hl;J1=1;var e=hl&&hl.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(hl,"__esModule",{value:!0}),hl.default=a;const t=e(B_());function a(r,o){let s=null;if(!r||typeof r!="string")return s;const c=(0,t.default)(r),d=typeof o=="function";return c.forEach(p=>{if(p.type!=="declaration")return;const{property:f,value:y}=p;d?o(f,y,p):y&&(s=s||{},s[f]=y)}),s}return hl}var Oo={},eb;function H_(){if(eb)return Oo;eb=1,Object.defineProperty(Oo,"__esModule",{value:!0}),Oo.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,a=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,s=function(f){return!f||a.test(f)||e.test(f)},c=function(f,y){return y.toUpperCase()},d=function(f,y){return"".concat(y,"-")},p=function(f,y){return y===void 0&&(y={}),s(f)?f:(f=f.toLowerCase(),y.reactCompat?f=f.replace(o,d):f=f.replace(r,d),f.replace(t,c))};return Oo.camelCase=p,Oo}var Mo,tb;function $_(){if(tb)return Mo;tb=1;var e=Mo&&Mo.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},t=e(U_()),a=H_();function r(o,s){var c={};return!o||typeof o!="string"||(0,t.default)(o,function(d,p){d&&p&&(c[(0,a.camelCase)(d,s)]=p)}),c}return r.default=r,Mo=r,Mo}var q_=$_();const F_=ns(q_),sS=cS("end"),bm=cS("start");function cS(e){return t;function t(a){const r=a&&a.position&&a.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function G_(e){const t=bm(e),a=sS(e);if(t&&a)return{start:t,end:a}}function qo(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?nb(e.position):"start"in e||"end"in e?nb(e):"line"in e||"column"in e?vh(e):""}function vh(e){return ab(e&&e.line)+":"+ab(e&&e.column)}function nb(e){return vh(e&&e.start)+"-"+vh(e&&e.end)}function ab(e){return e&&typeof e=="number"?e:1}class fn extends Error{constructor(t,a,r){super(),typeof a=="string"&&(r=a,a=void 0);let o="",s={},c=!1;if(a&&("line"in a&&"column"in a?s={place:a}:"start"in a&&"end"in a?s={place:a}:"type"in a?s={ancestors:[a],place:a.position}:s={...a}),typeof t=="string"?o=t:!s.cause&&t&&(c=!0,o=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof r=="string"){const p=r.indexOf(":");p===-1?s.ruleId=r:(s.source=r.slice(0,p),s.ruleId=r.slice(p+1))}if(!s.place&&s.ancestors&&s.ancestors){const p=s.ancestors[s.ancestors.length-1];p&&(s.place=p.position)}const d=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=d?d.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=d?d.line:void 0,this.name=qo(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=c&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}fn.prototype.file="";fn.prototype.name="";fn.prototype.reason="";fn.prototype.message="";fn.prototype.stack="";fn.prototype.column=void 0;fn.prototype.line=void 0;fn.prototype.ancestors=void 0;fn.prototype.cause=void 0;fn.prototype.fatal=void 0;fn.prototype.place=void 0;fn.prototype.ruleId=void 0;fn.prototype.source=void 0;const xm={}.hasOwnProperty,V_=new Map,W_=/[A-Z]/g,Y_=new Set(["table","tbody","thead","tfoot","tr"]),K_=new Set(["td","th"]),uS="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Q_(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const a=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=iO(a,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");r=aO(a,t.jsx,t.jsxs)}const o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:a,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?vm:I_,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=dS(o,e,void 0);return s&&typeof s!="string"?s:o.create(e,o.Fragment,{children:s||void 0},void 0)}function dS(e,t,a){if(t.type==="element")return X_(e,t,a);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Z_(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return eO(e,t,a);if(t.type==="mdxjsEsm")return J_(e,t);if(t.type==="root")return tO(e,t,a);if(t.type==="text")return nO(e,t)}function X_(e,t,a){const r=e.schema;let o=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(o=vm,e.schema=o),e.ancestors.push(t);const s=pS(e,t.tagName,!1),c=rO(e,t);let d=Sm(e,t);return Y_.has(t.tagName)&&(d=d.filter(function(p){return typeof p=="string"?!j_(p):!0})),fS(e,c,s,t),wm(c,d),e.ancestors.pop(),e.schema=r,e.create(t,s,c,a)}function Z_(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Zo(e,t.position)}function J_(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Zo(e,t.position)}function eO(e,t,a){const r=e.schema;let o=r;t.name==="svg"&&r.space==="html"&&(o=vm,e.schema=o),e.ancestors.push(t);const s=t.name===null?e.Fragment:pS(e,t.name,!0),c=lO(e,t),d=Sm(e,t);return fS(e,c,s,t),wm(c,d),e.ancestors.pop(),e.schema=r,e.create(t,s,c,a)}function tO(e,t,a){const r={};return wm(r,Sm(e,t)),e.create(t,e.Fragment,r,a)}function nO(e,t){return t.value}function fS(e,t,a,r){typeof a!="string"&&a!==e.Fragment&&e.passNode&&(t.node=r)}function wm(e,t){if(t.length>0){const a=t.length>1?t:t[0];a&&(e.children=a)}}function aO(e,t,a){return r;function r(o,s,c,d){const f=Array.isArray(c.children)?a:t;return d?f(s,c,d):f(s,c)}}function iO(e,t){return a;function a(r,o,s,c){const d=Array.isArray(s.children),p=bm(r);return t(o,s,c,d,{columnNumber:p?p.column-1:void 0,fileName:e,lineNumber:p?p.line:void 0},void 0)}}function rO(e,t){const a={};let r,o;for(o in t.properties)if(o!=="children"&&xm.call(t.properties,o)){const s=oO(e,o,t.properties[o]);if(s){const[c,d]=s;e.tableCellAlignToStyle&&c==="align"&&typeof d=="string"&&K_.has(t.tagName)?r=d:a[c]=d}}if(r){const s=a.style||(a.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return a}function lO(e,t){const a={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const s=r.data.estree.body[0];s.type;const c=s.expression;c.type;const d=c.properties[0];d.type,Object.assign(a,e.evaluater.evaluateExpression(d.argument))}else Zo(e,t.position);else{const o=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const d=r.value.data.estree.body[0];d.type,s=e.evaluater.evaluateExpression(d.expression)}else Zo(e,t.position);else s=r.value===null?!0:r.value;a[o]=s}return a}function Sm(e,t){const a=[];let r=-1;const o=e.passKeys?new Map:V_;for(;++r<t.children.length;){const s=t.children[r];let c;if(e.passKeys){const p=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(p){const f=o.get(p)||0;c=p+"-"+f,o.set(p,f+1)}}const d=dS(e,s,c);d!==void 0&&a.push(d)}return a}function oO(e,t,a){const r=D_(e.schema,t);if(!(a==null||typeof a=="number"&&Number.isNaN(a))){if(Array.isArray(a)&&(a=r.commaSeparated?S_(a):P_(a)),r.property==="style"){let o=typeof a=="object"?a:sO(e,String(a));return e.stylePropertyNameCase==="css"&&(o=cO(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&r.space?__[r.property]||r.property:r.attribute,a]}}function sO(e,t){try{return F_(t,{reactCompat:!0})}catch(a){if(e.ignoreInvalidStyle)return{};const r=a,o=new fn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=uS+"#cannot-parse-style-attribute",o}}function pS(e,t,a){let r;if(!a)r={type:"Literal",value:t};else if(t.includes(".")){const o=t.split(".");let s=-1,c;for(;++s<o.length;){const d=Y1(o[s])?{type:"Identifier",name:o[s]}:{type:"Literal",value:o[s]};c=c?{type:"MemberExpression",object:c,property:d,computed:!!(s&&d.type==="Literal"),optional:!1}:d}r=c}else r=Y1(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const o=r.value;return xm.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(r);Zo(e)}function Zo(e,t){const a=new fn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=uS+"#cannot-handle-mdx-estrees-without-createevaluater",a}function cO(e){const t={};let a;for(a in e)xm.call(e,a)&&(t[uO(a)]=e[a]);return t}function uO(e){let t=e.replace(W_,dO);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function dO(e){return"-"+e.toLowerCase()}const Ep={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"]},fO={};function km(e,t){const a=fO,r=typeof a.includeImageAlt=="boolean"?a.includeImageAlt:!0,o=typeof a.includeHtml=="boolean"?a.includeHtml:!0;return hS(e,r,o)}function hS(e,t,a){if(pO(e)){if("value"in e)return e.type==="html"&&!a?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return ib(e.children,t,a)}return Array.isArray(e)?ib(e,t,a):""}function ib(e,t,a){const r=[];let o=-1;for(;++o<e.length;)r[o]=hS(e[o],t,a);return r.join("")}function pO(e){return!!(e&&typeof e=="object")}const rb=document.createElement("i");function Cm(e){const t="&"+e+";";rb.innerHTML=t;const a=rb.textContent;return a.charCodeAt(a.length-1)===59&&e!=="semi"||a===t?!1:a}function Yn(e,t,a,r){const o=e.length;let s=0,c;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,a=a>0?a:0,r.length<1e4)c=Array.from(r),c.unshift(t,a),e.splice(...c);else for(a&&e.splice(t,a);s<r.length;)c=r.slice(s,s+1e4),c.unshift(t,0),e.splice(...c),s+=1e4,t+=1e4}function ca(e,t){return e.length>0?(Yn(e,e.length,0,t),e):t}const lb={}.hasOwnProperty;function mS(e){const t={};let a=-1;for(;++a<e.length;)hO(t,e[a]);return t}function hO(e,t){let a;for(a in t){const o=(lb.call(e,a)?e[a]:void 0)||(e[a]={}),s=t[a];let c;if(s)for(c in s){lb.call(o,c)||(o[c]=[]);const d=s[c];mO(o[c],Array.isArray(d)?d:d?[d]:[])}}}function mO(e,t){let a=-1;const r=[];for(;++a<t.length;)(t[a].add==="after"?e:r).push(t[a]);Yn(e,0,0,r)}function gS(e,t){const a=Number.parseInt(e,t);return a<9||a===11||a>13&&a<32||a>126&&a<160||a>55295&&a<57344||a>64975&&a<65008||(a&65535)===65535||(a&65535)===65534||a>1114111?"�":String.fromCodePoint(a)}function ba(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const vn=Yi(/[A-Za-z]/),dn=Yi(/[\dA-Za-z]/),gO=Yi(/[#-'*+\--9=?A-Z^-~]/);function uu(e){return e!==null&&(e<32||e===127)}const bh=Yi(/\d/),yO=Yi(/[\dA-Fa-f]/),vO=Yi(/[!-/:-@[-`{-~]/);function Ae(e){return e!==null&&e<-2}function yt(e){return e!==null&&(e<0||e===32)}function Fe(e){return e===-2||e===-1||e===32}const Au=Yi(new RegExp("\\p{P}|\\p{S}","u")),kr=Yi(/\s/);function Yi(e){return t;function t(a){return a!==null&&a>-1&&e.test(String.fromCharCode(a))}}function Dl(e){const t=[];let a=-1,r=0,o=0;for(;++a<e.length;){const s=e.charCodeAt(a);let c="";if(s===37&&dn(e.charCodeAt(a+1))&&dn(e.charCodeAt(a+2)))o=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(c=String.fromCharCode(s));else if(s>55295&&s<57344){const d=e.charCodeAt(a+1);s<56320&&d>56319&&d<57344?(c=String.fromCharCode(s,d),o=1):c="�"}else c=String.fromCharCode(s);c&&(t.push(e.slice(r,a),encodeURIComponent(c)),r=a+o+1,c=""),o&&(a+=o,o=0)}return t.join("")+e.slice(r)}function Qe(e,t,a,r){const o=r?r-1:Number.POSITIVE_INFINITY;let s=0;return c;function c(p){return Fe(p)?(e.enter(a),d(p)):t(p)}function d(p){return Fe(p)&&s++<o?(e.consume(p),d):(e.exit(a),t(p))}}const bO={tokenize:xO};function xO(e){const t=e.attempt(this.parser.constructs.contentInitial,r,o);let a;return t;function r(d){if(d===null){e.consume(d);return}return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),Qe(e,t,"linePrefix")}function o(d){return e.enter("paragraph"),s(d)}function s(d){const p=e.enter("chunkText",{contentType:"text",previous:a});return a&&(a.next=p),a=p,c(d)}function c(d){if(d===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(d);return}return Ae(d)?(e.consume(d),e.exit("chunkText"),s):(e.consume(d),c)}}const wO={tokenize:SO},ob={tokenize:kO};function SO(e){const t=this,a=[];let r=0,o,s,c;return d;function d(_){if(r<a.length){const U=a[r];return t.containerState=U[1],e.attempt(U[0].continuation,p,f)(_)}return f(_)}function p(_){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&R();const U=t.events.length;let I=U,O;for(;I--;)if(t.events[I][0]==="exit"&&t.events[I][1].type==="chunkFlow"){O=t.events[I][1].end;break}E(r);let P=U;for(;P<t.events.length;)t.events[P][1].end={...O},P++;return Yn(t.events,I+1,0,t.events.slice(U)),t.events.length=P,f(_)}return d(_)}function f(_){if(r===a.length){if(!o)return b(_);if(o.currentConstruct&&o.currentConstruct.concrete)return k(_);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(ob,y,m)(_)}function y(_){return o&&R(),E(r),b(_)}function m(_){return t.parser.lazy[t.now().line]=r!==a.length,c=t.now().offset,k(_)}function b(_){return t.containerState={},e.attempt(ob,x,k)(_)}function x(_){return r++,a.push([t.currentConstruct,t.containerState]),b(_)}function k(_){if(_===null){o&&R(),E(0),e.consume(_);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:s}),C(_)}function C(_){if(_===null){A(e.exit("chunkFlow"),!0),E(0),e.consume(_);return}return Ae(_)?(e.consume(_),A(e.exit("chunkFlow")),r=0,t.interrupt=void 0,d):(e.consume(_),C)}function A(_,U){const I=t.sliceStream(_);if(U&&I.push(null),_.previous=s,s&&(s.next=_),s=_,o.defineSkip(_.start),o.write(I),t.parser.lazy[_.start.line]){let O=o.events.length;for(;O--;)if(o.events[O][1].start.offset<c&&(!o.events[O][1].end||o.events[O][1].end.offset>c))return;const P=t.events.length;let Y=P,D,T;for(;Y--;)if(t.events[Y][0]==="exit"&&t.events[Y][1].type==="chunkFlow"){if(D){T=t.events[Y][1].end;break}D=!0}for(E(r),O=P;O<t.events.length;)t.events[O][1].end={...T},O++;Yn(t.events,Y+1,0,t.events.slice(P)),t.events.length=O}}function E(_){let U=a.length;for(;U-- >_;){const I=a[U];t.containerState=I[1],I[0].exit.call(t,e)}a.length=_}function R(){o.write([null]),s=void 0,o=void 0,t.containerState._closeFlow=void 0}}function kO(e,t,a){return Qe(e,e.attempt(this.parser.constructs.document,t,a),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Cl(e){if(e===null||yt(e)||kr(e))return 1;if(Au(e))return 2}function ju(e,t,a){const r=[];let o=-1;for(;++o<e.length;){const s=e[o].resolveAll;s&&!r.includes(s)&&(t=s(t,a),r.push(s))}return t}const xh={name:"attention",resolveAll:CO,tokenize:EO};function CO(e,t){let a=-1,r,o,s,c,d,p,f,y;for(;++a<e.length;)if(e[a][0]==="enter"&&e[a][1].type==="attentionSequence"&&e[a][1]._close){for(r=a;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[a][1]).charCodeAt(0)){if((e[r][1]._close||e[a][1]._open)&&(e[a][1].end.offset-e[a][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[a][1].end.offset-e[a][1].start.offset)%3))continue;p=e[r][1].end.offset-e[r][1].start.offset>1&&e[a][1].end.offset-e[a][1].start.offset>1?2:1;const m={...e[r][1].end},b={...e[a][1].start};sb(m,-p),sb(b,p),c={type:p>1?"strongSequence":"emphasisSequence",start:m,end:{...e[r][1].end}},d={type:p>1?"strongSequence":"emphasisSequence",start:{...e[a][1].start},end:b},s={type:p>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[a][1].start}},o={type:p>1?"strong":"emphasis",start:{...c.start},end:{...d.end}},e[r][1].end={...c.start},e[a][1].start={...d.end},f=[],e[r][1].end.offset-e[r][1].start.offset&&(f=ca(f,[["enter",e[r][1],t],["exit",e[r][1],t]])),f=ca(f,[["enter",o,t],["enter",c,t],["exit",c,t],["enter",s,t]]),f=ca(f,ju(t.parser.constructs.insideSpan.null,e.slice(r+1,a),t)),f=ca(f,[["exit",s,t],["enter",d,t],["exit",d,t],["exit",o,t]]),e[a][1].end.offset-e[a][1].start.offset?(y=2,f=ca(f,[["enter",e[a][1],t],["exit",e[a][1],t]])):y=0,Yn(e,r-1,a-r+3,f),a=r+f.length-y-2;break}}for(a=-1;++a<e.length;)e[a][1].type==="attentionSequence"&&(e[a][1].type="data");return e}function EO(e,t){const a=this.parser.constructs.attentionMarkers.null,r=this.previous,o=Cl(r);let s;return c;function c(p){return s=p,e.enter("attentionSequence"),d(p)}function d(p){if(p===s)return e.consume(p),d;const f=e.exit("attentionSequence"),y=Cl(p),m=!y||y===2&&o||a.includes(p),b=!o||o===2&&y||a.includes(r);return f._open=!!(s===42?m:m&&(o||!b)),f._close=!!(s===42?b:b&&(y||!m)),t(p)}}function sb(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const AO={name:"autolink",tokenize:jO};function jO(e,t,a){let r=0;return o;function o(x){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(x){return vn(x)?(e.consume(x),c):x===64?a(x):f(x)}function c(x){return x===43||x===45||x===46||dn(x)?(r=1,d(x)):f(x)}function d(x){return x===58?(e.consume(x),r=0,p):(x===43||x===45||x===46||dn(x))&&r++<32?(e.consume(x),d):(r=0,f(x))}function p(x){return x===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.exit("autolink"),t):x===null||x===32||x===60||uu(x)?a(x):(e.consume(x),p)}function f(x){return x===64?(e.consume(x),y):gO(x)?(e.consume(x),f):a(x)}function y(x){return dn(x)?m(x):a(x)}function m(x){return x===46?(e.consume(x),r=0,y):x===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.exit("autolink"),t):b(x)}function b(x){if((x===45||dn(x))&&r++<63){const k=x===45?b:m;return e.consume(x),k}return a(x)}}const ss={partial:!0,tokenize:TO};function TO(e,t,a){return r;function r(s){return Fe(s)?Qe(e,o,"linePrefix")(s):o(s)}function o(s){return s===null||Ae(s)?t(s):a(s)}}const yS={continuation:{tokenize:NO},exit:_O,name:"blockQuote",tokenize:RO};function RO(e,t,a){const r=this;return o;function o(c){if(c===62){const d=r.containerState;return d.open||(e.enter("blockQuote",{_container:!0}),d.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(c),e.exit("blockQuoteMarker"),s}return a(c)}function s(c){return Fe(c)?(e.enter("blockQuotePrefixWhitespace"),e.consume(c),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(c))}}function NO(e,t,a){const r=this;return o;function o(c){return Fe(c)?Qe(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c):s(c)}function s(c){return e.attempt(yS,t,a)(c)}}function _O(e){e.exit("blockQuote")}const vS={name:"characterEscape",tokenize:OO};function OO(e,t,a){return r;function r(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),o}function o(s){return vO(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):a(s)}}const bS={name:"characterReference",tokenize:MO};function MO(e,t,a){const r=this;let o=0,s,c;return d;function d(m){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),p}function p(m){return m===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(m),e.exit("characterReferenceMarkerNumeric"),f):(e.enter("characterReferenceValue"),s=31,c=dn,y(m))}function f(m){return m===88||m===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(m),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,c=yO,y):(e.enter("characterReferenceValue"),s=7,c=bh,y(m))}function y(m){if(m===59&&o){const b=e.exit("characterReferenceValue");return c===dn&&!Cm(r.sliceSerialize(b))?a(m):(e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return c(m)&&o++<s?(e.consume(m),y):a(m)}}const cb={partial:!0,tokenize:LO},ub={concrete:!0,name:"codeFenced",tokenize:DO};function DO(e,t,a){const r=this,o={partial:!0,tokenize:I};let s=0,c=0,d;return p;function p(O){return f(O)}function f(O){const P=r.events[r.events.length-1];return s=P&&P[1].type==="linePrefix"?P[2].sliceSerialize(P[1],!0).length:0,d=O,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),y(O)}function y(O){return O===d?(c++,e.consume(O),y):c<3?a(O):(e.exit("codeFencedFenceSequence"),Fe(O)?Qe(e,m,"whitespace")(O):m(O))}function m(O){return O===null||Ae(O)?(e.exit("codeFencedFence"),r.interrupt?t(O):e.check(cb,C,U)(O)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),b(O))}function b(O){return O===null||Ae(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),m(O)):Fe(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Qe(e,x,"whitespace")(O)):O===96&&O===d?a(O):(e.consume(O),b)}function x(O){return O===null||Ae(O)?m(O):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),k(O))}function k(O){return O===null||Ae(O)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),m(O)):O===96&&O===d?a(O):(e.consume(O),k)}function C(O){return e.attempt(o,U,A)(O)}function A(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),E}function E(O){return s>0&&Fe(O)?Qe(e,R,"linePrefix",s+1)(O):R(O)}function R(O){return O===null||Ae(O)?e.check(cb,C,U)(O):(e.enter("codeFlowValue"),_(O))}function _(O){return O===null||Ae(O)?(e.exit("codeFlowValue"),R(O)):(e.consume(O),_)}function U(O){return e.exit("codeFenced"),t(O)}function I(O,P,Y){let D=0;return T;function T(Q){return O.enter("lineEnding"),O.consume(Q),O.exit("lineEnding"),G}function G(Q){return O.enter("codeFencedFence"),Fe(Q)?Qe(O,W,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Q):W(Q)}function W(Q){return Q===d?(O.enter("codeFencedFenceSequence"),ae(Q)):Y(Q)}function ae(Q){return Q===d?(D++,O.consume(Q),ae):D>=c?(O.exit("codeFencedFenceSequence"),Fe(Q)?Qe(O,q,"whitespace")(Q):q(Q)):Y(Q)}function q(Q){return Q===null||Ae(Q)?(O.exit("codeFencedFence"),P(Q)):Y(Q)}}}function LO(e,t,a){const r=this;return o;function o(c){return c===null?a(c):(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),s)}function s(c){return r.parser.lazy[r.now().line]?a(c):t(c)}}const Ap={name:"codeIndented",tokenize:IO},zO={partial:!0,tokenize:PO};function IO(e,t,a){const r=this;return o;function o(f){return e.enter("codeIndented"),Qe(e,s,"linePrefix",5)(f)}function s(f){const y=r.events[r.events.length-1];return y&&y[1].type==="linePrefix"&&y[2].sliceSerialize(y[1],!0).length>=4?c(f):a(f)}function c(f){return f===null?p(f):Ae(f)?e.attempt(zO,c,p)(f):(e.enter("codeFlowValue"),d(f))}function d(f){return f===null||Ae(f)?(e.exit("codeFlowValue"),c(f)):(e.consume(f),d)}function p(f){return e.exit("codeIndented"),t(f)}}function PO(e,t,a){const r=this;return o;function o(c){return r.parser.lazy[r.now().line]?a(c):Ae(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),o):Qe(e,s,"linePrefix",5)(c)}function s(c){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?t(c):Ae(c)?o(c):a(c)}}const BO={name:"codeText",previous:HO,resolve:UO,tokenize:$O};function UO(e){let t=e.length-4,a=3,r,o;if((e[a][1].type==="lineEnding"||e[a][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=a;++r<t;)if(e[r][1].type==="codeTextData"){e[a][1].type="codeTextPadding",e[t][1].type="codeTextPadding",a+=2,t-=2;break}}for(r=a-1,t++;++r<=t;)o===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(o=r):(r===t||e[r][1].type==="lineEnding")&&(e[o][1].type="codeTextData",r!==o+2&&(e[o][1].end=e[r-1][1].end,e.splice(o+2,r-o-2),t-=r-o-2,r=o+2),o=void 0);return e}function HO(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function $O(e,t,a){let r=0,o,s;return c;function c(m){return e.enter("codeText"),e.enter("codeTextSequence"),d(m)}function d(m){return m===96?(e.consume(m),r++,d):(e.exit("codeTextSequence"),p(m))}function p(m){return m===null?a(m):m===32?(e.enter("space"),e.consume(m),e.exit("space"),p):m===96?(s=e.enter("codeTextSequence"),o=0,y(m)):Ae(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),p):(e.enter("codeTextData"),f(m))}function f(m){return m===null||m===32||m===96||Ae(m)?(e.exit("codeTextData"),p(m)):(e.consume(m),f)}function y(m){return m===96?(e.consume(m),o++,y):o===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(m)):(s.type="codeTextData",f(m))}}class qO{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,a){const r=a??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,a,r){const o=a||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return r&&Do(this.left,r),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Do(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Do(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 a=this.left.splice(t,Number.POSITIVE_INFINITY);Do(this.right,a.reverse())}else{const a=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Do(this.left,a.reverse())}}}function Do(e,t){let a=0;if(t.length<1e4)e.push(...t);else for(;a<t.length;)e.push(...t.slice(a,a+1e4)),a+=1e4}function xS(e){const t={};let a=-1,r,o,s,c,d,p,f;const y=new qO(e);for(;++a<y.length;){for(;a in t;)a=t[a];if(r=y.get(a),a&&r[1].type==="chunkFlow"&&y.get(a-1)[1].type==="listItemPrefix"&&(p=r[1]._tokenizer.events,s=0,s<p.length&&p[s][1].type==="lineEndingBlank"&&(s+=2),s<p.length&&p[s][1].type==="content"))for(;++s<p.length&&p[s][1].type!=="content";)p[s][1].type==="chunkText"&&(p[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,FO(y,a)),a=t[a],f=!0);else if(r[1]._container){for(s=a,o=void 0;s--;)if(c=y.get(s),c[1].type==="lineEnding"||c[1].type==="lineEndingBlank")c[0]==="enter"&&(o&&(y.get(o)[1].type="lineEndingBlank"),c[1].type="lineEnding",o=s);else if(!(c[1].type==="linePrefix"||c[1].type==="listItemIndent"))break;o&&(r[1].end={...y.get(o)[1].start},d=y.slice(o,a),d.unshift(r),y.splice(o,a-o+1,d))}}return Yn(e,0,Number.POSITIVE_INFINITY,y.slice(0)),!f}function FO(e,t){const a=e.get(t)[1],r=e.get(t)[2];let o=t-1;const s=[];let c=a._tokenizer;c||(c=r.parser[a.contentType](a.start),a._contentTypeTextTrailing&&(c._contentTypeTextTrailing=!0));const d=c.events,p=[],f={};let y,m,b=-1,x=a,k=0,C=0;const A=[C];for(;x;){for(;e.get(++o)[1]!==x;);s.push(o),x._tokenizer||(y=r.sliceStream(x),x.next||y.push(null),m&&c.defineSkip(x.start),x._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=!0),c.write(y),x._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=void 0)),m=x,x=x.next}for(x=a;++b<d.length;)d[b][0]==="exit"&&d[b-1][0]==="enter"&&d[b][1].type===d[b-1][1].type&&d[b][1].start.line!==d[b][1].end.line&&(C=b+1,A.push(C),x._tokenizer=void 0,x.previous=void 0,x=x.next);for(c.events=[],x?(x._tokenizer=void 0,x.previous=void 0):A.pop(),b=A.length;b--;){const E=d.slice(A[b],A[b+1]),R=s.pop();p.push([R,R+E.length-1]),e.splice(R,2,E)}for(p.reverse(),b=-1;++b<p.length;)f[k+p[b][0]]=k+p[b][1],k+=p[b][1]-p[b][0]-1;return f}const GO={resolve:WO,tokenize:YO},VO={partial:!0,tokenize:KO};function WO(e){return xS(e),e}function YO(e,t){let a;return r;function r(d){return e.enter("content"),a=e.enter("chunkContent",{contentType:"content"}),o(d)}function o(d){return d===null?s(d):Ae(d)?e.check(VO,c,s)(d):(e.consume(d),o)}function s(d){return e.exit("chunkContent"),e.exit("content"),t(d)}function c(d){return e.consume(d),e.exit("chunkContent"),a.next=e.enter("chunkContent",{contentType:"content",previous:a}),a=a.next,o}}function KO(e,t,a){const r=this;return o;function o(c){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),Qe(e,s,"linePrefix")}function s(c){if(c===null||Ae(c))return a(c);const d=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?t(c):e.interrupt(r.parser.constructs.flow,a,t)(c)}}function wS(e,t,a,r,o,s,c,d,p){const f=p||Number.POSITIVE_INFINITY;let y=0;return m;function m(E){return E===60?(e.enter(r),e.enter(o),e.enter(s),e.consume(E),e.exit(s),b):E===null||E===32||E===41||uu(E)?a(E):(e.enter(r),e.enter(c),e.enter(d),e.enter("chunkString",{contentType:"string"}),C(E))}function b(E){return E===62?(e.enter(s),e.consume(E),e.exit(s),e.exit(o),e.exit(r),t):(e.enter(d),e.enter("chunkString",{contentType:"string"}),x(E))}function x(E){return E===62?(e.exit("chunkString"),e.exit(d),b(E)):E===null||E===60||Ae(E)?a(E):(e.consume(E),E===92?k:x)}function k(E){return E===60||E===62||E===92?(e.consume(E),x):x(E)}function C(E){return!y&&(E===null||E===41||yt(E))?(e.exit("chunkString"),e.exit(d),e.exit(c),e.exit(r),t(E)):y<f&&E===40?(e.consume(E),y++,C):E===41?(e.consume(E),y--,C):E===null||E===32||E===40||uu(E)?a(E):(e.consume(E),E===92?A:C)}function A(E){return E===40||E===41||E===92?(e.consume(E),C):C(E)}}function SS(e,t,a,r,o,s){const c=this;let d=0,p;return f;function f(x){return e.enter(r),e.enter(o),e.consume(x),e.exit(o),e.enter(s),y}function y(x){return d>999||x===null||x===91||x===93&&!p||x===94&&!d&&"_hiddenFootnoteSupport"in c.parser.constructs?a(x):x===93?(e.exit(s),e.enter(o),e.consume(x),e.exit(o),e.exit(r),t):Ae(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),y):(e.enter("chunkString",{contentType:"string"}),m(x))}function m(x){return x===null||x===91||x===93||Ae(x)||d++>999?(e.exit("chunkString"),y(x)):(e.consume(x),p||(p=!Fe(x)),x===92?b:m)}function b(x){return x===91||x===92||x===93?(e.consume(x),d++,m):m(x)}}function kS(e,t,a,r,o,s){let c;return d;function d(b){return b===34||b===39||b===40?(e.enter(r),e.enter(o),e.consume(b),e.exit(o),c=b===40?41:b,p):a(b)}function p(b){return b===c?(e.enter(o),e.consume(b),e.exit(o),e.exit(r),t):(e.enter(s),f(b))}function f(b){return b===c?(e.exit(s),p(c)):b===null?a(b):Ae(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),Qe(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),y(b))}function y(b){return b===c||b===null||Ae(b)?(e.exit("chunkString"),f(b)):(e.consume(b),b===92?m:y)}function m(b){return b===c||b===92?(e.consume(b),y):y(b)}}function Fo(e,t){let a;return r;function r(o){return Ae(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a=!0,r):Fe(o)?Qe(e,r,a?"linePrefix":"lineSuffix")(o):t(o)}}const QO={name:"definition",tokenize:ZO},XO={partial:!0,tokenize:JO};function ZO(e,t,a){const r=this;let o;return s;function s(x){return e.enter("definition"),c(x)}function c(x){return SS.call(r,e,d,a,"definitionLabel","definitionLabelMarker","definitionLabelString")(x)}function d(x){return o=ba(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),p):a(x)}function p(x){return yt(x)?Fo(e,f)(x):f(x)}function f(x){return wS(e,y,a,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(x)}function y(x){return e.attempt(XO,m,m)(x)}function m(x){return Fe(x)?Qe(e,b,"whitespace")(x):b(x)}function b(x){return x===null||Ae(x)?(e.exit("definition"),r.parser.defined.push(o),t(x)):a(x)}}function JO(e,t,a){return r;function r(d){return yt(d)?Fo(e,o)(d):a(d)}function o(d){return kS(e,s,a,"definitionTitle","definitionTitleMarker","definitionTitleString")(d)}function s(d){return Fe(d)?Qe(e,c,"whitespace")(d):c(d)}function c(d){return d===null||Ae(d)?t(d):a(d)}}const eM={name:"hardBreakEscape",tokenize:tM};function tM(e,t,a){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),o}function o(s){return Ae(s)?(e.exit("hardBreakEscape"),t(s)):a(s)}}const nM={name:"headingAtx",resolve:aM,tokenize:iM};function aM(e,t){let a=e.length-2,r=3,o,s;return e[r][1].type==="whitespace"&&(r+=2),a-2>r&&e[a][1].type==="whitespace"&&(a-=2),e[a][1].type==="atxHeadingSequence"&&(r===a-1||a-4>r&&e[a-2][1].type==="whitespace")&&(a-=r+1===a?2:4),a>r&&(o={type:"atxHeadingText",start:e[r][1].start,end:e[a][1].end},s={type:"chunkText",start:e[r][1].start,end:e[a][1].end,contentType:"text"},Yn(e,r,a-r+1,[["enter",o,t],["enter",s,t],["exit",s,t],["exit",o,t]])),e}function iM(e,t,a){let r=0;return o;function o(y){return e.enter("atxHeading"),s(y)}function s(y){return e.enter("atxHeadingSequence"),c(y)}function c(y){return y===35&&r++<6?(e.consume(y),c):y===null||yt(y)?(e.exit("atxHeadingSequence"),d(y)):a(y)}function d(y){return y===35?(e.enter("atxHeadingSequence"),p(y)):y===null||Ae(y)?(e.exit("atxHeading"),t(y)):Fe(y)?Qe(e,d,"whitespace")(y):(e.enter("atxHeadingText"),f(y))}function p(y){return y===35?(e.consume(y),p):(e.exit("atxHeadingSequence"),d(y))}function f(y){return y===null||y===35||yt(y)?(e.exit("atxHeadingText"),d(y)):(e.consume(y),f)}}const rM=["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"],db=["pre","script","style","textarea"],lM={concrete:!0,name:"htmlFlow",resolveTo:cM,tokenize:uM},oM={partial:!0,tokenize:fM},sM={partial:!0,tokenize:dM};function cM(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 uM(e,t,a){const r=this;let o,s,c,d,p;return f;function f(N){return y(N)}function y(N){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(N),m}function m(N){return N===33?(e.consume(N),b):N===47?(e.consume(N),s=!0,C):N===63?(e.consume(N),o=3,r.interrupt?t:M):vn(N)?(e.consume(N),c=String.fromCharCode(N),A):a(N)}function b(N){return N===45?(e.consume(N),o=2,x):N===91?(e.consume(N),o=5,d=0,k):vn(N)?(e.consume(N),o=4,r.interrupt?t:M):a(N)}function x(N){return N===45?(e.consume(N),r.interrupt?t:M):a(N)}function k(N){const ue="CDATA[";return N===ue.charCodeAt(d++)?(e.consume(N),d===ue.length?r.interrupt?t:W:k):a(N)}function C(N){return vn(N)?(e.consume(N),c=String.fromCharCode(N),A):a(N)}function A(N){if(N===null||N===47||N===62||yt(N)){const ue=N===47,ge=c.toLowerCase();return!ue&&!s&&db.includes(ge)?(o=1,r.interrupt?t(N):W(N)):rM.includes(c.toLowerCase())?(o=6,ue?(e.consume(N),E):r.interrupt?t(N):W(N)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?a(N):s?R(N):_(N))}return N===45||dn(N)?(e.consume(N),c+=String.fromCharCode(N),A):a(N)}function E(N){return N===62?(e.consume(N),r.interrupt?t:W):a(N)}function R(N){return Fe(N)?(e.consume(N),R):T(N)}function _(N){return N===47?(e.consume(N),T):N===58||N===95||vn(N)?(e.consume(N),U):Fe(N)?(e.consume(N),_):T(N)}function U(N){return N===45||N===46||N===58||N===95||dn(N)?(e.consume(N),U):I(N)}function I(N){return N===61?(e.consume(N),O):Fe(N)?(e.consume(N),I):_(N)}function O(N){return N===null||N===60||N===61||N===62||N===96?a(N):N===34||N===39?(e.consume(N),p=N,P):Fe(N)?(e.consume(N),O):Y(N)}function P(N){return N===p?(e.consume(N),p=null,D):N===null||Ae(N)?a(N):(e.consume(N),P)}function Y(N){return N===null||N===34||N===39||N===47||N===60||N===61||N===62||N===96||yt(N)?I(N):(e.consume(N),Y)}function D(N){return N===47||N===62||Fe(N)?_(N):a(N)}function T(N){return N===62?(e.consume(N),G):a(N)}function G(N){return N===null||Ae(N)?W(N):Fe(N)?(e.consume(N),G):a(N)}function W(N){return N===45&&o===2?(e.consume(N),F):N===60&&o===1?(e.consume(N),ee):N===62&&o===4?(e.consume(N),L):N===63&&o===3?(e.consume(N),M):N===93&&o===5?(e.consume(N),X):Ae(N)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(oM,K,ae)(N)):N===null||Ae(N)?(e.exit("htmlFlowData"),ae(N)):(e.consume(N),W)}function ae(N){return e.check(sM,q,K)(N)}function q(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),Q}function Q(N){return N===null||Ae(N)?ae(N):(e.enter("htmlFlowData"),W(N))}function F(N){return N===45?(e.consume(N),M):W(N)}function ee(N){return N===47?(e.consume(N),c="",ie):W(N)}function ie(N){if(N===62){const ue=c.toLowerCase();return db.includes(ue)?(e.consume(N),L):W(N)}return vn(N)&&c.length<8?(e.consume(N),c+=String.fromCharCode(N),ie):W(N)}function X(N){return N===93?(e.consume(N),M):W(N)}function M(N){return N===62?(e.consume(N),L):N===45&&o===2?(e.consume(N),M):W(N)}function L(N){return N===null||Ae(N)?(e.exit("htmlFlowData"),K(N)):(e.consume(N),L)}function K(N){return e.exit("htmlFlow"),t(N)}}function dM(e,t,a){const r=this;return o;function o(c){return Ae(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),s):a(c)}function s(c){return r.parser.lazy[r.now().line]?a(c):t(c)}}function fM(e,t,a){return r;function r(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(ss,t,a)}}const pM={name:"htmlText",tokenize:hM};function hM(e,t,a){const r=this;let o,s,c;return d;function d(M){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(M),p}function p(M){return M===33?(e.consume(M),f):M===47?(e.consume(M),I):M===63?(e.consume(M),_):vn(M)?(e.consume(M),Y):a(M)}function f(M){return M===45?(e.consume(M),y):M===91?(e.consume(M),s=0,k):vn(M)?(e.consume(M),R):a(M)}function y(M){return M===45?(e.consume(M),x):a(M)}function m(M){return M===null?a(M):M===45?(e.consume(M),b):Ae(M)?(c=m,ee(M)):(e.consume(M),m)}function b(M){return M===45?(e.consume(M),x):m(M)}function x(M){return M===62?F(M):M===45?b(M):m(M)}function k(M){const L="CDATA[";return M===L.charCodeAt(s++)?(e.consume(M),s===L.length?C:k):a(M)}function C(M){return M===null?a(M):M===93?(e.consume(M),A):Ae(M)?(c=C,ee(M)):(e.consume(M),C)}function A(M){return M===93?(e.consume(M),E):C(M)}function E(M){return M===62?F(M):M===93?(e.consume(M),E):C(M)}function R(M){return M===null||M===62?F(M):Ae(M)?(c=R,ee(M)):(e.consume(M),R)}function _(M){return M===null?a(M):M===63?(e.consume(M),U):Ae(M)?(c=_,ee(M)):(e.consume(M),_)}function U(M){return M===62?F(M):_(M)}function I(M){return vn(M)?(e.consume(M),O):a(M)}function O(M){return M===45||dn(M)?(e.consume(M),O):P(M)}function P(M){return Ae(M)?(c=P,ee(M)):Fe(M)?(e.consume(M),P):F(M)}function Y(M){return M===45||dn(M)?(e.consume(M),Y):M===47||M===62||yt(M)?D(M):a(M)}function D(M){return M===47?(e.consume(M),F):M===58||M===95||vn(M)?(e.consume(M),T):Ae(M)?(c=D,ee(M)):Fe(M)?(e.consume(M),D):F(M)}function T(M){return M===45||M===46||M===58||M===95||dn(M)?(e.consume(M),T):G(M)}function G(M){return M===61?(e.consume(M),W):Ae(M)?(c=G,ee(M)):Fe(M)?(e.consume(M),G):D(M)}function W(M){return M===null||M===60||M===61||M===62||M===96?a(M):M===34||M===39?(e.consume(M),o=M,ae):Ae(M)?(c=W,ee(M)):Fe(M)?(e.consume(M),W):(e.consume(M),q)}function ae(M){return M===o?(e.consume(M),o=void 0,Q):M===null?a(M):Ae(M)?(c=ae,ee(M)):(e.consume(M),ae)}function q(M){return M===null||M===34||M===39||M===60||M===61||M===96?a(M):M===47||M===62||yt(M)?D(M):(e.consume(M),q)}function Q(M){return M===47||M===62||yt(M)?D(M):a(M)}function F(M){return M===62?(e.consume(M),e.exit("htmlTextData"),e.exit("htmlText"),t):a(M)}function ee(M){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),ie}function ie(M){return Fe(M)?Qe(e,X,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):X(M)}function X(M){return e.enter("htmlTextData"),c(M)}}const Em={name:"labelEnd",resolveAll:vM,resolveTo:bM,tokenize:xM},mM={tokenize:wM},gM={tokenize:SM},yM={tokenize:kM};function vM(e){let t=-1;const a=[];for(;++t<e.length;){const r=e[t][1];if(a.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const o=r.type==="labelImage"?4:2;r.type="data",t+=o}}return e.length!==a.length&&Yn(e,0,e.length,a),e}function bM(e,t){let a=e.length,r=0,o,s,c,d;for(;a--;)if(o=e[a][1],s){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[a][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(c){if(e[a][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(s=a,o.type!=="labelLink")){r=2;break}}else o.type==="labelEnd"&&(c=a);const p={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},f={type:"label",start:{...e[s][1].start},end:{...e[c][1].end}},y={type:"labelText",start:{...e[s+r+2][1].end},end:{...e[c-2][1].start}};return d=[["enter",p,t],["enter",f,t]],d=ca(d,e.slice(s+1,s+r+3)),d=ca(d,[["enter",y,t]]),d=ca(d,ju(t.parser.constructs.insideSpan.null,e.slice(s+r+4,c-3),t)),d=ca(d,[["exit",y,t],e[c-2],e[c-1],["exit",f,t]]),d=ca(d,e.slice(c+1)),d=ca(d,[["exit",p,t]]),Yn(e,s,e.length,d),e}function xM(e,t,a){const r=this;let o=r.events.length,s,c;for(;o--;)if((r.events[o][1].type==="labelImage"||r.events[o][1].type==="labelLink")&&!r.events[o][1]._balanced){s=r.events[o][1];break}return d;function d(b){return s?s._inactive?m(b):(c=r.parser.defined.includes(ba(r.sliceSerialize({start:s.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(b),e.exit("labelMarker"),e.exit("labelEnd"),p):a(b)}function p(b){return b===40?e.attempt(mM,y,c?y:m)(b):b===91?e.attempt(gM,y,c?f:m)(b):c?y(b):m(b)}function f(b){return e.attempt(yM,y,m)(b)}function y(b){return t(b)}function m(b){return s._balanced=!0,a(b)}}function wM(e,t,a){return r;function r(m){return e.enter("resource"),e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),o}function o(m){return yt(m)?Fo(e,s)(m):s(m)}function s(m){return m===41?y(m):wS(e,c,d,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function c(m){return yt(m)?Fo(e,p)(m):y(m)}function d(m){return a(m)}function p(m){return m===34||m===39||m===40?kS(e,f,a,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):y(m)}function f(m){return yt(m)?Fo(e,y)(m):y(m)}function y(m){return m===41?(e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),e.exit("resource"),t):a(m)}}function SM(e,t,a){const r=this;return o;function o(d){return SS.call(r,e,s,c,"reference","referenceMarker","referenceString")(d)}function s(d){return r.parser.defined.includes(ba(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(d):a(d)}function c(d){return a(d)}}function kM(e,t,a){return r;function r(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),o}function o(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):a(s)}}const CM={name:"labelStartImage",resolveAll:Em.resolveAll,tokenize:EM};function EM(e,t,a){const r=this;return o;function o(d){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(d),e.exit("labelImageMarker"),s}function s(d){return d===91?(e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelImage"),c):a(d)}function c(d){return d===94&&"_hiddenFootnoteSupport"in r.parser.constructs?a(d):t(d)}}const AM={name:"labelStartLink",resolveAll:Em.resolveAll,tokenize:jM};function jM(e,t,a){const r=this;return o;function o(c){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelLink"),s}function s(c){return c===94&&"_hiddenFootnoteSupport"in r.parser.constructs?a(c):t(c)}}const jp={name:"lineEnding",tokenize:TM};function TM(e,t){return a;function a(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Qe(e,t,"linePrefix")}}const Vc={name:"thematicBreak",tokenize:RM};function RM(e,t,a){let r=0,o;return s;function s(f){return e.enter("thematicBreak"),c(f)}function c(f){return o=f,d(f)}function d(f){return f===o?(e.enter("thematicBreakSequence"),p(f)):r>=3&&(f===null||Ae(f))?(e.exit("thematicBreak"),t(f)):a(f)}function p(f){return f===o?(e.consume(f),r++,p):(e.exit("thematicBreakSequence"),Fe(f)?Qe(e,d,"whitespace")(f):d(f))}}const Nn={continuation:{tokenize:MM},exit:LM,name:"list",tokenize:OM},NM={partial:!0,tokenize:zM},_M={partial:!0,tokenize:DM};function OM(e,t,a){const r=this,o=r.events[r.events.length-1];let s=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,c=0;return d;function d(x){const k=r.containerState.type||(x===42||x===43||x===45?"listUnordered":"listOrdered");if(k==="listUnordered"?!r.containerState.marker||x===r.containerState.marker:bh(x)){if(r.containerState.type||(r.containerState.type=k,e.enter(k,{_container:!0})),k==="listUnordered")return e.enter("listItemPrefix"),x===42||x===45?e.check(Vc,a,f)(x):f(x);if(!r.interrupt||x===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),p(x)}return a(x)}function p(x){return bh(x)&&++c<10?(e.consume(x),p):(!r.interrupt||c<2)&&(r.containerState.marker?x===r.containerState.marker:x===41||x===46)?(e.exit("listItemValue"),f(x)):a(x)}function f(x){return e.enter("listItemMarker"),e.consume(x),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||x,e.check(ss,r.interrupt?a:y,e.attempt(NM,b,m))}function y(x){return r.containerState.initialBlankLine=!0,s++,b(x)}function m(x){return Fe(x)?(e.enter("listItemPrefixWhitespace"),e.consume(x),e.exit("listItemPrefixWhitespace"),b):a(x)}function b(x){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(x)}}function MM(e,t,a){const r=this;return r.containerState._closeFlow=void 0,e.check(ss,o,s);function o(d){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Qe(e,t,"listItemIndent",r.containerState.size+1)(d)}function s(d){return r.containerState.furtherBlankLines||!Fe(d)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,c(d)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(_M,t,c)(d))}function c(d){return r.containerState._closeFlow=!0,r.interrupt=void 0,Qe(e,e.attempt(Nn,t,a),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d)}}function DM(e,t,a){const r=this;return Qe(e,o,"listItemIndent",r.containerState.size+1);function o(s){const c=r.events[r.events.length-1];return c&&c[1].type==="listItemIndent"&&c[2].sliceSerialize(c[1],!0).length===r.containerState.size?t(s):a(s)}}function LM(e){e.exit(this.containerState.type)}function zM(e,t,a){const r=this;return Qe(e,o,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(s){const c=r.events[r.events.length-1];return!Fe(s)&&c&&c[1].type==="listItemPrefixWhitespace"?t(s):a(s)}}const fb={name:"setextUnderline",resolveTo:IM,tokenize:PM};function IM(e,t){let a=e.length,r,o,s;for(;a--;)if(e[a][0]==="enter"){if(e[a][1].type==="content"){r=a;break}e[a][1].type==="paragraph"&&(o=a)}else e[a][1].type==="content"&&e.splice(a,1),!s&&e[a][1].type==="definition"&&(s=a);const c={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",s?(e.splice(o,0,["enter",c,t]),e.splice(s+1,0,["exit",e[r][1],t]),e[r][1].end={...e[s][1].end}):e[r][1]=c,e.push(["exit",c,t]),e}function PM(e,t,a){const r=this;let o;return s;function s(f){let y=r.events.length,m;for(;y--;)if(r.events[y][1].type!=="lineEnding"&&r.events[y][1].type!=="linePrefix"&&r.events[y][1].type!=="content"){m=r.events[y][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||m)?(e.enter("setextHeadingLine"),o=f,c(f)):a(f)}function c(f){return e.enter("setextHeadingLineSequence"),d(f)}function d(f){return f===o?(e.consume(f),d):(e.exit("setextHeadingLineSequence"),Fe(f)?Qe(e,p,"lineSuffix")(f):p(f))}function p(f){return f===null||Ae(f)?(e.exit("setextHeadingLine"),t(f)):a(f)}}const BM={tokenize:UM};function UM(e){const t=this,a=e.attempt(ss,r,e.attempt(this.parser.constructs.flowInitial,o,Qe(e,e.attempt(this.parser.constructs.flow,o,e.attempt(GO,o)),"linePrefix")));return a;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,a}function o(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,a}}const HM={resolveAll:ES()},$M=CS("string"),qM=CS("text");function CS(e){return{resolveAll:ES(e==="text"?FM:void 0),tokenize:t};function t(a){const r=this,o=this.parser.constructs[e],s=a.attempt(o,c,d);return c;function c(y){return f(y)?s(y):d(y)}function d(y){if(y===null){a.consume(y);return}return a.enter("data"),a.consume(y),p}function p(y){return f(y)?(a.exit("data"),s(y)):(a.consume(y),p)}function f(y){if(y===null)return!0;const m=o[y];let b=-1;if(m)for(;++b<m.length;){const x=m[b];if(!x.previous||x.previous.call(r,r.previous))return!0}return!1}}}function ES(e){return t;function t(a,r){let o=-1,s;for(;++o<=a.length;)s===void 0?a[o]&&a[o][1].type==="data"&&(s=o,o++):(!a[o]||a[o][1].type!=="data")&&(o!==s+2&&(a[s][1].end=a[o-1][1].end,a.splice(s+2,o-s-2),o=s+2),s=void 0);return e?e(a,r):a}}function FM(e,t){let a=0;for(;++a<=e.length;)if((a===e.length||e[a][1].type==="lineEnding")&&e[a-1][1].type==="data"){const r=e[a-1][1],o=t.sliceStream(r);let s=o.length,c=-1,d=0,p;for(;s--;){const f=o[s];if(typeof f=="string"){for(c=f.length;f.charCodeAt(c-1)===32;)d++,c--;if(c)break;c=-1}else if(f===-2)p=!0,d++;else if(f!==-1){s++;break}}if(t._contentTypeTextTrailing&&a===e.length&&(d=0),d){const f={type:a===e.length||p||d<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?c:r.start._bufferIndex+c,_index:r.start._index+s,line:r.end.line,column:r.end.column-d,offset:r.end.offset-d},end:{...r.end}};r.end={...f.start},r.start.offset===r.end.offset?Object.assign(r,f):(e.splice(a,0,["enter",f,t],["exit",f,t]),a+=2)}a++}return e}const GM={42:Nn,43:Nn,45:Nn,48:Nn,49:Nn,50:Nn,51:Nn,52:Nn,53:Nn,54:Nn,55:Nn,56:Nn,57:Nn,62:yS},VM={91:QO},WM={[-2]:Ap,[-1]:Ap,32:Ap},YM={35:nM,42:Vc,45:[fb,Vc],60:lM,61:fb,95:Vc,96:ub,126:ub},KM={38:bS,92:vS},QM={[-5]:jp,[-4]:jp,[-3]:jp,33:CM,38:bS,42:xh,60:[AO,pM],91:AM,92:[eM,vS],93:Em,95:xh,96:BO},XM={null:[xh,HM]},ZM={null:[42,95]},JM={null:[]},eD=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:ZM,contentInitial:VM,disable:JM,document:GM,flow:YM,flowInitial:WM,insideSpan:XM,string:KM,text:QM},Symbol.toStringTag,{value:"Module"}));function tD(e,t,a){let r={_bufferIndex:-1,_index:0,line:a&&a.line||1,column:a&&a.column||1,offset:a&&a.offset||0};const o={},s=[];let c=[],d=[];const p={attempt:P(I),check:P(O),consume:R,enter:_,exit:U,interrupt:P(O,{interrupt:!0})},f={code:null,containerState:{},defineSkip:C,events:[],now:k,parser:e,previous:null,sliceSerialize:b,sliceStream:x,write:m};let y=t.tokenize.call(f,p);return t.resolveAll&&s.push(t),f;function m(G){return c=ca(c,G),A(),c[c.length-1]!==null?[]:(Y(t,0),f.events=ju(s,f.events,f),f.events)}function b(G,W){return aD(x(G),W)}function x(G){return nD(c,G)}function k(){const{_bufferIndex:G,_index:W,line:ae,column:q,offset:Q}=r;return{_bufferIndex:G,_index:W,line:ae,column:q,offset:Q}}function C(G){o[G.line]=G.column,T()}function A(){let G;for(;r._index<c.length;){const W=c[r._index];if(typeof W=="string")for(G=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===G&&r._bufferIndex<W.length;)E(W.charCodeAt(r._bufferIndex));else E(W)}}function E(G){y=y(G)}function R(G){Ae(G)?(r.line++,r.column=1,r.offset+=G===-3?2:1,T()):G!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===c[r._index].length&&(r._bufferIndex=-1,r._index++)),f.previous=G}function _(G,W){const ae=W||{};return ae.type=G,ae.start=k(),f.events.push(["enter",ae,f]),d.push(ae),ae}function U(G){const W=d.pop();return W.end=k(),f.events.push(["exit",W,f]),W}function I(G,W){Y(G,W.from)}function O(G,W){W.restore()}function P(G,W){return ae;function ae(q,Q,F){let ee,ie,X,M;return Array.isArray(q)?K(q):"tokenize"in q?K([q]):L(q);function L(me){return Ee;function Ee(Ue){const Re=Ue!==null&&me[Ue],tt=Ue!==null&&me.null,It=[...Array.isArray(Re)?Re:Re?[Re]:[],...Array.isArray(tt)?tt:tt?[tt]:[]];return K(It)(Ue)}}function K(me){return ee=me,ie=0,me.length===0?F:N(me[ie])}function N(me){return Ee;function Ee(Ue){return M=D(),X=me,me.partial||(f.currentConstruct=me),me.name&&f.parser.constructs.disable.null.includes(me.name)?ge():me.tokenize.call(W?Object.assign(Object.create(f),W):f,p,ue,ge)(Ue)}}function ue(me){return G(X,M),Q}function ge(me){return M.restore(),++ie<ee.length?N(ee[ie]):F}}}function Y(G,W){G.resolveAll&&!s.includes(G)&&s.push(G),G.resolve&&Yn(f.events,W,f.events.length-W,G.resolve(f.events.slice(W),f)),G.resolveTo&&(f.events=G.resolveTo(f.events,f))}function D(){const G=k(),W=f.previous,ae=f.currentConstruct,q=f.events.length,Q=Array.from(d);return{from:q,restore:F};function F(){r=G,f.previous=W,f.currentConstruct=ae,f.events.length=q,d=Q,T()}}function T(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}function nD(e,t){const a=t.start._index,r=t.start._bufferIndex,o=t.end._index,s=t.end._bufferIndex;let c;if(a===o)c=[e[a].slice(r,s)];else{if(c=e.slice(a,o),r>-1){const d=c[0];typeof d=="string"?c[0]=d.slice(r):c.shift()}s>0&&c.push(e[o].slice(0,s))}return c}function aD(e,t){let a=-1;const r=[];let o;for(;++a<e.length;){const s=e[a];let c;if(typeof s=="string")c=s;else switch(s){case-5:{c="\r";break}case-4:{c=`
1108
+ `;break}case-3:{c=`\r
1109
+ `;break}case-2:{c=t?" ":" ";break}case-1:{if(!t&&o)continue;c=" ";break}default:c=String.fromCharCode(s)}o=s===-2,r.push(c)}return r.join("")}function iD(e){const r={constructs:mS([eD,...(e||{}).extensions||[]]),content:o(bO),defined:[],document:o(wO),flow:o(BM),lazy:{},string:o($M),text:o(qM)};return r;function o(s){return c;function c(d){return tD(r,s,d)}}}function rD(e){for(;!xS(e););return e}const pb=/[\0\t\n\r]/g;function lD(){let e=1,t="",a=!0,r;return o;function o(s,c,d){const p=[];let f,y,m,b,x;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(c||void 0).decode(s)),m=0,t="",a&&(s.charCodeAt(0)===65279&&m++,a=void 0);m<s.length;){if(pb.lastIndex=m,f=pb.exec(s),b=f&&f.index!==void 0?f.index:s.length,x=s.charCodeAt(b),!f){t=s.slice(m);break}if(x===10&&m===b&&r)p.push(-3),r=void 0;else switch(r&&(p.push(-5),r=void 0),m<b&&(p.push(s.slice(m,b)),e+=b-m),x){case 0:{p.push(65533),e++;break}case 9:{for(y=Math.ceil(e/4)*4,p.push(-2);e++<y;)p.push(-1);break}case 10:{p.push(-4),e=1;break}default:r=!0,e=1}m=b+1}return d&&(r&&p.push(-5),t&&p.push(t),p.push(null)),p}}const oD=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function sD(e){return e.replace(oD,cD)}function cD(e,t,a){if(t)return t;if(a.charCodeAt(0)===35){const o=a.charCodeAt(1),s=o===120||o===88;return gS(a.slice(s?2:1),s?16:10)}return Cm(a)||e}const AS={}.hasOwnProperty;function uD(e,t,a){return t&&typeof t=="object"&&(a=t,t=void 0),dD(a)(rD(iD(a).document().write(lD()(e,t,!0))))}function dD(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(Mt),autolinkProtocol:D,autolinkEmail:D,atxHeading:s(an),blockQuote:s(tt),characterEscape:D,characterReference:D,codeFenced:s(It),codeFencedFenceInfo:c,codeFencedFenceMeta:c,codeIndented:s(It,c),codeText:s(xt,c),codeTextData:D,data:D,codeFlowValue:D,definition:s(wt),definitionDestinationString:c,definitionLabelString:c,definitionTitleString:c,emphasis:s(vt),hardBreakEscape:s(Be),hardBreakTrailing:s(Be),htmlFlow:s(ht,c),htmlFlowData:D,htmlText:s(ht,c),htmlTextData:D,image:s(Pt),label:c,link:s(Mt),listItem:s(Bt),listItemValue:b,listOrdered:s(he,m),listUnordered:s(he),paragraph:s(Qn),reference:N,referenceString:c,resourceDestinationString:c,resourceTitleString:c,setextHeading:s(an),strong:s(wn),thematicBreak:s(fe)},exit:{atxHeading:p(),atxHeadingSequence:I,autolink:p(),autolinkEmail:Re,autolinkProtocol:Ue,blockQuote:p(),characterEscapeValue:T,characterReferenceMarkerHexadecimal:ge,characterReferenceMarkerNumeric:ge,characterReferenceValue:me,characterReference:Ee,codeFenced:p(A),codeFencedFence:C,codeFencedFenceInfo:x,codeFencedFenceMeta:k,codeFlowValue:T,codeIndented:p(E),codeText:p(Q),codeTextData:T,data:T,definition:p(),definitionDestinationString:U,definitionLabelString:R,definitionTitleString:_,emphasis:p(),hardBreakEscape:p(W),hardBreakTrailing:p(W),htmlFlow:p(ae),htmlFlowData:T,htmlText:p(q),htmlTextData:T,image:p(ee),label:X,labelText:ie,lineEnding:G,link:p(F),listItem:p(),listOrdered:p(),listUnordered:p(),paragraph:p(),referenceString:ue,resourceDestinationString:M,resourceTitleString:L,resource:K,setextHeading:p(Y),setextHeadingLineSequence:P,setextHeadingText:O,strong:p(),thematicBreak:p()}};jS(t,(e||{}).mdastExtensions||[]);const a={};return r;function r(H){let le={type:"root",children:[]};const pe={stack:[le],tokenStack:[],config:t,enter:d,exit:f,buffer:c,resume:y,data:a},ye=[];let B=-1;for(;++B<H.length;)if(H[B][1].type==="listOrdered"||H[B][1].type==="listUnordered")if(H[B][0]==="enter")ye.push(B);else{const Te=ye.pop();B=o(H,Te,B)}for(B=-1;++B<H.length;){const Te=t[H[B][0]];AS.call(Te,H[B][1].type)&&Te[H[B][1].type].call(Object.assign({sliceSerialize:H[B][2].sliceSerialize},pe),H[B][1])}if(pe.tokenStack.length>0){const Te=pe.tokenStack[pe.tokenStack.length-1];(Te[1]||hb).call(pe,void 0,Te[0])}for(le.position={start:Hi(H.length>0?H[0][1].start:{line:1,column:1,offset:0}),end:Hi(H.length>0?H[H.length-2][1].end:{line:1,column:1,offset:0})},B=-1;++B<t.transforms.length;)le=t.transforms[B](le)||le;return le}function o(H,le,pe){let ye=le-1,B=-1,Te=!1,it,Pe,Xe,We;for(;++ye<=pe;){const Se=H[ye];switch(Se[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Se[0]==="enter"?B++:B--,We=void 0;break}case"lineEndingBlank":{Se[0]==="enter"&&(it&&!We&&!B&&!Xe&&(Xe=ye),We=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:We=void 0}if(!B&&Se[0]==="enter"&&Se[1].type==="listItemPrefix"||B===-1&&Se[0]==="exit"&&(Se[1].type==="listUnordered"||Se[1].type==="listOrdered")){if(it){let Zt=ye;for(Pe=void 0;Zt--;){const lt=H[Zt];if(lt[1].type==="lineEnding"||lt[1].type==="lineEndingBlank"){if(lt[0]==="exit")continue;Pe&&(H[Pe][1].type="lineEndingBlank",Te=!0),lt[1].type="lineEnding",Pe=Zt}else if(!(lt[1].type==="linePrefix"||lt[1].type==="blockQuotePrefix"||lt[1].type==="blockQuotePrefixWhitespace"||lt[1].type==="blockQuoteMarker"||lt[1].type==="listItemIndent"))break}Xe&&(!Pe||Xe<Pe)&&(it._spread=!0),it.end=Object.assign({},Pe?H[Pe][1].start:Se[1].end),H.splice(Pe||ye,0,["exit",it,Se[2]]),ye++,pe++}if(Se[1].type==="listItemPrefix"){const Zt={type:"listItem",_spread:!1,start:Object.assign({},Se[1].start),end:void 0};it=Zt,H.splice(ye,0,["enter",Zt,Se[2]]),ye++,pe++,Xe=void 0,We=!0}}}return H[le][1]._spread=Te,pe}function s(H,le){return pe;function pe(ye){d.call(this,H(ye),ye),le&&le.call(this,ye)}}function c(){this.stack.push({type:"fragment",children:[]})}function d(H,le,pe){this.stack[this.stack.length-1].children.push(H),this.stack.push(H),this.tokenStack.push([le,pe||void 0]),H.position={start:Hi(le.start),end:void 0}}function p(H){return le;function le(pe){H&&H.call(this,pe),f.call(this,pe)}}function f(H,le){const pe=this.stack.pop(),ye=this.tokenStack.pop();if(ye)ye[0].type!==H.type&&(le?le.call(this,H,ye[0]):(ye[1]||hb).call(this,H,ye[0]));else throw new Error("Cannot close `"+H.type+"` ("+qo({start:H.start,end:H.end})+"): it’s not open");pe.position.end=Hi(H.end)}function y(){return km(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function b(H){if(this.data.expectingFirstListItemValue){const le=this.stack[this.stack.length-2];le.start=Number.parseInt(this.sliceSerialize(H),10),this.data.expectingFirstListItemValue=void 0}}function x(){const H=this.resume(),le=this.stack[this.stack.length-1];le.lang=H}function k(){const H=this.resume(),le=this.stack[this.stack.length-1];le.meta=H}function C(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function A(){const H=this.resume(),le=this.stack[this.stack.length-1];le.value=H.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function E(){const H=this.resume(),le=this.stack[this.stack.length-1];le.value=H.replace(/(\r?\n|\r)$/g,"")}function R(H){const le=this.resume(),pe=this.stack[this.stack.length-1];pe.label=le,pe.identifier=ba(this.sliceSerialize(H)).toLowerCase()}function _(){const H=this.resume(),le=this.stack[this.stack.length-1];le.title=H}function U(){const H=this.resume(),le=this.stack[this.stack.length-1];le.url=H}function I(H){const le=this.stack[this.stack.length-1];if(!le.depth){const pe=this.sliceSerialize(H).length;le.depth=pe}}function O(){this.data.setextHeadingSlurpLineEnding=!0}function P(H){const le=this.stack[this.stack.length-1];le.depth=this.sliceSerialize(H).codePointAt(0)===61?1:2}function Y(){this.data.setextHeadingSlurpLineEnding=void 0}function D(H){const pe=this.stack[this.stack.length-1].children;let ye=pe[pe.length-1];(!ye||ye.type!=="text")&&(ye=rt(),ye.position={start:Hi(H.start),end:void 0},pe.push(ye)),this.stack.push(ye)}function T(H){const le=this.stack.pop();le.value+=this.sliceSerialize(H),le.position.end=Hi(H.end)}function G(H){const le=this.stack[this.stack.length-1];if(this.data.atHardBreak){const pe=le.children[le.children.length-1];pe.position.end=Hi(H.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(le.type)&&(D.call(this,H),T.call(this,H))}function W(){this.data.atHardBreak=!0}function ae(){const H=this.resume(),le=this.stack[this.stack.length-1];le.value=H}function q(){const H=this.resume(),le=this.stack[this.stack.length-1];le.value=H}function Q(){const H=this.resume(),le=this.stack[this.stack.length-1];le.value=H}function F(){const H=this.stack[this.stack.length-1];if(this.data.inReference){const le=this.data.referenceType||"shortcut";H.type+="Reference",H.referenceType=le,delete H.url,delete H.title}else delete H.identifier,delete H.label;this.data.referenceType=void 0}function ee(){const H=this.stack[this.stack.length-1];if(this.data.inReference){const le=this.data.referenceType||"shortcut";H.type+="Reference",H.referenceType=le,delete H.url,delete H.title}else delete H.identifier,delete H.label;this.data.referenceType=void 0}function ie(H){const le=this.sliceSerialize(H),pe=this.stack[this.stack.length-2];pe.label=sD(le),pe.identifier=ba(le).toLowerCase()}function X(){const H=this.stack[this.stack.length-1],le=this.resume(),pe=this.stack[this.stack.length-1];if(this.data.inReference=!0,pe.type==="link"){const ye=H.children;pe.children=ye}else pe.alt=le}function M(){const H=this.resume(),le=this.stack[this.stack.length-1];le.url=H}function L(){const H=this.resume(),le=this.stack[this.stack.length-1];le.title=H}function K(){this.data.inReference=void 0}function N(){this.data.referenceType="collapsed"}function ue(H){const le=this.resume(),pe=this.stack[this.stack.length-1];pe.label=le,pe.identifier=ba(this.sliceSerialize(H)).toLowerCase(),this.data.referenceType="full"}function ge(H){this.data.characterReferenceType=H.type}function me(H){const le=this.sliceSerialize(H),pe=this.data.characterReferenceType;let ye;pe?(ye=gS(le,pe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ye=Cm(le);const B=this.stack[this.stack.length-1];B.value+=ye}function Ee(H){const le=this.stack.pop();le.position.end=Hi(H.end)}function Ue(H){T.call(this,H);const le=this.stack[this.stack.length-1];le.url=this.sliceSerialize(H)}function Re(H){T.call(this,H);const le=this.stack[this.stack.length-1];le.url="mailto:"+this.sliceSerialize(H)}function tt(){return{type:"blockquote",children:[]}}function It(){return{type:"code",lang:null,meta:null,value:""}}function xt(){return{type:"inlineCode",value:""}}function wt(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function vt(){return{type:"emphasis",children:[]}}function an(){return{type:"heading",depth:0,children:[]}}function Be(){return{type:"break"}}function ht(){return{type:"html",value:""}}function Pt(){return{type:"image",title:null,url:"",alt:null}}function Mt(){return{type:"link",title:null,url:"",children:[]}}function he(H){return{type:"list",ordered:H.type==="listOrdered",start:null,spread:H._spread,children:[]}}function Bt(H){return{type:"listItem",spread:H._spread,checked:null,children:[]}}function Qn(){return{type:"paragraph",children:[]}}function wn(){return{type:"strong",children:[]}}function rt(){return{type:"text",value:""}}function fe(){return{type:"thematicBreak"}}}function Hi(e){return{line:e.line,column:e.column,offset:e.offset}}function jS(e,t){let a=-1;for(;++a<t.length;){const r=t[a];Array.isArray(r)?jS(e,r):fD(e,r)}}function fD(e,t){let a;for(a in t)if(AS.call(t,a))switch(a){case"canContainEols":{const r=t[a];r&&e[a].push(...r);break}case"transforms":{const r=t[a];r&&e[a].push(...r);break}case"enter":case"exit":{const r=t[a];r&&Object.assign(e[a],r);break}}}function hb(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+qo({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+qo({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+qo({start:t.start,end:t.end})+") is still open")}function pD(e){const t=this;t.parser=a;function a(r){return uD(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function hD(e,t){const a={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,a),e.applyData(t,a)}function mD(e,t){const a={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,a),[e.applyData(t,a),{type:"text",value:`
1110
+ `}]}function gD(e,t){const a=t.value?t.value+`
1111
+ `:"",r={},o=t.lang?t.lang.split(/\s+/):[];o.length>0&&(r.className=["language-"+o[0]]);let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:a}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function yD(e,t){const a={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function vD(e,t){const a={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function bD(e,t){const a=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),o=Dl(r.toLowerCase()),s=e.footnoteOrder.indexOf(r);let c,d=e.footnoteCounts.get(r);d===void 0?(d=0,e.footnoteOrder.push(r),c=e.footnoteOrder.length):c=s+1,d+=1,e.footnoteCounts.set(r,d);const p={type:"element",tagName:"a",properties:{href:"#"+a+"fn-"+o,id:a+"fnref-"+o+(d>1?"-"+d:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(c)}]};e.patch(t,p);const f={type:"element",tagName:"sup",properties:{},children:[p]};return e.patch(t,f),e.applyData(t,f)}function xD(e,t){const a={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function wD(e,t){if(e.options.allowDangerousHtml){const a={type:"raw",value:t.value};return e.patch(t,a),e.applyData(t,a)}}function TS(e,t){const a=t.referenceType;let r="]";if(a==="collapsed"?r+="[]":a==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const o=e.all(t),s=o[0];s&&s.type==="text"?s.value="["+s.value:o.unshift({type:"text",value:"["});const c=o[o.length-1];return c&&c.type==="text"?c.value+=r:o.push({type:"text",value:r}),o}function SD(e,t){const a=String(t.identifier).toUpperCase(),r=e.definitionById.get(a);if(!r)return TS(e,t);const o={src:Dl(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(o.title=r.title);const s={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,s),e.applyData(t,s)}function kD(e,t){const a={src:Dl(t.url)};t.alt!==null&&t.alt!==void 0&&(a.alt=t.alt),t.title!==null&&t.title!==void 0&&(a.title=t.title);const r={type:"element",tagName:"img",properties:a,children:[]};return e.patch(t,r),e.applyData(t,r)}function CD(e,t){const a={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,a);const r={type:"element",tagName:"code",properties:{},children:[a]};return e.patch(t,r),e.applyData(t,r)}function ED(e,t){const a=String(t.identifier).toUpperCase(),r=e.definitionById.get(a);if(!r)return TS(e,t);const o={href:Dl(r.url||"")};r.title!==null&&r.title!==void 0&&(o.title=r.title);const s={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function AD(e,t){const a={href:Dl(t.url)};t.title!==null&&t.title!==void 0&&(a.title=t.title);const r={type:"element",tagName:"a",properties:a,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function jD(e,t,a){const r=e.all(t),o=a?TD(a):RS(t),s={},c=[];if(typeof t.checked=="boolean"){const y=r[0];let m;y&&y.type==="element"&&y.tagName==="p"?m=y:(m={type:"element",tagName:"p",properties:{},children:[]},r.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let d=-1;for(;++d<r.length;){const y=r[d];(o||d!==0||y.type!=="element"||y.tagName!=="p")&&c.push({type:"text",value:`
1112
+ `}),y.type==="element"&&y.tagName==="p"&&!o?c.push(...y.children):c.push(y)}const p=r[r.length-1];p&&(o||p.type!=="element"||p.tagName!=="p")&&c.push({type:"text",value:`
1113
+ `});const f={type:"element",tagName:"li",properties:s,children:c};return e.patch(t,f),e.applyData(t,f)}function TD(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const a=e.children;let r=-1;for(;!t&&++r<a.length;)t=RS(a[r])}return t}function RS(e){const t=e.spread;return t??e.children.length>1}function RD(e,t){const a={},r=e.all(t);let o=-1;for(typeof t.start=="number"&&t.start!==1&&(a.start=t.start);++o<r.length;){const c=r[o];if(c.type==="element"&&c.tagName==="li"&&c.properties&&Array.isArray(c.properties.className)&&c.properties.className.includes("task-list-item")){a.className=["contains-task-list"];break}}const s={type:"element",tagName:t.ordered?"ol":"ul",properties:a,children:e.wrap(r,!0)};return e.patch(t,s),e.applyData(t,s)}function ND(e,t){const a={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function _D(e,t){const a={type:"root",children:e.wrap(e.all(t))};return e.patch(t,a),e.applyData(t,a)}function OD(e,t){const a={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function MD(e,t){const a=e.all(t),r=a.shift(),o=[];if(r){const c={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],c),o.push(c)}if(a.length>0){const c={type:"element",tagName:"tbody",properties:{},children:e.wrap(a,!0)},d=bm(t.children[1]),p=sS(t.children[t.children.length-1]);d&&p&&(c.position={start:d,end:p}),o.push(c)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,s),e.applyData(t,s)}function DD(e,t,a){const r=a?a.children:void 0,s=(r?r.indexOf(t):1)===0?"th":"td",c=a&&a.type==="table"?a.align:void 0,d=c?c.length:t.children.length;let p=-1;const f=[];for(;++p<d;){const m=t.children[p],b={},x=c?c[p]:void 0;x&&(b.align=x);let k={type:"element",tagName:s,properties:b,children:[]};m&&(k.children=e.all(m),e.patch(m,k),k=e.applyData(m,k)),f.push(k)}const y={type:"element",tagName:"tr",properties:{},children:e.wrap(f,!0)};return e.patch(t,y),e.applyData(t,y)}function LD(e,t){const a={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}const mb=9,gb=32;function zD(e){const t=String(e),a=/\r?\n|\r/g;let r=a.exec(t),o=0;const s=[];for(;r;)s.push(yb(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=a.exec(t);return s.push(yb(t.slice(o),o>0,!1)),s.join("")}function yb(e,t,a){let r=0,o=e.length;if(t){let s=e.codePointAt(r);for(;s===mb||s===gb;)r++,s=e.codePointAt(r)}if(a){let s=e.codePointAt(o-1);for(;s===mb||s===gb;)o--,s=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}function ID(e,t){const a={type:"text",value:zD(String(t.value))};return e.patch(t,a),e.applyData(t,a)}function PD(e,t){const a={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,a),e.applyData(t,a)}const BD={blockquote:hD,break:mD,code:gD,delete:yD,emphasis:vD,footnoteReference:bD,heading:xD,html:wD,imageReference:SD,image:kD,inlineCode:CD,linkReference:ED,link:AD,listItem:jD,list:RD,paragraph:ND,root:_D,strong:OD,table:MD,tableCell:LD,tableRow:DD,text:ID,thematicBreak:PD,toml:Mc,yaml:Mc,definition:Mc,footnoteDefinition:Mc};function Mc(){}const NS=-1,Tu=0,Go=1,du=2,Am=3,jm=4,Tm=5,Rm=6,_S=7,OS=8,UD=typeof self=="object"?self:globalThis,vb=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new UD[e](t)},HD=(e,t)=>{const a=(o,s)=>(e.set(s,o),o),r=o=>{if(e.has(o))return e.get(o);const[s,c]=t[o];switch(s){case Tu:case NS:return a(c,o);case Go:{const d=a([],o);for(const p of c)d.push(r(p));return d}case du:{const d=a({},o);for(const[p,f]of c)d[r(p)]=r(f);return d}case Am:return a(new Date(c),o);case jm:{const{source:d,flags:p}=c;return a(new RegExp(d,p),o)}case Tm:{const d=a(new Map,o);for(const[p,f]of c)d.set(r(p),r(f));return d}case Rm:{const d=a(new Set,o);for(const p of c)d.add(r(p));return d}case _S:{const{name:d,message:p}=c;return a(vb(d,p),o)}case OS:return a(BigInt(c),o);case"BigInt":return a(Object(BigInt(c)),o);case"ArrayBuffer":return a(new Uint8Array(c).buffer,c);case"DataView":{const{buffer:d}=new Uint8Array(c);return a(new DataView(d),c)}}return a(vb(s,c),o)};return r},bb=e=>HD(new Map,e)(0),ml="",{toString:$D}={},{keys:qD}=Object,Lo=e=>{const t=typeof e;if(t!=="object"||!e)return[Tu,t];const a=$D.call(e).slice(8,-1);switch(a){case"Array":return[Go,ml];case"Object":return[du,ml];case"Date":return[Am,ml];case"RegExp":return[jm,ml];case"Map":return[Tm,ml];case"Set":return[Rm,ml];case"DataView":return[Go,a]}return a.includes("Array")?[Go,a]:a.includes("Error")?[_S,a]:[du,a]},Dc=([e,t])=>e===Tu&&(t==="function"||t==="symbol"),FD=(e,t,a,r)=>{const o=(c,d)=>{const p=r.push(c)-1;return a.set(d,p),p},s=c=>{if(a.has(c))return a.get(c);let[d,p]=Lo(c);switch(d){case Tu:{let y=c;switch(p){case"bigint":d=OS,y=c.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+p);y=null;break;case"undefined":return o([NS],c)}return o([d,y],c)}case Go:{if(p){let b=c;return p==="DataView"?b=new Uint8Array(c.buffer):p==="ArrayBuffer"&&(b=new Uint8Array(c)),o([p,[...b]],c)}const y=[],m=o([d,y],c);for(const b of c)y.push(s(b));return m}case du:{if(p)switch(p){case"BigInt":return o([p,c.toString()],c);case"Boolean":case"Number":case"String":return o([p,c.valueOf()],c)}if(t&&"toJSON"in c)return s(c.toJSON());const y=[],m=o([d,y],c);for(const b of qD(c))(e||!Dc(Lo(c[b])))&&y.push([s(b),s(c[b])]);return m}case Am:return o([d,c.toISOString()],c);case jm:{const{source:y,flags:m}=c;return o([d,{source:y,flags:m}],c)}case Tm:{const y=[],m=o([d,y],c);for(const[b,x]of c)(e||!(Dc(Lo(b))||Dc(Lo(x))))&&y.push([s(b),s(x)]);return m}case Rm:{const y=[],m=o([d,y],c);for(const b of c)(e||!Dc(Lo(b)))&&y.push(s(b));return m}}const{message:f}=c;return o([d,{name:p,message:f}],c)};return s},xb=(e,{json:t,lossy:a}={})=>{const r=[];return FD(!(t||a),!!t,new Map,r)(e),r},fu=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?bb(xb(e,t)):structuredClone(e):(e,t)=>bb(xb(e,t));function GD(e,t){const a=[{type:"text",value:"↩"}];return t>1&&a.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),a}function VD(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function WD(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=e.options.footnoteBackContent||GD,r=e.options.footnoteBackLabel||VD,o=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",c=e.options.footnoteLabelProperties||{className:["sr-only"]},d=[];let p=-1;for(;++p<e.footnoteOrder.length;){const f=e.footnoteById.get(e.footnoteOrder[p]);if(!f)continue;const y=e.all(f),m=String(f.identifier).toUpperCase(),b=Dl(m.toLowerCase());let x=0;const k=[],C=e.footnoteCounts.get(m);for(;C!==void 0&&++x<=C;){k.length>0&&k.push({type:"text",value:" "});let R=typeof a=="string"?a:a(p,x);typeof R=="string"&&(R={type:"text",value:R}),k.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+b+(x>1?"-"+x:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(p,x),className:["data-footnote-backref"]},children:Array.isArray(R)?R:[R]})}const A=y[y.length-1];if(A&&A.type==="element"&&A.tagName==="p"){const R=A.children[A.children.length-1];R&&R.type==="text"?R.value+=" ":A.children.push({type:"text",value:" "}),A.children.push(...k)}else y.push(...k);const E={type:"element",tagName:"li",properties:{id:t+"fn-"+b},children:e.wrap(y,!0)};e.patch(f,E),d.push(E)}if(d.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...fu(c),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
1114
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(d,!0)},{type:"text",value:`
1115
+ `}]}}const Ru=(function(e){if(e==null)return XD;if(typeof e=="function")return Nu(e);if(typeof e=="object")return Array.isArray(e)?YD(e):KD(e);if(typeof e=="string")return QD(e);throw new Error("Expected function, string, or object as test")});function YD(e){const t=[];let a=-1;for(;++a<e.length;)t[a]=Ru(e[a]);return Nu(r);function r(...o){let s=-1;for(;++s<t.length;)if(t[s].apply(this,o))return!0;return!1}}function KD(e){const t=e;return Nu(a);function a(r){const o=r;let s;for(s in e)if(o[s]!==t[s])return!1;return!0}}function QD(e){return Nu(t);function t(a){return a&&a.type===e}}function Nu(e){return t;function t(a,r,o){return!!(ZD(a)&&e.call(this,a,typeof r=="number"?r:void 0,o||void 0))}}function XD(){return!0}function ZD(e){return e!==null&&typeof e=="object"&&"type"in e}const MS=[],JD=!0,wh=!1,e6="skip";function DS(e,t,a,r){let o;typeof t=="function"&&typeof a!="function"?(r=a,a=t):o=t;const s=Ru(o),c=r?-1:1;d(e,void 0,[])();function d(p,f,y){const m=p&&typeof p=="object"?p:{};if(typeof m.type=="string"){const x=typeof m.tagName=="string"?m.tagName:typeof m.name=="string"?m.name:void 0;Object.defineProperty(b,"name",{value:"node ("+(p.type+(x?"<"+x+">":""))+")"})}return b;function b(){let x=MS,k,C,A;if((!t||s(p,f,y[y.length-1]||void 0))&&(x=t6(a(p,y)),x[0]===wh))return x;if("children"in p&&p.children){const E=p;if(E.children&&x[0]!==e6)for(C=(r?E.children.length:-1)+c,A=y.concat(E);C>-1&&C<E.children.length;){const R=E.children[C];if(k=d(R,C,A)(),k[0]===wh)return k;C=typeof k[1]=="number"?k[1]:C+c}}return x}}}function t6(e){return Array.isArray(e)?e:typeof e=="number"?[JD,e]:e==null?MS:[e]}function Nm(e,t,a,r){let o,s,c;typeof t=="function"&&typeof a!="function"?(s=void 0,c=t,o=a):(s=t,c=a,o=r),DS(e,s,d,o);function d(p,f){const y=f[f.length-1],m=y?y.children.indexOf(p):void 0;return c(p,m,y)}}const Sh={}.hasOwnProperty,n6={};function a6(e,t){const a=t||n6,r=new Map,o=new Map,s=new Map,c={...BD,...a.handlers},d={all:f,applyData:r6,definitionById:r,footnoteById:o,footnoteCounts:s,footnoteOrder:[],handlers:c,one:p,options:a,patch:i6,wrap:o6};return Nm(e,function(y){if(y.type==="definition"||y.type==="footnoteDefinition"){const m=y.type==="definition"?r:o,b=String(y.identifier).toUpperCase();m.has(b)||m.set(b,y)}}),d;function p(y,m){const b=y.type,x=d.handlers[b];if(Sh.call(d.handlers,b)&&x)return x(d,y,m);if(d.options.passThrough&&d.options.passThrough.includes(b)){if("children"in y){const{children:C,...A}=y,E=fu(A);return E.children=d.all(y),E}return fu(y)}return(d.options.unknownHandler||l6)(d,y,m)}function f(y){const m=[];if("children"in y){const b=y.children;let x=-1;for(;++x<b.length;){const k=d.one(b[x],y);if(k){if(x&&b[x-1].type==="break"&&(!Array.isArray(k)&&k.type==="text"&&(k.value=wb(k.value)),!Array.isArray(k)&&k.type==="element")){const C=k.children[0];C&&C.type==="text"&&(C.value=wb(C.value))}Array.isArray(k)?m.push(...k):m.push(k)}}}return m}}function i6(e,t){e.position&&(t.position=G_(e))}function r6(e,t){let a=t;if(e&&e.data){const r=e.data.hName,o=e.data.hChildren,s=e.data.hProperties;if(typeof r=="string")if(a.type==="element")a.tagName=r;else{const c="children"in a?a.children:[a];a={type:"element",tagName:r,properties:{},children:c}}a.type==="element"&&s&&Object.assign(a.properties,fu(s)),"children"in a&&a.children&&o!==null&&o!==void 0&&(a.children=o)}return a}function l6(e,t){const a=t.data||{},r="value"in t&&!(Sh.call(a,"hProperties")||Sh.call(a,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function o6(e,t){const a=[];let r=-1;for(t&&a.push({type:"text",value:`
1116
+ `});++r<e.length;)r&&a.push({type:"text",value:`
1117
+ `}),a.push(e[r]);return t&&e.length>0&&a.push({type:"text",value:`
1118
+ `}),a}function wb(e){let t=0,a=e.charCodeAt(t);for(;a===9||a===32;)t++,a=e.charCodeAt(t);return e.slice(t)}function Sb(e,t){const a=a6(e,t),r=a.one(e,void 0),o=WD(a),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return o&&s.children.push({type:"text",value:`
1119
+ `},o),s}function s6(e,t){return e&&"run"in e?async function(a,r){const o=Sb(a,{file:r,...t});await e.run(o,r)}:function(a,r){return Sb(a,{file:r,...e||t})}}function kb(e){if(e)throw e}var Tp,Cb;function c6(){if(Cb)return Tp;Cb=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,a=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=function(f){return typeof Array.isArray=="function"?Array.isArray(f):t.call(f)==="[object Array]"},s=function(f){if(!f||t.call(f)!=="[object Object]")return!1;var y=e.call(f,"constructor"),m=f.constructor&&f.constructor.prototype&&e.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!y&&!m)return!1;var b;for(b in f);return typeof b>"u"||e.call(f,b)},c=function(f,y){a&&y.name==="__proto__"?a(f,y.name,{enumerable:!0,configurable:!0,value:y.newValue,writable:!0}):f[y.name]=y.newValue},d=function(f,y){if(y==="__proto__")if(e.call(f,y)){if(r)return r(f,y).value}else return;return f[y]};return Tp=function p(){var f,y,m,b,x,k,C=arguments[0],A=1,E=arguments.length,R=!1;for(typeof C=="boolean"&&(R=C,C=arguments[1]||{},A=2),(C==null||typeof C!="object"&&typeof C!="function")&&(C={});A<E;++A)if(f=arguments[A],f!=null)for(y in f)m=d(C,y),b=d(f,y),C!==b&&(R&&b&&(s(b)||(x=o(b)))?(x?(x=!1,k=m&&o(m)?m:[]):k=m&&s(m)?m:{},c(C,{name:y,newValue:p(R,k,b)})):typeof b<"u"&&c(C,{name:y,newValue:b}));return C},Tp}var u6=c6();const Rp=ns(u6);function kh(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 d6(){const e=[],t={run:a,use:r};return t;function a(...o){let s=-1;const c=o.pop();if(typeof c!="function")throw new TypeError("Expected function as last argument, not "+c);d(null,...o);function d(p,...f){const y=e[++s];let m=-1;if(p){c(p);return}for(;++m<o.length;)(f[m]===null||f[m]===void 0)&&(f[m]=o[m]);o=f,y?f6(y,d)(...f):c(null,...f)}}function r(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function f6(e,t){let a;return r;function r(...c){const d=e.length>c.length;let p;d&&c.push(o);try{p=e.apply(this,c)}catch(f){const y=f;if(d&&a)throw y;return o(y)}d||(p&&p.then&&typeof p.then=="function"?p.then(s,o):p instanceof Error?o(p):s(p))}function o(c,...d){a||(a=!0,t(c,...d))}function s(c){o(null,c)}}const Oa={basename:p6,dirname:h6,extname:m6,join:g6,sep:"/"};function p6(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');cs(e);let a=0,r=-1,o=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(s){a=o+1;break}}else r<0&&(s=!0,r=o+1);return r<0?"":e.slice(a,r)}if(t===e)return"";let c=-1,d=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(s){a=o+1;break}}else c<0&&(s=!0,c=o+1),d>-1&&(e.codePointAt(o)===t.codePointAt(d--)?d<0&&(r=o):(d=-1,r=c));return a===r?r=c:r<0&&(r=e.length),e.slice(a,r)}function h6(e){if(cs(e),e.length===0)return".";let t=-1,a=e.length,r;for(;--a;)if(e.codePointAt(a)===47){if(r){t=a;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function m6(e){cs(e);let t=e.length,a=-1,r=0,o=-1,s=0,c;for(;t--;){const d=e.codePointAt(t);if(d===47){if(c){r=t+1;break}continue}a<0&&(c=!0,a=t+1),d===46?o<0?o=t:s!==1&&(s=1):o>-1&&(s=-1)}return o<0||a<0||s===0||s===1&&o===a-1&&o===r+1?"":e.slice(o,a)}function g6(...e){let t=-1,a;for(;++t<e.length;)cs(e[t]),e[t]&&(a=a===void 0?e[t]:a+"/"+e[t]);return a===void 0?".":y6(a)}function y6(e){cs(e);const t=e.codePointAt(0)===47;let a=v6(e,!t);return a.length===0&&!t&&(a="."),a.length>0&&e.codePointAt(e.length-1)===47&&(a+="/"),t?"/"+a:a}function v6(e,t){let a="",r=0,o=-1,s=0,c=-1,d,p;for(;++c<=e.length;){if(c<e.length)d=e.codePointAt(c);else{if(d===47)break;d=47}if(d===47){if(!(o===c-1||s===1))if(o!==c-1&&s===2){if(a.length<2||r!==2||a.codePointAt(a.length-1)!==46||a.codePointAt(a.length-2)!==46){if(a.length>2){if(p=a.lastIndexOf("/"),p!==a.length-1){p<0?(a="",r=0):(a=a.slice(0,p),r=a.length-1-a.lastIndexOf("/")),o=c,s=0;continue}}else if(a.length>0){a="",r=0,o=c,s=0;continue}}t&&(a=a.length>0?a+"/..":"..",r=2)}else a.length>0?a+="/"+e.slice(o+1,c):a=e.slice(o+1,c),r=c-o-1;o=c,s=0}else d===46&&s>-1?s++:s=-1}return a}function cs(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const b6={cwd:x6};function x6(){return"/"}function Ch(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function w6(e){if(typeof e=="string")e=new URL(e);else if(!Ch(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 S6(e)}function S6(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let a=-1;for(;++a<t.length;)if(t.codePointAt(a)===37&&t.codePointAt(a+1)===50){const r=t.codePointAt(a+2);if(r===70||r===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(t)}const Np=["history","path","basename","stem","extname","dirname"];class LS{constructor(t){let a;t?Ch(t)?a={path:t}:typeof t=="string"||k6(t)?a={value:t}:a=t:a={},this.cwd="cwd"in a?"":b6.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Np.length;){const s=Np[r];s in a&&a[s]!==void 0&&a[s]!==null&&(this[s]=s==="history"?[...a[s]]:a[s])}let o;for(o in a)Np.includes(o)||(this[o]=a[o])}get basename(){return typeof this.path=="string"?Oa.basename(this.path):void 0}set basename(t){Op(t,"basename"),_p(t,"basename"),this.path=Oa.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Oa.dirname(this.path):void 0}set dirname(t){Eb(this.basename,"dirname"),this.path=Oa.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Oa.extname(this.path):void 0}set extname(t){if(_p(t,"extname"),Eb(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=Oa.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Ch(t)&&(t=w6(t)),Op(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Oa.basename(this.path,this.extname):void 0}set stem(t){Op(t,"stem"),_p(t,"stem"),this.path=Oa.join(this.dirname||"",t+(this.extname||""))}fail(t,a,r){const o=this.message(t,a,r);throw o.fatal=!0,o}info(t,a,r){const o=this.message(t,a,r);return o.fatal=void 0,o}message(t,a,r){const o=new fn(t,a,r);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function _p(e,t){if(e&&e.includes(Oa.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Oa.sep+"`")}function Op(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Eb(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function k6(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const C6=(function(e){const r=this.constructor.prototype,o=r[e],s=function(){return o.apply(s,arguments)};return Object.setPrototypeOf(s,r),s}),E6={}.hasOwnProperty;class _m extends C6{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=d6()}copy(){const t=new _m;let a=-1;for(;++a<this.attachers.length;){const r=this.attachers[a];t.use(...r)}return t.data(Rp(!0,{},this.namespace)),t}data(t,a){return typeof t=="string"?arguments.length===2?(Lp("data",this.frozen),this.namespace[t]=a,this):E6.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Lp("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[a,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const o=a.call(t,...r);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const a=Lc(t),r=this.parser||this.Parser;return Mp("parse",r),r(String(a),a)}process(t,a){const r=this;return this.freeze(),Mp("process",this.parser||this.Parser),Dp("process",this.compiler||this.Compiler),a?o(void 0,a):new Promise(o);function o(s,c){const d=Lc(t),p=r.parse(d);r.run(p,d,function(y,m,b){if(y||!m||!b)return f(y);const x=m,k=r.stringify(x,b);T6(k)?b.value=k:b.result=k,f(y,b)});function f(y,m){y||!m?c(y):s?s(m):a(void 0,m)}}}processSync(t){let a=!1,r;return this.freeze(),Mp("processSync",this.parser||this.Parser),Dp("processSync",this.compiler||this.Compiler),this.process(t,o),jb("processSync","process",a),r;function o(s,c){a=!0,kb(s),r=c}}run(t,a,r){Ab(t),this.freeze();const o=this.transformers;return!r&&typeof a=="function"&&(r=a,a=void 0),r?s(void 0,r):new Promise(s);function s(c,d){const p=Lc(a);o.run(t,p,f);function f(y,m,b){const x=m||t;y?d(y):c?c(x):r(void 0,x,b)}}}runSync(t,a){let r=!1,o;return this.run(t,a,s),jb("runSync","run",r),o;function s(c,d){kb(c),o=d,r=!0}}stringify(t,a){this.freeze();const r=Lc(a),o=this.compiler||this.Compiler;return Dp("stringify",o),Ab(t),o(t,r)}use(t,...a){const r=this.attachers,o=this.namespace;if(Lp("use",this.frozen),t!=null)if(typeof t=="function")p(t,a);else if(typeof t=="object")Array.isArray(t)?d(t):c(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function s(f){if(typeof f=="function")p(f,[]);else if(typeof f=="object")if(Array.isArray(f)){const[y,...m]=f;p(y,m)}else c(f);else throw new TypeError("Expected usable value, not `"+f+"`")}function c(f){if(!("plugins"in f)&&!("settings"in f))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");d(f.plugins),f.settings&&(o.settings=Rp(!0,o.settings,f.settings))}function d(f){let y=-1;if(f!=null)if(Array.isArray(f))for(;++y<f.length;){const m=f[y];s(m)}else throw new TypeError("Expected a list of plugins, not `"+f+"`")}function p(f,y){let m=-1,b=-1;for(;++m<r.length;)if(r[m][0]===f){b=m;break}if(b===-1)r.push([f,...y]);else if(y.length>0){let[x,...k]=y;const C=r[b][1];kh(C)&&kh(x)&&(x=Rp(!0,C,x)),r[b]=[f,x,...k]}}}}const A6=new _m().freeze();function Mp(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Dp(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Lp(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 Ab(e){if(!kh(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function jb(e,t,a){if(!a)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Lc(e){return j6(e)?e:new LS(e)}function j6(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function T6(e){return typeof e=="string"||R6(e)}function R6(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const N6="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Tb=[],Rb={allowDangerousHtml:!0},_6=/^(https?|ircs?|mailto|xmpp)$/i,O6=[{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 M6(e){const t=D6(e),a=L6(e);return z6(t.runSync(t.parse(a),a),e)}function D6(e){const t=e.rehypePlugins||Tb,a=e.remarkPlugins||Tb,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Rb}:Rb;return A6().use(pD).use(a).use(s6,r).use(t)}function L6(e){const t=e.children||"",a=new LS;return typeof t=="string"&&(a.value=t),a}function z6(e,t){const a=t.allowedElements,r=t.allowElement,o=t.components,s=t.disallowedElements,c=t.skipHtml,d=t.unwrapDisallowed,p=t.urlTransform||I6;for(const y of O6)Object.hasOwn(t,y.from)&&(""+y.from+(y.to?"use `"+y.to+"` instead":"remove it")+N6+y.id,void 0);return Nm(e,f),Q_(e,{Fragment:g.Fragment,components:o,ignoreInvalidStyle:!0,jsx:g.jsx,jsxs:g.jsxs,passKeys:!0,passNode:!0});function f(y,m,b){if(y.type==="raw"&&b&&typeof m=="number")return c?b.children.splice(m,1):b.children[m]={type:"text",value:y.value},m;if(y.type==="element"){let x;for(x in Ep)if(Object.hasOwn(Ep,x)&&Object.hasOwn(y.properties,x)){const k=y.properties[x],C=Ep[x];(C===null||C.includes(y.tagName))&&(y.properties[x]=p(String(k||""),x,y))}}if(y.type==="element"){let x=a?!a.includes(y.tagName):s?s.includes(y.tagName):!1;if(!x&&r&&typeof m=="number"&&(x=!r(y,m,b)),x&&b&&typeof m=="number")return d&&y.children?b.children.splice(m,1,...y.children):b.children.splice(m,1),m}}}function I6(e){const t=e.indexOf(":"),a=e.indexOf("?"),r=e.indexOf("#"),o=e.indexOf("/");return t===-1||o!==-1&&t>o||a!==-1&&t>a||r!==-1&&t>r||_6.test(e.slice(0,t))?e:""}function Nb(e,t){const a=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,o=a.indexOf(t);for(;o!==-1;)r++,o=a.indexOf(t,o+t.length);return r}function P6(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function zS(e,t,a){const o=Ru((a||{}).ignore||[]),s=B6(t);let c=-1;for(;++c<s.length;)DS(e,"text",d);function d(f,y){let m=-1,b;for(;++m<y.length;){const x=y[m],k=b?b.children:void 0;if(o(x,k?k.indexOf(x):void 0,b))return;b=x}if(b)return p(f,y)}function p(f,y){const m=y[y.length-1],b=s[c][0],x=s[c][1];let k=0;const A=m.children.indexOf(f);let E=!1,R=[];b.lastIndex=0;let _=b.exec(f.value);for(;_;){const U=_.index,I={index:_.index,input:_.input,stack:[...y,f]};let O=x(..._,I);if(typeof O=="string"&&(O=O.length>0?{type:"text",value:O}:void 0),O===!1?b.lastIndex=U+1:(k!==U&&R.push({type:"text",value:f.value.slice(k,U)}),Array.isArray(O)?R.push(...O):O&&R.push(O),k=U+_[0].length,E=!0),!b.global)break;_=b.exec(f.value)}return E?(k<f.value.length&&R.push({type:"text",value:f.value.slice(k)}),m.children.splice(A,1,...R)):R=[f],A+R.length}}function B6(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const a=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<a.length;){const o=a[r];t.push([U6(o[0]),H6(o[1])])}return t}function U6(e){return typeof e=="string"?new RegExp(P6(e),"g"):e}function H6(e){return typeof e=="function"?e:function(){return e}}const zp="phrasing",Ip=["autolink","link","image","label"];function $6(){return{transforms:[K6],enter:{literalAutolink:F6,literalAutolinkEmail:Pp,literalAutolinkHttp:Pp,literalAutolinkWww:Pp},exit:{literalAutolink:Y6,literalAutolinkEmail:W6,literalAutolinkHttp:G6,literalAutolinkWww:V6}}}function q6(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:zp,notInConstruct:Ip},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:zp,notInConstruct:Ip},{character:":",before:"[ps]",after:"\\/",inConstruct:zp,notInConstruct:Ip}]}}function F6(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Pp(e){this.config.enter.autolinkProtocol.call(this,e)}function G6(e){this.config.exit.autolinkProtocol.call(this,e)}function V6(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 W6(e){this.config.exit.autolinkEmail.call(this,e)}function Y6(e){this.exit(e)}function K6(e){zS(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Q6],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),X6]],{ignore:["link","linkReference"]})}function Q6(e,t,a,r,o){let s="";if(!IS(o)||(/^w/i.test(t)&&(a=t+a,t="",s="http://"),!Z6(a)))return!1;const c=J6(a+r);if(!c[0])return!1;const d={type:"link",title:null,url:s+t+c[0],children:[{type:"text",value:t+c[0]}]};return c[1]?[d,{type:"text",value:c[1]}]:d}function X6(e,t,a,r){return!IS(r,!0)||/[-\d_]$/.test(a)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+a,children:[{type:"text",value:t+"@"+a}]}}function Z6(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 J6(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let a=t[0],r=a.indexOf(")");const o=Nb(e,"(");let s=Nb(e,")");for(;r!==-1&&o>s;)e+=a.slice(0,r+1),a=a.slice(r+1),r=a.indexOf(")"),s++;return[e,a]}function IS(e,t){const a=e.input.charCodeAt(e.index-1);return(e.index===0||kr(a)||Au(a))&&(!t||a!==47)}PS.peek=s5;function e5(){this.buffer()}function t5(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function n5(){this.buffer()}function a5(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function i5(e){const t=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=ba(this.sliceSerialize(e)).toLowerCase(),a.label=t}function r5(e){this.exit(e)}function l5(e){const t=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=ba(this.sliceSerialize(e)).toLowerCase(),a.label=t}function o5(e){this.exit(e)}function s5(){return"["}function PS(e,t,a,r){const o=a.createTracker(r);let s=o.move("[^");const c=a.enter("footnoteReference"),d=a.enter("reference");return s+=o.move(a.safe(a.associationId(e),{after:"]",before:s})),d(),c(),s+=o.move("]"),s}function c5(){return{enter:{gfmFootnoteCallString:e5,gfmFootnoteCall:t5,gfmFootnoteDefinitionLabelString:n5,gfmFootnoteDefinition:a5},exit:{gfmFootnoteCallString:i5,gfmFootnoteCall:r5,gfmFootnoteDefinitionLabelString:l5,gfmFootnoteDefinition:o5}}}function u5(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:a,footnoteReference:PS},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function a(r,o,s,c){const d=s.createTracker(c);let p=d.move("[^");const f=s.enter("footnoteDefinition"),y=s.enter("label");return p+=d.move(s.safe(s.associationId(r),{before:p,after:"]"})),y(),p+=d.move("]:"),r.children&&r.children.length>0&&(d.shift(4),p+=d.move((t?`
1120
+ `:" ")+s.indentLines(s.containerFlow(r,d.current()),t?BS:d5))),f(),p}}function d5(e,t,a){return t===0?e:BS(e,t,a)}function BS(e,t,a){return(a?"":" ")+e}const f5=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];US.peek=y5;function p5(){return{canContainEols:["delete"],enter:{strikethrough:m5},exit:{strikethrough:g5}}}function h5(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:f5}],handlers:{delete:US}}}function m5(e){this.enter({type:"delete",children:[]},e)}function g5(e){this.exit(e)}function US(e,t,a,r){const o=a.createTracker(r),s=a.enter("strikethrough");let c=o.move("~~");return c+=a.containerPhrasing(e,{...o.current(),before:c,after:"~"}),c+=o.move("~~"),s(),c}function y5(){return"~"}function v5(e){return e.length}function b5(e,t){const a=t||{},r=(a.align||[]).concat(),o=a.stringLength||v5,s=[],c=[],d=[],p=[];let f=0,y=-1;for(;++y<e.length;){const C=[],A=[];let E=-1;for(e[y].length>f&&(f=e[y].length);++E<e[y].length;){const R=x5(e[y][E]);if(a.alignDelimiters!==!1){const _=o(R);A[E]=_,(p[E]===void 0||_>p[E])&&(p[E]=_)}C.push(R)}c[y]=C,d[y]=A}let m=-1;if(typeof r=="object"&&"length"in r)for(;++m<f;)s[m]=_b(r[m]);else{const C=_b(r);for(;++m<f;)s[m]=C}m=-1;const b=[],x=[];for(;++m<f;){const C=s[m];let A="",E="";C===99?(A=":",E=":"):C===108?A=":":C===114&&(E=":");let R=a.alignDelimiters===!1?1:Math.max(1,p[m]-A.length-E.length);const _=A+"-".repeat(R)+E;a.alignDelimiters!==!1&&(R=A.length+R+E.length,R>p[m]&&(p[m]=R),x[m]=R),b[m]=_}c.splice(1,0,b),d.splice(1,0,x),y=-1;const k=[];for(;++y<c.length;){const C=c[y],A=d[y];m=-1;const E=[];for(;++m<f;){const R=C[m]||"";let _="",U="";if(a.alignDelimiters!==!1){const I=p[m]-(A[m]||0),O=s[m];O===114?_=" ".repeat(I):O===99?I%2?(_=" ".repeat(I/2+.5),U=" ".repeat(I/2-.5)):(_=" ".repeat(I/2),U=_):U=" ".repeat(I)}a.delimiterStart!==!1&&!m&&E.push("|"),a.padding!==!1&&!(a.alignDelimiters===!1&&R==="")&&(a.delimiterStart!==!1||m)&&E.push(" "),a.alignDelimiters!==!1&&E.push(_),E.push(R),a.alignDelimiters!==!1&&E.push(U),a.padding!==!1&&E.push(" "),(a.delimiterEnd!==!1||m!==f-1)&&E.push("|")}k.push(a.delimiterEnd===!1?E.join("").replace(/ +$/,""):E.join(""))}return k.join(`
1121
+ `)}function x5(e){return e==null?"":String(e)}function _b(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 w5(e,t,a,r){const o=a.enter("blockquote"),s=a.createTracker(r);s.move("> "),s.shift(2);const c=a.indentLines(a.containerFlow(e,s.current()),S5);return o(),c}function S5(e,t,a){return">"+(a?"":" ")+e}function k5(e,t){return Ob(e,t.inConstruct,!0)&&!Ob(e,t.notInConstruct,!1)}function Ob(e,t,a){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return a;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function Mb(e,t,a,r){let o=-1;for(;++o<a.unsafe.length;)if(a.unsafe[o].character===`
1122
+ `&&k5(a.stack,a.unsafe[o]))return/[ \t]/.test(r.before)?"":" ";return`\\
1123
+ `}function C5(e,t){const a=String(e);let r=a.indexOf(t),o=r,s=0,c=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===o?++s>c&&(c=s):s=1,o=r+t.length,r=a.indexOf(t,o);return c}function E5(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 A5(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 j5(e,t,a,r){const o=A5(a),s=e.value||"",c=o==="`"?"GraveAccent":"Tilde";if(E5(e,a)){const m=a.enter("codeIndented"),b=a.indentLines(s,T5);return m(),b}const d=a.createTracker(r),p=o.repeat(Math.max(C5(s,o)+1,3)),f=a.enter("codeFenced");let y=d.move(p);if(e.lang){const m=a.enter(`codeFencedLang${c}`);y+=d.move(a.safe(e.lang,{before:y,after:" ",encode:["`"],...d.current()})),m()}if(e.lang&&e.meta){const m=a.enter(`codeFencedMeta${c}`);y+=d.move(" "),y+=d.move(a.safe(e.meta,{before:y,after:`
1124
+ `,encode:["`"],...d.current()})),m()}return y+=d.move(`
1125
+ `),s&&(y+=d.move(s+`
1126
+ `)),y+=d.move(p),f(),y}function T5(e,t,a){return(a?"":" ")+e}function Om(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 R5(e,t,a,r){const o=Om(a),s=o==='"'?"Quote":"Apostrophe",c=a.enter("definition");let d=a.enter("label");const p=a.createTracker(r);let f=p.move("[");return f+=p.move(a.safe(a.associationId(e),{before:f,after:"]",...p.current()})),f+=p.move("]: "),d(),!e.url||/[\0- \u007F]/.test(e.url)?(d=a.enter("destinationLiteral"),f+=p.move("<"),f+=p.move(a.safe(e.url,{before:f,after:">",...p.current()})),f+=p.move(">")):(d=a.enter("destinationRaw"),f+=p.move(a.safe(e.url,{before:f,after:e.title?" ":`
1127
+ `,...p.current()}))),d(),e.title&&(d=a.enter(`title${s}`),f+=p.move(" "+o),f+=p.move(a.safe(e.title,{before:f,after:o,...p.current()})),f+=p.move(o),d()),c(),f}function N5(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 Jo(e){return"&#x"+e.toString(16).toUpperCase()+";"}function pu(e,t,a){const r=Cl(e),o=Cl(t);return r===void 0?o===void 0?a==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}HS.peek=_5;function HS(e,t,a,r){const o=N5(a),s=a.enter("emphasis"),c=a.createTracker(r),d=c.move(o);let p=c.move(a.containerPhrasing(e,{after:o,before:d,...c.current()}));const f=p.charCodeAt(0),y=pu(r.before.charCodeAt(r.before.length-1),f,o);y.inside&&(p=Jo(f)+p.slice(1));const m=p.charCodeAt(p.length-1),b=pu(r.after.charCodeAt(0),m,o);b.inside&&(p=p.slice(0,-1)+Jo(m));const x=c.move(o);return s(),a.attentionEncodeSurroundingInfo={after:b.outside,before:y.outside},d+p+x}function _5(e,t,a){return a.options.emphasis||"*"}function O5(e,t){let a=!1;return Nm(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return a=!0,wh}),!!((!e.depth||e.depth<3)&&km(e)&&(t.options.setext||a))}function M5(e,t,a,r){const o=Math.max(Math.min(6,e.depth||1),1),s=a.createTracker(r);if(O5(e,a)){const y=a.enter("headingSetext"),m=a.enter("phrasing"),b=a.containerPhrasing(e,{...s.current(),before:`
1128
+ `,after:`
1129
+ `});return m(),y(),b+`
1130
+ `+(o===1?"=":"-").repeat(b.length-(Math.max(b.lastIndexOf("\r"),b.lastIndexOf(`
1131
+ `))+1))}const c="#".repeat(o),d=a.enter("headingAtx"),p=a.enter("phrasing");s.move(c+" ");let f=a.containerPhrasing(e,{before:"# ",after:`
1132
+ `,...s.current()});return/^[\t ]/.test(f)&&(f=Jo(f.charCodeAt(0))+f.slice(1)),f=f?c+" "+f:c,a.options.closeAtx&&(f+=" "+c),p(),d(),f}$S.peek=D5;function $S(e){return e.value||""}function D5(){return"<"}qS.peek=L5;function qS(e,t,a,r){const o=Om(a),s=o==='"'?"Quote":"Apostrophe",c=a.enter("image");let d=a.enter("label");const p=a.createTracker(r);let f=p.move("![");return f+=p.move(a.safe(e.alt,{before:f,after:"]",...p.current()})),f+=p.move("]("),d(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(d=a.enter("destinationLiteral"),f+=p.move("<"),f+=p.move(a.safe(e.url,{before:f,after:">",...p.current()})),f+=p.move(">")):(d=a.enter("destinationRaw"),f+=p.move(a.safe(e.url,{before:f,after:e.title?" ":")",...p.current()}))),d(),e.title&&(d=a.enter(`title${s}`),f+=p.move(" "+o),f+=p.move(a.safe(e.title,{before:f,after:o,...p.current()})),f+=p.move(o),d()),f+=p.move(")"),c(),f}function L5(){return"!"}FS.peek=z5;function FS(e,t,a,r){const o=e.referenceType,s=a.enter("imageReference");let c=a.enter("label");const d=a.createTracker(r);let p=d.move("![");const f=a.safe(e.alt,{before:p,after:"]",...d.current()});p+=d.move(f+"]["),c();const y=a.stack;a.stack=[],c=a.enter("reference");const m=a.safe(a.associationId(e),{before:p,after:"]",...d.current()});return c(),a.stack=y,s(),o==="full"||!f||f!==m?p+=d.move(m+"]"):o==="shortcut"?p=p.slice(0,-1):p+=d.move("]"),p}function z5(){return"!"}GS.peek=I5;function GS(e,t,a){let r=e.value||"",o="`",s=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(r);)o+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++s<a.unsafe.length;){const c=a.unsafe[s],d=a.compilePattern(c);let p;if(c.atBreak)for(;p=d.exec(r);){let f=p.index;r.charCodeAt(f)===10&&r.charCodeAt(f-1)===13&&f--,r=r.slice(0,f)+" "+r.slice(p.index+1)}}return o+r+o}function I5(){return"`"}function VS(e,t){const a=km(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(a===e.url||"mailto:"+a===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}WS.peek=P5;function WS(e,t,a,r){const o=Om(a),s=o==='"'?"Quote":"Apostrophe",c=a.createTracker(r);let d,p;if(VS(e,a)){const y=a.stack;a.stack=[],d=a.enter("autolink");let m=c.move("<");return m+=c.move(a.containerPhrasing(e,{before:m,after:">",...c.current()})),m+=c.move(">"),d(),a.stack=y,m}d=a.enter("link"),p=a.enter("label");let f=c.move("[");return f+=c.move(a.containerPhrasing(e,{before:f,after:"](",...c.current()})),f+=c.move("]("),p(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(p=a.enter("destinationLiteral"),f+=c.move("<"),f+=c.move(a.safe(e.url,{before:f,after:">",...c.current()})),f+=c.move(">")):(p=a.enter("destinationRaw"),f+=c.move(a.safe(e.url,{before:f,after:e.title?" ":")",...c.current()}))),p(),e.title&&(p=a.enter(`title${s}`),f+=c.move(" "+o),f+=c.move(a.safe(e.title,{before:f,after:o,...c.current()})),f+=c.move(o),p()),f+=c.move(")"),d(),f}function P5(e,t,a){return VS(e,a)?"<":"["}YS.peek=B5;function YS(e,t,a,r){const o=e.referenceType,s=a.enter("linkReference");let c=a.enter("label");const d=a.createTracker(r);let p=d.move("[");const f=a.containerPhrasing(e,{before:p,after:"]",...d.current()});p+=d.move(f+"]["),c();const y=a.stack;a.stack=[],c=a.enter("reference");const m=a.safe(a.associationId(e),{before:p,after:"]",...d.current()});return c(),a.stack=y,s(),o==="full"||!f||f!==m?p+=d.move(m+"]"):o==="shortcut"?p=p.slice(0,-1):p+=d.move("]"),p}function B5(){return"["}function Mm(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 U5(e){const t=Mm(e),a=e.options.bulletOther;if(!a)return t==="*"?"-":"*";if(a!=="*"&&a!=="+"&&a!=="-")throw new Error("Cannot serialize items with `"+a+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(a===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+a+"`) to be different");return a}function H5(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 KS(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 $5(e,t,a,r){const o=a.enter("list"),s=a.bulletCurrent;let c=e.ordered?H5(a):Mm(a);const d=e.ordered?c==="."?")":".":U5(a);let p=t&&a.bulletLastUsed?c===a.bulletLastUsed:!1;if(!e.ordered){const y=e.children?e.children[0]:void 0;if((c==="*"||c==="-")&&y&&(!y.children||!y.children[0])&&a.stack[a.stack.length-1]==="list"&&a.stack[a.stack.length-2]==="listItem"&&a.stack[a.stack.length-3]==="list"&&a.stack[a.stack.length-4]==="listItem"&&a.indexStack[a.indexStack.length-1]===0&&a.indexStack[a.indexStack.length-2]===0&&a.indexStack[a.indexStack.length-3]===0&&(p=!0),KS(a)===c&&y){let m=-1;for(;++m<e.children.length;){const b=e.children[m];if(b&&b.type==="listItem"&&b.children&&b.children[0]&&b.children[0].type==="thematicBreak"){p=!0;break}}}}p&&(c=d),a.bulletCurrent=c;const f=a.containerFlow(e,r);return a.bulletLastUsed=c,a.bulletCurrent=s,o(),f}function q5(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 F5(e,t,a,r){const o=q5(a);let s=a.bulletCurrent||Mm(a);t&&t.type==="list"&&t.ordered&&(s=(typeof t.start=="number"&&t.start>-1?t.start:1)+(a.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let c=s.length+1;(o==="tab"||o==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(c=Math.ceil(c/4)*4);const d=a.createTracker(r);d.move(s+" ".repeat(c-s.length)),d.shift(c);const p=a.enter("listItem"),f=a.indentLines(a.containerFlow(e,d.current()),y);return p(),f;function y(m,b,x){return b?(x?"":" ".repeat(c))+m:(x?s:s+" ".repeat(c-s.length))+m}}function G5(e,t,a,r){const o=a.enter("paragraph"),s=a.enter("phrasing"),c=a.containerPhrasing(e,r);return s(),o(),c}const V5=Ru(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function W5(e,t,a,r){return(e.children.some(function(c){return V5(c)})?a.containerPhrasing:a.containerFlow).call(a,e,r)}function Y5(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}QS.peek=K5;function QS(e,t,a,r){const o=Y5(a),s=a.enter("strong"),c=a.createTracker(r),d=c.move(o+o);let p=c.move(a.containerPhrasing(e,{after:o,before:d,...c.current()}));const f=p.charCodeAt(0),y=pu(r.before.charCodeAt(r.before.length-1),f,o);y.inside&&(p=Jo(f)+p.slice(1));const m=p.charCodeAt(p.length-1),b=pu(r.after.charCodeAt(0),m,o);b.inside&&(p=p.slice(0,-1)+Jo(m));const x=c.move(o+o);return s(),a.attentionEncodeSurroundingInfo={after:b.outside,before:y.outside},d+p+x}function K5(e,t,a){return a.options.strong||"*"}function Q5(e,t,a,r){return a.safe(e.value,r)}function X5(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 Z5(e,t,a){const r=(KS(a)+(a.options.ruleSpaces?" ":"")).repeat(X5(a));return a.options.ruleSpaces?r.slice(0,-1):r}const XS={blockquote:w5,break:Mb,code:j5,definition:R5,emphasis:HS,hardBreak:Mb,heading:M5,html:$S,image:qS,imageReference:FS,inlineCode:GS,link:WS,linkReference:YS,list:$5,listItem:F5,paragraph:G5,root:W5,strong:QS,text:Q5,thematicBreak:Z5};function J5(){return{enter:{table:eL,tableData:Db,tableHeader:Db,tableRow:nL},exit:{codeText:aL,table:tL,tableData:Bp,tableHeader:Bp,tableRow:Bp}}}function eL(e){const t=e._align;this.enter({type:"table",align:t.map(function(a){return a==="none"?null:a}),children:[]},e),this.data.inTable=!0}function tL(e){this.exit(e),this.data.inTable=void 0}function nL(e){this.enter({type:"tableRow",children:[]},e)}function Bp(e){this.exit(e)}function Db(e){this.enter({type:"tableCell",children:[]},e)}function aL(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,iL));const a=this.stack[this.stack.length-1];a.type,a.value=t,this.exit(e)}function iL(e,t){return t==="|"?t:e}function rL(e){const t=e||{},a=t.tableCellPadding,r=t.tablePipeAlign,o=t.stringLength,s=a?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
1133
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:b,table:c,tableCell:p,tableRow:d}};function c(x,k,C,A){return f(y(x,C,A),x.align)}function d(x,k,C,A){const E=m(x,C,A),R=f([E]);return R.slice(0,R.indexOf(`
1134
+ `))}function p(x,k,C,A){const E=C.enter("tableCell"),R=C.enter("phrasing"),_=C.containerPhrasing(x,{...A,before:s,after:s});return R(),E(),_}function f(x,k){return b5(x,{align:k,alignDelimiters:r,padding:a,stringLength:o})}function y(x,k,C){const A=x.children;let E=-1;const R=[],_=k.enter("table");for(;++E<A.length;)R[E]=m(A[E],k,C);return _(),R}function m(x,k,C){const A=x.children;let E=-1;const R=[],_=k.enter("tableRow");for(;++E<A.length;)R[E]=p(A[E],x,k,C);return _(),R}function b(x,k,C){let A=XS.inlineCode(x,k,C);return C.stack.includes("tableCell")&&(A=A.replace(/\|/g,"\\$&")),A}}function lL(){return{exit:{taskListCheckValueChecked:Lb,taskListCheckValueUnchecked:Lb,paragraph:sL}}}function oL(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:cL}}}function Lb(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function sL(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const a=this.stack[this.stack.length-1];a.type;const r=a.children[0];if(r&&r.type==="text"){const o=t.children;let s=-1,c;for(;++s<o.length;){const d=o[s];if(d.type==="paragraph"){c=d;break}}c===a&&(r.value=r.value.slice(1),r.value.length===0?a.children.shift():a.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,a.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function cL(e,t,a,r){const o=e.children[0],s=typeof e.checked=="boolean"&&o&&o.type==="paragraph",c="["+(e.checked?"x":" ")+"] ",d=a.createTracker(r);s&&d.move(c);let p=XS.listItem(e,t,a,{...r,...d.current()});return s&&(p=p.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,f)),p;function f(y){return y+c}}function uL(){return[$6(),c5(),p5(),J5(),lL()]}function dL(e){return{extensions:[q6(),u5(e),h5(),rL(e),oL()]}}const fL={tokenize:vL,partial:!0},ZS={tokenize:bL,partial:!0},JS={tokenize:xL,partial:!0},ek={tokenize:wL,partial:!0},pL={tokenize:SL,partial:!0},tk={name:"wwwAutolink",tokenize:gL,previous:ak},nk={name:"protocolAutolink",tokenize:yL,previous:ik},pi={name:"emailAutolink",tokenize:mL,previous:rk},Pa={};function hL(){return{text:Pa}}let vr=48;for(;vr<123;)Pa[vr]=pi,vr++,vr===58?vr=65:vr===91&&(vr=97);Pa[43]=pi;Pa[45]=pi;Pa[46]=pi;Pa[95]=pi;Pa[72]=[pi,nk];Pa[104]=[pi,nk];Pa[87]=[pi,tk];Pa[119]=[pi,tk];function mL(e,t,a){const r=this;let o,s;return c;function c(m){return!Eh(m)||!rk.call(r,r.previous)||Dm(r.events)?a(m):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),d(m))}function d(m){return Eh(m)?(e.consume(m),d):m===64?(e.consume(m),p):a(m)}function p(m){return m===46?e.check(pL,y,f)(m):m===45||m===95||dn(m)?(s=!0,e.consume(m),p):y(m)}function f(m){return e.consume(m),o=!0,p}function y(m){return s&&o&&vn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(m)):a(m)}}function gL(e,t,a){const r=this;return o;function o(c){return c!==87&&c!==119||!ak.call(r,r.previous)||Dm(r.events)?a(c):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(fL,e.attempt(ZS,e.attempt(JS,s),a),a)(c))}function s(c){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(c)}}function yL(e,t,a){const r=this;let o="",s=!1;return c;function c(m){return(m===72||m===104)&&ik.call(r,r.previous)&&!Dm(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(m),e.consume(m),d):a(m)}function d(m){if(vn(m)&&o.length<5)return o+=String.fromCodePoint(m),e.consume(m),d;if(m===58){const b=o.toLowerCase();if(b==="http"||b==="https")return e.consume(m),p}return a(m)}function p(m){return m===47?(e.consume(m),s?f:(s=!0,p)):a(m)}function f(m){return m===null||uu(m)||yt(m)||kr(m)||Au(m)?a(m):e.attempt(ZS,e.attempt(JS,y),a)(m)}function y(m){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(m)}}function vL(e,t,a){let r=0;return o;function o(c){return(c===87||c===119)&&r<3?(r++,e.consume(c),o):c===46&&r===3?(e.consume(c),s):a(c)}function s(c){return c===null?a(c):t(c)}}function bL(e,t,a){let r,o,s;return c;function c(f){return f===46||f===95?e.check(ek,p,d)(f):f===null||yt(f)||kr(f)||f!==45&&Au(f)?p(f):(s=!0,e.consume(f),c)}function d(f){return f===95?r=!0:(o=r,r=void 0),e.consume(f),c}function p(f){return o||r||!s?a(f):t(f)}}function xL(e,t){let a=0,r=0;return o;function o(c){return c===40?(a++,e.consume(c),o):c===41&&r<a?s(c):c===33||c===34||c===38||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===60||c===63||c===93||c===95||c===126?e.check(ek,t,s)(c):c===null||yt(c)||kr(c)?t(c):(e.consume(c),o)}function s(c){return c===41&&r++,e.consume(c),o}}function wL(e,t,a){return r;function r(d){return d===33||d===34||d===39||d===41||d===42||d===44||d===46||d===58||d===59||d===63||d===95||d===126?(e.consume(d),r):d===38?(e.consume(d),s):d===93?(e.consume(d),o):d===60||d===null||yt(d)||kr(d)?t(d):a(d)}function o(d){return d===null||d===40||d===91||yt(d)||kr(d)?t(d):r(d)}function s(d){return vn(d)?c(d):a(d)}function c(d){return d===59?(e.consume(d),r):vn(d)?(e.consume(d),c):a(d)}}function SL(e,t,a){return r;function r(s){return e.consume(s),o}function o(s){return dn(s)?a(s):t(s)}}function ak(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||yt(e)}function ik(e){return!vn(e)}function rk(e){return!(e===47||Eh(e))}function Eh(e){return e===43||e===45||e===46||e===95||dn(e)}function Dm(e){let t=e.length,a=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){a=!0;break}if(r._gfmAutolinkLiteralWalkedInto){a=!1;break}}return e.length>0&&!a&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),a}const kL={tokenize:_L,partial:!0};function CL(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:TL,continuation:{tokenize:RL},exit:NL}},text:{91:{name:"gfmFootnoteCall",tokenize:jL},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:EL,resolveTo:AL}}}}function EL(e,t,a){const r=this;let o=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let c;for(;o--;){const p=r.events[o][1];if(p.type==="labelImage"){c=p;break}if(p.type==="gfmFootnoteCall"||p.type==="labelLink"||p.type==="label"||p.type==="image"||p.type==="link")break}return d;function d(p){if(!c||!c._balanced)return a(p);const f=ba(r.sliceSerialize({start:c.end,end:r.now()}));return f.codePointAt(0)!==94||!s.includes(f.slice(1))?a(p):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),t(p))}}function AL(e,t){let a=e.length;for(;a--;)if(e[a][1].type==="labelImage"&&e[a][0]==="enter"){e[a][1];break}e[a+1][1].type="data",e[a+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[a+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[a+3][1].end),end:Object.assign({},e[a+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},c={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},d=[e[a+1],e[a+2],["enter",r,t],e[a+3],e[a+4],["enter",o,t],["exit",o,t],["enter",s,t],["enter",c,t],["exit",c,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(a,e.length-a+1,...d),e}function jL(e,t,a){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,c;return d;function d(m){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),p}function p(m){return m!==94?a(m):(e.enter("gfmFootnoteCallMarker"),e.consume(m),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",f)}function f(m){if(s>999||m===93&&!c||m===null||m===91||yt(m))return a(m);if(m===93){e.exit("chunkString");const b=e.exit("gfmFootnoteCallString");return o.includes(ba(r.sliceSerialize(b)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):a(m)}return yt(m)||(c=!0),s++,e.consume(m),m===92?y:f}function y(m){return m===91||m===92||m===93?(e.consume(m),s++,f):f(m)}}function TL(e,t,a){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,c=0,d;return p;function p(k){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),f}function f(k){return k===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",y):a(k)}function y(k){if(c>999||k===93&&!d||k===null||k===91||yt(k))return a(k);if(k===93){e.exit("chunkString");const C=e.exit("gfmFootnoteDefinitionLabelString");return s=ba(r.sliceSerialize(C)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),b}return yt(k)||(d=!0),c++,e.consume(k),k===92?m:y}function m(k){return k===91||k===92||k===93?(e.consume(k),c++,y):y(k)}function b(k){return k===58?(e.enter("definitionMarker"),e.consume(k),e.exit("definitionMarker"),o.includes(s)||o.push(s),Qe(e,x,"gfmFootnoteDefinitionWhitespace")):a(k)}function x(k){return t(k)}}function RL(e,t,a){return e.check(ss,t,e.attempt(kL,t,a))}function NL(e){e.exit("gfmFootnoteDefinition")}function _L(e,t,a){const r=this;return Qe(e,o,"gfmFootnoteDefinitionIndent",5);function o(s){const c=r.events[r.events.length-1];return c&&c[1].type==="gfmFootnoteDefinitionIndent"&&c[2].sliceSerialize(c[1],!0).length===4?t(s):a(s)}}function OL(e){let a=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:s,resolveAll:o};return a==null&&(a=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function o(c,d){let p=-1;for(;++p<c.length;)if(c[p][0]==="enter"&&c[p][1].type==="strikethroughSequenceTemporary"&&c[p][1]._close){let f=p;for(;f--;)if(c[f][0]==="exit"&&c[f][1].type==="strikethroughSequenceTemporary"&&c[f][1]._open&&c[p][1].end.offset-c[p][1].start.offset===c[f][1].end.offset-c[f][1].start.offset){c[p][1].type="strikethroughSequence",c[f][1].type="strikethroughSequence";const y={type:"strikethrough",start:Object.assign({},c[f][1].start),end:Object.assign({},c[p][1].end)},m={type:"strikethroughText",start:Object.assign({},c[f][1].end),end:Object.assign({},c[p][1].start)},b=[["enter",y,d],["enter",c[f][1],d],["exit",c[f][1],d],["enter",m,d]],x=d.parser.constructs.insideSpan.null;x&&Yn(b,b.length,0,ju(x,c.slice(f+1,p),d)),Yn(b,b.length,0,[["exit",m,d],["enter",c[p][1],d],["exit",c[p][1],d],["exit",y,d]]),Yn(c,f-1,p-f+3,b),p=f+b.length-2;break}}for(p=-1;++p<c.length;)c[p][1].type==="strikethroughSequenceTemporary"&&(c[p][1].type="data");return c}function s(c,d,p){const f=this.previous,y=this.events;let m=0;return b;function b(k){return f===126&&y[y.length-1][1].type!=="characterEscape"?p(k):(c.enter("strikethroughSequenceTemporary"),x(k))}function x(k){const C=Cl(f);if(k===126)return m>1?p(k):(c.consume(k),m++,x);if(m<2&&!a)return p(k);const A=c.exit("strikethroughSequenceTemporary"),E=Cl(k);return A._open=!E||E===2&&!!C,A._close=!C||C===2&&!!E,d(k)}}}class ML{constructor(){this.map=[]}add(t,a,r){DL(this,t,a,r)}consume(t){if(this.map.sort(function(s,c){return s[0]-c[0]}),this.map.length===0)return;let a=this.map.length;const r=[];for(;a>0;)a-=1,r.push(t.slice(this.map[a][0]+this.map[a][1]),this.map[a][2]),t.length=this.map[a][0];r.push(t.slice()),t.length=0;let o=r.pop();for(;o;){for(const s of o)t.push(s);o=r.pop()}this.map.length=0}}function DL(e,t,a,r){let o=0;if(!(a===0&&r.length===0)){for(;o<e.map.length;){if(e.map[o][0]===t){e.map[o][1]+=a,e.map[o][2].push(...r);return}o+=1}e.map.push([t,a,r])}}function LL(e,t){let a=!1;const r=[];for(;t<e.length;){const o=e[t];if(a){if(o[0]==="enter")o[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(o[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const s=r.length-1;r[s]=r[s]==="left"?"center":"right"}}else if(o[1].type==="tableDelimiterRow")break}else o[0]==="enter"&&o[1].type==="tableDelimiterRow"&&(a=!0);t+=1}return r}function zL(){return{flow:{null:{name:"table",tokenize:IL,resolveAll:PL}}}}function IL(e,t,a){const r=this;let o=0,s=0,c;return d;function d(T){let G=r.events.length-1;for(;G>-1;){const q=r.events[G][1].type;if(q==="lineEnding"||q==="linePrefix")G--;else break}const W=G>-1?r.events[G][1].type:null,ae=W==="tableHead"||W==="tableRow"?O:p;return ae===O&&r.parser.lazy[r.now().line]?a(T):ae(T)}function p(T){return e.enter("tableHead"),e.enter("tableRow"),f(T)}function f(T){return T===124||(c=!0,s+=1),y(T)}function y(T){return T===null?a(T):Ae(T)?s>1?(s=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),x):a(T):Fe(T)?Qe(e,y,"whitespace")(T):(s+=1,c&&(c=!1,o+=1),T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),c=!0,y):(e.enter("data"),m(T)))}function m(T){return T===null||T===124||yt(T)?(e.exit("data"),y(T)):(e.consume(T),T===92?b:m)}function b(T){return T===92||T===124?(e.consume(T),m):m(T)}function x(T){return r.interrupt=!1,r.parser.lazy[r.now().line]?a(T):(e.enter("tableDelimiterRow"),c=!1,Fe(T)?Qe(e,k,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):k(T))}function k(T){return T===45||T===58?A(T):T===124?(c=!0,e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),C):I(T)}function C(T){return Fe(T)?Qe(e,A,"whitespace")(T):A(T)}function A(T){return T===58?(s+=1,c=!0,e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),E):T===45?(s+=1,E(T)):T===null||Ae(T)?U(T):I(T)}function E(T){return T===45?(e.enter("tableDelimiterFiller"),R(T)):I(T)}function R(T){return T===45?(e.consume(T),R):T===58?(c=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),_):(e.exit("tableDelimiterFiller"),_(T))}function _(T){return Fe(T)?Qe(e,U,"whitespace")(T):U(T)}function U(T){return T===124?k(T):T===null||Ae(T)?!c||o!==s?I(T):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(T)):I(T)}function I(T){return a(T)}function O(T){return e.enter("tableRow"),P(T)}function P(T){return T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),P):T===null||Ae(T)?(e.exit("tableRow"),t(T)):Fe(T)?Qe(e,P,"whitespace")(T):(e.enter("data"),Y(T))}function Y(T){return T===null||T===124||yt(T)?(e.exit("data"),P(T)):(e.consume(T),T===92?D:Y)}function D(T){return T===92||T===124?(e.consume(T),Y):Y(T)}}function PL(e,t){let a=-1,r=!0,o=0,s=[0,0,0,0],c=[0,0,0,0],d=!1,p=0,f,y,m;const b=new ML;for(;++a<e.length;){const x=e[a],k=x[1];x[0]==="enter"?k.type==="tableHead"?(d=!1,p!==0&&(zb(b,t,p,f,y),y=void 0,p=0),f={type:"table",start:Object.assign({},k.start),end:Object.assign({},k.end)},b.add(a,0,[["enter",f,t]])):k.type==="tableRow"||k.type==="tableDelimiterRow"?(r=!0,m=void 0,s=[0,0,0,0],c=[0,a+1,0,0],d&&(d=!1,y={type:"tableBody",start:Object.assign({},k.start),end:Object.assign({},k.end)},b.add(a,0,[["enter",y,t]])),o=k.type==="tableDelimiterRow"?2:y?3:1):o&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")?(r=!1,c[2]===0&&(s[1]!==0&&(c[0]=c[1],m=zc(b,t,s,o,void 0,m),s=[0,0,0,0]),c[2]=a)):k.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(c[0]=c[1],m=zc(b,t,s,o,void 0,m)),s=c,c=[s[1],a,0,0])):k.type==="tableHead"?(d=!0,p=a):k.type==="tableRow"||k.type==="tableDelimiterRow"?(p=a,s[1]!==0?(c[0]=c[1],m=zc(b,t,s,o,a,m)):c[1]!==0&&(m=zc(b,t,c,o,a,m)),o=0):o&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")&&(c[3]=a)}for(p!==0&&zb(b,t,p,f,y),b.consume(t.events),a=-1;++a<t.events.length;){const x=t.events[a];x[0]==="enter"&&x[1].type==="table"&&(x[1]._align=LL(t.events,a))}return e}function zc(e,t,a,r,o,s){const c=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",d="tableContent";a[0]!==0&&(s.end=Object.assign({},gl(t.events,a[0])),e.add(a[0],0,[["exit",s,t]]));const p=gl(t.events,a[1]);if(s={type:c,start:Object.assign({},p),end:Object.assign({},p)},e.add(a[1],0,[["enter",s,t]]),a[2]!==0){const f=gl(t.events,a[2]),y=gl(t.events,a[3]),m={type:d,start:Object.assign({},f),end:Object.assign({},y)};if(e.add(a[2],0,[["enter",m,t]]),r!==2){const b=t.events[a[2]],x=t.events[a[3]];if(b[1].end=Object.assign({},x[1].end),b[1].type="chunkText",b[1].contentType="text",a[3]>a[2]+1){const k=a[2]+1,C=a[3]-a[2]-1;e.add(k,C,[])}}e.add(a[3]+1,0,[["exit",m,t]])}return o!==void 0&&(s.end=Object.assign({},gl(t.events,o)),e.add(o,0,[["exit",s,t]]),s=void 0),s}function zb(e,t,a,r,o){const s=[],c=gl(t.events,a);o&&(o.end=Object.assign({},c),s.push(["exit",o,t])),r.end=Object.assign({},c),s.push(["exit",r,t]),e.add(a+1,0,s)}function gl(e,t){const a=e[t],r=a[0]==="enter"?"start":"end";return a[1][r]}const BL={name:"tasklistCheck",tokenize:HL};function UL(){return{text:{91:BL}}}function HL(e,t,a){const r=this;return o;function o(p){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?a(p):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(p),e.exit("taskListCheckMarker"),s)}function s(p){return yt(p)?(e.enter("taskListCheckValueUnchecked"),e.consume(p),e.exit("taskListCheckValueUnchecked"),c):p===88||p===120?(e.enter("taskListCheckValueChecked"),e.consume(p),e.exit("taskListCheckValueChecked"),c):a(p)}function c(p){return p===93?(e.enter("taskListCheckMarker"),e.consume(p),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),d):a(p)}function d(p){return Ae(p)?t(p):Fe(p)?e.check({tokenize:$L},t,a)(p):a(p)}}function $L(e,t,a){return Qe(e,r,"whitespace");function r(o){return o===null?a(o):t(o)}}function qL(e){return mS([hL(),CL(),OL(e),zL(),UL()])}const FL={};function GL(e){const t=this,a=e||FL,r=t.data(),o=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),c=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);o.push(qL(a)),s.push(uL()),c.push(dL(a))}function VL(e){zS(e,[/\r?\n|\r/g,WL])}function WL(){return{type:"break"}}function YL(){return function(e){VL(e)}}const lk=[{aliases:{sh:"sh",shell:"sh",zsh:"sh",bash:"bash"},load:()=>at(()=>import("./bash-Yzrsuije.js"),[])},{aliases:{css:"css"},load:()=>at(()=>import("./css-CLj8gQPS.js"),[])},{aliases:{diff:"diff",patch:"diff"},load:()=>at(()=>import("./diff-D97Zzqfu.js"),[])},{aliases:{dockerfile:"dockerfile",docker:"dockerfile"},load:()=>at(()=>import("./dockerfile-BcOcwvcX.js"),[])},{aliases:{go:"go",golang:"go"},load:()=>at(()=>import("./go-C27-OAKa.js"),[])},{aliases:{html:"html"},load:()=>at(()=>import("./html-pp8916En.js"),__vite__mapDeps([0,1,2]))},{aliases:{js:"js",javascript:"js"},load:()=>at(()=>import("./javascript-wDzz0qaB.js"),[])},{aliases:{json:"json"},load:()=>at(()=>import("./json-Cp-IABpG.js"),[])},{aliases:{jsx:"jsx"},load:()=>at(()=>import("./jsx-g9-lgVsj.js"),[])},{aliases:{md:"md",markdown:"md"},load:()=>at(()=>import("./markdown-Cvjx9yec.js"),[])},{aliases:{py:"py",python:"py"},load:()=>at(()=>import("./python-B6aJPvgy.js"),[])},{aliases:{rust:"rust",rs:"rust"},load:()=>at(()=>import("./rust-B1yitclQ.js"),[])},{aliases:{solidity:"solidity",sol:"solidity"},load:()=>at(()=>import("./solidity-rGO070M0.js"),[])},{aliases:{sparql:"sparql"},load:()=>at(()=>import("./sparql-DVZY-KUA.js"),[])},{aliases:{sql:"sql"},load:()=>at(()=>import("./sql-BLtJtn59.js"),[])},{aliases:{toml:"toml"},load:()=>at(()=>import("./toml-vGWfd6FD.js"),[])},{aliases:{tsx:"tsx"},load:()=>at(()=>import("./tsx-COt5Ahok.js"),[])},{aliases:{ts:"ts",typescript:"ts"},load:()=>at(()=>import("./typescript-BPQ3VLAy.js"),[])},{aliases:{xml:"xml"},load:()=>at(()=>import("./xml-B8PEiB0p.js"),[])},{aliases:{yaml:"yaml",yml:"yaml"},load:()=>at(()=>import("./yaml-Buea-lGh.js"),[])}],ok=Object.freeze(Object.assign({},...lk.map(({aliases:e})=>e)));Object.freeze(Object.keys(ok));function KL(e){if(!e)return null;const t=e.toLowerCase().trim();return ok[t]??null}async function GP(){return(await Promise.all(lk.map(({load:t})=>t()))).flatMap(({default:t})=>t).filter((t,a,r)=>r.findIndex(o=>o.name===t.name)===a)}let zo=null;function QL(){return zo||(zo=at(()=>import("./shikiHighlighter-DL7LOds2.js"),[]).then(e=>e.createHighlighter()).catch(e=>{throw zo=null,e}),zo)}function XL({code:e,lang:t}){const a=KL(t),[r,o]=S.useState(null),[s,c]=S.useState(!1),p=Vn(m=>m.theme)==="light"?"github-light":"github-dark",f=S.useRef(null);S.useEffect(()=>{if(!a){o(null);return}let m=!1;return QL().then(b=>{if(!m)try{o(b.codeToHtml(e,{lang:a,theme:p}))}catch{o(null)}}).catch(()=>{m||o(null)}),()=>{m=!0}},[e,a,p]),S.useEffect(()=>()=>{f.current&&clearTimeout(f.current)},[]);const y=async()=>{try{await navigator.clipboard.writeText(e),c(!0),f.current&&clearTimeout(f.current),f.current=setTimeout(()=>c(!1),1200)}catch{}};return g.jsxs("div",{className:"v10-md-pre",children:[g.jsx("button",{type:"button",className:"v10-md-copy",onClick:y,"aria-label":s?"Copied":"Copy code",title:s?"Copied":"Copy code",children:s?g.jsx(cN,{size:14,"aria-hidden":"true"}):g.jsx(hN,{size:14,"aria-hidden":"true"})}),g.jsx("span",{className:"v10-md-copy-announce","aria-live":"polite",children:s?"Copied":""}),a&&g.jsx("span",{className:"v10-md-pre-lang","aria-hidden":"true",children:a}),r?g.jsx("div",{className:"v10-md-pre-rendered",dangerouslySetInnerHTML:{__html:r}}):g.jsx("pre",{className:"v10-md-pre-fallback",children:g.jsx("code",{children:e})})]})}function ZL(){return e=>{let t="none",a=null;const r=new Set(["img","hr","br"]),o=(d,p)=>{const f=d.children;if(Array.isArray(f))for(let y=0;y<f.length;y++){const m=f[y];if(m.type==="text"&&typeof m.value=="string"&&m.value.trim().length>0)p?t="code":(a={siblings:f,index:y},t="text");else if(m.type==="element"){const b=m.tagName;b==="pre"?(t="code",o(m,!0)):b&&r.has(b)?t="leaf":o(m,p)}}},s=e;o(s,!1);const c={type:"element",tagName:"span",properties:{className:["v10-chat-cursor"]},children:[]};if(t==="text"&&a){const{siblings:d,index:p}=a;d.splice(p+1,0,c)}else t==="leaf"&&Array.isArray(s.children)&&s.children.push(c)}}function JL(e){return e?/^https?:\/\//i.test(e)?"http":/^mailto:/i.test(e)?"mailto":"inert":"inert"}function sk({content:e,streaming:t}){return g.jsx("div",{className:"v10-md",children:g.jsx(M6,{remarkPlugins:[GL,YL],rehypePlugins:t?[ZL]:[],components:{img:({src:a,alt:r,title:o})=>g.jsxs("span",{className:"v10-md-image-placeholder",title:o||(typeof a=="string"?a:void 0),children:["[image",r?`: ${r}`:"","]"]}),h1:({children:a})=>g.jsx("h1",{className:"v10-md-h1",children:a}),h2:({children:a})=>g.jsx("h2",{className:"v10-md-h2",children:a}),h3:({children:a})=>g.jsx("h3",{className:"v10-md-h3",children:a}),h4:({children:a})=>g.jsx("h4",{className:"v10-md-h4",children:a}),h5:({children:a})=>g.jsx("h5",{className:"v10-md-h5",children:a}),h6:({children:a})=>g.jsx("h6",{className:"v10-md-h6",children:a}),p:({children:a})=>g.jsx("p",{className:"v10-md-p",children:a}),ul:({children:a})=>g.jsx("ul",{className:"v10-md-ul",children:a}),ol:({children:a})=>g.jsx("ol",{className:"v10-md-ol",children:a}),li:({children:a})=>g.jsx("li",{className:"v10-md-li",children:a}),a:({href:a,children:r})=>{const o=JL(a);return o==="http"?g.jsx("a",{className:"v10-md-link",href:a,target:"_blank",rel:"noopener noreferrer",children:r}):o==="mailto"?g.jsx("a",{className:"v10-md-link",href:a,children:r}):g.jsx("span",{className:"v10-md-link v10-md-link-inert",title:a,children:r})},blockquote:({children:a})=>g.jsx("blockquote",{className:"v10-md-blockquote",children:a}),hr:()=>g.jsx("hr",{className:"v10-md-hr"}),table:({children:a})=>g.jsx("div",{className:"v10-md-table-scroll",children:g.jsx("table",{className:"v10-md-table",children:a})}),thead:({children:a,node:r,...o})=>g.jsx("thead",{className:"v10-md-thead",...o,children:a}),tbody:({children:a,node:r,...o})=>g.jsx("tbody",{className:"v10-md-tbody",...o,children:a}),tr:({children:a,node:r,...o})=>g.jsx("tr",{className:"v10-md-tr",...o,children:a}),th:({children:a,node:r,...o})=>g.jsx("th",{className:"v10-md-th",...o,children:a}),td:({children:a,node:r,...o})=>g.jsx("td",{className:"v10-md-td",...o,children:a}),pre:({children:a,node:r})=>{var s,c,d;const o=(s=r==null?void 0:r.children)==null?void 0:s[0];if((o==null?void 0:o.tagName)==="code"){const p=((d=(c=o.properties)==null?void 0:c.className)==null?void 0:d[0])??"",f=/language-([\w-]+)/.exec(p),y=(o.children??[]).map(m=>(m==null?void 0:m.value)??"").join("").replace(/\n$/,"");return g.jsx(XL,{code:y,lang:f==null?void 0:f[1]})}return g.jsx("pre",{children:a})},code:({children:a})=>g.jsx("code",{className:"v10-md-code",children:a})},children:e})})}const ez=g.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[g.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),g.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),tz=fi(()=>at(()=>import("./Operations-aVCBUh8u.js"),__vite__mapDeps([3,4])).then(e=>e.OperationsPage),"operations"),nz=fi(()=>at(()=>import("./AgentHub-CYfAoOWF.js"),[]).then(e=>e.AgentHubPage),"agent hub"),az=fi(()=>at(()=>import("./Settings-rEyPw1oS.js"),__vite__mapDeps([5,6])).then(e=>e.SettingsPage),"settings"),iz=fi(()=>at(()=>import("./AgentProfilePage-BjQm0je4.js"),__vite__mapDeps([7,8,9])).then(e=>e.AgentProfilePage),"account"),rz=fi(()=>at(()=>import("./PublishingConviction-BnAJjHL8.js"),__vite__mapDeps([10,11,6,12])).then(e=>e.PublishingConvictionPage),"Publisher Conviction"),lz=fi(()=>at(()=>import("./ConvictionDetailView-CuLUhbzR.js"),__vite__mapDeps([13,12,6,11])).then(e=>e.ConvictionDetailView),"account"),oz=fi(()=>at(()=>import("./ProjectView-Cb1PQ-jm.js"),__vite__mapDeps([14,8,9,11,15,16])).then(e=>e.ProjectView),"project"),Up=fi(()=>at(()=>import("./MemoryLayerView-Dymg_Zf_.js"),__vite__mapDeps([17,15])).then(e=>e.MemoryLayerView),({layer:e})=>({wm:"working memory",swm:"shared memory",vm:"verifiable memory"})[e]),sz=fi(()=>at(()=>import("./MemoryStackView-Bq8Fbh5W.js"),__vite__mapDeps([18,9])).then(e=>e.MemoryStackView),"memory stack");function cz(){const{tabs:e,activeTabId:t,setActiveTab:a,closeTab:r}=xn();return g.jsx("div",{className:"v10-center-tabs",children:e.map(o=>g.jsxs("button",{className:`v10-center-tab ${o.id===t?"active":""}`,onClick:()=>a(o.id),children:[g.jsx("span",{className:"v10-center-tab-label",children:o.label}),o.closable&&g.jsx("span",{className:"v10-center-tab-close",onClick:s=>{s.stopPropagation(),r(o.id)},children:ez})]},o.id))})}const uz=["text/","application/json","application/xml","application/javascript","application/x-yaml"];function dz(e){return uz.some(t=>e.startsWith(t))}function fz({docRef:e,contentType:t}){const{tabs:a,activeTabId:r,closeTab:o}=xn(),s=xn(T=>T.setActiveTab),[c,d]=S.useState(null),[p,f]=S.useState(null),[y,m]=S.useState(""),[b,x]=S.useState(!0),[k,C]=S.useState(null),[A,E]=S.useState("formatted"),R=e.startsWith("urn:dkg:file:"),_=a.find(T=>T.id===r),U=(_==null?void 0:_.label)??"Document",I=()=>{const T=a.find(G=>G.id.startsWith("project:"));T&&s(T.id),o(r)};S.useEffect(()=>{let T=!1;if(x(!0),C(null),d(null),f(null),m(""),!R){x(!1);return}const G=e.replace("urn:dkg:file:",""),W=new AbortController;return fetch(bT(G,t||void 0),{headers:Rt(),signal:W.signal}).then(async ae=>{if(!ae.ok)throw new Error(`HTTP ${ae.status}`);const q=ae.headers.get("content-type")??"application/octet-stream";if(!T)if(m(q),dz(q)){const Q=await ae.text();T||(d(Q),x(!1))}else if(q.startsWith("image/")){const Q=await ae.blob();T||(f(URL.createObjectURL(Q)),x(!1))}else if(q==="application/pdf"){const Q=await ae.blob();T||(f(URL.createObjectURL(Q)),x(!1))}else{const Q=await ae.text();T||(d(Q),x(!1))}}).catch(ae=>{T||(C(ae.message),x(!1))}),()=>{T=!0,W.abort()}},[e,R,t]),S.useEffect(()=>{E("formatted")},[e]),S.useEffect(()=>{const T=p;return()=>{T&&URL.revokeObjectURL(T)}},[p]);const O=y.startsWith("image/"),P=y==="application/pdf",Y=y.startsWith("text/markdown")||t.startsWith("text/markdown"),D=!b&&!k&&R&&Y&&c!==null;return g.jsxs("div",{style:{height:"100%",display:"flex",flexDirection:"column",overflow:"hidden"},children:[g.jsxs("div",{style:{flexShrink:0,display:"flex",alignItems:"center",gap:10,padding:"8px 16px",borderBottom:"1px solid var(--border-subtle)",background:"var(--bg-panel)"},children:[g.jsx("button",{onClick:I,style:{border:"1px solid var(--border-default)",borderRadius:5,background:"none",color:"var(--text-secondary)",fontSize:11,fontWeight:600,padding:"4px 10px",cursor:"pointer",fontFamily:"var(--font-sans)"},children:"← Back to Project"}),g.jsxs("span",{style:{fontSize:13,fontWeight:600,color:"var(--text-primary)"},children:["📄 ",U]}),D&&g.jsx("div",{role:"group","aria-label":"Document view mode",style:{marginLeft:"auto",display:"flex",gap:2,padding:2,border:"1px solid var(--border-default)",borderRadius:6,background:"var(--bg-surface)"},children:["formatted","raw"].map(T=>{const G=A===T;return g.jsx("button",{type:"button","aria-pressed":G,onClick:()=>E(T),style:{border:"none",borderRadius:4,cursor:"pointer",padding:"3px 12px",fontSize:11,fontWeight:600,fontFamily:"var(--font-sans)",color:G?"var(--text-primary)":"var(--text-secondary)",background:G?"var(--bg-elevated)":"transparent"},children:T==="formatted"?"Formatted":"Raw"},T)})})]}),g.jsx("div",{style:{flex:1,overflow:"auto",padding:"20px 24px"},children:R?g.jsxs(g.Fragment,{children:[b&&g.jsx("div",{style:{color:"var(--text-tertiary)",fontSize:12},children:"Loading document..."}),k&&g.jsxs("div",{style:{color:"var(--accent-red)",fontSize:12},children:["Failed to load: ",k]}),!b&&O&&p&&g.jsx("img",{src:p,alt:U,style:{maxWidth:"100%",borderRadius:8}}),!b&&P&&p&&g.jsx("iframe",{src:p,title:U,style:{width:"100%",height:"100%",border:"none",borderRadius:8}}),c!==null&&!O&&!P&&Y&&A==="formatted"&&g.jsx("div",{style:{background:"var(--bg-surface)",borderRadius:8,padding:"16px 20px",border:"1px solid var(--border-default)",color:"var(--text-primary)"},children:g.jsx(sk,{content:c})}),c!==null&&!O&&!P&&!(Y&&A==="formatted")&&g.jsx("pre",{style:{fontFamily:"var(--font-mono)",fontSize:12,lineHeight:1.7,color:"var(--text-primary)",whiteSpace:"pre-wrap",wordBreak:"break-word",background:"var(--bg-surface)",borderRadius:8,padding:16,border:"1px solid var(--border-default)",margin:0},children:c})]}):g.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:10,height:"100%",color:"var(--text-tertiary)",textAlign:"center"},children:[g.jsx("span",{style:{fontSize:28,opacity:.6},children:"📄"}),g.jsx("span",{style:{fontSize:13,fontWeight:600,color:"var(--text-secondary)"},children:"Source file not available for this document"}),g.jsx("span",{style:{fontSize:12,maxWidth:360,lineHeight:1.6},children:"This document was indexed into the graph without a stored source file, so there is nothing to preview here. You can still explore its extracted entities and relationships in the graph."})]})})]})}function pz(){const e=xn(t=>t.activeTabId);if(e==="dashboard")return g.jsx(y_,{});if(e==="operations")return g.jsx(tz,{});if(e==="agent-hub")return g.jsx(nz,{});if(e==="settings")return g.jsx(az,{});if(e==="conviction")return g.jsx(rz,{});if(e==="memory-stack")return g.jsx(sz,{});if(e===mm)return g.jsx(x_,{});if(e.startsWith("project:")){const t=e.slice(8);return g.jsx(oz,{contextGraphId:t})}if(e.startsWith("conviction:")){const t=e.slice(11);return g.jsx(lz,{accountId:t})}if(e.startsWith("agent:")){const t=e.slice(6),a=t.indexOf("|");if(a>0){const r=t.slice(0,a),o=t.slice(a+1),s=o.includes(":")?o:`urn:dkg:agent:${o}`;return g.jsx(iz,{contextGraphId:r,agentUri:s})}}if(e.startsWith(gm)){const{docRef:t,contentType:a}=w_(e);return g.jsx(fz,{docRef:t,contentType:a})}return e.startsWith("wm:")?g.jsx(Up,{layer:"wm",contextGraphId:e.slice(3)}):e.startsWith("swm:")?g.jsx(Up,{layer:"swm",contextGraphId:e.slice(4)}):e.startsWith("vm:")?g.jsx(Up,{layer:"vm",contextGraphId:e.slice(3)}):g.jsx("div",{className:"v10-view-placeholder",children:g.jsxs("p",{style:{color:"var(--text-tertiary)",fontSize:12},children:['View "',e,'" coming soon.']})})}function hz(){return g.jsxs("div",{className:"v10-panel-center",children:[g.jsx(cz,{}),g.jsx("div",{className:"v10-center-content",children:g.jsx(pz,{})})]})}const mz=["Node Log","Transactions"],gz=g.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:g.jsx("polyline",{points:"6 9 12 15 18 9"})}),yz=g.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[g.jsx("polyline",{points:"15 3 21 3 21 9"}),g.jsx("polyline",{points:"9 21 3 21 3 15"}),g.jsx("line",{x1:"21",y1:"3",x2:"14",y2:"10"}),g.jsx("line",{x1:"3",y1:"21",x2:"10",y2:"14"})]}),vz=g.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[g.jsx("polyline",{points:"4 14 10 14 10 20"}),g.jsx("polyline",{points:"20 10 14 10 14 4"}),g.jsx("line",{x1:"10",y1:"14",x2:"3",y2:"21"}),g.jsx("line",{x1:"21",y1:"3",x2:"14",y2:"10"})]}),bz=/(\x1B\[[0-9;]*[mGKHFJA-Z]|\[[0-9;]*m)/g;function xz(e){return e.replace(bz,"")}function Ib(e){const t=e.toLowerCase();return t.includes("error")||t.includes(" err ")||t.includes("[error]")?"error":t.includes("warn")||t.includes("[warn]")?"warn":t.includes("debug")||t.includes("[debug]")||t.includes("trace")?"debug":"info"}const wz={error:"var(--accent-red, #ef4444)",warn:"var(--accent-yellow, #f59e0b)",info:"var(--text-primary)",debug:"var(--text-tertiary)"};function Sz(e){const t=S.useRef(null),a=S.useRef(!0);return S.useEffect(()=>{const r=t.current;if(!r)return;const o=()=>{a.current=r.scrollHeight-r.scrollTop-r.clientHeight<40};return r.addEventListener("scroll",o),()=>r.removeEventListener("scroll",o)},[]),S.useEffect(()=>{a.current&&t.current&&(t.current.scrollTop=t.current.scrollHeight)},[e]),t}function kz(){const[e,t]=S.useState([]),[a,r]=S.useState(""),[o,s]=S.useState("all"),c=S.useCallback(()=>{Wn.fetchNodeLog({lines:300,q:a||void 0}).then(({lines:y})=>t((y??[]).map(xz))).catch(()=>{})},[a]);S.useEffect(()=>{c();const y=setInterval(c,3e3);return()=>clearInterval(y)},[c]);const d=e.filter(y=>o==="all"||Ib(y)===o),p=d.length>0?d[d.length-1]:"",f=Sz(p);return g.jsxs("div",{className:"v10-log-container",children:[g.jsxs("div",{className:"v10-log-toolbar",children:[g.jsx("input",{id:"dkg-node-log-filter",name:"dkg-node-log-filter",type:"text",placeholder:"Filter logs...",className:"v10-log-filter",value:a,onChange:y=>r(y.target.value),"aria-label":"Filter node log lines"}),g.jsxs("select",{id:"dkg-node-log-level",name:"dkg-node-log-level",className:"v10-log-level-select",value:o,onChange:y=>s(y.target.value),"aria-label":"Filter node log level",children:[g.jsx("option",{value:"all",children:"All"}),g.jsx("option",{value:"error",children:"Error"}),g.jsx("option",{value:"warn",children:"Warn"}),g.jsx("option",{value:"info",children:"Info"}),g.jsx("option",{value:"debug",children:"Debug"})]})]}),g.jsxs("div",{className:"v10-log-output",ref:f,children:[d.map((y,m)=>g.jsx("div",{className:"v10-log-line",style:{color:wz[Ib(y)]},children:y},m)),d.length===0&&g.jsx("div",{className:"v10-log-line",style:{color:"var(--text-tertiary)"},children:"No log output"})]})]})}const Cz=new Set(["publish","publishFromSWM","update","ka-update","verify","reconstruct"]),Ez={publish:"#22c55e",publishFromSWM:"#16a34a",update:"#14b8a6","ka-update":"#0d9488",verify:"#8b5cf6",reconstruct:"#fb923c"};function Az(){const[e,t]=S.useState([]),[a,r]=S.useState(null),o=S.useCallback(()=>{const s=String(Date.now()-216e5),c=[...Cz].join(",");Wn.fetchOperationsWithPhases({limit:"100",from:s,names:c}).then(d=>{t((d==null?void 0:d.operations)??[])}).catch(()=>{})},[]);return S.useEffect(()=>{o();const s=setInterval(o,1e4);return()=>clearInterval(s)},[o]),e.length===0?g.jsx("div",{style:{padding:"20px 16px",color:"var(--text-tertiary)",fontSize:12},children:"No publish, update, or verify activity in the last 6 hours."}):g.jsx("div",{className:"v10-log-output",style:{overflowY:"auto",flex:1},children:g.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:11},children:[g.jsx("thead",{children:g.jsxs("tr",{style:{borderBottom:"1px solid var(--border-subtle)",color:"var(--text-secondary)",textAlign:"left"},children:[g.jsx("th",{style:{padding:"6px 12px",fontWeight:600},children:"Type"}),g.jsx("th",{style:{padding:"6px 12px",fontWeight:600},children:"ID"}),g.jsx("th",{style:{padding:"6px 12px",fontWeight:600},children:"Status"}),g.jsx("th",{style:{padding:"6px 12px",fontWeight:600},children:"Duration"}),g.jsx("th",{style:{padding:"6px 12px",fontWeight:600},children:"Time"}),g.jsx("th",{style:{padding:"6px 12px",fontWeight:600},children:"Tx Hash"})]})}),g.jsx("tbody",{children:e.map(s=>{const c=(s.phases??[]).find(f=>f.phase==="chain"),d=s.tx_hash??(c==null?void 0:c.tx_hash),p=a===s.operation_id;return g.jsxs(bn.Fragment,{children:[g.jsxs("tr",{onClick:()=>r(f=>f===s.operation_id?null:s.operation_id),style:{borderBottom:"1px solid var(--border-subtle)",cursor:"pointer",background:p?"rgba(255,255,255,.03)":void 0},children:[g.jsx("td",{style:{padding:"7px 12px",color:Ez[s.operation_name]??"var(--text-secondary)",fontWeight:600},children:s.operation_name}),g.jsx("td",{style:{padding:"7px 12px",fontFamily:"var(--font-mono)",color:"var(--text-secondary)"},children:L1(s.operation_id)}),g.jsx("td",{style:{padding:"7px 12px"},children:g.jsx("span",{style:{padding:"2px 6px",borderRadius:4,fontSize:10,fontWeight:600,background:s.status==="success"?"rgba(34,197,94,.15)":s.status==="error"?"rgba(239,68,68,.15)":"rgba(245,158,11,.15)",color:s.status==="success"?"#22c55e":s.status==="error"?"#ef4444":"#f59e0b"},children:s.status})}),g.jsx("td",{style:{padding:"7px 12px",color:"var(--text-secondary)"},children:s.duration_ms!=null?D1(s.duration_ms):"—"}),g.jsx("td",{style:{padding:"7px 12px",color:"var(--text-secondary)"},children:s.started_at?m3(s.started_at):"—"}),g.jsx("td",{style:{padding:"7px 12px",fontFamily:"var(--font-mono)",color:"var(--text-tertiary)",maxWidth:140,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:d?`${d.slice(0,10)}…`:s.status==="success"?g.jsx("span",{style:{fontFamily:"var(--font-sans)",fontStyle:"italic",color:"var(--text-tertiary)"},children:"local"}):"—"})]}),p&&g.jsx("tr",{style:{background:"rgba(0,0,0,.2)"},children:g.jsxs("td",{colSpan:6,style:{padding:"8px 16px"},children:[g.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:16,fontSize:11,color:"var(--text-secondary)"},children:[g.jsxs("span",{children:[g.jsx("b",{children:"ID:"})," ",g.jsx("span",{style:{fontFamily:"var(--font-mono)"},children:s.operation_id})]}),d&&g.jsxs("span",{children:[g.jsx("b",{children:"Tx:"})," ",g.jsx("span",{style:{fontFamily:"var(--font-mono)"},children:d})]}),s.peer_id&&g.jsxs("span",{children:[g.jsx("b",{children:"Peer:"})," ",g.jsx("span",{style:{fontFamily:"var(--font-mono)"},children:L1(s.peer_id)})]}),s.error_message&&g.jsxs("span",{style:{color:"#ef4444"},children:[g.jsx("b",{children:"Error:"})," ",s.error_message]})]}),(s.phases??[]).length>0&&g.jsx("div",{style:{marginTop:8,display:"flex",gap:6,flexWrap:"wrap"},children:s.phases.map(f=>g.jsxs("span",{style:{padding:"2px 8px",borderRadius:4,fontSize:10,fontWeight:600,background:"rgba(255,255,255,.06)",color:"var(--text-secondary)"},children:[f.phase," ",f.duration_ms!=null?D1(f.duration_ms):""]},f.phase))})]})})]},s.operation_id)})})]})})}function jz(){const{bottomCollapsed:e,toggleBottom:t,bottomMaximised:a,toggleBottomMaximised:r,bottomHeight:o,setBottomHeight:s}=Vn(),[c,d]=S.useState("Node Log"),p=S.useRef(null),f=S.useRef(o);f.current=o,S.useEffect(()=>{const m=p.current;if(!m)return;let b=0;const x=A=>{const E=b-A.clientY;b=A.clientY,s(f.current+E)},k=()=>{document.removeEventListener("mousemove",x),document.removeEventListener("mouseup",k),document.body.style.cursor="",document.body.style.userSelect="",m.classList.remove("active")},C=A=>{A.preventDefault(),b=A.clientY,document.addEventListener("mousemove",x),document.addEventListener("mouseup",k),document.body.style.cursor="row-resize",document.body.style.userSelect="none",m.classList.add("active")};return m.addEventListener("mousedown",C),()=>m.removeEventListener("mousedown",C)},[s]);const y=e?void 0:a?"80vh":Math.min(o,Xc());return g.jsxs("div",{className:`v10-panel-bottom ${e?"collapsed":""} ${a?"maximised":""}`,style:e?void 0:{height:y},children:[!e&&!a&&g.jsx("div",{className:"v10-resize-handle-v",ref:p,title:"Drag to resize"}),g.jsxs("div",{className:"v10-bottom-tabs",children:[mz.map(m=>g.jsx("button",{className:`v10-bottom-tab ${m===c?"active":""}`,onClick:()=>{d(m),e&&t()},children:m},m)),g.jsx("div",{style:{flex:1}}),g.jsx("button",{className:"v10-bottom-toggle",onClick:r,title:a?"Restore":"Maximise",style:{display:e?"none":void 0},children:a?vz:yz}),g.jsx("button",{className:"v10-bottom-toggle",onClick:t,title:e?"Expand":"Collapse",children:g.jsx("span",{style:{transform:e?"rotate(180deg)":"none",display:"flex",transition:"transform 0.15s"},children:gz})})]}),!e&&g.jsxs("div",{className:"v10-bottom-content",children:[c==="Node Log"&&g.jsx(kz,{}),c==="Transactions"&&g.jsx(Az,{})]})]})}function Pb(e){const t=Math.floor(e/1e3);if(t<60)return`${t}s`;const a=Math.floor(t/60);return a<60?`${a}m`:`${Math.floor(a/60)}h ${a%60}m`}function hu(e){if(e==null||e==="")return"";const t=e instanceof Date?e:new Date(e);return Number.isNaN(t.valueOf())?typeof e=="string"?e:"":t.toLocaleString([],{dateStyle:"medium",timeStyle:"short"})}function Ah(e){if(e==null||e==="")return;const t=e instanceof Date?e:new Date(e);if(!Number.isNaN(t.valueOf()))return t.toISOString()}function Tz(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Rz(e){var a;const t=((a=e.split(".").pop())==null?void 0:a.toLowerCase())??"";return["md","txt","csv","json","xml","yaml","yml"].includes(t)?"TXT":["pdf"].includes(t)?"PDF":["docx","doc"].includes(t)?"DOC":["png","jpg","jpeg","webp"].includes(t)?"IMG":["py","ts","js","tsx","jsx","java","go","rs","c","cpp"].includes(t)?"CODE":"FILE"}function jh(e,t){var a;return((a=e.find(r=>r.id===t))==null?void 0:a.name)??t}function Nz(e){return e.startsWith("did:dkg:context-graph:")?e:`did:dkg:context-graph:${e}`}function _z(e){return String(e??"").replace(/[\u0000-\u001F\u007F]/g," ").replace(/\s+/g," ").trim()}function ck(e){if(e.length===0)return"";const t=e.map(a=>a.fileName);return t.length<=2?`Attached ${t.join(" and ")}.`:`Attached ${t[0]} and ${t.length-1} more files.`}function uk(e){return e.status==="queued"||e.status==="completed"||e.status==="skipped"}function dk(e){return e.name.trim()}function Oz(e){if(e.status!=="completed"||!e.result)return null;const t=e.result.extraction.mdIntermediateHash,a=t??(e.result.detectedContentType==="text/markdown"?e.result.fileHash:void 0);return{id:e.id,fileName:dk(e.file),contextGraphId:e.contextGraphId,assertionName:e.assertionName,assertionUri:e.result.assertionUri,fileHash:e.result.fileHash,detectedContentType:e.result.detectedContentType,rootEntity:e.result.rootEntity,extractionStatus:"completed",tripleCount:e.result.extraction.tripleCount??e.result.extraction.triplesWritten,...t?{mdIntermediateHash:t}:{},...a?{markdownHash:a,markdownForm:`urn:dkg:file:${a}`}:{}}}function Mz(e){const t=[];return{results:e.flatMap(r=>{if(r.status!=="skipped"||!r.result)return[];t.push(r.id);const o=r.result,s=o.extraction;return[{id:r.id,fileName:dk(r.file),contextGraphId:r.contextGraphId,assertionName:r.assertionName,assertionUri:o.assertionUri,fileHash:o.fileHash,detectedContentType:o.detectedContentType,extractionStatus:"skipped",pipelineUsed:s.pipelineUsed??null,tripleCount:s.tripleCount??s.triplesWritten??0,...o.rootEntity?{rootEntity:o.rootEntity}:{},...s.mdIntermediateHash?{mdIntermediateHash:s.mdIntermediateHash}:{},...s.error?{error:s.error}:{}}]}),deliveredDraftIds:t}}function fk(e){return e.length===0?"":e.length===1?`Attachment import result: ${_z(e[0].fileName)}.`:`Attached ${e.length} document import results.`}function Dz(e,t){const a=[ck(e),fk(t)].filter(r=>r.length>0).map(r=>r.replace(/\.$/,""));return a.length?`${a.join("; ")}.`:""}function Lz(e,t,a){const r=[];if(t){const o=jh(e,t);r.push({key:"target_context_graph",label:"Target context graph id",value:t}),r.push({key:"target_context_graph_uri",label:"Target context graph URI",value:Nz(t)}),r.push({key:"target_context_graph_name",label:"Target context graph name",value:o})}return a!=null&&a.agentAddress&&r.push({key:"current_agent_address",label:"Current agent address",value:a.agentAddress}),a!=null&&a.agentDid&&r.push({key:"current_agent_did",label:"Current agent DID",value:a.agentDid}),a!=null&&a.peerId&&r.push({key:"current_agent_peer_id",label:"Current agent peer ID",value:a.peerId}),r}const zz="https://docs.openclaw.ai/",Iz="https://github.com/openclaw/openclaw/releases",Sr="__add_agent__",Pz=["openclaw"];function Bz(e,t){const a=t instanceof Error?t.message:String(t??"Unknown error");if(t instanceof tu){if(t.code==="HERMES_BRIDGE_RESPONSE_TIMEOUT")return`${e.name} bridge response timed out.`;if(t.code==="HERMES_GATEWAY_RESPONSE_TIMEOUT")return`${e.name} gateway response timed out.`;if(t.code==="OPENCLAW_BRIDGE_RESPONSE_TIMEOUT")return`${e.name} bridge response timed out.`;if(t.code==="OPENCLAW_GATEWAY_RESPONSE_TIMEOUT")return`${e.name} gateway response timed out.`;if(t.code==="PRIME_AGENT_SESSION_BUSY")return`${e.name} session is busy — try again in a moment.`;if(t.code==="PRIME_AGENT_NO_SESSION")return`No live ${e.name} session is available. Start or resume a session, then send again.`;if(t.code==="PRIME_AGENT_PROVIDER_UNAUTHORIZED")return`${e.name} provider authentication failed. Check its provider credentials and try again.`;if(t.code==="PRIME_AGENT_PROVIDER_ERROR")return`${e.name} provider request failed. Check its provider configuration and try again.`;if(t.code==="PRIME_AGENT_TURN_ABORTED")return`${e.name} turn was aborted.`;if(t.code==="PRIME_AGENT_TURN_TIMEOUT")return`${e.name} turn exceeded its maximum run time.`;if(t.code==="PRIME_AGENT_DELIVERY_FAILED")return`${e.name} rejected the message before starting the turn.`;if(t.code==="SWM_SYNC_TIMEOUT"||t.source==="background-sync")return"Background sync timed out. The chat request was not marked as failed by the local-agent bridge."}return/OpenClaw bridge unreachable/i.test(a)?`${e.name} is unavailable right now.`:/Hermes bridge unreachable/i.test(a)?`${e.name} is unavailable right now.`:/gateway response timeout/i.test(a)?`${e.name} gateway response timed out.`:/bridge response timeout/i.test(a)||/aborted due to timeout/i.test(a)?`${e.name} bridge response timed out.`:/Agent response timeout/i.test(a)?`${e.name} took too long to respond.`:/Agent returned no text response/i.test(a)||/\(no response\)/i.test(a)?`${e.name} did not return a text reply.`:a}function Hp(e,t,a){return e+(t-e)*a}function pk(e){return e-Math.floor(e)}function $p(e,t){const a=Math.floor(e),r=Math.floor(t);let o=e-a,s=t-r;o=o*o*(3-2*o),s=s*s*(3-2*s);const c=ua(a,r),d=ua(a+1,r),p=ua(a,r+1),f=ua(a+1,r+1);return c+(d-c)*o+(p-c)*s+(c-d-p+f)*o*s}function ua(e,t){const a=Math.sin(e*12.9898+t*78.233)*43758.5453;return a-Math.floor(a)}function Lm(e,t){const a=Math.PI*(3-Math.sqrt(5)),r=1-2*(e+.5)/t,o=Math.sqrt(1-r*r),s=e*a;return[o*Math.cos(s),r,o*Math.sin(s)]}function Uz(e,t){return Math.atan2(Math.sin(e-t),Math.cos(e-t))}function jr(e,t,a,r,o){const s=Math.sin(t),c=Math.cos(t),d=Math.sin(e),p=Math.cos(e);return(f,y,m)=>{const b=f*p+m*d,x=-f*d+m*p,k=y*c-x*s,C=y*s+x*c;return[a+b*o,r-k*o,C]}}function Ki(e,t,a,r=.3){t.sort((o,s)=>o.z-s.z);for(const o of t){const s=o.a??1;if(s<.02)continue;const c=Math.min(1,Math.max(0,o.white)),d=Math.round((a?1-c:c)*255);e.fillStyle=`rgba(${d},${d},${d},${s})`,e.beginPath(),e.arc(o.x,o.y,Math.max(r,o.r),0,Math.PI*2),e.fill()}}function Hz(e,t,a){for(const r of t){const o=r.a??1;if(o<.02)continue;const s=Math.min(1,Math.max(0,r.white)),c=Math.round((a?1-s:s)*255);e.strokeStyle=`rgba(${c},${c},${c},${o})`,e.lineWidth=r.w,e.beginPath(),e.moveTo(r.x1,r.y1),e.lineTo(r.x2,r.y2),e.stroke()}}function Tr(e,t){return(e/300)**t}const $z=(e,t,a,r,o)=>{const s=t/2,c=t/2,d=t/2*.76,p=jr(a*.4,.3,s,c,1),f=Tr(t,o.rsPow??.6),y=[],m=o.ghostN??150;for(let k=0;k<m;k++){const C=Lm(k,m),[A,E,R]=p(C[0]*d,C[1]*d,C[2]*d),_=(R/d+1)/2;y.push({x:A,y:E,z:R,r:.8*f,white:.78,a:.1+.22*_})}const b=o.strandN??52,x=o.turns??3;for(let k=0;k<3;k++){const C=k/3*2*Math.PI;for(let A=0;A<b;A++){const E=(pk(A/b+a*.045)*2-1)*.96,R=Math.sqrt(Math.max(0,1-E*E)),_=Math.min(1,(1-Math.abs(E))/.1),U=E*Math.PI*x+C,I=1+.075*Math.sin(E*Math.PI*x*2+C*2+a*.8),O=R*d*I,[P,Y,D]=p(Math.cos(U)*O,E*d*I,Math.sin(U)*O),T=(D/d+1)/2;y.push({x:P,y:Y,z:D,r:((o.rBase??1.2)+(o.rDepth??1.8)*T)*f,white:.55-.45*T,a:_*(.45+.55*T)})}}Ki(e,y,r,o.rMin)};function qz(e,t,a,r){const o=2*t*a+r,s=e%o,c=new Array(t).fill(0);let d=-1;if(s<2*t*a){const p=Math.floor(s/a),f=(s-p*a)/a,y=1-(1-Math.min(1,f/.7))**3;if(p<t){for(let m=0;m<p;m++)c[m]=1;c[p]=y,d=p}else{const m=2*t-1-p;for(let b=0;b<m;b++)c[b]=1;c[m]=1-y,d=m}}return{amount:c,active:d}}function Fz(e,t,a){let[r,o,s]=e,c=!1;for(let d=0;d<t.length;d++){if(a.amount[d]<=0)continue;const p=t[d],f=p.axis===0?r:p.axis===1?o:s;if(f<p.lo||f>=p.hi)continue;d===a.active&&(c=!0);const y=p.ang*a.amount[d],m=Math.cos(y),b=Math.sin(y);if(p.axis===0){const x=o*m-s*b;s=o*b+s*m,o=x}else if(p.axis===1){const x=r*m+s*b;s=-r*b+s*m,r=x}else{const x=r*m-o*b;o=r*b+o*m,r=x}}return[r,o,s,c]}function Gz(e){const t=[];for(let a=0;a<e;a++){const r=Math.min(2,Math.floor(ua(a,2.3)*3)),o=-1+.5*Math.min(3,Math.floor(ua(a,5.9)*4)),s=ua(a,7.7)<.5?1:-1;t.push({axis:r,lo:o,hi:o+.5,ang:s*Math.PI/2})}return t}const Vz=(e,t,a,r,o)=>{const s=t/2,c=t/2,d=t/2*.82,p=.4+.06*Math.sin(a*.35),f=jr(a*.5,p,s,c,d),y=a*(.5+(1.7-.5)*(o.scanMul??1)),m=Tr(t,o.rsPow??.6),b=o.dimBase??1,x=[],k=o.latRings??17,C=o.lonDensity??44;for(let A=0;A<=k;A++){const E=-Math.PI/2+A/k*Math.PI,R=Math.cos(E),_=Math.sin(E),U=Math.max(1,Math.round(Math.abs(R)*C));for(let I=0;I<U;I++){const O=I/U*2*Math.PI,[P,Y,D]=f(R*Math.cos(O),_,R*Math.sin(O)),T=(D+1)/2,G=Uz(O+a*.5,y),W=Math.exp(-(G*G)/.18)*Math.max(0,D);x.push({x:P,y:Y,z:D,r:((o.rBase??.6)+(o.rDepth??1.7)*T+(o.rBoost??1)*W)*m,white:(o.inkFar??.62)-(o.inkSpan??.54)*T,a:b+(1-b)*Math.min(1,W)})}}Ki(e,x,r,o.rMin)},Wz=(e,t,a,r,o)=>{const s=t/2,c=t/2,d=t/2*.82,p=jr(a*.55,.35+.1*Math.sin(a*.9),s,c,d),f=Tr(t,o.rsPow??.6),y=o.moveCount??14,m=Gz(y),b=qz(a,y,.42,1.2),x=[],k=o.latRings??15,C=o.lonDensity??40;for(let A=0;A<=k;A++){const E=-Math.PI/2+A/k*Math.PI,R=Math.cos(E),_=Math.sin(E),U=Math.max(1,Math.round(Math.abs(R)*C));for(let I=0;I<U;I++){const O=I/U*2*Math.PI,[P,Y,D,T]=Fz([R*Math.cos(O),_,R*Math.sin(O)],m,b),[G,W,ae]=p(P,Y,D),q=(ae+1)/2;x.push({x:G,y:W,z:ae,r:((o.rBase??.6)+(o.rDepth??1.7)*q+(T?o.rActive??.3:0))*f,white:(o.inkFar??.62)-(o.inkSpan??.54)*q-(T?.14:0)})}}Ki(e,x,r,o.rMin)},Yz=(e,t,a,r,o)=>{const s=t/2,c=t/2,d=t/2*.874,p=jr(a*.18,.38,s,c,1),f=Tr(t,o.rsPow??.6),y=[],m=o.rings??15,b=o.lonDensity??40;for(let x=0;x<=m;x++){const k=-Math.PI/2+x/m*Math.PI,C=Math.cos(k),A=Math.sin(k),E=.62*Math.sin(a*2.1-x*.52)+.38*Math.sin(a*1.27+x*.83),R=d*(.88+.105*E),_=Math.max(1,Math.round(Math.abs(C)*b));for(let U=0;U<_;U++){const I=U/_*2*Math.PI,[O,P,Y]=p(C*Math.cos(I)*R,A*R,C*Math.sin(I)*R),D=(Y/d+1)/2,T=Math.max(0,E);y.push({x:O,y:P,z:Y,r:((o.rBase??.6)+(o.rDepth??1.7)*D)*(1+.4*T)*f,white:.66-.56*D-.1*T})}}Ki(e,y,r,o.rMin)};function Kz(e){return e*e*(3-2*e)}function hk(e){const t=e.length,a=[];let r=0;for(let o=0;o<t;o++){const s=e[o],c=e[(o+1)%t],d=Math.hypot(c[0]-s[0],c[1]-s[1]);a.push(d),r+=d}return o=>{let s=o*r,c=0;for(;s>a[c]&&c<t-1;)s-=a[c],c++;const d=e[c],p=e[(c+1)%t],f=a[c]?Math.min(1,s/a[c]):0;return[d[0]+(p[0]-d[0])*f,d[1]+(p[1]-d[1])*f]}}const Qz=e=>{const t=-Math.PI/2+e*2*Math.PI;return[Math.cos(t)*.24,Math.sin(t)*.24]},Xz=hk([[0,-.26],[.24,.16],[-.24,.16]]),Zz=hk([[0,-.2],[.2,-.2],[.2,.2],[-.2,.2],[-.2,-.2]]),qp=[Qz,Xz,Zz];function Jz(e){return Math.max(6,Math.round(34*e))}const Th=1.4,mk=.9,Fp=Th+mk,eI=(e,t,a,r,o)=>{const s=qp.length,c=a%(Fp*s),d=Math.floor(c/Fp),p=c-d*Fp,f=p>Th?Kz((p-Th)/mk):0,y=o.spread??1,m=qp[d],b=qp[(d+1)%s],x=160,k=[];for(let Y=0;Y<x;Y++){const D=Y/x,T=m(D),G=b(D);k.push([(T[0]+(G[0]-T[0])*f)*y,(T[1]+(G[1]-T[1])*f)*y])}const C=[];let A=0;for(let Y=0;Y<x;Y++){const D=k[Y],T=k[(Y+1)%x],G=Math.hypot(T[0]-D[0],T[1]-D[1]);C.push(G),A+=G}const E=Jz(o.iconD??1),R=(o.rDot??.021)*1.35*y,_=1+.02*Math.sin(p*3.1),U=[],I=t/2;let O=0,P=0;for(let Y=0;Y<E;Y++){const D=Y/E*A;for(;P+C[O]<D&&O<x-1;)P+=C[O],O++;const T=k[O],G=k[(O+1)%x],W=C[O]?Math.min(1,(D-P)/C[O]):0,ae=(T[0]+(G[0]-T[0])*W)*_,q=(T[1]+(G[1]-T[1])*W)*_;U.push({x:I+ae*t,y:I+q*t,z:0,r:Math.max(.35,R*t),white:.1})}Ki(e,U,r,o.rMin)},tI=(e,t,a,r,o)=>{const s=t/2,c=t/2,d=t/2*.82,p=jr(a*.12,.3,s,c,1),f=Tr(t,o.rsPow??.6),y=[],m=o.orbitN??12,b=o.ghostN??40,x=o.particles??3;for(let k=0;k<m;k++){const C=ua(k,1.7),A=ua(k,5.2),E=ua(k,8.9),R=d*(.45+.52*C),_=C*2*Math.PI,U=Math.acos(2*A-1),I=Math.sin(U)*Math.cos(_),O=Math.cos(U),P=Math.sin(U)*Math.sin(_);let Y=-O,D=I;const T=0,G=Math.max(1e-6,Math.sqrt(Y*Y+D*D));Y/=G,D/=G;const W=O*T-P*D,ae=P*Y-I*T,q=I*D-O*Y,Q=(.25+.55*E)*(E>.5?1:-1);for(let F=0;F<b;F++){const ee=F/b*2*Math.PI,[ie,X,M]=p((Y*Math.cos(ee)+W*Math.sin(ee))*R,(D*Math.cos(ee)+ae*Math.sin(ee))*R,(T*Math.cos(ee)+q*Math.sin(ee))*R),L=(M/R+1)/2;y.push({x:ie,y:X,z:M,r:(o.ghostR??.9)*f,white:.72,a:(o.ghostA??.5)*(.4+.6*L)})}for(let F=0;F<x;F++){const ee=a*Q+F/x*2*Math.PI+A*6,[ie,X,M]=p((Y*Math.cos(ee)+W*Math.sin(ee))*R,(D*Math.cos(ee)+ae*Math.sin(ee))*R,(T*Math.cos(ee)+q*Math.sin(ee))*R),L=(M/R+1)/2;y.push({x:ie,y:X,z:M,r:((o.partR??1.2)+(o.partRDepth??1.6)*L)*f,white:.3-.22*L})}}Ki(e,y,r,o.rMin)},Bb=(e,t,a,r,o)=>{const s=t/2,c=t/2,d=t/2*.78,p=o.spin??1,f=.3,y=jr(a*.1*p,f,s,c,1),m=Tr(t,o.rsPow??.6),b=[],x=o.ghostN??150;for(let q=0;q<x;q++){const Q=Lm(q,x),[F,ee,ie]=y(Q[0]*d,Q[1]*d,Q[2]*d),X=(ie/d+1)/2;b.push({x:F,y:ee,z:ie,r:.8*m,white:.78,a:.1+.22*X})}const k=a*.24*p,C=o.faceOn?-f:.55+.3*Math.sin(a*.18)*p,A=Math.cos(k),E=0,R=Math.sin(k),_=-R*Math.sin(C),U=Math.cos(C),I=A*Math.sin(C),O=E*I-R*U,P=R*_-A*I,Y=A*U-E*_,D=.23*(o.wobMul??1),T=o.faceOn?d/(1+.85*D):d,G=o.lanes??5,W=o.segs??88,ae=Math.max(1,Math.round(G*(o.bandMul??1)));for(let q=0;q<ae;q++){const Q=(q-(ae-1)/2)*.075,F=Math.abs(q-(ae-1)/2)/Math.max(1,(ae-1)/2);for(let ee=0;ee<W;ee++){const ie=ee/W*2*Math.PI,X=(.16*Math.sin(ie*3-a*1.7+q*.22)+.07*Math.sin(ie*5+a*1.1))*(o.wobMul??1),M=o.faceOn?1+X:1,L=o.faceOn?Q:Q+X,K=A*Math.cos(ie)+_*Math.sin(ie)+O*L,N=E*Math.cos(ie)+U*Math.sin(ie)+P*L,ue=R*Math.cos(ie)+I*Math.sin(ie)+Y*L,ge=Math.sqrt(K*K+N*N+ue*ue),me=T*M,[Ee,Ue,Re]=y(K/ge*me,N/ge*me,ue/ge*me),tt=(Re/d+1)/2;b.push({x:Ee,y:Ue,z:Re,r:((o.rBase??1.1)+(o.rDepth??1.7)*tt)*(1-.25*F)*m,white:.52-.44*tt+.18*F,a:.4+.6*tt})}}Ki(e,b,r,o.rMin)},nI=(e,t,a,r,o)=>{const s=t/2,c=t/2,d=t/2*.8*(o.spread??1),p=jr(a*.12,.32,s,c,d),f=Tr(t,o.rsPow??.6),y=o.nodeN??30,m=o.thr??.72,b=o.nodeR??1.4,x=o.nodeRDepth??1.8,k=[];for(let R=0;R<y;R++){const _=Lm(R,y),U=_[0]+.3*($p(R*.31+9,a*.24)-.5)*2,I=_[1]+.3*($p(R*.53+27,a*.21)-.5)*2,O=_[2]+.3*($p(R*.77+55,a*.27)-.5)*2,P=Math.sqrt(U*U+I*I+O*O);k.push([U/P,I/P,O/P])}const C=[],A=[];for(let R=0;R<y;R++)for(let _=R+1;_<y;_++){const U=k[R][0]-k[_][0],I=k[R][1]-k[_][1],O=k[R][2]-k[_][2],P=Math.sqrt(U*U+I*I+O*O);if(P>=m)continue;const[Y,D,T]=p(k[R][0],k[R][1],k[R][2]),[G,W,ae]=p(k[_][0],k[_][1],k[_][2]),q=((T+ae)/2+1)/2;C.push({x1:Y,y1:D,x2:G,y2:W,white:.42,a:(1-P/m)*(.3+.55*q),w:Math.max(.6,(o.lineW??.8)*f)})}for(let R=0;R<y;R++){const[_,U,I]=p(k[R][0],k[R][1],k[R][2]),O=(I+1)/2,P=1+.25*Math.sin(a*1.4+R*2.7);A.push({x:_,y:U,z:I,r:(b+x*O)*P*f,white:.55-.45*O})}const E=o.signals??5;for(let R=0;R<E;R++){const _=Math.floor(a*.55+R*7.31),U=Math.floor(ua(_,R*3.1+1.7)*y),I=Math.floor(ua(_,R*5.7+4.2)*y);if(U===I)continue;const O=pk(a*.55+R*7.31),P=Hp(k[U][0],k[I][0],O),Y=Hp(k[U][1],k[I][1],O),D=Hp(k[U][2],k[I][2],O),T=Math.max(1e-6,Math.sqrt(P*P+Y*Y+D*D)),[G,W,ae]=p(P/T,Y/T,D/T),q=(ae+1)/2;A.push({x:G,y:W,z:ae,r:(b*1.5+x*q)*f,white:.05,a:.5+.5*q})}Hz(e,C,r),Ki(e,A,r,o.rMin)},aI={orbits:tI,globe:Vz,rubik:Wz,wave:Yz,web:nI,braid:$z,ribbon:Bb,ring:Bb,morph:eI},iI=[["latRings","lonDensity"],["rings","lonDensity"],["lanes","segs"]],rI=["orbitN","ghostN","nodeN","strandN","signals"],lI=["iconD"],oI=["rBase","rDepth","rActive","rDot","ghostR","partR","partRDepth","nodeR","nodeRDepth"];function sI(e,t){const a={...e},r=new Set,o=Math.sqrt(t);for(const[s,c]of iI){const d=a[s],p=a[c];d!=null&&p!=null&&!r.has(s)&&!r.has(c)&&(a[s]=Math.max(2,Math.round(d*o)),a[c]=Math.max(2,Math.round(p*o)),r.add(s),r.add(c))}for(const s of rI){const c=a[s];c!=null&&c!==0&&!r.has(s)&&(a[s]=Math.max(1,Math.round(c*t)))}for(const s of lI){const c=a[s];c!=null&&(a[s]=Math.max(.02,c*t))}return a}function cI(e,t){const a={...e};for(const r of oI){const o=a[r];o!=null&&(a[r]=o*t)}return a.rSizeMul=(a.rSizeMul??1)*t,a}const uI={globe:{latRings:17,lonDensity:44,rBase:.6,rDepth:1.7,rBoost:1,inkFar:.62,inkSpan:.54,rsPow:.6,rMin:.3},orbits:{orbitN:12,ghostN:40,ghostR:.9,ghostA:.5,particles:3,partR:1.2,partRDepth:1.6,rsPow:.6,rMin:.3},rubik:{latRings:15,lonDensity:40,moveCount:14,rBase:.6,rDepth:1.7,rActive:.3,inkFar:.62,inkSpan:.54,rsPow:.6,rMin:.3},wave:{rings:15,lonDensity:40,rBase:.6,rDepth:1.7,rsPow:.6,rMin:.3},web:{nodeN:30,thr:.72,signals:5,nodeR:1.4,nodeRDepth:1.8,lineW:.8,rsPow:.6,rMin:.3},braid:{strandN:52,turns:3,ghostN:150,rBase:1.2,rDepth:1.8,rsPow:.6,rMin:.3},ribbon:{lanes:5,segs:88,ghostN:150,rBase:1.1,rDepth:1.7,rsPow:.6,rMin:.3},ring:{lanes:5,segs:88,ghostN:0,faceOn:1,rBase:1.1,rDepth:1.7,rsPow:.6,rMin:.3},morph:{rDot:.021,iconD:1,rMin:.25}},dI={working:"orbits",searching:"globe",solving:"rubik",listening:"wave",connecting:"web",weaving:"braid",composing:"ribbon",breathing:"ring",shaping:"morph"},fI={orbits:{64:{speed:1.885,count:1,size:1},20:{speed:3.9,count:.238,size:2.4}},globe:{64:{speed:2.015,count:.42,size:1.15,extra:{scanMul:4.08,dimBase:.45}},20:{speed:2.665,count:.105,size:1.75,extra:{scanMul:4.335,dimBase:.45}}},rubik:{64:{speed:1.82,count:.35,size:1.05},20:{speed:1.95,count:.088,size:1.9}},wave:{64:{speed:4.388,count:.341,size:1},20:{speed:3.998,count:.105,size:1.6}},web:{64:{speed:3.315,count:1.35,size:.95},20:{speed:6.63,count:.25,size:1.52}},braid:{64:{speed:1.625,count:.5,size:1},20:{speed:2.75,count:.1125,size:1.36}},ribbon:{64:{speed:2.34,count:.25,size:.85,extra:{spin:0,bandMul:3.9,wobMul:1}},20:{speed:3.12,count:.051,size:1.073,extra:{spin:0,bandMul:4.94,wobMul:1}}},ring:{64:{speed:3.24,count:.25,size:.956,extra:{spin:0,bandMul:3.627,wobMul:.368}},20:{speed:3.78,count:.028,size:1.622,extra:{spin:0,bandMul:3.968,wobMul:.565}}},morph:{64:{speed:2.405,count:.702,size:.395,extra:{spread:1.45}},20:{speed:2.08,count:.53,size:1.011,extra:{spread:1.45}}}},Ub=new Map;function pI(e,t){const a=`${e}-${t}`,r=Ub.get(a);if(r)return r;const o=dI[e],s=fI[o][t];let c={...uI[o]};s.count!==1&&(c=sI(c,s.count)),s.size!==1&&(c=cI(c,s.size)),s.extra&&(c={...c,...s.extra});const d={mode:o,speed:s.speed,opts:c};return Ub.set(a,d),d}function hI(e){let t=e;for(;t;){const a=t.getAttribute("data-theme");if(a==="dark")return!0;if(a==="light")return!1;if(t.classList.contains("dark"))return!0;if(t.classList.contains("light"))return!1;t=t.parentElement}return null}function mI(){return typeof matchMedia>"u"||matchMedia("(prefers-color-scheme: dark)").matches}function gI(e,t){const[a,r]=S.useState(!0);return S.useEffect(()=>{if(e==="dark"){r(!0);return}if(e==="light"){r(!1);return}const o=()=>{const p=hI(t.current);r(p??mI())};o();const s=typeof matchMedia<"u"?matchMedia("(prefers-color-scheme: dark)"):null,c=()=>o();s==null||s.addEventListener("change",c);let d=null;return typeof MutationObserver<"u"&&t.current&&(d=new MutationObserver(o),d.observe(document.documentElement,{attributes:!0,attributeFilter:["class","data-theme"],subtree:!0})),()=>{s==null||s.removeEventListener("change",c),d==null||d.disconnect()}},[e,t]),a}function yI(){const[e,t]=S.useState(!1);return S.useEffect(()=>{if(typeof matchMedia>"u")return;const a=matchMedia("(prefers-reduced-motion: reduce)");t(a.matches);const r=o=>t(o.matches);return a.addEventListener("change",r),()=>a.removeEventListener("change",r)},[]),e}const vI={working:"Working…",searching:"Searching…",solving:"Solving…",listening:"Listening…",connecting:"Connecting…",weaving:"Weaving…",composing:"Composing…",breathing:"Thinking…",shaping:"Shaping…"};function bI({state:e="working",size:t=64,theme:a="auto",speed:r=1,paused:o=!1,style:s,"aria-label":c,...d}){const p=S.useRef(null),f=gI(a,p),y=yI();return S.useEffect(()=>{const m=p.current;if(!m)return;const b=Math.min(2,typeof devicePixelRatio<"u"&&devicePixelRatio||1);m.width=Math.round(t*b),m.height=Math.round(t*b);const x=m.getContext("2d");if(!x)return;const{mode:k,speed:C,opts:A}=pI(e,t),E=aI[k],R=C*r,_=W=>{x.setTransform(b,0,0,b,0,0),x.clearRect(0,0,t,t),E(x,t,W,f,A)};if(y){_(.6);return}let U=0,I=!1;const O=()=>{_(performance.now()/1e3*R),I&&(U=requestAnimationFrame(O))},P=()=>{I||o||(I=!0,U=requestAnimationFrame(O))},Y=()=>{I=!1,cancelAnimationFrame(U)};_(performance.now()/1e3*R);let D=!0;const T=typeof IntersectionObserver<"u"?new IntersectionObserver(([W])=>{D=W.isIntersecting,D&&document.visibilityState!=="hidden"?P():Y()}):null;T==null||T.observe(m);const G=()=>{document.visibilityState==="hidden"?Y():D&&P()};return document.addEventListener("visibilitychange",G),T||P(),()=>{Y(),T==null||T.disconnect(),document.removeEventListener("visibilitychange",G)}},[e,t,f,r,o,y]),g.jsx("canvas",{ref:p,role:"img","aria-label":c??vI[e],style:{width:t,height:t,display:"block",...s},...d})}let xI=0;function wI(e,t,a){const r=e.trim();return r?r===t?!0:a==="Request cancelled."&&r===a:!1}function SI(e,t,a,r){return e&&wI(e,t,a)?{content:e,synthesized:!0}:e?r==="hermes"?{content:e,failureNotice:t,synthesized:!1}:{content:e,synthesized:!1}:{content:"",failureNotice:t,synthesized:!0}}function kI(e,t){return e?{content:e,failureNotice:t,synthesized:!1}:{content:t,synthesized:!0}}function Hb(e,t=""){const a=e.author.toLowerCase(),r=a.includes("assistant")||a.includes("agent")?"assistant":"user",o=typeof e.failureReason=="string"&&e.failureReason.trim()?e.failureReason.trim():void 0,s=r==="assistant"&&(e.persistStatus==="failed"||!!o),c=`Error: ${o??"The local agent turn failed."}`,d=s?SI(e.text,c,o,t):null,p=(d==null?void 0:d.content)??(e.text||ck(e.attachmentRefs??[])),f=!!e.text;return{id:e.uri||`local-history:${++xI}`,uri:e.uri,turnId:e.turnId,role:r,content:p,ts:hu(e.ts),tsRaw:Ah(e.ts),attachments:e.attachmentRefs,failureNotice:d==null?void 0:d.failureNotice,synthesized:(d==null?void 0:d.synthesized)??!f}}function CI(e){return e.turnId?`turn:${e.turnId}:${e.role}`:e.uri??`${e.role}:${e.ts??""}:${e.content}`}function Gp(e,t){const a=new Set,r=[];for(const o of[...t,...e]){const s=CI(o);a.has(s)||(a.add(s),r.push(o))}return r}function $b(e,t,a){const r=typeof a=="string"&&a.trim()?a.trim():t;return!r||r===t?e:e.map(o=>o.turnId===t?{...o,turnId:r}:o)}function qb(e){return e.replace(/\r\n/g,`
1135
+ `).replace(/^(?:[ \t]*\n)+/,"").replace(/(?:\n[ \t]*)+$/,"")}function EI(e,t,a,r,o){const s=qb(e),c=o?qb(o):"";if(t==="assistant"&&r&&s.trim()===""&&!c)return g.jsxs("span",{className:"v10-chat-thinking",role:"status","aria-live":"polite",children:[g.jsx(bI,{"aria-hidden":"true",className:"v10-chat-thinking-orb",state:"connecting",size:64,style:{width:28,height:28},theme:"auto"}),g.jsx("span",{children:"Connecting dots..."})]});if(t==="assistant"&&!a&&s.trim()!=="")return g.jsxs(g.Fragment,{children:[g.jsx(sk,{content:s,streaming:r&&!c}),c&&g.jsxs("span",{className:"v10-chat-plaintext v10-chat-failure-notice",children:[c,r&&g.jsx("span",{className:"v10-chat-cursor"})]})]});const d=[s,c].filter(Boolean).join(`
1136
+
1137
+ `);return g.jsxs("span",{className:"v10-chat-plaintext",children:[d,r&&g.jsx("span",{className:"v10-chat-cursor"})]})}function Rh(){return Rh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},Rh.apply(null,arguments)}function AI(e,t){if(e==null)return{};var a={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;a[r]=e[r]}return a}var jI=S.useLayoutEffect,TI=function(t){var a=bn.useRef(t);return jI(function(){a.current=t}),a},Fb=function(t,a){if(typeof t=="function"){t(a);return}t.current=a},RI=function(t,a){var r=bn.useRef();return bn.useCallback(function(o){t.current=o,r.current&&Fb(r.current,null),r.current=a,a&&Fb(a,o)},[a])},Gb={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0",display:"block"},NI=function(t){Object.keys(Gb).forEach(function(a){t.style.setProperty(a,Gb[a],"important")})},Vb=NI,yn=null,Wb=function(t,a){var r=t.scrollHeight;return a.sizingStyle.boxSizing==="border-box"?r+a.borderSize:r-a.paddingSize};function _I(e,t,a,r){a===void 0&&(a=1),r===void 0&&(r=1/0),yn||(yn=document.createElement("textarea"),yn.setAttribute("tabindex","-1"),yn.setAttribute("aria-hidden","true"),Vb(yn)),yn.parentNode===null&&document.body.appendChild(yn);var o=e.paddingSize,s=e.borderSize,c=e.sizingStyle,d=c.boxSizing;Object.keys(c).forEach(function(b){var x=b;yn.style[x]=c[x]}),Vb(yn),yn.value=t;var p=Wb(yn,e);yn.value=t,p=Wb(yn,e),yn.value="x";var f=yn.scrollHeight-o,y=f*a;d==="border-box"&&(y=y+o+s),p=Math.max(y,p);var m=f*r;return d==="border-box"&&(m=m+o+s),p=Math.min(m,p),[p,f]}var Yb=function(){},OI=function(t,a){return t.reduce(function(r,o){return r[o]=a[o],r},{})},MI=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak","wordSpacing","scrollbarGutter"],DI=!!document.documentElement.currentStyle,LI=function(t){var a=window.getComputedStyle(t);if(a===null)return null;var r=OI(MI,a),o=r.boxSizing;if(o==="")return null;DI&&o==="border-box"&&(r.width=parseFloat(r.width)+parseFloat(r.borderRightWidth)+parseFloat(r.borderLeftWidth)+parseFloat(r.paddingRight)+parseFloat(r.paddingLeft)+"px");var s=parseFloat(r.paddingBottom)+parseFloat(r.paddingTop),c=parseFloat(r.borderBottomWidth)+parseFloat(r.borderTopWidth);return{sizingStyle:r,paddingSize:s,borderSize:c}},zI=LI;function zm(e,t,a){var r=TI(a);S.useLayoutEffect(function(){var o=function(c){return r.current(c)};if(e)return e.addEventListener(t,o),function(){return e.removeEventListener(t,o)}},[])}var II=function(t,a){zm(document.body,"reset",function(r){t.current.form===r.target&&a(r)})},PI=function(t){zm(window,"resize",t)},BI=function(t){zm(document.fonts,"loadingdone",t)},UI=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],HI=function(t,a){var r=t.cacheMeasurements,o=t.maxRows,s=t.minRows,c=t.onChange,d=c===void 0?Yb:c,p=t.onHeightChange,f=p===void 0?Yb:p,y=AI(t,UI),m=y.value!==void 0,b=S.useRef(null),x=RI(b,a),k=S.useRef(0),C=S.useRef(),A=function(){var _=b.current,U=r&&C.current?C.current:zI(_);if(U){C.current=U;var I=_I(U,_.value||_.placeholder||"x",s,o),O=I[0],P=I[1];k.current!==O&&(k.current=O,_.style.setProperty("height",O+"px","important"),f(O,{rowHeight:P}))}},E=function(_){m||A(),d(_)};return S.useLayoutEffect(A),II(b,function(){if(!m){var R=b.current.value;requestAnimationFrame(function(){var _=b.current;_&&R!==_.value&&A()})}}),PI(A),BI(A),S.createElement("textarea",Rh({},y,{onChange:E,ref:x}))},$I=S.forwardRef(HI),Vp={exports:{}},Wp,Kb;function qI(){if(Kb)return Wp;Kb=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Wp=e,Wp}var Yp,Qb;function FI(){if(Qb)return Yp;Qb=1;var e=qI();function t(){}function a(){}return a.resetWarningCache=t,Yp=function(){function r(c,d,p,f,y,m){if(m!==e){var b=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw b.name="Invariant Violation",b}}r.isRequired=r;function o(){return r}var s={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:a,resetWarningCache:t};return s.PropTypes=s,s},Yp}var Xb;function GI(){return Xb||(Xb=1,Vp.exports=FI()()),Vp.exports}var VI=GI();const gt=ns(VI);function Rr(e,t,a,r){function o(s){return s instanceof a?s:new a(function(c){c(s)})}return new(a||(a=Promise))(function(s,c){function d(y){try{f(r.next(y))}catch(m){c(m)}}function p(y){try{f(r.throw(y))}catch(m){c(m)}}function f(y){y.done?s(y.value):o(y.value).then(d,p)}f((r=r.apply(e,t||[])).next())})}const WI=new Map([["1km","application/vnd.1000minds.decision-model+xml"],["3dml","text/vnd.in3d.3dml"],["3ds","image/x-3ds"],["3g2","video/3gpp2"],["3gp","video/3gp"],["3gpp","video/3gpp"],["3mf","model/3mf"],["7z","application/x-7z-compressed"],["7zip","application/x-7z-compressed"],["123","application/vnd.lotus-1-2-3"],["aab","application/x-authorware-bin"],["aac","audio/x-acc"],["aam","application/x-authorware-map"],["aas","application/x-authorware-seg"],["abw","application/x-abiword"],["ac","application/vnd.nokia.n-gage.ac+xml"],["ac3","audio/ac3"],["acc","application/vnd.americandynamics.acc"],["ace","application/x-ace-compressed"],["acu","application/vnd.acucobol"],["acutc","application/vnd.acucorp"],["adp","audio/adpcm"],["aep","application/vnd.audiograph"],["afm","application/x-font-type1"],["afp","application/vnd.ibm.modcap"],["ahead","application/vnd.ahead.space"],["ai","application/pdf"],["aif","audio/x-aiff"],["aifc","audio/x-aiff"],["aiff","audio/x-aiff"],["air","application/vnd.adobe.air-application-installer-package+zip"],["ait","application/vnd.dvb.ait"],["ami","application/vnd.amiga.ami"],["amr","audio/amr"],["apk","application/vnd.android.package-archive"],["apng","image/apng"],["appcache","text/cache-manifest"],["application","application/x-ms-application"],["apr","application/vnd.lotus-approach"],["arc","application/x-freearc"],["arj","application/x-arj"],["asc","application/pgp-signature"],["asf","video/x-ms-asf"],["asm","text/x-asm"],["aso","application/vnd.accpac.simply.aso"],["asx","video/x-ms-asf"],["atc","application/vnd.acucorp"],["atom","application/atom+xml"],["atomcat","application/atomcat+xml"],["atomdeleted","application/atomdeleted+xml"],["atomsvc","application/atomsvc+xml"],["atx","application/vnd.antix.game-component"],["au","audio/x-au"],["avi","video/x-msvideo"],["avif","image/avif"],["aw","application/applixware"],["azf","application/vnd.airzip.filesecure.azf"],["azs","application/vnd.airzip.filesecure.azs"],["azv","image/vnd.airzip.accelerator.azv"],["azw","application/vnd.amazon.ebook"],["b16","image/vnd.pco.b16"],["bat","application/x-msdownload"],["bcpio","application/x-bcpio"],["bdf","application/x-font-bdf"],["bdm","application/vnd.syncml.dm+wbxml"],["bdoc","application/x-bdoc"],["bed","application/vnd.realvnc.bed"],["bh2","application/vnd.fujitsu.oasysprs"],["bin","application/octet-stream"],["blb","application/x-blorb"],["blorb","application/x-blorb"],["bmi","application/vnd.bmi"],["bmml","application/vnd.balsamiq.bmml+xml"],["bmp","image/bmp"],["book","application/vnd.framemaker"],["box","application/vnd.previewsystems.box"],["boz","application/x-bzip2"],["bpk","application/octet-stream"],["bpmn","application/octet-stream"],["bsp","model/vnd.valve.source.compiled-map"],["btif","image/prs.btif"],["buffer","application/octet-stream"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["c","text/x-c"],["c4d","application/vnd.clonk.c4group"],["c4f","application/vnd.clonk.c4group"],["c4g","application/vnd.clonk.c4group"],["c4p","application/vnd.clonk.c4group"],["c4u","application/vnd.clonk.c4group"],["c11amc","application/vnd.cluetrust.cartomobile-config"],["c11amz","application/vnd.cluetrust.cartomobile-config-pkg"],["cab","application/vnd.ms-cab-compressed"],["caf","audio/x-caf"],["cap","application/vnd.tcpdump.pcap"],["car","application/vnd.curl.car"],["cat","application/vnd.ms-pki.seccat"],["cb7","application/x-cbr"],["cba","application/x-cbr"],["cbr","application/x-cbr"],["cbt","application/x-cbr"],["cbz","application/x-cbr"],["cc","text/x-c"],["cco","application/x-cocoa"],["cct","application/x-director"],["ccxml","application/ccxml+xml"],["cdbcmsg","application/vnd.contact.cmsg"],["cda","application/x-cdf"],["cdf","application/x-netcdf"],["cdfx","application/cdfx+xml"],["cdkey","application/vnd.mediastation.cdkey"],["cdmia","application/cdmi-capability"],["cdmic","application/cdmi-container"],["cdmid","application/cdmi-domain"],["cdmio","application/cdmi-object"],["cdmiq","application/cdmi-queue"],["cdr","application/cdr"],["cdx","chemical/x-cdx"],["cdxml","application/vnd.chemdraw+xml"],["cdy","application/vnd.cinderella"],["cer","application/pkix-cert"],["cfs","application/x-cfs-compressed"],["cgm","image/cgm"],["chat","application/x-chat"],["chm","application/vnd.ms-htmlhelp"],["chrt","application/vnd.kde.kchart"],["cif","chemical/x-cif"],["cii","application/vnd.anser-web-certificate-issue-initiation"],["cil","application/vnd.ms-artgalry"],["cjs","application/node"],["cla","application/vnd.claymore"],["class","application/octet-stream"],["clkk","application/vnd.crick.clicker.keyboard"],["clkp","application/vnd.crick.clicker.palette"],["clkt","application/vnd.crick.clicker.template"],["clkw","application/vnd.crick.clicker.wordbank"],["clkx","application/vnd.crick.clicker"],["clp","application/x-msclip"],["cmc","application/vnd.cosmocaller"],["cmdf","chemical/x-cmdf"],["cml","chemical/x-cml"],["cmp","application/vnd.yellowriver-custom-menu"],["cmx","image/x-cmx"],["cod","application/vnd.rim.cod"],["coffee","text/coffeescript"],["com","application/x-msdownload"],["conf","text/plain"],["cpio","application/x-cpio"],["cpp","text/x-c"],["cpt","application/mac-compactpro"],["crd","application/x-mscardfile"],["crl","application/pkix-crl"],["crt","application/x-x509-ca-cert"],["crx","application/x-chrome-extension"],["cryptonote","application/vnd.rig.cryptonote"],["csh","application/x-csh"],["csl","application/vnd.citationstyles.style+xml"],["csml","chemical/x-csml"],["csp","application/vnd.commonspace"],["csr","application/octet-stream"],["css","text/css"],["cst","application/x-director"],["csv","text/csv"],["cu","application/cu-seeme"],["curl","text/vnd.curl"],["cww","application/prs.cww"],["cxt","application/x-director"],["cxx","text/x-c"],["dae","model/vnd.collada+xml"],["daf","application/vnd.mobius.daf"],["dart","application/vnd.dart"],["dataless","application/vnd.fdsn.seed"],["davmount","application/davmount+xml"],["dbf","application/vnd.dbf"],["dbk","application/docbook+xml"],["dcr","application/x-director"],["dcurl","text/vnd.curl.dcurl"],["dd2","application/vnd.oma.dd2+xml"],["ddd","application/vnd.fujixerox.ddd"],["ddf","application/vnd.syncml.dmddf+xml"],["dds","image/vnd.ms-dds"],["deb","application/x-debian-package"],["def","text/plain"],["deploy","application/octet-stream"],["der","application/x-x509-ca-cert"],["dfac","application/vnd.dreamfactory"],["dgc","application/x-dgc-compressed"],["dic","text/x-c"],["dir","application/x-director"],["dis","application/vnd.mobius.dis"],["disposition-notification","message/disposition-notification"],["dist","application/octet-stream"],["distz","application/octet-stream"],["djv","image/vnd.djvu"],["djvu","image/vnd.djvu"],["dll","application/octet-stream"],["dmg","application/x-apple-diskimage"],["dmn","application/octet-stream"],["dmp","application/vnd.tcpdump.pcap"],["dms","application/octet-stream"],["dna","application/vnd.dna"],["doc","application/msword"],["docm","application/vnd.ms-word.template.macroEnabled.12"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["dot","application/msword"],["dotm","application/vnd.ms-word.template.macroEnabled.12"],["dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"],["dp","application/vnd.osgi.dp"],["dpg","application/vnd.dpgraph"],["dra","audio/vnd.dra"],["drle","image/dicom-rle"],["dsc","text/prs.lines.tag"],["dssc","application/dssc+der"],["dtb","application/x-dtbook+xml"],["dtd","application/xml-dtd"],["dts","audio/vnd.dts"],["dtshd","audio/vnd.dts.hd"],["dump","application/octet-stream"],["dvb","video/vnd.dvb.file"],["dvi","application/x-dvi"],["dwd","application/atsc-dwd+xml"],["dwf","model/vnd.dwf"],["dwg","image/vnd.dwg"],["dxf","image/vnd.dxf"],["dxp","application/vnd.spotfire.dxp"],["dxr","application/x-director"],["ear","application/java-archive"],["ecelp4800","audio/vnd.nuera.ecelp4800"],["ecelp7470","audio/vnd.nuera.ecelp7470"],["ecelp9600","audio/vnd.nuera.ecelp9600"],["ecma","application/ecmascript"],["edm","application/vnd.novadigm.edm"],["edx","application/vnd.novadigm.edx"],["efif","application/vnd.picsel"],["ei6","application/vnd.pg.osasli"],["elc","application/octet-stream"],["emf","image/emf"],["eml","message/rfc822"],["emma","application/emma+xml"],["emotionml","application/emotionml+xml"],["emz","application/x-msmetafile"],["eol","audio/vnd.digital-winds"],["eot","application/vnd.ms-fontobject"],["eps","application/postscript"],["epub","application/epub+zip"],["es","application/ecmascript"],["es3","application/vnd.eszigno3+xml"],["esa","application/vnd.osgi.subsystem"],["esf","application/vnd.epson.esf"],["et3","application/vnd.eszigno3+xml"],["etx","text/x-setext"],["eva","application/x-eva"],["evy","application/x-envoy"],["exe","application/octet-stream"],["exi","application/exi"],["exp","application/express"],["exr","image/aces"],["ext","application/vnd.novadigm.ext"],["ez","application/andrew-inset"],["ez2","application/vnd.ezpix-album"],["ez3","application/vnd.ezpix-package"],["f","text/x-fortran"],["f4v","video/mp4"],["f77","text/x-fortran"],["f90","text/x-fortran"],["fbs","image/vnd.fastbidsheet"],["fcdt","application/vnd.adobe.formscentral.fcdt"],["fcs","application/vnd.isac.fcs"],["fdf","application/vnd.fdf"],["fdt","application/fdt+xml"],["fe_launch","application/vnd.denovo.fcselayout-link"],["fg5","application/vnd.fujitsu.oasysgp"],["fgd","application/x-director"],["fh","image/x-freehand"],["fh4","image/x-freehand"],["fh5","image/x-freehand"],["fh7","image/x-freehand"],["fhc","image/x-freehand"],["fig","application/x-xfig"],["fits","image/fits"],["flac","audio/x-flac"],["fli","video/x-fli"],["flo","application/vnd.micrografx.flo"],["flv","video/x-flv"],["flw","application/vnd.kde.kivio"],["flx","text/vnd.fmi.flexstor"],["fly","text/vnd.fly"],["fm","application/vnd.framemaker"],["fnc","application/vnd.frogans.fnc"],["fo","application/vnd.software602.filler.form+xml"],["for","text/x-fortran"],["fpx","image/vnd.fpx"],["frame","application/vnd.framemaker"],["fsc","application/vnd.fsc.weblaunch"],["fst","image/vnd.fst"],["ftc","application/vnd.fluxtime.clip"],["fti","application/vnd.anser-web-funds-transfer-initiation"],["fvt","video/vnd.fvt"],["fxp","application/vnd.adobe.fxp"],["fxpl","application/vnd.adobe.fxp"],["fzs","application/vnd.fuzzysheet"],["g2w","application/vnd.geoplan"],["g3","image/g3fax"],["g3w","application/vnd.geospace"],["gac","application/vnd.groove-account"],["gam","application/x-tads"],["gbr","application/rpki-ghostbusters"],["gca","application/x-gca-compressed"],["gdl","model/vnd.gdl"],["gdoc","application/vnd.google-apps.document"],["geo","application/vnd.dynageo"],["geojson","application/geo+json"],["gex","application/vnd.geometry-explorer"],["ggb","application/vnd.geogebra.file"],["ggt","application/vnd.geogebra.tool"],["ghf","application/vnd.groove-help"],["gif","image/gif"],["gim","application/vnd.groove-identity-message"],["glb","model/gltf-binary"],["gltf","model/gltf+json"],["gml","application/gml+xml"],["gmx","application/vnd.gmx"],["gnumeric","application/x-gnumeric"],["gpg","application/gpg-keys"],["gph","application/vnd.flographit"],["gpx","application/gpx+xml"],["gqf","application/vnd.grafeq"],["gqs","application/vnd.grafeq"],["gram","application/srgs"],["gramps","application/x-gramps-xml"],["gre","application/vnd.geometry-explorer"],["grv","application/vnd.groove-injector"],["grxml","application/srgs+xml"],["gsf","application/x-font-ghostscript"],["gsheet","application/vnd.google-apps.spreadsheet"],["gslides","application/vnd.google-apps.presentation"],["gtar","application/x-gtar"],["gtm","application/vnd.groove-tool-message"],["gtw","model/vnd.gtw"],["gv","text/vnd.graphviz"],["gxf","application/gxf"],["gxt","application/vnd.geonext"],["gz","application/gzip"],["gzip","application/gzip"],["h","text/x-c"],["h261","video/h261"],["h263","video/h263"],["h264","video/h264"],["hal","application/vnd.hal+xml"],["hbci","application/vnd.hbci"],["hbs","text/x-handlebars-template"],["hdd","application/x-virtualbox-hdd"],["hdf","application/x-hdf"],["heic","image/heic"],["heics","image/heic-sequence"],["heif","image/heif"],["heifs","image/heif-sequence"],["hej2","image/hej2k"],["held","application/atsc-held+xml"],["hh","text/x-c"],["hjson","application/hjson"],["hlp","application/winhlp"],["hpgl","application/vnd.hp-hpgl"],["hpid","application/vnd.hp-hpid"],["hps","application/vnd.hp-hps"],["hqx","application/mac-binhex40"],["hsj2","image/hsj2"],["htc","text/x-component"],["htke","application/vnd.kenameaapp"],["htm","text/html"],["html","text/html"],["hvd","application/vnd.yamaha.hv-dic"],["hvp","application/vnd.yamaha.hv-voice"],["hvs","application/vnd.yamaha.hv-script"],["i2g","application/vnd.intergeo"],["icc","application/vnd.iccprofile"],["ice","x-conference/x-cooltalk"],["icm","application/vnd.iccprofile"],["ico","image/x-icon"],["ics","text/calendar"],["ief","image/ief"],["ifb","text/calendar"],["ifm","application/vnd.shana.informed.formdata"],["iges","model/iges"],["igl","application/vnd.igloader"],["igm","application/vnd.insors.igm"],["igs","model/iges"],["igx","application/vnd.micrografx.igx"],["iif","application/vnd.shana.informed.interchange"],["img","application/octet-stream"],["imp","application/vnd.accpac.simply.imp"],["ims","application/vnd.ms-ims"],["in","text/plain"],["ini","text/plain"],["ink","application/inkml+xml"],["inkml","application/inkml+xml"],["install","application/x-install-instructions"],["iota","application/vnd.astraea-software.iota"],["ipfix","application/ipfix"],["ipk","application/vnd.shana.informed.package"],["irm","application/vnd.ibm.rights-management"],["irp","application/vnd.irepository.package+xml"],["iso","application/x-iso9660-image"],["itp","application/vnd.shana.informed.formtemplate"],["its","application/its+xml"],["ivp","application/vnd.immervision-ivp"],["ivu","application/vnd.immervision-ivu"],["jad","text/vnd.sun.j2me.app-descriptor"],["jade","text/jade"],["jam","application/vnd.jam"],["jar","application/java-archive"],["jardiff","application/x-java-archive-diff"],["java","text/x-java-source"],["jhc","image/jphc"],["jisp","application/vnd.jisp"],["jls","image/jls"],["jlt","application/vnd.hp-jlyt"],["jng","image/x-jng"],["jnlp","application/x-java-jnlp-file"],["joda","application/vnd.joost.joda-archive"],["jp2","image/jp2"],["jpe","image/jpeg"],["jpeg","image/jpeg"],["jpf","image/jpx"],["jpg","image/jpeg"],["jpg2","image/jp2"],["jpgm","video/jpm"],["jpgv","video/jpeg"],["jph","image/jph"],["jpm","video/jpm"],["jpx","image/jpx"],["js","application/javascript"],["json","application/json"],["json5","application/json5"],["jsonld","application/ld+json"],["jsonl","application/jsonl"],["jsonml","application/jsonml+json"],["jsx","text/jsx"],["jxr","image/jxr"],["jxra","image/jxra"],["jxrs","image/jxrs"],["jxs","image/jxs"],["jxsc","image/jxsc"],["jxsi","image/jxsi"],["jxss","image/jxss"],["kar","audio/midi"],["karbon","application/vnd.kde.karbon"],["kdb","application/octet-stream"],["kdbx","application/x-keepass2"],["key","application/x-iwork-keynote-sffkey"],["kfo","application/vnd.kde.kformula"],["kia","application/vnd.kidspiration"],["kml","application/vnd.google-earth.kml+xml"],["kmz","application/vnd.google-earth.kmz"],["kne","application/vnd.kinar"],["knp","application/vnd.kinar"],["kon","application/vnd.kde.kontour"],["kpr","application/vnd.kde.kpresenter"],["kpt","application/vnd.kde.kpresenter"],["kpxx","application/vnd.ds-keypoint"],["ksp","application/vnd.kde.kspread"],["ktr","application/vnd.kahootz"],["ktx","image/ktx"],["ktx2","image/ktx2"],["ktz","application/vnd.kahootz"],["kwd","application/vnd.kde.kword"],["kwt","application/vnd.kde.kword"],["lasxml","application/vnd.las.las+xml"],["latex","application/x-latex"],["lbd","application/vnd.llamagraphics.life-balance.desktop"],["lbe","application/vnd.llamagraphics.life-balance.exchange+xml"],["les","application/vnd.hhe.lesson-player"],["less","text/less"],["lgr","application/lgr+xml"],["lha","application/octet-stream"],["link66","application/vnd.route66.link66+xml"],["list","text/plain"],["list3820","application/vnd.ibm.modcap"],["listafp","application/vnd.ibm.modcap"],["litcoffee","text/coffeescript"],["lnk","application/x-ms-shortcut"],["log","text/plain"],["lostxml","application/lost+xml"],["lrf","application/octet-stream"],["lrm","application/vnd.ms-lrm"],["ltf","application/vnd.frogans.ltf"],["lua","text/x-lua"],["luac","application/x-lua-bytecode"],["lvp","audio/vnd.lucent.voice"],["lwp","application/vnd.lotus-wordpro"],["lzh","application/octet-stream"],["m1v","video/mpeg"],["m2a","audio/mpeg"],["m2v","video/mpeg"],["m3a","audio/mpeg"],["m3u","text/plain"],["m3u8","application/vnd.apple.mpegurl"],["m4a","audio/x-m4a"],["m4p","application/mp4"],["m4s","video/iso.segment"],["m4u","application/vnd.mpegurl"],["m4v","video/x-m4v"],["m13","application/x-msmediaview"],["m14","application/x-msmediaview"],["m21","application/mp21"],["ma","application/mathematica"],["mads","application/mads+xml"],["maei","application/mmt-aei+xml"],["mag","application/vnd.ecowin.chart"],["maker","application/vnd.framemaker"],["man","text/troff"],["manifest","text/cache-manifest"],["map","application/json"],["mar","application/octet-stream"],["markdown","text/markdown"],["mathml","application/mathml+xml"],["mb","application/mathematica"],["mbk","application/vnd.mobius.mbk"],["mbox","application/mbox"],["mc1","application/vnd.medcalcdata"],["mcd","application/vnd.mcd"],["mcurl","text/vnd.curl.mcurl"],["md","text/markdown"],["mdb","application/x-msaccess"],["mdi","image/vnd.ms-modi"],["mdx","text/mdx"],["me","text/troff"],["mesh","model/mesh"],["meta4","application/metalink4+xml"],["metalink","application/metalink+xml"],["mets","application/mets+xml"],["mfm","application/vnd.mfmp"],["mft","application/rpki-manifest"],["mgp","application/vnd.osgeo.mapguide.package"],["mgz","application/vnd.proteus.magazine"],["mid","audio/midi"],["midi","audio/midi"],["mie","application/x-mie"],["mif","application/vnd.mif"],["mime","message/rfc822"],["mj2","video/mj2"],["mjp2","video/mj2"],["mjs","application/javascript"],["mk3d","video/x-matroska"],["mka","audio/x-matroska"],["mkd","text/x-markdown"],["mks","video/x-matroska"],["mkv","video/x-matroska"],["mlp","application/vnd.dolby.mlp"],["mmd","application/vnd.chipnuts.karaoke-mmd"],["mmf","application/vnd.smaf"],["mml","text/mathml"],["mmr","image/vnd.fujixerox.edmics-mmr"],["mng","video/x-mng"],["mny","application/x-msmoney"],["mobi","application/x-mobipocket-ebook"],["mods","application/mods+xml"],["mov","video/quicktime"],["movie","video/x-sgi-movie"],["mp2","audio/mpeg"],["mp2a","audio/mpeg"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mp4a","audio/mp4"],["mp4s","application/mp4"],["mp4v","video/mp4"],["mp21","application/mp21"],["mpc","application/vnd.mophun.certificate"],["mpd","application/dash+xml"],["mpe","video/mpeg"],["mpeg","video/mpeg"],["mpg","video/mpeg"],["mpg4","video/mp4"],["mpga","audio/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["mpm","application/vnd.blueice.multipass"],["mpn","application/vnd.mophun.application"],["mpp","application/vnd.ms-project"],["mpt","application/vnd.ms-project"],["mpy","application/vnd.ibm.minipay"],["mqy","application/vnd.mobius.mqy"],["mrc","application/marc"],["mrcx","application/marcxml+xml"],["ms","text/troff"],["mscml","application/mediaservercontrol+xml"],["mseed","application/vnd.fdsn.mseed"],["mseq","application/vnd.mseq"],["msf","application/vnd.epson.msf"],["msg","application/vnd.ms-outlook"],["msh","model/mesh"],["msi","application/x-msdownload"],["msl","application/vnd.mobius.msl"],["msm","application/octet-stream"],["msp","application/octet-stream"],["msty","application/vnd.muvee.style"],["mtl","model/mtl"],["mts","model/vnd.mts"],["mus","application/vnd.musician"],["musd","application/mmt-usd+xml"],["musicxml","application/vnd.recordare.musicxml+xml"],["mvb","application/x-msmediaview"],["mvt","application/vnd.mapbox-vector-tile"],["mwf","application/vnd.mfer"],["mxf","application/mxf"],["mxl","application/vnd.recordare.musicxml"],["mxmf","audio/mobile-xmf"],["mxml","application/xv+xml"],["mxs","application/vnd.triscape.mxs"],["mxu","video/vnd.mpegurl"],["n-gage","application/vnd.nokia.n-gage.symbian.install"],["n3","text/n3"],["nb","application/mathematica"],["nbp","application/vnd.wolfram.player"],["nc","application/x-netcdf"],["ncx","application/x-dtbncx+xml"],["nfo","text/x-nfo"],["ngdat","application/vnd.nokia.n-gage.data"],["nitf","application/vnd.nitf"],["nlu","application/vnd.neurolanguage.nlu"],["nml","application/vnd.enliven"],["nnd","application/vnd.noblenet-directory"],["nns","application/vnd.noblenet-sealer"],["nnw","application/vnd.noblenet-web"],["npx","image/vnd.net-fpx"],["nq","application/n-quads"],["nsc","application/x-conference"],["nsf","application/vnd.lotus-notes"],["nt","application/n-triples"],["ntf","application/vnd.nitf"],["numbers","application/x-iwork-numbers-sffnumbers"],["nzb","application/x-nzb"],["oa2","application/vnd.fujitsu.oasys2"],["oa3","application/vnd.fujitsu.oasys3"],["oas","application/vnd.fujitsu.oasys"],["obd","application/x-msbinder"],["obgx","application/vnd.openblox.game+xml"],["obj","model/obj"],["oda","application/oda"],["odb","application/vnd.oasis.opendocument.database"],["odc","application/vnd.oasis.opendocument.chart"],["odf","application/vnd.oasis.opendocument.formula"],["odft","application/vnd.oasis.opendocument.formula-template"],["odg","application/vnd.oasis.opendocument.graphics"],["odi","application/vnd.oasis.opendocument.image"],["odm","application/vnd.oasis.opendocument.text-master"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogex","model/vnd.opengex"],["ogg","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["omdoc","application/omdoc+xml"],["onepkg","application/onenote"],["onetmp","application/onenote"],["onetoc","application/onenote"],["onetoc2","application/onenote"],["opf","application/oebps-package+xml"],["opml","text/x-opml"],["oprc","application/vnd.palm"],["opus","audio/ogg"],["org","text/x-org"],["osf","application/vnd.yamaha.openscoreformat"],["osfpvg","application/vnd.yamaha.openscoreformat.osfpvg+xml"],["osm","application/vnd.openstreetmap.data+xml"],["otc","application/vnd.oasis.opendocument.chart-template"],["otf","font/otf"],["otg","application/vnd.oasis.opendocument.graphics-template"],["oth","application/vnd.oasis.opendocument.text-web"],["oti","application/vnd.oasis.opendocument.image-template"],["otp","application/vnd.oasis.opendocument.presentation-template"],["ots","application/vnd.oasis.opendocument.spreadsheet-template"],["ott","application/vnd.oasis.opendocument.text-template"],["ova","application/x-virtualbox-ova"],["ovf","application/x-virtualbox-ovf"],["owl","application/rdf+xml"],["oxps","application/oxps"],["oxt","application/vnd.openofficeorg.extension"],["p","text/x-pascal"],["p7a","application/x-pkcs7-signature"],["p7b","application/x-pkcs7-certificates"],["p7c","application/pkcs7-mime"],["p7m","application/pkcs7-mime"],["p7r","application/x-pkcs7-certreqresp"],["p7s","application/pkcs7-signature"],["p8","application/pkcs8"],["p10","application/x-pkcs10"],["p12","application/x-pkcs12"],["pac","application/x-ns-proxy-autoconfig"],["pages","application/x-iwork-pages-sffpages"],["pas","text/x-pascal"],["paw","application/vnd.pawaafile"],["pbd","application/vnd.powerbuilder6"],["pbm","image/x-portable-bitmap"],["pcap","application/vnd.tcpdump.pcap"],["pcf","application/x-font-pcf"],["pcl","application/vnd.hp-pcl"],["pclxl","application/vnd.hp-pclxl"],["pct","image/x-pict"],["pcurl","application/vnd.curl.pcurl"],["pcx","image/x-pcx"],["pdb","application/x-pilot"],["pde","text/x-processing"],["pdf","application/pdf"],["pem","application/x-x509-user-cert"],["pfa","application/x-font-type1"],["pfb","application/x-font-type1"],["pfm","application/x-font-type1"],["pfr","application/font-tdpfr"],["pfx","application/x-pkcs12"],["pgm","image/x-portable-graymap"],["pgn","application/x-chess-pgn"],["pgp","application/pgp"],["php","application/x-httpd-php"],["php3","application/x-httpd-php"],["php4","application/x-httpd-php"],["phps","application/x-httpd-php-source"],["phtml","application/x-httpd-php"],["pic","image/x-pict"],["pkg","application/octet-stream"],["pki","application/pkixcmp"],["pkipath","application/pkix-pkipath"],["pkpass","application/vnd.apple.pkpass"],["pl","application/x-perl"],["plb","application/vnd.3gpp.pic-bw-large"],["plc","application/vnd.mobius.plc"],["plf","application/vnd.pocketlearn"],["pls","application/pls+xml"],["pm","application/x-perl"],["pml","application/vnd.ctc-posml"],["png","image/png"],["pnm","image/x-portable-anymap"],["portpkg","application/vnd.macports.portpkg"],["pot","application/vnd.ms-powerpoint"],["potm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["potx","application/vnd.openxmlformats-officedocument.presentationml.template"],["ppa","application/vnd.ms-powerpoint"],["ppam","application/vnd.ms-powerpoint.addin.macroEnabled.12"],["ppd","application/vnd.cups-ppd"],["ppm","image/x-portable-pixmap"],["pps","application/vnd.ms-powerpoint"],["ppsm","application/vnd.ms-powerpoint.slideshow.macroEnabled.12"],["ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"],["ppt","application/powerpoint"],["pptm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["pqa","application/vnd.palm"],["prc","application/x-pilot"],["pre","application/vnd.lotus-freelance"],["prf","application/pics-rules"],["provx","application/provenance+xml"],["ps","application/postscript"],["psb","application/vnd.3gpp.pic-bw-small"],["psd","application/x-photoshop"],["psf","application/x-font-linux-psf"],["pskcxml","application/pskc+xml"],["pti","image/prs.pti"],["ptid","application/vnd.pvi.ptid1"],["pub","application/x-mspublisher"],["pvb","application/vnd.3gpp.pic-bw-var"],["pwn","application/vnd.3m.post-it-notes"],["pya","audio/vnd.ms-playready.media.pya"],["pyv","video/vnd.ms-playready.media.pyv"],["qam","application/vnd.epson.quickanime"],["qbo","application/vnd.intu.qbo"],["qfx","application/vnd.intu.qfx"],["qps","application/vnd.publishare-delta-tree"],["qt","video/quicktime"],["qwd","application/vnd.quark.quarkxpress"],["qwt","application/vnd.quark.quarkxpress"],["qxb","application/vnd.quark.quarkxpress"],["qxd","application/vnd.quark.quarkxpress"],["qxl","application/vnd.quark.quarkxpress"],["qxt","application/vnd.quark.quarkxpress"],["ra","audio/x-realaudio"],["ram","audio/x-pn-realaudio"],["raml","application/raml+yaml"],["rapd","application/route-apd+xml"],["rar","application/x-rar"],["ras","image/x-cmu-raster"],["rcprofile","application/vnd.ipunplugged.rcprofile"],["rdf","application/rdf+xml"],["rdz","application/vnd.data-vision.rdz"],["relo","application/p2p-overlay+xml"],["rep","application/vnd.businessobjects"],["res","application/x-dtbresource+xml"],["rgb","image/x-rgb"],["rif","application/reginfo+xml"],["rip","audio/vnd.rip"],["ris","application/x-research-info-systems"],["rl","application/resource-lists+xml"],["rlc","image/vnd.fujixerox.edmics-rlc"],["rld","application/resource-lists-diff+xml"],["rm","audio/x-pn-realaudio"],["rmi","audio/midi"],["rmp","audio/x-pn-realaudio-plugin"],["rms","application/vnd.jcp.javame.midlet-rms"],["rmvb","application/vnd.rn-realmedia-vbr"],["rnc","application/relax-ng-compact-syntax"],["rng","application/xml"],["roa","application/rpki-roa"],["roff","text/troff"],["rp9","application/vnd.cloanto.rp9"],["rpm","audio/x-pn-realaudio-plugin"],["rpss","application/vnd.nokia.radio-presets"],["rpst","application/vnd.nokia.radio-preset"],["rq","application/sparql-query"],["rs","application/rls-services+xml"],["rsa","application/x-pkcs7"],["rsat","application/atsc-rsat+xml"],["rsd","application/rsd+xml"],["rsheet","application/urc-ressheet+xml"],["rss","application/rss+xml"],["rtf","text/rtf"],["rtx","text/richtext"],["run","application/x-makeself"],["rusd","application/route-usd+xml"],["rv","video/vnd.rn-realvideo"],["s","text/x-asm"],["s3m","audio/s3m"],["saf","application/vnd.yamaha.smaf-audio"],["sass","text/x-sass"],["sbml","application/sbml+xml"],["sc","application/vnd.ibm.secure-container"],["scd","application/x-msschedule"],["scm","application/vnd.lotus-screencam"],["scq","application/scvp-cv-request"],["scs","application/scvp-cv-response"],["scss","text/x-scss"],["scurl","text/vnd.curl.scurl"],["sda","application/vnd.stardivision.draw"],["sdc","application/vnd.stardivision.calc"],["sdd","application/vnd.stardivision.impress"],["sdkd","application/vnd.solent.sdkm+xml"],["sdkm","application/vnd.solent.sdkm+xml"],["sdp","application/sdp"],["sdw","application/vnd.stardivision.writer"],["sea","application/octet-stream"],["see","application/vnd.seemail"],["seed","application/vnd.fdsn.seed"],["sema","application/vnd.sema"],["semd","application/vnd.semd"],["semf","application/vnd.semf"],["senmlx","application/senml+xml"],["sensmlx","application/sensml+xml"],["ser","application/java-serialized-object"],["setpay","application/set-payment-initiation"],["setreg","application/set-registration-initiation"],["sfd-hdstx","application/vnd.hydrostatix.sof-data"],["sfs","application/vnd.spotfire.sfs"],["sfv","text/x-sfv"],["sgi","image/sgi"],["sgl","application/vnd.stardivision.writer-global"],["sgm","text/sgml"],["sgml","text/sgml"],["sh","application/x-sh"],["shar","application/x-shar"],["shex","text/shex"],["shf","application/shf+xml"],["shtml","text/html"],["sid","image/x-mrsid-image"],["sieve","application/sieve"],["sig","application/pgp-signature"],["sil","audio/silk"],["silo","model/mesh"],["sis","application/vnd.symbian.install"],["sisx","application/vnd.symbian.install"],["sit","application/x-stuffit"],["sitx","application/x-stuffitx"],["siv","application/sieve"],["skd","application/vnd.koan"],["skm","application/vnd.koan"],["skp","application/vnd.koan"],["skt","application/vnd.koan"],["sldm","application/vnd.ms-powerpoint.slide.macroenabled.12"],["sldx","application/vnd.openxmlformats-officedocument.presentationml.slide"],["slim","text/slim"],["slm","text/slim"],["sls","application/route-s-tsid+xml"],["slt","application/vnd.epson.salt"],["sm","application/vnd.stepmania.stepchart"],["smf","application/vnd.stardivision.math"],["smi","application/smil"],["smil","application/smil"],["smv","video/x-smv"],["smzip","application/vnd.stepmania.package"],["snd","audio/basic"],["snf","application/x-font-snf"],["so","application/octet-stream"],["spc","application/x-pkcs7-certificates"],["spdx","text/spdx"],["spf","application/vnd.yamaha.smaf-phrase"],["spl","application/x-futuresplash"],["spot","text/vnd.in3d.spot"],["spp","application/scvp-vp-response"],["spq","application/scvp-vp-request"],["spx","audio/ogg"],["sql","application/x-sql"],["src","application/x-wais-source"],["srt","application/x-subrip"],["sru","application/sru+xml"],["srx","application/sparql-results+xml"],["ssdl","application/ssdl+xml"],["sse","application/vnd.kodak-descriptor"],["ssf","application/vnd.epson.ssf"],["ssml","application/ssml+xml"],["sst","application/octet-stream"],["st","application/vnd.sailingtracker.track"],["stc","application/vnd.sun.xml.calc.template"],["std","application/vnd.sun.xml.draw.template"],["stf","application/vnd.wt.stf"],["sti","application/vnd.sun.xml.impress.template"],["stk","application/hyperstudio"],["stl","model/stl"],["stpx","model/step+xml"],["stpxz","model/step-xml+zip"],["stpz","model/step+zip"],["str","application/vnd.pg.format"],["stw","application/vnd.sun.xml.writer.template"],["styl","text/stylus"],["stylus","text/stylus"],["sub","text/vnd.dvb.subtitle"],["sus","application/vnd.sus-calendar"],["susp","application/vnd.sus-calendar"],["sv4cpio","application/x-sv4cpio"],["sv4crc","application/x-sv4crc"],["svc","application/vnd.dvb.service"],["svd","application/vnd.svd"],["svg","image/svg+xml"],["svgz","image/svg+xml"],["swa","application/x-director"],["swf","application/x-shockwave-flash"],["swi","application/vnd.aristanetworks.swi"],["swidtag","application/swid+xml"],["sxc","application/vnd.sun.xml.calc"],["sxd","application/vnd.sun.xml.draw"],["sxg","application/vnd.sun.xml.writer.global"],["sxi","application/vnd.sun.xml.impress"],["sxm","application/vnd.sun.xml.math"],["sxw","application/vnd.sun.xml.writer"],["t","text/troff"],["t3","application/x-t3vm-image"],["t38","image/t38"],["taglet","application/vnd.mynfc"],["tao","application/vnd.tao.intent-module-archive"],["tap","image/vnd.tencent.tap"],["tar","application/x-tar"],["tcap","application/vnd.3gpp2.tcap"],["tcl","application/x-tcl"],["td","application/urc-targetdesc+xml"],["teacher","application/vnd.smart.teacher"],["tei","application/tei+xml"],["teicorpus","application/tei+xml"],["tex","application/x-tex"],["texi","application/x-texinfo"],["texinfo","application/x-texinfo"],["text","text/plain"],["tfi","application/thraud+xml"],["tfm","application/x-tex-tfm"],["tfx","image/tiff-fx"],["tga","image/x-tga"],["tgz","application/x-tar"],["thmx","application/vnd.ms-officetheme"],["tif","image/tiff"],["tiff","image/tiff"],["tk","application/x-tcl"],["tmo","application/vnd.tmobile-livetv"],["toml","application/toml"],["torrent","application/x-bittorrent"],["tpl","application/vnd.groove-tool-template"],["tpt","application/vnd.trid.tpt"],["tr","text/troff"],["tra","application/vnd.trueapp"],["trig","application/trig"],["trm","application/x-msterminal"],["ts","video/mp2t"],["tsd","application/timestamped-data"],["tsv","text/tab-separated-values"],["ttc","font/collection"],["ttf","font/ttf"],["ttl","text/turtle"],["ttml","application/ttml+xml"],["twd","application/vnd.simtech-mindmapper"],["twds","application/vnd.simtech-mindmapper"],["txd","application/vnd.genomatix.tuxedo"],["txf","application/vnd.mobius.txf"],["txt","text/plain"],["u8dsn","message/global-delivery-status"],["u8hdr","message/global-headers"],["u8mdn","message/global-disposition-notification"],["u8msg","message/global"],["u32","application/x-authorware-bin"],["ubj","application/ubjson"],["udeb","application/x-debian-package"],["ufd","application/vnd.ufdl"],["ufdl","application/vnd.ufdl"],["ulx","application/x-glulx"],["umj","application/vnd.umajin"],["unityweb","application/vnd.unity"],["uoml","application/vnd.uoml+xml"],["uri","text/uri-list"],["uris","text/uri-list"],["urls","text/uri-list"],["usdz","model/vnd.usdz+zip"],["ustar","application/x-ustar"],["utz","application/vnd.uiq.theme"],["uu","text/x-uuencode"],["uva","audio/vnd.dece.audio"],["uvd","application/vnd.dece.data"],["uvf","application/vnd.dece.data"],["uvg","image/vnd.dece.graphic"],["uvh","video/vnd.dece.hd"],["uvi","image/vnd.dece.graphic"],["uvm","video/vnd.dece.mobile"],["uvp","video/vnd.dece.pd"],["uvs","video/vnd.dece.sd"],["uvt","application/vnd.dece.ttml+xml"],["uvu","video/vnd.uvvu.mp4"],["uvv","video/vnd.dece.video"],["uvva","audio/vnd.dece.audio"],["uvvd","application/vnd.dece.data"],["uvvf","application/vnd.dece.data"],["uvvg","image/vnd.dece.graphic"],["uvvh","video/vnd.dece.hd"],["uvvi","image/vnd.dece.graphic"],["uvvm","video/vnd.dece.mobile"],["uvvp","video/vnd.dece.pd"],["uvvs","video/vnd.dece.sd"],["uvvt","application/vnd.dece.ttml+xml"],["uvvu","video/vnd.uvvu.mp4"],["uvvv","video/vnd.dece.video"],["uvvx","application/vnd.dece.unspecified"],["uvvz","application/vnd.dece.zip"],["uvx","application/vnd.dece.unspecified"],["uvz","application/vnd.dece.zip"],["vbox","application/x-virtualbox-vbox"],["vbox-extpack","application/x-virtualbox-vbox-extpack"],["vcard","text/vcard"],["vcd","application/x-cdlink"],["vcf","text/x-vcard"],["vcg","application/vnd.groove-vcard"],["vcs","text/x-vcalendar"],["vcx","application/vnd.vcx"],["vdi","application/x-virtualbox-vdi"],["vds","model/vnd.sap.vds"],["vhd","application/x-virtualbox-vhd"],["vis","application/vnd.visionary"],["viv","video/vnd.vivo"],["vlc","application/videolan"],["vmdk","application/x-virtualbox-vmdk"],["vob","video/x-ms-vob"],["vor","application/vnd.stardivision.writer"],["vox","application/x-authorware-bin"],["vrml","model/vrml"],["vsd","application/vnd.visio"],["vsf","application/vnd.vsf"],["vss","application/vnd.visio"],["vst","application/vnd.visio"],["vsw","application/vnd.visio"],["vtf","image/vnd.valve.source.texture"],["vtt","text/vtt"],["vtu","model/vnd.vtu"],["vxml","application/voicexml+xml"],["w3d","application/x-director"],["wad","application/x-doom"],["wadl","application/vnd.sun.wadl+xml"],["war","application/java-archive"],["wasm","application/wasm"],["wav","audio/x-wav"],["wax","audio/x-ms-wax"],["wbmp","image/vnd.wap.wbmp"],["wbs","application/vnd.criticaltools.wbs+xml"],["wbxml","application/wbxml"],["wcm","application/vnd.ms-works"],["wdb","application/vnd.ms-works"],["wdp","image/vnd.ms-photo"],["weba","audio/webm"],["webapp","application/x-web-app-manifest+json"],["webm","video/webm"],["webmanifest","application/manifest+json"],["webp","image/webp"],["wg","application/vnd.pmi.widget"],["wgt","application/widget"],["wks","application/vnd.ms-works"],["wm","video/x-ms-wm"],["wma","audio/x-ms-wma"],["wmd","application/x-ms-wmd"],["wmf","image/wmf"],["wml","text/vnd.wap.wml"],["wmlc","application/wmlc"],["wmls","text/vnd.wap.wmlscript"],["wmlsc","application/vnd.wap.wmlscriptc"],["wmv","video/x-ms-wmv"],["wmx","video/x-ms-wmx"],["wmz","application/x-msmetafile"],["woff","font/woff"],["woff2","font/woff2"],["word","application/msword"],["wpd","application/vnd.wordperfect"],["wpl","application/vnd.ms-wpl"],["wps","application/vnd.ms-works"],["wqd","application/vnd.wqd"],["wri","application/x-mswrite"],["wrl","model/vrml"],["wsc","message/vnd.wfa.wsc"],["wsdl","application/wsdl+xml"],["wspolicy","application/wspolicy+xml"],["wtb","application/vnd.webturbo"],["wvx","video/x-ms-wvx"],["x3d","model/x3d+xml"],["x3db","model/x3d+fastinfoset"],["x3dbz","model/x3d+binary"],["x3dv","model/x3d-vrml"],["x3dvz","model/x3d+vrml"],["x3dz","model/x3d+xml"],["x32","application/x-authorware-bin"],["x_b","model/vnd.parasolid.transmit.binary"],["x_t","model/vnd.parasolid.transmit.text"],["xaml","application/xaml+xml"],["xap","application/x-silverlight-app"],["xar","application/vnd.xara"],["xav","application/xcap-att+xml"],["xbap","application/x-ms-xbap"],["xbd","application/vnd.fujixerox.docuworks.binder"],["xbm","image/x-xbitmap"],["xca","application/xcap-caps+xml"],["xcs","application/calendar+xml"],["xdf","application/xcap-diff+xml"],["xdm","application/vnd.syncml.dm+xml"],["xdp","application/vnd.adobe.xdp+xml"],["xdssc","application/dssc+xml"],["xdw","application/vnd.fujixerox.docuworks"],["xel","application/xcap-el+xml"],["xenc","application/xenc+xml"],["xer","application/patch-ops-error+xml"],["xfdf","application/vnd.adobe.xfdf"],["xfdl","application/vnd.xfdl"],["xht","application/xhtml+xml"],["xhtml","application/xhtml+xml"],["xhvml","application/xv+xml"],["xif","image/vnd.xiff"],["xl","application/excel"],["xla","application/vnd.ms-excel"],["xlam","application/vnd.ms-excel.addin.macroEnabled.12"],["xlc","application/vnd.ms-excel"],["xlf","application/xliff+xml"],["xlm","application/vnd.ms-excel"],["xls","application/vnd.ms-excel"],["xlsb","application/vnd.ms-excel.sheet.binary.macroEnabled.12"],["xlsm","application/vnd.ms-excel.sheet.macroEnabled.12"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xlt","application/vnd.ms-excel"],["xltm","application/vnd.ms-excel.template.macroEnabled.12"],["xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"],["xlw","application/vnd.ms-excel"],["xm","audio/xm"],["xml","application/xml"],["xns","application/xcap-ns+xml"],["xo","application/vnd.olpc-sugar"],["xop","application/xop+xml"],["xpi","application/x-xpinstall"],["xpl","application/xproc+xml"],["xpm","image/x-xpixmap"],["xpr","application/vnd.is-xpr"],["xps","application/vnd.ms-xpsdocument"],["xpw","application/vnd.intercon.formnet"],["xpx","application/vnd.intercon.formnet"],["xsd","application/xml"],["xsl","application/xml"],["xslt","application/xslt+xml"],["xsm","application/vnd.syncml+xml"],["xspf","application/xspf+xml"],["xul","application/vnd.mozilla.xul+xml"],["xvm","application/xv+xml"],["xvml","application/xv+xml"],["xwd","image/x-xwindowdump"],["xyz","chemical/x-xyz"],["xz","application/x-xz"],["yaml","text/yaml"],["yang","application/yang"],["yin","application/yin+xml"],["yml","text/yaml"],["ymp","text/x-suse-ymp"],["z","application/x-compress"],["z1","application/x-zmachine"],["z2","application/x-zmachine"],["z3","application/x-zmachine"],["z4","application/x-zmachine"],["z5","application/x-zmachine"],["z6","application/x-zmachine"],["z7","application/x-zmachine"],["z8","application/x-zmachine"],["zaz","application/vnd.zzazz.deck+xml"],["zip","application/zip"],["zir","application/vnd.zul"],["zirz","application/vnd.zul"],["zmm","application/vnd.handheld-entertainment+xml"],["zsh","text/x-scriptzsh"]]);function El(e,t,a){const r=YI(e),{webkitRelativePath:o}=e,s=typeof t=="string"?t:typeof o=="string"&&o.length>0?o:`./${e.name}`;return typeof r.path!="string"&&Zb(r,"path",s),Zb(r,"relativePath",s),r}function YI(e){const{name:t}=e;if(t&&t.lastIndexOf(".")!==-1&&!e.type){const r=t.split(".").pop().toLowerCase(),o=WI.get(r);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}function Zb(e,t,a){Object.defineProperty(e,t,{value:a,writable:!1,configurable:!1,enumerable:!0})}const KI=[".DS_Store","Thumbs.db"];function QI(e){return Rr(this,void 0,void 0,function*(){return mu(e)&&XI(e.dataTransfer)?t8(e.dataTransfer,e.type):ZI(e)?JI(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?e8(e):[]})}function XI(e){return mu(e)}function ZI(e){return mu(e)&&mu(e.target)}function mu(e){return typeof e=="object"&&e!==null}function JI(e){return Nh(e.target.files).map(t=>El(t))}function e8(e){return Rr(this,void 0,void 0,function*(){return(yield Promise.all(e.map(a=>a.getFile()))).map(a=>El(a))})}function t8(e,t){return Rr(this,void 0,void 0,function*(){if(e.items){const a=Nh(e.items).filter(o=>o.kind==="file");if(t!=="drop")return a;const r=yield Promise.all(a.map(n8));return Jb(gk(r))}return Jb(Nh(e.files).map(a=>El(a)))})}function Jb(e){return e.filter(t=>KI.indexOf(t.name)===-1)}function Nh(e){if(e===null)return[];const t=[];for(let a=0;a<e.length;a++){const r=e[a];t.push(r)}return t}function n8(e){if(typeof e.webkitGetAsEntry!="function")return ex(e);const t=e.webkitGetAsEntry();return t&&t.isDirectory?yk(t):ex(e,t)}function gk(e){return e.reduce((t,a)=>[...t,...Array.isArray(a)?gk(a):[a]],[])}function ex(e,t){return Rr(this,void 0,void 0,function*(){var a;if(globalThis.isSecureContext&&typeof e.getAsFileSystemHandle=="function"){const s=yield e.getAsFileSystemHandle();if(s===null)throw new Error(`${e} is not a File`);if(s!==void 0){const c=yield s.getFile();return c.handle=s,El(c)}}const r=e.getAsFile();if(!r)throw new Error(`${e} is not a File`);return El(r,(a=t==null?void 0:t.fullPath)!==null&&a!==void 0?a:void 0)})}function a8(e){return Rr(this,void 0,void 0,function*(){return e.isDirectory?yk(e):i8(e)})}function yk(e){const t=e.createReader();return new Promise((a,r)=>{const o=[];function s(){t.readEntries(c=>Rr(this,void 0,void 0,function*(){if(c.length){const d=Promise.all(c.map(a8));o.push(d),s()}else try{const d=yield Promise.all(o);a(d)}catch(d){r(d)}}),c=>{r(c)})}s()})}function i8(e){return Rr(this,void 0,void 0,function*(){return new Promise((t,a)=>{e.file(r=>{const o=El(r,e.fullPath);t(o)},r=>{a(r)})})})}var Ic={},tx;function r8(){return tx||(tx=1,Ic.__esModule=!0,Ic.default=function(e,t){if(e&&t){var a=Array.isArray(t)?t:t.split(",");if(a.length===0)return!0;var r=e.name||"",o=(e.type||"").toLowerCase(),s=o.replace(/\/.*$/,"");return a.some(function(c){var d=c.trim().toLowerCase();return d.charAt(0)==="."?r.toLowerCase().endsWith(d):d.endsWith("/*")?s===d.replace(/\/.*$/,""):o===d})}return!0}),Ic}var l8=r8();const Kp=ns(l8);function nx(e){return c8(e)||s8(e)||bk(e)||o8()}function o8(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1138
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function s8(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function c8(e){if(Array.isArray(e))return _h(e)}function ax(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),a.push.apply(a,r)}return a}function ix(e){for(var t=1;t<arguments.length;t++){var a=arguments[t]!=null?arguments[t]:{};t%2?ax(Object(a),!0).forEach(function(r){vk(e,r,a[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):ax(Object(a)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(a,r))})}return e}function vk(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function es(e,t){return f8(e)||d8(e,t)||bk(e,t)||u8()}function u8(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1139
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function bk(e,t){if(e){if(typeof e=="string")return _h(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);if(a==="Object"&&e.constructor&&(a=e.constructor.name),a==="Map"||a==="Set")return Array.from(e);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return _h(e,t)}}function _h(e,t){(t==null||t>e.length)&&(t=e.length);for(var a=0,r=new Array(t);a<t;a++)r[a]=e[a];return r}function d8(e,t){var a=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(a!=null){var r=[],o=!0,s=!1,c,d;try{for(a=a.call(e);!(o=(c=a.next()).done)&&(r.push(c.value),!(t&&r.length===t));o=!0);}catch(p){s=!0,d=p}finally{try{!o&&a.return!=null&&a.return()}finally{if(s)throw d}}return r}}function f8(e){if(Array.isArray(e))return e}var p8=typeof Kp=="function"?Kp:Kp.default,h8="file-invalid-type",m8="file-too-large",g8="file-too-small",y8="too-many-files",v8=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",a=t.split(","),r=a.length>1?"one of ".concat(a.join(", ")):a[0];return{code:h8,message:"File type must be ".concat(r)}},rx=function(t){return{code:m8,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},lx=function(t){return{code:g8,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},b8={code:y8,message:"Too many files"};function x8(e){return e.type===""&&typeof e.getAsFile=="function"}function xk(e,t){var a=e.type==="application/x-moz-file"||p8(e,t)||x8(e);return[a,a?null:v8(t)]}function wk(e,t,a){if(wr(e.size))if(wr(t)&&wr(a)){if(e.size>a)return[!1,rx(a)];if(e.size<t)return[!1,lx(t)]}else{if(wr(t)&&e.size<t)return[!1,lx(t)];if(wr(a)&&e.size>a)return[!1,rx(a)]}return[!0,null]}function wr(e){return e!=null}function w8(e){var t=e.files,a=e.accept,r=e.minSize,o=e.maxSize,s=e.multiple,c=e.maxFiles,d=e.validator;return!s&&t.length>1||s&&c>=1&&t.length>c?!1:t.every(function(p){var f=xk(p,a),y=es(f,1),m=y[0],b=wk(p,r,o),x=es(b,1),k=x[0],C=d?d(p):null;return m&&k&&!C})}function gu(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Io(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function ox(e){e.preventDefault()}function S8(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function k8(e){return e.indexOf("Edge/")!==-1}function C8(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return S8(e)||k8(e)}function Na(){for(var e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];return function(r){for(var o=arguments.length,s=new Array(o>1?o-1:0),c=1;c<o;c++)s[c-1]=arguments[c];return t.some(function(d){return!gu(r)&&d&&d.apply(void 0,[r].concat(s)),gu(r)})}}function E8(){return"showOpenFilePicker"in window}function A8(e){if(wr(e)){var t=Object.entries(e).filter(function(a){var r=es(a,2),o=r[0],s=r[1],c=!0;return Sk(o)||(console.warn('Skipped "'.concat(o,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),c=!1),(!Array.isArray(s)||!s.every(kk))&&(console.warn('Skipped "'.concat(o,'" because an invalid file extension was provided.')),c=!1),c}).reduce(function(a,r){var o=es(r,2),s=o[0],c=o[1];return ix(ix({},a),{},vk({},s,c))},{});return[{description:"Files",accept:t}]}return e}function j8(e){if(wr(e))return Object.entries(e).reduce(function(t,a){var r=es(a,2),o=r[0],s=r[1];return[].concat(nx(t),[o],nx(s))},[]).filter(function(t){return Sk(t)||kk(t)}).join(",")}function T8(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function R8(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function Sk(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||e==="application/*"||/\w+\/[-+.\w]+/g.test(e)}function kk(e){return/^.*\.[\w]+$/.test(e)}var N8=["children"],_8=["open"],O8=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],M8=["refKey","onChange","onClick"];function sx(e){return z8(e)||L8(e)||Ck(e)||D8()}function D8(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1140
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function L8(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function z8(e){if(Array.isArray(e))return Oh(e)}function Qp(e,t){return B8(e)||P8(e,t)||Ck(e,t)||I8()}function I8(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1141
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ck(e,t){if(e){if(typeof e=="string")return Oh(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);if(a==="Object"&&e.constructor&&(a=e.constructor.name),a==="Map"||a==="Set")return Array.from(e);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return Oh(e,t)}}function Oh(e,t){(t==null||t>e.length)&&(t=e.length);for(var a=0,r=new Array(t);a<t;a++)r[a]=e[a];return r}function P8(e,t){var a=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(a!=null){var r=[],o=!0,s=!1,c,d;try{for(a=a.call(e);!(o=(c=a.next()).done)&&(r.push(c.value),!(t&&r.length===t));o=!0);}catch(p){s=!0,d=p}finally{try{!o&&a.return!=null&&a.return()}finally{if(s)throw d}}return r}}function B8(e){if(Array.isArray(e))return e}function cx(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),a.push.apply(a,r)}return a}function Ct(e){for(var t=1;t<arguments.length;t++){var a=arguments[t]!=null?arguments[t]:{};t%2?cx(Object(a),!0).forEach(function(r){Mh(e,r,a[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):cx(Object(a)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(a,r))})}return e}function Mh(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function yu(e,t){if(e==null)return{};var a=U8(e,t),r,o;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(o=0;o<s.length;o++)r=s[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function U8(e,t){if(e==null)return{};var a={},r=Object.keys(e),o,s;for(s=0;s<r.length;s++)o=r[s],!(t.indexOf(o)>=0)&&(a[o]=e[o]);return a}var Im=S.forwardRef(function(e,t){var a=e.children,r=yu(e,N8),o=Ak(r),s=o.open,c=yu(o,_8);return S.useImperativeHandle(t,function(){return{open:s}},[s]),bn.createElement(S.Fragment,null,a(Ct(Ct({},c),{},{open:s})))});Im.displayName="Dropzone";var Ek={disabled:!1,getFilesFromEvent:QI,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!1,autoFocus:!1};Im.defaultProps=Ek;Im.propTypes={children:gt.func,accept:gt.objectOf(gt.arrayOf(gt.string)),multiple:gt.bool,preventDropOnDocument:gt.bool,noClick:gt.bool,noKeyboard:gt.bool,noDrag:gt.bool,noDragEventsBubbling:gt.bool,minSize:gt.number,maxSize:gt.number,maxFiles:gt.number,disabled:gt.bool,getFilesFromEvent:gt.func,onFileDialogCancel:gt.func,onFileDialogOpen:gt.func,useFsAccessApi:gt.bool,autoFocus:gt.bool,onDragEnter:gt.func,onDragLeave:gt.func,onDragOver:gt.func,onDrop:gt.func,onDropAccepted:gt.func,onDropRejected:gt.func,onError:gt.func,validator:gt.func};var Dh={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,isDragGlobal:!1,acceptedFiles:[],fileRejections:[]};function Ak(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=Ct(Ct({},Ek),e),a=t.accept,r=t.disabled,o=t.getFilesFromEvent,s=t.maxSize,c=t.minSize,d=t.multiple,p=t.maxFiles,f=t.onDragEnter,y=t.onDragLeave,m=t.onDragOver,b=t.onDrop,x=t.onDropAccepted,k=t.onDropRejected,C=t.onFileDialogCancel,A=t.onFileDialogOpen,E=t.useFsAccessApi,R=t.autoFocus,_=t.preventDropOnDocument,U=t.noClick,I=t.noKeyboard,O=t.noDrag,P=t.noDragEventsBubbling,Y=t.onError,D=t.validator,T=S.useMemo(function(){return j8(a)},[a]),G=S.useMemo(function(){return A8(a)},[a]),W=S.useMemo(function(){return typeof A=="function"?A:ux},[A]),ae=S.useMemo(function(){return typeof C=="function"?C:ux},[C]),q=S.useRef(null),Q=S.useRef(null),F=S.useReducer(H8,Dh),ee=Qp(F,2),ie=ee[0],X=ee[1],M=ie.isFocused,L=ie.isFileDialogActive,K=S.useRef(typeof window<"u"&&window.isSecureContext&&E&&E8()),N=function(){!K.current&&L&&setTimeout(function(){if(Q.current){var H=Q.current.files;H.length||(X({type:"closeDialog"}),ae())}},300)};S.useEffect(function(){return window.addEventListener("focus",N,!1),function(){window.removeEventListener("focus",N,!1)}},[Q,L,ae,K]);var ue=S.useRef([]),ge=S.useRef([]),me=function(H){q.current&&q.current.contains(H.target)||(H.preventDefault(),ue.current=[])};S.useEffect(function(){return _&&(document.addEventListener("dragover",ox,!1),document.addEventListener("drop",me,!1)),function(){_&&(document.removeEventListener("dragover",ox),document.removeEventListener("drop",me))}},[q,_]),S.useEffect(function(){var fe=function(B){ge.current=[].concat(sx(ge.current),[B.target]),Io(B)&&X({isDragGlobal:!0,type:"setDragGlobal"})},H=function(B){ge.current=ge.current.filter(function(Te){return Te!==B.target&&Te!==null}),!(ge.current.length>0)&&X({isDragGlobal:!1,type:"setDragGlobal"})},le=function(){ge.current=[],X({isDragGlobal:!1,type:"setDragGlobal"})},pe=function(){ge.current=[],X({isDragGlobal:!1,type:"setDragGlobal"})};return document.addEventListener("dragenter",fe,!1),document.addEventListener("dragleave",H,!1),document.addEventListener("dragend",le,!1),document.addEventListener("drop",pe,!1),function(){document.removeEventListener("dragenter",fe),document.removeEventListener("dragleave",H),document.removeEventListener("dragend",le),document.removeEventListener("drop",pe)}},[q]),S.useEffect(function(){return!r&&R&&q.current&&q.current.focus(),function(){}},[q,R,r]);var Ee=S.useCallback(function(fe){Y?Y(fe):console.error(fe)},[Y]),Ue=S.useCallback(function(fe){fe.preventDefault(),fe.persist(),Bt(fe),ue.current=[].concat(sx(ue.current),[fe.target]),Io(fe)&&Promise.resolve(o(fe)).then(function(H){if(!(gu(fe)&&!P)){var le=H.length,pe=le>0&&w8({files:H,accept:T,minSize:c,maxSize:s,multiple:d,maxFiles:p,validator:D}),ye=le>0&&!pe;X({isDragAccept:pe,isDragReject:ye,isDragActive:!0,type:"setDraggedFiles"}),f&&f(fe)}}).catch(function(H){return Ee(H)})},[o,f,Ee,P,T,c,s,d,p,D]),Re=S.useCallback(function(fe){fe.preventDefault(),fe.persist(),Bt(fe);var H=Io(fe);if(H&&fe.dataTransfer)try{fe.dataTransfer.dropEffect="copy"}catch{}return H&&m&&m(fe),!1},[m,P]),tt=S.useCallback(function(fe){fe.preventDefault(),fe.persist(),Bt(fe);var H=ue.current.filter(function(pe){return q.current&&q.current.contains(pe)}),le=H.indexOf(fe.target);le!==-1&&H.splice(le,1),ue.current=H,!(H.length>0)&&(X({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Io(fe)&&y&&y(fe))},[q,y,P]),It=S.useCallback(function(fe,H){var le=[],pe=[];fe.forEach(function(ye){var B=xk(ye,T),Te=Qp(B,2),it=Te[0],Pe=Te[1],Xe=wk(ye,c,s),We=Qp(Xe,2),Se=We[0],Zt=We[1],lt=D?D(ye):null;if(it&&Se&&!lt)le.push(ye);else{var Ba=[Pe,Zt];lt&&(Ba=Ba.concat(lt)),pe.push({file:ye,errors:Ba.filter(function(hi){return hi})})}}),(!d&&le.length>1||d&&p>=1&&le.length>p)&&(le.forEach(function(ye){pe.push({file:ye,errors:[b8]})}),le.splice(0)),X({acceptedFiles:le,fileRejections:pe,type:"setFiles"}),b&&b(le,pe,H),pe.length>0&&k&&k(pe,H),le.length>0&&x&&x(le,H)},[X,d,T,c,s,p,b,x,k,D]),xt=S.useCallback(function(fe){fe.preventDefault(),fe.persist(),Bt(fe),ue.current=[],Io(fe)&&Promise.resolve(o(fe)).then(function(H){gu(fe)&&!P||It(H,fe)}).catch(function(H){return Ee(H)}),X({type:"reset"})},[o,It,Ee,P]),wt=S.useCallback(function(){if(K.current){X({type:"openDialog"}),W();var fe={multiple:d,types:G};window.showOpenFilePicker(fe).then(function(H){return o(H)}).then(function(H){It(H,null),X({type:"closeDialog"})}).catch(function(H){T8(H)?(ae(H),X({type:"closeDialog"})):R8(H)?(K.current=!1,Q.current?(Q.current.value=null,Q.current.click()):Ee(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):Ee(H)});return}Q.current&&(X({type:"openDialog"}),W(),Q.current.value=null,Q.current.click())},[X,W,ae,E,It,Ee,G,d]),vt=S.useCallback(function(fe){!q.current||!q.current.isEqualNode(fe.target)||(fe.key===" "||fe.key==="Enter"||fe.keyCode===32||fe.keyCode===13)&&(fe.preventDefault(),wt())},[q,wt]),an=S.useCallback(function(){X({type:"focus"})},[]),Be=S.useCallback(function(){X({type:"blur"})},[]),ht=S.useCallback(function(){U||(C8()?setTimeout(wt,0):wt())},[U,wt]),Pt=function(H){return r?null:H},Mt=function(H){return I?null:Pt(H)},he=function(H){return O?null:Pt(H)},Bt=function(H){P&&H.stopPropagation()},Qn=S.useMemo(function(){return function(){var fe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},H=fe.refKey,le=H===void 0?"ref":H,pe=fe.role,ye=fe.onKeyDown,B=fe.onFocus,Te=fe.onBlur,it=fe.onClick,Pe=fe.onDragEnter,Xe=fe.onDragOver,We=fe.onDragLeave,Se=fe.onDrop,Zt=yu(fe,O8);return Ct(Ct(Mh({onKeyDown:Mt(Na(ye,vt)),onFocus:Mt(Na(B,an)),onBlur:Mt(Na(Te,Be)),onClick:Pt(Na(it,ht)),onDragEnter:he(Na(Pe,Ue)),onDragOver:he(Na(Xe,Re)),onDragLeave:he(Na(We,tt)),onDrop:he(Na(Se,xt)),role:typeof pe=="string"&&pe!==""?pe:"presentation"},le,q),!r&&!I?{tabIndex:0}:{}),Zt)}},[q,vt,an,Be,ht,Ue,Re,tt,xt,I,O,r]),wn=S.useCallback(function(fe){fe.stopPropagation()},[]),rt=S.useMemo(function(){return function(){var fe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},H=fe.refKey,le=H===void 0?"ref":H,pe=fe.onChange,ye=fe.onClick,B=yu(fe,M8),Te=Mh({accept:T,multiple:d,type:"file",style:{border:0,clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"},onChange:Pt(Na(pe,xt)),onClick:Pt(Na(ye,wn)),tabIndex:-1},le,Q);return Ct(Ct({},Te),B)}},[Q,a,d,xt,r]);return Ct(Ct({},ie),{},{isFocused:M&&!r,getRootProps:Qn,getInputProps:rt,rootRef:q,inputRef:Q,open:Pt(wt)})}function H8(e,t){switch(t.type){case"focus":return Ct(Ct({},e),{},{isFocused:!0});case"blur":return Ct(Ct({},e),{},{isFocused:!1});case"openDialog":return Ct(Ct({},Dh),{},{isFileDialogActive:!0});case"closeDialog":return Ct(Ct({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return Ct(Ct({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return Ct(Ct({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,isDragReject:!1});case"setDragGlobal":return Ct(Ct({},e),{},{isDragGlobal:t.isDragGlobal});case"reset":return Ct({},Dh);default:return e}}function ux(){}function dx({value:e,onChange:t,options:a,placeholder:r="Select…",disabled:o=!1,className:s,ariaLabel:c,prefixIcon:d}){const[p,f]=S.useState(!1),[y,m]=S.useState(null),[b,x]=S.useState(()=>{const D=a.findIndex(T=>T.value===e);return D>=0?D:0}),k=S.useRef(null),C=S.useRef(null),A=S.useRef(null),E=a.find(D=>D.value===e),R=(E==null?void 0:E.label)??r,_=S.useCallback(()=>{var D;f(!1),(D=C.current)==null||D.focus()},[]),U=S.useCallback(()=>{const D=C.current;if(!D)return;const T=D.getBoundingClientRect(),G=Math.min(240,a.length*36+16),W=window.innerHeight-T.bottom,ae=T.top,q=W<G+16&&ae>W?"above":"below";m({left:T.left,top:q==="below"?T.bottom+4:T.top-4,width:T.width,placement:q})},[a.length]);S.useLayoutEffect(()=>{p&&U()},[p,U]),S.useEffect(()=>{if(!p)return;const D=()=>U(),T=()=>U(),G=ae=>{var Q,F;const q=ae.target;(Q=k.current)!=null&&Q.contains(q)||(F=A.current)!=null&&F.contains(q)||f(!1)},W=ae=>{ae.key==="Escape"&&(ae.preventDefault(),_())};return window.addEventListener("scroll",D,!0),window.addEventListener("resize",T),document.addEventListener("mousedown",G),document.addEventListener("keydown",W),()=>{window.removeEventListener("scroll",D,!0),window.removeEventListener("resize",T),document.removeEventListener("mousedown",G),document.removeEventListener("keydown",W)}},[p,_,U]),S.useEffect(()=>{if(p){const D=a.findIndex(T=>T.value===e);x(D>=0?D:0),requestAnimationFrame(()=>{var T;return(T=A.current)==null?void 0:T.focus()})}},[p,e,a]),S.useEffect(()=>{o&&p&&f(!1)},[o,p]);const I=D=>{o||(D.key==="ArrowDown"||D.key==="Enter"||D.key===" ")&&(D.preventDefault(),f(!0))},O=D=>{var T;if(D.key==="ArrowDown")D.preventDefault(),x(G=>{var W;for(let ae=1;ae<=a.length;ae++){const q=(G+ae)%a.length;if(!((W=a[q])!=null&&W.disabled))return q}return G});else if(D.key==="ArrowUp")D.preventDefault(),x(G=>{var W;for(let ae=1;ae<=a.length;ae++){const q=(G-ae+a.length)%a.length;if(!((W=a[q])!=null&&W.disabled))return q}return G});else if(D.key==="Enter"){D.preventDefault();const G=a[b];G&&!G.disabled&&(t(G.value),_())}else if(D.key==="Home"){D.preventDefault();const G=a.findIndex(W=>!W.disabled);G>=0&&x(G)}else if(D.key==="End"){D.preventDefault();let G=-1;for(let W=a.length-1;W>=0;W--)if(!((T=a[W])!=null&&T.disabled)){G=W;break}G>=0&&x(G)}},P=["v10-select",s,o?"disabled":"",p?"open":""].filter(Boolean).join(" "),Y=y?y.placement==="below"?{position:"fixed",left:y.left,top:y.top,width:y.width}:{position:"fixed",left:y.left,top:y.top,width:y.width,transform:"translateY(-100%)"}:void 0;return g.jsxs("div",{ref:k,className:P,children:[g.jsxs("button",{ref:C,type:"button",className:"v10-select-trigger",onClick:()=>!o&&f(D=>!D),onKeyDown:I,disabled:o,"aria-haspopup":"listbox","aria-expanded":p,"aria-label":c,children:[d&&g.jsx("span",{className:"v10-select-prefix","aria-hidden":"true",children:d}),g.jsx("span",{className:`v10-select-value ${E?"":"placeholder"}`,children:R}),g.jsx(dN,{className:"v10-select-caret",size:12,"aria-hidden":"true"})]}),p&&y&&jA.createPortal(g.jsxs("ul",{ref:A,className:`v10-select-menu v10-select-menu-${y.placement}`,role:"listbox",tabIndex:-1,onKeyDown:O,style:Y,children:[a.length===0&&g.jsx("li",{className:"v10-select-option empty","aria-disabled":"true",children:"No options"}),a.map((D,T)=>g.jsx("li",{role:"option","aria-selected":D.value===e,title:D.label,className:["v10-select-option",D.value===e?"selected":"",T===b?"highlighted":"",D.disabled?"disabled":""].filter(Boolean).join(" "),onMouseEnter:()=>x(T),onMouseDown:G=>G.preventDefault(),onClick:()=>{o||D.disabled||(t(D.value),_())},children:D.label},D.value))]}),document.body)]})}function fx(e){return e.bridgeOnline?"connected":e.status==="connecting"?"known":e.status==="degraded"?"degraded":"offline"}function $8(e,t){return t?"Session history":e.chatReady?`${e.name} connected`:e.status==="connecting"?`${e.name} is connecting…`:e.status==="degraded"?`${e.name} degraded`:`${e.name} is unavailable`}function q8(e){const[t,a]=S.useState(!1),[r,o]=S.useState(!1),s=S.useRef(null),c=S.useRef(null),d=S.useRef(null);S.useLayoutEffect(()=>{if(!t)return;const m=d.current,b=c.current;if(!m||!b)return;const k=(b.closest(".v10-panel-right")||document.body).getBoundingClientRect();b.getBoundingClientRect().left+m.offsetWidth>k.right-4?o(!0):o(!1)},[t]);const p=S.useCallback(()=>{var m;a(!1),(m=c.current)==null||m.focus()},[]);S.useEffect(()=>{if(!t)return;const m=x=>{var k;(k=s.current)!=null&&k.contains(x.target)||a(!1)},b=x=>{x.key==="Escape"&&(x.preventDefault(),p())};return document.addEventListener("mousedown",m),document.addEventListener("keydown",b),()=>{document.removeEventListener("mousedown",m),document.removeEventListener("keydown",b)}},[t,p]),S.useEffect(()=>{var b;if(!t)return;const m=(b=d.current)==null?void 0:b.querySelector(".v10-agent-tab-menu-item:not(:disabled)");m==null||m.focus()},[t]);const f=m=>{(m.key==="ArrowDown"||m.key==="Enter"||m.key===" ")&&(m.preventDefault(),a(!0))},y=m=>{var A,E;if(m.key==="Tab"){a(!1);return}if(m.key!=="ArrowDown"&&m.key!=="ArrowUp")return;m.preventDefault();const b=Array.from(((A=d.current)==null?void 0:A.querySelectorAll(".v10-agent-tab-menu-item:not(:disabled)"))??[]);if(b.length===0)return;const x=b.findIndex(R=>R===document.activeElement),k=m.key==="ArrowDown"?1:-1,C=x===-1?k===1?0:b.length-1:(x+k+b.length)%b.length;(E=b[C])==null||E.focus()};return g.jsxs("div",{className:"v10-agent-tab-menu",ref:s,children:[g.jsx("button",{ref:c,type:"button",className:"v10-agent-tab-menu-trigger","aria-label":`More actions for ${e.integration.name}`,"aria-haspopup":"menu","aria-expanded":t,title:`More actions for ${e.integration.name}`,onClick:m=>{m.stopPropagation(),a(b=>!b)},onKeyDown:f,children:g.jsx(gN,{"aria-hidden":"true",size:14})}),t&&g.jsxs("div",{ref:d,className:`v10-agent-tab-menu-popover${r?" align-right":""}`,role:"menu",onKeyDown:y,children:[g.jsxs("div",{className:"v10-agent-tab-menu-status","aria-hidden":"true",children:[g.jsx("span",{className:`v10-agents-stat-dot ${e.statusDotClass}`}),g.jsx("span",{children:e.statusLabel})]}),g.jsx("button",{type:"button",role:"menuitem",className:"v10-agent-tab-menu-item",disabled:e.refreshBusy,onClick:()=>{p(),e.onRefresh()},children:e.refreshBusy?"Refreshing…":"Refresh"}),e.canClearSession&&g.jsx("button",{type:"button",role:"menuitem",className:"v10-agent-tab-menu-item",disabled:e.clearBusy,onClick:()=>{var m;p(),(m=e.onClearSession)==null||m.call(e)},children:e.clearBusy?"Clearing…":"Clear session"}),e.canDisconnect&&g.jsx("button",{type:"button",role:"menuitem",className:"v10-agent-tab-menu-item danger",onClick:()=>{p(),e.onDisconnect()},children:"Disconnect"})]})]})}function Pm(e,t){return(t==null?void 0:t.trim())||`integration:${e}`}function Vo(e){const t=e.sessionId??e.defaultSessionId??br(e.integrationId);return{integrationId:e.integrationId,sessionId:t,stateKey:Pm(e.integrationId,t)}}function jk(e,t){for(const a of t)if(e===a.id||e.startsWith(`${a.id}:`))return{id:a.id,name:a.name};return null}function Tk(e){var a;if(e.selectedSessionId==null)return!1;const t=e.integrations.find(r=>r.id===e.integrationId);return!(((a=jk(e.selectedSessionId,e.integrations))==null?void 0:a.id)!==e.integrationId||t!=null&&t.defaultSessionId&&e.selectedSessionId!==t.defaultSessionId&&G8(e.integrationId,e.selectedSessionId))}function F8(e){return Tk(e)}function G8(e,t){return t===`${e}:dkg-ui`||t.startsWith(`${e}:dkg-ui:profile-`)||t.startsWith(`${e}:dkg-ui:home-`)||t.startsWith(`${e}:dkg-ui:transport-`)}function px(e,t){const a=e.flatMap(r=>{var d;const o=jk(r.session,t);if(!o)return[];const s=r.messages.find(p=>p.author==="user"),c=r.messages[r.messages.length-1];return[{sessionId:r.session,integrationId:o.id,integrationName:o.name,preview:((d=s==null?void 0:s.text)==null?void 0:d.slice(0,60))||r.session,messageCount:r.messages.length,lastTs:c==null?void 0:c.ts}]});return a.sort((r,o)=>{const s=Date.parse(r.lastTs??""),c=Date.parse(o.lastTs??"");return Number.isFinite(s)&&Number.isFinite(c)?c-s:String(o.lastTs??"").localeCompare(String(r.lastTs??""))}),a}function Rk(e,t,a,r,o){var c;const s=Vo({integrationId:e,sessionId:t,defaultSessionId:o});return(((c=a[s.stateKey])==null?void 0:c.length)??0)>0||(s.sessionId?r.some(d=>d.sessionId===s.sessionId):!1)}function Nk(e,t,a){const r=Pm(e,null);return Object.entries(t).some(([o,s])=>s.length>0&&(o===r||o.startsWith(`${e}:`)))||a.some(o=>o.integrationId===e)}function V8(e){const t=[...e.integrations].sort(_u),a=t.filter(d=>d.persistentChat),r=t.find(d=>d.id===e.selectedIntegrationId)??a[0]??null,o=r?Vo({integrationId:r.id,sessionId:e.selectedSessionId,defaultSessionId:r.defaultSessionId}):null,s=r?Rk(r.id,e.selectedSessionId,e.localMessagesByConversation,e.sessions,r.defaultSessionId):!1,c=r?Nk(r.id,e.localMessagesByConversation,e.sessions):!1;return{sortedIntegrations:t,connectedIntegrations:a,selectedIntegration:r,selectedConversation:o,selectedHasConversation:s,selectedIntegrationHasAnyConversation:c}}function W8(e){const t=e.selectedIntegration,a=!!(t&&!t.persistentChat&&e.selectedHasConversation),r=!!(t&&!t.persistentChat&&e.selectedIntegrationHasAnyConversation),o=r?[t,...e.connectedAgents.filter(d=>d.id!==t.id)]:e.connectedAgents,s=e.selectedIntegrationId===Sr||!t&&e.connectedAgents.length===0||!!(t&&!t.persistentChat&&!e.selectedIntegrationHasAnyConversation),c=!e.localHistoryLoaded&&e.localMessagesCount===0&&!!(t!=null&&t.persistentChat||e.selectedHasConversation);return{showingSessionHistory:a,showingStoredSessions:r,visibleAgentTabs:o,showAddFlow:s,shouldShowConversationLoader:c}}function _u(e,t){const a=e.id==="openclaw"?0:1,r=t.id==="openclaw"?0:1;return a!==r?a-r:e.persistentChat!==t.persistentChat?e.persistentChat?-1:1:e.name.localeCompare(t.name)}function Wc(e,t){return[...e.filter(a=>a.id!==t.id),t].sort(_u)}function Y8(e,t){const a=e.find(c=>c.id===t);if(!a)return e;const r=a.connectSupported,o=r?"available":"coming_soon",s=r?"Ready to connect":"Coming next";return Wc(e,{...a,configured:!1,detected:!1,persistentChat:!1,chatReady:!1,bridgeOnline:!1,bridgeStatusLabel:s,status:o,statusLabel:s,detail:r?`${a.name} is no longer attached to this node. Reconnect from the + tab when you want live chat again.`:a.detail,error:void 0,target:void 0})}function K8(e){const t=e.selectedItem;return e.selectedIntegrationId===Sr||t!=null&&(t.persistentChat||Rk(e.selectedIntegrationId,e.selectedSessionId,e.localMessagesByConversation,e.sessionSummaries,t.defaultSessionId)||Nk(e.selectedIntegrationId,e.localMessagesByConversation,e.sessionSummaries))}const Q8={openclaw:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAEy0lEQVR42u2ba4hVVRTHf1OmM9GUjzITRmEyX4nglxwjzZKMIsFHGEJJJlLfJGTGBD8kRkRCVmrRA8ueSqmRqJFOpqb2QafR0sovvbTygaPQpONM3s6W/43D7Z65Zx/OuWcfuAsWM/fOXnut/9pr77322nugQhWqUIWiUzVwC1CXgu466a5OC/wdwA9ADugE9gCPAD0S1NlDOvZIp9H9I9CQhgOmA98BrwIfAG0yaDswIgF9I9S30XFGOo3uVs8h96QVBVf6fh8IvCADTwFTfH8bANztOWk+sBLYAHyhkfwKaAbWAyvUZhJwk09+ivrMScdA39+qXFsX7gV+Bi4Ay4GtPuNt+LQX2p8BL6ov0+fkLCyMozWiuZi5WX07S4OBNzVauYT4gnQMdg38w8DxBIEX8nHtBqlTL+ClMgIv5JdlQyp0LbAxRfB5/kS2lJWu0eqec4S3yqaykMnG1joEPs9rE85C/6MlDoLP89NJg5/sy8HDrNQ7gIMRwVwCWtTHiZAyF5NMi3sD31usztdLrqfODW0W4H8H7vPp7g+sCSlrbLwuzdBvVn5u5uMqL2r2Ard6ETEvpPw/3iHrQekcBuwE3tEAHAjZx5IksrwzIZU/7jM+/90qjcq5EPLHgFr1sdj3/RhgYUgbjK2D4nTA8xbh+5ivWPKGRu12L2HqE3Ia/OLpu1p9jAK+1kmxxsIBhp+LC3w/zcmwijcUyF+hn7O0sJWS79TRudhxd6flOtIvDgfMtVy9zRxuBK7y9WEi4FeLPg4XnPxMND0bYSeZE4cDXrPY+vxsQv8tYDPwdwT5c0q1V3u7yKEI8p2qGFnTDcBQb+Wt18pbo89TlWgccTgROiIbp8rmamGo1+f+3QE3CcQWJR3m3N3uhf9vwDYtPg+oElujUXEN/GrZVidbm7yp97kwtAvTSZ0b/pcszVYWVUrJX5rfPR2LhMOyqVE2hskYZ/uLmactlHWoYPmMQw5YKpsuWtYcLxdXn4igcGxEuaTY2HJbRDnrUlaHsqyljkXAIMsIyGlrvjx/bIRaIiQlSfOXsqnFUu5blCzYJhc3ezvDeYcccF422WJ5FF0whk1U9snTaxzcBt+WbftCtjeYh+Rz7U0hBMxBZriurbocdECXbBse8tD1qf+cMa7EAmISifuVSf3kcCZobLtRtraXyAPGFSZDTd10epdSyr0Og/dP096yOWiwGoPSYXNk3a3t4RttL30UVvszAD7P+2VzX2FoUZ1hF/BQmANRre/q+ymLapBL3Cbb89f4tVHvAFozCD7PrXHcFSzKsAMWxlEQGVpiRXWV25XjxELrM+iAj+OsCk9UrS8r4I2td8bpgCpVi7LigC1JPJ4aq6Ow6+A7VBtIhFZmwAErkrwdNhcNRx0GfzSuy5DuaJKjU6FDtpWFmhx0QFM53whV6cbIFfCvp/Fk1jxPW+cA+HVpPpUzNzHvpgj+PdmQKpnT1rIUwC8r16swm+eyf5QB+J/S5STVKyy7Eip6vq/yt/M0HvgQOBsD8LNa6MaTQZoT8P7vSWAB8Iq200X6fKmbN0eZpGkBo1rsn5waAtpOy7IDZgSAmlCk7YSAtjMqDsgwzQwANTGg6lSs7cwsO8DM64+K8MgibUcGtG2gQsnRv1P7PFimYrmBAAAAAElFTkSuQmCC",hermes:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAANwElEQVR42rVbCZAcVRn+Z3bume6ZnnN3dg0EEzmMiWCJpVUmIjEeWJZiqRRBEw8owERRU4pXieWBEsAyZUlQMXhfSCkBQUuU9RY8IhQaECMEEjAEYyRkQULWflPfW7/8eT3dvYtb1cl0v9fv/e//X//H9/9PRGRURMZEpCIiIyLSFpGeiORFpIS2Jto8EemLSA33LbxfFJEC3mujrYq+Pu6bGKuEsbsi0hGRHOY2bQ30bRBNOfTrRtDkK5raoKkAukZB5wj69LEOcx8IBusTAzp4yU7Wx2RZvDiOgbIYeIwYwJNV0ddH3ybGsgzoYS7Tt4y2Ovo2FE1d9M8RTQH6+pinGsGAMdCUBd3jWIelaTBJBZO20KmKxgBtNbT5ILaO9hraA0ffOvVtYVI7T4A57DwNtPk0j+3bpL4B9fUc8zSJfk1TE30q1NeMMeDaSIyEKuCcllCZJGS3aFlJqJ5CQkl2WBttVUVToOi3NPEOaxBNdocNBuxgwCIY0cZAFbQFaPMwqIf7AH0rmKSN94tYRBfSLGDyDvqWsLgmftfQVld9a0RTS9HUQF8f83DfDugpJ6B/IOlRMCCPRXQxeAntAb4/DxKp4b6J9hIG7IHQHMYbA4G27yiIKoCwNuasoK2Bvg3cV4imDt4ro83S5BP9OczfAz2W/ibaaqDJw/2AAfkIArsOAusRBHZwcV8mcEwR2FUEagYzgczgLt7POxgcOBjciWBwnZg2M3iACewWbWOyIjryFq2rz6aF/tx32BZtp9iivJ2TfmKWJvvZRNFf02bQ2lzrBxQdfoBWUlahsZKKM4N2HvMsQz6ET0p2DIt2+QFxZrBHNEWZQav4B/9ok9bE7ypeZtPTVCatGWHSPGU6PZKsmWueiDxdRI4TkWNF5Kloz2CRwRAz2yTz56cws57DzA44YaXZB9dykCabEWtyMnhxHISOgOM9/C6ibcBdkq55tlhEVoVjbxSRX4vIv0VkWkT2icgOEflVKMHPhP+vwNhl2mF5/O6QGZzAYjJY9Djm1zSV0NZAX2uazfgDrvi46iSpOt3bNl/dR/X1aOuuDNs+FT67RETeKiInYVsa4k8VkWvABH39UUTejjGKKWjyU/YdSN1yI0OucA6c72N3ZPDyBLZhBt9bX0mohuttInKnY2FTIRMmReQ0vGf+3kC7QV9mVywnbc87LIPnE9gRlv4x0GPpb6Othr72UzPrmiG4Tt9dDduljt8e3VcxaQPPa/Q7D6luiViMvjbSQl4qIv+K6LdXRF6PxTeIpgC0MP1MU0PRb/sy/Ye5wi4dUIkIVkoUVR2B7/eJhIu31w8gNcEio95/VETeTIGMtjLWFY7SAZGusLXhNXwGUVbAatw2iCjTjjkmlOBvUy7cLmpXyOjP0g7aOKT/dSKyEAtoYGF+Cvo9Rf/ACgzDA2w8HYUHmPsTReQOReiBIYv4h4jcH37320TkZSJyPBTeKuy8Ptq13vge9MoFMKENhQdE+QHD8ICBpbKRlvUEy3jWwYsFDN5VwUobjNsMSVpid4rIfSThg2oxRuLvFZHV2ParwMBPgzAz14WhxXhQRK7CWJeh79PwfDW2ck95gl3yBNvknVaI/jz+71lXuEAMYL/bBiuWAT0awDobhpD3iMgPsdDHQi5fDM1tFv8dfLdmkb8RkZtCBpwLzp+P7b4VfS8XkaVY0KJwsV8XkVNE5EuhhXgnpH8ZmHgzuc0+0dQjAXIAVUFbw8WAniOwcX0COfoEzCRHwpRNYGBj59eLyGtxvxzm7cMiskRE1sIRssStc3wel0LShpZfQtrb0fZIyPC78fsgrIaoTyCXABLjYKsptFWsErGxdxmEtEnheASSvE9ErghN1DtE5IVYqJHwnyGhu5Vtn4K3twXt9zgY8AcQlsH4wxTolRRtWvqtC90ipKuNZ0y/h/vGbMxgBjvkNmx5I42HhxCaxiz+M5zvI2Dk9WDatEOPWGV6HAVmgTLNvaSIUDXCEbL4W1U5HYZBy1IsbAe2b5K+ByhGuAUMngaDXZZlJekopr9KjpCmv6qcpkNc4azDFR5XrrB5cU0KqW5P6SPcA6VoJHwXGL0vwku8FBKekyvsp7yMYvloigX9B9p7KkHfgyR1vTO2R8QJVRXQ+erei1nPIeHwuEMHZFU4LPhOoxZxr0Mn/FREfj4LT5Gvvyt/YxpWYh5omnU43HSAHAHphkAFQRXY5ChCH4E5NJ7e37B9jT9wpoj8Dtv6r7AEO1Iw4EFcWsEupbC8GkG/BnR8yg8cAollyY7mFCSWJTPybIc0DsDLW0tJltfAz/+JiPxIRN5PQGsfKNDahAx4DLtAPz+bFsz052MgsZnMUIlsYocw/pYCIBlUNO1fIYlPw3F5tYicTjsqA/9gJzHJMOJVGFfg0OhF3Qo7f5PS/tsc1mADRag67+ACRYsaFNWweEnB4jkHLO7BE7wBfvyfoORug2u7jCRiwuQ3Ybt+F4y7CN9mBszQDDDO0u8BnOxXccYe1fdnlFAdpcwQw+LlCFh84Ad0yS/OE26vEyN5LHyUpNuGb38q0B8TGO0ml7cLs2Pc46/B3z+Nkh1GAq9IoQcexi7gZ7vhEJUV/Tbv0IVw85hvlELvQWLEQs5VLJpTY4zbFxRuXyDEpQTp347vvEC4vcXnngKNnaN4wIx/VgoGGDP5F4dn+EqKXWxqjOlvEv09on/AgJz6BIoqOcr5+7rK31vn6UhI4luUlQlUvF4mJdUjPHBDSnO43eFZnk8KTydHc5ib6w/qhIHMKD2ruat41kyQ8rbZnmPgx38QW/4EQl0Yt9eITR6QWBoG7MVc/GwzKT6mvxlBv0/0H2YGu8oV1unrCQpAbCS5BP77i4HyWLvLuH2THJUc6YetKRnwOMwtP7sfNLtc4TFKqbMrbJ2/maDBhfF7Ch32FbpqCw5egu/yFIAfPukBxukbymlZFBNJDnOKtG5YQSYuDf2RmaGxCFdYZ4bM31tAyDp4gb8Ix/m4iCwg3L6iJGT+Tp6lW7zfoQjXg67UrnBDYfxpOVgExjcN2OuM0PZvwk44j96tq3mKAFN0JPjQLGKEaTC94shaRdHvaVeYy11cmaGsgsSsDvCRD7BbcQ22Y5USkRmF21tn6vNqMRfCnKZhwHUInffC1AbkCueT6IA0VsBmVxeRD2AWc63y4loOK6Bx+5yyAFOAyG9JyQBjeq/G79cRAmStQDnOCuQIEovzA4pwXE4mZ6nokNo6jJGlChGrL9qEPnMKbRLKdFdKBnwj1Anvxu9PKmvm8gMOg8RcnmDH4Qla13ES+LwFJBdj+2lnZQlBUB5qAE4kBs9TIMduoD4PpGTAlaSENyH7vIwWHusJRsUC7Etbr24cEloBaZpn5wwxVZOIErdicfvhKpu/+QoPMLvhBcAN0jDgYwSxm+DsmSFzv0hFlbGxQFw0mCd4+Xho6S0IY5dTCny/AyOI8udXgQm30vM34tn6lAxYCcDFhuSjwCCPpoKqodFgHB5QonTz82HqXN7ZNxPiftNAhM5TDHsAKNHBFIvfA8bZ/MON+LTuBWjjx+AB1TSIkMDn3wx8z8Li9yEkvp6QmycS5gAuSrlgVxXJzXR/OT5PI4ijsJ5YRIgxwWoMJmgY8mUR+bGIfAAWYQUU0TQ5QwcSuLIvgg7ZOAcG6HnOAS07KTvE+Q2fMMGqyxXmYEWjwjYIasPrOgDQc4+SyLeHEDwFp2kpdpQNWz80C/Onr4dgDSwM7ydwhSs6L1Afgp/XaSc0kbG9HVt+JzTwakduX6O4a6i2x5bQmb9PUL+7yBxOYXG7AL1NRiRJroBg9kFZV2LW47uKpLJDXGEukqqA6HmY1Ciil2MHRAUrXB+wgOIJgwx/FYvbAMj9KliXM6HNj4X3eRLc5UuQhOV44EYw+FxKgycuknLl1oIEuTXDpHepxd4JizBMuRk7/YyQmC8A4roAWns+lOkdWPAIudBlbGUjnM9BFzHavAPp+JwjN+jKbwRcJMWlrMWURVIZwOEXwyE5CvZ4WKrscWzza7FdF8Jz3IRFHY0dZs8LcBmeFdLVSKTuhwu8kGqOc2mKpNqEkZcS1gd4Khc/Iv/7Oz0mdN0GTb0Y0jgC1WFnw56fQBUqVQdNVrqL8dlcQ7uDaSonqA8IbJHU6JBiaV0hwucFuDbfMOG5sAyPQnlN4Zu/AZ+GSY19n7bhfEhyMUpizgITG1T6HnVoqgK4/QxiVk6BrvoMg64Qac2lRqgHIgpUWt/HYp4XOkzPQtC0AIpnARypcSrDN/8/B+NN0Lg18tW7JN0Oubc18lR1jVCB8EquEXIWSaWtEssPqciyIESTymmrNG6WzgCUaHsHVHano7UubXGmqeYQiqapparEuEjKnmGYU52gPjeoj80lPTdYprxDNuG5wSBBnWAxSZ1gKwKxSVIpqlEkV1WmH4M4ldWxvJLKO5QVxl8ldKcUUb0aVynKNM3ZDLrOC0Sd6Miqg5lx6WuXGXSdF4grknKZwRlXuBaB2rqqxV3V1royuxaBxHpqnpoDtfUcqHNSmmZLv7NIaizleYE8FT20SfkNywz1Ep5IyRJqNfL/OC/gqcyN/yScGBn2bt3xrp+iL4/bmOOJEc+VGSrO8cyQDT0Dh4RcOqAfk3vsz+LMUC5NZihQgMiwU2OuE1p8aqxFuQR9aowPZ8edBNMHrgOV6Y07NaZPsgURp8aC/wJs6rIsXDWrggAAAABJRU5ErkJggg==","prime-agent":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAEUElEQVR42u2Za4hWRRjHf7uuklZ0pSuRG26WUdHVIilqsduHXa39UJBCJWWlkNLNCrthQR+iD4ZWFLFZEhWRKJYVka6Q+qnY7trFG9GuZRetzextBv4Lw2HOeed99z3nLNv8YfZlmTkzzzPnufyf50BERERERERERERERETEiMcRwAH/J4UPAqYAC4E1wE7gY+C4kaz0aOBSYDHwDVDxjPaRqPhhwGxgU4rSg+N5YOxIUnwMcCvwdRXF7XgMaG7UwQcD5wHnAseUpPxkY+4fBSj+BzCrkQdfDnwJ7NfoAz4E5ijSFuHn9wK/Byj/I3BFo33tu4wDrSlek6Pyk4D3AhS3Y6ustKE426SVf6scvA+4rcHnNgG3y9pClN8BnJPHGzjVmN+fAQLYS5jeoDNbgTcS+9uLeCfl7F3K/7lgArA38C1sA44d4nnX6226+/bIFR5NefMX5RmArg5wAXc8Wec59uK6Pfs9Z3L58cALnrkf8jJ7F695Dv7EpJq7UnJxfx3Us9PD4v4B7tP8ZZ5zdio+5YoLgQHP4VdpfmWKFcwN3P9IYInHwqzLzXTWnZJIgft1abnjrZS3byusccDmlAtYF8DAbK7u9Tz7C9ChNW3mz8PiIO6aZ4pQ/nzgb4+AMzR/ckZw3Kv5NF7xtLJG8rmfgalOJtjlzFlL3GAC7c1ASxEX4As6PeLiyA2yguEdnj3bZUGVlDc/NbH+YrlChy50VFGc+2gPARmQQIO4u8oF9Do0+XBlh4GM9XMcAjTPMLpVRulXlRlelys0F3UB13kE7E6seSkgJX5qeMSyjFhhx1+KNWOcam9bCscYV9QFLPf49GnO/KiAOjx0LJN5jzfnTjRF1iVKpe6aX03Ov7HIsnNDQoAVntL4+wYovxv4AvhANPdtFT5r9f/L4gKTiq67Z4qY7JGgt3gKlcnqt9Wj+JtKgyeojzda+05JWFqpaNHtV1KaC03K97Uq/xlwiGe/+WJ//XkWNrXA0s8tEnq5Z/6COpS3fYUzE/vYDLHUQ7YOLFP5WY75D5aiyTbYWTUqv0qVpWtB01PYYEX7l4K5KdXfnYl1zXIRG7Ce8tDVipjk+0bJrsRzV5o6490qqbGtDOWnZZCVrxSw0uDygs9NYFtkgt3pzrz1+xt0YdWsZXWRrG8QJ6rEzBJsXsbzC9Q5WqRiaazM+CZT6z/rxJNqY08RNb4P3QHC9Sv9pbXNJ6hGf8XEke01NlLSXK0QnCG/CxGwTxnCB+vbvw2BGD1RVuB7vEZBfxJtdXGoIVDf1qm4zf8PlKW8jcrr6xD6wcQ+HXUqvzXn7wpBX116axB4QGVqa2Kf++ukxOOHA+tbHWimK9Un9GFhDYpvSfT8SkdXhrC2LfViAD9vD1DcptlHgKMYZmjyBMI+fYhorSGWPKTWVrKXsNH83qP+/rBGpwqfxUOgoicB16p52amWdgsREREREREREREREREREaXhPxXZ1AH/I5YbAAAAAElFTkSuQmCC"};function X8(e){return Q8[e.trim().toLowerCase()]}function hx({integrationId:e}){const t=X8(e);return t?g.jsx("span",{className:"v10-local-agent-logo","aria-hidden":"true","data-agent-logo":e,style:{maskImage:`url("${t}")`,WebkitMaskImage:`url("${t}")`}}):null}function Z8(e){var pe,ye;const{integrations:t,selectedIntegrationId:a,selectedIntegration:r,selectedSessionId:o,selectedHasConversation:s,selectedIntegrationHasAnyConversation:c,onSelectIntegration:d,onConnectIntegration:p,onDisconnectIntegration:f,onRefreshIntegration:y,onClearIntegrationSession:m,connectBusyId:b,refreshBusyId:x,clearBusyId:k,connectNotice:C,connectError:A,localMessages:E,localHistoryLoaded:R,localChatEndRef:_,localInput:U,onLocalInputChange:I,onSendLocalMessage:O,onStopLocalStream:P,localSending:Y,activeProjectId:D,availableProjects:T,projectsLoading:G,onSelectProject:W,attachments:ae,onAddAttachments:q,onRemoveAttachment:Q}=e,F=e.selectableProjects??T,ee=ae,ie=ee.some(uk),X=[...new Set(ee.map(B=>B.contextGraphId))],M=ee.some(B=>B.status==="uploading"),K=E.some(B=>B.streaming)?"streaming":M?"uploading":"idle",N=ee.length>0&&ee.some(B=>B.contextGraphId!==D),ue=S.useRef(null),ge=S.useRef(null),[me,Ee]=S.useState(null),Ue=S.useCallback(B=>{ge.current=B,Ee(B)},[]),[Re,tt]=S.useState(!1),It=S.useCallback(()=>{const B=ge.current;if(!B)return;const Te=B.scrollHeight-B.scrollTop-B.clientHeight;tt(Te>40)},[]),xt=S.useCallback(()=>{const B=ge.current;B&&B.scrollTo({top:B.scrollHeight,behavior:"smooth"})},[]);S.useEffect(()=>{const B=ge.current;if(!B)return;const Te=requestAnimationFrame(()=>{const it=B.scrollHeight-B.scrollTop-B.clientHeight;tt(it>40)});return()=>cancelAnimationFrame(Te)},[a,o,E.length]),S.useEffect(()=>{if(!me||typeof MutationObserver>"u")return;const B=()=>{const it=me.scrollHeight-me.scrollTop-me.clientHeight;tt(it>40)};B();const Te=new MutationObserver(B);return Te.observe(me,{childList:!0,subtree:!0,characterData:!0}),()=>Te.disconnect()},[me]);const wt=(pe=e.selectedIntegration)!=null&&pe.chatAttachments?e.activeProjectId?e.localSending?"sending":null:"noProject":"unsupported",vt=wt===null,an=S.useCallback(B=>{vt&&q(B)},[vt,q]),Be=Ak({onDrop:an,noClick:!0,noKeyboard:!0}),ht=[...t].sort(_u),Pt=ht.filter(B=>B.persistentChat),Mt=ht.filter(B=>!B.persistentChat),he=r,{showingSessionHistory:Bt,showingStoredSessions:Qn,visibleAgentTabs:wn,showAddFlow:rt,shouldShowConversationLoader:fe}=W8({connectedAgents:Pt,selectedIntegration:r,selectedIntegrationId:a,selectedHasConversation:s,selectedIntegrationHasAnyConversation:c,localHistoryLoaded:R,localMessagesCount:E.length}),H=Y||!(he!=null&&he.chatReady)||he.busy===!0,le=!H&&!M&&(U.trim()!==""||ie);return g.jsxs("div",{className:"v10-agents-tab",children:[g.jsxs("div",{className:"v10-agent-subtabs",role:"tablist","aria-label":"Integrated agents",children:[wn.map(B=>{const Te=(he==null?void 0:he.id)===B.id&&!rt;return g.jsxs("div",{className:`v10-agent-subtab-group ${Te?"active":""}`,children:[g.jsxs("button",{className:`v10-agent-subtab ${Te?"active":""}`,onClick:()=>d(B.id,{preserveSession:Tk({integrationId:B.id,selectedSessionId:o,integrations:t}),sessionId:B.defaultSessionId}),role:"tab","aria-selected":Te,children:[g.jsx("span",{className:`v10-agents-stat-dot ${fx(B)}`}),g.jsx(hx,{integrationId:B.id}),g.jsx("span",{children:B.name})]}),Te&&g.jsx(q8,{integration:B,statusLabel:$8(B,Bt),statusDotClass:fx(B),refreshBusy:x===B.id,clearBusy:k===B.id,canDisconnect:B.connectSupported&&B.persistentChat,canClearSession:B.id==="local-llm",onRefresh:()=>y(B.id),onDisconnect:()=>f(B.id),onClearSession:()=>m(B.id)})]},B.id)}),g.jsx("button",{className:`v10-agent-subtab add ${rt?"active":""}`,onClick:()=>d(Sr),role:"tab","aria-selected":rt,"aria-label":"Add another integrated agent",title:"Add another integrated agent",children:"+"})]}),rt?g.jsxs("div",{className:"v10-agent-add-surface",children:[g.jsx("div",{className:"v10-agents-section-label",children:"Connect Another Agent"}),C&&g.jsx("div",{className:"v10-local-agent-notice",children:C}),A&&g.jsx("div",{className:"v10-local-agent-error",children:A}),g.jsxs("div",{className:"v10-local-agent-list","aria-label":"Available agent integrations",children:[Mt.length===0&&g.jsx("div",{className:"v10-agent-empty-state",children:"No additional local agent integrations are available yet."}),Mt.map(B=>g.jsxs("div",{className:"v10-local-agent-detail v10-local-agent-choice",children:[g.jsxs("div",{className:"v10-local-agent-detail-head",children:[g.jsxs("div",{children:[g.jsxs("div",{className:"v10-local-agent-title",children:[g.jsx(hx,{integrationId:B.id}),B.name]}),g.jsx("div",{className:"v10-local-agent-subtitle",children:B.description})]}),g.jsx("span",{className:`v10-local-agent-status-pill ${B.status}`,children:B.statusLabel})]}),g.jsx("p",{className:"v10-local-agent-copy",children:B.detail}),B.error&&g.jsx("div",{className:"v10-local-agent-warning offline",role:"status","data-testid":`local-agent-warning-${B.id}`,children:B.error}),B.id==="openclaw"&&g.jsxs(g.Fragment,{children:[g.jsx("p",{className:"v10-local-agent-copy",children:"Connect your local OpenClaw once, then this tab becomes the persistent chat surface for that agent. The node can retry the bridge without forcing you back through setup."}),g.jsxs("div",{className:"v10-local-agent-actions",children:[g.jsx("button",{className:"v10-agent-send-btn secondary",onClick:()=>p(B.id),disabled:b===B.id,children:b===B.id?"Connecting...":"Connect OpenClaw"}),g.jsx("a",{className:"v10-agent-link-btn",href:zz,target:"_blank",rel:"noreferrer",children:"Docs"}),g.jsx("a",{className:"v10-agent-link-btn",href:Iz,target:"_blank",rel:"noreferrer",children:"Release Notes"})]})]}),B.id==="prime-agent"&&g.jsxs(g.Fragment,{children:[g.jsx("p",{className:"v10-local-agent-copy",children:"Connect a local Prime Agent through the node, then this tab becomes the persistent chat surface for it. Prime Agent publishes a bridge per live session; the first chat pins one session, and you can switch explicitly when several are live."}),typeof B.sessionCount=="number"&&g.jsx("p",{className:"v10-local-agent-copy","data-testid":`local-agent-sessions-${B.id}`,children:B.sessionCount===0?"No live session. Start a Prime Agent session, then refresh — the extension publishes its bridge on session start.":B.sessionCount===1?"1 live session.":`${B.sessionCount} live sessions — choose which session this chat should use.`}),B.connectSupported&&g.jsx("div",{className:"v10-local-agent-actions",children:g.jsx("button",{className:"v10-agent-send-btn secondary",onClick:()=>p(B.id),disabled:b===B.id,children:b===B.id?"Connecting...":"Connect Prime Agent"})})]}),B.id==="hermes"&&g.jsxs(g.Fragment,{children:[g.jsx("p",{className:"v10-local-agent-copy",children:"Connect a local Hermes profile through the node, then this tab becomes the persistent chat surface for that profile."}),B.connectSupported&&g.jsx("div",{className:"v10-local-agent-actions",children:g.jsx("button",{className:"v10-agent-send-btn secondary",onClick:()=>p(B.id),disabled:b===B.id,children:b===B.id?"Connecting...":"Connect Hermes"})})]})]},B.id))]})]}):he&&g.jsxs("div",{...Be.getRootProps({className:"v10-local-agent-chat-shell"}),children:[g.jsx("input",{...Be.getInputProps()}),C&&g.jsx("div",{className:"v10-local-agent-notice",children:C}),A&&g.jsx("div",{className:"v10-local-agent-error",children:A}),!he.chatReady&&g.jsx("div",{className:`v10-local-agent-warning ${he.status==="connecting"?"connecting":"offline"}`,children:Bt?`${he.name} is not currently attached to this node. Session history remains available here; reconnect from the + tab when you want live chat again.`:he.status==="connecting"?`${he.name} is still finishing setup. This chat tab stays in place and will go live automatically when the connection is ready.`:he.status==="degraded"?he.detail:Qn?`${he.name} has saved sessions on this node. Open one from Sessions or reconnect from the + tab to resume live chat here.`:`${he.name} is temporarily unavailable. Refresh after it recovers to resume chatting here.`}),he.id==="prime-agent"&&he.busy===!0&&g.jsx("div",{className:"v10-local-agent-warning connecting",role:"status","data-testid":"prime-agent-active-turn-status",children:he.detail}),he.id==="prime-agent"&&(((ye=he.liveSessions)==null?void 0:ye.length)??0)>1&&g.jsxs("div",{className:"v10-composer-target","data-testid":"prime-agent-session-picker",children:[g.jsx("span",{className:"v10-local-agent-target-label",children:"Prime session"}),g.jsx(dx,{className:"v10-local-agent-target-select",value:o??he.defaultSessionId??"",onChange:B=>d(he.id,{sessionId:B}),options:he.liveSessions.map((B,Te)=>{var it;return{value:B.sessionId,label:((it=B.sessionName)==null?void 0:it.trim())||`${Te===0?"Most recent":`Session ${Te+1}`} · ${B.sessionId.slice(0,8)}…`}}),ariaLabel:"Prime Agent session",disabled:Y||he.busy===!0})]}),Be.isDragActive&&g.jsx("div",{className:`v10-drop-overlay active ${vt?"accept":"refuse"}`,role:"status","aria-live":"polite",children:g.jsxs("div",{className:"v10-drop-overlay-card",children:[vt?g.jsx(MN,{className:"v10-drop-overlay-icon",size:32,"aria-hidden":"true"}):g.jsx(oN,{className:"v10-drop-overlay-icon",size:32,"aria-hidden":"true"}),g.jsx("div",{className:"v10-drop-overlay-title",children:vt?`Drop files to attach to ${jh(T,D)}`:wt==="sending"?"Wait for the current send to finish.":wt==="unsupported"?`${he.name} doesn't accept file attachments.`:"Choose a context graph before attaching files."}),g.jsx("div",{className:"v10-drop-overlay-hint",children:vt?"Release to upload to this conversation.":wt==="sending"?"Drop will be accepted once the agent reply lands.":wt==="unsupported"?"Try a different agent that supports attachments.":"Use the picker below the composer."})]})}),g.jsxs("div",{className:"v10-chat-messages v10-local-agent-messages",ref:Ue,onScroll:It,children:[fe&&g.jsx("div",{className:"v10-agent-empty-state",children:"Loading the latest conversation from DKG memory..."}),!fe&&E.length===0&&(()=>{const B=Bt?{title:"No turns in this session yet.",hint:`Reconnect ${he.name} from the + tab to start a new live thread.`}:Qn?{title:`${he.name} has saved sessions.`,hint:"Open one from Sessions, or reconnect from + to start fresh."}:he.chatReady?{title:`Start a conversation with ${he.name}.`,hint:'Try: "What can you help me with?"'}:{title:`${he.name} is offline.`,hint:"Conversation history stays here while the bridge reconnects."};return g.jsxs("div",{className:"v10-agent-empty-state",children:[g.jsx("div",{className:"v10-agent-empty-state-title",children:B.title}),g.jsx("div",{className:"v10-agent-empty-state-hint",children:B.hint})]})})(),E.map(B=>{var Te,it;return g.jsxs("div",{className:`v10-chat-msg ${B.role}`,children:[g.jsx("div",{className:`v10-chat-bubble ${B.role}`,children:EI(B.content,B.role,!!B.synthesized,!!B.streaming,B.failureNotice)}),B.attachments&&B.attachments.length>0&&g.jsx("div",{className:"v10-local-agent-attachment-row",style:{display:"flex",flexWrap:"wrap",gap:6,marginTop:6},children:B.attachments.map(Pe=>g.jsx("span",{className:"v10-local-agent-attachment-chip",style:{padding:"2px 8px",borderRadius:999,background:"var(--bg-elevated)",fontSize:11},children:Pe.fileName},Pe.id??Pe.assertionUri??Pe.fileHash))}),B.role==="assistant"&&(((Te=B.toolCalls)==null?void 0:Te.length)||B.traceFile)&&g.jsxs("div",{className:"v10-local-agent-copy","data-testid":"local-llm-turn-metadata",children:[(it=B.toolCalls)!=null&&it.length?`Tools: ${B.toolCalls.map(Pe=>Pe.name).join(", ")}`:"Tools: none",B.traceFile?` · Trace: ${B.traceFile}`:""]}),B.ts&&g.jsx("time",{className:`v10-local-agent-msg-time ${B.role}`,dateTime:B.tsRaw,children:B.ts})]},B.id)}),g.jsx("div",{ref:_}),g.jsx("button",{type:"button",className:`v10-scroll-to-bottom ${Re?"visible":""}`,onClick:xt,"aria-label":"Scroll to latest message",title:"Scroll to latest message",tabIndex:Re?0:-1,"aria-hidden":!Re,children:g.jsx(aN,{size:14,"aria-hidden":"true"})})]}),g.jsx("div",{className:"v10-agent-input-area",children:g.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,width:"100%"},children:[ee.length>0&&g.jsx("div",{className:"v10-attachment-chips",role:"list","aria-label":"Attached files",children:ee.map(B=>{var Pe,Xe;const Te=((Pe=B.result)==null?void 0:Pe.extraction.tripleCount)??((Xe=B.result)==null?void 0:Xe.extraction.triplesWritten),it=B.status==="queued"?"Queued":B.status==="uploading"?"Importing…":B.status==="completed"?Te!=null?`Ready · ${Te} triples`:"Ready":B.status==="skipped"?"Stored only":B.error??"Failed";return g.jsxs("div",{className:"v10-attachment-chip","data-status":B.status,role:"listitem",children:[g.jsx("div",{className:"v10-attachment-chip-badge","aria-hidden":"true",children:Rz(B.file.name)}),g.jsxs("div",{className:"v10-attachment-chip-body",children:[g.jsx("div",{className:"v10-attachment-chip-name",title:B.file.name,children:B.file.name}),g.jsxs("div",{className:"v10-attachment-chip-meta",children:[g.jsx("span",{children:Tz(B.file.size)}),g.jsx("span",{"aria-hidden":"true",children:"·"}),g.jsx("span",{className:"v10-attachment-chip-status",children:it})]})]}),g.jsx("button",{type:"button",className:"v10-attachment-chip-remove",onClick:()=>Q(B.id),disabled:Y,"aria-label":`Remove ${B.file.name}`,title:"Remove attachment",children:g.jsx(BN,{size:12,"aria-hidden":"true"})})]},B.id)})}),N&&g.jsx("div",{className:"v10-local-agent-copy",style:{margin:0,color:"var(--text-tertiary)"},children:X.length>1?"Queued files keep their stored targets and may span multiple projects.":`Queued files keep their stored target (${jh(T,X[0])}), not the active project.`}),g.jsx("input",{ref:ue,type:"file",multiple:!0,style:{display:"none"},onChange:B=>{B.target.files&&(q(B.target.files),B.target.value="")}}),g.jsx("div",{className:"v10-local-agent-composer-row",children:g.jsxs("div",{className:"v10-local-agent-composer-shell",children:[g.jsx($I,{placeholder:Bt?`Reconnect ${he.name} to resume live chat...`:he.chatReady?`Message ${he.name}...`:he.status==="connecting"?`${he.name} is still connecting...`:`${he.name} bridge offline...`,className:"v10-agent-input",value:U,onChange:B=>I(B.target.value),onKeyDown:B=>{if(!B.nativeEvent.isComposing){if(B.key==="Enter"&&!B.shiftKey&&!B.ctrlKey&&!B.metaKey){B.preventDefault(),le&&O();return}if((B.ctrlKey||B.metaKey)&&B.key==="Enter"){B.preventDefault(),le&&O();return}B.key==="Escape"&&U.length>0&&(B.preventDefault(),I(""))}},disabled:H,minRows:1,maxRows:8}),g.jsxs("div",{className:"v10-composer-controls",children:[g.jsxs("div",{className:"v10-composer-controls-left",children:[g.jsx("button",{type:"button",className:"v10-composer-attach",onClick:()=>{var B;return(B=ue.current)==null?void 0:B.click()},disabled:!vt,title:vt?"Attach files":wt==="noProject"?"Choose a context graph to attach files":wt==="sending"?"Wait for the current message to send":"This agent does not support attachments","aria-label":"Attach files",children:g.jsx(AN,{size:14,"aria-hidden":"true"})}),g.jsx("div",{className:"v10-composer-target",children:g.jsx(dx,{className:"v10-local-agent-target-select",value:D??"",onChange:W,options:[...D?[{value:"",label:"No context graph (clear selection)"}]:[],...F.map(B=>({value:B.id,label:B.name}))],placeholder:G?"Loading context graphs…":"Choose a context graph",disabled:G||!D&&F.length===0,ariaLabel:"Active project",prefixIcon:g.jsx(vN,{size:12,"aria-hidden":"true"})})})]}),g.jsx("button",{type:"button",className:`v10-local-agent-inline-send v10-local-agent-inline-send-${K}`,onClick:K==="streaming"?P:O,disabled:K==="streaming"?!1:K==="uploading"?!0:!le,"aria-label":K==="streaming"?"Stop reply":K==="uploading"?"Send message (attachments uploading)":"Send message",title:K==="streaming"?"Stop reply":K==="uploading"?"Send message (attachments uploading)…":"Send message",children:K==="streaming"?g.jsx(RN,{size:12,"aria-hidden":"true"}):K==="uploading"?g.jsx(SN,{className:"v10-local-agent-inline-send-spinner",size:14,"aria-hidden":"true"}):g.jsx(rN,{size:14,"aria-hidden":"true"})})]})]})})]})})]})]})}function Xp(e){return e.length>12?e.slice(-8):e}function J8(e){if(!e)return"";const t=e.lastIndexOf(":"),a=t>=0?e.slice(t+1):e;return a.length>10?a.slice(-10):a||e.slice(-8)}function e9(e,t){const a=new Map;for(const y of t){if(!y.peerId)continue;const m=a.get(y.peerId)??[];m.push(y),a.set(y.peerId,m)}const r=new Map;for(const y of e){if(!y.peerId)continue;const m=r.get(y.peerId)??{hasDirect:!1,hasRelay:!1,openedAt:null},b=m.hasDirect||y.transport==="direct",x=m.hasRelay||y.transport==="relayed",k=y.openedAt!=null?m.openedAt!=null?Math.min(m.openedAt,y.openedAt):y.openedAt:m.openedAt;r.set(y.peerId,{hasDirect:b,hasRelay:x,openedAt:k})}const o=y=>{var m;return(m=y.find(b=>b.name))==null?void 0:m.name},s=y=>y.reduce((m,b)=>b.lastSeen!=null&&(m==null||b.lastSeen>m)?b.lastSeen:m,void 0),c=[],d=new Set;for(const[y,m]of r){const b=a.get(y)??[];c.push({peerId:y,name:o(b),transport:m.hasDirect?"direct":"relayed",hasDirect:m.hasDirect,hasRelay:m.hasRelay,openedAt:m.openedAt,connected:!0,lastSeen:s(b),agents:b}),d.add(y)}for(const[y,m]of a){if(d.has(y))continue;const b=m.filter(A=>A.connectionStatus==="connected");if(b.length===0)continue;const x=b.some(A=>A.connectionTransport==="direct"),k=b.some(A=>A.connectionTransport==="relayed"),C=k&&!x?"relayed":"direct";c.push({peerId:y,name:o(m),transport:C,hasDirect:x,hasRelay:k,openedAt:null,connected:!0,lastSeen:s(m),agents:m}),d.add(y)}const p=[];for(const[y,m]of a){if(d.has(y))continue;const b=s(m);b!=null&&p.push({peerId:y,name:o(m),transport:"direct",hasDirect:!1,hasRelay:!1,openedAt:null,connected:!1,lastSeen:b,agents:m})}p.sort((y,m)=>(m.lastSeen??0)-(y.lastSeen??0));const f=c.filter(y=>y.transport==="direct").length;return{connected:c,recentlySeen:p,directCount:f,relayedCount:c.length-f}}function t9({peer:e}){var y;const[t,a]=S.useState(!1),r=S.useId(),o=3,s=e.connected?"connected":"offline",c=((y=e.name)==null?void 0:y.trim())||Xp(e.peerId),d=t?e.agents:e.agents.slice(0,o),p=e.connected?e.transport:"Disconnected",f=e.connected&&e.hasDirect&&e.hasRelay?"Direct + relay paths active — direct shown":void 0;return g.jsxs("div",{className:`v10-agent-card v10-peer-card ${s}`,children:[g.jsxs("div",{className:"v10-agent-card-header",children:[g.jsx("span",{className:`v10-agent-card-dot ${s}`}),g.jsx("span",{className:"v10-peer-card-name",children:c}),g.jsx("span",{className:"v10-agent-card-badge",title:f,children:p})]}),g.jsxs("div",{className:"v10-peer-card-meta",children:[g.jsx("span",{title:e.peerId,children:Xp(e.peerId)}),e.connected&&e.openedAt!=null&&g.jsxs("span",{children:["up ",Pb(Date.now()-e.openedAt)]}),!e.connected&&e.lastSeen!=null&&g.jsxs("span",{children:[Pb(Date.now()-e.lastSeen)," ago"]}),e.agents.length>0&&g.jsxs("span",{children:[e.agents.length," agent",e.agents.length===1?"":"s"]})]}),e.agents.length>0&&g.jsxs("ul",{id:r,className:"v10-peer-card-chips","aria-label":`Agents on ${c}`,children:[d.map((m,b)=>g.jsx("li",{className:"v10-peer-chip",title:m.agentUri||"",children:g.jsx("span",{className:"v10-peer-chip-label",children:J8(m.agentUri)||Xp(m.peerId)})},m.agentUri||`${e.peerId}:${b}`)),e.agents.length>o&&g.jsx("li",{children:g.jsx("button",{type:"button",className:"v10-peer-chip-more","aria-expanded":t,"aria-controls":r,onClick:()=>a(m=>!m),children:t?"Show less":`+${e.agents.length-o} more`})})]})]})}function mx(e){const{label:t,peers:a,expanded:r,onToggle:o,emptyMessage:s}=e;return g.jsxs("div",{className:"v10-peer-group",children:[g.jsxs("button",{type:"button",className:"v10-peer-group-header",onClick:o,"aria-expanded":r,children:[g.jsx(sh,{size:14,className:`v10-peer-group-chevron ${r?"expanded":""}`,"aria-hidden":"true"}),g.jsx("span",{className:"v10-peer-group-label",children:t}),g.jsx("span",{className:"v10-peer-group-count",children:a.length})]}),r&&g.jsx("div",{className:"v10-peer-group-body",children:a.length===0?g.jsx("div",{className:"v10-agent-empty-state",children:s}):a.map(c=>g.jsx(t9,{peer:c},c.peerId))})]})}function n9(e){const{peerAgents:t,connections:a,loading:r,onRefresh:o}=e,[s,c]=S.useState(!0),[d,p]=S.useState(!1),{connected:f,recentlySeen:y,directCount:m,relayedCount:b}=e9(a.rows,t);return g.jsxs("div",{className:"v10-agent-scroll-tab",children:[g.jsxs("div",{className:"v10-agents-summary",children:[g.jsxs("span",{className:"v10-agents-stat",children:[g.jsx("span",{className:`v10-agents-stat-dot ${f.length>0||a.total>0?"connected":"known"}`}),g.jsxs("span",{title:"Unique libp2p peers connected to this node — matches the count in the header.",children:[f.length," peer",f.length===1?"":"s"]})]}),g.jsxs("span",{className:"v10-agents-stat",title:"Preferred transport per peer (peers reachable via direct + relay are bucketed under direct)",children:[m," direct / ",b," relayed"]}),g.jsx("button",{className:"v10-agents-refresh",onClick:o,title:"Refresh network peers",children:"Refresh"})]}),r&&g.jsx("p",{className:"v10-agents-loading",children:"Loading peers..."}),!r&&f.length===0&&y.length===0&&a.total===0&&g.jsx("div",{className:"v10-agent-empty-state",children:"No network peers detected yet."}),!r&&f.length===0&&a.total>0&&g.jsxs("div",{className:"v10-agent-empty-state",children:["Connected to ",a.total," peer",a.total===1?"":"s"," (peer metadata syncing…)."]}),(f.length>0||y.length>0)&&g.jsxs(g.Fragment,{children:[g.jsx(mx,{label:"Connected",peers:f,expanded:s,onToggle:()=>c(x=>!x),emptyMessage:"No peers currently connected."}),g.jsx(mx,{label:"Recently seen",peers:y,expanded:d,onToggle:()=>p(x=>!x),emptyMessage:"No previously-seen peers."})]})]})}function a9(e){const{sessions:t,onOpenSession:a}=e;return g.jsx("div",{className:"v10-agent-scroll-tab",children:g.jsxs("div",{className:"v10-sessions-list",children:[g.jsx("div",{className:"v10-local-agent-copy",style:{marginBottom:12},children:"Sessions track DKG-persisted conversations for your integrated agents."}),t.length===0?g.jsx("p",{className:"v10-agent-empty-state",children:"No integrated-agent sessions yet."}):t.map(r=>g.jsxs("button",{className:"v10-session-item",onClick:()=>a(r),children:[g.jsxs("span",{className:"v10-session-preview",children:[r.integrationName,": ",r.preview]}),g.jsxs("span",{className:"v10-session-count",children:[r.messageCount," msg",r.messageCount!==1?"s":"",r.lastTs?` - ${hu(r.lastTs)}`:""]})]},r.sessionId))]})})}function i9(){const{stage:e,advance:t}=cm(),[a,r]=S.useState("agents"),[o,s]=S.useState([]),[c,d]=S.useState([]),[p,f]=S.useState({total:0,direct:0,relayed:0,rows:[]}),[y,m]=S.useState(!0),{data:b}=im(),[x,k]=S.useState([]),[C,A]=S.useState("openclaw"),[E,R]=S.useState(()=>br("openclaw")),[_,U]=S.useState(null),[I,O]=S.useState(null),[P,Y]=S.useState(null),[D,T]=S.useState(null),[G,W]=S.useState(null),[ae,q]=S.useState({}),[Q,F]=S.useState({}),[ee,ie]=S.useState({}),[X,M]=S.useState({}),[L,K]=S.useState({}),N=S.useRef(new Map),ue=S.useRef(!1),ge=S.useRef(null),me=S.useRef([]),Ee=S.useRef({}),Ue=S.useRef("openclaw"),Re=S.useRef(br("openclaw")),tt=ga(se=>se.contextGraphs),It=ga(se=>se.loading),xt=ga(se=>se.activeProjectId),wt=ga(se=>se.setActiveProject),vt=S.useMemo(()=>Q4(tt,b?fm(b):null,xt),[tt,b,xt]),an=px(o,x),{selectedIntegration:Be,selectedConversation:ht,selectedHasConversation:Pt,selectedIntegrationHasAnyConversation:Mt}=V8({integrations:x,selectedIntegrationId:C,selectedSessionId:E,localMessagesByConversation:ae,sessions:an}),he=(ht==null?void 0:ht.stateKey)??null,Bt=he?ae[he]??[]:[],Qn=he?X[he]??!1:!1,wn=he?Q[he]??"":"",rt=he?ee[he]??!1:!1,fe=he?L[he]??[]:[],H=S.useCallback(()=>{var se;(se=ge.current)==null||se.scrollIntoView({behavior:"smooth"})},[]);S.useEffect(H,[he,Bt,H]),S.useEffect(()=>{me.current=o},[o]),S.useEffect(()=>{Ee.current=ae},[ae]),S.useEffect(()=>{Ue.current=C},[C]),S.useEffect(()=>{Re.current=E},[E]);const le=S.useCallback((se,ve)=>{q(ke=>({...ke,[se]:ve(ke[se]??[])}))},[]),pe=S.useCallback((se,ve)=>{se&&F(ke=>({...ke,[se]:ve}))},[]),ye=S.useCallback((se,ve)=>{ie(ke=>({...ke,[se]:ve}))},[]),B=S.useCallback((se,ve)=>{K(ke=>({...ke,[se]:ve(ke[se]??[])}))},[]),Te=S.useCallback((se,ve,ke)=>{const Me=Array.from(ve);if(Me.length===0)return;const Ke=new Set((L[se]??[]).map(we=>`${we.contextGraphId}:${we.file.name}:${we.file.size}:${we.file.lastModified}`)),ot=Me.filter(we=>{const _e=`${ke}:${we.name}:${we.size}:${we.lastModified}`;return Ke.has(_e)?!1:(Ke.add(_e),!0)});if(ot.length===0)return;const Ne=ot.map(we=>({id:`${se}:${we.name}:${we.size}:${we.lastModified}:${Uo()}`,file:we,contextGraphId:ke,assertionName:`${Date.now().toString(36)}-${Uo().slice(0,8)}-${we.name.replace(/[^a-zA-Z0-9._-]/g,"_")}`,status:"queued"}));B(se,we=>[...we,...Ne])},[L,B]),it=S.useCallback(async(se,ve)=>{const ke=[];for(const Me of ve){if(Me.status==="completed"||Me.status==="skipped"){ke.push(Me);continue}B(se,Ke=>Ke.map(ot=>ot.id===Me.id?{...ot,status:"uploading",error:void 0}:ot));try{const Ke=await fT(Me.assertionName,Me.contextGraphId,Me.file),ot=Ke.extraction.status==="completed"?"completed":Ke.extraction.status==="skipped"?"skipped":"error",Ne={...Me,status:ot,result:Ke,error:Ke.extraction.error};ke.push(Ne),B(se,we=>we.map(_e=>_e.id===Me.id?Ne:_e))}catch(Ke){const ot={...Me,status:"error",error:(Ke==null?void 0:Ke.message)??"Upload failed"};ke.push(ot),B(se,Ne=>Ne.map(we=>we.id===Me.id?ot:we))}}return ke},[B]),Pe=S.useCallback((se,ve)=>{B(se,ke=>ke.filter(Me=>Me.id!==ve))},[B]),Xe=S.useCallback((se,ve)=>{const ke=new Set(ve);B(se,Me=>Me.filter(Ke=>!ke.has(Ke.id)))},[B]),We=S.useCallback((se,ve={})=>{A(se),se!==Sr&&(ve.preserveSession||R(ve.sessionId??br(se)))},[]),Se=S.useCallback(()=>{Wn.fetchMemorySessions(50).then(({sessions:se})=>s(se??[])).catch(()=>{})},[]),Zt=S.useCallback(async()=>{try{const[se,ve]=await Promise.all([fw().catch(()=>({agents:[]})),Zj().catch(()=>({total:0,direct:0,relayed:0,connections:[]}))]),ke=(se.agents??[]).filter(Me=>Me.connectionStatus!=="self");d(ke),f({total:ve.total??0,direct:ve.direct??0,relayed:ve.relayed??0,rows:Array.isArray(ve.connections)?ve.connections:[]})}catch{}m(!1)},[]),lt=S.useCallback(async()=>{try{const{integrations:se}=await Cu();k(se);const ve=px(me.current,se),ke=[...se].sort(_u).filter(_e=>_e.persistentChat),Me=Ue.current,Ke=Re.current,ot=se.find(_e=>_e.id===Me)??null,Ne=K8({selectedIntegrationId:Me,selectedItem:ot,selectedSessionId:Ke,localMessagesByConversation:Ee.current,sessionSummaries:ve});if(!Ne){const _e=ke[0];We((_e==null?void 0:_e.id)??Sr,{sessionId:(_e==null?void 0:_e.defaultSessionId)??null})}const we=ke[0];we&&!ue.current&&Me!==Sr?(ue.current=!0,We(we.id,{sessionId:we.defaultSessionId}),r("agents")):!we&&!Ne&&(ue.current=!1,We(Sr))}catch{}},[We]),Ba=S.useCallback(async(se,ve=null,ke=null)=>{const Me=Vo({integrationId:se,sessionId:ve,defaultSessionId:ke});M(Ke=>({...Ke,[Me.stateKey]:!1}));try{const ot=(await l1(se,100,{sessionId:Me.sessionId??void 0})).map(Ne=>Hb(Ne,se));le(Me.stateKey,Ne=>Gp(Ne,ot))}catch{le(Me.stateKey,Ke=>Ke)}finally{M(Ke=>({...Ke,[Me.stateKey]:!0})),Se()}},[Se,le]);S.useEffect(()=>{Se(),Zt(),lt()},[Se,Zt,lt]),S.useEffect(()=>{for(const se of Pz)Ba(se,br(se))},[]);const hi=S.useCallback(()=>{Se(),Zt()},[Se,Zt]);rs(hi,15e3,{runImmediately:!1});const Qi=x.some(se=>se.persistentChat&&(!se.chatReady||se.status==="connecting"))?3e3:15e3;S.useEffect(()=>{const se=setInterval(()=>{lt()},Qi);return()=>clearInterval(se)},[Qi,lt]),S.useEffect(()=>{if(!(Be!=null&&Be.chatSupported)||!Be.persistentChat&&!Pt){he&&M(ve=>({...ve,[he]:!1}));return}let se=!1;return(async()=>await Ba(Be.id,(ht==null?void 0:ht.sessionId)??null,Be.defaultSessionId??null))(),()=>{se=!0}},[Ba,ht==null?void 0:ht.sessionId,he,Pt,Be==null?void 0:Be.defaultSessionId,Be==null?void 0:Be.chatSupported,Be==null?void 0:Be.id,Be==null?void 0:Be.persistentChat]);const Nr=S.useCallback(async()=>{var Or,$a;const se=Be,ve=ht,ke=wn.trim(),Me=fe,Ke=Me.some(uk);if(!(se!=null&&se.chatSupported)||!se.chatReady||rt||!ve||!ke&&!Ke)return;const ot=se.id,Ne=ve.stateKey;ye(Ne,!0),Y(null);let we=null,_e="",cn="",Ha="",zl="",fs=[],mi=[],Sa=[];try{mi=await it(Ne,Me);const Jt=mi.map(He=>Oz(He)).filter(He=>He!=null),pn=Mz(mi);if(!ke&&Jt.length===0&&pn.results.length===0)return;cn=Uo();const Mn=fk(pn.results),Tt=[ke,Mn].filter(He=>He.length>0).join(`
1142
+
1143
+ `);Ha=ke?Tt:Dz(Jt,pn.results);const Sn=ke?Tt:"";fs=Jt,Sa=[...Jt.map(He=>He.id).filter(He=>typeof He=="string"&&He.length>0),...pn.deliveredDraftIds];const hn=`local:${Ne}:${cn}:user`;_e=`local:${Ne}:${cn}:assistant`;const Xn=new Date,gi=hu(Xn),Il=Ah(Xn);le(Ne,He=>[...He,{id:hn,turnId:cn,role:"user",content:Ha,ts:gi,tsRaw:Il,attachments:Jt},{id:_e,turnId:cn,role:"assistant",content:"",ts:gi,tsRaw:Il,streaming:!0}]),pe(Ne,""),Sa.length>0&&Xe(Ne,Sa),we=new AbortController,N.current.set(Ne,we);const ps=[...Lz(tt,xt,b)],Du=se.id==="prime-agent"?(Or=se.liveSessions)==null?void 0:Or.find(He=>He.sessionId===ve.sessionId):void 0,mn=await XT(ot,Sn,{correlationId:cn,signal:we==null?void 0:we.signal,sessionId:ve.sessionId??void 0,liveSession:Du,profile:se.profile,persistUserMessage:Sn?void 0:Ha,attachments:Jt,attachmentImportResults:pn.results,contextEntries:ps,contextGraphId:xt??void 0,onEvent:He=>{He.type==="text_delta"&&(zl+=He.delta,le(Ne,Kt=>Kt.map(qa=>qa.id===_e?{...qa,content:qa.content+He.delta}:qa)))}}),Ji=new Date;le(Ne,He=>$b(He,cn,mn.turnId).map(Kt=>{var qa;return Kt.id===_e?{...Kt,content:mn.text||Kt.content,turnId:((qa=mn.turnId)==null?void 0:qa.trim())||Kt.turnId,streaming:!1,synthesized:!mn.text&&!Kt.content?!0:Kt.synthesized,ts:hu(Ji),tsRaw:Ah(Ji),toolCalls:mn.toolCalls,traceFile:mn.traceFile,profile:mn.profile,contextGraphId:mn.contextGraphId,readOnly:mn.readOnly}:Kt}));const kn=ot==="prime-agent"?($a=mn.sessionId)==null?void 0:$a.trim():void 0;if(kn&&kn!==ve.sessionId&&Ue.current===ot&&Re.current===ve.sessionId){const He=Pm(ot,kn);q(Kt=>({...Kt,[He]:Gp(Kt[He]??[],Kt[Ne]??[])})),M(Kt=>({...Kt,[He]:Kt[Ne]??!0})),We(ot,{sessionId:kn}),O(`${se.name} restarted; switched chat to the live session.`)}Se(),e===0&&t()}catch(Jt){const pn=(Jt==null?void 0:Jt.name)==="AbortError",Mn=pn?"Request cancelled.":Bz(se,Jt),Tt=pn?Mn:`Error: ${Mn}`;if(_e){const Sn=kI(zl,Tt);le(Ne,ka=>ka.map(hn=>hn.id===_e?{...hn,...Sn,streaming:!1}:hn))}else Y(Mn);!pn&&ot==="hermes"&&_e&&Ha&&(async()=>{try{const Sn=await QT(ot,{sessionId:ve.sessionId??void 0,correlationId:cn||void 0,userMessage:Ha,assistantReply:zl,failureReason:Mn,profile:se.profile,attachments:fs,contextGraphId:xt??void 0});Sn.turnId&&le(Ne,ka=>$b(ka,cn,Sn.turnId)),Se()}catch{}})(),Sa.length>0&&mi.length>0&&K(Sn=>{const ka=Sn[Ne]??[],hn=new Set(ka.map(gi=>gi.id)),Xn=mi.filter(gi=>!hn.has(gi.id));return Xn.length===0?Sn:{...Sn,[Ne]:[...Xn,...ka]}}),lt()}finally{ye(Ne,!1),N.current.get(Ne)===we&&N.current.delete(Ne)}},[xt,t,tt,b,Se,wn,rt,it,fe,lt,ht,Be,Xe,pe,ye,We,e,le]),Ua=S.useCallback(()=>{if(!he)return;const se=N.current.get(he);se==null||se.abort()},[he]),_r=S.useCallback(async se=>{U(se),Y(null),O(null);try{const ve=await VT(se);k(Ke=>Wc(Ke,ve.integration)),await lt();const ke=Wc(x,ve.integration),Me=F8({integrationId:se,selectedSessionId:E,integrations:ke});We(se,{preserveSession:Me,sessionId:ve.integration.defaultSessionId}),ue.current=!0,O(ve.notice??(ve.integration.chatReady?`${ve.integration.name} is connected and chat-ready.`:`${ve.integration.name} attach is in progress. The node will keep checking for a live bridge.`)),r("agents")}catch(ve){await lt(),Y(ve.message)}finally{U(null)}},[x,lt,E,We]),Xi=S.useCallback(async se=>{Y(null),O(null);try{await WT(se),k(ve=>Y8(ve,se)),ue.current=!1,We(se,{preserveSession:C===se}),O("The local agent was disconnected from this node. Session history remains available here."),r("agents"),await lt()}catch(ve){Y(ve.message)}},[lt,C,We]),Ou=S.useCallback(async se=>{var Ke,ot,Ne;if(D===se)return;T(se),Y(null),O(null);const ve=Vo({integrationId:se,sessionId:C===se?Re.current:null,defaultSessionId:(Ke=x.find(we=>we.id===se))==null?void 0:Ke.defaultSessionId}),[ke,Me]=await Promise.allSettled([YT(se),l1(se,100,{sessionId:ve.sessionId??void 0})]);try{if(ke.status==="fulfilled"?(k(we=>Wc(we,ke.value.integration)),ke.value.notice&&O(ke.value.notice)):Y(((ot=ke.reason)==null?void 0:ot.message)??"Failed to refresh integration."),Me.status==="fulfilled"){const we=Me.value.map(_e=>Hb(_e,se));le(ve.stateKey,_e=>Gp(_e,we)),M(_e=>({..._e,[ve.stateKey]:!0}))}else ke.status==="fulfilled"&&Y(((Ne=Me.reason)==null?void 0:Ne.message)??"Failed to refresh conversation.")}finally{T(null)}},[x,D,C,le]),us=S.useCallback(async se=>{if(!(se!=="local-llm"||G)){W(se),Y(null),O(null);try{await OT();const ve=Vo({integrationId:se,sessionId:br(se)});q(ke=>({...ke,[ve.stateKey]:[]})),F(ke=>({...ke,[ve.stateKey]:""})),K(ke=>({...ke,[ve.stateKey]:[]})),M(ke=>({...ke,[ve.stateKey]:!0})),O("DKG Local LLM session cleared. You can now select a different Context Graph."),await lt()}catch(ve){Y((ve==null?void 0:ve.message)??"Failed to clear the local LLM session.")}finally{W(null)}}},[G,lt]),Ll=S.useCallback(se=>{We(se.integrationId,{sessionId:se.sessionId}),r("agents")},[We]),Zi=S.useCallback(se=>{wt(se||null)},[wt]),Mu=S.useCallback(se=>{!he||!xt||Te(he,se,xt)},[xt,Te,he]),ds=S.useCallback(se=>{he&&Pe(he,se)},[Pe,he]);return g.jsxs("div",{className:"v10-panel-right",children:[g.jsxs("div",{className:"v10-agent-mode-tabs",children:[g.jsx("button",{className:`v10-agent-mode-tab ${a==="agents"?"active":""}`,onClick:()=>r("agents"),children:"Agents"}),g.jsx("button",{className:`v10-agent-mode-tab ${a==="network"?"active":""}`,onClick:()=>r("network"),children:"Network"}),g.jsx("button",{className:`v10-agent-mode-tab ${a==="sessions"?"active":""}`,onClick:()=>r("sessions"),children:"Sessions"})]}),a==="agents"&&g.jsx(Z8,{integrations:x,selectedIntegrationId:C,selectedIntegration:Be,selectedSessionId:E,selectedHasConversation:Pt,selectedIntegrationHasAnyConversation:Mt,onSelectIntegration:We,onConnectIntegration:_r,onDisconnectIntegration:Xi,onRefreshIntegration:Ou,onClearIntegrationSession:us,connectBusyId:_,refreshBusyId:D,clearBusyId:G,connectNotice:I,connectError:P,localMessages:Bt,localHistoryLoaded:Qn,localChatEndRef:ge,localInput:wn,onLocalInputChange:se=>pe(he,se),onSendLocalMessage:Nr,onStopLocalStream:Ua,localSending:rt,activeProjectId:xt,availableProjects:tt,selectableProjects:vt,projectsLoading:It,onSelectProject:Zi,attachments:fe,onAddAttachments:Mu,onRemoveAttachment:ds}),a==="network"&&g.jsx(n9,{peerAgents:c,connections:p,loading:y,onRefresh:Zt}),a==="sessions"&&g.jsx(a9,{sessions:an,onOpenSession:Ll})]})}function _k(e,t=document){const a=e==="light";t.documentElement.setAttribute("data-theme",e),t.documentElement.classList.toggle("light",a),t.body.classList.toggle("light",a)}function r9(){const{toggleLeft:e,toggleRight:t,toggleBottom:a}=Vn();S.useEffect(()=>{const r=o=>{if(o.target instanceof HTMLInputElement||o.target instanceof HTMLTextAreaElement||!(o.metaKey||o.ctrlKey))return;const c=o.key.toLowerCase();if(o.shiftKey&&c==="b"){o.preventDefault(),t();return}if(!o.shiftKey){if(c==="b"){o.preventDefault(),e();return}if(c==="j"){o.preventDefault(),a();return}}};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[e,t,a])}const gx={"/observability":{id:"operations",label:"Observability"},"/operations":{id:"operations",label:"Observability"},"/settings":{id:"settings",label:"Settings"}},l9={operations:"/observability",settings:"/settings",dashboard:"/"};function o9(){const{pathname:e}=wa(),t=Ph(),a=xn(o=>o.openTab),r=xn(o=>o.activeTabId);S.useEffect(()=>{const o=gx[e];o&&a({id:o.id,label:o.label,closable:!0})},[e,a]),S.useEffect(()=>{const o=l9[r];if(o){o!==e&&t(o,{replace:!0});return}gx[e]&&t("/",{replace:!0})},[r,e,t])}function s9(){const e=Vn(t=>t.theme);return S.useEffect(()=>{_k(e)},[e]),g.jsx("main",{className:"v10-app",style:{alignItems:"center",justifyContent:"center",padding:24},children:g.jsxs("section",{role:"alert",style:{maxWidth:480,lineHeight:1.6},children:[g.jsx("h1",{children:"Node unavailable"}),g.jsx("p",{children:"Live node data could not be loaded. The node may be stopped, timing out or returning errors."}),g.jsx("p",{children:"Node status, balances, graphs and integration readiness are unavailable. Check the daemon, then reload to retry the connection."}),g.jsx("button",{type:"button",className:"v10-modal-btn primary",onClick:()=>window.location.reload(),children:"Retry connection"})]})})}const yx=[1e3,2e3,4e3,8e3,15e3,3e4];function c9(e){return yx[Math.min(e,yx.length-1)]}function Ok({reload:e=()=>window.location.reload(),probeRetryMs:t=c9}){const[a,r]=S.useState("hidden"),[o,s]=S.useState("");if(S.useEffect(()=>{if(Aj())return;let d=!1,p;const f=async y=>{const m=await _j();if(d)return;if(m==="unknown"){p=setTimeout(()=>{f(y+1)},t(y));return}if(m==="accepted")return;const b=!!ew();b&&Rj(),r(b?"rejected":"required")};return f(0),()=>{d=!0,p!==void 0&&clearTimeout(p)}},[]),a==="hidden")return null;const c=d=>{d.preventDefault(),o.trim()&&Tj(o)&&e()};return g.jsxs("form",{className:"v10-token-prompt","aria-label":"Node API token",onSubmit:c,children:[g.jsxs("span",{className:"v10-token-prompt-text",children:[g.jsx("strong",{children:"API token required"}),a==="rejected"?" — the node did not accept that token.":" —"," The node passes its token to the dashboard only when it is opened on the node host. Paste the token from ",g.jsx("code",{children:"auth.token"})," on the node host to use this dashboard at ",g.jsx("strong",{children:window.location.host})," (kept for this tab only)."]}),g.jsx("input",{className:"v10-token-prompt-input",type:"password",autoComplete:"off",spellCheck:!1,"aria-label":"API token",value:o,onChange:d=>s(d.target.value)}),g.jsx("button",{type:"submit",className:"v10-token-prompt-submit",disabled:!o.trim(),children:"Use token"})]})}function u9(){const e=Gh(t=>t.setNodeStatus);rs(()=>{Wn.fetchStatus().then(e).catch(()=>{})},1e4)}function vx(e){const t=S.useRef(null),a=S.useRef(e);return a.current=e,S.useEffect(()=>{const r=t.current;if(!r)return;let o=0;const s=p=>{const f=p.clientX-o;o=p.clientX,a.current(f)},c=()=>{document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",c),document.body.style.cursor="",document.body.style.userSelect="",r.classList.remove("active")},d=p=>{p.preventDefault(),o=p.clientX,document.addEventListener("mousemove",s),document.addEventListener("mouseup",c),document.body.style.cursor="col-resize",document.body.style.userSelect="none",r.classList.add("active")};return r.addEventListener("mousedown",d),()=>r.removeEventListener("mousedown",d)},[]),t}function d9(e){const t=S.useRef(e);t.current=e;const[a,r]=S.useState(null);return S.useEffect(()=>{if(!a)return;let o=0;const s=p=>{const f=p.clientY-o;o=p.clientY,t.current(f)},c=()=>{document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",c),document.body.style.cursor="",document.body.style.userSelect="",a.classList.remove("active")},d=p=>{p.preventDefault(),o=p.clientY,document.addEventListener("mousemove",s),document.addEventListener("mouseup",c),document.body.style.cursor="row-resize",document.body.style.userSelect="none",a.classList.add("active")};return a.addEventListener("mousedown",d),()=>{a.removeEventListener("mousedown",d),c()}},[a]),S.useCallback(o=>r(o),[])}function f9(){u9(),r9(),o9();const{leftCollapsed:e,rightCollapsed:t,bottomCollapsed:a,theme:r,leftWidth:o,rightWidth:s,setLeftWidth:c,setRightWidth:d,setBottomHeight:p}=Vn(),[,f]=S.useState(0);S.useEffect(()=>{_k(r)},[r]),S.useEffect(()=>{const A=()=>f(E=>E+1);return window.addEventListener("resize",A),()=>window.removeEventListener("resize",A)},[]),S.useLayoutEffect(()=>{const A=window.requestAnimationFrame(()=>{window.dispatchEvent(new Event("resize"))});return()=>window.cancelAnimationFrame(A)},[e,t]);const y=S.useCallback(A=>{const E=Vn.getState().leftWidth;c(Math.max(140,Math.min(400,E+A)))},[c]),m=S.useCallback(A=>{const E=Vn.getState().rightWidth;d(Math.max(200,Math.min(500,E-A)))},[d]),b=S.useCallback(A=>{const E=Math.min(Vn.getState().bottomHeight,Xc());p(Math.min(E-A,Xc()))},[p]),x=vx(y),k=vx(m),C=d9(b);return g.jsxs("div",{className:"v10-app",children:[g.jsx(Ok,{}),g.jsx(x4,{}),g.jsxs("div",{className:"v10-app-body",children:[!e&&g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"v10-panel-left",style:{width:o},children:g.jsx(u3,{})}),g.jsx("div",{className:"v10-resize-handle-h",ref:x})]}),g.jsxs("div",{className:"v10-center-region",style:{flex:1,minWidth:0,display:"flex",flexDirection:"column",overflow:"hidden"},children:[g.jsx("div",{style:{flex:1,minHeight:0,overflow:"hidden"},children:g.jsx(hz,{})}),!a&&g.jsx("div",{className:"v10-resize-handle-v",ref:C}),g.jsx(jz,{})]}),!t&&g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"v10-resize-handle-h",ref:k}),g.jsx("div",{className:"v10-panel-right",style:{width:s},children:g.jsx(i9,{})})]})]})]})}const p9=bn.lazy(()=>at(()=>import("./Network-F76S9_1V.js"),[]).then(e=>({default:e.NetworkPage})));function h9(){const e=xn(t=>t.openTab);return S.useLayoutEffect(()=>{e(v_)},[e]),g.jsx(Po,{to:"/",replace:!0})}function m9(){const e=S.useSyncExternalStore(yR,s1,s1);return S.useEffect(()=>{vw()},[]),e?g.jsx(s9,{}):g.jsxs(WE,{children:[g.jsx($i,{path:"/network",element:g.jsxs(g.Fragment,{children:[g.jsx(Ok,{}),g.jsx(bn.Suspense,{fallback:g.jsx("div",{className:"lazy-spinner",children:"Loading..."}),children:g.jsx(p9,{})})]})}),g.jsx($i,{path:"/context-graph-primer",element:g.jsx(h9,{})}),g.jsx($i,{path:"/agent",element:g.jsx(Po,{to:"/",replace:!0})}),g.jsx($i,{path:"/explorer",element:g.jsx(Po,{to:"/",replace:!0})}),g.jsx($i,{path:"/messages",element:g.jsx(Po,{to:"/",replace:!0})}),g.jsx($i,{path:"/apps/*",element:g.jsx(Po,{to:"/",replace:!0})}),g.jsx($i,{path:"*",element:g.jsx(f9,{})})]})}function g9(){const[e,t]=S.useState(0);return S.useEffect(()=>Nj(()=>t(a=>a+1)),[]),g.jsx(yA,{basename:"/ui",children:g.jsx(m9,{})},e)}KC.createRoot(document.getElementById("root")).render(g.jsx(bn.StrictMode,{children:g.jsx(g9,{})}));export{Zj as $,Yt as A,x9 as B,t_ as C,PP as D,Jh as E,_9 as F,O9 as G,Wt as H,lP as I,rP as J,qP as K,Qw as L,zP as M,e_ as N,AP as O,sP as P,HP as Q,bn as R,LP as S,SP as T,lw as U,xP as V,IN as W,f1 as X,Uj as Y,fw as Z,at as _,n_ as a,Hj as a$,Xh as a0,Su as a1,q9 as a2,oP as a3,F9 as a4,yP as a5,tT as a6,H9 as a7,j9 as a8,aT as a9,BP as aA,HN as aB,et as aC,b9 as aD,ns as aE,TP as aF,UR as aG,$R as aH,I_ as aI,NP as aJ,fT as aK,va as aL,B3 as aM,Ew as aN,R9 as aO,N9 as aP,qR as aQ,Yj as aR,dP as aS,hP as aT,g as aU,vT as aV,bP as aW,T9 as aX,J9 as aY,rT as aZ,E9 as a_,$9 as aa,nT as ab,t1 as ac,X9 as ad,Y9 as ae,K9 as af,V9 as ag,G9 as ah,W9 as ai,I9 as aj,Xj as ak,Q9 as al,B9 as am,gw as an,bT as ao,DP as ap,D_ as aq,gP as ar,D1 as as,s_ as at,c_ as au,UN as av,fP as aw,$P as ax,m3 as ay,UP as az,v_ as b,GP as b0,N3 as b1,_w as b2,RP as b3,a_ as b4,su as b5,lm as b6,aP as b7,D9 as b8,cP as b9,P9 as bA,U9 as bB,_3 as bC,Gh as bD,OP as bE,im as bF,vp as bG,Iw as bH,MP as bI,Vn as bJ,r_ as bK,U3 as bL,RR as bM,ou as bN,_l as bO,Tw as bP,Rw as bQ,oh as bR,ga as bS,xn as bT,vP as bU,mP as bV,z9 as bW,j_ as bX,eP as bY,w9 as ba,A9 as bb,S9 as bc,C9 as bd,zR as be,k9 as bf,dj as bg,iP as bh,nP as bi,S as bj,tP as bk,cT as bl,Z9 as bm,FP as bn,L1 as bo,EP as bp,wP as bq,uP as br,Ma as bs,M9 as bt,S_ as bu,P_ as bv,vm as bw,XN as bx,kP as by,CP as bz,cN as c,dN as d,hN as e,pP as f,Ix as g,SN as h,Fw as i,i9 as j,gt as k,IP as l,_P as m,Wn as n,i_ as o,sT as p,Rt as q,em as r,jP as s,P3 as t,Wi as u,Gt as v,Nb as w,GR as x,v9 as y,L9 as z};