botschat 0.1.3 → 0.1.6

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 (46) hide show
  1. package/README.md +2 -2
  2. package/package.json +4 -1
  3. package/packages/api/package.json +2 -1
  4. package/packages/api/src/do/connection-do.ts +128 -33
  5. package/packages/api/src/index.ts +103 -6
  6. package/packages/api/src/routes/auth.ts +123 -29
  7. package/packages/api/src/routes/pairing.ts +14 -1
  8. package/packages/api/src/routes/setup.ts +70 -24
  9. package/packages/api/src/routes/upload.ts +12 -8
  10. package/packages/api/src/utils/auth.ts +212 -43
  11. package/packages/api/src/utils/id.ts +30 -14
  12. package/packages/api/src/utils/rate-limit.ts +73 -0
  13. package/packages/plugin/dist/src/channel.js +9 -3
  14. package/packages/plugin/dist/src/channel.js.map +1 -1
  15. package/packages/plugin/package.json +2 -2
  16. package/packages/web/dist/assets/{index-DuGeoFJT.css → index-BST9bfvT.css} +1 -1
  17. package/packages/web/dist/assets/index-Da18EnTa.js +851 -0
  18. package/packages/web/dist/botschat-icon.svg +4 -0
  19. package/packages/web/dist/index.html +23 -3
  20. package/packages/web/dist/manifest.json +24 -0
  21. package/packages/web/dist/sw.js +40 -0
  22. package/packages/web/index.html +21 -1
  23. package/packages/web/src/App.tsx +241 -96
  24. package/packages/web/src/api.ts +63 -3
  25. package/packages/web/src/components/ChatWindow.tsx +11 -11
  26. package/packages/web/src/components/ConnectionSettings.tsx +475 -0
  27. package/packages/web/src/components/CronDetail.tsx +475 -235
  28. package/packages/web/src/components/CronSidebar.tsx +1 -1
  29. package/packages/web/src/components/DebugLogPanel.tsx +116 -3
  30. package/packages/web/src/components/IconRail.tsx +56 -16
  31. package/packages/web/src/components/JobList.tsx +2 -6
  32. package/packages/web/src/components/LoginPage.tsx +126 -103
  33. package/packages/web/src/components/MobileLayout.tsx +480 -0
  34. package/packages/web/src/components/OnboardingPage.tsx +7 -16
  35. package/packages/web/src/components/ResizeHandle.tsx +34 -0
  36. package/packages/web/src/components/Sidebar.tsx +1 -1
  37. package/packages/web/src/components/TaskBar.tsx +2 -2
  38. package/packages/web/src/components/ThreadPanel.tsx +2 -5
  39. package/packages/web/src/hooks/useIsMobile.ts +27 -0
  40. package/packages/web/src/index.css +59 -0
  41. package/packages/web/src/main.tsx +9 -0
  42. package/packages/web/src/store.ts +12 -5
  43. package/packages/web/src/ws.ts +2 -0
  44. package/scripts/dev.sh +13 -13
  45. package/wrangler.toml +3 -1
  46. package/packages/web/dist/assets/index-DyzTR_Y4.js +0 -847
@@ -0,0 +1,851 @@
1
+ var WE=Object.defineProperty;var cb=e=>{throw TypeError(e)};var JE=(e,n,i)=>n in e?WE(e,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[n]=i;var Ga=(e,n,i)=>JE(e,typeof n!="symbol"?n+"":n,i),ub=(e,n,i)=>n.has(e)||cb("Cannot "+i);var as=(e,n,i)=>(ub(e,n,"read from private field"),i?i.call(e):n.get(e)),db=(e,n,i)=>n.has(e)?cb("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(e):n.set(e,i),fb=(e,n,i,l)=>(ub(e,n,"write to private field"),l?l.call(e,i):n.set(e,i),i);(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))l(o);new MutationObserver(o=>{for(const c of o)if(c.type==="childList")for(const u of c.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&l(u)}).observe(document,{childList:!0,subtree:!0});function i(o){const c={};return o.integrity&&(c.integrity=o.integrity),o.referrerPolicy&&(c.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?c.credentials="include":o.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function l(o){if(o.ep)return;o.ep=!0;const c=i(o);fetch(o.href,c)}})();function Ds(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Vd={exports:{}},ls={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var hb;function eS(){if(hb)return ls;hb=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function i(l,o,c){var u=null;if(c!==void 0&&(u=""+c),o.key!==void 0&&(u=""+o.key),"key"in o){c={};for(var f in o)f!=="key"&&(c[f]=o[f])}else c=o;return o=c.ref,{$$typeof:e,type:l,key:u,ref:o!==void 0?o:null,props:c}}return ls.Fragment=n,ls.jsx=i,ls.jsxs=i,ls}var pb;function tS(){return pb||(pb=1,Vd.exports=eS()),Vd.exports}var g=tS(),Yd={exports:{}},Ie={};/**
10
+ * @license React
11
+ * react.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var mb;function nS(){if(mb)return Ie;mb=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),u=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),E=Symbol.iterator;function v(R){return R===null||typeof R!="object"?null:(R=E&&R[E]||R["@@iterator"],typeof R=="function"?R:null)}var _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},N=Object.assign,T={};function S(R,q,w){this.props=R,this.context=q,this.refs=T,this.updater=w||_}S.prototype.isReactComponent={},S.prototype.setState=function(R,q){if(typeof R!="object"&&typeof R!="function"&&R!=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,R,q,"setState")},S.prototype.forceUpdate=function(R){this.updater.enqueueForceUpdate(this,R,"forceUpdate")};function D(){}D.prototype=S.prototype;function M(R,q,w){this.props=R,this.context=q,this.refs=T,this.updater=w||_}var A=M.prototype=new D;A.constructor=M,N(A,S.prototype),A.isPureReactComponent=!0;var F=Array.isArray;function L(){}var X={H:null,A:null,T:null,S:null},re=Object.prototype.hasOwnProperty;function oe(R,q,w){var ue=w.ref;return{$$typeof:e,type:R,key:q,ref:ue!==void 0?ue:null,props:w}}function B(R,q){return oe(R.type,q,R.props)}function Q(R){return typeof R=="object"&&R!==null&&R.$$typeof===e}function ee(R){var q={"=":"=0",":":"=2"};return"$"+R.replace(/[=:]/g,function(w){return q[w]})}var me=/\/+/g;function se(R,q){return typeof R=="object"&&R!==null&&R.key!=null?ee(""+R.key):q.toString(36)}function $(R){switch(R.status){case"fulfilled":return R.value;case"rejected":throw R.reason;default:switch(typeof R.status=="string"?R.then(L,L):(R.status="pending",R.then(function(q){R.status==="pending"&&(R.status="fulfilled",R.value=q)},function(q){R.status==="pending"&&(R.status="rejected",R.reason=q)})),R.status){case"fulfilled":return R.value;case"rejected":throw R.reason}}throw R}function j(R,q,w,ue,ye){var K=typeof R;(K==="undefined"||K==="boolean")&&(R=null);var de=!1;if(R===null)de=!0;else switch(K){case"bigint":case"string":case"number":de=!0;break;case"object":switch(R.$$typeof){case e:case n:de=!0;break;case b:return de=R._init,j(de(R._payload),q,w,ue,ye)}}if(de)return ye=ye(R),de=ue===""?"."+se(R,0):ue,F(ye)?(w="",de!=null&&(w=de.replace(me,"$&/")+"/"),j(ye,q,w,"",function(De){return De})):ye!=null&&(Q(ye)&&(ye=B(ye,w+(ye.key==null||R&&R.key===ye.key?"":(""+ye.key).replace(me,"$&/")+"/")+de)),q.push(ye)),1;de=0;var xe=ue===""?".":ue+":";if(F(R))for(var ve=0;ve<R.length;ve++)ue=R[ve],K=xe+se(ue,ve),de+=j(ue,q,w,K,ye);else if(ve=v(R),typeof ve=="function")for(R=ve.call(R),ve=0;!(ue=R.next()).done;)ue=ue.value,K=xe+se(ue,ve++),de+=j(ue,q,w,K,ye);else if(K==="object"){if(typeof R.then=="function")return j($(R),q,w,ue,ye);throw q=String(R),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(R).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.")}return de}function O(R,q,w){if(R==null)return R;var ue=[],ye=0;return j(R,ue,"","",function(K){return q.call(w,K,ye++)}),ue}function P(R){if(R._status===-1){var q=R._result;q=q(),q.then(function(w){(R._status===0||R._status===-1)&&(R._status=1,R._result=w)},function(w){(R._status===0||R._status===-1)&&(R._status=2,R._result=w)}),R._status===-1&&(R._status=0,R._result=q)}if(R._status===1)return R._result.default;throw R._result}var J=typeof reportError=="function"?reportError:function(R){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof R=="object"&&R!==null&&typeof R.message=="string"?String(R.message):String(R),error:R});if(!window.dispatchEvent(q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",R);return}console.error(R)},C={map:O,forEach:function(R,q,w){O(R,function(){q.apply(this,arguments)},w)},count:function(R){var q=0;return O(R,function(){q++}),q},toArray:function(R){return O(R,function(q){return q})||[]},only:function(R){if(!Q(R))throw Error("React.Children.only expected to receive a single React element child.");return R}};return Ie.Activity=y,Ie.Children=C,Ie.Component=S,Ie.Fragment=i,Ie.Profiler=o,Ie.PureComponent=M,Ie.StrictMode=l,Ie.Suspense=h,Ie.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=X,Ie.__COMPILER_RUNTIME={__proto__:null,c:function(R){return X.H.useMemoCache(R)}},Ie.cache=function(R){return function(){return R.apply(null,arguments)}},Ie.cacheSignal=function(){return null},Ie.cloneElement=function(R,q,w){if(R==null)throw Error("The argument must be a React element, but you passed "+R+".");var ue=N({},R.props),ye=R.key;if(q!=null)for(K in q.key!==void 0&&(ye=""+q.key),q)!re.call(q,K)||K==="key"||K==="__self"||K==="__source"||K==="ref"&&q.ref===void 0||(ue[K]=q[K]);var K=arguments.length-2;if(K===1)ue.children=w;else if(1<K){for(var de=Array(K),xe=0;xe<K;xe++)de[xe]=arguments[xe+2];ue.children=de}return oe(R.type,ye,ue)},Ie.createContext=function(R){return R={$$typeof:u,_currentValue:R,_currentValue2:R,_threadCount:0,Provider:null,Consumer:null},R.Provider=R,R.Consumer={$$typeof:c,_context:R},R},Ie.createElement=function(R,q,w){var ue,ye={},K=null;if(q!=null)for(ue in q.key!==void 0&&(K=""+q.key),q)re.call(q,ue)&&ue!=="key"&&ue!=="__self"&&ue!=="__source"&&(ye[ue]=q[ue]);var de=arguments.length-2;if(de===1)ye.children=w;else if(1<de){for(var xe=Array(de),ve=0;ve<de;ve++)xe[ve]=arguments[ve+2];ye.children=xe}if(R&&R.defaultProps)for(ue in de=R.defaultProps,de)ye[ue]===void 0&&(ye[ue]=de[ue]);return oe(R,K,ye)},Ie.createRef=function(){return{current:null}},Ie.forwardRef=function(R){return{$$typeof:f,render:R}},Ie.isValidElement=Q,Ie.lazy=function(R){return{$$typeof:b,_payload:{_status:-1,_result:R},_init:P}},Ie.memo=function(R,q){return{$$typeof:p,type:R,compare:q===void 0?null:q}},Ie.startTransition=function(R){var q=X.T,w={};X.T=w;try{var ue=R(),ye=X.S;ye!==null&&ye(w,ue),typeof ue=="object"&&ue!==null&&typeof ue.then=="function"&&ue.then(L,J)}catch(K){J(K)}finally{q!==null&&w.types!==null&&(q.types=w.types),X.T=q}},Ie.unstable_useCacheRefresh=function(){return X.H.useCacheRefresh()},Ie.use=function(R){return X.H.use(R)},Ie.useActionState=function(R,q,w){return X.H.useActionState(R,q,w)},Ie.useCallback=function(R,q){return X.H.useCallback(R,q)},Ie.useContext=function(R){return X.H.useContext(R)},Ie.useDebugValue=function(){},Ie.useDeferredValue=function(R,q){return X.H.useDeferredValue(R,q)},Ie.useEffect=function(R,q){return X.H.useEffect(R,q)},Ie.useEffectEvent=function(R){return X.H.useEffectEvent(R)},Ie.useId=function(){return X.H.useId()},Ie.useImperativeHandle=function(R,q,w){return X.H.useImperativeHandle(R,q,w)},Ie.useInsertionEffect=function(R,q){return X.H.useInsertionEffect(R,q)},Ie.useLayoutEffect=function(R,q){return X.H.useLayoutEffect(R,q)},Ie.useMemo=function(R,q){return X.H.useMemo(R,q)},Ie.useOptimistic=function(R,q){return X.H.useOptimistic(R,q)},Ie.useReducer=function(R,q,w){return X.H.useReducer(R,q,w)},Ie.useRef=function(R){return X.H.useRef(R)},Ie.useState=function(R){return X.H.useState(R)},Ie.useSyncExternalStore=function(R,q,w){return X.H.useSyncExternalStore(R,q,w)},Ie.useTransition=function(){return X.H.useTransition()},Ie.version="19.2.4",Ie}var gb;function nh(){return gb||(gb=1,Yd.exports=nS()),Yd.exports}var U=nh();const Si=Ds(U);var Xd={exports:{}},ss={},Zd={exports:{}},Qd={};/**
18
+ * @license React
19
+ * scheduler.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var bb;function rS(){return bb||(bb=1,(function(e){function n(j,O){var P=j.length;j.push(O);e:for(;0<P;){var J=P-1>>>1,C=j[J];if(0<o(C,O))j[J]=O,j[P]=C,P=J;else break e}}function i(j){return j.length===0?null:j[0]}function l(j){if(j.length===0)return null;var O=j[0],P=j.pop();if(P!==O){j[0]=P;e:for(var J=0,C=j.length,R=C>>>1;J<R;){var q=2*(J+1)-1,w=j[q],ue=q+1,ye=j[ue];if(0>o(w,P))ue<C&&0>o(ye,w)?(j[J]=ye,j[ue]=P,J=ue):(j[J]=w,j[q]=P,J=q);else if(ue<C&&0>o(ye,P))j[J]=ye,j[ue]=P,J=ue;else break e}}return O}function o(j,O){var P=j.sortIndex-O.sortIndex;return P!==0?P:j.id-O.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var u=Date,f=u.now();e.unstable_now=function(){return u.now()-f}}var h=[],p=[],b=1,y=null,E=3,v=!1,_=!1,N=!1,T=!1,S=typeof setTimeout=="function"?setTimeout:null,D=typeof clearTimeout=="function"?clearTimeout:null,M=typeof setImmediate<"u"?setImmediate:null;function A(j){for(var O=i(p);O!==null;){if(O.callback===null)l(p);else if(O.startTime<=j)l(p),O.sortIndex=O.expirationTime,n(h,O);else break;O=i(p)}}function F(j){if(N=!1,A(j),!_)if(i(h)!==null)_=!0,L||(L=!0,ee());else{var O=i(p);O!==null&&$(F,O.startTime-j)}}var L=!1,X=-1,re=5,oe=-1;function B(){return T?!0:!(e.unstable_now()-oe<re)}function Q(){if(T=!1,L){var j=e.unstable_now();oe=j;var O=!0;try{e:{_=!1,N&&(N=!1,D(X),X=-1),v=!0;var P=E;try{t:{for(A(j),y=i(h);y!==null&&!(y.expirationTime>j&&B());){var J=y.callback;if(typeof J=="function"){y.callback=null,E=y.priorityLevel;var C=J(y.expirationTime<=j);if(j=e.unstable_now(),typeof C=="function"){y.callback=C,A(j),O=!0;break t}y===i(h)&&l(h),A(j)}else l(h);y=i(h)}if(y!==null)O=!0;else{var R=i(p);R!==null&&$(F,R.startTime-j),O=!1}}break e}finally{y=null,E=P,v=!1}O=void 0}}finally{O?ee():L=!1}}}var ee;if(typeof M=="function")ee=function(){M(Q)};else if(typeof MessageChannel<"u"){var me=new MessageChannel,se=me.port2;me.port1.onmessage=Q,ee=function(){se.postMessage(null)}}else ee=function(){S(Q,0)};function $(j,O){X=S(function(){j(e.unstable_now())},O)}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(j){j.callback=null},e.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):re=0<j?Math.floor(1e3/j):5},e.unstable_getCurrentPriorityLevel=function(){return E},e.unstable_next=function(j){switch(E){case 1:case 2:case 3:var O=3;break;default:O=E}var P=E;E=O;try{return j()}finally{E=P}},e.unstable_requestPaint=function(){T=!0},e.unstable_runWithPriority=function(j,O){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var P=E;E=j;try{return O()}finally{E=P}},e.unstable_scheduleCallback=function(j,O,P){var J=e.unstable_now();switch(typeof P=="object"&&P!==null?(P=P.delay,P=typeof P=="number"&&0<P?J+P:J):P=J,j){case 1:var C=-1;break;case 2:C=250;break;case 5:C=1073741823;break;case 4:C=1e4;break;default:C=5e3}return C=P+C,j={id:b++,callback:O,priorityLevel:j,startTime:P,expirationTime:C,sortIndex:-1},P>J?(j.sortIndex=P,n(p,j),i(h)===null&&j===i(p)&&(N?(D(X),X=-1):N=!0,$(F,P-J))):(j.sortIndex=C,n(h,j),_||v||(_=!0,L||(L=!0,ee()))),j},e.unstable_shouldYield=B,e.unstable_wrapCallback=function(j){var O=E;return function(){var P=E;E=O;try{return j.apply(this,arguments)}finally{E=P}}}})(Qd)),Qd}var yb;function iS(){return yb||(yb=1,Zd.exports=rS()),Zd.exports}var Wd={exports:{}},en={};/**
26
+ * @license React
27
+ * react-dom.production.js
28
+ *
29
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var vb;function aS(){if(vb)return en;vb=1;var e=nh();function n(h){var p="https://react.dev/errors/"+h;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)p+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+h+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var l={d:{f:i,r:function(){throw Error(n(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for("react.portal");function c(h,p,b){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:y==null?null:""+y,children:h,containerInfo:p,implementation:b}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(h,p){if(h==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return en.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=l,en.createPortal=function(h,p){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(n(299));return c(h,p,null,b)},en.flushSync=function(h){var p=u.T,b=l.p;try{if(u.T=null,l.p=2,h)return h()}finally{u.T=p,l.p=b,l.d.f()}},en.preconnect=function(h,p){typeof h=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,l.d.C(h,p))},en.prefetchDNS=function(h){typeof h=="string"&&l.d.D(h)},en.preinit=function(h,p){if(typeof h=="string"&&p&&typeof p.as=="string"){var b=p.as,y=f(b,p.crossOrigin),E=typeof p.integrity=="string"?p.integrity:void 0,v=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;b==="style"?l.d.S(h,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:y,integrity:E,fetchPriority:v}):b==="script"&&l.d.X(h,{crossOrigin:y,integrity:E,fetchPriority:v,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},en.preinitModule=function(h,p){if(typeof h=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var b=f(p.as,p.crossOrigin);l.d.M(h,{crossOrigin:b,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&l.d.M(h)},en.preload=function(h,p){if(typeof h=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var b=p.as,y=f(b,p.crossOrigin);l.d.L(h,b,{crossOrigin:y,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},en.preloadModule=function(h,p){if(typeof h=="string")if(p){var b=f(p.as,p.crossOrigin);l.d.m(h,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:b,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else l.d.m(h)},en.requestFormReset=function(h){l.d.r(h)},en.unstable_batchedUpdates=function(h,p){return h(p)},en.useFormState=function(h,p,b){return u.H.useFormState(h,p,b)},en.useFormStatus=function(){return u.H.useHostTransitionStatus()},en.version="19.2.4",en}var xb;function lS(){if(xb)return Wd.exports;xb=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(n){console.error(n)}}return e(),Wd.exports=aS(),Wd.exports}/**
34
+ * @license React
35
+ * react-dom-client.production.js
36
+ *
37
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var Eb;function sS(){if(Eb)return ss;Eb=1;var e=iS(),n=nh(),i=lS();function l(t){var r="https://react.dev/errors/"+t;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)r+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+t+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function c(t){var r=t,a=t;if(t.alternate)for(;r.return;)r=r.return;else{t=r;do r=t,(r.flags&4098)!==0&&(a=r.return),t=r.return;while(t)}return r.tag===3?a:null}function u(t){if(t.tag===13){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function f(t){if(t.tag===31){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function h(t){if(c(t)!==t)throw Error(l(188))}function p(t){var r=t.alternate;if(!r){if(r=c(t),r===null)throw Error(l(188));return r!==t?null:t}for(var a=t,s=r;;){var d=a.return;if(d===null)break;var m=d.alternate;if(m===null){if(s=d.return,s!==null){a=s;continue}break}if(d.child===m.child){for(m=d.child;m;){if(m===a)return h(d),t;if(m===s)return h(d),r;m=m.sibling}throw Error(l(188))}if(a.return!==s.return)a=d,s=m;else{for(var x=!1,k=d.child;k;){if(k===a){x=!0,a=d,s=m;break}if(k===s){x=!0,s=d,a=m;break}k=k.sibling}if(!x){for(k=m.child;k;){if(k===a){x=!0,a=m,s=d;break}if(k===s){x=!0,s=m,a=d;break}k=k.sibling}if(!x)throw Error(l(189))}}if(a.alternate!==s)throw Error(l(190))}if(a.tag!==3)throw Error(l(188));return a.stateNode.current===a?t:r}function b(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t;for(t=t.child;t!==null;){if(r=b(t),r!==null)return r;t=t.sibling}return null}var y=Object.assign,E=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),_=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),D=Symbol.for("react.consumer"),M=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),F=Symbol.for("react.suspense"),L=Symbol.for("react.suspense_list"),X=Symbol.for("react.memo"),re=Symbol.for("react.lazy"),oe=Symbol.for("react.activity"),B=Symbol.for("react.memo_cache_sentinel"),Q=Symbol.iterator;function ee(t){return t===null||typeof t!="object"?null:(t=Q&&t[Q]||t["@@iterator"],typeof t=="function"?t:null)}var me=Symbol.for("react.client.reference");function se(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===me?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case N:return"Fragment";case S:return"Profiler";case T:return"StrictMode";case F:return"Suspense";case L:return"SuspenseList";case oe:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case _:return"Portal";case M:return t.displayName||"Context";case D:return(t._context.displayName||"Context")+".Consumer";case A:var r=t.render;return t=t.displayName,t||(t=r.displayName||r.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case X:return r=t.displayName||null,r!==null?r:se(t.type)||"Memo";case re:r=t._payload,t=t._init;try{return se(t(r))}catch{}}return null}var $=Array.isArray,j=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,O=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P={pending:!1,data:null,method:null,action:null},J=[],C=-1;function R(t){return{current:t}}function q(t){0>C||(t.current=J[C],J[C]=null,C--)}function w(t,r){C++,J[C]=t.current,t.current=r}var ue=R(null),ye=R(null),K=R(null),de=R(null);function xe(t,r){switch(w(K,r),w(ye,t),w(ue,null),r.nodeType){case 9:case 11:t=(t=r.documentElement)&&(t=t.namespaceURI)?Rg(t):0;break;default:if(t=r.tagName,r=r.namespaceURI)r=Rg(r),t=Dg(r,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}q(ue),w(ue,t)}function ve(){q(ue),q(ye),q(K)}function De(t){t.memoizedState!==null&&w(de,t);var r=ue.current,a=Dg(r,t.type);r!==a&&(w(ye,t),w(ue,a))}function St(t){ye.current===t&&(q(ue),q(ye)),de.current===t&&(q(de),ts._currentValue=P)}var Tt,$r;function kn(t){if(Tt===void 0)try{throw Error()}catch(a){var r=a.stack.trim().match(/\n( *(at )?)/);Tt=r&&r[1]||"",$r=-1<a.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+Tt+t+$r}var rr=!1;function Ye(t,r){if(!t||rr)return"";rr=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(r){var le=function(){throw Error()};if(Object.defineProperty(le.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(le,[])}catch(W){var Z=W}Reflect.construct(t,[],le)}else{try{le.call()}catch(W){Z=W}t.call(le.prototype)}}else{try{throw Error()}catch(W){Z=W}(le=t())&&typeof le.catch=="function"&&le.catch(function(){})}}catch(W){if(W&&Z&&typeof W.stack=="string")return[W.stack,Z.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var d=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");d&&d.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var m=s.DetermineComponentFrameRoot(),x=m[0],k=m[1];if(x&&k){var I=x.split(`
44
+ `),Y=k.split(`
45
+ `);for(d=s=0;s<I.length&&!I[s].includes("DetermineComponentFrameRoot");)s++;for(;d<Y.length&&!Y[d].includes("DetermineComponentFrameRoot");)d++;if(s===I.length||d===Y.length)for(s=I.length-1,d=Y.length-1;1<=s&&0<=d&&I[s]!==Y[d];)d--;for(;1<=s&&0<=d;s--,d--)if(I[s]!==Y[d]){if(s!==1||d!==1)do if(s--,d--,0>d||I[s]!==Y[d]){var ne=`
46
+ `+I[s].replace(" at new "," at ");return t.displayName&&ne.includes("<anonymous>")&&(ne=ne.replace("<anonymous>",t.displayName)),ne}while(1<=s&&0<=d);break}}}finally{rr=!1,Error.prepareStackTrace=a}return(a=t?t.displayName||t.name:"")?kn(a):""}function Xn(t,r){switch(t.tag){case 26:case 27:case 5:return kn(t.type);case 16:return kn("Lazy");case 13:return t.child!==r&&r!==null?kn("Suspense Fallback"):kn("Suspense");case 19:return kn("SuspenseList");case 0:case 15:return Ye(t.type,!1);case 11:return Ye(t.type.render,!1);case 1:return Ye(t.type,!0);case 31:return kn("Activity");default:return""}}function zn(t){try{var r="",a=null;do r+=Xn(t,a),a=t,t=t.return;while(t);return r}catch(s){return`
47
+ Error generating stack: `+s.message+`
48
+ `+s.stack}}var ir=Object.prototype.hasOwnProperty,vr=e.unstable_scheduleCallback,Ni=e.unstable_cancelCallback,dl=e.unstable_shouldYield,ia=e.unstable_requestPaint,wt=e.unstable_now,aa=e.unstable_getCurrentPriorityLevel,te=e.unstable_ImmediatePriority,pe=e.unstable_UserBlockingPriority,Ae=e.unstable_NormalPriority,He=e.unstable_LowPriority,Qe=e.unstable_IdlePriority,rn=e.log,Zn=e.unstable_setDisableYieldValue,Kt=null,Ct=null;function Qt(t){if(typeof rn=="function"&&Zn(t),Ct&&typeof Ct.setStrictMode=="function")try{Ct.setStrictMode(Kt,t)}catch{}}var rt=Math.clz32?Math.clz32:Ps,ar=Math.log,an=Math.LN2;function Ps(t){return t>>>=0,t===0?32:31-(ar(t)/an|0)|0}var Ti=256,la=262144,Ci=4194304;function hn(t){var r=t&42;if(r!==0)return r;switch(t&-t){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 t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function z(t,r,a){var s=t.pendingLanes;if(s===0)return 0;var d=0,m=t.suspendedLanes,x=t.pingedLanes;t=t.warmLanes;var k=s&134217727;return k!==0?(s=k&~m,s!==0?d=hn(s):(x&=k,x!==0?d=hn(x):a||(a=k&~t,a!==0&&(d=hn(a))))):(k=s&~m,k!==0?d=hn(k):x!==0?d=hn(x):a||(a=s&~t,a!==0&&(d=hn(a)))),d===0?0:r!==0&&r!==d&&(r&m)===0&&(m=d&-d,a=r&-r,m>=a||m===32&&(a&4194048)!==0)?r:d}function ie(t,r){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&r)===0}function be(t,r){switch(t){case 1:case 2:case 4:case 8:case 64:return r+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 r+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 Le(){var t=Ci;return Ci<<=1,(Ci&62914560)===0&&(Ci=4194304),t}function vt(t){for(var r=[],a=0;31>a;a++)r.push(t);return r}function ht(t,r){t.pendingLanes|=r,r!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function _e(t,r,a,s,d,m){var x=t.pendingLanes;t.pendingLanes=a,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=a,t.entangledLanes&=a,t.errorRecoveryDisabledLanes&=a,t.shellSuspendCounter=0;var k=t.entanglements,I=t.expirationTimes,Y=t.hiddenUpdates;for(a=x&~a;0<a;){var ne=31-rt(a),le=1<<ne;k[ne]=0,I[ne]=-1;var Z=Y[ne];if(Z!==null)for(Y[ne]=null,ne=0;ne<Z.length;ne++){var W=Z[ne];W!==null&&(W.lane&=-536870913)}a&=~le}s!==0&&Ee(t,s,0),m!==0&&d===0&&t.tag!==0&&(t.suspendedLanes|=m&~(x&~r))}function Ee(t,r,a){t.pendingLanes|=r,t.suspendedLanes&=~r;var s=31-rt(r);t.entangledLanes|=r,t.entanglements[s]=t.entanglements[s]|1073741824|a&261930}function Re(t,r){var a=t.entangledLanes|=r;for(t=t.entanglements;a;){var s=31-rt(a),d=1<<s;d&r|t[s]&r&&(t[s]|=r),a&=~d}}function Mt(t,r){var a=r&-r;return a=(a&42)!==0?1:_t(a),(a&(t.suspendedLanes|r))!==0?0:a}function _t(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=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:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function xr(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function sa(){var t=O.p;return t!==0?t:(t=window.event,t===void 0?32:nb(t.type))}function oa(t,r){var a=O.p;try{return O.p=t,r()}finally{O.p=a}}var lr=Math.random().toString(36).slice(2),Rt="__reactFiber$"+lr,Wt="__reactProps$"+lr,Kr="__reactContainer$"+lr,fl="__reactEvents$"+lr,Fs="__reactListeners$"+lr,ca="__reactHandles$"+lr,Gs="__reactResources$"+lr,Ai="__reactMarker$"+lr;function hl(t){delete t[Rt],delete t[Wt],delete t[fl],delete t[Fs],delete t[ca]}function ln(t){var r=t[Rt];if(r)return r;for(var a=t.parentNode;a;){if(r=a[Kr]||a[Rt]){if(a=r.alternate,r.child!==null||a!==null&&a.child!==null)for(t=Hg(t);t!==null;){if(a=t[Rt])return a;t=Hg(t)}return r}t=a,a=t.parentNode}return null}function Er(t){if(t=t[Rt]||t[Kr]){var r=t.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return t}return null}function qr(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t.stateNode;throw Error(l(33))}function Vr(t){var r=t[Gs];return r||(r=t[Gs]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function zt(t){t[Ai]=!0}var $s=new Set,Oi={};function Sr(t,r){fe(t,r),fe(t+"Capture",r)}function fe(t,r){for(Oi[t]=r,t=0;t<r.length;t++)$s.add(r[t])}var Ne=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]*$"),Pe={},it={};function Dt(t){return ir.call(it,t)?!0:ir.call(Pe,t)?!1:Ne.test(t)?it[t]=!0:(Pe[t]=!0,!1)}function Jt(t,r,a){if(Dt(r))if(a===null)t.removeAttribute(r);else{switch(typeof a){case"undefined":case"function":case"symbol":t.removeAttribute(r);return;case"boolean":var s=r.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){t.removeAttribute(r);return}}t.setAttribute(r,""+a)}}function wn(t,r,a){if(a===null)t.removeAttribute(r);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(r);return}t.setAttribute(r,""+a)}}function pn(t,r,a,s){if(s===null)t.removeAttribute(a);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(a);return}t.setAttributeNS(r,a,""+s)}}function bt(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Nn(t){var r=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function Ks(t,r,a){var s=Object.getOwnPropertyDescriptor(t.constructor.prototype,r);if(!t.hasOwnProperty(r)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var d=s.get,m=s.set;return Object.defineProperty(t,r,{configurable:!0,get:function(){return d.call(this)},set:function(x){a=""+x,m.call(this,x)}}),Object.defineProperty(t,r,{enumerable:s.enumerable}),{getValue:function(){return a},setValue:function(x){a=""+x},stopTracking:function(){t._valueTracker=null,delete t[r]}}}}function ua(t){if(!t._valueTracker){var r=Nn(t)?"checked":"value";t._valueTracker=Ks(t,r,""+t[r])}}function pl(t){if(!t)return!1;var r=t._valueTracker;if(!r)return!0;var a=r.getValue(),s="";return t&&(s=Nn(t)?t.checked?"true":"false":t.value),t=s,t!==a?(r.setValue(t),!0):!1}function da(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var qc=/[\n"\\]/g;function mn(t){return t.replace(qc,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function ml(t,r,a,s,d,m,x,k){t.name="",x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?t.type=x:t.removeAttribute("type"),r!=null?x==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+bt(r)):t.value!==""+bt(r)&&(t.value=""+bt(r)):x!=="submit"&&x!=="reset"||t.removeAttribute("value"),r!=null?fa(t,x,bt(r)):a!=null?fa(t,x,bt(a)):s!=null&&t.removeAttribute("value"),d==null&&m!=null&&(t.defaultChecked=!!m),d!=null&&(t.checked=d&&typeof d!="function"&&typeof d!="symbol"),k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?t.name=""+bt(k):t.removeAttribute("name")}function Mi(t,r,a,s,d,m,x,k){if(m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(t.type=m),r!=null||a!=null){if(!(m!=="submit"&&m!=="reset"||r!=null)){ua(t);return}a=a!=null?""+bt(a):"",r=r!=null?""+bt(r):a,k||r===t.value||(t.value=r),t.defaultValue=r}s=s??d,s=typeof s!="function"&&typeof s!="symbol"&&!!s,t.checked=k?t.checked:!!s,t.defaultChecked=!!s,x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(t.name=x),ua(t)}function fa(t,r,a){r==="number"&&da(t.ownerDocument)===t||t.defaultValue===""+a||(t.defaultValue=""+a)}function qt(t,r,a,s){if(t=t.options,r){r={};for(var d=0;d<a.length;d++)r["$"+a[d]]=!0;for(a=0;a<t.length;a++)d=r.hasOwnProperty("$"+t[a].value),t[a].selected!==d&&(t[a].selected=d),d&&s&&(t[a].defaultSelected=!0)}else{for(a=""+bt(a),r=null,d=0;d<t.length;d++){if(t[d].value===a){t[d].selected=!0,s&&(t[d].defaultSelected=!0);return}r!==null||t[d].disabled||(r=t[d])}r!==null&&(r.selected=!0)}}function qs(t,r,a){if(r!=null&&(r=""+bt(r),r!==t.value&&(t.value=r),a==null)){t.defaultValue!==r&&(t.defaultValue=r);return}t.defaultValue=a!=null?""+bt(a):""}function ha(t,r,a,s){if(r==null){if(s!=null){if(a!=null)throw Error(l(92));if($(s)){if(1<s.length)throw Error(l(93));s=s[0]}a=s}a==null&&(a=""),r=a}a=bt(r),t.defaultValue=a,s=t.textContent,s===a&&s!==""&&s!==null&&(t.value=s),ua(t)}function Me(t,r){if(r){var a=t.firstChild;if(a&&a===t.lastChild&&a.nodeType===3){a.nodeValue=r;return}}t.textContent=r}var Vs=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 Bt(t,r,a){var s=r.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?s?t.setProperty(r,""):r==="float"?t.cssFloat="":t[r]="":s?t.setProperty(r,a):typeof a!="number"||a===0||Vs.has(r)?r==="float"?t.cssFloat=a:t[r]=(""+a).trim():t[r]=a+"px"}function at(t,r,a){if(r!=null&&typeof r!="object")throw Error(l(62));if(t=t.style,a!=null){for(var s in a)!a.hasOwnProperty(s)||r!=null&&r.hasOwnProperty(s)||(s.indexOf("--")===0?t.setProperty(s,""):s==="float"?t.cssFloat="":t[s]="");for(var d in r)s=r[d],r.hasOwnProperty(d)&&a[d]!==s&&Bt(t,d,s)}else for(var m in r)r.hasOwnProperty(m)&&Bt(t,m,r[m])}function Yr(t){if(t.indexOf("-")===-1)return!1;switch(t){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 _r=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"]]),gl=/^[\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 Xr(t){return gl.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function ge(){}var ke=null;function ze(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Ke=null,Nt=null;function Bn(t){var r=Er(t);if(r&&(t=r.stateNode)){var a=t[Wt]||null;e:switch(t=r.stateNode,r.type){case"input":if(ml(t,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),r=a.name,a.type==="radio"&&r!=null){for(a=t;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+mn(""+r)+'"][type="radio"]'),r=0;r<a.length;r++){var s=a[r];if(s!==t&&s.form===t.form){var d=s[Wt]||null;if(!d)throw Error(l(90));ml(s,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name)}}for(r=0;r<a.length;r++)s=a[r],s.form===t.form&&pl(s)}break e;case"textarea":qs(t,a.value,a.defaultValue);break e;case"select":r=a.value,r!=null&&qt(t,!!a.multiple,r,!1)}}}var bl=!1;function Ys(t,r,a){if(bl)return t(r,a);bl=!0;try{var s=t(r);return s}finally{if(bl=!1,(Ke!==null||Nt!==null)&&(zo(),Ke&&(r=Ke,t=Nt,Nt=Ke=null,Bn(r),t)))for(r=0;r<t.length;r++)Bn(t[r])}}function yl(t,r){var a=t.stateNode;if(a===null)return null;var s=a[Wt]||null;if(s===null)return null;a=s[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(s=!s.disabled)||(t=t.type,s=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!s;break e;default:t=!1}if(t)return null;if(a&&typeof a!="function")throw Error(l(231,r,typeof a));return a}var kr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Vc=!1;if(kr)try{var vl={};Object.defineProperty(vl,"passive",{get:function(){Vc=!0}}),window.addEventListener("test",vl,vl),window.removeEventListener("test",vl,vl)}catch{Vc=!1}var Zr=null,Yc=null,Xs=null;function Dh(){if(Xs)return Xs;var t,r=Yc,a=r.length,s,d="value"in Zr?Zr.value:Zr.textContent,m=d.length;for(t=0;t<a&&r[t]===d[t];t++);var x=a-t;for(s=1;s<=x&&r[a-s]===d[m-s];s++);return Xs=d.slice(t,1<s?1-s:void 0)}function Zs(t){var r=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&r===13&&(t=13)):t=r,t===10&&(t=13),32<=t||t===13?t:0}function Qs(){return!0}function Lh(){return!1}function gn(t){function r(a,s,d,m,x){this._reactName=a,this._targetInst=d,this.type=s,this.nativeEvent=m,this.target=x,this.currentTarget=null;for(var k in t)t.hasOwnProperty(k)&&(a=t[k],this[k]=a?a(m):m[k]);return this.isDefaultPrevented=(m.defaultPrevented!=null?m.defaultPrevented:m.returnValue===!1)?Qs:Lh,this.isPropagationStopped=Lh,this}return y(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Qs)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Qs)},persist:function(){},isPersistent:Qs}),r}var Ri={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ws=gn(Ri),xl=y({},Ri,{view:0,detail:0}),Z0=gn(xl),Xc,Zc,El,Js=y({},xl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Wc,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==El&&(El&&t.type==="mousemove"?(Xc=t.screenX-El.screenX,Zc=t.screenY-El.screenY):Zc=Xc=0,El=t),Xc)},movementY:function(t){return"movementY"in t?t.movementY:Zc}}),Ih=gn(Js),Q0=y({},Js,{dataTransfer:0}),W0=gn(Q0),J0=y({},xl,{relatedTarget:0}),Qc=gn(J0),e1=y({},Ri,{animationName:0,elapsedTime:0,pseudoElement:0}),t1=gn(e1),n1=y({},Ri,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),r1=gn(n1),i1=y({},Ri,{data:0}),zh=gn(i1),a1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},l1={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"},s1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function o1(t){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(t):(t=s1[t])?!!r[t]:!1}function Wc(){return o1}var c1=y({},xl,{key:function(t){if(t.key){var r=a1[t.key]||t.key;if(r!=="Unidentified")return r}return t.type==="keypress"?(t=Zs(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?l1[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Wc,charCode:function(t){return t.type==="keypress"?Zs(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Zs(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),u1=gn(c1),d1=y({},Js,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Bh=gn(d1),f1=y({},xl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Wc}),h1=gn(f1),p1=y({},Ri,{propertyName:0,elapsedTime:0,pseudoElement:0}),m1=gn(p1),g1=y({},Js,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),b1=gn(g1),y1=y({},Ri,{newState:0,oldState:0}),v1=gn(y1),x1=[9,13,27,32],Jc=kr&&"CompositionEvent"in window,Sl=null;kr&&"documentMode"in document&&(Sl=document.documentMode);var E1=kr&&"TextEvent"in window&&!Sl,Uh=kr&&(!Jc||Sl&&8<Sl&&11>=Sl),jh=" ",Hh=!1;function Ph(t,r){switch(t){case"keyup":return x1.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Fh(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var pa=!1;function S1(t,r){switch(t){case"compositionend":return Fh(r);case"keypress":return r.which!==32?null:(Hh=!0,jh);case"textInput":return t=r.data,t===jh&&Hh?null:t;default:return null}}function _1(t,r){if(pa)return t==="compositionend"||!Jc&&Ph(t,r)?(t=Dh(),Xs=Yc=Zr=null,pa=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return Uh&&r.locale!=="ko"?null:r.data;default:return null}}var k1={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Gh(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r==="input"?!!k1[t.type]:r==="textarea"}function $h(t,r,a,s){Ke?Nt?Nt.push(s):Nt=[s]:Ke=s,r=Go(r,"onChange"),0<r.length&&(a=new Ws("onChange","change",null,a,s),t.push({event:a,listeners:r}))}var _l=null,kl=null;function w1(t){Ng(t,0)}function eo(t){var r=qr(t);if(pl(r))return t}function Kh(t,r){if(t==="change")return r}var qh=!1;if(kr){var eu;if(kr){var tu="oninput"in document;if(!tu){var Vh=document.createElement("div");Vh.setAttribute("oninput","return;"),tu=typeof Vh.oninput=="function"}eu=tu}else eu=!1;qh=eu&&(!document.documentMode||9<document.documentMode)}function Yh(){_l&&(_l.detachEvent("onpropertychange",Xh),kl=_l=null)}function Xh(t){if(t.propertyName==="value"&&eo(kl)){var r=[];$h(r,kl,t,ze(t)),Ys(w1,r)}}function N1(t,r,a){t==="focusin"?(Yh(),_l=r,kl=a,_l.attachEvent("onpropertychange",Xh)):t==="focusout"&&Yh()}function T1(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return eo(kl)}function C1(t,r){if(t==="click")return eo(r)}function A1(t,r){if(t==="input"||t==="change")return eo(r)}function O1(t,r){return t===r&&(t!==0||1/t===1/r)||t!==t&&r!==r}var Tn=typeof Object.is=="function"?Object.is:O1;function wl(t,r){if(Tn(t,r))return!0;if(typeof t!="object"||t===null||typeof r!="object"||r===null)return!1;var a=Object.keys(t),s=Object.keys(r);if(a.length!==s.length)return!1;for(s=0;s<a.length;s++){var d=a[s];if(!ir.call(r,d)||!Tn(t[d],r[d]))return!1}return!0}function Zh(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Qh(t,r){var a=Zh(t);t=0;for(var s;a;){if(a.nodeType===3){if(s=t+a.textContent.length,t<=r&&s>=r)return{node:a,offset:r-t};t=s}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Zh(a)}}function Wh(t,r){return t&&r?t===r?!0:t&&t.nodeType===3?!1:r&&r.nodeType===3?Wh(t,r.parentNode):"contains"in t?t.contains(r):t.compareDocumentPosition?!!(t.compareDocumentPosition(r)&16):!1:!1}function Jh(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var r=da(t.document);r instanceof t.HTMLIFrameElement;){try{var a=typeof r.contentWindow.location.href=="string"}catch{a=!1}if(a)t=r.contentWindow;else break;r=da(t.document)}return r}function nu(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r&&(r==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||r==="textarea"||t.contentEditable==="true")}var M1=kr&&"documentMode"in document&&11>=document.documentMode,ma=null,ru=null,Nl=null,iu=!1;function ep(t,r,a){var s=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;iu||ma==null||ma!==da(s)||(s=ma,"selectionStart"in s&&nu(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),Nl&&wl(Nl,s)||(Nl=s,s=Go(ru,"onSelect"),0<s.length&&(r=new Ws("onSelect","select",null,r,a),t.push({event:r,listeners:s}),r.target=ma)))}function Di(t,r){var a={};return a[t.toLowerCase()]=r.toLowerCase(),a["Webkit"+t]="webkit"+r,a["Moz"+t]="moz"+r,a}var ga={animationend:Di("Animation","AnimationEnd"),animationiteration:Di("Animation","AnimationIteration"),animationstart:Di("Animation","AnimationStart"),transitionrun:Di("Transition","TransitionRun"),transitionstart:Di("Transition","TransitionStart"),transitioncancel:Di("Transition","TransitionCancel"),transitionend:Di("Transition","TransitionEnd")},au={},tp={};kr&&(tp=document.createElement("div").style,"AnimationEvent"in window||(delete ga.animationend.animation,delete ga.animationiteration.animation,delete ga.animationstart.animation),"TransitionEvent"in window||delete ga.transitionend.transition);function Li(t){if(au[t])return au[t];if(!ga[t])return t;var r=ga[t],a;for(a in r)if(r.hasOwnProperty(a)&&a in tp)return au[t]=r[a];return t}var np=Li("animationend"),rp=Li("animationiteration"),ip=Li("animationstart"),R1=Li("transitionrun"),D1=Li("transitionstart"),L1=Li("transitioncancel"),ap=Li("transitionend"),lp=new Map,lu="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(" ");lu.push("scrollEnd");function Qn(t,r){lp.set(t,r),Sr(r,[t])}var to=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},Un=[],ba=0,su=0;function no(){for(var t=ba,r=su=ba=0;r<t;){var a=Un[r];Un[r++]=null;var s=Un[r];Un[r++]=null;var d=Un[r];Un[r++]=null;var m=Un[r];if(Un[r++]=null,s!==null&&d!==null){var x=s.pending;x===null?d.next=d:(d.next=x.next,x.next=d),s.pending=d}m!==0&&sp(a,d,m)}}function ro(t,r,a,s){Un[ba++]=t,Un[ba++]=r,Un[ba++]=a,Un[ba++]=s,su|=s,t.lanes|=s,t=t.alternate,t!==null&&(t.lanes|=s)}function ou(t,r,a,s){return ro(t,r,a,s),io(t)}function Ii(t,r){return ro(t,null,null,r),io(t)}function sp(t,r,a){t.lanes|=a;var s=t.alternate;s!==null&&(s.lanes|=a);for(var d=!1,m=t.return;m!==null;)m.childLanes|=a,s=m.alternate,s!==null&&(s.childLanes|=a),m.tag===22&&(t=m.stateNode,t===null||t._visibility&1||(d=!0)),t=m,m=m.return;return t.tag===3?(m=t.stateNode,d&&r!==null&&(d=31-rt(a),t=m.hiddenUpdates,s=t[d],s===null?t[d]=[r]:s.push(r),r.lane=a|536870912),m):null}function io(t){if(50<Yl)throw Yl=0,bd=null,Error(l(185));for(var r=t.return;r!==null;)t=r,r=t.return;return t.tag===3?t.stateNode:null}var ya={};function I1(t,r,a,s){this.tag=t,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Cn(t,r,a,s){return new I1(t,r,a,s)}function cu(t){return t=t.prototype,!(!t||!t.isReactComponent)}function wr(t,r){var a=t.alternate;return a===null?(a=Cn(t.tag,r,t.key,t.mode),a.elementType=t.elementType,a.type=t.type,a.stateNode=t.stateNode,a.alternate=t,t.alternate=a):(a.pendingProps=r,a.type=t.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=t.flags&65011712,a.childLanes=t.childLanes,a.lanes=t.lanes,a.child=t.child,a.memoizedProps=t.memoizedProps,a.memoizedState=t.memoizedState,a.updateQueue=t.updateQueue,r=t.dependencies,a.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},a.sibling=t.sibling,a.index=t.index,a.ref=t.ref,a.refCleanup=t.refCleanup,a}function op(t,r){t.flags&=65011714;var a=t.alternate;return a===null?(t.childLanes=0,t.lanes=r,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=a.childLanes,t.lanes=a.lanes,t.child=a.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=a.memoizedProps,t.memoizedState=a.memoizedState,t.updateQueue=a.updateQueue,t.type=a.type,r=a.dependencies,t.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),t}function ao(t,r,a,s,d,m){var x=0;if(s=t,typeof t=="function")cu(t)&&(x=1);else if(typeof t=="string")x=HE(t,a,ue.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case oe:return t=Cn(31,a,r,d),t.elementType=oe,t.lanes=m,t;case N:return zi(a.children,d,m,r);case T:x=8,d|=24;break;case S:return t=Cn(12,a,r,d|2),t.elementType=S,t.lanes=m,t;case F:return t=Cn(13,a,r,d),t.elementType=F,t.lanes=m,t;case L:return t=Cn(19,a,r,d),t.elementType=L,t.lanes=m,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case M:x=10;break e;case D:x=9;break e;case A:x=11;break e;case X:x=14;break e;case re:x=16,s=null;break e}x=29,a=Error(l(130,t===null?"null":typeof t,"")),s=null}return r=Cn(x,a,r,d),r.elementType=t,r.type=s,r.lanes=m,r}function zi(t,r,a,s){return t=Cn(7,t,s,r),t.lanes=a,t}function uu(t,r,a){return t=Cn(6,t,null,r),t.lanes=a,t}function cp(t){var r=Cn(18,null,null,0);return r.stateNode=t,r}function du(t,r,a){return r=Cn(4,t.children!==null?t.children:[],t.key,r),r.lanes=a,r.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},r}var up=new WeakMap;function jn(t,r){if(typeof t=="object"&&t!==null){var a=up.get(t);return a!==void 0?a:(r={value:t,source:r,stack:zn(r)},up.set(t,r),r)}return{value:t,source:r,stack:zn(r)}}var va=[],xa=0,lo=null,Tl=0,Hn=[],Pn=0,Qr=null,sr=1,or="";function Nr(t,r){va[xa++]=Tl,va[xa++]=lo,lo=t,Tl=r}function dp(t,r,a){Hn[Pn++]=sr,Hn[Pn++]=or,Hn[Pn++]=Qr,Qr=t;var s=sr;t=or;var d=32-rt(s)-1;s&=~(1<<d),a+=1;var m=32-rt(r)+d;if(30<m){var x=d-d%5;m=(s&(1<<x)-1).toString(32),s>>=x,d-=x,sr=1<<32-rt(r)+d|a<<d|s,or=m+t}else sr=1<<m|a<<d|s,or=t}function fu(t){t.return!==null&&(Nr(t,1),dp(t,1,0))}function hu(t){for(;t===lo;)lo=va[--xa],va[xa]=null,Tl=va[--xa],va[xa]=null;for(;t===Qr;)Qr=Hn[--Pn],Hn[Pn]=null,or=Hn[--Pn],Hn[Pn]=null,sr=Hn[--Pn],Hn[Pn]=null}function fp(t,r){Hn[Pn++]=sr,Hn[Pn++]=or,Hn[Pn++]=Qr,sr=r.id,or=r.overflow,Qr=t}var Vt=null,xt=null,Xe=!1,Wr=null,Fn=!1,pu=Error(l(519));function Jr(t){var r=Error(l(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Cl(jn(r,t)),pu}function hp(t){var r=t.stateNode,a=t.type,s=t.memoizedProps;switch(r[Rt]=t,r[Wt]=s,a){case"dialog":Ge("cancel",r),Ge("close",r);break;case"iframe":case"object":case"embed":Ge("load",r);break;case"video":case"audio":for(a=0;a<Zl.length;a++)Ge(Zl[a],r);break;case"source":Ge("error",r);break;case"img":case"image":case"link":Ge("error",r),Ge("load",r);break;case"details":Ge("toggle",r);break;case"input":Ge("invalid",r),Mi(r,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":Ge("invalid",r);break;case"textarea":Ge("invalid",r),ha(r,s.value,s.defaultValue,s.children)}a=s.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||r.textContent===""+a||s.suppressHydrationWarning===!0||Og(r.textContent,a)?(s.popover!=null&&(Ge("beforetoggle",r),Ge("toggle",r)),s.onScroll!=null&&Ge("scroll",r),s.onScrollEnd!=null&&Ge("scrollend",r),s.onClick!=null&&(r.onclick=ge),r=!0):r=!1,r||Jr(t,!0)}function pp(t){for(Vt=t.return;Vt;)switch(Vt.tag){case 5:case 31:case 13:Fn=!1;return;case 27:case 3:Fn=!0;return;default:Vt=Vt.return}}function Ea(t){if(t!==Vt)return!1;if(!Xe)return pp(t),Xe=!0,!1;var r=t.tag,a;if((a=r!==3&&r!==27)&&((a=r===5)&&(a=t.type,a=!(a!=="form"&&a!=="button")||Rd(t.type,t.memoizedProps)),a=!a),a&&xt&&Jr(t),pp(t),r===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(l(317));xt=jg(t)}else if(r===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(l(317));xt=jg(t)}else r===27?(r=xt,hi(t.type)?(t=Bd,Bd=null,xt=t):xt=r):xt=Vt?$n(t.stateNode.nextSibling):null;return!0}function Bi(){xt=Vt=null,Xe=!1}function mu(){var t=Wr;return t!==null&&(xn===null?xn=t:xn.push.apply(xn,t),Wr=null),t}function Cl(t){Wr===null?Wr=[t]:Wr.push(t)}var gu=R(null),Ui=null,Tr=null;function ei(t,r,a){w(gu,r._currentValue),r._currentValue=a}function Cr(t){t._currentValue=gu.current,q(gu)}function bu(t,r,a){for(;t!==null;){var s=t.alternate;if((t.childLanes&r)!==r?(t.childLanes|=r,s!==null&&(s.childLanes|=r)):s!==null&&(s.childLanes&r)!==r&&(s.childLanes|=r),t===a)break;t=t.return}}function yu(t,r,a,s){var d=t.child;for(d!==null&&(d.return=t);d!==null;){var m=d.dependencies;if(m!==null){var x=d.child;m=m.firstContext;e:for(;m!==null;){var k=m;m=d;for(var I=0;I<r.length;I++)if(k.context===r[I]){m.lanes|=a,k=m.alternate,k!==null&&(k.lanes|=a),bu(m.return,a,t),s||(x=null);break e}m=k.next}}else if(d.tag===18){if(x=d.return,x===null)throw Error(l(341));x.lanes|=a,m=x.alternate,m!==null&&(m.lanes|=a),bu(x,a,t),x=null}else x=d.child;if(x!==null)x.return=d;else for(x=d;x!==null;){if(x===t){x=null;break}if(d=x.sibling,d!==null){d.return=x.return,x=d;break}x=x.return}d=x}}function Sa(t,r,a,s){t=null;for(var d=r,m=!1;d!==null;){if(!m){if((d.flags&524288)!==0)m=!0;else if((d.flags&262144)!==0)break}if(d.tag===10){var x=d.alternate;if(x===null)throw Error(l(387));if(x=x.memoizedProps,x!==null){var k=d.type;Tn(d.pendingProps.value,x.value)||(t!==null?t.push(k):t=[k])}}else if(d===de.current){if(x=d.alternate,x===null)throw Error(l(387));x.memoizedState.memoizedState!==d.memoizedState.memoizedState&&(t!==null?t.push(ts):t=[ts])}d=d.return}t!==null&&yu(r,t,a,s),r.flags|=262144}function so(t){for(t=t.firstContext;t!==null;){if(!Tn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function ji(t){Ui=t,Tr=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Yt(t){return mp(Ui,t)}function oo(t,r){return Ui===null&&ji(t),mp(t,r)}function mp(t,r){var a=r._currentValue;if(r={context:r,memoizedValue:a,next:null},Tr===null){if(t===null)throw Error(l(308));Tr=r,t.dependencies={lanes:0,firstContext:r},t.flags|=524288}else Tr=Tr.next=r;return a}var z1=typeof AbortController<"u"?AbortController:function(){var t=[],r=this.signal={aborted:!1,addEventListener:function(a,s){t.push(s)}};this.abort=function(){r.aborted=!0,t.forEach(function(a){return a()})}},B1=e.unstable_scheduleCallback,U1=e.unstable_NormalPriority,Ut={$$typeof:M,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function vu(){return{controller:new z1,data:new Map,refCount:0}}function Al(t){t.refCount--,t.refCount===0&&B1(U1,function(){t.controller.abort()})}var Ol=null,xu=0,_a=0,ka=null;function j1(t,r){if(Ol===null){var a=Ol=[];xu=0,_a=_d(),ka={status:"pending",value:void 0,then:function(s){a.push(s)}}}return xu++,r.then(gp,gp),r}function gp(){if(--xu===0&&Ol!==null){ka!==null&&(ka.status="fulfilled");var t=Ol;Ol=null,_a=0,ka=null;for(var r=0;r<t.length;r++)(0,t[r])()}}function H1(t,r){var a=[],s={status:"pending",value:null,reason:null,then:function(d){a.push(d)}};return t.then(function(){s.status="fulfilled",s.value=r;for(var d=0;d<a.length;d++)(0,a[d])(r)},function(d){for(s.status="rejected",s.reason=d,d=0;d<a.length;d++)(0,a[d])(void 0)}),s}var bp=j.S;j.S=function(t,r){eg=wt(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&j1(t,r),bp!==null&&bp(t,r)};var Hi=R(null);function Eu(){var t=Hi.current;return t!==null?t:pt.pooledCache}function co(t,r){r===null?w(Hi,Hi.current):w(Hi,r.pool)}function yp(){var t=Eu();return t===null?null:{parent:Ut._currentValue,pool:t}}var wa=Error(l(460)),Su=Error(l(474)),uo=Error(l(542)),fo={then:function(){}};function vp(t){return t=t.status,t==="fulfilled"||t==="rejected"}function xp(t,r,a){switch(a=t[a],a===void 0?t.push(r):a!==r&&(r.then(ge,ge),r=a),r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,Sp(t),t;default:if(typeof r.status=="string")r.then(ge,ge);else{if(t=pt,t!==null&&100<t.shellSuspendCounter)throw Error(l(482));t=r,t.status="pending",t.then(function(s){if(r.status==="pending"){var d=r;d.status="fulfilled",d.value=s}},function(s){if(r.status==="pending"){var d=r;d.status="rejected",d.reason=s}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,Sp(t),t}throw Fi=r,wa}}function Pi(t){try{var r=t._init;return r(t._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(Fi=a,wa):a}}var Fi=null;function Ep(){if(Fi===null)throw Error(l(459));var t=Fi;return Fi=null,t}function Sp(t){if(t===wa||t===uo)throw Error(l(483))}var Na=null,Ml=0;function ho(t){var r=Ml;return Ml+=1,Na===null&&(Na=[]),xp(Na,t,r)}function Rl(t,r){r=r.props.ref,t.ref=r!==void 0?r:null}function po(t,r){throw r.$$typeof===E?Error(l(525)):(t=Object.prototype.toString.call(r),Error(l(31,t==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":t)))}function _p(t){function r(G,H){if(t){var V=G.deletions;V===null?(G.deletions=[H],G.flags|=16):V.push(H)}}function a(G,H){if(!t)return null;for(;H!==null;)r(G,H),H=H.sibling;return null}function s(G){for(var H=new Map;G!==null;)G.key!==null?H.set(G.key,G):H.set(G.index,G),G=G.sibling;return H}function d(G,H){return G=wr(G,H),G.index=0,G.sibling=null,G}function m(G,H,V){return G.index=V,t?(V=G.alternate,V!==null?(V=V.index,V<H?(G.flags|=67108866,H):V):(G.flags|=67108866,H)):(G.flags|=1048576,H)}function x(G){return t&&G.alternate===null&&(G.flags|=67108866),G}function k(G,H,V,ae){return H===null||H.tag!==6?(H=uu(V,G.mode,ae),H.return=G,H):(H=d(H,V),H.return=G,H)}function I(G,H,V,ae){var Te=V.type;return Te===N?ne(G,H,V.props.children,ae,V.key):H!==null&&(H.elementType===Te||typeof Te=="object"&&Te!==null&&Te.$$typeof===re&&Pi(Te)===H.type)?(H=d(H,V.props),Rl(H,V),H.return=G,H):(H=ao(V.type,V.key,V.props,null,G.mode,ae),Rl(H,V),H.return=G,H)}function Y(G,H,V,ae){return H===null||H.tag!==4||H.stateNode.containerInfo!==V.containerInfo||H.stateNode.implementation!==V.implementation?(H=du(V,G.mode,ae),H.return=G,H):(H=d(H,V.children||[]),H.return=G,H)}function ne(G,H,V,ae,Te){return H===null||H.tag!==7?(H=zi(V,G.mode,ae,Te),H.return=G,H):(H=d(H,V),H.return=G,H)}function le(G,H,V){if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return H=uu(""+H,G.mode,V),H.return=G,H;if(typeof H=="object"&&H!==null){switch(H.$$typeof){case v:return V=ao(H.type,H.key,H.props,null,G.mode,V),Rl(V,H),V.return=G,V;case _:return H=du(H,G.mode,V),H.return=G,H;case re:return H=Pi(H),le(G,H,V)}if($(H)||ee(H))return H=zi(H,G.mode,V,null),H.return=G,H;if(typeof H.then=="function")return le(G,ho(H),V);if(H.$$typeof===M)return le(G,oo(G,H),V);po(G,H)}return null}function Z(G,H,V,ae){var Te=H!==null?H.key:null;if(typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint")return Te!==null?null:k(G,H,""+V,ae);if(typeof V=="object"&&V!==null){switch(V.$$typeof){case v:return V.key===Te?I(G,H,V,ae):null;case _:return V.key===Te?Y(G,H,V,ae):null;case re:return V=Pi(V),Z(G,H,V,ae)}if($(V)||ee(V))return Te!==null?null:ne(G,H,V,ae,null);if(typeof V.then=="function")return Z(G,H,ho(V),ae);if(V.$$typeof===M)return Z(G,H,oo(G,V),ae);po(G,V)}return null}function W(G,H,V,ae,Te){if(typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint")return G=G.get(V)||null,k(H,G,""+ae,Te);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case v:return G=G.get(ae.key===null?V:ae.key)||null,I(H,G,ae,Te);case _:return G=G.get(ae.key===null?V:ae.key)||null,Y(H,G,ae,Te);case re:return ae=Pi(ae),W(G,H,V,ae,Te)}if($(ae)||ee(ae))return G=G.get(V)||null,ne(H,G,ae,Te,null);if(typeof ae.then=="function")return W(G,H,V,ho(ae),Te);if(ae.$$typeof===M)return W(G,H,V,oo(H,ae),Te);po(H,ae)}return null}function Se(G,H,V,ae){for(var Te=null,We=null,we=H,Ue=H=0,Ve=null;we!==null&&Ue<V.length;Ue++){we.index>Ue?(Ve=we,we=null):Ve=we.sibling;var Je=Z(G,we,V[Ue],ae);if(Je===null){we===null&&(we=Ve);break}t&&we&&Je.alternate===null&&r(G,we),H=m(Je,H,Ue),We===null?Te=Je:We.sibling=Je,We=Je,we=Ve}if(Ue===V.length)return a(G,we),Xe&&Nr(G,Ue),Te;if(we===null){for(;Ue<V.length;Ue++)we=le(G,V[Ue],ae),we!==null&&(H=m(we,H,Ue),We===null?Te=we:We.sibling=we,We=we);return Xe&&Nr(G,Ue),Te}for(we=s(we);Ue<V.length;Ue++)Ve=W(we,G,Ue,V[Ue],ae),Ve!==null&&(t&&Ve.alternate!==null&&we.delete(Ve.key===null?Ue:Ve.key),H=m(Ve,H,Ue),We===null?Te=Ve:We.sibling=Ve,We=Ve);return t&&we.forEach(function(yi){return r(G,yi)}),Xe&&Nr(G,Ue),Te}function Oe(G,H,V,ae){if(V==null)throw Error(l(151));for(var Te=null,We=null,we=H,Ue=H=0,Ve=null,Je=V.next();we!==null&&!Je.done;Ue++,Je=V.next()){we.index>Ue?(Ve=we,we=null):Ve=we.sibling;var yi=Z(G,we,Je.value,ae);if(yi===null){we===null&&(we=Ve);break}t&&we&&yi.alternate===null&&r(G,we),H=m(yi,H,Ue),We===null?Te=yi:We.sibling=yi,We=yi,we=Ve}if(Je.done)return a(G,we),Xe&&Nr(G,Ue),Te;if(we===null){for(;!Je.done;Ue++,Je=V.next())Je=le(G,Je.value,ae),Je!==null&&(H=m(Je,H,Ue),We===null?Te=Je:We.sibling=Je,We=Je);return Xe&&Nr(G,Ue),Te}for(we=s(we);!Je.done;Ue++,Je=V.next())Je=W(we,G,Ue,Je.value,ae),Je!==null&&(t&&Je.alternate!==null&&we.delete(Je.key===null?Ue:Je.key),H=m(Je,H,Ue),We===null?Te=Je:We.sibling=Je,We=Je);return t&&we.forEach(function(QE){return r(G,QE)}),Xe&&Nr(G,Ue),Te}function dt(G,H,V,ae){if(typeof V=="object"&&V!==null&&V.type===N&&V.key===null&&(V=V.props.children),typeof V=="object"&&V!==null){switch(V.$$typeof){case v:e:{for(var Te=V.key;H!==null;){if(H.key===Te){if(Te=V.type,Te===N){if(H.tag===7){a(G,H.sibling),ae=d(H,V.props.children),ae.return=G,G=ae;break e}}else if(H.elementType===Te||typeof Te=="object"&&Te!==null&&Te.$$typeof===re&&Pi(Te)===H.type){a(G,H.sibling),ae=d(H,V.props),Rl(ae,V),ae.return=G,G=ae;break e}a(G,H);break}else r(G,H);H=H.sibling}V.type===N?(ae=zi(V.props.children,G.mode,ae,V.key),ae.return=G,G=ae):(ae=ao(V.type,V.key,V.props,null,G.mode,ae),Rl(ae,V),ae.return=G,G=ae)}return x(G);case _:e:{for(Te=V.key;H!==null;){if(H.key===Te)if(H.tag===4&&H.stateNode.containerInfo===V.containerInfo&&H.stateNode.implementation===V.implementation){a(G,H.sibling),ae=d(H,V.children||[]),ae.return=G,G=ae;break e}else{a(G,H);break}else r(G,H);H=H.sibling}ae=du(V,G.mode,ae),ae.return=G,G=ae}return x(G);case re:return V=Pi(V),dt(G,H,V,ae)}if($(V))return Se(G,H,V,ae);if(ee(V)){if(Te=ee(V),typeof Te!="function")throw Error(l(150));return V=Te.call(V),Oe(G,H,V,ae)}if(typeof V.then=="function")return dt(G,H,ho(V),ae);if(V.$$typeof===M)return dt(G,H,oo(G,V),ae);po(G,V)}return typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint"?(V=""+V,H!==null&&H.tag===6?(a(G,H.sibling),ae=d(H,V),ae.return=G,G=ae):(a(G,H),ae=uu(V,G.mode,ae),ae.return=G,G=ae),x(G)):a(G,H)}return function(G,H,V,ae){try{Ml=0;var Te=dt(G,H,V,ae);return Na=null,Te}catch(we){if(we===wa||we===uo)throw we;var We=Cn(29,we,null,G.mode);return We.lanes=ae,We.return=G,We}finally{}}}var Gi=_p(!0),kp=_p(!1),ti=!1;function _u(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ku(t,r){t=t.updateQueue,r.updateQueue===t&&(r.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function ni(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function ri(t,r,a){var s=t.updateQueue;if(s===null)return null;if(s=s.shared,(et&2)!==0){var d=s.pending;return d===null?r.next=r:(r.next=d.next,d.next=r),s.pending=r,r=io(t),sp(t,null,a),r}return ro(t,s,r,a),io(t)}function Dl(t,r,a){if(r=r.updateQueue,r!==null&&(r=r.shared,(a&4194048)!==0)){var s=r.lanes;s&=t.pendingLanes,a|=s,r.lanes=a,Re(t,a)}}function wu(t,r){var a=t.updateQueue,s=t.alternate;if(s!==null&&(s=s.updateQueue,a===s)){var d=null,m=null;if(a=a.firstBaseUpdate,a!==null){do{var x={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};m===null?d=m=x:m=m.next=x,a=a.next}while(a!==null);m===null?d=m=r:m=m.next=r}else d=m=r;a={baseState:s.baseState,firstBaseUpdate:d,lastBaseUpdate:m,shared:s.shared,callbacks:s.callbacks},t.updateQueue=a;return}t=a.lastBaseUpdate,t===null?a.firstBaseUpdate=r:t.next=r,a.lastBaseUpdate=r}var Nu=!1;function Ll(){if(Nu){var t=ka;if(t!==null)throw t}}function Il(t,r,a,s){Nu=!1;var d=t.updateQueue;ti=!1;var m=d.firstBaseUpdate,x=d.lastBaseUpdate,k=d.shared.pending;if(k!==null){d.shared.pending=null;var I=k,Y=I.next;I.next=null,x===null?m=Y:x.next=Y,x=I;var ne=t.alternate;ne!==null&&(ne=ne.updateQueue,k=ne.lastBaseUpdate,k!==x&&(k===null?ne.firstBaseUpdate=Y:k.next=Y,ne.lastBaseUpdate=I))}if(m!==null){var le=d.baseState;x=0,ne=Y=I=null,k=m;do{var Z=k.lane&-536870913,W=Z!==k.lane;if(W?(qe&Z)===Z:(s&Z)===Z){Z!==0&&Z===_a&&(Nu=!0),ne!==null&&(ne=ne.next={lane:0,tag:k.tag,payload:k.payload,callback:null,next:null});e:{var Se=t,Oe=k;Z=r;var dt=a;switch(Oe.tag){case 1:if(Se=Oe.payload,typeof Se=="function"){le=Se.call(dt,le,Z);break e}le=Se;break e;case 3:Se.flags=Se.flags&-65537|128;case 0:if(Se=Oe.payload,Z=typeof Se=="function"?Se.call(dt,le,Z):Se,Z==null)break e;le=y({},le,Z);break e;case 2:ti=!0}}Z=k.callback,Z!==null&&(t.flags|=64,W&&(t.flags|=8192),W=d.callbacks,W===null?d.callbacks=[Z]:W.push(Z))}else W={lane:Z,tag:k.tag,payload:k.payload,callback:k.callback,next:null},ne===null?(Y=ne=W,I=le):ne=ne.next=W,x|=Z;if(k=k.next,k===null){if(k=d.shared.pending,k===null)break;W=k,k=W.next,W.next=null,d.lastBaseUpdate=W,d.shared.pending=null}}while(!0);ne===null&&(I=le),d.baseState=I,d.firstBaseUpdate=Y,d.lastBaseUpdate=ne,m===null&&(d.shared.lanes=0),oi|=x,t.lanes=x,t.memoizedState=le}}function wp(t,r){if(typeof t!="function")throw Error(l(191,t));t.call(r)}function Np(t,r){var a=t.callbacks;if(a!==null)for(t.callbacks=null,t=0;t<a.length;t++)wp(a[t],r)}var Ta=R(null),mo=R(0);function Tp(t,r){t=Br,w(mo,t),w(Ta,r),Br=t|r.baseLanes}function Tu(){w(mo,Br),w(Ta,Ta.current)}function Cu(){Br=mo.current,q(Ta),q(mo)}var An=R(null),Gn=null;function ii(t){var r=t.alternate;w(Lt,Lt.current&1),w(An,t),Gn===null&&(r===null||Ta.current!==null||r.memoizedState!==null)&&(Gn=t)}function Au(t){w(Lt,Lt.current),w(An,t),Gn===null&&(Gn=t)}function Cp(t){t.tag===22?(w(Lt,Lt.current),w(An,t),Gn===null&&(Gn=t)):ai()}function ai(){w(Lt,Lt.current),w(An,An.current)}function On(t){q(An),Gn===t&&(Gn=null),q(Lt)}var Lt=R(0);function go(t){for(var r=t;r!==null;){if(r.tag===13){var a=r.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Id(a)||zd(a)))return r}else if(r.tag===19&&(r.memoizedProps.revealOrder==="forwards"||r.memoizedProps.revealOrder==="backwards"||r.memoizedProps.revealOrder==="unstable_legacy-backwards"||r.memoizedProps.revealOrder==="together")){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var Ar=0,Be=null,ct=null,jt=null,bo=!1,Ca=!1,$i=!1,yo=0,zl=0,Aa=null,P1=0;function At(){throw Error(l(321))}function Ou(t,r){if(r===null)return!1;for(var a=0;a<r.length&&a<t.length;a++)if(!Tn(t[a],r[a]))return!1;return!0}function Mu(t,r,a,s,d,m){return Ar=m,Be=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,j.H=t===null||t.memoizedState===null?dm:qu,$i=!1,m=a(s,d),$i=!1,Ca&&(m=Op(r,a,s,d)),Ap(t),m}function Ap(t){j.H=jl;var r=ct!==null&&ct.next!==null;if(Ar=0,jt=ct=Be=null,bo=!1,zl=0,Aa=null,r)throw Error(l(300));t===null||Ht||(t=t.dependencies,t!==null&&so(t)&&(Ht=!0))}function Op(t,r,a,s){Be=t;var d=0;do{if(Ca&&(Aa=null),zl=0,Ca=!1,25<=d)throw Error(l(301));if(d+=1,jt=ct=null,t.updateQueue!=null){var m=t.updateQueue;m.lastEffect=null,m.events=null,m.stores=null,m.memoCache!=null&&(m.memoCache.index=0)}j.H=fm,m=r(a,s)}while(Ca);return m}function F1(){var t=j.H,r=t.useState()[0];return r=typeof r.then=="function"?Bl(r):r,t=t.useState()[0],(ct!==null?ct.memoizedState:null)!==t&&(Be.flags|=1024),r}function Ru(){var t=yo!==0;return yo=0,t}function Du(t,r,a){r.updateQueue=t.updateQueue,r.flags&=-2053,t.lanes&=~a}function Lu(t){if(bo){for(t=t.memoizedState;t!==null;){var r=t.queue;r!==null&&(r.pending=null),t=t.next}bo=!1}Ar=0,jt=ct=Be=null,Ca=!1,zl=yo=0,Aa=null}function sn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return jt===null?Be.memoizedState=jt=t:jt=jt.next=t,jt}function It(){if(ct===null){var t=Be.alternate;t=t!==null?t.memoizedState:null}else t=ct.next;var r=jt===null?Be.memoizedState:jt.next;if(r!==null)jt=r,ct=t;else{if(t===null)throw Be.alternate===null?Error(l(467)):Error(l(310));ct=t,t={memoizedState:ct.memoizedState,baseState:ct.baseState,baseQueue:ct.baseQueue,queue:ct.queue,next:null},jt===null?Be.memoizedState=jt=t:jt=jt.next=t}return jt}function vo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Bl(t){var r=zl;return zl+=1,Aa===null&&(Aa=[]),t=xp(Aa,t,r),r=Be,(jt===null?r.memoizedState:jt.next)===null&&(r=r.alternate,j.H=r===null||r.memoizedState===null?dm:qu),t}function xo(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Bl(t);if(t.$$typeof===M)return Yt(t)}throw Error(l(438,String(t)))}function Iu(t){var r=null,a=Be.updateQueue;if(a!==null&&(r=a.memoCache),r==null){var s=Be.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(r={data:s.data.map(function(d){return d.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),a===null&&(a=vo(),Be.updateQueue=a),a.memoCache=r,a=r.data[r.index],a===void 0)for(a=r.data[r.index]=Array(t),s=0;s<t;s++)a[s]=B;return r.index++,a}function Or(t,r){return typeof r=="function"?r(t):r}function Eo(t){var r=It();return zu(r,ct,t)}function zu(t,r,a){var s=t.queue;if(s===null)throw Error(l(311));s.lastRenderedReducer=a;var d=t.baseQueue,m=s.pending;if(m!==null){if(d!==null){var x=d.next;d.next=m.next,m.next=x}r.baseQueue=d=m,s.pending=null}if(m=t.baseState,d===null)t.memoizedState=m;else{r=d.next;var k=x=null,I=null,Y=r,ne=!1;do{var le=Y.lane&-536870913;if(le!==Y.lane?(qe&le)===le:(Ar&le)===le){var Z=Y.revertLane;if(Z===0)I!==null&&(I=I.next={lane:0,revertLane:0,gesture:null,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null}),le===_a&&(ne=!0);else if((Ar&Z)===Z){Y=Y.next,Z===_a&&(ne=!0);continue}else le={lane:0,revertLane:Y.revertLane,gesture:null,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},I===null?(k=I=le,x=m):I=I.next=le,Be.lanes|=Z,oi|=Z;le=Y.action,$i&&a(m,le),m=Y.hasEagerState?Y.eagerState:a(m,le)}else Z={lane:le,revertLane:Y.revertLane,gesture:Y.gesture,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},I===null?(k=I=Z,x=m):I=I.next=Z,Be.lanes|=le,oi|=le;Y=Y.next}while(Y!==null&&Y!==r);if(I===null?x=m:I.next=k,!Tn(m,t.memoizedState)&&(Ht=!0,ne&&(a=ka,a!==null)))throw a;t.memoizedState=m,t.baseState=x,t.baseQueue=I,s.lastRenderedState=m}return d===null&&(s.lanes=0),[t.memoizedState,s.dispatch]}function Bu(t){var r=It(),a=r.queue;if(a===null)throw Error(l(311));a.lastRenderedReducer=t;var s=a.dispatch,d=a.pending,m=r.memoizedState;if(d!==null){a.pending=null;var x=d=d.next;do m=t(m,x.action),x=x.next;while(x!==d);Tn(m,r.memoizedState)||(Ht=!0),r.memoizedState=m,r.baseQueue===null&&(r.baseState=m),a.lastRenderedState=m}return[m,s]}function Mp(t,r,a){var s=Be,d=It(),m=Xe;if(m){if(a===void 0)throw Error(l(407));a=a()}else a=r();var x=!Tn((ct||d).memoizedState,a);if(x&&(d.memoizedState=a,Ht=!0),d=d.queue,Hu(Lp.bind(null,s,d,t),[t]),d.getSnapshot!==r||x||jt!==null&&jt.memoizedState.tag&1){if(s.flags|=2048,Oa(9,{destroy:void 0},Dp.bind(null,s,d,a,r),null),pt===null)throw Error(l(349));m||(Ar&127)!==0||Rp(s,r,a)}return a}function Rp(t,r,a){t.flags|=16384,t={getSnapshot:r,value:a},r=Be.updateQueue,r===null?(r=vo(),Be.updateQueue=r,r.stores=[t]):(a=r.stores,a===null?r.stores=[t]:a.push(t))}function Dp(t,r,a,s){r.value=a,r.getSnapshot=s,Ip(r)&&zp(t)}function Lp(t,r,a){return a(function(){Ip(r)&&zp(t)})}function Ip(t){var r=t.getSnapshot;t=t.value;try{var a=r();return!Tn(t,a)}catch{return!0}}function zp(t){var r=Ii(t,2);r!==null&&En(r,t,2)}function Uu(t){var r=sn();if(typeof t=="function"){var a=t;if(t=a(),$i){Qt(!0);try{a()}finally{Qt(!1)}}}return r.memoizedState=r.baseState=t,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Or,lastRenderedState:t},r}function Bp(t,r,a,s){return t.baseState=a,zu(t,ct,typeof s=="function"?s:Or)}function G1(t,r,a,s,d){if(ko(t))throw Error(l(485));if(t=r.action,t!==null){var m={payload:d,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(x){m.listeners.push(x)}};j.T!==null?a(!0):m.isTransition=!1,s(m),a=r.pending,a===null?(m.next=r.pending=m,Up(r,m)):(m.next=a.next,r.pending=a.next=m)}}function Up(t,r){var a=r.action,s=r.payload,d=t.state;if(r.isTransition){var m=j.T,x={};j.T=x;try{var k=a(d,s),I=j.S;I!==null&&I(x,k),jp(t,r,k)}catch(Y){ju(t,r,Y)}finally{m!==null&&x.types!==null&&(m.types=x.types),j.T=m}}else try{m=a(d,s),jp(t,r,m)}catch(Y){ju(t,r,Y)}}function jp(t,r,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(s){Hp(t,r,s)},function(s){return ju(t,r,s)}):Hp(t,r,a)}function Hp(t,r,a){r.status="fulfilled",r.value=a,Pp(r),t.state=a,r=t.pending,r!==null&&(a=r.next,a===r?t.pending=null:(a=a.next,r.next=a,Up(t,a)))}function ju(t,r,a){var s=t.pending;if(t.pending=null,s!==null){s=s.next;do r.status="rejected",r.reason=a,Pp(r),r=r.next;while(r!==s)}t.action=null}function Pp(t){t=t.listeners;for(var r=0;r<t.length;r++)(0,t[r])()}function Fp(t,r){return r}function Gp(t,r){if(Xe){var a=pt.formState;if(a!==null){e:{var s=Be;if(Xe){if(xt){t:{for(var d=xt,m=Fn;d.nodeType!==8;){if(!m){d=null;break t}if(d=$n(d.nextSibling),d===null){d=null;break t}}m=d.data,d=m==="F!"||m==="F"?d:null}if(d){xt=$n(d.nextSibling),s=d.data==="F!";break e}}Jr(s)}s=!1}s&&(r=a[0])}}return a=sn(),a.memoizedState=a.baseState=r,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fp,lastRenderedState:r},a.queue=s,a=om.bind(null,Be,s),s.dispatch=a,s=Uu(!1),m=Ku.bind(null,Be,!1,s.queue),s=sn(),d={state:r,dispatch:null,action:t,pending:null},s.queue=d,a=G1.bind(null,Be,d,m,a),d.dispatch=a,s.memoizedState=t,[r,a,!1]}function $p(t){var r=It();return Kp(r,ct,t)}function Kp(t,r,a){if(r=zu(t,r,Fp)[0],t=Eo(Or)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var s=Bl(r)}catch(x){throw x===wa?uo:x}else s=r;r=It();var d=r.queue,m=d.dispatch;return a!==r.memoizedState&&(Be.flags|=2048,Oa(9,{destroy:void 0},$1.bind(null,d,a),null)),[s,m,t]}function $1(t,r){t.action=r}function qp(t){var r=It(),a=ct;if(a!==null)return Kp(r,a,t);It(),r=r.memoizedState,a=It();var s=a.queue.dispatch;return a.memoizedState=t,[r,s,!1]}function Oa(t,r,a,s){return t={tag:t,create:a,deps:s,inst:r,next:null},r=Be.updateQueue,r===null&&(r=vo(),Be.updateQueue=r),a=r.lastEffect,a===null?r.lastEffect=t.next=t:(s=a.next,a.next=t,t.next=s,r.lastEffect=t),t}function Vp(){return It().memoizedState}function So(t,r,a,s){var d=sn();Be.flags|=t,d.memoizedState=Oa(1|r,{destroy:void 0},a,s===void 0?null:s)}function _o(t,r,a,s){var d=It();s=s===void 0?null:s;var m=d.memoizedState.inst;ct!==null&&s!==null&&Ou(s,ct.memoizedState.deps)?d.memoizedState=Oa(r,m,a,s):(Be.flags|=t,d.memoizedState=Oa(1|r,m,a,s))}function Yp(t,r){So(8390656,8,t,r)}function Hu(t,r){_o(2048,8,t,r)}function K1(t){Be.flags|=4;var r=Be.updateQueue;if(r===null)r=vo(),Be.updateQueue=r,r.events=[t];else{var a=r.events;a===null?r.events=[t]:a.push(t)}}function Xp(t){var r=It().memoizedState;return K1({ref:r,nextImpl:t}),function(){if((et&2)!==0)throw Error(l(440));return r.impl.apply(void 0,arguments)}}function Zp(t,r){return _o(4,2,t,r)}function Qp(t,r){return _o(4,4,t,r)}function Wp(t,r){if(typeof r=="function"){t=t();var a=r(t);return function(){typeof a=="function"?a():r(null)}}if(r!=null)return t=t(),r.current=t,function(){r.current=null}}function Jp(t,r,a){a=a!=null?a.concat([t]):null,_o(4,4,Wp.bind(null,r,t),a)}function Pu(){}function em(t,r){var a=It();r=r===void 0?null:r;var s=a.memoizedState;return r!==null&&Ou(r,s[1])?s[0]:(a.memoizedState=[t,r],t)}function tm(t,r){var a=It();r=r===void 0?null:r;var s=a.memoizedState;if(r!==null&&Ou(r,s[1]))return s[0];if(s=t(),$i){Qt(!0);try{t()}finally{Qt(!1)}}return a.memoizedState=[s,r],s}function Fu(t,r,a){return a===void 0||(Ar&1073741824)!==0&&(qe&261930)===0?t.memoizedState=r:(t.memoizedState=a,t=ng(),Be.lanes|=t,oi|=t,a)}function nm(t,r,a,s){return Tn(a,r)?a:Ta.current!==null?(t=Fu(t,a,s),Tn(t,r)||(Ht=!0),t):(Ar&42)===0||(Ar&1073741824)!==0&&(qe&261930)===0?(Ht=!0,t.memoizedState=a):(t=ng(),Be.lanes|=t,oi|=t,r)}function rm(t,r,a,s,d){var m=O.p;O.p=m!==0&&8>m?m:8;var x=j.T,k={};j.T=k,Ku(t,!1,r,a);try{var I=d(),Y=j.S;if(Y!==null&&Y(k,I),I!==null&&typeof I=="object"&&typeof I.then=="function"){var ne=H1(I,s);Ul(t,r,ne,Dn(t))}else Ul(t,r,s,Dn(t))}catch(le){Ul(t,r,{then:function(){},status:"rejected",reason:le},Dn())}finally{O.p=m,x!==null&&k.types!==null&&(x.types=k.types),j.T=x}}function q1(){}function Gu(t,r,a,s){if(t.tag!==5)throw Error(l(476));var d=im(t).queue;rm(t,d,r,P,a===null?q1:function(){return am(t),a(s)})}function im(t){var r=t.memoizedState;if(r!==null)return r;r={memoizedState:P,baseState:P,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Or,lastRenderedState:P},next:null};var a={};return r.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Or,lastRenderedState:a},next:null},t.memoizedState=r,t=t.alternate,t!==null&&(t.memoizedState=r),r}function am(t){var r=im(t);r.next===null&&(r=t.alternate.memoizedState),Ul(t,r.next.queue,{},Dn())}function $u(){return Yt(ts)}function lm(){return It().memoizedState}function sm(){return It().memoizedState}function V1(t){for(var r=t.return;r!==null;){switch(r.tag){case 24:case 3:var a=Dn();t=ni(a);var s=ri(r,t,a);s!==null&&(En(s,r,a),Dl(s,r,a)),r={cache:vu()},t.payload=r;return}r=r.return}}function Y1(t,r,a){var s=Dn();a={lane:s,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},ko(t)?cm(r,a):(a=ou(t,r,a,s),a!==null&&(En(a,t,s),um(a,r,s)))}function om(t,r,a){var s=Dn();Ul(t,r,a,s)}function Ul(t,r,a,s){var d={lane:s,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(ko(t))cm(r,d);else{var m=t.alternate;if(t.lanes===0&&(m===null||m.lanes===0)&&(m=r.lastRenderedReducer,m!==null))try{var x=r.lastRenderedState,k=m(x,a);if(d.hasEagerState=!0,d.eagerState=k,Tn(k,x))return ro(t,r,d,0),pt===null&&no(),!1}catch{}finally{}if(a=ou(t,r,d,s),a!==null)return En(a,t,s),um(a,r,s),!0}return!1}function Ku(t,r,a,s){if(s={lane:2,revertLane:_d(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},ko(t)){if(r)throw Error(l(479))}else r=ou(t,a,s,2),r!==null&&En(r,t,2)}function ko(t){var r=t.alternate;return t===Be||r!==null&&r===Be}function cm(t,r){Ca=bo=!0;var a=t.pending;a===null?r.next=r:(r.next=a.next,a.next=r),t.pending=r}function um(t,r,a){if((a&4194048)!==0){var s=r.lanes;s&=t.pendingLanes,a|=s,r.lanes=a,Re(t,a)}}var jl={readContext:Yt,use:xo,useCallback:At,useContext:At,useEffect:At,useImperativeHandle:At,useLayoutEffect:At,useInsertionEffect:At,useMemo:At,useReducer:At,useRef:At,useState:At,useDebugValue:At,useDeferredValue:At,useTransition:At,useSyncExternalStore:At,useId:At,useHostTransitionStatus:At,useFormState:At,useActionState:At,useOptimistic:At,useMemoCache:At,useCacheRefresh:At};jl.useEffectEvent=At;var dm={readContext:Yt,use:xo,useCallback:function(t,r){return sn().memoizedState=[t,r===void 0?null:r],t},useContext:Yt,useEffect:Yp,useImperativeHandle:function(t,r,a){a=a!=null?a.concat([t]):null,So(4194308,4,Wp.bind(null,r,t),a)},useLayoutEffect:function(t,r){return So(4194308,4,t,r)},useInsertionEffect:function(t,r){So(4,2,t,r)},useMemo:function(t,r){var a=sn();r=r===void 0?null:r;var s=t();if($i){Qt(!0);try{t()}finally{Qt(!1)}}return a.memoizedState=[s,r],s},useReducer:function(t,r,a){var s=sn();if(a!==void 0){var d=a(r);if($i){Qt(!0);try{a(r)}finally{Qt(!1)}}}else d=r;return s.memoizedState=s.baseState=d,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:d},s.queue=t,t=t.dispatch=Y1.bind(null,Be,t),[s.memoizedState,t]},useRef:function(t){var r=sn();return t={current:t},r.memoizedState=t},useState:function(t){t=Uu(t);var r=t.queue,a=om.bind(null,Be,r);return r.dispatch=a,[t.memoizedState,a]},useDebugValue:Pu,useDeferredValue:function(t,r){var a=sn();return Fu(a,t,r)},useTransition:function(){var t=Uu(!1);return t=rm.bind(null,Be,t.queue,!0,!1),sn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,r,a){var s=Be,d=sn();if(Xe){if(a===void 0)throw Error(l(407));a=a()}else{if(a=r(),pt===null)throw Error(l(349));(qe&127)!==0||Rp(s,r,a)}d.memoizedState=a;var m={value:a,getSnapshot:r};return d.queue=m,Yp(Lp.bind(null,s,m,t),[t]),s.flags|=2048,Oa(9,{destroy:void 0},Dp.bind(null,s,m,a,r),null),a},useId:function(){var t=sn(),r=pt.identifierPrefix;if(Xe){var a=or,s=sr;a=(s&~(1<<32-rt(s)-1)).toString(32)+a,r="_"+r+"R_"+a,a=yo++,0<a&&(r+="H"+a.toString(32)),r+="_"}else a=P1++,r="_"+r+"r_"+a.toString(32)+"_";return t.memoizedState=r},useHostTransitionStatus:$u,useFormState:Gp,useActionState:Gp,useOptimistic:function(t){var r=sn();r.memoizedState=r.baseState=t;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=a,r=Ku.bind(null,Be,!0,a),a.dispatch=r,[t,r]},useMemoCache:Iu,useCacheRefresh:function(){return sn().memoizedState=V1.bind(null,Be)},useEffectEvent:function(t){var r=sn(),a={impl:t};return r.memoizedState=a,function(){if((et&2)!==0)throw Error(l(440));return a.impl.apply(void 0,arguments)}}},qu={readContext:Yt,use:xo,useCallback:em,useContext:Yt,useEffect:Hu,useImperativeHandle:Jp,useInsertionEffect:Zp,useLayoutEffect:Qp,useMemo:tm,useReducer:Eo,useRef:Vp,useState:function(){return Eo(Or)},useDebugValue:Pu,useDeferredValue:function(t,r){var a=It();return nm(a,ct.memoizedState,t,r)},useTransition:function(){var t=Eo(Or)[0],r=It().memoizedState;return[typeof t=="boolean"?t:Bl(t),r]},useSyncExternalStore:Mp,useId:lm,useHostTransitionStatus:$u,useFormState:$p,useActionState:$p,useOptimistic:function(t,r){var a=It();return Bp(a,ct,t,r)},useMemoCache:Iu,useCacheRefresh:sm};qu.useEffectEvent=Xp;var fm={readContext:Yt,use:xo,useCallback:em,useContext:Yt,useEffect:Hu,useImperativeHandle:Jp,useInsertionEffect:Zp,useLayoutEffect:Qp,useMemo:tm,useReducer:Bu,useRef:Vp,useState:function(){return Bu(Or)},useDebugValue:Pu,useDeferredValue:function(t,r){var a=It();return ct===null?Fu(a,t,r):nm(a,ct.memoizedState,t,r)},useTransition:function(){var t=Bu(Or)[0],r=It().memoizedState;return[typeof t=="boolean"?t:Bl(t),r]},useSyncExternalStore:Mp,useId:lm,useHostTransitionStatus:$u,useFormState:qp,useActionState:qp,useOptimistic:function(t,r){var a=It();return ct!==null?Bp(a,ct,t,r):(a.baseState=t,[t,a.queue.dispatch])},useMemoCache:Iu,useCacheRefresh:sm};fm.useEffectEvent=Xp;function Vu(t,r,a,s){r=t.memoizedState,a=a(s,r),a=a==null?r:y({},r,a),t.memoizedState=a,t.lanes===0&&(t.updateQueue.baseState=a)}var Yu={enqueueSetState:function(t,r,a){t=t._reactInternals;var s=Dn(),d=ni(s);d.payload=r,a!=null&&(d.callback=a),r=ri(t,d,s),r!==null&&(En(r,t,s),Dl(r,t,s))},enqueueReplaceState:function(t,r,a){t=t._reactInternals;var s=Dn(),d=ni(s);d.tag=1,d.payload=r,a!=null&&(d.callback=a),r=ri(t,d,s),r!==null&&(En(r,t,s),Dl(r,t,s))},enqueueForceUpdate:function(t,r){t=t._reactInternals;var a=Dn(),s=ni(a);s.tag=2,r!=null&&(s.callback=r),r=ri(t,s,a),r!==null&&(En(r,t,a),Dl(r,t,a))}};function hm(t,r,a,s,d,m,x){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(s,m,x):r.prototype&&r.prototype.isPureReactComponent?!wl(a,s)||!wl(d,m):!0}function pm(t,r,a,s){t=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(a,s),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(a,s),r.state!==t&&Yu.enqueueReplaceState(r,r.state,null)}function Ki(t,r){var a=r;if("ref"in r){a={};for(var s in r)s!=="ref"&&(a[s]=r[s])}if(t=t.defaultProps){a===r&&(a=y({},a));for(var d in t)a[d]===void 0&&(a[d]=t[d])}return a}function mm(t){to(t)}function gm(t){console.error(t)}function bm(t){to(t)}function wo(t,r){try{var a=t.onUncaughtError;a(r.value,{componentStack:r.stack})}catch(s){setTimeout(function(){throw s})}}function ym(t,r,a){try{var s=t.onCaughtError;s(a.value,{componentStack:a.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(d){setTimeout(function(){throw d})}}function Xu(t,r,a){return a=ni(a),a.tag=3,a.payload={element:null},a.callback=function(){wo(t,r)},a}function vm(t){return t=ni(t),t.tag=3,t}function xm(t,r,a,s){var d=a.type.getDerivedStateFromError;if(typeof d=="function"){var m=s.value;t.payload=function(){return d(m)},t.callback=function(){ym(r,a,s)}}var x=a.stateNode;x!==null&&typeof x.componentDidCatch=="function"&&(t.callback=function(){ym(r,a,s),typeof d!="function"&&(ci===null?ci=new Set([this]):ci.add(this));var k=s.stack;this.componentDidCatch(s.value,{componentStack:k!==null?k:""})})}function X1(t,r,a,s,d){if(a.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(r=a.alternate,r!==null&&Sa(r,a,d,!0),a=An.current,a!==null){switch(a.tag){case 31:case 13:return Gn===null?Bo():a.alternate===null&&Ot===0&&(Ot=3),a.flags&=-257,a.flags|=65536,a.lanes=d,s===fo?a.flags|=16384:(r=a.updateQueue,r===null?a.updateQueue=new Set([s]):r.add(s),xd(t,s,d)),!1;case 22:return a.flags|=65536,s===fo?a.flags|=16384:(r=a.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([s])},a.updateQueue=r):(a=r.retryQueue,a===null?r.retryQueue=new Set([s]):a.add(s)),xd(t,s,d)),!1}throw Error(l(435,a.tag))}return xd(t,s,d),Bo(),!1}if(Xe)return r=An.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=d,s!==pu&&(t=Error(l(422),{cause:s}),Cl(jn(t,a)))):(s!==pu&&(r=Error(l(423),{cause:s}),Cl(jn(r,a))),t=t.current.alternate,t.flags|=65536,d&=-d,t.lanes|=d,s=jn(s,a),d=Xu(t.stateNode,s,d),wu(t,d),Ot!==4&&(Ot=2)),!1;var m=Error(l(520),{cause:s});if(m=jn(m,a),Vl===null?Vl=[m]:Vl.push(m),Ot!==4&&(Ot=2),r===null)return!0;s=jn(s,a),a=r;do{switch(a.tag){case 3:return a.flags|=65536,t=d&-d,a.lanes|=t,t=Xu(a.stateNode,s,t),wu(a,t),!1;case 1:if(r=a.type,m=a.stateNode,(a.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(ci===null||!ci.has(m))))return a.flags|=65536,d&=-d,a.lanes|=d,d=vm(d),xm(d,t,a,s),wu(a,d),!1}a=a.return}while(a!==null);return!1}var Zu=Error(l(461)),Ht=!1;function Xt(t,r,a,s){r.child=t===null?kp(r,null,a,s):Gi(r,t.child,a,s)}function Em(t,r,a,s,d){a=a.render;var m=r.ref;if("ref"in s){var x={};for(var k in s)k!=="ref"&&(x[k]=s[k])}else x=s;return ji(r),s=Mu(t,r,a,x,m,d),k=Ru(),t!==null&&!Ht?(Du(t,r,d),Mr(t,r,d)):(Xe&&k&&fu(r),r.flags|=1,Xt(t,r,s,d),r.child)}function Sm(t,r,a,s,d){if(t===null){var m=a.type;return typeof m=="function"&&!cu(m)&&m.defaultProps===void 0&&a.compare===null?(r.tag=15,r.type=m,_m(t,r,m,s,d)):(t=ao(a.type,null,s,r,r.mode,d),t.ref=r.ref,t.return=r,r.child=t)}if(m=t.child,!id(t,d)){var x=m.memoizedProps;if(a=a.compare,a=a!==null?a:wl,a(x,s)&&t.ref===r.ref)return Mr(t,r,d)}return r.flags|=1,t=wr(m,s),t.ref=r.ref,t.return=r,r.child=t}function _m(t,r,a,s,d){if(t!==null){var m=t.memoizedProps;if(wl(m,s)&&t.ref===r.ref)if(Ht=!1,r.pendingProps=s=m,id(t,d))(t.flags&131072)!==0&&(Ht=!0);else return r.lanes=t.lanes,Mr(t,r,d)}return Qu(t,r,a,s,d)}function km(t,r,a,s){var d=s.children,m=t!==null?t.memoizedState:null;if(t===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.mode==="hidden"){if((r.flags&128)!==0){if(m=m!==null?m.baseLanes|a:a,t!==null){for(s=r.child=t.child,d=0;s!==null;)d=d|s.lanes|s.childLanes,s=s.sibling;s=d&~m}else s=0,r.child=null;return wm(t,r,m,a,s)}if((a&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},t!==null&&co(r,m!==null?m.cachePool:null),m!==null?Tp(r,m):Tu(),Cp(r);else return s=r.lanes=536870912,wm(t,r,m!==null?m.baseLanes|a:a,a,s)}else m!==null?(co(r,m.cachePool),Tp(r,m),ai(),r.memoizedState=null):(t!==null&&co(r,null),Tu(),ai());return Xt(t,r,d,a),r.child}function Hl(t,r){return t!==null&&t.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function wm(t,r,a,s,d){var m=Eu();return m=m===null?null:{parent:Ut._currentValue,pool:m},r.memoizedState={baseLanes:a,cachePool:m},t!==null&&co(r,null),Tu(),Cp(r),t!==null&&Sa(t,r,s,!0),r.childLanes=d,null}function No(t,r){return r=Co({mode:r.mode,children:r.children},t.mode),r.ref=t.ref,t.child=r,r.return=t,r}function Nm(t,r,a){return Gi(r,t.child,null,a),t=No(r,r.pendingProps),t.flags|=2,On(r),r.memoizedState=null,t}function Z1(t,r,a){var s=r.pendingProps,d=(r.flags&128)!==0;if(r.flags&=-129,t===null){if(Xe){if(s.mode==="hidden")return t=No(r,s),r.lanes=536870912,Hl(null,t);if(Au(r),(t=xt)?(t=Ug(t,Fn),t=t!==null&&t.data==="&"?t:null,t!==null&&(r.memoizedState={dehydrated:t,treeContext:Qr!==null?{id:sr,overflow:or}:null,retryLane:536870912,hydrationErrors:null},a=cp(t),a.return=r,r.child=a,Vt=r,xt=null)):t=null,t===null)throw Jr(r);return r.lanes=536870912,null}return No(r,s)}var m=t.memoizedState;if(m!==null){var x=m.dehydrated;if(Au(r),d)if(r.flags&256)r.flags&=-257,r=Nm(t,r,a);else if(r.memoizedState!==null)r.child=t.child,r.flags|=128,r=null;else throw Error(l(558));else if(Ht||Sa(t,r,a,!1),d=(a&t.childLanes)!==0,Ht||d){if(s=pt,s!==null&&(x=Mt(s,a),x!==0&&x!==m.retryLane))throw m.retryLane=x,Ii(t,x),En(s,t,x),Zu;Bo(),r=Nm(t,r,a)}else t=m.treeContext,xt=$n(x.nextSibling),Vt=r,Xe=!0,Wr=null,Fn=!1,t!==null&&fp(r,t),r=No(r,s),r.flags|=4096;return r}return t=wr(t.child,{mode:s.mode,children:s.children}),t.ref=r.ref,r.child=t,t.return=r,t}function To(t,r){var a=r.ref;if(a===null)t!==null&&t.ref!==null&&(r.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(l(284));(t===null||t.ref!==a)&&(r.flags|=4194816)}}function Qu(t,r,a,s,d){return ji(r),a=Mu(t,r,a,s,void 0,d),s=Ru(),t!==null&&!Ht?(Du(t,r,d),Mr(t,r,d)):(Xe&&s&&fu(r),r.flags|=1,Xt(t,r,a,d),r.child)}function Tm(t,r,a,s,d,m){return ji(r),r.updateQueue=null,a=Op(r,s,a,d),Ap(t),s=Ru(),t!==null&&!Ht?(Du(t,r,m),Mr(t,r,m)):(Xe&&s&&fu(r),r.flags|=1,Xt(t,r,a,m),r.child)}function Cm(t,r,a,s,d){if(ji(r),r.stateNode===null){var m=ya,x=a.contextType;typeof x=="object"&&x!==null&&(m=Yt(x)),m=new a(s,m),r.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,m.updater=Yu,r.stateNode=m,m._reactInternals=r,m=r.stateNode,m.props=s,m.state=r.memoizedState,m.refs={},_u(r),x=a.contextType,m.context=typeof x=="object"&&x!==null?Yt(x):ya,m.state=r.memoizedState,x=a.getDerivedStateFromProps,typeof x=="function"&&(Vu(r,a,x,s),m.state=r.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof m.getSnapshotBeforeUpdate=="function"||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(x=m.state,typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount(),x!==m.state&&Yu.enqueueReplaceState(m,m.state,null),Il(r,s,m,d),Ll(),m.state=r.memoizedState),typeof m.componentDidMount=="function"&&(r.flags|=4194308),s=!0}else if(t===null){m=r.stateNode;var k=r.memoizedProps,I=Ki(a,k);m.props=I;var Y=m.context,ne=a.contextType;x=ya,typeof ne=="object"&&ne!==null&&(x=Yt(ne));var le=a.getDerivedStateFromProps;ne=typeof le=="function"||typeof m.getSnapshotBeforeUpdate=="function",k=r.pendingProps!==k,ne||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(k||Y!==x)&&pm(r,m,s,x),ti=!1;var Z=r.memoizedState;m.state=Z,Il(r,s,m,d),Ll(),Y=r.memoizedState,k||Z!==Y||ti?(typeof le=="function"&&(Vu(r,a,le,s),Y=r.memoizedState),(I=ti||hm(r,a,I,s,Z,Y,x))?(ne||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount()),typeof m.componentDidMount=="function"&&(r.flags|=4194308)):(typeof m.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=s,r.memoizedState=Y),m.props=s,m.state=Y,m.context=x,s=I):(typeof m.componentDidMount=="function"&&(r.flags|=4194308),s=!1)}else{m=r.stateNode,ku(t,r),x=r.memoizedProps,ne=Ki(a,x),m.props=ne,le=r.pendingProps,Z=m.context,Y=a.contextType,I=ya,typeof Y=="object"&&Y!==null&&(I=Yt(Y)),k=a.getDerivedStateFromProps,(Y=typeof k=="function"||typeof m.getSnapshotBeforeUpdate=="function")||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(x!==le||Z!==I)&&pm(r,m,s,I),ti=!1,Z=r.memoizedState,m.state=Z,Il(r,s,m,d),Ll();var W=r.memoizedState;x!==le||Z!==W||ti||t!==null&&t.dependencies!==null&&so(t.dependencies)?(typeof k=="function"&&(Vu(r,a,k,s),W=r.memoizedState),(ne=ti||hm(r,a,ne,s,Z,W,I)||t!==null&&t.dependencies!==null&&so(t.dependencies))?(Y||typeof m.UNSAFE_componentWillUpdate!="function"&&typeof m.componentWillUpdate!="function"||(typeof m.componentWillUpdate=="function"&&m.componentWillUpdate(s,W,I),typeof m.UNSAFE_componentWillUpdate=="function"&&m.UNSAFE_componentWillUpdate(s,W,I)),typeof m.componentDidUpdate=="function"&&(r.flags|=4),typeof m.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof m.componentDidUpdate!="function"||x===t.memoizedProps&&Z===t.memoizedState||(r.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||x===t.memoizedProps&&Z===t.memoizedState||(r.flags|=1024),r.memoizedProps=s,r.memoizedState=W),m.props=s,m.state=W,m.context=I,s=ne):(typeof m.componentDidUpdate!="function"||x===t.memoizedProps&&Z===t.memoizedState||(r.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||x===t.memoizedProps&&Z===t.memoizedState||(r.flags|=1024),s=!1)}return m=s,To(t,r),s=(r.flags&128)!==0,m||s?(m=r.stateNode,a=s&&typeof a.getDerivedStateFromError!="function"?null:m.render(),r.flags|=1,t!==null&&s?(r.child=Gi(r,t.child,null,d),r.child=Gi(r,null,a,d)):Xt(t,r,a,d),r.memoizedState=m.state,t=r.child):t=Mr(t,r,d),t}function Am(t,r,a,s){return Bi(),r.flags|=256,Xt(t,r,a,s),r.child}var Wu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ju(t){return{baseLanes:t,cachePool:yp()}}function ed(t,r,a){return t=t!==null?t.childLanes&~a:0,r&&(t|=Rn),t}function Om(t,r,a){var s=r.pendingProps,d=!1,m=(r.flags&128)!==0,x;if((x=m)||(x=t!==null&&t.memoizedState===null?!1:(Lt.current&2)!==0),x&&(d=!0,r.flags&=-129),x=(r.flags&32)!==0,r.flags&=-33,t===null){if(Xe){if(d?ii(r):ai(),(t=xt)?(t=Ug(t,Fn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(r.memoizedState={dehydrated:t,treeContext:Qr!==null?{id:sr,overflow:or}:null,retryLane:536870912,hydrationErrors:null},a=cp(t),a.return=r,r.child=a,Vt=r,xt=null)):t=null,t===null)throw Jr(r);return zd(t)?r.lanes=32:r.lanes=536870912,null}var k=s.children;return s=s.fallback,d?(ai(),d=r.mode,k=Co({mode:"hidden",children:k},d),s=zi(s,d,a,null),k.return=r,s.return=r,k.sibling=s,r.child=k,s=r.child,s.memoizedState=Ju(a),s.childLanes=ed(t,x,a),r.memoizedState=Wu,Hl(null,s)):(ii(r),td(r,k))}var I=t.memoizedState;if(I!==null&&(k=I.dehydrated,k!==null)){if(m)r.flags&256?(ii(r),r.flags&=-257,r=nd(t,r,a)):r.memoizedState!==null?(ai(),r.child=t.child,r.flags|=128,r=null):(ai(),k=s.fallback,d=r.mode,s=Co({mode:"visible",children:s.children},d),k=zi(k,d,a,null),k.flags|=2,s.return=r,k.return=r,s.sibling=k,r.child=s,Gi(r,t.child,null,a),s=r.child,s.memoizedState=Ju(a),s.childLanes=ed(t,x,a),r.memoizedState=Wu,r=Hl(null,s));else if(ii(r),zd(k)){if(x=k.nextSibling&&k.nextSibling.dataset,x)var Y=x.dgst;x=Y,s=Error(l(419)),s.stack="",s.digest=x,Cl({value:s,source:null,stack:null}),r=nd(t,r,a)}else if(Ht||Sa(t,r,a,!1),x=(a&t.childLanes)!==0,Ht||x){if(x=pt,x!==null&&(s=Mt(x,a),s!==0&&s!==I.retryLane))throw I.retryLane=s,Ii(t,s),En(x,t,s),Zu;Id(k)||Bo(),r=nd(t,r,a)}else Id(k)?(r.flags|=192,r.child=t.child,r=null):(t=I.treeContext,xt=$n(k.nextSibling),Vt=r,Xe=!0,Wr=null,Fn=!1,t!==null&&fp(r,t),r=td(r,s.children),r.flags|=4096);return r}return d?(ai(),k=s.fallback,d=r.mode,I=t.child,Y=I.sibling,s=wr(I,{mode:"hidden",children:s.children}),s.subtreeFlags=I.subtreeFlags&65011712,Y!==null?k=wr(Y,k):(k=zi(k,d,a,null),k.flags|=2),k.return=r,s.return=r,s.sibling=k,r.child=s,Hl(null,s),s=r.child,k=t.child.memoizedState,k===null?k=Ju(a):(d=k.cachePool,d!==null?(I=Ut._currentValue,d=d.parent!==I?{parent:I,pool:I}:d):d=yp(),k={baseLanes:k.baseLanes|a,cachePool:d}),s.memoizedState=k,s.childLanes=ed(t,x,a),r.memoizedState=Wu,Hl(t.child,s)):(ii(r),a=t.child,t=a.sibling,a=wr(a,{mode:"visible",children:s.children}),a.return=r,a.sibling=null,t!==null&&(x=r.deletions,x===null?(r.deletions=[t],r.flags|=16):x.push(t)),r.child=a,r.memoizedState=null,a)}function td(t,r){return r=Co({mode:"visible",children:r},t.mode),r.return=t,t.child=r}function Co(t,r){return t=Cn(22,t,null,r),t.lanes=0,t}function nd(t,r,a){return Gi(r,t.child,null,a),t=td(r,r.pendingProps.children),t.flags|=2,r.memoizedState=null,t}function Mm(t,r,a){t.lanes|=r;var s=t.alternate;s!==null&&(s.lanes|=r),bu(t.return,r,a)}function rd(t,r,a,s,d,m){var x=t.memoizedState;x===null?t.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:s,tail:a,tailMode:d,treeForkCount:m}:(x.isBackwards=r,x.rendering=null,x.renderingStartTime=0,x.last=s,x.tail=a,x.tailMode=d,x.treeForkCount=m)}function Rm(t,r,a){var s=r.pendingProps,d=s.revealOrder,m=s.tail;s=s.children;var x=Lt.current,k=(x&2)!==0;if(k?(x=x&1|2,r.flags|=128):x&=1,w(Lt,x),Xt(t,r,s,a),s=Xe?Tl:0,!k&&t!==null&&(t.flags&128)!==0)e:for(t=r.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Mm(t,a,r);else if(t.tag===19)Mm(t,a,r);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===r)break e;for(;t.sibling===null;){if(t.return===null||t.return===r)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(d){case"forwards":for(a=r.child,d=null;a!==null;)t=a.alternate,t!==null&&go(t)===null&&(d=a),a=a.sibling;a=d,a===null?(d=r.child,r.child=null):(d=a.sibling,a.sibling=null),rd(r,!1,d,a,m,s);break;case"backwards":case"unstable_legacy-backwards":for(a=null,d=r.child,r.child=null;d!==null;){if(t=d.alternate,t!==null&&go(t)===null){r.child=d;break}t=d.sibling,d.sibling=a,a=d,d=t}rd(r,!0,a,null,m,s);break;case"together":rd(r,!1,null,null,void 0,s);break;default:r.memoizedState=null}return r.child}function Mr(t,r,a){if(t!==null&&(r.dependencies=t.dependencies),oi|=r.lanes,(a&r.childLanes)===0)if(t!==null){if(Sa(t,r,a,!1),(a&r.childLanes)===0)return null}else return null;if(t!==null&&r.child!==t.child)throw Error(l(153));if(r.child!==null){for(t=r.child,a=wr(t,t.pendingProps),r.child=a,a.return=r;t.sibling!==null;)t=t.sibling,a=a.sibling=wr(t,t.pendingProps),a.return=r;a.sibling=null}return r.child}function id(t,r){return(t.lanes&r)!==0?!0:(t=t.dependencies,!!(t!==null&&so(t)))}function Q1(t,r,a){switch(r.tag){case 3:xe(r,r.stateNode.containerInfo),ei(r,Ut,t.memoizedState.cache),Bi();break;case 27:case 5:De(r);break;case 4:xe(r,r.stateNode.containerInfo);break;case 10:ei(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,Au(r),null;break;case 13:var s=r.memoizedState;if(s!==null)return s.dehydrated!==null?(ii(r),r.flags|=128,null):(a&r.child.childLanes)!==0?Om(t,r,a):(ii(r),t=Mr(t,r,a),t!==null?t.sibling:null);ii(r);break;case 19:var d=(t.flags&128)!==0;if(s=(a&r.childLanes)!==0,s||(Sa(t,r,a,!1),s=(a&r.childLanes)!==0),d){if(s)return Rm(t,r,a);r.flags|=128}if(d=r.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),w(Lt,Lt.current),s)break;return null;case 22:return r.lanes=0,km(t,r,a,r.pendingProps);case 24:ei(r,Ut,t.memoizedState.cache)}return Mr(t,r,a)}function Dm(t,r,a){if(t!==null)if(t.memoizedProps!==r.pendingProps)Ht=!0;else{if(!id(t,a)&&(r.flags&128)===0)return Ht=!1,Q1(t,r,a);Ht=(t.flags&131072)!==0}else Ht=!1,Xe&&(r.flags&1048576)!==0&&dp(r,Tl,r.index);switch(r.lanes=0,r.tag){case 16:e:{var s=r.pendingProps;if(t=Pi(r.elementType),r.type=t,typeof t=="function")cu(t)?(s=Ki(t,s),r.tag=1,r=Cm(null,r,t,s,a)):(r.tag=0,r=Qu(null,r,t,s,a));else{if(t!=null){var d=t.$$typeof;if(d===A){r.tag=11,r=Em(null,r,t,s,a);break e}else if(d===X){r.tag=14,r=Sm(null,r,t,s,a);break e}}throw r=se(t)||t,Error(l(306,r,""))}}return r;case 0:return Qu(t,r,r.type,r.pendingProps,a);case 1:return s=r.type,d=Ki(s,r.pendingProps),Cm(t,r,s,d,a);case 3:e:{if(xe(r,r.stateNode.containerInfo),t===null)throw Error(l(387));s=r.pendingProps;var m=r.memoizedState;d=m.element,ku(t,r),Il(r,s,null,a);var x=r.memoizedState;if(s=x.cache,ei(r,Ut,s),s!==m.cache&&yu(r,[Ut],a,!0),Ll(),s=x.element,m.isDehydrated)if(m={element:s,isDehydrated:!1,cache:x.cache},r.updateQueue.baseState=m,r.memoizedState=m,r.flags&256){r=Am(t,r,s,a);break e}else if(s!==d){d=jn(Error(l(424)),r),Cl(d),r=Am(t,r,s,a);break e}else{switch(t=r.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(xt=$n(t.firstChild),Vt=r,Xe=!0,Wr=null,Fn=!0,a=kp(r,null,s,a),r.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if(Bi(),s===d){r=Mr(t,r,a);break e}Xt(t,r,s,a)}r=r.child}return r;case 26:return To(t,r),t===null?(a=$g(r.type,null,r.pendingProps,null))?r.memoizedState=a:Xe||(a=r.type,t=r.pendingProps,s=$o(K.current).createElement(a),s[Rt]=r,s[Wt]=t,Zt(s,a,t),zt(s),r.stateNode=s):r.memoizedState=$g(r.type,t.memoizedProps,r.pendingProps,t.memoizedState),null;case 27:return De(r),t===null&&Xe&&(s=r.stateNode=Pg(r.type,r.pendingProps,K.current),Vt=r,Fn=!0,d=xt,hi(r.type)?(Bd=d,xt=$n(s.firstChild)):xt=d),Xt(t,r,r.pendingProps.children,a),To(t,r),t===null&&(r.flags|=4194304),r.child;case 5:return t===null&&Xe&&((d=s=xt)&&(s=TE(s,r.type,r.pendingProps,Fn),s!==null?(r.stateNode=s,Vt=r,xt=$n(s.firstChild),Fn=!1,d=!0):d=!1),d||Jr(r)),De(r),d=r.type,m=r.pendingProps,x=t!==null?t.memoizedProps:null,s=m.children,Rd(d,m)?s=null:x!==null&&Rd(d,x)&&(r.flags|=32),r.memoizedState!==null&&(d=Mu(t,r,F1,null,null,a),ts._currentValue=d),To(t,r),Xt(t,r,s,a),r.child;case 6:return t===null&&Xe&&((t=a=xt)&&(a=CE(a,r.pendingProps,Fn),a!==null?(r.stateNode=a,Vt=r,xt=null,t=!0):t=!1),t||Jr(r)),null;case 13:return Om(t,r,a);case 4:return xe(r,r.stateNode.containerInfo),s=r.pendingProps,t===null?r.child=Gi(r,null,s,a):Xt(t,r,s,a),r.child;case 11:return Em(t,r,r.type,r.pendingProps,a);case 7:return Xt(t,r,r.pendingProps,a),r.child;case 8:return Xt(t,r,r.pendingProps.children,a),r.child;case 12:return Xt(t,r,r.pendingProps.children,a),r.child;case 10:return s=r.pendingProps,ei(r,r.type,s.value),Xt(t,r,s.children,a),r.child;case 9:return d=r.type._context,s=r.pendingProps.children,ji(r),d=Yt(d),s=s(d),r.flags|=1,Xt(t,r,s,a),r.child;case 14:return Sm(t,r,r.type,r.pendingProps,a);case 15:return _m(t,r,r.type,r.pendingProps,a);case 19:return Rm(t,r,a);case 31:return Z1(t,r,a);case 22:return km(t,r,a,r.pendingProps);case 24:return ji(r),s=Yt(Ut),t===null?(d=Eu(),d===null&&(d=pt,m=vu(),d.pooledCache=m,m.refCount++,m!==null&&(d.pooledCacheLanes|=a),d=m),r.memoizedState={parent:s,cache:d},_u(r),ei(r,Ut,d)):((t.lanes&a)!==0&&(ku(t,r),Il(r,null,null,a),Ll()),d=t.memoizedState,m=r.memoizedState,d.parent!==s?(d={parent:s,cache:s},r.memoizedState=d,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=d),ei(r,Ut,s)):(s=m.cache,ei(r,Ut,s),s!==d.cache&&yu(r,[Ut],a,!0))),Xt(t,r,r.pendingProps.children,a),r.child;case 29:throw r.pendingProps}throw Error(l(156,r.tag))}function Rr(t){t.flags|=4}function ad(t,r,a,s,d){if((r=(t.mode&32)!==0)&&(r=!1),r){if(t.flags|=16777216,(d&335544128)===d)if(t.stateNode.complete)t.flags|=8192;else if(lg())t.flags|=8192;else throw Fi=fo,Su}else t.flags&=-16777217}function Lm(t,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!Xg(r))if(lg())t.flags|=8192;else throw Fi=fo,Su}function Ao(t,r){r!==null&&(t.flags|=4),t.flags&16384&&(r=t.tag!==22?Le():536870912,t.lanes|=r,La|=r)}function Pl(t,r){if(!Xe)switch(t.tailMode){case"hidden":r=t.tail;for(var a=null;r!==null;)r.alternate!==null&&(a=r),r=r.sibling;a===null?t.tail=null:a.sibling=null;break;case"collapsed":a=t.tail;for(var s=null;a!==null;)a.alternate!==null&&(s=a),a=a.sibling;s===null?r||t.tail===null?t.tail=null:t.tail.sibling=null:s.sibling=null}}function Et(t){var r=t.alternate!==null&&t.alternate.child===t.child,a=0,s=0;if(r)for(var d=t.child;d!==null;)a|=d.lanes|d.childLanes,s|=d.subtreeFlags&65011712,s|=d.flags&65011712,d.return=t,d=d.sibling;else for(d=t.child;d!==null;)a|=d.lanes|d.childLanes,s|=d.subtreeFlags,s|=d.flags,d.return=t,d=d.sibling;return t.subtreeFlags|=s,t.childLanes=a,r}function W1(t,r,a){var s=r.pendingProps;switch(hu(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Et(r),null;case 1:return Et(r),null;case 3:return a=r.stateNode,s=null,t!==null&&(s=t.memoizedState.cache),r.memoizedState.cache!==s&&(r.flags|=2048),Cr(Ut),ve(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(t===null||t.child===null)&&(Ea(r)?Rr(r):t===null||t.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,mu())),Et(r),null;case 26:var d=r.type,m=r.memoizedState;return t===null?(Rr(r),m!==null?(Et(r),Lm(r,m)):(Et(r),ad(r,d,null,s,a))):m?m!==t.memoizedState?(Rr(r),Et(r),Lm(r,m)):(Et(r),r.flags&=-16777217):(t=t.memoizedProps,t!==s&&Rr(r),Et(r),ad(r,d,t,s,a)),null;case 27:if(St(r),a=K.current,d=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==s&&Rr(r);else{if(!s){if(r.stateNode===null)throw Error(l(166));return Et(r),null}t=ue.current,Ea(r)?hp(r):(t=Pg(d,s,a),r.stateNode=t,Rr(r))}return Et(r),null;case 5:if(St(r),d=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==s&&Rr(r);else{if(!s){if(r.stateNode===null)throw Error(l(166));return Et(r),null}if(m=ue.current,Ea(r))hp(r);else{var x=$o(K.current);switch(m){case 1:m=x.createElementNS("http://www.w3.org/2000/svg",d);break;case 2:m=x.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;default:switch(d){case"svg":m=x.createElementNS("http://www.w3.org/2000/svg",d);break;case"math":m=x.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;case"script":m=x.createElement("div"),m.innerHTML="<script><\/script>",m=m.removeChild(m.firstChild);break;case"select":m=typeof s.is=="string"?x.createElement("select",{is:s.is}):x.createElement("select"),s.multiple?m.multiple=!0:s.size&&(m.size=s.size);break;default:m=typeof s.is=="string"?x.createElement(d,{is:s.is}):x.createElement(d)}}m[Rt]=r,m[Wt]=s;e:for(x=r.child;x!==null;){if(x.tag===5||x.tag===6)m.appendChild(x.stateNode);else if(x.tag!==4&&x.tag!==27&&x.child!==null){x.child.return=x,x=x.child;continue}if(x===r)break e;for(;x.sibling===null;){if(x.return===null||x.return===r)break e;x=x.return}x.sibling.return=x.return,x=x.sibling}r.stateNode=m;e:switch(Zt(m,d,s),d){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&Rr(r)}}return Et(r),ad(r,r.type,t===null?null:t.memoizedProps,r.pendingProps,a),null;case 6:if(t&&r.stateNode!=null)t.memoizedProps!==s&&Rr(r);else{if(typeof s!="string"&&r.stateNode===null)throw Error(l(166));if(t=K.current,Ea(r)){if(t=r.stateNode,a=r.memoizedProps,s=null,d=Vt,d!==null)switch(d.tag){case 27:case 5:s=d.memoizedProps}t[Rt]=r,t=!!(t.nodeValue===a||s!==null&&s.suppressHydrationWarning===!0||Og(t.nodeValue,a)),t||Jr(r,!0)}else t=$o(t).createTextNode(s),t[Rt]=r,r.stateNode=t}return Et(r),null;case 31:if(a=r.memoizedState,t===null||t.memoizedState!==null){if(s=Ea(r),a!==null){if(t===null){if(!s)throw Error(l(318));if(t=r.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(l(557));t[Rt]=r}else Bi(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Et(r),t=!1}else a=mu(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=a),t=!0;if(!t)return r.flags&256?(On(r),r):(On(r),null);if((r.flags&128)!==0)throw Error(l(558))}return Et(r),null;case 13:if(s=r.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(d=Ea(r),s!==null&&s.dehydrated!==null){if(t===null){if(!d)throw Error(l(318));if(d=r.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(l(317));d[Rt]=r}else Bi(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Et(r),d=!1}else d=mu(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=d),d=!0;if(!d)return r.flags&256?(On(r),r):(On(r),null)}return On(r),(r.flags&128)!==0?(r.lanes=a,r):(a=s!==null,t=t!==null&&t.memoizedState!==null,a&&(s=r.child,d=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(d=s.alternate.memoizedState.cachePool.pool),m=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(m=s.memoizedState.cachePool.pool),m!==d&&(s.flags|=2048)),a!==t&&a&&(r.child.flags|=8192),Ao(r,r.updateQueue),Et(r),null);case 4:return ve(),t===null&&Td(r.stateNode.containerInfo),Et(r),null;case 10:return Cr(r.type),Et(r),null;case 19:if(q(Lt),s=r.memoizedState,s===null)return Et(r),null;if(d=(r.flags&128)!==0,m=s.rendering,m===null)if(d)Pl(s,!1);else{if(Ot!==0||t!==null&&(t.flags&128)!==0)for(t=r.child;t!==null;){if(m=go(t),m!==null){for(r.flags|=128,Pl(s,!1),t=m.updateQueue,r.updateQueue=t,Ao(r,t),r.subtreeFlags=0,t=a,a=r.child;a!==null;)op(a,t),a=a.sibling;return w(Lt,Lt.current&1|2),Xe&&Nr(r,s.treeForkCount),r.child}t=t.sibling}s.tail!==null&&wt()>Lo&&(r.flags|=128,d=!0,Pl(s,!1),r.lanes=4194304)}else{if(!d)if(t=go(m),t!==null){if(r.flags|=128,d=!0,t=t.updateQueue,r.updateQueue=t,Ao(r,t),Pl(s,!0),s.tail===null&&s.tailMode==="hidden"&&!m.alternate&&!Xe)return Et(r),null}else 2*wt()-s.renderingStartTime>Lo&&a!==536870912&&(r.flags|=128,d=!0,Pl(s,!1),r.lanes=4194304);s.isBackwards?(m.sibling=r.child,r.child=m):(t=s.last,t!==null?t.sibling=m:r.child=m,s.last=m)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=wt(),t.sibling=null,a=Lt.current,w(Lt,d?a&1|2:a&1),Xe&&Nr(r,s.treeForkCount),t):(Et(r),null);case 22:case 23:return On(r),Cu(),s=r.memoizedState!==null,t!==null?t.memoizedState!==null!==s&&(r.flags|=8192):s&&(r.flags|=8192),s?(a&536870912)!==0&&(r.flags&128)===0&&(Et(r),r.subtreeFlags&6&&(r.flags|=8192)):Et(r),a=r.updateQueue,a!==null&&Ao(r,a.retryQueue),a=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),s=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(s=r.memoizedState.cachePool.pool),s!==a&&(r.flags|=2048),t!==null&&q(Hi),null;case 24:return a=null,t!==null&&(a=t.memoizedState.cache),r.memoizedState.cache!==a&&(r.flags|=2048),Cr(Ut),Et(r),null;case 25:return null;case 30:return null}throw Error(l(156,r.tag))}function J1(t,r){switch(hu(r),r.tag){case 1:return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 3:return Cr(Ut),ve(),t=r.flags,(t&65536)!==0&&(t&128)===0?(r.flags=t&-65537|128,r):null;case 26:case 27:case 5:return St(r),null;case 31:if(r.memoizedState!==null){if(On(r),r.alternate===null)throw Error(l(340));Bi()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 13:if(On(r),t=r.memoizedState,t!==null&&t.dehydrated!==null){if(r.alternate===null)throw Error(l(340));Bi()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 19:return q(Lt),null;case 4:return ve(),null;case 10:return Cr(r.type),null;case 22:case 23:return On(r),Cu(),t!==null&&q(Hi),t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 24:return Cr(Ut),null;case 25:return null;default:return null}}function Im(t,r){switch(hu(r),r.tag){case 3:Cr(Ut),ve();break;case 26:case 27:case 5:St(r);break;case 4:ve();break;case 31:r.memoizedState!==null&&On(r);break;case 13:On(r);break;case 19:q(Lt);break;case 10:Cr(r.type);break;case 22:case 23:On(r),Cu(),t!==null&&q(Hi);break;case 24:Cr(Ut)}}function Fl(t,r){try{var a=r.updateQueue,s=a!==null?a.lastEffect:null;if(s!==null){var d=s.next;a=d;do{if((a.tag&t)===t){s=void 0;var m=a.create,x=a.inst;s=m(),x.destroy=s}a=a.next}while(a!==d)}}catch(k){st(r,r.return,k)}}function li(t,r,a){try{var s=r.updateQueue,d=s!==null?s.lastEffect:null;if(d!==null){var m=d.next;s=m;do{if((s.tag&t)===t){var x=s.inst,k=x.destroy;if(k!==void 0){x.destroy=void 0,d=r;var I=a,Y=k;try{Y()}catch(ne){st(d,I,ne)}}}s=s.next}while(s!==m)}}catch(ne){st(r,r.return,ne)}}function zm(t){var r=t.updateQueue;if(r!==null){var a=t.stateNode;try{Np(r,a)}catch(s){st(t,t.return,s)}}}function Bm(t,r,a){a.props=Ki(t.type,t.memoizedProps),a.state=t.memoizedState;try{a.componentWillUnmount()}catch(s){st(t,r,s)}}function Gl(t,r){try{var a=t.ref;if(a!==null){switch(t.tag){case 26:case 27:case 5:var s=t.stateNode;break;case 30:s=t.stateNode;break;default:s=t.stateNode}typeof a=="function"?t.refCleanup=a(s):a.current=s}}catch(d){st(t,r,d)}}function cr(t,r){var a=t.ref,s=t.refCleanup;if(a!==null)if(typeof s=="function")try{s()}catch(d){st(t,r,d)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(d){st(t,r,d)}else a.current=null}function Um(t){var r=t.type,a=t.memoizedProps,s=t.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":a.autoFocus&&s.focus();break e;case"img":a.src?s.src=a.src:a.srcSet&&(s.srcset=a.srcSet)}}catch(d){st(t,t.return,d)}}function ld(t,r,a){try{var s=t.stateNode;EE(s,t.type,a,r),s[Wt]=r}catch(d){st(t,t.return,d)}}function jm(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&hi(t.type)||t.tag===4}function sd(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||jm(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&hi(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function od(t,r,a){var s=t.tag;if(s===5||s===6)t=t.stateNode,r?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(t,r):(r=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,r.appendChild(t),a=a._reactRootContainer,a!=null||r.onclick!==null||(r.onclick=ge));else if(s!==4&&(s===27&&hi(t.type)&&(a=t.stateNode,r=null),t=t.child,t!==null))for(od(t,r,a),t=t.sibling;t!==null;)od(t,r,a),t=t.sibling}function Oo(t,r,a){var s=t.tag;if(s===5||s===6)t=t.stateNode,r?a.insertBefore(t,r):a.appendChild(t);else if(s!==4&&(s===27&&hi(t.type)&&(a=t.stateNode),t=t.child,t!==null))for(Oo(t,r,a),t=t.sibling;t!==null;)Oo(t,r,a),t=t.sibling}function Hm(t){var r=t.stateNode,a=t.memoizedProps;try{for(var s=t.type,d=r.attributes;d.length;)r.removeAttributeNode(d[0]);Zt(r,s,a),r[Rt]=t,r[Wt]=a}catch(m){st(t,t.return,m)}}var Dr=!1,Pt=!1,cd=!1,Pm=typeof WeakSet=="function"?WeakSet:Set,$t=null;function eE(t,r){if(t=t.containerInfo,Od=Qo,t=Jh(t),nu(t)){if("selectionStart"in t)var a={start:t.selectionStart,end:t.selectionEnd};else e:{a=(a=t.ownerDocument)&&a.defaultView||window;var s=a.getSelection&&a.getSelection();if(s&&s.rangeCount!==0){a=s.anchorNode;var d=s.anchorOffset,m=s.focusNode;s=s.focusOffset;try{a.nodeType,m.nodeType}catch{a=null;break e}var x=0,k=-1,I=-1,Y=0,ne=0,le=t,Z=null;t:for(;;){for(var W;le!==a||d!==0&&le.nodeType!==3||(k=x+d),le!==m||s!==0&&le.nodeType!==3||(I=x+s),le.nodeType===3&&(x+=le.nodeValue.length),(W=le.firstChild)!==null;)Z=le,le=W;for(;;){if(le===t)break t;if(Z===a&&++Y===d&&(k=x),Z===m&&++ne===s&&(I=x),(W=le.nextSibling)!==null)break;le=Z,Z=le.parentNode}le=W}a=k===-1||I===-1?null:{start:k,end:I}}else a=null}a=a||{start:0,end:0}}else a=null;for(Md={focusedElem:t,selectionRange:a},Qo=!1,$t=r;$t!==null;)if(r=$t,t=r.child,(r.subtreeFlags&1028)!==0&&t!==null)t.return=r,$t=t;else for(;$t!==null;){switch(r=$t,m=r.alternate,t=r.flags,r.tag){case 0:if((t&4)!==0&&(t=r.updateQueue,t=t!==null?t.events:null,t!==null))for(a=0;a<t.length;a++)d=t[a],d.ref.impl=d.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&m!==null){t=void 0,a=r,d=m.memoizedProps,m=m.memoizedState,s=a.stateNode;try{var Se=Ki(a.type,d);t=s.getSnapshotBeforeUpdate(Se,m),s.__reactInternalSnapshotBeforeUpdate=t}catch(Oe){st(a,a.return,Oe)}}break;case 3:if((t&1024)!==0){if(t=r.stateNode.containerInfo,a=t.nodeType,a===9)Ld(t);else if(a===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Ld(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(l(163))}if(t=r.sibling,t!==null){t.return=r.return,$t=t;break}$t=r.return}}function Fm(t,r,a){var s=a.flags;switch(a.tag){case 0:case 11:case 15:Ir(t,a),s&4&&Fl(5,a);break;case 1:if(Ir(t,a),s&4)if(t=a.stateNode,r===null)try{t.componentDidMount()}catch(x){st(a,a.return,x)}else{var d=Ki(a.type,r.memoizedProps);r=r.memoizedState;try{t.componentDidUpdate(d,r,t.__reactInternalSnapshotBeforeUpdate)}catch(x){st(a,a.return,x)}}s&64&&zm(a),s&512&&Gl(a,a.return);break;case 3:if(Ir(t,a),s&64&&(t=a.updateQueue,t!==null)){if(r=null,a.child!==null)switch(a.child.tag){case 27:case 5:r=a.child.stateNode;break;case 1:r=a.child.stateNode}try{Np(t,r)}catch(x){st(a,a.return,x)}}break;case 27:r===null&&s&4&&Hm(a);case 26:case 5:Ir(t,a),r===null&&s&4&&Um(a),s&512&&Gl(a,a.return);break;case 12:Ir(t,a);break;case 31:Ir(t,a),s&4&&Km(t,a);break;case 13:Ir(t,a),s&4&&qm(t,a),s&64&&(t=a.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(a=cE.bind(null,a),AE(t,a))));break;case 22:if(s=a.memoizedState!==null||Dr,!s){r=r!==null&&r.memoizedState!==null||Pt,d=Dr;var m=Pt;Dr=s,(Pt=r)&&!m?zr(t,a,(a.subtreeFlags&8772)!==0):Ir(t,a),Dr=d,Pt=m}break;case 30:break;default:Ir(t,a)}}function Gm(t){var r=t.alternate;r!==null&&(t.alternate=null,Gm(r)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(r=t.stateNode,r!==null&&hl(r)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var kt=null,bn=!1;function Lr(t,r,a){for(a=a.child;a!==null;)$m(t,r,a),a=a.sibling}function $m(t,r,a){if(Ct&&typeof Ct.onCommitFiberUnmount=="function")try{Ct.onCommitFiberUnmount(Kt,a)}catch{}switch(a.tag){case 26:Pt||cr(a,r),Lr(t,r,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Pt||cr(a,r);var s=kt,d=bn;hi(a.type)&&(kt=a.stateNode,bn=!1),Lr(t,r,a),Wl(a.stateNode),kt=s,bn=d;break;case 5:Pt||cr(a,r);case 6:if(s=kt,d=bn,kt=null,Lr(t,r,a),kt=s,bn=d,kt!==null)if(bn)try{(kt.nodeType===9?kt.body:kt.nodeName==="HTML"?kt.ownerDocument.body:kt).removeChild(a.stateNode)}catch(m){st(a,r,m)}else try{kt.removeChild(a.stateNode)}catch(m){st(a,r,m)}break;case 18:kt!==null&&(bn?(t=kt,zg(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,a.stateNode),Fa(t)):zg(kt,a.stateNode));break;case 4:s=kt,d=bn,kt=a.stateNode.containerInfo,bn=!0,Lr(t,r,a),kt=s,bn=d;break;case 0:case 11:case 14:case 15:li(2,a,r),Pt||li(4,a,r),Lr(t,r,a);break;case 1:Pt||(cr(a,r),s=a.stateNode,typeof s.componentWillUnmount=="function"&&Bm(a,r,s)),Lr(t,r,a);break;case 21:Lr(t,r,a);break;case 22:Pt=(s=Pt)||a.memoizedState!==null,Lr(t,r,a),Pt=s;break;default:Lr(t,r,a)}}function Km(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Fa(t)}catch(a){st(r,r.return,a)}}}function qm(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Fa(t)}catch(a){st(r,r.return,a)}}function tE(t){switch(t.tag){case 31:case 13:case 19:var r=t.stateNode;return r===null&&(r=t.stateNode=new Pm),r;case 22:return t=t.stateNode,r=t._retryCache,r===null&&(r=t._retryCache=new Pm),r;default:throw Error(l(435,t.tag))}}function Mo(t,r){var a=tE(t);r.forEach(function(s){if(!a.has(s)){a.add(s);var d=uE.bind(null,t,s);s.then(d,d)}})}function yn(t,r){var a=r.deletions;if(a!==null)for(var s=0;s<a.length;s++){var d=a[s],m=t,x=r,k=x;e:for(;k!==null;){switch(k.tag){case 27:if(hi(k.type)){kt=k.stateNode,bn=!1;break e}break;case 5:kt=k.stateNode,bn=!1;break e;case 3:case 4:kt=k.stateNode.containerInfo,bn=!0;break e}k=k.return}if(kt===null)throw Error(l(160));$m(m,x,d),kt=null,bn=!1,m=d.alternate,m!==null&&(m.return=null),d.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)Vm(r,t),r=r.sibling}var Wn=null;function Vm(t,r){var a=t.alternate,s=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:yn(r,t),vn(t),s&4&&(li(3,t,t.return),Fl(3,t),li(5,t,t.return));break;case 1:yn(r,t),vn(t),s&512&&(Pt||a===null||cr(a,a.return)),s&64&&Dr&&(t=t.updateQueue,t!==null&&(s=t.callbacks,s!==null&&(a=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=a===null?s:a.concat(s))));break;case 26:var d=Wn;if(yn(r,t),vn(t),s&512&&(Pt||a===null||cr(a,a.return)),s&4){var m=a!==null?a.memoizedState:null;if(s=t.memoizedState,a===null)if(s===null)if(t.stateNode===null){e:{s=t.type,a=t.memoizedProps,d=d.ownerDocument||d;t:switch(s){case"title":m=d.getElementsByTagName("title")[0],(!m||m[Ai]||m[Rt]||m.namespaceURI==="http://www.w3.org/2000/svg"||m.hasAttribute("itemprop"))&&(m=d.createElement(s),d.head.insertBefore(m,d.querySelector("head > title"))),Zt(m,s,a),m[Rt]=t,zt(m),s=m;break e;case"link":var x=Vg("link","href",d).get(s+(a.href||""));if(x){for(var k=0;k<x.length;k++)if(m=x[k],m.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&m.getAttribute("rel")===(a.rel==null?null:a.rel)&&m.getAttribute("title")===(a.title==null?null:a.title)&&m.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){x.splice(k,1);break t}}m=d.createElement(s),Zt(m,s,a),d.head.appendChild(m);break;case"meta":if(x=Vg("meta","content",d).get(s+(a.content||""))){for(k=0;k<x.length;k++)if(m=x[k],m.getAttribute("content")===(a.content==null?null:""+a.content)&&m.getAttribute("name")===(a.name==null?null:a.name)&&m.getAttribute("property")===(a.property==null?null:a.property)&&m.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&m.getAttribute("charset")===(a.charSet==null?null:a.charSet)){x.splice(k,1);break t}}m=d.createElement(s),Zt(m,s,a),d.head.appendChild(m);break;default:throw Error(l(468,s))}m[Rt]=t,zt(m),s=m}t.stateNode=s}else Yg(d,t.type,t.stateNode);else t.stateNode=qg(d,s,t.memoizedProps);else m!==s?(m===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):m.count--,s===null?Yg(d,t.type,t.stateNode):qg(d,s,t.memoizedProps)):s===null&&t.stateNode!==null&&ld(t,t.memoizedProps,a.memoizedProps)}break;case 27:yn(r,t),vn(t),s&512&&(Pt||a===null||cr(a,a.return)),a!==null&&s&4&&ld(t,t.memoizedProps,a.memoizedProps);break;case 5:if(yn(r,t),vn(t),s&512&&(Pt||a===null||cr(a,a.return)),t.flags&32){d=t.stateNode;try{Me(d,"")}catch(Se){st(t,t.return,Se)}}s&4&&t.stateNode!=null&&(d=t.memoizedProps,ld(t,d,a!==null?a.memoizedProps:d)),s&1024&&(cd=!0);break;case 6:if(yn(r,t),vn(t),s&4){if(t.stateNode===null)throw Error(l(162));s=t.memoizedProps,a=t.stateNode;try{a.nodeValue=s}catch(Se){st(t,t.return,Se)}}break;case 3:if(Vo=null,d=Wn,Wn=Ko(r.containerInfo),yn(r,t),Wn=d,vn(t),s&4&&a!==null&&a.memoizedState.isDehydrated)try{Fa(r.containerInfo)}catch(Se){st(t,t.return,Se)}cd&&(cd=!1,Ym(t));break;case 4:s=Wn,Wn=Ko(t.stateNode.containerInfo),yn(r,t),vn(t),Wn=s;break;case 12:yn(r,t),vn(t);break;case 31:yn(r,t),vn(t),s&4&&(s=t.updateQueue,s!==null&&(t.updateQueue=null,Mo(t,s)));break;case 13:yn(r,t),vn(t),t.child.flags&8192&&t.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Do=wt()),s&4&&(s=t.updateQueue,s!==null&&(t.updateQueue=null,Mo(t,s)));break;case 22:d=t.memoizedState!==null;var I=a!==null&&a.memoizedState!==null,Y=Dr,ne=Pt;if(Dr=Y||d,Pt=ne||I,yn(r,t),Pt=ne,Dr=Y,vn(t),s&8192)e:for(r=t.stateNode,r._visibility=d?r._visibility&-2:r._visibility|1,d&&(a===null||I||Dr||Pt||qi(t)),a=null,r=t;;){if(r.tag===5||r.tag===26){if(a===null){I=a=r;try{if(m=I.stateNode,d)x=m.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none";else{k=I.stateNode;var le=I.memoizedProps.style,Z=le!=null&&le.hasOwnProperty("display")?le.display:null;k.style.display=Z==null||typeof Z=="boolean"?"":(""+Z).trim()}}catch(Se){st(I,I.return,Se)}}}else if(r.tag===6){if(a===null){I=r;try{I.stateNode.nodeValue=d?"":I.memoizedProps}catch(Se){st(I,I.return,Se)}}}else if(r.tag===18){if(a===null){I=r;try{var W=I.stateNode;d?Bg(W,!0):Bg(I.stateNode,!1)}catch(Se){st(I,I.return,Se)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===t)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break e;for(;r.sibling===null;){if(r.return===null||r.return===t)break e;a===r&&(a=null),r=r.return}a===r&&(a=null),r.sibling.return=r.return,r=r.sibling}s&4&&(s=t.updateQueue,s!==null&&(a=s.retryQueue,a!==null&&(s.retryQueue=null,Mo(t,a))));break;case 19:yn(r,t),vn(t),s&4&&(s=t.updateQueue,s!==null&&(t.updateQueue=null,Mo(t,s)));break;case 30:break;case 21:break;default:yn(r,t),vn(t)}}function vn(t){var r=t.flags;if(r&2){try{for(var a,s=t.return;s!==null;){if(jm(s)){a=s;break}s=s.return}if(a==null)throw Error(l(160));switch(a.tag){case 27:var d=a.stateNode,m=sd(t);Oo(t,m,d);break;case 5:var x=a.stateNode;a.flags&32&&(Me(x,""),a.flags&=-33);var k=sd(t);Oo(t,k,x);break;case 3:case 4:var I=a.stateNode.containerInfo,Y=sd(t);od(t,Y,I);break;default:throw Error(l(161))}}catch(ne){st(t,t.return,ne)}t.flags&=-3}r&4096&&(t.flags&=-4097)}function Ym(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var r=t;Ym(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),t=t.sibling}}function Ir(t,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)Fm(t,r.alternate,r),r=r.sibling}function qi(t){for(t=t.child;t!==null;){var r=t;switch(r.tag){case 0:case 11:case 14:case 15:li(4,r,r.return),qi(r);break;case 1:cr(r,r.return);var a=r.stateNode;typeof a.componentWillUnmount=="function"&&Bm(r,r.return,a),qi(r);break;case 27:Wl(r.stateNode);case 26:case 5:cr(r,r.return),qi(r);break;case 22:r.memoizedState===null&&qi(r);break;case 30:qi(r);break;default:qi(r)}t=t.sibling}}function zr(t,r,a){for(a=a&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var s=r.alternate,d=t,m=r,x=m.flags;switch(m.tag){case 0:case 11:case 15:zr(d,m,a),Fl(4,m);break;case 1:if(zr(d,m,a),s=m,d=s.stateNode,typeof d.componentDidMount=="function")try{d.componentDidMount()}catch(Y){st(s,s.return,Y)}if(s=m,d=s.updateQueue,d!==null){var k=s.stateNode;try{var I=d.shared.hiddenCallbacks;if(I!==null)for(d.shared.hiddenCallbacks=null,d=0;d<I.length;d++)wp(I[d],k)}catch(Y){st(s,s.return,Y)}}a&&x&64&&zm(m),Gl(m,m.return);break;case 27:Hm(m);case 26:case 5:zr(d,m,a),a&&s===null&&x&4&&Um(m),Gl(m,m.return);break;case 12:zr(d,m,a);break;case 31:zr(d,m,a),a&&x&4&&Km(d,m);break;case 13:zr(d,m,a),a&&x&4&&qm(d,m);break;case 22:m.memoizedState===null&&zr(d,m,a),Gl(m,m.return);break;case 30:break;default:zr(d,m,a)}r=r.sibling}}function ud(t,r){var a=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),t=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(t=r.memoizedState.cachePool.pool),t!==a&&(t!=null&&t.refCount++,a!=null&&Al(a))}function dd(t,r){t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&Al(t))}function Jn(t,r,a,s){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Xm(t,r,a,s),r=r.sibling}function Xm(t,r,a,s){var d=r.flags;switch(r.tag){case 0:case 11:case 15:Jn(t,r,a,s),d&2048&&Fl(9,r);break;case 1:Jn(t,r,a,s);break;case 3:Jn(t,r,a,s),d&2048&&(t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&Al(t)));break;case 12:if(d&2048){Jn(t,r,a,s),t=r.stateNode;try{var m=r.memoizedProps,x=m.id,k=m.onPostCommit;typeof k=="function"&&k(x,r.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(I){st(r,r.return,I)}}else Jn(t,r,a,s);break;case 31:Jn(t,r,a,s);break;case 13:Jn(t,r,a,s);break;case 23:break;case 22:m=r.stateNode,x=r.alternate,r.memoizedState!==null?m._visibility&2?Jn(t,r,a,s):$l(t,r):m._visibility&2?Jn(t,r,a,s):(m._visibility|=2,Ma(t,r,a,s,(r.subtreeFlags&10256)!==0||!1)),d&2048&&ud(x,r);break;case 24:Jn(t,r,a,s),d&2048&&dd(r.alternate,r);break;default:Jn(t,r,a,s)}}function Ma(t,r,a,s,d){for(d=d&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var m=t,x=r,k=a,I=s,Y=x.flags;switch(x.tag){case 0:case 11:case 15:Ma(m,x,k,I,d),Fl(8,x);break;case 23:break;case 22:var ne=x.stateNode;x.memoizedState!==null?ne._visibility&2?Ma(m,x,k,I,d):$l(m,x):(ne._visibility|=2,Ma(m,x,k,I,d)),d&&Y&2048&&ud(x.alternate,x);break;case 24:Ma(m,x,k,I,d),d&&Y&2048&&dd(x.alternate,x);break;default:Ma(m,x,k,I,d)}r=r.sibling}}function $l(t,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var a=t,s=r,d=s.flags;switch(s.tag){case 22:$l(a,s),d&2048&&ud(s.alternate,s);break;case 24:$l(a,s),d&2048&&dd(s.alternate,s);break;default:$l(a,s)}r=r.sibling}}var Kl=8192;function Ra(t,r,a){if(t.subtreeFlags&Kl)for(t=t.child;t!==null;)Zm(t,r,a),t=t.sibling}function Zm(t,r,a){switch(t.tag){case 26:Ra(t,r,a),t.flags&Kl&&t.memoizedState!==null&&PE(a,Wn,t.memoizedState,t.memoizedProps);break;case 5:Ra(t,r,a);break;case 3:case 4:var s=Wn;Wn=Ko(t.stateNode.containerInfo),Ra(t,r,a),Wn=s;break;case 22:t.memoizedState===null&&(s=t.alternate,s!==null&&s.memoizedState!==null?(s=Kl,Kl=16777216,Ra(t,r,a),Kl=s):Ra(t,r,a));break;default:Ra(t,r,a)}}function Qm(t){var r=t.alternate;if(r!==null&&(t=r.child,t!==null)){r.child=null;do r=t.sibling,t.sibling=null,t=r;while(t!==null)}}function ql(t){var r=t.deletions;if((t.flags&16)!==0){if(r!==null)for(var a=0;a<r.length;a++){var s=r[a];$t=s,Jm(s,t)}Qm(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Wm(t),t=t.sibling}function Wm(t){switch(t.tag){case 0:case 11:case 15:ql(t),t.flags&2048&&li(9,t,t.return);break;case 3:ql(t);break;case 12:ql(t);break;case 22:var r=t.stateNode;t.memoizedState!==null&&r._visibility&2&&(t.return===null||t.return.tag!==13)?(r._visibility&=-3,Ro(t)):ql(t);break;default:ql(t)}}function Ro(t){var r=t.deletions;if((t.flags&16)!==0){if(r!==null)for(var a=0;a<r.length;a++){var s=r[a];$t=s,Jm(s,t)}Qm(t)}for(t=t.child;t!==null;){switch(r=t,r.tag){case 0:case 11:case 15:li(8,r,r.return),Ro(r);break;case 22:a=r.stateNode,a._visibility&2&&(a._visibility&=-3,Ro(r));break;default:Ro(r)}t=t.sibling}}function Jm(t,r){for(;$t!==null;){var a=$t;switch(a.tag){case 0:case 11:case 15:li(8,a,r);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var s=a.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:Al(a.memoizedState.cache)}if(s=a.child,s!==null)s.return=a,$t=s;else e:for(a=t;$t!==null;){s=$t;var d=s.sibling,m=s.return;if(Gm(s),s===a){$t=null;break e}if(d!==null){d.return=m,$t=d;break e}$t=m}}}var nE={getCacheForType:function(t){var r=Yt(Ut),a=r.data.get(t);return a===void 0&&(a=t(),r.data.set(t,a)),a},cacheSignal:function(){return Yt(Ut).controller.signal}},rE=typeof WeakMap=="function"?WeakMap:Map,et=0,pt=null,Fe=null,qe=0,lt=0,Mn=null,si=!1,Da=!1,fd=!1,Br=0,Ot=0,oi=0,Vi=0,hd=0,Rn=0,La=0,Vl=null,xn=null,pd=!1,Do=0,eg=0,Lo=1/0,Io=null,ci=null,Gt=0,ui=null,Ia=null,Ur=0,md=0,gd=null,tg=null,Yl=0,bd=null;function Dn(){return(et&2)!==0&&qe!==0?qe&-qe:j.T!==null?_d():sa()}function ng(){if(Rn===0)if((qe&536870912)===0||Xe){var t=la;la<<=1,(la&3932160)===0&&(la=262144),Rn=t}else Rn=536870912;return t=An.current,t!==null&&(t.flags|=32),Rn}function En(t,r,a){(t===pt&&(lt===2||lt===9)||t.cancelPendingCommit!==null)&&(za(t,0),di(t,qe,Rn,!1)),ht(t,a),((et&2)===0||t!==pt)&&(t===pt&&((et&2)===0&&(Vi|=a),Ot===4&&di(t,qe,Rn,!1)),ur(t))}function rg(t,r,a){if((et&6)!==0)throw Error(l(327));var s=!a&&(r&127)===0&&(r&t.expiredLanes)===0||ie(t,r),d=s?lE(t,r):vd(t,r,!0),m=s;do{if(d===0){Da&&!s&&di(t,r,0,!1);break}else{if(a=t.current.alternate,m&&!iE(a)){d=vd(t,r,!1),m=!1;continue}if(d===2){if(m=r,t.errorRecoveryDisabledLanes&m)var x=0;else x=t.pendingLanes&-536870913,x=x!==0?x:x&536870912?536870912:0;if(x!==0){r=x;e:{var k=t;d=Vl;var I=k.current.memoizedState.isDehydrated;if(I&&(za(k,x).flags|=256),x=vd(k,x,!1),x!==2){if(fd&&!I){k.errorRecoveryDisabledLanes|=m,Vi|=m,d=4;break e}m=xn,xn=d,m!==null&&(xn===null?xn=m:xn.push.apply(xn,m))}d=x}if(m=!1,d!==2)continue}}if(d===1){za(t,0),di(t,r,0,!0);break}e:{switch(s=t,m=d,m){case 0:case 1:throw Error(l(345));case 4:if((r&4194048)!==r)break;case 6:di(s,r,Rn,!si);break e;case 2:xn=null;break;case 3:case 5:break;default:throw Error(l(329))}if((r&62914560)===r&&(d=Do+300-wt(),10<d)){if(di(s,r,Rn,!si),z(s,0,!0)!==0)break e;Ur=r,s.timeoutHandle=Lg(ig.bind(null,s,a,xn,Io,pd,r,Rn,Vi,La,si,m,"Throttled",-0,0),d);break e}ig(s,a,xn,Io,pd,r,Rn,Vi,La,si,m,null,-0,0)}}break}while(!0);ur(t)}function ig(t,r,a,s,d,m,x,k,I,Y,ne,le,Z,W){if(t.timeoutHandle=-1,le=r.subtreeFlags,le&8192||(le&16785408)===16785408){le={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ge},Zm(r,m,le);var Se=(m&62914560)===m?Do-wt():(m&4194048)===m?eg-wt():0;if(Se=FE(le,Se),Se!==null){Ur=m,t.cancelPendingCommit=Se(fg.bind(null,t,r,m,a,s,d,x,k,I,ne,le,null,Z,W)),di(t,m,x,!Y);return}}fg(t,r,m,a,s,d,x,k,I)}function iE(t){for(var r=t;;){var a=r.tag;if((a===0||a===11||a===15)&&r.flags&16384&&(a=r.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var s=0;s<a.length;s++){var d=a[s],m=d.getSnapshot;d=d.value;try{if(!Tn(m(),d))return!1}catch{return!1}}if(a=r.child,r.subtreeFlags&16384&&a!==null)a.return=r,r=a;else{if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function di(t,r,a,s){r&=~hd,r&=~Vi,t.suspendedLanes|=r,t.pingedLanes&=~r,s&&(t.warmLanes|=r),s=t.expirationTimes;for(var d=r;0<d;){var m=31-rt(d),x=1<<m;s[m]=-1,d&=~x}a!==0&&Ee(t,a,r)}function zo(){return(et&6)===0?(Xl(0),!1):!0}function yd(){if(Fe!==null){if(lt===0)var t=Fe.return;else t=Fe,Tr=Ui=null,Lu(t),Na=null,Ml=0,t=Fe;for(;t!==null;)Im(t.alternate,t),t=t.return;Fe=null}}function za(t,r){var a=t.timeoutHandle;a!==-1&&(t.timeoutHandle=-1,kE(a)),a=t.cancelPendingCommit,a!==null&&(t.cancelPendingCommit=null,a()),Ur=0,yd(),pt=t,Fe=a=wr(t.current,null),qe=r,lt=0,Mn=null,si=!1,Da=ie(t,r),fd=!1,La=Rn=hd=Vi=oi=Ot=0,xn=Vl=null,pd=!1,(r&8)!==0&&(r|=r&32);var s=t.entangledLanes;if(s!==0)for(t=t.entanglements,s&=r;0<s;){var d=31-rt(s),m=1<<d;r|=t[d],s&=~m}return Br=r,no(),a}function ag(t,r){Be=null,j.H=jl,r===wa||r===uo?(r=Ep(),lt=3):r===Su?(r=Ep(),lt=4):lt=r===Zu?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,Mn=r,Fe===null&&(Ot=1,wo(t,jn(r,t.current)))}function lg(){var t=An.current;return t===null?!0:(qe&4194048)===qe?Gn===null:(qe&62914560)===qe||(qe&536870912)!==0?t===Gn:!1}function sg(){var t=j.H;return j.H=jl,t===null?jl:t}function og(){var t=j.A;return j.A=nE,t}function Bo(){Ot=4,si||(qe&4194048)!==qe&&An.current!==null||(Da=!0),(oi&134217727)===0&&(Vi&134217727)===0||pt===null||di(pt,qe,Rn,!1)}function vd(t,r,a){var s=et;et|=2;var d=sg(),m=og();(pt!==t||qe!==r)&&(Io=null,za(t,r)),r=!1;var x=Ot;e:do try{if(lt!==0&&Fe!==null){var k=Fe,I=Mn;switch(lt){case 8:yd(),x=6;break e;case 3:case 2:case 9:case 6:An.current===null&&(r=!0);var Y=lt;if(lt=0,Mn=null,Ba(t,k,I,Y),a&&Da){x=0;break e}break;default:Y=lt,lt=0,Mn=null,Ba(t,k,I,Y)}}aE(),x=Ot;break}catch(ne){ag(t,ne)}while(!0);return r&&t.shellSuspendCounter++,Tr=Ui=null,et=s,j.H=d,j.A=m,Fe===null&&(pt=null,qe=0,no()),x}function aE(){for(;Fe!==null;)cg(Fe)}function lE(t,r){var a=et;et|=2;var s=sg(),d=og();pt!==t||qe!==r?(Io=null,Lo=wt()+500,za(t,r)):Da=ie(t,r);e:do try{if(lt!==0&&Fe!==null){r=Fe;var m=Mn;t:switch(lt){case 1:lt=0,Mn=null,Ba(t,r,m,1);break;case 2:case 9:if(vp(m)){lt=0,Mn=null,ug(r);break}r=function(){lt!==2&&lt!==9||pt!==t||(lt=7),ur(t)},m.then(r,r);break e;case 3:lt=7;break e;case 4:lt=5;break e;case 7:vp(m)?(lt=0,Mn=null,ug(r)):(lt=0,Mn=null,Ba(t,r,m,7));break;case 5:var x=null;switch(Fe.tag){case 26:x=Fe.memoizedState;case 5:case 27:var k=Fe;if(x?Xg(x):k.stateNode.complete){lt=0,Mn=null;var I=k.sibling;if(I!==null)Fe=I;else{var Y=k.return;Y!==null?(Fe=Y,Uo(Y)):Fe=null}break t}}lt=0,Mn=null,Ba(t,r,m,5);break;case 6:lt=0,Mn=null,Ba(t,r,m,6);break;case 8:yd(),Ot=6;break e;default:throw Error(l(462))}}sE();break}catch(ne){ag(t,ne)}while(!0);return Tr=Ui=null,j.H=s,j.A=d,et=a,Fe!==null?0:(pt=null,qe=0,no(),Ot)}function sE(){for(;Fe!==null&&!dl();)cg(Fe)}function cg(t){var r=Dm(t.alternate,t,Br);t.memoizedProps=t.pendingProps,r===null?Uo(t):Fe=r}function ug(t){var r=t,a=r.alternate;switch(r.tag){case 15:case 0:r=Tm(a,r,r.pendingProps,r.type,void 0,qe);break;case 11:r=Tm(a,r,r.pendingProps,r.type.render,r.ref,qe);break;case 5:Lu(r);default:Im(a,r),r=Fe=op(r,Br),r=Dm(a,r,Br)}t.memoizedProps=t.pendingProps,r===null?Uo(t):Fe=r}function Ba(t,r,a,s){Tr=Ui=null,Lu(r),Na=null,Ml=0;var d=r.return;try{if(X1(t,d,r,a,qe)){Ot=1,wo(t,jn(a,t.current)),Fe=null;return}}catch(m){if(d!==null)throw Fe=d,m;Ot=1,wo(t,jn(a,t.current)),Fe=null;return}r.flags&32768?(Xe||s===1?t=!0:Da||(qe&536870912)!==0?t=!1:(si=t=!0,(s===2||s===9||s===3||s===6)&&(s=An.current,s!==null&&s.tag===13&&(s.flags|=16384))),dg(r,t)):Uo(r)}function Uo(t){var r=t;do{if((r.flags&32768)!==0){dg(r,si);return}t=r.return;var a=W1(r.alternate,r,Br);if(a!==null){Fe=a;return}if(r=r.sibling,r!==null){Fe=r;return}Fe=r=t}while(r!==null);Ot===0&&(Ot=5)}function dg(t,r){do{var a=J1(t.alternate,t);if(a!==null){a.flags&=32767,Fe=a;return}if(a=t.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!r&&(t=t.sibling,t!==null)){Fe=t;return}Fe=t=a}while(t!==null);Ot=6,Fe=null}function fg(t,r,a,s,d,m,x,k,I){t.cancelPendingCommit=null;do jo();while(Gt!==0);if((et&6)!==0)throw Error(l(327));if(r!==null){if(r===t.current)throw Error(l(177));if(m=r.lanes|r.childLanes,m|=su,_e(t,a,m,x,k,I),t===pt&&(Fe=pt=null,qe=0),Ia=r,ui=t,Ur=a,md=m,gd=d,tg=s,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,dE(Ae,function(){return bg(),null})):(t.callbackNode=null,t.callbackPriority=0),s=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||s){s=j.T,j.T=null,d=O.p,O.p=2,x=et,et|=4;try{eE(t,r,a)}finally{et=x,O.p=d,j.T=s}}Gt=1,hg(),pg(),mg()}}function hg(){if(Gt===1){Gt=0;var t=ui,r=Ia,a=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||a){a=j.T,j.T=null;var s=O.p;O.p=2;var d=et;et|=4;try{Vm(r,t);var m=Md,x=Jh(t.containerInfo),k=m.focusedElem,I=m.selectionRange;if(x!==k&&k&&k.ownerDocument&&Wh(k.ownerDocument.documentElement,k)){if(I!==null&&nu(k)){var Y=I.start,ne=I.end;if(ne===void 0&&(ne=Y),"selectionStart"in k)k.selectionStart=Y,k.selectionEnd=Math.min(ne,k.value.length);else{var le=k.ownerDocument||document,Z=le&&le.defaultView||window;if(Z.getSelection){var W=Z.getSelection(),Se=k.textContent.length,Oe=Math.min(I.start,Se),dt=I.end===void 0?Oe:Math.min(I.end,Se);!W.extend&&Oe>dt&&(x=dt,dt=Oe,Oe=x);var G=Qh(k,Oe),H=Qh(k,dt);if(G&&H&&(W.rangeCount!==1||W.anchorNode!==G.node||W.anchorOffset!==G.offset||W.focusNode!==H.node||W.focusOffset!==H.offset)){var V=le.createRange();V.setStart(G.node,G.offset),W.removeAllRanges(),Oe>dt?(W.addRange(V),W.extend(H.node,H.offset)):(V.setEnd(H.node,H.offset),W.addRange(V))}}}}for(le=[],W=k;W=W.parentNode;)W.nodeType===1&&le.push({element:W,left:W.scrollLeft,top:W.scrollTop});for(typeof k.focus=="function"&&k.focus(),k=0;k<le.length;k++){var ae=le[k];ae.element.scrollLeft=ae.left,ae.element.scrollTop=ae.top}}Qo=!!Od,Md=Od=null}finally{et=d,O.p=s,j.T=a}}t.current=r,Gt=2}}function pg(){if(Gt===2){Gt=0;var t=ui,r=Ia,a=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||a){a=j.T,j.T=null;var s=O.p;O.p=2;var d=et;et|=4;try{Fm(t,r.alternate,r)}finally{et=d,O.p=s,j.T=a}}Gt=3}}function mg(){if(Gt===4||Gt===3){Gt=0,ia();var t=ui,r=Ia,a=Ur,s=tg;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?Gt=5:(Gt=0,Ia=ui=null,gg(t,t.pendingLanes));var d=t.pendingLanes;if(d===0&&(ci=null),xr(a),r=r.stateNode,Ct&&typeof Ct.onCommitFiberRoot=="function")try{Ct.onCommitFiberRoot(Kt,r,void 0,(r.current.flags&128)===128)}catch{}if(s!==null){r=j.T,d=O.p,O.p=2,j.T=null;try{for(var m=t.onRecoverableError,x=0;x<s.length;x++){var k=s[x];m(k.value,{componentStack:k.stack})}}finally{j.T=r,O.p=d}}(Ur&3)!==0&&jo(),ur(t),d=t.pendingLanes,(a&261930)!==0&&(d&42)!==0?t===bd?Yl++:(Yl=0,bd=t):Yl=0,Xl(0)}}function gg(t,r){(t.pooledCacheLanes&=r)===0&&(r=t.pooledCache,r!=null&&(t.pooledCache=null,Al(r)))}function jo(){return hg(),pg(),mg(),bg()}function bg(){if(Gt!==5)return!1;var t=ui,r=md;md=0;var a=xr(Ur),s=j.T,d=O.p;try{O.p=32>a?32:a,j.T=null,a=gd,gd=null;var m=ui,x=Ur;if(Gt=0,Ia=ui=null,Ur=0,(et&6)!==0)throw Error(l(331));var k=et;if(et|=4,Wm(m.current),Xm(m,m.current,x,a),et=k,Xl(0,!1),Ct&&typeof Ct.onPostCommitFiberRoot=="function")try{Ct.onPostCommitFiberRoot(Kt,m)}catch{}return!0}finally{O.p=d,j.T=s,gg(t,r)}}function yg(t,r,a){r=jn(a,r),r=Xu(t.stateNode,r,2),t=ri(t,r,2),t!==null&&(ht(t,2),ur(t))}function st(t,r,a){if(t.tag===3)yg(t,t,a);else for(;r!==null;){if(r.tag===3){yg(r,t,a);break}else if(r.tag===1){var s=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(ci===null||!ci.has(s))){t=jn(a,t),a=vm(2),s=ri(r,a,2),s!==null&&(xm(a,s,r,t),ht(s,2),ur(s));break}}r=r.return}}function xd(t,r,a){var s=t.pingCache;if(s===null){s=t.pingCache=new rE;var d=new Set;s.set(r,d)}else d=s.get(r),d===void 0&&(d=new Set,s.set(r,d));d.has(a)||(fd=!0,d.add(a),t=oE.bind(null,t,r,a),r.then(t,t))}function oE(t,r,a){var s=t.pingCache;s!==null&&s.delete(r),t.pingedLanes|=t.suspendedLanes&a,t.warmLanes&=~a,pt===t&&(qe&a)===a&&(Ot===4||Ot===3&&(qe&62914560)===qe&&300>wt()-Do?(et&2)===0&&za(t,0):hd|=a,La===qe&&(La=0)),ur(t)}function vg(t,r){r===0&&(r=Le()),t=Ii(t,r),t!==null&&(ht(t,r),ur(t))}function cE(t){var r=t.memoizedState,a=0;r!==null&&(a=r.retryLane),vg(t,a)}function uE(t,r){var a=0;switch(t.tag){case 31:case 13:var s=t.stateNode,d=t.memoizedState;d!==null&&(a=d.retryLane);break;case 19:s=t.stateNode;break;case 22:s=t.stateNode._retryCache;break;default:throw Error(l(314))}s!==null&&s.delete(r),vg(t,a)}function dE(t,r){return vr(t,r)}var Ho=null,Ua=null,Ed=!1,Po=!1,Sd=!1,fi=0;function ur(t){t!==Ua&&t.next===null&&(Ua===null?Ho=Ua=t:Ua=Ua.next=t),Po=!0,Ed||(Ed=!0,hE())}function Xl(t,r){if(!Sd&&Po){Sd=!0;do for(var a=!1,s=Ho;s!==null;){if(t!==0){var d=s.pendingLanes;if(d===0)var m=0;else{var x=s.suspendedLanes,k=s.pingedLanes;m=(1<<31-rt(42|t)+1)-1,m&=d&~(x&~k),m=m&201326741?m&201326741|1:m?m|2:0}m!==0&&(a=!0,_g(s,m))}else m=qe,m=z(s,s===pt?m:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(m&3)===0||ie(s,m)||(a=!0,_g(s,m));s=s.next}while(a);Sd=!1}}function fE(){xg()}function xg(){Po=Ed=!1;var t=0;fi!==0&&_E()&&(t=fi);for(var r=wt(),a=null,s=Ho;s!==null;){var d=s.next,m=Eg(s,r);m===0?(s.next=null,a===null?Ho=d:a.next=d,d===null&&(Ua=a)):(a=s,(t!==0||(m&3)!==0)&&(Po=!0)),s=d}Gt!==0&&Gt!==5||Xl(t),fi!==0&&(fi=0)}function Eg(t,r){for(var a=t.suspendedLanes,s=t.pingedLanes,d=t.expirationTimes,m=t.pendingLanes&-62914561;0<m;){var x=31-rt(m),k=1<<x,I=d[x];I===-1?((k&a)===0||(k&s)!==0)&&(d[x]=be(k,r)):I<=r&&(t.expiredLanes|=k),m&=~k}if(r=pt,a=qe,a=z(t,t===r?a:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),s=t.callbackNode,a===0||t===r&&(lt===2||lt===9)||t.cancelPendingCommit!==null)return s!==null&&s!==null&&Ni(s),t.callbackNode=null,t.callbackPriority=0;if((a&3)===0||ie(t,a)){if(r=a&-a,r===t.callbackPriority)return r;switch(s!==null&&Ni(s),xr(a)){case 2:case 8:a=pe;break;case 32:a=Ae;break;case 268435456:a=Qe;break;default:a=Ae}return s=Sg.bind(null,t),a=vr(a,s),t.callbackPriority=r,t.callbackNode=a,r}return s!==null&&s!==null&&Ni(s),t.callbackPriority=2,t.callbackNode=null,2}function Sg(t,r){if(Gt!==0&&Gt!==5)return t.callbackNode=null,t.callbackPriority=0,null;var a=t.callbackNode;if(jo()&&t.callbackNode!==a)return null;var s=qe;return s=z(t,t===pt?s:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),s===0?null:(rg(t,s,r),Eg(t,wt()),t.callbackNode!=null&&t.callbackNode===a?Sg.bind(null,t):null)}function _g(t,r){if(jo())return null;rg(t,r,!0)}function hE(){wE(function(){(et&6)!==0?vr(te,fE):xg()})}function _d(){if(fi===0){var t=_a;t===0&&(t=Ti,Ti<<=1,(Ti&261888)===0&&(Ti=256)),fi=t}return fi}function kg(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Xr(""+t)}function wg(t,r){var a=r.ownerDocument.createElement("input");return a.name=r.name,a.value=r.value,t.id&&a.setAttribute("form",t.id),r.parentNode.insertBefore(a,r),t=new FormData(t),a.parentNode.removeChild(a),t}function pE(t,r,a,s,d){if(r==="submit"&&a&&a.stateNode===d){var m=kg((d[Wt]||null).action),x=s.submitter;x&&(r=(r=x[Wt]||null)?kg(r.formAction):x.getAttribute("formAction"),r!==null&&(m=r,x=null));var k=new Ws("action","action",null,s,d);t.push({event:k,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(fi!==0){var I=x?wg(d,x):new FormData(d);Gu(a,{pending:!0,data:I,method:d.method,action:m},null,I)}}else typeof m=="function"&&(k.preventDefault(),I=x?wg(d,x):new FormData(d),Gu(a,{pending:!0,data:I,method:d.method,action:m},m,I))},currentTarget:d}]})}}for(var kd=0;kd<lu.length;kd++){var wd=lu[kd],mE=wd.toLowerCase(),gE=wd[0].toUpperCase()+wd.slice(1);Qn(mE,"on"+gE)}Qn(np,"onAnimationEnd"),Qn(rp,"onAnimationIteration"),Qn(ip,"onAnimationStart"),Qn("dblclick","onDoubleClick"),Qn("focusin","onFocus"),Qn("focusout","onBlur"),Qn(R1,"onTransitionRun"),Qn(D1,"onTransitionStart"),Qn(L1,"onTransitionCancel"),Qn(ap,"onTransitionEnd"),fe("onMouseEnter",["mouseout","mouseover"]),fe("onMouseLeave",["mouseout","mouseover"]),fe("onPointerEnter",["pointerout","pointerover"]),fe("onPointerLeave",["pointerout","pointerover"]),Sr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Sr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Sr("onBeforeInput",["compositionend","keypress","textInput","paste"]),Sr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Sr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Sr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Zl="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(" "),bE=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Zl));function Ng(t,r){r=(r&4)!==0;for(var a=0;a<t.length;a++){var s=t[a],d=s.event;s=s.listeners;e:{var m=void 0;if(r)for(var x=s.length-1;0<=x;x--){var k=s[x],I=k.instance,Y=k.currentTarget;if(k=k.listener,I!==m&&d.isPropagationStopped())break e;m=k,d.currentTarget=Y;try{m(d)}catch(ne){to(ne)}d.currentTarget=null,m=I}else for(x=0;x<s.length;x++){if(k=s[x],I=k.instance,Y=k.currentTarget,k=k.listener,I!==m&&d.isPropagationStopped())break e;m=k,d.currentTarget=Y;try{m(d)}catch(ne){to(ne)}d.currentTarget=null,m=I}}}}function Ge(t,r){var a=r[fl];a===void 0&&(a=r[fl]=new Set);var s=t+"__bubble";a.has(s)||(Tg(r,t,2,!1),a.add(s))}function Nd(t,r,a){var s=0;r&&(s|=4),Tg(a,t,s,r)}var Fo="_reactListening"+Math.random().toString(36).slice(2);function Td(t){if(!t[Fo]){t[Fo]=!0,$s.forEach(function(a){a!=="selectionchange"&&(bE.has(a)||Nd(a,!1,t),Nd(a,!0,t))});var r=t.nodeType===9?t:t.ownerDocument;r===null||r[Fo]||(r[Fo]=!0,Nd("selectionchange",!1,r))}}function Tg(t,r,a,s){switch(nb(r)){case 2:var d=KE;break;case 8:d=qE;break;default:d=Fd}a=d.bind(null,r,a,t),d=void 0,!Vc||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(d=!0),s?d!==void 0?t.addEventListener(r,a,{capture:!0,passive:d}):t.addEventListener(r,a,!0):d!==void 0?t.addEventListener(r,a,{passive:d}):t.addEventListener(r,a,!1)}function Cd(t,r,a,s,d){var m=s;if((r&1)===0&&(r&2)===0&&s!==null)e:for(;;){if(s===null)return;var x=s.tag;if(x===3||x===4){var k=s.stateNode.containerInfo;if(k===d)break;if(x===4)for(x=s.return;x!==null;){var I=x.tag;if((I===3||I===4)&&x.stateNode.containerInfo===d)return;x=x.return}for(;k!==null;){if(x=ln(k),x===null)return;if(I=x.tag,I===5||I===6||I===26||I===27){s=m=x;continue e}k=k.parentNode}}s=s.return}Ys(function(){var Y=m,ne=ze(a),le=[];e:{var Z=lp.get(t);if(Z!==void 0){var W=Ws,Se=t;switch(t){case"keypress":if(Zs(a)===0)break e;case"keydown":case"keyup":W=u1;break;case"focusin":Se="focus",W=Qc;break;case"focusout":Se="blur",W=Qc;break;case"beforeblur":case"afterblur":W=Qc;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":W=Ih;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":W=W0;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":W=h1;break;case np:case rp:case ip:W=t1;break;case ap:W=m1;break;case"scroll":case"scrollend":W=Z0;break;case"wheel":W=b1;break;case"copy":case"cut":case"paste":W=r1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":W=Bh;break;case"toggle":case"beforetoggle":W=v1}var Oe=(r&4)!==0,dt=!Oe&&(t==="scroll"||t==="scrollend"),G=Oe?Z!==null?Z+"Capture":null:Z;Oe=[];for(var H=Y,V;H!==null;){var ae=H;if(V=ae.stateNode,ae=ae.tag,ae!==5&&ae!==26&&ae!==27||V===null||G===null||(ae=yl(H,G),ae!=null&&Oe.push(Ql(H,ae,V))),dt)break;H=H.return}0<Oe.length&&(Z=new W(Z,Se,null,a,ne),le.push({event:Z,listeners:Oe}))}}if((r&7)===0){e:{if(Z=t==="mouseover"||t==="pointerover",W=t==="mouseout"||t==="pointerout",Z&&a!==ke&&(Se=a.relatedTarget||a.fromElement)&&(ln(Se)||Se[Kr]))break e;if((W||Z)&&(Z=ne.window===ne?ne:(Z=ne.ownerDocument)?Z.defaultView||Z.parentWindow:window,W?(Se=a.relatedTarget||a.toElement,W=Y,Se=Se?ln(Se):null,Se!==null&&(dt=c(Se),Oe=Se.tag,Se!==dt||Oe!==5&&Oe!==27&&Oe!==6)&&(Se=null)):(W=null,Se=Y),W!==Se)){if(Oe=Ih,ae="onMouseLeave",G="onMouseEnter",H="mouse",(t==="pointerout"||t==="pointerover")&&(Oe=Bh,ae="onPointerLeave",G="onPointerEnter",H="pointer"),dt=W==null?Z:qr(W),V=Se==null?Z:qr(Se),Z=new Oe(ae,H+"leave",W,a,ne),Z.target=dt,Z.relatedTarget=V,ae=null,ln(ne)===Y&&(Oe=new Oe(G,H+"enter",Se,a,ne),Oe.target=V,Oe.relatedTarget=dt,ae=Oe),dt=ae,W&&Se)t:{for(Oe=yE,G=W,H=Se,V=0,ae=G;ae;ae=Oe(ae))V++;ae=0;for(var Te=H;Te;Te=Oe(Te))ae++;for(;0<V-ae;)G=Oe(G),V--;for(;0<ae-V;)H=Oe(H),ae--;for(;V--;){if(G===H||H!==null&&G===H.alternate){Oe=G;break t}G=Oe(G),H=Oe(H)}Oe=null}else Oe=null;W!==null&&Cg(le,Z,W,Oe,!1),Se!==null&&dt!==null&&Cg(le,dt,Se,Oe,!0)}}e:{if(Z=Y?qr(Y):window,W=Z.nodeName&&Z.nodeName.toLowerCase(),W==="select"||W==="input"&&Z.type==="file")var We=Kh;else if(Gh(Z))if(qh)We=A1;else{We=T1;var we=N1}else W=Z.nodeName,!W||W.toLowerCase()!=="input"||Z.type!=="checkbox"&&Z.type!=="radio"?Y&&Yr(Y.elementType)&&(We=Kh):We=C1;if(We&&(We=We(t,Y))){$h(le,We,a,ne);break e}we&&we(t,Z,Y),t==="focusout"&&Y&&Z.type==="number"&&Y.memoizedProps.value!=null&&fa(Z,"number",Z.value)}switch(we=Y?qr(Y):window,t){case"focusin":(Gh(we)||we.contentEditable==="true")&&(ma=we,ru=Y,Nl=null);break;case"focusout":Nl=ru=ma=null;break;case"mousedown":iu=!0;break;case"contextmenu":case"mouseup":case"dragend":iu=!1,ep(le,a,ne);break;case"selectionchange":if(M1)break;case"keydown":case"keyup":ep(le,a,ne)}var Ue;if(Jc)e:{switch(t){case"compositionstart":var Ve="onCompositionStart";break e;case"compositionend":Ve="onCompositionEnd";break e;case"compositionupdate":Ve="onCompositionUpdate";break e}Ve=void 0}else pa?Ph(t,a)&&(Ve="onCompositionEnd"):t==="keydown"&&a.keyCode===229&&(Ve="onCompositionStart");Ve&&(Uh&&a.locale!=="ko"&&(pa||Ve!=="onCompositionStart"?Ve==="onCompositionEnd"&&pa&&(Ue=Dh()):(Zr=ne,Yc="value"in Zr?Zr.value:Zr.textContent,pa=!0)),we=Go(Y,Ve),0<we.length&&(Ve=new zh(Ve,t,null,a,ne),le.push({event:Ve,listeners:we}),Ue?Ve.data=Ue:(Ue=Fh(a),Ue!==null&&(Ve.data=Ue)))),(Ue=E1?S1(t,a):_1(t,a))&&(Ve=Go(Y,"onBeforeInput"),0<Ve.length&&(we=new zh("onBeforeInput","beforeinput",null,a,ne),le.push({event:we,listeners:Ve}),we.data=Ue)),pE(le,t,Y,a,ne)}Ng(le,r)})}function Ql(t,r,a){return{instance:t,listener:r,currentTarget:a}}function Go(t,r){for(var a=r+"Capture",s=[];t!==null;){var d=t,m=d.stateNode;if(d=d.tag,d!==5&&d!==26&&d!==27||m===null||(d=yl(t,a),d!=null&&s.unshift(Ql(t,d,m)),d=yl(t,r),d!=null&&s.push(Ql(t,d,m))),t.tag===3)return s;t=t.return}return[]}function yE(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Cg(t,r,a,s,d){for(var m=r._reactName,x=[];a!==null&&a!==s;){var k=a,I=k.alternate,Y=k.stateNode;if(k=k.tag,I!==null&&I===s)break;k!==5&&k!==26&&k!==27||Y===null||(I=Y,d?(Y=yl(a,m),Y!=null&&x.unshift(Ql(a,Y,I))):d||(Y=yl(a,m),Y!=null&&x.push(Ql(a,Y,I)))),a=a.return}x.length!==0&&t.push({event:r,listeners:x})}var vE=/\r\n?/g,xE=/\u0000|\uFFFD/g;function Ag(t){return(typeof t=="string"?t:""+t).replace(vE,`
49
+ `).replace(xE,"")}function Og(t,r){return r=Ag(r),Ag(t)===r}function ut(t,r,a,s,d,m){switch(a){case"children":typeof s=="string"?r==="body"||r==="textarea"&&s===""||Me(t,s):(typeof s=="number"||typeof s=="bigint")&&r!=="body"&&Me(t,""+s);break;case"className":wn(t,"class",s);break;case"tabIndex":wn(t,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":wn(t,a,s);break;case"style":at(t,s,m);break;case"data":if(r!=="object"){wn(t,"data",s);break}case"src":case"href":if(s===""&&(r!=="a"||a!=="href")){t.removeAttribute(a);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){t.removeAttribute(a);break}s=Xr(""+s),t.setAttribute(a,s);break;case"action":case"formAction":if(typeof s=="function"){t.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof m=="function"&&(a==="formAction"?(r!=="input"&&ut(t,r,"name",d.name,d,null),ut(t,r,"formEncType",d.formEncType,d,null),ut(t,r,"formMethod",d.formMethod,d,null),ut(t,r,"formTarget",d.formTarget,d,null)):(ut(t,r,"encType",d.encType,d,null),ut(t,r,"method",d.method,d,null),ut(t,r,"target",d.target,d,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){t.removeAttribute(a);break}s=Xr(""+s),t.setAttribute(a,s);break;case"onClick":s!=null&&(t.onclick=ge);break;case"onScroll":s!=null&&Ge("scroll",t);break;case"onScrollEnd":s!=null&&Ge("scrollend",t);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(l(61));if(a=s.__html,a!=null){if(d.children!=null)throw Error(l(60));t.innerHTML=a}}break;case"multiple":t.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":t.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){t.removeAttribute("xlink:href");break}a=Xr(""+s),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":s!=null&&typeof s!="function"&&typeof s!="symbol"?t.setAttribute(a,""+s):t.removeAttribute(a);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":s&&typeof s!="function"&&typeof s!="symbol"?t.setAttribute(a,""):t.removeAttribute(a);break;case"capture":case"download":s===!0?t.setAttribute(a,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?t.setAttribute(a,s):t.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?t.setAttribute(a,s):t.removeAttribute(a);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?t.removeAttribute(a):t.setAttribute(a,s);break;case"popover":Ge("beforetoggle",t),Ge("toggle",t),Jt(t,"popover",s);break;case"xlinkActuate":pn(t,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":pn(t,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":pn(t,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":pn(t,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":pn(t,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":pn(t,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":pn(t,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":pn(t,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":pn(t,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":Jt(t,"is",s);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=_r.get(a)||a,Jt(t,a,s))}}function Ad(t,r,a,s,d,m){switch(a){case"style":at(t,s,m);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(l(61));if(a=s.__html,a!=null){if(d.children!=null)throw Error(l(60));t.innerHTML=a}}break;case"children":typeof s=="string"?Me(t,s):(typeof s=="number"||typeof s=="bigint")&&Me(t,""+s);break;case"onScroll":s!=null&&Ge("scroll",t);break;case"onScrollEnd":s!=null&&Ge("scrollend",t);break;case"onClick":s!=null&&(t.onclick=ge);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Oi.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(d=a.endsWith("Capture"),r=a.slice(2,d?a.length-7:void 0),m=t[Wt]||null,m=m!=null?m[a]:null,typeof m=="function"&&t.removeEventListener(r,m,d),typeof s=="function")){typeof m!="function"&&m!==null&&(a in t?t[a]=null:t.hasAttribute(a)&&t.removeAttribute(a)),t.addEventListener(r,s,d);break e}a in t?t[a]=s:s===!0?t.setAttribute(a,""):Jt(t,a,s)}}}function Zt(t,r,a){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ge("error",t),Ge("load",t);var s=!1,d=!1,m;for(m in a)if(a.hasOwnProperty(m)){var x=a[m];if(x!=null)switch(m){case"src":s=!0;break;case"srcSet":d=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(l(137,r));default:ut(t,r,m,x,a,null)}}d&&ut(t,r,"srcSet",a.srcSet,a,null),s&&ut(t,r,"src",a.src,a,null);return;case"input":Ge("invalid",t);var k=m=x=d=null,I=null,Y=null;for(s in a)if(a.hasOwnProperty(s)){var ne=a[s];if(ne!=null)switch(s){case"name":d=ne;break;case"type":x=ne;break;case"checked":I=ne;break;case"defaultChecked":Y=ne;break;case"value":m=ne;break;case"defaultValue":k=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(l(137,r));break;default:ut(t,r,s,ne,a,null)}}Mi(t,m,k,I,Y,x,d,!1);return;case"select":Ge("invalid",t),s=x=m=null;for(d in a)if(a.hasOwnProperty(d)&&(k=a[d],k!=null))switch(d){case"value":m=k;break;case"defaultValue":x=k;break;case"multiple":s=k;default:ut(t,r,d,k,a,null)}r=m,a=x,t.multiple=!!s,r!=null?qt(t,!!s,r,!1):a!=null&&qt(t,!!s,a,!0);return;case"textarea":Ge("invalid",t),m=d=s=null;for(x in a)if(a.hasOwnProperty(x)&&(k=a[x],k!=null))switch(x){case"value":s=k;break;case"defaultValue":d=k;break;case"children":m=k;break;case"dangerouslySetInnerHTML":if(k!=null)throw Error(l(91));break;default:ut(t,r,x,k,a,null)}ha(t,s,d,m);return;case"option":for(I in a)if(a.hasOwnProperty(I)&&(s=a[I],s!=null))switch(I){case"selected":t.selected=s&&typeof s!="function"&&typeof s!="symbol";break;default:ut(t,r,I,s,a,null)}return;case"dialog":Ge("beforetoggle",t),Ge("toggle",t),Ge("cancel",t),Ge("close",t);break;case"iframe":case"object":Ge("load",t);break;case"video":case"audio":for(s=0;s<Zl.length;s++)Ge(Zl[s],t);break;case"image":Ge("error",t),Ge("load",t);break;case"details":Ge("toggle",t);break;case"embed":case"source":case"link":Ge("error",t),Ge("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Y in a)if(a.hasOwnProperty(Y)&&(s=a[Y],s!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":throw Error(l(137,r));default:ut(t,r,Y,s,a,null)}return;default:if(Yr(r)){for(ne in a)a.hasOwnProperty(ne)&&(s=a[ne],s!==void 0&&Ad(t,r,ne,s,a,void 0));return}}for(k in a)a.hasOwnProperty(k)&&(s=a[k],s!=null&&ut(t,r,k,s,a,null))}function EE(t,r,a,s){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var d=null,m=null,x=null,k=null,I=null,Y=null,ne=null;for(W in a){var le=a[W];if(a.hasOwnProperty(W)&&le!=null)switch(W){case"checked":break;case"value":break;case"defaultValue":I=le;default:s.hasOwnProperty(W)||ut(t,r,W,null,s,le)}}for(var Z in s){var W=s[Z];if(le=a[Z],s.hasOwnProperty(Z)&&(W!=null||le!=null))switch(Z){case"type":m=W;break;case"name":d=W;break;case"checked":Y=W;break;case"defaultChecked":ne=W;break;case"value":x=W;break;case"defaultValue":k=W;break;case"children":case"dangerouslySetInnerHTML":if(W!=null)throw Error(l(137,r));break;default:W!==le&&ut(t,r,Z,W,s,le)}}ml(t,x,k,I,Y,ne,m,d);return;case"select":W=x=k=Z=null;for(m in a)if(I=a[m],a.hasOwnProperty(m)&&I!=null)switch(m){case"value":break;case"multiple":W=I;default:s.hasOwnProperty(m)||ut(t,r,m,null,s,I)}for(d in s)if(m=s[d],I=a[d],s.hasOwnProperty(d)&&(m!=null||I!=null))switch(d){case"value":Z=m;break;case"defaultValue":k=m;break;case"multiple":x=m;default:m!==I&&ut(t,r,d,m,s,I)}r=k,a=x,s=W,Z!=null?qt(t,!!a,Z,!1):!!s!=!!a&&(r!=null?qt(t,!!a,r,!0):qt(t,!!a,a?[]:"",!1));return;case"textarea":W=Z=null;for(k in a)if(d=a[k],a.hasOwnProperty(k)&&d!=null&&!s.hasOwnProperty(k))switch(k){case"value":break;case"children":break;default:ut(t,r,k,null,s,d)}for(x in s)if(d=s[x],m=a[x],s.hasOwnProperty(x)&&(d!=null||m!=null))switch(x){case"value":Z=d;break;case"defaultValue":W=d;break;case"children":break;case"dangerouslySetInnerHTML":if(d!=null)throw Error(l(91));break;default:d!==m&&ut(t,r,x,d,s,m)}qs(t,Z,W);return;case"option":for(var Se in a)if(Z=a[Se],a.hasOwnProperty(Se)&&Z!=null&&!s.hasOwnProperty(Se))switch(Se){case"selected":t.selected=!1;break;default:ut(t,r,Se,null,s,Z)}for(I in s)if(Z=s[I],W=a[I],s.hasOwnProperty(I)&&Z!==W&&(Z!=null||W!=null))switch(I){case"selected":t.selected=Z&&typeof Z!="function"&&typeof Z!="symbol";break;default:ut(t,r,I,Z,s,W)}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 Oe in a)Z=a[Oe],a.hasOwnProperty(Oe)&&Z!=null&&!s.hasOwnProperty(Oe)&&ut(t,r,Oe,null,s,Z);for(Y in s)if(Z=s[Y],W=a[Y],s.hasOwnProperty(Y)&&Z!==W&&(Z!=null||W!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":if(Z!=null)throw Error(l(137,r));break;default:ut(t,r,Y,Z,s,W)}return;default:if(Yr(r)){for(var dt in a)Z=a[dt],a.hasOwnProperty(dt)&&Z!==void 0&&!s.hasOwnProperty(dt)&&Ad(t,r,dt,void 0,s,Z);for(ne in s)Z=s[ne],W=a[ne],!s.hasOwnProperty(ne)||Z===W||Z===void 0&&W===void 0||Ad(t,r,ne,Z,s,W);return}}for(var G in a)Z=a[G],a.hasOwnProperty(G)&&Z!=null&&!s.hasOwnProperty(G)&&ut(t,r,G,null,s,Z);for(le in s)Z=s[le],W=a[le],!s.hasOwnProperty(le)||Z===W||Z==null&&W==null||ut(t,r,le,Z,s,W)}function Mg(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function SE(){if(typeof performance.getEntriesByType=="function"){for(var t=0,r=0,a=performance.getEntriesByType("resource"),s=0;s<a.length;s++){var d=a[s],m=d.transferSize,x=d.initiatorType,k=d.duration;if(m&&k&&Mg(x)){for(x=0,k=d.responseEnd,s+=1;s<a.length;s++){var I=a[s],Y=I.startTime;if(Y>k)break;var ne=I.transferSize,le=I.initiatorType;ne&&Mg(le)&&(I=I.responseEnd,x+=ne*(I<k?1:(k-Y)/(I-Y)))}if(--s,r+=8*(m+x)/(d.duration/1e3),t++,10<t)break}}if(0<t)return r/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var Od=null,Md=null;function $o(t){return t.nodeType===9?t:t.ownerDocument}function Rg(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Dg(t,r){if(t===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&r==="foreignObject"?0:t}function Rd(t,r){return t==="textarea"||t==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var Dd=null;function _E(){var t=window.event;return t&&t.type==="popstate"?t===Dd?!1:(Dd=t,!0):(Dd=null,!1)}var Lg=typeof setTimeout=="function"?setTimeout:void 0,kE=typeof clearTimeout=="function"?clearTimeout:void 0,Ig=typeof Promise=="function"?Promise:void 0,wE=typeof queueMicrotask=="function"?queueMicrotask:typeof Ig<"u"?function(t){return Ig.resolve(null).then(t).catch(NE)}:Lg;function NE(t){setTimeout(function(){throw t})}function hi(t){return t==="head"}function zg(t,r){var a=r,s=0;do{var d=a.nextSibling;if(t.removeChild(a),d&&d.nodeType===8)if(a=d.data,a==="/$"||a==="/&"){if(s===0){t.removeChild(d),Fa(r);return}s--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")s++;else if(a==="html")Wl(t.ownerDocument.documentElement);else if(a==="head"){a=t.ownerDocument.head,Wl(a);for(var m=a.firstChild;m;){var x=m.nextSibling,k=m.nodeName;m[Ai]||k==="SCRIPT"||k==="STYLE"||k==="LINK"&&m.rel.toLowerCase()==="stylesheet"||a.removeChild(m),m=x}}else a==="body"&&Wl(t.ownerDocument.body);a=d}while(a);Fa(r)}function Bg(t,r){var a=t;t=0;do{var s=a.nextSibling;if(a.nodeType===1?r?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(r?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),s&&s.nodeType===8)if(a=s.data,a==="/$"){if(t===0)break;t--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||t++;a=s}while(a)}function Ld(t){var r=t.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var a=r;switch(r=r.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":Ld(a),hl(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}t.removeChild(a)}}function TE(t,r,a,s){for(;t.nodeType===1;){var d=a;if(t.nodeName.toLowerCase()!==r.toLowerCase()){if(!s&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(s){if(!t[Ai])switch(r){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(m=t.getAttribute("rel"),m==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(m!==d.rel||t.getAttribute("href")!==(d.href==null||d.href===""?null:d.href)||t.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin)||t.getAttribute("title")!==(d.title==null?null:d.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(m=t.getAttribute("src"),(m!==(d.src==null?null:d.src)||t.getAttribute("type")!==(d.type==null?null:d.type)||t.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin))&&m&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(r==="input"&&t.type==="hidden"){var m=d.name==null?null:""+d.name;if(d.type==="hidden"&&t.getAttribute("name")===m)return t}else return t;if(t=$n(t.nextSibling),t===null)break}return null}function CE(t,r,a){if(r==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!a||(t=$n(t.nextSibling),t===null))return null;return t}function Ug(t,r){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!r||(t=$n(t.nextSibling),t===null))return null;return t}function Id(t){return t.data==="$?"||t.data==="$~"}function zd(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function AE(t,r){var a=t.ownerDocument;if(t.data==="$~")t._reactRetry=r;else if(t.data!=="$?"||a.readyState!=="loading")r();else{var s=function(){r(),a.removeEventListener("DOMContentLoaded",s)};a.addEventListener("DOMContentLoaded",s),t._reactRetry=s}}function $n(t){for(;t!=null;t=t.nextSibling){var r=t.nodeType;if(r===1||r===3)break;if(r===8){if(r=t.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return t}var Bd=null;function jg(t){t=t.nextSibling;for(var r=0;t;){if(t.nodeType===8){var a=t.data;if(a==="/$"||a==="/&"){if(r===0)return $n(t.nextSibling);r--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||r++}t=t.nextSibling}return null}function Hg(t){t=t.previousSibling;for(var r=0;t;){if(t.nodeType===8){var a=t.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(r===0)return t;r--}else a!=="/$"&&a!=="/&"||r++}t=t.previousSibling}return null}function Pg(t,r,a){switch(r=$o(a),t){case"html":if(t=r.documentElement,!t)throw Error(l(452));return t;case"head":if(t=r.head,!t)throw Error(l(453));return t;case"body":if(t=r.body,!t)throw Error(l(454));return t;default:throw Error(l(451))}}function Wl(t){for(var r=t.attributes;r.length;)t.removeAttributeNode(r[0]);hl(t)}var Kn=new Map,Fg=new Set;function Ko(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var jr=O.d;O.d={f:OE,r:ME,D:RE,C:DE,L:LE,m:IE,X:BE,S:zE,M:UE};function OE(){var t=jr.f(),r=zo();return t||r}function ME(t){var r=Er(t);r!==null&&r.tag===5&&r.type==="form"?am(r):jr.r(t)}var ja=typeof document>"u"?null:document;function Gg(t,r,a){var s=ja;if(s&&typeof r=="string"&&r){var d=mn(r);d='link[rel="'+t+'"][href="'+d+'"]',typeof a=="string"&&(d+='[crossorigin="'+a+'"]'),Fg.has(d)||(Fg.add(d),t={rel:t,crossOrigin:a,href:r},s.querySelector(d)===null&&(r=s.createElement("link"),Zt(r,"link",t),zt(r),s.head.appendChild(r)))}}function RE(t){jr.D(t),Gg("dns-prefetch",t,null)}function DE(t,r){jr.C(t,r),Gg("preconnect",t,r)}function LE(t,r,a){jr.L(t,r,a);var s=ja;if(s&&t&&r){var d='link[rel="preload"][as="'+mn(r)+'"]';r==="image"&&a&&a.imageSrcSet?(d+='[imagesrcset="'+mn(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(d+='[imagesizes="'+mn(a.imageSizes)+'"]')):d+='[href="'+mn(t)+'"]';var m=d;switch(r){case"style":m=Ha(t);break;case"script":m=Pa(t)}Kn.has(m)||(t=y({rel:"preload",href:r==="image"&&a&&a.imageSrcSet?void 0:t,as:r},a),Kn.set(m,t),s.querySelector(d)!==null||r==="style"&&s.querySelector(Jl(m))||r==="script"&&s.querySelector(es(m))||(r=s.createElement("link"),Zt(r,"link",t),zt(r),s.head.appendChild(r)))}}function IE(t,r){jr.m(t,r);var a=ja;if(a&&t){var s=r&&typeof r.as=="string"?r.as:"script",d='link[rel="modulepreload"][as="'+mn(s)+'"][href="'+mn(t)+'"]',m=d;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":m=Pa(t)}if(!Kn.has(m)&&(t=y({rel:"modulepreload",href:t},r),Kn.set(m,t),a.querySelector(d)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(es(m)))return}s=a.createElement("link"),Zt(s,"link",t),zt(s),a.head.appendChild(s)}}}function zE(t,r,a){jr.S(t,r,a);var s=ja;if(s&&t){var d=Vr(s).hoistableStyles,m=Ha(t);r=r||"default";var x=d.get(m);if(!x){var k={loading:0,preload:null};if(x=s.querySelector(Jl(m)))k.loading=5;else{t=y({rel:"stylesheet",href:t,"data-precedence":r},a),(a=Kn.get(m))&&Ud(t,a);var I=x=s.createElement("link");zt(I),Zt(I,"link",t),I._p=new Promise(function(Y,ne){I.onload=Y,I.onerror=ne}),I.addEventListener("load",function(){k.loading|=1}),I.addEventListener("error",function(){k.loading|=2}),k.loading|=4,qo(x,r,s)}x={type:"stylesheet",instance:x,count:1,state:k},d.set(m,x)}}}function BE(t,r){jr.X(t,r);var a=ja;if(a&&t){var s=Vr(a).hoistableScripts,d=Pa(t),m=s.get(d);m||(m=a.querySelector(es(d)),m||(t=y({src:t,async:!0},r),(r=Kn.get(d))&&jd(t,r),m=a.createElement("script"),zt(m),Zt(m,"link",t),a.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},s.set(d,m))}}function UE(t,r){jr.M(t,r);var a=ja;if(a&&t){var s=Vr(a).hoistableScripts,d=Pa(t),m=s.get(d);m||(m=a.querySelector(es(d)),m||(t=y({src:t,async:!0,type:"module"},r),(r=Kn.get(d))&&jd(t,r),m=a.createElement("script"),zt(m),Zt(m,"link",t),a.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},s.set(d,m))}}function $g(t,r,a,s){var d=(d=K.current)?Ko(d):null;if(!d)throw Error(l(446));switch(t){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(r=Ha(a.href),a=Vr(d).hoistableStyles,s=a.get(r),s||(s={type:"style",instance:null,count:0,state:null},a.set(r,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){t=Ha(a.href);var m=Vr(d).hoistableStyles,x=m.get(t);if(x||(d=d.ownerDocument||d,x={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},m.set(t,x),(m=d.querySelector(Jl(t)))&&!m._p&&(x.instance=m,x.state.loading=5),Kn.has(t)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Kn.set(t,a),m||jE(d,t,a,x.state))),r&&s===null)throw Error(l(528,""));return x}if(r&&s!==null)throw Error(l(529,""));return null;case"script":return r=a.async,a=a.src,typeof a=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=Pa(a),a=Vr(d).hoistableScripts,s=a.get(r),s||(s={type:"script",instance:null,count:0,state:null},a.set(r,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,t))}}function Ha(t){return'href="'+mn(t)+'"'}function Jl(t){return'link[rel="stylesheet"]['+t+"]"}function Kg(t){return y({},t,{"data-precedence":t.precedence,precedence:null})}function jE(t,r,a,s){t.querySelector('link[rel="preload"][as="style"]['+r+"]")?s.loading=1:(r=t.createElement("link"),s.preload=r,r.addEventListener("load",function(){return s.loading|=1}),r.addEventListener("error",function(){return s.loading|=2}),Zt(r,"link",a),zt(r),t.head.appendChild(r))}function Pa(t){return'[src="'+mn(t)+'"]'}function es(t){return"script[async]"+t}function qg(t,r,a){if(r.count++,r.instance===null)switch(r.type){case"style":var s=t.querySelector('style[data-href~="'+mn(a.href)+'"]');if(s)return r.instance=s,zt(s),s;var d=y({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return s=(t.ownerDocument||t).createElement("style"),zt(s),Zt(s,"style",d),qo(s,a.precedence,t),r.instance=s;case"stylesheet":d=Ha(a.href);var m=t.querySelector(Jl(d));if(m)return r.state.loading|=4,r.instance=m,zt(m),m;s=Kg(a),(d=Kn.get(d))&&Ud(s,d),m=(t.ownerDocument||t).createElement("link"),zt(m);var x=m;return x._p=new Promise(function(k,I){x.onload=k,x.onerror=I}),Zt(m,"link",s),r.state.loading|=4,qo(m,a.precedence,t),r.instance=m;case"script":return m=Pa(a.src),(d=t.querySelector(es(m)))?(r.instance=d,zt(d),d):(s=a,(d=Kn.get(m))&&(s=y({},a),jd(s,d)),t=t.ownerDocument||t,d=t.createElement("script"),zt(d),Zt(d,"link",s),t.head.appendChild(d),r.instance=d);case"void":return null;default:throw Error(l(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(s=r.instance,r.state.loading|=4,qo(s,a.precedence,t));return r.instance}function qo(t,r,a){for(var s=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),d=s.length?s[s.length-1]:null,m=d,x=0;x<s.length;x++){var k=s[x];if(k.dataset.precedence===r)m=k;else if(m!==d)break}m?m.parentNode.insertBefore(t,m.nextSibling):(r=a.nodeType===9?a.head:a,r.insertBefore(t,r.firstChild))}function Ud(t,r){t.crossOrigin==null&&(t.crossOrigin=r.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=r.referrerPolicy),t.title==null&&(t.title=r.title)}function jd(t,r){t.crossOrigin==null&&(t.crossOrigin=r.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=r.referrerPolicy),t.integrity==null&&(t.integrity=r.integrity)}var Vo=null;function Vg(t,r,a){if(Vo===null){var s=new Map,d=Vo=new Map;d.set(a,s)}else d=Vo,s=d.get(a),s||(s=new Map,d.set(a,s));if(s.has(t))return s;for(s.set(t,null),a=a.getElementsByTagName(t),d=0;d<a.length;d++){var m=a[d];if(!(m[Ai]||m[Rt]||t==="link"&&m.getAttribute("rel")==="stylesheet")&&m.namespaceURI!=="http://www.w3.org/2000/svg"){var x=m.getAttribute(r)||"";x=t+x;var k=s.get(x);k?k.push(m):s.set(x,[m])}}return s}function Yg(t,r,a){t=t.ownerDocument||t,t.head.insertBefore(a,r==="title"?t.querySelector("head > title"):null)}function HE(t,r,a){if(a===1||r.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;switch(r.rel){case"stylesheet":return t=r.disabled,typeof r.precedence=="string"&&t==null;default:return!0}case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function Xg(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function PE(t,r,a,s){if(a.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var d=Ha(s.href),m=r.querySelector(Jl(d));if(m){r=m._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(t.count++,t=Yo.bind(t),r.then(t,t)),a.state.loading|=4,a.instance=m,zt(m);return}m=r.ownerDocument||r,s=Kg(s),(d=Kn.get(d))&&Ud(s,d),m=m.createElement("link"),zt(m);var x=m;x._p=new Promise(function(k,I){x.onload=k,x.onerror=I}),Zt(m,"link",s),a.instance=m}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(a,r),(r=a.state.preload)&&(a.state.loading&3)===0&&(t.count++,a=Yo.bind(t),r.addEventListener("load",a),r.addEventListener("error",a))}}var Hd=0;function FE(t,r){return t.stylesheets&&t.count===0&&Zo(t,t.stylesheets),0<t.count||0<t.imgCount?function(a){var s=setTimeout(function(){if(t.stylesheets&&Zo(t,t.stylesheets),t.unsuspend){var m=t.unsuspend;t.unsuspend=null,m()}},6e4+r);0<t.imgBytes&&Hd===0&&(Hd=62500*SE());var d=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Zo(t,t.stylesheets),t.unsuspend)){var m=t.unsuspend;t.unsuspend=null,m()}},(t.imgBytes>Hd?50:800)+r);return t.unsuspend=a,function(){t.unsuspend=null,clearTimeout(s),clearTimeout(d)}}:null}function Yo(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Zo(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Xo=null;function Zo(t,r){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Xo=new Map,r.forEach(GE,t),Xo=null,Yo.call(t))}function GE(t,r){if(!(r.state.loading&4)){var a=Xo.get(t);if(a)var s=a.get(null);else{a=new Map,Xo.set(t,a);for(var d=t.querySelectorAll("link[data-precedence],style[data-precedence]"),m=0;m<d.length;m++){var x=d[m];(x.nodeName==="LINK"||x.getAttribute("media")!=="not all")&&(a.set(x.dataset.precedence,x),s=x)}s&&a.set(null,s)}d=r.instance,x=d.getAttribute("data-precedence"),m=a.get(x)||s,m===s&&a.set(null,d),a.set(x,d),this.count++,s=Yo.bind(this),d.addEventListener("load",s),d.addEventListener("error",s),m?m.parentNode.insertBefore(d,m.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(d,t.firstChild)),r.state.loading|=4}}var ts={$$typeof:M,Provider:null,Consumer:null,_currentValue:P,_currentValue2:P,_threadCount:0};function $E(t,r,a,s,d,m,x,k,I){this.tag=1,this.containerInfo=t,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=vt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=vt(0),this.hiddenUpdates=vt(null),this.identifierPrefix=s,this.onUncaughtError=d,this.onCaughtError=m,this.onRecoverableError=x,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=I,this.incompleteTransitions=new Map}function Zg(t,r,a,s,d,m,x,k,I,Y,ne,le){return t=new $E(t,r,a,x,I,Y,ne,le,k),r=1,m===!0&&(r|=24),m=Cn(3,null,null,r),t.current=m,m.stateNode=t,r=vu(),r.refCount++,t.pooledCache=r,r.refCount++,m.memoizedState={element:s,isDehydrated:a,cache:r},_u(m),t}function Qg(t){return t?(t=ya,t):ya}function Wg(t,r,a,s,d,m){d=Qg(d),s.context===null?s.context=d:s.pendingContext=d,s=ni(r),s.payload={element:a},m=m===void 0?null:m,m!==null&&(s.callback=m),a=ri(t,s,r),a!==null&&(En(a,t,r),Dl(a,t,r))}function Jg(t,r){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var a=t.retryLane;t.retryLane=a!==0&&a<r?a:r}}function Pd(t,r){Jg(t,r),(t=t.alternate)&&Jg(t,r)}function eb(t){if(t.tag===13||t.tag===31){var r=Ii(t,67108864);r!==null&&En(r,t,67108864),Pd(t,67108864)}}function tb(t){if(t.tag===13||t.tag===31){var r=Dn();r=_t(r);var a=Ii(t,r);a!==null&&En(a,t,r),Pd(t,r)}}var Qo=!0;function KE(t,r,a,s){var d=j.T;j.T=null;var m=O.p;try{O.p=2,Fd(t,r,a,s)}finally{O.p=m,j.T=d}}function qE(t,r,a,s){var d=j.T;j.T=null;var m=O.p;try{O.p=8,Fd(t,r,a,s)}finally{O.p=m,j.T=d}}function Fd(t,r,a,s){if(Qo){var d=Gd(s);if(d===null)Cd(t,r,s,Wo,a),rb(t,s);else if(YE(d,t,r,a,s))s.stopPropagation();else if(rb(t,s),r&4&&-1<VE.indexOf(t)){for(;d!==null;){var m=Er(d);if(m!==null)switch(m.tag){case 3:if(m=m.stateNode,m.current.memoizedState.isDehydrated){var x=hn(m.pendingLanes);if(x!==0){var k=m;for(k.pendingLanes|=2,k.entangledLanes|=2;x;){var I=1<<31-rt(x);k.entanglements[1]|=I,x&=~I}ur(m),(et&6)===0&&(Lo=wt()+500,Xl(0))}}break;case 31:case 13:k=Ii(m,2),k!==null&&En(k,m,2),zo(),Pd(m,2)}if(m=Gd(s),m===null&&Cd(t,r,s,Wo,a),m===d)break;d=m}d!==null&&s.stopPropagation()}else Cd(t,r,s,null,a)}}function Gd(t){return t=ze(t),$d(t)}var Wo=null;function $d(t){if(Wo=null,t=ln(t),t!==null){var r=c(t);if(r===null)t=null;else{var a=r.tag;if(a===13){if(t=u(r),t!==null)return t;t=null}else if(a===31){if(t=f(r),t!==null)return t;t=null}else if(a===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;t=null}else r!==t&&(t=null)}}return Wo=t,null}function nb(t){switch(t){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(aa()){case te:return 2;case pe:return 8;case Ae:case He:return 32;case Qe:return 268435456;default:return 32}default:return 32}}var Kd=!1,pi=null,mi=null,gi=null,ns=new Map,rs=new Map,bi=[],VE="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 rb(t,r){switch(t){case"focusin":case"focusout":pi=null;break;case"dragenter":case"dragleave":mi=null;break;case"mouseover":case"mouseout":gi=null;break;case"pointerover":case"pointerout":ns.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":rs.delete(r.pointerId)}}function is(t,r,a,s,d,m){return t===null||t.nativeEvent!==m?(t={blockedOn:r,domEventName:a,eventSystemFlags:s,nativeEvent:m,targetContainers:[d]},r!==null&&(r=Er(r),r!==null&&eb(r)),t):(t.eventSystemFlags|=s,r=t.targetContainers,d!==null&&r.indexOf(d)===-1&&r.push(d),t)}function YE(t,r,a,s,d){switch(r){case"focusin":return pi=is(pi,t,r,a,s,d),!0;case"dragenter":return mi=is(mi,t,r,a,s,d),!0;case"mouseover":return gi=is(gi,t,r,a,s,d),!0;case"pointerover":var m=d.pointerId;return ns.set(m,is(ns.get(m)||null,t,r,a,s,d)),!0;case"gotpointercapture":return m=d.pointerId,rs.set(m,is(rs.get(m)||null,t,r,a,s,d)),!0}return!1}function ib(t){var r=ln(t.target);if(r!==null){var a=c(r);if(a!==null){if(r=a.tag,r===13){if(r=u(a),r!==null){t.blockedOn=r,oa(t.priority,function(){tb(a)});return}}else if(r===31){if(r=f(a),r!==null){t.blockedOn=r,oa(t.priority,function(){tb(a)});return}}else if(r===3&&a.stateNode.current.memoizedState.isDehydrated){t.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Jo(t){if(t.blockedOn!==null)return!1;for(var r=t.targetContainers;0<r.length;){var a=Gd(t.nativeEvent);if(a===null){a=t.nativeEvent;var s=new a.constructor(a.type,a);ke=s,a.target.dispatchEvent(s),ke=null}else return r=Er(a),r!==null&&eb(r),t.blockedOn=a,!1;r.shift()}return!0}function ab(t,r,a){Jo(t)&&a.delete(r)}function XE(){Kd=!1,pi!==null&&Jo(pi)&&(pi=null),mi!==null&&Jo(mi)&&(mi=null),gi!==null&&Jo(gi)&&(gi=null),ns.forEach(ab),rs.forEach(ab)}function ec(t,r){t.blockedOn===r&&(t.blockedOn=null,Kd||(Kd=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,XE)))}var tc=null;function lb(t){tc!==t&&(tc=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){tc===t&&(tc=null);for(var r=0;r<t.length;r+=3){var a=t[r],s=t[r+1],d=t[r+2];if(typeof s!="function"){if($d(s||a)===null)continue;break}var m=Er(a);m!==null&&(t.splice(r,3),r-=3,Gu(m,{pending:!0,data:d,method:a.method,action:s},s,d))}}))}function Fa(t){function r(I){return ec(I,t)}pi!==null&&ec(pi,t),mi!==null&&ec(mi,t),gi!==null&&ec(gi,t),ns.forEach(r),rs.forEach(r);for(var a=0;a<bi.length;a++){var s=bi[a];s.blockedOn===t&&(s.blockedOn=null)}for(;0<bi.length&&(a=bi[0],a.blockedOn===null);)ib(a),a.blockedOn===null&&bi.shift();if(a=(t.ownerDocument||t).$$reactFormReplay,a!=null)for(s=0;s<a.length;s+=3){var d=a[s],m=a[s+1],x=d[Wt]||null;if(typeof m=="function")x||lb(a);else if(x){var k=null;if(m&&m.hasAttribute("formAction")){if(d=m,x=m[Wt]||null)k=x.formAction;else if($d(d)!==null)continue}else k=x.action;typeof k=="function"?a[s+1]=k:(a.splice(s,3),s-=3),lb(a)}}}function sb(){function t(m){m.canIntercept&&m.info==="react-transition"&&m.intercept({handler:function(){return new Promise(function(x){return d=x})},focusReset:"manual",scroll:"manual"})}function r(){d!==null&&(d(),d=null),s||setTimeout(a,20)}function a(){if(!s&&!navigation.transition){var m=navigation.currentEntry;m&&m.url!=null&&navigation.navigate(m.url,{state:m.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var s=!1,d=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(a,100),function(){s=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),d!==null&&(d(),d=null)}}}function qd(t){this._internalRoot=t}nc.prototype.render=qd.prototype.render=function(t){var r=this._internalRoot;if(r===null)throw Error(l(409));var a=r.current,s=Dn();Wg(a,s,t,r,null,null)},nc.prototype.unmount=qd.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var r=t.containerInfo;Wg(t.current,2,null,t,null,null),zo(),r[Kr]=null}};function nc(t){this._internalRoot=t}nc.prototype.unstable_scheduleHydration=function(t){if(t){var r=sa();t={blockedOn:null,target:t,priority:r};for(var a=0;a<bi.length&&r!==0&&r<bi[a].priority;a++);bi.splice(a,0,t),a===0&&ib(t)}};var ob=n.version;if(ob!=="19.2.4")throw Error(l(527,ob,"19.2.4"));O.findDOMNode=function(t){var r=t._reactInternals;if(r===void 0)throw typeof t.render=="function"?Error(l(188)):(t=Object.keys(t).join(","),Error(l(268,t)));return t=p(r),t=t!==null?b(t):null,t=t===null?null:t.stateNode,t};var ZE={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:j,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var rc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!rc.isDisabled&&rc.supportsFiber)try{Kt=rc.inject(ZE),Ct=rc}catch{}}return ss.createRoot=function(t,r){if(!o(t))throw Error(l(299));var a=!1,s="",d=mm,m=gm,x=bm;return r!=null&&(r.unstable_strictMode===!0&&(a=!0),r.identifierPrefix!==void 0&&(s=r.identifierPrefix),r.onUncaughtError!==void 0&&(d=r.onUncaughtError),r.onCaughtError!==void 0&&(m=r.onCaughtError),r.onRecoverableError!==void 0&&(x=r.onRecoverableError)),r=Zg(t,1,!1,null,null,a,s,null,d,m,x,sb),t[Kr]=r.current,Td(t),new qd(r)},ss.hydrateRoot=function(t,r,a){if(!o(t))throw Error(l(299));var s=!1,d="",m=mm,x=gm,k=bm,I=null;return a!=null&&(a.unstable_strictMode===!0&&(s=!0),a.identifierPrefix!==void 0&&(d=a.identifierPrefix),a.onUncaughtError!==void 0&&(m=a.onUncaughtError),a.onCaughtError!==void 0&&(x=a.onCaughtError),a.onRecoverableError!==void 0&&(k=a.onRecoverableError),a.formState!==void 0&&(I=a.formState)),r=Zg(t,1,!0,r,a??null,s,d,I,m,x,k,sb),r.context=Qg(null),a=r.current,s=Dn(),s=_t(s),d=ni(s),d.callback=null,ri(a,d,s),a=s,r.current.lanes=a,ht(r,a),ur(r),t[Kr]=r.current,Td(t),new nc(r)},ss.version="19.2.4",ss}var Sb;function oS(){if(Sb)return Xd.exports;Sb=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(n){console.error(n)}}return e(),Xd.exports=sS(),Xd.exports}var cS=oS();const uS=Ds(cS);function dS(e,n){const i=getComputedStyle(e),l=parseFloat(i.fontSize);return n*l}function fS(e,n){const i=getComputedStyle(e.ownerDocument.body),l=parseFloat(i.fontSize);return n*l}function hS(e){return e/100*window.innerHeight}function pS(e){return e/100*window.innerWidth}function mS(e){switch(typeof e){case"number":return[e,"px"];case"string":{const n=parseFloat(e);return e.endsWith("%")?[n,"%"]:e.endsWith("px")?[n,"px"]:e.endsWith("rem")?[n,"rem"]:e.endsWith("em")?[n,"em"]:e.endsWith("vh")?[n,"vh"]:e.endsWith("vw")?[n,"vw"]:[n,"%"]}}}function ic({groupSize:e,panelElement:n,styleProp:i}){let l;const[o,c]=mS(i);switch(c){case"%":{l=o/100*e;break}case"px":{l=o;break}case"rem":{l=fS(n,o);break}case"em":{l=dS(n,o);break}case"vh":{l=hS(o);break}case"vw":{l=pS(o);break}}return l}function er(e){return parseFloat(e.toFixed(3))}function sl({group:e}){const{orientation:n,panels:i}=e;return i.reduce((l,o)=>(l+=n==="horizontal"?o.element.offsetWidth:o.element.offsetHeight,l),0)}function Df(e){const{panels:n}=e,i=sl({group:e});return i===0?n.map(l=>({collapsedSize:0,collapsible:l.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:l.panelConstraints.disabled,minSize:0,maxSize:100,panelId:l.id})):n.map(l=>{const{element:o,panelConstraints:c}=l;let u=0;if(c.collapsedSize!==void 0){const b=ic({groupSize:i,panelElement:o,styleProp:c.collapsedSize});u=er(b/i*100)}let f;if(c.defaultSize!==void 0){const b=ic({groupSize:i,panelElement:o,styleProp:c.defaultSize});f=er(b/i*100)}let h=0;if(c.minSize!==void 0){const b=ic({groupSize:i,panelElement:o,styleProp:c.minSize});h=er(b/i*100)}let p=100;if(c.maxSize!==void 0){const b=ic({groupSize:i,panelElement:o,styleProp:c.maxSize});p=er(b/i*100)}return{collapsedSize:u,collapsible:c.collapsible===!0,defaultSize:f,disabled:c.disabled,minSize:h,maxSize:p,panelId:l.id}})}function ot(e,n="Assertion error"){if(!e)throw Error(n)}function Lf(e,n){return Array.from(n).sort(e==="horizontal"?gS:bS)}function gS(e,n){const i=e.element.offsetLeft-n.element.offsetLeft;return i!==0?i:e.element.offsetWidth-n.element.offsetWidth}function bS(e,n){const i=e.element.offsetTop-n.element.offsetTop;return i!==0?i:e.element.offsetHeight-n.element.offsetHeight}function vv(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function xv(e,n){return{x:e.x>=n.left&&e.x<=n.right?0:Math.min(Math.abs(e.x-n.left),Math.abs(e.x-n.right)),y:e.y>=n.top&&e.y<=n.bottom?0:Math.min(Math.abs(e.y-n.top),Math.abs(e.y-n.bottom))}}function yS({orientation:e,rects:n,targetRect:i}){const l={x:i.x+i.width/2,y:i.y+i.height/2};let o,c=Number.MAX_VALUE;for(const u of n){const{x:f,y:h}=xv(l,u),p=e==="horizontal"?f:h;p<c&&(c=p,o=u)}return ot(o,"No rect found"),o}let ac;function vS(){return ac===void 0&&(typeof matchMedia=="function"?ac=!!matchMedia("(pointer:coarse)").matches:ac=!1),ac}function Ev(e){const{element:n,orientation:i,panels:l,separators:o}=e,c=Lf(i,Array.from(n.children).filter(vv).map(_=>({element:_}))).map(({element:_})=>_),u=[];let f=!1,h=!1,p=-1,b=-1,y=0,E,v=[];{let _=-1;for(const N of c)N.hasAttribute("data-panel")&&(_++,N.ariaDisabled===null&&(y++,p===-1&&(p=_),b=_))}if(y>1){let _=-1;for(const N of c)if(N.hasAttribute("data-panel")){_++;const T=l.find(S=>S.element===N);if(T){if(E){const S=E.element.getBoundingClientRect(),D=N.getBoundingClientRect();let M;if(h){const A=i==="horizontal"?new DOMRect(S.right,S.top,0,S.height):new DOMRect(S.left,S.bottom,S.width,0),F=i==="horizontal"?new DOMRect(D.left,D.top,0,D.height):new DOMRect(D.left,D.top,D.width,0);switch(v.length){case 0:{M=[A,F];break}case 1:{const L=v[0],X=yS({orientation:i,rects:[S,D],targetRect:L.element.getBoundingClientRect()});M=[L,X===S?F:A];break}default:{M=v;break}}}else v.length?M=v:M=[i==="horizontal"?new DOMRect(S.right,D.top,D.left-S.right,D.height):new DOMRect(D.left,S.bottom,D.width,D.top-S.bottom)];for(const A of M){let F="width"in A?A:A.element.getBoundingClientRect();const L=vS()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(F.width<L){const re=L-F.width;F=new DOMRect(F.x-re/2,F.y,F.width+re,F.height)}if(F.height<L){const re=L-F.height;F=new DOMRect(F.x,F.y-re/2,F.width,F.height+re)}const X=_<=p||_>b;!f&&!X&&u.push({group:e,groupSize:sl({group:e}),panels:[E,T],separator:"width"in A?void 0:A,rect:F}),f=!1}}h=!1,E=T,v=[]}}else if(N.hasAttribute("data-separator")){N.ariaDisabled!==null&&(f=!0);const T=o.find(S=>S.element===N);T?v.push(T):(E=void 0,v=[])}else h=!0}return u}var _i;class xS{constructor(){db(this,_i,{})}addListener(n,i){const l=as(this,_i)[n];return l===void 0?as(this,_i)[n]=[i]:l.includes(i)||l.push(i),()=>{this.removeListener(n,i)}}emit(n,i){const l=as(this,_i)[n];if(l!==void 0)if(l.length===1)l[0].call(null,i);else{let o=!1,c=null;const u=Array.from(l);for(let f=0;f<u.length;f++){const h=u[f];try{h.call(null,i)}catch(p){c===null&&(o=!0,c=p)}}if(o)throw c}}removeAllListeners(){fb(this,_i,{})}removeListener(n,i){const l=as(this,_i)[n];if(l!==void 0){const o=l.indexOf(i);o>=0&&l.splice(o,1)}}}_i=new WeakMap;function cn(e,n,i=0){return Math.abs(er(e)-er(n))<=i}let qn={cursorFlags:0,interactionState:{state:"inactive"},mountedGroups:new Map};const Hr=new xS;function dn(){return qn}function fn(e){const n=typeof e=="function"?e(qn):e;if(qn===n)return qn;const i=qn;return qn={...qn,...n},n.cursorFlags!==void 0&&Hr.emit("cursorFlagsChange",qn.cursorFlags),n.interactionState!==void 0&&Hr.emit("interactionStateChange",qn.interactionState),n.mountedGroups!==void 0&&(qn.mountedGroups.forEach((l,o)=>{l.derivedPanelConstraints.forEach(c=>{if(c.collapsible){const{layout:u}=i.mountedGroups.get(o)??{};if(u){const f=cn(c.collapsedSize,l.layout[c.panelId]),h=cn(c.collapsedSize,u[c.panelId]);f&&!h&&(o.inMemoryLastExpandedPanelSizes[c.panelId]=u[c.panelId])}}})}),Hr.emit("mountedGroupsChange",qn.mountedGroups)),qn}function ES(e,n,i){let l,o={x:1/0,y:1/0};for(const c of n){const u=xv(i,c.rect);switch(e){case"horizontal":{u.x<=o.x&&(l=c,o=u);break}case"vertical":{u.y<=o.y&&(l=c,o=u);break}}}return l?{distance:o,hitRegion:l}:void 0}function SS(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function _S(e,n){if(e===n)throw new Error("Cannot compare node with itself");const i={a:wb(e),b:wb(n)};let l;for(;i.a.at(-1)===i.b.at(-1);)l=i.a.pop(),i.b.pop();ot(l,"Stacking order can only be calculated for elements with a common ancestor");const o={a:kb(_b(i.a)),b:kb(_b(i.b))};if(o.a===o.b){const c=l.childNodes,u={a:i.a.at(-1),b:i.b.at(-1)};let f=c.length;for(;f--;){const h=c[f];if(h===u.a)return 1;if(h===u.b)return-1}}return Math.sign(o.a-o.b)}const kS=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function wS(e){const n=getComputedStyle(Sv(e)??e).display;return n==="flex"||n==="inline-flex"}function NS(e){const n=getComputedStyle(e);return!!(n.position==="fixed"||n.zIndex!=="auto"&&(n.position!=="static"||wS(e))||+n.opacity<1||"transform"in n&&n.transform!=="none"||"webkitTransform"in n&&n.webkitTransform!=="none"||"mixBlendMode"in n&&n.mixBlendMode!=="normal"||"filter"in n&&n.filter!=="none"||"webkitFilter"in n&&n.webkitFilter!=="none"||"isolation"in n&&n.isolation==="isolate"||kS.test(n.willChange)||n.webkitOverflowScrolling==="touch")}function _b(e){let n=e.length;for(;n--;){const i=e[n];if(ot(i,"Missing node"),NS(i))return i}return null}function kb(e){return e&&Number(getComputedStyle(e).zIndex)||0}function wb(e){const n=[];for(;e;)n.push(e),e=Sv(e);return n}function Sv(e){const{parentNode:n}=e;return SS(n)?n.host:n}function TS(e,n){return e.x<n.x+n.width&&e.x+e.width>n.x&&e.y<n.y+n.height&&e.y+e.height>n.y}function CS({groupElement:e,hitRegion:n,pointerEventTarget:i}){if(!vv(i)||i.contains(e)||e.contains(i))return!0;if(_S(i,e)>0){let l=i;for(;l;){if(l.contains(e))return!0;if(TS(l.getBoundingClientRect(),n))return!1;l=l.parentElement}}return!0}function rh(e,n){const i=[];return n.forEach((l,o)=>{if(o.disabled)return;const c=Ev(o),u=ES(o.orientation,c,{x:e.clientX,y:e.clientY});u&&u.distance.x<=0&&u.distance.y<=0&&CS({groupElement:o.element,hitRegion:u.hitRegion.rect,pointerEventTarget:e.target})&&i.push(u.hitRegion)}),i}function AS(e,n){if(e.length!==n.length)return!1;for(let i=0;i<e.length;i++)if(e[i]!=n[i])return!1;return!0}function hr(e,n){return cn(e,n)?0:e>n?1:-1}function Ja({overrideDisabledPanels:e,panelConstraints:n,prevSize:i,size:l}){const{collapsedSize:o=0,collapsible:c,disabled:u,maxSize:f=100,minSize:h=0}=n;if(u&&!e)return i;if(hr(l,h)<0)if(c){const p=(o+h)/2;hr(l,p)<0?l=o:l=h}else l=h;return l=Math.min(f,l),l=er(l),l}function Ns({delta:e,initialLayout:n,panelConstraints:i,pivotIndices:l,prevLayout:o,trigger:c}){if(cn(e,0))return n;const u=c==="imperative-api",f=Object.values(n),h=Object.values(o),p=[...f],[b,y]=l;ot(b!=null,"Invalid first pivot index"),ot(y!=null,"Invalid second pivot index");let E=0;switch(c){case"keyboard":{{const N=e<0?y:b,T=i[N];ot(T,`Panel constraints not found for index ${N}`);const{collapsedSize:S=0,collapsible:D,minSize:M=0}=T;if(D){const A=f[N];if(ot(A!=null,`Previous layout not found for panel index ${N}`),cn(A,S)){const F=M-A;hr(F,Math.abs(e))>0&&(e=e<0?0-F:F)}}}{const N=e<0?b:y,T=i[N];ot(T,`No panel constraints found for index ${N}`);const{collapsedSize:S=0,collapsible:D,minSize:M=0}=T;if(D){const A=f[N];if(ot(A!=null,`Previous layout not found for panel index ${N}`),cn(A,M)){const F=A-S;hr(F,Math.abs(e))>0&&(e=e<0?0-F:F)}}}break}default:{const N=e<0?y:b,T=i[N];ot(T,`Panel constraints not found for index ${N}`);const S=f[N],{collapsible:D,collapsedSize:M,minSize:A}=T;if(D&&hr(S,A)<0)if(e>0){const F=A-M,L=F/2,X=S+e;hr(X,A)<0&&(e=hr(e,L)<=0?0:F)}else{const F=A-M,L=100-F/2,X=S-e;hr(X,A)<0&&(e=hr(100+e,L)>0?0:-F)}break}}{const N=e<0?1:-1;let T=e<0?y:b,S=0;for(;;){const M=f[T];ot(M!=null,`Previous layout not found for panel index ${T}`);const A=Ja({overrideDisabledPanels:u,panelConstraints:i[T],prevSize:M,size:100})-M;if(S+=A,T+=N,T<0||T>=i.length)break}const D=Math.min(Math.abs(e),Math.abs(S));e=e<0?0-D:D}{let N=e<0?b:y;for(;N>=0&&N<i.length;){const T=Math.abs(e)-Math.abs(E),S=f[N];ot(S!=null,`Previous layout not found for panel index ${N}`);const D=S-T,M=Ja({overrideDisabledPanels:u,panelConstraints:i[N],prevSize:S,size:D});if(!cn(S,M)&&(E+=S-M,p[N]=M,E.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?N--:N++}}if(AS(h,p))return o;{const N=e<0?y:b,T=f[N];ot(T!=null,`Previous layout not found for panel index ${N}`);const S=T+E,D=Ja({overrideDisabledPanels:u,panelConstraints:i[N],prevSize:T,size:S});if(p[N]=D,!cn(D,S)){let M=S-D,A=e<0?y:b;for(;A>=0&&A<i.length;){const F=p[A];ot(F!=null,`Previous layout not found for panel index ${A}`);const L=F+M,X=Ja({overrideDisabledPanels:u,panelConstraints:i[A],prevSize:F,size:L});if(cn(F,X)||(M-=X-F,p[A]=X),cn(M,0))break;e>0?A--:A++}}}const v=Object.values(p).reduce((N,T)=>T+N,0);if(!cn(v,100,.1))return o;const _=Object.keys(o);return p.reduce((N,T,S)=>(N[_[S]]=T,N),{})}function Qi(e,n){if(Object.keys(e).length!==Object.keys(n).length)return!1;for(const i in e)if(n[i]===void 0||hr(e[i],n[i])!==0)return!1;return!0}function Wi({layout:e,panelConstraints:n}){const i=Object.values(e),l=[...i],o=l.reduce((f,h)=>f+h,0);if(l.length!==n.length)throw Error(`Invalid ${n.length} panel layout: ${l.map(f=>`${f}%`).join(", ")}`);if(!cn(o,100)&&l.length>0)for(let f=0;f<n.length;f++){const h=l[f];ot(h!=null,`No layout data found for index ${f}`);const p=100/o*h;l[f]=p}let c=0;for(let f=0;f<n.length;f++){const h=i[f];ot(h!=null,`No layout data found for index ${f}`);const p=l[f];ot(p!=null,`No layout data found for index ${f}`);const b=Ja({overrideDisabledPanels:!0,panelConstraints:n[f],prevSize:h,size:p});p!=b&&(c+=p-b,l[f]=b)}if(!cn(c,0))for(let f=0;f<n.length;f++){const h=l[f];ot(h!=null,`No layout data found for index ${f}`);const p=h+c,b=Ja({overrideDisabledPanels:!0,panelConstraints:n[f],prevSize:h,size:p});if(h!==b&&(c-=b-h,l[f]=b,cn(c,0)))break}const u=Object.keys(e);return l.reduce((f,h,p)=>(f[u[p]]=h,f),{})}function _v({groupId:e,panelId:n}){const i=()=>{const{mountedGroups:f}=dn();for(const[h,{defaultLayoutDeferred:p,derivedPanelConstraints:b,layout:y,separatorToPanels:E}]of f)if(h.id===e)return{defaultLayoutDeferred:p,derivedPanelConstraints:b,group:h,layout:y,separatorToPanels:E};throw Error(`Group ${e} not found`)},l=()=>{const f=i().derivedPanelConstraints.find(h=>h.panelId===n);if(f!==void 0)return f;throw Error(`Panel constraints not found for Panel ${n}`)},o=()=>{const f=i().group.panels.find(h=>h.id===n);if(f!==void 0)return f;throw Error(`Layout not found for Panel ${n}`)},c=()=>{const f=i().layout[n];if(f!==void 0)return f;throw Error(`Layout not found for Panel ${n}`)},u=f=>{const h=c();if(f===h)return;const{defaultLayoutDeferred:p,derivedPanelConstraints:b,group:y,layout:E,separatorToPanels:v}=i(),_=y.panels.findIndex(D=>D.id===n),N=_===y.panels.length-1,T=Ns({delta:N?h-f:f-h,initialLayout:E,panelConstraints:b,pivotIndices:N?[_-1,_]:[_,_+1],prevLayout:E,trigger:"imperative-api"}),S=Wi({layout:T,panelConstraints:b});Qi(E,S)||fn(D=>({mountedGroups:new Map(D.mountedGroups).set(y,{defaultLayoutDeferred:p,derivedPanelConstraints:b,layout:S,separatorToPanels:v})}))};return{collapse:()=>{const{collapsible:f,collapsedSize:h}=l(),{mutableValues:p}=o(),b=c();f&&b!==h&&(p.expandToSize=b,u(h))},expand:()=>{const{collapsible:f,collapsedSize:h,minSize:p}=l(),{mutableValues:b}=o(),y=c();if(f&&y===h){let E=b.expandToSize??p;E===0&&(E=1),u(E)}},getSize:()=>{const{group:f}=i(),h=c(),{element:p}=o(),b=f.orientation==="horizontal"?p.offsetWidth:p.offsetHeight;return{asPercentage:h,inPixels:b}},isCollapsed:()=>{const{collapsible:f,collapsedSize:h}=l(),p=c();return f&&cn(h,p)},resize:f=>{if(c()!==f){let h;switch(typeof f){case"number":{const{group:p}=i(),b=sl({group:p});h=er(f/b*100);break}case"string":{h=parseFloat(f);break}}u(h)}}}}function Nb(e){if(e.defaultPrevented)return;const{mountedGroups:n}=dn();rh(e,n).forEach(i=>{if(i.separator){const l=i.panels.find(o=>o.panelConstraints.defaultSize!==void 0);if(l){const o=l.panelConstraints.defaultSize,c=_v({groupId:i.group.id,panelId:l.id});c&&o!==void 0&&(c.resize(o),e.preventDefault())}}})}function vc(e){const{mountedGroups:n}=dn();for(const[i]of n)if(i.separators.some(l=>l.element===e))return i;throw Error("Could not find parent Group for separator element")}function kv({groupId:e}){const n=()=>{const{mountedGroups:i}=dn();for(const[l,o]of i)if(l.id===e)return{group:l,...o};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){const{defaultLayoutDeferred:i,layout:l}=n();return i?{}:l},setLayout(i){const{defaultLayoutDeferred:l,derivedPanelConstraints:o,group:c,layout:u,separatorToPanels:f}=n(),h=Wi({layout:i,panelConstraints:o});if(l)return u;if(!Qi(u,h)){fn(b=>({mountedGroups:new Map(b.mountedGroups).set(c,{defaultLayoutDeferred:l,derivedPanelConstraints:o,layout:h,separatorToPanels:f})}));const p=c.panels.map(({id:b})=>b).join(",");c.inMemoryLayouts[p]=h}return h}}}function wv(e){const{mountedGroups:n}=dn(),i=n.get(e);return ot(i,`Mounted Group ${e.id} not found`),i}function Yi(e,n){const i=vc(e),l=wv(i),o=i.separators.find(b=>b.element===e);ot(o,"Matching separator not found");const c=l.separatorToPanels.get(o);ot(c,"Matching panels not found");const u=c.map(b=>i.panels.indexOf(b)),f=kv({groupId:i.id}).getLayout(),h=Ns({delta:n,initialLayout:f,panelConstraints:l.derivedPanelConstraints,pivotIndices:u,prevLayout:f,trigger:"keyboard"}),p=Wi({layout:h,panelConstraints:l.derivedPanelConstraints});Qi(f,p)||fn(b=>({mountedGroups:new Map(b.mountedGroups).set(i,{defaultLayoutDeferred:l.defaultLayoutDeferred,derivedPanelConstraints:l.derivedPanelConstraints,layout:p,separatorToPanels:l.separatorToPanels})}))}function Tb(e){if(e.defaultPrevented)return;const n=e.currentTarget,i=vc(n);if(!i.disabled)switch(e.key){case"ArrowDown":{e.preventDefault(),i.orientation==="vertical"&&Yi(n,5);break}case"ArrowLeft":{e.preventDefault(),i.orientation==="horizontal"&&Yi(n,-5);break}case"ArrowRight":{e.preventDefault(),i.orientation==="horizontal"&&Yi(n,5);break}case"ArrowUp":{e.preventDefault(),i.orientation==="vertical"&&Yi(n,-5);break}case"End":{e.preventDefault(),Yi(n,100);break}case"Enter":{e.preventDefault();const l=vc(n),{derivedPanelConstraints:o,layout:c,separatorToPanels:u}=wv(l),f=l.separators.find(y=>y.element===n);ot(f,"Matching separator not found");const h=u.get(f);ot(h,"Matching panels not found");const p=h[0],b=o.find(y=>y.panelId===p.id);if(ot(b,"Panel metadata not found"),b.collapsible){const y=c[p.id],E=b.collapsedSize===y?l.inMemoryLastExpandedPanelSizes[p.id]??b.minSize:b.collapsedSize;Yi(n,E-y)}break}case"F6":{e.preventDefault();const l=vc(n).separators.map(u=>u.element),o=Array.from(l).findIndex(u=>u===e.currentTarget);ot(o!==null,"Index not found");const c=e.shiftKey?o>0?o-1:l.length-1:o+1<l.length?o+1:0;l[c].focus();break}case"Home":{e.preventDefault(),Yi(n,-100);break}}}function Cb(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const{mountedGroups:n}=dn(),i=rh(e,n),l=new Map;let o=!1;i.forEach(c=>{c.separator&&(o||(o=!0,c.separator.element.focus()));const u=n.get(c.group);u&&l.set(c.group,u.layout)}),fn({interactionState:{hitRegions:i,initialLayoutMap:l,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:"active"}}),i.length&&e.preventDefault()}const OS=e=>e,Jd=()=>{},Nv=1,Tv=2,Cv=4,Av=8,Ab=3,Ob=12;let lc;function Mb(){return lc===void 0&&(lc=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(lc=!0)),lc}function MS({cursorFlags:e,groups:n,state:i}){let l=0,o=0;switch(i){case"active":case"hover":n.forEach(c=>{if(!c.disableCursor)switch(c.orientation){case"horizontal":{l++;break}case"vertical":{o++;break}}})}if(!(l===0&&o===0)){switch(i){case"active":{if(e&&Mb()){const c=(e&Nv)!==0,u=(e&Tv)!==0,f=(e&Cv)!==0,h=(e&Av)!==0;if(c)return f?"se-resize":h?"ne-resize":"e-resize";if(u)return f?"sw-resize":h?"nw-resize":"w-resize";if(f)return"s-resize";if(h)return"n-resize"}break}}return Mb()?l>0&&o>0?"move":l>0?"ew-resize":"ns-resize":l>0&&o>0?"grab":l>0?"col-resize":"row-resize"}}const Rb=new WeakMap;function ih(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:n,styleSheet:i}=Rb.get(e)??{};i===void 0&&(i=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets.push(i));const{cursorFlags:l,interactionState:o}=dn();switch(o.state){case"active":case"hover":{const c=MS({cursorFlags:l,groups:o.hitRegions.map(f=>f.group),state:o.state}),u=`*, *:hover {cursor: ${c} !important; ${o.state==="active"?"touch-action: none;":""} }`;if(n===u)return;n=u,c?i.cssRules.length===0?i.insertRule(u):i.replaceSync(u):i.cssRules.length===1&&i.deleteRule(0);break}case"inactive":{n=void 0,i.cssRules.length===1&&i.deleteRule(0);break}}Rb.set(e,{prevStyle:n,styleSheet:i})}function Ov({document:e,event:n,hitRegions:i,initialLayoutMap:l,mountedGroups:o,pointerDownAtPoint:c,prevCursorFlags:u}){let f=0;const h=new Map(o);i.forEach(b=>{const{group:y,groupSize:E}=b,{disableCursor:v,orientation:_,panels:N}=y;let T=0;c?_==="horizontal"?T=(n.clientX-c.x)/E*100:T=(n.clientY-c.y)/E*100:_==="horizontal"?T=n.clientX<0?-100:100:T=n.clientY<0?-100:100;const S=l.get(y),{defaultLayoutDeferred:D,derivedPanelConstraints:M,layout:A,separatorToPanels:F}=o.get(y)??{defaultLayoutDeferred:!1};if(M&&S&&A&&F){const L=Ns({delta:T,initialLayout:S,panelConstraints:M,pivotIndices:b.panels.map(X=>N.indexOf(X)),prevLayout:A,trigger:"mouse-or-touch"});if(Qi(L,A)){if(T!==0&&!v)switch(_){case"horizontal":{f|=T<0?Nv:Tv;break}case"vertical":{f|=T<0?Cv:Av;break}}}else{h.set(b.group,{defaultLayoutDeferred:D,derivedPanelConstraints:M,layout:L,separatorToPanels:F});const X=b.group.panels.map(({id:re})=>re).join(",");b.group.inMemoryLayouts[X]=L}}});let p=0;n.movementX===0?p|=u&Ab:p|=f&Ab,n.movementY===0?p|=u&Ob:p|=f&Ob,fn({cursorFlags:p,mountedGroups:h}),ih(e)}function Db(e){const{cursorFlags:n,interactionState:i,mountedGroups:l}=dn();switch(i.state){case"active":Ov({document:e.currentTarget,event:e,hitRegions:i.hitRegions,initialLayoutMap:i.initialLayoutMap,mountedGroups:l,prevCursorFlags:n})}}function Lb(e){if(e.defaultPrevented)return;const{cursorFlags:n,interactionState:i,mountedGroups:l}=dn();switch(i.state){case"active":{if(e.buttons===0){fn(o=>o.interactionState.state==="inactive"?o:{cursorFlags:0,interactionState:{state:"inactive"}}),fn(o=>({mountedGroups:new Map(o.mountedGroups)}));return}Ov({document:e.currentTarget,event:e,hitRegions:i.hitRegions,initialLayoutMap:i.initialLayoutMap,mountedGroups:l,pointerDownAtPoint:i.pointerDownAtPoint,prevCursorFlags:n});break}default:{const o=rh(e,l);o.length===0?i.state!=="inactive"&&fn({interactionState:{state:"inactive"}}):fn({interactionState:{hitRegions:o,state:"hover"}}),ih(e.currentTarget);break}}}function Ib(e){if(e.relatedTarget instanceof HTMLIFrameElement){const{interactionState:n}=dn();switch(n.state){case"hover":fn({interactionState:{state:"inactive"}})}}}function zb(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const{interactionState:n}=dn();switch(n.state){case"active":fn({cursorFlags:0,interactionState:{state:"inactive"}}),n.hitRegions.length>0&&(ih(e.currentTarget),fn(i=>({mountedGroups:new Map(i.mountedGroups)})),e.preventDefault())}}function Bb(e){let n=0,i=0;const l={};for(const c of e)if(c.defaultSize!==void 0){n++;const u=er(c.defaultSize);i+=u,l[c.panelId]=u}else l[c.panelId]=void 0;const o=e.length-n;if(o!==0){const c=er((100-i)/o);for(const u of e)u.defaultSize===void 0&&(l[u.panelId]=c)}return l}function RS(e,n,i){if(!i[0])return;const l=e.panels.find(h=>h.element===n);if(!l||!l.onResize)return;const o=sl({group:e}),c=e.orientation==="horizontal"?l.element.offsetWidth:l.element.offsetHeight,u=l.mutableValues.prevSize,f={asPercentage:er(c/o*100),inPixels:c};l.mutableValues.prevSize=f,l.onResize(f,l.id,u)}function DS(e,n){if(Object.keys(e).length!==Object.keys(n).length)return!1;for(const i in e)if(e[i]!==n[i])return!1;return!0}function LS(e,n){const i=e.map(o=>o.id),l=Object.keys(n);if(i.length!==l.length)return!1;for(const o of i)if(!l.includes(o))return!1;return!0}const $a=new Map;function IS(e){let n=!0;ot(e.element.ownerDocument.defaultView,"Cannot register an unmounted Group");const i=e.element.ownerDocument.defaultView.ResizeObserver,l=new Set,o=new Set,c=new i(_=>{for(const N of _){const{borderBoxSize:T,target:S}=N;if(S===e.element){if(n){if(sl({group:e})===0)return;fn(D=>{const M=D.mountedGroups.get(e);if(M){const A=Df(e),F=M.defaultLayoutDeferred?Bb(A):M.layout,L=Wi({layout:F,panelConstraints:A});return!M.defaultLayoutDeferred&&Qi(F,L)&&DS(M.derivedPanelConstraints,A)?D:{mountedGroups:new Map(D.mountedGroups).set(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:A,layout:L,separatorToPanels:M.separatorToPanels})}}return D})}}else RS(e,S,T)}});c.observe(e.element),e.panels.forEach(_=>{ot(!l.has(_.id),`Panel ids must be unique; id "${_.id}" was used more than once`),l.add(_.id),_.onResize&&c.observe(_.element)});const u=sl({group:e}),f=Df(e),h=e.panels.map(({id:_})=>_).join(",");let p=e.defaultLayout;p&&(LS(e.panels,p)||(p=void 0));const b=e.inMemoryLayouts[h]??p??Bb(f),y=Wi({layout:b,panelConstraints:f}),E=Ev(e),v=e.element.ownerDocument;return fn(_=>{const N=new Map;return $a.set(v,($a.get(v)??0)+1),E.forEach(T=>{T.separator&&N.set(T.separator,T.panels)}),{mountedGroups:new Map(_.mountedGroups).set(e,{defaultLayoutDeferred:u===0,derivedPanelConstraints:f,layout:y,separatorToPanels:N})}}),e.separators.forEach(_=>{ot(!o.has(_.id),`Separator ids must be unique; id "${_.id}" was used more than once`),o.add(_.id),_.element.addEventListener("keydown",Tb)}),$a.get(v)===1&&(v.addEventListener("dblclick",Nb,!0),v.addEventListener("pointerdown",Cb,!0),v.addEventListener("pointerleave",Db),v.addEventListener("pointermove",Lb),v.addEventListener("pointerout",Ib),v.addEventListener("pointerup",zb,!0)),function(){n=!1,$a.set(v,Math.max(0,($a.get(v)??0)-1)),fn(_=>{const N=new Map(_.mountedGroups);return N.delete(e),{mountedGroups:N}}),e.separators.forEach(_=>{_.element.removeEventListener("keydown",Tb)}),$a.get(v)||(v.removeEventListener("dblclick",Nb,!0),v.removeEventListener("pointerdown",Cb,!0),v.removeEventListener("pointerleave",Db),v.removeEventListener("pointermove",Lb),v.removeEventListener("pointerout",Ib),v.removeEventListener("pointerup",zb,!0)),c.disconnect()}}function zS(){const[e,n]=U.useState({}),i=U.useCallback(()=>n({}),[]);return[e,i]}function ah(e){const n=U.useId();return`${e??n}`}const ea=typeof window<"u"?U.useLayoutEffect:U.useEffect;function ys(e){const n=U.useRef(e);return ea(()=>{n.current=e},[e]),U.useCallback((...i)=>{var l;return(l=n.current)==null?void 0:l.call(n,...i)},[n])}function lh(...e){return ys(n=>{e.forEach(i=>{if(i)switch(typeof i){case"function":{i(n);break}case"object":{i.current=n;break}}})})}function sh(e){const n=U.useRef({...e});return ea(()=>{for(const i in e)n.current[i]=e[i]},[e]),n.current}const Mv=U.createContext(null);function BS(e,n){const i=U.useRef({getLayout:()=>({}),setLayout:OS});U.useImperativeHandle(n,()=>i.current,[]),ea(()=>{Object.assign(i.current,kv({groupId:e}))})}function Ts({children:e,className:n,defaultLayout:i,disableCursor:l,disabled:o,elementRef:c,groupRef:u,id:f,onLayoutChange:h,onLayoutChanged:p,orientation:b="horizontal",resizeTargetMinimumSize:y={coarse:20,fine:10},style:E,...v}){const _=U.useRef({onLayoutChange:{},onLayoutChanged:{}}),N=ys(Q=>{Qi(_.current.onLayoutChange,Q)||(_.current.onLayoutChange=Q,h==null||h(Q))}),T=ys(Q=>{Qi(_.current.onLayoutChanged,Q)||(_.current.onLayoutChanged=Q,p==null||p(Q))}),S=ah(f),D=U.useRef(null),[M,A]=zS(),F=U.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:y,separators:[]}),L=lh(D,c);BS(S,u);const X=ys((Q,ee)=>{const{interactionState:me,mountedGroups:se}=dn();for(const $ of se.keys())if($.id===Q){const j=se.get($);if(j){let O=!1;switch(me.state){case"active":{O=me.hitRegions.some(P=>P.group===$);break}}return{flexGrow:j.layout[ee]??1,pointerEvents:O?"none":void 0}}}return{flexGrow:(i==null?void 0:i[ee])??1}}),re=sh({defaultLayout:i,disableCursor:l}),oe=U.useMemo(()=>({get disableCursor(){return!!re.disableCursor},getPanelStyles:X,id:S,orientation:b,registerPanel:Q=>{const ee=F.current;return ee.panels=Lf(b,[...ee.panels,Q]),A(),()=>{ee.panels=ee.panels.filter(me=>me!==Q),A()}},registerSeparator:Q=>{const ee=F.current;return ee.separators=Lf(b,[...ee.separators,Q]),A(),()=>{ee.separators=ee.separators.filter(me=>me!==Q),A()}},togglePanelDisabled:(Q,ee)=>{const me=F.current.panels.find($=>$.id===Q);me&&(me.panelConstraints.disabled=ee);const{mountedGroups:se}=dn();for(const $ of se.keys())if($.id===S){const j=se.get($);j&&(j.derivedPanelConstraints=Df($))}},toggleSeparatorDisabled:(Q,ee)=>{const me=F.current.separators.find(se=>se.id===Q);me&&(me.disabled=ee)}}),[X,S,A,b,re]),B=U.useRef(null);return ea(()=>{const Q=D.current;if(Q===null)return;const ee=F.current;let me;if(re.defaultLayout!==void 0&&Object.keys(re.defaultLayout).length===ee.panels.length){me={};for(const J of ee.panels){const C=re.defaultLayout[J.id];C!==void 0&&(me[J.id]=C)}}const se={defaultLayout:me,disableCursor:!!re.disableCursor,disabled:!!o,element:Q,id:S,inMemoryLastExpandedPanelSizes:F.current.lastExpandedPanelSizes,inMemoryLayouts:F.current.layouts,orientation:b,panels:ee.panels,resizeTargetMinimumSize:ee.resizeTargetMinimumSize,separators:ee.separators};B.current=se;const $=IS(se),j=dn().mountedGroups.get(se);if(j){const{defaultLayoutDeferred:J,derivedPanelConstraints:C,layout:R}=j;!J&&C.length>0&&(N(R),T(R))}const O=Hr.addListener("interactionStateChange",J=>{J.state}),P=Hr.addListener("mountedGroupsChange",J=>{const C=J.get(se);if(C){const{defaultLayoutDeferred:R,derivedPanelConstraints:q,layout:w}=C;if(R||q.length===0)return;const{interactionState:ue}=dn(),ye=ue.state!=="active";N(w),ye&&T(w)}});return()=>{B.current=null,$(),O(),P()}},[o,S,T,N,b,M,re]),U.useEffect(()=>{const Q=B.current;Q&&(Q.defaultLayout=i,Q.disableCursor=!!l)}),g.jsx(Mv.Provider,{value:oe,children:g.jsx("div",{...v,className:n,"data-group":!0,"data-testid":S,id:S,ref:L,style:{height:"100%",width:"100%",overflow:"hidden",...E,display:"flex",flexDirection:b==="horizontal"?"row":"column",flexWrap:"nowrap"},children:e})})}Ts.displayName="Group";function ef(e,n){return`react-resizable-panels:${[e,...n].join(":")}`}function kc({debounceSaveMs:e=100,panelIds:n,storage:i=localStorage,...l}){const o=n!==void 0,c="id"in l?l.id:l.groupId,u=ef(c,n??[]),f=U.useSyncExternalStore(US,()=>i.getItem(u),()=>i.getItem(u)),h=U.useMemo(()=>f?JSON.parse(f):void 0,[f]),p=U.useRef(null),b=U.useCallback(()=>{const v=p.current;v&&(p.current=null,clearTimeout(v))},[]);U.useLayoutEffect(()=>()=>{b()},[b]);const y=U.useCallback(v=>{b();let _;o?_=ef(c,Object.keys(v)):_=ef(c,[]);try{i.setItem(_,JSON.stringify(v))}catch(N){console.error(N)}},[b,o,c,i]),E=U.useCallback(v=>{b(),e===0?y(v):p.current=setTimeout(()=>{y(v)},e)},[b,e,y]);return{defaultLayout:h,onLayoutChange:E,onLayoutChanged:y}}function US(){return function(){}}function oh(){const e=U.useContext(Mv);return ot(e,"Group Context not found; did you render a Panel or Separator outside of a Group?"),e}function jS(e,n){const{id:i}=oh(),l=U.useRef({collapse:Jd,expand:Jd,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:Jd});U.useImperativeHandle(n,()=>l.current,[]),ea(()=>{Object.assign(l.current,_v({groupId:i,panelId:e}))})}function pr({children:e,className:n,collapsedSize:i="0%",collapsible:l=!1,defaultSize:o,disabled:c,elementRef:u,id:f,maxSize:h="100%",minSize:p="0%",onResize:b,panelRef:y,style:E,...v}){const _=!!f,N=ah(f),T=sh({disabled:c}),S=U.useRef(null),D=lh(S,u),{getPanelStyles:M,id:A,registerPanel:F,togglePanelDisabled:L}=oh(),X=b!==null,re=ys((B,Q,ee)=>{b==null||b(B,f,ee)});ea(()=>{const B=S.current;if(B!==null){const Q={element:B,id:N,idIsStable:_,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:X?re:void 0,panelConstraints:{collapsedSize:i,collapsible:l,defaultSize:o,disabled:T.disabled,maxSize:h,minSize:p}};return F(Q)}},[i,l,o,X,N,_,h,p,re,F,T]),U.useEffect(()=>{L(N,!!c)},[c,N,L]),jS(N,y);const oe=U.useSyncExternalStore(B=>(Hr.addListener("mountedGroupsChange",B),()=>{Hr.removeListener("mountedGroupsChange",B)}),()=>JSON.stringify(M(A,N)),()=>JSON.stringify(M(A,N)));return g.jsx("div",{...v,"aria-disabled":c||void 0,"data-panel":!0,"data-testid":N,id:N,ref:D,style:{...HS,display:"flex",flexBasis:0,flexShrink:1,overflow:"hidden",...JSON.parse(oe)},children:g.jsx("div",{className:n,style:{maxHeight:"100%",maxWidth:"100%",flexGrow:1,...E},children:e})})}pr.displayName="Panel";const HS={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function PS({layout:e,panelConstraints:n,panelId:i,panelIndex:l}){let o,c;const u=e[i],f=n.find(h=>h.panelId===i);if(f){const h=f.maxSize,p=f.collapsible?f.collapsedSize:f.minSize,b=[l,l+1];c=Wi({layout:Ns({delta:p-u,initialLayout:e,panelConstraints:n,pivotIndices:b,prevLayout:e}),panelConstraints:n})[i],o=Wi({layout:Ns({delta:h-u,initialLayout:e,panelConstraints:n,pivotIndices:b,prevLayout:e}),panelConstraints:n})[i]}return{valueControls:i,valueMax:o,valueMin:c,valueNow:u}}function Rv({children:e,className:n,disabled:i,elementRef:l,id:o,style:c,...u}){const f=ah(o),h=sh({disabled:i}),[p,b]=U.useState({}),[y,E]=U.useState("inactive"),v=U.useRef(null),_=lh(v,l),{disableCursor:N,id:T,orientation:S,registerSeparator:D,toggleSeparatorDisabled:M}=oh(),A=S==="horizontal"?"vertical":"horizontal";ea(()=>{const L=v.current;if(L!==null){const X={disabled:h.disabled,element:L,id:f},re=D(X),oe=Hr.addListener("interactionStateChange",Q=>{E(Q.state!=="inactive"&&Q.hitRegions.some(ee=>ee.separator===X)?Q.state:"inactive")}),B=Hr.addListener("mountedGroupsChange",Q=>{Q.forEach(({derivedPanelConstraints:ee,layout:me,separatorToPanels:se},$)=>{if($.id===T){const j=se.get(X);if(j){const O=j[0],P=$.panels.indexOf(O);b(PS({layout:me,panelConstraints:ee,panelId:O.id,panelIndex:P}))}}})});return()=>{oe(),B(),re()}}},[T,f,D,h]),U.useEffect(()=>{M(f,!!i)},[i,f,M]);let F;return i&&!N&&(F="not-allowed"),g.jsx("div",{...u,"aria-controls":p.valueControls,"aria-disabled":i||void 0,"aria-orientation":A,"aria-valuemax":p.valueMax,"aria-valuemin":p.valueMin,"aria-valuenow":p.valueNow,children:e,className:n,"data-separator":i?"disabled":y,"data-testid":f,id:f,ref:_,role:"separator",style:{flexBasis:"auto",cursor:F,...c,flexGrow:0,flexShrink:0},tabIndex:i?void 0:0})}Rv.displayName="Separator";const ch={user:null,activeView:"messages",agents:[],selectedAgentId:null,selectedSessionKey:null,channels:[],selectedChannelId:null,sessions:[],selectedSessionId:null,tasks:[],selectedTaskId:null,jobs:[],selectedJobId:null,messages:[],threadMessages:[],activeThreadId:null,threadReplyCounts:{},openclawConnected:!1,sessionModel:null,wsConnected:!1,models:[],defaultModel:null,streamingRunId:null,streamingSessionKey:null,streamingThreadId:null,cronTasks:[],selectedCronTaskId:null,cronJobs:[],selectedCronJobId:null};function FS(e,n){switch(n.type){case"SET_USER":return{...e,user:n.user};case"SET_ACTIVE_VIEW":return{...e,activeView:n.view};case"SET_AGENTS":return{...e,agents:n.agents};case"SELECT_AGENT":return{...e,selectedAgentId:n.agentId,selectedSessionKey:n.sessionKey,sessions:[],selectedSessionId:null,messages:[],jobs:[],selectedJobId:null,activeThreadId:null,threadMessages:[]};case"SET_CHANNELS":return{...e,channels:n.channels};case"SELECT_CHANNEL":return{...e,selectedChannelId:n.channelId,sessions:[],selectedSessionId:null,tasks:[],selectedTaskId:null,jobs:[],selectedJobId:null,messages:[]};case"SET_SESSIONS":return{...e,sessions:n.sessions};case"SELECT_SESSION":{const i=n.sessionKey??e.selectedSessionKey,l=i!==e.selectedSessionKey;return{...e,selectedSessionId:n.sessionId,selectedSessionKey:i,messages:l?[]:e.messages,activeThreadId:l?null:e.activeThreadId,threadMessages:l?[]:e.threadMessages}}case"ADD_SESSION":return{...e,sessions:[...e.sessions,n.session]};case"REMOVE_SESSION":return{...e,sessions:e.sessions.filter(i=>i.id!==n.sessionId),...e.selectedSessionId===n.sessionId?{selectedSessionId:null,selectedSessionKey:null,messages:[]}:{}};case"RENAME_SESSION":return{...e,sessions:e.sessions.map(i=>i.id===n.sessionId?{...i,name:n.name}:i)};case"SET_TASKS":return{...e,tasks:n.tasks};case"SELECT_TASK":{const i=n.sessionKey??e.selectedSessionKey,l=i!==e.selectedSessionKey;return{...e,selectedTaskId:n.taskId,selectedSessionKey:i,messages:l?[]:e.messages,jobs:[],selectedJobId:null}}case"SET_JOBS":return{...e,jobs:n.jobs};case"SELECT_JOB":return{...e,selectedJobId:n.jobId,selectedSessionKey:n.sessionKey??e.selectedSessionKey,messages:[]};case"ADD_JOB":return{...e,jobs:[n.job,...e.jobs]};case"ADD_MESSAGE":{const i=e.messages[e.messages.length-1];return n.message.sender==="agent"&&(i!=null&&i.isStreaming)?{...e,streamingRunId:null,streamingSessionKey:null,messages:[...e.messages.slice(0,-1),{...n.message,isStreaming:!1}]}:{...e,messages:[...e.messages,n.message]}}case"SET_MESSAGES":return{...e,messages:n.messages,...n.replyCounts?{threadReplyCounts:{...e.threadReplyCounts,...n.replyCounts}}:{}};case"OPEN_THREAD":return{...e,activeThreadId:n.threadId,threadMessages:n.messages,threadReplyCounts:{...e.threadReplyCounts,...n.messages.length>0?{[n.threadId]:n.messages.length}:{}}};case"CLOSE_THREAD":return{...e,activeThreadId:null,threadMessages:[]};case"ADD_THREAD_MESSAGE":{const i=n.message.threadId??e.activeThreadId,l=!!(i&&i===e.activeThreadId);let o=e.threadMessages,c={};if(l){const f=e.threadMessages[e.threadMessages.length-1];n.message.sender==="agent"&&(f!=null&&f.isStreaming)?(o=[...e.threadMessages.slice(0,-1),{...n.message,isStreaming:!1}],c={streamingRunId:null,streamingSessionKey:null,streamingThreadId:null}):o=[...e.threadMessages,n.message]}const u={...e.threadReplyCounts};return i&&(l?u[i]=o.length:u[i]=(u[i]??0)+1),{...e,...c,threadMessages:o,threadReplyCounts:u}}case"SET_OPENCLAW_CONNECTED":return{...e,openclawConnected:n.connected,defaultModel:n.defaultModel??e.defaultModel};case"SET_SESSION_MODEL":return{...e,sessionModel:n.model};case"SET_WS_CONNECTED":return{...e,wsConnected:n.connected};case"SET_MODELS":return{...e,models:n.models};case"SET_DEFAULT_MODEL":return{...e,defaultModel:n.model};case"RESOLVE_ACTION":return{...e,messages:e.messages.map(i=>i.id===n.messageId?{...i,resolvedActions:{...i.resolvedActions,[n.promptHash]:{value:n.value,label:n.label}}}:i)};case"STREAM_START":{const i={id:`stream_${n.runId}`,sender:"agent",text:"",timestamp:Date.now(),isStreaming:!0},l=!!n.threadId;return{...e,streamingRunId:n.runId,streamingSessionKey:n.sessionKey,streamingThreadId:n.threadId??null,...l?{threadMessages:[...e.threadMessages,i]}:{messages:[...e.messages,i]}}}case"STREAM_CHUNK":{if(e.streamingRunId!==n.runId)return e;const i=`stream_${n.runId}`;return e.streamingThreadId?{...e,threadMessages:e.threadMessages.map(l=>l.id===i?{...l,text:n.text}:l)}:{...e,messages:e.messages.map(l=>l.id===i?{...l,text:n.text}:l)}}case"STREAM_END":return e.streamingRunId&&e.streamingRunId!==n.runId?e:{...e,streamingRunId:null,streamingSessionKey:null,streamingThreadId:null};case"SET_CRON_TASKS":return{...e,cronTasks:n.cronTasks};case"MERGE_SCAN_DATA":{const i=new Map(n.scanTasks.map(c=>[c.cronJobId,c])),l=e.cronTasks.map(c=>{const u=c.openclawCronJobId?i.get(c.openclawCronJobId):null;return u?{...c,schedule:u.schedule||null,instructions:u.instructions||null,model:u.model||null,enabled:u.enabled}:c}),o=e.tasks.map(c=>{const u=c.openclawCronJobId?i.get(c.openclawCronJobId):null;return u?{...c,schedule:u.schedule||null,instructions:u.instructions||null,model:u.model||null,enabled:u.enabled}:c});return{...e,cronTasks:l,tasks:o}}case"UPDATE_CRON_TASK":return{...e,cronTasks:e.cronTasks.map(i=>i.id===n.taskId?{...i,...n.updates}:i),tasks:e.tasks.map(i=>i.id===n.taskId?{...i,...n.updates}:i)};case"SELECT_CRON_TASK":return e.selectedCronTaskId===n.taskId?e:{...e,selectedCronTaskId:n.taskId,cronJobs:[],selectedCronJobId:null,messages:[],selectedSessionKey:null};case"SET_CRON_JOBS":return{...e,cronJobs:n.cronJobs};case"SELECT_CRON_JOB":return{...e,selectedCronJobId:n.jobId,selectedSessionKey:n.sessionKey??e.selectedSessionKey,messages:[]};case"ADD_CRON_JOB":return{...e,cronJobs:[n.job,...e.cronJobs]};case"UPDATE_CRON_JOB":return e.cronJobs.some(l=>l.id===n.job.id)?{...e,cronJobs:e.cronJobs.map(l=>{var c;if(l.id!==n.job.id)return l;const o=l.summary&&l.summary.length>(((c=n.job.summary)==null?void 0:c.length)||0)?l.summary:n.job.summary;return{...l,...n.job,summary:o}})}:{...e,cronJobs:[n.job,...e.cronJobs]};case"APPEND_JOB_OUTPUT":{const i=l=>l.map(o=>o.id===n.jobId?{...o,summary:n.text}:o);return{...e,jobs:i(e.jobs),cronJobs:i(e.cronJobs)}}case"LOGOUT":return{...ch};default:return e}}const ps=U.createContext(ch),ms=U.createContext(()=>{});function nr(){return U.useContext(ps)}function Fr(){return U.useContext(ms)}const Ub=500;let GS=1;const el=[],wc=new Set;function Ka(e,n,i,l){const o={id:GS++,ts:Date.now(),level:e,tag:n,message:i,detail:l!==void 0?typeof l=="string"?l:JSON.stringify(l,null,2):void 0};el.push(o),el.length>Ub&&el.splice(0,el.length-Ub);for(const c of wc)c()}function $S(){return el}function KS(){el.length=0;for(const e of wc)e()}function qS(e){return wc.add(e),()=>wc.delete(e)}const ce={info:(e,n,i)=>Ka("info",e,n,i),warn:(e,n,i)=>Ka("warn",e,n,i),error:(e,n,i)=>Ka("error",e,n,i),wsIn:(e,n,i)=>Ka("ws-in",e,n,i),wsOut:(e,n,i)=>Ka("ws-out",e,n,i),api:(e,n,i)=>Ka("api",e,n,i)},If="/api";let vs=localStorage.getItem("botschat_token"),Nc=localStorage.getItem("botschat_refresh_token");function Ls(e){vs=e,e?localStorage.setItem("botschat_token",e):localStorage.removeItem("botschat_token")}function Bc(e){Nc=e,e?localStorage.setItem("botschat_refresh_token",e):localStorage.removeItem("botschat_refresh_token")}function jb(){return vs}async function VS(){if(!Nc)return!1;try{const e=await fetch(`${If}/auth/refresh`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:Nc})});if(!e.ok)return!1;const n=await e.json();return Ls(n.token),ce.info("API","Access token refreshed successfully"),!0}catch{return!1}}async function nt(e,n,i){const l=`${e} ${n}`;ce.api("API",`→ ${l}`,i);const o={"Content-Type":"application/json"};vs&&(o.Authorization=`Bearer ${vs}`);const c=performance.now();let u;try{u=await fetch(`${If}${n}`,{method:e,headers:o,body:i?JSON.stringify(i):void 0,cache:"no-store"})}catch(p){const b=Math.round(performance.now()-c);throw ce.error("API",`✗ ${l} — network error (${b}ms)`,String(p)),p}if(u.status===401&&Nc&&!n.includes("/auth/refresh")&&await VS()){o.Authorization=`Bearer ${vs}`;try{u=await fetch(`${If}${n}`,{method:e,headers:o,body:i?JSON.stringify(i):void 0,cache:"no-store"})}catch(b){const y=Math.round(performance.now()-c);throw ce.error("API",`✗ ${l} — network error on retry (${y}ms)`,String(b)),b}}const f=Math.round(performance.now()-c);if(!u.ok){const b=(await u.json().catch(()=>({error:u.statusText}))).error??`HTTP ${u.status}`;throw ce.error("API",`✗ ${l} — ${u.status} (${f}ms): ${b}`),new Error(b)}const h=await u.json();return ce.api("API",`✓ ${l} — ${u.status} (${f}ms)`,h),h}const xc={config:()=>nt("GET","/auth/config"),register:(e,n,i)=>nt("POST","/auth/register",{email:e,password:n,displayName:i}),login:(e,n)=>nt("POST","/auth/login",{email:e,password:n}),firebase:e=>nt("POST","/auth/firebase",{idToken:e}),me:()=>nt("GET","/me")},YS={updateSettings:e=>nt("PATCH","/me",e)},XS={list:()=>nt("GET","/models")},nl={list:()=>nt("GET","/agents")},mr={list:()=>nt("GET","/channels"),get:e=>nt("GET",`/channels/${e}`),create:e=>nt("POST","/channels",e),update:(e,n)=>nt("PATCH",`/channels/${e}`,n),delete:e=>nt("DELETE",`/channels/${e}`)},tl={list:e=>nt("GET",`/channels/${e}/sessions`),create:(e,n)=>nt("POST",`/channels/${e}/sessions`,{name:n}),rename:(e,n,i)=>nt("PATCH",`/channels/${e}/sessions/${n}`,{name:i}),delete:(e,n)=>nt("DELETE",`/channels/${e}/sessions/${n}`)},Vn={list:e=>nt("GET",`/channels/${e}/tasks`),listAll:(e="background")=>nt("GET",`/tasks?kind=${e}`),scanData:()=>nt("GET","/task-scan"),create:(e,n)=>nt("POST",`/channels/${e}/tasks`,n),update:(e,n,i)=>nt("PATCH",`/channels/${e}/tasks/${n}`,i),delete:(e,n)=>nt("DELETE",`/channels/${e}/tasks/${n}`),run:(e,n)=>nt("POST",`/channels/${e}/tasks/${n}/run`)},zf={list:(e,n)=>nt("GET",`/channels/${e}/tasks/${n}/jobs`),listByTask:e=>nt("GET",`/tasks/${e}/jobs`)},Dv={list:(e,n,i)=>nt("GET",`/messages/${e}?sessionKey=${encodeURIComponent(n)}${i?`&threadId=${encodeURIComponent(i)}`:""}`)},gs={list:()=>nt("GET","/pairing-tokens"),create:e=>nt("POST","/pairing-tokens",{label:e}),delete:e=>nt("DELETE",`/pairing-tokens/${e}`)},Lv={cloudUrl:()=>nt("GET","/setup/cloud-url")};function Uc({value:e,onChange:n,models:i,disabled:l,placeholder:o="Select model...",compact:c}){const f=!i.find(N=>N.id===e)&&e?i.find(N=>N.name===e):null,h=f?f.id:e,p=!h||i.some(N=>N.id===h);U.useEffect(()=>{f&&e!==f.id&&n(f.id)},[f,e,n]);const b=U.useRef(null),[y,E]=U.useState(void 0),v=h||o,_=U.useCallback(()=>{if(!c||!b.current)return;const N=getComputedStyle(b.current),S=document.createElement("canvas").getContext("2d");if(!S)return;S.font=`${N.fontSize} ${N.fontFamily}`;const D=S.measureText(v).width,M=parseFloat(N.paddingLeft)||6,A=parseFloat(N.paddingRight)||6;E(Math.ceil(D)+M+A+22)},[c,v]);return U.useEffect(()=>{_()},[_]),g.jsxs("select",{ref:b,value:h,onChange:N=>n(N.target.value),disabled:l,className:`rounded-sm focus:outline-none ${c?"text-caption py-0.5 px-1.5":"text-body py-1.5 px-2.5"}`,style:{background:c?"transparent":"var(--bg-hover)",color:h?"var(--text-primary)":"var(--text-muted)",border:c?"1px solid transparent":"1px solid var(--border)",cursor:l?"not-allowed":"pointer",opacity:l?.5:1,width:c&&y?y:void 0,maxWidth:"100%",fontFamily:"var(--font-mono)",textOverflow:"ellipsis",overflow:"hidden"},children:[!h&&g.jsx("option",{value:"",children:o}),h&&!p&&g.jsx("option",{value:h,children:h}),i.map(N=>g.jsx("option",{value:N.id,children:N.id},N.id))]})}class ZS{constructor(n){Ga(this,"ws",null);Ga(this,"reconnectTimer",null);Ga(this,"backoffMs",1e3);Ga(this,"intentionalClose",!1);Ga(this,"_connected",!1);this.opts=n}get connected(){return this._connected}connect(){this.intentionalClose=!1;const i=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/ws/${this.opts.userId}/${this.opts.sessionId}`;ce.info("WS",`Connecting to ${i}`),this.ws=new WebSocket(i),this.ws.onopen=()=>{ce.info("WS","Socket opened, sending auth"),this.ws.send(JSON.stringify({type:"auth",token:this.opts.token}))},this.ws.onmessage=l=>{try{const o=JSON.parse(l.data);o.type==="auth.ok"?(ce.info("WS","Auth OK — connected"),this.backoffMs=1e3,this._connected=!0,this.opts.onStatusChange(!0)):this.opts.onMessage(o)}catch{ce.warn("WS","Failed to parse incoming message",l.data)}},this.ws.onclose=l=>{this._connected=!1,this.opts.onStatusChange(!1),this.intentionalClose?ce.info("WS","Connection closed (intentional)"):(ce.warn("WS",`Connection closed (code=${l.code}), reconnecting in ${this.backoffMs}ms`),this.reconnectTimer=setTimeout(()=>{this.backoffMs=Math.min(this.backoffMs*2,3e4),this.connect()},this.backoffMs))},this.ws.onerror=()=>{ce.error("WS","WebSocket error (close event will follow)")}}send(n){var i,l;((i=this.ws)==null?void 0:i.readyState)===WebSocket.OPEN?this.ws.send(JSON.stringify(n)):ce.warn("WS",`Cannot send — socket not open (readyState=${(l=this.ws)==null?void 0:l.readyState})`,n)}disconnect(){var n;this.intentionalClose=!0,this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),(n=this.ws)==null||n.close(),this.ws=null,this._connected=!1,this.opts.onStatusChange(!1)}}function QS({onToggleTheme:e,onOpenSettings:n,theme:i}){var b,y,E,v,_,N,T,S,D,M;const l=nr(),o=Fr(),[c,u]=Si.useState(!1),f=()=>{var A;ce.info("Auth",`Logout — user ${(A=l.user)==null?void 0:A.email}`),Ls(null),Bc(null),o({type:"LOGOUT"})},h=A=>{ce.info("Nav",`Switch view → ${A}`),o({type:"SET_ACTIVE_VIEW",view:A})},p=((E=(y=(b=l.user)==null?void 0:b.displayName)==null?void 0:y[0])==null?void 0:E.toUpperCase())??((N=(_=(v=l.user)==null?void 0:v.email)==null?void 0:_[0])==null?void 0:N.toUpperCase())??"?";return g.jsxs("div",{className:"flex flex-col items-center py-3 gap-2 h-full",style:{width:48,background:"var(--bg-primary)",borderRight:"1px solid var(--border)"},children:[g.jsx("button",{className:"w-8 h-8 rounded-lg flex items-center justify-center overflow-hidden hover:rounded-xl transition-all",title:"BotsChat",children:g.jsx("img",{src:"/botschat-logo.png",alt:"BotsChat",className:"w-8 h-8"})}),g.jsx("div",{className:"w-7 border-t my-1",style:{borderColor:"var(--sidebar-divider)"}}),g.jsx(os,{label:"Home",active:!1,icon:g.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 12l8.954-8.955a1.126 1.126 0 011.591 0L21.75 12M4.5 9.75v10.125c0 .621.504 1.125 1.125 1.125H9.75v-4.875c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21h4.125c.621 0 1.125-.504 1.125-1.125V9.75M8.25 21h8.25"})})}),g.jsx(os,{label:"Messages",active:l.activeView==="messages",onClick:()=>h("messages"),icon:g.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.25 8.511c.884.284 1.5 1.128 1.5 2.097v4.286c0 1.136-.847 2.1-1.98 2.193-.34.027-.68.052-1.02.072v3.091l-3-3c-1.354 0-2.694-.055-4.02-.163a2.115 2.115 0 01-.825-.242m9.345-8.334a2.126 2.126 0 00-.476-.095 48.64 48.64 0 00-8.048 0c-1.131.094-1.976 1.057-1.976 2.192v4.286c0 .837.46 1.58 1.155 1.951m9.345-8.334V6.637c0-1.621-1.152-3.026-2.76-3.235A48.455 48.455 0 0011.25 3c-2.115 0-4.198.137-6.24.402-1.608.209-2.76 1.614-2.76 3.235v6.226c0 1.621 1.152 3.026 2.76 3.235.577.075 1.157.14 1.74.194V21l4.155-4.155"})})}),g.jsx(os,{label:"Automations",active:l.activeView==="automations",onClick:()=>h("automations"),icon:g.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z"})})}),g.jsx("div",{className:"flex-1"}),g.jsx(os,{label:"Settings",active:!1,onClick:n,icon:g.jsxs("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:[g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.324.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 011.37.49l1.296 2.247a1.125 1.125 0 01-.26 1.431l-1.003.827c-.293.24-.438.613-.431.992a6.759 6.759 0 010 .255c-.007.378.138.75.43.99l1.005.828c.424.35.534.954.26 1.43l-1.298 2.247a1.125 1.125 0 01-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.57 6.57 0 01-.22.128c-.331.183-.581.495-.644.869l-.213 1.28c-.09.543-.56.941-1.11.941h-2.594c-.55 0-1.02-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 01-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 01-1.369-.49l-1.297-2.247a1.125 1.125 0 01.26-1.431l1.004-.827c.292-.24.437-.613.43-.992a6.932 6.932 0 010-.255c.007-.378-.138-.75-.43-.99l-1.004-.828a1.125 1.125 0 01-.26-1.43l1.297-2.247a1.125 1.125 0 011.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.087.22-.128.332-.183.582-.495.644-.869l.214-1.281z"}),g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]})}),g.jsx(os,{label:i==="dark"?"Light mode":"Dark mode",active:!1,onClick:e,icon:i==="dark"?g.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3v2.25m6.364.386l-1.591 1.591M21 12h-2.25m-.386 6.364l-1.591-1.591M12 18.75V21m-4.773-4.227l-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0z"})}):g.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21.752 15.002A9.718 9.718 0 0118 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 003 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 009.002-5.998z"})})}),g.jsxs("div",{className:"relative",children:[g.jsx("button",{onClick:()=>u(!c),className:"w-6 h-6 rounded flex items-center justify-center text-[10px] font-bold text-white mt-1 cursor-pointer",style:{background:"#9B59B6"},title:((T=l.user)==null?void 0:T.displayName)??((S=l.user)==null?void 0:S.email)??"User",children:p}),c&&g.jsx("div",{className:"fixed inset-0 z-50",onClick:()=>u(!1),children:g.jsxs("div",{className:"absolute rounded-lg py-1 min-w-[200px]",style:{bottom:12,left:56,background:"var(--bg-surface)",border:"1px solid var(--border)",boxShadow:"0 4px 12px rgba(0,0,0,0.15)"},onClick:A=>A.stopPropagation(),children:[g.jsxs("div",{className:"px-4 py-2.5",style:{borderBottom:"1px solid var(--border)"},children:[g.jsx("div",{className:"text-body font-bold",style:{color:"var(--text-primary)"},children:((D=l.user)==null?void 0:D.displayName)??"User"}),g.jsx("div",{className:"text-caption",style:{color:"var(--text-muted)"},children:(M=l.user)==null?void 0:M.email})]}),g.jsxs("button",{className:"w-full text-left px-4 py-2.5 text-body flex items-center gap-2.5",style:{color:"var(--accent-red)"},onClick:()=>{f(),u(!1)},onMouseEnter:A=>{A.currentTarget.style.background="var(--sidebar-hover)"},onMouseLeave:A=>{A.currentTarget.style.background=""},children:[g.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 9V5.25A2.25 2.25 0 0013.5 3h-6a2.25 2.25 0 00-2.25 2.25v13.5A2.25 2.25 0 007.5 21h6a2.25 2.25 0 002.25-2.25V15m3 0l3-3m0 0l-3-3m3 3H9"})}),"Logout"]})]})})]})]})}function os({label:e,active:n,icon:i,onClick:l}){return g.jsxs("div",{className:"relative flex items-center justify-center",children:[n&&g.jsx("div",{className:"absolute left-0 w-[3px] h-5 rounded-r-sm",style:{left:-4,background:"var(--text-sidebar-active)"}}),g.jsx("button",{onClick:l,className:`w-8 h-8 rounded-lg flex items-center justify-center transition-colors ${n?"text-[--text-sidebar-active]":"text-[--text-sidebar] hover:text-[--text-sidebar-active]"}`,style:n?{background:"var(--sidebar-hover)"}:void 0,onMouseEnter:o=>{n||(o.currentTarget.style.background="var(--sidebar-hover)")},onMouseLeave:o=>{n||(o.currentTarget.style.background="")},title:e,"aria-label":e,children:i})]})}function Iv(){const e=nr(),n=Fr(),[i,l]=U.useState(!1),[o,c]=U.useState(""),[u,f]=U.useState(""),[h,p]=U.useState(!0),b=async()=>{if(o.trim()){ce.info("Channel",`Creating channel: "${o}"${u?` (${u})`:""}`);try{await mr.create({name:o,description:u});const{agents:S}=await nl.list(),{channels:D}=await mr.list();n({type:"SET_AGENTS",agents:S}),n({type:"SET_CHANNELS",channels:D});const M=S.find(A=>A.name===o.trim());if(M){ce.info("Channel",`Channel created → agent ${M.id}, auto-selected`),n({type:"SELECT_AGENT",agentId:M.id,sessionKey:M.sessionKey});try{localStorage.setItem("botschat_last_agent",M.id)}catch{}}l(!1),c(""),f("")}catch(S){ce.error("Channel",`Failed to create channel: ${S}`)}}},[y,E]=U.useState(null),v=(S,D)=>{if(e.selectedAgentId===S)return;const M=e.agents.find(A=>A.id===S);ce.info("Channel",`Selected channel: ${(M==null?void 0:M.name)??S} (session=${D})`),n({type:"SELECT_AGENT",agentId:S,sessionKey:D});try{localStorage.setItem("botschat_last_agent",S)}catch{}},_=async S=>{const D=e.channels.find(M=>M.id===S);ce.info("Channel",`Deleting channel: ${(D==null?void 0:D.name)??S}`);try{await mr.delete(S),ce.info("Channel",`Channel deleted: ${(D==null?void 0:D.name)??S}`);const M=e.agents.find(L=>L.channelId===S);M&&e.selectedAgentId===M.id&&n({type:"SELECT_AGENT",agentId:null,sessionKey:null});const{agents:A}=await nl.list(),{channels:F}=await mr.list();n({type:"SET_AGENTS",agents:A}),n({type:"SET_CHANNELS",channels:F})}catch(M){ce.error("Channel",`Failed to delete channel: ${M}`)}finally{E(null)}},N=e.agents.filter(S=>S.isDefault),T=e.agents.filter(S=>!S.isDefault&&S.name!=="Default");return g.jsxs("div",{className:"flex flex-col h-full",style:{background:"var(--bg-secondary)"},children:[g.jsxs("div",{className:"px-4 py-3 flex items-center gap-2",children:[g.jsx("span",{className:"text-[--text-sidebar-active] font-bold text-h2 truncate flex-1",children:"BotsChat"}),g.jsx("svg",{className:"w-3 h-3 text-[--text-sidebar]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),g.jsx("div",{className:"px-4 pb-2",children:g.jsxs("div",{className:"flex items-center gap-1.5",children:[g.jsx("div",{className:"w-2 h-2 rounded-full",style:{background:e.openclawConnected?"var(--accent-green)":"var(--accent-red)"}}),g.jsx("span",{className:"text-tiny text-[--text-muted]",children:e.openclawConnected?"OpenClaw connected":"OpenClaw offline"})]})}),g.jsxs("div",{className:"flex-1 overflow-y-auto sidebar-scroll",children:[g.jsx(WS,{label:"Channels",expanded:h,onToggle:()=>p(!h)}),h&&g.jsxs("div",{children:[N.map(S=>g.jsx(Hb,{label:`# ${S.name}`,active:e.selectedAgentId===S.id,onClick:()=>v(S.id,S.sessionKey)},S.id)),T.map(S=>g.jsx(Hb,{label:`# ${S.name}`,active:e.selectedAgentId===S.id,onClick:()=>v(S.id,S.sessionKey),showDelete:!0,confirmDelete:y===S.channelId,onDeleteClick:D=>{D.stopPropagation(),E(S.channelId)},onDeleteConfirm:D=>{D.stopPropagation(),S.channelId&&_(S.channelId)},onDeleteCancel:D=>{D.stopPropagation(),E(null)}},S.id)),T.length===0&&N.length===0&&g.jsx("div",{className:"px-8 py-2 text-tiny text-[--text-muted]",children:"Loading channels…"})]})]}),i?g.jsxs("div",{className:"p-3 space-y-2",style:{borderTop:"1px solid var(--sidebar-border)"},children:[g.jsx("input",{type:"text",placeholder:"Channel name",value:o,onChange:S=>c(S.target.value),onKeyDown:S=>S.key==="Enter"&&!S.nativeEvent.isComposing&&b(),className:"w-full px-2 py-1.5 text-caption text-[--text-sidebar] rounded-sm focus:outline-none placeholder:text-[--text-muted]",style:{background:"var(--sidebar-hover)",border:"1px solid var(--sidebar-border)"},autoFocus:!0}),g.jsx("input",{type:"text",placeholder:"Description (optional)",value:u,onChange:S=>f(S.target.value),className:"w-full px-2 py-1.5 text-caption text-[--text-sidebar] rounded-sm focus:outline-none placeholder:text-[--text-muted]",style:{background:"var(--sidebar-hover)",border:"1px solid var(--sidebar-border)"}}),g.jsxs("div",{className:"flex gap-2",children:[g.jsx("button",{onClick:b,className:"flex-1 px-3 py-1.5 text-caption bg-[--bg-active] text-white rounded-sm font-bold hover:brightness-110",children:"Create"}),g.jsx("button",{onClick:()=>l(!1),className:"px-3 py-1.5 text-caption text-[--text-muted] hover:text-[--text-sidebar]",children:"Cancel"})]})]}):g.jsx("div",{className:"p-3",style:{borderTop:"1px solid var(--sidebar-border)"},children:g.jsx("button",{onClick:()=>l(!0),className:"w-full px-3 py-1.5 text-caption text-[--text-sidebar] hover:text-[--text-sidebar-active] rounded-sm border border-dashed transition-colors",style:{borderColor:"var(--sidebar-divider)"},children:"+ New channel"})})]})}function WS({label:e,expanded:n,onToggle:i}){return g.jsxs("button",{onClick:i,className:"w-full flex items-center gap-1 px-4 py-1.5 text-tiny uppercase tracking-wider text-[--text-sidebar] hover:text-[--text-sidebar-active] transition-colors",children:[g.jsx("svg",{className:`w-3 h-3 transition-transform ${n?"rotate-0":"-rotate-90"}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})}),e]})}function Hb({label:e,active:n,onClick:i,showDelete:l,confirmDelete:o,onDeleteClick:c,onDeleteConfirm:u,onDeleteCancel:f}){const[h,p]=U.useState(!1),b=U.useRef(null);return U.useEffect(()=>{if(!o)return;const y=E=>{b.current&&!b.current.contains(E.target)&&(f==null||f(E))};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[o,f]),o?g.jsxs("div",{ref:b,className:"px-4 py-1.5 flex items-center gap-1.5",style:{paddingLeft:32,background:"var(--sidebar-hover)"},children:[g.jsx("span",{className:"text-caption text-[--text-sidebar] truncate flex-1",children:"Delete?"}),g.jsx("button",{onClick:u,className:"px-1.5 py-0.5 text-tiny rounded-sm font-bold text-white",style:{background:"var(--accent-red, #e53935)"},children:"Yes"}),g.jsx("button",{onClick:f,className:"px-1.5 py-0.5 text-tiny rounded-sm text-[--text-muted] hover:text-[--text-sidebar]",children:"No"})]}):g.jsxs("div",{className:"relative group",onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),children:[g.jsx("button",{onClick:i,className:"w-full text-left py-[5px] text-body truncate transition-colors",onMouseEnter:y=>{n||(y.currentTarget.style.background="var(--sidebar-hover)")},onMouseLeave:y=>{n||(y.currentTarget.style.background=n?"var(--bg-hover)":"")},style:{paddingLeft:n?29:32,paddingRight:l?28:void 0,background:n?"var(--bg-hover)":void 0,borderLeft:n?"3px solid var(--bg-active)":"3px solid transparent",color:n?"var(--text-sidebar-active)":"var(--text-sidebar)",fontWeight:n?700:void 0},children:e}),l&&h&&g.jsx("button",{onClick:c,className:"absolute right-2 top-1/2 -translate-y-1/2 w-5 h-5 flex items-center justify-center rounded-sm text-[--text-muted] hover:text-[--accent-red] hover:bg-[--sidebar-hover] transition-colors",title:"Delete channel",children:g.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]})}function JS(e,n){const i={};return(e[e.length-1]===""?[...e,""]:e).join((i.padRight?" ":"")+","+(i.padLeft===!1?"":" ")).trim()}const e_=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,t_=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,n_={};function Pb(e,n){return(n_.jsx?t_:e_).test(e)}const r_=/[ \t\n\f\r]/g;function i_(e){return typeof e=="object"?e.type==="text"?Fb(e.value):!1:Fb(e)}function Fb(e){return e.replace(r_,"")===""}class Is{constructor(n,i,l){this.normal=i,this.property=n,l&&(this.space=l)}}Is.prototype.normal={};Is.prototype.property={};Is.prototype.space=void 0;function zv(e,n){const i={},l={};for(const o of e)Object.assign(i,o.property),Object.assign(l,o.normal);return new Is(i,l,n)}function Bf(e){return e.toLowerCase()}class _n{constructor(n,i){this.attribute=i,this.property=n}}_n.prototype.attribute="";_n.prototype.booleanish=!1;_n.prototype.boolean=!1;_n.prototype.commaOrSpaceSeparated=!1;_n.prototype.commaSeparated=!1;_n.prototype.defined=!1;_n.prototype.mustUseProperty=!1;_n.prototype.number=!1;_n.prototype.overloadedBoolean=!1;_n.prototype.property="";_n.prototype.spaceSeparated=!1;_n.prototype.space=void 0;let a_=0;const je=ta(),Ft=ta(),Uf=ta(),he=ta(),yt=ta(),rl=ta(),Ln=ta();function ta(){return 2**++a_}const jf=Object.freeze(Object.defineProperty({__proto__:null,boolean:je,booleanish:Ft,commaOrSpaceSeparated:Ln,commaSeparated:rl,number:he,overloadedBoolean:Uf,spaceSeparated:yt},Symbol.toStringTag,{value:"Module"})),tf=Object.keys(jf);class uh extends _n{constructor(n,i,l,o){let c=-1;if(super(n,i),Gb(this,"space",o),typeof l=="number")for(;++c<tf.length;){const u=tf[c];Gb(this,tf[c],(l&jf[u])===jf[u])}}}uh.prototype.defined=!0;function Gb(e,n,i){i&&(e[n]=i)}function cl(e){const n={},i={};for(const[l,o]of Object.entries(e.properties)){const c=new uh(l,e.transform(e.attributes||{},l),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(l)&&(c.mustUseProperty=!0),n[l]=c,i[Bf(l)]=l,i[Bf(c.attribute)]=l}return new Is(n,i,e.space)}const Bv=cl({properties:{ariaActiveDescendant:null,ariaAtomic:Ft,ariaAutoComplete:null,ariaBusy:Ft,ariaChecked:Ft,ariaColCount:he,ariaColIndex:he,ariaColSpan:he,ariaControls:yt,ariaCurrent:null,ariaDescribedBy:yt,ariaDetails:null,ariaDisabled:Ft,ariaDropEffect:yt,ariaErrorMessage:null,ariaExpanded:Ft,ariaFlowTo:yt,ariaGrabbed:Ft,ariaHasPopup:null,ariaHidden:Ft,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:yt,ariaLevel:he,ariaLive:null,ariaModal:Ft,ariaMultiLine:Ft,ariaMultiSelectable:Ft,ariaOrientation:null,ariaOwns:yt,ariaPlaceholder:null,ariaPosInSet:he,ariaPressed:Ft,ariaReadOnly:Ft,ariaRelevant:null,ariaRequired:Ft,ariaRoleDescription:yt,ariaRowCount:he,ariaRowIndex:he,ariaRowSpan:he,ariaSelected:Ft,ariaSetSize:he,ariaSort:null,ariaValueMax:he,ariaValueMin:he,ariaValueNow:he,ariaValueText:null,role:null},transform(e,n){return n==="role"?n:"aria-"+n.slice(4).toLowerCase()}});function Uv(e,n){return n in e?e[n]:n}function jv(e,n){return Uv(e,n.toLowerCase())}const l_=cl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:rl,acceptCharset:yt,accessKey:yt,action:null,allow:null,allowFullScreen:je,allowPaymentRequest:je,allowUserMedia:je,alt:null,as:null,async:je,autoCapitalize:null,autoComplete:yt,autoFocus:je,autoPlay:je,blocking:yt,capture:null,charSet:null,checked:je,cite:null,className:yt,cols:he,colSpan:null,content:null,contentEditable:Ft,controls:je,controlsList:yt,coords:he|rl,crossOrigin:null,data:null,dateTime:null,decoding:null,default:je,defer:je,dir:null,dirName:null,disabled:je,download:Uf,draggable:Ft,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:je,formTarget:null,headers:yt,height:he,hidden:Uf,high:he,href:null,hrefLang:null,htmlFor:yt,httpEquiv:yt,id:null,imageSizes:null,imageSrcSet:null,inert:je,inputMode:null,integrity:null,is:null,isMap:je,itemId:null,itemProp:yt,itemRef:yt,itemScope:je,itemType:yt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:je,low:he,manifest:null,max:null,maxLength:he,media:null,method:null,min:null,minLength:he,multiple:je,muted:je,name:null,nonce:null,noModule:je,noValidate:je,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:je,optimum:he,pattern:null,ping:yt,placeholder:null,playsInline:je,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:je,referrerPolicy:null,rel:yt,required:je,reversed:je,rows:he,rowSpan:he,sandbox:yt,scope:null,scoped:je,seamless:je,selected:je,shadowRootClonable:je,shadowRootDelegatesFocus:je,shadowRootMode:null,shape:null,size:he,sizes:null,slot:null,span:he,spellCheck:Ft,src:null,srcDoc:null,srcLang:null,srcSet:null,start:he,step:null,style:null,tabIndex:he,target:null,title:null,translate:null,type:null,typeMustMatch:je,useMap:null,value:Ft,width:he,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:yt,axis:null,background:null,bgColor:null,border:he,borderColor:null,bottomMargin:he,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:je,declare:je,event:null,face:null,frame:null,frameBorder:null,hSpace:he,leftMargin:he,link:null,longDesc:null,lowSrc:null,marginHeight:he,marginWidth:he,noResize:je,noHref:je,noShade:je,noWrap:je,object:null,profile:null,prompt:null,rev:null,rightMargin:he,rules:null,scheme:null,scrolling:Ft,standby:null,summary:null,text:null,topMargin:he,valueType:null,version:null,vAlign:null,vLink:null,vSpace:he,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:je,disableRemotePlayback:je,prefix:null,property:null,results:he,security:null,unselectable:null},space:"html",transform:jv}),s_=cl({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:Ln,accentHeight:he,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:he,amplitude:he,arabicForm:null,ascent:he,attributeName:null,attributeType:null,azimuth:he,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:he,by:null,calcMode:null,capHeight:he,className:yt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:he,diffuseConstant:he,direction:null,display:null,dur:null,divisor:he,dominantBaseline:null,download:je,dx:null,dy:null,edgeMode:null,editable:null,elevation:he,enableBackground:null,end:null,event:null,exponent:he,externalResourcesRequired:null,fill:null,fillOpacity:he,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:rl,g2:rl,glyphName:rl,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:he,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:he,horizOriginX:he,horizOriginY:he,id:null,ideographic:he,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:he,k:he,k1:he,k2:he,k3:he,k4:he,kernelMatrix:Ln,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:he,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:he,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:he,overlineThickness:he,paintOrder:null,panose1:null,path:null,pathLength:he,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:yt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:he,pointsAtY:he,pointsAtZ:he,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ln,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ln,rev:Ln,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ln,requiredFeatures:Ln,requiredFonts:Ln,requiredFormats:Ln,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:he,specularExponent:he,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:he,strikethroughThickness:he,string:null,stroke:null,strokeDashArray:Ln,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:he,strokeOpacity:he,strokeWidth:null,style:null,surfaceScale:he,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ln,tabIndex:he,tableValues:null,target:null,targetX:he,targetY:he,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ln,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:he,underlineThickness:he,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:he,values:null,vAlphabetic:he,vMathematical:he,vectorEffect:null,vHanging:he,vIdeographic:he,version:null,vertAdvY:he,vertOriginX:he,vertOriginY:he,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:he,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Uv}),Hv=cl({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,n){return"xlink:"+n.slice(5).toLowerCase()}}),Pv=cl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:jv}),Fv=cl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,n){return"xml:"+n.slice(3).toLowerCase()}}),o_={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"},c_=/[A-Z]/g,$b=/-[a-z]/g,u_=/^data[-\w.:]+$/i;function d_(e,n){const i=Bf(n);let l=n,o=_n;if(i in e.normal)return e.property[e.normal[i]];if(i.length>4&&i.slice(0,4)==="data"&&u_.test(n)){if(n.charAt(4)==="-"){const c=n.slice(5).replace($b,h_);l="data"+c.charAt(0).toUpperCase()+c.slice(1)}else{const c=n.slice(4);if(!$b.test(c)){let u=c.replace(c_,f_);u.charAt(0)!=="-"&&(u="-"+u),n="data"+u}}o=uh}return new o(l,n)}function f_(e){return"-"+e.toLowerCase()}function h_(e){return e.charAt(1).toUpperCase()}const p_=zv([Bv,l_,Hv,Pv,Fv],"html"),dh=zv([Bv,s_,Hv,Pv,Fv],"svg");function m_(e){return e.join(" ").trim()}var qa={},nf,Kb;function g_(){if(Kb)return nf;Kb=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,i=/^\s*/,l=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,c=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,f=/^\s+|\s+$/g,h=`
50
+ `,p="/",b="*",y="",E="comment",v="declaration";function _(T,S){if(typeof T!="string")throw new TypeError("First argument must be a string");if(!T)return[];S=S||{};var D=1,M=1;function A(se){var $=se.match(n);$&&(D+=$.length);var j=se.lastIndexOf(h);M=~j?se.length-j:M+se.length}function F(){var se={line:D,column:M};return function($){return $.position=new L(se),oe(),$}}function L(se){this.start=se,this.end={line:D,column:M},this.source=S.source}L.prototype.content=T;function X(se){var $=new Error(S.source+":"+D+":"+M+": "+se);if($.reason=se,$.filename=S.source,$.line=D,$.column=M,$.source=T,!S.silent)throw $}function re(se){var $=se.exec(T);if($){var j=$[0];return A(j),T=T.slice(j.length),$}}function oe(){re(i)}function B(se){var $;for(se=se||[];$=Q();)$!==!1&&se.push($);return se}function Q(){var se=F();if(!(p!=T.charAt(0)||b!=T.charAt(1))){for(var $=2;y!=T.charAt($)&&(b!=T.charAt($)||p!=T.charAt($+1));)++$;if($+=2,y===T.charAt($-1))return X("End of comment missing");var j=T.slice(2,$-2);return M+=2,A(j),T=T.slice($),M+=2,se({type:E,comment:j})}}function ee(){var se=F(),$=re(l);if($){if(Q(),!re(o))return X("property missing ':'");var j=re(c),O=se({type:v,property:N($[0].replace(e,y)),value:j?N(j[0].replace(e,y)):y});return re(u),O}}function me(){var se=[];B(se);for(var $;$=ee();)$!==!1&&(se.push($),B(se));return se}return oe(),me()}function N(T){return T?T.replace(f,y):y}return nf=_,nf}var qb;function b_(){if(qb)return qa;qb=1;var e=qa&&qa.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(qa,"__esModule",{value:!0}),qa.default=i;const n=e(g_());function i(l,o){let c=null;if(!l||typeof l!="string")return c;const u=(0,n.default)(l),f=typeof o=="function";return u.forEach(h=>{if(h.type!=="declaration")return;const{property:p,value:b}=h;f?o(p,b,h):b&&(c=c||{},c[p]=b)}),c}return qa}var cs={},Vb;function y_(){if(Vb)return cs;Vb=1,Object.defineProperty(cs,"__esModule",{value:!0}),cs.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,i=/^[^-]+$/,l=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,c=function(p){return!p||i.test(p)||e.test(p)},u=function(p,b){return b.toUpperCase()},f=function(p,b){return"".concat(b,"-")},h=function(p,b){return b===void 0&&(b={}),c(p)?p:(p=p.toLowerCase(),b.reactCompat?p=p.replace(o,f):p=p.replace(l,f),p.replace(n,u))};return cs.camelCase=h,cs}var us,Yb;function v_(){if(Yb)return us;Yb=1;var e=us&&us.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},n=e(b_()),i=y_();function l(o,c){var u={};return!o||typeof o!="string"||(0,n.default)(o,function(f,h){f&&h&&(u[(0,i.camelCase)(f,c)]=h)}),u}return l.default=l,us=l,us}var x_=v_();const E_=Ds(x_),Gv=$v("end"),fh=$v("start");function $v(e){return n;function n(i){const l=i&&i.position&&i.position[e]||{};if(typeof l.line=="number"&&l.line>0&&typeof l.column=="number"&&l.column>0)return{line:l.line,column:l.column,offset:typeof l.offset=="number"&&l.offset>-1?l.offset:void 0}}}function S_(e){const n=fh(e),i=Gv(e);if(n&&i)return{start:n,end:i}}function xs(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Xb(e.position):"start"in e||"end"in e?Xb(e):"line"in e||"column"in e?Hf(e):""}function Hf(e){return Zb(e&&e.line)+":"+Zb(e&&e.column)}function Xb(e){return Hf(e&&e.start)+"-"+Hf(e&&e.end)}function Zb(e){return e&&typeof e=="number"?e:1}class nn extends Error{constructor(n,i,l){super(),typeof i=="string"&&(l=i,i=void 0);let o="",c={},u=!1;if(i&&("line"in i&&"column"in i?c={place:i}:"start"in i&&"end"in i?c={place:i}:"type"in i?c={ancestors:[i],place:i.position}:c={...i}),typeof n=="string"?o=n:!c.cause&&n&&(u=!0,o=n.message,c.cause=n),!c.ruleId&&!c.source&&typeof l=="string"){const h=l.indexOf(":");h===-1?c.ruleId=l:(c.source=l.slice(0,h),c.ruleId=l.slice(h+1))}if(!c.place&&c.ancestors&&c.ancestors){const h=c.ancestors[c.ancestors.length-1];h&&(c.place=h.position)}const f=c.place&&"start"in c.place?c.place.start:c.place;this.ancestors=c.ancestors||void 0,this.cause=c.cause||void 0,this.column=f?f.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=f?f.line:void 0,this.name=xs(c.place)||"1:1",this.place=c.place||void 0,this.reason=this.message,this.ruleId=c.ruleId||void 0,this.source=c.source||void 0,this.stack=u&&c.cause&&typeof c.cause.stack=="string"?c.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}nn.prototype.file="";nn.prototype.name="";nn.prototype.reason="";nn.prototype.message="";nn.prototype.stack="";nn.prototype.column=void 0;nn.prototype.line=void 0;nn.prototype.ancestors=void 0;nn.prototype.cause=void 0;nn.prototype.fatal=void 0;nn.prototype.place=void 0;nn.prototype.ruleId=void 0;nn.prototype.source=void 0;const hh={}.hasOwnProperty,__=new Map,k_=/[A-Z]/g,w_=new Set(["table","tbody","thead","tfoot","tr"]),N_=new Set(["td","th"]),Kv="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function T_(e,n){if(!n||n.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const i=n.filePath||void 0;let l;if(n.development){if(typeof n.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");l=I_(i,n.jsxDEV)}else{if(typeof n.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof n.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");l=L_(i,n.jsx,n.jsxs)}const o={Fragment:n.Fragment,ancestors:[],components:n.components||{},create:l,elementAttributeNameCase:n.elementAttributeNameCase||"react",evaluater:n.createEvaluater?n.createEvaluater():void 0,filePath:i,ignoreInvalidStyle:n.ignoreInvalidStyle||!1,passKeys:n.passKeys!==!1,passNode:n.passNode||!1,schema:n.space==="svg"?dh:p_,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},c=qv(o,e,void 0);return c&&typeof c!="string"?c:o.create(e,o.Fragment,{children:c||void 0},void 0)}function qv(e,n,i){if(n.type==="element")return C_(e,n,i);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return A_(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return M_(e,n,i);if(n.type==="mdxjsEsm")return O_(e,n);if(n.type==="root")return R_(e,n,i);if(n.type==="text")return D_(e,n)}function C_(e,n,i){const l=e.schema;let o=l;n.tagName.toLowerCase()==="svg"&&l.space==="html"&&(o=dh,e.schema=o),e.ancestors.push(n);const c=Yv(e,n.tagName,!1),u=z_(e,n);let f=mh(e,n);return w_.has(n.tagName)&&(f=f.filter(function(h){return typeof h=="string"?!i_(h):!0})),Vv(e,u,c,n),ph(u,f),e.ancestors.pop(),e.schema=l,e.create(n,c,u,i)}function A_(e,n){if(n.data&&n.data.estree&&e.evaluater){const l=n.data.estree.body[0];return l.type,e.evaluater.evaluateExpression(l.expression)}Cs(e,n.position)}function O_(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);Cs(e,n.position)}function M_(e,n,i){const l=e.schema;let o=l;n.name==="svg"&&l.space==="html"&&(o=dh,e.schema=o),e.ancestors.push(n);const c=n.name===null?e.Fragment:Yv(e,n.name,!0),u=B_(e,n),f=mh(e,n);return Vv(e,u,c,n),ph(u,f),e.ancestors.pop(),e.schema=l,e.create(n,c,u,i)}function R_(e,n,i){const l={};return ph(l,mh(e,n)),e.create(n,e.Fragment,l,i)}function D_(e,n){return n.value}function Vv(e,n,i,l){typeof i!="string"&&i!==e.Fragment&&e.passNode&&(n.node=l)}function ph(e,n){if(n.length>0){const i=n.length>1?n:n[0];i&&(e.children=i)}}function L_(e,n,i){return l;function l(o,c,u,f){const p=Array.isArray(u.children)?i:n;return f?p(c,u,f):p(c,u)}}function I_(e,n){return i;function i(l,o,c,u){const f=Array.isArray(c.children),h=fh(l);return n(o,c,u,f,{columnNumber:h?h.column-1:void 0,fileName:e,lineNumber:h?h.line:void 0},void 0)}}function z_(e,n){const i={};let l,o;for(o in n.properties)if(o!=="children"&&hh.call(n.properties,o)){const c=U_(e,o,n.properties[o]);if(c){const[u,f]=c;e.tableCellAlignToStyle&&u==="align"&&typeof f=="string"&&N_.has(n.tagName)?l=f:i[u]=f}}if(l){const c=i.style||(i.style={});c[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=l}return i}function B_(e,n){const i={};for(const l of n.attributes)if(l.type==="mdxJsxExpressionAttribute")if(l.data&&l.data.estree&&e.evaluater){const c=l.data.estree.body[0];c.type;const u=c.expression;u.type;const f=u.properties[0];f.type,Object.assign(i,e.evaluater.evaluateExpression(f.argument))}else Cs(e,n.position);else{const o=l.name;let c;if(l.value&&typeof l.value=="object")if(l.value.data&&l.value.data.estree&&e.evaluater){const f=l.value.data.estree.body[0];f.type,c=e.evaluater.evaluateExpression(f.expression)}else Cs(e,n.position);else c=l.value===null?!0:l.value;i[o]=c}return i}function mh(e,n){const i=[];let l=-1;const o=e.passKeys?new Map:__;for(;++l<n.children.length;){const c=n.children[l];let u;if(e.passKeys){const h=c.type==="element"?c.tagName:c.type==="mdxJsxFlowElement"||c.type==="mdxJsxTextElement"?c.name:void 0;if(h){const p=o.get(h)||0;u=h+"-"+p,o.set(h,p+1)}}const f=qv(e,c,u);f!==void 0&&i.push(f)}return i}function U_(e,n,i){const l=d_(e.schema,n);if(!(i==null||typeof i=="number"&&Number.isNaN(i))){if(Array.isArray(i)&&(i=l.commaSeparated?JS(i):m_(i)),l.property==="style"){let o=typeof i=="object"?i:j_(e,String(i));return e.stylePropertyNameCase==="css"&&(o=H_(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&l.space?o_[l.property]||l.property:l.attribute,i]}}function j_(e,n){try{return E_(n,{reactCompat:!0})}catch(i){if(e.ignoreInvalidStyle)return{};const l=i,o=new nn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:l,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=Kv+"#cannot-parse-style-attribute",o}}function Yv(e,n,i){let l;if(!i)l={type:"Literal",value:n};else if(n.includes(".")){const o=n.split(".");let c=-1,u;for(;++c<o.length;){const f=Pb(o[c])?{type:"Identifier",name:o[c]}:{type:"Literal",value:o[c]};u=u?{type:"MemberExpression",object:u,property:f,computed:!!(c&&f.type==="Literal"),optional:!1}:f}l=u}else l=Pb(n)&&!/^[a-z]/.test(n)?{type:"Identifier",name:n}:{type:"Literal",value:n};if(l.type==="Literal"){const o=l.value;return hh.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(l);Cs(e)}function Cs(e,n){const i=new nn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:n,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=Kv+"#cannot-handle-mdx-estrees-without-createevaluater",i}function H_(e){const n={};let i;for(i in e)hh.call(e,i)&&(n[P_(i)]=e[i]);return n}function P_(e){let n=e.replace(k_,F_);return n.slice(0,3)==="ms-"&&(n="-"+n),n}function F_(e){return"-"+e.toLowerCase()}const rf={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"]},G_={};function gh(e,n){const i=G_,l=typeof i.includeImageAlt=="boolean"?i.includeImageAlt:!0,o=typeof i.includeHtml=="boolean"?i.includeHtml:!0;return Xv(e,l,o)}function Xv(e,n,i){if($_(e)){if("value"in e)return e.type==="html"&&!i?"":e.value;if(n&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Qb(e.children,n,i)}return Array.isArray(e)?Qb(e,n,i):""}function Qb(e,n,i){const l=[];let o=-1;for(;++o<e.length;)l[o]=Xv(e[o],n,i);return l.join("")}function $_(e){return!!(e&&typeof e=="object")}const Wb=document.createElement("i");function bh(e){const n="&"+e+";";Wb.innerHTML=n;const i=Wb.textContent;return i.charCodeAt(i.length-1)===59&&e!=="semi"||i===n?!1:i}function In(e,n,i,l){const o=e.length;let c=0,u;if(n<0?n=-n>o?0:o+n:n=n>o?o:n,i=i>0?i:0,l.length<1e4)u=Array.from(l),u.unshift(n,i),e.splice(...u);else for(i&&e.splice(n,i);c<l.length;)u=l.slice(c,c+1e4),u.unshift(n,0),e.splice(...u),c+=1e4,n+=1e4}function Yn(e,n){return e.length>0?(In(e,e.length,0,n),e):n}const Jb={}.hasOwnProperty;function Zv(e){const n={};let i=-1;for(;++i<e.length;)K_(n,e[i]);return n}function K_(e,n){let i;for(i in n){const o=(Jb.call(e,i)?e[i]:void 0)||(e[i]={}),c=n[i];let u;if(c)for(u in c){Jb.call(o,u)||(o[u]=[]);const f=c[u];q_(o[u],Array.isArray(f)?f:f?[f]:[])}}}function q_(e,n){let i=-1;const l=[];for(;++i<n.length;)(n[i].add==="after"?e:l).push(n[i]);In(e,0,0,l)}function Qv(e,n){const i=Number.parseInt(e,n);return i<9||i===11||i>13&&i<32||i>126&&i<160||i>55295&&i<57344||i>64975&&i<65008||(i&65535)===65535||(i&65535)===65534||i>1114111?"�":String.fromCodePoint(i)}function tr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const un=wi(/[A-Za-z]/),tn=wi(/[\dA-Za-z]/),V_=wi(/[#-'*+\--9=?A-Z^-~]/);function Tc(e){return e!==null&&(e<32||e===127)}const Pf=wi(/\d/),Y_=wi(/[\dA-Fa-f]/),X_=wi(/[!-/:-@[-`{-~]/);function Ce(e){return e!==null&&e<-2}function gt(e){return e!==null&&(e<0||e===32)}function $e(e){return e===-2||e===-1||e===32}const jc=wi(new RegExp("\\p{P}|\\p{S}","u")),Ji=wi(/\s/);function wi(e){return n;function n(i){return i!==null&&i>-1&&e.test(String.fromCharCode(i))}}function ul(e){const n=[];let i=-1,l=0,o=0;for(;++i<e.length;){const c=e.charCodeAt(i);let u="";if(c===37&&tn(e.charCodeAt(i+1))&&tn(e.charCodeAt(i+2)))o=2;else if(c<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(c))||(u=String.fromCharCode(c));else if(c>55295&&c<57344){const f=e.charCodeAt(i+1);c<56320&&f>56319&&f<57344?(u=String.fromCharCode(c,f),o=1):u="�"}else u=String.fromCharCode(c);u&&(n.push(e.slice(l,i),encodeURIComponent(u)),l=i+o+1,u=""),o&&(i+=o,o=0)}return n.join("")+e.slice(l)}function Ze(e,n,i,l){const o=l?l-1:Number.POSITIVE_INFINITY;let c=0;return u;function u(h){return $e(h)?(e.enter(i),f(h)):n(h)}function f(h){return $e(h)&&c++<o?(e.consume(h),f):(e.exit(i),n(h))}}const Z_={tokenize:Q_};function Q_(e){const n=e.attempt(this.parser.constructs.contentInitial,l,o);let i;return n;function l(f){if(f===null){e.consume(f);return}return e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),Ze(e,n,"linePrefix")}function o(f){return e.enter("paragraph"),c(f)}function c(f){const h=e.enter("chunkText",{contentType:"text",previous:i});return i&&(i.next=h),i=h,u(f)}function u(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return Ce(f)?(e.consume(f),e.exit("chunkText"),c):(e.consume(f),u)}}const W_={tokenize:J_},ey={tokenize:ek};function J_(e){const n=this,i=[];let l=0,o,c,u;return f;function f(M){if(l<i.length){const A=i[l];return n.containerState=A[1],e.attempt(A[0].continuation,h,p)(M)}return p(M)}function h(M){if(l++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,o&&D();const A=n.events.length;let F=A,L;for(;F--;)if(n.events[F][0]==="exit"&&n.events[F][1].type==="chunkFlow"){L=n.events[F][1].end;break}S(l);let X=A;for(;X<n.events.length;)n.events[X][1].end={...L},X++;return In(n.events,F+1,0,n.events.slice(A)),n.events.length=X,p(M)}return f(M)}function p(M){if(l===i.length){if(!o)return E(M);if(o.currentConstruct&&o.currentConstruct.concrete)return _(M);n.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(ey,b,y)(M)}function b(M){return o&&D(),S(l),E(M)}function y(M){return n.parser.lazy[n.now().line]=l!==i.length,u=n.now().offset,_(M)}function E(M){return n.containerState={},e.attempt(ey,v,_)(M)}function v(M){return l++,i.push([n.currentConstruct,n.containerState]),E(M)}function _(M){if(M===null){o&&D(),S(0),e.consume(M);return}return o=o||n.parser.flow(n.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:c}),N(M)}function N(M){if(M===null){T(e.exit("chunkFlow"),!0),S(0),e.consume(M);return}return Ce(M)?(e.consume(M),T(e.exit("chunkFlow")),l=0,n.interrupt=void 0,f):(e.consume(M),N)}function T(M,A){const F=n.sliceStream(M);if(A&&F.push(null),M.previous=c,c&&(c.next=M),c=M,o.defineSkip(M.start),o.write(F),n.parser.lazy[M.start.line]){let L=o.events.length;for(;L--;)if(o.events[L][1].start.offset<u&&(!o.events[L][1].end||o.events[L][1].end.offset>u))return;const X=n.events.length;let re=X,oe,B;for(;re--;)if(n.events[re][0]==="exit"&&n.events[re][1].type==="chunkFlow"){if(oe){B=n.events[re][1].end;break}oe=!0}for(S(l),L=X;L<n.events.length;)n.events[L][1].end={...B},L++;In(n.events,re+1,0,n.events.slice(X)),n.events.length=L}}function S(M){let A=i.length;for(;A-- >M;){const F=i[A];n.containerState=F[1],F[0].exit.call(n,e)}i.length=M}function D(){o.write([null]),c=void 0,o=void 0,n.containerState._closeFlow=void 0}}function ek(e,n,i){return Ze(e,e.attempt(this.parser.constructs.document,n,i),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ol(e){if(e===null||gt(e)||Ji(e))return 1;if(jc(e))return 2}function Hc(e,n,i){const l=[];let o=-1;for(;++o<e.length;){const c=e[o].resolveAll;c&&!l.includes(c)&&(n=c(n,i),l.push(c))}return n}const Ff={name:"attention",resolveAll:tk,tokenize:nk};function tk(e,n){let i=-1,l,o,c,u,f,h,p,b;for(;++i<e.length;)if(e[i][0]==="enter"&&e[i][1].type==="attentionSequence"&&e[i][1]._close){for(l=i;l--;)if(e[l][0]==="exit"&&e[l][1].type==="attentionSequence"&&e[l][1]._open&&n.sliceSerialize(e[l][1]).charCodeAt(0)===n.sliceSerialize(e[i][1]).charCodeAt(0)){if((e[l][1]._close||e[i][1]._open)&&(e[i][1].end.offset-e[i][1].start.offset)%3&&!((e[l][1].end.offset-e[l][1].start.offset+e[i][1].end.offset-e[i][1].start.offset)%3))continue;h=e[l][1].end.offset-e[l][1].start.offset>1&&e[i][1].end.offset-e[i][1].start.offset>1?2:1;const y={...e[l][1].end},E={...e[i][1].start};ty(y,-h),ty(E,h),u={type:h>1?"strongSequence":"emphasisSequence",start:y,end:{...e[l][1].end}},f={type:h>1?"strongSequence":"emphasisSequence",start:{...e[i][1].start},end:E},c={type:h>1?"strongText":"emphasisText",start:{...e[l][1].end},end:{...e[i][1].start}},o={type:h>1?"strong":"emphasis",start:{...u.start},end:{...f.end}},e[l][1].end={...u.start},e[i][1].start={...f.end},p=[],e[l][1].end.offset-e[l][1].start.offset&&(p=Yn(p,[["enter",e[l][1],n],["exit",e[l][1],n]])),p=Yn(p,[["enter",o,n],["enter",u,n],["exit",u,n],["enter",c,n]]),p=Yn(p,Hc(n.parser.constructs.insideSpan.null,e.slice(l+1,i),n)),p=Yn(p,[["exit",c,n],["enter",f,n],["exit",f,n],["exit",o,n]]),e[i][1].end.offset-e[i][1].start.offset?(b=2,p=Yn(p,[["enter",e[i][1],n],["exit",e[i][1],n]])):b=0,In(e,l-1,i-l+3,p),i=l+p.length-b-2;break}}for(i=-1;++i<e.length;)e[i][1].type==="attentionSequence"&&(e[i][1].type="data");return e}function nk(e,n){const i=this.parser.constructs.attentionMarkers.null,l=this.previous,o=ol(l);let c;return u;function u(h){return c=h,e.enter("attentionSequence"),f(h)}function f(h){if(h===c)return e.consume(h),f;const p=e.exit("attentionSequence"),b=ol(h),y=!b||b===2&&o||i.includes(h),E=!o||o===2&&b||i.includes(l);return p._open=!!(c===42?y:y&&(o||!E)),p._close=!!(c===42?E:E&&(b||!y)),n(h)}}function ty(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}const rk={name:"autolink",tokenize:ik};function ik(e,n,i){let l=0;return o;function o(v){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),c}function c(v){return un(v)?(e.consume(v),u):v===64?i(v):p(v)}function u(v){return v===43||v===45||v===46||tn(v)?(l=1,f(v)):p(v)}function f(v){return v===58?(e.consume(v),l=0,h):(v===43||v===45||v===46||tn(v))&&l++<32?(e.consume(v),f):(l=0,p(v))}function h(v){return v===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),n):v===null||v===32||v===60||Tc(v)?i(v):(e.consume(v),h)}function p(v){return v===64?(e.consume(v),b):V_(v)?(e.consume(v),p):i(v)}function b(v){return tn(v)?y(v):i(v)}function y(v){return v===46?(e.consume(v),l=0,b):v===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),n):E(v)}function E(v){if((v===45||tn(v))&&l++<63){const _=v===45?E:y;return e.consume(v),_}return i(v)}}const zs={partial:!0,tokenize:ak};function ak(e,n,i){return l;function l(c){return $e(c)?Ze(e,o,"linePrefix")(c):o(c)}function o(c){return c===null||Ce(c)?n(c):i(c)}}const Wv={continuation:{tokenize:sk},exit:ok,name:"blockQuote",tokenize:lk};function lk(e,n,i){const l=this;return o;function o(u){if(u===62){const f=l.containerState;return f.open||(e.enter("blockQuote",{_container:!0}),f.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(u),e.exit("blockQuoteMarker"),c}return i(u)}function c(u){return $e(u)?(e.enter("blockQuotePrefixWhitespace"),e.consume(u),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),n):(e.exit("blockQuotePrefix"),n(u))}}function sk(e,n,i){const l=this;return o;function o(u){return $e(u)?Ze(e,c,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u):c(u)}function c(u){return e.attempt(Wv,n,i)(u)}}function ok(e){e.exit("blockQuote")}const Jv={name:"characterEscape",tokenize:ck};function ck(e,n,i){return l;function l(c){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(c),e.exit("escapeMarker"),o}function o(c){return X_(c)?(e.enter("characterEscapeValue"),e.consume(c),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):i(c)}}const ex={name:"characterReference",tokenize:uk};function uk(e,n,i){const l=this;let o=0,c,u;return f;function f(y){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(y),e.exit("characterReferenceMarker"),h}function h(y){return y===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(y),e.exit("characterReferenceMarkerNumeric"),p):(e.enter("characterReferenceValue"),c=31,u=tn,b(y))}function p(y){return y===88||y===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(y),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),c=6,u=Y_,b):(e.enter("characterReferenceValue"),c=7,u=Pf,b(y))}function b(y){if(y===59&&o){const E=e.exit("characterReferenceValue");return u===tn&&!bh(l.sliceSerialize(E))?i(y):(e.enter("characterReferenceMarker"),e.consume(y),e.exit("characterReferenceMarker"),e.exit("characterReference"),n)}return u(y)&&o++<c?(e.consume(y),b):i(y)}}const ny={partial:!0,tokenize:fk},ry={concrete:!0,name:"codeFenced",tokenize:dk};function dk(e,n,i){const l=this,o={partial:!0,tokenize:F};let c=0,u=0,f;return h;function h(L){return p(L)}function p(L){const X=l.events[l.events.length-1];return c=X&&X[1].type==="linePrefix"?X[2].sliceSerialize(X[1],!0).length:0,f=L,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),b(L)}function b(L){return L===f?(u++,e.consume(L),b):u<3?i(L):(e.exit("codeFencedFenceSequence"),$e(L)?Ze(e,y,"whitespace")(L):y(L))}function y(L){return L===null||Ce(L)?(e.exit("codeFencedFence"),l.interrupt?n(L):e.check(ny,N,A)(L)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),E(L))}function E(L){return L===null||Ce(L)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),y(L)):$e(L)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Ze(e,v,"whitespace")(L)):L===96&&L===f?i(L):(e.consume(L),E)}function v(L){return L===null||Ce(L)?y(L):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),_(L))}function _(L){return L===null||Ce(L)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),y(L)):L===96&&L===f?i(L):(e.consume(L),_)}function N(L){return e.attempt(o,A,T)(L)}function T(L){return e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),S}function S(L){return c>0&&$e(L)?Ze(e,D,"linePrefix",c+1)(L):D(L)}function D(L){return L===null||Ce(L)?e.check(ny,N,A)(L):(e.enter("codeFlowValue"),M(L))}function M(L){return L===null||Ce(L)?(e.exit("codeFlowValue"),D(L)):(e.consume(L),M)}function A(L){return e.exit("codeFenced"),n(L)}function F(L,X,re){let oe=0;return B;function B($){return L.enter("lineEnding"),L.consume($),L.exit("lineEnding"),Q}function Q($){return L.enter("codeFencedFence"),$e($)?Ze(L,ee,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)($):ee($)}function ee($){return $===f?(L.enter("codeFencedFenceSequence"),me($)):re($)}function me($){return $===f?(oe++,L.consume($),me):oe>=u?(L.exit("codeFencedFenceSequence"),$e($)?Ze(L,se,"whitespace")($):se($)):re($)}function se($){return $===null||Ce($)?(L.exit("codeFencedFence"),X($)):re($)}}}function fk(e,n,i){const l=this;return o;function o(u){return u===null?i(u):(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),c)}function c(u){return l.parser.lazy[l.now().line]?i(u):n(u)}}const af={name:"codeIndented",tokenize:pk},hk={partial:!0,tokenize:mk};function pk(e,n,i){const l=this;return o;function o(p){return e.enter("codeIndented"),Ze(e,c,"linePrefix",5)(p)}function c(p){const b=l.events[l.events.length-1];return b&&b[1].type==="linePrefix"&&b[2].sliceSerialize(b[1],!0).length>=4?u(p):i(p)}function u(p){return p===null?h(p):Ce(p)?e.attempt(hk,u,h)(p):(e.enter("codeFlowValue"),f(p))}function f(p){return p===null||Ce(p)?(e.exit("codeFlowValue"),u(p)):(e.consume(p),f)}function h(p){return e.exit("codeIndented"),n(p)}}function mk(e,n,i){const l=this;return o;function o(u){return l.parser.lazy[l.now().line]?i(u):Ce(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),o):Ze(e,c,"linePrefix",5)(u)}function c(u){const f=l.events[l.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?n(u):Ce(u)?o(u):i(u)}}const gk={name:"codeText",previous:yk,resolve:bk,tokenize:vk};function bk(e){let n=e.length-4,i=3,l,o;if((e[i][1].type==="lineEnding"||e[i][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(l=i;++l<n;)if(e[l][1].type==="codeTextData"){e[i][1].type="codeTextPadding",e[n][1].type="codeTextPadding",i+=2,n-=2;break}}for(l=i-1,n++;++l<=n;)o===void 0?l!==n&&e[l][1].type!=="lineEnding"&&(o=l):(l===n||e[l][1].type==="lineEnding")&&(e[o][1].type="codeTextData",l!==o+2&&(e[o][1].end=e[l-1][1].end,e.splice(o+2,l-o-2),n-=l-o-2,l=o+2),o=void 0);return e}function yk(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function vk(e,n,i){let l=0,o,c;return u;function u(y){return e.enter("codeText"),e.enter("codeTextSequence"),f(y)}function f(y){return y===96?(e.consume(y),l++,f):(e.exit("codeTextSequence"),h(y))}function h(y){return y===null?i(y):y===32?(e.enter("space"),e.consume(y),e.exit("space"),h):y===96?(c=e.enter("codeTextSequence"),o=0,b(y)):Ce(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),h):(e.enter("codeTextData"),p(y))}function p(y){return y===null||y===32||y===96||Ce(y)?(e.exit("codeTextData"),h(y)):(e.consume(y),p)}function b(y){return y===96?(e.consume(y),o++,b):o===l?(e.exit("codeTextSequence"),e.exit("codeText"),n(y)):(c.type="codeTextData",p(y))}}class xk{constructor(n){this.left=n?[...n]:[],this.right=[]}get(n){if(n<0||n>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return n<this.left.length?this.left[n]:this.right[this.right.length-n+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(n,i){const l=i??Number.POSITIVE_INFINITY;return l<this.left.length?this.left.slice(n,l):n>this.left.length?this.right.slice(this.right.length-l+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-l+this.left.length).reverse())}splice(n,i,l){const o=i||0;this.setCursor(Math.trunc(n));const c=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return l&&ds(this.left,l),c.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),ds(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),ds(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n<this.left.length){const i=this.left.splice(n,Number.POSITIVE_INFINITY);ds(this.right,i.reverse())}else{const i=this.right.splice(this.left.length+this.right.length-n,Number.POSITIVE_INFINITY);ds(this.left,i.reverse())}}}function ds(e,n){let i=0;if(n.length<1e4)e.push(...n);else for(;i<n.length;)e.push(...n.slice(i,i+1e4)),i+=1e4}function tx(e){const n={};let i=-1,l,o,c,u,f,h,p;const b=new xk(e);for(;++i<b.length;){for(;i in n;)i=n[i];if(l=b.get(i),i&&l[1].type==="chunkFlow"&&b.get(i-1)[1].type==="listItemPrefix"&&(h=l[1]._tokenizer.events,c=0,c<h.length&&h[c][1].type==="lineEndingBlank"&&(c+=2),c<h.length&&h[c][1].type==="content"))for(;++c<h.length&&h[c][1].type!=="content";)h[c][1].type==="chunkText"&&(h[c][1]._isInFirstContentOfListItem=!0,c++);if(l[0]==="enter")l[1].contentType&&(Object.assign(n,Ek(b,i)),i=n[i],p=!0);else if(l[1]._container){for(c=i,o=void 0;c--;)if(u=b.get(c),u[1].type==="lineEnding"||u[1].type==="lineEndingBlank")u[0]==="enter"&&(o&&(b.get(o)[1].type="lineEndingBlank"),u[1].type="lineEnding",o=c);else if(!(u[1].type==="linePrefix"||u[1].type==="listItemIndent"))break;o&&(l[1].end={...b.get(o)[1].start},f=b.slice(o,i),f.unshift(l),b.splice(o,i-o+1,f))}}return In(e,0,Number.POSITIVE_INFINITY,b.slice(0)),!p}function Ek(e,n){const i=e.get(n)[1],l=e.get(n)[2];let o=n-1;const c=[];let u=i._tokenizer;u||(u=l.parser[i.contentType](i.start),i._contentTypeTextTrailing&&(u._contentTypeTextTrailing=!0));const f=u.events,h=[],p={};let b,y,E=-1,v=i,_=0,N=0;const T=[N];for(;v;){for(;e.get(++o)[1]!==v;);c.push(o),v._tokenizer||(b=l.sliceStream(v),v.next||b.push(null),y&&u.defineSkip(v.start),v._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=!0),u.write(b),v._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=void 0)),y=v,v=v.next}for(v=i;++E<f.length;)f[E][0]==="exit"&&f[E-1][0]==="enter"&&f[E][1].type===f[E-1][1].type&&f[E][1].start.line!==f[E][1].end.line&&(N=E+1,T.push(N),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(u.events=[],v?(v._tokenizer=void 0,v.previous=void 0):T.pop(),E=T.length;E--;){const S=f.slice(T[E],T[E+1]),D=c.pop();h.push([D,D+S.length-1]),e.splice(D,2,S)}for(h.reverse(),E=-1;++E<h.length;)p[_+h[E][0]]=_+h[E][1],_+=h[E][1]-h[E][0]-1;return p}const Sk={resolve:kk,tokenize:wk},_k={partial:!0,tokenize:Nk};function kk(e){return tx(e),e}function wk(e,n){let i;return l;function l(f){return e.enter("content"),i=e.enter("chunkContent",{contentType:"content"}),o(f)}function o(f){return f===null?c(f):Ce(f)?e.check(_k,u,c)(f):(e.consume(f),o)}function c(f){return e.exit("chunkContent"),e.exit("content"),n(f)}function u(f){return e.consume(f),e.exit("chunkContent"),i.next=e.enter("chunkContent",{contentType:"content",previous:i}),i=i.next,o}}function Nk(e,n,i){const l=this;return o;function o(u){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),Ze(e,c,"linePrefix")}function c(u){if(u===null||Ce(u))return i(u);const f=l.events[l.events.length-1];return!l.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?n(u):e.interrupt(l.parser.constructs.flow,i,n)(u)}}function nx(e,n,i,l,o,c,u,f,h){const p=h||Number.POSITIVE_INFINITY;let b=0;return y;function y(S){return S===60?(e.enter(l),e.enter(o),e.enter(c),e.consume(S),e.exit(c),E):S===null||S===32||S===41||Tc(S)?i(S):(e.enter(l),e.enter(u),e.enter(f),e.enter("chunkString",{contentType:"string"}),N(S))}function E(S){return S===62?(e.enter(c),e.consume(S),e.exit(c),e.exit(o),e.exit(l),n):(e.enter(f),e.enter("chunkString",{contentType:"string"}),v(S))}function v(S){return S===62?(e.exit("chunkString"),e.exit(f),E(S)):S===null||S===60||Ce(S)?i(S):(e.consume(S),S===92?_:v)}function _(S){return S===60||S===62||S===92?(e.consume(S),v):v(S)}function N(S){return!b&&(S===null||S===41||gt(S))?(e.exit("chunkString"),e.exit(f),e.exit(u),e.exit(l),n(S)):b<p&&S===40?(e.consume(S),b++,N):S===41?(e.consume(S),b--,N):S===null||S===32||S===40||Tc(S)?i(S):(e.consume(S),S===92?T:N)}function T(S){return S===40||S===41||S===92?(e.consume(S),N):N(S)}}function rx(e,n,i,l,o,c){const u=this;let f=0,h;return p;function p(v){return e.enter(l),e.enter(o),e.consume(v),e.exit(o),e.enter(c),b}function b(v){return f>999||v===null||v===91||v===93&&!h||v===94&&!f&&"_hiddenFootnoteSupport"in u.parser.constructs?i(v):v===93?(e.exit(c),e.enter(o),e.consume(v),e.exit(o),e.exit(l),n):Ce(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),b):(e.enter("chunkString",{contentType:"string"}),y(v))}function y(v){return v===null||v===91||v===93||Ce(v)||f++>999?(e.exit("chunkString"),b(v)):(e.consume(v),h||(h=!$e(v)),v===92?E:y)}function E(v){return v===91||v===92||v===93?(e.consume(v),f++,y):y(v)}}function ix(e,n,i,l,o,c){let u;return f;function f(E){return E===34||E===39||E===40?(e.enter(l),e.enter(o),e.consume(E),e.exit(o),u=E===40?41:E,h):i(E)}function h(E){return E===u?(e.enter(o),e.consume(E),e.exit(o),e.exit(l),n):(e.enter(c),p(E))}function p(E){return E===u?(e.exit(c),h(u)):E===null?i(E):Ce(E)?(e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),Ze(e,p,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),b(E))}function b(E){return E===u||E===null||Ce(E)?(e.exit("chunkString"),p(E)):(e.consume(E),E===92?y:b)}function y(E){return E===u||E===92?(e.consume(E),b):b(E)}}function Es(e,n){let i;return l;function l(o){return Ce(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i=!0,l):$e(o)?Ze(e,l,i?"linePrefix":"lineSuffix")(o):n(o)}}const Tk={name:"definition",tokenize:Ak},Ck={partial:!0,tokenize:Ok};function Ak(e,n,i){const l=this;let o;return c;function c(v){return e.enter("definition"),u(v)}function u(v){return rx.call(l,e,f,i,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function f(v){return o=tr(l.sliceSerialize(l.events[l.events.length-1][1]).slice(1,-1)),v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),h):i(v)}function h(v){return gt(v)?Es(e,p)(v):p(v)}function p(v){return nx(e,b,i,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function b(v){return e.attempt(Ck,y,y)(v)}function y(v){return $e(v)?Ze(e,E,"whitespace")(v):E(v)}function E(v){return v===null||Ce(v)?(e.exit("definition"),l.parser.defined.push(o),n(v)):i(v)}}function Ok(e,n,i){return l;function l(f){return gt(f)?Es(e,o)(f):i(f)}function o(f){return ix(e,c,i,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function c(f){return $e(f)?Ze(e,u,"whitespace")(f):u(f)}function u(f){return f===null||Ce(f)?n(f):i(f)}}const Mk={name:"hardBreakEscape",tokenize:Rk};function Rk(e,n,i){return l;function l(c){return e.enter("hardBreakEscape"),e.consume(c),o}function o(c){return Ce(c)?(e.exit("hardBreakEscape"),n(c)):i(c)}}const Dk={name:"headingAtx",resolve:Lk,tokenize:Ik};function Lk(e,n){let i=e.length-2,l=3,o,c;return e[l][1].type==="whitespace"&&(l+=2),i-2>l&&e[i][1].type==="whitespace"&&(i-=2),e[i][1].type==="atxHeadingSequence"&&(l===i-1||i-4>l&&e[i-2][1].type==="whitespace")&&(i-=l+1===i?2:4),i>l&&(o={type:"atxHeadingText",start:e[l][1].start,end:e[i][1].end},c={type:"chunkText",start:e[l][1].start,end:e[i][1].end,contentType:"text"},In(e,l,i-l+1,[["enter",o,n],["enter",c,n],["exit",c,n],["exit",o,n]])),e}function Ik(e,n,i){let l=0;return o;function o(b){return e.enter("atxHeading"),c(b)}function c(b){return e.enter("atxHeadingSequence"),u(b)}function u(b){return b===35&&l++<6?(e.consume(b),u):b===null||gt(b)?(e.exit("atxHeadingSequence"),f(b)):i(b)}function f(b){return b===35?(e.enter("atxHeadingSequence"),h(b)):b===null||Ce(b)?(e.exit("atxHeading"),n(b)):$e(b)?Ze(e,f,"whitespace")(b):(e.enter("atxHeadingText"),p(b))}function h(b){return b===35?(e.consume(b),h):(e.exit("atxHeadingSequence"),f(b))}function p(b){return b===null||b===35||gt(b)?(e.exit("atxHeadingText"),f(b)):(e.consume(b),p)}}const zk=["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"],iy=["pre","script","style","textarea"],Bk={concrete:!0,name:"htmlFlow",resolveTo:Hk,tokenize:Pk},Uk={partial:!0,tokenize:Gk},jk={partial:!0,tokenize:Fk};function Hk(e){let n=e.length;for(;n--&&!(e[n][0]==="enter"&&e[n][1].type==="htmlFlow"););return n>1&&e[n-2][1].type==="linePrefix"&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e}function Pk(e,n,i){const l=this;let o,c,u,f,h;return p;function p(w){return b(w)}function b(w){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(w),y}function y(w){return w===33?(e.consume(w),E):w===47?(e.consume(w),c=!0,N):w===63?(e.consume(w),o=3,l.interrupt?n:C):un(w)?(e.consume(w),u=String.fromCharCode(w),T):i(w)}function E(w){return w===45?(e.consume(w),o=2,v):w===91?(e.consume(w),o=5,f=0,_):un(w)?(e.consume(w),o=4,l.interrupt?n:C):i(w)}function v(w){return w===45?(e.consume(w),l.interrupt?n:C):i(w)}function _(w){const ue="CDATA[";return w===ue.charCodeAt(f++)?(e.consume(w),f===ue.length?l.interrupt?n:ee:_):i(w)}function N(w){return un(w)?(e.consume(w),u=String.fromCharCode(w),T):i(w)}function T(w){if(w===null||w===47||w===62||gt(w)){const ue=w===47,ye=u.toLowerCase();return!ue&&!c&&iy.includes(ye)?(o=1,l.interrupt?n(w):ee(w)):zk.includes(u.toLowerCase())?(o=6,ue?(e.consume(w),S):l.interrupt?n(w):ee(w)):(o=7,l.interrupt&&!l.parser.lazy[l.now().line]?i(w):c?D(w):M(w))}return w===45||tn(w)?(e.consume(w),u+=String.fromCharCode(w),T):i(w)}function S(w){return w===62?(e.consume(w),l.interrupt?n:ee):i(w)}function D(w){return $e(w)?(e.consume(w),D):B(w)}function M(w){return w===47?(e.consume(w),B):w===58||w===95||un(w)?(e.consume(w),A):$e(w)?(e.consume(w),M):B(w)}function A(w){return w===45||w===46||w===58||w===95||tn(w)?(e.consume(w),A):F(w)}function F(w){return w===61?(e.consume(w),L):$e(w)?(e.consume(w),F):M(w)}function L(w){return w===null||w===60||w===61||w===62||w===96?i(w):w===34||w===39?(e.consume(w),h=w,X):$e(w)?(e.consume(w),L):re(w)}function X(w){return w===h?(e.consume(w),h=null,oe):w===null||Ce(w)?i(w):(e.consume(w),X)}function re(w){return w===null||w===34||w===39||w===47||w===60||w===61||w===62||w===96||gt(w)?F(w):(e.consume(w),re)}function oe(w){return w===47||w===62||$e(w)?M(w):i(w)}function B(w){return w===62?(e.consume(w),Q):i(w)}function Q(w){return w===null||Ce(w)?ee(w):$e(w)?(e.consume(w),Q):i(w)}function ee(w){return w===45&&o===2?(e.consume(w),j):w===60&&o===1?(e.consume(w),O):w===62&&o===4?(e.consume(w),R):w===63&&o===3?(e.consume(w),C):w===93&&o===5?(e.consume(w),J):Ce(w)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(Uk,q,me)(w)):w===null||Ce(w)?(e.exit("htmlFlowData"),me(w)):(e.consume(w),ee)}function me(w){return e.check(jk,se,q)(w)}function se(w){return e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),$}function $(w){return w===null||Ce(w)?me(w):(e.enter("htmlFlowData"),ee(w))}function j(w){return w===45?(e.consume(w),C):ee(w)}function O(w){return w===47?(e.consume(w),u="",P):ee(w)}function P(w){if(w===62){const ue=u.toLowerCase();return iy.includes(ue)?(e.consume(w),R):ee(w)}return un(w)&&u.length<8?(e.consume(w),u+=String.fromCharCode(w),P):ee(w)}function J(w){return w===93?(e.consume(w),C):ee(w)}function C(w){return w===62?(e.consume(w),R):w===45&&o===2?(e.consume(w),C):ee(w)}function R(w){return w===null||Ce(w)?(e.exit("htmlFlowData"),q(w)):(e.consume(w),R)}function q(w){return e.exit("htmlFlow"),n(w)}}function Fk(e,n,i){const l=this;return o;function o(u){return Ce(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),c):i(u)}function c(u){return l.parser.lazy[l.now().line]?i(u):n(u)}}function Gk(e,n,i){return l;function l(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(zs,n,i)}}const $k={name:"htmlText",tokenize:Kk};function Kk(e,n,i){const l=this;let o,c,u;return f;function f(C){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(C),h}function h(C){return C===33?(e.consume(C),p):C===47?(e.consume(C),F):C===63?(e.consume(C),M):un(C)?(e.consume(C),re):i(C)}function p(C){return C===45?(e.consume(C),b):C===91?(e.consume(C),c=0,_):un(C)?(e.consume(C),D):i(C)}function b(C){return C===45?(e.consume(C),v):i(C)}function y(C){return C===null?i(C):C===45?(e.consume(C),E):Ce(C)?(u=y,O(C)):(e.consume(C),y)}function E(C){return C===45?(e.consume(C),v):y(C)}function v(C){return C===62?j(C):C===45?E(C):y(C)}function _(C){const R="CDATA[";return C===R.charCodeAt(c++)?(e.consume(C),c===R.length?N:_):i(C)}function N(C){return C===null?i(C):C===93?(e.consume(C),T):Ce(C)?(u=N,O(C)):(e.consume(C),N)}function T(C){return C===93?(e.consume(C),S):N(C)}function S(C){return C===62?j(C):C===93?(e.consume(C),S):N(C)}function D(C){return C===null||C===62?j(C):Ce(C)?(u=D,O(C)):(e.consume(C),D)}function M(C){return C===null?i(C):C===63?(e.consume(C),A):Ce(C)?(u=M,O(C)):(e.consume(C),M)}function A(C){return C===62?j(C):M(C)}function F(C){return un(C)?(e.consume(C),L):i(C)}function L(C){return C===45||tn(C)?(e.consume(C),L):X(C)}function X(C){return Ce(C)?(u=X,O(C)):$e(C)?(e.consume(C),X):j(C)}function re(C){return C===45||tn(C)?(e.consume(C),re):C===47||C===62||gt(C)?oe(C):i(C)}function oe(C){return C===47?(e.consume(C),j):C===58||C===95||un(C)?(e.consume(C),B):Ce(C)?(u=oe,O(C)):$e(C)?(e.consume(C),oe):j(C)}function B(C){return C===45||C===46||C===58||C===95||tn(C)?(e.consume(C),B):Q(C)}function Q(C){return C===61?(e.consume(C),ee):Ce(C)?(u=Q,O(C)):$e(C)?(e.consume(C),Q):oe(C)}function ee(C){return C===null||C===60||C===61||C===62||C===96?i(C):C===34||C===39?(e.consume(C),o=C,me):Ce(C)?(u=ee,O(C)):$e(C)?(e.consume(C),ee):(e.consume(C),se)}function me(C){return C===o?(e.consume(C),o=void 0,$):C===null?i(C):Ce(C)?(u=me,O(C)):(e.consume(C),me)}function se(C){return C===null||C===34||C===39||C===60||C===61||C===96?i(C):C===47||C===62||gt(C)?oe(C):(e.consume(C),se)}function $(C){return C===47||C===62||gt(C)?oe(C):i(C)}function j(C){return C===62?(e.consume(C),e.exit("htmlTextData"),e.exit("htmlText"),n):i(C)}function O(C){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),P}function P(C){return $e(C)?Ze(e,J,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C):J(C)}function J(C){return e.enter("htmlTextData"),u(C)}}const yh={name:"labelEnd",resolveAll:Xk,resolveTo:Zk,tokenize:Qk},qk={tokenize:Wk},Vk={tokenize:Jk},Yk={tokenize:ew};function Xk(e){let n=-1;const i=[];for(;++n<e.length;){const l=e[n][1];if(i.push(e[n]),l.type==="labelImage"||l.type==="labelLink"||l.type==="labelEnd"){const o=l.type==="labelImage"?4:2;l.type="data",n+=o}}return e.length!==i.length&&In(e,0,e.length,i),e}function Zk(e,n){let i=e.length,l=0,o,c,u,f;for(;i--;)if(o=e[i][1],c){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[i][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(u){if(e[i][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(c=i,o.type!=="labelLink")){l=2;break}}else o.type==="labelEnd"&&(u=i);const h={type:e[c][1].type==="labelLink"?"link":"image",start:{...e[c][1].start},end:{...e[e.length-1][1].end}},p={type:"label",start:{...e[c][1].start},end:{...e[u][1].end}},b={type:"labelText",start:{...e[c+l+2][1].end},end:{...e[u-2][1].start}};return f=[["enter",h,n],["enter",p,n]],f=Yn(f,e.slice(c+1,c+l+3)),f=Yn(f,[["enter",b,n]]),f=Yn(f,Hc(n.parser.constructs.insideSpan.null,e.slice(c+l+4,u-3),n)),f=Yn(f,[["exit",b,n],e[u-2],e[u-1],["exit",p,n]]),f=Yn(f,e.slice(u+1)),f=Yn(f,[["exit",h,n]]),In(e,c,e.length,f),e}function Qk(e,n,i){const l=this;let o=l.events.length,c,u;for(;o--;)if((l.events[o][1].type==="labelImage"||l.events[o][1].type==="labelLink")&&!l.events[o][1]._balanced){c=l.events[o][1];break}return f;function f(E){return c?c._inactive?y(E):(u=l.parser.defined.includes(tr(l.sliceSerialize({start:c.end,end:l.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(E),e.exit("labelMarker"),e.exit("labelEnd"),h):i(E)}function h(E){return E===40?e.attempt(qk,b,u?b:y)(E):E===91?e.attempt(Vk,b,u?p:y)(E):u?b(E):y(E)}function p(E){return e.attempt(Yk,b,y)(E)}function b(E){return n(E)}function y(E){return c._balanced=!0,i(E)}}function Wk(e,n,i){return l;function l(y){return e.enter("resource"),e.enter("resourceMarker"),e.consume(y),e.exit("resourceMarker"),o}function o(y){return gt(y)?Es(e,c)(y):c(y)}function c(y){return y===41?b(y):nx(e,u,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(y)}function u(y){return gt(y)?Es(e,h)(y):b(y)}function f(y){return i(y)}function h(y){return y===34||y===39||y===40?ix(e,p,i,"resourceTitle","resourceTitleMarker","resourceTitleString")(y):b(y)}function p(y){return gt(y)?Es(e,b)(y):b(y)}function b(y){return y===41?(e.enter("resourceMarker"),e.consume(y),e.exit("resourceMarker"),e.exit("resource"),n):i(y)}}function Jk(e,n,i){const l=this;return o;function o(f){return rx.call(l,e,c,u,"reference","referenceMarker","referenceString")(f)}function c(f){return l.parser.defined.includes(tr(l.sliceSerialize(l.events[l.events.length-1][1]).slice(1,-1)))?n(f):i(f)}function u(f){return i(f)}}function ew(e,n,i){return l;function l(c){return e.enter("reference"),e.enter("referenceMarker"),e.consume(c),e.exit("referenceMarker"),o}function o(c){return c===93?(e.enter("referenceMarker"),e.consume(c),e.exit("referenceMarker"),e.exit("reference"),n):i(c)}}const tw={name:"labelStartImage",resolveAll:yh.resolveAll,tokenize:nw};function nw(e,n,i){const l=this;return o;function o(f){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(f),e.exit("labelImageMarker"),c}function c(f){return f===91?(e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelImage"),u):i(f)}function u(f){return f===94&&"_hiddenFootnoteSupport"in l.parser.constructs?i(f):n(f)}}const rw={name:"labelStartLink",resolveAll:yh.resolveAll,tokenize:iw};function iw(e,n,i){const l=this;return o;function o(u){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelLink"),c}function c(u){return u===94&&"_hiddenFootnoteSupport"in l.parser.constructs?i(u):n(u)}}const lf={name:"lineEnding",tokenize:aw};function aw(e,n){return i;function i(l){return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),Ze(e,n,"linePrefix")}}const Ec={name:"thematicBreak",tokenize:lw};function lw(e,n,i){let l=0,o;return c;function c(p){return e.enter("thematicBreak"),u(p)}function u(p){return o=p,f(p)}function f(p){return p===o?(e.enter("thematicBreakSequence"),h(p)):l>=3&&(p===null||Ce(p))?(e.exit("thematicBreak"),n(p)):i(p)}function h(p){return p===o?(e.consume(p),l++,h):(e.exit("thematicBreakSequence"),$e(p)?Ze(e,f,"whitespace")(p):f(p))}}const Sn={continuation:{tokenize:uw},exit:fw,name:"list",tokenize:cw},sw={partial:!0,tokenize:hw},ow={partial:!0,tokenize:dw};function cw(e,n,i){const l=this,o=l.events[l.events.length-1];let c=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,u=0;return f;function f(v){const _=l.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(_==="listUnordered"?!l.containerState.marker||v===l.containerState.marker:Pf(v)){if(l.containerState.type||(l.containerState.type=_,e.enter(_,{_container:!0})),_==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(Ec,i,p)(v):p(v);if(!l.interrupt||v===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),h(v)}return i(v)}function h(v){return Pf(v)&&++u<10?(e.consume(v),h):(!l.interrupt||u<2)&&(l.containerState.marker?v===l.containerState.marker:v===41||v===46)?(e.exit("listItemValue"),p(v)):i(v)}function p(v){return e.enter("listItemMarker"),e.consume(v),e.exit("listItemMarker"),l.containerState.marker=l.containerState.marker||v,e.check(zs,l.interrupt?i:b,e.attempt(sw,E,y))}function b(v){return l.containerState.initialBlankLine=!0,c++,E(v)}function y(v){return $e(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),E):i(v)}function E(v){return l.containerState.size=c+l.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(v)}}function uw(e,n,i){const l=this;return l.containerState._closeFlow=void 0,e.check(zs,o,c);function o(f){return l.containerState.furtherBlankLines=l.containerState.furtherBlankLines||l.containerState.initialBlankLine,Ze(e,n,"listItemIndent",l.containerState.size+1)(f)}function c(f){return l.containerState.furtherBlankLines||!$e(f)?(l.containerState.furtherBlankLines=void 0,l.containerState.initialBlankLine=void 0,u(f)):(l.containerState.furtherBlankLines=void 0,l.containerState.initialBlankLine=void 0,e.attempt(ow,n,u)(f))}function u(f){return l.containerState._closeFlow=!0,l.interrupt=void 0,Ze(e,e.attempt(Sn,n,i),"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function dw(e,n,i){const l=this;return Ze(e,o,"listItemIndent",l.containerState.size+1);function o(c){const u=l.events[l.events.length-1];return u&&u[1].type==="listItemIndent"&&u[2].sliceSerialize(u[1],!0).length===l.containerState.size?n(c):i(c)}}function fw(e){e.exit(this.containerState.type)}function hw(e,n,i){const l=this;return Ze(e,o,"listItemPrefixWhitespace",l.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(c){const u=l.events[l.events.length-1];return!$e(c)&&u&&u[1].type==="listItemPrefixWhitespace"?n(c):i(c)}}const ay={name:"setextUnderline",resolveTo:pw,tokenize:mw};function pw(e,n){let i=e.length,l,o,c;for(;i--;)if(e[i][0]==="enter"){if(e[i][1].type==="content"){l=i;break}e[i][1].type==="paragraph"&&(o=i)}else e[i][1].type==="content"&&e.splice(i,1),!c&&e[i][1].type==="definition"&&(c=i);const u={type:"setextHeading",start:{...e[l][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",c?(e.splice(o,0,["enter",u,n]),e.splice(c+1,0,["exit",e[l][1],n]),e[l][1].end={...e[c][1].end}):e[l][1]=u,e.push(["exit",u,n]),e}function mw(e,n,i){const l=this;let o;return c;function c(p){let b=l.events.length,y;for(;b--;)if(l.events[b][1].type!=="lineEnding"&&l.events[b][1].type!=="linePrefix"&&l.events[b][1].type!=="content"){y=l.events[b][1].type==="paragraph";break}return!l.parser.lazy[l.now().line]&&(l.interrupt||y)?(e.enter("setextHeadingLine"),o=p,u(p)):i(p)}function u(p){return e.enter("setextHeadingLineSequence"),f(p)}function f(p){return p===o?(e.consume(p),f):(e.exit("setextHeadingLineSequence"),$e(p)?Ze(e,h,"lineSuffix")(p):h(p))}function h(p){return p===null||Ce(p)?(e.exit("setextHeadingLine"),n(p)):i(p)}}const gw={tokenize:bw};function bw(e){const n=this,i=e.attempt(zs,l,e.attempt(this.parser.constructs.flowInitial,o,Ze(e,e.attempt(this.parser.constructs.flow,o,e.attempt(Sk,o)),"linePrefix")));return i;function l(c){if(c===null){e.consume(c);return}return e.enter("lineEndingBlank"),e.consume(c),e.exit("lineEndingBlank"),n.currentConstruct=void 0,i}function o(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),n.currentConstruct=void 0,i}}const yw={resolveAll:lx()},vw=ax("string"),xw=ax("text");function ax(e){return{resolveAll:lx(e==="text"?Ew:void 0),tokenize:n};function n(i){const l=this,o=this.parser.constructs[e],c=i.attempt(o,u,f);return u;function u(b){return p(b)?c(b):f(b)}function f(b){if(b===null){i.consume(b);return}return i.enter("data"),i.consume(b),h}function h(b){return p(b)?(i.exit("data"),c(b)):(i.consume(b),h)}function p(b){if(b===null)return!0;const y=o[b];let E=-1;if(y)for(;++E<y.length;){const v=y[E];if(!v.previous||v.previous.call(l,l.previous))return!0}return!1}}}function lx(e){return n;function n(i,l){let o=-1,c;for(;++o<=i.length;)c===void 0?i[o]&&i[o][1].type==="data"&&(c=o,o++):(!i[o]||i[o][1].type!=="data")&&(o!==c+2&&(i[c][1].end=i[o-1][1].end,i.splice(c+2,o-c-2),o=c+2),c=void 0);return e?e(i,l):i}}function Ew(e,n){let i=0;for(;++i<=e.length;)if((i===e.length||e[i][1].type==="lineEnding")&&e[i-1][1].type==="data"){const l=e[i-1][1],o=n.sliceStream(l);let c=o.length,u=-1,f=0,h;for(;c--;){const p=o[c];if(typeof p=="string"){for(u=p.length;p.charCodeAt(u-1)===32;)f++,u--;if(u)break;u=-1}else if(p===-2)h=!0,f++;else if(p!==-1){c++;break}}if(n._contentTypeTextTrailing&&i===e.length&&(f=0),f){const p={type:i===e.length||h||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:c?u:l.start._bufferIndex+u,_index:l.start._index+c,line:l.end.line,column:l.end.column-f,offset:l.end.offset-f},end:{...l.end}};l.end={...p.start},l.start.offset===l.end.offset?Object.assign(l,p):(e.splice(i,0,["enter",p,n],["exit",p,n]),i+=2)}i++}return e}const Sw={42:Sn,43:Sn,45:Sn,48:Sn,49:Sn,50:Sn,51:Sn,52:Sn,53:Sn,54:Sn,55:Sn,56:Sn,57:Sn,62:Wv},_w={91:Tk},kw={[-2]:af,[-1]:af,32:af},ww={35:Dk,42:Ec,45:[ay,Ec],60:Bk,61:ay,95:Ec,96:ry,126:ry},Nw={38:ex,92:Jv},Tw={[-5]:lf,[-4]:lf,[-3]:lf,33:tw,38:ex,42:Ff,60:[rk,$k],91:rw,92:[Mk,Jv],93:yh,95:Ff,96:gk},Cw={null:[Ff,yw]},Aw={null:[42,95]},Ow={null:[]},Mw=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Aw,contentInitial:_w,disable:Ow,document:Sw,flow:ww,flowInitial:kw,insideSpan:Cw,string:Nw,text:Tw},Symbol.toStringTag,{value:"Module"}));function Rw(e,n,i){let l={_bufferIndex:-1,_index:0,line:i&&i.line||1,column:i&&i.column||1,offset:i&&i.offset||0};const o={},c=[];let u=[],f=[];const h={attempt:X(F),check:X(L),consume:D,enter:M,exit:A,interrupt:X(L,{interrupt:!0})},p={code:null,containerState:{},defineSkip:N,events:[],now:_,parser:e,previous:null,sliceSerialize:E,sliceStream:v,write:y};let b=n.tokenize.call(p,h);return n.resolveAll&&c.push(n),p;function y(Q){return u=Yn(u,Q),T(),u[u.length-1]!==null?[]:(re(n,0),p.events=Hc(c,p.events,p),p.events)}function E(Q,ee){return Lw(v(Q),ee)}function v(Q){return Dw(u,Q)}function _(){const{_bufferIndex:Q,_index:ee,line:me,column:se,offset:$}=l;return{_bufferIndex:Q,_index:ee,line:me,column:se,offset:$}}function N(Q){o[Q.line]=Q.column,B()}function T(){let Q;for(;l._index<u.length;){const ee=u[l._index];if(typeof ee=="string")for(Q=l._index,l._bufferIndex<0&&(l._bufferIndex=0);l._index===Q&&l._bufferIndex<ee.length;)S(ee.charCodeAt(l._bufferIndex));else S(ee)}}function S(Q){b=b(Q)}function D(Q){Ce(Q)?(l.line++,l.column=1,l.offset+=Q===-3?2:1,B()):Q!==-1&&(l.column++,l.offset++),l._bufferIndex<0?l._index++:(l._bufferIndex++,l._bufferIndex===u[l._index].length&&(l._bufferIndex=-1,l._index++)),p.previous=Q}function M(Q,ee){const me=ee||{};return me.type=Q,me.start=_(),p.events.push(["enter",me,p]),f.push(me),me}function A(Q){const ee=f.pop();return ee.end=_(),p.events.push(["exit",ee,p]),ee}function F(Q,ee){re(Q,ee.from)}function L(Q,ee){ee.restore()}function X(Q,ee){return me;function me(se,$,j){let O,P,J,C;return Array.isArray(se)?q(se):"tokenize"in se?q([se]):R(se);function R(K){return de;function de(xe){const ve=xe!==null&&K[xe],De=xe!==null&&K.null,St=[...Array.isArray(ve)?ve:ve?[ve]:[],...Array.isArray(De)?De:De?[De]:[]];return q(St)(xe)}}function q(K){return O=K,P=0,K.length===0?j:w(K[P])}function w(K){return de;function de(xe){return C=oe(),J=K,K.partial||(p.currentConstruct=K),K.name&&p.parser.constructs.disable.null.includes(K.name)?ye():K.tokenize.call(ee?Object.assign(Object.create(p),ee):p,h,ue,ye)(xe)}}function ue(K){return Q(J,C),$}function ye(K){return C.restore(),++P<O.length?w(O[P]):j}}}function re(Q,ee){Q.resolveAll&&!c.includes(Q)&&c.push(Q),Q.resolve&&In(p.events,ee,p.events.length-ee,Q.resolve(p.events.slice(ee),p)),Q.resolveTo&&(p.events=Q.resolveTo(p.events,p))}function oe(){const Q=_(),ee=p.previous,me=p.currentConstruct,se=p.events.length,$=Array.from(f);return{from:se,restore:j};function j(){l=Q,p.previous=ee,p.currentConstruct=me,p.events.length=se,f=$,B()}}function B(){l.line in o&&l.column<2&&(l.column=o[l.line],l.offset+=o[l.line]-1)}}function Dw(e,n){const i=n.start._index,l=n.start._bufferIndex,o=n.end._index,c=n.end._bufferIndex;let u;if(i===o)u=[e[i].slice(l,c)];else{if(u=e.slice(i,o),l>-1){const f=u[0];typeof f=="string"?u[0]=f.slice(l):u.shift()}c>0&&u.push(e[o].slice(0,c))}return u}function Lw(e,n){let i=-1;const l=[];let o;for(;++i<e.length;){const c=e[i];let u;if(typeof c=="string")u=c;else switch(c){case-5:{u="\r";break}case-4:{u=`
51
+ `;break}case-3:{u=`\r
52
+ `;break}case-2:{u=n?" ":" ";break}case-1:{if(!n&&o)continue;u=" ";break}default:u=String.fromCharCode(c)}o=c===-2,l.push(u)}return l.join("")}function Iw(e){const l={constructs:Zv([Mw,...(e||{}).extensions||[]]),content:o(Z_),defined:[],document:o(W_),flow:o(gw),lazy:{},string:o(vw),text:o(xw)};return l;function o(c){return u;function u(f){return Rw(l,c,f)}}}function zw(e){for(;!tx(e););return e}const ly=/[\0\t\n\r]/g;function Bw(){let e=1,n="",i=!0,l;return o;function o(c,u,f){const h=[];let p,b,y,E,v;for(c=n+(typeof c=="string"?c.toString():new TextDecoder(u||void 0).decode(c)),y=0,n="",i&&(c.charCodeAt(0)===65279&&y++,i=void 0);y<c.length;){if(ly.lastIndex=y,p=ly.exec(c),E=p&&p.index!==void 0?p.index:c.length,v=c.charCodeAt(E),!p){n=c.slice(y);break}if(v===10&&y===E&&l)h.push(-3),l=void 0;else switch(l&&(h.push(-5),l=void 0),y<E&&(h.push(c.slice(y,E)),e+=E-y),v){case 0:{h.push(65533),e++;break}case 9:{for(b=Math.ceil(e/4)*4,h.push(-2);e++<b;)h.push(-1);break}case 10:{h.push(-4),e=1;break}default:l=!0,e=1}y=E+1}return f&&(l&&h.push(-5),n&&h.push(n),h.push(null)),h}}const Uw=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function jw(e){return e.replace(Uw,Hw)}function Hw(e,n,i){if(n)return n;if(i.charCodeAt(0)===35){const o=i.charCodeAt(1),c=o===120||o===88;return Qv(i.slice(c?2:1),c?16:10)}return bh(i)||e}const sx={}.hasOwnProperty;function Pw(e,n,i){return typeof n!="string"&&(i=n,n=void 0),Fw(i)(zw(Iw(i).document().write(Bw()(e,n,!0))))}function Fw(e){const n={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:c(ir),autolinkProtocol:oe,autolinkEmail:oe,atxHeading:c(rr),blockQuote:c(De),characterEscape:oe,characterReference:oe,codeFenced:c(St),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:c(St,u),codeText:c(Tt,u),codeTextData:oe,data:oe,codeFlowValue:oe,definition:c($r),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:c(kn),hardBreakEscape:c(Ye),hardBreakTrailing:c(Ye),htmlFlow:c(Xn,u),htmlFlowData:oe,htmlText:c(Xn,u),htmlTextData:oe,image:c(zn),label:u,link:c(ir),listItem:c(Ni),listItemValue:E,listOrdered:c(vr,y),listUnordered:c(vr),paragraph:c(dl),reference:w,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:c(rr),strong:c(ia),thematicBreak:c(aa)},exit:{atxHeading:h(),atxHeadingSequence:F,autolink:h(),autolinkEmail:ve,autolinkProtocol:xe,blockQuote:h(),characterEscapeValue:B,characterReferenceMarkerHexadecimal:ye,characterReferenceMarkerNumeric:ye,characterReferenceValue:K,characterReference:de,codeFenced:h(T),codeFencedFence:N,codeFencedFenceInfo:v,codeFencedFenceMeta:_,codeFlowValue:B,codeIndented:h(S),codeText:h($),codeTextData:B,data:B,definition:h(),definitionDestinationString:A,definitionLabelString:D,definitionTitleString:M,emphasis:h(),hardBreakEscape:h(ee),hardBreakTrailing:h(ee),htmlFlow:h(me),htmlFlowData:B,htmlText:h(se),htmlTextData:B,image:h(O),label:J,labelText:P,lineEnding:Q,link:h(j),listItem:h(),listOrdered:h(),listUnordered:h(),paragraph:h(),referenceString:ue,resourceDestinationString:C,resourceTitleString:R,resource:q,setextHeading:h(re),setextHeadingLineSequence:X,setextHeadingText:L,strong:h(),thematicBreak:h()}};ox(n,(e||{}).mdastExtensions||[]);const i={};return l;function l(te){let pe={type:"root",children:[]};const Ae={stack:[pe],tokenStack:[],config:n,enter:f,exit:p,buffer:u,resume:b,data:i},He=[];let Qe=-1;for(;++Qe<te.length;)if(te[Qe][1].type==="listOrdered"||te[Qe][1].type==="listUnordered")if(te[Qe][0]==="enter")He.push(Qe);else{const rn=He.pop();Qe=o(te,rn,Qe)}for(Qe=-1;++Qe<te.length;){const rn=n[te[Qe][0]];sx.call(rn,te[Qe][1].type)&&rn[te[Qe][1].type].call(Object.assign({sliceSerialize:te[Qe][2].sliceSerialize},Ae),te[Qe][1])}if(Ae.tokenStack.length>0){const rn=Ae.tokenStack[Ae.tokenStack.length-1];(rn[1]||sy).call(Ae,void 0,rn[0])}for(pe.position={start:vi(te.length>0?te[0][1].start:{line:1,column:1,offset:0}),end:vi(te.length>0?te[te.length-2][1].end:{line:1,column:1,offset:0})},Qe=-1;++Qe<n.transforms.length;)pe=n.transforms[Qe](pe)||pe;return pe}function o(te,pe,Ae){let He=pe-1,Qe=-1,rn=!1,Zn,Kt,Ct,Qt;for(;++He<=Ae;){const rt=te[He];switch(rt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{rt[0]==="enter"?Qe++:Qe--,Qt=void 0;break}case"lineEndingBlank":{rt[0]==="enter"&&(Zn&&!Qt&&!Qe&&!Ct&&(Ct=He),Qt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Qt=void 0}if(!Qe&&rt[0]==="enter"&&rt[1].type==="listItemPrefix"||Qe===-1&&rt[0]==="exit"&&(rt[1].type==="listUnordered"||rt[1].type==="listOrdered")){if(Zn){let ar=He;for(Kt=void 0;ar--;){const an=te[ar];if(an[1].type==="lineEnding"||an[1].type==="lineEndingBlank"){if(an[0]==="exit")continue;Kt&&(te[Kt][1].type="lineEndingBlank",rn=!0),an[1].type="lineEnding",Kt=ar}else if(!(an[1].type==="linePrefix"||an[1].type==="blockQuotePrefix"||an[1].type==="blockQuotePrefixWhitespace"||an[1].type==="blockQuoteMarker"||an[1].type==="listItemIndent"))break}Ct&&(!Kt||Ct<Kt)&&(Zn._spread=!0),Zn.end=Object.assign({},Kt?te[Kt][1].start:rt[1].end),te.splice(Kt||He,0,["exit",Zn,rt[2]]),He++,Ae++}if(rt[1].type==="listItemPrefix"){const ar={type:"listItem",_spread:!1,start:Object.assign({},rt[1].start),end:void 0};Zn=ar,te.splice(He,0,["enter",ar,rt[2]]),He++,Ae++,Ct=void 0,Qt=!0}}}return te[pe][1]._spread=rn,Ae}function c(te,pe){return Ae;function Ae(He){f.call(this,te(He),He),pe&&pe.call(this,He)}}function u(){this.stack.push({type:"fragment",children:[]})}function f(te,pe,Ae){this.stack[this.stack.length-1].children.push(te),this.stack.push(te),this.tokenStack.push([pe,Ae||void 0]),te.position={start:vi(pe.start),end:void 0}}function h(te){return pe;function pe(Ae){te&&te.call(this,Ae),p.call(this,Ae)}}function p(te,pe){const Ae=this.stack.pop(),He=this.tokenStack.pop();if(He)He[0].type!==te.type&&(pe?pe.call(this,te,He[0]):(He[1]||sy).call(this,te,He[0]));else throw new Error("Cannot close `"+te.type+"` ("+xs({start:te.start,end:te.end})+"): it’s not open");Ae.position.end=vi(te.end)}function b(){return gh(this.stack.pop())}function y(){this.data.expectingFirstListItemValue=!0}function E(te){if(this.data.expectingFirstListItemValue){const pe=this.stack[this.stack.length-2];pe.start=Number.parseInt(this.sliceSerialize(te),10),this.data.expectingFirstListItemValue=void 0}}function v(){const te=this.resume(),pe=this.stack[this.stack.length-1];pe.lang=te}function _(){const te=this.resume(),pe=this.stack[this.stack.length-1];pe.meta=te}function N(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function T(){const te=this.resume(),pe=this.stack[this.stack.length-1];pe.value=te.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function S(){const te=this.resume(),pe=this.stack[this.stack.length-1];pe.value=te.replace(/(\r?\n|\r)$/g,"")}function D(te){const pe=this.resume(),Ae=this.stack[this.stack.length-1];Ae.label=pe,Ae.identifier=tr(this.sliceSerialize(te)).toLowerCase()}function M(){const te=this.resume(),pe=this.stack[this.stack.length-1];pe.title=te}function A(){const te=this.resume(),pe=this.stack[this.stack.length-1];pe.url=te}function F(te){const pe=this.stack[this.stack.length-1];if(!pe.depth){const Ae=this.sliceSerialize(te).length;pe.depth=Ae}}function L(){this.data.setextHeadingSlurpLineEnding=!0}function X(te){const pe=this.stack[this.stack.length-1];pe.depth=this.sliceSerialize(te).codePointAt(0)===61?1:2}function re(){this.data.setextHeadingSlurpLineEnding=void 0}function oe(te){const Ae=this.stack[this.stack.length-1].children;let He=Ae[Ae.length-1];(!He||He.type!=="text")&&(He=wt(),He.position={start:vi(te.start),end:void 0},Ae.push(He)),this.stack.push(He)}function B(te){const pe=this.stack.pop();pe.value+=this.sliceSerialize(te),pe.position.end=vi(te.end)}function Q(te){const pe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ae=pe.children[pe.children.length-1];Ae.position.end=vi(te.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&n.canContainEols.includes(pe.type)&&(oe.call(this,te),B.call(this,te))}function ee(){this.data.atHardBreak=!0}function me(){const te=this.resume(),pe=this.stack[this.stack.length-1];pe.value=te}function se(){const te=this.resume(),pe=this.stack[this.stack.length-1];pe.value=te}function $(){const te=this.resume(),pe=this.stack[this.stack.length-1];pe.value=te}function j(){const te=this.stack[this.stack.length-1];if(this.data.inReference){const pe=this.data.referenceType||"shortcut";te.type+="Reference",te.referenceType=pe,delete te.url,delete te.title}else delete te.identifier,delete te.label;this.data.referenceType=void 0}function O(){const te=this.stack[this.stack.length-1];if(this.data.inReference){const pe=this.data.referenceType||"shortcut";te.type+="Reference",te.referenceType=pe,delete te.url,delete te.title}else delete te.identifier,delete te.label;this.data.referenceType=void 0}function P(te){const pe=this.sliceSerialize(te),Ae=this.stack[this.stack.length-2];Ae.label=jw(pe),Ae.identifier=tr(pe).toLowerCase()}function J(){const te=this.stack[this.stack.length-1],pe=this.resume(),Ae=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ae.type==="link"){const He=te.children;Ae.children=He}else Ae.alt=pe}function C(){const te=this.resume(),pe=this.stack[this.stack.length-1];pe.url=te}function R(){const te=this.resume(),pe=this.stack[this.stack.length-1];pe.title=te}function q(){this.data.inReference=void 0}function w(){this.data.referenceType="collapsed"}function ue(te){const pe=this.resume(),Ae=this.stack[this.stack.length-1];Ae.label=pe,Ae.identifier=tr(this.sliceSerialize(te)).toLowerCase(),this.data.referenceType="full"}function ye(te){this.data.characterReferenceType=te.type}function K(te){const pe=this.sliceSerialize(te),Ae=this.data.characterReferenceType;let He;Ae?(He=Qv(pe,Ae==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):He=bh(pe);const Qe=this.stack[this.stack.length-1];Qe.value+=He}function de(te){const pe=this.stack.pop();pe.position.end=vi(te.end)}function xe(te){B.call(this,te);const pe=this.stack[this.stack.length-1];pe.url=this.sliceSerialize(te)}function ve(te){B.call(this,te);const pe=this.stack[this.stack.length-1];pe.url="mailto:"+this.sliceSerialize(te)}function De(){return{type:"blockquote",children:[]}}function St(){return{type:"code",lang:null,meta:null,value:""}}function Tt(){return{type:"inlineCode",value:""}}function $r(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function kn(){return{type:"emphasis",children:[]}}function rr(){return{type:"heading",depth:0,children:[]}}function Ye(){return{type:"break"}}function Xn(){return{type:"html",value:""}}function zn(){return{type:"image",title:null,url:"",alt:null}}function ir(){return{type:"link",title:null,url:"",children:[]}}function vr(te){return{type:"list",ordered:te.type==="listOrdered",start:null,spread:te._spread,children:[]}}function Ni(te){return{type:"listItem",spread:te._spread,checked:null,children:[]}}function dl(){return{type:"paragraph",children:[]}}function ia(){return{type:"strong",children:[]}}function wt(){return{type:"text",value:""}}function aa(){return{type:"thematicBreak"}}}function vi(e){return{line:e.line,column:e.column,offset:e.offset}}function ox(e,n){let i=-1;for(;++i<n.length;){const l=n[i];Array.isArray(l)?ox(e,l):Gw(e,l)}}function Gw(e,n){let i;for(i in n)if(sx.call(n,i))switch(i){case"canContainEols":{const l=n[i];l&&e[i].push(...l);break}case"transforms":{const l=n[i];l&&e[i].push(...l);break}case"enter":case"exit":{const l=n[i];l&&Object.assign(e[i],l);break}}}function sy(e,n){throw e?new Error("Cannot close `"+e.type+"` ("+xs({start:e.start,end:e.end})+"): a different token (`"+n.type+"`, "+xs({start:n.start,end:n.end})+") is open"):new Error("Cannot close document, a token (`"+n.type+"`, "+xs({start:n.start,end:n.end})+") is still open")}function $w(e){const n=this;n.parser=i;function i(l){return Pw(l,{...n.data("settings"),...e,extensions:n.data("micromarkExtensions")||[],mdastExtensions:n.data("fromMarkdownExtensions")||[]})}}function Kw(e,n){const i={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(n),!0)};return e.patch(n,i),e.applyData(n,i)}function qw(e,n){const i={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,i),[e.applyData(n,i),{type:"text",value:`
53
+ `}]}function Vw(e,n){const i=n.value?n.value+`
54
+ `:"",l={},o=n.lang?n.lang.split(/\s+/):[];o.length>0&&(l.className=["language-"+o[0]]);let c={type:"element",tagName:"code",properties:l,children:[{type:"text",value:i}]};return n.meta&&(c.data={meta:n.meta}),e.patch(n,c),c=e.applyData(n,c),c={type:"element",tagName:"pre",properties:{},children:[c]},e.patch(n,c),c}function Yw(e,n){const i={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function Xw(e,n){const i={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function Zw(e,n){const i=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",l=String(n.identifier).toUpperCase(),o=ul(l.toLowerCase()),c=e.footnoteOrder.indexOf(l);let u,f=e.footnoteCounts.get(l);f===void 0?(f=0,e.footnoteOrder.push(l),u=e.footnoteOrder.length):u=c+1,f+=1,e.footnoteCounts.set(l,f);const h={type:"element",tagName:"a",properties:{href:"#"+i+"fn-"+o,id:i+"fnref-"+o+(f>1?"-"+f:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(u)}]};e.patch(n,h);const p={type:"element",tagName:"sup",properties:{},children:[h]};return e.patch(n,p),e.applyData(n,p)}function Qw(e,n){const i={type:"element",tagName:"h"+n.depth,properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function Ww(e,n){if(e.options.allowDangerousHtml){const i={type:"raw",value:n.value};return e.patch(n,i),e.applyData(n,i)}}function cx(e,n){const i=n.referenceType;let l="]";if(i==="collapsed"?l+="[]":i==="full"&&(l+="["+(n.label||n.identifier)+"]"),n.type==="imageReference")return[{type:"text",value:"!["+n.alt+l}];const o=e.all(n),c=o[0];c&&c.type==="text"?c.value="["+c.value:o.unshift({type:"text",value:"["});const u=o[o.length-1];return u&&u.type==="text"?u.value+=l:o.push({type:"text",value:l}),o}function Jw(e,n){const i=String(n.identifier).toUpperCase(),l=e.definitionById.get(i);if(!l)return cx(e,n);const o={src:ul(l.url||""),alt:n.alt};l.title!==null&&l.title!==void 0&&(o.title=l.title);const c={type:"element",tagName:"img",properties:o,children:[]};return e.patch(n,c),e.applyData(n,c)}function eN(e,n){const i={src:ul(n.url)};n.alt!==null&&n.alt!==void 0&&(i.alt=n.alt),n.title!==null&&n.title!==void 0&&(i.title=n.title);const l={type:"element",tagName:"img",properties:i,children:[]};return e.patch(n,l),e.applyData(n,l)}function tN(e,n){const i={type:"text",value:n.value.replace(/\r?\n|\r/g," ")};e.patch(n,i);const l={type:"element",tagName:"code",properties:{},children:[i]};return e.patch(n,l),e.applyData(n,l)}function nN(e,n){const i=String(n.identifier).toUpperCase(),l=e.definitionById.get(i);if(!l)return cx(e,n);const o={href:ul(l.url||"")};l.title!==null&&l.title!==void 0&&(o.title=l.title);const c={type:"element",tagName:"a",properties:o,children:e.all(n)};return e.patch(n,c),e.applyData(n,c)}function rN(e,n){const i={href:ul(n.url)};n.title!==null&&n.title!==void 0&&(i.title=n.title);const l={type:"element",tagName:"a",properties:i,children:e.all(n)};return e.patch(n,l),e.applyData(n,l)}function iN(e,n,i){const l=e.all(n),o=i?aN(i):ux(n),c={},u=[];if(typeof n.checked=="boolean"){const b=l[0];let y;b&&b.type==="element"&&b.tagName==="p"?y=b:(y={type:"element",tagName:"p",properties:{},children:[]},l.unshift(y)),y.children.length>0&&y.children.unshift({type:"text",value:" "}),y.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:n.checked,disabled:!0},children:[]}),c.className=["task-list-item"]}let f=-1;for(;++f<l.length;){const b=l[f];(o||f!==0||b.type!=="element"||b.tagName!=="p")&&u.push({type:"text",value:`
55
+ `}),b.type==="element"&&b.tagName==="p"&&!o?u.push(...b.children):u.push(b)}const h=l[l.length-1];h&&(o||h.type!=="element"||h.tagName!=="p")&&u.push({type:"text",value:`
56
+ `});const p={type:"element",tagName:"li",properties:c,children:u};return e.patch(n,p),e.applyData(n,p)}function aN(e){let n=!1;if(e.type==="list"){n=e.spread||!1;const i=e.children;let l=-1;for(;!n&&++l<i.length;)n=ux(i[l])}return n}function ux(e){const n=e.spread;return n??e.children.length>1}function lN(e,n){const i={},l=e.all(n);let o=-1;for(typeof n.start=="number"&&n.start!==1&&(i.start=n.start);++o<l.length;){const u=l[o];if(u.type==="element"&&u.tagName==="li"&&u.properties&&Array.isArray(u.properties.className)&&u.properties.className.includes("task-list-item")){i.className=["contains-task-list"];break}}const c={type:"element",tagName:n.ordered?"ol":"ul",properties:i,children:e.wrap(l,!0)};return e.patch(n,c),e.applyData(n,c)}function sN(e,n){const i={type:"element",tagName:"p",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function oN(e,n){const i={type:"root",children:e.wrap(e.all(n))};return e.patch(n,i),e.applyData(n,i)}function cN(e,n){const i={type:"element",tagName:"strong",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function uN(e,n){const i=e.all(n),l=i.shift(),o=[];if(l){const u={type:"element",tagName:"thead",properties:{},children:e.wrap([l],!0)};e.patch(n.children[0],u),o.push(u)}if(i.length>0){const u={type:"element",tagName:"tbody",properties:{},children:e.wrap(i,!0)},f=fh(n.children[1]),h=Gv(n.children[n.children.length-1]);f&&h&&(u.position={start:f,end:h}),o.push(u)}const c={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(n,c),e.applyData(n,c)}function dN(e,n,i){const l=i?i.children:void 0,c=(l?l.indexOf(n):1)===0?"th":"td",u=i&&i.type==="table"?i.align:void 0,f=u?u.length:n.children.length;let h=-1;const p=[];for(;++h<f;){const y=n.children[h],E={},v=u?u[h]:void 0;v&&(E.align=v);let _={type:"element",tagName:c,properties:E,children:[]};y&&(_.children=e.all(y),e.patch(y,_),_=e.applyData(y,_)),p.push(_)}const b={type:"element",tagName:"tr",properties:{},children:e.wrap(p,!0)};return e.patch(n,b),e.applyData(n,b)}function fN(e,n){const i={type:"element",tagName:"td",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}const oy=9,cy=32;function hN(e){const n=String(e),i=/\r?\n|\r/g;let l=i.exec(n),o=0;const c=[];for(;l;)c.push(uy(n.slice(o,l.index),o>0,!0),l[0]),o=l.index+l[0].length,l=i.exec(n);return c.push(uy(n.slice(o),o>0,!1)),c.join("")}function uy(e,n,i){let l=0,o=e.length;if(n){let c=e.codePointAt(l);for(;c===oy||c===cy;)l++,c=e.codePointAt(l)}if(i){let c=e.codePointAt(o-1);for(;c===oy||c===cy;)o--,c=e.codePointAt(o-1)}return o>l?e.slice(l,o):""}function pN(e,n){const i={type:"text",value:hN(String(n.value))};return e.patch(n,i),e.applyData(n,i)}function mN(e,n){const i={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,i),e.applyData(n,i)}const gN={blockquote:Kw,break:qw,code:Vw,delete:Yw,emphasis:Xw,footnoteReference:Zw,heading:Qw,html:Ww,imageReference:Jw,image:eN,inlineCode:tN,linkReference:nN,link:rN,listItem:iN,list:lN,paragraph:sN,root:oN,strong:cN,table:uN,tableCell:fN,tableRow:dN,text:pN,thematicBreak:mN,toml:sc,yaml:sc,definition:sc,footnoteDefinition:sc};function sc(){}const dx=-1,Pc=0,Ss=1,Cc=2,vh=3,xh=4,Eh=5,Sh=6,fx=7,hx=8,dy=typeof self=="object"?self:globalThis,bN=(e,n)=>{const i=(o,c)=>(e.set(c,o),o),l=o=>{if(e.has(o))return e.get(o);const[c,u]=n[o];switch(c){case Pc:case dx:return i(u,o);case Ss:{const f=i([],o);for(const h of u)f.push(l(h));return f}case Cc:{const f=i({},o);for(const[h,p]of u)f[l(h)]=l(p);return f}case vh:return i(new Date(u),o);case xh:{const{source:f,flags:h}=u;return i(new RegExp(f,h),o)}case Eh:{const f=i(new Map,o);for(const[h,p]of u)f.set(l(h),l(p));return f}case Sh:{const f=i(new Set,o);for(const h of u)f.add(l(h));return f}case fx:{const{name:f,message:h}=u;return i(new dy[f](h),o)}case hx:return i(BigInt(u),o);case"BigInt":return i(Object(BigInt(u)),o);case"ArrayBuffer":return i(new Uint8Array(u).buffer,u);case"DataView":{const{buffer:f}=new Uint8Array(u);return i(new DataView(f),u)}}return i(new dy[c](u),o)};return l},fy=e=>bN(new Map,e)(0),Va="",{toString:yN}={},{keys:vN}=Object,fs=e=>{const n=typeof e;if(n!=="object"||!e)return[Pc,n];const i=yN.call(e).slice(8,-1);switch(i){case"Array":return[Ss,Va];case"Object":return[Cc,Va];case"Date":return[vh,Va];case"RegExp":return[xh,Va];case"Map":return[Eh,Va];case"Set":return[Sh,Va];case"DataView":return[Ss,i]}return i.includes("Array")?[Ss,i]:i.includes("Error")?[fx,i]:[Cc,i]},oc=([e,n])=>e===Pc&&(n==="function"||n==="symbol"),xN=(e,n,i,l)=>{const o=(u,f)=>{const h=l.push(u)-1;return i.set(f,h),h},c=u=>{if(i.has(u))return i.get(u);let[f,h]=fs(u);switch(f){case Pc:{let b=u;switch(h){case"bigint":f=hx,b=u.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+h);b=null;break;case"undefined":return o([dx],u)}return o([f,b],u)}case Ss:{if(h){let E=u;return h==="DataView"?E=new Uint8Array(u.buffer):h==="ArrayBuffer"&&(E=new Uint8Array(u)),o([h,[...E]],u)}const b=[],y=o([f,b],u);for(const E of u)b.push(c(E));return y}case Cc:{if(h)switch(h){case"BigInt":return o([h,u.toString()],u);case"Boolean":case"Number":case"String":return o([h,u.valueOf()],u)}if(n&&"toJSON"in u)return c(u.toJSON());const b=[],y=o([f,b],u);for(const E of vN(u))(e||!oc(fs(u[E])))&&b.push([c(E),c(u[E])]);return y}case vh:return o([f,u.toISOString()],u);case xh:{const{source:b,flags:y}=u;return o([f,{source:b,flags:y}],u)}case Eh:{const b=[],y=o([f,b],u);for(const[E,v]of u)(e||!(oc(fs(E))||oc(fs(v))))&&b.push([c(E),c(v)]);return y}case Sh:{const b=[],y=o([f,b],u);for(const E of u)(e||!oc(fs(E)))&&b.push(c(E));return y}}const{message:p}=u;return o([f,{name:h,message:p}],u)};return c},hy=(e,{json:n,lossy:i}={})=>{const l=[];return xN(!(n||i),!!n,new Map,l)(e),l},Ac=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?fy(hy(e,n)):structuredClone(e):(e,n)=>fy(hy(e,n));function EN(e,n){const i=[{type:"text",value:"↩"}];return n>1&&i.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(n)}]}),i}function SN(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function _N(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=e.options.footnoteBackContent||EN,l=e.options.footnoteBackLabel||SN,o=e.options.footnoteLabel||"Footnotes",c=e.options.footnoteLabelTagName||"h2",u=e.options.footnoteLabelProperties||{className:["sr-only"]},f=[];let h=-1;for(;++h<e.footnoteOrder.length;){const p=e.footnoteById.get(e.footnoteOrder[h]);if(!p)continue;const b=e.all(p),y=String(p.identifier).toUpperCase(),E=ul(y.toLowerCase());let v=0;const _=[],N=e.footnoteCounts.get(y);for(;N!==void 0&&++v<=N;){_.length>0&&_.push({type:"text",value:" "});let D=typeof i=="string"?i:i(h,v);typeof D=="string"&&(D={type:"text",value:D}),_.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+E+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof l=="string"?l:l(h,v),className:["data-footnote-backref"]},children:Array.isArray(D)?D:[D]})}const T=b[b.length-1];if(T&&T.type==="element"&&T.tagName==="p"){const D=T.children[T.children.length-1];D&&D.type==="text"?D.value+=" ":T.children.push({type:"text",value:" "}),T.children.push(..._)}else b.push(..._);const S={type:"element",tagName:"li",properties:{id:n+"fn-"+E},children:e.wrap(b,!0)};e.patch(p,S),f.push(S)}if(f.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:c,properties:{...Ac(u),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
57
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(f,!0)},{type:"text",value:`
58
+ `}]}}const Bs=(function(e){if(e==null)return TN;if(typeof e=="function")return Fc(e);if(typeof e=="object")return Array.isArray(e)?kN(e):wN(e);if(typeof e=="string")return NN(e);throw new Error("Expected function, string, or object as test")});function kN(e){const n=[];let i=-1;for(;++i<e.length;)n[i]=Bs(e[i]);return Fc(l);function l(...o){let c=-1;for(;++c<n.length;)if(n[c].apply(this,o))return!0;return!1}}function wN(e){const n=e;return Fc(i);function i(l){const o=l;let c;for(c in e)if(o[c]!==n[c])return!1;return!0}}function NN(e){return Fc(n);function n(i){return i&&i.type===e}}function Fc(e){return n;function n(i,l,o){return!!(CN(i)&&e.call(this,i,typeof l=="number"?l:void 0,o||void 0))}}function TN(){return!0}function CN(e){return e!==null&&typeof e=="object"&&"type"in e}const px=[],AN=!0,Gf=!1,ON="skip";function mx(e,n,i,l){let o;typeof n=="function"&&typeof i!="function"?(l=i,i=n):o=n;const c=Bs(o),u=l?-1:1;f(e,void 0,[])();function f(h,p,b){const y=h&&typeof h=="object"?h:{};if(typeof y.type=="string"){const v=typeof y.tagName=="string"?y.tagName:typeof y.name=="string"?y.name:void 0;Object.defineProperty(E,"name",{value:"node ("+(h.type+(v?"<"+v+">":""))+")"})}return E;function E(){let v=px,_,N,T;if((!n||c(h,p,b[b.length-1]||void 0))&&(v=MN(i(h,b)),v[0]===Gf))return v;if("children"in h&&h.children){const S=h;if(S.children&&v[0]!==ON)for(N=(l?S.children.length:-1)+u,T=b.concat(S);N>-1&&N<S.children.length;){const D=S.children[N];if(_=f(D,N,T)(),_[0]===Gf)return _;N=typeof _[1]=="number"?_[1]:N+u}}return v}}}function MN(e){return Array.isArray(e)?e:typeof e=="number"?[AN,e]:e==null?px:[e]}function Gc(e,n,i,l){let o,c,u;typeof n=="function"&&typeof i!="function"?(c=void 0,u=n,o=i):(c=n,u=i,o=l),mx(e,c,f,o);function f(h,p){const b=p[p.length-1],y=b?b.children.indexOf(h):void 0;return u(h,y,b)}}const $f={}.hasOwnProperty,RN={};function DN(e,n){const i=n||RN,l=new Map,o=new Map,c=new Map,u={...gN,...i.handlers},f={all:p,applyData:IN,definitionById:l,footnoteById:o,footnoteCounts:c,footnoteOrder:[],handlers:u,one:h,options:i,patch:LN,wrap:BN};return Gc(e,function(b){if(b.type==="definition"||b.type==="footnoteDefinition"){const y=b.type==="definition"?l:o,E=String(b.identifier).toUpperCase();y.has(E)||y.set(E,b)}}),f;function h(b,y){const E=b.type,v=f.handlers[E];if($f.call(f.handlers,E)&&v)return v(f,b,y);if(f.options.passThrough&&f.options.passThrough.includes(E)){if("children"in b){const{children:N,...T}=b,S=Ac(T);return S.children=f.all(b),S}return Ac(b)}return(f.options.unknownHandler||zN)(f,b,y)}function p(b){const y=[];if("children"in b){const E=b.children;let v=-1;for(;++v<E.length;){const _=f.one(E[v],b);if(_){if(v&&E[v-1].type==="break"&&(!Array.isArray(_)&&_.type==="text"&&(_.value=py(_.value)),!Array.isArray(_)&&_.type==="element")){const N=_.children[0];N&&N.type==="text"&&(N.value=py(N.value))}Array.isArray(_)?y.push(..._):y.push(_)}}}return y}}function LN(e,n){e.position&&(n.position=S_(e))}function IN(e,n){let i=n;if(e&&e.data){const l=e.data.hName,o=e.data.hChildren,c=e.data.hProperties;if(typeof l=="string")if(i.type==="element")i.tagName=l;else{const u="children"in i?i.children:[i];i={type:"element",tagName:l,properties:{},children:u}}i.type==="element"&&c&&Object.assign(i.properties,Ac(c)),"children"in i&&i.children&&o!==null&&o!==void 0&&(i.children=o)}return i}function zN(e,n){const i=n.data||{},l="value"in n&&!($f.call(i,"hProperties")||$f.call(i,"hChildren"))?{type:"text",value:n.value}:{type:"element",tagName:"div",properties:{},children:e.all(n)};return e.patch(n,l),e.applyData(n,l)}function BN(e,n){const i=[];let l=-1;for(n&&i.push({type:"text",value:`
59
+ `});++l<e.length;)l&&i.push({type:"text",value:`
60
+ `}),i.push(e[l]);return n&&e.length>0&&i.push({type:"text",value:`
61
+ `}),i}function py(e){let n=0,i=e.charCodeAt(n);for(;i===9||i===32;)n++,i=e.charCodeAt(n);return e.slice(n)}function my(e,n){const i=DN(e,n),l=i.one(e,void 0),o=_N(i),c=Array.isArray(l)?{type:"root",children:l}:l||{type:"root",children:[]};return o&&c.children.push({type:"text",value:`
62
+ `},o),c}function UN(e,n){return e&&"run"in e?async function(i,l){const o=my(i,{file:l,...n});await e.run(o,l)}:function(i,l){return my(i,{file:l,...e||n})}}function gy(e){if(e)throw e}var sf,by;function jN(){if(by)return sf;by=1;var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,i=Object.defineProperty,l=Object.getOwnPropertyDescriptor,o=function(p){return typeof Array.isArray=="function"?Array.isArray(p):n.call(p)==="[object Array]"},c=function(p){if(!p||n.call(p)!=="[object Object]")return!1;var b=e.call(p,"constructor"),y=p.constructor&&p.constructor.prototype&&e.call(p.constructor.prototype,"isPrototypeOf");if(p.constructor&&!b&&!y)return!1;var E;for(E in p);return typeof E>"u"||e.call(p,E)},u=function(p,b){i&&b.name==="__proto__"?i(p,b.name,{enumerable:!0,configurable:!0,value:b.newValue,writable:!0}):p[b.name]=b.newValue},f=function(p,b){if(b==="__proto__")if(e.call(p,b)){if(l)return l(p,b).value}else return;return p[b]};return sf=function h(){var p,b,y,E,v,_,N=arguments[0],T=1,S=arguments.length,D=!1;for(typeof N=="boolean"&&(D=N,N=arguments[1]||{},T=2),(N==null||typeof N!="object"&&typeof N!="function")&&(N={});T<S;++T)if(p=arguments[T],p!=null)for(b in p)y=f(N,b),E=f(p,b),N!==E&&(D&&E&&(c(E)||(v=o(E)))?(v?(v=!1,_=y&&o(y)?y:[]):_=y&&c(y)?y:{},u(N,{name:b,newValue:h(D,_,E)})):typeof E<"u"&&u(N,{name:b,newValue:E}));return N},sf}var HN=jN();const of=Ds(HN);function Kf(e){if(typeof e!="object"||e===null)return!1;const n=Object.getPrototypeOf(e);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function PN(){const e=[],n={run:i,use:l};return n;function i(...o){let c=-1;const u=o.pop();if(typeof u!="function")throw new TypeError("Expected function as last argument, not "+u);f(null,...o);function f(h,...p){const b=e[++c];let y=-1;if(h){u(h);return}for(;++y<o.length;)(p[y]===null||p[y]===void 0)&&(p[y]=o[y]);o=p,b?FN(b,f)(...p):u(null,...p)}}function l(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),n}}function FN(e,n){let i;return l;function l(...u){const f=e.length>u.length;let h;f&&u.push(o);try{h=e.apply(this,u)}catch(p){const b=p;if(f&&i)throw b;return o(b)}f||(h&&h.then&&typeof h.then=="function"?h.then(c,o):h instanceof Error?o(h):c(h))}function o(u,...f){i||(i=!0,n(u,...f))}function c(u){o(null,u)}}const fr={basename:GN,dirname:$N,extname:KN,join:qN,sep:"/"};function GN(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');Us(e);let i=0,l=-1,o=e.length,c;if(n===void 0||n.length===0||n.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(c){i=o+1;break}}else l<0&&(c=!0,l=o+1);return l<0?"":e.slice(i,l)}if(n===e)return"";let u=-1,f=n.length-1;for(;o--;)if(e.codePointAt(o)===47){if(c){i=o+1;break}}else u<0&&(c=!0,u=o+1),f>-1&&(e.codePointAt(o)===n.codePointAt(f--)?f<0&&(l=o):(f=-1,l=u));return i===l?l=u:l<0&&(l=e.length),e.slice(i,l)}function $N(e){if(Us(e),e.length===0)return".";let n=-1,i=e.length,l;for(;--i;)if(e.codePointAt(i)===47){if(l){n=i;break}}else l||(l=!0);return n<0?e.codePointAt(0)===47?"/":".":n===1&&e.codePointAt(0)===47?"//":e.slice(0,n)}function KN(e){Us(e);let n=e.length,i=-1,l=0,o=-1,c=0,u;for(;n--;){const f=e.codePointAt(n);if(f===47){if(u){l=n+1;break}continue}i<0&&(u=!0,i=n+1),f===46?o<0?o=n:c!==1&&(c=1):o>-1&&(c=-1)}return o<0||i<0||c===0||c===1&&o===i-1&&o===l+1?"":e.slice(o,i)}function qN(...e){let n=-1,i;for(;++n<e.length;)Us(e[n]),e[n]&&(i=i===void 0?e[n]:i+"/"+e[n]);return i===void 0?".":VN(i)}function VN(e){Us(e);const n=e.codePointAt(0)===47;let i=YN(e,!n);return i.length===0&&!n&&(i="."),i.length>0&&e.codePointAt(e.length-1)===47&&(i+="/"),n?"/"+i:i}function YN(e,n){let i="",l=0,o=-1,c=0,u=-1,f,h;for(;++u<=e.length;){if(u<e.length)f=e.codePointAt(u);else{if(f===47)break;f=47}if(f===47){if(!(o===u-1||c===1))if(o!==u-1&&c===2){if(i.length<2||l!==2||i.codePointAt(i.length-1)!==46||i.codePointAt(i.length-2)!==46){if(i.length>2){if(h=i.lastIndexOf("/"),h!==i.length-1){h<0?(i="",l=0):(i=i.slice(0,h),l=i.length-1-i.lastIndexOf("/")),o=u,c=0;continue}}else if(i.length>0){i="",l=0,o=u,c=0;continue}}n&&(i=i.length>0?i+"/..":"..",l=2)}else i.length>0?i+="/"+e.slice(o+1,u):i=e.slice(o+1,u),l=u-o-1;o=u,c=0}else f===46&&c>-1?c++:c=-1}return i}function Us(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const XN={cwd:ZN};function ZN(){return"/"}function qf(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function QN(e){if(typeof e=="string")e=new URL(e);else if(!qf(e)){const n=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw n.code="ERR_INVALID_ARG_TYPE",n}if(e.protocol!=="file:"){const n=new TypeError("The URL must be of scheme file");throw n.code="ERR_INVALID_URL_SCHEME",n}return WN(e)}function WN(e){if(e.hostname!==""){const l=new TypeError('File URL host must be "localhost" or empty on darwin');throw l.code="ERR_INVALID_FILE_URL_HOST",l}const n=e.pathname;let i=-1;for(;++i<n.length;)if(n.codePointAt(i)===37&&n.codePointAt(i+1)===50){const l=n.codePointAt(i+2);if(l===70||l===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(n)}const cf=["history","path","basename","stem","extname","dirname"];class gx{constructor(n){let i;n?qf(n)?i={path:n}:typeof n=="string"||JN(n)?i={value:n}:i=n:i={},this.cwd="cwd"in i?"":XN.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let l=-1;for(;++l<cf.length;){const c=cf[l];c in i&&i[c]!==void 0&&i[c]!==null&&(this[c]=c==="history"?[...i[c]]:i[c])}let o;for(o in i)cf.includes(o)||(this[o]=i[o])}get basename(){return typeof this.path=="string"?fr.basename(this.path):void 0}set basename(n){df(n,"basename"),uf(n,"basename"),this.path=fr.join(this.dirname||"",n)}get dirname(){return typeof this.path=="string"?fr.dirname(this.path):void 0}set dirname(n){yy(this.basename,"dirname"),this.path=fr.join(n||"",this.basename)}get extname(){return typeof this.path=="string"?fr.extname(this.path):void 0}set extname(n){if(uf(n,"extname"),yy(this.dirname,"extname"),n){if(n.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(n.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=fr.join(this.dirname,this.stem+(n||""))}get path(){return this.history[this.history.length-1]}set path(n){qf(n)&&(n=QN(n)),df(n,"path"),this.path!==n&&this.history.push(n)}get stem(){return typeof this.path=="string"?fr.basename(this.path,this.extname):void 0}set stem(n){df(n,"stem"),uf(n,"stem"),this.path=fr.join(this.dirname||"",n+(this.extname||""))}fail(n,i,l){const o=this.message(n,i,l);throw o.fatal=!0,o}info(n,i,l){const o=this.message(n,i,l);return o.fatal=void 0,o}message(n,i,l){const o=new nn(n,i,l);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(n){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(n||void 0).decode(this.value)}}function uf(e,n){if(e&&e.includes(fr.sep))throw new Error("`"+n+"` cannot be a path: did not expect `"+fr.sep+"`")}function df(e,n){if(!e)throw new Error("`"+n+"` cannot be empty")}function yy(e,n){if(!e)throw new Error("Setting `"+n+"` requires `path` to be set too")}function JN(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const eT=(function(e){const l=this.constructor.prototype,o=l[e],c=function(){return o.apply(c,arguments)};return Object.setPrototypeOf(c,l),c}),tT={}.hasOwnProperty;class _h extends eT{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=PN()}copy(){const n=new _h;let i=-1;for(;++i<this.attachers.length;){const l=this.attachers[i];n.use(...l)}return n.data(of(!0,{},this.namespace)),n}data(n,i){return typeof n=="string"?arguments.length===2?(pf("data",this.frozen),this.namespace[n]=i,this):tT.call(this.namespace,n)&&this.namespace[n]||void 0:n?(pf("data",this.frozen),this.namespace=n,this):this.namespace}freeze(){if(this.frozen)return this;const n=this;for(;++this.freezeIndex<this.attachers.length;){const[i,...l]=this.attachers[this.freezeIndex];if(l[0]===!1)continue;l[0]===!0&&(l[0]=void 0);const o=i.call(n,...l);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(n){this.freeze();const i=cc(n),l=this.parser||this.Parser;return ff("parse",l),l(String(i),i)}process(n,i){const l=this;return this.freeze(),ff("process",this.parser||this.Parser),hf("process",this.compiler||this.Compiler),i?o(void 0,i):new Promise(o);function o(c,u){const f=cc(n),h=l.parse(f);l.run(h,f,function(b,y,E){if(b||!y||!E)return p(b);const v=y,_=l.stringify(v,E);iT(_)?E.value=_:E.result=_,p(b,E)});function p(b,y){b||!y?u(b):c?c(y):i(void 0,y)}}}processSync(n){let i=!1,l;return this.freeze(),ff("processSync",this.parser||this.Parser),hf("processSync",this.compiler||this.Compiler),this.process(n,o),xy("processSync","process",i),l;function o(c,u){i=!0,gy(c),l=u}}run(n,i,l){vy(n),this.freeze();const o=this.transformers;return!l&&typeof i=="function"&&(l=i,i=void 0),l?c(void 0,l):new Promise(c);function c(u,f){const h=cc(i);o.run(n,h,p);function p(b,y,E){const v=y||n;b?f(b):u?u(v):l(void 0,v,E)}}}runSync(n,i){let l=!1,o;return this.run(n,i,c),xy("runSync","run",l),o;function c(u,f){gy(u),o=f,l=!0}}stringify(n,i){this.freeze();const l=cc(i),o=this.compiler||this.Compiler;return hf("stringify",o),vy(n),o(n,l)}use(n,...i){const l=this.attachers,o=this.namespace;if(pf("use",this.frozen),n!=null)if(typeof n=="function")h(n,i);else if(typeof n=="object")Array.isArray(n)?f(n):u(n);else throw new TypeError("Expected usable value, not `"+n+"`");return this;function c(p){if(typeof p=="function")h(p,[]);else if(typeof p=="object")if(Array.isArray(p)){const[b,...y]=p;h(b,y)}else u(p);else throw new TypeError("Expected usable value, not `"+p+"`")}function u(p){if(!("plugins"in p)&&!("settings"in p))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");f(p.plugins),p.settings&&(o.settings=of(!0,o.settings,p.settings))}function f(p){let b=-1;if(p!=null)if(Array.isArray(p))for(;++b<p.length;){const y=p[b];c(y)}else throw new TypeError("Expected a list of plugins, not `"+p+"`")}function h(p,b){let y=-1,E=-1;for(;++y<l.length;)if(l[y][0]===p){E=y;break}if(E===-1)l.push([p,...b]);else if(b.length>0){let[v,..._]=b;const N=l[E][1];Kf(N)&&Kf(v)&&(v=of(!0,N,v)),l[E]=[p,v,..._]}}}}const nT=new _h().freeze();function ff(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function hf(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function pf(e,n){if(n)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function vy(e){if(!Kf(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function xy(e,n,i){if(!i)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function cc(e){return rT(e)?e:new gx(e)}function rT(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function iT(e){return typeof e=="string"||aT(e)}function aT(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const lT="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Ey=[],Sy={allowDangerousHtml:!0},sT=/^(https?|ircs?|mailto|xmpp)$/i,oT=[{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 bx(e){const n=cT(e),i=uT(e);return dT(n.runSync(n.parse(i),i),e)}function cT(e){const n=e.rehypePlugins||Ey,i=e.remarkPlugins||Ey,l=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Sy}:Sy;return nT().use($w).use(i).use(UN,l).use(n)}function uT(e){const n=e.children||"",i=new gx;return typeof n=="string"&&(i.value=n),i}function dT(e,n){const i=n.allowedElements,l=n.allowElement,o=n.components,c=n.disallowedElements,u=n.skipHtml,f=n.unwrapDisallowed,h=n.urlTransform||fT;for(const b of oT)Object.hasOwn(n,b.from)&&(""+b.from+(b.to?"use `"+b.to+"` instead":"remove it")+lT+b.id,void 0);return Gc(e,p),T_(e,{Fragment:g.Fragment,components:o,ignoreInvalidStyle:!0,jsx:g.jsx,jsxs:g.jsxs,passKeys:!0,passNode:!0});function p(b,y,E){if(b.type==="raw"&&E&&typeof y=="number")return u?E.children.splice(y,1):E.children[y]={type:"text",value:b.value},y;if(b.type==="element"){let v;for(v in rf)if(Object.hasOwn(rf,v)&&Object.hasOwn(b.properties,v)){const _=b.properties[v],N=rf[v];(N===null||N.includes(b.tagName))&&(b.properties[v]=h(String(_||""),v,b))}}if(b.type==="element"){let v=i?!i.includes(b.tagName):c?c.includes(b.tagName):!1;if(!v&&l&&typeof y=="number"&&(v=!l(b,y,E)),v&&E&&typeof y=="number")return f&&b.children?E.children.splice(y,1,...b.children):E.children.splice(y,1),y}}}function fT(e){const n=e.indexOf(":"),i=e.indexOf("?"),l=e.indexOf("#"),o=e.indexOf("/");return n===-1||o!==-1&&n>o||i!==-1&&n>i||l!==-1&&n>l||sT.test(e.slice(0,n))?e:""}function _y(e,n){const i=String(e);if(typeof n!="string")throw new TypeError("Expected character");let l=0,o=i.indexOf(n);for(;o!==-1;)l++,o=i.indexOf(n,o+n.length);return l}function hT(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function pT(e,n,i){const o=Bs((i||{}).ignore||[]),c=mT(n);let u=-1;for(;++u<c.length;)mx(e,"text",f);function f(p,b){let y=-1,E;for(;++y<b.length;){const v=b[y],_=E?E.children:void 0;if(o(v,_?_.indexOf(v):void 0,E))return;E=v}if(E)return h(p,b)}function h(p,b){const y=b[b.length-1],E=c[u][0],v=c[u][1];let _=0;const T=y.children.indexOf(p);let S=!1,D=[];E.lastIndex=0;let M=E.exec(p.value);for(;M;){const A=M.index,F={index:M.index,input:M.input,stack:[...b,p]};let L=v(...M,F);if(typeof L=="string"&&(L=L.length>0?{type:"text",value:L}:void 0),L===!1?E.lastIndex=A+1:(_!==A&&D.push({type:"text",value:p.value.slice(_,A)}),Array.isArray(L)?D.push(...L):L&&D.push(L),_=A+M[0].length,S=!0),!E.global)break;M=E.exec(p.value)}return S?(_<p.value.length&&D.push({type:"text",value:p.value.slice(_)}),y.children.splice(T,1,...D)):D=[p],T+D.length}}function mT(e){const n=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const i=!e[0]||Array.isArray(e[0])?e:[e];let l=-1;for(;++l<i.length;){const o=i[l];n.push([gT(o[0]),bT(o[1])])}return n}function gT(e){return typeof e=="string"?new RegExp(hT(e),"g"):e}function bT(e){return typeof e=="function"?e:function(){return e}}const mf="phrasing",gf=["autolink","link","image","label"];function yT(){return{transforms:[wT],enter:{literalAutolink:xT,literalAutolinkEmail:bf,literalAutolinkHttp:bf,literalAutolinkWww:bf},exit:{literalAutolink:kT,literalAutolinkEmail:_T,literalAutolinkHttp:ET,literalAutolinkWww:ST}}}function vT(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:mf,notInConstruct:gf},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:mf,notInConstruct:gf},{character:":",before:"[ps]",after:"\\/",inConstruct:mf,notInConstruct:gf}]}}function xT(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function bf(e){this.config.enter.autolinkProtocol.call(this,e)}function ET(e){this.config.exit.autolinkProtocol.call(this,e)}function ST(e){this.config.exit.data.call(this,e);const n=this.stack[this.stack.length-1];n.type,n.url="http://"+this.sliceSerialize(e)}function _T(e){this.config.exit.autolinkEmail.call(this,e)}function kT(e){this.exit(e)}function wT(e){pT(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,NT],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),TT]],{ignore:["link","linkReference"]})}function NT(e,n,i,l,o){let c="";if(!yx(o)||(/^w/i.test(n)&&(i=n+i,n="",c="http://"),!CT(i)))return!1;const u=AT(i+l);if(!u[0])return!1;const f={type:"link",title:null,url:c+n+u[0],children:[{type:"text",value:n+u[0]}]};return u[1]?[f,{type:"text",value:u[1]}]:f}function TT(e,n,i,l){return!yx(l,!0)||/[-\d_]$/.test(i)?!1:{type:"link",title:null,url:"mailto:"+n+"@"+i,children:[{type:"text",value:n+"@"+i}]}}function CT(e){const n=e.split(".");return!(n.length<2||n[n.length-1]&&(/_/.test(n[n.length-1])||!/[a-zA-Z\d]/.test(n[n.length-1]))||n[n.length-2]&&(/_/.test(n[n.length-2])||!/[a-zA-Z\d]/.test(n[n.length-2])))}function AT(e){const n=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let i=n[0],l=i.indexOf(")");const o=_y(e,"(");let c=_y(e,")");for(;l!==-1&&o>c;)e+=i.slice(0,l+1),i=i.slice(l+1),l=i.indexOf(")"),c++;return[e,i]}function yx(e,n){const i=e.input.charCodeAt(e.index-1);return(e.index===0||Ji(i)||jc(i))&&(!n||i!==47)}vx.peek=UT;function OT(){this.buffer()}function MT(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function RT(){this.buffer()}function DT(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function LT(e){const n=this.resume(),i=this.stack[this.stack.length-1];i.type,i.identifier=tr(this.sliceSerialize(e)).toLowerCase(),i.label=n}function IT(e){this.exit(e)}function zT(e){const n=this.resume(),i=this.stack[this.stack.length-1];i.type,i.identifier=tr(this.sliceSerialize(e)).toLowerCase(),i.label=n}function BT(e){this.exit(e)}function UT(){return"["}function vx(e,n,i,l){const o=i.createTracker(l);let c=o.move("[^");const u=i.enter("footnoteReference"),f=i.enter("reference");return c+=o.move(i.safe(i.associationId(e),{after:"]",before:c})),f(),u(),c+=o.move("]"),c}function jT(){return{enter:{gfmFootnoteCallString:OT,gfmFootnoteCall:MT,gfmFootnoteDefinitionLabelString:RT,gfmFootnoteDefinition:DT},exit:{gfmFootnoteCallString:LT,gfmFootnoteCall:IT,gfmFootnoteDefinitionLabelString:zT,gfmFootnoteDefinition:BT}}}function HT(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:i,footnoteReference:vx},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function i(l,o,c,u){const f=c.createTracker(u);let h=f.move("[^");const p=c.enter("footnoteDefinition"),b=c.enter("label");return h+=f.move(c.safe(c.associationId(l),{before:h,after:"]"})),b(),h+=f.move("]:"),l.children&&l.children.length>0&&(f.shift(4),h+=f.move((n?`
63
+ `:" ")+c.indentLines(c.containerFlow(l,f.current()),n?xx:PT))),p(),h}}function PT(e,n,i){return n===0?e:xx(e,n,i)}function xx(e,n,i){return(i?"":" ")+e}const FT=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Ex.peek=VT;function GT(){return{canContainEols:["delete"],enter:{strikethrough:KT},exit:{strikethrough:qT}}}function $T(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:FT}],handlers:{delete:Ex}}}function KT(e){this.enter({type:"delete",children:[]},e)}function qT(e){this.exit(e)}function Ex(e,n,i,l){const o=i.createTracker(l),c=i.enter("strikethrough");let u=o.move("~~");return u+=i.containerPhrasing(e,{...o.current(),before:u,after:"~"}),u+=o.move("~~"),c(),u}function VT(){return"~"}function YT(e){return e.length}function XT(e,n){const i=n||{},l=(i.align||[]).concat(),o=i.stringLength||YT,c=[],u=[],f=[],h=[];let p=0,b=-1;for(;++b<e.length;){const N=[],T=[];let S=-1;for(e[b].length>p&&(p=e[b].length);++S<e[b].length;){const D=ZT(e[b][S]);if(i.alignDelimiters!==!1){const M=o(D);T[S]=M,(h[S]===void 0||M>h[S])&&(h[S]=M)}N.push(D)}u[b]=N,f[b]=T}let y=-1;if(typeof l=="object"&&"length"in l)for(;++y<p;)c[y]=ky(l[y]);else{const N=ky(l);for(;++y<p;)c[y]=N}y=-1;const E=[],v=[];for(;++y<p;){const N=c[y];let T="",S="";N===99?(T=":",S=":"):N===108?T=":":N===114&&(S=":");let D=i.alignDelimiters===!1?1:Math.max(1,h[y]-T.length-S.length);const M=T+"-".repeat(D)+S;i.alignDelimiters!==!1&&(D=T.length+D+S.length,D>h[y]&&(h[y]=D),v[y]=D),E[y]=M}u.splice(1,0,E),f.splice(1,0,v),b=-1;const _=[];for(;++b<u.length;){const N=u[b],T=f[b];y=-1;const S=[];for(;++y<p;){const D=N[y]||"";let M="",A="";if(i.alignDelimiters!==!1){const F=h[y]-(T[y]||0),L=c[y];L===114?M=" ".repeat(F):L===99?F%2?(M=" ".repeat(F/2+.5),A=" ".repeat(F/2-.5)):(M=" ".repeat(F/2),A=M):A=" ".repeat(F)}i.delimiterStart!==!1&&!y&&S.push("|"),i.padding!==!1&&!(i.alignDelimiters===!1&&D==="")&&(i.delimiterStart!==!1||y)&&S.push(" "),i.alignDelimiters!==!1&&S.push(M),S.push(D),i.alignDelimiters!==!1&&S.push(A),i.padding!==!1&&S.push(" "),(i.delimiterEnd!==!1||y!==p-1)&&S.push("|")}_.push(i.delimiterEnd===!1?S.join("").replace(/ +$/,""):S.join(""))}return _.join(`
64
+ `)}function ZT(e){return e==null?"":String(e)}function ky(e){const n=typeof e=="string"?e.codePointAt(0):0;return n===67||n===99?99:n===76||n===108?108:n===82||n===114?114:0}function QT(e,n,i,l){const o=i.enter("blockquote"),c=i.createTracker(l);c.move("> "),c.shift(2);const u=i.indentLines(i.containerFlow(e,c.current()),WT);return o(),u}function WT(e,n,i){return">"+(i?"":" ")+e}function JT(e,n){return wy(e,n.inConstruct,!0)&&!wy(e,n.notInConstruct,!1)}function wy(e,n,i){if(typeof n=="string"&&(n=[n]),!n||n.length===0)return i;let l=-1;for(;++l<n.length;)if(e.includes(n[l]))return!0;return!1}function Ny(e,n,i,l){let o=-1;for(;++o<i.unsafe.length;)if(i.unsafe[o].character===`
65
+ `&&JT(i.stack,i.unsafe[o]))return/[ \t]/.test(l.before)?"":" ";return`\\
66
+ `}function eC(e,n){const i=String(e);let l=i.indexOf(n),o=l,c=0,u=0;if(typeof n!="string")throw new TypeError("Expected substring");for(;l!==-1;)l===o?++c>u&&(u=c):c=1,o=l+n.length,l=i.indexOf(n,o);return u}function tC(e,n){return!!(n.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function nC(e){const n=e.options.fence||"`";if(n!=="`"&&n!=="~")throw new Error("Cannot serialize code with `"+n+"` for `options.fence`, expected `` ` `` or `~`");return n}function rC(e,n,i,l){const o=nC(i),c=e.value||"",u=o==="`"?"GraveAccent":"Tilde";if(tC(e,i)){const y=i.enter("codeIndented"),E=i.indentLines(c,iC);return y(),E}const f=i.createTracker(l),h=o.repeat(Math.max(eC(c,o)+1,3)),p=i.enter("codeFenced");let b=f.move(h);if(e.lang){const y=i.enter(`codeFencedLang${u}`);b+=f.move(i.safe(e.lang,{before:b,after:" ",encode:["`"],...f.current()})),y()}if(e.lang&&e.meta){const y=i.enter(`codeFencedMeta${u}`);b+=f.move(" "),b+=f.move(i.safe(e.meta,{before:b,after:`
67
+ `,encode:["`"],...f.current()})),y()}return b+=f.move(`
68
+ `),c&&(b+=f.move(c+`
69
+ `)),b+=f.move(h),p(),b}function iC(e,n,i){return(i?"":" ")+e}function kh(e){const n=e.options.quote||'"';if(n!=='"'&&n!=="'")throw new Error("Cannot serialize title with `"+n+"` for `options.quote`, expected `\"`, or `'`");return n}function aC(e,n,i,l){const o=kh(i),c=o==='"'?"Quote":"Apostrophe",u=i.enter("definition");let f=i.enter("label");const h=i.createTracker(l);let p=h.move("[");return p+=h.move(i.safe(i.associationId(e),{before:p,after:"]",...h.current()})),p+=h.move("]: "),f(),!e.url||/[\0- \u007F]/.test(e.url)?(f=i.enter("destinationLiteral"),p+=h.move("<"),p+=h.move(i.safe(e.url,{before:p,after:">",...h.current()})),p+=h.move(">")):(f=i.enter("destinationRaw"),p+=h.move(i.safe(e.url,{before:p,after:e.title?" ":`
70
+ `,...h.current()}))),f(),e.title&&(f=i.enter(`title${c}`),p+=h.move(" "+o),p+=h.move(i.safe(e.title,{before:p,after:o,...h.current()})),p+=h.move(o),f()),u(),p}function lC(e){const n=e.options.emphasis||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize emphasis with `"+n+"` for `options.emphasis`, expected `*`, or `_`");return n}function As(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Oc(e,n,i){const l=ol(e),o=ol(n);return l===void 0?o===void 0?i==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:l===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}}Sx.peek=sC;function Sx(e,n,i,l){const o=lC(i),c=i.enter("emphasis"),u=i.createTracker(l),f=u.move(o);let h=u.move(i.containerPhrasing(e,{after:o,before:f,...u.current()}));const p=h.charCodeAt(0),b=Oc(l.before.charCodeAt(l.before.length-1),p,o);b.inside&&(h=As(p)+h.slice(1));const y=h.charCodeAt(h.length-1),E=Oc(l.after.charCodeAt(0),y,o);E.inside&&(h=h.slice(0,-1)+As(y));const v=u.move(o);return c(),i.attentionEncodeSurroundingInfo={after:E.outside,before:b.outside},f+h+v}function sC(e,n,i){return i.options.emphasis||"*"}function oC(e,n){let i=!1;return Gc(e,function(l){if("value"in l&&/\r?\n|\r/.test(l.value)||l.type==="break")return i=!0,Gf}),!!((!e.depth||e.depth<3)&&gh(e)&&(n.options.setext||i))}function cC(e,n,i,l){const o=Math.max(Math.min(6,e.depth||1),1),c=i.createTracker(l);if(oC(e,i)){const b=i.enter("headingSetext"),y=i.enter("phrasing"),E=i.containerPhrasing(e,{...c.current(),before:`
71
+ `,after:`
72
+ `});return y(),b(),E+`
73
+ `+(o===1?"=":"-").repeat(E.length-(Math.max(E.lastIndexOf("\r"),E.lastIndexOf(`
74
+ `))+1))}const u="#".repeat(o),f=i.enter("headingAtx"),h=i.enter("phrasing");c.move(u+" ");let p=i.containerPhrasing(e,{before:"# ",after:`
75
+ `,...c.current()});return/^[\t ]/.test(p)&&(p=As(p.charCodeAt(0))+p.slice(1)),p=p?u+" "+p:u,i.options.closeAtx&&(p+=" "+u),h(),f(),p}_x.peek=uC;function _x(e){return e.value||""}function uC(){return"<"}kx.peek=dC;function kx(e,n,i,l){const o=kh(i),c=o==='"'?"Quote":"Apostrophe",u=i.enter("image");let f=i.enter("label");const h=i.createTracker(l);let p=h.move("![");return p+=h.move(i.safe(e.alt,{before:p,after:"]",...h.current()})),p+=h.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=i.enter("destinationLiteral"),p+=h.move("<"),p+=h.move(i.safe(e.url,{before:p,after:">",...h.current()})),p+=h.move(">")):(f=i.enter("destinationRaw"),p+=h.move(i.safe(e.url,{before:p,after:e.title?" ":")",...h.current()}))),f(),e.title&&(f=i.enter(`title${c}`),p+=h.move(" "+o),p+=h.move(i.safe(e.title,{before:p,after:o,...h.current()})),p+=h.move(o),f()),p+=h.move(")"),u(),p}function dC(){return"!"}wx.peek=fC;function wx(e,n,i,l){const o=e.referenceType,c=i.enter("imageReference");let u=i.enter("label");const f=i.createTracker(l);let h=f.move("![");const p=i.safe(e.alt,{before:h,after:"]",...f.current()});h+=f.move(p+"]["),u();const b=i.stack;i.stack=[],u=i.enter("reference");const y=i.safe(i.associationId(e),{before:h,after:"]",...f.current()});return u(),i.stack=b,c(),o==="full"||!p||p!==y?h+=f.move(y+"]"):o==="shortcut"?h=h.slice(0,-1):h+=f.move("]"),h}function fC(){return"!"}Nx.peek=hC;function Nx(e,n,i){let l=e.value||"",o="`",c=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(l);)o+="`";for(/[^ \r\n]/.test(l)&&(/^[ \r\n]/.test(l)&&/[ \r\n]$/.test(l)||/^`|`$/.test(l))&&(l=" "+l+" ");++c<i.unsafe.length;){const u=i.unsafe[c],f=i.compilePattern(u);let h;if(u.atBreak)for(;h=f.exec(l);){let p=h.index;l.charCodeAt(p)===10&&l.charCodeAt(p-1)===13&&p--,l=l.slice(0,p)+" "+l.slice(h.index+1)}}return o+l+o}function hC(){return"`"}function Tx(e,n){const i=gh(e);return!!(!n.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(i===e.url||"mailto:"+i===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Cx.peek=pC;function Cx(e,n,i,l){const o=kh(i),c=o==='"'?"Quote":"Apostrophe",u=i.createTracker(l);let f,h;if(Tx(e,i)){const b=i.stack;i.stack=[],f=i.enter("autolink");let y=u.move("<");return y+=u.move(i.containerPhrasing(e,{before:y,after:">",...u.current()})),y+=u.move(">"),f(),i.stack=b,y}f=i.enter("link"),h=i.enter("label");let p=u.move("[");return p+=u.move(i.containerPhrasing(e,{before:p,after:"](",...u.current()})),p+=u.move("]("),h(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(h=i.enter("destinationLiteral"),p+=u.move("<"),p+=u.move(i.safe(e.url,{before:p,after:">",...u.current()})),p+=u.move(">")):(h=i.enter("destinationRaw"),p+=u.move(i.safe(e.url,{before:p,after:e.title?" ":")",...u.current()}))),h(),e.title&&(h=i.enter(`title${c}`),p+=u.move(" "+o),p+=u.move(i.safe(e.title,{before:p,after:o,...u.current()})),p+=u.move(o),h()),p+=u.move(")"),f(),p}function pC(e,n,i){return Tx(e,i)?"<":"["}Ax.peek=mC;function Ax(e,n,i,l){const o=e.referenceType,c=i.enter("linkReference");let u=i.enter("label");const f=i.createTracker(l);let h=f.move("[");const p=i.containerPhrasing(e,{before:h,after:"]",...f.current()});h+=f.move(p+"]["),u();const b=i.stack;i.stack=[],u=i.enter("reference");const y=i.safe(i.associationId(e),{before:h,after:"]",...f.current()});return u(),i.stack=b,c(),o==="full"||!p||p!==y?h+=f.move(y+"]"):o==="shortcut"?h=h.slice(0,-1):h+=f.move("]"),h}function mC(){return"["}function wh(e){const n=e.options.bullet||"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bullet`, expected `*`, `+`, or `-`");return n}function gC(e){const n=wh(e),i=e.options.bulletOther;if(!i)return n==="*"?"-":"*";if(i!=="*"&&i!=="+"&&i!=="-")throw new Error("Cannot serialize items with `"+i+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(i===n)throw new Error("Expected `bullet` (`"+n+"`) and `bulletOther` (`"+i+"`) to be different");return i}function bC(e){const n=e.options.bulletOrdered||".";if(n!=="."&&n!==")")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOrdered`, expected `.` or `)`");return n}function Ox(e){const n=e.options.rule||"*";if(n!=="*"&&n!=="-"&&n!=="_")throw new Error("Cannot serialize rules with `"+n+"` for `options.rule`, expected `*`, `-`, or `_`");return n}function yC(e,n,i,l){const o=i.enter("list"),c=i.bulletCurrent;let u=e.ordered?bC(i):wh(i);const f=e.ordered?u==="."?")":".":gC(i);let h=n&&i.bulletLastUsed?u===i.bulletLastUsed:!1;if(!e.ordered){const b=e.children?e.children[0]:void 0;if((u==="*"||u==="-")&&b&&(!b.children||!b.children[0])&&i.stack[i.stack.length-1]==="list"&&i.stack[i.stack.length-2]==="listItem"&&i.stack[i.stack.length-3]==="list"&&i.stack[i.stack.length-4]==="listItem"&&i.indexStack[i.indexStack.length-1]===0&&i.indexStack[i.indexStack.length-2]===0&&i.indexStack[i.indexStack.length-3]===0&&(h=!0),Ox(i)===u&&b){let y=-1;for(;++y<e.children.length;){const E=e.children[y];if(E&&E.type==="listItem"&&E.children&&E.children[0]&&E.children[0].type==="thematicBreak"){h=!0;break}}}}h&&(u=f),i.bulletCurrent=u;const p=i.containerFlow(e,l);return i.bulletLastUsed=u,i.bulletCurrent=c,o(),p}function vC(e){const n=e.options.listItemIndent||"one";if(n!=="tab"&&n!=="one"&&n!=="mixed")throw new Error("Cannot serialize items with `"+n+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return n}function xC(e,n,i,l){const o=vC(i);let c=i.bulletCurrent||wh(i);n&&n.type==="list"&&n.ordered&&(c=(typeof n.start=="number"&&n.start>-1?n.start:1)+(i.options.incrementListMarker===!1?0:n.children.indexOf(e))+c);let u=c.length+1;(o==="tab"||o==="mixed"&&(n&&n.type==="list"&&n.spread||e.spread))&&(u=Math.ceil(u/4)*4);const f=i.createTracker(l);f.move(c+" ".repeat(u-c.length)),f.shift(u);const h=i.enter("listItem"),p=i.indentLines(i.containerFlow(e,f.current()),b);return h(),p;function b(y,E,v){return E?(v?"":" ".repeat(u))+y:(v?c:c+" ".repeat(u-c.length))+y}}function EC(e,n,i,l){const o=i.enter("paragraph"),c=i.enter("phrasing"),u=i.containerPhrasing(e,l);return c(),o(),u}const SC=Bs(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function _C(e,n,i,l){return(e.children.some(function(u){return SC(u)})?i.containerPhrasing:i.containerFlow).call(i,e,l)}function kC(e){const n=e.options.strong||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize strong with `"+n+"` for `options.strong`, expected `*`, or `_`");return n}Mx.peek=wC;function Mx(e,n,i,l){const o=kC(i),c=i.enter("strong"),u=i.createTracker(l),f=u.move(o+o);let h=u.move(i.containerPhrasing(e,{after:o,before:f,...u.current()}));const p=h.charCodeAt(0),b=Oc(l.before.charCodeAt(l.before.length-1),p,o);b.inside&&(h=As(p)+h.slice(1));const y=h.charCodeAt(h.length-1),E=Oc(l.after.charCodeAt(0),y,o);E.inside&&(h=h.slice(0,-1)+As(y));const v=u.move(o+o);return c(),i.attentionEncodeSurroundingInfo={after:E.outside,before:b.outside},f+h+v}function wC(e,n,i){return i.options.strong||"*"}function NC(e,n,i,l){return i.safe(e.value,l)}function TC(e){const n=e.options.ruleRepetition||3;if(n<3)throw new Error("Cannot serialize rules with repetition `"+n+"` for `options.ruleRepetition`, expected `3` or more");return n}function CC(e,n,i){const l=(Ox(i)+(i.options.ruleSpaces?" ":"")).repeat(TC(i));return i.options.ruleSpaces?l.slice(0,-1):l}const Rx={blockquote:QT,break:Ny,code:rC,definition:aC,emphasis:Sx,hardBreak:Ny,heading:cC,html:_x,image:kx,imageReference:wx,inlineCode:Nx,link:Cx,linkReference:Ax,list:yC,listItem:xC,paragraph:EC,root:_C,strong:Mx,text:NC,thematicBreak:CC};function AC(){return{enter:{table:OC,tableData:Ty,tableHeader:Ty,tableRow:RC},exit:{codeText:DC,table:MC,tableData:yf,tableHeader:yf,tableRow:yf}}}function OC(e){const n=e._align;this.enter({type:"table",align:n.map(function(i){return i==="none"?null:i}),children:[]},e),this.data.inTable=!0}function MC(e){this.exit(e),this.data.inTable=void 0}function RC(e){this.enter({type:"tableRow",children:[]},e)}function yf(e){this.exit(e)}function Ty(e){this.enter({type:"tableCell",children:[]},e)}function DC(e){let n=this.resume();this.data.inTable&&(n=n.replace(/\\([\\|])/g,LC));const i=this.stack[this.stack.length-1];i.type,i.value=n,this.exit(e)}function LC(e,n){return n==="|"?n:e}function IC(e){const n=e||{},i=n.tableCellPadding,l=n.tablePipeAlign,o=n.stringLength,c=i?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
76
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:E,table:u,tableCell:h,tableRow:f}};function u(v,_,N,T){return p(b(v,N,T),v.align)}function f(v,_,N,T){const S=y(v,N,T),D=p([S]);return D.slice(0,D.indexOf(`
77
+ `))}function h(v,_,N,T){const S=N.enter("tableCell"),D=N.enter("phrasing"),M=N.containerPhrasing(v,{...T,before:c,after:c});return D(),S(),M}function p(v,_){return XT(v,{align:_,alignDelimiters:l,padding:i,stringLength:o})}function b(v,_,N){const T=v.children;let S=-1;const D=[],M=_.enter("table");for(;++S<T.length;)D[S]=y(T[S],_,N);return M(),D}function y(v,_,N){const T=v.children;let S=-1;const D=[],M=_.enter("tableRow");for(;++S<T.length;)D[S]=h(T[S],v,_,N);return M(),D}function E(v,_,N){let T=Rx.inlineCode(v,_,N);return N.stack.includes("tableCell")&&(T=T.replace(/\|/g,"\\$&")),T}}function zC(){return{exit:{taskListCheckValueChecked:Cy,taskListCheckValueUnchecked:Cy,paragraph:UC}}}function BC(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:jC}}}function Cy(e){const n=this.stack[this.stack.length-2];n.type,n.checked=e.type==="taskListCheckValueChecked"}function UC(e){const n=this.stack[this.stack.length-2];if(n&&n.type==="listItem"&&typeof n.checked=="boolean"){const i=this.stack[this.stack.length-1];i.type;const l=i.children[0];if(l&&l.type==="text"){const o=n.children;let c=-1,u;for(;++c<o.length;){const f=o[c];if(f.type==="paragraph"){u=f;break}}u===i&&(l.value=l.value.slice(1),l.value.length===0?i.children.shift():i.position&&l.position&&typeof l.position.start.offset=="number"&&(l.position.start.column++,l.position.start.offset++,i.position.start=Object.assign({},l.position.start)))}}this.exit(e)}function jC(e,n,i,l){const o=e.children[0],c=typeof e.checked=="boolean"&&o&&o.type==="paragraph",u="["+(e.checked?"x":" ")+"] ",f=i.createTracker(l);c&&f.move(u);let h=Rx.listItem(e,n,i,{...l,...f.current()});return c&&(h=h.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,p)),h;function p(b){return b+u}}function HC(){return[yT(),jT(),GT(),AC(),zC()]}function PC(e){return{extensions:[vT(),HT(e),$T(),IC(e),BC()]}}const FC={tokenize:YC,partial:!0},Dx={tokenize:XC,partial:!0},Lx={tokenize:ZC,partial:!0},Ix={tokenize:QC,partial:!0},GC={tokenize:WC,partial:!0},zx={name:"wwwAutolink",tokenize:qC,previous:Ux},Bx={name:"protocolAutolink",tokenize:VC,previous:jx},Gr={name:"emailAutolink",tokenize:KC,previous:Hx},yr={};function $C(){return{text:yr}}let Xi=48;for(;Xi<123;)yr[Xi]=Gr,Xi++,Xi===58?Xi=65:Xi===91&&(Xi=97);yr[43]=Gr;yr[45]=Gr;yr[46]=Gr;yr[95]=Gr;yr[72]=[Gr,Bx];yr[104]=[Gr,Bx];yr[87]=[Gr,zx];yr[119]=[Gr,zx];function KC(e,n,i){const l=this;let o,c;return u;function u(y){return!Vf(y)||!Hx.call(l,l.previous)||Nh(l.events)?i(y):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),f(y))}function f(y){return Vf(y)?(e.consume(y),f):y===64?(e.consume(y),h):i(y)}function h(y){return y===46?e.check(GC,b,p)(y):y===45||y===95||tn(y)?(c=!0,e.consume(y),h):b(y)}function p(y){return e.consume(y),o=!0,h}function b(y){return c&&o&&un(l.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),n(y)):i(y)}}function qC(e,n,i){const l=this;return o;function o(u){return u!==87&&u!==119||!Ux.call(l,l.previous)||Nh(l.events)?i(u):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(FC,e.attempt(Dx,e.attempt(Lx,c),i),i)(u))}function c(u){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),n(u)}}function VC(e,n,i){const l=this;let o="",c=!1;return u;function u(y){return(y===72||y===104)&&jx.call(l,l.previous)&&!Nh(l.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(y),e.consume(y),f):i(y)}function f(y){if(un(y)&&o.length<5)return o+=String.fromCodePoint(y),e.consume(y),f;if(y===58){const E=o.toLowerCase();if(E==="http"||E==="https")return e.consume(y),h}return i(y)}function h(y){return y===47?(e.consume(y),c?p:(c=!0,h)):i(y)}function p(y){return y===null||Tc(y)||gt(y)||Ji(y)||jc(y)?i(y):e.attempt(Dx,e.attempt(Lx,b),i)(y)}function b(y){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),n(y)}}function YC(e,n,i){let l=0;return o;function o(u){return(u===87||u===119)&&l<3?(l++,e.consume(u),o):u===46&&l===3?(e.consume(u),c):i(u)}function c(u){return u===null?i(u):n(u)}}function XC(e,n,i){let l,o,c;return u;function u(p){return p===46||p===95?e.check(Ix,h,f)(p):p===null||gt(p)||Ji(p)||p!==45&&jc(p)?h(p):(c=!0,e.consume(p),u)}function f(p){return p===95?l=!0:(o=l,l=void 0),e.consume(p),u}function h(p){return o||l||!c?i(p):n(p)}}function ZC(e,n){let i=0,l=0;return o;function o(u){return u===40?(i++,e.consume(u),o):u===41&&l<i?c(u):u===33||u===34||u===38||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===60||u===63||u===93||u===95||u===126?e.check(Ix,n,c)(u):u===null||gt(u)||Ji(u)?n(u):(e.consume(u),o)}function c(u){return u===41&&l++,e.consume(u),o}}function QC(e,n,i){return l;function l(f){return f===33||f===34||f===39||f===41||f===42||f===44||f===46||f===58||f===59||f===63||f===95||f===126?(e.consume(f),l):f===38?(e.consume(f),c):f===93?(e.consume(f),o):f===60||f===null||gt(f)||Ji(f)?n(f):i(f)}function o(f){return f===null||f===40||f===91||gt(f)||Ji(f)?n(f):l(f)}function c(f){return un(f)?u(f):i(f)}function u(f){return f===59?(e.consume(f),l):un(f)?(e.consume(f),u):i(f)}}function WC(e,n,i){return l;function l(c){return e.consume(c),o}function o(c){return tn(c)?i(c):n(c)}}function Ux(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||gt(e)}function jx(e){return!un(e)}function Hx(e){return!(e===47||Vf(e))}function Vf(e){return e===43||e===45||e===46||e===95||tn(e)}function Nh(e){let n=e.length,i=!1;for(;n--;){const l=e[n][1];if((l.type==="labelLink"||l.type==="labelImage")&&!l._balanced){i=!0;break}if(l._gfmAutolinkLiteralWalkedInto){i=!1;break}}return e.length>0&&!i&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),i}const JC={tokenize:s2,partial:!0};function e2(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:i2,continuation:{tokenize:a2},exit:l2}},text:{91:{name:"gfmFootnoteCall",tokenize:r2},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:t2,resolveTo:n2}}}}function t2(e,n,i){const l=this;let o=l.events.length;const c=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]);let u;for(;o--;){const h=l.events[o][1];if(h.type==="labelImage"){u=h;break}if(h.type==="gfmFootnoteCall"||h.type==="labelLink"||h.type==="label"||h.type==="image"||h.type==="link")break}return f;function f(h){if(!u||!u._balanced)return i(h);const p=tr(l.sliceSerialize({start:u.end,end:l.now()}));return p.codePointAt(0)!==94||!c.includes(p.slice(1))?i(h):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),n(h))}}function n2(e,n){let i=e.length;for(;i--;)if(e[i][1].type==="labelImage"&&e[i][0]==="enter"){e[i][1];break}e[i+1][1].type="data",e[i+3][1].type="gfmFootnoteCallLabelMarker";const l={type:"gfmFootnoteCall",start:Object.assign({},e[i+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[i+3][1].end),end:Object.assign({},e[i+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const c={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},u={type:"chunkString",contentType:"string",start:Object.assign({},c.start),end:Object.assign({},c.end)},f=[e[i+1],e[i+2],["enter",l,n],e[i+3],e[i+4],["enter",o,n],["exit",o,n],["enter",c,n],["enter",u,n],["exit",u,n],["exit",c,n],e[e.length-2],e[e.length-1],["exit",l,n]];return e.splice(i,e.length-i+1,...f),e}function r2(e,n,i){const l=this,o=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]);let c=0,u;return f;function f(y){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(y),e.exit("gfmFootnoteCallLabelMarker"),h}function h(y){return y!==94?i(y):(e.enter("gfmFootnoteCallMarker"),e.consume(y),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",p)}function p(y){if(c>999||y===93&&!u||y===null||y===91||gt(y))return i(y);if(y===93){e.exit("chunkString");const E=e.exit("gfmFootnoteCallString");return o.includes(tr(l.sliceSerialize(E)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(y),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),n):i(y)}return gt(y)||(u=!0),c++,e.consume(y),y===92?b:p}function b(y){return y===91||y===92||y===93?(e.consume(y),c++,p):p(y)}}function i2(e,n,i){const l=this,o=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]);let c,u=0,f;return h;function h(_){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(_),e.exit("gfmFootnoteDefinitionLabelMarker"),p}function p(_){return _===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(_),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",b):i(_)}function b(_){if(u>999||_===93&&!f||_===null||_===91||gt(_))return i(_);if(_===93){e.exit("chunkString");const N=e.exit("gfmFootnoteDefinitionLabelString");return c=tr(l.sliceSerialize(N)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(_),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),E}return gt(_)||(f=!0),u++,e.consume(_),_===92?y:b}function y(_){return _===91||_===92||_===93?(e.consume(_),u++,b):b(_)}function E(_){return _===58?(e.enter("definitionMarker"),e.consume(_),e.exit("definitionMarker"),o.includes(c)||o.push(c),Ze(e,v,"gfmFootnoteDefinitionWhitespace")):i(_)}function v(_){return n(_)}}function a2(e,n,i){return e.check(zs,n,e.attempt(JC,n,i))}function l2(e){e.exit("gfmFootnoteDefinition")}function s2(e,n,i){const l=this;return Ze(e,o,"gfmFootnoteDefinitionIndent",5);function o(c){const u=l.events[l.events.length-1];return u&&u[1].type==="gfmFootnoteDefinitionIndent"&&u[2].sliceSerialize(u[1],!0).length===4?n(c):i(c)}}function o2(e){let i=(e||{}).singleTilde;const l={name:"strikethrough",tokenize:c,resolveAll:o};return i==null&&(i=!0),{text:{126:l},insideSpan:{null:[l]},attentionMarkers:{null:[126]}};function o(u,f){let h=-1;for(;++h<u.length;)if(u[h][0]==="enter"&&u[h][1].type==="strikethroughSequenceTemporary"&&u[h][1]._close){let p=h;for(;p--;)if(u[p][0]==="exit"&&u[p][1].type==="strikethroughSequenceTemporary"&&u[p][1]._open&&u[h][1].end.offset-u[h][1].start.offset===u[p][1].end.offset-u[p][1].start.offset){u[h][1].type="strikethroughSequence",u[p][1].type="strikethroughSequence";const b={type:"strikethrough",start:Object.assign({},u[p][1].start),end:Object.assign({},u[h][1].end)},y={type:"strikethroughText",start:Object.assign({},u[p][1].end),end:Object.assign({},u[h][1].start)},E=[["enter",b,f],["enter",u[p][1],f],["exit",u[p][1],f],["enter",y,f]],v=f.parser.constructs.insideSpan.null;v&&In(E,E.length,0,Hc(v,u.slice(p+1,h),f)),In(E,E.length,0,[["exit",y,f],["enter",u[h][1],f],["exit",u[h][1],f],["exit",b,f]]),In(u,p-1,h-p+3,E),h=p+E.length-2;break}}for(h=-1;++h<u.length;)u[h][1].type==="strikethroughSequenceTemporary"&&(u[h][1].type="data");return u}function c(u,f,h){const p=this.previous,b=this.events;let y=0;return E;function E(_){return p===126&&b[b.length-1][1].type!=="characterEscape"?h(_):(u.enter("strikethroughSequenceTemporary"),v(_))}function v(_){const N=ol(p);if(_===126)return y>1?h(_):(u.consume(_),y++,v);if(y<2&&!i)return h(_);const T=u.exit("strikethroughSequenceTemporary"),S=ol(_);return T._open=!S||S===2&&!!N,T._close=!N||N===2&&!!S,f(_)}}}class c2{constructor(){this.map=[]}add(n,i,l){u2(this,n,i,l)}consume(n){if(this.map.sort(function(c,u){return c[0]-u[0]}),this.map.length===0)return;let i=this.map.length;const l=[];for(;i>0;)i-=1,l.push(n.slice(this.map[i][0]+this.map[i][1]),this.map[i][2]),n.length=this.map[i][0];l.push(n.slice()),n.length=0;let o=l.pop();for(;o;){for(const c of o)n.push(c);o=l.pop()}this.map.length=0}}function u2(e,n,i,l){let o=0;if(!(i===0&&l.length===0)){for(;o<e.map.length;){if(e.map[o][0]===n){e.map[o][1]+=i,e.map[o][2].push(...l);return}o+=1}e.map.push([n,i,l])}}function d2(e,n){let i=!1;const l=[];for(;n<e.length;){const o=e[n];if(i){if(o[0]==="enter")o[1].type==="tableContent"&&l.push(e[n+1][1].type==="tableDelimiterMarker"?"left":"none");else if(o[1].type==="tableContent"){if(e[n-1][1].type==="tableDelimiterMarker"){const c=l.length-1;l[c]=l[c]==="left"?"center":"right"}}else if(o[1].type==="tableDelimiterRow")break}else o[0]==="enter"&&o[1].type==="tableDelimiterRow"&&(i=!0);n+=1}return l}function f2(){return{flow:{null:{name:"table",tokenize:h2,resolveAll:p2}}}}function h2(e,n,i){const l=this;let o=0,c=0,u;return f;function f(B){let Q=l.events.length-1;for(;Q>-1;){const se=l.events[Q][1].type;if(se==="lineEnding"||se==="linePrefix")Q--;else break}const ee=Q>-1?l.events[Q][1].type:null,me=ee==="tableHead"||ee==="tableRow"?L:h;return me===L&&l.parser.lazy[l.now().line]?i(B):me(B)}function h(B){return e.enter("tableHead"),e.enter("tableRow"),p(B)}function p(B){return B===124||(u=!0,c+=1),b(B)}function b(B){return B===null?i(B):Ce(B)?c>1?(c=0,l.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(B),e.exit("lineEnding"),v):i(B):$e(B)?Ze(e,b,"whitespace")(B):(c+=1,u&&(u=!1,o+=1),B===124?(e.enter("tableCellDivider"),e.consume(B),e.exit("tableCellDivider"),u=!0,b):(e.enter("data"),y(B)))}function y(B){return B===null||B===124||gt(B)?(e.exit("data"),b(B)):(e.consume(B),B===92?E:y)}function E(B){return B===92||B===124?(e.consume(B),y):y(B)}function v(B){return l.interrupt=!1,l.parser.lazy[l.now().line]?i(B):(e.enter("tableDelimiterRow"),u=!1,$e(B)?Ze(e,_,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):_(B))}function _(B){return B===45||B===58?T(B):B===124?(u=!0,e.enter("tableCellDivider"),e.consume(B),e.exit("tableCellDivider"),N):F(B)}function N(B){return $e(B)?Ze(e,T,"whitespace")(B):T(B)}function T(B){return B===58?(c+=1,u=!0,e.enter("tableDelimiterMarker"),e.consume(B),e.exit("tableDelimiterMarker"),S):B===45?(c+=1,S(B)):B===null||Ce(B)?A(B):F(B)}function S(B){return B===45?(e.enter("tableDelimiterFiller"),D(B)):F(B)}function D(B){return B===45?(e.consume(B),D):B===58?(u=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(B),e.exit("tableDelimiterMarker"),M):(e.exit("tableDelimiterFiller"),M(B))}function M(B){return $e(B)?Ze(e,A,"whitespace")(B):A(B)}function A(B){return B===124?_(B):B===null||Ce(B)?!u||o!==c?F(B):(e.exit("tableDelimiterRow"),e.exit("tableHead"),n(B)):F(B)}function F(B){return i(B)}function L(B){return e.enter("tableRow"),X(B)}function X(B){return B===124?(e.enter("tableCellDivider"),e.consume(B),e.exit("tableCellDivider"),X):B===null||Ce(B)?(e.exit("tableRow"),n(B)):$e(B)?Ze(e,X,"whitespace")(B):(e.enter("data"),re(B))}function re(B){return B===null||B===124||gt(B)?(e.exit("data"),X(B)):(e.consume(B),B===92?oe:re)}function oe(B){return B===92||B===124?(e.consume(B),re):re(B)}}function p2(e,n){let i=-1,l=!0,o=0,c=[0,0,0,0],u=[0,0,0,0],f=!1,h=0,p,b,y;const E=new c2;for(;++i<e.length;){const v=e[i],_=v[1];v[0]==="enter"?_.type==="tableHead"?(f=!1,h!==0&&(Ay(E,n,h,p,b),b=void 0,h=0),p={type:"table",start:Object.assign({},_.start),end:Object.assign({},_.end)},E.add(i,0,[["enter",p,n]])):_.type==="tableRow"||_.type==="tableDelimiterRow"?(l=!0,y=void 0,c=[0,0,0,0],u=[0,i+1,0,0],f&&(f=!1,b={type:"tableBody",start:Object.assign({},_.start),end:Object.assign({},_.end)},E.add(i,0,[["enter",b,n]])),o=_.type==="tableDelimiterRow"?2:b?3:1):o&&(_.type==="data"||_.type==="tableDelimiterMarker"||_.type==="tableDelimiterFiller")?(l=!1,u[2]===0&&(c[1]!==0&&(u[0]=u[1],y=uc(E,n,c,o,void 0,y),c=[0,0,0,0]),u[2]=i)):_.type==="tableCellDivider"&&(l?l=!1:(c[1]!==0&&(u[0]=u[1],y=uc(E,n,c,o,void 0,y)),c=u,u=[c[1],i,0,0])):_.type==="tableHead"?(f=!0,h=i):_.type==="tableRow"||_.type==="tableDelimiterRow"?(h=i,c[1]!==0?(u[0]=u[1],y=uc(E,n,c,o,i,y)):u[1]!==0&&(y=uc(E,n,u,o,i,y)),o=0):o&&(_.type==="data"||_.type==="tableDelimiterMarker"||_.type==="tableDelimiterFiller")&&(u[3]=i)}for(h!==0&&Ay(E,n,h,p,b),E.consume(n.events),i=-1;++i<n.events.length;){const v=n.events[i];v[0]==="enter"&&v[1].type==="table"&&(v[1]._align=d2(n.events,i))}return e}function uc(e,n,i,l,o,c){const u=l===1?"tableHeader":l===2?"tableDelimiter":"tableData",f="tableContent";i[0]!==0&&(c.end=Object.assign({},Xa(n.events,i[0])),e.add(i[0],0,[["exit",c,n]]));const h=Xa(n.events,i[1]);if(c={type:u,start:Object.assign({},h),end:Object.assign({},h)},e.add(i[1],0,[["enter",c,n]]),i[2]!==0){const p=Xa(n.events,i[2]),b=Xa(n.events,i[3]),y={type:f,start:Object.assign({},p),end:Object.assign({},b)};if(e.add(i[2],0,[["enter",y,n]]),l!==2){const E=n.events[i[2]],v=n.events[i[3]];if(E[1].end=Object.assign({},v[1].end),E[1].type="chunkText",E[1].contentType="text",i[3]>i[2]+1){const _=i[2]+1,N=i[3]-i[2]-1;e.add(_,N,[])}}e.add(i[3]+1,0,[["exit",y,n]])}return o!==void 0&&(c.end=Object.assign({},Xa(n.events,o)),e.add(o,0,[["exit",c,n]]),c=void 0),c}function Ay(e,n,i,l,o){const c=[],u=Xa(n.events,i);o&&(o.end=Object.assign({},u),c.push(["exit",o,n])),l.end=Object.assign({},u),c.push(["exit",l,n]),e.add(i+1,0,c)}function Xa(e,n){const i=e[n],l=i[0]==="enter"?"start":"end";return i[1][l]}const m2={name:"tasklistCheck",tokenize:b2};function g2(){return{text:{91:m2}}}function b2(e,n,i){const l=this;return o;function o(h){return l.previous!==null||!l._gfmTasklistFirstContentOfListItem?i(h):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),c)}function c(h){return gt(h)?(e.enter("taskListCheckValueUnchecked"),e.consume(h),e.exit("taskListCheckValueUnchecked"),u):h===88||h===120?(e.enter("taskListCheckValueChecked"),e.consume(h),e.exit("taskListCheckValueChecked"),u):i(h)}function u(h){return h===93?(e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),f):i(h)}function f(h){return Ce(h)?n(h):$e(h)?e.check({tokenize:y2},n,i)(h):i(h)}}function y2(e,n,i){return Ze(e,l,"whitespace");function l(o){return o===null?i(o):n(o)}}function v2(e){return Zv([$C(),e2(),o2(e),f2(),g2()])}const x2={};function Px(e){const n=this,i=e||x2,l=n.data(),o=l.micromarkExtensions||(l.micromarkExtensions=[]),c=l.fromMarkdownExtensions||(l.fromMarkdownExtensions=[]),u=l.toMarkdownExtensions||(l.toMarkdownExtensions=[]);o.push(v2(i)),c.push(HC()),u.push(PC(i))}const Oy=(function(e,n,i){const l=Bs(i);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof n=="number"){if(n<0||n===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(n=e.children.indexOf(n),n<0)throw new Error("Expected child node or index");for(;++n<e.children.length;)if(l(e.children[n],n,e))return e.children[n]}),na=(function(e){if(e==null)return _2;if(typeof e=="string")return S2(e);if(typeof e=="object")return E2(e);if(typeof e=="function")return Th(e);throw new Error("Expected function, string, or array as `test`")});function E2(e){const n=[];let i=-1;for(;++i<e.length;)n[i]=na(e[i]);return Th(l);function l(...o){let c=-1;for(;++c<n.length;)if(n[c].apply(this,o))return!0;return!1}}function S2(e){return Th(n);function n(i){return i.tagName===e}}function Th(e){return n;function n(i,l,o){return!!(k2(i)&&e.call(this,i,typeof l=="number"?l:void 0,o||void 0))}}function _2(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function k2(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const My=/\n/g,Ry=/[\t ]+/g,Yf=na("br"),Dy=na(R2),w2=na("p"),Ly=na("tr"),N2=na(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",M2,D2]),Fx=na(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function T2(e,n){const i=n||{},l="children"in e?e.children:[],o=Fx(e),c=Kx(e,{whitespace:i.whitespace||"normal"}),u=[];(e.type==="text"||e.type==="comment")&&u.push(...$x(e,{breakBefore:!0,breakAfter:!0}));let f=-1;for(;++f<l.length;)u.push(...Gx(l[f],e,{whitespace:c,breakBefore:f?void 0:o,breakAfter:f<l.length-1?Yf(l[f+1]):o}));const h=[];let p;for(f=-1;++f<u.length;){const b=u[f];typeof b=="number"?p!==void 0&&b>p&&(p=b):b&&(p!==void 0&&p>-1&&h.push(`
78
+ `.repeat(p)||" "),p=-1,h.push(b))}return h.join("")}function Gx(e,n,i){return e.type==="element"?C2(e,n,i):e.type==="text"?i.whitespace==="normal"?$x(e,i):A2(e):[]}function C2(e,n,i){const l=Kx(e,i),o=e.children||[];let c=-1,u=[];if(N2(e))return u;let f,h;for(Yf(e)||Ly(e)&&Oy(n,e,Ly)?h=`
79
+ `:w2(e)?(f=2,h=2):Fx(e)&&(f=1,h=1);++c<o.length;)u=u.concat(Gx(o[c],e,{whitespace:l,breakBefore:c?void 0:f,breakAfter:c<o.length-1?Yf(o[c+1]):h}));return Dy(e)&&Oy(n,e,Dy)&&u.push(" "),f&&u.unshift(f),h&&u.push(h),u}function $x(e,n){const i=String(e.value),l=[],o=[];let c=0;for(;c<=i.length;){My.lastIndex=c;const h=My.exec(i),p=h&&"index"in h?h.index:i.length;l.push(O2(i.slice(c,p).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),c===0?n.breakBefore:!0,p===i.length?n.breakAfter:!0)),c=p+1}let u=-1,f;for(;++u<l.length;)l[u].charCodeAt(l[u].length-1)===8203||u<l.length-1&&l[u+1].charCodeAt(0)===8203?(o.push(l[u]),f=void 0):l[u]?(typeof f=="number"&&o.push(f),o.push(l[u]),f=0):(u===0||u===l.length-1)&&o.push(0);return o}function A2(e){return[String(e.value)]}function O2(e,n,i){const l=[];let o=0,c;for(;o<e.length;){Ry.lastIndex=o;const u=Ry.exec(e);c=u?u.index:e.length,!o&&!c&&u&&!n&&l.push(""),o!==c&&l.push(e.slice(o,c)),o=u?c+u[0].length:c}return o!==c&&!i&&l.push(""),l.join(" ")}function Kx(e,n){if(e.type==="element"){const i=e.properties||{};switch(e.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return i.wrap?"pre-wrap":"pre";case"td":case"th":return i.noWrap?"nowrap":n.whitespace;case"textarea":return"pre-wrap"}}return n.whitespace}function M2(e){return!!(e.properties||{}).hidden}function R2(e){return e.tagName==="td"||e.tagName==="th"}function D2(e){return e.tagName==="dialog"&&!(e.properties||{}).open}function L2(e){const n=e.regex,i=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),l="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",u="(?!struct)("+l+"|"+n.optional(o)+"[a-zA-Z_]\\w*"+n.optional("<[^<>]+>")+")",f={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},p={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},b={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},y={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(p,{className:"string"}),{className:"string",begin:/<.*?>/},i,e.C_BLOCK_COMMENT_MODE]},E={className:"title",begin:n.optional(o)+e.IDENT_RE,relevance:0},v=n.optional(o)+e.IDENT_RE+"\\s*\\(",_=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],N=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],T=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],S=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],A={type:N,keyword:_,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:T},F={className:"function.dispatch",relevance:0,keywords:{_hint:S},begin:n.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,n.lookahead(/(<[^<>]+>|)\s*\(/))},L=[F,y,f,i,e.C_BLOCK_COMMENT_MODE,b,p],X={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:A,contains:L.concat([{begin:/\(/,end:/\)/,keywords:A,contains:L.concat(["self"]),relevance:0}]),relevance:0},re={className:"function",begin:"("+u+"[\\*&\\s]+)+"+v,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:A,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:l,keywords:A,relevance:0},{begin:v,returnBegin:!0,contains:[E],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[p,b]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:A,relevance:0,contains:[i,e.C_BLOCK_COMMENT_MODE,p,b,f,{begin:/\(/,end:/\)/,keywords:A,relevance:0,contains:["self",i,e.C_BLOCK_COMMENT_MODE,p,b,f]}]},f,i,e.C_BLOCK_COMMENT_MODE,y]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:A,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(X,re,F,L,[y,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:A,contains:["self",f]},{begin:e.IDENT_RE+"::",keywords:A},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function I2(e){const n={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},i=L2(e),l=i.keywords;return l.type=[...l.type,...n.type],l.literal=[...l.literal,...n.literal],l.built_in=[...l.built_in,...n.built_in],l._hints=n._hints,i.name="Arduino",i.aliases=["ino"],i.supersetOf="cpp",i}function z2(e){const n=e.regex,i={},l={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[i]}]};Object.assign(i,{className:"variable",variants:[{begin:n.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},l]});const o={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},c=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),u={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},f={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,i,o]};o.contains.push(f);const h={match:/\\"/},p={className:"string",begin:/'/,end:/'/},b={match:/\\'/},y={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,i]},E=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],v=e.SHEBANG({binary:`(${E.join("|")})`,relevance:10}),_={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},N=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],T=["true","false"],S={match:/(\/[a-z._-]+)+/},D=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],M=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],A=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],F=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:N,literal:T,built_in:[...D,...M,"set","shopt",...A,...F]},contains:[v,e.SHEBANG(),_,y,c,u,S,f,h,p,b,i]}}function B2(e){const n=e.regex,i=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),l="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",u="("+l+"|"+n.optional(o)+"[a-zA-Z_]\\w*"+n.optional("<[^<>]+>")+")",f={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},p={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},b={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},y={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(p,{className:"string"}),{className:"string",begin:/<.*?>/},i,e.C_BLOCK_COMMENT_MODE]},E={className:"title",begin:n.optional(o)+e.IDENT_RE,relevance:0},v=n.optional(o)+e.IDENT_RE+"\\s*\\(",T={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},S=[y,f,i,e.C_BLOCK_COMMENT_MODE,b,p],D={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:T,contains:S.concat([{begin:/\(/,end:/\)/,keywords:T,contains:S.concat(["self"]),relevance:0}]),relevance:0},M={begin:"("+u+"[\\*&\\s]+)+"+v,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:T,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:l,keywords:T,relevance:0},{begin:v,returnBegin:!0,contains:[e.inherit(E,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:T,relevance:0,contains:[i,e.C_BLOCK_COMMENT_MODE,p,b,f,{begin:/\(/,end:/\)/,keywords:T,relevance:0,contains:["self",i,e.C_BLOCK_COMMENT_MODE,p,b,f]}]},f,i,e.C_BLOCK_COMMENT_MODE,y]};return{name:"C",aliases:["h"],keywords:T,disableAutodetect:!0,illegal:"</",contains:[].concat(D,M,S,[y,{begin:e.IDENT_RE+"::",keywords:T},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:y,strings:p,keywords:T}}}function U2(e){const n=e.regex,i=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),l="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",u="(?!struct)("+l+"|"+n.optional(o)+"[a-zA-Z_]\\w*"+n.optional("<[^<>]+>")+")",f={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},p={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},b={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},y={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(p,{className:"string"}),{className:"string",begin:/<.*?>/},i,e.C_BLOCK_COMMENT_MODE]},E={className:"title",begin:n.optional(o)+e.IDENT_RE,relevance:0},v=n.optional(o)+e.IDENT_RE+"\\s*\\(",_=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],N=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],T=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],S=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],A={type:N,keyword:_,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:T},F={className:"function.dispatch",relevance:0,keywords:{_hint:S},begin:n.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,n.lookahead(/(<[^<>]+>|)\s*\(/))},L=[F,y,f,i,e.C_BLOCK_COMMENT_MODE,b,p],X={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:A,contains:L.concat([{begin:/\(/,end:/\)/,keywords:A,contains:L.concat(["self"]),relevance:0}]),relevance:0},re={className:"function",begin:"("+u+"[\\*&\\s]+)+"+v,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:A,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:l,keywords:A,relevance:0},{begin:v,returnBegin:!0,contains:[E],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[p,b]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:A,relevance:0,contains:[i,e.C_BLOCK_COMMENT_MODE,p,b,f,{begin:/\(/,end:/\)/,keywords:A,relevance:0,contains:["self",i,e.C_BLOCK_COMMENT_MODE,p,b,f]}]},f,i,e.C_BLOCK_COMMENT_MODE,y]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:A,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(X,re,F,L,[y,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:A,contains:["self",f]},{begin:e.IDENT_RE+"::",keywords:A},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function j2(e){const n=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],i=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],l=["default","false","null","true"],o=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],c=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],u={keyword:o.concat(c),built_in:n,literal:l},f=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),h={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},p={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},b={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},y=e.inherit(b,{illegal:/\n/}),E={className:"subst",begin:/\{/,end:/\}/,keywords:u},v=e.inherit(E,{illegal:/\n/}),_={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,v]},N={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},E]},T=e.inherit(N,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},v]});E.contains=[N,_,b,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,e.C_BLOCK_COMMENT_MODE],v.contains=[T,_,y,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const S={variants:[p,N,_,b,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},D={begin:"<",end:">",contains:[{beginKeywords:"in out"},f]},M=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",A={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:u,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},S,h,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},f,D,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[f,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[f,D,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+M+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:u,contains:[{beginKeywords:i.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,D],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,relevance:0,contains:[S,h,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},A]}}const H2=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),P2=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],F2=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],G2=[...P2,...F2],$2=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),K2=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),q2=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),V2=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function Y2(e){const n=e.regex,i=H2(e),l={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},o="and or not only",c=/@-?\w[\w]*(-\w+)*/,u="[a-zA-Z-][a-zA-Z0-9_-]*",f=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[i.BLOCK_COMMENT,l,i.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+u,relevance:0},i.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+K2.join("|")+")"},{begin:":(:)?("+q2.join("|")+")"}]},i.CSS_VARIABLE,{className:"attribute",begin:"\\b("+V2.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[i.BLOCK_COMMENT,i.HEXCOLOR,i.IMPORTANT,i.CSS_NUMBER_MODE,...f,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...f,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},i.FUNCTION_DISPATCH]},{begin:n.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:c},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:o,attribute:$2.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...f,i.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+G2.join("|")+")\\b"}]}}function X2(e){const n=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:n.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:n.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function Z2(e){const c={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:c,illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"string",variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[e.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:c,illegal:/["']/}]}]}}function Q2(e){const n=e.regex,i=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[e.HASH_COMMENT_MODE,e.QUOTE_STRING_MODE,e.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:n.concat(i,n.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function W2(e){const n=e.regex,i={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},l=e.COMMENT();l.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const o={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},c={className:"literal",begin:/\bon|off|true|false|yes|no\b/},u={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},f={begin:/\[/,end:/\]/,contains:[l,c,o,u,i,"self"],relevance:0},h=/[A-Za-z0-9_-]+/,p=/"(\\"|[^"])*"/,b=/'[^']*'/,y=n.either(h,p,b),E=n.concat(y,"(\\s*\\.\\s*",y,")*",n.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[l,{className:"section",begin:/\[+/,end:/\]+/},{begin:E,className:"attr",starts:{end:/$/,contains:[l,f,c,o,u,i]}}]}}var Za="[0-9](_*[0-9])*",dc=`\\.(${Za})`,fc="[0-9a-fA-F](_*[0-9a-fA-F])*",Iy={className:"number",variants:[{begin:`(\\b(${Za})((${dc})|\\.)?|(${dc}))[eE][+-]?(${Za})[fFdD]?\\b`},{begin:`\\b(${Za})((${dc})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${dc})[fFdD]?\\b`},{begin:`\\b(${Za})[fFdD]\\b`},{begin:`\\b0[xX]((${fc})\\.?|(${fc})?\\.(${fc}))[pP][+-]?(${Za})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${fc})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function qx(e,n,i){return i===-1?"":e.replace(n,l=>qx(e,n,i-1))}function J2(e){const n=e.regex,i="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",l=i+qx("(?:<"+i+"~~~(?:\\s*,\\s*"+i+"~~~)*>)?",/~~~/g,2),h={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},p={className:"meta",begin:"@"+i,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},b={className:"params",begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:h,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,i],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[n.concat(/(?!else)/,i),/\s+/,i,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,i],className:{1:"keyword",3:"title.class"},contains:[b,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+l+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:h,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:[p,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,Iy,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},Iy,p]}}const zy="[A-Za-z$_][0-9A-Za-z$_]*",eA=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],tA=["true","false","null","undefined","NaN","Infinity"],Vx=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Yx=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Xx=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],nA=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],rA=[].concat(Xx,Vx,Yx);function iA(e){const n=e.regex,i=(P,{after:J})=>{const C="</"+P[0].slice(1);return P.input.indexOf(C,J)!==-1},l=zy,o={begin:"<>",end:"</>"},c=/<[A-Za-z0-9\\._:-]+\s*\/>/,u={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(P,J)=>{const C=P[0].length+P.index,R=P.input[C];if(R==="<"||R===","){J.ignoreMatch();return}R===">"&&(i(P,{after:C})||J.ignoreMatch());let q;const w=P.input.substring(C);if(q=w.match(/^\s*=/)){J.ignoreMatch();return}if((q=w.match(/^\s+extends\s+/))&&q.index===0){J.ignoreMatch();return}}},f={$pattern:zy,keyword:eA,literal:tA,built_in:rA,"variable.language":nA},h="[0-9](_?[0-9])*",p=`\\.(${h})`,b="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",y={className:"number",variants:[{begin:`(\\b(${b})((${p})|\\.)?|(${p}))[eE][+-]?(${h})\\b`},{begin:`\\b(${b})\\b((${p})\\b|\\.)?|(${p})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},E={className:"subst",begin:"\\$\\{",end:"\\}",keywords:f,contains:[]},v={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,E],subLanguage:"xml"}},_={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,E],subLanguage:"css"}},N={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,E],subLanguage:"graphql"}},T={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,E]},D={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:l+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},M=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,v,_,N,T,{match:/\$\d+/},y];E.contains=M.concat({begin:/\{/,end:/\}/,keywords:f,contains:["self"].concat(M)});const A=[].concat(D,E.contains),F=A.concat([{begin:/(\s*)\(/,end:/\)/,keywords:f,contains:["self"].concat(A)}]),L={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:F},X={variants:[{match:[/class/,/\s+/,l,/\s+/,/extends/,/\s+/,n.concat(l,"(",n.concat(/\./,l),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,l],scope:{1:"keyword",3:"title.class"}}]},re={relevance:0,match:n.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Vx,...Yx]}},oe={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},B={variants:[{match:[/function/,/\s+/,l,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[L],illegal:/%/},Q={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function ee(P){return n.concat("(?!",P.join("|"),")")}const me={match:n.concat(/\b/,ee([...Xx,"super","import"].map(P=>`${P}\\s*\\(`)),l,n.lookahead(/\s*\(/)),className:"title.function",relevance:0},se={begin:n.concat(/\./,n.lookahead(n.concat(l,/(?![0-9A-Za-z$_(])/))),end:l,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},$={match:[/get|set/,/\s+/,l,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},L]},j="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",O={match:[/const|var|let/,/\s+/,l,/\s*/,/=\s*/,/(async\s*)?/,n.lookahead(j)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[L]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:f,exports:{PARAMS_CONTAINS:F,CLASS_REFERENCE:re},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),oe,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,v,_,N,T,D,{match:/\$\d+/},y,re,{scope:"attr",match:l+n.lookahead(":"),relevance:0},O,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[D,e.REGEXP_MODE,{className:"function",begin:j,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:F}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:o.begin,end:o.end},{match:c},{begin:u.begin,"on:begin":u.isTrulyOpeningTag,end:u.end}],subLanguage:"xml",contains:[{begin:u.begin,end:u.end,skip:!0,contains:["self"]}]}]},B,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[L,e.inherit(e.TITLE_MODE,{begin:l,className:"title.function"})]},{match:/\.\.\./,relevance:0},se,{match:"\\$"+l,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[L]},me,Q,X,$,{match:/\$[(.]/}]}}function aA(e){const n={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},i={match:/[{}[\],:]/,className:"punctuation",relevance:0},l=["true","false","null"],o={scope:"literal",beginKeywords:l.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:l},contains:[n,i,e.QUOTE_STRING_MODE,o,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var Qa="[0-9](_*[0-9])*",hc=`\\.(${Qa})`,pc="[0-9a-fA-F](_*[0-9a-fA-F])*",lA={className:"number",variants:[{begin:`(\\b(${Qa})((${hc})|\\.)?|(${hc}))[eE][+-]?(${Qa})[fFdD]?\\b`},{begin:`\\b(${Qa})((${hc})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${hc})[fFdD]?\\b`},{begin:`\\b(${Qa})[fFdD]\\b`},{begin:`\\b0[xX]((${pc})\\.?|(${pc})?\\.(${pc}))[pP][+-]?(${Qa})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${pc})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function sA(e){const n={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},i={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},l={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},o={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},c={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},u={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[c,o]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,c,o]}]};o.contains.push(u);const f={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},h={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(u,{className:"string"}),"self"]}]},p=lA,b=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),y={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},E=y;return E.variants[1].contains=[y],y.variants[1].contains=[E],{name:"Kotlin",aliases:["kt","kts"],keywords:n,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,b,i,l,f,h,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:n,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:n,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[y,e.C_LINE_COMMENT_MODE,b],relevance:0},e.C_LINE_COMMENT_MODE,b,f,h,u,e.C_NUMBER_MODE]},b]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},f,h]},u,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
80
+ `},p]}}const oA=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),cA=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],uA=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],dA=[...cA,...uA],fA=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),Zx=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),Qx=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),hA=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),pA=Zx.concat(Qx).sort().reverse();function mA(e){const n=oA(e),i=pA,l="and or not only",o="[\\w-]+",c="("+o+"|@\\{"+o+"\\})",u=[],f=[],h=function(M){return{className:"string",begin:"~?"+M+".*?"+M}},p=function(M,A,F){return{className:M,begin:A,relevance:F}},b={$pattern:/[a-z-]+/,keyword:l,attribute:fA.join(" ")},y={begin:"\\(",end:"\\)",contains:f,keywords:b,relevance:0};f.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,h("'"),h('"'),n.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},n.HEXCOLOR,y,p("variable","@@?"+o,10),p("variable","@\\{"+o+"\\}"),p("built_in","~?`[^`]*?`"),{className:"attribute",begin:o+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},n.IMPORTANT,{beginKeywords:"and not"},n.FUNCTION_DISPATCH);const E=f.concat({begin:/\{/,end:/\}/,contains:u}),v={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(f)},_={begin:c+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+hA.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:f}}]},N={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:b,returnEnd:!0,contains:f,relevance:0}},T={className:"variable",variants:[{begin:"@"+o+"\\s*:",relevance:15},{begin:"@"+o}],starts:{end:"[;}]",returnEnd:!0,contains:E}},S={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:c,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,v,p("keyword","all\\b"),p("variable","@\\{"+o+"\\}"),{begin:"\\b("+dA.join("|")+")\\b",className:"selector-tag"},n.CSS_NUMBER_MODE,p("selector-tag",c,0),p("selector-id","#"+c),p("selector-class","\\."+c,0),p("selector-tag","&",0),n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+Zx.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+Qx.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:E},{begin:"!important"},n.FUNCTION_DISPATCH]},D={begin:o+`:(:)?(${i.join("|")})`,returnBegin:!0,contains:[S]};return u.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,N,T,D,_,S,v,n.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:u}}function gA(e){const n="\\[=*\\[",i="\\]=*\\]",l={begin:n,end:i,contains:["self"]},o=[e.COMMENT("--(?!"+n+")","$"),e.COMMENT("--"+n,i,{contains:[l],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:o.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:o}].concat(o)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:n,end:i,contains:[l],relevance:5}])}}function bA(e){const n={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},i={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n]},l={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[n,i]},o={begin:"^"+e.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},c={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},u={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[n]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[e.HASH_COMMENT_MODE,n,i,l,o,c,u]}}function yA(e){const n=e.regex,i={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},l={begin:"^[-\\*]{3,}",end:"$"},o={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},c={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},u={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},f=/[A-Za-z][A-Za-z0-9+.-]*/,h={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:n.concat(/\[.+?\]\(/,f,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},p={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},b={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},y=e.inherit(p,{contains:[]}),E=e.inherit(b,{contains:[]});p.contains.push(E),b.contains.push(y);let v=[i,h];return[p,b,y,E].forEach(S=>{S.contains=S.contains.concat(v)}),v=v.concat(p,b),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:v},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:v}]}]},i,c,p,b,{className:"quote",begin:"^>\\s+",contains:v,end:"$"},o,l,h,u,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function vA(e){const n={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},i=/[a-zA-Z@][a-zA-Z0-9_]*/,f={"variable.language":["this","super"],$pattern:i,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},h={$pattern:i,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:f,illegal:"</",contains:[n,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.C_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+h.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:h,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function xA(e){const n=e.regex,i=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],l=/[dualxmsipngr]{0,12}/,o={$pattern:/[\w.]+/,keyword:i.join(" ")},c={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:o},u={begin:/->\{/,end:/\}/},f={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},h={scope:"variable",variants:[{begin:/\$\d/},{begin:n.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[f]},p={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},b=[e.BACKSLASH_ESCAPE,c,h],y=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],E=(N,T,S="\\1")=>{const D=S==="\\1"?S:n.concat(S,T);return n.concat(n.concat("(?:",N,")"),T,/(?:\\.|[^\\\/])*?/,D,/(?:\\.|[^\\\/])*?/,S,l)},v=(N,T,S)=>n.concat(n.concat("(?:",N,")"),T,/(?:\\.|[^\\\/])*?/,S,l),_=[h,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),u,{className:"string",contains:b,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},p,{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:E("s|tr|y",n.either(...y,{capture:!0}))},{begin:E("s|tr|y","\\(","\\)")},{begin:E("s|tr|y","\\[","\\]")},{begin:E("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:v("(?:m|qr)?",/\//,/\//)},{begin:v("m|qr",n.either(...y,{capture:!0}),/\1/)},{begin:v("m|qr",/\(/,/\)/)},{begin:v("m|qr",/\[/,/\]/)},{begin:v("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,f]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,f,p]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return c.contains=_,u.contains=_,{name:"Perl",aliases:["pl","pm"],keywords:o,contains:_}}function EA(e){const n=e.regex,i=/(?![A-Za-z0-9])(?![$])/,l=n.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,i),o=n.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,i),c=n.concat(/[A-Z]+/,i),u={scope:"variable",match:"\\$+"+l},f={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},h={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},p=e.inherit(e.APOS_STRING_MODE,{illegal:null}),b=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(h)}),y={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(h),"on:begin":(se,$)=>{$.data._beginMatch=se[1]||se[2]},"on:end":(se,$)=>{$.data._beginMatch!==se[1]&&$.ignoreMatch()}},E=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),v=`[
81
+ ]`,_={scope:"string",variants:[b,p,y,E]},N={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},T=["false","null","true"],S=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],D=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],A={keyword:S,literal:(se=>{const $=[];return se.forEach(j=>{$.push(j),j.toLowerCase()===j?$.push(j.toUpperCase()):$.push(j.toLowerCase())}),$})(T),built_in:D},F=se=>se.map($=>$.replace(/\|\d+$/,"")),L={variants:[{match:[/new/,n.concat(v,"+"),n.concat("(?!",F(D).join("\\b|"),"\\b)"),o],scope:{1:"keyword",4:"title.class"}}]},X=n.concat(l,"\\b(?!\\()"),re={variants:[{match:[n.concat(/::/,n.lookahead(/(?!class\b)/)),X],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[o,n.concat(/::/,n.lookahead(/(?!class\b)/)),X],scope:{1:"title.class",3:"variable.constant"}},{match:[o,n.concat("::",n.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[o,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},oe={scope:"attr",match:n.concat(l,n.lookahead(":"),n.lookahead(/(?!::)/))},B={relevance:0,begin:/\(/,end:/\)/,keywords:A,contains:[oe,u,re,e.C_BLOCK_COMMENT_MODE,_,N,L]},Q={relevance:0,match:[/\b/,n.concat("(?!fn\\b|function\\b|",F(S).join("\\b|"),"|",F(D).join("\\b|"),"\\b)"),l,n.concat(v,"*"),n.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[B]};B.contains.push(Q);const ee=[oe,re,e.C_BLOCK_COMMENT_MODE,_,N,L],me={begin:n.concat(/#\[\s*\\?/,n.either(o,c)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:T,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:T,keyword:["new","array"]},contains:["self",...ee]},...ee,{scope:"meta",variants:[{match:o},{match:c}]}]};return{case_insensitive:!1,keywords:A,contains:[me,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},f,{scope:"variable.language",match:/\$this\b/},u,Q,re,{match:[/const/,/\s/,l],scope:{1:"keyword",3:"variable.constant"}},L,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:A,contains:["self",me,u,re,e.C_BLOCK_COMMENT_MODE,_,N]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},_,N]}}function SA(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function _A(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function kA(e){const n=e.regex,i=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),l=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],f={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:l,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},h={className:"meta",begin:/^(>>>|\.\.\.) /},p={className:"subst",begin:/\{/,end:/\}/,keywords:f,illegal:/#/},b={begin:/\{\{/,relevance:0},y={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,h],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,h],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,h,b,p]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,h,b,p]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,b,p]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,b,p]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},E="[0-9](_?[0-9])*",v=`(\\b(${E}))?\\.(${E})|\\b(${E})\\.`,_=`\\b|${l.join("|")}`,N={className:"number",relevance:0,variants:[{begin:`(\\b(${E})|(${v}))[eE][+-]?(${E})[jJ]?(?=${_})`},{begin:`(${v})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${_})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${_})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${_})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${_})`},{begin:`\\b(${E})[jJ](?=${_})`}]},T={className:"comment",begin:n.lookahead(/# type:/),end:/$/,keywords:f,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},S={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:["self",h,N,y,e.HASH_COMMENT_MODE]}]};return p.contains=[y,N,h],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:f,illegal:/(<\/|\?)|=>/,contains:[h,N,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},y,T,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,i],scope:{1:"keyword",3:"title.function"},contains:[S]},{variants:[{match:[/\bclass/,/\s+/,i,/\s*/,/\(\s*/,i,/\s*\)/]},{match:[/\bclass/,/\s+/,i]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[N,S,y]}]}}function wA(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function NA(e){const n=e.regex,i=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,l=n.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),o=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,c=n.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:i,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:n.lookahead(n.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:i},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[o,l]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,l]},{scope:{1:"punctuation",2:"number"},match:[c,l]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,l]}]},{scope:{3:"operator"},match:[i,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:o},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:c},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function TA(e){const n=e.regex,i="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",l=n.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),o=n.concat(l,/(::\w+)*/),u={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},f={className:"doctag",begin:"@[A-Za-z]+"},h={begin:"#<",end:">"},p=[e.COMMENT("#","$",{contains:[f]}),e.COMMENT("^=begin","^=end",{contains:[f],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],b={className:"subst",begin:/#\{/,end:/\}/,keywords:u},y={className:"string",contains:[e.BACKSLASH_ESCAPE,b],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:n.concat(/<<[-~]?'?/,n.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,b]})]}]},E="[1-9](_?[0-9])*|0",v="[0-9](_?[0-9])*",_={className:"number",relevance:0,variants:[{begin:`\\b(${E})(\\.(${v}))?([eE][+-]?(${v})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},N={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:u}]},L=[y,{variants:[{match:[/class\s+/,o,/\s+<\s+/,o]},{match:[/\b(class|module)\s+/,o]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:u},{match:[/(include|extend)\s+/,o],scope:{2:"title.class"},keywords:u},{relevance:0,match:[o,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:l,scope:"title.class"},{match:[/def/,/\s+/,i],scope:{1:"keyword",3:"title.function"},contains:[N]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[y,{begin:i}],relevance:0},_,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:u},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,b],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(h,p),relevance:0}].concat(h,p);b.contains=L,N.contains=L;const B=[{begin:/^\s*=>/,starts:{end:"$",contains:L}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:u,contains:L}}];return p.unshift(h),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:u,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(B).concat(p).concat(L)}}function CA(e){const n=e.regex,i=/(r#)?/,l=n.concat(i,e.UNDERSCORE_IDENT_RE),o=n.concat(i,e.IDENT_RE),c={className:"title.function.invoke",relevance:0,begin:n.concat(/\b/,/(?!let|for|while|if|else|match\b)/,o,n.lookahead(/\s*\(/))},u="([ui](8|16|32|64|128|size)|f(32|64))?",f=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],h=["true","false","Some","None","Ok","Err"],p=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],b=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:b,keyword:f,literal:h,built_in:p},illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{contains:["self"]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+u},{begin:"\\b0o([0-7_]+)"+u},{begin:"\\b0x([A-Fa-f0-9_]+)"+u},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+u}],relevance:0},{begin:[/fn/,/\s+/,l],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,l],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,l,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,l],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,l],className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:p,type:b}},{className:"punctuation",begin:"->"},c]}}const AA=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),OA=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],MA=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],RA=[...OA,...MA],DA=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),LA=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),IA=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),zA=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function BA(e){const n=AA(e),i=IA,l=LA,o="@[a-z-]+",c="and or not only",f={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,n.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+RA.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+l.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+i.join("|")+")"},f,{begin:/\(/,end:/\)/,contains:[n.CSS_NUMBER_MODE]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+zA.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[n.BLOCK_COMMENT,f,n.HEXCOLOR,n.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,n.IMPORTANT,n.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:o,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:c,attribute:DA.join(" ")},contains:[{begin:o,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},f,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,n.HEXCOLOR,n.CSS_NUMBER_MODE]},n.FUNCTION_DISPATCH]}}function UA(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function jA(e){const n=e.regex,i=e.COMMENT("--","$"),l={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},o={begin:/"/,end:/"/,contains:[{match:/""/}]},c=["true","false","unknown"],u=["double precision","large object","with timezone","without timezone"],f=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],h=["add","asc","collation","desc","final","first","last","view"],p=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],b=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],y=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],E=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],v=b,_=[...p,...h].filter(F=>!b.includes(F)),N={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},T={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},S={match:n.concat(/\b/,n.either(...v),/\s*\(/),relevance:0,keywords:{built_in:v}};function D(F){return n.concat(/\b/,n.either(...F.map(L=>L.replace(/\s+/,"\\s+"))),/\b/)}const M={scope:"keyword",match:D(E),relevance:0};function A(F,{exceptions:L,when:X}={}){const re=X;return L=L||[],F.map(oe=>oe.match(/\|\d+$/)||L.includes(oe)?oe:re(oe)?`${oe}|0`:oe)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:A(_,{when:F=>F.length<3}),literal:c,type:f,built_in:y},contains:[{scope:"type",match:D(u)},M,S,N,l,o,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,i,T]}}function Wx(e){return e?typeof e=="string"?e:e.source:null}function hs(e){return ft("(?=",e,")")}function ft(...e){return e.map(i=>Wx(i)).join("")}function HA(e){const n=e[e.length-1];return typeof n=="object"&&n.constructor===Object?(e.splice(e.length-1,1),n):{}}function on(...e){return"("+(HA(e).capture?"":"?:")+e.map(l=>Wx(l)).join("|")+")"}const Ch=e=>ft(/\b/,e,/\w$/.test(e)?/\b/:/\B/),PA=["Protocol","Type"].map(Ch),By=["init","self"].map(Ch),FA=["Any","Self"],vf=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],Uy=["false","nil","true"],GA=["assignment","associativity","higherThan","left","lowerThan","none","right"],$A=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],jy=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],Jx=on(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),e0=on(Jx,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),xf=ft(Jx,e0,"*"),t0=on(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),Mc=on(t0,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),dr=ft(t0,Mc,"*"),mc=ft(/[A-Z]/,Mc,"*"),KA=["attached","autoclosure",ft(/convention\(/,on("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",ft(/objc\(/,dr,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],qA=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function VA(e){const n={match:/\s+/,relevance:0},i=e.COMMENT("/\\*","\\*/",{contains:["self"]}),l=[e.C_LINE_COMMENT_MODE,i],o={match:[/\./,on(...PA,...By)],className:{2:"keyword"}},c={match:ft(/\./,on(...vf)),relevance:0},u=vf.filter(Ye=>typeof Ye=="string").concat(["_|0"]),f=vf.filter(Ye=>typeof Ye!="string").concat(FA).map(Ch),h={variants:[{className:"keyword",match:on(...f,...By)}]},p={$pattern:on(/\b\w+/,/#\w+/),keyword:u.concat($A),literal:Uy},b=[o,c,h],y={match:ft(/\./,on(...jy)),relevance:0},E={className:"built_in",match:ft(/\b/,on(...jy),/(?=\()/)},v=[y,E],_={match:/->/,relevance:0},N={className:"operator",relevance:0,variants:[{match:xf},{match:`\\.(\\.|${e0})+`}]},T=[_,N],S="([0-9]_*)+",D="([0-9a-fA-F]_*)+",M={className:"number",relevance:0,variants:[{match:`\\b(${S})(\\.(${S}))?([eE][+-]?(${S}))?\\b`},{match:`\\b0x(${D})(\\.(${D}))?([pP][+-]?(${S}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},A=(Ye="")=>({className:"subst",variants:[{match:ft(/\\/,Ye,/[0\\tnr"']/)},{match:ft(/\\/,Ye,/u\{[0-9a-fA-F]{1,8}\}/)}]}),F=(Ye="")=>({className:"subst",match:ft(/\\/,Ye,/[\t ]*(?:[\r\n]|\r\n)/)}),L=(Ye="")=>({className:"subst",label:"interpol",begin:ft(/\\/,Ye,/\(/),end:/\)/}),X=(Ye="")=>({begin:ft(Ye,/"""/),end:ft(/"""/,Ye),contains:[A(Ye),F(Ye),L(Ye)]}),re=(Ye="")=>({begin:ft(Ye,/"/),end:ft(/"/,Ye),contains:[A(Ye),L(Ye)]}),oe={className:"string",variants:[X(),X("#"),X("##"),X("###"),re(),re("#"),re("##"),re("###")]},B=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],Q={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:B},ee=Ye=>{const Xn=ft(Ye,/\//),zn=ft(/\//,Ye);return{begin:Xn,end:zn,contains:[...B,{scope:"comment",begin:`#(?!.*${zn})`,end:/$/}]}},me={scope:"regexp",variants:[ee("###"),ee("##"),ee("#"),Q]},se={match:ft(/`/,dr,/`/)},$={className:"variable",match:/\$\d+/},j={className:"variable",match:`\\$${Mc}+`},O=[se,$,j],P={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:qA,contains:[...T,M,oe]}]}},J={scope:"keyword",match:ft(/@/,on(...KA),hs(on(/\(/,/\s+/)))},C={scope:"meta",match:ft(/@/,dr)},R=[P,J,C],q={match:hs(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:ft(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,Mc,"+")},{className:"type",match:mc,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:ft(/\s+&\s+/,hs(mc)),relevance:0}]},w={begin:/</,end:/>/,keywords:p,contains:[...l,...b,...R,_,q]};q.contains.push(w);const ue={match:ft(dr,/\s*:/),keywords:"_|0",relevance:0},ye={begin:/\(/,end:/\)/,relevance:0,keywords:p,contains:["self",ue,...l,me,...b,...v,...T,M,oe,...O,...R,q]},K={begin:/</,end:/>/,keywords:"repeat each",contains:[...l,q]},de={begin:on(hs(ft(dr,/\s*:/)),hs(ft(dr,/\s+/,dr,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:dr}]},xe={begin:/\(/,end:/\)/,keywords:p,contains:[de,...l,...b,...T,M,oe,...R,q,ye],endsParent:!0,illegal:/["']/},ve={match:[/(func|macro)/,/\s+/,on(se.match,dr,xf)],className:{1:"keyword",3:"title.function"},contains:[K,xe,n],illegal:[/\[/,/%/]},De={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[K,xe,n],illegal:/\[|%/},St={match:[/operator/,/\s+/,xf],className:{1:"keyword",3:"title"}},Tt={begin:[/precedencegroup/,/\s+/,mc],className:{1:"keyword",3:"title"},contains:[q],keywords:[...GA,...Uy],end:/}/},$r={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},kn={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},rr={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,dr,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:p,contains:[K,...b,{begin:/:/,end:/\{/,keywords:p,contains:[{scope:"title.class.inherited",match:mc},...b],relevance:0}]};for(const Ye of oe.variants){const Xn=Ye.contains.find(ir=>ir.label==="interpol");Xn.keywords=p;const zn=[...b,...v,...T,M,oe,...O];Xn.contains=[...zn,{begin:/\(/,end:/\)/,contains:["self",...zn]}]}return{name:"Swift",keywords:p,contains:[...l,ve,De,$r,kn,rr,St,Tt,{beginKeywords:"import",end:/$/,contains:[...l],relevance:0},me,...b,...v,...T,M,oe,...O,...R,q,ye]}}const Rc="[A-Za-z$_][0-9A-Za-z$_]*",n0=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],r0=["true","false","null","undefined","NaN","Infinity"],i0=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],a0=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],l0=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],s0=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],o0=[].concat(l0,i0,a0);function YA(e){const n=e.regex,i=(P,{after:J})=>{const C="</"+P[0].slice(1);return P.input.indexOf(C,J)!==-1},l=Rc,o={begin:"<>",end:"</>"},c=/<[A-Za-z0-9\\._:-]+\s*\/>/,u={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(P,J)=>{const C=P[0].length+P.index,R=P.input[C];if(R==="<"||R===","){J.ignoreMatch();return}R===">"&&(i(P,{after:C})||J.ignoreMatch());let q;const w=P.input.substring(C);if(q=w.match(/^\s*=/)){J.ignoreMatch();return}if((q=w.match(/^\s+extends\s+/))&&q.index===0){J.ignoreMatch();return}}},f={$pattern:Rc,keyword:n0,literal:r0,built_in:o0,"variable.language":s0},h="[0-9](_?[0-9])*",p=`\\.(${h})`,b="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",y={className:"number",variants:[{begin:`(\\b(${b})((${p})|\\.)?|(${p}))[eE][+-]?(${h})\\b`},{begin:`\\b(${b})\\b((${p})\\b|\\.)?|(${p})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},E={className:"subst",begin:"\\$\\{",end:"\\}",keywords:f,contains:[]},v={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,E],subLanguage:"xml"}},_={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,E],subLanguage:"css"}},N={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,E],subLanguage:"graphql"}},T={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,E]},D={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:l+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},M=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,v,_,N,T,{match:/\$\d+/},y];E.contains=M.concat({begin:/\{/,end:/\}/,keywords:f,contains:["self"].concat(M)});const A=[].concat(D,E.contains),F=A.concat([{begin:/(\s*)\(/,end:/\)/,keywords:f,contains:["self"].concat(A)}]),L={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:F},X={variants:[{match:[/class/,/\s+/,l,/\s+/,/extends/,/\s+/,n.concat(l,"(",n.concat(/\./,l),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,l],scope:{1:"keyword",3:"title.class"}}]},re={relevance:0,match:n.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...i0,...a0]}},oe={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},B={variants:[{match:[/function/,/\s+/,l,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[L],illegal:/%/},Q={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function ee(P){return n.concat("(?!",P.join("|"),")")}const me={match:n.concat(/\b/,ee([...l0,"super","import"].map(P=>`${P}\\s*\\(`)),l,n.lookahead(/\s*\(/)),className:"title.function",relevance:0},se={begin:n.concat(/\./,n.lookahead(n.concat(l,/(?![0-9A-Za-z$_(])/))),end:l,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},$={match:[/get|set/,/\s+/,l,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},L]},j="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",O={match:[/const|var|let/,/\s+/,l,/\s*/,/=\s*/,/(async\s*)?/,n.lookahead(j)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[L]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:f,exports:{PARAMS_CONTAINS:F,CLASS_REFERENCE:re},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),oe,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,v,_,N,T,D,{match:/\$\d+/},y,re,{scope:"attr",match:l+n.lookahead(":"),relevance:0},O,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[D,e.REGEXP_MODE,{className:"function",begin:j,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:F}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:o.begin,end:o.end},{match:c},{begin:u.begin,"on:begin":u.isTrulyOpeningTag,end:u.end}],subLanguage:"xml",contains:[{begin:u.begin,end:u.end,skip:!0,contains:["self"]}]}]},B,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[L,e.inherit(e.TITLE_MODE,{begin:l,className:"title.function"})]},{match:/\.\.\./,relevance:0},se,{match:"\\$"+l,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[L]},me,Q,X,$,{match:/\$[(.]/}]}}function XA(e){const n=e.regex,i=YA(e),l=Rc,o=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],c={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},u={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:o},contains:[i.exports.CLASS_REFERENCE]},f={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},h=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],p={$pattern:Rc,keyword:n0.concat(h),literal:r0,built_in:o0.concat(o),"variable.language":s0},b={className:"meta",begin:"@"+l},y=(N,T,S)=>{const D=N.contains.findIndex(M=>M.label===T);if(D===-1)throw new Error("can not find mode to replace");N.contains.splice(D,1,S)};Object.assign(i.keywords,p),i.exports.PARAMS_CONTAINS.push(b);const E=i.contains.find(N=>N.scope==="attr"),v=Object.assign({},E,{match:n.concat(l,n.lookahead(/\s*\?:/))});i.exports.PARAMS_CONTAINS.push([i.exports.CLASS_REFERENCE,E,v]),i.contains=i.contains.concat([b,c,u,v]),y(i,"shebang",e.SHEBANG()),y(i,"use_strict",f);const _=i.contains.find(N=>N.label==="func.def");return _.relevance=0,Object.assign(i,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),i}function ZA(e){const n=e.regex,i={className:"string",begin:/"(""|[^/n])"C\b/},l={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},o=/\d{1,2}\/\d{1,2}\/\d{4}/,c=/\d{4}-\d{1,2}-\d{1,2}/,u=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,f=/\d{1,2}(:\d{1,2}){1,2}/,h={className:"literal",variants:[{begin:n.concat(/# */,n.either(c,o),/ *#/)},{begin:n.concat(/# */,f,/ *#/)},{begin:n.concat(/# */,u,/ *#/)},{begin:n.concat(/# */,n.either(c,o),/ +/,n.either(u,f),/ *#/)}]},p={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},b={className:"label",begin:/^\w+:/},y=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),E=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[i,l,h,p,b,y,E,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[E]}]}}function QA(e){e.regex;const n=e.COMMENT(/\(;/,/;\)/);n.contains.push("self");const i=e.COMMENT(/;;/,/$/),l=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],o={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},c={className:"variable",begin:/\$[\w_]+/},u={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},f={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},h={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},p={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:l},contains:[i,n,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},c,u,o,e.QUOTE_STRING_MODE,h,p,f]}}function WA(e){const n=e.regex,i=n.concat(/[\p{L}_]/u,n.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),l=/[\p{L}0-9._:-]+/u,o={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},c={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},u=e.inherit(c,{begin:/\(/,end:/\)/}),f=e.inherit(e.APOS_STRING_MODE,{className:"string"}),h=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),p={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:l,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[o]},{begin:/'/,end:/'/,contains:[o]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[c,h,f,u,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[c,u,h,f]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},o,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[h]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[p],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[p],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:n.concat(/</,n.lookahead(n.concat(i,n.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:i,relevance:0,starts:p}]},{className:"tag",begin:n.concat(/<\//,n.lookahead(n.concat(i,/>/))),contains:[{className:"name",begin:i,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function JA(e){const n="true false yes no null",i="[\\w#;/?:@&=+$,.~*'()[\\]]+",l={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},o={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},c={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},u={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,o]},f=e.inherit(u,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),E={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},v={end:",",endsWithParent:!0,excludeEnd:!0,keywords:n,relevance:0},_={begin:/\{/,end:/\}/,contains:[v],illegal:"\\n",relevance:0},N={begin:"\\[",end:"\\]",contains:[v],illegal:"\\n",relevance:0},T=[l,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+i},{className:"type",begin:"!<"+i+">"},{className:"type",begin:"!"+i},{className:"type",begin:"!!"+i},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:n,keywords:{literal:n}},E,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},_,N,c,u],S=[...T];return S.pop(),S.push(f),v.contains=S,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:T}}const eO={arduino:I2,bash:z2,c:B2,cpp:U2,csharp:j2,css:Y2,diff:X2,go:Z2,graphql:Q2,ini:W2,java:J2,javascript:iA,json:aA,kotlin:sA,less:mA,lua:gA,makefile:bA,markdown:yA,objectivec:vA,perl:xA,php:EA,"php-template":SA,plaintext:_A,python:kA,"python-repl":wA,r:NA,ruby:TA,rust:CA,scss:BA,shell:UA,sql:jA,swift:VA,typescript:XA,vbnet:ZA,wasm:QA,xml:WA,yaml:JA};var Ef,Hy;function tO(){if(Hy)return Ef;Hy=1;function e(z){return z instanceof Map?z.clear=z.delete=z.set=function(){throw new Error("map is read-only")}:z instanceof Set&&(z.add=z.clear=z.delete=function(){throw new Error("set is read-only")}),Object.freeze(z),Object.getOwnPropertyNames(z).forEach(ie=>{const be=z[ie],Le=typeof be;(Le==="object"||Le==="function")&&!Object.isFrozen(be)&&e(be)}),z}class n{constructor(ie){ie.data===void 0&&(ie.data={}),this.data=ie.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function i(z){return z.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function l(z,...ie){const be=Object.create(null);for(const Le in z)be[Le]=z[Le];return ie.forEach(function(Le){for(const vt in Le)be[vt]=Le[vt]}),be}const o="</span>",c=z=>!!z.scope,u=(z,{prefix:ie})=>{if(z.startsWith("language:"))return z.replace("language:","language-");if(z.includes(".")){const be=z.split(".");return[`${ie}${be.shift()}`,...be.map((Le,vt)=>`${Le}${"_".repeat(vt+1)}`)].join(" ")}return`${ie}${z}`};class f{constructor(ie,be){this.buffer="",this.classPrefix=be.classPrefix,ie.walk(this)}addText(ie){this.buffer+=i(ie)}openNode(ie){if(!c(ie))return;const be=u(ie.scope,{prefix:this.classPrefix});this.span(be)}closeNode(ie){c(ie)&&(this.buffer+=o)}value(){return this.buffer}span(ie){this.buffer+=`<span class="${ie}">`}}const h=(z={})=>{const ie={children:[]};return Object.assign(ie,z),ie};class p{constructor(){this.rootNode=h(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(ie){this.top.children.push(ie)}openNode(ie){const be=h({scope:ie});this.add(be),this.stack.push(be)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(ie){return this.constructor._walk(ie,this.rootNode)}static _walk(ie,be){return typeof be=="string"?ie.addText(be):be.children&&(ie.openNode(be),be.children.forEach(Le=>this._walk(ie,Le)),ie.closeNode(be)),ie}static _collapse(ie){typeof ie!="string"&&ie.children&&(ie.children.every(be=>typeof be=="string")?ie.children=[ie.children.join("")]:ie.children.forEach(be=>{p._collapse(be)}))}}class b extends p{constructor(ie){super(),this.options=ie}addText(ie){ie!==""&&this.add(ie)}startScope(ie){this.openNode(ie)}endScope(){this.closeNode()}__addSublanguage(ie,be){const Le=ie.root;be&&(Le.scope=`language:${be}`),this.add(Le)}toHTML(){return new f(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function y(z){return z?typeof z=="string"?z:z.source:null}function E(z){return N("(?=",z,")")}function v(z){return N("(?:",z,")*")}function _(z){return N("(?:",z,")?")}function N(...z){return z.map(be=>y(be)).join("")}function T(z){const ie=z[z.length-1];return typeof ie=="object"&&ie.constructor===Object?(z.splice(z.length-1,1),ie):{}}function S(...z){return"("+(T(z).capture?"":"?:")+z.map(Le=>y(Le)).join("|")+")"}function D(z){return new RegExp(z.toString()+"|").exec("").length-1}function M(z,ie){const be=z&&z.exec(ie);return be&&be.index===0}const A=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function F(z,{joinWith:ie}){let be=0;return z.map(Le=>{be+=1;const vt=be;let ht=y(Le),_e="";for(;ht.length>0;){const Ee=A.exec(ht);if(!Ee){_e+=ht;break}_e+=ht.substring(0,Ee.index),ht=ht.substring(Ee.index+Ee[0].length),Ee[0][0]==="\\"&&Ee[1]?_e+="\\"+String(Number(Ee[1])+vt):(_e+=Ee[0],Ee[0]==="("&&be++)}return _e}).map(Le=>`(${Le})`).join(ie)}const L=/\b\B/,X="[a-zA-Z]\\w*",re="[a-zA-Z_]\\w*",oe="\\b\\d+(\\.\\d+)?",B="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Q="\\b(0b[01]+)",ee="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",me=(z={})=>{const ie=/^#![ ]*\//;return z.binary&&(z.begin=N(ie,/.*\b/,z.binary,/\b.*/)),l({scope:"meta",begin:ie,end:/$/,relevance:0,"on:begin":(be,Le)=>{be.index!==0&&Le.ignoreMatch()}},z)},se={begin:"\\\\[\\s\\S]",relevance:0},$={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[se]},j={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[se]},O={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},P=function(z,ie,be={}){const Le=l({scope:"comment",begin:z,end:ie,contains:[]},be);Le.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const vt=S("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return Le.contains.push({begin:N(/[ ]+/,"(",vt,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),Le},J=P("//","$"),C=P("/\\*","\\*/"),R=P("#","$"),q={scope:"number",begin:oe,relevance:0},w={scope:"number",begin:B,relevance:0},ue={scope:"number",begin:Q,relevance:0},ye={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[se,{begin:/\[/,end:/\]/,relevance:0,contains:[se]}]},K={scope:"title",begin:X,relevance:0},de={scope:"title",begin:re,relevance:0},xe={begin:"\\.\\s*"+re,relevance:0};var De=Object.freeze({__proto__:null,APOS_STRING_MODE:$,BACKSLASH_ESCAPE:se,BINARY_NUMBER_MODE:ue,BINARY_NUMBER_RE:Q,COMMENT:P,C_BLOCK_COMMENT_MODE:C,C_LINE_COMMENT_MODE:J,C_NUMBER_MODE:w,C_NUMBER_RE:B,END_SAME_AS_BEGIN:function(z){return Object.assign(z,{"on:begin":(ie,be)=>{be.data._beginMatch=ie[1]},"on:end":(ie,be)=>{be.data._beginMatch!==ie[1]&&be.ignoreMatch()}})},HASH_COMMENT_MODE:R,IDENT_RE:X,MATCH_NOTHING_RE:L,METHOD_GUARD:xe,NUMBER_MODE:q,NUMBER_RE:oe,PHRASAL_WORDS_MODE:O,QUOTE_STRING_MODE:j,REGEXP_MODE:ye,RE_STARTERS_RE:ee,SHEBANG:me,TITLE_MODE:K,UNDERSCORE_IDENT_RE:re,UNDERSCORE_TITLE_MODE:de});function St(z,ie){z.input[z.index-1]==="."&&ie.ignoreMatch()}function Tt(z,ie){z.className!==void 0&&(z.scope=z.className,delete z.className)}function $r(z,ie){ie&&z.beginKeywords&&(z.begin="\\b("+z.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",z.__beforeBegin=St,z.keywords=z.keywords||z.beginKeywords,delete z.beginKeywords,z.relevance===void 0&&(z.relevance=0))}function kn(z,ie){Array.isArray(z.illegal)&&(z.illegal=S(...z.illegal))}function rr(z,ie){if(z.match){if(z.begin||z.end)throw new Error("begin & end are not supported with match");z.begin=z.match,delete z.match}}function Ye(z,ie){z.relevance===void 0&&(z.relevance=1)}const Xn=(z,ie)=>{if(!z.beforeMatch)return;if(z.starts)throw new Error("beforeMatch cannot be used with starts");const be=Object.assign({},z);Object.keys(z).forEach(Le=>{delete z[Le]}),z.keywords=be.keywords,z.begin=N(be.beforeMatch,E(be.begin)),z.starts={relevance:0,contains:[Object.assign(be,{endsParent:!0})]},z.relevance=0,delete be.beforeMatch},zn=["of","and","for","in","not","or","if","then","parent","list","value"],ir="keyword";function vr(z,ie,be=ir){const Le=Object.create(null);return typeof z=="string"?vt(be,z.split(" ")):Array.isArray(z)?vt(be,z):Object.keys(z).forEach(function(ht){Object.assign(Le,vr(z[ht],ie,ht))}),Le;function vt(ht,_e){ie&&(_e=_e.map(Ee=>Ee.toLowerCase())),_e.forEach(function(Ee){const Re=Ee.split("|");Le[Re[0]]=[ht,Ni(Re[0],Re[1])]})}}function Ni(z,ie){return ie?Number(ie):dl(z)?0:1}function dl(z){return zn.includes(z.toLowerCase())}const ia={},wt=z=>{console.error(z)},aa=(z,...ie)=>{console.log(`WARN: ${z}`,...ie)},te=(z,ie)=>{ia[`${z}/${ie}`]||(console.log(`Deprecated as of ${z}. ${ie}`),ia[`${z}/${ie}`]=!0)},pe=new Error;function Ae(z,ie,{key:be}){let Le=0;const vt=z[be],ht={},_e={};for(let Ee=1;Ee<=ie.length;Ee++)_e[Ee+Le]=vt[Ee],ht[Ee+Le]=!0,Le+=D(ie[Ee-1]);z[be]=_e,z[be]._emit=ht,z[be]._multi=!0}function He(z){if(Array.isArray(z.begin)){if(z.skip||z.excludeBegin||z.returnBegin)throw wt("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),pe;if(typeof z.beginScope!="object"||z.beginScope===null)throw wt("beginScope must be object"),pe;Ae(z,z.begin,{key:"beginScope"}),z.begin=F(z.begin,{joinWith:""})}}function Qe(z){if(Array.isArray(z.end)){if(z.skip||z.excludeEnd||z.returnEnd)throw wt("skip, excludeEnd, returnEnd not compatible with endScope: {}"),pe;if(typeof z.endScope!="object"||z.endScope===null)throw wt("endScope must be object"),pe;Ae(z,z.end,{key:"endScope"}),z.end=F(z.end,{joinWith:""})}}function rn(z){z.scope&&typeof z.scope=="object"&&z.scope!==null&&(z.beginScope=z.scope,delete z.scope)}function Zn(z){rn(z),typeof z.beginScope=="string"&&(z.beginScope={_wrap:z.beginScope}),typeof z.endScope=="string"&&(z.endScope={_wrap:z.endScope}),He(z),Qe(z)}function Kt(z){function ie(_e,Ee){return new RegExp(y(_e),"m"+(z.case_insensitive?"i":"")+(z.unicodeRegex?"u":"")+(Ee?"g":""))}class be{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(Ee,Re){Re.position=this.position++,this.matchIndexes[this.matchAt]=Re,this.regexes.push([Re,Ee]),this.matchAt+=D(Ee)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const Ee=this.regexes.map(Re=>Re[1]);this.matcherRe=ie(F(Ee,{joinWith:"|"}),!0),this.lastIndex=0}exec(Ee){this.matcherRe.lastIndex=this.lastIndex;const Re=this.matcherRe.exec(Ee);if(!Re)return null;const Mt=Re.findIndex((xr,sa)=>sa>0&&xr!==void 0),_t=this.matchIndexes[Mt];return Re.splice(0,Mt),Object.assign(Re,_t)}}class Le{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(Ee){if(this.multiRegexes[Ee])return this.multiRegexes[Ee];const Re=new be;return this.rules.slice(Ee).forEach(([Mt,_t])=>Re.addRule(Mt,_t)),Re.compile(),this.multiRegexes[Ee]=Re,Re}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(Ee,Re){this.rules.push([Ee,Re]),Re.type==="begin"&&this.count++}exec(Ee){const Re=this.getMatcher(this.regexIndex);Re.lastIndex=this.lastIndex;let Mt=Re.exec(Ee);if(this.resumingScanAtSamePosition()&&!(Mt&&Mt.index===this.lastIndex)){const _t=this.getMatcher(0);_t.lastIndex=this.lastIndex+1,Mt=_t.exec(Ee)}return Mt&&(this.regexIndex+=Mt.position+1,this.regexIndex===this.count&&this.considerAll()),Mt}}function vt(_e){const Ee=new Le;return _e.contains.forEach(Re=>Ee.addRule(Re.begin,{rule:Re,type:"begin"})),_e.terminatorEnd&&Ee.addRule(_e.terminatorEnd,{type:"end"}),_e.illegal&&Ee.addRule(_e.illegal,{type:"illegal"}),Ee}function ht(_e,Ee){const Re=_e;if(_e.isCompiled)return Re;[Tt,rr,Zn,Xn].forEach(_t=>_t(_e,Ee)),z.compilerExtensions.forEach(_t=>_t(_e,Ee)),_e.__beforeBegin=null,[$r,kn,Ye].forEach(_t=>_t(_e,Ee)),_e.isCompiled=!0;let Mt=null;return typeof _e.keywords=="object"&&_e.keywords.$pattern&&(_e.keywords=Object.assign({},_e.keywords),Mt=_e.keywords.$pattern,delete _e.keywords.$pattern),Mt=Mt||/\w+/,_e.keywords&&(_e.keywords=vr(_e.keywords,z.case_insensitive)),Re.keywordPatternRe=ie(Mt,!0),Ee&&(_e.begin||(_e.begin=/\B|\b/),Re.beginRe=ie(Re.begin),!_e.end&&!_e.endsWithParent&&(_e.end=/\B|\b/),_e.end&&(Re.endRe=ie(Re.end)),Re.terminatorEnd=y(Re.end)||"",_e.endsWithParent&&Ee.terminatorEnd&&(Re.terminatorEnd+=(_e.end?"|":"")+Ee.terminatorEnd)),_e.illegal&&(Re.illegalRe=ie(_e.illegal)),_e.contains||(_e.contains=[]),_e.contains=[].concat(..._e.contains.map(function(_t){return Qt(_t==="self"?_e:_t)})),_e.contains.forEach(function(_t){ht(_t,Re)}),_e.starts&&ht(_e.starts,Ee),Re.matcher=vt(Re),Re}if(z.compilerExtensions||(z.compilerExtensions=[]),z.contains&&z.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return z.classNameAliases=l(z.classNameAliases||{}),ht(z)}function Ct(z){return z?z.endsWithParent||Ct(z.starts):!1}function Qt(z){return z.variants&&!z.cachedVariants&&(z.cachedVariants=z.variants.map(function(ie){return l(z,{variants:null},ie)})),z.cachedVariants?z.cachedVariants:Ct(z)?l(z,{starts:z.starts?l(z.starts):null}):Object.isFrozen(z)?l(z):z}var rt="11.11.1";class ar extends Error{constructor(ie,be){super(ie),this.name="HTMLInjectionError",this.html=be}}const an=i,Ps=l,Ti=Symbol("nomatch"),la=7,Ci=function(z){const ie=Object.create(null),be=Object.create(null),Le=[];let vt=!0;const ht="Could not find the language '{}', did you forget to load/include a language module?",_e={disableAutodetect:!0,name:"Plain text",contains:[]};let Ee={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:b};function Re(fe){return Ee.noHighlightRe.test(fe)}function Mt(fe){let Ne=fe.className+" ";Ne+=fe.parentNode?fe.parentNode.className:"";const Pe=Ee.languageDetectRe.exec(Ne);if(Pe){const it=ln(Pe[1]);return it||(aa(ht.replace("{}",Pe[1])),aa("Falling back to no-highlight mode for this block.",fe)),it?Pe[1]:"no-highlight"}return Ne.split(/\s+/).find(it=>Re(it)||ln(it))}function _t(fe,Ne,Pe){let it="",Dt="";typeof Ne=="object"?(it=fe,Pe=Ne.ignoreIllegals,Dt=Ne.language):(te("10.7.0","highlight(lang, code, ...args) has been deprecated."),te("10.7.0",`Please use highlight(code, options) instead.
82
+ https://github.com/highlightjs/highlight.js/issues/2277`),Dt=fe,it=Ne),Pe===void 0&&(Pe=!0);const Jt={code:it,language:Dt};Oi("before:highlight",Jt);const wn=Jt.result?Jt.result:xr(Jt.language,Jt.code,Pe);return wn.code=Jt.code,Oi("after:highlight",wn),wn}function xr(fe,Ne,Pe,it){const Dt=Object.create(null);function Jt(ge,ke){return ge.keywords[ke]}function wn(){if(!Me.keywords){Bt.addText(at);return}let ge=0;Me.keywordPatternRe.lastIndex=0;let ke=Me.keywordPatternRe.exec(at),ze="";for(;ke;){ze+=at.substring(ge,ke.index);const Ke=qt.case_insensitive?ke[0].toLowerCase():ke[0],Nt=Jt(Me,Ke);if(Nt){const[Bn,bl]=Nt;if(Bt.addText(ze),ze="",Dt[Ke]=(Dt[Ke]||0)+1,Dt[Ke]<=la&&(Yr+=bl),Bn.startsWith("_"))ze+=ke[0];else{const Ys=qt.classNameAliases[Bn]||Bn;Nn(ke[0],Ys)}}else ze+=ke[0];ge=Me.keywordPatternRe.lastIndex,ke=Me.keywordPatternRe.exec(at)}ze+=at.substring(ge),Bt.addText(ze)}function pn(){if(at==="")return;let ge=null;if(typeof Me.subLanguage=="string"){if(!ie[Me.subLanguage]){Bt.addText(at);return}ge=xr(Me.subLanguage,at,!0,Vs[Me.subLanguage]),Vs[Me.subLanguage]=ge._top}else ge=oa(at,Me.subLanguage.length?Me.subLanguage:null);Me.relevance>0&&(Yr+=ge.relevance),Bt.__addSublanguage(ge._emitter,ge.language)}function bt(){Me.subLanguage!=null?pn():wn(),at=""}function Nn(ge,ke){ge!==""&&(Bt.startScope(ke),Bt.addText(ge),Bt.endScope())}function Ks(ge,ke){let ze=1;const Ke=ke.length-1;for(;ze<=Ke;){if(!ge._emit[ze]){ze++;continue}const Nt=qt.classNameAliases[ge[ze]]||ge[ze],Bn=ke[ze];Nt?Nn(Bn,Nt):(at=Bn,wn(),at=""),ze++}}function ua(ge,ke){return ge.scope&&typeof ge.scope=="string"&&Bt.openNode(qt.classNameAliases[ge.scope]||ge.scope),ge.beginScope&&(ge.beginScope._wrap?(Nn(at,qt.classNameAliases[ge.beginScope._wrap]||ge.beginScope._wrap),at=""):ge.beginScope._multi&&(Ks(ge.beginScope,ke),at="")),Me=Object.create(ge,{parent:{value:Me}}),Me}function pl(ge,ke,ze){let Ke=M(ge.endRe,ze);if(Ke){if(ge["on:end"]){const Nt=new n(ge);ge["on:end"](ke,Nt),Nt.isMatchIgnored&&(Ke=!1)}if(Ke){for(;ge.endsParent&&ge.parent;)ge=ge.parent;return ge}}if(ge.endsWithParent)return pl(ge.parent,ke,ze)}function da(ge){return Me.matcher.regexIndex===0?(at+=ge[0],1):(Xr=!0,0)}function qc(ge){const ke=ge[0],ze=ge.rule,Ke=new n(ze),Nt=[ze.__beforeBegin,ze["on:begin"]];for(const Bn of Nt)if(Bn&&(Bn(ge,Ke),Ke.isMatchIgnored))return da(ke);return ze.skip?at+=ke:(ze.excludeBegin&&(at+=ke),bt(),!ze.returnBegin&&!ze.excludeBegin&&(at=ke)),ua(ze,ge),ze.returnBegin?0:ke.length}function mn(ge){const ke=ge[0],ze=Ne.substring(ge.index),Ke=pl(Me,ge,ze);if(!Ke)return Ti;const Nt=Me;Me.endScope&&Me.endScope._wrap?(bt(),Nn(ke,Me.endScope._wrap)):Me.endScope&&Me.endScope._multi?(bt(),Ks(Me.endScope,ge)):Nt.skip?at+=ke:(Nt.returnEnd||Nt.excludeEnd||(at+=ke),bt(),Nt.excludeEnd&&(at=ke));do Me.scope&&Bt.closeNode(),!Me.skip&&!Me.subLanguage&&(Yr+=Me.relevance),Me=Me.parent;while(Me!==Ke.parent);return Ke.starts&&ua(Ke.starts,ge),Nt.returnEnd?0:ke.length}function ml(){const ge=[];for(let ke=Me;ke!==qt;ke=ke.parent)ke.scope&&ge.unshift(ke.scope);ge.forEach(ke=>Bt.openNode(ke))}let Mi={};function fa(ge,ke){const ze=ke&&ke[0];if(at+=ge,ze==null)return bt(),0;if(Mi.type==="begin"&&ke.type==="end"&&Mi.index===ke.index&&ze===""){if(at+=Ne.slice(ke.index,ke.index+1),!vt){const Ke=new Error(`0 width match regex (${fe})`);throw Ke.languageName=fe,Ke.badRule=Mi.rule,Ke}return 1}if(Mi=ke,ke.type==="begin")return qc(ke);if(ke.type==="illegal"&&!Pe){const Ke=new Error('Illegal lexeme "'+ze+'" for mode "'+(Me.scope||"<unnamed>")+'"');throw Ke.mode=Me,Ke}else if(ke.type==="end"){const Ke=mn(ke);if(Ke!==Ti)return Ke}if(ke.type==="illegal"&&ze==="")return at+=`
83
+ `,1;if(gl>1e5&&gl>ke.index*3)throw new Error("potential infinite loop, way more iterations than matches");return at+=ze,ze.length}const qt=ln(fe);if(!qt)throw wt(ht.replace("{}",fe)),new Error('Unknown language: "'+fe+'"');const qs=Kt(qt);let ha="",Me=it||qs;const Vs={},Bt=new Ee.__emitter(Ee);ml();let at="",Yr=0,_r=0,gl=0,Xr=!1;try{if(qt.__emitTokens)qt.__emitTokens(Ne,Bt);else{for(Me.matcher.considerAll();;){gl++,Xr?Xr=!1:Me.matcher.considerAll(),Me.matcher.lastIndex=_r;const ge=Me.matcher.exec(Ne);if(!ge)break;const ke=Ne.substring(_r,ge.index),ze=fa(ke,ge);_r=ge.index+ze}fa(Ne.substring(_r))}return Bt.finalize(),ha=Bt.toHTML(),{language:fe,value:ha,relevance:Yr,illegal:!1,_emitter:Bt,_top:Me}}catch(ge){if(ge.message&&ge.message.includes("Illegal"))return{language:fe,value:an(Ne),illegal:!0,relevance:0,_illegalBy:{message:ge.message,index:_r,context:Ne.slice(_r-100,_r+100),mode:ge.mode,resultSoFar:ha},_emitter:Bt};if(vt)return{language:fe,value:an(Ne),illegal:!1,relevance:0,errorRaised:ge,_emitter:Bt,_top:Me};throw ge}}function sa(fe){const Ne={value:an(fe),illegal:!1,relevance:0,_top:_e,_emitter:new Ee.__emitter(Ee)};return Ne._emitter.addText(fe),Ne}function oa(fe,Ne){Ne=Ne||Ee.languages||Object.keys(ie);const Pe=sa(fe),it=Ne.filter(ln).filter(qr).map(bt=>xr(bt,fe,!1));it.unshift(Pe);const Dt=it.sort((bt,Nn)=>{if(bt.relevance!==Nn.relevance)return Nn.relevance-bt.relevance;if(bt.language&&Nn.language){if(ln(bt.language).supersetOf===Nn.language)return 1;if(ln(Nn.language).supersetOf===bt.language)return-1}return 0}),[Jt,wn]=Dt,pn=Jt;return pn.secondBest=wn,pn}function lr(fe,Ne,Pe){const it=Ne&&be[Ne]||Pe;fe.classList.add("hljs"),fe.classList.add(`language-${it}`)}function Rt(fe){let Ne=null;const Pe=Mt(fe);if(Re(Pe))return;if(Oi("before:highlightElement",{el:fe,language:Pe}),fe.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",fe);return}if(fe.children.length>0&&(Ee.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(fe)),Ee.throwUnescapedHTML))throw new ar("One of your code blocks includes unescaped HTML.",fe.innerHTML);Ne=fe;const it=Ne.textContent,Dt=Pe?_t(it,{language:Pe,ignoreIllegals:!0}):oa(it);fe.innerHTML=Dt.value,fe.dataset.highlighted="yes",lr(fe,Pe,Dt.language),fe.result={language:Dt.language,re:Dt.relevance,relevance:Dt.relevance},Dt.secondBest&&(fe.secondBest={language:Dt.secondBest.language,relevance:Dt.secondBest.relevance}),Oi("after:highlightElement",{el:fe,result:Dt,text:it})}function Wt(fe){Ee=Ps(Ee,fe)}const Kr=()=>{ca(),te("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function fl(){ca(),te("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Fs=!1;function ca(){function fe(){ca()}if(document.readyState==="loading"){Fs||window.addEventListener("DOMContentLoaded",fe,!1),Fs=!0;return}document.querySelectorAll(Ee.cssSelector).forEach(Rt)}function Gs(fe,Ne){let Pe=null;try{Pe=Ne(z)}catch(it){if(wt("Language definition for '{}' could not be registered.".replace("{}",fe)),vt)wt(it);else throw it;Pe=_e}Pe.name||(Pe.name=fe),ie[fe]=Pe,Pe.rawDefinition=Ne.bind(null,z),Pe.aliases&&Er(Pe.aliases,{languageName:fe})}function Ai(fe){delete ie[fe];for(const Ne of Object.keys(be))be[Ne]===fe&&delete be[Ne]}function hl(){return Object.keys(ie)}function ln(fe){return fe=(fe||"").toLowerCase(),ie[fe]||ie[be[fe]]}function Er(fe,{languageName:Ne}){typeof fe=="string"&&(fe=[fe]),fe.forEach(Pe=>{be[Pe.toLowerCase()]=Ne})}function qr(fe){const Ne=ln(fe);return Ne&&!Ne.disableAutodetect}function Vr(fe){fe["before:highlightBlock"]&&!fe["before:highlightElement"]&&(fe["before:highlightElement"]=Ne=>{fe["before:highlightBlock"](Object.assign({block:Ne.el},Ne))}),fe["after:highlightBlock"]&&!fe["after:highlightElement"]&&(fe["after:highlightElement"]=Ne=>{fe["after:highlightBlock"](Object.assign({block:Ne.el},Ne))})}function zt(fe){Vr(fe),Le.push(fe)}function $s(fe){const Ne=Le.indexOf(fe);Ne!==-1&&Le.splice(Ne,1)}function Oi(fe,Ne){const Pe=fe;Le.forEach(function(it){it[Pe]&&it[Pe](Ne)})}function Sr(fe){return te("10.7.0","highlightBlock will be removed entirely in v12.0"),te("10.7.0","Please use highlightElement now."),Rt(fe)}Object.assign(z,{highlight:_t,highlightAuto:oa,highlightAll:ca,highlightElement:Rt,highlightBlock:Sr,configure:Wt,initHighlighting:Kr,initHighlightingOnLoad:fl,registerLanguage:Gs,unregisterLanguage:Ai,listLanguages:hl,getLanguage:ln,registerAliases:Er,autoDetection:qr,inherit:Ps,addPlugin:zt,removePlugin:$s}),z.debugMode=function(){vt=!1},z.safeMode=function(){vt=!0},z.versionString=rt,z.regex={concat:N,lookahead:E,either:S,optional:_,anyNumberOfTimes:v};for(const fe in De)typeof De[fe]=="object"&&e(De[fe]);return Object.assign(z,De),z},hn=Ci({});return hn.newInstance=()=>Ci({}),Ef=hn,hn.HighlightJS=hn,hn.default=hn,Ef}var nO=tO();const rO=Ds(nO),Py={},iO="hljs-";function aO(e){const n=rO.newInstance();return e&&c(e),{highlight:i,highlightAuto:l,listLanguages:o,register:c,registerAlias:u,registered:f};function i(h,p,b){const y=b||Py,E=typeof y.prefix=="string"?y.prefix:iO;if(!n.getLanguage(h))throw new Error("Unknown language: `"+h+"` is not registered");n.configure({__emitter:lO,classPrefix:E});const v=n.highlight(p,{ignoreIllegals:!0,language:h});if(v.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:v.errorRaised});const _=v._emitter.root,N=_.data;return N.language=v.language,N.relevance=v.relevance,_}function l(h,p){const y=(p||Py).subset||o();let E=-1,v=0,_;for(;++E<y.length;){const N=y[E];if(!n.getLanguage(N))continue;const T=i(N,h,p);T.data&&T.data.relevance!==void 0&&T.data.relevance>v&&(v=T.data.relevance,_=T)}return _||{type:"root",children:[],data:{language:void 0,relevance:v}}}function o(){return n.listLanguages()}function c(h,p){if(typeof h=="string")n.registerLanguage(h,p);else{let b;for(b in h)Object.hasOwn(h,b)&&n.registerLanguage(b,h[b])}}function u(h,p){if(typeof h=="string")n.registerAliases(typeof p=="string"?p:[...p],{languageName:h});else{let b;for(b in h)if(Object.hasOwn(h,b)){const y=h[b];n.registerAliases(typeof y=="string"?y:[...y],{languageName:b})}}}function f(h){return!!n.getLanguage(h)}}class lO{constructor(n){this.options=n,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(n){if(n==="")return;const i=this.stack[this.stack.length-1],l=i.children[i.children.length-1];l&&l.type==="text"?l.value+=n:i.children.push({type:"text",value:n})}startScope(n){this.openNode(String(n))}endScope(){this.closeNode()}__addSublanguage(n,i){const l=this.stack[this.stack.length-1],o=n.root.children;i?l.children.push({type:"element",tagName:"span",properties:{className:[i]},children:o}):l.children.push(...o)}openNode(n){const i=this,l=n.split(".").map(function(u,f){return f?u+"_".repeat(f):i.options.classPrefix+u}),o=this.stack[this.stack.length-1],c={type:"element",tagName:"span",properties:{className:l},children:[]};o.children.push(c),this.stack.push(c)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const sO={};function oO(e){const n=e||sO,i=n.aliases,l=n.detect||!1,o=n.languages||eO,c=n.plainText,u=n.prefix,f=n.subset;let h="hljs";const p=aO(o);if(i&&p.registerAlias(i),u){const b=u.indexOf("-");h=b===-1?u:u.slice(0,b)}return function(b,y){Gc(b,"element",function(E,v,_){if(E.tagName!=="code"||!_||_.type!=="element"||_.tagName!=="pre")return;const N=cO(E);if(N===!1||!N&&!l||N&&c&&c.includes(N))return;Array.isArray(E.properties.className)||(E.properties.className=[]),E.properties.className.includes(h)||E.properties.className.unshift(h);const T=T2(E,{whitespace:"pre"});let S;try{S=N?p.highlight(N,T,{prefix:u}):p.highlightAuto(T,{prefix:u,subset:f})}catch(D){const M=D;if(N&&/Unknown language/.test(M.message)){y.message("Cannot highlight as `"+N+"`, it’s not registered",{ancestors:[_,E],cause:M,place:E.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw M}!N&&S.data&&S.data.language&&E.properties.className.push("language-"+S.data.language),S.children.length>0&&(E.children=S.children)})}}function cO(e){const n=e.properties.className;let i=-1;if(!Array.isArray(n))return;let l;for(;++i<n.length;){const o=String(n[i]);if(o==="no-highlight"||o==="nohighlight")return!1;!l&&o.slice(0,5)==="lang-"&&(l=o.slice(5)),!l&&o.slice(0,9)==="language-"&&(l=o.slice(9))}return l}function Ya(e){return e?typeof e=="string"?e:"literalString"in e?e.literalString:"dataPath"in e?`{{${e.dataPath}}}`:"":""}function gc(e){return e?Array.isArray(e)?e:"explicitList"in e?e.explicitList:[]:[]}function uO({className:e,children:n}){const[i,l]=U.useState(!1),o=String(n).replace(/\n$/,""),c=(e==null?void 0:e.replace(/^language-/,""))??"",u=U.useCallback(()=>{navigator.clipboard.writeText(o).then(()=>{l(!0),setTimeout(()=>l(!1),2e3)})},[o]);return g.jsxs("div",{className:"group/code relative my-2 rounded-md overflow-hidden",style:{border:"1px solid var(--border)"},children:[g.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5",style:{background:"var(--bg-hover)",borderBottom:"1px solid var(--border)"},children:[g.jsx("span",{className:"text-tiny font-mono uppercase",style:{color:"var(--text-muted)"},children:c||"code"}),g.jsx("button",{onClick:u,className:"flex items-center gap-1 px-2 py-0.5 rounded text-tiny transition-colors",style:{color:i?"var(--accent-green)":"var(--text-muted)",background:"transparent"},title:"Copy code",children:i?g.jsxs(g.Fragment,{children:[g.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}),"Copied"]}):g.jsxs(g.Fragment,{children:[g.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.666 3.888A2.25 2.25 0 0013.5 2.25h-3c-1.03 0-1.9.693-2.166 1.638m7.332 0c.055.194.084.4.084.612v0a.75.75 0 01-.75.75H9.75a.75.75 0 01-.75-.75v0c0-.212.03-.418.084-.612m7.332 0c.646.049 1.288.11 1.927.184 1.1.128 1.907 1.077 1.907 2.185V19.5a2.25 2.25 0 01-2.25 2.25H6.75A2.25 2.25 0 014.5 19.5V6.257c0-1.108.806-2.057 1.907-2.185a48.208 48.208 0 011.927-.184"})}),"Copy"]})})]}),g.jsx("pre",{className:"overflow-x-auto p-3 text-[13px] leading-[1.5]",style:{background:"var(--code-bg)",color:"var(--text-primary)",margin:0},children:g.jsx("code",{className:e,style:{fontFamily:"var(--font-mono)"},children:n})})]})}function dO({children:e}){return g.jsx("div",{className:"my-2 overflow-x-auto rounded-md",style:{border:"1px solid var(--border)"},children:g.jsx("table",{className:"min-w-full text-[13px]",style:{borderCollapse:"collapse"},children:e})})}function fO({children:e}){return g.jsx("thead",{style:{background:"var(--bg-hover)"},children:e})}function hO({children:e,...n}){return g.jsx("tr",{...n,style:{borderBottom:"1px solid var(--border)"},className:"hover:bg-[--bg-hover] transition-colors",children:e})}function Fy({children:e,isHeader:n=!1,style:i}){const l=n?"th":"td";return g.jsx(l,{className:`px-3 py-2 text-left ${n?"font-bold":""}`,style:{color:n?"var(--text-primary)":"var(--text-secondary)",whiteSpace:"nowrap",...i},children:e})}function pO({jsonl:e,onAction:n}){const i=U.useMemo(()=>mO(e),[e]);return i?g.jsx("div",{className:"mt-1",children:bs(i.rootId,i.components,n)}):g.jsxs("div",{className:"mt-2 px-2 py-1.5 rounded-sm text-caption",style:{background:"var(--code-bg)",border:"1px solid var(--border)",color:"var(--text-secondary)"},children:[g.jsx("span",{className:"font-bold text-tiny",style:{color:"var(--text-muted)"},children:"A2UI"}),g.jsx("pre",{className:"mt-1 overflow-x-auto whitespace-pre-wrap break-words max-h-32",style:{fontFamily:"var(--font-mono)",fontSize:12},children:e})]})}function mO(e){try{const n=e.trim().split(`
84
+ `).filter(Boolean),i=new Map;let l="";for(const o of n){const c=JSON.parse(o);if("surfaceUpdate"in c)for(const u of c.surfaceUpdate.components)i.set(u.id,u.component);"beginRendering"in c&&(l=c.beginRendering.root)}return!l||i.size===0?null:{rootId:l,components:i}}catch{return null}}function bs(e,n,i){const l=n.get(e);if(!l)return null;if("Text"in l){const{text:o,usageHint:c}=l.Text,u=Ya(o),f=c??"body",h={h1:"text-h1 font-bold",h2:"text-h2 font-bold",h3:"text-[14px] font-bold",h4:"text-caption font-bold",h5:"text-tiny font-bold uppercase tracking-wide",caption:"text-caption",body:"text-body"};return g.jsx("p",{className:`${h[f]??"text-body"} my-0.5`,style:{color:f.startsWith("h")?"var(--text-primary)":"var(--text-secondary)"},children:u},e)}if("Button"in l){const{label:o,action:c,style:u}=l.Button,f=Ya(o),h=u==="primary"||u==="filled";return g.jsx("button",{onClick:()=>{c!=null&&c.sendMessage&&i&&i(c.sendMessage,c)},className:`inline-flex items-center gap-1.5 px-3 py-1.5 rounded-sm text-caption font-bold transition-colors ${h?"text-white":"hover:bg-[--bg-hover]"}`,style:{background:h?"var(--bg-active)":"transparent",color:h?"#fff":"var(--text-link)",border:h?"none":"1px solid var(--border)"},children:f},e)}if("Column"in l){const o=gc(l.Column.children),c=l.Column.gap??4;return g.jsx("div",{className:"flex flex-col",style:{gap:c},children:o.map(u=>bs(u,n,i))},e)}if("Row"in l){const o=gc(l.Row.children),c=l.Row.gap??8;return g.jsx("div",{className:"flex flex-row flex-wrap items-center",style:{gap:c},children:o.map(u=>bs(u,n,i))},e)}if("Card"in l){const o=gc(l.Card.children),c=l.Card.title?Ya(l.Card.title):null;return g.jsxs("div",{className:"rounded-md p-3 my-1",style:{background:"var(--bg-hover)",border:"1px solid var(--border)"},children:[c&&g.jsx("p",{className:"text-h2 font-bold mb-2",style:{color:"var(--text-primary)"},children:c}),g.jsx("div",{className:"flex flex-col gap-1",children:o.map(u=>bs(u,n,i))})]},e)}if("List"in l){const o=gc(l.List.children);return g.jsx("div",{className:"flex flex-col gap-0.5 my-1",children:o.map(c=>g.jsxs("div",{className:"flex items-start gap-2 px-2 py-1.5 rounded hover:bg-[--bg-hover] transition-colors",children:[g.jsx("span",{className:"text-tiny mt-1",style:{color:"var(--text-muted)"},children:"•"}),bs(c,n,i)]},c))},e)}if("Image"in l){const o=Ya(l.Image.url),c=l.Image.alt?Ya(l.Image.alt):"";return g.jsx("img",{src:o,alt:c,className:"max-w-[360px] max-h-64 rounded-md object-contain my-1",style:{border:"1px solid var(--border)"}},e)}if("Divider"in l)return g.jsx("hr",{className:"my-2",style:{border:"none",borderTop:"1px solid var(--border)"}},e);if("Icon"in l){const o=Ya(l.Icon.name);return g.jsxs("span",{className:"text-body",style:{color:"var(--text-secondary)"},children:["[",o,"]"]},e)}return null}function gO(e,n){return{pre({children:i,node:l}){var c,u,f,h;const o=(c=l==null?void 0:l.children)==null?void 0:c[0];if((o==null?void 0:o.tagName)==="code"){const p=(u=o.properties)!=null&&u.className?Array.isArray(o.properties.className)?o.properties.className.join(" "):String(o.properties.className):void 0;if(p!=null&&p.includes("language-action")){const b=String(((f=i==null?void 0:i.props)==null?void 0:f.children)??i).trim();try{const y=JSON.parse(b);if(y&&typeof y=="object"&&y.kind){const E=bO(y.prompt??b),v=n==null?void 0:n[E];return g.jsx(xO,{action:y,resolved:v,onResolve:e?(_,N)=>e(_,N):void 0})}}catch{}}return g.jsx(uO,{className:p,children:((h=i==null?void 0:i.props)==null?void 0:h.children)??i})}return g.jsx("pre",{children:i})},code({className:i,children:l,...o}){return g.jsx("code",{className:"px-1 py-0.5 rounded text-[0.85em]",style:{background:"var(--code-bg)",color:"var(--code-text)",fontFamily:"var(--font-mono)"},...o,children:l})},table({children:i}){return g.jsx(dO,{children:i})},thead({children:i}){return g.jsx(fO,{children:i})},tr({children:i,...l}){return g.jsx(hO,{...l,children:i})},th({children:i,style:l}){return g.jsx(Fy,{isHeader:!0,style:l,children:i})},td({children:i,style:l}){return g.jsx(Fy,{style:l,children:i})},a({href:i,children:l,...o}){return g.jsx("a",{href:i,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--text-link)"},className:"underline underline-offset-2 hover:opacity-80 transition-opacity",...o,children:l})},blockquote({children:i}){return g.jsx("blockquote",{className:"my-2 pl-3 py-0.5",style:{borderLeft:"3px solid var(--bg-active)",color:"var(--text-secondary)"},children:i})}}}function bO(e){let n=0;for(let i=0;i<e.length;i++)n=(n<<5)-n+e.charCodeAt(i)|0;return n.toString(36)}function yO(e,n){if(!e.includes("```action"))return e;const i=[];let l=e;const o=/```action\s*\n[\s\S]*?```/g;let c=0,u;for(;(u=o.exec(l))!==null;)u.index>c&&i.push(l.slice(c,u.index)),i.push(u[0]),c=u.index+u[0].length;const f=l.slice(c),h=f.indexOf("```action");return h!==-1&&n?i.push(f.slice(0,h)):i.push(f),i.join("")}function vO(e){return e.includes("```action")?e.replace(/```action\s*\n[\s\S]*?```/g,"").includes("```action"):!1}function xO({action:e,resolved:n,onResolve:i}){var b,y;const[l,o]=U.useState(""),[c,u]=U.useState(null);if(n)return g.jsxs("div",{className:"mt-2 rounded-lg px-4 py-3 flex items-center gap-2",style:{background:"var(--bg-hover)",border:"1px solid var(--border)",opacity:.85},children:[g.jsx("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,style:{color:"var(--accent-green, #34d399)"},children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}),g.jsxs("span",{className:"text-caption",style:{color:"var(--text-secondary)"},children:["Selected: ",g.jsx("strong",{style:{color:"var(--text-primary)"},children:n.label??n.value})]})]});const f=E=>{i&&i(E.value,E.label)},h=()=>{const E=l.trim();E&&i&&i(E,E)},p=(E,v)=>{const _=c===v;return E.style==="primary"?{background:"var(--bg-active)",color:"#fff",border:"none",opacity:_?.9:1}:E.style==="danger"?{background:_?"rgba(239,68,68,0.15)":"transparent",color:"var(--accent-red, #ef4444)",border:"1px solid var(--accent-red, #ef4444)"}:{background:_?"var(--bg-hover)":"transparent",color:"var(--text-link)",border:"1px solid var(--border)"}};if(e.kind==="confirm"){const E=((b=e.items)==null?void 0:b[0])??{label:"Yes",value:"yes"},v=((y=e.items)==null?void 0:y[1])??{label:"No",value:"no"};return g.jsxs("div",{className:"mt-2 rounded-lg overflow-hidden",style:{border:"1px solid var(--border)",background:"var(--bg-secondary, var(--bg-hover))"},children:[e.prompt&&g.jsx("div",{className:"px-4 py-3",style:{borderBottom:"1px solid var(--border)"},children:g.jsx("p",{className:"text-body font-bold",style:{color:"var(--text-primary)"},children:e.prompt})}),g.jsxs("div",{className:"flex",children:[g.jsx("button",{onClick:()=>f(v),onMouseEnter:()=>u(0),onMouseLeave:()=>u(null),className:"flex-1 px-4 py-2.5 text-caption font-bold transition-all cursor-pointer",style:{background:c===0?"var(--bg-hover)":"transparent",color:"var(--text-secondary)",borderRight:"1px solid var(--border)",border:"none",borderRightWidth:1,borderRightStyle:"solid",borderRightColor:"var(--border)"},children:v.label}),g.jsx("button",{onClick:()=>f(E),onMouseEnter:()=>u(1),onMouseLeave:()=>u(null),className:"flex-1 px-4 py-2.5 text-caption font-bold transition-all cursor-pointer",style:{background:"var(--bg-active)",color:"#fff",border:"none",opacity:c===1?.9:1},children:E.label})]})]})}return e.kind==="buttons"&&e.items?g.jsxs("div",{className:"mt-2 rounded-lg overflow-hidden",style:{border:"1px solid var(--border)",background:"var(--bg-secondary, var(--bg-hover))"},children:[e.prompt&&g.jsx("div",{className:"px-4 py-3",style:{borderBottom:"1px solid var(--border)"},children:g.jsx("p",{className:"text-body font-bold",style:{color:"var(--text-primary)"},children:e.prompt})}),g.jsx("div",{className:"flex flex-wrap gap-2 px-4 py-3",children:e.items.map((E,v)=>g.jsx("button",{onClick:()=>f(E),onMouseEnter:()=>u(v),onMouseLeave:()=>u(null),className:"inline-flex items-center gap-1.5 px-4 py-2 rounded-md text-caption font-bold transition-all cursor-pointer",style:p(E,v),children:E.label},E.value))})]}):e.kind==="select"&&e.items?g.jsxs("div",{className:"mt-2 rounded-lg overflow-hidden",style:{border:"1px solid var(--border)",background:"var(--bg-secondary, var(--bg-hover))"},children:[e.prompt&&g.jsx("div",{className:"px-4 py-3",style:{borderBottom:"1px solid var(--border)"},children:g.jsx("p",{className:"text-body font-bold",style:{color:"var(--text-primary)"},children:e.prompt})}),g.jsx("div",{className:"flex flex-col",children:e.items.map((E,v)=>g.jsxs("button",{onClick:()=>f(E),onMouseEnter:()=>u(v),onMouseLeave:()=>u(null),className:"flex items-center gap-3 px-4 py-2.5 text-left transition-all cursor-pointer",style:{background:c===v?"var(--bg-hover)":"transparent",color:"var(--text-primary)",borderBottom:v<e.items.length-1?"1px solid var(--border)":"none",border:"none",borderBottomWidth:v<e.items.length-1?1:0,borderBottomStyle:"solid",borderBottomColor:"var(--border)"},children:[g.jsx("span",{className:"w-5 h-5 rounded-full flex items-center justify-center flex-shrink-0",style:{border:"2px solid var(--border)",background:c===v?"var(--bg-active)":"transparent"},children:c===v&&g.jsx("span",{className:"w-2 h-2 rounded-full",style:{background:"#fff"}})}),g.jsx("span",{className:"text-caption",children:E.label})]},E.value))})]}):e.kind==="input"?g.jsxs("div",{className:"mt-2 rounded-lg overflow-hidden",style:{border:"1px solid var(--border)",background:"var(--bg-secondary, var(--bg-hover))"},children:[e.prompt&&g.jsx("div",{className:"px-4 py-3",style:{borderBottom:"1px solid var(--border)"},children:g.jsx("p",{className:"text-body font-bold",style:{color:"var(--text-primary)"},children:e.prompt})}),g.jsxs("div",{className:"flex items-center gap-2 px-4 py-3",children:[g.jsx("input",{type:"text",value:l,onChange:E=>o(E.target.value),onKeyDown:E=>{E.key==="Enter"&&h()},placeholder:e.placeholder??"Type your answer...",className:"flex-1 px-3 py-2 rounded-md text-caption outline-none",style:{background:"var(--bg-primary, var(--bg))",color:"var(--text-primary)",border:"1px solid var(--border)"}}),g.jsx("button",{onClick:h,disabled:!l.trim(),className:"px-4 py-2 rounded-md text-caption font-bold transition-all cursor-pointer",style:{background:l.trim()?"var(--bg-active)":"var(--bg-hover)",color:l.trim()?"#fff":"var(--text-muted)",border:"none"},children:"Submit"})]})]}):null}function EO(){return g.jsxs("div",{className:"mt-2 rounded-lg px-4 py-3 flex items-center gap-3",style:{background:"var(--bg-secondary, var(--bg-hover))",border:"1px solid var(--border)"},children:[g.jsx("span",{className:"inline-block w-2 h-2 rounded-full animate-pulse",style:{background:"var(--text-link)"}}),g.jsx("span",{className:"text-caption",style:{color:"var(--text-muted)"},children:"Preparing options..."})]})}function Xf({text:e,mediaUrl:n,a2ui:i,className:l="",isStreaming:o,onAction:c,onResolveAction:u,resolvedActions:f}){const h=U.useMemo(()=>gO(u,f),[u,f]),p=U.useMemo(()=>yO(e,o),[e,o]),b=o&&vO(e);return g.jsxs("div",{className:l,children:[n&&g.jsx("div",{className:"mb-2",children:g.jsx(SO,{url:n})}),p?g.jsx("div",{className:"prose prose-sm max-w-none prose-p:my-1 prose-ul:my-1 prose-ol:my-1 prose-pre:my-0 prose-code:before:content-none prose-code:after:content-none prose-headings:my-2",style:{color:"var(--text-primary)","--tw-prose-headings":"var(--text-primary)","--tw-prose-bold":"var(--text-primary)","--tw-prose-code":"var(--code-text)","--tw-prose-pre-code":"var(--text-primary)","--tw-prose-pre-bg":"var(--code-bg)","--tw-prose-bullets":"var(--text-muted)","--tw-prose-counters":"var(--text-muted)"},children:g.jsx(bx,{remarkPlugins:[Px],rehypePlugins:[oO],components:h,children:p})}):null,b&&g.jsx(EO,{}),i&&g.jsx(pO,{jsonl:i,onAction:c})]})}function SO({url:e}){var i,l;const n=((i=e.split(".").pop())==null?void 0:i.toLowerCase().split("?")[0])??"";if(["mp3","wav","ogg","m4a","aac","webm"].includes(n))return g.jsxs("div",{className:"flex items-center gap-3 px-3 py-2 rounded-md max-w-[360px]",style:{background:"var(--bg-hover)",border:"1px solid var(--border)"},children:[g.jsx("svg",{className:"w-8 h-8 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,style:{color:"var(--text-link)"},children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.114 5.636a9 9 0 010 12.728M16.463 8.288a5.25 5.25 0 010 7.424M6.75 8.25l4.72-4.72a.75.75 0 011.28.53v15.88a.75.75 0 01-1.28.53l-4.72-4.72H4.51c-.88 0-1.704-.507-1.938-1.354A9.01 9.01 0 012.25 12c0-.83.112-1.633.322-2.396C2.806 8.756 3.63 8.25 4.51 8.25H6.75z"})}),g.jsx("audio",{controls:!0,className:"flex-1 h-8",style:{maxWidth:280},children:g.jsx("source",{src:e})})]});if(["mp4","mov","avi","mkv"].includes(n))return g.jsx("video",{controls:!0,className:"max-w-[360px] max-h-64 rounded-md",style:{border:"1px solid var(--border)"},children:g.jsx("source",{src:e})});if(["pdf","zip","tar","gz","doc","docx","xls","xlsx","csv"].includes(n)){const o=((l=e.split("/").pop())==null?void 0:l.split("?")[0])??"file";return g.jsxs("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-3 px-3 py-2.5 rounded-md max-w-[360px] hover:opacity-90 transition-opacity",style:{background:"var(--bg-hover)",border:"1px solid var(--border)",textDecoration:"none"},children:[g.jsx("svg",{className:"w-8 h-8 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,style:{color:"var(--text-link)"},children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"})}),g.jsxs("div",{className:"flex-1 min-w-0",children:[g.jsx("p",{className:"text-caption font-bold truncate",style:{color:"var(--text-primary)"},children:o}),g.jsxs("p",{className:"text-tiny",style:{color:"var(--text-muted)"},children:[n.toUpperCase()," — Click to open"]})]}),g.jsx("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,style:{color:"var(--text-muted)"},children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3"})})]})}return g.jsx("img",{src:e,alt:"",className:"max-w-[360px] max-h-64 rounded-md object-contain cursor-pointer hover:opacity-90 transition-opacity",style:{border:"1px solid var(--border)"},onClick:()=>window.open(e,"_blank")})}function _O({channelId:e}){const n=nr(),i=Fr(),[l,o]=U.useState(null),[c,u]=U.useState(""),f=U.useRef(null),h=U.useRef(null),p=n.sessions,b=n.selectedSessionId;U.useEffect(()=>{l&&f.current&&(f.current.focus(),f.current.select())},[l]);const y=U.useCallback(T=>{if(T===b)return;const S=p.find(D=>D.id===T);S&&(ce.info("Session",`Switched to session: ${S.name} (${S.id})`),i({type:"SELECT_SESSION",sessionId:S.id,sessionKey:S.sessionKey}))},[b,p,i]),E=U.useCallback(async()=>{try{let T=e;if(!T){ce.info("Session","No channel for default agent — auto-creating General channel"),T=(await mr.create({name:"General",openclawAgentId:"main"})).id;const[{agents:M},{channels:A}]=await Promise.all([nl.list(),mr.list()]);i({type:"SET_AGENTS",agents:M}),i({type:"SET_CHANNELS",channels:A});const{sessions:F}=await tl.list(T);i({type:"SET_SESSIONS",sessions:F}),F.length>0&&i({type:"SELECT_SESSION",sessionId:F[0].id,sessionKey:F[0].sessionKey});return}const S=await tl.create(T);ce.info("Session",`Created session: ${S.name} (${S.id})`),i({type:"ADD_SESSION",session:S}),i({type:"SELECT_SESSION",sessionId:S.id,sessionKey:S.sessionKey}),requestAnimationFrame(()=>{h.current&&(h.current.scrollLeft=h.current.scrollWidth)})}catch(T){ce.error("Session",`Failed to create session: ${T}`)}},[e,i]),v=U.useCallback(async T=>{if(!(p.length<=1||!e))try{if(await tl.delete(e,T),ce.info("Session",`Deleted session: ${T}`),i({type:"REMOVE_SESSION",sessionId:T}),b===T){const S=p.filter(D=>D.id!==T);S.length>0&&i({type:"SELECT_SESSION",sessionId:S[0].id,sessionKey:S[0].sessionKey})}}catch(S){ce.error("Session",`Failed to delete session: ${S}`)}},[e,p,b,i]),_=U.useCallback((T,S)=>{o(T),u(S)},[]),N=U.useCallback(async()=>{if(!l||!c.trim()||!e){o(null);return}try{await tl.rename(e,l,c.trim()),ce.info("Session",`Renamed session ${l} to: ${c.trim()}`),i({type:"RENAME_SESSION",sessionId:l,name:c.trim()})}catch(T){ce.error("Session",`Failed to rename session: ${T}`)}o(null)},[e,l,c,i]);return g.jsx("div",{className:"flex items-center gap-0 px-3",style:{height:36,borderBottom:"1px solid var(--border)",background:"var(--bg-surface)"},children:g.jsxs("div",{ref:h,className:"flex items-center gap-0.5 overflow-x-auto no-scrollbar",children:[p.map(T=>{const S=T.id===b,D=T.id===l;return g.jsx("div",{className:"group relative flex items-center shrink-0",children:D?g.jsx("input",{ref:f,value:c,onChange:M=>u(M.target.value),onBlur:N,onKeyDown:M=>{M.key==="Enter"&&!M.nativeEvent.isComposing&&(M.preventDefault(),N()),M.key==="Escape"&&o(null)},className:"px-2.5 py-1 text-caption rounded-t-md focus:outline-none",style:{background:"var(--bg-hover)",color:"var(--text-primary)",border:"1px solid var(--bg-active)",borderBottom:"none",minWidth:60,maxWidth:140}}):g.jsxs("button",{onClick:()=>y(T.id),onDoubleClick:()=>_(T.id,T.name),className:"flex items-center gap-1 px-2.5 py-1 text-caption rounded-t-md transition-colors whitespace-nowrap",style:{background:S?"var(--bg-hover)":"transparent",color:S?"var(--text-primary)":"var(--text-secondary)",fontWeight:S?700:400,borderBottom:S?"2px solid var(--bg-active)":"2px solid transparent",marginBottom:-1},title:`${T.name} (double-click to rename)`,children:[g.jsx("span",{className:"max-w-[120px] truncate",children:T.name}),p.length>1&&g.jsx("span",{onClick:M=>{M.stopPropagation(),v(T.id)},className:"ml-0.5 w-4 h-4 flex items-center justify-center rounded-sm opacity-0 group-hover:opacity-100 transition-opacity hover:bg-[--bg-hover]",style:{color:"var(--text-muted)"},title:"Close session",children:g.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]})},T.id)}),g.jsx("button",{onClick:E,className:"shrink-0 w-7 h-7 flex items-center justify-center rounded-md transition-colors ml-0.5",style:{color:"var(--text-muted)"},title:"New session","aria-label":"New session",onMouseEnter:T=>{T.currentTarget.style.background="var(--bg-hover)",T.currentTarget.style.color="var(--text-primary)"},onMouseLeave:T=>{T.currentTarget.style.background="",T.currentTarget.style.color="var(--text-muted)"},children:g.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"})})})]})})}function kO(e){let n=0;for(let i=0;i<e.length;i++)n=(n<<5)-n+e.charCodeAt(i)|0;return n.toString(36)}const Gy=[{cmd:"/help",label:"Help",icon:"?"},{cmd:"/status",label:"Status",icon:"i"},{cmd:"/model",label:"Model",icon:"M"},{cmd:"/clear",label:"Clear",icon:"C"},{cmd:"/think",label:"Think",icon:"T"},{cmd:"/image",label:"Image",icon:"I"},{cmd:"/search",label:"Search",icon:"S"},{cmd:"/summarize",label:"Summarize",icon:"Σ"},{cmd:"/translate",label:"Translate",icon:"翻"},{cmd:"/reset",label:"Reset",icon:"R"}],c0="botschat_skill_freq_v2",$y="botschat_skill_freq",wO=2,NO=14;function u0(e=new Date){return e.toISOString().slice(0,10)}function d0(e){const n=Date.now()-NO*864e5;for(const i of Object.values(e))for(const l of Object.keys(i.daily))new Date(l).getTime()<n&&delete i.daily[l]}function f0(){try{const e=localStorage.getItem(c0);if(e){const i=JSON.parse(e);return d0(i),i}const n=localStorage.getItem($y);if(n){const i=JSON.parse(n),l=u0(),o={};for(const[c,u]of Object.entries(i))o[c]={total:u,daily:{[l]:u}};return h0(o),localStorage.removeItem($y),o}return{}}catch{return{}}}function h0(e){d0(e),localStorage.setItem(c0,JSON.stringify(e))}function Ky(e){const n=e.match(/^\/(\S+)/);if(!n)return null;const i=`/${n[1]}`,l=f0(),o=u0();return l[i]||(l[i]={total:0,daily:{}}),l[i].total+=1,l[i].daily[o]=(l[i].daily[o]??0)+1,h0(l),i}function p0(e){const n=Date.now()-wO*864e5;let i=0;for(const[l,o]of Object.entries(e.daily))new Date(l).getTime()>=n&&(i+=o);return i}function qy(e){return p0(e)*5+e.total}function TO(){const e=f0(),n=new Set(Gy.map(o=>o.cmd)),i=Object.keys(e).filter(o=>!n.has(o)&&o.startsWith("/")).map(o=>({cmd:o,label:o.slice(1).charAt(0).toUpperCase()+o.slice(2),icon:o.slice(1).charAt(0).toUpperCase()}));return{skills:[...Gy,...i].sort((o,c)=>{const u=e[o.cmd]?qy(e[o.cmd]):0;return(e[c.cmd]?qy(e[c.cmd]):0)-u}),store:e}}function m0({sendMessage:e}){var w,ue,ye;const n=nr(),i=Fr(),[l,o]=U.useState(""),[c,u]=U.useState(0),[f,h]=U.useState(null),[p,b]=U.useState(!1),[y,E]=U.useState(!1),v=U.useRef(null),_=U.useRef(null),N=U.useRef(null),T=U.useRef(null),S=n.selectedSessionKey,{skills:D,store:M}=U.useMemo(()=>TO(),[c]);U.useEffect(()=>{var K;(K=v.current)==null||K.scrollIntoView({behavior:"smooth"})},[n.messages]),U.useEffect(()=>{_.current&&(_.current.style.height="auto",_.current.style.height=Math.min(_.current.scrollHeight,160)+"px")},[l]),U.useEffect(()=>{S&&_.current&&requestAnimationFrame(()=>{var K;(K=_.current)==null||K.focus()})},[S]),U.useEffect(()=>{if(S)try{const de=JSON.parse(localStorage.getItem("botschat:sessionModels")||"{}")[S];de&&de!==n.sessionModel?i({type:"SET_SESSION_MODEL",model:de}):!de&&n.sessionModel&&i({type:"SET_SESSION_MODEL",model:null})}catch{}},[S]);const A=n.sessionModel??n.defaultModel,F=U.useCallback(K=>{var xe;if(!K||!S||K===A)return;ce.info("Chat",`Model change: ${A??"none"} → ${K}`),i({type:"SET_SESSION_MODEL",model:K});try{const ve=JSON.parse(localStorage.getItem("botschat:sessionModels")||"{}");ve[S]=K,localStorage.setItem("botschat:sessionModels",JSON.stringify(ve))}catch{}Ky("/model"),u(ve=>ve+1);const de={id:crypto.randomUUID(),sender:"user",text:`/model ${K}`,timestamp:Date.now()};i({type:"ADD_MESSAGE",message:de}),e({type:"user.message",sessionKey:S,text:`/model ${K}`,userId:((xe=n.user)==null?void 0:xe.id)??"",messageId:de.id}),requestAnimationFrame(()=>{var ve;(ve=v.current)==null||ve.scrollIntoView({behavior:"smooth"})})},[S,A,(w=n.user)==null?void 0:w.id,e,i]),L=U.useCallback(K=>{var de;ce.info("Skill",`Skill button clicked: ${K}`),o(xe=>xe.startsWith(K+" ")||xe===K?xe:K+" "),(de=_.current)==null||de.focus()},[]),X=U.useCallback(K=>{var ve,De;const de=(ve=K.target.files)==null?void 0:ve[0];if(!de||!de.type.startsWith("image/"))return;const xe=URL.createObjectURL(de);h({file:de,preview:xe}),K.target.value="",(De=_.current)==null||De.focus()},[]),re=U.useCallback(()=>{f&&(URL.revokeObjectURL(f.preview),h(null))},[f]),oe=U.useCallback(async K=>{const de=new FormData;de.append("file",K);const xe=localStorage.getItem("botschat_token");try{const ve=await fetch("/api/upload",{method:"POST",headers:xe?{Authorization:`Bearer ${xe}`}:{},body:de});if(!ve.ok){const Tt=await ve.json().catch(()=>({error:"Upload failed"}));throw new Error(Tt.error??`HTTP ${ve.status}`)}const De=await ve.json();return De.url.startsWith("/")?`${window.location.origin}${De.url}`:De.url}catch(ve){return ce.error("Upload",`Image upload failed: ${ve}`),null}},[]),B=U.useCallback(K=>{K.preventDefault(),K.stopPropagation(),K.dataTransfer.types.includes("Files")&&E(!0)},[]),Q=U.useCallback(K=>{var xe;K.preventDefault(),K.stopPropagation();const de=(xe=T.current)==null?void 0:xe.getBoundingClientRect();if(de){const{clientX:ve,clientY:De}=K;(ve<de.left||ve>de.right||De<de.top||De>de.bottom)&&E(!1)}},[]),ee=U.useCallback(K=>{K.preventDefault(),K.stopPropagation()},[]),me=U.useCallback(K=>{var xe,ve;K.preventDefault(),K.stopPropagation(),E(!1);const de=(xe=K.dataTransfer.files)==null?void 0:xe[0];if(de&&de.type.startsWith("image/")){const De=URL.createObjectURL(de);h({file:de,preview:De}),(ve=_.current)==null||ve.focus()}},[]),se=U.useCallback(K=>{var xe;const de=(xe=K.clipboardData)==null?void 0:xe.items;if(de){for(let ve=0;ve<de.length;ve++)if(de[ve].type.startsWith("image/")){K.preventDefault();const De=de[ve].getAsFile();if(De){const St=URL.createObjectURL(De);h({file:De,preview:St})}return}}},[]),$=async()=>{var St;if(!l.trim()&&!f||!S)return;const K=l.trim(),de=K.length>0,xe=de&&K.startsWith("/");ce.info("Chat",`Send message${xe?" (skill)":""}${f?" +image":""}: ${K.length>120?K.slice(0,120)+"…":K}`,{sessionKey:S,isSkill:xe}),de&&(Ky(K),u(Tt=>Tt+1));let ve;if(f){b(!0);const Tt=await oe(f.file);if(b(!1),!Tt)return;ve=Tt,re()}const De={id:crypto.randomUUID(),sender:"user",text:K,timestamp:Date.now(),mediaUrl:ve};i({type:"ADD_MESSAGE",message:De}),e({type:"user.message",sessionKey:S,text:K,userId:((St=n.user)==null?void 0:St.id)??"",messageId:De.id,...ve?{mediaUrl:ve}:{}}),o(""),requestAnimationFrame(()=>{var Tt;(Tt=v.current)==null||Tt.scrollIntoView({behavior:"smooth"})})},j=K=>{ce.info("Thread",`Open thread for message: ${K}`),i({type:"OPEN_THREAD",threadId:K,messages:[]})},O=U.useCallback(K=>{var xe;if(!S)return;ce.info("A2UI",`Action triggered: ${K}`);const de={id:crypto.randomUUID(),sender:"user",text:K,timestamp:Date.now()};i({type:"ADD_MESSAGE",message:de}),e({type:"user.message",sessionKey:S,text:K,userId:((xe=n.user)==null?void 0:xe.id)??"",messageId:de.id}),requestAnimationFrame(()=>{var ve;(ve=v.current)==null||ve.scrollIntoView({behavior:"smooth"})})},[S,(ue=n.user)==null?void 0:ue.id,e,i]),P=U.useCallback((K,de,xe)=>{var St;if(!S)return;ce.info("ActionCard",`Resolved: "${xe}" (value="${de}")`);const ve=kO(xe+de);i({type:"RESOLVE_ACTION",messageId:K,promptHash:ve,value:de,label:xe});const De={id:crypto.randomUUID(),sender:"user",text:xe,timestamp:Date.now()};i({type:"ADD_MESSAGE",message:De}),e({type:"user.message",sessionKey:S,text:xe,userId:((St=n.user)==null?void 0:St.id)??"",messageId:De.id}),requestAnimationFrame(()=>{var Tt;(Tt=v.current)==null||Tt.scrollIntoView({behavior:"smooth"})})},[S,(ye=n.user)==null?void 0:ye.id,e,i]),J=n.agents.find(K=>K.id===n.selectedAgentId),C=(J==null?void 0:J.name)??"channel",R=(J==null?void 0:J.channelId)??null,q=!!J;return S?g.jsxs("div",{ref:T,className:"flex-1 flex flex-col min-w-0 h-full relative",style:{background:"var(--bg-surface)"},onDragEnter:B,onDragLeave:Q,onDragOver:ee,onDrop:me,children:[y&&g.jsx("div",{className:"absolute inset-0 z-50 flex items-center justify-center",style:{background:"rgba(0,0,0,0.4)",pointerEvents:"none"},children:g.jsxs("div",{className:"flex flex-col items-center gap-3 p-8 rounded-lg",style:{background:"var(--bg-surface)",border:"2px dashed var(--text-link)"},children:[g.jsx("svg",{className:"w-12 h-12",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,style:{color:"var(--text-link)"},children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 15.75l5.159-5.159a2.25 2.25 0 013.182 0l5.159 5.159m-1.5-1.5l1.409-1.409a2.25 2.25 0 013.182 0l2.909 2.909M3.75 21h16.5a1.5 1.5 0 001.5-1.5V6a1.5 1.5 0 00-1.5-1.5H3.75A1.5 1.5 0 002.25 6v13.5A1.5 1.5 0 003.75 21z"})}),g.jsx("span",{className:"text-body font-bold",style:{color:"var(--text-primary)"},children:"Drop image here"})]})}),g.jsxs("div",{className:"flex items-center justify-between px-3 sm:px-5 gap-2 flex-shrink-0",style:{height:44,borderBottom:"1px solid var(--border)"},children:[g.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[g.jsxs("span",{className:"text-h1 truncate",style:{color:"var(--text-primary)"},children:["# ",C]}),J&&!J.isDefault&&g.jsx("span",{className:"text-caption hidden sm:inline flex-shrink-0",style:{color:"var(--text-secondary)"},children:"— custom channel"})]}),g.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[g.jsx("svg",{className:"w-3.5 h-3.5 hidden sm:block",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,style:{color:"var(--text-muted)"},children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.813 15.904L9 18.75l-.813-2.846a4.5 4.5 0 00-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 003.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 003.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 00-3.09 3.09zM18.259 8.715L18 9.75l-.259-1.035a3.375 3.375 0 00-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 002.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 002.455 2.456L21.75 6l-1.036.259a3.375 3.375 0 00-2.455 2.456z"})}),g.jsx(Uc,{value:A??"",onChange:F,models:n.models,disabled:!n.openclawConnected,placeholder:"No model",compact:!0})]})]}),q&&g.jsx(_O,{channelId:R}),g.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[n.messages.length===0&&g.jsx("div",{className:"py-12 px-5 text-center",children:g.jsx("p",{className:"text-caption",style:{color:"var(--text-muted)"},children:"No messages yet. Start a conversation."})}),n.messages.map((K,de)=>{const xe=de>0?n.messages[de-1]:null,ve=(xe==null?void 0:xe.sender)===K.sender&&K.timestamp-xe.timestamp<3e5;return g.jsx(CO,{msg:K,grouped:ve,onOpenThread:()=>j(K.id),onAction:O,onResolveAction:(De,St)=>P(K.id,De,St)},K.id)}),g.jsx("div",{ref:v})]}),g.jsxs("div",{className:"flex-shrink-0 px-3 sm:px-5 pb-3 sm:pb-4 pt-2",children:[g.jsx("div",{className:"flex items-center gap-1.5 pb-1.5 overflow-x-auto no-scrollbar",children:D.map(K=>{const de=M[K.cmd],xe=(de==null?void 0:de.total)??0,ve=de?p0(de):0,De=l.startsWith(K.cmd+" ")||l===K.cmd;return g.jsxs("button",{onClick:()=>L(K.cmd),className:"flex items-center gap-1 px-2 py-1 rounded-md text-xs whitespace-nowrap transition-colors shrink-0",style:{background:De?"var(--bg-active)":"var(--bg-hover)",color:De?"#fff":"var(--text-secondary)",border:"1px solid transparent"},title:`${K.cmd}${xe>0?` (total ${xe}x${ve>0?`, recent ${ve}x`:""})`:""}`,children:[g.jsx("span",{className:"font-mono text-[10px] opacity-70",children:K.cmd}),xe>0&&g.jsx("span",{className:"ml-0.5 px-1 rounded-sm text-[10px] font-bold",style:{background:De?"rgba(255,255,255,0.2)":"var(--bg-surface)",color:De?"#fff":"var(--text-muted)"},children:xe})]},K.cmd)})}),g.jsxs("div",{className:"rounded-md",style:{border:"1px solid var(--border)",background:"var(--bg-surface)"},children:[f&&g.jsxs("div",{className:"px-3 pt-2 flex items-start gap-2",children:[g.jsxs("div",{className:"relative",children:[g.jsx("img",{src:f.preview,alt:"Preview",className:"max-w-[120px] max-h-[80px] rounded-md object-contain",style:{border:"1px solid var(--border)"}}),g.jsx("button",{onClick:re,className:"absolute -top-1.5 -right-1.5 w-5 h-5 rounded-full flex items-center justify-center text-white opacity-80 hover:opacity-100 transition-opacity",style:{background:"#e74c3c",fontSize:11},title:"Remove image",children:"✕"})]}),p&&g.jsx("span",{className:"text-caption",style:{color:"var(--text-muted)"},children:"Uploading…"})]}),g.jsx("textarea",{ref:_,value:l,onChange:K=>o(K.target.value),onKeyDown:K=>{K.key==="Enter"&&!K.shiftKey&&!K.nativeEvent.isComposing&&(K.preventDefault(),$())},onPaste:se,placeholder:n.openclawConnected?`Message #${C}`:"OpenClaw is offline…",disabled:!n.openclawConnected,rows:1,className:"w-full px-3 py-2.5 text-body bg-transparent resize-none focus:outline-none disabled:opacity-50 placeholder:text-[--text-muted]",style:{color:"var(--text-primary)",minHeight:40}}),g.jsxs("div",{className:"flex items-center justify-between px-3 pb-2",children:[g.jsxs("div",{className:"flex items-center gap-1",children:[g.jsx("input",{ref:N,type:"file",accept:"image/*",className:"hidden",onChange:X}),g.jsx("button",{onClick:()=>{var K;return(K=N.current)==null?void 0:K.click()},className:"p-1.5 rounded hover:bg-[--bg-hover] transition-colors",style:{color:"var(--text-muted)"},title:"Upload image","aria-label":"Upload image",disabled:!n.openclawConnected,children:g.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 15.75l5.159-5.159a2.25 2.25 0 013.182 0l5.159 5.159m-1.5-1.5l1.409-1.409a2.25 2.25 0 013.182 0l2.909 2.909M3.75 21h16.5a1.5 1.5 0 001.5-1.5V6a1.5 1.5 0 00-1.5-1.5H3.75A1.5 1.5 0 002.25 6v13.5A1.5 1.5 0 003.75 21zm14.25-15.75a.75.75 0 11-1.5 0 .75.75 0 011.5 0z"})})})]}),g.jsx("button",{onClick:$,disabled:!l.trim()&&!f||!n.openclawConnected,className:"px-3 py-1.5 rounded-sm text-caption font-bold text-white disabled:opacity-40 disabled:cursor-not-allowed transition-colors",style:{background:"var(--bg-active)"},children:g.jsxs("div",{className:"flex items-center gap-1.5",children:[g.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 12L3.269 3.126A59.768 59.768 0 0121.485 12 59.77 59.77 0 013.27 20.876L5.999 12zm0 0h7.5"})}),"Send"]})})]})]})]})]}):g.jsx("div",{className:"flex-1 h-full flex items-center justify-center",style:{background:"var(--bg-surface)"},children:g.jsxs("div",{className:"text-center",children:[g.jsx("svg",{className:"w-16 h-16 mx-auto mb-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1,style:{color:"var(--text-muted)"},children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.25 8.511c.884.284 1.5 1.128 1.5 2.097v4.286c0 1.136-.847 2.1-1.98 2.193-.34.027-.68.052-1.02.072v3.091l-3-3c-1.354 0-2.694-.055-4.02-.163a2.115 2.115 0 01-.825-.242m9.345-8.334a2.126 2.126 0 00-.476-.095 48.64 48.64 0 00-8.048 0c-1.131.094-1.976 1.057-1.976 2.192v4.286c0 .837.46 1.58 1.155 1.951m9.345-8.334V6.637c0-1.621-1.152-3.026-2.76-3.235A48.455 48.455 0 0011.25 3c-2.115 0-4.198.137-6.24.402-1.608.209-2.76 1.614-2.76 3.235v6.226c0 1.621 1.152 3.026 2.76 3.235.577.075 1.157.14 1.74.194V21l4.155-4.155"})}),g.jsx("p",{className:"text-body font-bold",style:{color:"var(--text-muted)"},children:"Select a channel to get started"}),g.jsx("p",{className:"text-caption mt-1",style:{color:"var(--text-muted)"},children:"Choose a channel from the sidebar"})]})})}function CO({msg:e,grouped:n,onOpenThread:i,onAction:l,onResolveAction:o}){const c=nr(),u=e.sender==="user"?"You":"OpenClaw Agent",f=e.sender==="user"?"#9B59B6":"#2BAC76",h=e.sender==="user"?"U":"A",p=c.threadReplyCounts[e.id]??0;return g.jsxs("div",{className:"group relative px-3 sm:px-5 hover:bg-[--bg-hover] transition-colors",style:{paddingTop:n?2:8,paddingBottom:2},children:[g.jsxs("div",{className:"flex gap-2 max-w-message",children:[g.jsx("div",{className:"flex-shrink-0",style:{width:36},children:!n&&g.jsx("div",{className:"w-9 h-9 rounded flex items-center justify-center text-white text-caption font-bold",style:{background:f},children:h})}),g.jsxs("div",{className:"flex-1 min-w-0",children:[!n&&g.jsxs("div",{className:"flex items-baseline gap-2 mb-0.5",children:[g.jsx("span",{className:"text-h2",style:{color:"var(--text-primary)"},children:u}),g.jsx("span",{className:"text-caption",style:{color:"var(--text-secondary)"},children:new Date(e.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]}),g.jsx(Xf,{text:e.text,mediaUrl:e.mediaUrl,a2ui:e.a2ui,isStreaming:e.isStreaming,onAction:l,onResolveAction:o,resolvedActions:e.resolvedActions}),e.isStreaming&&g.jsx("span",{className:"inline-block w-1.5 h-4 ml-0.5 rounded-sm animate-pulse",style:{background:"var(--text-link)",verticalAlign:"text-bottom"}}),p>0&&g.jsxs("button",{onClick:i,className:"flex items-center gap-2 mt-1 py-1 px-1 -ml-1 rounded hover:bg-[--bg-hover] transition-colors cursor-pointer group/thread",children:[g.jsxs("span",{className:"text-caption font-bold",style:{color:"var(--text-link)"},children:[p," ",p===1?"reply":"replies"]}),g.jsx("span",{className:"text-caption opacity-0 group-hover/thread:opacity-100 transition-opacity",style:{color:"var(--text-secondary)"},children:"View thread"}),g.jsx("svg",{className:"w-4 h-4 opacity-0 group-hover/thread:opacity-100 transition-opacity",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,style:{color:"var(--text-secondary)"},children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 4.5l7.5 7.5-7.5 7.5"})})]})]})]}),g.jsx("div",{className:"absolute top-0 right-5 -translate-y-1/2 opacity-0 group-hover:opacity-100 transition-opacity flex items-center gap-0.5 px-1 py-0.5 rounded",style:{background:"var(--bg-surface)",border:"1px solid var(--border)",boxShadow:"var(--shadow-sm)"},children:g.jsx(AO,{label:"Reply in thread",icon:g.jsx("svg",{className:"w-[18px] h-[18px]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.25 8.511c.884.284 1.5 1.128 1.5 2.097v4.286c0 1.136-.847 2.1-1.98 2.193-.34.027-.68.052-1.02.072v3.091l-3-3c-1.354 0-2.694-.055-4.02-.163a2.115 2.115 0 01-.825-.242m9.345-8.334a2.126 2.126 0 00-.476-.095 48.64 48.64 0 00-8.048 0c-1.131.094-1.976 1.057-1.976 2.192v4.286c0 .837.46 1.58 1.155 1.951m9.345-8.334V6.637c0-1.621-1.152-3.026-2.76-3.235A48.455 48.455 0 0011.25 3c-2.115 0-4.198.137-6.24.402-1.608.209-2.76 1.614-2.76 3.235v6.226c0 1.621 1.152 3.026 2.76 3.235.577.075 1.157.14 1.74.194V21l4.155-4.155"})}),onClick:i})})]})}function AO({label:e,icon:n,onClick:i}){return g.jsx("button",{onClick:i,className:"p-1 rounded hover:bg-[--bg-hover] transition-colors",style:{color:"var(--text-secondary)"},title:e,"aria-label":e,children:n})}function g0({sendMessage:e}){const n=nr(),i=Fr(),[l,o]=U.useState("");if(U.useEffect(()=>{if(!n.activeThreadId||!n.selectedSessionKey||!n.user)return;const f=`${n.selectedSessionKey}:thread:${n.activeThreadId}`;ce.info("Thread",`Loading history for thread ${n.activeThreadId}`),Dv.list(n.user.id,f,n.activeThreadId).then(({messages:h})=>{ce.info("Thread",`Loaded ${h.length} thread messages`),h.length>0&&i({type:"OPEN_THREAD",threadId:n.activeThreadId,messages:h})}).catch(h=>{ce.error("Thread",`Failed to load thread history: ${h}`)})},[n.activeThreadId]),!n.activeThreadId)return null;const c=n.messages.find(f=>f.id===n.activeThreadId),u=()=>{var b;if(!l.trim()||!n.selectedSessionKey)return;const f=l.trim(),h=`${n.selectedSessionKey}:thread:${n.activeThreadId}`;ce.info("Thread",`Send reply: ${f.length>120?f.slice(0,120)+"…":f}`,{threadId:n.activeThreadId});const p={id:crypto.randomUUID(),sender:"user",text:f,timestamp:Date.now(),threadId:n.activeThreadId??void 0};i({type:"ADD_THREAD_MESSAGE",message:p}),e({type:"user.message",sessionKey:h,text:f,userId:((b=n.user)==null?void 0:b.id)??"",messageId:p.id}),o("")};return g.jsxs("div",{className:"flex flex-col h-full",style:{background:"var(--bg-surface)"},children:[g.jsxs("div",{className:"flex items-center justify-between px-4 flex-shrink-0",style:{height:44,borderBottom:"1px solid var(--border)"},children:[g.jsx("h3",{className:"text-h1",style:{color:"var(--text-primary)"},children:"Thread"}),g.jsx("button",{onClick:()=>i({type:"CLOSE_THREAD"}),className:"p-1 rounded hover:bg-[--bg-hover] transition-colors",style:{color:"var(--text-secondary)"},"aria-label":"Close thread",children:g.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),g.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[c&&g.jsx("div",{className:"px-5 py-3",style:{borderBottom:"1px solid var(--border)"},children:g.jsxs("div",{className:"flex gap-2",children:[g.jsx("div",{className:"w-9 h-9 rounded flex-shrink-0 flex items-center justify-center text-white text-caption font-bold",style:{background:c.sender==="user"?"#9B59B6":"#2BAC76"},children:c.sender==="user"?"U":"A"}),g.jsxs("div",{className:"flex-1 min-w-0",children:[g.jsxs("div",{className:"flex items-baseline gap-2 mb-0.5",children:[g.jsx("span",{className:"text-h2",style:{color:"var(--text-primary)"},children:c.sender==="user"?"You":"OpenClaw Agent"}),g.jsx("span",{className:"text-caption",style:{color:"var(--text-secondary)"},children:new Date(c.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]}),g.jsx(Xf,{text:c.text,mediaUrl:c.mediaUrl})]})]})}),g.jsx("div",{className:"px-5 py-2",style:{borderBottom:"1px solid var(--border)"},children:g.jsxs("span",{className:"text-caption font-bold",style:{color:"var(--text-link)"},children:[n.threadMessages.length," ",n.threadMessages.length===1?"reply":"replies"]})}),n.threadMessages.map((f,h)=>{const p=h>0?n.threadMessages[h-1]:null,b=(p==null?void 0:p.sender)===f.sender&&f.timestamp-p.timestamp<3e5;return g.jsx("div",{className:"px-5 hover:bg-[--bg-hover] transition-colors",style:{paddingTop:b?2:8,paddingBottom:2},children:g.jsxs("div",{className:"flex gap-2",children:[g.jsx("div",{className:"flex-shrink-0",style:{width:36},children:!b&&g.jsx("div",{className:"w-9 h-9 rounded flex items-center justify-center text-white text-caption font-bold",style:{background:f.sender==="user"?"#9B59B6":"#2BAC76"},children:f.sender==="user"?"U":"A"})}),g.jsxs("div",{className:"flex-1 min-w-0",children:[!b&&g.jsxs("div",{className:"flex items-baseline gap-2 mb-0.5",children:[g.jsx("span",{className:"text-h2",style:{color:"var(--text-primary)"},children:f.sender==="user"?"You":"OpenClaw Agent"}),g.jsx("span",{className:"text-caption",style:{color:"var(--text-secondary)"},children:new Date(f.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]}),g.jsx(Xf,{text:f.text,mediaUrl:f.mediaUrl,a2ui:f.a2ui})]})]})},f.id)})]})," ",g.jsx("div",{className:"px-4 pb-3 pt-2",children:g.jsxs("div",{className:"rounded-md",style:{border:"1px solid var(--border)",background:"var(--bg-surface)"},children:[g.jsx("textarea",{value:l,onChange:f=>o(f.target.value),onKeyDown:f=>{f.key==="Enter"&&!f.shiftKey&&!f.nativeEvent.isComposing&&(f.preventDefault(),u())},placeholder:"Reply…",rows:1,className:"w-full px-3 py-2 text-body bg-transparent resize-none focus:outline-none placeholder:text-[--text-muted]",style:{color:"var(--text-primary)",minHeight:36}}),g.jsx("div",{className:"flex justify-end px-3 pb-2",children:g.jsx("button",{onClick:u,disabled:!l.trim(),className:"px-3 py-1 rounded-sm text-caption font-bold text-white disabled:opacity-40 disabled:cursor-not-allowed transition-colors",style:{background:"var(--bg-active)"},children:"Send"})})]})})]})}function OO(e){switch(e){case"ok":return"OK";case"error":return"ERR";case"skipped":return"SKIP";case"running":return"RUN";default:return e.toUpperCase()}}function MO(e){switch(e){case"ok":return{bg:"rgba(43,172,118,0.15)",fg:"var(--accent-green)"};case"error":return{bg:"rgba(224,30,90,0.15)",fg:"var(--accent-red)"};case"running":return{bg:"rgba(29,155,209,0.15)",fg:"var(--text-link)"};default:return{bg:"rgba(232,162,48,0.15)",fg:"var(--accent-yellow)"}}}function RO({jobs:e,selectedJobId:n,onSelectJob:i}){return e.length===0?g.jsx("div",{className:"flex items-center justify-center h-full",style:{background:"var(--bg-surface)"},children:g.jsxs("div",{className:"text-center p-4",children:[g.jsx("svg",{className:"w-8 h-8 mx-auto mb-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,style:{color:"var(--text-muted)"},children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})}),g.jsxs("p",{className:"text-tiny",style:{color:"var(--text-muted)"},children:["No runs yet.",g.jsx("br",{}),"Waiting for schedule..."]})]})}):g.jsxs("div",{className:"overflow-y-auto h-full",style:{background:"var(--bg-surface)"},children:[g.jsxs("div",{className:"px-3 py-2",style:{borderBottom:"1px solid var(--border)"},children:[g.jsx("span",{className:"text-tiny uppercase tracking-wider font-bold",style:{color:"var(--text-muted)"},children:"Job History"}),g.jsxs("span",{className:"text-tiny ml-1",style:{color:"var(--text-muted)"},children:["(",e.length,")"]})]}),e.map((l,o)=>{const c=MO(l.status),u=l.number||e.length-o;return g.jsxs("button",{onClick:()=>i(l.id),className:`w-full text-left px-3 py-2 hover:bg-[--bg-hover] transition-colors ${n===l.id?"bg-[--bg-hover]":""}`,style:{borderBottom:"1px solid var(--border)",...n===l.id?{borderLeft:"3px solid var(--bg-active)"}:{}},children:[g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsxs("span",{className:"text-tiny font-mono",style:{color:"var(--text-muted)"},children:["#",u]}),g.jsx("span",{className:"text-tiny px-1.5 py-0.5 rounded-sm font-bold",style:{background:c.bg,color:c.fg},children:OO(l.status)})]}),g.jsxs("div",{className:"text-tiny mt-0.5",style:{color:"var(--text-muted)"},children:[l.time,l.durationMs!=null&&g.jsxs("span",{className:"ml-1",children:["(",(l.durationMs/1e3).toFixed(1),"s)"]})]}),l.summary&&g.jsx("div",{className:"text-caption mt-1 truncate",style:{color:"var(--text-secondary)"},children:l.summary})]},l.id)})]})}const DO=()=>{};var Vy={};/**
85
+ * @license
86
+ * Copyright 2017 Google LLC
87
+ *
88
+ * Licensed under the Apache License, Version 2.0 (the "License");
89
+ * you may not use this file except in compliance with the License.
90
+ * You may obtain a copy of the License at
91
+ *
92
+ * http://www.apache.org/licenses/LICENSE-2.0
93
+ *
94
+ * Unless required by applicable law or agreed to in writing, software
95
+ * distributed under the License is distributed on an "AS IS" BASIS,
96
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
97
+ * See the License for the specific language governing permissions and
98
+ * limitations under the License.
99
+ */const b0=function(e){const n=[];let i=0;for(let l=0;l<e.length;l++){let o=e.charCodeAt(l);o<128?n[i++]=o:o<2048?(n[i++]=o>>6|192,n[i++]=o&63|128):(o&64512)===55296&&l+1<e.length&&(e.charCodeAt(l+1)&64512)===56320?(o=65536+((o&1023)<<10)+(e.charCodeAt(++l)&1023),n[i++]=o>>18|240,n[i++]=o>>12&63|128,n[i++]=o>>6&63|128,n[i++]=o&63|128):(n[i++]=o>>12|224,n[i++]=o>>6&63|128,n[i++]=o&63|128)}return n},LO=function(e){const n=[];let i=0,l=0;for(;i<e.length;){const o=e[i++];if(o<128)n[l++]=String.fromCharCode(o);else if(o>191&&o<224){const c=e[i++];n[l++]=String.fromCharCode((o&31)<<6|c&63)}else if(o>239&&o<365){const c=e[i++],u=e[i++],f=e[i++],h=((o&7)<<18|(c&63)<<12|(u&63)<<6|f&63)-65536;n[l++]=String.fromCharCode(55296+(h>>10)),n[l++]=String.fromCharCode(56320+(h&1023))}else{const c=e[i++],u=e[i++];n[l++]=String.fromCharCode((o&15)<<12|(c&63)<<6|u&63)}}return n.join("")},y0={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray(e,n){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();const i=n?this.byteToCharMapWebSafe_:this.byteToCharMap_,l=[];for(let o=0;o<e.length;o+=3){const c=e[o],u=o+1<e.length,f=u?e[o+1]:0,h=o+2<e.length,p=h?e[o+2]:0,b=c>>2,y=(c&3)<<4|f>>4;let E=(f&15)<<2|p>>6,v=p&63;h||(v=64,u||(E=64)),l.push(i[b],i[y],i[E],i[v])}return l.join("")},encodeString(e,n){return this.HAS_NATIVE_SUPPORT&&!n?btoa(e):this.encodeByteArray(b0(e),n)},decodeString(e,n){return this.HAS_NATIVE_SUPPORT&&!n?atob(e):LO(this.decodeStringToByteArray(e,n))},decodeStringToByteArray(e,n){this.init_();const i=n?this.charToByteMapWebSafe_:this.charToByteMap_,l=[];for(let o=0;o<e.length;){const c=i[e.charAt(o++)],f=o<e.length?i[e.charAt(o)]:0;++o;const p=o<e.length?i[e.charAt(o)]:64;++o;const y=o<e.length?i[e.charAt(o)]:64;if(++o,c==null||f==null||p==null||y==null)throw new IO;const E=c<<2|f>>4;if(l.push(E),p!==64){const v=f<<4&240|p>>2;if(l.push(v),y!==64){const _=p<<6&192|y;l.push(_)}}}return l},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let e=0;e<this.ENCODED_VALS.length;e++)this.byteToCharMap_[e]=this.ENCODED_VALS.charAt(e),this.charToByteMap_[this.byteToCharMap_[e]]=e,this.byteToCharMapWebSafe_[e]=this.ENCODED_VALS_WEBSAFE.charAt(e),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[e]]=e,e>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}};class IO extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const zO=function(e){const n=b0(e);return y0.encodeByteArray(n,!0)},v0=function(e){return zO(e).replace(/\./g,"")},x0=function(e){try{return y0.decodeString(e,!0)}catch(n){console.error("base64Decode failed: ",n)}return null};/**
100
+ * @license
101
+ * Copyright 2022 Google LLC
102
+ *
103
+ * Licensed under the Apache License, Version 2.0 (the "License");
104
+ * you may not use this file except in compliance with the License.
105
+ * You may obtain a copy of the License at
106
+ *
107
+ * http://www.apache.org/licenses/LICENSE-2.0
108
+ *
109
+ * Unless required by applicable law or agreed to in writing, software
110
+ * distributed under the License is distributed on an "AS IS" BASIS,
111
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
112
+ * See the License for the specific language governing permissions and
113
+ * limitations under the License.
114
+ */function BO(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("Unable to locate global object.")}/**
115
+ * @license
116
+ * Copyright 2022 Google LLC
117
+ *
118
+ * Licensed under the Apache License, Version 2.0 (the "License");
119
+ * you may not use this file except in compliance with the License.
120
+ * You may obtain a copy of the License at
121
+ *
122
+ * http://www.apache.org/licenses/LICENSE-2.0
123
+ *
124
+ * Unless required by applicable law or agreed to in writing, software
125
+ * distributed under the License is distributed on an "AS IS" BASIS,
126
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
127
+ * See the License for the specific language governing permissions and
128
+ * limitations under the License.
129
+ */const UO=()=>BO().__FIREBASE_DEFAULTS__,jO=()=>{if(typeof process>"u"||typeof Vy>"u")return;const e=Vy.__FIREBASE_DEFAULTS__;if(e)return JSON.parse(e)},HO=()=>{if(typeof document>"u")return;let e;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const n=e&&x0(e[1]);return n&&JSON.parse(n)},PO=()=>{try{return DO()||UO()||jO()||HO()}catch(e){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`);return}},FO=e=>{var n;return(n=PO())==null?void 0:n[`_${e}`]};/**
130
+ * @license
131
+ * Copyright 2025 Google LLC
132
+ *
133
+ * Licensed under the Apache License, Version 2.0 (the "License");
134
+ * you may not use this file except in compliance with the License.
135
+ * You may obtain a copy of the License at
136
+ *
137
+ * http://www.apache.org/licenses/LICENSE-2.0
138
+ *
139
+ * Unless required by applicable law or agreed to in writing, software
140
+ * distributed under the License is distributed on an "AS IS" BASIS,
141
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
142
+ * See the License for the specific language governing permissions and
143
+ * limitations under the License.
144
+ */function E0(e){try{return(e.startsWith("http://")||e.startsWith("https://")?new URL(e).hostname:e).endsWith(".cloudworkstations.dev")}catch{return!1}}/**
145
+ * @license
146
+ * Copyright 2017 Google LLC
147
+ *
148
+ * Licensed under the Apache License, Version 2.0 (the "License");
149
+ * you may not use this file except in compliance with the License.
150
+ * You may obtain a copy of the License at
151
+ *
152
+ * http://www.apache.org/licenses/LICENSE-2.0
153
+ *
154
+ * Unless required by applicable law or agreed to in writing, software
155
+ * distributed under the License is distributed on an "AS IS" BASIS,
156
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
157
+ * See the License for the specific language governing permissions and
158
+ * limitations under the License.
159
+ */function br(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function GO(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(br())}function $O(){return typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"}function KO(){const e=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof e=="object"&&e.id!==void 0}function qO(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function VO(){try{return typeof indexedDB=="object"}catch{return!1}}function YO(){return new Promise((e,n)=>{try{let i=!0;const l="validate-browser-context-for-indexeddb-analytics-module",o=self.indexedDB.open(l);o.onsuccess=()=>{o.result.close(),i||self.indexedDB.deleteDatabase(l),e(!0)},o.onupgradeneeded=()=>{i=!1},o.onerror=()=>{var c;n(((c=o.error)==null?void 0:c.message)||"")}}catch(i){n(i)}})}/**
160
+ * @license
161
+ * Copyright 2017 Google LLC
162
+ *
163
+ * Licensed under the Apache License, Version 2.0 (the "License");
164
+ * you may not use this file except in compliance with the License.
165
+ * You may obtain a copy of the License at
166
+ *
167
+ * http://www.apache.org/licenses/LICENSE-2.0
168
+ *
169
+ * Unless required by applicable law or agreed to in writing, software
170
+ * distributed under the License is distributed on an "AS IS" BASIS,
171
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
172
+ * See the License for the specific language governing permissions and
173
+ * limitations under the License.
174
+ */const XO="FirebaseError";class ra extends Error{constructor(n,i,l){super(i),this.code=n,this.customData=l,this.name=XO,Object.setPrototypeOf(this,ra.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,js.prototype.create)}}class js{constructor(n,i,l){this.service=n,this.serviceName=i,this.errors=l}create(n,...i){const l=i[0]||{},o=`${this.service}/${n}`,c=this.errors[n],u=c?ZO(c,l):"Error",f=`${this.serviceName}: ${u} (${o}).`;return new ra(o,f,l)}}function ZO(e,n){return e.replace(QO,(i,l)=>{const o=n[l];return o!=null?String(o):`<${l}?>`})}const QO=/\{\$([^}]+)}/g;/**
175
+ * @license
176
+ * Copyright 2017 Google LLC
177
+ *
178
+ * Licensed under the Apache License, Version 2.0 (the "License");
179
+ * you may not use this file except in compliance with the License.
180
+ * You may obtain a copy of the License at
181
+ *
182
+ * http://www.apache.org/licenses/LICENSE-2.0
183
+ *
184
+ * Unless required by applicable law or agreed to in writing, software
185
+ * distributed under the License is distributed on an "AS IS" BASIS,
186
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
187
+ * See the License for the specific language governing permissions and
188
+ * limitations under the License.
189
+ */function S0(e){const n=[];for(const[i,l]of Object.entries(e))Array.isArray(l)?l.forEach(o=>{n.push(encodeURIComponent(i)+"="+encodeURIComponent(o))}):n.push(encodeURIComponent(i)+"="+encodeURIComponent(l));return n.length?"&"+n.join("&"):""}function WO(e,n){const i=new JO(e,n);return i.subscribe.bind(i)}class JO{constructor(n,i){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=i,this.task.then(()=>{n(this)}).catch(l=>{this.error(l)})}next(n){this.forEachObserver(i=>{i.next(n)})}error(n){this.forEachObserver(i=>{i.error(n)}),this.close(n)}complete(){this.forEachObserver(n=>{n.complete()}),this.close()}subscribe(n,i,l){let o;if(n===void 0&&i===void 0&&l===void 0)throw new Error("Missing Observer.");eM(n,["next","error","complete"])?o=n:o={next:n,error:i,complete:l},o.next===void 0&&(o.next=Sf),o.error===void 0&&(o.error=Sf),o.complete===void 0&&(o.complete=Sf);const c=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?o.error(this.finalError):o.complete()}catch{}}),this.observers.push(o),c}unsubscribeOne(n){this.observers===void 0||this.observers[n]===void 0||(delete this.observers[n],this.observerCount-=1,this.observerCount===0&&this.onNoObservers!==void 0&&this.onNoObservers(this))}forEachObserver(n){if(!this.finalized)for(let i=0;i<this.observers.length;i++)this.sendOne(i,n)}sendOne(n,i){this.task.then(()=>{if(this.observers!==void 0&&this.observers[n]!==void 0)try{i(this.observers[n])}catch(l){typeof console<"u"&&console.error&&console.error(l)}})}close(n){this.finalized||(this.finalized=!0,n!==void 0&&(this.finalError=n),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function eM(e,n){if(typeof e!="object"||e===null)return!1;for(const i of n)if(i in e&&typeof e[i]=="function")return!0;return!1}function Sf(){}/**
190
+ * @license
191
+ * Copyright 2021 Google LLC
192
+ *
193
+ * Licensed under the Apache License, Version 2.0 (the "License");
194
+ * you may not use this file except in compliance with the License.
195
+ * You may obtain a copy of the License at
196
+ *
197
+ * http://www.apache.org/licenses/LICENSE-2.0
198
+ *
199
+ * Unless required by applicable law or agreed to in writing, software
200
+ * distributed under the License is distributed on an "AS IS" BASIS,
201
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
202
+ * See the License for the specific language governing permissions and
203
+ * limitations under the License.
204
+ */function $c(e){return e&&e._delegate?e._delegate:e}class Os{constructor(n,i,l){this.name=n,this.instanceFactory=i,this.type=l,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(n){return this.instantiationMode=n,this}setMultipleInstances(n){return this.multipleInstances=n,this}setServiceProps(n){return this.serviceProps=n,this}setInstanceCreatedCallback(n){return this.onInstanceCreated=n,this}}/**
205
+ * @license
206
+ * Copyright 2017 Google LLC
207
+ *
208
+ * Licensed under the Apache License, Version 2.0 (the "License");
209
+ * you may not use this file except in compliance with the License.
210
+ * You may obtain a copy of the License at
211
+ *
212
+ * http://www.apache.org/licenses/LICENSE-2.0
213
+ *
214
+ * Unless required by applicable law or agreed to in writing, software
215
+ * distributed under the License is distributed on an "AS IS" BASIS,
216
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
217
+ * See the License for the specific language governing permissions and
218
+ * limitations under the License.
219
+ */var mt;(function(e){e[e.DEBUG=0]="DEBUG",e[e.VERBOSE=1]="VERBOSE",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"})(mt||(mt={}));const tM={debug:mt.DEBUG,verbose:mt.VERBOSE,info:mt.INFO,warn:mt.WARN,error:mt.ERROR,silent:mt.SILENT},nM=mt.INFO,rM={[mt.DEBUG]:"log",[mt.VERBOSE]:"log",[mt.INFO]:"info",[mt.WARN]:"warn",[mt.ERROR]:"error"},iM=(e,n,...i)=>{if(n<e.logLevel)return;const l=new Date().toISOString(),o=rM[n];if(o)console[o](`[${l}] ${e.name}:`,...i);else throw new Error(`Attempted to log a message with an invalid logType (value: ${n})`)};class _0{constructor(n){this.name=n,this._logLevel=nM,this._logHandler=iM,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(n){if(!(n in mt))throw new TypeError(`Invalid value "${n}" assigned to \`logLevel\``);this._logLevel=n}setLogLevel(n){this._logLevel=typeof n=="string"?tM[n]:n}get logHandler(){return this._logHandler}set logHandler(n){if(typeof n!="function")throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=n}get userLogHandler(){return this._userLogHandler}set userLogHandler(n){this._userLogHandler=n}debug(...n){this._userLogHandler&&this._userLogHandler(this,mt.DEBUG,...n),this._logHandler(this,mt.DEBUG,...n)}log(...n){this._userLogHandler&&this._userLogHandler(this,mt.VERBOSE,...n),this._logHandler(this,mt.VERBOSE,...n)}info(...n){this._userLogHandler&&this._userLogHandler(this,mt.INFO,...n),this._logHandler(this,mt.INFO,...n)}warn(...n){this._userLogHandler&&this._userLogHandler(this,mt.WARN,...n),this._logHandler(this,mt.WARN,...n)}error(...n){this._userLogHandler&&this._userLogHandler(this,mt.ERROR,...n),this._logHandler(this,mt.ERROR,...n)}}const aM=(e,n)=>n.some(i=>e instanceof i);let Yy,Xy;function lM(){return Yy||(Yy=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function sM(){return Xy||(Xy=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const k0=new WeakMap,Zf=new WeakMap,w0=new WeakMap,_f=new WeakMap,Ah=new WeakMap;function oM(e){const n=new Promise((i,l)=>{const o=()=>{e.removeEventListener("success",c),e.removeEventListener("error",u)},c=()=>{i(ki(e.result)),o()},u=()=>{l(e.error),o()};e.addEventListener("success",c),e.addEventListener("error",u)});return n.then(i=>{i instanceof IDBCursor&&k0.set(i,e)}).catch(()=>{}),Ah.set(n,e),n}function cM(e){if(Zf.has(e))return;const n=new Promise((i,l)=>{const o=()=>{e.removeEventListener("complete",c),e.removeEventListener("error",u),e.removeEventListener("abort",u)},c=()=>{i(),o()},u=()=>{l(e.error||new DOMException("AbortError","AbortError")),o()};e.addEventListener("complete",c),e.addEventListener("error",u),e.addEventListener("abort",u)});Zf.set(e,n)}let Qf={get(e,n,i){if(e instanceof IDBTransaction){if(n==="done")return Zf.get(e);if(n==="objectStoreNames")return e.objectStoreNames||w0.get(e);if(n==="store")return i.objectStoreNames[1]?void 0:i.objectStore(i.objectStoreNames[0])}return ki(e[n])},set(e,n,i){return e[n]=i,!0},has(e,n){return e instanceof IDBTransaction&&(n==="done"||n==="store")?!0:n in e}};function uM(e){Qf=e(Qf)}function dM(e){return e===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(n,...i){const l=e.call(kf(this),n,...i);return w0.set(l,n.sort?n.sort():[n]),ki(l)}:sM().includes(e)?function(...n){return e.apply(kf(this),n),ki(k0.get(this))}:function(...n){return ki(e.apply(kf(this),n))}}function fM(e){return typeof e=="function"?dM(e):(e instanceof IDBTransaction&&cM(e),aM(e,lM())?new Proxy(e,Qf):e)}function ki(e){if(e instanceof IDBRequest)return oM(e);if(_f.has(e))return _f.get(e);const n=fM(e);return n!==e&&(_f.set(e,n),Ah.set(n,e)),n}const kf=e=>Ah.get(e);function hM(e,n,{blocked:i,upgrade:l,blocking:o,terminated:c}={}){const u=indexedDB.open(e,n),f=ki(u);return l&&u.addEventListener("upgradeneeded",h=>{l(ki(u.result),h.oldVersion,h.newVersion,ki(u.transaction),h)}),i&&u.addEventListener("blocked",h=>i(h.oldVersion,h.newVersion,h)),f.then(h=>{c&&h.addEventListener("close",()=>c()),o&&h.addEventListener("versionchange",p=>o(p.oldVersion,p.newVersion,p))}).catch(()=>{}),f}const pM=["get","getKey","getAll","getAllKeys","count"],mM=["put","add","delete","clear"],wf=new Map;function Zy(e,n){if(!(e instanceof IDBDatabase&&!(n in e)&&typeof n=="string"))return;if(wf.get(n))return wf.get(n);const i=n.replace(/FromIndex$/,""),l=n!==i,o=mM.includes(i);if(!(i in(l?IDBIndex:IDBObjectStore).prototype)||!(o||pM.includes(i)))return;const c=async function(u,...f){const h=this.transaction(u,o?"readwrite":"readonly");let p=h.store;return l&&(p=p.index(f.shift())),(await Promise.all([p[i](...f),o&&h.done]))[0]};return wf.set(n,c),c}uM(e=>({...e,get:(n,i,l)=>Zy(n,i)||e.get(n,i,l),has:(n,i)=>!!Zy(n,i)||e.has(n,i)}));/**
220
+ * @license
221
+ * Copyright 2019 Google LLC
222
+ *
223
+ * Licensed under the Apache License, Version 2.0 (the "License");
224
+ * you may not use this file except in compliance with the License.
225
+ * You may obtain a copy of the License at
226
+ *
227
+ * http://www.apache.org/licenses/LICENSE-2.0
228
+ *
229
+ * Unless required by applicable law or agreed to in writing, software
230
+ * distributed under the License is distributed on an "AS IS" BASIS,
231
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
232
+ * See the License for the specific language governing permissions and
233
+ * limitations under the License.
234
+ */class gM{constructor(n){this.container=n}getPlatformInfoString(){return this.container.getProviders().map(i=>{if(bM(i)){const l=i.getImmediate();return`${l.library}/${l.version}`}else return null}).filter(i=>i).join(" ")}}function bM(e){const n=e.getComponent();return(n==null?void 0:n.type)==="VERSION"}const Wf="@firebase/app",Qy="0.14.8";/**
235
+ * @license
236
+ * Copyright 2019 Google LLC
237
+ *
238
+ * Licensed under the Apache License, Version 2.0 (the "License");
239
+ * you may not use this file except in compliance with the License.
240
+ * You may obtain a copy of the License at
241
+ *
242
+ * http://www.apache.org/licenses/LICENSE-2.0
243
+ *
244
+ * Unless required by applicable law or agreed to in writing, software
245
+ * distributed under the License is distributed on an "AS IS" BASIS,
246
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
247
+ * See the License for the specific language governing permissions and
248
+ * limitations under the License.
249
+ */const Pr=new _0("@firebase/app"),yM="@firebase/app-compat",vM="@firebase/analytics-compat",xM="@firebase/analytics",EM="@firebase/app-check-compat",SM="@firebase/app-check",_M="@firebase/auth",kM="@firebase/auth-compat",wM="@firebase/database",NM="@firebase/data-connect",TM="@firebase/database-compat",CM="@firebase/functions",AM="@firebase/functions-compat",OM="@firebase/installations",MM="@firebase/installations-compat",RM="@firebase/messaging",DM="@firebase/messaging-compat",LM="@firebase/performance",IM="@firebase/performance-compat",zM="@firebase/remote-config",BM="@firebase/remote-config-compat",UM="@firebase/storage",jM="@firebase/storage-compat",HM="@firebase/firestore",PM="@firebase/ai",FM="@firebase/firestore-compat",GM="firebase",$M="12.9.0",KM={[Wf]:"fire-core",[yM]:"fire-core-compat",[xM]:"fire-analytics",[vM]:"fire-analytics-compat",[SM]:"fire-app-check",[EM]:"fire-app-check-compat",[_M]:"fire-auth",[kM]:"fire-auth-compat",[wM]:"fire-rtdb",[NM]:"fire-data-connect",[TM]:"fire-rtdb-compat",[CM]:"fire-fn",[AM]:"fire-fn-compat",[OM]:"fire-iid",[MM]:"fire-iid-compat",[RM]:"fire-fcm",[DM]:"fire-fcm-compat",[LM]:"fire-perf",[IM]:"fire-perf-compat",[zM]:"fire-rc",[BM]:"fire-rc-compat",[UM]:"fire-gcs",[jM]:"fire-gcs-compat",[HM]:"fire-fst",[FM]:"fire-fst-compat",[PM]:"fire-vertex","fire-js":"fire-js",[GM]:"fire-js-all"};/**
250
+ * @license
251
+ * Copyright 2019 Google LLC
252
+ *
253
+ * Licensed under the Apache License, Version 2.0 (the "License");
254
+ * you may not use this file except in compliance with the License.
255
+ * You may obtain a copy of the License at
256
+ *
257
+ * http://www.apache.org/licenses/LICENSE-2.0
258
+ *
259
+ * Unless required by applicable law or agreed to in writing, software
260
+ * distributed under the License is distributed on an "AS IS" BASIS,
261
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
262
+ * See the License for the specific language governing permissions and
263
+ * limitations under the License.
264
+ */const qM=new Map,VM=new Map,Wy=new Map;function Jy(e,n){try{e.container.addComponent(n)}catch(i){Pr.debug(`Component ${n.name} failed to register with FirebaseApp ${e.name}`,i)}}function Ms(e){const n=e.name;if(Wy.has(n))return Pr.debug(`There were multiple attempts to register component ${n}.`),!1;Wy.set(n,e);for(const i of qM.values())Jy(i,e);for(const i of VM.values())Jy(i,e);return!0}function Wa(e){return e==null?!1:e.settings!==void 0}/**
265
+ * @license
266
+ * Copyright 2019 Google LLC
267
+ *
268
+ * Licensed under the Apache License, Version 2.0 (the "License");
269
+ * you may not use this file except in compliance with the License.
270
+ * You may obtain a copy of the License at
271
+ *
272
+ * http://www.apache.org/licenses/LICENSE-2.0
273
+ *
274
+ * Unless required by applicable law or agreed to in writing, software
275
+ * distributed under the License is distributed on an "AS IS" BASIS,
276
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
277
+ * See the License for the specific language governing permissions and
278
+ * limitations under the License.
279
+ */const YM={"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}'","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."},Oh=new js("app","Firebase",YM);/**
280
+ * @license
281
+ * Copyright 2019 Google LLC
282
+ *
283
+ * Licensed under the Apache License, Version 2.0 (the "License");
284
+ * you may not use this file except in compliance with the License.
285
+ * You may obtain a copy of the License at
286
+ *
287
+ * http://www.apache.org/licenses/LICENSE-2.0
288
+ *
289
+ * Unless required by applicable law or agreed to in writing, software
290
+ * distributed under the License is distributed on an "AS IS" BASIS,
291
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
292
+ * See the License for the specific language governing permissions and
293
+ * limitations under the License.
294
+ */const Mh=$M;function il(e,n,i){let l=KM[e]??e;i&&(l+=`-${i}`);const o=l.match(/\s|\//),c=n.match(/\s|\//);if(o||c){const u=[`Unable to register library "${l}" with version "${n}":`];o&&u.push(`library name "${l}" contains illegal characters (whitespace or "/")`),o&&c&&u.push("and"),c&&u.push(`version name "${n}" contains illegal characters (whitespace or "/")`),Pr.warn(u.join(" "));return}Ms(new Os(`${l}-version`,()=>({library:l,version:n}),"VERSION"))}/**
295
+ * @license
296
+ * Copyright 2021 Google LLC
297
+ *
298
+ * Licensed under the Apache License, Version 2.0 (the "License");
299
+ * you may not use this file except in compliance with the License.
300
+ * You may obtain a copy of the License at
301
+ *
302
+ * http://www.apache.org/licenses/LICENSE-2.0
303
+ *
304
+ * Unless required by applicable law or agreed to in writing, software
305
+ * distributed under the License is distributed on an "AS IS" BASIS,
306
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
307
+ * See the License for the specific language governing permissions and
308
+ * limitations under the License.
309
+ */const XM="firebase-heartbeat-database",ZM=1,Rs="firebase-heartbeat-store";let Nf=null;function N0(){return Nf||(Nf=hM(XM,ZM,{upgrade:(e,n)=>{switch(n){case 0:try{e.createObjectStore(Rs)}catch(i){console.warn(i)}}}}).catch(e=>{throw Oh.create("idb-open",{originalErrorMessage:e.message})})),Nf}async function QM(e){try{const i=(await N0()).transaction(Rs),l=await i.objectStore(Rs).get(T0(e));return await i.done,l}catch(n){if(n instanceof ra)Pr.warn(n.message);else{const i=Oh.create("idb-get",{originalErrorMessage:n==null?void 0:n.message});Pr.warn(i.message)}}}async function ev(e,n){try{const l=(await N0()).transaction(Rs,"readwrite");await l.objectStore(Rs).put(n,T0(e)),await l.done}catch(i){if(i instanceof ra)Pr.warn(i.message);else{const l=Oh.create("idb-set",{originalErrorMessage:i==null?void 0:i.message});Pr.warn(l.message)}}}function T0(e){return`${e.name}!${e.options.appId}`}/**
310
+ * @license
311
+ * Copyright 2021 Google LLC
312
+ *
313
+ * Licensed under the Apache License, Version 2.0 (the "License");
314
+ * you may not use this file except in compliance with the License.
315
+ * You may obtain a copy of the License at
316
+ *
317
+ * http://www.apache.org/licenses/LICENSE-2.0
318
+ *
319
+ * Unless required by applicable law or agreed to in writing, software
320
+ * distributed under the License is distributed on an "AS IS" BASIS,
321
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
322
+ * See the License for the specific language governing permissions and
323
+ * limitations under the License.
324
+ */const WM=1024,JM=30;class eR{constructor(n){this.container=n,this._heartbeatsCache=null;const i=this.container.getProvider("app").getImmediate();this._storage=new nR(i),this._heartbeatsCachePromise=this._storage.read().then(l=>(this._heartbeatsCache=l,l))}async triggerHeartbeat(){var n,i;try{const o=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),c=tv();if(((n=this._heartbeatsCache)==null?void 0:n.heartbeats)==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,((i=this._heartbeatsCache)==null?void 0:i.heartbeats)==null)||this._heartbeatsCache.lastSentHeartbeatDate===c||this._heartbeatsCache.heartbeats.some(u=>u.date===c))return;if(this._heartbeatsCache.heartbeats.push({date:c,agent:o}),this._heartbeatsCache.heartbeats.length>JM){const u=rR(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(u,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(l){Pr.warn(l)}}async getHeartbeatsHeader(){var n;try{if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,((n=this._heartbeatsCache)==null?void 0:n.heartbeats)==null||this._heartbeatsCache.heartbeats.length===0)return"";const i=tv(),{heartbeatsToSend:l,unsentEntries:o}=tR(this._heartbeatsCache.heartbeats),c=v0(JSON.stringify({version:2,heartbeats:l}));return this._heartbeatsCache.lastSentHeartbeatDate=i,o.length>0?(this._heartbeatsCache.heartbeats=o,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),c}catch(i){return Pr.warn(i),""}}}function tv(){return new Date().toISOString().substring(0,10)}function tR(e,n=WM){const i=[];let l=e.slice();for(const o of e){const c=i.find(u=>u.agent===o.agent);if(c){if(c.dates.push(o.date),nv(i)>n){c.dates.pop();break}}else if(i.push({agent:o.agent,dates:[o.date]}),nv(i)>n){i.pop();break}l=l.slice(1)}return{heartbeatsToSend:i,unsentEntries:l}}class nR{constructor(n){this.app=n,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return VO()?YO().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){const i=await QM(this.app);return i!=null&&i.heartbeats?i:{heartbeats:[]}}else return{heartbeats:[]}}async overwrite(n){if(await this._canUseIndexedDBPromise){const l=await this.read();return ev(this.app,{lastSentHeartbeatDate:n.lastSentHeartbeatDate??l.lastSentHeartbeatDate,heartbeats:n.heartbeats})}else return}async add(n){if(await this._canUseIndexedDBPromise){const l=await this.read();return ev(this.app,{lastSentHeartbeatDate:n.lastSentHeartbeatDate??l.lastSentHeartbeatDate,heartbeats:[...l.heartbeats,...n.heartbeats]})}else return}}function nv(e){return v0(JSON.stringify({version:2,heartbeats:e})).length}function rR(e){if(e.length===0)return-1;let n=0,i=e[0].date;for(let l=1;l<e.length;l++)e[l].date<i&&(i=e[l].date,n=l);return n}/**
325
+ * @license
326
+ * Copyright 2019 Google LLC
327
+ *
328
+ * Licensed under the Apache License, Version 2.0 (the "License");
329
+ * you may not use this file except in compliance with the License.
330
+ * You may obtain a copy of the License at
331
+ *
332
+ * http://www.apache.org/licenses/LICENSE-2.0
333
+ *
334
+ * Unless required by applicable law or agreed to in writing, software
335
+ * distributed under the License is distributed on an "AS IS" BASIS,
336
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
337
+ * See the License for the specific language governing permissions and
338
+ * limitations under the License.
339
+ */function iR(e){Ms(new Os("platform-logger",n=>new gM(n),"PRIVATE")),Ms(new Os("heartbeat",n=>new eR(n),"PRIVATE")),il(Wf,Qy,e),il(Wf,Qy,"esm2020"),il("fire-js","")}iR("");var aR="firebase",lR="12.9.0";/**
340
+ * @license
341
+ * Copyright 2020 Google LLC
342
+ *
343
+ * Licensed under the Apache License, Version 2.0 (the "License");
344
+ * you may not use this file except in compliance with the License.
345
+ * You may obtain a copy of the License at
346
+ *
347
+ * http://www.apache.org/licenses/LICENSE-2.0
348
+ *
349
+ * Unless required by applicable law or agreed to in writing, software
350
+ * distributed under the License is distributed on an "AS IS" BASIS,
351
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
352
+ * See the License for the specific language governing permissions and
353
+ * limitations under the License.
354
+ */il(aR,lR,"app");function C0(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}const sR=C0,A0=new js("auth","Firebase",C0());/**
355
+ * @license
356
+ * Copyright 2020 Google LLC
357
+ *
358
+ * Licensed under the Apache License, Version 2.0 (the "License");
359
+ * you may not use this file except in compliance with the License.
360
+ * You may obtain a copy of the License at
361
+ *
362
+ * http://www.apache.org/licenses/LICENSE-2.0
363
+ *
364
+ * Unless required by applicable law or agreed to in writing, software
365
+ * distributed under the License is distributed on an "AS IS" BASIS,
366
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
367
+ * See the License for the specific language governing permissions and
368
+ * limitations under the License.
369
+ */const Dc=new _0("@firebase/auth");function oR(e,...n){Dc.logLevel<=mt.WARN&&Dc.warn(`Auth (${Mh}): ${e}`,...n)}function Sc(e,...n){Dc.logLevel<=mt.ERROR&&Dc.error(`Auth (${Mh}): ${e}`,...n)}/**
370
+ * @license
371
+ * Copyright 2020 Google LLC
372
+ *
373
+ * Licensed under the Apache License, Version 2.0 (the "License");
374
+ * you may not use this file except in compliance with the License.
375
+ * You may obtain a copy of the License at
376
+ *
377
+ * http://www.apache.org/licenses/LICENSE-2.0
378
+ *
379
+ * Unless required by applicable law or agreed to in writing, software
380
+ * distributed under the License is distributed on an "AS IS" BASIS,
381
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
382
+ * See the License for the specific language governing permissions and
383
+ * limitations under the License.
384
+ */function rv(e,...n){throw Rh(e,...n)}function O0(e,...n){return Rh(e,...n)}function M0(e,n,i){const l={...sR(),[n]:i};return new js("auth","Firebase",l).create(n,{appName:e.name})}function _c(e){return M0(e,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function Rh(e,...n){if(typeof e!="string"){const i=n[0],l=[...n.slice(1)];return l[0]&&(l[0].appName=e.name),e._errorFactory.create(i,...l)}return A0.create(e,...n)}function tt(e,n,...i){if(!e)throw Rh(n,...i)}function _s(e){const n="INTERNAL ASSERTION FAILED: "+e;throw Sc(n),new Error(n)}function Lc(e,n){e||_s(n)}function cR(){return iv()==="http:"||iv()==="https:"}function iv(){var e;return typeof self<"u"&&((e=self.location)==null?void 0:e.protocol)||null}/**
385
+ * @license
386
+ * Copyright 2020 Google LLC
387
+ *
388
+ * Licensed under the Apache License, Version 2.0 (the "License");
389
+ * you may not use this file except in compliance with the License.
390
+ * You may obtain a copy of the License at
391
+ *
392
+ * http://www.apache.org/licenses/LICENSE-2.0
393
+ *
394
+ * Unless required by applicable law or agreed to in writing, software
395
+ * distributed under the License is distributed on an "AS IS" BASIS,
396
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
397
+ * See the License for the specific language governing permissions and
398
+ * limitations under the License.
399
+ */function uR(){return typeof navigator<"u"&&navigator&&"onLine"in navigator&&typeof navigator.onLine=="boolean"&&(cR()||KO()||"connection"in navigator)?navigator.onLine:!0}function dR(){if(typeof navigator>"u")return null;const e=navigator;return e.languages&&e.languages[0]||e.language||null}/**
400
+ * @license
401
+ * Copyright 2020 Google LLC
402
+ *
403
+ * Licensed under the Apache License, Version 2.0 (the "License");
404
+ * you may not use this file except in compliance with the License.
405
+ * You may obtain a copy of the License at
406
+ *
407
+ * http://www.apache.org/licenses/LICENSE-2.0
408
+ *
409
+ * Unless required by applicable law or agreed to in writing, software
410
+ * distributed under the License is distributed on an "AS IS" BASIS,
411
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
412
+ * See the License for the specific language governing permissions and
413
+ * limitations under the License.
414
+ */class Hs{constructor(n,i){this.shortDelay=n,this.longDelay=i,Lc(i>n,"Short delay should be less than long delay!"),this.isMobile=GO()||qO()}get(){return uR()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}/**
415
+ * @license
416
+ * Copyright 2020 Google LLC
417
+ *
418
+ * Licensed under the Apache License, Version 2.0 (the "License");
419
+ * you may not use this file except in compliance with the License.
420
+ * You may obtain a copy of the License at
421
+ *
422
+ * http://www.apache.org/licenses/LICENSE-2.0
423
+ *
424
+ * Unless required by applicable law or agreed to in writing, software
425
+ * distributed under the License is distributed on an "AS IS" BASIS,
426
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
427
+ * See the License for the specific language governing permissions and
428
+ * limitations under the License.
429
+ */function fR(e,n){Lc(e.emulator,"Emulator should always be set here");const{url:i}=e.emulator;return n?`${i}${n.startsWith("/")?n.slice(1):n}`:i}/**
430
+ * @license
431
+ * Copyright 2020 Google LLC
432
+ *
433
+ * Licensed under the Apache License, Version 2.0 (the "License");
434
+ * you may not use this file except in compliance with the License.
435
+ * You may obtain a copy of the License at
436
+ *
437
+ * http://www.apache.org/licenses/LICENSE-2.0
438
+ *
439
+ * Unless required by applicable law or agreed to in writing, software
440
+ * distributed under the License is distributed on an "AS IS" BASIS,
441
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
442
+ * See the License for the specific language governing permissions and
443
+ * limitations under the License.
444
+ */class R0{static initialize(n,i,l){this.fetchImpl=n,i&&(this.headersImpl=i),l&&(this.responseImpl=l)}static fetch(){if(this.fetchImpl)return this.fetchImpl;if(typeof self<"u"&&"fetch"in self)return self.fetch;if(typeof globalThis<"u"&&globalThis.fetch)return globalThis.fetch;if(typeof fetch<"u")return fetch;_s("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){if(this.headersImpl)return this.headersImpl;if(typeof self<"u"&&"Headers"in self)return self.Headers;if(typeof globalThis<"u"&&globalThis.Headers)return globalThis.Headers;if(typeof Headers<"u")return Headers;_s("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){if(this.responseImpl)return this.responseImpl;if(typeof self<"u"&&"Response"in self)return self.Response;if(typeof globalThis<"u"&&globalThis.Response)return globalThis.Response;if(typeof Response<"u")return Response;_s("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}/**
445
+ * @license
446
+ * Copyright 2020 Google LLC
447
+ *
448
+ * Licensed under the Apache License, Version 2.0 (the "License");
449
+ * you may not use this file except in compliance with the License.
450
+ * You may obtain a copy of the License at
451
+ *
452
+ * http://www.apache.org/licenses/LICENSE-2.0
453
+ *
454
+ * Unless required by applicable law or agreed to in writing, software
455
+ * distributed under the License is distributed on an "AS IS" BASIS,
456
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
457
+ * See the License for the specific language governing permissions and
458
+ * limitations under the License.
459
+ */const hR={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"missing-password",INVALID_LOGIN_CREDENTIALS:"invalid-credential",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",PASSWORD_DOES_NOT_MEET_REQUIREMENTS:"password-does-not-meet-requirements",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error",RECAPTCHA_NOT_ENABLED:"recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"invalid-recaptcha-action",MISSING_CLIENT_TYPE:"missing-client-type",MISSING_RECAPTCHA_VERSION:"missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"invalid-recaptcha-version",INVALID_REQ_TYPE:"invalid-req-type"};/**
460
+ * @license
461
+ * Copyright 2020 Google LLC
462
+ *
463
+ * Licensed under the Apache License, Version 2.0 (the "License");
464
+ * you may not use this file except in compliance with the License.
465
+ * You may obtain a copy of the License at
466
+ *
467
+ * http://www.apache.org/licenses/LICENSE-2.0
468
+ *
469
+ * Unless required by applicable law or agreed to in writing, software
470
+ * distributed under the License is distributed on an "AS IS" BASIS,
471
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
472
+ * See the License for the specific language governing permissions and
473
+ * limitations under the License.
474
+ */const pR=["/v1/accounts:signInWithCustomToken","/v1/accounts:signInWithEmailLink","/v1/accounts:signInWithIdp","/v1/accounts:signInWithPassword","/v1/accounts:signInWithPhoneNumber","/v1/token"],mR=new Hs(3e4,6e4);function D0(e,n){return e.tenantId&&!n.tenantId?{...n,tenantId:e.tenantId}:n}async function Kc(e,n,i,l,o={}){return L0(e,o,async()=>{let c={},u={};l&&(n==="GET"?u=l:c={body:JSON.stringify(l)});const f=S0({key:e.config.apiKey,...u}).slice(1),h=await e._getAdditionalHeaders();h["Content-Type"]="application/json",e.languageCode&&(h["X-Firebase-Locale"]=e.languageCode);const p={method:n,headers:h,...c};return $O()||(p.referrerPolicy="no-referrer"),e.emulatorConfig&&E0(e.emulatorConfig.host)&&(p.credentials="include"),R0.fetch()(await I0(e,e.config.apiHost,i,f),p)})}async function L0(e,n,i){e._canInitEmulator=!1;const l={...hR,...n};try{const o=new gR(e),c=await Promise.race([i(),o.promise]);o.clearNetworkTimeout();const u=await c.json();if("needConfirmation"in u)throw bc(e,"account-exists-with-different-credential",u);if(c.ok&&!("errorMessage"in u))return u;{const f=c.ok?u.errorMessage:u.error.message,[h,p]=f.split(" : ");if(h==="FEDERATED_USER_ID_ALREADY_LINKED")throw bc(e,"credential-already-in-use",u);if(h==="EMAIL_EXISTS")throw bc(e,"email-already-in-use",u);if(h==="USER_DISABLED")throw bc(e,"user-disabled",u);const b=l[h]||h.toLowerCase().replace(/[_\s]+/g,"-");if(p)throw M0(e,b,p);rv(e,b)}}catch(o){if(o instanceof ra)throw o;rv(e,"network-request-failed",{message:String(o)})}}async function I0(e,n,i,l){const o=`${n}${i}?${l}`,c=e,u=c.config.emulator?fR(e.config,o):`${e.config.apiScheme}://${o}`;return pR.includes(i)&&(await c._persistenceManagerAvailable,c._getPersistenceType()==="COOKIE")?c._getPersistence()._getFinalTarget(u).toString():u}class gR{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(n){this.auth=n,this.timer=null,this.promise=new Promise((i,l)=>{this.timer=setTimeout(()=>l(O0(this.auth,"network-request-failed")),mR.get())})}}function bc(e,n,i){const l={appName:e.name};i.email&&(l.email=i.email),i.phoneNumber&&(l.phoneNumber=i.phoneNumber);const o=O0(e,n,l);return o.customData._tokenResponse=i,o}/**
475
+ * @license
476
+ * Copyright 2020 Google LLC
477
+ *
478
+ * Licensed under the Apache License, Version 2.0 (the "License");
479
+ * you may not use this file except in compliance with the License.
480
+ * You may obtain a copy of the License at
481
+ *
482
+ * http://www.apache.org/licenses/LICENSE-2.0
483
+ *
484
+ * Unless required by applicable law or agreed to in writing, software
485
+ * distributed under the License is distributed on an "AS IS" BASIS,
486
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
487
+ * See the License for the specific language governing permissions and
488
+ * limitations under the License.
489
+ */async function bR(e,n){return Kc(e,"POST","/v1/accounts:delete",n)}async function Ic(e,n){return Kc(e,"POST","/v1/accounts:lookup",n)}/**
490
+ * @license
491
+ * Copyright 2020 Google LLC
492
+ *
493
+ * Licensed under the Apache License, Version 2.0 (the "License");
494
+ * you may not use this file except in compliance with the License.
495
+ * You may obtain a copy of the License at
496
+ *
497
+ * http://www.apache.org/licenses/LICENSE-2.0
498
+ *
499
+ * Unless required by applicable law or agreed to in writing, software
500
+ * distributed under the License is distributed on an "AS IS" BASIS,
501
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
502
+ * See the License for the specific language governing permissions and
503
+ * limitations under the License.
504
+ */function ks(e){if(e)try{const n=new Date(Number(e));if(!isNaN(n.getTime()))return n.toUTCString()}catch{}}async function yR(e,n=!1){const i=$c(e),l=await i.getIdToken(n),o=z0(l);tt(o&&o.exp&&o.auth_time&&o.iat,i.auth,"internal-error");const c=typeof o.firebase=="object"?o.firebase:void 0,u=c==null?void 0:c.sign_in_provider;return{claims:o,token:l,authTime:ks(Tf(o.auth_time)),issuedAtTime:ks(Tf(o.iat)),expirationTime:ks(Tf(o.exp)),signInProvider:u||null,signInSecondFactor:(c==null?void 0:c.sign_in_second_factor)||null}}function Tf(e){return Number(e)*1e3}function z0(e){const[n,i,l]=e.split(".");if(n===void 0||i===void 0||l===void 0)return Sc("JWT malformed, contained fewer than 3 sections"),null;try{const o=x0(i);return o?JSON.parse(o):(Sc("Failed to decode base64 JWT payload"),null)}catch(o){return Sc("Caught error parsing JWT payload as JSON",o==null?void 0:o.toString()),null}}function av(e){const n=z0(e);return tt(n,"internal-error"),tt(typeof n.exp<"u","internal-error"),tt(typeof n.iat<"u","internal-error"),Number(n.exp)-Number(n.iat)}/**
505
+ * @license
506
+ * Copyright 2020 Google LLC
507
+ *
508
+ * Licensed under the Apache License, Version 2.0 (the "License");
509
+ * you may not use this file except in compliance with the License.
510
+ * You may obtain a copy of the License at
511
+ *
512
+ * http://www.apache.org/licenses/LICENSE-2.0
513
+ *
514
+ * Unless required by applicable law or agreed to in writing, software
515
+ * distributed under the License is distributed on an "AS IS" BASIS,
516
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
517
+ * See the License for the specific language governing permissions and
518
+ * limitations under the License.
519
+ */async function Jf(e,n,i=!1){if(i)return n;try{return await n}catch(l){throw l instanceof ra&&vR(l)&&e.auth.currentUser===e&&await e.auth.signOut(),l}}function vR({code:e}){return e==="auth/user-disabled"||e==="auth/user-token-expired"}/**
520
+ * @license
521
+ * Copyright 2020 Google LLC
522
+ *
523
+ * Licensed under the Apache License, Version 2.0 (the "License");
524
+ * you may not use this file except in compliance with the License.
525
+ * You may obtain a copy of the License at
526
+ *
527
+ * http://www.apache.org/licenses/LICENSE-2.0
528
+ *
529
+ * Unless required by applicable law or agreed to in writing, software
530
+ * distributed under the License is distributed on an "AS IS" BASIS,
531
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
532
+ * See the License for the specific language governing permissions and
533
+ * limitations under the License.
534
+ */class xR{constructor(n){this.user=n,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,this.timerId!==null&&clearTimeout(this.timerId))}getInterval(n){if(n){const i=this.errorBackoff;return this.errorBackoff=Math.min(this.errorBackoff*2,96e4),i}else{this.errorBackoff=3e4;const l=(this.user.stsTokenManager.expirationTime??0)-Date.now()-3e5;return Math.max(0,l)}}schedule(n=!1){if(!this.isRunning)return;const i=this.getInterval(n);this.timerId=setTimeout(async()=>{await this.iteration()},i)}async iteration(){try{await this.user.getIdToken(!0)}catch(n){(n==null?void 0:n.code)==="auth/network-request-failed"&&this.schedule(!0);return}this.schedule()}}/**
535
+ * @license
536
+ * Copyright 2020 Google LLC
537
+ *
538
+ * Licensed under the Apache License, Version 2.0 (the "License");
539
+ * you may not use this file except in compliance with the License.
540
+ * You may obtain a copy of the License at
541
+ *
542
+ * http://www.apache.org/licenses/LICENSE-2.0
543
+ *
544
+ * Unless required by applicable law or agreed to in writing, software
545
+ * distributed under the License is distributed on an "AS IS" BASIS,
546
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
547
+ * See the License for the specific language governing permissions and
548
+ * limitations under the License.
549
+ */class eh{constructor(n,i){this.createdAt=n,this.lastLoginAt=i,this._initializeTime()}_initializeTime(){this.lastSignInTime=ks(this.lastLoginAt),this.creationTime=ks(this.createdAt)}_copy(n){this.createdAt=n.createdAt,this.lastLoginAt=n.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}/**
550
+ * @license
551
+ * Copyright 2019 Google LLC
552
+ *
553
+ * Licensed under the Apache License, Version 2.0 (the "License");
554
+ * you may not use this file except in compliance with the License.
555
+ * You may obtain a copy of the License at
556
+ *
557
+ * http://www.apache.org/licenses/LICENSE-2.0
558
+ *
559
+ * Unless required by applicable law or agreed to in writing, software
560
+ * distributed under the License is distributed on an "AS IS" BASIS,
561
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
562
+ * See the License for the specific language governing permissions and
563
+ * limitations under the License.
564
+ */async function zc(e){var y;const n=e.auth,i=await e.getIdToken(),l=await Jf(e,Ic(n,{idToken:i}));tt(l==null?void 0:l.users.length,n,"internal-error");const o=l.users[0];e._notifyReloadListener(o);const c=(y=o.providerUserInfo)!=null&&y.length?B0(o.providerUserInfo):[],u=SR(e.providerData,c),f=e.isAnonymous,h=!(e.email&&o.passwordHash)&&!(u!=null&&u.length),p=f?h:!1,b={uid:o.localId,displayName:o.displayName||null,photoURL:o.photoUrl||null,email:o.email||null,emailVerified:o.emailVerified||!1,phoneNumber:o.phoneNumber||null,tenantId:o.tenantId||null,providerData:u,metadata:new eh(o.createdAt,o.lastLoginAt),isAnonymous:p};Object.assign(e,b)}async function ER(e){const n=$c(e);await zc(n),await n.auth._persistUserIfCurrent(n),n.auth._notifyListenersIfCurrent(n)}function SR(e,n){return[...e.filter(l=>!n.some(o=>o.providerId===l.providerId)),...n]}function B0(e){return e.map(({providerId:n,...i})=>({providerId:n,uid:i.rawId||"",displayName:i.displayName||null,email:i.email||null,phoneNumber:i.phoneNumber||null,photoURL:i.photoUrl||null}))}/**
565
+ * @license
566
+ * Copyright 2020 Google LLC
567
+ *
568
+ * Licensed under the Apache License, Version 2.0 (the "License");
569
+ * you may not use this file except in compliance with the License.
570
+ * You may obtain a copy of the License at
571
+ *
572
+ * http://www.apache.org/licenses/LICENSE-2.0
573
+ *
574
+ * Unless required by applicable law or agreed to in writing, software
575
+ * distributed under the License is distributed on an "AS IS" BASIS,
576
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
577
+ * See the License for the specific language governing permissions and
578
+ * limitations under the License.
579
+ */async function _R(e,n){const i=await L0(e,{},async()=>{const l=S0({grant_type:"refresh_token",refresh_token:n}).slice(1),{tokenApiHost:o,apiKey:c}=e.config,u=await I0(e,o,"/v1/token",`key=${c}`),f=await e._getAdditionalHeaders();f["Content-Type"]="application/x-www-form-urlencoded";const h={method:"POST",headers:f,body:l};return e.emulatorConfig&&E0(e.emulatorConfig.host)&&(h.credentials="include"),R0.fetch()(u,h)});return{accessToken:i.access_token,expiresIn:i.expires_in,refreshToken:i.refresh_token}}async function kR(e,n){return Kc(e,"POST","/v2/accounts:revokeToken",D0(e,n))}/**
580
+ * @license
581
+ * Copyright 2020 Google LLC
582
+ *
583
+ * Licensed under the Apache License, Version 2.0 (the "License");
584
+ * you may not use this file except in compliance with the License.
585
+ * You may obtain a copy of the License at
586
+ *
587
+ * http://www.apache.org/licenses/LICENSE-2.0
588
+ *
589
+ * Unless required by applicable law or agreed to in writing, software
590
+ * distributed under the License is distributed on an "AS IS" BASIS,
591
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
592
+ * See the License for the specific language governing permissions and
593
+ * limitations under the License.
594
+ */class al{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(n){tt(n.idToken,"internal-error"),tt(typeof n.idToken<"u","internal-error"),tt(typeof n.refreshToken<"u","internal-error");const i="expiresIn"in n&&typeof n.expiresIn<"u"?Number(n.expiresIn):av(n.idToken);this.updateTokensAndExpiration(n.idToken,n.refreshToken,i)}updateFromIdToken(n){tt(n.length!==0,"internal-error");const i=av(n);this.updateTokensAndExpiration(n,null,i)}async getToken(n,i=!1){return!i&&this.accessToken&&!this.isExpired?this.accessToken:(tt(this.refreshToken,n,"user-token-expired"),this.refreshToken?(await this.refresh(n,this.refreshToken),this.accessToken):null)}clearRefreshToken(){this.refreshToken=null}async refresh(n,i){const{accessToken:l,refreshToken:o,expiresIn:c}=await _R(n,i);this.updateTokensAndExpiration(l,o,Number(c))}updateTokensAndExpiration(n,i,l){this.refreshToken=i||null,this.accessToken=n||null,this.expirationTime=Date.now()+l*1e3}static fromJSON(n,i){const{refreshToken:l,accessToken:o,expirationTime:c}=i,u=new al;return l&&(tt(typeof l=="string","internal-error",{appName:n}),u.refreshToken=l),o&&(tt(typeof o=="string","internal-error",{appName:n}),u.accessToken=o),c&&(tt(typeof c=="number","internal-error",{appName:n}),u.expirationTime=c),u}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(n){this.accessToken=n.accessToken,this.refreshToken=n.refreshToken,this.expirationTime=n.expirationTime}_clone(){return Object.assign(new al,this.toJSON())}_performRefresh(){return _s("not implemented")}}/**
595
+ * @license
596
+ * Copyright 2020 Google LLC
597
+ *
598
+ * Licensed under the Apache License, Version 2.0 (the "License");
599
+ * you may not use this file except in compliance with the License.
600
+ * You may obtain a copy of the License at
601
+ *
602
+ * http://www.apache.org/licenses/LICENSE-2.0
603
+ *
604
+ * Unless required by applicable law or agreed to in writing, software
605
+ * distributed under the License is distributed on an "AS IS" BASIS,
606
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
607
+ * See the License for the specific language governing permissions and
608
+ * limitations under the License.
609
+ */function xi(e,n){tt(typeof e=="string"||typeof e>"u","internal-error",{appName:n})}class gr{constructor({uid:n,auth:i,stsTokenManager:l,...o}){this.providerId="firebase",this.proactiveRefresh=new xR(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=n,this.auth=i,this.stsTokenManager=l,this.accessToken=l.accessToken,this.displayName=o.displayName||null,this.email=o.email||null,this.emailVerified=o.emailVerified||!1,this.phoneNumber=o.phoneNumber||null,this.photoURL=o.photoURL||null,this.isAnonymous=o.isAnonymous||!1,this.tenantId=o.tenantId||null,this.providerData=o.providerData?[...o.providerData]:[],this.metadata=new eh(o.createdAt||void 0,o.lastLoginAt||void 0)}async getIdToken(n){const i=await Jf(this,this.stsTokenManager.getToken(this.auth,n));return tt(i,this.auth,"internal-error"),this.accessToken!==i&&(this.accessToken=i,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),i}getIdTokenResult(n){return yR(this,n)}reload(){return ER(this)}_assign(n){this!==n&&(tt(this.uid===n.uid,this.auth,"internal-error"),this.displayName=n.displayName,this.photoURL=n.photoURL,this.email=n.email,this.emailVerified=n.emailVerified,this.phoneNumber=n.phoneNumber,this.isAnonymous=n.isAnonymous,this.tenantId=n.tenantId,this.providerData=n.providerData.map(i=>({...i})),this.metadata._copy(n.metadata),this.stsTokenManager._assign(n.stsTokenManager))}_clone(n){const i=new gr({...this,auth:n,stsTokenManager:this.stsTokenManager._clone()});return i.metadata._copy(this.metadata),i}_onReload(n){tt(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=n,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(n){this.reloadListener?this.reloadListener(n):this.reloadUserInfo=n}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(n,i=!1){let l=!1;n.idToken&&n.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(n),l=!0),i&&await zc(this),await this.auth._persistUserIfCurrent(this),l&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(Wa(this.auth.app))return Promise.reject(_c(this.auth));const n=await this.getIdToken();return await Jf(this,bR(this.auth,{idToken:n})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return{uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(n=>({...n})),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId,...this.metadata.toJSON(),apiKey:this.auth.config.apiKey,appName:this.auth.name}}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(n,i){const l=i.displayName??void 0,o=i.email??void 0,c=i.phoneNumber??void 0,u=i.photoURL??void 0,f=i.tenantId??void 0,h=i._redirectEventId??void 0,p=i.createdAt??void 0,b=i.lastLoginAt??void 0,{uid:y,emailVerified:E,isAnonymous:v,providerData:_,stsTokenManager:N}=i;tt(y&&N,n,"internal-error");const T=al.fromJSON(this.name,N);tt(typeof y=="string",n,"internal-error"),xi(l,n.name),xi(o,n.name),tt(typeof E=="boolean",n,"internal-error"),tt(typeof v=="boolean",n,"internal-error"),xi(c,n.name),xi(u,n.name),xi(f,n.name),xi(h,n.name),xi(p,n.name),xi(b,n.name);const S=new gr({uid:y,auth:n,email:o,emailVerified:E,displayName:l,isAnonymous:v,photoURL:u,phoneNumber:c,tenantId:f,stsTokenManager:T,createdAt:p,lastLoginAt:b});return _&&Array.isArray(_)&&(S.providerData=_.map(D=>({...D}))),h&&(S._redirectEventId=h),S}static async _fromIdTokenResponse(n,i,l=!1){const o=new al;o.updateFromServerResponse(i);const c=new gr({uid:i.localId,auth:n,stsTokenManager:o,isAnonymous:l});return await zc(c),c}static async _fromGetAccountInfoResponse(n,i,l){const o=i.users[0];tt(o.localId!==void 0,"internal-error");const c=o.providerUserInfo!==void 0?B0(o.providerUserInfo):[],u=!(o.email&&o.passwordHash)&&!(c!=null&&c.length),f=new al;f.updateFromIdToken(l);const h=new gr({uid:o.localId,auth:n,stsTokenManager:f,isAnonymous:u}),p={uid:o.localId,displayName:o.displayName||null,photoURL:o.photoUrl||null,email:o.email||null,emailVerified:o.emailVerified||!1,phoneNumber:o.phoneNumber||null,tenantId:o.tenantId||null,providerData:c,metadata:new eh(o.createdAt,o.lastLoginAt),isAnonymous:!(o.email&&o.passwordHash)&&!(c!=null&&c.length)};return Object.assign(h,p),h}}/**
610
+ * @license
611
+ * Copyright 2020 Google LLC
612
+ *
613
+ * Licensed under the Apache License, Version 2.0 (the "License");
614
+ * you may not use this file except in compliance with the License.
615
+ * You may obtain a copy of the License at
616
+ *
617
+ * http://www.apache.org/licenses/LICENSE-2.0
618
+ *
619
+ * Unless required by applicable law or agreed to in writing, software
620
+ * distributed under the License is distributed on an "AS IS" BASIS,
621
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
622
+ * See the License for the specific language governing permissions and
623
+ * limitations under the License.
624
+ */const lv=new Map;function Zi(e){Lc(e instanceof Function,"Expected a class definition");let n=lv.get(e);return n?(Lc(n instanceof e,"Instance stored in cache mismatched with class"),n):(n=new e,lv.set(e,n),n)}/**
625
+ * @license
626
+ * Copyright 2019 Google LLC
627
+ *
628
+ * Licensed under the Apache License, Version 2.0 (the "License");
629
+ * you may not use this file except in compliance with the License.
630
+ * You may obtain a copy of the License at
631
+ *
632
+ * http://www.apache.org/licenses/LICENSE-2.0
633
+ *
634
+ * Unless required by applicable law or agreed to in writing, software
635
+ * distributed under the License is distributed on an "AS IS" BASIS,
636
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
637
+ * See the License for the specific language governing permissions and
638
+ * limitations under the License.
639
+ */class U0{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(n,i){this.storage[n]=i}async _get(n){const i=this.storage[n];return i===void 0?null:i}async _remove(n){delete this.storage[n]}_addListener(n,i){}_removeListener(n,i){}}U0.type="NONE";const sv=U0;/**
640
+ * @license
641
+ * Copyright 2019 Google LLC
642
+ *
643
+ * Licensed under the Apache License, Version 2.0 (the "License");
644
+ * you may not use this file except in compliance with the License.
645
+ * You may obtain a copy of the License at
646
+ *
647
+ * http://www.apache.org/licenses/LICENSE-2.0
648
+ *
649
+ * Unless required by applicable law or agreed to in writing, software
650
+ * distributed under the License is distributed on an "AS IS" BASIS,
651
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
652
+ * See the License for the specific language governing permissions and
653
+ * limitations under the License.
654
+ */function Cf(e,n,i){return`firebase:${e}:${n}:${i}`}class ll{constructor(n,i,l){this.persistence=n,this.auth=i,this.userKey=l;const{config:o,name:c}=this.auth;this.fullUserKey=Cf(this.userKey,o.apiKey,c),this.fullPersistenceKey=Cf("persistence",o.apiKey,c),this.boundEventHandler=i._onStorageEvent.bind(i),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(n){return this.persistence._set(this.fullUserKey,n.toJSON())}async getCurrentUser(){const n=await this.persistence._get(this.fullUserKey);if(!n)return null;if(typeof n=="string"){const i=await Ic(this.auth,{idToken:n}).catch(()=>{});return i?gr._fromGetAccountInfoResponse(this.auth,i,n):null}return gr._fromJSON(this.auth,n)}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(n){if(this.persistence===n)return;const i=await this.getCurrentUser();if(await this.removeCurrentUser(),this.persistence=n,i)return this.setCurrentUser(i)}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(n,i,l="authUser"){if(!i.length)return new ll(Zi(sv),n,l);const o=(await Promise.all(i.map(async p=>{if(await p._isAvailable())return p}))).filter(p=>p);let c=o[0]||Zi(sv);const u=Cf(l,n.config.apiKey,n.name);let f=null;for(const p of i)try{const b=await p._get(u);if(b){let y;if(typeof b=="string"){const E=await Ic(n,{idToken:b}).catch(()=>{});if(!E)break;y=await gr._fromGetAccountInfoResponse(n,E,b)}else y=gr._fromJSON(n,b);p!==c&&(f=y),c=p;break}}catch{}const h=o.filter(p=>p._shouldAllowMigration);return!c._shouldAllowMigration||!h.length?new ll(c,n,l):(c=h[0],f&&await c._set(u,f.toJSON()),await Promise.all(i.map(async p=>{if(p!==c)try{await p._remove(u)}catch{}})),new ll(c,n,l))}}/**
655
+ * @license
656
+ * Copyright 2020 Google LLC
657
+ *
658
+ * Licensed under the Apache License, Version 2.0 (the "License");
659
+ * you may not use this file except in compliance with the License.
660
+ * You may obtain a copy of the License at
661
+ *
662
+ * http://www.apache.org/licenses/LICENSE-2.0
663
+ *
664
+ * Unless required by applicable law or agreed to in writing, software
665
+ * distributed under the License is distributed on an "AS IS" BASIS,
666
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
667
+ * See the License for the specific language governing permissions and
668
+ * limitations under the License.
669
+ */function ov(e){const n=e.toLowerCase();if(n.includes("opera/")||n.includes("opr/")||n.includes("opios/"))return"Opera";if(CR(n))return"IEMobile";if(n.includes("msie")||n.includes("trident/"))return"IE";if(n.includes("edge/"))return"Edge";if(wR(n))return"Firefox";if(n.includes("silk/"))return"Silk";if(OR(n))return"Blackberry";if(MR(n))return"Webos";if(NR(n))return"Safari";if((n.includes("chrome/")||TR(n))&&!n.includes("edge/"))return"Chrome";if(AR(n))return"Android";{const i=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,l=e.match(i);if((l==null?void 0:l.length)===2)return l[1]}return"Other"}function wR(e=br()){return/firefox\//i.test(e)}function NR(e=br()){const n=e.toLowerCase();return n.includes("safari/")&&!n.includes("chrome/")&&!n.includes("crios/")&&!n.includes("android")}function TR(e=br()){return/crios\//i.test(e)}function CR(e=br()){return/iemobile/i.test(e)}function AR(e=br()){return/android/i.test(e)}function OR(e=br()){return/blackberry/i.test(e)}function MR(e=br()){return/webos/i.test(e)}/**
670
+ * @license
671
+ * Copyright 2020 Google LLC
672
+ *
673
+ * Licensed under the Apache License, Version 2.0 (the "License");
674
+ * you may not use this file except in compliance with the License.
675
+ * You may obtain a copy of the License at
676
+ *
677
+ * http://www.apache.org/licenses/LICENSE-2.0
678
+ *
679
+ * Unless required by applicable law or agreed to in writing, software
680
+ * distributed under the License is distributed on an "AS IS" BASIS,
681
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
682
+ * See the License for the specific language governing permissions and
683
+ * limitations under the License.
684
+ */function j0(e,n=[]){let i;switch(e){case"Browser":i=ov(br());break;case"Worker":i=`${ov(br())}-${e}`;break;default:i=e}const l=n.length?n.join(","):"FirebaseCore-web";return`${i}/JsCore/${Mh}/${l}`}/**
685
+ * @license
686
+ * Copyright 2022 Google LLC
687
+ *
688
+ * Licensed under the Apache License, Version 2.0 (the "License");
689
+ * you may not use this file except in compliance with the License.
690
+ * You may obtain a copy of the License at
691
+ *
692
+ * http://www.apache.org/licenses/LICENSE-2.0
693
+ *
694
+ * Unless required by applicable law or agreed to in writing, software
695
+ * distributed under the License is distributed on an "AS IS" BASIS,
696
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
697
+ * See the License for the specific language governing permissions and
698
+ * limitations under the License.
699
+ */class RR{constructor(n){this.auth=n,this.queue=[]}pushCallback(n,i){const l=c=>new Promise((u,f)=>{try{const h=n(c);u(h)}catch(h){f(h)}});l.onAbort=i,this.queue.push(l);const o=this.queue.length-1;return()=>{this.queue[o]=()=>Promise.resolve()}}async runMiddleware(n){if(this.auth.currentUser===n)return;const i=[];try{for(const l of this.queue)await l(n),l.onAbort&&i.push(l.onAbort)}catch(l){i.reverse();for(const o of i)try{o()}catch{}throw this.auth._errorFactory.create("login-blocked",{originalMessage:l==null?void 0:l.message})}}}/**
700
+ * @license
701
+ * Copyright 2023 Google LLC
702
+ *
703
+ * Licensed under the Apache License, Version 2.0 (the "License");
704
+ * you may not use this file except in compliance with the License.
705
+ * You may obtain a copy of the License at
706
+ *
707
+ * http://www.apache.org/licenses/LICENSE-2.0
708
+ *
709
+ * Unless required by applicable law or agreed to in writing, software
710
+ * distributed under the License is distributed on an "AS IS" BASIS,
711
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
712
+ * See the License for the specific language governing permissions and
713
+ * limitations under the License.
714
+ */async function DR(e,n={}){return Kc(e,"GET","/v2/passwordPolicy",D0(e,n))}/**
715
+ * @license
716
+ * Copyright 2023 Google LLC
717
+ *
718
+ * Licensed under the Apache License, Version 2.0 (the "License");
719
+ * you may not use this file except in compliance with the License.
720
+ * You may obtain a copy of the License at
721
+ *
722
+ * http://www.apache.org/licenses/LICENSE-2.0
723
+ *
724
+ * Unless required by applicable law or agreed to in writing, software
725
+ * distributed under the License is distributed on an "AS IS" BASIS,
726
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
727
+ * See the License for the specific language governing permissions and
728
+ * limitations under the License.
729
+ */const LR=6;class IR{constructor(n){var l;const i=n.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=i.minPasswordLength??LR,i.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=i.maxPasswordLength),i.containsLowercaseCharacter!==void 0&&(this.customStrengthOptions.containsLowercaseLetter=i.containsLowercaseCharacter),i.containsUppercaseCharacter!==void 0&&(this.customStrengthOptions.containsUppercaseLetter=i.containsUppercaseCharacter),i.containsNumericCharacter!==void 0&&(this.customStrengthOptions.containsNumericCharacter=i.containsNumericCharacter),i.containsNonAlphanumericCharacter!==void 0&&(this.customStrengthOptions.containsNonAlphanumericCharacter=i.containsNonAlphanumericCharacter),this.enforcementState=n.enforcementState,this.enforcementState==="ENFORCEMENT_STATE_UNSPECIFIED"&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=((l=n.allowedNonAlphanumericCharacters)==null?void 0:l.join(""))??"",this.forceUpgradeOnSignin=n.forceUpgradeOnSignin??!1,this.schemaVersion=n.schemaVersion}validatePassword(n){const i={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(n,i),this.validatePasswordCharacterOptions(n,i),i.isValid&&(i.isValid=i.meetsMinPasswordLength??!0),i.isValid&&(i.isValid=i.meetsMaxPasswordLength??!0),i.isValid&&(i.isValid=i.containsLowercaseLetter??!0),i.isValid&&(i.isValid=i.containsUppercaseLetter??!0),i.isValid&&(i.isValid=i.containsNumericCharacter??!0),i.isValid&&(i.isValid=i.containsNonAlphanumericCharacter??!0),i}validatePasswordLengthOptions(n,i){const l=this.customStrengthOptions.minPasswordLength,o=this.customStrengthOptions.maxPasswordLength;l&&(i.meetsMinPasswordLength=n.length>=l),o&&(i.meetsMaxPasswordLength=n.length<=o)}validatePasswordCharacterOptions(n,i){this.updatePasswordCharacterOptionsStatuses(i,!1,!1,!1,!1);let l;for(let o=0;o<n.length;o++)l=n.charAt(o),this.updatePasswordCharacterOptionsStatuses(i,l>="a"&&l<="z",l>="A"&&l<="Z",l>="0"&&l<="9",this.allowedNonAlphanumericCharacters.includes(l))}updatePasswordCharacterOptionsStatuses(n,i,l,o,c){this.customStrengthOptions.containsLowercaseLetter&&(n.containsLowercaseLetter||(n.containsLowercaseLetter=i)),this.customStrengthOptions.containsUppercaseLetter&&(n.containsUppercaseLetter||(n.containsUppercaseLetter=l)),this.customStrengthOptions.containsNumericCharacter&&(n.containsNumericCharacter||(n.containsNumericCharacter=o)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(n.containsNonAlphanumericCharacter||(n.containsNonAlphanumericCharacter=c))}}/**
730
+ * @license
731
+ * Copyright 2020 Google LLC
732
+ *
733
+ * Licensed under the Apache License, Version 2.0 (the "License");
734
+ * you may not use this file except in compliance with the License.
735
+ * You may obtain a copy of the License at
736
+ *
737
+ * http://www.apache.org/licenses/LICENSE-2.0
738
+ *
739
+ * Unless required by applicable law or agreed to in writing, software
740
+ * distributed under the License is distributed on an "AS IS" BASIS,
741
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
742
+ * See the License for the specific language governing permissions and
743
+ * limitations under the License.
744
+ */class zR{constructor(n,i,l,o){this.app=n,this.heartbeatServiceProvider=i,this.appCheckServiceProvider=l,this.config=o,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new cv(this),this.idTokenSubscription=new cv(this),this.beforeStateQueue=new RR(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=A0,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this._resolvePersistenceManagerAvailable=void 0,this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=n.name,this.clientVersion=o.sdkClientVersion,this._persistenceManagerAvailable=new Promise(c=>this._resolvePersistenceManagerAvailable=c)}_initializeWithPersistence(n,i){return i&&(this._popupRedirectResolver=Zi(i)),this._initializationPromise=this.queue(async()=>{var l,o,c;if(!this._deleted&&(this.persistenceManager=await ll.create(this,n),(l=this._resolvePersistenceManagerAvailable)==null||l.call(this),!this._deleted)){if((o=this._popupRedirectResolver)!=null&&o._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch{}await this.initializeCurrentUser(i),this.lastNotifiedUid=((c=this.currentUser)==null?void 0:c.uid)||null,!this._deleted&&(this._isInitialized=!0)}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const n=await this.assertedPersistence.getCurrentUser();if(!(!this.currentUser&&!n)){if(this.currentUser&&n&&this.currentUser.uid===n.uid){this._currentUser._assign(n),await this.currentUser.getIdToken();return}await this._updateCurrentUser(n,!0)}}async initializeCurrentUserFromIdToken(n){try{const i=await Ic(this,{idToken:n}),l=await gr._fromGetAccountInfoResponse(this,i,n);await this.directlySetCurrentUser(l)}catch(i){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",i),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(n){var c;if(Wa(this.app)){const u=this.app.settings.authIdToken;return u?new Promise(f=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(u).then(f,f))}):this.directlySetCurrentUser(null)}const i=await this.assertedPersistence.getCurrentUser();let l=i,o=!1;if(n&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const u=(c=this.redirectUser)==null?void 0:c._redirectEventId,f=l==null?void 0:l._redirectEventId,h=await this.tryRedirectSignIn(n);(!u||u===f)&&(h!=null&&h.user)&&(l=h.user,o=!0)}if(!l)return this.directlySetCurrentUser(null);if(!l._redirectEventId){if(o)try{await this.beforeStateQueue.runMiddleware(l)}catch(u){l=i,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(u))}return l?this.reloadAndSetCurrentUserOrClear(l):this.directlySetCurrentUser(null)}return tt(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===l._redirectEventId?this.directlySetCurrentUser(l):this.reloadAndSetCurrentUserOrClear(l)}async tryRedirectSignIn(n){let i=null;try{i=await this._popupRedirectResolver._completeRedirectFn(this,n,!0)}catch{await this._setRedirectUser(null)}return i}async reloadAndSetCurrentUserOrClear(n){try{await zc(n)}catch(i){if((i==null?void 0:i.code)!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(n)}useDeviceLanguage(){this.languageCode=dR()}async _delete(){this._deleted=!0}async updateCurrentUser(n){if(Wa(this.app))return Promise.reject(_c(this));const i=n?$c(n):null;return i&&tt(i.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(i&&i._clone(this))}async _updateCurrentUser(n,i=!1){if(!this._deleted)return n&&tt(this.tenantId===n.tenantId,this,"tenant-id-mismatch"),i||await this.beforeStateQueue.runMiddleware(n),this.queue(async()=>{await this.directlySetCurrentUser(n),this.notifyAuthListeners()})}async signOut(){return Wa(this.app)?Promise.reject(_c(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(n){return Wa(this.app)?Promise.reject(_c(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(Zi(n))})}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(n){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const i=this._getPasswordPolicyInternal();return i.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):i.validatePassword(n)}_getPasswordPolicyInternal(){return this.tenantId===null?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const n=await DR(this),i=new IR(n);this.tenantId===null?this._projectPasswordPolicy=i:this._tenantPasswordPolicies[this.tenantId]=i}_getPersistenceType(){return this.assertedPersistence.persistence.type}_getPersistence(){return this.assertedPersistence.persistence}_updateErrorMap(n){this._errorFactory=new js("auth","Firebase",n())}onAuthStateChanged(n,i,l){return this.registerStateListener(this.authStateSubscription,n,i,l)}beforeAuthStateChanged(n,i){return this.beforeStateQueue.pushCallback(n,i)}onIdTokenChanged(n,i,l){return this.registerStateListener(this.idTokenSubscription,n,i,l)}authStateReady(){return new Promise((n,i)=>{if(this.currentUser)n();else{const l=this.onAuthStateChanged(()=>{l(),n()},i)}})}async revokeAccessToken(n){if(this.currentUser){const i=await this.currentUser.getIdToken(),l={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:n,idToken:i};this.tenantId!=null&&(l.tenantId=this.tenantId),await kR(this,l)}}toJSON(){var n;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:(n=this._currentUser)==null?void 0:n.toJSON()}}async _setRedirectUser(n,i){const l=await this.getOrInitRedirectPersistenceManager(i);return n===null?l.removeCurrentUser():l.setCurrentUser(n)}async getOrInitRedirectPersistenceManager(n){if(!this.redirectPersistenceManager){const i=n&&Zi(n)||this._popupRedirectResolver;tt(i,this,"argument-error"),this.redirectPersistenceManager=await ll.create(this,[Zi(i._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(n){var i,l;return this._isInitialized&&await this.queue(async()=>{}),((i=this._currentUser)==null?void 0:i._redirectEventId)===n?this._currentUser:((l=this.redirectUser)==null?void 0:l._redirectEventId)===n?this.redirectUser:null}async _persistUserIfCurrent(n){if(n===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(n))}_notifyListenersIfCurrent(n){n===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var i;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const n=((i=this.currentUser)==null?void 0:i.uid)??null;this.lastNotifiedUid!==n&&(this.lastNotifiedUid=n,this.authStateSubscription.next(this.currentUser))}registerStateListener(n,i,l,o){if(this._deleted)return()=>{};const c=typeof i=="function"?i:i.next.bind(i);let u=!1;const f=this._isInitialized?Promise.resolve():this._initializationPromise;if(tt(f,this,"internal-error"),f.then(()=>{u||c(this.currentUser)}),typeof i=="function"){const h=n.addObserver(i,l,o);return()=>{u=!0,h()}}else{const h=n.addObserver(i);return()=>{u=!0,h()}}}async directlySetCurrentUser(n){this.currentUser&&this.currentUser!==n&&this._currentUser._stopProactiveRefresh(),n&&this.isProactiveRefreshEnabled&&n._startProactiveRefresh(),this.currentUser=n,n?await this.assertedPersistence.setCurrentUser(n):await this.assertedPersistence.removeCurrentUser()}queue(n){return this.operations=this.operations.then(n,n),this.operations}get assertedPersistence(){return tt(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(n){!n||this.frameworks.includes(n)||(this.frameworks.push(n),this.frameworks.sort(),this.clientVersion=j0(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var o;const n={"X-Client-Version":this.clientVersion};this.app.options.appId&&(n["X-Firebase-gmpid"]=this.app.options.appId);const i=await((o=this.heartbeatServiceProvider.getImmediate({optional:!0}))==null?void 0:o.getHeartbeatsHeader());i&&(n["X-Firebase-Client"]=i);const l=await this._getAppCheckToken();return l&&(n["X-Firebase-AppCheck"]=l),n}async _getAppCheckToken(){var i;if(Wa(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;const n=await((i=this.appCheckServiceProvider.getImmediate({optional:!0}))==null?void 0:i.getToken());return n!=null&&n.error&&oR(`Error while retrieving App Check token: ${n.error}`),n==null?void 0:n.token}}function BR(e){return $c(e)}class cv{constructor(n){this.auth=n,this.observer=null,this.addObserver=WO(i=>this.observer=i)}get next(){return tt(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}function UR(e,n){const i=(n==null?void 0:n.persistence)||[],l=(Array.isArray(i)?i:[i]).map(Zi);n!=null&&n.errorMap&&e._updateErrorMap(n.errorMap),e._initializeWithPersistence(l,n==null?void 0:n.popupRedirectResolver)}new Hs(3e4,6e4);/**
745
+ * @license
746
+ * Copyright 2020 Google LLC
747
+ *
748
+ * Licensed under the Apache License, Version 2.0 (the "License");
749
+ * you may not use this file except in compliance with the License.
750
+ * You may obtain a copy of the License at
751
+ *
752
+ * http://www.apache.org/licenses/LICENSE-2.0
753
+ *
754
+ * Unless required by applicable law or agreed to in writing, software
755
+ * distributed under the License is distributed on an "AS IS" BASIS,
756
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
757
+ * See the License for the specific language governing permissions and
758
+ * limitations under the License.
759
+ */new Hs(2e3,1e4);/**
760
+ * @license
761
+ * Copyright 2020 Google LLC.
762
+ *
763
+ * Licensed under the Apache License, Version 2.0 (the "License");
764
+ * you may not use this file except in compliance with the License.
765
+ * You may obtain a copy of the License at
766
+ *
767
+ * http://www.apache.org/licenses/LICENSE-2.0
768
+ *
769
+ * Unless required by applicable law or agreed to in writing, software
770
+ * distributed under the License is distributed on an "AS IS" BASIS,
771
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
772
+ * See the License for the specific language governing permissions and
773
+ * limitations under the License.
774
+ */new Hs(3e4,6e4);/**
775
+ * @license
776
+ * Copyright 2020 Google LLC.
777
+ *
778
+ * Licensed under the Apache License, Version 2.0 (the "License");
779
+ * you may not use this file except in compliance with the License.
780
+ * You may obtain a copy of the License at
781
+ *
782
+ * http://www.apache.org/licenses/LICENSE-2.0
783
+ *
784
+ * Unless required by applicable law or agreed to in writing, software
785
+ * distributed under the License is distributed on an "AS IS" BASIS,
786
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
787
+ * See the License for the specific language governing permissions and
788
+ * limitations under the License.
789
+ */new Hs(5e3,15e3);var uv="@firebase/auth",dv="1.12.0";/**
790
+ * @license
791
+ * Copyright 2020 Google LLC
792
+ *
793
+ * Licensed under the Apache License, Version 2.0 (the "License");
794
+ * you may not use this file except in compliance with the License.
795
+ * You may obtain a copy of the License at
796
+ *
797
+ * http://www.apache.org/licenses/LICENSE-2.0
798
+ *
799
+ * Unless required by applicable law or agreed to in writing, software
800
+ * distributed under the License is distributed on an "AS IS" BASIS,
801
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
802
+ * See the License for the specific language governing permissions and
803
+ * limitations under the License.
804
+ */class jR{constructor(n){this.auth=n,this.internalListeners=new Map}getUid(){var n;return this.assertAuthConfigured(),((n=this.auth.currentUser)==null?void 0:n.uid)||null}async getToken(n){return this.assertAuthConfigured(),await this.auth._initializationPromise,this.auth.currentUser?{accessToken:await this.auth.currentUser.getIdToken(n)}:null}addAuthTokenListener(n){if(this.assertAuthConfigured(),this.internalListeners.has(n))return;const i=this.auth.onIdTokenChanged(l=>{n((l==null?void 0:l.stsTokenManager.accessToken)||null)});this.internalListeners.set(n,i),this.updateProactiveRefresh()}removeAuthTokenListener(n){this.assertAuthConfigured();const i=this.internalListeners.get(n);i&&(this.internalListeners.delete(n),i(),this.updateProactiveRefresh())}assertAuthConfigured(){tt(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}/**
805
+ * @license
806
+ * Copyright 2020 Google LLC
807
+ *
808
+ * Licensed under the Apache License, Version 2.0 (the "License");
809
+ * you may not use this file except in compliance with the License.
810
+ * You may obtain a copy of the License at
811
+ *
812
+ * http://www.apache.org/licenses/LICENSE-2.0
813
+ *
814
+ * Unless required by applicable law or agreed to in writing, software
815
+ * distributed under the License is distributed on an "AS IS" BASIS,
816
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
817
+ * See the License for the specific language governing permissions and
818
+ * limitations under the License.
819
+ */function HR(e){switch(e){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}function PR(e){Ms(new Os("auth",(n,{options:i})=>{const l=n.getProvider("app").getImmediate(),o=n.getProvider("heartbeat"),c=n.getProvider("app-check-internal"),{apiKey:u,authDomain:f}=l.options;tt(u&&!u.includes(":"),"invalid-api-key",{appName:l.name});const h={apiKey:u,authDomain:f,clientPlatform:e,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:j0(e)},p=new zR(l,o,c,h);return UR(p,i),p},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((n,i,l)=>{n.getProvider("auth-internal").initialize()})),Ms(new Os("auth-internal",n=>{const i=BR(n.getProvider("auth").getImmediate());return(l=>new jR(l))(i)},"PRIVATE").setInstantiationMode("EXPLICIT")),il(uv,dv,HR(e)),il(uv,dv,"esm2020")}/**
820
+ * @license
821
+ * Copyright 2021 Google LLC
822
+ *
823
+ * Licensed under the Apache License, Version 2.0 (the "License");
824
+ * you may not use this file except in compliance with the License.
825
+ * You may obtain a copy of the License at
826
+ *
827
+ * http://www.apache.org/licenses/LICENSE-2.0
828
+ *
829
+ * Unless required by applicable law or agreed to in writing, software
830
+ * distributed under the License is distributed on an "AS IS" BASIS,
831
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
832
+ * See the License for the specific language governing permissions and
833
+ * limitations under the License.
834
+ */const FR=300;FO("authIdTokenMaxAge");PR("Browser");function GR(){return!1}function $R(){const e=Fr(),[n,i]=U.useState(!1),[l,o]=U.useState(""),[c,u]=U.useState(""),[f,h]=U.useState(""),[p,b]=U.useState(""),[y,E]=U.useState(!1),[v,_]=U.useState(null),[N,T]=U.useState(null),S=GR(),D=y||!!v;U.useEffect(()=>{xc.config().then(T).catch(()=>{T({emailEnabled:!0,googleEnabled:S,githubEnabled:S})})},[S]);const M=(N==null?void 0:N.emailEnabled)??!0,A=L=>{Ls(L.token),L.refreshToken&&Bc(L.refreshToken),e({type:"SET_USER",user:{id:L.id,email:L.email,displayName:L.displayName}})},F=async L=>{L.preventDefault(),b(""),E(!0);try{let X;n?(ce.info("Auth",`Registering new account: ${l}`),X=await xc.register(l,c,f||void 0)):(ce.info("Auth",`Logging in: ${l}`),X=await xc.login(l,c)),ce.info("Auth",`${n?"Register":"Login"} success — user ${X.id} (${X.email})`),A(X)}catch(X){const re=X instanceof Error?X.message:"Something went wrong";ce.error("Auth",`${n?"Register":"Login"} failed: ${re}`),b(re)}finally{E(!1)}};return g.jsx("div",{className:"min-h-screen flex items-center justify-center",style:{background:"var(--bg-secondary)"},children:g.jsxs("div",{className:"w-full max-w-md",children:[g.jsxs("div",{className:"text-center mb-8",children:[g.jsx("img",{src:"/botschat-logo.png",alt:"BotsChat",className:"inline-block w-16 h-16 mb-4"}),g.jsx("h1",{className:"text-3xl font-bold",style:{color:"var(--text-primary)"},children:"BotsChat"}),g.jsx("p",{className:"mt-2",style:{color:"var(--text-secondary)"},children:"Multi-channel AI chat powered by OpenClaw"})]}),g.jsxs("div",{className:"rounded-md p-8",style:{background:"var(--bg-surface)",boxShadow:"var(--shadow-lg)"},children:[g.jsx("h2",{className:"text-h1 mb-6",style:{color:"var(--text-primary)"},children:M&&n?"Create account":"Sign in"}),S,p&&g.jsx("div",{className:"text-caption px-3 py-2 rounded-sm mt-4",style:{background:"rgba(224,30,90,0.1)",color:"var(--accent-red)"},children:p}),M&&g.jsxs(g.Fragment,{children:[g.jsxs("form",{onSubmit:F,className:"space-y-4",children:[n&&g.jsxs("div",{children:[g.jsx("label",{className:"block text-caption font-bold mb-1",style:{color:"var(--text-secondary)"},children:"Display Name"}),g.jsx("input",{type:"text",value:f,onChange:L=>h(L.target.value),className:"w-full px-3 py-2.5 text-body rounded-sm focus:outline-none placeholder:text-[--text-muted]",style:{background:"var(--bg-surface)",color:"var(--text-primary)",border:"1px solid var(--border)"},placeholder:"Your name"})]}),g.jsxs("div",{children:[g.jsx("label",{className:"block text-caption font-bold mb-1",style:{color:"var(--text-secondary)"},children:"Email"}),g.jsx("input",{type:"email",value:l,onChange:L=>o(L.target.value),required:!0,className:"w-full px-3 py-2.5 text-body rounded-sm focus:outline-none placeholder:text-[--text-muted]",style:{background:"var(--bg-surface)",color:"var(--text-primary)",border:"1px solid var(--border)"},placeholder:"you@example.com"})]}),g.jsxs("div",{children:[g.jsx("label",{className:"block text-caption font-bold mb-1",style:{color:"var(--text-secondary)"},children:"Password"}),g.jsx("input",{type:"password",value:c,onChange:L=>u(L.target.value),required:!0,className:"w-full px-3 py-2.5 text-body rounded-sm focus:outline-none placeholder:text-[--text-muted]",style:{background:"var(--bg-surface)",color:"var(--text-primary)",border:"1px solid var(--border)"},placeholder:"Enter password"})]}),g.jsx("button",{type:"submit",disabled:D,className:"w-full py-2.5 font-bold text-body text-white rounded-sm disabled:opacity-50 transition-colors hover:brightness-110",style:{background:"var(--bg-active)"},children:y?"...":n?"Create account":"Sign in with email"})]}),g.jsx("div",{className:"mt-6 text-center",children:g.jsx("button",{onClick:()=>{i(!n),b("")},className:"text-caption hover:underline",style:{color:"var(--text-link)"},children:n?"Already have an account? Sign in":"Don't have an account? Register"})})]})]})]})})}function KR({text:e}){const[n,i]=U.useState(!1),l=async()=>{try{await navigator.clipboard.writeText(e),i(!0),setTimeout(()=>i(!1),2e3)}catch{const o=document.createElement("textarea");o.value=e,document.body.appendChild(o),o.select(),document.execCommand("copy"),document.body.removeChild(o),i(!0),setTimeout(()=>i(!1),2e3)}};return g.jsx("button",{onClick:l,className:"shrink-0 px-2.5 py-1 text-tiny font-medium rounded-sm transition-colors",style:{background:n?"var(--accent-green)":"var(--bg-hover)",color:n?"#fff":"var(--text-secondary)"},children:n?"Copied!":"Copy"})}function yc({code:e,multiline:n}){return g.jsxs("div",{className:"flex items-start gap-2 rounded-md px-3 py-2.5",style:{background:"var(--code-bg)",border:"1px solid var(--border)"},children:[g.jsx("pre",{className:"flex-1 text-caption font-mono overflow-x-auto whitespace-pre-wrap break-all",style:{color:"var(--text-primary)"},children:e}),g.jsx(KR,{text:e})]})}function qR({color:e}){return g.jsxs("span",{className:"relative flex h-3 w-3",children:[g.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full opacity-75",style:{backgroundColor:e}}),g.jsx("span",{className:"relative inline-flex rounded-full h-3 w-3",style:{backgroundColor:e}})]})}function VR({onSkip:e}){const n=nr(),[i,l]=U.useState(null),[o,c]=U.useState(!0),[u,f]=U.useState(typeof window<"u"?window.location.origin:"https://console.botschat.app"),[h,p]=U.useState(!1),[b,y]=U.useState(),[E,v]=U.useState(!1);U.useEffect(()=>{let T=!1;async function S(){try{const D=await Lv.cloudUrl();if(T)return;f(D.cloudUrl),p(D.isLoopback),y(D.hint)}catch(D){ce.warn("Onboarding",`Failed to fetch cloudUrl, using origin: ${D}`);const M=window.location.hostname,A=M==="localhost"||M.startsWith("127.");p(A),A&&y("This URL (localhost) only works on this machine. If your OpenClaw is on a different host, replace with its LAN IP.")}}return S(),()=>{T=!0}},[]),U.useEffect(()=>{let T=!1;async function S(){c(!0);try{const{token:D}=await gs.create("Default");T||l(D)}catch(D){ce.error("Onboarding",`Failed to create pairing token: ${D}`)}finally{T||c(!1)}}return S(),()=>{T=!0}},[]);const _=i?`openclaw plugins install @botschat/botschat && \\
835
+ openclaw config set channels.botschat.cloudUrl ${u} && \\
836
+ openclaw config set channels.botschat.pairingToken ${i} && \\
837
+ openclaw config set channels.botschat.enabled true && \\
838
+ openclaw gateway restart`:"Loading...",N=n.openclawConnected;return g.jsx("div",{className:"min-h-screen flex items-center justify-center p-4",style:{background:"var(--bg-secondary)"},children:g.jsxs("div",{className:"w-full max-w-xl",children:[g.jsxs("div",{className:"text-center mb-8",children:[g.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-xl text-white text-2xl font-bold mb-4",style:{background:"#1264A3"},children:"BC"}),g.jsx("h1",{className:"text-3xl font-bold",style:{color:"var(--text-primary)"},children:"Welcome to BotsChat!"}),g.jsx("p",{className:"mt-2",style:{color:"var(--text-secondary)"},children:"Connect your OpenClaw agent to start chatting."})]}),g.jsx("div",{className:"rounded-md p-8",style:{background:"var(--bg-surface)",boxShadow:"var(--shadow-lg)"},children:N?g.jsxs("div",{className:"text-center py-6",children:[g.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full mb-4",style:{background:"rgba(43, 172, 118, 0.15)"},children:g.jsx("svg",{className:"w-8 h-8",fill:"none",viewBox:"0 0 24 24",stroke:"var(--accent-green)",strokeWidth:2.5,children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),g.jsx("h2",{className:"text-h1 font-bold mb-2",style:{color:"var(--text-primary)"},children:"OpenClaw Connected!"}),g.jsx("p",{className:"text-body mb-6",style:{color:"var(--text-secondary)"},children:"Your agent is ready. Start chatting now."}),g.jsx("button",{onClick:e,className:"px-6 py-2.5 font-bold text-body text-white rounded-sm transition-colors hover:brightness-110",style:{background:"var(--bg-active)"},children:"Start Chatting"})]}):g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"flex items-center gap-3 rounded-md px-4 py-3 mb-6",style:{background:"rgba(232, 162, 48, 0.1)",border:"1px solid rgba(232, 162, 48, 0.3)"},children:[g.jsx(qR,{color:"var(--accent-yellow)"}),g.jsx("span",{className:"text-caption font-medium",style:{color:"var(--accent-yellow)"},children:"Waiting for OpenClaw connection..."})]}),g.jsxs("div",{className:"mb-6",children:[g.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[g.jsx("span",{className:"inline-flex items-center justify-center w-6 h-6 rounded-full text-tiny font-bold text-white",style:{background:"var(--bg-active)"},children:"1"}),g.jsx("h3",{className:"text-body font-bold",style:{color:"var(--text-primary)"},children:"Run this command on your OpenClaw machine"})]}),g.jsx("p",{className:"text-caption mb-3 ml-8",style:{color:"var(--text-secondary)"},children:"This installs the BotsChat plugin, configures the connection, and restarts the gateway."}),h&&g.jsxs("div",{className:"flex items-start gap-2 rounded-md px-3 py-2.5 mb-3 ml-8 text-caption",style:{background:"rgba(232, 162, 48, 0.1)",border:"1px solid rgba(232, 162, 48, 0.25)",color:"var(--accent-yellow)"},children:[g.jsx("svg",{className:"w-4 h-4 mt-0.5 shrink-0",viewBox:"0 0 20 20",fill:"currentColor",children:g.jsx("path",{fillRule:"evenodd",d:"M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.168 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495zM10 6a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0v-3.5A.75.75 0 0110 6zm0 9a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})}),g.jsxs("span",{children:[b||"localhost URL may not be reachable from other machines."," ",g.jsx("button",{onClick:()=>v(!0),className:"underline font-medium hover:brightness-110",style:{color:"var(--text-link)"},children:"Change URL"})]})]}),E&&g.jsxs("div",{className:"flex items-center gap-2 mb-3 ml-8",children:[g.jsx("label",{className:"text-caption font-bold shrink-0",style:{color:"var(--text-secondary)"},children:"Cloud URL:"}),g.jsx("input",{type:"text",value:u,onChange:T=>{f(T.target.value.replace(/\/+$/,"")),p(!1)},className:"flex-1 px-2.5 py-1.5 rounded-sm text-caption font-mono",style:{background:"var(--code-bg)",border:"1px solid var(--border)",color:"var(--text-primary)",outline:"none"},placeholder:"http://192.168.x.x:8787",autoFocus:!0}),g.jsx("button",{onClick:()=>v(!1),className:"px-2.5 py-1 text-tiny font-medium rounded-sm",style:{background:"var(--bg-active)",color:"#fff"},children:"Done"})]}),g.jsx("div",{className:"ml-8",children:o?g.jsx("div",{className:"rounded-md px-3 py-2.5 animate-pulse",style:{background:"var(--code-bg)",height:"80px"}}):g.jsx(yc,{code:_,multiline:!0})})]}),g.jsxs("div",{className:"mb-6",children:[g.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[g.jsx("span",{className:"inline-flex items-center justify-center w-6 h-6 rounded-full text-tiny font-bold text-white",style:{background:"var(--bg-active)"},children:"2"}),g.jsx("h3",{className:"text-body font-bold",style:{color:"var(--text-primary)"},children:"Verify connection"})]}),g.jsx("p",{className:"text-caption ml-8",style:{color:"var(--text-secondary)"},children:'Check the gateway logs — you should see "Authenticated with BotsChat cloud":'}),g.jsx("div",{className:"ml-8 mt-2",children:g.jsx(yc,{code:"openclaw gateway logs"})})]}),g.jsxs("details",{className:"mb-4",children:[g.jsx("summary",{className:"text-caption font-medium cursor-pointer select-none",style:{color:"var(--text-link)"},children:"Or configure manually"}),g.jsxs("div",{className:"mt-3 space-y-3 ml-1",children:[g.jsxs("div",{children:[g.jsx("label",{className:"block text-caption font-bold mb-1",style:{color:"var(--text-secondary)"},children:"Your Pairing Token"}),i?g.jsx(yc,{code:i}):g.jsx("span",{className:"text-caption",style:{color:"var(--text-muted)"},children:"Loading..."})]}),g.jsxs("div",{children:[g.jsx("label",{className:"block text-caption font-bold mb-1",style:{color:"var(--text-secondary)"},children:"Cloud URL"}),g.jsx(yc,{code:u})]})]})]}),g.jsx("div",{className:"text-center pt-2",children:g.jsx("button",{onClick:e,className:"text-caption hover:underline",style:{color:"var(--text-muted)"},children:"Skip for now"})})]})})]})})}function H0({text:e}){const[n,i]=U.useState(!1),l=async()=>{try{await navigator.clipboard.writeText(e),i(!0),setTimeout(()=>i(!1),2e3)}catch{const o=document.createElement("textarea");o.value=e,document.body.appendChild(o),o.select(),document.execCommand("copy"),document.body.removeChild(o),i(!0),setTimeout(()=>i(!1),2e3)}};return g.jsx("button",{onClick:l,className:"shrink-0 px-2.5 py-1 text-tiny font-medium rounded-sm transition-colors",style:{background:n?"var(--accent-green)":"var(--bg-hover)",color:n?"#fff":"var(--text-secondary)"},children:n?"Copied!":"Copy"})}function YR({code:e}){return g.jsxs("div",{className:"flex items-start gap-2 rounded-md px-3 py-2.5",style:{background:"var(--code-bg)",border:"1px solid var(--border)"},children:[g.jsx("pre",{className:"flex-1 text-caption font-mono overflow-x-auto whitespace-pre-wrap break-all",style:{color:"var(--text-primary)"},children:e}),g.jsx(H0,{text:e})]})}function XR(e){const i=Date.now()/1e3-e;return i<60?"Just now":i<3600?`${Math.floor(i/60)}m ago`:i<86400?`${Math.floor(i/3600)}h ago`:i<604800?`${Math.floor(i/86400)}d ago`:new Date(e*1e3).toLocaleDateString()}function P0(){const e=nr(),[n,i]=U.useState([]),[l,o]=U.useState(!0),[c,u]=U.useState(typeof window<"u"?window.location.origin:"https://console.botschat.app"),[f,h]=U.useState(!1),[p,b]=U.useState(),[y,E]=U.useState(!1),[v,_]=U.useState(!1),[N,T]=U.useState(""),[S,D]=U.useState(!1),[M,A]=U.useState(null);U.useEffect(()=>{let B=!1;return Lv.cloudUrl().then(Q=>{B||(u(Q.cloudUrl),h(Q.isLoopback),b(Q.hint))}).catch(Q=>{ce.warn("ConnectionSettings",`Failed to fetch cloudUrl: ${Q}`);const ee=window.location.hostname,me=ee==="localhost"||ee.startsWith("127.");h(me),me&&b("This URL (localhost) only works on this machine. If your OpenClaw is on a different host, replace with its LAN IP.")}),()=>{B=!0}},[]),U.useEffect(()=>{let B=!1;return o(!0),gs.list().then(({tokens:Q})=>{B||i(Q)}).catch(Q=>{ce.error("ConnectionSettings",`Failed to list tokens: ${Q}`)}).finally(()=>{B||o(!1)}),()=>{B=!0}},[]);const F=U.useCallback(async()=>{D(!0);try{const B=await gs.create(N.trim()||void 0);A({id:B.id,token:B.token});const{tokens:Q}=await gs.list();i(Q),T(""),_(!1)}catch(B){ce.error("ConnectionSettings",`Failed to create token: ${B}`)}finally{D(!1)}},[N]),L=U.useCallback(async B=>{try{await gs.delete(B),i(Q=>Q.filter(ee=>ee.id!==B)),(M==null?void 0:M.id)===B&&A(null)}catch(Q){ce.error("ConnectionSettings",`Failed to revoke token: ${Q}`)}},[M]),X=(M==null?void 0:M.token)??null,re=X?`openclaw plugins install @botschat/botschat && \\
839
+ openclaw config set channels.botschat.cloudUrl ${c} && \\
840
+ openclaw config set channels.botschat.pairingToken ${X} && \\
841
+ openclaw config set channels.botschat.enabled true && \\
842
+ openclaw gateway restart`:null,oe=e.openclawConnected;return g.jsxs("div",{className:"space-y-5",children:[g.jsxs("div",{children:[g.jsx("label",{className:"block text-caption font-bold mb-1.5",style:{color:"var(--text-secondary)"},children:"OpenClaw Status"}),g.jsxs("div",{className:"flex items-center gap-3 rounded-md px-4 py-3",style:{background:oe?"rgba(43, 172, 118, 0.1)":"rgba(232, 162, 48, 0.1)",border:`1px solid ${oe?"rgba(43, 172, 118, 0.3)":"rgba(232, 162, 48, 0.3)"}`},children:[g.jsx("span",{className:"w-2.5 h-2.5 rounded-full shrink-0",style:{background:oe?"var(--accent-green)":"var(--accent-yellow)"}}),g.jsx("span",{className:"text-caption font-medium",style:{color:oe?"var(--accent-green)":"var(--accent-yellow)"},children:oe?"Connected to OpenClaw":"Not connected"})]})]}),g.jsxs("div",{children:[g.jsx("label",{className:"block text-caption font-bold mb-1.5",style:{color:"var(--text-secondary)"},children:"Setup Command"}),g.jsx("p",{className:"text-tiny mb-2",style:{color:"var(--text-muted)"},children:"Run this on your OpenClaw machine to install and connect the plugin."}),f&&g.jsxs("div",{className:"flex items-start gap-2 rounded-md px-3 py-2 mb-2 text-tiny",style:{background:"rgba(232, 162, 48, 0.1)",border:"1px solid rgba(232, 162, 48, 0.25)",color:"var(--accent-yellow)"},children:[g.jsx("svg",{className:"w-3.5 h-3.5 mt-0.5 shrink-0",viewBox:"0 0 20 20",fill:"currentColor",children:g.jsx("path",{fillRule:"evenodd",d:"M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.168 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495zM10 6a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0v-3.5A.75.75 0 0110 6zm0 9a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})}),g.jsxs("span",{children:[p||"localhost URL may not be reachable from other machines."," ",g.jsx("button",{onClick:()=>E(!0),className:"underline font-medium hover:brightness-110",style:{color:"var(--text-link)"},children:"Change URL"})]})]}),y&&g.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[g.jsx("label",{className:"text-tiny font-bold shrink-0",style:{color:"var(--text-secondary)"},children:"Cloud URL:"}),g.jsx("input",{type:"text",value:c,onChange:B=>{u(B.target.value.replace(/\/+$/,"")),h(!1)},className:"flex-1 px-2.5 py-1 rounded-sm text-tiny font-mono",style:{background:"var(--code-bg)",border:"1px solid var(--border)",color:"var(--text-primary)",outline:"none"},placeholder:"http://192.168.x.x:8787",autoFocus:!0}),g.jsx("button",{onClick:()=>E(!1),className:"px-2.5 py-1 text-tiny font-medium rounded-sm",style:{background:"var(--bg-active)",color:"#fff"},children:"Done"})]}),l?g.jsx("div",{className:"rounded-md px-3 py-2.5 animate-pulse",style:{background:"var(--code-bg)",height:"64px"}}):re?g.jsx(YR,{code:re}):g.jsx("div",{className:"rounded-md px-4 py-3 text-caption",style:{background:"var(--code-bg)",border:"1px solid var(--border)",color:"var(--text-muted)"},children:n.length>0?"Create a new pairing token below to generate the setup command. (Token values are only shown once at creation time.)":"No pairing tokens available. Create one below to generate the setup command."}),!y&&g.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[g.jsx("span",{className:"text-tiny",style:{color:"var(--text-muted)"},children:"Cloud URL:"}),g.jsx("code",{className:"text-tiny font-mono",style:{color:"var(--text-secondary)"},children:c}),g.jsx("button",{onClick:()=>E(!0),className:"text-tiny hover:underline",style:{color:"var(--text-link)"},children:"Edit"})]})]}),g.jsxs("div",{children:[g.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[g.jsx("label",{className:"text-caption font-bold",style:{color:"var(--text-secondary)"},children:"Pairing Tokens"}),g.jsx("button",{onClick:()=>_(!v),className:"text-tiny font-medium hover:underline",style:{color:"var(--text-link)"},children:v?"Cancel":"+ New Token"})]}),v&&g.jsxs("div",{className:"flex items-center gap-2 rounded-md px-3 py-2.5 mb-2",style:{background:"var(--code-bg)",border:"1px solid var(--border)"},children:[g.jsx("input",{type:"text",value:N,onChange:B=>T(B.target.value),placeholder:"Token label (optional)",className:"flex-1 px-2 py-1 rounded-sm text-tiny",style:{background:"var(--bg-surface)",border:"1px solid var(--border)",color:"var(--text-primary)",outline:"none"},onKeyDown:B=>{B.key==="Enter"&&F()},autoFocus:!0}),g.jsx("button",{onClick:F,disabled:S,className:"px-3 py-1 text-tiny font-medium rounded-sm text-white",style:{background:S?"var(--text-muted)":"var(--bg-active)"},children:S?"Creating...":"Create"})]}),M&&g.jsxs("div",{className:"rounded-md px-3 py-2.5 mb-2",style:{background:"rgba(43, 172, 118, 0.08)",border:"1px solid rgba(43, 172, 118, 0.3)"},children:[g.jsxs("div",{className:"flex items-center justify-between mb-1",children:[g.jsx("span",{className:"text-tiny font-bold",style:{color:"var(--accent-green)"},children:"New token created — copy it now (only shown once)"}),g.jsx("button",{onClick:()=>A(null),className:"text-tiny",style:{color:"var(--text-muted)"},children:"Dismiss"})]}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("code",{className:"flex-1 text-tiny font-mono break-all",style:{color:"var(--text-primary)"},children:M.token}),g.jsx(H0,{text:M.token})]})]}),l?g.jsx("div",{className:"rounded-md px-3 py-4 animate-pulse",style:{background:"var(--code-bg)"}}):n.length===0?g.jsx("p",{className:"text-tiny py-2",style:{color:"var(--text-muted)"},children:"No active pairing tokens. Create one to connect your OpenClaw agent."}):g.jsx("div",{className:"space-y-1",children:n.map(B=>g.jsxs("div",{className:"flex items-center gap-2 rounded-md px-3 py-2",style:{background:"var(--code-bg)",border:"1px solid var(--border)"},children:[g.jsx("code",{className:"text-tiny font-mono shrink-0",style:{color:"var(--text-primary)"},children:B.tokenPreview}),B.label&&g.jsx("span",{className:"text-tiny px-1.5 py-0.5 rounded",style:{background:"var(--bg-hover)",color:"var(--text-secondary)"},children:B.label}),g.jsx("span",{className:"flex-1"}),g.jsx("span",{className:"text-tiny",style:{color:"var(--text-muted)"},children:B.lastConnectedAt?XR(B.lastConnectedAt):"Never connected"}),g.jsx("button",{onClick:()=>L(B.id),className:"text-tiny font-medium hover:underline shrink-0",style:{color:"var(--accent-red)"},title:"Revoke this token",children:"Revoke"})]},B.id))})]})]})}const F0={info:"var(--text-muted)",warn:"var(--accent-yellow)",error:"var(--accent-red)","ws-in":"#6BCB77","ws-out":"#4D96FF",api:"#C77DFF"},G0={info:"INF",warn:"WRN",error:"ERR","ws-in":"WS↓","ws-out":"WS↑",api:"API"};function ZR(e){const n=new Date(e);return n.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})+"."+String(n.getMilliseconds()).padStart(3,"0")}const Af="botschat_debug_panel_height",fv=220,Of=80,Mf=600;function QR(){const e=U.useSyncExternalStore(qS,$S),[n,i]=U.useState(!1),[l,o]=U.useState("all"),[c,u]=U.useState(new Set),f=U.useRef(null),h=U.useRef(!0),[p,b]=U.useState(()=>{try{const A=localStorage.getItem(Af);if(A){const F=parseInt(A,10);if(F>=Of&&F<=Mf)return F}}catch{}return fv}),y=U.useRef(!1),E=U.useRef(0),v=U.useRef(fv),_=U.useCallback(A=>{A.preventDefault(),A.stopPropagation(),y.current=!0,E.current=A.clientY,v.current=p;const F=X=>{if(!y.current)return;const re=E.current-X.clientY,oe=Math.max(Of,Math.min(Mf,v.current+re));b(oe)},L=()=>{y.current&&(y.current=!1,document.removeEventListener("mousemove",F),document.removeEventListener("mouseup",L),b(X=>{try{localStorage.setItem(Af,String(X))}catch{}return X}))};document.addEventListener("mousemove",F),document.addEventListener("mouseup",L)},[p]),N=U.useCallback(A=>{A.stopPropagation();const F=A.touches[0];y.current=!0,E.current=F.clientY,v.current=p;const L=re=>{if(!y.current)return;const oe=re.touches[0],B=E.current-oe.clientY,Q=Math.max(Of,Math.min(Mf,v.current+B));b(Q)},X=()=>{y.current&&(y.current=!1,document.removeEventListener("touchmove",L),document.removeEventListener("touchend",X),b(re=>{try{localStorage.setItem(Af,String(re))}catch{}return re}))};document.addEventListener("touchmove",L,{passive:!1}),document.addEventListener("touchend",X)},[p]);U.useEffect(()=>{n&&h.current&&f.current&&(f.current.scrollTop=f.current.scrollHeight)},[e.length,n]);const T=()=>{if(!f.current)return;const{scrollTop:A,scrollHeight:F,clientHeight:L}=f.current;h.current=F-A-L<40},S=A=>{u(F=>{const L=new Set(F);return L.has(A)?L.delete(A):L.add(A),L})},D=l==="all"?e:e.filter(A=>A.level===l),M=e.length;return g.jsxs("div",{style:{flexShrink:0,fontFamily:"var(--font-mono)",fontSize:12,lineHeight:1.5},children:[n&&g.jsx("div",{onMouseDown:_,onTouchStart:N,className:"resize-handle group",style:{height:6,cursor:"row-resize",display:"flex",alignItems:"center",justifyContent:"center",background:"var(--bg-secondary)",borderTop:"1px solid var(--border)",flexShrink:0},children:g.jsx("div",{className:"resize-handle-line",style:{width:"100%",height:1,background:"var(--border)",transition:"height 150ms, background 150ms"}})}),g.jsxs("div",{onClick:()=>i(!n),style:{display:"flex",alignItems:"center",gap:8,padding:"3px 12px",background:"var(--bg-secondary)",borderTop:n?void 0:"1px solid var(--border)",cursor:"pointer",userSelect:"none"},children:[g.jsx("svg",{width:10,height:10,viewBox:"0 0 10 10",style:{transform:n?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.15s",flexShrink:0},children:g.jsx("path",{d:"M1 7L5 3l4 4",stroke:"var(--text-muted)",strokeWidth:1.5,fill:"none"})}),g.jsx("span",{style:{color:"var(--text-muted)",fontWeight:600,fontSize:11},children:"Debug Log"}),g.jsxs("span",{style:{color:"var(--text-muted)",fontSize:10},children:["(",M,")"]}),n&&g.jsx("div",{style:{display:"flex",gap:2,marginLeft:8},onClick:A=>A.stopPropagation(),children:["all","ws-in","ws-out","api","info","warn","error"].map(A=>g.jsx("button",{onClick:()=>o(A),style:{padding:"1px 6px",borderRadius:3,border:"none",fontSize:10,fontFamily:"var(--font-mono)",cursor:"pointer",background:l===A?"var(--bg-active)":"var(--bg-hover)",color:l===A?"#fff":A==="all"?"var(--text-muted)":F0[A]},children:A==="all"?"ALL":G0[A]},A))}),n&&g.jsx("button",{onClick:A=>{A.stopPropagation(),KS()},style:{marginLeft:"auto",padding:"1px 8px",borderRadius:3,border:"none",fontSize:10,fontFamily:"var(--font-mono)",cursor:"pointer",background:"var(--bg-hover)",color:"var(--text-muted)"},children:"Clear"})]}),n&&g.jsxs("div",{ref:f,onScroll:T,style:{height:p,overflowY:"auto",overflowX:"hidden",background:"var(--bg-primary)",borderTop:"1px solid var(--border)"},children:[D.length===0&&g.jsx("div",{style:{padding:"16px 12px",color:"var(--text-muted)",textAlign:"center"},children:"No log entries yet."}),D.map(A=>g.jsx(WR,{entry:A,expanded:c.has(A.id),onToggleExpand:()=>S(A.id)},A.id))]})]})}function WR({entry:e,expanded:n,onToggleExpand:i}){const l=F0[e.level],o=G0[e.level];return g.jsxs("div",{style:{padding:"1px 12px",borderBottom:"1px solid var(--border)",wordBreak:"break-all"},onMouseEnter:c=>c.currentTarget.style.background="var(--bg-hover)",onMouseLeave:c=>c.currentTarget.style.background="",children:[g.jsxs("div",{style:{display:"flex",gap:8,alignItems:"flex-start"},children:[g.jsx("span",{style:{color:"var(--text-muted)",flexShrink:0,width:85},children:ZR(e.ts)}),g.jsx("span",{style:{color:l,fontWeight:700,flexShrink:0,width:28,textAlign:"center"},children:o}),g.jsxs("span",{style:{color:"var(--text-secondary)",flexShrink:0,minWidth:50},children:["[",e.tag,"]"]}),g.jsx("span",{style:{color:"var(--text-primary)",flex:1},children:e.message}),e.detail&&g.jsx("button",{onClick:i,style:{border:"none",background:"none",cursor:"pointer",color:"var(--text-muted)",fontSize:10,padding:"0 4px",flexShrink:0},children:n?"▼":"▶"})]}),n&&e.detail&&g.jsx("pre",{style:{margin:"2px 0 4px 121px",padding:"4px 8px",background:"var(--code-bg)",borderRadius:3,color:"var(--text-secondary)",fontSize:11,whiteSpace:"pre-wrap",wordBreak:"break-all",maxHeight:200,overflowY:"auto"},children:e.detail})]})}function $0(){const e=nr(),n=Fr(),i=l=>{n({type:"SELECT_CRON_TASK",taskId:l})};return g.jsxs("div",{className:"flex flex-col h-full",style:{background:"var(--bg-secondary)"},children:[g.jsx("div",{className:"px-4 py-3 flex items-center gap-2",children:g.jsx("span",{className:"text-[--text-sidebar-active] font-bold text-h2 truncate flex-1",children:"Automations"})}),g.jsx("div",{className:"px-4 pb-2",children:g.jsxs("div",{className:"flex items-center gap-1.5",children:[g.jsx("div",{className:"w-2 h-2 rounded-full",style:{background:e.openclawConnected?"var(--accent-green)":"var(--accent-red)"}}),g.jsx("span",{className:"text-tiny text-[--text-muted]",children:e.openclawConnected?"OpenClaw connected":"OpenClaw offline"})]})}),g.jsx("div",{className:"px-4 pb-2",children:g.jsxs("span",{className:"text-tiny text-[--text-muted]",children:[e.cronTasks.length," cron job",e.cronTasks.length!==1?"s":""]})}),g.jsx("div",{className:"flex-1 overflow-y-auto sidebar-scroll",children:e.cronTasks.length===0?g.jsxs("div",{className:"px-4 py-8 text-center",children:[g.jsx("svg",{className:"w-10 h-10 mx-auto mb-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1,style:{color:"var(--text-muted)"},children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z"})}),g.jsx("p",{className:"text-caption text-[--text-muted]",children:"No automations yet."}),g.jsx("p",{className:"text-tiny text-[--text-muted] mt-1",children:"Cron jobs from OpenClaw will appear here automatically."})]}):e.cronTasks.map(l=>{const o=e.selectedCronTaskId===l.id,c=l.enabled;let u="var(--accent-green)";return c||(u="var(--text-muted)"),g.jsxs("button",{onClick:()=>i(l.id),className:"w-full text-left py-2 transition-colors",style:{paddingLeft:o?13:16,paddingRight:16,background:o?"var(--bg-hover)":void 0,borderLeft:o?"3px solid var(--bg-active)":"3px solid transparent",color:o?"var(--text-sidebar-active)":"var(--text-sidebar)"},onMouseEnter:f=>{o||(f.currentTarget.style.background="var(--sidebar-hover)")},onMouseLeave:f=>{o||(f.currentTarget.style.background=o?"var(--bg-hover)":"")},children:[g.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[g.jsx("div",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{background:u}}),g.jsx("span",{className:`text-body truncate ${o?"font-bold":""}`,children:l.name})]}),g.jsxs("div",{className:"flex items-center gap-2 mt-0.5 pl-4",children:[g.jsx("span",{className:"text-tiny truncate",style:{color:"var(--text-muted)"},children:l.schedule??"no schedule"}),!c&&g.jsx("span",{className:"text-tiny",style:{color:"var(--text-muted)"},children:"paused"})]})]},l.id)})})]})}function th(e){if(!e)return null;const n=e.trim().toLowerCase(),i=n.match(/^every\s+(\d+(?:\.\d+)?)\s*(s|m|h)$/);if(i)return{kind:"every",intervalValue:parseFloat(i[1]),intervalUnit:i[2]};const l=n.match(/^at\s+(\d{1,2}:\d{2})$/);return l?{kind:"at",atTime:l[1].padStart(5,"0")}:null}function JR(e){return e.kind==="every"&&e.intervalValue&&e.intervalUnit?`every ${e.intervalValue}${e.intervalUnit}`:e.kind==="at"&&e.atTime?`at ${e.atTime}`:""}function eD({value:e,onChange:n,onSave:i,onCancel:l,saving:o}){const c=th(e),[u,f]=U.useState((c==null?void 0:c.kind)??"every"),[h,p]=U.useState((c==null?void 0:c.intervalValue)??1),[b,y]=U.useState((c==null?void 0:c.intervalUnit)??"h"),[E,v]=U.useState((c==null?void 0:c.atTime)??"09:00");U.useEffect(()=>{const A=th(e);A&&(f(A.kind),A.kind==="every"?(p(A.intervalValue??1),y(A.intervalUnit??"h")):v(A.atTime??"09:00"))},[e]);const _=U.useCallback((A,F,L,X)=>{const re=JR(A==="every"?{kind:"every",intervalValue:F,intervalUnit:L}:{kind:"at",atTime:X});n(re)},[n]),N=A=>{f(A),_(A,h,b,E)},T=A=>{const F=Math.max(1,Math.min(A,999));p(F),_(u,F,b,E)},S=A=>{y(A),_(u,h,A,E)},D=A=>{v(A),_(u,h,b,A)},M=A=>{A.key==="Escape"&&l(),A.key==="Enter"&&(A.preventDefault(),i())};return g.jsxs("div",{className:"flex flex-col gap-2",onKeyDown:M,children:[g.jsxs("div",{className:"flex items-center gap-1",children:[g.jsx(hv,{active:u==="every",onClick:()=>N("every"),label:"Interval",icon:g.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0l3.181 3.183a8.25 8.25 0 0013.803-3.7M4.031 9.865a8.25 8.25 0 0113.803-3.7l3.181 3.182"})})}),g.jsx(hv,{active:u==="at",onClick:()=>N("at"),label:"Daily at",icon:g.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z"})})})]}),g.jsxs("div",{className:"flex items-center gap-2",children:[u==="every"?g.jsxs(g.Fragment,{children:[g.jsx("span",{className:"text-caption flex-shrink-0",style:{color:"var(--text-muted)"},children:"Every"}),g.jsx("input",{type:"number",min:1,max:999,value:h,onChange:A=>T(parseInt(A.target.value,10)||1),className:"text-body px-2 py-1 rounded-sm focus:outline-none w-16 text-center",style:{background:"var(--bg-hover)",color:"var(--text-primary)",border:"1px solid var(--bg-active)"},autoFocus:!0}),g.jsxs("div",{className:"flex items-center gap-0.5",children:[g.jsx(Rf,{active:b==="m",onClick:()=>S("m"),label:"min"}),g.jsx(Rf,{active:b==="h",onClick:()=>S("h"),label:"hr"}),g.jsx(Rf,{active:b==="s",onClick:()=>S("s"),label:"sec"})]})]}):g.jsxs(g.Fragment,{children:[g.jsx("span",{className:"text-caption flex-shrink-0",style:{color:"var(--text-muted)"},children:"Daily at"}),g.jsx("input",{type:"time",value:E,onChange:A=>D(A.target.value),className:"text-body px-2 py-1 rounded-sm focus:outline-none",style:{background:"var(--bg-hover)",color:"var(--text-primary)",border:"1px solid var(--bg-active)"},autoFocus:!0})]}),g.jsxs("div",{className:"flex items-center gap-1 ml-auto flex-shrink-0",children:[g.jsx("button",{onClick:i,disabled:o,className:"px-2 py-1 text-tiny font-bold text-white rounded-sm disabled:opacity-50",style:{background:"var(--bg-active)"},children:o?"...":"Save"}),g.jsx("button",{onClick:l,className:"px-2 py-1 text-tiny rounded-sm",style:{color:"var(--text-muted)"},children:"Cancel"})]})]}),g.jsx("div",{className:"text-tiny",style:{color:"var(--text-muted)"},children:u==="every"?`Runs every ${h} ${b==="h"?"hour":b==="m"?"minute":"second"}${h!==1?"s":""}`:`Runs daily at ${E}`})]})}function tD({schedule:e,onClick:n}){if(!e)return g.jsx("span",{className:"text-body cursor-pointer hover:underline",style:{color:"var(--text-muted)"},onClick:n,title:"Click to set schedule",children:"Not set"});const i=th(e);return i?g.jsx("button",{className:"flex items-center gap-1.5 cursor-pointer group",onClick:n,title:"Click to edit schedule",children:i.kind==="every"?g.jsxs(g.Fragment,{children:[g.jsx("svg",{className:"w-3.5 h-3.5 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,style:{color:"var(--text-muted)"},children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0l3.181 3.183a8.25 8.25 0 0013.803-3.7M4.031 9.865a8.25 8.25 0 0113.803-3.7l3.181 3.182"})}),g.jsxs("span",{className:"text-body group-hover:underline",style:{color:"var(--text-primary)"},children:["Every ",i.intervalValue,i.intervalUnit==="h"?"h":i.intervalUnit==="m"?"m":"s"]})]}):g.jsxs(g.Fragment,{children:[g.jsx("svg",{className:"w-3.5 h-3.5 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,style:{color:"var(--text-muted)"},children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z"})}),g.jsxs("span",{className:"text-body group-hover:underline",style:{color:"var(--text-primary)"},children:["Daily at ",i.atTime]})]})}):g.jsx("span",{className:"text-body cursor-pointer hover:underline",style:{color:"var(--text-primary)"},onClick:n,title:"Click to edit schedule",children:e})}function hv({active:e,onClick:n,label:i,icon:l}){return g.jsxs("button",{onClick:n,className:"flex items-center gap-1.5 px-2.5 py-1 text-caption rounded-sm transition-colors",style:{background:e?"rgba(29,155,209,0.15)":"transparent",color:e?"var(--text-link)":"var(--text-muted)",border:e?"1px solid rgba(29,155,209,0.3)":"1px solid transparent"},children:[l,i]})}function Rf({active:e,onClick:n,label:i}){return g.jsx("button",{onClick:n,className:"px-2 py-1 text-caption rounded-sm transition-colors",style:{background:e?"var(--bg-active)":"var(--bg-hover)",color:e?"#fff":"var(--text-secondary)",border:e?"1px solid var(--bg-active)":"1px solid var(--border)"},children:i})}function ws({direction:e="horizontal",className:n=""}){const i=e==="vertical";return g.jsx(Rv,{className:`resize-handle group relative flex items-center justify-center ${i?"h-[6px] cursor-row-resize":"w-[6px] cursor-col-resize"} ${n}`,style:{flexShrink:0,flexGrow:0},children:g.jsx("div",{className:`resize-handle-line transition-all duration-150 ${i?"w-full h-px group-hover:h-[3px]":"h-full w-px group-hover:w-[3px]"}`,style:{background:"var(--border)"}})})}const pv=768;function K0(){const[e,n]=U.useState(()=>typeof window>"u"?!1:window.innerWidth<pv);return U.useEffect(()=>{const i=window.matchMedia(`(max-width: ${pv-1}px)`),l=o=>n(o.matches);return n(i.matches),i.addEventListener("change",l),()=>i.removeEventListener("change",l)},[]),e}function mv(e){return new Date(e*1e3).toLocaleString()}function q0(e){switch(e){case"ok":return"OK";case"error":return"ERR";case"skipped":return"SKIP";case"running":return"RUN";default:return e.toUpperCase()}}function V0(e){switch(e){case"ok":return{bg:"rgba(43,172,118,0.15)",fg:"var(--accent-green)"};case"error":return{bg:"rgba(224,30,90,0.15)",fg:"var(--accent-red)"};case"running":return{bg:"rgba(29,155,209,0.15)",fg:"var(--text-link)"};default:return{bg:"rgba(232,162,48,0.15)",fg:"var(--accent-yellow)"}}}function Y0(){const e=nr(),n=Fr(),i=K0(),l=e.cronTasks.find($=>$.id===e.selectedCronTaskId),[o,c]=U.useState(null),[u,f]=U.useState(""),[h,p]=U.useState(!1),[b,y]=U.useState(!1),[E,v]=U.useState(!1),[_,N]=U.useState(!1),[T,S]=U.useState(!0),D=U.useRef(null);U.useEffect(()=>{c(null),y(!1)},[e.selectedCronTaskId]),U.useEffect(()=>{o&&D.current&&D.current.focus()},[o]);const M=U.useCallback(()=>{l&&(ce.info("Cron",`Loading jobs for task: ${l.name} (${l.id})`),zf.listByTask(l.id).then(({jobs:$})=>{ce.info("Cron",`Loaded ${$.length} jobs for task ${l.name}`);const j=A.current,O=new Map;for(const J of j)J.summary&&O.set(J.id,J.summary);const P=$.map(J=>{var R;const C=O.get(J.id);return C&&C.length>(((R=J.summary)==null?void 0:R.length)||0)?{...J,summary:C}:J});n({type:"SET_CRON_JOBS",cronJobs:P}),$.length>0&&!e.selectedCronJobId&&n({type:"SELECT_CRON_JOB",jobId:$[0].id,sessionKey:$[0].sessionKey})}).catch($=>{ce.error("Cron",`Failed to load jobs: ${$}`)}))},[l==null?void 0:l.id]);U.useEffect(()=>{M()},[M]);const A=U.useRef(e.cronJobs);U.useEffect(()=>{A.current=e.cronJobs},[e.cronJobs]),U.useEffect(()=>{if(!e.cronJobs.some(P=>P.status==="running")||!l)return;const j=l.id,O=setInterval(()=>{ce.info("Cron","Auto-refreshing jobs (running job detected)"),zf.listByTask(j).then(({jobs:P})=>{const J=A.current,C=new Map;for(const q of J)q.summary&&C.set(q.id,q.summary);const R=P.map(q=>{var ue;const w=C.get(q.id);return w&&w.length>(((ue=q.summary)==null?void 0:ue.length)||0)?{...q,summary:w}:q});n({type:"SET_CRON_JOBS",cronJobs:R})}).catch(()=>{})},3e3);return()=>clearInterval(O)},[e.cronJobs,l==null?void 0:l.id]);const F=U.useCallback(async()=>{if(!l)return;const $=!l.enabled;ce.info("Cron",`Toggle task "${l.name}": ${l.enabled?"enabled → disabled":"disabled → enabled"}`),n({type:"UPDATE_CRON_TASK",taskId:l.id,updates:{enabled:$}});try{await Vn.update(l.channelId,l.id,{schedule:l.schedule??"",instructions:l.instructions??"",enabled:$,model:l.model??""})}catch(j){ce.error("Cron",`Failed to toggle task: ${j}`),n({type:"UPDATE_CRON_TASK",taskId:l.id,updates:{enabled:l.enabled}})}},[l]),L=U.useCallback($=>{const j=e.cronJobs.find(O=>O.id===$);j&&(ce.info("Cron",`Selected job #${j.number||$} (status=${j.status})`),n({type:"SELECT_CRON_JOB",jobId:j.id,sessionKey:j.sessionKey||void 0}))},[e.cronJobs]),X=$=>{if(!l)return;const j=$==="name"?l.name:$==="schedule"?l.schedule??"":l.instructions??"";f(j),c($)},re=U.useCallback(async $=>{if(!l)return;ce.info("Cron",`Change model for "${l.name}": → ${$||"default"}`);const j=l.model;n({type:"UPDATE_CRON_TASK",taskId:l.id,updates:{model:$||null}});try{await Vn.update(l.channelId,l.id,{schedule:l.schedule??"",instructions:l.instructions??"",enabled:l.enabled,model:$})}catch(O){ce.error("Cron",`Failed to update task model: ${O}`),n({type:"UPDATE_CRON_TASK",taskId:l.id,updates:{model:j}})}},[l]),oe=U.useCallback(async()=>{if(!(!l||_)){ce.info("Cron",`Triggering immediate run for "${l.name}"`),N(!0);try{await Vn.run(l.channelId,l.id),ce.info("Cron",`Task "${l.name}" triggered successfully`),setTimeout(()=>{M()},1500)}catch($){ce.error("Cron",`Failed to trigger task: ${$}`)}finally{N(!1)}}},[l,_,M]),B=()=>{c(null),f("")},Q=async()=>{if(!(!l||!o)){ce.info("Cron",`Save edit "${o}" for "${l.name}": ${u.length>80?u.slice(0,80)+"…":u}`),p(!0);try{if(o==="name")n({type:"UPDATE_CRON_TASK",taskId:l.id,updates:{name:u}}),await Vn.update(l.channelId,l.id,{name:u});else{const $={[o]:u};n({type:"UPDATE_CRON_TASK",taskId:l.id,updates:$}),await Vn.update(l.channelId,l.id,{schedule:o==="schedule"?u:l.schedule??"",instructions:o==="instructions"?u:l.instructions??"",enabled:l.enabled,model:l.model??""})}c(null)}catch($){ce.error("Cron",`Failed to update task field "${o}": ${$}`)}finally{p(!1)}}},ee=async()=>{if(l){ce.info("Cron",`Deleting task: "${l.name}" (${l.id})`),v(!0);try{await Vn.delete(l.channelId,l.id),ce.info("Cron",`Task deleted: "${l.name}"`);const{tasks:$}=await Vn.listAll("background");n({type:"SET_CRON_TASKS",cronTasks:$}),n({type:"SELECT_CRON_TASK",taskId:$.length>0?$[0].id:null}),y(!1)}catch($){ce.error("Cron",`Failed to delete task: ${$}`)}finally{v(!1)}}},me=$=>{$.key==="Escape"&&B(),$.key==="Enter"&&!$.shiftKey&&o!=="instructions"&&($.preventDefault(),Q())};if(!l)return g.jsx("div",{className:"flex-1 h-full flex items-center justify-center",style:{background:"var(--bg-surface)"},children:g.jsxs("div",{className:"text-center",children:[g.jsx("svg",{className:"w-16 h-16 mx-auto mb-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1,style:{color:"var(--text-muted)"},children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z"})}),g.jsx("p",{className:"text-body font-bold",style:{color:"var(--text-muted)"},children:"Select an automation"}),g.jsx("p",{className:"text-caption mt-1",style:{color:"var(--text-muted)"},children:"Choose a cron job from the sidebar to view details"})]})});const se=e.channels.find($=>$.id===l.channelId);return g.jsxs("div",{className:"flex-1 h-full flex flex-col min-w-0",style:{background:"var(--bg-surface)"},children:[g.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 px-4 sm:px-5 py-2 sm:py-3 flex-shrink-0",style:{borderBottom:"1px solid var(--border)"},children:[g.jsxs("div",{className:"flex items-center gap-2 sm:gap-3 min-w-0 flex-1",children:[g.jsx("svg",{className:"w-5 h-5 flex-shrink-0 hidden sm:block",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,style:{color:"var(--text-secondary)"},children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z"})}),o==="name"?g.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[g.jsx("input",{ref:D,value:u,onChange:$=>f($.target.value),onKeyDown:me,className:"text-h2 font-bold px-2 py-0.5 rounded-sm focus:outline-none min-w-0 w-full",style:{background:"var(--bg-hover)",color:"var(--text-primary)",border:"1px solid var(--bg-active)",maxWidth:280}}),g.jsx(X0,{saving:h,onSave:Q,onCancel:B})]}):g.jsx("h2",{className:"text-h2 font-bold truncate cursor-pointer hover:underline",style:{color:"var(--text-primary)"},onClick:()=>X("name"),title:"Click to edit name",children:l.name}),!l.enabled&&g.jsx("span",{className:"text-tiny px-2 py-0.5 rounded-sm font-bold flex-shrink-0",style:{background:"rgba(232,162,48,0.15)",color:"var(--accent-yellow)"},children:"PAUSED"})]}),g.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2 flex-shrink-0",children:[g.jsxs("button",{onClick:oe,disabled:_,className:"flex items-center gap-1 sm:gap-1.5 px-2 sm:px-3 py-1 sm:py-1.5 text-caption rounded-sm transition-colors disabled:opacity-50",style:{background:"rgba(29,155,209,0.15)",color:"var(--text-link)"},title:"Run task now (one-time)",children:[g.jsx("svg",{className:"w-3.5 h-3.5",fill:"currentColor",viewBox:"0 0 24 24",children:g.jsx("path",{d:"M8 5v14l11-7z"})}),g.jsx("span",{className:"hidden sm:inline",children:_?"Running...":"Run Now"})]}),g.jsx("button",{onClick:()=>y(!0),className:"p-1 sm:p-1.5 rounded-sm transition-colors hover:bg-[--bg-hover]",style:{color:"var(--text-muted)"},title:"Delete task",children:g.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0"})})}),g.jsxs("button",{onClick:F,className:"flex items-center gap-1.5 sm:gap-2 px-2 sm:px-3 py-1 sm:py-1.5 text-caption rounded-sm transition-colors",style:{background:l.enabled?"rgba(43,172,118,0.15)":"rgba(107,111,118,0.15)",color:l.enabled?"var(--accent-green)":"var(--text-muted)"},children:[g.jsx("div",{className:"w-7 h-4 rounded-full relative transition-colors flex-shrink-0",style:{background:l.enabled?"var(--accent-green)":"var(--text-muted)"},children:g.jsx("div",{className:"w-3 h-3 rounded-full bg-white absolute top-0.5 transition-all",style:{left:l.enabled?14:2}})}),g.jsx("span",{className:"hidden sm:inline",children:l.enabled?"Enabled":"Disabled"})]})]})]}),b&&g.jsxs("div",{className:"px-4 sm:px-5 py-2 sm:py-3 flex flex-wrap items-center justify-between gap-2",style:{background:"rgba(224,30,90,0.08)",borderBottom:"1px solid var(--border)"},children:[g.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[g.jsx("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,style:{color:"var(--accent-red)"},children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z"})}),g.jsxs("span",{className:"text-caption",style:{color:"var(--accent-red)"},children:['Delete "',l.name,'"?']})]}),g.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[g.jsx("button",{onClick:ee,disabled:E,className:"px-3 py-1.5 text-caption font-bold text-white rounded-sm disabled:opacity-50",style:{background:"var(--accent-red)"},children:E?"Deleting...":"Delete"}),g.jsx("button",{onClick:()=>y(!1),className:"px-3 py-1.5 text-caption rounded-sm",style:{color:"var(--text-muted)"},children:"Cancel"})]})]}),g.jsx(nD,{task:l,channel:se,state:e,isMobile:i,infoExpanded:T,setInfoExpanded:S,editingField:o,editValue:u,setEditValue:f,editRef:D,handleKeyDown:me,saving:h,saveEdit:Q,cancelEdit:B,startEdit:X,handleModelSelectChange:re,handleSelectJob:L})]})}function nD({task:e,channel:n,state:i,isMobile:l,infoExpanded:o,setInfoExpanded:c,editingField:u,editValue:f,setEditValue:h,editRef:p,handleKeyDown:b,saving:y,saveEdit:E,cancelEdit:v,startEdit:_,handleModelSelectChange:N,handleSelectJob:T}){const S=kc({id:"botschat-cron-detail-v"}),[D,M]=U.useState(40),A=U.useRef(null),F=U.useRef({startY:0,startPct:40}),L=U.useCallback(oe=>{oe.preventDefault(),F.current.startY=oe.touches[0].clientY,F.current.startPct=D;const B=ee=>{if(ee.preventDefault(),!A.current)return;const me=A.current.getBoundingClientRect().height,se=(ee.touches[0].clientY-F.current.startY)/me*100;M(Math.max(10,Math.min(70,F.current.startPct+se)))},Q=()=>{document.removeEventListener("touchmove",B),document.removeEventListener("touchend",Q)};document.addEventListener("touchmove",B,{passive:!1}),document.addEventListener("touchend",Q)},[D]),X=U.useCallback(oe=>{oe.preventDefault(),F.current.startY=oe.clientY,F.current.startPct=D;const B=ee=>{if(!A.current)return;const me=A.current.getBoundingClientRect().height,se=(ee.clientY-F.current.startY)/me*100;M(Math.max(10,Math.min(70,F.current.startPct+se)))},Q=()=>{document.removeEventListener("mousemove",B),document.removeEventListener("mouseup",Q)};document.addEventListener("mousemove",B),document.addEventListener("mouseup",Q)},[D]),re=g.jsxs("div",{className:"h-full flex flex-col",children:[g.jsxs("button",{className:"w-full flex items-center gap-2 px-4 sm:px-5 py-2 text-tiny uppercase tracking-wider hover:bg-[--bg-hover] transition-colors flex-shrink-0",style:{color:"var(--text-muted)"},onClick:()=>c(!o),children:[g.jsx("svg",{className:`w-3 h-3 transition-transform ${o?"rotate-0":"-rotate-90"}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})}),"Task Details"]}),o&&g.jsxs("div",{className:"flex-1 overflow-y-auto px-4 sm:px-5 pb-4 space-y-4",children:[u==="schedule"?g.jsx("div",{children:g.jsx(Ei,{label:"Schedule",children:g.jsx(eD,{value:f,onChange:h,onSave:E,onCancel:v,saving:y})})}):g.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 sm:gap-4",children:[g.jsx(Ei,{label:"Schedule",children:g.jsx(tD,{schedule:e.schedule,onClick:()=>_("schedule")})}),g.jsx(Ei,{label:"Model",children:g.jsx(Uc,{value:e.model??"",onChange:N,models:i.models,placeholder:"Default"})}),g.jsx(Ei,{label:"Channel",children:g.jsx("span",{className:"text-body",style:{color:"var(--text-primary)"},children:(n==null?void 0:n.name)??"Default"})}),g.jsx(Ei,{label:"Status",children:g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("div",{className:"w-2 h-2 rounded-full",style:{background:e.enabled?"var(--accent-green)":"var(--accent-yellow)"}}),g.jsx("span",{className:"text-body",style:{color:"var(--text-primary)"},children:e.enabled?"Active":"Paused"})]})})]}),g.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3 sm:gap-4",children:[g.jsx(Ei,{label:"Cron Job ID",children:g.jsx("span",{className:"text-caption font-mono",style:{color:"var(--text-secondary)"},children:e.openclawCronJobId??"N/A"})}),g.jsx(Ei,{label:"Created",children:g.jsx("span",{className:"text-caption",style:{color:"var(--text-secondary)"},children:e.createdAt?mv(e.createdAt):"N/A"})}),g.jsx(Ei,{label:"Updated",children:g.jsx("span",{className:"text-caption",style:{color:"var(--text-secondary)"},children:e.updatedAt?mv(e.updatedAt):"N/A"})})]}),g.jsxs("div",{children:[g.jsxs("div",{className:"flex items-center justify-between mb-1",children:[g.jsx("span",{className:"text-tiny uppercase tracking-wider",style:{color:"var(--text-muted)"},children:"Prompt / Instructions"}),u!=="instructions"&&g.jsx("button",{onClick:()=>_("instructions"),className:"text-tiny px-2 py-0.5 rounded-sm transition-colors hover:bg-[--bg-hover]",style:{color:"var(--text-link)"},children:"Edit"})]}),u==="instructions"?g.jsxs("div",{children:[g.jsx("textarea",{ref:p,value:f,onChange:oe=>h(oe.target.value),onKeyDown:oe=>{oe.key==="Escape"&&v(),oe.key==="Enter"&&(oe.metaKey||oe.ctrlKey)&&(oe.preventDefault(),E())},placeholder:"Enter the prompt or instructions for this cron task...",rows:6,className:"w-full text-caption p-3 rounded-md resize-y focus:outline-none",style:{background:"var(--bg-hover)",color:"var(--text-primary)",border:"1px solid var(--bg-active)",minHeight:80,maxHeight:300}}),g.jsxs("div",{className:"flex items-center justify-between mt-2",children:[g.jsx("span",{className:"text-tiny",style:{color:"var(--text-muted)"},children:"Cmd/Ctrl+Enter to save, Esc to cancel"}),g.jsx(X0,{saving:y,onSave:E,onCancel:v})]})]}):g.jsx("div",{className:"text-caption p-3 rounded-md whitespace-pre-wrap cursor-pointer hover:border-[--text-muted] transition-colors",style:{background:"var(--bg-hover)",color:e.instructions?"var(--text-primary)":"var(--text-muted)",border:"1px solid transparent",minHeight:48},onClick:()=>_("instructions"),title:"Click to edit",children:e.instructions||"No instructions set. Click to add a prompt for this cron task."})]})]})]});return l?g.jsxs("div",{ref:A,className:"flex-1 min-h-0 flex flex-col",children:[g.jsx("div",{className:"flex-shrink-0 overflow-y-auto",style:{...o?{height:`${D}%`}:{},borderBottom:"1px solid var(--border)"},children:re}),o&&g.jsx("div",{className:"flex-shrink-0 flex items-center justify-center touch-none select-none",style:{height:20,cursor:"row-resize",background:"var(--bg-surface)",borderBottom:"1px solid var(--border)"},onTouchStart:L,onMouseDown:X,children:g.jsx("div",{className:"rounded-full",style:{width:36,height:4,background:"var(--text-muted)",opacity:.4}})}),g.jsx(gv,{cronJobs:i.cronJobs,selectedCronJobId:i.selectedCronJobId,handleSelectJob:T,mobile:!0})]}):g.jsxs(Ts,{orientation:"vertical",defaultLayout:S.defaultLayout,onLayoutChanged:S.onLayoutChanged,id:"botschat-cron-detail-v",className:"flex-1 min-h-0",children:[g.jsx(pr,{id:"cron-info",defaultSize:"40%",minSize:"5%",maxSize:"70%",children:g.jsx("div",{className:"h-full",style:{borderBottom:"1px solid var(--border)"},children:re})}),g.jsx(ws,{direction:"vertical"}),g.jsx(pr,{id:"cron-content-area",children:g.jsx(gv,{cronJobs:i.cronJobs,selectedCronJobId:i.selectedCronJobId,handleSelectJob:T,mobile:!1})})]})}function gv({cronJobs:e,selectedCronJobId:n,handleSelectJob:i,mobile:l}){const o=kc({id:"botschat-cron-content"}),[c,u]=U.useState(!1),f=p=>{i(p),u(!0)},h=g.jsxs("div",{className:"overflow-y-auto h-full",children:[g.jsxs("div",{className:"px-3 py-2",style:{borderBottom:"1px solid var(--border)"},children:[g.jsx("span",{className:"text-tiny uppercase tracking-wider font-bold",style:{color:"var(--text-muted)"},children:"Execution History"}),g.jsxs("span",{className:"text-tiny ml-1",style:{color:"var(--text-muted)"},children:["(",e.length,")"]})]}),e.length===0?g.jsxs("div",{className:"px-4 py-6 text-center",children:[g.jsx("p",{className:"text-tiny",style:{color:"var(--text-muted)"},children:"No runs yet."}),g.jsx("p",{className:"text-tiny mt-1",style:{color:"var(--text-muted)"},children:"Waiting for schedule..."})]}):e.map((p,b)=>{const y=V0(p.status),E=p.number||e.length-b,v=n===p.id;return g.jsxs("button",{onClick:()=>l?f(p.id):i(p.id),className:`w-full text-left px-3 py-2 hover:bg-[--bg-hover] transition-colors ${v?"bg-[--bg-hover]":""}`,style:{borderBottom:"1px solid var(--border)",...v?{borderLeft:"3px solid var(--bg-active)"}:{}},children:[g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsxs("span",{className:"text-tiny font-mono",style:{color:"var(--text-muted)"},children:["#",E]}),g.jsxs("span",{className:"text-tiny px-1.5 py-0.5 rounded-sm font-bold flex items-center gap-1",style:{background:y.bg,color:y.fg},children:[p.status==="running"&&g.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full animate-pulse",style:{background:"var(--text-link)"}}),q0(p.status)]})]}),g.jsxs("div",{className:"text-tiny mt-0.5",style:{color:"var(--text-muted)"},children:[p.time,p.durationMs!=null&&g.jsxs("span",{className:"ml-1",children:["(",(p.durationMs/1e3).toFixed(1),"s)"]})]}),p.summary&&g.jsx("div",{className:"text-caption mt-1 truncate",style:{color:"var(--text-secondary)"},children:p.summary})]},p.id)})]});return l?c&&n?g.jsxs("div",{className:"flex-1 flex flex-col min-h-0",children:[g.jsxs("button",{onClick:()=>u(!1),className:"flex items-center gap-1 px-4 py-2 text-caption flex-shrink-0",style:{borderBottom:"1px solid var(--border)",color:"var(--text-link)"},children:[g.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 19.5L8.25 12l7.5-7.5"})}),"Back to History"]}),g.jsx("div",{className:"flex-1 min-h-0",children:g.jsx(bv,{jobs:e,selectedJobId:n})})]}):g.jsx("div",{className:"flex-1 min-h-0",children:h}):g.jsxs(Ts,{orientation:"horizontal",defaultLayout:o.defaultLayout,onLayoutChanged:o.onLayoutChanged,id:"botschat-cron-content",className:"flex-1 min-h-0",children:[g.jsx(pr,{id:"cron-jobs",defaultSize:"20%",minSize:"8%",maxSize:"40%",children:h}),g.jsx(ws,{}),g.jsx(pr,{id:"cron-output",children:g.jsx(bv,{jobs:e,selectedJobId:n})})]})}const rD=`prose prose-sm max-w-none
843
+ prose-p:my-1.5 prose-ul:my-1.5 prose-ol:my-1.5
844
+ prose-pre:my-2 prose-pre:rounded-md prose-pre:text-caption
845
+ prose-code:before:content-none prose-code:after:content-none
846
+ prose-code:px-1 prose-code:py-0.5 prose-code:rounded-sm prose-code:text-caption
847
+ prose-table:my-2 prose-th:px-3 prose-th:py-1.5 prose-td:px-3 prose-td:py-1.5
848
+ prose-h1:text-lg prose-h2:text-base prose-h3:text-sm
849
+ prose-li:my-0.5
850
+ prose-blockquote:border-l-2 prose-blockquote:pl-4 prose-blockquote:my-2
851
+ prose-hr:my-4`,iD={color:"var(--text-primary)","--tw-prose-headings":"var(--text-primary)","--tw-prose-bold":"var(--text-primary)","--tw-prose-links":"var(--text-link)","--tw-prose-code":"var(--text-primary)","--tw-prose-pre-code":"var(--text-primary)","--tw-prose-pre-bg":"var(--code-bg)","--tw-prose-th-borders":"var(--border)","--tw-prose-td-borders":"var(--border)","--tw-prose-quotes":"var(--text-secondary)","--tw-prose-quote-borders":"var(--border)","--tw-prose-bullets":"var(--text-muted)","--tw-prose-counters":"var(--text-muted)","--tw-prose-hr":"var(--border)"};function aD(e){return e.split(/\n\n---\n\n/).filter(n=>n.trim())}function bv({jobs:e,selectedJobId:n}){const i=n?e.find(f=>f.id===n):null,l=U.useRef(null);if(U.useEffect(()=>{l.current&&(i==null?void 0:i.status)==="running"&&(l.current.scrollTop=l.current.scrollHeight)},[i==null?void 0:i.summary,i==null?void 0:i.status]),!i)return g.jsx("div",{className:"flex-1 h-full flex items-center justify-center",style:{background:"var(--bg-surface)"},children:g.jsx("p",{className:"text-caption",style:{color:"var(--text-muted)"},children:e.length>0?"Select a run to view output":"No execution history yet"})});const o=V0(i.status),c=i.status==="running",u=i.summary?aD(i.summary):[];return g.jsxs("div",{className:"flex-1 h-full flex flex-col min-w-0",style:{background:"var(--bg-surface)"},children:[g.jsxs("div",{className:"flex items-center gap-3 px-5 py-2.5 flex-shrink-0",style:{borderBottom:"1px solid var(--border)"},children:[g.jsx("span",{className:"text-tiny px-2 py-0.5 rounded-sm font-bold",style:{background:o.bg,color:o.fg},children:q0(i.status)}),c&&g.jsx("span",{className:"inline-block w-2 h-2 rounded-full animate-pulse",style:{background:"var(--text-link)"}}),g.jsx("span",{className:"text-caption",style:{color:"var(--text-secondary)"},children:i.time}),i.durationMs!=null&&g.jsx("span",{className:"text-caption",style:{color:"var(--text-muted)"},children:i.durationMs>=6e4?`${(i.durationMs/6e4).toFixed(1)}m`:`${(i.durationMs/1e3).toFixed(1)}s`})]}),g.jsx("div",{className:"flex-1 overflow-y-auto px-5 py-4",ref:l,children:u.length>0?g.jsxs("div",{className:"flex flex-col gap-3",children:[u.map((f,h)=>{const p=h===u.length-1,b=c&&p;return g.jsxs("div",{className:"rounded-md px-4 py-3",style:{background:"var(--bg-primary)",border:b?"1px solid var(--text-link)":"1px solid var(--border)"},children:[g.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[g.jsx("span",{className:"text-tiny font-bold px-1.5 py-0.5 rounded-sm",style:{background:b?"var(--text-link)":"var(--bg-surface)",color:b?"#fff":"var(--text-muted)"},children:u.length>1?`#${h+1}`:"Output"}),b&&g.jsxs("div",{className:"flex items-center gap-1",children:[g.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full animate-pulse",style:{background:"var(--text-link)"}}),g.jsx("span",{className:"text-tiny",style:{color:"var(--text-link)"},children:"streaming..."})]}),!b&&!c&&u.length>1&&g.jsx("span",{className:"text-tiny",style:{color:"var(--text-muted)"},children:"completed"})]}),g.jsx("div",{className:rD,style:iD,children:g.jsx(bx,{remarkPlugins:[Px],children:f})})]},h)}),c&&g.jsxs("div",{className:"flex items-center gap-1.5 pl-2",children:[g.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full animate-pulse",style:{background:"var(--text-link)"}}),g.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full animate-pulse",style:{background:"var(--text-link)",animationDelay:"0.2s"}}),g.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full animate-pulse",style:{background:"var(--text-link)",animationDelay:"0.4s"}})]})]}):c?g.jsxs("div",{className:"flex items-center gap-1.5 py-2 pl-1",children:[g.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full animate-pulse",style:{background:"var(--text-link)"}}),g.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full animate-pulse",style:{background:"var(--text-link)",animationDelay:"0.2s"}}),g.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full animate-pulse",style:{background:"var(--text-link)",animationDelay:"0.4s"}})]}):g.jsx("div",{className:"flex items-center justify-center h-full",children:g.jsx("p",{className:"text-caption",style:{color:"var(--text-muted)"},children:"No output recorded for this run."})})})]})}function Ei({label:e,children:n}){return g.jsxs("div",{className:"min-w-0",children:[g.jsx("div",{className:"text-tiny uppercase tracking-wider mb-1",style:{color:"var(--text-muted)"},children:e}),n]})}function X0({saving:e,onSave:n,onCancel:i}){return g.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[g.jsx("button",{onClick:n,disabled:e,className:"px-2 py-1 text-tiny font-bold text-white rounded-sm disabled:opacity-50",style:{background:"var(--bg-active)"},children:e?"...":"Save"}),g.jsx("button",{onClick:i,className:"px-2 py-1 text-tiny rounded-sm",style:{color:"var(--text-muted)"},children:"Cancel"})]})}function lD({sendMessage:e,theme:n,onToggleTheme:i,showSettings:l,onOpenSettings:o,onCloseSettings:c,handleDefaultModelChange:u,handleSelectJob:f}){var X,re,oe,B,Q,ee,me,se,$,j;const h=nr(),p=Fr(),[b,y]=U.useState(()=>h.activeView==="automations"?"cron-list":h.selectedAgentId&&h.selectedSessionKey?"chat":"channel-list"),[E,v]=U.useState(!1),_=h.activeView,N=U.useCallback(O=>{p({type:"SET_ACTIVE_VIEW",view:O}),O==="messages"?h.selectedAgentId&&h.selectedSessionKey?y("chat"):y("channel-list"):h.selectedCronTaskId?y("cron-detail"):y("cron-list")},[p,h.selectedAgentId,h.selectedSessionKey,h.selectedCronTaskId]),T=Si.useRef(h.selectedAgentId);Si.useEffect(()=>{h.selectedAgentId&&h.selectedAgentId!==T.current&&b==="channel-list"&&y("chat"),T.current=h.selectedAgentId},[h.selectedAgentId,b]);const S=Si.useRef(h.selectedCronTaskId);Si.useEffect(()=>{h.selectedCronTaskId&&h.selectedCronTaskId!==S.current&&b==="cron-list"&&y("cron-detail"),S.current=h.selectedCronTaskId},[h.selectedCronTaskId,b]),Si.useEffect(()=>{h.activeThreadId&&b==="chat"&&y("thread")},[h.activeThreadId,b]),Si.useEffect(()=>{!h.activeThreadId&&b==="thread"&&y("chat")},[h.activeThreadId,b]);const D=()=>{var O;ce.info("Auth",`Mobile logout — user ${(O=h.user)==null?void 0:O.email}`),Ls(null),Bc(null),p({type:"LOGOUT"})},M=((oe=(re=(X=h.user)==null?void 0:X.displayName)==null?void 0:re[0])==null?void 0:oe.toUpperCase())??((ee=(Q=(B=h.user)==null?void 0:B.email)==null?void 0:Q[0])==null?void 0:ee.toUpperCase())??"?",A=U.useCallback(()=>{switch(b){case"chat":y("channel-list");break;case"thread":p({type:"CLOSE_THREAD"}),y("chat");break;case"cron-detail":y("cron-list");break}},[b,p]),F=()=>{switch(b){case"channel-list":return"BotsChat";case"chat":{const O=h.agents.find(P=>P.id===h.selectedAgentId);return`# ${(O==null?void 0:O.name)??"Chat"}`}case"thread":return"Thread";case"cron-list":return"Automations";case"cron-detail":{const O=h.cronTasks.find(P=>P.id===h.selectedCronTaskId);return(O==null?void 0:O.name)??"Task Detail"}default:return"BotsChat"}},L=b!=="channel-list"&&b!=="cron-list";return g.jsxs("div",{className:"flex flex-col h-screen",style:{background:"var(--bg-surface)"},children:[g.jsxs("div",{className:"flex items-center justify-between px-4 flex-shrink-0",style:{height:44,paddingTop:"env(safe-area-inset-top, 0px)",background:"var(--bg-primary)",borderBottom:"1px solid var(--border)"},children:[g.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[L&&g.jsx("button",{onClick:A,className:"p-1 -ml-1 rounded",style:{color:"var(--text-link)"},"aria-label":"Back",children:g.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 19.5L8.25 12l7.5-7.5"})})}),g.jsx("span",{className:"text-h2 font-bold truncate",style:{color:"var(--text-primary)"},children:F()})]}),g.jsxs("div",{className:"flex items-center gap-1",children:[g.jsx("div",{className:"w-2 h-2 rounded-full mr-1",style:{background:h.openclawConnected?"var(--accent-green)":"var(--accent-red)"}}),g.jsx("button",{onClick:o,className:"p-1.5 rounded",style:{color:"var(--text-muted)"},children:g.jsxs("svg",{className:"w-4.5 h-4.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:[g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.324.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 011.37.49l1.296 2.247a1.125 1.125 0 01-.26 1.431l-1.003.827c-.293.24-.438.613-.431.992a6.759 6.759 0 010 .255c-.007.378.138.75.43.99l1.005.828c.424.35.534.954.26 1.43l-1.298 2.247a1.125 1.125 0 01-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.57 6.57 0 01-.22.128c-.331.183-.581.495-.644.869l-.213 1.28c-.09.543-.56.941-1.11.941h-2.594c-.55 0-1.02-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 01-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 01-1.369-.49l-1.297-2.247a1.125 1.125 0 01.26-1.431l1.004-.827c.292-.24.437-.613.43-.992a6.932 6.932 0 010-.255c.007-.378-.138-.75-.43-.99l-1.004-.828a1.125 1.125 0 01-.26-1.43l1.297-2.247a1.125 1.125 0 011.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.087.22-.128.332-.183.582-.495.644-.869l.214-1.281z"}),g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]})}),g.jsx("button",{onClick:()=>v(!E),className:"w-6 h-6 rounded flex items-center justify-center text-[10px] font-bold text-white",style:{background:"#9B59B6"},title:((me=h.user)==null?void 0:me.displayName)??((se=h.user)==null?void 0:se.email)??"User",children:M})]})]}),E&&g.jsx("div",{className:"fixed inset-0 z-50",onClick:()=>v(!1),children:g.jsxs("div",{className:"absolute right-4 rounded-lg py-1 min-w-[200px]",style:{top:"calc(44px + env(safe-area-inset-top, 0px) + 4px)",background:"var(--bg-surface)",border:"1px solid var(--border)",boxShadow:"0 4px 12px rgba(0,0,0,0.15)"},onClick:O=>O.stopPropagation(),children:[g.jsxs("div",{className:"px-4 py-2.5",style:{borderBottom:"1px solid var(--border)"},children:[g.jsx("div",{className:"text-body font-bold",style:{color:"var(--text-primary)"},children:(($=h.user)==null?void 0:$.displayName)??"User"}),g.jsx("div",{className:"text-caption",style:{color:"var(--text-muted)"},children:(j=h.user)==null?void 0:j.email})]}),g.jsxs("button",{className:"w-full text-left px-4 py-2.5 text-body flex items-center gap-2.5",style:{color:"var(--text-primary)"},onClick:()=>{i(),v(!1)},children:[n==="dark"?g.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3v2.25m6.364.386l-1.591 1.591M21 12h-2.25m-.386 6.364l-1.591-1.591M12 18.75V21m-4.773-4.227l-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0z"})}):g.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21.752 15.002A9.718 9.718 0 0118 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 003 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 009.002-5.998z"})}),n==="dark"?"Light Mode":"Dark Mode"]}),g.jsx("div",{style:{borderTop:"1px solid var(--border)"}}),g.jsxs("button",{className:"w-full text-left px-4 py-2.5 text-body flex items-center gap-2.5",style:{color:"var(--accent-red)"},onClick:()=>{D(),v(!1)},children:[g.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 9V5.25A2.25 2.25 0 0013.5 3h-6a2.25 2.25 0 00-2.25 2.25v13.5A2.25 2.25 0 007.5 21h6a2.25 2.25 0 002.25-2.25V15m3 0l3-3m0 0l-3-3m3 3H9"})}),"Logout"]})]})}),g.jsxs("div",{className:"flex-1 min-h-0 flex flex-col overflow-hidden",children:[b==="channel-list"&&g.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",style:{background:"var(--bg-secondary)"},children:g.jsx(Iv,{})}),b==="chat"&&g.jsx("div",{className:"flex-1 min-h-0 flex flex-col",children:g.jsx(m0,{sendMessage:e})}),b==="thread"&&g.jsx("div",{className:"flex-1 min-h-0 flex flex-col",children:g.jsx(g0,{sendMessage:e})}),b==="cron-list"&&g.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",style:{background:"var(--bg-secondary)"},children:g.jsx($0,{})}),b==="cron-detail"&&g.jsx("div",{className:"flex-1 min-h-0 flex flex-col overflow-hidden",children:g.jsx(Y0,{})})]}),g.jsxs("div",{className:"flex items-stretch flex-shrink-0",style:{height:56,background:"var(--bg-primary)",borderTop:"1px solid var(--border)",paddingBottom:"env(safe-area-inset-bottom, 0px)"},children:[g.jsx(yv,{label:"Messages",active:_==="messages",onClick:()=>N("messages"),icon:g.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.25 8.511c.884.284 1.5 1.128 1.5 2.097v4.286c0 1.136-.847 2.1-1.98 2.193-.34.027-.68.052-1.02.072v3.091l-3-3c-1.354 0-2.694-.055-4.02-.163a2.115 2.115 0 01-.825-.242m9.345-8.334a2.126 2.126 0 00-.476-.095 48.64 48.64 0 00-8.048 0c-1.131.094-1.976 1.057-1.976 2.192v4.286c0 .837.46 1.58 1.155 1.951m9.345-8.334V6.637c0-1.621-1.152-3.026-2.76-3.235A48.455 48.455 0 0011.25 3c-2.115 0-4.198.137-6.24.402-1.608.209-2.76 1.614-2.76 3.235v6.226c0 1.621 1.152 3.026 2.76 3.235.577.075 1.157.14 1.74.194V21l4.155-4.155"})})}),g.jsx(yv,{label:"Automations",active:_==="automations",onClick:()=>N("automations"),icon:g.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z"})})})]}),l&&g.jsx(sD,{state:h,onClose:c,handleDefaultModelChange:u})]})}function sD({state:e,onClose:n,handleDefaultModelChange:i}){const[l,o]=U.useState("general");return g.jsx("div",{className:"fixed inset-0 flex items-end justify-center z-50",style:{background:"rgba(0,0,0,0.5)"},onClick:n,children:g.jsxs("div",{className:"w-full rounded-t-xl p-5 max-h-[85vh] flex flex-col",style:{background:"var(--bg-surface)",paddingBottom:"calc(20px + env(safe-area-inset-bottom, 0px))"},onClick:c=>c.stopPropagation(),children:[g.jsx("div",{className:"w-10 h-1 rounded-full mx-auto mb-4",style:{background:"var(--text-muted)"}}),g.jsx("h2",{className:"text-h1 font-bold mb-3",style:{color:"var(--text-primary)"},children:"Settings"}),g.jsxs("div",{className:"flex gap-4 mb-4",style:{borderBottom:"1px solid var(--border)"},children:[g.jsx("button",{className:"pb-2 text-caption font-bold transition-colors",style:{color:l==="general"?"var(--text-primary)":"var(--text-muted)",borderBottom:l==="general"?"2px solid var(--bg-active)":"2px solid transparent",marginBottom:"-1px"},onClick:()=>o("general"),children:"General"}),g.jsx("button",{className:"pb-2 text-caption font-bold transition-colors",style:{color:l==="connection"?"var(--text-primary)":"var(--text-muted)",borderBottom:l==="connection"?"2px solid var(--bg-active)":"2px solid transparent",marginBottom:"-1px"},onClick:()=>o("connection"),children:"Connection"})]}),g.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[l==="general"&&g.jsxs("div",{className:"space-y-4",children:[g.jsxs("div",{children:[g.jsx("label",{className:"block text-caption font-bold mb-1.5",style:{color:"var(--text-secondary)"},children:"Default Model"}),g.jsx(Uc,{value:e.defaultModel??"",onChange:i,models:e.models,placeholder:"Not set (use agent default)"})]}),g.jsxs("div",{children:[g.jsx("label",{className:"block text-caption font-bold mb-1.5",style:{color:"var(--text-secondary)"},children:"Current Session Model"}),g.jsx("span",{className:"text-body font-mono",style:{color:e.sessionModel||e.defaultModel?"var(--text-primary)":"var(--text-muted)"},children:e.sessionModel??e.defaultModel??"Not connected"})]})]}),l==="connection"&&g.jsx(P0,{})]}),g.jsx("button",{onClick:n,className:"w-full mt-4 py-2.5 text-caption font-bold text-white rounded-md shrink-0",style:{background:"var(--bg-active)"},children:"Done"})]})})}function yv({label:e,active:n,onClick:i,icon:l}){return g.jsxs("button",{onClick:i,className:"flex-1 flex flex-col items-center justify-center gap-0.5 transition-colors",style:{color:n?"var(--text-link)":"var(--text-muted)"},children:[l,g.jsx("span",{className:"text-[10px] leading-tight",children:e})]})}function oD(){var j;const[e,n]=U.useReducer(FS,ch,O=>{try{const P=localStorage.getItem("botschat_active_view");if(P==="messages"||P==="automations")return{...O,activeView:P}}catch{}return O}),i=U.useRef(null),l=U.useRef(()=>{}),o=U.useRef(!1),[c,u]=U.useState(!1),[f,h]=U.useState("general"),[p,b]=U.useState(!1),y=K0(),E=kc({id:"botschat-main"}),v=kc({id:"botschat-content"}),[_,N]=U.useState(()=>localStorage.getItem("botschat_onboarding_dismissed")==="1"),T=U.useCallback(()=>{N(!0),localStorage.setItem("botschat_onboarding_dismissed","1")},[]),[S,D]=U.useState(()=>{var P;const O=localStorage.getItem("botschat_theme");return O==="light"||O==="dark"?O:(P=window.matchMedia)!=null&&P.call(window,"(prefers-color-scheme: light)").matches?"light":"dark"});U.useEffect(()=>{document.documentElement.setAttribute("data-theme",S),localStorage.setItem("botschat_theme",S);const O=document.querySelector('meta[name="theme-color"]');O&&O.setAttribute("content",S==="dark"?"#1A1D21":"#FFFFFF")},[S]),U.useEffect(()=>{localStorage.setItem("botschat_active_view",e.activeView)},[e.activeView]),U.useEffect(()=>{e.selectedCronTaskId&&localStorage.setItem("botschat_last_cron_task",e.selectedCronTaskId)},[e.selectedCronTaskId]),U.useEffect(()=>{if(e.selectedSessionId){const O=e.agents.find(P=>P.id===e.selectedAgentId);O!=null&&O.channelId&&localStorage.setItem(`botschat_last_session_${O.channelId}`,e.selectedSessionId)}},[e.selectedSessionId,e.selectedAgentId,e.agents]);const M=U.useCallback(()=>{D(O=>O==="dark"?"light":"dark")},[]);U.useEffect(()=>{jb()&&(ce.api("Auth","Auto-login with stored token"),xc.me().then(P=>{var J;ce.info("Auth",`Logged in as ${P.email} (${P.id})`),n({type:"SET_USER",user:P}),(J=P.settings)!=null&&J.defaultModel&&n({type:"SET_DEFAULT_MODEL",model:P.settings.defaultModel})}).catch(P=>{ce.warn("Auth",`Auto-login failed: ${P}`),Ls(null),Bc(null)}))},[]),U.useEffect(()=>{if(!e.user)return;const O=setTimeout(()=>{e.models.length===0&&XS.list().then(({models:P})=>{P.length>0&&n({type:"SET_MODELS",models:P})}).catch(()=>{})},2e3);return()=>clearTimeout(O)},[e.user,e.models.length]),U.useEffect(()=>{e.user&&(ce.api("Agents","Loading agents list"),nl.list().then(({agents:O})=>{if(ce.info("Agents",`Loaded ${O.length} agents`,O.map(P=>({id:P.id,name:P.name,channelId:P.channelId}))),n({type:"SET_AGENTS",agents:O}),O.length>0&&!e.selectedAgentId){let P=O[0];try{const J=localStorage.getItem("botschat_last_agent");if(J){const C=O.find(R=>R.id===J);C&&(ce.info("Agents",`Restoring last channel: ${C.name} (${C.id})`),P=C)}}catch{}n({type:"SELECT_AGENT",agentId:P.id,sessionKey:P.sessionKey})}}),ce.api("Channels","Loading channels list"),mr.list().then(({channels:O})=>{ce.info("Channels",`Loaded ${O.length} channels`,O.map(P=>({id:P.id,name:P.name}))),n({type:"SET_CHANNELS",channels:O}),b(!0)}))},[e.user]),U.useEffect(()=>{e.user&&e.activeView==="automations"&&(ce.api("Cron","Loading all background tasks + scan data"),Promise.all([Vn.listAll("background"),Vn.scanData()]).then(([{tasks:O},{tasks:P}])=>{if(ce.info("Cron",`Loaded ${O.length} cron tasks + ${P.length} scan entries`),n({type:"SET_CRON_TASKS",cronTasks:O}),n({type:"MERGE_SCAN_DATA",scanTasks:P.map(J=>({cronJobId:J.cronJobId,schedule:J.schedule,instructions:J.instructions,model:J.model||void 0,enabled:J.enabled}))}),O.length>0&&!e.selectedCronTaskId){let J=O[0].id;try{const C=localStorage.getItem("botschat_last_cron_task");if(C){const R=O.find(q=>q.id===C);R&&(ce.info("Cron",`Restoring last cron task: ${R.name} (${R.id})`),J=R.id)}}catch{}n({type:"SELECT_CRON_TASK",taskId:J})}}))},[e.user,e.activeView]);const A=(j=e.agents.find(O=>O.id===e.selectedAgentId))==null?void 0:j.channelId,F=e.activeView==="messages";U.useEffect(()=>{if(!F)return;if(!e.selectedAgentId){n({type:"SET_TASKS",tasks:[]}),n({type:"SELECT_TASK",taskId:null}),n({type:"SET_SESSIONS",sessions:[]});return}const O=e.agents.find(P=>P.id===e.selectedAgentId);O!=null&&O.channelId?(O.isDefault?(n({type:"SET_TASKS",tasks:[]}),n({type:"SELECT_TASK",taskId:null})):Vn.list(O.channelId).then(({tasks:P})=>{if(n({type:"SET_TASKS",tasks:P}),P.length>0){const J=P[0];n({type:"SELECT_TASK",taskId:J.id})}}),tl.list(O.channelId).then(({sessions:P})=>{if(ce.info("Sessions",`Loaded ${P.length} sessions for channel ${O.channelId}`),n({type:"SET_SESSIONS",sessions:P}),P.length>0){let J=P[0];try{const C=localStorage.getItem(`botschat_last_session_${O.channelId}`);if(C){const R=P.find(q=>q.id===C);R&&(ce.info("Sessions",`Restoring last session: ${R.name} (${R.id})`),J=R)}}catch{}n({type:"SELECT_SESSION",sessionId:J.id,sessionKey:J.sessionKey})}}).catch(P=>{ce.error("Sessions",`Failed to load sessions: ${P}`)})):O!=null&&O.isDefault&&!o.current&&_?(ce.info("Sessions","Default agent has no channel — auto-creating General channel"),o.current=!0,n({type:"SET_TASKS",tasks:[]}),n({type:"SELECT_TASK",taskId:null}),n({type:"SET_SESSIONS",sessions:[]}),mr.create({name:"General",openclawAgentId:"main"}).then(async P=>{ce.info("Sessions",`General channel created: ${P.id}`);const[{agents:J},{channels:C}]=await Promise.all([nl.list(),mr.list()]);n({type:"SET_AGENTS",agents:J}),n({type:"SET_CHANNELS",channels:C});const{sessions:R}=await tl.list(P.id);n({type:"SET_SESSIONS",sessions:R}),R.length>0&&n({type:"SELECT_SESSION",sessionId:R[0].id,sessionKey:R[0].sessionKey})}).catch(P=>{ce.error("Sessions",`Failed to auto-create General channel: ${P}`),o.current=!1})):(n({type:"SET_TASKS",tasks:[]}),n({type:"SELECT_TASK",taskId:null}),n({type:"SET_SESSIONS",sessions:[]}))},[e.selectedAgentId,A,F,_]),U.useEffect(()=>{if(!e.selectedTaskId)return;const O=e.tasks.find(J=>J.id===e.selectedTaskId);if(!O||O.kind!=="background"){n({type:"SET_JOBS",jobs:[]});return}const P=e.agents.find(J=>J.id===e.selectedAgentId);P!=null&&P.channelId&&zf.list(P.channelId,O.id).then(({jobs:J})=>{n({type:"SET_JOBS",jobs:J}),J.length>0&&!e.selectedJobId&&n({type:"SELECT_JOB",jobId:J[0].id,sessionKey:J[0].sessionKey})}).catch(J=>{console.error("Failed to load jobs:",J)})},[e.selectedTaskId,e.tasks]),U.useEffect(()=>{if(!e.user||!e.selectedSessionKey)return;let O=!1;return Dv.list(e.user.id,e.selectedSessionKey).then(({messages:P,replyCounts:J})=>{O||n({type:"SET_MESSAGES",messages:P,replyCounts:J})}).catch(P=>{console.error("Failed to load message history:",P)}),()=>{O=!0}},[e.user,e.selectedSessionKey]);const L=U.useRef(e);U.useEffect(()=>{L.current=e},[e]);const X=U.useCallback(O=>{var q;const P=O.sessionKey,J=O.threadId??O.replyToId;ce.wsIn("WS",`${O.type}`,O);const C=w=>{if(w)return w.replace(/:thread:.+$/,"")},R=w=>w?C(w)===L.current.selectedSessionKey:!0;switch(O.type){case"connection.status":ce.info("Connection",`OpenClaw ${O.openclawConnected?"connected":"disconnected"}${O.defaultModel?` (default: ${O.defaultModel})`:""}`),n({type:"SET_OPENCLAW_CONNECTED",connected:O.openclawConnected,defaultModel:O.defaultModel||void 0}),Array.isArray(O.models)&&O.models.length>0&&n({type:"SET_MODELS",models:O.models});break;case"openclaw.disconnected":ce.warn("Connection","OpenClaw disconnected"),n({type:"SET_OPENCLAW_CONNECTED",connected:!1});break;case"model.changed":if(O.model&&O.sessionKey){ce.info("Model",`Session model changed to: ${O.model} (session: ${O.sessionKey})`),n({type:"SET_SESSION_MODEL",model:O.model});try{const w=JSON.parse(localStorage.getItem("botschat:sessionModels")||"{}");w[O.sessionKey]=O.model,localStorage.setItem("botschat:sessionModels",JSON.stringify(w))}catch{}}break;case"agent.stream.start":if(P&&R(P)){const w=J??((q=P.match(/:thread:(.+)$/))==null?void 0:q[1]);n({type:"STREAM_START",runId:O.runId,sessionKey:P,threadId:w})}break;case"agent.stream.chunk":n({type:"STREAM_CHUNK",runId:O.runId,sessionKey:P??"",text:O.text});break;case"agent.stream.end":n({type:"STREAM_END",runId:O.runId});break;case"agent.text":{if(!R(P))break;const w={id:crypto.randomUUID(),sender:"agent",text:O.text,timestamp:Date.now(),threadId:J};n(J&&P?{type:"ADD_THREAD_MESSAGE",message:w}:{type:"ADD_MESSAGE",message:w});break}case"agent.media":{if(!R(P))break;const w={id:crypto.randomUUID(),sender:"agent",text:O.caption??"",mediaUrl:O.mediaUrl,timestamp:Date.now(),threadId:J};n(J&&P?{type:"ADD_THREAD_MESSAGE",message:w}:{type:"ADD_MESSAGE",message:w});break}case"agent.a2ui":{if(!R(P))break;const w={id:crypto.randomUUID(),sender:"agent",text:"",a2ui:O.jsonl,timestamp:Date.now(),threadId:J};n(J&&P?{type:"ADD_THREAD_MESSAGE",message:w}:{type:"ADD_MESSAGE",message:w});break}case"job.update":{const w={id:O.jobId,number:0,sessionKey:O.sessionKey,status:O.status,startedAt:O.startedAt,finishedAt:O.finishedAt??null,durationMs:O.durationMs??null,summary:O.summary??"",time:new Date((O.startedAt??0)*1e3).toLocaleString()};if(w.status==="running")n({type:"ADD_JOB",job:w});else{const ue=L.current,ye=ue.jobs.some(K=>K.id===w.id);n(ye?{type:"SET_JOBS",jobs:ue.jobs.map(K=>K.id===w.id?{...K,...w}:K)}:{type:"ADD_JOB",job:w})}w.status==="running"?n({type:"ADD_CRON_JOB",job:w}):n({type:"UPDATE_CRON_JOB",job:w});break}case"job.output":{const w=O.jobId,ue=O.text;w&&ue&&n({type:"APPEND_JOB_OUTPUT",jobId:w,text:ue});break}case"task.scan.result":{const w=O.tasks??[];ce.info("TaskScan",`Scan result: ${w.length} tasks reported`,w),nl.list().then(({agents:ye})=>{ce.info("TaskScan",`Reloaded ${ye.length} agents`),n({type:"SET_AGENTS",agents:ye})}),mr.list().then(({channels:ye})=>{ce.info("TaskScan",`Reloaded ${ye.length} channels`),n({type:"SET_CHANNELS",channels:ye})}),Vn.listAll("background").then(({tasks:ye})=>{ce.info("TaskScan",`Reloaded ${ye.length} cron tasks, merging scan data`),n({type:"SET_CRON_TASKS",cronTasks:ye}),n({type:"MERGE_SCAN_DATA",scanTasks:w.map(K=>({cronJobId:K.cronJobId,schedule:K.schedule,instructions:K.instructions??"",model:K.model,enabled:K.enabled}))})});const ue=L.current;if(ue.selectedAgentId){const ye=ue.agents.find(K=>K.id===ue.selectedAgentId);ye!=null&&ye.channelId&&Vn.list(ye.channelId).then(({tasks:K})=>{n({type:"SET_TASKS",tasks:K})})}break}case"status":break;case"models.list":Array.isArray(O.models)&&n({type:"SET_MODELS",models:O.models});break;case"task.schedule.ack":O.ok?ce.info("Task",`Schedule applied to OpenClaw: ${O.cronJobId}`):ce.error("Task",`Schedule push to OpenClaw failed: ${O.error}`,O);break;case"error":ce.error("Server",O.message,O);break}},[]);U.useEffect(()=>{l.current=X},[X]),U.useEffect(()=>{if(!e.user)return;const O=jb();if(!O)return;const P=crypto.randomUUID();ce.info("WS",`Connecting WebSocket (session=${P.slice(0,8)}...)`);const J=new ZS({userId:e.user.id,sessionId:P,token:O,onMessage:C=>{l.current(C)},onStatusChange:C=>{ce.info("WS",C?"WebSocket connected":"WebSocket disconnected"),n({type:"SET_WS_CONNECTED",connected:C})}});return J.connect(),i.current=J,()=>{J.disconnect(),i.current=null}},[e.user]);const re=U.useCallback(O=>{var P;ce.wsOut("WS",`${O.type}`,O),(P=i.current)==null||P.send(O)},[]),oe=U.useCallback(async O=>{n({type:"SET_DEFAULT_MODEL",model:O||null});try{await YS.updateSettings({defaultModel:O||void 0})}catch(P){console.error("Failed to update default model:",P)}},[]),B=U.useCallback(O=>{const P=e.jobs.find(J=>J.id===O);P&&n({type:"SELECT_JOB",jobId:P.id,sessionKey:P.sessionKey||void 0})},[e.jobs]);if(U.useEffect(()=>{if(e.openclawConnected&&!_){const O=setTimeout(()=>{T()},1500);return()=>clearTimeout(O)}},[e.openclawConnected,_,T]),!e.user)return g.jsx(ps.Provider,{value:e,children:g.jsx(ms.Provider,{value:n,children:g.jsx($R,{})})});if(!_&&p&&e.channels.length===0&&!e.openclawConnected)return g.jsx(ps.Provider,{value:e,children:g.jsx(ms.Provider,{value:n,children:g.jsx(VR,{onSkip:T})})});e.agents.find(O=>O.id===e.selectedAgentId);const ee=e.tasks.find(O=>O.id===e.selectedTaskId),me=(ee==null?void 0:ee.kind)==="background",se=!!e.selectedSessionKey,$=e.activeView==="automations";return y?g.jsx(ps.Provider,{value:e,children:g.jsx(ms.Provider,{value:n,children:g.jsx(lD,{sendMessage:re,theme:S,onToggleTheme:M,showSettings:c,onOpenSettings:()=>u(!0),onCloseSettings:()=>u(!1),handleDefaultModelChange:oe,handleSelectJob:B})})}):g.jsx(ps.Provider,{value:e,children:g.jsxs(ms.Provider,{value:n,children:[g.jsxs("div",{className:"flex flex-col h-screen",children:[g.jsxs("div",{className:"flex flex-1 min-h-0",children:[g.jsx(QS,{onToggleTheme:M,onOpenSettings:()=>u(!0),theme:S}),g.jsxs(Ts,{orientation:"horizontal",defaultLayout:E.defaultLayout,onLayoutChanged:E.onLayoutChanged,id:"botschat-main",className:"flex-1",children:[g.jsx(pr,{id:"sidebar",defaultSize:"15%",minSize:"5%",maxSize:"30%",children:$?g.jsx($0,{}):g.jsx(Iv,{})}),g.jsx(ws,{}),g.jsx(pr,{id:"content",children:$?g.jsx(Y0,{}):g.jsx("div",{className:"flex-1 flex flex-col min-w-0 h-full",children:se?g.jsxs(Ts,{orientation:"horizontal",defaultLayout:v.defaultLayout,onLayoutChanged:v.onLayoutChanged,id:"botschat-content",children:[me&&g.jsxs(g.Fragment,{children:[g.jsx(pr,{id:"joblist",defaultSize:"15%",minSize:"5%",maxSize:"30%",children:g.jsx(RO,{jobs:e.jobs,selectedJobId:e.selectedJobId,onSelectJob:B})}),g.jsx(ws,{})]}),g.jsx(pr,{id:"chat",children:g.jsx(m0,{sendMessage:re})}),e.activeThreadId&&g.jsxs(g.Fragment,{children:[g.jsx(ws,{}),g.jsx(pr,{id:"thread",defaultSize:"28%",minSize:"10%",maxSize:"50%",children:g.jsx(g0,{sendMessage:re})})]})]}):g.jsx("div",{className:"flex-1 flex items-center justify-center",style:{background:"var(--bg-surface)"},children:g.jsxs("div",{className:"text-center",children:[g.jsx("svg",{className:"w-20 h-20 mx-auto mb-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1,style:{color:"var(--text-muted)"},children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"})}),g.jsx("p",{className:"text-body font-bold",style:{color:"var(--text-muted)"},children:"Select a channel to get started"}),g.jsx("p",{className:"text-caption mt-1",style:{color:"var(--text-muted)"},children:"Choose a channel from the sidebar"})]})})})})]})]}),g.jsx(QR,{})]}),c&&g.jsx("div",{className:"fixed inset-0 flex items-center justify-center z-50",style:{background:"rgba(0,0,0,0.5)"},onClick:()=>u(!1),children:g.jsxs("div",{className:"rounded-lg p-6 w-[540px] max-w-[90vw] max-h-[85vh] flex flex-col",style:{background:"var(--bg-surface)",boxShadow:"var(--shadow-lg)"},onClick:O=>O.stopPropagation(),children:[g.jsxs("div",{className:"flex items-center justify-between mb-4",children:[g.jsx("h2",{className:"text-h1 font-bold",style:{color:"var(--text-primary)"},children:"Settings"}),g.jsx("button",{onClick:()=>u(!1),className:"p-1 hover:bg-[--bg-hover] rounded",style:{color:"var(--text-muted)"},children:g.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),g.jsxs("div",{className:"flex gap-4 mb-4",style:{borderBottom:"1px solid var(--border)"},children:[g.jsx("button",{className:"pb-2 text-caption font-bold transition-colors",style:{color:f==="general"?"var(--text-primary)":"var(--text-muted)",borderBottom:f==="general"?"2px solid var(--bg-active)":"2px solid transparent",marginBottom:"-1px"},onClick:()=>h("general"),children:"General"}),g.jsx("button",{className:"pb-2 text-caption font-bold transition-colors",style:{color:f==="connection"?"var(--text-primary)":"var(--text-muted)",borderBottom:f==="connection"?"2px solid var(--bg-active)":"2px solid transparent",marginBottom:"-1px"},onClick:()=>h("connection"),children:"Connection"})]}),g.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[f==="general"&&g.jsxs("div",{className:"space-y-5",children:[g.jsxs("div",{children:[g.jsx("label",{className:"block text-caption font-bold mb-1.5",style:{color:"var(--text-secondary)"},children:"Default Model"}),g.jsx(Uc,{value:e.defaultModel??"",onChange:oe,models:e.models,placeholder:"Not set (use agent default)"}),g.jsxs("p",{className:"text-tiny mt-1.5",style:{color:"var(--text-muted)"},children:["Default model for new conversations. You can override per session using"," ",g.jsx("code",{children:"/model"})," or per automation in its settings."]})]}),g.jsxs("div",{children:[g.jsx("label",{className:"block text-caption font-bold mb-1.5",style:{color:"var(--text-secondary)"},children:"Current Session Model"}),g.jsx("span",{className:"text-body font-mono",style:{color:e.sessionModel||e.defaultModel?"var(--text-primary)":"var(--text-muted)"},children:e.sessionModel??e.defaultModel??"Not connected"})]})]}),f==="connection"&&g.jsx(P0,{})]}),g.jsx("div",{className:"mt-4 pt-4 flex justify-end",style:{borderTop:"1px solid var(--border)"},children:g.jsx("button",{onClick:()=>u(!1),className:"px-4 py-1.5 text-caption font-bold text-white rounded-sm",style:{background:"var(--bg-active)"},children:"Done"})})]})})]})})}uS.createRoot(document.getElementById("root")).render(g.jsx(Si.StrictMode,{children:g.jsx(oD,{})}));"serviceWorker"in navigator&&window.addEventListener("load",()=>{navigator.serviceWorker.register("/sw.js").catch(()=>{})});