codekin 0.4.1 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -15
- package/bin/codekin.mjs +52 -32
- package/dist/assets/index-BwKZeT4V.css +1 -0
- package/dist/assets/index-CfBnNU24.js +186 -0
- package/dist/index.html +2 -2
- package/package.json +2 -7
- package/server/dist/approval-manager.d.ts +7 -2
- package/server/dist/approval-manager.js +44 -78
- package/server/dist/approval-manager.js.map +1 -1
- package/server/dist/claude-process.d.ts +23 -3
- package/server/dist/claude-process.js +120 -27
- package/server/dist/claude-process.js.map +1 -1
- package/server/dist/commit-event-handler.js.map +1 -1
- package/server/dist/config.d.ts +4 -0
- package/server/dist/config.js +17 -0
- package/server/dist/config.js.map +1 -1
- package/server/dist/diff-manager.d.ts +41 -0
- package/server/dist/diff-manager.js +303 -0
- package/server/dist/diff-manager.js.map +1 -0
- package/server/dist/error-page.d.ts +5 -0
- package/server/dist/error-page.js +144 -0
- package/server/dist/error-page.js.map +1 -0
- package/server/dist/native-permissions.d.ts +44 -0
- package/server/dist/native-permissions.js +163 -0
- package/server/dist/native-permissions.js.map +1 -0
- package/server/dist/orchestrator-children.d.ts +74 -0
- package/server/dist/orchestrator-children.js +281 -0
- package/server/dist/orchestrator-children.js.map +1 -0
- package/server/dist/orchestrator-learning.d.ts +134 -0
- package/server/dist/orchestrator-learning.js +567 -0
- package/server/dist/orchestrator-learning.js.map +1 -0
- package/server/dist/orchestrator-manager.d.ts +25 -0
- package/server/dist/orchestrator-manager.js +353 -0
- package/server/dist/orchestrator-manager.js.map +1 -0
- package/server/dist/orchestrator-memory.d.ts +77 -0
- package/server/dist/orchestrator-memory.js +288 -0
- package/server/dist/orchestrator-memory.js.map +1 -0
- package/server/dist/orchestrator-monitor.d.ts +59 -0
- package/server/dist/orchestrator-monitor.js +238 -0
- package/server/dist/orchestrator-monitor.js.map +1 -0
- package/server/dist/orchestrator-reports.d.ts +45 -0
- package/server/dist/orchestrator-reports.js +124 -0
- package/server/dist/orchestrator-reports.js.map +1 -0
- package/server/dist/orchestrator-routes.d.ts +17 -0
- package/server/dist/orchestrator-routes.js +526 -0
- package/server/dist/orchestrator-routes.js.map +1 -0
- package/server/dist/session-archive.js +9 -2
- package/server/dist/session-archive.js.map +1 -1
- package/server/dist/session-manager.d.ts +99 -39
- package/server/dist/session-manager.js +565 -394
- package/server/dist/session-manager.js.map +1 -1
- package/server/dist/session-naming.d.ts +6 -10
- package/server/dist/session-naming.js +60 -62
- package/server/dist/session-naming.js.map +1 -1
- package/server/dist/session-persistence.d.ts +6 -1
- package/server/dist/session-persistence.js +6 -0
- package/server/dist/session-persistence.js.map +1 -1
- package/server/dist/session-restart-scheduler.d.ts +30 -0
- package/server/dist/session-restart-scheduler.js +41 -0
- package/server/dist/session-restart-scheduler.js.map +1 -0
- package/server/dist/session-routes.js +122 -61
- package/server/dist/session-routes.js.map +1 -1
- package/server/dist/stepflow-types.d.ts +1 -1
- package/server/dist/tsconfig.tsbuildinfo +1 -1
- package/server/dist/types.d.ts +34 -2
- package/server/dist/types.js +8 -1
- package/server/dist/types.js.map +1 -1
- package/server/dist/upload-routes.js +7 -1
- package/server/dist/upload-routes.js.map +1 -1
- package/server/dist/version-check.d.ts +17 -0
- package/server/dist/version-check.js +89 -0
- package/server/dist/version-check.js.map +1 -0
- package/server/dist/workflow-engine.d.ts +74 -1
- package/server/dist/workflow-engine.js +20 -1
- package/server/dist/workflow-engine.js.map +1 -1
- package/server/dist/ws-message-handler.js +115 -9
- package/server/dist/ws-message-handler.js.map +1 -1
- package/server/dist/ws-server.js +90 -15
- package/server/dist/ws-server.js.map +1 -1
- package/dist/assets/index-BAdQqYEY.js +0 -182
- package/dist/assets/index-CeZYNLWt.css +0 -1
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
function n2(e,n){for(var r=0;r<n.length;r++){const l=n[r];if(typeof l!="string"&&!Array.isArray(l)){for(const s in l)if(s!=="default"&&!(s in e)){const o=Object.getOwnPropertyDescriptor(l,s);o&&Object.defineProperty(e,s,o.get?o:{enumerable:!0,get:()=>l[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))l(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const u of o.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&l(u)}).observe(document,{childList:!0,subtree:!0});function r(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function l(s){if(s.ep)return;s.ep=!0;const o=r(s);fetch(s.href,o)}})();function fo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Gd={exports:{}},js={};var iy;function r2(){if(iy)return js;iy=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function r(l,s,o){var u=null;if(o!==void 0&&(u=""+o),s.key!==void 0&&(u=""+s.key),"key"in s){o={};for(var f in s)f!=="key"&&(o[f]=s[f])}else o=s;return s=o.ref,{$$typeof:e,type:l,key:u,ref:s!==void 0?s:null,props:o}}return js.Fragment=n,js.jsx=r,js.jsxs=r,js}var sy;function a2(){return sy||(sy=1,Gd.exports=r2()),Gd.exports}var d=a2(),qd={exports:{}},Ye={};var oy;function l2(){if(oy)return Ye;oy=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),o=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"),g=Symbol.for("react.lazy"),x=Symbol.for("react.activity"),y=Symbol.iterator;function v(O){return O===null||typeof O!="object"?null:(O=y&&O[y]||O["@@iterator"],typeof O=="function"?O:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,N={};function T(O,I,A){this.props=O,this.context=I,this.refs=N,this.updater=A||w}T.prototype.isReactComponent={},T.prototype.setState=function(O,I){if(typeof O!="object"&&typeof O!="function"&&O!=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,O,I,"setState")},T.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function R(){}R.prototype=T.prototype;function j(O,I,A){this.props=O,this.context=I,this.refs=N,this.updater=A||w}var $=j.prototype=new R;$.constructor=j,E($,T.prototype),$.isPureReactComponent=!0;var B=Array.isArray;function _(){}var D={H:null,A:null,T:null,S:null},F=Object.prototype.hasOwnProperty;function Y(O,I,A){var oe=A.ref;return{$$typeof:e,type:O,key:I,ref:oe!==void 0?oe:null,props:A}}function L(O,I){return Y(O.type,I,O.props)}function X(O){return typeof O=="object"&&O!==null&&O.$$typeof===e}function Z(O){var I={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(A){return I[A]})}var te=/\/+/g;function J(O,I){return typeof O=="object"&&O!==null&&O.key!=null?Z(""+O.key):I.toString(36)}function G(O){switch(O.status){case"fulfilled":return O.value;case"rejected":throw O.reason;default:switch(typeof O.status=="string"?O.then(_,_):(O.status="pending",O.then(function(I){O.status==="pending"&&(O.status="fulfilled",O.value=I)},function(I){O.status==="pending"&&(O.status="rejected",O.reason=I)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function z(O,I,A,oe,le){var he=typeof O;(he==="undefined"||he==="boolean")&&(O=null);var pe=!1;if(O===null)pe=!0;else switch(he){case"bigint":case"string":case"number":pe=!0;break;case"object":switch(O.$$typeof){case e:case n:pe=!0;break;case g:return pe=O._init,z(pe(O._payload),I,A,oe,le)}}if(pe)return le=le(O),pe=oe===""?"."+J(O,0):oe,B(le)?(A="",pe!=null&&(A=pe.replace(te,"$&/")+"/"),z(le,I,A,"",function(qe){return qe})):le!=null&&(X(le)&&(le=L(le,A+(le.key==null||O&&O.key===le.key?"":(""+le.key).replace(te,"$&/")+"/")+pe)),I.push(le)),1;pe=0;var Ae=oe===""?".":oe+":";if(B(O))for(var Re=0;Re<O.length;Re++)oe=O[Re],he=Ae+J(oe,Re),pe+=z(oe,I,A,he,le);else if(Re=v(O),typeof Re=="function")for(O=Re.call(O),Re=0;!(oe=O.next()).done;)oe=oe.value,he=Ae+J(oe,Re++),pe+=z(oe,I,A,he,le);else if(he==="object"){if(typeof O.then=="function")return z(G(O),I,A,oe,le);throw I=String(O),Error("Objects are not valid as a React child (found: "+(I==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":I)+"). If you meant to render a collection of children, use an array instead.")}return pe}function V(O,I,A){if(O==null)return O;var oe=[],le=0;return z(O,oe,"","",function(he){return I.call(A,he,le++)}),oe}function ne(O){if(O._status===-1){var I=O._result;I=I(),I.then(function(A){(O._status===0||O._status===-1)&&(O._status=1,O._result=A)},function(A){(O._status===0||O._status===-1)&&(O._status=2,O._result=A)}),O._status===-1&&(O._status=0,O._result=I)}if(O._status===1)return O._result.default;throw O._result}var be=typeof reportError=="function"?reportError:function(O){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var I=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof O=="object"&&O!==null&&typeof O.message=="string"?String(O.message):String(O),error:O});if(!window.dispatchEvent(I))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",O);return}console.error(O)},M={map:V,forEach:function(O,I,A){V(O,function(){I.apply(this,arguments)},A)},count:function(O){var I=0;return V(O,function(){I++}),I},toArray:function(O){return V(O,function(I){return I})||[]},only:function(O){if(!X(O))throw Error("React.Children.only expected to receive a single React element child.");return O}};return Ye.Activity=x,Ye.Children=M,Ye.Component=T,Ye.Fragment=r,Ye.Profiler=s,Ye.PureComponent=j,Ye.StrictMode=l,Ye.Suspense=h,Ye.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,Ye.__COMPILER_RUNTIME={__proto__:null,c:function(O){return D.H.useMemoCache(O)}},Ye.cache=function(O){return function(){return O.apply(null,arguments)}},Ye.cacheSignal=function(){return null},Ye.cloneElement=function(O,I,A){if(O==null)throw Error("The argument must be a React element, but you passed "+O+".");var oe=E({},O.props),le=O.key;if(I!=null)for(he in I.key!==void 0&&(le=""+I.key),I)!F.call(I,he)||he==="key"||he==="__self"||he==="__source"||he==="ref"&&I.ref===void 0||(oe[he]=I[he]);var he=arguments.length-2;if(he===1)oe.children=A;else if(1<he){for(var pe=Array(he),Ae=0;Ae<he;Ae++)pe[Ae]=arguments[Ae+2];oe.children=pe}return Y(O.type,le,oe)},Ye.createContext=function(O){return O={$$typeof:u,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null},O.Provider=O,O.Consumer={$$typeof:o,_context:O},O},Ye.createElement=function(O,I,A){var oe,le={},he=null;if(I!=null)for(oe in I.key!==void 0&&(he=""+I.key),I)F.call(I,oe)&&oe!=="key"&&oe!=="__self"&&oe!=="__source"&&(le[oe]=I[oe]);var pe=arguments.length-2;if(pe===1)le.children=A;else if(1<pe){for(var Ae=Array(pe),Re=0;Re<pe;Re++)Ae[Re]=arguments[Re+2];le.children=Ae}if(O&&O.defaultProps)for(oe in pe=O.defaultProps,pe)le[oe]===void 0&&(le[oe]=pe[oe]);return Y(O,he,le)},Ye.createRef=function(){return{current:null}},Ye.forwardRef=function(O){return{$$typeof:f,render:O}},Ye.isValidElement=X,Ye.lazy=function(O){return{$$typeof:g,_payload:{_status:-1,_result:O},_init:ne}},Ye.memo=function(O,I){return{$$typeof:p,type:O,compare:I===void 0?null:I}},Ye.startTransition=function(O){var I=D.T,A={};D.T=A;try{var oe=O(),le=D.S;le!==null&&le(A,oe),typeof oe=="object"&&oe!==null&&typeof oe.then=="function"&&oe.then(_,be)}catch(he){be(he)}finally{I!==null&&A.types!==null&&(I.types=A.types),D.T=I}},Ye.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},Ye.use=function(O){return D.H.use(O)},Ye.useActionState=function(O,I,A){return D.H.useActionState(O,I,A)},Ye.useCallback=function(O,I){return D.H.useCallback(O,I)},Ye.useContext=function(O){return D.H.useContext(O)},Ye.useDebugValue=function(){},Ye.useDeferredValue=function(O,I){return D.H.useDeferredValue(O,I)},Ye.useEffect=function(O,I){return D.H.useEffect(O,I)},Ye.useEffectEvent=function(O){return D.H.useEffectEvent(O)},Ye.useId=function(){return D.H.useId()},Ye.useImperativeHandle=function(O,I,A){return D.H.useImperativeHandle(O,I,A)},Ye.useInsertionEffect=function(O,I){return D.H.useInsertionEffect(O,I)},Ye.useLayoutEffect=function(O,I){return D.H.useLayoutEffect(O,I)},Ye.useMemo=function(O,I){return D.H.useMemo(O,I)},Ye.useOptimistic=function(O,I){return D.H.useOptimistic(O,I)},Ye.useReducer=function(O,I,A){return D.H.useReducer(O,I,A)},Ye.useRef=function(O){return D.H.useRef(O)},Ye.useState=function(O){return D.H.useState(O)},Ye.useSyncExternalStore=function(O,I,A){return D.H.useSyncExternalStore(O,I,A)},Ye.useTransition=function(){return D.H.useTransition()},Ye.version="19.2.4",Ye}var uy;function Ap(){return uy||(uy=1,qd.exports=l2()),qd.exports}var k=Ap();const i2=fo(k),Cp=n2({__proto__:null,default:i2},[k]);var Yd={exports:{}},Rs={},Vd={exports:{}},Xd={};var cy;function s2(){return cy||(cy=1,(function(e){function n(z,V){var ne=z.length;z.push(V);e:for(;0<ne;){var be=ne-1>>>1,M=z[be];if(0<s(M,V))z[be]=V,z[ne]=M,ne=be;else break e}}function r(z){return z.length===0?null:z[0]}function l(z){if(z.length===0)return null;var V=z[0],ne=z.pop();if(ne!==V){z[0]=ne;e:for(var be=0,M=z.length,O=M>>>1;be<O;){var I=2*(be+1)-1,A=z[I],oe=I+1,le=z[oe];if(0>s(A,ne))oe<M&&0>s(le,A)?(z[be]=le,z[oe]=ne,be=oe):(z[be]=A,z[I]=ne,be=I);else if(oe<M&&0>s(le,ne))z[be]=le,z[oe]=ne,be=oe;else break e}}return V}function s(z,V){var ne=z.sortIndex-V.sortIndex;return ne!==0?ne:z.id-V.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var u=Date,f=u.now();e.unstable_now=function(){return u.now()-f}}var h=[],p=[],g=1,x=null,y=3,v=!1,w=!1,E=!1,N=!1,T=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,j=typeof setImmediate<"u"?setImmediate:null;function $(z){for(var V=r(p);V!==null;){if(V.callback===null)l(p);else if(V.startTime<=z)l(p),V.sortIndex=V.expirationTime,n(h,V);else break;V=r(p)}}function B(z){if(E=!1,$(z),!w)if(r(h)!==null)w=!0,_||(_=!0,Z());else{var V=r(p);V!==null&&G(B,V.startTime-z)}}var _=!1,D=-1,F=5,Y=-1;function L(){return N?!0:!(e.unstable_now()-Y<F)}function X(){if(N=!1,_){var z=e.unstable_now();Y=z;var V=!0;try{e:{w=!1,E&&(E=!1,R(D),D=-1),v=!0;var ne=y;try{t:{for($(z),x=r(h);x!==null&&!(x.expirationTime>z&&L());){var be=x.callback;if(typeof be=="function"){x.callback=null,y=x.priorityLevel;var M=be(x.expirationTime<=z);if(z=e.unstable_now(),typeof M=="function"){x.callback=M,$(z),V=!0;break t}x===r(h)&&l(h),$(z)}else l(h);x=r(h)}if(x!==null)V=!0;else{var O=r(p);O!==null&&G(B,O.startTime-z),V=!1}}break e}finally{x=null,y=ne,v=!1}V=void 0}}finally{V?Z():_=!1}}}var Z;if(typeof j=="function")Z=function(){j(X)};else if(typeof MessageChannel<"u"){var te=new MessageChannel,J=te.port2;te.port1.onmessage=X,Z=function(){J.postMessage(null)}}else Z=function(){T(X,0)};function G(z,V){D=T(function(){z(e.unstable_now())},V)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(z){z.callback=null},e.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<z?Math.floor(1e3/z):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(z){switch(y){case 1:case 2:case 3:var V=3;break;default:V=y}var ne=y;y=V;try{return z()}finally{y=ne}},e.unstable_requestPaint=function(){N=!0},e.unstable_runWithPriority=function(z,V){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var ne=y;y=z;try{return V()}finally{y=ne}},e.unstable_scheduleCallback=function(z,V,ne){var be=e.unstable_now();switch(typeof ne=="object"&&ne!==null?(ne=ne.delay,ne=typeof ne=="number"&&0<ne?be+ne:be):ne=be,z){case 1:var M=-1;break;case 2:M=250;break;case 5:M=1073741823;break;case 4:M=1e4;break;default:M=5e3}return M=ne+M,z={id:g++,callback:V,priorityLevel:z,startTime:ne,expirationTime:M,sortIndex:-1},ne>be?(z.sortIndex=ne,n(p,z),r(h)===null&&z===r(p)&&(E?(R(D),D=-1):E=!0,G(B,ne-be))):(z.sortIndex=M,n(h,z),w||v||(w=!0,_||(_=!0,Z()))),z},e.unstable_shouldYield=L,e.unstable_wrapCallback=function(z){var V=y;return function(){var ne=y;y=V;try{return z.apply(this,arguments)}finally{y=ne}}}})(Xd)),Xd}var fy;function o2(){return fy||(fy=1,Vd.exports=s2()),Vd.exports}var Kd={exports:{}},Mn={};var dy;function u2(){if(dy)return Mn;dy=1;var e=Ap();function n(h){var p="https://react.dev/errors/"+h;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)p+="&args[]="+encodeURIComponent(arguments[g])}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 r(){}var l={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},s=Symbol.for("react.portal");function o(h,p,g){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:x==null?null:""+x,children:h,containerInfo:p,implementation:g}}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 Mn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=l,Mn.createPortal=function(h,p){var g=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 o(h,p,null,g)},Mn.flushSync=function(h){var p=u.T,g=l.p;try{if(u.T=null,l.p=2,h)return h()}finally{u.T=p,l.p=g,l.d.f()}},Mn.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))},Mn.prefetchDNS=function(h){typeof h=="string"&&l.d.D(h)},Mn.preinit=function(h,p){if(typeof h=="string"&&p&&typeof p.as=="string"){var g=p.as,x=f(g,p.crossOrigin),y=typeof p.integrity=="string"?p.integrity:void 0,v=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;g==="style"?l.d.S(h,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:x,integrity:y,fetchPriority:v}):g==="script"&&l.d.X(h,{crossOrigin:x,integrity:y,fetchPriority:v,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},Mn.preinitModule=function(h,p){if(typeof h=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var g=f(p.as,p.crossOrigin);l.d.M(h,{crossOrigin:g,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)},Mn.preload=function(h,p){if(typeof h=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var g=p.as,x=f(g,p.crossOrigin);l.d.L(h,g,{crossOrigin:x,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})}},Mn.preloadModule=function(h,p){if(typeof h=="string")if(p){var g=f(p.as,p.crossOrigin);l.d.m(h,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else l.d.m(h)},Mn.requestFormReset=function(h){l.d.r(h)},Mn.unstable_batchedUpdates=function(h,p){return h(p)},Mn.useFormState=function(h,p,g){return u.H.useFormState(h,p,g)},Mn.useFormStatus=function(){return u.H.useHostTransitionStatus()},Mn.version="19.2.4",Mn}var hy;function D0(){if(hy)return Kd.exports;hy=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(),Kd.exports=u2(),Kd.exports}var py;function c2(){if(py)return Rs;py=1;var e=o2(),n=Ap(),r=D0();function l(t){var a="https://react.dev/errors/"+t;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)a+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+t+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function o(t){var a=t,i=t;if(t.alternate)for(;a.return;)a=a.return;else{t=a;do a=t,(a.flags&4098)!==0&&(i=a.return),t=a.return;while(t)}return a.tag===3?i:null}function u(t){if(t.tag===13){var a=t.memoizedState;if(a===null&&(t=t.alternate,t!==null&&(a=t.memoizedState)),a!==null)return a.dehydrated}return null}function f(t){if(t.tag===31){var a=t.memoizedState;if(a===null&&(t=t.alternate,t!==null&&(a=t.memoizedState)),a!==null)return a.dehydrated}return null}function h(t){if(o(t)!==t)throw Error(l(188))}function p(t){var a=t.alternate;if(!a){if(a=o(t),a===null)throw Error(l(188));return a!==t?null:t}for(var i=t,c=a;;){var m=i.return;if(m===null)break;var b=m.alternate;if(b===null){if(c=m.return,c!==null){i=c;continue}break}if(m.child===b.child){for(b=m.child;b;){if(b===i)return h(m),t;if(b===c)return h(m),a;b=b.sibling}throw Error(l(188))}if(i.return!==c.return)i=m,c=b;else{for(var S=!1,C=m.child;C;){if(C===i){S=!0,i=m,c=b;break}if(C===c){S=!0,c=m,i=b;break}C=C.sibling}if(!S){for(C=b.child;C;){if(C===i){S=!0,i=b,c=m;break}if(C===c){S=!0,c=b,i=m;break}C=C.sibling}if(!S)throw Error(l(189))}}if(i.alternate!==c)throw Error(l(190))}if(i.tag!==3)throw Error(l(188));return i.stateNode.current===i?t:a}function g(t){var a=t.tag;if(a===5||a===26||a===27||a===6)return t;for(t=t.child;t!==null;){if(a=g(t),a!==null)return a;t=t.sibling}return null}var x=Object.assign,y=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),j=Symbol.for("react.context"),$=Symbol.for("react.forward_ref"),B=Symbol.for("react.suspense"),_=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),F=Symbol.for("react.lazy"),Y=Symbol.for("react.activity"),L=Symbol.for("react.memo_cache_sentinel"),X=Symbol.iterator;function Z(t){return t===null||typeof t!="object"?null:(t=X&&t[X]||t["@@iterator"],typeof t=="function"?t:null)}var te=Symbol.for("react.client.reference");function J(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===te?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case E:return"Fragment";case T:return"Profiler";case N:return"StrictMode";case B:return"Suspense";case _:return"SuspenseList";case Y:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case w:return"Portal";case j:return t.displayName||"Context";case R:return(t._context.displayName||"Context")+".Consumer";case $:var a=t.render;return t=t.displayName,t||(t=a.displayName||a.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case D:return a=t.displayName||null,a!==null?a:J(t.type)||"Memo";case F:a=t._payload,t=t._init;try{return J(t(a))}catch{}}return null}var G=Array.isArray,z=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ne={pending:!1,data:null,method:null,action:null},be=[],M=-1;function O(t){return{current:t}}function I(t){0>M||(t.current=be[M],be[M]=null,M--)}function A(t,a){M++,be[M]=t.current,t.current=a}var oe=O(null),le=O(null),he=O(null),pe=O(null);function Ae(t,a){switch(A(he,a),A(le,t),A(oe,null),a.nodeType){case 9:case 11:t=(t=a.documentElement)&&(t=t.namespaceURI)?Cb(t):0;break;default:if(t=a.tagName,a=a.namespaceURI)a=Cb(a),t=jb(a,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}I(oe),A(oe,t)}function Re(){I(oe),I(le),I(he)}function qe(t){t.memoizedState!==null&&A(pe,t);var a=oe.current,i=jb(a,t.type);a!==i&&(A(le,t),A(oe,i))}function pt(t){le.current===t&&(I(oe),I(le)),pe.current===t&&(I(pe),_s._currentValue=ne)}var St,Ge;function Et(t){if(St===void 0)try{throw Error()}catch(i){var a=i.stack.trim().match(/\n( *(at )?)/);St=a&&a[1]||"",Ge=-1<i.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+St+t+Ge}var ve=!1;function Ee(t,a){if(!t||ve)return"";ve=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(a){var de=function(){throw Error()};if(Object.defineProperty(de.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(de,[])}catch(ie){var ee=ie}Reflect.construct(t,[],de)}else{try{de.call()}catch(ie){ee=ie}t.call(de.prototype)}}else{try{throw Error()}catch(ie){ee=ie}(de=t())&&typeof de.catch=="function"&&de.catch(function(){})}}catch(ie){if(ie&&ee&&typeof ie.stack=="string")return[ie.stack,ee.stack]}return[null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var m=Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name");m&&m.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var b=c.DetermineComponentFrameRoot(),S=b[0],C=b[1];if(S&&C){var U=S.split(`
|
|
4
|
+
`),W=C.split(`
|
|
5
|
+
`);for(m=c=0;c<U.length&&!U[c].includes("DetermineComponentFrameRoot");)c++;for(;m<W.length&&!W[m].includes("DetermineComponentFrameRoot");)m++;if(c===U.length||m===W.length)for(c=U.length-1,m=W.length-1;1<=c&&0<=m&&U[c]!==W[m];)m--;for(;1<=c&&0<=m;c--,m--)if(U[c]!==W[m]){if(c!==1||m!==1)do if(c--,m--,0>m||U[c]!==W[m]){var ue=`
|
|
6
|
+
`+U[c].replace(" at new "," at ");return t.displayName&&ue.includes("<anonymous>")&&(ue=ue.replace("<anonymous>",t.displayName)),ue}while(1<=c&&0<=m);break}}}finally{ve=!1,Error.prepareStackTrace=i}return(i=t?t.displayName||t.name:"")?Et(i):""}function mt(t,a){switch(t.tag){case 26:case 27:case 5:return Et(t.type);case 16:return Et("Lazy");case 13:return t.child!==a&&a!==null?Et("Suspense Fallback"):Et("Suspense");case 19:return Et("SuspenseList");case 0:case 15:return Ee(t.type,!1);case 11:return Ee(t.type.render,!1);case 1:return Ee(t.type,!0);case 31:return Et("Activity");default:return""}}function ze(t){try{var a="",i=null;do a+=mt(t,i),i=t,t=t.return;while(t);return a}catch(c){return`
|
|
7
|
+
Error generating stack: `+c.message+`
|
|
8
|
+
`+c.stack}}var gt=Object.prototype.hasOwnProperty,Wt=e.unstable_scheduleCallback,Sn=e.unstable_cancelCallback,Pn=e.unstable_shouldYield,zn=e.unstable_requestPaint,kt=e.unstable_now,pn=e.unstable_getCurrentPriorityLevel,se=e.unstable_ImmediatePriority,ge=e.unstable_UserBlockingPriority,re=e.unstable_NormalPriority,we=e.unstable_LowPriority,$e=e.unstable_IdlePriority,xt=e.log,Mt=e.unstable_setDisableYieldValue,Pt=null,nt=null;function bt(t){if(typeof xt=="function"&&Mt(t),nt&&typeof nt.setStrictMode=="function")try{nt.setStrictMode(Pt,t)}catch{}}var Je=Math.clz32?Math.clz32:ra,bn=Math.log,Jt=Math.LN2;function ra(t){return t>>>=0,t===0?32:31-(bn(t)/Jt|0)|0}var jn=256,sn=262144,nr=4194304;function en(t){var a=t&42;if(a!==0)return a;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 H(t,a,i){var c=t.pendingLanes;if(c===0)return 0;var m=0,b=t.suspendedLanes,S=t.pingedLanes;t=t.warmLanes;var C=c&134217727;return C!==0?(c=C&~b,c!==0?m=en(c):(S&=C,S!==0?m=en(S):i||(i=C&~t,i!==0&&(m=en(i))))):(C=c&~b,C!==0?m=en(C):S!==0?m=en(S):i||(i=c&~t,i!==0&&(m=en(i)))),m===0?0:a!==0&&a!==m&&(a&b)===0&&(b=m&-m,i=a&-a,b>=i||b===32&&(i&4194048)!==0)?a:m}function ce(t,a){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&a)===0}function ye(t,a){switch(t){case 1:case 2:case 4:case 8:case 64:return a+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 a+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=nr;return nr<<=1,(nr&62914560)===0&&(nr=4194304),t}function Tt(t){for(var a=[],i=0;31>i;i++)a.push(t);return a}function Ze(t,a){t.pendingLanes|=a,a!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Te(t,a,i,c,m,b){var S=t.pendingLanes;t.pendingLanes=i,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=i,t.entangledLanes&=i,t.errorRecoveryDisabledLanes&=i,t.shellSuspendCounter=0;var C=t.entanglements,U=t.expirationTimes,W=t.hiddenUpdates;for(i=S&~i;0<i;){var ue=31-Je(i),de=1<<ue;C[ue]=0,U[ue]=-1;var ee=W[ue];if(ee!==null)for(W[ue]=null,ue=0;ue<ee.length;ue++){var ie=ee[ue];ie!==null&&(ie.lane&=-536870913)}i&=~de}c!==0&&Ne(t,c,0),b!==0&&m===0&&t.tag!==0&&(t.suspendedLanes|=b&~(S&~a))}function Ne(t,a,i){t.pendingLanes|=a,t.suspendedLanes&=~a;var c=31-Je(a);t.entangledLanes|=a,t.entanglements[c]=t.entanglements[c]|1073741824|i&261930}function Ue(t,a){var i=t.entangledLanes|=a;for(t=t.entanglements;i;){var c=31-Je(i),m=1<<c;m&a|t[c]&a&&(t[c]|=a),i&=~m}}function It(t,a){var i=a&-a;return i=(i&42)!==0?1:rt(i),(i&(t.suspendedLanes|a))!==0?0:i}function rt(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 mn(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function gr(){var t=V.p;return t!==0?t:(t=window.event,t===void 0?32:Jb(t.type))}function Mr(t,a){var i=V.p;try{return V.p=t,a()}finally{V.p=i}}var yn=Math.random().toString(36).slice(2),Ot="__reactFiber$"+yn,Nt="__reactProps$"+yn,Fn="__reactContainer$"+yn,xr="__reactEvents$"+yn,aa="__reactListeners$"+yn,br="__reactHandles$"+yn,qr="__reactResources$"+yn,Ce="__reactMarker$"+yn;function P(t){delete t[Ot],delete t[Nt],delete t[xr],delete t[aa],delete t[br]}function me(t){var a=t[Ot];if(a)return a;for(var i=t.parentNode;i;){if(a=i[Fn]||i[Ot]){if(i=a.alternate,a.child!==null||i!==null&&i.child!==null)for(t=Ib(t);t!==null;){if(i=t[Ot])return i;t=Ib(t)}return a}t=i,i=t.parentNode}return null}function _e(t){if(t=t[Ot]||t[Fn]){var a=t.tag;if(a===5||a===6||a===13||a===31||a===26||a===27||a===3)return t}return null}function ct(t){var a=t.tag;if(a===5||a===26||a===27||a===6)return t.stateNode;throw Error(l(33))}function Bt(t){var a=t[qr];return a||(a=t[qr]={hoistableStyles:new Map,hoistableScripts:new Map}),a}function Ve(t){t[Ce]=!0}var Zt=new Set,gn={};function vn(t,a){xe(t,a),xe(t+"Capture",a)}function xe(t,a){for(gn[t]=a,t=0;t<a.length;t++)Zt.add(a[t])}var ae=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]*$"),Ie={},et={};function rn(t){return gt.call(et,t)?!0:gt.call(Ie,t)?!1:ae.test(t)?et[t]=!0:(Ie[t]=!0,!1)}function Rn(t,a,i){if(rn(a))if(i===null)t.removeAttribute(a);else{switch(typeof i){case"undefined":case"function":case"symbol":t.removeAttribute(a);return;case"boolean":var c=a.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){t.removeAttribute(a);return}}t.setAttribute(a,""+i)}}function rr(t,a,i){if(i===null)t.removeAttribute(a);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(a);return}t.setAttribute(a,""+i)}}function Gn(t,a,i,c){if(c===null)t.removeAttribute(i);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(i);return}t.setAttributeNS(a,i,""+c)}}function Ft(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function ar(t){var a=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function ko(t,a,i){var c=Object.getOwnPropertyDescriptor(t.constructor.prototype,a);if(!t.hasOwnProperty(a)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var m=c.get,b=c.set;return Object.defineProperty(t,a,{configurable:!0,get:function(){return m.call(this)},set:function(S){i=""+S,b.call(this,S)}}),Object.defineProperty(t,a,{enumerable:c.enumerable}),{getValue:function(){return i},setValue:function(S){i=""+S},stopTracking:function(){t._valueTracker=null,delete t[a]}}}}function Ul(t){if(!t._valueTracker){var a=ar(t)?"checked":"value";t._valueTracker=ko(t,a,""+t[a])}}function $i(t){if(!t)return!1;var a=t._valueTracker;if(!a)return!0;var i=a.getValue(),c="";return t&&(c=ar(t)?t.checked?"true":"false":t.value),t=c,t!==i?(a.setValue(t),!0):!1}function Hl(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 Pc=/[\n"\\]/g;function qn(t){return t.replace(Pc,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function Ui(t,a,i,c,m,b,S,C){t.name="",S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?t.type=S:t.removeAttribute("type"),a!=null?S==="number"?(a===0&&t.value===""||t.value!=a)&&(t.value=""+Ft(a)):t.value!==""+Ft(a)&&(t.value=""+Ft(a)):S!=="submit"&&S!=="reset"||t.removeAttribute("value"),a!=null?Pl(t,S,Ft(a)):i!=null?Pl(t,S,Ft(i)):c!=null&&t.removeAttribute("value"),m==null&&b!=null&&(t.defaultChecked=!!b),m!=null&&(t.checked=m&&typeof m!="function"&&typeof m!="symbol"),C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?t.name=""+Ft(C):t.removeAttribute("name")}function ul(t,a,i,c,m,b,S,C){if(b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(t.type=b),a!=null||i!=null){if(!(b!=="submit"&&b!=="reset"||a!=null)){Ul(t);return}i=i!=null?""+Ft(i):"",a=a!=null?""+Ft(a):i,C||a===t.value||(t.value=a),t.defaultValue=a}c=c??m,c=typeof c!="function"&&typeof c!="symbol"&&!!c,t.checked=C?t.checked:!!c,t.defaultChecked=!!c,S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(t.name=S),Ul(t)}function Pl(t,a,i){a==="number"&&Hl(t.ownerDocument)===t||t.defaultValue===""+i||(t.defaultValue=""+i)}function En(t,a,i,c){if(t=t.options,a){a={};for(var m=0;m<i.length;m++)a["$"+i[m]]=!0;for(i=0;i<t.length;i++)m=a.hasOwnProperty("$"+t[i].value),t[i].selected!==m&&(t[i].selected=m),m&&c&&(t[i].defaultSelected=!0)}else{for(i=""+Ft(i),a=null,m=0;m<t.length;m++){if(t[m].value===i){t[m].selected=!0,c&&(t[m].defaultSelected=!0);return}a!==null||t[m].disabled||(a=t[m])}a!==null&&(a.selected=!0)}}function wo(t,a,i){if(a!=null&&(a=""+Ft(a),a!==t.value&&(t.value=a),i==null)){t.defaultValue!==a&&(t.defaultValue=a);return}t.defaultValue=i!=null?""+Ft(i):""}function Fl(t,a,i,c){if(a==null){if(c!=null){if(i!=null)throw Error(l(92));if(G(c)){if(1<c.length)throw Error(l(93));c=c[0]}i=c}i==null&&(i=""),a=i}i=Ft(a),t.defaultValue=i,c=t.textContent,c===i&&c!==""&&c!==null&&(t.value=c),Ul(t)}function Fe(t,a){if(a){var i=t.firstChild;if(i&&i===t.lastChild&&i.nodeType===3){i.nodeValue=a;return}}t.textContent=a}var So=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function on(t,a,i){var c=a.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?c?t.setProperty(a,""):a==="float"?t.cssFloat="":t[a]="":c?t.setProperty(a,i):typeof i!="number"||i===0||So.has(a)?a==="float"?t.cssFloat=i:t[a]=(""+i).trim():t[a]=i+"px"}function At(t,a,i){if(a!=null&&typeof a!="object")throw Error(l(62));if(t=t.style,i!=null){for(var c in i)!i.hasOwnProperty(c)||a!=null&&a.hasOwnProperty(c)||(c.indexOf("--")===0?t.setProperty(c,""):c==="float"?t.cssFloat="":t[c]="");for(var m in a)c=a[m],a.hasOwnProperty(m)&&i[m]!==c&&on(t,m,c)}else for(var b in a)a.hasOwnProperty(b)&&on(t,b,a[b])}function Ca(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 la=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"]]),Hi=/^[\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 ja(t){return Hi.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function Se(){}var Me=null;function Xe(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var st=null,Qt=null;function yr(t){var a=_e(t);if(a&&(t=a.stateNode)){var i=t[Nt]||null;e:switch(t=a.stateNode,a.type){case"input":if(Ui(t,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),a=i.name,i.type==="radio"&&a!=null){for(i=t;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+qn(""+a)+'"][type="radio"]'),a=0;a<i.length;a++){var c=i[a];if(c!==t&&c.form===t.form){var m=c[Nt]||null;if(!m)throw Error(l(90));Ui(c,m.value,m.defaultValue,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name)}}for(a=0;a<i.length;a++)c=i[a],c.form===t.form&&$i(c)}break e;case"textarea":wo(t,i.value,i.defaultValue);break e;case"select":a=i.value,a!=null&&En(t,!!i.multiple,a,!1)}}}var Pi=!1;function Eo(t,a,i){if(Pi)return t(a,i);Pi=!0;try{var c=t(a);return c}finally{if(Pi=!1,(st!==null||Qt!==null)&&(fu(),st&&(a=st,t=Qt,Qt=st=null,yr(a),t)))for(a=0;a<t.length;a++)yr(t[a])}}function Fi(t,a){var i=t.stateNode;if(i===null)return null;var c=i[Nt]||null;if(c===null)return null;i=c[a];e:switch(a){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(c=!c.disabled)||(t=t.type,c=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!c;break e;default:t=!1}if(t)return null;if(i&&typeof i!="function")throw Error(l(231,a,typeof i));return i}var ia=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Fc=!1;if(ia)try{var Gi={};Object.defineProperty(Gi,"passive",{get:function(){Fc=!0}}),window.addEventListener("test",Gi,Gi),window.removeEventListener("test",Gi,Gi)}catch{Fc=!1}var Ra=null,Gc=null,No=null;function jm(){if(No)return No;var t,a=Gc,i=a.length,c,m="value"in Ra?Ra.value:Ra.textContent,b=m.length;for(t=0;t<i&&a[t]===m[t];t++);var S=i-t;for(c=1;c<=S&&a[i-c]===m[b-c];c++);return No=m.slice(t,1<c?1-c:void 0)}function _o(t){var a=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&a===13&&(t=13)):t=a,t===10&&(t=13),32<=t||t===13?t:0}function To(){return!0}function Rm(){return!1}function Yn(t){function a(i,c,m,b,S){this._reactName=i,this._targetInst=m,this.type=c,this.nativeEvent=b,this.target=S,this.currentTarget=null;for(var C in t)t.hasOwnProperty(C)&&(i=t[C],this[C]=i?i(b):b[C]);return this.isDefaultPrevented=(b.defaultPrevented!=null?b.defaultPrevented:b.returnValue===!1)?To:Rm,this.isPropagationStopped=Rm,this}return x(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=To)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=To)},persist:function(){},isPersistent:To}),a}var cl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ao=Yn(cl),qi=x({},cl,{view:0,detail:0}),eS=Yn(qi),qc,Yc,Yi,Co=x({},qi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Xc,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!==Yi&&(Yi&&t.type==="mousemove"?(qc=t.screenX-Yi.screenX,Yc=t.screenY-Yi.screenY):Yc=qc=0,Yi=t),qc)},movementY:function(t){return"movementY"in t?t.movementY:Yc}}),Mm=Yn(Co),tS=x({},Co,{dataTransfer:0}),nS=Yn(tS),rS=x({},qi,{relatedTarget:0}),Vc=Yn(rS),aS=x({},cl,{animationName:0,elapsedTime:0,pseudoElement:0}),lS=Yn(aS),iS=x({},cl,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),sS=Yn(iS),oS=x({},cl,{data:0}),Om=Yn(oS),uS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},cS={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"},fS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function dS(t){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(t):(t=fS[t])?!!a[t]:!1}function Xc(){return dS}var hS=x({},qi,{key:function(t){if(t.key){var a=uS[t.key]||t.key;if(a!=="Unidentified")return a}return t.type==="keypress"?(t=_o(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?cS[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Xc,charCode:function(t){return t.type==="keypress"?_o(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?_o(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),pS=Yn(hS),mS=x({},Co,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Dm=Yn(mS),gS=x({},qi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Xc}),xS=Yn(gS),bS=x({},cl,{propertyName:0,elapsedTime:0,pseudoElement:0}),yS=Yn(bS),vS=x({},Co,{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}),kS=Yn(vS),wS=x({},cl,{newState:0,oldState:0}),SS=Yn(wS),ES=[9,13,27,32],Kc=ia&&"CompositionEvent"in window,Vi=null;ia&&"documentMode"in document&&(Vi=document.documentMode);var NS=ia&&"TextEvent"in window&&!Vi,zm=ia&&(!Kc||Vi&&8<Vi&&11>=Vi),Lm=" ",Im=!1;function Bm(t,a){switch(t){case"keyup":return ES.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function $m(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Gl=!1;function _S(t,a){switch(t){case"compositionend":return $m(a);case"keypress":return a.which!==32?null:(Im=!0,Lm);case"textInput":return t=a.data,t===Lm&&Im?null:t;default:return null}}function TS(t,a){if(Gl)return t==="compositionend"||!Kc&&Bm(t,a)?(t=jm(),No=Gc=Ra=null,Gl=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return zm&&a.locale!=="ko"?null:a.data;default:return null}}var AS={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 Um(t){var a=t&&t.nodeName&&t.nodeName.toLowerCase();return a==="input"?!!AS[t.type]:a==="textarea"}function Hm(t,a,i,c){st?Qt?Qt.push(c):Qt=[c]:st=c,a=bu(a,"onChange"),0<a.length&&(i=new Ao("onChange","change",null,i,c),t.push({event:i,listeners:a}))}var Xi=null,Ki=null;function CS(t){Sb(t,0)}function jo(t){var a=ct(t);if($i(a))return t}function Pm(t,a){if(t==="change")return a}var Fm=!1;if(ia){var Zc;if(ia){var Qc="oninput"in document;if(!Qc){var Gm=document.createElement("div");Gm.setAttribute("oninput","return;"),Qc=typeof Gm.oninput=="function"}Zc=Qc}else Zc=!1;Fm=Zc&&(!document.documentMode||9<document.documentMode)}function qm(){Xi&&(Xi.detachEvent("onpropertychange",Ym),Ki=Xi=null)}function Ym(t){if(t.propertyName==="value"&&jo(Ki)){var a=[];Hm(a,Ki,t,Xe(t)),Eo(CS,a)}}function jS(t,a,i){t==="focusin"?(qm(),Xi=a,Ki=i,Xi.attachEvent("onpropertychange",Ym)):t==="focusout"&&qm()}function RS(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return jo(Ki)}function MS(t,a){if(t==="click")return jo(a)}function OS(t,a){if(t==="input"||t==="change")return jo(a)}function DS(t,a){return t===a&&(t!==0||1/t===1/a)||t!==t&&a!==a}var lr=typeof Object.is=="function"?Object.is:DS;function Zi(t,a){if(lr(t,a))return!0;if(typeof t!="object"||t===null||typeof a!="object"||a===null)return!1;var i=Object.keys(t),c=Object.keys(a);if(i.length!==c.length)return!1;for(c=0;c<i.length;c++){var m=i[c];if(!gt.call(a,m)||!lr(t[m],a[m]))return!1}return!0}function Vm(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Xm(t,a){var i=Vm(t);t=0;for(var c;i;){if(i.nodeType===3){if(c=t+i.textContent.length,t<=a&&c>=a)return{node:i,offset:a-t};t=c}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=Vm(i)}}function Km(t,a){return t&&a?t===a?!0:t&&t.nodeType===3?!1:a&&a.nodeType===3?Km(t,a.parentNode):"contains"in t?t.contains(a):t.compareDocumentPosition?!!(t.compareDocumentPosition(a)&16):!1:!1}function Zm(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var a=Hl(t.document);a instanceof t.HTMLIFrameElement;){try{var i=typeof a.contentWindow.location.href=="string"}catch{i=!1}if(i)t=a.contentWindow;else break;a=Hl(t.document)}return a}function Wc(t){var a=t&&t.nodeName&&t.nodeName.toLowerCase();return a&&(a==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||a==="textarea"||t.contentEditable==="true")}var zS=ia&&"documentMode"in document&&11>=document.documentMode,ql=null,Jc=null,Qi=null,ef=!1;function Qm(t,a,i){var c=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;ef||ql==null||ql!==Hl(c)||(c=ql,"selectionStart"in c&&Wc(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),Qi&&Zi(Qi,c)||(Qi=c,c=bu(Jc,"onSelect"),0<c.length&&(a=new Ao("onSelect","select",null,a,i),t.push({event:a,listeners:c}),a.target=ql)))}function fl(t,a){var i={};return i[t.toLowerCase()]=a.toLowerCase(),i["Webkit"+t]="webkit"+a,i["Moz"+t]="moz"+a,i}var Yl={animationend:fl("Animation","AnimationEnd"),animationiteration:fl("Animation","AnimationIteration"),animationstart:fl("Animation","AnimationStart"),transitionrun:fl("Transition","TransitionRun"),transitionstart:fl("Transition","TransitionStart"),transitioncancel:fl("Transition","TransitionCancel"),transitionend:fl("Transition","TransitionEnd")},tf={},Wm={};ia&&(Wm=document.createElement("div").style,"AnimationEvent"in window||(delete Yl.animationend.animation,delete Yl.animationiteration.animation,delete Yl.animationstart.animation),"TransitionEvent"in window||delete Yl.transitionend.transition);function dl(t){if(tf[t])return tf[t];if(!Yl[t])return t;var a=Yl[t],i;for(i in a)if(a.hasOwnProperty(i)&&i in Wm)return tf[t]=a[i];return t}var Jm=dl("animationend"),eg=dl("animationiteration"),tg=dl("animationstart"),LS=dl("transitionrun"),IS=dl("transitionstart"),BS=dl("transitioncancel"),ng=dl("transitionend"),rg=new Map,nf="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(" ");nf.push("scrollEnd");function Or(t,a){rg.set(t,a),vn(a,[t])}var Ro=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var a=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(a))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},vr=[],Vl=0,rf=0;function Mo(){for(var t=Vl,a=rf=Vl=0;a<t;){var i=vr[a];vr[a++]=null;var c=vr[a];vr[a++]=null;var m=vr[a];vr[a++]=null;var b=vr[a];if(vr[a++]=null,c!==null&&m!==null){var S=c.pending;S===null?m.next=m:(m.next=S.next,S.next=m),c.pending=m}b!==0&&ag(i,m,b)}}function Oo(t,a,i,c){vr[Vl++]=t,vr[Vl++]=a,vr[Vl++]=i,vr[Vl++]=c,rf|=c,t.lanes|=c,t=t.alternate,t!==null&&(t.lanes|=c)}function af(t,a,i,c){return Oo(t,a,i,c),Do(t)}function hl(t,a){return Oo(t,null,null,a),Do(t)}function ag(t,a,i){t.lanes|=i;var c=t.alternate;c!==null&&(c.lanes|=i);for(var m=!1,b=t.return;b!==null;)b.childLanes|=i,c=b.alternate,c!==null&&(c.childLanes|=i),b.tag===22&&(t=b.stateNode,t===null||t._visibility&1||(m=!0)),t=b,b=b.return;return t.tag===3?(b=t.stateNode,m&&a!==null&&(m=31-Je(i),t=b.hiddenUpdates,c=t[m],c===null?t[m]=[a]:c.push(a),a.lane=i|536870912),b):null}function Do(t){if(50<ys)throw ys=0,pd=null,Error(l(185));for(var a=t.return;a!==null;)t=a,a=t.return;return t.tag===3?t.stateNode:null}var Xl={};function $S(t,a,i,c){this.tag=t,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ir(t,a,i,c){return new $S(t,a,i,c)}function lf(t){return t=t.prototype,!(!t||!t.isReactComponent)}function sa(t,a){var i=t.alternate;return i===null?(i=ir(t.tag,a,t.key,t.mode),i.elementType=t.elementType,i.type=t.type,i.stateNode=t.stateNode,i.alternate=t,t.alternate=i):(i.pendingProps=a,i.type=t.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=t.flags&65011712,i.childLanes=t.childLanes,i.lanes=t.lanes,i.child=t.child,i.memoizedProps=t.memoizedProps,i.memoizedState=t.memoizedState,i.updateQueue=t.updateQueue,a=t.dependencies,i.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},i.sibling=t.sibling,i.index=t.index,i.ref=t.ref,i.refCleanup=t.refCleanup,i}function lg(t,a){t.flags&=65011714;var i=t.alternate;return i===null?(t.childLanes=0,t.lanes=a,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=i.childLanes,t.lanes=i.lanes,t.child=i.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=i.memoizedProps,t.memoizedState=i.memoizedState,t.updateQueue=i.updateQueue,t.type=i.type,a=i.dependencies,t.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),t}function zo(t,a,i,c,m,b){var S=0;if(c=t,typeof t=="function")lf(t)&&(S=1);else if(typeof t=="string")S=GE(t,i,oe.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case Y:return t=ir(31,i,a,m),t.elementType=Y,t.lanes=b,t;case E:return pl(i.children,m,b,a);case N:S=8,m|=24;break;case T:return t=ir(12,i,a,m|2),t.elementType=T,t.lanes=b,t;case B:return t=ir(13,i,a,m),t.elementType=B,t.lanes=b,t;case _:return t=ir(19,i,a,m),t.elementType=_,t.lanes=b,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case j:S=10;break e;case R:S=9;break e;case $:S=11;break e;case D:S=14;break e;case F:S=16,c=null;break e}S=29,i=Error(l(130,t===null?"null":typeof t,"")),c=null}return a=ir(S,i,a,m),a.elementType=t,a.type=c,a.lanes=b,a}function pl(t,a,i,c){return t=ir(7,t,c,a),t.lanes=i,t}function sf(t,a,i){return t=ir(6,t,null,a),t.lanes=i,t}function ig(t){var a=ir(18,null,null,0);return a.stateNode=t,a}function of(t,a,i){return a=ir(4,t.children!==null?t.children:[],t.key,a),a.lanes=i,a.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},a}var sg=new WeakMap;function kr(t,a){if(typeof t=="object"&&t!==null){var i=sg.get(t);return i!==void 0?i:(a={value:t,source:a,stack:ze(a)},sg.set(t,a),a)}return{value:t,source:a,stack:ze(a)}}var Kl=[],Zl=0,Lo=null,Wi=0,wr=[],Sr=0,Ma=null,Yr=1,Vr="";function oa(t,a){Kl[Zl++]=Wi,Kl[Zl++]=Lo,Lo=t,Wi=a}function og(t,a,i){wr[Sr++]=Yr,wr[Sr++]=Vr,wr[Sr++]=Ma,Ma=t;var c=Yr;t=Vr;var m=32-Je(c)-1;c&=~(1<<m),i+=1;var b=32-Je(a)+m;if(30<b){var S=m-m%5;b=(c&(1<<S)-1).toString(32),c>>=S,m-=S,Yr=1<<32-Je(a)+m|i<<m|c,Vr=b+t}else Yr=1<<b|i<<m|c,Vr=t}function uf(t){t.return!==null&&(oa(t,1),og(t,1,0))}function cf(t){for(;t===Lo;)Lo=Kl[--Zl],Kl[Zl]=null,Wi=Kl[--Zl],Kl[Zl]=null;for(;t===Ma;)Ma=wr[--Sr],wr[Sr]=null,Vr=wr[--Sr],wr[Sr]=null,Yr=wr[--Sr],wr[Sr]=null}function ug(t,a){wr[Sr++]=Yr,wr[Sr++]=Vr,wr[Sr++]=Ma,Yr=a.id,Vr=a.overflow,Ma=t}var Nn=null,Yt=null,ft=!1,Oa=null,Er=!1,ff=Error(l(519));function Da(t){var a=Error(l(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ji(kr(a,t)),ff}function cg(t){var a=t.stateNode,i=t.type,c=t.memoizedProps;switch(a[Ot]=t,a[Nt]=c,i){case"dialog":lt("cancel",a),lt("close",a);break;case"iframe":case"object":case"embed":lt("load",a);break;case"video":case"audio":for(i=0;i<ks.length;i++)lt(ks[i],a);break;case"source":lt("error",a);break;case"img":case"image":case"link":lt("error",a),lt("load",a);break;case"details":lt("toggle",a);break;case"input":lt("invalid",a),ul(a,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":lt("invalid",a);break;case"textarea":lt("invalid",a),Fl(a,c.value,c.defaultValue,c.children)}i=c.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||a.textContent===""+i||c.suppressHydrationWarning===!0||Tb(a.textContent,i)?(c.popover!=null&&(lt("beforetoggle",a),lt("toggle",a)),c.onScroll!=null&<("scroll",a),c.onScrollEnd!=null&<("scrollend",a),c.onClick!=null&&(a.onclick=Se),a=!0):a=!1,a||Da(t,!0)}function fg(t){for(Nn=t.return;Nn;)switch(Nn.tag){case 5:case 31:case 13:Er=!1;return;case 27:case 3:Er=!0;return;default:Nn=Nn.return}}function Ql(t){if(t!==Nn)return!1;if(!ft)return fg(t),ft=!0,!1;var a=t.tag,i;if((i=a!==3&&a!==27)&&((i=a===5)&&(i=t.type,i=!(i!=="form"&&i!=="button")||Cd(t.type,t.memoizedProps)),i=!i),i&&Yt&&Da(t),fg(t),a===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(l(317));Yt=Lb(t)}else if(a===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(l(317));Yt=Lb(t)}else a===27?(a=Yt,Xa(t.type)?(t=Dd,Dd=null,Yt=t):Yt=a):Yt=Nn?_r(t.stateNode.nextSibling):null;return!0}function ml(){Yt=Nn=null,ft=!1}function df(){var t=Oa;return t!==null&&(Zn===null?Zn=t:Zn.push.apply(Zn,t),Oa=null),t}function Ji(t){Oa===null?Oa=[t]:Oa.push(t)}var hf=O(null),gl=null,ua=null;function za(t,a,i){A(hf,a._currentValue),a._currentValue=i}function ca(t){t._currentValue=hf.current,I(hf)}function pf(t,a,i){for(;t!==null;){var c=t.alternate;if((t.childLanes&a)!==a?(t.childLanes|=a,c!==null&&(c.childLanes|=a)):c!==null&&(c.childLanes&a)!==a&&(c.childLanes|=a),t===i)break;t=t.return}}function mf(t,a,i,c){var m=t.child;for(m!==null&&(m.return=t);m!==null;){var b=m.dependencies;if(b!==null){var S=m.child;b=b.firstContext;e:for(;b!==null;){var C=b;b=m;for(var U=0;U<a.length;U++)if(C.context===a[U]){b.lanes|=i,C=b.alternate,C!==null&&(C.lanes|=i),pf(b.return,i,t),c||(S=null);break e}b=C.next}}else if(m.tag===18){if(S=m.return,S===null)throw Error(l(341));S.lanes|=i,b=S.alternate,b!==null&&(b.lanes|=i),pf(S,i,t),S=null}else S=m.child;if(S!==null)S.return=m;else for(S=m;S!==null;){if(S===t){S=null;break}if(m=S.sibling,m!==null){m.return=S.return,S=m;break}S=S.return}m=S}}function Wl(t,a,i,c){t=null;for(var m=a,b=!1;m!==null;){if(!b){if((m.flags&524288)!==0)b=!0;else if((m.flags&262144)!==0)break}if(m.tag===10){var S=m.alternate;if(S===null)throw Error(l(387));if(S=S.memoizedProps,S!==null){var C=m.type;lr(m.pendingProps.value,S.value)||(t!==null?t.push(C):t=[C])}}else if(m===pe.current){if(S=m.alternate,S===null)throw Error(l(387));S.memoizedState.memoizedState!==m.memoizedState.memoizedState&&(t!==null?t.push(_s):t=[_s])}m=m.return}t!==null&&mf(a,t,i,c),a.flags|=262144}function Io(t){for(t=t.firstContext;t!==null;){if(!lr(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function xl(t){gl=t,ua=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function _n(t){return dg(gl,t)}function Bo(t,a){return gl===null&&xl(t),dg(t,a)}function dg(t,a){var i=a._currentValue;if(a={context:a,memoizedValue:i,next:null},ua===null){if(t===null)throw Error(l(308));ua=a,t.dependencies={lanes:0,firstContext:a},t.flags|=524288}else ua=ua.next=a;return i}var US=typeof AbortController<"u"?AbortController:function(){var t=[],a=this.signal={aborted:!1,addEventListener:function(i,c){t.push(c)}};this.abort=function(){a.aborted=!0,t.forEach(function(i){return i()})}},HS=e.unstable_scheduleCallback,PS=e.unstable_NormalPriority,un={$$typeof:j,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function gf(){return{controller:new US,data:new Map,refCount:0}}function es(t){t.refCount--,t.refCount===0&&HS(PS,function(){t.controller.abort()})}var ts=null,xf=0,Jl=0,ei=null;function FS(t,a){if(ts===null){var i=ts=[];xf=0,Jl=vd(),ei={status:"pending",value:void 0,then:function(c){i.push(c)}}}return xf++,a.then(hg,hg),a}function hg(){if(--xf===0&&ts!==null){ei!==null&&(ei.status="fulfilled");var t=ts;ts=null,Jl=0,ei=null;for(var a=0;a<t.length;a++)(0,t[a])()}}function GS(t,a){var i=[],c={status:"pending",value:null,reason:null,then:function(m){i.push(m)}};return t.then(function(){c.status="fulfilled",c.value=a;for(var m=0;m<i.length;m++)(0,i[m])(a)},function(m){for(c.status="rejected",c.reason=m,m=0;m<i.length;m++)(0,i[m])(void 0)}),c}var pg=z.S;z.S=function(t,a){Qx=kt(),typeof a=="object"&&a!==null&&typeof a.then=="function"&&FS(t,a),pg!==null&&pg(t,a)};var bl=O(null);function bf(){var t=bl.current;return t!==null?t:$t.pooledCache}function $o(t,a){a===null?A(bl,bl.current):A(bl,a.pool)}function mg(){var t=bf();return t===null?null:{parent:un._currentValue,pool:t}}var ti=Error(l(460)),yf=Error(l(474)),Uo=Error(l(542)),Ho={then:function(){}};function gg(t){return t=t.status,t==="fulfilled"||t==="rejected"}function xg(t,a,i){switch(i=t[i],i===void 0?t.push(a):i!==a&&(a.then(Se,Se),a=i),a.status){case"fulfilled":return a.value;case"rejected":throw t=a.reason,yg(t),t;default:if(typeof a.status=="string")a.then(Se,Se);else{if(t=$t,t!==null&&100<t.shellSuspendCounter)throw Error(l(482));t=a,t.status="pending",t.then(function(c){if(a.status==="pending"){var m=a;m.status="fulfilled",m.value=c}},function(c){if(a.status==="pending"){var m=a;m.status="rejected",m.reason=c}})}switch(a.status){case"fulfilled":return a.value;case"rejected":throw t=a.reason,yg(t),t}throw vl=a,ti}}function yl(t){try{var a=t._init;return a(t._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(vl=i,ti):i}}var vl=null;function bg(){if(vl===null)throw Error(l(459));var t=vl;return vl=null,t}function yg(t){if(t===ti||t===Uo)throw Error(l(483))}var ni=null,ns=0;function Po(t){var a=ns;return ns+=1,ni===null&&(ni=[]),xg(ni,t,a)}function rs(t,a){a=a.props.ref,t.ref=a!==void 0?a:null}function Fo(t,a){throw a.$$typeof===y?Error(l(525)):(t=Object.prototype.toString.call(a),Error(l(31,t==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":t)))}function vg(t){function a(K,q){if(t){var Q=K.deletions;Q===null?(K.deletions=[q],K.flags|=16):Q.push(q)}}function i(K,q){if(!t)return null;for(;q!==null;)a(K,q),q=q.sibling;return null}function c(K){for(var q=new Map;K!==null;)K.key!==null?q.set(K.key,K):q.set(K.index,K),K=K.sibling;return q}function m(K,q){return K=sa(K,q),K.index=0,K.sibling=null,K}function b(K,q,Q){return K.index=Q,t?(Q=K.alternate,Q!==null?(Q=Q.index,Q<q?(K.flags|=67108866,q):Q):(K.flags|=67108866,q)):(K.flags|=1048576,q)}function S(K){return t&&K.alternate===null&&(K.flags|=67108866),K}function C(K,q,Q,fe){return q===null||q.tag!==6?(q=sf(Q,K.mode,fe),q.return=K,q):(q=m(q,Q),q.return=K,q)}function U(K,q,Q,fe){var Be=Q.type;return Be===E?ue(K,q,Q.props.children,fe,Q.key):q!==null&&(q.elementType===Be||typeof Be=="object"&&Be!==null&&Be.$$typeof===F&&yl(Be)===q.type)?(q=m(q,Q.props),rs(q,Q),q.return=K,q):(q=zo(Q.type,Q.key,Q.props,null,K.mode,fe),rs(q,Q),q.return=K,q)}function W(K,q,Q,fe){return q===null||q.tag!==4||q.stateNode.containerInfo!==Q.containerInfo||q.stateNode.implementation!==Q.implementation?(q=of(Q,K.mode,fe),q.return=K,q):(q=m(q,Q.children||[]),q.return=K,q)}function ue(K,q,Q,fe,Be){return q===null||q.tag!==7?(q=pl(Q,K.mode,fe,Be),q.return=K,q):(q=m(q,Q),q.return=K,q)}function de(K,q,Q){if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return q=sf(""+q,K.mode,Q),q.return=K,q;if(typeof q=="object"&&q!==null){switch(q.$$typeof){case v:return Q=zo(q.type,q.key,q.props,null,K.mode,Q),rs(Q,q),Q.return=K,Q;case w:return q=of(q,K.mode,Q),q.return=K,q;case F:return q=yl(q),de(K,q,Q)}if(G(q)||Z(q))return q=pl(q,K.mode,Q,null),q.return=K,q;if(typeof q.then=="function")return de(K,Po(q),Q);if(q.$$typeof===j)return de(K,Bo(K,q),Q);Fo(K,q)}return null}function ee(K,q,Q,fe){var Be=q!==null?q.key:null;if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return Be!==null?null:C(K,q,""+Q,fe);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case v:return Q.key===Be?U(K,q,Q,fe):null;case w:return Q.key===Be?W(K,q,Q,fe):null;case F:return Q=yl(Q),ee(K,q,Q,fe)}if(G(Q)||Z(Q))return Be!==null?null:ue(K,q,Q,fe,null);if(typeof Q.then=="function")return ee(K,q,Po(Q),fe);if(Q.$$typeof===j)return ee(K,q,Bo(K,Q),fe);Fo(K,Q)}return null}function ie(K,q,Q,fe,Be){if(typeof fe=="string"&&fe!==""||typeof fe=="number"||typeof fe=="bigint")return K=K.get(Q)||null,C(q,K,""+fe,Be);if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case v:return K=K.get(fe.key===null?Q:fe.key)||null,U(q,K,fe,Be);case w:return K=K.get(fe.key===null?Q:fe.key)||null,W(q,K,fe,Be);case F:return fe=yl(fe),ie(K,q,Q,fe,Be)}if(G(fe)||Z(fe))return K=K.get(Q)||null,ue(q,K,fe,Be,null);if(typeof fe.then=="function")return ie(K,q,Q,Po(fe),Be);if(fe.$$typeof===j)return ie(K,q,Q,Bo(q,fe),Be);Fo(q,fe)}return null}function je(K,q,Q,fe){for(var Be=null,yt=null,Oe=q,Qe=q=0,ut=null;Oe!==null&&Qe<Q.length;Qe++){Oe.index>Qe?(ut=Oe,Oe=null):ut=Oe.sibling;var vt=ee(K,Oe,Q[Qe],fe);if(vt===null){Oe===null&&(Oe=ut);break}t&&Oe&&vt.alternate===null&&a(K,Oe),q=b(vt,q,Qe),yt===null?Be=vt:yt.sibling=vt,yt=vt,Oe=ut}if(Qe===Q.length)return i(K,Oe),ft&&oa(K,Qe),Be;if(Oe===null){for(;Qe<Q.length;Qe++)Oe=de(K,Q[Qe],fe),Oe!==null&&(q=b(Oe,q,Qe),yt===null?Be=Oe:yt.sibling=Oe,yt=Oe);return ft&&oa(K,Qe),Be}for(Oe=c(Oe);Qe<Q.length;Qe++)ut=ie(Oe,K,Qe,Q[Qe],fe),ut!==null&&(t&&ut.alternate!==null&&Oe.delete(ut.key===null?Qe:ut.key),q=b(ut,q,Qe),yt===null?Be=ut:yt.sibling=ut,yt=ut);return t&&Oe.forEach(function(Ja){return a(K,Ja)}),ft&&oa(K,Qe),Be}function Pe(K,q,Q,fe){if(Q==null)throw Error(l(151));for(var Be=null,yt=null,Oe=q,Qe=q=0,ut=null,vt=Q.next();Oe!==null&&!vt.done;Qe++,vt=Q.next()){Oe.index>Qe?(ut=Oe,Oe=null):ut=Oe.sibling;var Ja=ee(K,Oe,vt.value,fe);if(Ja===null){Oe===null&&(Oe=ut);break}t&&Oe&&Ja.alternate===null&&a(K,Oe),q=b(Ja,q,Qe),yt===null?Be=Ja:yt.sibling=Ja,yt=Ja,Oe=ut}if(vt.done)return i(K,Oe),ft&&oa(K,Qe),Be;if(Oe===null){for(;!vt.done;Qe++,vt=Q.next())vt=de(K,vt.value,fe),vt!==null&&(q=b(vt,q,Qe),yt===null?Be=vt:yt.sibling=vt,yt=vt);return ft&&oa(K,Qe),Be}for(Oe=c(Oe);!vt.done;Qe++,vt=Q.next())vt=ie(Oe,K,Qe,vt.value,fe),vt!==null&&(t&&vt.alternate!==null&&Oe.delete(vt.key===null?Qe:vt.key),q=b(vt,q,Qe),yt===null?Be=vt:yt.sibling=vt,yt=vt);return t&&Oe.forEach(function(t2){return a(K,t2)}),ft&&oa(K,Qe),Be}function Lt(K,q,Q,fe){if(typeof Q=="object"&&Q!==null&&Q.type===E&&Q.key===null&&(Q=Q.props.children),typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case v:e:{for(var Be=Q.key;q!==null;){if(q.key===Be){if(Be=Q.type,Be===E){if(q.tag===7){i(K,q.sibling),fe=m(q,Q.props.children),fe.return=K,K=fe;break e}}else if(q.elementType===Be||typeof Be=="object"&&Be!==null&&Be.$$typeof===F&&yl(Be)===q.type){i(K,q.sibling),fe=m(q,Q.props),rs(fe,Q),fe.return=K,K=fe;break e}i(K,q);break}else a(K,q);q=q.sibling}Q.type===E?(fe=pl(Q.props.children,K.mode,fe,Q.key),fe.return=K,K=fe):(fe=zo(Q.type,Q.key,Q.props,null,K.mode,fe),rs(fe,Q),fe.return=K,K=fe)}return S(K);case w:e:{for(Be=Q.key;q!==null;){if(q.key===Be)if(q.tag===4&&q.stateNode.containerInfo===Q.containerInfo&&q.stateNode.implementation===Q.implementation){i(K,q.sibling),fe=m(q,Q.children||[]),fe.return=K,K=fe;break e}else{i(K,q);break}else a(K,q);q=q.sibling}fe=of(Q,K.mode,fe),fe.return=K,K=fe}return S(K);case F:return Q=yl(Q),Lt(K,q,Q,fe)}if(G(Q))return je(K,q,Q,fe);if(Z(Q)){if(Be=Z(Q),typeof Be!="function")throw Error(l(150));return Q=Be.call(Q),Pe(K,q,Q,fe)}if(typeof Q.then=="function")return Lt(K,q,Po(Q),fe);if(Q.$$typeof===j)return Lt(K,q,Bo(K,Q),fe);Fo(K,Q)}return typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint"?(Q=""+Q,q!==null&&q.tag===6?(i(K,q.sibling),fe=m(q,Q),fe.return=K,K=fe):(i(K,q),fe=sf(Q,K.mode,fe),fe.return=K,K=fe),S(K)):i(K,q)}return function(K,q,Q,fe){try{ns=0;var Be=Lt(K,q,Q,fe);return ni=null,Be}catch(Oe){if(Oe===ti||Oe===Uo)throw Oe;var yt=ir(29,Oe,null,K.mode);return yt.lanes=fe,yt.return=K,yt}}}var kl=vg(!0),kg=vg(!1),La=!1;function vf(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function kf(t,a){t=t.updateQueue,a.updateQueue===t&&(a.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Ia(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Ba(t,a,i){var c=t.updateQueue;if(c===null)return null;if(c=c.shared,(wt&2)!==0){var m=c.pending;return m===null?a.next=a:(a.next=m.next,m.next=a),c.pending=a,a=Do(t),ag(t,null,i),a}return Oo(t,c,a,i),Do(t)}function as(t,a,i){if(a=a.updateQueue,a!==null&&(a=a.shared,(i&4194048)!==0)){var c=a.lanes;c&=t.pendingLanes,i|=c,a.lanes=i,Ue(t,i)}}function wf(t,a){var i=t.updateQueue,c=t.alternate;if(c!==null&&(c=c.updateQueue,i===c)){var m=null,b=null;if(i=i.firstBaseUpdate,i!==null){do{var S={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};b===null?m=b=S:b=b.next=S,i=i.next}while(i!==null);b===null?m=b=a:b=b.next=a}else m=b=a;i={baseState:c.baseState,firstBaseUpdate:m,lastBaseUpdate:b,shared:c.shared,callbacks:c.callbacks},t.updateQueue=i;return}t=i.lastBaseUpdate,t===null?i.firstBaseUpdate=a:t.next=a,i.lastBaseUpdate=a}var Sf=!1;function ls(){if(Sf){var t=ei;if(t!==null)throw t}}function is(t,a,i,c){Sf=!1;var m=t.updateQueue;La=!1;var b=m.firstBaseUpdate,S=m.lastBaseUpdate,C=m.shared.pending;if(C!==null){m.shared.pending=null;var U=C,W=U.next;U.next=null,S===null?b=W:S.next=W,S=U;var ue=t.alternate;ue!==null&&(ue=ue.updateQueue,C=ue.lastBaseUpdate,C!==S&&(C===null?ue.firstBaseUpdate=W:C.next=W,ue.lastBaseUpdate=U))}if(b!==null){var de=m.baseState;S=0,ue=W=U=null,C=b;do{var ee=C.lane&-536870913,ie=ee!==C.lane;if(ie?(ot&ee)===ee:(c&ee)===ee){ee!==0&&ee===Jl&&(Sf=!0),ue!==null&&(ue=ue.next={lane:0,tag:C.tag,payload:C.payload,callback:null,next:null});e:{var je=t,Pe=C;ee=a;var Lt=i;switch(Pe.tag){case 1:if(je=Pe.payload,typeof je=="function"){de=je.call(Lt,de,ee);break e}de=je;break e;case 3:je.flags=je.flags&-65537|128;case 0:if(je=Pe.payload,ee=typeof je=="function"?je.call(Lt,de,ee):je,ee==null)break e;de=x({},de,ee);break e;case 2:La=!0}}ee=C.callback,ee!==null&&(t.flags|=64,ie&&(t.flags|=8192),ie=m.callbacks,ie===null?m.callbacks=[ee]:ie.push(ee))}else ie={lane:ee,tag:C.tag,payload:C.payload,callback:C.callback,next:null},ue===null?(W=ue=ie,U=de):ue=ue.next=ie,S|=ee;if(C=C.next,C===null){if(C=m.shared.pending,C===null)break;ie=C,C=ie.next,ie.next=null,m.lastBaseUpdate=ie,m.shared.pending=null}}while(!0);ue===null&&(U=de),m.baseState=U,m.firstBaseUpdate=W,m.lastBaseUpdate=ue,b===null&&(m.shared.lanes=0),Fa|=S,t.lanes=S,t.memoizedState=de}}function wg(t,a){if(typeof t!="function")throw Error(l(191,t));t.call(a)}function Sg(t,a){var i=t.callbacks;if(i!==null)for(t.callbacks=null,t=0;t<i.length;t++)wg(i[t],a)}var ri=O(null),Go=O(0);function Eg(t,a){t=ya,A(Go,t),A(ri,a),ya=t|a.baseLanes}function Ef(){A(Go,ya),A(ri,ri.current)}function Nf(){ya=Go.current,I(ri),I(Go)}var sr=O(null),Nr=null;function $a(t){var a=t.alternate;A(an,an.current&1),A(sr,t),Nr===null&&(a===null||ri.current!==null||a.memoizedState!==null)&&(Nr=t)}function _f(t){A(an,an.current),A(sr,t),Nr===null&&(Nr=t)}function Ng(t){t.tag===22?(A(an,an.current),A(sr,t),Nr===null&&(Nr=t)):Ua()}function Ua(){A(an,an.current),A(sr,sr.current)}function or(t){I(sr),Nr===t&&(Nr=null),I(an)}var an=O(0);function qo(t){for(var a=t;a!==null;){if(a.tag===13){var i=a.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||Md(i)||Od(i)))return a}else if(a.tag===19&&(a.memoizedProps.revealOrder==="forwards"||a.memoizedProps.revealOrder==="backwards"||a.memoizedProps.revealOrder==="unstable_legacy-backwards"||a.memoizedProps.revealOrder==="together")){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===t)break;for(;a.sibling===null;){if(a.return===null||a.return===t)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var fa=0,Ke=null,Dt=null,cn=null,Yo=!1,ai=!1,wl=!1,Vo=0,ss=0,li=null,qS=0;function tn(){throw Error(l(321))}function Tf(t,a){if(a===null)return!1;for(var i=0;i<a.length&&i<t.length;i++)if(!lr(t[i],a[i]))return!1;return!0}function Af(t,a,i,c,m,b){return fa=b,Ke=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,z.H=t===null||t.memoizedState===null?ox:Ff,wl=!1,b=i(c,m),wl=!1,ai&&(b=Tg(a,i,c,m)),_g(t),b}function _g(t){z.H=cs;var a=Dt!==null&&Dt.next!==null;if(fa=0,cn=Dt=Ke=null,Yo=!1,ss=0,li=null,a)throw Error(l(300));t===null||fn||(t=t.dependencies,t!==null&&Io(t)&&(fn=!0))}function Tg(t,a,i,c){Ke=t;var m=0;do{if(ai&&(li=null),ss=0,ai=!1,25<=m)throw Error(l(301));if(m+=1,cn=Dt=null,t.updateQueue!=null){var b=t.updateQueue;b.lastEffect=null,b.events=null,b.stores=null,b.memoCache!=null&&(b.memoCache.index=0)}z.H=ux,b=a(i,c)}while(ai);return b}function YS(){var t=z.H,a=t.useState()[0];return a=typeof a.then=="function"?os(a):a,t=t.useState()[0],(Dt!==null?Dt.memoizedState:null)!==t&&(Ke.flags|=1024),a}function Cf(){var t=Vo!==0;return Vo=0,t}function jf(t,a,i){a.updateQueue=t.updateQueue,a.flags&=-2053,t.lanes&=~i}function Rf(t){if(Yo){for(t=t.memoizedState;t!==null;){var a=t.queue;a!==null&&(a.pending=null),t=t.next}Yo=!1}fa=0,cn=Dt=Ke=null,ai=!1,ss=Vo=0,li=null}function Ln(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return cn===null?Ke.memoizedState=cn=t:cn=cn.next=t,cn}function ln(){if(Dt===null){var t=Ke.alternate;t=t!==null?t.memoizedState:null}else t=Dt.next;var a=cn===null?Ke.memoizedState:cn.next;if(a!==null)cn=a,Dt=t;else{if(t===null)throw Ke.alternate===null?Error(l(467)):Error(l(310));Dt=t,t={memoizedState:Dt.memoizedState,baseState:Dt.baseState,baseQueue:Dt.baseQueue,queue:Dt.queue,next:null},cn===null?Ke.memoizedState=cn=t:cn=cn.next=t}return cn}function Xo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function os(t){var a=ss;return ss+=1,li===null&&(li=[]),t=xg(li,t,a),a=Ke,(cn===null?a.memoizedState:cn.next)===null&&(a=a.alternate,z.H=a===null||a.memoizedState===null?ox:Ff),t}function Ko(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return os(t);if(t.$$typeof===j)return _n(t)}throw Error(l(438,String(t)))}function Mf(t){var a=null,i=Ke.updateQueue;if(i!==null&&(a=i.memoCache),a==null){var c=Ke.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(a={data:c.data.map(function(m){return m.slice()}),index:0})))}if(a==null&&(a={data:[],index:0}),i===null&&(i=Xo(),Ke.updateQueue=i),i.memoCache=a,i=a.data[a.index],i===void 0)for(i=a.data[a.index]=Array(t),c=0;c<t;c++)i[c]=L;return a.index++,i}function da(t,a){return typeof a=="function"?a(t):a}function Zo(t){var a=ln();return Of(a,Dt,t)}function Of(t,a,i){var c=t.queue;if(c===null)throw Error(l(311));c.lastRenderedReducer=i;var m=t.baseQueue,b=c.pending;if(b!==null){if(m!==null){var S=m.next;m.next=b.next,b.next=S}a.baseQueue=m=b,c.pending=null}if(b=t.baseState,m===null)t.memoizedState=b;else{a=m.next;var C=S=null,U=null,W=a,ue=!1;do{var de=W.lane&-536870913;if(de!==W.lane?(ot&de)===de:(fa&de)===de){var ee=W.revertLane;if(ee===0)U!==null&&(U=U.next={lane:0,revertLane:0,gesture:null,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null}),de===Jl&&(ue=!0);else if((fa&ee)===ee){W=W.next,ee===Jl&&(ue=!0);continue}else de={lane:0,revertLane:W.revertLane,gesture:null,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null},U===null?(C=U=de,S=b):U=U.next=de,Ke.lanes|=ee,Fa|=ee;de=W.action,wl&&i(b,de),b=W.hasEagerState?W.eagerState:i(b,de)}else ee={lane:de,revertLane:W.revertLane,gesture:W.gesture,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null},U===null?(C=U=ee,S=b):U=U.next=ee,Ke.lanes|=de,Fa|=de;W=W.next}while(W!==null&&W!==a);if(U===null?S=b:U.next=C,!lr(b,t.memoizedState)&&(fn=!0,ue&&(i=ei,i!==null)))throw i;t.memoizedState=b,t.baseState=S,t.baseQueue=U,c.lastRenderedState=b}return m===null&&(c.lanes=0),[t.memoizedState,c.dispatch]}function Df(t){var a=ln(),i=a.queue;if(i===null)throw Error(l(311));i.lastRenderedReducer=t;var c=i.dispatch,m=i.pending,b=a.memoizedState;if(m!==null){i.pending=null;var S=m=m.next;do b=t(b,S.action),S=S.next;while(S!==m);lr(b,a.memoizedState)||(fn=!0),a.memoizedState=b,a.baseQueue===null&&(a.baseState=b),i.lastRenderedState=b}return[b,c]}function Ag(t,a,i){var c=Ke,m=ln(),b=ft;if(b){if(i===void 0)throw Error(l(407));i=i()}else i=a();var S=!lr((Dt||m).memoizedState,i);if(S&&(m.memoizedState=i,fn=!0),m=m.queue,If(Rg.bind(null,c,m,t),[t]),m.getSnapshot!==a||S||cn!==null&&cn.memoizedState.tag&1){if(c.flags|=2048,ii(9,{destroy:void 0},jg.bind(null,c,m,i,a),null),$t===null)throw Error(l(349));b||(fa&127)!==0||Cg(c,a,i)}return i}function Cg(t,a,i){t.flags|=16384,t={getSnapshot:a,value:i},a=Ke.updateQueue,a===null?(a=Xo(),Ke.updateQueue=a,a.stores=[t]):(i=a.stores,i===null?a.stores=[t]:i.push(t))}function jg(t,a,i,c){a.value=i,a.getSnapshot=c,Mg(a)&&Og(t)}function Rg(t,a,i){return i(function(){Mg(a)&&Og(t)})}function Mg(t){var a=t.getSnapshot;t=t.value;try{var i=a();return!lr(t,i)}catch{return!0}}function Og(t){var a=hl(t,2);a!==null&&Qn(a,t,2)}function zf(t){var a=Ln();if(typeof t=="function"){var i=t;if(t=i(),wl){bt(!0);try{i()}finally{bt(!1)}}}return a.memoizedState=a.baseState=t,a.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:da,lastRenderedState:t},a}function Dg(t,a,i,c){return t.baseState=i,Of(t,Dt,typeof c=="function"?c:da)}function VS(t,a,i,c,m){if(Jo(t))throw Error(l(485));if(t=a.action,t!==null){var b={payload:m,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(S){b.listeners.push(S)}};z.T!==null?i(!0):b.isTransition=!1,c(b),i=a.pending,i===null?(b.next=a.pending=b,zg(a,b)):(b.next=i.next,a.pending=i.next=b)}}function zg(t,a){var i=a.action,c=a.payload,m=t.state;if(a.isTransition){var b=z.T,S={};z.T=S;try{var C=i(m,c),U=z.S;U!==null&&U(S,C),Lg(t,a,C)}catch(W){Lf(t,a,W)}finally{b!==null&&S.types!==null&&(b.types=S.types),z.T=b}}else try{b=i(m,c),Lg(t,a,b)}catch(W){Lf(t,a,W)}}function Lg(t,a,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(c){Ig(t,a,c)},function(c){return Lf(t,a,c)}):Ig(t,a,i)}function Ig(t,a,i){a.status="fulfilled",a.value=i,Bg(a),t.state=i,a=t.pending,a!==null&&(i=a.next,i===a?t.pending=null:(i=i.next,a.next=i,zg(t,i)))}function Lf(t,a,i){var c=t.pending;if(t.pending=null,c!==null){c=c.next;do a.status="rejected",a.reason=i,Bg(a),a=a.next;while(a!==c)}t.action=null}function Bg(t){t=t.listeners;for(var a=0;a<t.length;a++)(0,t[a])()}function $g(t,a){return a}function Ug(t,a){if(ft){var i=$t.formState;if(i!==null){e:{var c=Ke;if(ft){if(Yt){t:{for(var m=Yt,b=Er;m.nodeType!==8;){if(!b){m=null;break t}if(m=_r(m.nextSibling),m===null){m=null;break t}}b=m.data,m=b==="F!"||b==="F"?m:null}if(m){Yt=_r(m.nextSibling),c=m.data==="F!";break e}}Da(c)}c=!1}c&&(a=i[0])}}return i=Ln(),i.memoizedState=i.baseState=a,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:$g,lastRenderedState:a},i.queue=c,i=lx.bind(null,Ke,c),c.dispatch=i,c=zf(!1),b=Pf.bind(null,Ke,!1,c.queue),c=Ln(),m={state:a,dispatch:null,action:t,pending:null},c.queue=m,i=VS.bind(null,Ke,m,b,i),m.dispatch=i,c.memoizedState=t,[a,i,!1]}function Hg(t){var a=ln();return Pg(a,Dt,t)}function Pg(t,a,i){if(a=Of(t,a,$g)[0],t=Zo(da)[0],typeof a=="object"&&a!==null&&typeof a.then=="function")try{var c=os(a)}catch(S){throw S===ti?Uo:S}else c=a;a=ln();var m=a.queue,b=m.dispatch;return i!==a.memoizedState&&(Ke.flags|=2048,ii(9,{destroy:void 0},XS.bind(null,m,i),null)),[c,b,t]}function XS(t,a){t.action=a}function Fg(t){var a=ln(),i=Dt;if(i!==null)return Pg(a,i,t);ln(),a=a.memoizedState,i=ln();var c=i.queue.dispatch;return i.memoizedState=t,[a,c,!1]}function ii(t,a,i,c){return t={tag:t,create:i,deps:c,inst:a,next:null},a=Ke.updateQueue,a===null&&(a=Xo(),Ke.updateQueue=a),i=a.lastEffect,i===null?a.lastEffect=t.next=t:(c=i.next,i.next=t,t.next=c,a.lastEffect=t),t}function Gg(){return ln().memoizedState}function Qo(t,a,i,c){var m=Ln();Ke.flags|=t,m.memoizedState=ii(1|a,{destroy:void 0},i,c===void 0?null:c)}function Wo(t,a,i,c){var m=ln();c=c===void 0?null:c;var b=m.memoizedState.inst;Dt!==null&&c!==null&&Tf(c,Dt.memoizedState.deps)?m.memoizedState=ii(a,b,i,c):(Ke.flags|=t,m.memoizedState=ii(1|a,b,i,c))}function qg(t,a){Qo(8390656,8,t,a)}function If(t,a){Wo(2048,8,t,a)}function KS(t){Ke.flags|=4;var a=Ke.updateQueue;if(a===null)a=Xo(),Ke.updateQueue=a,a.events=[t];else{var i=a.events;i===null?a.events=[t]:i.push(t)}}function Yg(t){var a=ln().memoizedState;return KS({ref:a,nextImpl:t}),function(){if((wt&2)!==0)throw Error(l(440));return a.impl.apply(void 0,arguments)}}function Vg(t,a){return Wo(4,2,t,a)}function Xg(t,a){return Wo(4,4,t,a)}function Kg(t,a){if(typeof a=="function"){t=t();var i=a(t);return function(){typeof i=="function"?i():a(null)}}if(a!=null)return t=t(),a.current=t,function(){a.current=null}}function Zg(t,a,i){i=i!=null?i.concat([t]):null,Wo(4,4,Kg.bind(null,a,t),i)}function Bf(){}function Qg(t,a){var i=ln();a=a===void 0?null:a;var c=i.memoizedState;return a!==null&&Tf(a,c[1])?c[0]:(i.memoizedState=[t,a],t)}function Wg(t,a){var i=ln();a=a===void 0?null:a;var c=i.memoizedState;if(a!==null&&Tf(a,c[1]))return c[0];if(c=t(),wl){bt(!0);try{t()}finally{bt(!1)}}return i.memoizedState=[c,a],c}function $f(t,a,i){return i===void 0||(fa&1073741824)!==0&&(ot&261930)===0?t.memoizedState=a:(t.memoizedState=i,t=Jx(),Ke.lanes|=t,Fa|=t,i)}function Jg(t,a,i,c){return lr(i,a)?i:ri.current!==null?(t=$f(t,i,c),lr(t,a)||(fn=!0),t):(fa&42)===0||(fa&1073741824)!==0&&(ot&261930)===0?(fn=!0,t.memoizedState=i):(t=Jx(),Ke.lanes|=t,Fa|=t,a)}function ex(t,a,i,c,m){var b=V.p;V.p=b!==0&&8>b?b:8;var S=z.T,C={};z.T=C,Pf(t,!1,a,i);try{var U=m(),W=z.S;if(W!==null&&W(C,U),U!==null&&typeof U=="object"&&typeof U.then=="function"){var ue=GS(U,c);us(t,a,ue,fr(t))}else us(t,a,c,fr(t))}catch(de){us(t,a,{then:function(){},status:"rejected",reason:de},fr())}finally{V.p=b,S!==null&&C.types!==null&&(S.types=C.types),z.T=S}}function ZS(){}function Uf(t,a,i,c){if(t.tag!==5)throw Error(l(476));var m=tx(t).queue;ex(t,m,a,ne,i===null?ZS:function(){return nx(t),i(c)})}function tx(t){var a=t.memoizedState;if(a!==null)return a;a={memoizedState:ne,baseState:ne,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:da,lastRenderedState:ne},next:null};var i={};return a.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:da,lastRenderedState:i},next:null},t.memoizedState=a,t=t.alternate,t!==null&&(t.memoizedState=a),a}function nx(t){var a=tx(t);a.next===null&&(a=t.alternate.memoizedState),us(t,a.next.queue,{},fr())}function Hf(){return _n(_s)}function rx(){return ln().memoizedState}function ax(){return ln().memoizedState}function QS(t){for(var a=t.return;a!==null;){switch(a.tag){case 24:case 3:var i=fr();t=Ia(i);var c=Ba(a,t,i);c!==null&&(Qn(c,a,i),as(c,a,i)),a={cache:gf()},t.payload=a;return}a=a.return}}function WS(t,a,i){var c=fr();i={lane:c,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Jo(t)?ix(a,i):(i=af(t,a,i,c),i!==null&&(Qn(i,t,c),sx(i,a,c)))}function lx(t,a,i){var c=fr();us(t,a,i,c)}function us(t,a,i,c){var m={lane:c,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(Jo(t))ix(a,m);else{var b=t.alternate;if(t.lanes===0&&(b===null||b.lanes===0)&&(b=a.lastRenderedReducer,b!==null))try{var S=a.lastRenderedState,C=b(S,i);if(m.hasEagerState=!0,m.eagerState=C,lr(C,S))return Oo(t,a,m,0),$t===null&&Mo(),!1}catch{}if(i=af(t,a,m,c),i!==null)return Qn(i,t,c),sx(i,a,c),!0}return!1}function Pf(t,a,i,c){if(c={lane:2,revertLane:vd(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},Jo(t)){if(a)throw Error(l(479))}else a=af(t,i,c,2),a!==null&&Qn(a,t,2)}function Jo(t){var a=t.alternate;return t===Ke||a!==null&&a===Ke}function ix(t,a){ai=Yo=!0;var i=t.pending;i===null?a.next=a:(a.next=i.next,i.next=a),t.pending=a}function sx(t,a,i){if((i&4194048)!==0){var c=a.lanes;c&=t.pendingLanes,i|=c,a.lanes=i,Ue(t,i)}}var cs={readContext:_n,use:Ko,useCallback:tn,useContext:tn,useEffect:tn,useImperativeHandle:tn,useLayoutEffect:tn,useInsertionEffect:tn,useMemo:tn,useReducer:tn,useRef:tn,useState:tn,useDebugValue:tn,useDeferredValue:tn,useTransition:tn,useSyncExternalStore:tn,useId:tn,useHostTransitionStatus:tn,useFormState:tn,useActionState:tn,useOptimistic:tn,useMemoCache:tn,useCacheRefresh:tn};cs.useEffectEvent=tn;var ox={readContext:_n,use:Ko,useCallback:function(t,a){return Ln().memoizedState=[t,a===void 0?null:a],t},useContext:_n,useEffect:qg,useImperativeHandle:function(t,a,i){i=i!=null?i.concat([t]):null,Qo(4194308,4,Kg.bind(null,a,t),i)},useLayoutEffect:function(t,a){return Qo(4194308,4,t,a)},useInsertionEffect:function(t,a){Qo(4,2,t,a)},useMemo:function(t,a){var i=Ln();a=a===void 0?null:a;var c=t();if(wl){bt(!0);try{t()}finally{bt(!1)}}return i.memoizedState=[c,a],c},useReducer:function(t,a,i){var c=Ln();if(i!==void 0){var m=i(a);if(wl){bt(!0);try{i(a)}finally{bt(!1)}}}else m=a;return c.memoizedState=c.baseState=m,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:m},c.queue=t,t=t.dispatch=WS.bind(null,Ke,t),[c.memoizedState,t]},useRef:function(t){var a=Ln();return t={current:t},a.memoizedState=t},useState:function(t){t=zf(t);var a=t.queue,i=lx.bind(null,Ke,a);return a.dispatch=i,[t.memoizedState,i]},useDebugValue:Bf,useDeferredValue:function(t,a){var i=Ln();return $f(i,t,a)},useTransition:function(){var t=zf(!1);return t=ex.bind(null,Ke,t.queue,!0,!1),Ln().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,a,i){var c=Ke,m=Ln();if(ft){if(i===void 0)throw Error(l(407));i=i()}else{if(i=a(),$t===null)throw Error(l(349));(ot&127)!==0||Cg(c,a,i)}m.memoizedState=i;var b={value:i,getSnapshot:a};return m.queue=b,qg(Rg.bind(null,c,b,t),[t]),c.flags|=2048,ii(9,{destroy:void 0},jg.bind(null,c,b,i,a),null),i},useId:function(){var t=Ln(),a=$t.identifierPrefix;if(ft){var i=Vr,c=Yr;i=(c&~(1<<32-Je(c)-1)).toString(32)+i,a="_"+a+"R_"+i,i=Vo++,0<i&&(a+="H"+i.toString(32)),a+="_"}else i=qS++,a="_"+a+"r_"+i.toString(32)+"_";return t.memoizedState=a},useHostTransitionStatus:Hf,useFormState:Ug,useActionState:Ug,useOptimistic:function(t){var a=Ln();a.memoizedState=a.baseState=t;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return a.queue=i,a=Pf.bind(null,Ke,!0,i),i.dispatch=a,[t,a]},useMemoCache:Mf,useCacheRefresh:function(){return Ln().memoizedState=QS.bind(null,Ke)},useEffectEvent:function(t){var a=Ln(),i={impl:t};return a.memoizedState=i,function(){if((wt&2)!==0)throw Error(l(440));return i.impl.apply(void 0,arguments)}}},Ff={readContext:_n,use:Ko,useCallback:Qg,useContext:_n,useEffect:If,useImperativeHandle:Zg,useInsertionEffect:Vg,useLayoutEffect:Xg,useMemo:Wg,useReducer:Zo,useRef:Gg,useState:function(){return Zo(da)},useDebugValue:Bf,useDeferredValue:function(t,a){var i=ln();return Jg(i,Dt.memoizedState,t,a)},useTransition:function(){var t=Zo(da)[0],a=ln().memoizedState;return[typeof t=="boolean"?t:os(t),a]},useSyncExternalStore:Ag,useId:rx,useHostTransitionStatus:Hf,useFormState:Hg,useActionState:Hg,useOptimistic:function(t,a){var i=ln();return Dg(i,Dt,t,a)},useMemoCache:Mf,useCacheRefresh:ax};Ff.useEffectEvent=Yg;var ux={readContext:_n,use:Ko,useCallback:Qg,useContext:_n,useEffect:If,useImperativeHandle:Zg,useInsertionEffect:Vg,useLayoutEffect:Xg,useMemo:Wg,useReducer:Df,useRef:Gg,useState:function(){return Df(da)},useDebugValue:Bf,useDeferredValue:function(t,a){var i=ln();return Dt===null?$f(i,t,a):Jg(i,Dt.memoizedState,t,a)},useTransition:function(){var t=Df(da)[0],a=ln().memoizedState;return[typeof t=="boolean"?t:os(t),a]},useSyncExternalStore:Ag,useId:rx,useHostTransitionStatus:Hf,useFormState:Fg,useActionState:Fg,useOptimistic:function(t,a){var i=ln();return Dt!==null?Dg(i,Dt,t,a):(i.baseState=t,[t,i.queue.dispatch])},useMemoCache:Mf,useCacheRefresh:ax};ux.useEffectEvent=Yg;function Gf(t,a,i,c){a=t.memoizedState,i=i(c,a),i=i==null?a:x({},a,i),t.memoizedState=i,t.lanes===0&&(t.updateQueue.baseState=i)}var qf={enqueueSetState:function(t,a,i){t=t._reactInternals;var c=fr(),m=Ia(c);m.payload=a,i!=null&&(m.callback=i),a=Ba(t,m,c),a!==null&&(Qn(a,t,c),as(a,t,c))},enqueueReplaceState:function(t,a,i){t=t._reactInternals;var c=fr(),m=Ia(c);m.tag=1,m.payload=a,i!=null&&(m.callback=i),a=Ba(t,m,c),a!==null&&(Qn(a,t,c),as(a,t,c))},enqueueForceUpdate:function(t,a){t=t._reactInternals;var i=fr(),c=Ia(i);c.tag=2,a!=null&&(c.callback=a),a=Ba(t,c,i),a!==null&&(Qn(a,t,i),as(a,t,i))}};function cx(t,a,i,c,m,b,S){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(c,b,S):a.prototype&&a.prototype.isPureReactComponent?!Zi(i,c)||!Zi(m,b):!0}function fx(t,a,i,c){t=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(i,c),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(i,c),a.state!==t&&qf.enqueueReplaceState(a,a.state,null)}function Sl(t,a){var i=a;if("ref"in a){i={};for(var c in a)c!=="ref"&&(i[c]=a[c])}if(t=t.defaultProps){i===a&&(i=x({},i));for(var m in t)i[m]===void 0&&(i[m]=t[m])}return i}function dx(t){Ro(t)}function hx(t){console.error(t)}function px(t){Ro(t)}function eu(t,a){try{var i=t.onUncaughtError;i(a.value,{componentStack:a.stack})}catch(c){setTimeout(function(){throw c})}}function mx(t,a,i){try{var c=t.onCaughtError;c(i.value,{componentStack:i.stack,errorBoundary:a.tag===1?a.stateNode:null})}catch(m){setTimeout(function(){throw m})}}function Yf(t,a,i){return i=Ia(i),i.tag=3,i.payload={element:null},i.callback=function(){eu(t,a)},i}function gx(t){return t=Ia(t),t.tag=3,t}function xx(t,a,i,c){var m=i.type.getDerivedStateFromError;if(typeof m=="function"){var b=c.value;t.payload=function(){return m(b)},t.callback=function(){mx(a,i,c)}}var S=i.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(t.callback=function(){mx(a,i,c),typeof m!="function"&&(Ga===null?Ga=new Set([this]):Ga.add(this));var C=c.stack;this.componentDidCatch(c.value,{componentStack:C!==null?C:""})})}function JS(t,a,i,c,m){if(i.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(a=i.alternate,a!==null&&Wl(a,i,m,!0),i=sr.current,i!==null){switch(i.tag){case 31:case 13:return Nr===null?du():i.alternate===null&&nn===0&&(nn=3),i.flags&=-257,i.flags|=65536,i.lanes=m,c===Ho?i.flags|=16384:(a=i.updateQueue,a===null?i.updateQueue=new Set([c]):a.add(c),xd(t,c,m)),!1;case 22:return i.flags|=65536,c===Ho?i.flags|=16384:(a=i.updateQueue,a===null?(a={transitions:null,markerInstances:null,retryQueue:new Set([c])},i.updateQueue=a):(i=a.retryQueue,i===null?a.retryQueue=new Set([c]):i.add(c)),xd(t,c,m)),!1}throw Error(l(435,i.tag))}return xd(t,c,m),du(),!1}if(ft)return a=sr.current,a!==null?((a.flags&65536)===0&&(a.flags|=256),a.flags|=65536,a.lanes=m,c!==ff&&(t=Error(l(422),{cause:c}),Ji(kr(t,i)))):(c!==ff&&(a=Error(l(423),{cause:c}),Ji(kr(a,i))),t=t.current.alternate,t.flags|=65536,m&=-m,t.lanes|=m,c=kr(c,i),m=Yf(t.stateNode,c,m),wf(t,m),nn!==4&&(nn=2)),!1;var b=Error(l(520),{cause:c});if(b=kr(b,i),bs===null?bs=[b]:bs.push(b),nn!==4&&(nn=2),a===null)return!0;c=kr(c,i),i=a;do{switch(i.tag){case 3:return i.flags|=65536,t=m&-m,i.lanes|=t,t=Yf(i.stateNode,c,t),wf(i,t),!1;case 1:if(a=i.type,b=i.stateNode,(i.flags&128)===0&&(typeof a.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(Ga===null||!Ga.has(b))))return i.flags|=65536,m&=-m,i.lanes|=m,m=gx(m),xx(m,t,i,c),wf(i,m),!1}i=i.return}while(i!==null);return!1}var Vf=Error(l(461)),fn=!1;function Tn(t,a,i,c){a.child=t===null?kg(a,null,i,c):kl(a,t.child,i,c)}function bx(t,a,i,c,m){i=i.render;var b=a.ref;if("ref"in c){var S={};for(var C in c)C!=="ref"&&(S[C]=c[C])}else S=c;return xl(a),c=Af(t,a,i,S,b,m),C=Cf(),t!==null&&!fn?(jf(t,a,m),ha(t,a,m)):(ft&&C&&uf(a),a.flags|=1,Tn(t,a,c,m),a.child)}function yx(t,a,i,c,m){if(t===null){var b=i.type;return typeof b=="function"&&!lf(b)&&b.defaultProps===void 0&&i.compare===null?(a.tag=15,a.type=b,vx(t,a,b,c,m)):(t=zo(i.type,null,c,a,a.mode,m),t.ref=a.ref,t.return=a,a.child=t)}if(b=t.child,!td(t,m)){var S=b.memoizedProps;if(i=i.compare,i=i!==null?i:Zi,i(S,c)&&t.ref===a.ref)return ha(t,a,m)}return a.flags|=1,t=sa(b,c),t.ref=a.ref,t.return=a,a.child=t}function vx(t,a,i,c,m){if(t!==null){var b=t.memoizedProps;if(Zi(b,c)&&t.ref===a.ref)if(fn=!1,a.pendingProps=c=b,td(t,m))(t.flags&131072)!==0&&(fn=!0);else return a.lanes=t.lanes,ha(t,a,m)}return Xf(t,a,i,c,m)}function kx(t,a,i,c){var m=c.children,b=t!==null?t.memoizedState:null;if(t===null&&a.stateNode===null&&(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.mode==="hidden"){if((a.flags&128)!==0){if(b=b!==null?b.baseLanes|i:i,t!==null){for(c=a.child=t.child,m=0;c!==null;)m=m|c.lanes|c.childLanes,c=c.sibling;c=m&~b}else c=0,a.child=null;return wx(t,a,b,i,c)}if((i&536870912)!==0)a.memoizedState={baseLanes:0,cachePool:null},t!==null&&$o(a,b!==null?b.cachePool:null),b!==null?Eg(a,b):Ef(),Ng(a);else return c=a.lanes=536870912,wx(t,a,b!==null?b.baseLanes|i:i,i,c)}else b!==null?($o(a,b.cachePool),Eg(a,b),Ua(),a.memoizedState=null):(t!==null&&$o(a,null),Ef(),Ua());return Tn(t,a,m,i),a.child}function fs(t,a){return t!==null&&t.tag===22||a.stateNode!==null||(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.sibling}function wx(t,a,i,c,m){var b=bf();return b=b===null?null:{parent:un._currentValue,pool:b},a.memoizedState={baseLanes:i,cachePool:b},t!==null&&$o(a,null),Ef(),Ng(a),t!==null&&Wl(t,a,c,!0),a.childLanes=m,null}function tu(t,a){return a=ru({mode:a.mode,children:a.children},t.mode),a.ref=t.ref,t.child=a,a.return=t,a}function Sx(t,a,i){return kl(a,t.child,null,i),t=tu(a,a.pendingProps),t.flags|=2,or(a),a.memoizedState=null,t}function eE(t,a,i){var c=a.pendingProps,m=(a.flags&128)!==0;if(a.flags&=-129,t===null){if(ft){if(c.mode==="hidden")return t=tu(a,c),a.lanes=536870912,fs(null,t);if(_f(a),(t=Yt)?(t=zb(t,Er),t=t!==null&&t.data==="&"?t:null,t!==null&&(a.memoizedState={dehydrated:t,treeContext:Ma!==null?{id:Yr,overflow:Vr}:null,retryLane:536870912,hydrationErrors:null},i=ig(t),i.return=a,a.child=i,Nn=a,Yt=null)):t=null,t===null)throw Da(a);return a.lanes=536870912,null}return tu(a,c)}var b=t.memoizedState;if(b!==null){var S=b.dehydrated;if(_f(a),m)if(a.flags&256)a.flags&=-257,a=Sx(t,a,i);else if(a.memoizedState!==null)a.child=t.child,a.flags|=128,a=null;else throw Error(l(558));else if(fn||Wl(t,a,i,!1),m=(i&t.childLanes)!==0,fn||m){if(c=$t,c!==null&&(S=It(c,i),S!==0&&S!==b.retryLane))throw b.retryLane=S,hl(t,S),Qn(c,t,S),Vf;du(),a=Sx(t,a,i)}else t=b.treeContext,Yt=_r(S.nextSibling),Nn=a,ft=!0,Oa=null,Er=!1,t!==null&&ug(a,t),a=tu(a,c),a.flags|=4096;return a}return t=sa(t.child,{mode:c.mode,children:c.children}),t.ref=a.ref,a.child=t,t.return=a,t}function nu(t,a){var i=a.ref;if(i===null)t!==null&&t.ref!==null&&(a.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(l(284));(t===null||t.ref!==i)&&(a.flags|=4194816)}}function Xf(t,a,i,c,m){return xl(a),i=Af(t,a,i,c,void 0,m),c=Cf(),t!==null&&!fn?(jf(t,a,m),ha(t,a,m)):(ft&&c&&uf(a),a.flags|=1,Tn(t,a,i,m),a.child)}function Ex(t,a,i,c,m,b){return xl(a),a.updateQueue=null,i=Tg(a,c,i,m),_g(t),c=Cf(),t!==null&&!fn?(jf(t,a,b),ha(t,a,b)):(ft&&c&&uf(a),a.flags|=1,Tn(t,a,i,b),a.child)}function Nx(t,a,i,c,m){if(xl(a),a.stateNode===null){var b=Xl,S=i.contextType;typeof S=="object"&&S!==null&&(b=_n(S)),b=new i(c,b),a.memoizedState=b.state!==null&&b.state!==void 0?b.state:null,b.updater=qf,a.stateNode=b,b._reactInternals=a,b=a.stateNode,b.props=c,b.state=a.memoizedState,b.refs={},vf(a),S=i.contextType,b.context=typeof S=="object"&&S!==null?_n(S):Xl,b.state=a.memoizedState,S=i.getDerivedStateFromProps,typeof S=="function"&&(Gf(a,i,S,c),b.state=a.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof b.getSnapshotBeforeUpdate=="function"||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(S=b.state,typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount(),S!==b.state&&qf.enqueueReplaceState(b,b.state,null),is(a,c,b,m),ls(),b.state=a.memoizedState),typeof b.componentDidMount=="function"&&(a.flags|=4194308),c=!0}else if(t===null){b=a.stateNode;var C=a.memoizedProps,U=Sl(i,C);b.props=U;var W=b.context,ue=i.contextType;S=Xl,typeof ue=="object"&&ue!==null&&(S=_n(ue));var de=i.getDerivedStateFromProps;ue=typeof de=="function"||typeof b.getSnapshotBeforeUpdate=="function",C=a.pendingProps!==C,ue||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(C||W!==S)&&fx(a,b,c,S),La=!1;var ee=a.memoizedState;b.state=ee,is(a,c,b,m),ls(),W=a.memoizedState,C||ee!==W||La?(typeof de=="function"&&(Gf(a,i,de,c),W=a.memoizedState),(U=La||cx(a,i,U,c,ee,W,S))?(ue||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount()),typeof b.componentDidMount=="function"&&(a.flags|=4194308)):(typeof b.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=c,a.memoizedState=W),b.props=c,b.state=W,b.context=S,c=U):(typeof b.componentDidMount=="function"&&(a.flags|=4194308),c=!1)}else{b=a.stateNode,kf(t,a),S=a.memoizedProps,ue=Sl(i,S),b.props=ue,de=a.pendingProps,ee=b.context,W=i.contextType,U=Xl,typeof W=="object"&&W!==null&&(U=_n(W)),C=i.getDerivedStateFromProps,(W=typeof C=="function"||typeof b.getSnapshotBeforeUpdate=="function")||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(S!==de||ee!==U)&&fx(a,b,c,U),La=!1,ee=a.memoizedState,b.state=ee,is(a,c,b,m),ls();var ie=a.memoizedState;S!==de||ee!==ie||La||t!==null&&t.dependencies!==null&&Io(t.dependencies)?(typeof C=="function"&&(Gf(a,i,C,c),ie=a.memoizedState),(ue=La||cx(a,i,ue,c,ee,ie,U)||t!==null&&t.dependencies!==null&&Io(t.dependencies))?(W||typeof b.UNSAFE_componentWillUpdate!="function"&&typeof b.componentWillUpdate!="function"||(typeof b.componentWillUpdate=="function"&&b.componentWillUpdate(c,ie,U),typeof b.UNSAFE_componentWillUpdate=="function"&&b.UNSAFE_componentWillUpdate(c,ie,U)),typeof b.componentDidUpdate=="function"&&(a.flags|=4),typeof b.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof b.componentDidUpdate!="function"||S===t.memoizedProps&&ee===t.memoizedState||(a.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||S===t.memoizedProps&&ee===t.memoizedState||(a.flags|=1024),a.memoizedProps=c,a.memoizedState=ie),b.props=c,b.state=ie,b.context=U,c=ue):(typeof b.componentDidUpdate!="function"||S===t.memoizedProps&&ee===t.memoizedState||(a.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||S===t.memoizedProps&&ee===t.memoizedState||(a.flags|=1024),c=!1)}return b=c,nu(t,a),c=(a.flags&128)!==0,b||c?(b=a.stateNode,i=c&&typeof i.getDerivedStateFromError!="function"?null:b.render(),a.flags|=1,t!==null&&c?(a.child=kl(a,t.child,null,m),a.child=kl(a,null,i,m)):Tn(t,a,i,m),a.memoizedState=b.state,t=a.child):t=ha(t,a,m),t}function _x(t,a,i,c){return ml(),a.flags|=256,Tn(t,a,i,c),a.child}var Kf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Zf(t){return{baseLanes:t,cachePool:mg()}}function Qf(t,a,i){return t=t!==null?t.childLanes&~i:0,a&&(t|=cr),t}function Tx(t,a,i){var c=a.pendingProps,m=!1,b=(a.flags&128)!==0,S;if((S=b)||(S=t!==null&&t.memoizedState===null?!1:(an.current&2)!==0),S&&(m=!0,a.flags&=-129),S=(a.flags&32)!==0,a.flags&=-33,t===null){if(ft){if(m?$a(a):Ua(),(t=Yt)?(t=zb(t,Er),t=t!==null&&t.data!=="&"?t:null,t!==null&&(a.memoizedState={dehydrated:t,treeContext:Ma!==null?{id:Yr,overflow:Vr}:null,retryLane:536870912,hydrationErrors:null},i=ig(t),i.return=a,a.child=i,Nn=a,Yt=null)):t=null,t===null)throw Da(a);return Od(t)?a.lanes=32:a.lanes=536870912,null}var C=c.children;return c=c.fallback,m?(Ua(),m=a.mode,C=ru({mode:"hidden",children:C},m),c=pl(c,m,i,null),C.return=a,c.return=a,C.sibling=c,a.child=C,c=a.child,c.memoizedState=Zf(i),c.childLanes=Qf(t,S,i),a.memoizedState=Kf,fs(null,c)):($a(a),Wf(a,C))}var U=t.memoizedState;if(U!==null&&(C=U.dehydrated,C!==null)){if(b)a.flags&256?($a(a),a.flags&=-257,a=Jf(t,a,i)):a.memoizedState!==null?(Ua(),a.child=t.child,a.flags|=128,a=null):(Ua(),C=c.fallback,m=a.mode,c=ru({mode:"visible",children:c.children},m),C=pl(C,m,i,null),C.flags|=2,c.return=a,C.return=a,c.sibling=C,a.child=c,kl(a,t.child,null,i),c=a.child,c.memoizedState=Zf(i),c.childLanes=Qf(t,S,i),a.memoizedState=Kf,a=fs(null,c));else if($a(a),Od(C)){if(S=C.nextSibling&&C.nextSibling.dataset,S)var W=S.dgst;S=W,c=Error(l(419)),c.stack="",c.digest=S,Ji({value:c,source:null,stack:null}),a=Jf(t,a,i)}else if(fn||Wl(t,a,i,!1),S=(i&t.childLanes)!==0,fn||S){if(S=$t,S!==null&&(c=It(S,i),c!==0&&c!==U.retryLane))throw U.retryLane=c,hl(t,c),Qn(S,t,c),Vf;Md(C)||du(),a=Jf(t,a,i)}else Md(C)?(a.flags|=192,a.child=t.child,a=null):(t=U.treeContext,Yt=_r(C.nextSibling),Nn=a,ft=!0,Oa=null,Er=!1,t!==null&&ug(a,t),a=Wf(a,c.children),a.flags|=4096);return a}return m?(Ua(),C=c.fallback,m=a.mode,U=t.child,W=U.sibling,c=sa(U,{mode:"hidden",children:c.children}),c.subtreeFlags=U.subtreeFlags&65011712,W!==null?C=sa(W,C):(C=pl(C,m,i,null),C.flags|=2),C.return=a,c.return=a,c.sibling=C,a.child=c,fs(null,c),c=a.child,C=t.child.memoizedState,C===null?C=Zf(i):(m=C.cachePool,m!==null?(U=un._currentValue,m=m.parent!==U?{parent:U,pool:U}:m):m=mg(),C={baseLanes:C.baseLanes|i,cachePool:m}),c.memoizedState=C,c.childLanes=Qf(t,S,i),a.memoizedState=Kf,fs(t.child,c)):($a(a),i=t.child,t=i.sibling,i=sa(i,{mode:"visible",children:c.children}),i.return=a,i.sibling=null,t!==null&&(S=a.deletions,S===null?(a.deletions=[t],a.flags|=16):S.push(t)),a.child=i,a.memoizedState=null,i)}function Wf(t,a){return a=ru({mode:"visible",children:a},t.mode),a.return=t,t.child=a}function ru(t,a){return t=ir(22,t,null,a),t.lanes=0,t}function Jf(t,a,i){return kl(a,t.child,null,i),t=Wf(a,a.pendingProps.children),t.flags|=2,a.memoizedState=null,t}function Ax(t,a,i){t.lanes|=a;var c=t.alternate;c!==null&&(c.lanes|=a),pf(t.return,a,i)}function ed(t,a,i,c,m,b){var S=t.memoizedState;S===null?t.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:c,tail:i,tailMode:m,treeForkCount:b}:(S.isBackwards=a,S.rendering=null,S.renderingStartTime=0,S.last=c,S.tail=i,S.tailMode=m,S.treeForkCount=b)}function Cx(t,a,i){var c=a.pendingProps,m=c.revealOrder,b=c.tail;c=c.children;var S=an.current,C=(S&2)!==0;if(C?(S=S&1|2,a.flags|=128):S&=1,A(an,S),Tn(t,a,c,i),c=ft?Wi:0,!C&&t!==null&&(t.flags&128)!==0)e:for(t=a.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Ax(t,i,a);else if(t.tag===19)Ax(t,i,a);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===a)break e;for(;t.sibling===null;){if(t.return===null||t.return===a)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(m){case"forwards":for(i=a.child,m=null;i!==null;)t=i.alternate,t!==null&&qo(t)===null&&(m=i),i=i.sibling;i=m,i===null?(m=a.child,a.child=null):(m=i.sibling,i.sibling=null),ed(a,!1,m,i,b,c);break;case"backwards":case"unstable_legacy-backwards":for(i=null,m=a.child,a.child=null;m!==null;){if(t=m.alternate,t!==null&&qo(t)===null){a.child=m;break}t=m.sibling,m.sibling=i,i=m,m=t}ed(a,!0,i,null,b,c);break;case"together":ed(a,!1,null,null,void 0,c);break;default:a.memoizedState=null}return a.child}function ha(t,a,i){if(t!==null&&(a.dependencies=t.dependencies),Fa|=a.lanes,(i&a.childLanes)===0)if(t!==null){if(Wl(t,a,i,!1),(i&a.childLanes)===0)return null}else return null;if(t!==null&&a.child!==t.child)throw Error(l(153));if(a.child!==null){for(t=a.child,i=sa(t,t.pendingProps),a.child=i,i.return=a;t.sibling!==null;)t=t.sibling,i=i.sibling=sa(t,t.pendingProps),i.return=a;i.sibling=null}return a.child}function td(t,a){return(t.lanes&a)!==0?!0:(t=t.dependencies,!!(t!==null&&Io(t)))}function tE(t,a,i){switch(a.tag){case 3:Ae(a,a.stateNode.containerInfo),za(a,un,t.memoizedState.cache),ml();break;case 27:case 5:qe(a);break;case 4:Ae(a,a.stateNode.containerInfo);break;case 10:za(a,a.type,a.memoizedProps.value);break;case 31:if(a.memoizedState!==null)return a.flags|=128,_f(a),null;break;case 13:var c=a.memoizedState;if(c!==null)return c.dehydrated!==null?($a(a),a.flags|=128,null):(i&a.child.childLanes)!==0?Tx(t,a,i):($a(a),t=ha(t,a,i),t!==null?t.sibling:null);$a(a);break;case 19:var m=(t.flags&128)!==0;if(c=(i&a.childLanes)!==0,c||(Wl(t,a,i,!1),c=(i&a.childLanes)!==0),m){if(c)return Cx(t,a,i);a.flags|=128}if(m=a.memoizedState,m!==null&&(m.rendering=null,m.tail=null,m.lastEffect=null),A(an,an.current),c)break;return null;case 22:return a.lanes=0,kx(t,a,i,a.pendingProps);case 24:za(a,un,t.memoizedState.cache)}return ha(t,a,i)}function jx(t,a,i){if(t!==null)if(t.memoizedProps!==a.pendingProps)fn=!0;else{if(!td(t,i)&&(a.flags&128)===0)return fn=!1,tE(t,a,i);fn=(t.flags&131072)!==0}else fn=!1,ft&&(a.flags&1048576)!==0&&og(a,Wi,a.index);switch(a.lanes=0,a.tag){case 16:e:{var c=a.pendingProps;if(t=yl(a.elementType),a.type=t,typeof t=="function")lf(t)?(c=Sl(t,c),a.tag=1,a=Nx(null,a,t,c,i)):(a.tag=0,a=Xf(null,a,t,c,i));else{if(t!=null){var m=t.$$typeof;if(m===$){a.tag=11,a=bx(null,a,t,c,i);break e}else if(m===D){a.tag=14,a=yx(null,a,t,c,i);break e}}throw a=J(t)||t,Error(l(306,a,""))}}return a;case 0:return Xf(t,a,a.type,a.pendingProps,i);case 1:return c=a.type,m=Sl(c,a.pendingProps),Nx(t,a,c,m,i);case 3:e:{if(Ae(a,a.stateNode.containerInfo),t===null)throw Error(l(387));c=a.pendingProps;var b=a.memoizedState;m=b.element,kf(t,a),is(a,c,null,i);var S=a.memoizedState;if(c=S.cache,za(a,un,c),c!==b.cache&&mf(a,[un],i,!0),ls(),c=S.element,b.isDehydrated)if(b={element:c,isDehydrated:!1,cache:S.cache},a.updateQueue.baseState=b,a.memoizedState=b,a.flags&256){a=_x(t,a,c,i);break e}else if(c!==m){m=kr(Error(l(424)),a),Ji(m),a=_x(t,a,c,i);break e}else for(t=a.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,Yt=_r(t.firstChild),Nn=a,ft=!0,Oa=null,Er=!0,i=kg(a,null,c,i),a.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(ml(),c===m){a=ha(t,a,i);break e}Tn(t,a,c,i)}a=a.child}return a;case 26:return nu(t,a),t===null?(i=Hb(a.type,null,a.pendingProps,null))?a.memoizedState=i:ft||(i=a.type,t=a.pendingProps,c=yu(he.current).createElement(i),c[Ot]=a,c[Nt]=t,An(c,i,t),Ve(c),a.stateNode=c):a.memoizedState=Hb(a.type,t.memoizedProps,a.pendingProps,t.memoizedState),null;case 27:return qe(a),t===null&&ft&&(c=a.stateNode=Bb(a.type,a.pendingProps,he.current),Nn=a,Er=!0,m=Yt,Xa(a.type)?(Dd=m,Yt=_r(c.firstChild)):Yt=m),Tn(t,a,a.pendingProps.children,i),nu(t,a),t===null&&(a.flags|=4194304),a.child;case 5:return t===null&&ft&&((m=c=Yt)&&(c=RE(c,a.type,a.pendingProps,Er),c!==null?(a.stateNode=c,Nn=a,Yt=_r(c.firstChild),Er=!1,m=!0):m=!1),m||Da(a)),qe(a),m=a.type,b=a.pendingProps,S=t!==null?t.memoizedProps:null,c=b.children,Cd(m,b)?c=null:S!==null&&Cd(m,S)&&(a.flags|=32),a.memoizedState!==null&&(m=Af(t,a,YS,null,null,i),_s._currentValue=m),nu(t,a),Tn(t,a,c,i),a.child;case 6:return t===null&&ft&&((t=i=Yt)&&(i=ME(i,a.pendingProps,Er),i!==null?(a.stateNode=i,Nn=a,Yt=null,t=!0):t=!1),t||Da(a)),null;case 13:return Tx(t,a,i);case 4:return Ae(a,a.stateNode.containerInfo),c=a.pendingProps,t===null?a.child=kl(a,null,c,i):Tn(t,a,c,i),a.child;case 11:return bx(t,a,a.type,a.pendingProps,i);case 7:return Tn(t,a,a.pendingProps,i),a.child;case 8:return Tn(t,a,a.pendingProps.children,i),a.child;case 12:return Tn(t,a,a.pendingProps.children,i),a.child;case 10:return c=a.pendingProps,za(a,a.type,c.value),Tn(t,a,c.children,i),a.child;case 9:return m=a.type._context,c=a.pendingProps.children,xl(a),m=_n(m),c=c(m),a.flags|=1,Tn(t,a,c,i),a.child;case 14:return yx(t,a,a.type,a.pendingProps,i);case 15:return vx(t,a,a.type,a.pendingProps,i);case 19:return Cx(t,a,i);case 31:return eE(t,a,i);case 22:return kx(t,a,i,a.pendingProps);case 24:return xl(a),c=_n(un),t===null?(m=bf(),m===null&&(m=$t,b=gf(),m.pooledCache=b,b.refCount++,b!==null&&(m.pooledCacheLanes|=i),m=b),a.memoizedState={parent:c,cache:m},vf(a),za(a,un,m)):((t.lanes&i)!==0&&(kf(t,a),is(a,null,null,i),ls()),m=t.memoizedState,b=a.memoizedState,m.parent!==c?(m={parent:c,cache:c},a.memoizedState=m,a.lanes===0&&(a.memoizedState=a.updateQueue.baseState=m),za(a,un,c)):(c=b.cache,za(a,un,c),c!==m.cache&&mf(a,[un],i,!0))),Tn(t,a,a.pendingProps.children,i),a.child;case 29:throw a.pendingProps}throw Error(l(156,a.tag))}function pa(t){t.flags|=4}function nd(t,a,i,c,m){if((a=(t.mode&32)!==0)&&(a=!1),a){if(t.flags|=16777216,(m&335544128)===m)if(t.stateNode.complete)t.flags|=8192;else if(rb())t.flags|=8192;else throw vl=Ho,yf}else t.flags&=-16777217}function Rx(t,a){if(a.type!=="stylesheet"||(a.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!Yb(a))if(rb())t.flags|=8192;else throw vl=Ho,yf}function au(t,a){a!==null&&(t.flags|=4),t.flags&16384&&(a=t.tag!==22?Le():536870912,t.lanes|=a,ci|=a)}function ds(t,a){if(!ft)switch(t.tailMode){case"hidden":a=t.tail;for(var i=null;a!==null;)a.alternate!==null&&(i=a),a=a.sibling;i===null?t.tail=null:i.sibling=null;break;case"collapsed":i=t.tail;for(var c=null;i!==null;)i.alternate!==null&&(c=i),i=i.sibling;c===null?a||t.tail===null?t.tail=null:t.tail.sibling=null:c.sibling=null}}function Vt(t){var a=t.alternate!==null&&t.alternate.child===t.child,i=0,c=0;if(a)for(var m=t.child;m!==null;)i|=m.lanes|m.childLanes,c|=m.subtreeFlags&65011712,c|=m.flags&65011712,m.return=t,m=m.sibling;else for(m=t.child;m!==null;)i|=m.lanes|m.childLanes,c|=m.subtreeFlags,c|=m.flags,m.return=t,m=m.sibling;return t.subtreeFlags|=c,t.childLanes=i,a}function nE(t,a,i){var c=a.pendingProps;switch(cf(a),a.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Vt(a),null;case 1:return Vt(a),null;case 3:return i=a.stateNode,c=null,t!==null&&(c=t.memoizedState.cache),a.memoizedState.cache!==c&&(a.flags|=2048),ca(un),Re(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(t===null||t.child===null)&&(Ql(a)?pa(a):t===null||t.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,df())),Vt(a),null;case 26:var m=a.type,b=a.memoizedState;return t===null?(pa(a),b!==null?(Vt(a),Rx(a,b)):(Vt(a),nd(a,m,null,c,i))):b?b!==t.memoizedState?(pa(a),Vt(a),Rx(a,b)):(Vt(a),a.flags&=-16777217):(t=t.memoizedProps,t!==c&&pa(a),Vt(a),nd(a,m,t,c,i)),null;case 27:if(pt(a),i=he.current,m=a.type,t!==null&&a.stateNode!=null)t.memoizedProps!==c&&pa(a);else{if(!c){if(a.stateNode===null)throw Error(l(166));return Vt(a),null}t=oe.current,Ql(a)?cg(a):(t=Bb(m,c,i),a.stateNode=t,pa(a))}return Vt(a),null;case 5:if(pt(a),m=a.type,t!==null&&a.stateNode!=null)t.memoizedProps!==c&&pa(a);else{if(!c){if(a.stateNode===null)throw Error(l(166));return Vt(a),null}if(b=oe.current,Ql(a))cg(a);else{var S=yu(he.current);switch(b){case 1:b=S.createElementNS("http://www.w3.org/2000/svg",m);break;case 2:b=S.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;default:switch(m){case"svg":b=S.createElementNS("http://www.w3.org/2000/svg",m);break;case"math":b=S.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;case"script":b=S.createElement("div"),b.innerHTML="<script><\/script>",b=b.removeChild(b.firstChild);break;case"select":b=typeof c.is=="string"?S.createElement("select",{is:c.is}):S.createElement("select"),c.multiple?b.multiple=!0:c.size&&(b.size=c.size);break;default:b=typeof c.is=="string"?S.createElement(m,{is:c.is}):S.createElement(m)}}b[Ot]=a,b[Nt]=c;e:for(S=a.child;S!==null;){if(S.tag===5||S.tag===6)b.appendChild(S.stateNode);else if(S.tag!==4&&S.tag!==27&&S.child!==null){S.child.return=S,S=S.child;continue}if(S===a)break e;for(;S.sibling===null;){if(S.return===null||S.return===a)break e;S=S.return}S.sibling.return=S.return,S=S.sibling}a.stateNode=b;e:switch(An(b,m,c),m){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}c&&pa(a)}}return Vt(a),nd(a,a.type,t===null?null:t.memoizedProps,a.pendingProps,i),null;case 6:if(t&&a.stateNode!=null)t.memoizedProps!==c&&pa(a);else{if(typeof c!="string"&&a.stateNode===null)throw Error(l(166));if(t=he.current,Ql(a)){if(t=a.stateNode,i=a.memoizedProps,c=null,m=Nn,m!==null)switch(m.tag){case 27:case 5:c=m.memoizedProps}t[Ot]=a,t=!!(t.nodeValue===i||c!==null&&c.suppressHydrationWarning===!0||Tb(t.nodeValue,i)),t||Da(a,!0)}else t=yu(t).createTextNode(c),t[Ot]=a,a.stateNode=t}return Vt(a),null;case 31:if(i=a.memoizedState,t===null||t.memoizedState!==null){if(c=Ql(a),i!==null){if(t===null){if(!c)throw Error(l(318));if(t=a.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(l(557));t[Ot]=a}else ml(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;Vt(a),t=!1}else i=df(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=i),t=!0;if(!t)return a.flags&256?(or(a),a):(or(a),null);if((a.flags&128)!==0)throw Error(l(558))}return Vt(a),null;case 13:if(c=a.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(m=Ql(a),c!==null&&c.dehydrated!==null){if(t===null){if(!m)throw Error(l(318));if(m=a.memoizedState,m=m!==null?m.dehydrated:null,!m)throw Error(l(317));m[Ot]=a}else ml(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;Vt(a),m=!1}else m=df(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=m),m=!0;if(!m)return a.flags&256?(or(a),a):(or(a),null)}return or(a),(a.flags&128)!==0?(a.lanes=i,a):(i=c!==null,t=t!==null&&t.memoizedState!==null,i&&(c=a.child,m=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(m=c.alternate.memoizedState.cachePool.pool),b=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(b=c.memoizedState.cachePool.pool),b!==m&&(c.flags|=2048)),i!==t&&i&&(a.child.flags|=8192),au(a,a.updateQueue),Vt(a),null);case 4:return Re(),t===null&&Ed(a.stateNode.containerInfo),Vt(a),null;case 10:return ca(a.type),Vt(a),null;case 19:if(I(an),c=a.memoizedState,c===null)return Vt(a),null;if(m=(a.flags&128)!==0,b=c.rendering,b===null)if(m)ds(c,!1);else{if(nn!==0||t!==null&&(t.flags&128)!==0)for(t=a.child;t!==null;){if(b=qo(t),b!==null){for(a.flags|=128,ds(c,!1),t=b.updateQueue,a.updateQueue=t,au(a,t),a.subtreeFlags=0,t=i,i=a.child;i!==null;)lg(i,t),i=i.sibling;return A(an,an.current&1|2),ft&&oa(a,c.treeForkCount),a.child}t=t.sibling}c.tail!==null&&kt()>uu&&(a.flags|=128,m=!0,ds(c,!1),a.lanes=4194304)}else{if(!m)if(t=qo(b),t!==null){if(a.flags|=128,m=!0,t=t.updateQueue,a.updateQueue=t,au(a,t),ds(c,!0),c.tail===null&&c.tailMode==="hidden"&&!b.alternate&&!ft)return Vt(a),null}else 2*kt()-c.renderingStartTime>uu&&i!==536870912&&(a.flags|=128,m=!0,ds(c,!1),a.lanes=4194304);c.isBackwards?(b.sibling=a.child,a.child=b):(t=c.last,t!==null?t.sibling=b:a.child=b,c.last=b)}return c.tail!==null?(t=c.tail,c.rendering=t,c.tail=t.sibling,c.renderingStartTime=kt(),t.sibling=null,i=an.current,A(an,m?i&1|2:i&1),ft&&oa(a,c.treeForkCount),t):(Vt(a),null);case 22:case 23:return or(a),Nf(),c=a.memoizedState!==null,t!==null?t.memoizedState!==null!==c&&(a.flags|=8192):c&&(a.flags|=8192),c?(i&536870912)!==0&&(a.flags&128)===0&&(Vt(a),a.subtreeFlags&6&&(a.flags|=8192)):Vt(a),i=a.updateQueue,i!==null&&au(a,i.retryQueue),i=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),c=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(c=a.memoizedState.cachePool.pool),c!==i&&(a.flags|=2048),t!==null&&I(bl),null;case 24:return i=null,t!==null&&(i=t.memoizedState.cache),a.memoizedState.cache!==i&&(a.flags|=2048),ca(un),Vt(a),null;case 25:return null;case 30:return null}throw Error(l(156,a.tag))}function rE(t,a){switch(cf(a),a.tag){case 1:return t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 3:return ca(un),Re(),t=a.flags,(t&65536)!==0&&(t&128)===0?(a.flags=t&-65537|128,a):null;case 26:case 27:case 5:return pt(a),null;case 31:if(a.memoizedState!==null){if(or(a),a.alternate===null)throw Error(l(340));ml()}return t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 13:if(or(a),t=a.memoizedState,t!==null&&t.dehydrated!==null){if(a.alternate===null)throw Error(l(340));ml()}return t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 19:return I(an),null;case 4:return Re(),null;case 10:return ca(a.type),null;case 22:case 23:return or(a),Nf(),t!==null&&I(bl),t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 24:return ca(un),null;case 25:return null;default:return null}}function Mx(t,a){switch(cf(a),a.tag){case 3:ca(un),Re();break;case 26:case 27:case 5:pt(a);break;case 4:Re();break;case 31:a.memoizedState!==null&&or(a);break;case 13:or(a);break;case 19:I(an);break;case 10:ca(a.type);break;case 22:case 23:or(a),Nf(),t!==null&&I(bl);break;case 24:ca(un)}}function hs(t,a){try{var i=a.updateQueue,c=i!==null?i.lastEffect:null;if(c!==null){var m=c.next;i=m;do{if((i.tag&t)===t){c=void 0;var b=i.create,S=i.inst;c=b(),S.destroy=c}i=i.next}while(i!==m)}}catch(C){jt(a,a.return,C)}}function Ha(t,a,i){try{var c=a.updateQueue,m=c!==null?c.lastEffect:null;if(m!==null){var b=m.next;c=b;do{if((c.tag&t)===t){var S=c.inst,C=S.destroy;if(C!==void 0){S.destroy=void 0,m=a;var U=i,W=C;try{W()}catch(ue){jt(m,U,ue)}}}c=c.next}while(c!==b)}}catch(ue){jt(a,a.return,ue)}}function Ox(t){var a=t.updateQueue;if(a!==null){var i=t.stateNode;try{Sg(a,i)}catch(c){jt(t,t.return,c)}}}function Dx(t,a,i){i.props=Sl(t.type,t.memoizedProps),i.state=t.memoizedState;try{i.componentWillUnmount()}catch(c){jt(t,a,c)}}function ps(t,a){try{var i=t.ref;if(i!==null){switch(t.tag){case 26:case 27:case 5:var c=t.stateNode;break;case 30:c=t.stateNode;break;default:c=t.stateNode}typeof i=="function"?t.refCleanup=i(c):i.current=c}}catch(m){jt(t,a,m)}}function Xr(t,a){var i=t.ref,c=t.refCleanup;if(i!==null)if(typeof c=="function")try{c()}catch(m){jt(t,a,m)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(m){jt(t,a,m)}else i.current=null}function zx(t){var a=t.type,i=t.memoizedProps,c=t.stateNode;try{e:switch(a){case"button":case"input":case"select":case"textarea":i.autoFocus&&c.focus();break e;case"img":i.src?c.src=i.src:i.srcSet&&(c.srcset=i.srcSet)}}catch(m){jt(t,t.return,m)}}function rd(t,a,i){try{var c=t.stateNode;NE(c,t.type,i,a),c[Nt]=a}catch(m){jt(t,t.return,m)}}function Lx(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Xa(t.type)||t.tag===4}function ad(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Lx(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&&Xa(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 ld(t,a,i){var c=t.tag;if(c===5||c===6)t=t.stateNode,a?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(t,a):(a=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,a.appendChild(t),i=i._reactRootContainer,i!=null||a.onclick!==null||(a.onclick=Se));else if(c!==4&&(c===27&&Xa(t.type)&&(i=t.stateNode,a=null),t=t.child,t!==null))for(ld(t,a,i),t=t.sibling;t!==null;)ld(t,a,i),t=t.sibling}function lu(t,a,i){var c=t.tag;if(c===5||c===6)t=t.stateNode,a?i.insertBefore(t,a):i.appendChild(t);else if(c!==4&&(c===27&&Xa(t.type)&&(i=t.stateNode),t=t.child,t!==null))for(lu(t,a,i),t=t.sibling;t!==null;)lu(t,a,i),t=t.sibling}function Ix(t){var a=t.stateNode,i=t.memoizedProps;try{for(var c=t.type,m=a.attributes;m.length;)a.removeAttributeNode(m[0]);An(a,c,i),a[Ot]=t,a[Nt]=i}catch(b){jt(t,t.return,b)}}var ma=!1,dn=!1,id=!1,Bx=typeof WeakSet=="function"?WeakSet:Set,kn=null;function aE(t,a){if(t=t.containerInfo,Td=_u,t=Zm(t),Wc(t)){if("selectionStart"in t)var i={start:t.selectionStart,end:t.selectionEnd};else e:{i=(i=t.ownerDocument)&&i.defaultView||window;var c=i.getSelection&&i.getSelection();if(c&&c.rangeCount!==0){i=c.anchorNode;var m=c.anchorOffset,b=c.focusNode;c=c.focusOffset;try{i.nodeType,b.nodeType}catch{i=null;break e}var S=0,C=-1,U=-1,W=0,ue=0,de=t,ee=null;t:for(;;){for(var ie;de!==i||m!==0&&de.nodeType!==3||(C=S+m),de!==b||c!==0&&de.nodeType!==3||(U=S+c),de.nodeType===3&&(S+=de.nodeValue.length),(ie=de.firstChild)!==null;)ee=de,de=ie;for(;;){if(de===t)break t;if(ee===i&&++W===m&&(C=S),ee===b&&++ue===c&&(U=S),(ie=de.nextSibling)!==null)break;de=ee,ee=de.parentNode}de=ie}i=C===-1||U===-1?null:{start:C,end:U}}else i=null}i=i||{start:0,end:0}}else i=null;for(Ad={focusedElem:t,selectionRange:i},_u=!1,kn=a;kn!==null;)if(a=kn,t=a.child,(a.subtreeFlags&1028)!==0&&t!==null)t.return=a,kn=t;else for(;kn!==null;){switch(a=kn,b=a.alternate,t=a.flags,a.tag){case 0:if((t&4)!==0&&(t=a.updateQueue,t=t!==null?t.events:null,t!==null))for(i=0;i<t.length;i++)m=t[i],m.ref.impl=m.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&b!==null){t=void 0,i=a,m=b.memoizedProps,b=b.memoizedState,c=i.stateNode;try{var je=Sl(i.type,m);t=c.getSnapshotBeforeUpdate(je,b),c.__reactInternalSnapshotBeforeUpdate=t}catch(Pe){jt(i,i.return,Pe)}}break;case 3:if((t&1024)!==0){if(t=a.stateNode.containerInfo,i=t.nodeType,i===9)Rd(t);else if(i===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Rd(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=a.sibling,t!==null){t.return=a.return,kn=t;break}kn=a.return}}function $x(t,a,i){var c=i.flags;switch(i.tag){case 0:case 11:case 15:xa(t,i),c&4&&hs(5,i);break;case 1:if(xa(t,i),c&4)if(t=i.stateNode,a===null)try{t.componentDidMount()}catch(S){jt(i,i.return,S)}else{var m=Sl(i.type,a.memoizedProps);a=a.memoizedState;try{t.componentDidUpdate(m,a,t.__reactInternalSnapshotBeforeUpdate)}catch(S){jt(i,i.return,S)}}c&64&&Ox(i),c&512&&ps(i,i.return);break;case 3:if(xa(t,i),c&64&&(t=i.updateQueue,t!==null)){if(a=null,i.child!==null)switch(i.child.tag){case 27:case 5:a=i.child.stateNode;break;case 1:a=i.child.stateNode}try{Sg(t,a)}catch(S){jt(i,i.return,S)}}break;case 27:a===null&&c&4&&Ix(i);case 26:case 5:xa(t,i),a===null&&c&4&&zx(i),c&512&&ps(i,i.return);break;case 12:xa(t,i);break;case 31:xa(t,i),c&4&&Px(t,i);break;case 13:xa(t,i),c&4&&Fx(t,i),c&64&&(t=i.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(i=hE.bind(null,i),OE(t,i))));break;case 22:if(c=i.memoizedState!==null||ma,!c){a=a!==null&&a.memoizedState!==null||dn,m=ma;var b=dn;ma=c,(dn=a)&&!b?ba(t,i,(i.subtreeFlags&8772)!==0):xa(t,i),ma=m,dn=b}break;case 30:break;default:xa(t,i)}}function Ux(t){var a=t.alternate;a!==null&&(t.alternate=null,Ux(a)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(a=t.stateNode,a!==null&&P(a)),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,Vn=!1;function ga(t,a,i){for(i=i.child;i!==null;)Hx(t,a,i),i=i.sibling}function Hx(t,a,i){if(nt&&typeof nt.onCommitFiberUnmount=="function")try{nt.onCommitFiberUnmount(Pt,i)}catch{}switch(i.tag){case 26:dn||Xr(i,a),ga(t,a,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:dn||Xr(i,a);var c=Kt,m=Vn;Xa(i.type)&&(Kt=i.stateNode,Vn=!1),ga(t,a,i),Ss(i.stateNode),Kt=c,Vn=m;break;case 5:dn||Xr(i,a);case 6:if(c=Kt,m=Vn,Kt=null,ga(t,a,i),Kt=c,Vn=m,Kt!==null)if(Vn)try{(Kt.nodeType===9?Kt.body:Kt.nodeName==="HTML"?Kt.ownerDocument.body:Kt).removeChild(i.stateNode)}catch(b){jt(i,a,b)}else try{Kt.removeChild(i.stateNode)}catch(b){jt(i,a,b)}break;case 18:Kt!==null&&(Vn?(t=Kt,Ob(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,i.stateNode),bi(t)):Ob(Kt,i.stateNode));break;case 4:c=Kt,m=Vn,Kt=i.stateNode.containerInfo,Vn=!0,ga(t,a,i),Kt=c,Vn=m;break;case 0:case 11:case 14:case 15:Ha(2,i,a),dn||Ha(4,i,a),ga(t,a,i);break;case 1:dn||(Xr(i,a),c=i.stateNode,typeof c.componentWillUnmount=="function"&&Dx(i,a,c)),ga(t,a,i);break;case 21:ga(t,a,i);break;case 22:dn=(c=dn)||i.memoizedState!==null,ga(t,a,i),dn=c;break;default:ga(t,a,i)}}function Px(t,a){if(a.memoizedState===null&&(t=a.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{bi(t)}catch(i){jt(a,a.return,i)}}}function Fx(t,a){if(a.memoizedState===null&&(t=a.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{bi(t)}catch(i){jt(a,a.return,i)}}function lE(t){switch(t.tag){case 31:case 13:case 19:var a=t.stateNode;return a===null&&(a=t.stateNode=new Bx),a;case 22:return t=t.stateNode,a=t._retryCache,a===null&&(a=t._retryCache=new Bx),a;default:throw Error(l(435,t.tag))}}function iu(t,a){var i=lE(t);a.forEach(function(c){if(!i.has(c)){i.add(c);var m=pE.bind(null,t,c);c.then(m,m)}})}function Xn(t,a){var i=a.deletions;if(i!==null)for(var c=0;c<i.length;c++){var m=i[c],b=t,S=a,C=S;e:for(;C!==null;){switch(C.tag){case 27:if(Xa(C.type)){Kt=C.stateNode,Vn=!1;break e}break;case 5:Kt=C.stateNode,Vn=!1;break e;case 3:case 4:Kt=C.stateNode.containerInfo,Vn=!0;break e}C=C.return}if(Kt===null)throw Error(l(160));Hx(b,S,m),Kt=null,Vn=!1,b=m.alternate,b!==null&&(b.return=null),m.return=null}if(a.subtreeFlags&13886)for(a=a.child;a!==null;)Gx(a,t),a=a.sibling}var Dr=null;function Gx(t,a){var i=t.alternate,c=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Xn(a,t),Kn(t),c&4&&(Ha(3,t,t.return),hs(3,t),Ha(5,t,t.return));break;case 1:Xn(a,t),Kn(t),c&512&&(dn||i===null||Xr(i,i.return)),c&64&&ma&&(t=t.updateQueue,t!==null&&(c=t.callbacks,c!==null&&(i=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=i===null?c:i.concat(c))));break;case 26:var m=Dr;if(Xn(a,t),Kn(t),c&512&&(dn||i===null||Xr(i,i.return)),c&4){var b=i!==null?i.memoizedState:null;if(c=t.memoizedState,i===null)if(c===null)if(t.stateNode===null){e:{c=t.type,i=t.memoizedProps,m=m.ownerDocument||m;t:switch(c){case"title":b=m.getElementsByTagName("title")[0],(!b||b[Ce]||b[Ot]||b.namespaceURI==="http://www.w3.org/2000/svg"||b.hasAttribute("itemprop"))&&(b=m.createElement(c),m.head.insertBefore(b,m.querySelector("head > title"))),An(b,c,i),b[Ot]=t,Ve(b),c=b;break e;case"link":var S=Gb("link","href",m).get(c+(i.href||""));if(S){for(var C=0;C<S.length;C++)if(b=S[C],b.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&b.getAttribute("rel")===(i.rel==null?null:i.rel)&&b.getAttribute("title")===(i.title==null?null:i.title)&&b.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){S.splice(C,1);break t}}b=m.createElement(c),An(b,c,i),m.head.appendChild(b);break;case"meta":if(S=Gb("meta","content",m).get(c+(i.content||""))){for(C=0;C<S.length;C++)if(b=S[C],b.getAttribute("content")===(i.content==null?null:""+i.content)&&b.getAttribute("name")===(i.name==null?null:i.name)&&b.getAttribute("property")===(i.property==null?null:i.property)&&b.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&b.getAttribute("charset")===(i.charSet==null?null:i.charSet)){S.splice(C,1);break t}}b=m.createElement(c),An(b,c,i),m.head.appendChild(b);break;default:throw Error(l(468,c))}b[Ot]=t,Ve(b),c=b}t.stateNode=c}else qb(m,t.type,t.stateNode);else t.stateNode=Fb(m,c,t.memoizedProps);else b!==c?(b===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):b.count--,c===null?qb(m,t.type,t.stateNode):Fb(m,c,t.memoizedProps)):c===null&&t.stateNode!==null&&rd(t,t.memoizedProps,i.memoizedProps)}break;case 27:Xn(a,t),Kn(t),c&512&&(dn||i===null||Xr(i,i.return)),i!==null&&c&4&&rd(t,t.memoizedProps,i.memoizedProps);break;case 5:if(Xn(a,t),Kn(t),c&512&&(dn||i===null||Xr(i,i.return)),t.flags&32){m=t.stateNode;try{Fe(m,"")}catch(je){jt(t,t.return,je)}}c&4&&t.stateNode!=null&&(m=t.memoizedProps,rd(t,m,i!==null?i.memoizedProps:m)),c&1024&&(id=!0);break;case 6:if(Xn(a,t),Kn(t),c&4){if(t.stateNode===null)throw Error(l(162));c=t.memoizedProps,i=t.stateNode;try{i.nodeValue=c}catch(je){jt(t,t.return,je)}}break;case 3:if(wu=null,m=Dr,Dr=vu(a.containerInfo),Xn(a,t),Dr=m,Kn(t),c&4&&i!==null&&i.memoizedState.isDehydrated)try{bi(a.containerInfo)}catch(je){jt(t,t.return,je)}id&&(id=!1,qx(t));break;case 4:c=Dr,Dr=vu(t.stateNode.containerInfo),Xn(a,t),Kn(t),Dr=c;break;case 12:Xn(a,t),Kn(t);break;case 31:Xn(a,t),Kn(t),c&4&&(c=t.updateQueue,c!==null&&(t.updateQueue=null,iu(t,c)));break;case 13:Xn(a,t),Kn(t),t.child.flags&8192&&t.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(ou=kt()),c&4&&(c=t.updateQueue,c!==null&&(t.updateQueue=null,iu(t,c)));break;case 22:m=t.memoizedState!==null;var U=i!==null&&i.memoizedState!==null,W=ma,ue=dn;if(ma=W||m,dn=ue||U,Xn(a,t),dn=ue,ma=W,Kn(t),c&8192)e:for(a=t.stateNode,a._visibility=m?a._visibility&-2:a._visibility|1,m&&(i===null||U||ma||dn||El(t)),i=null,a=t;;){if(a.tag===5||a.tag===26){if(i===null){U=i=a;try{if(b=U.stateNode,m)S=b.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none";else{C=U.stateNode;var de=U.memoizedProps.style,ee=de!=null&&de.hasOwnProperty("display")?de.display:null;C.style.display=ee==null||typeof ee=="boolean"?"":(""+ee).trim()}}catch(je){jt(U,U.return,je)}}}else if(a.tag===6){if(i===null){U=a;try{U.stateNode.nodeValue=m?"":U.memoizedProps}catch(je){jt(U,U.return,je)}}}else if(a.tag===18){if(i===null){U=a;try{var ie=U.stateNode;m?Db(ie,!0):Db(U.stateNode,!1)}catch(je){jt(U,U.return,je)}}}else if((a.tag!==22&&a.tag!==23||a.memoizedState===null||a===t)&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===t)break e;for(;a.sibling===null;){if(a.return===null||a.return===t)break e;i===a&&(i=null),a=a.return}i===a&&(i=null),a.sibling.return=a.return,a=a.sibling}c&4&&(c=t.updateQueue,c!==null&&(i=c.retryQueue,i!==null&&(c.retryQueue=null,iu(t,i))));break;case 19:Xn(a,t),Kn(t),c&4&&(c=t.updateQueue,c!==null&&(t.updateQueue=null,iu(t,c)));break;case 30:break;case 21:break;default:Xn(a,t),Kn(t)}}function Kn(t){var a=t.flags;if(a&2){try{for(var i,c=t.return;c!==null;){if(Lx(c)){i=c;break}c=c.return}if(i==null)throw Error(l(160));switch(i.tag){case 27:var m=i.stateNode,b=ad(t);lu(t,b,m);break;case 5:var S=i.stateNode;i.flags&32&&(Fe(S,""),i.flags&=-33);var C=ad(t);lu(t,C,S);break;case 3:case 4:var U=i.stateNode.containerInfo,W=ad(t);ld(t,W,U);break;default:throw Error(l(161))}}catch(ue){jt(t,t.return,ue)}t.flags&=-3}a&4096&&(t.flags&=-4097)}function qx(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var a=t;qx(a),a.tag===5&&a.flags&1024&&a.stateNode.reset(),t=t.sibling}}function xa(t,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)$x(t,a.alternate,a),a=a.sibling}function El(t){for(t=t.child;t!==null;){var a=t;switch(a.tag){case 0:case 11:case 14:case 15:Ha(4,a,a.return),El(a);break;case 1:Xr(a,a.return);var i=a.stateNode;typeof i.componentWillUnmount=="function"&&Dx(a,a.return,i),El(a);break;case 27:Ss(a.stateNode);case 26:case 5:Xr(a,a.return),El(a);break;case 22:a.memoizedState===null&&El(a);break;case 30:El(a);break;default:El(a)}t=t.sibling}}function ba(t,a,i){for(i=i&&(a.subtreeFlags&8772)!==0,a=a.child;a!==null;){var c=a.alternate,m=t,b=a,S=b.flags;switch(b.tag){case 0:case 11:case 15:ba(m,b,i),hs(4,b);break;case 1:if(ba(m,b,i),c=b,m=c.stateNode,typeof m.componentDidMount=="function")try{m.componentDidMount()}catch(W){jt(c,c.return,W)}if(c=b,m=c.updateQueue,m!==null){var C=c.stateNode;try{var U=m.shared.hiddenCallbacks;if(U!==null)for(m.shared.hiddenCallbacks=null,m=0;m<U.length;m++)wg(U[m],C)}catch(W){jt(c,c.return,W)}}i&&S&64&&Ox(b),ps(b,b.return);break;case 27:Ix(b);case 26:case 5:ba(m,b,i),i&&c===null&&S&4&&zx(b),ps(b,b.return);break;case 12:ba(m,b,i);break;case 31:ba(m,b,i),i&&S&4&&Px(m,b);break;case 13:ba(m,b,i),i&&S&4&&Fx(m,b);break;case 22:b.memoizedState===null&&ba(m,b,i),ps(b,b.return);break;case 30:break;default:ba(m,b,i)}a=a.sibling}}function sd(t,a){var i=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),t=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(t=a.memoizedState.cachePool.pool),t!==i&&(t!=null&&t.refCount++,i!=null&&es(i))}function od(t,a){t=null,a.alternate!==null&&(t=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==t&&(a.refCount++,t!=null&&es(t))}function zr(t,a,i,c){if(a.subtreeFlags&10256)for(a=a.child;a!==null;)Yx(t,a,i,c),a=a.sibling}function Yx(t,a,i,c){var m=a.flags;switch(a.tag){case 0:case 11:case 15:zr(t,a,i,c),m&2048&&hs(9,a);break;case 1:zr(t,a,i,c);break;case 3:zr(t,a,i,c),m&2048&&(t=null,a.alternate!==null&&(t=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==t&&(a.refCount++,t!=null&&es(t)));break;case 12:if(m&2048){zr(t,a,i,c),t=a.stateNode;try{var b=a.memoizedProps,S=b.id,C=b.onPostCommit;typeof C=="function"&&C(S,a.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(U){jt(a,a.return,U)}}else zr(t,a,i,c);break;case 31:zr(t,a,i,c);break;case 13:zr(t,a,i,c);break;case 23:break;case 22:b=a.stateNode,S=a.alternate,a.memoizedState!==null?b._visibility&2?zr(t,a,i,c):ms(t,a):b._visibility&2?zr(t,a,i,c):(b._visibility|=2,si(t,a,i,c,(a.subtreeFlags&10256)!==0||!1)),m&2048&&sd(S,a);break;case 24:zr(t,a,i,c),m&2048&&od(a.alternate,a);break;default:zr(t,a,i,c)}}function si(t,a,i,c,m){for(m=m&&((a.subtreeFlags&10256)!==0||!1),a=a.child;a!==null;){var b=t,S=a,C=i,U=c,W=S.flags;switch(S.tag){case 0:case 11:case 15:si(b,S,C,U,m),hs(8,S);break;case 23:break;case 22:var ue=S.stateNode;S.memoizedState!==null?ue._visibility&2?si(b,S,C,U,m):ms(b,S):(ue._visibility|=2,si(b,S,C,U,m)),m&&W&2048&&sd(S.alternate,S);break;case 24:si(b,S,C,U,m),m&&W&2048&&od(S.alternate,S);break;default:si(b,S,C,U,m)}a=a.sibling}}function ms(t,a){if(a.subtreeFlags&10256)for(a=a.child;a!==null;){var i=t,c=a,m=c.flags;switch(c.tag){case 22:ms(i,c),m&2048&&sd(c.alternate,c);break;case 24:ms(i,c),m&2048&&od(c.alternate,c);break;default:ms(i,c)}a=a.sibling}}var gs=8192;function oi(t,a,i){if(t.subtreeFlags&gs)for(t=t.child;t!==null;)Vx(t,a,i),t=t.sibling}function Vx(t,a,i){switch(t.tag){case 26:oi(t,a,i),t.flags&gs&&t.memoizedState!==null&&qE(i,Dr,t.memoizedState,t.memoizedProps);break;case 5:oi(t,a,i);break;case 3:case 4:var c=Dr;Dr=vu(t.stateNode.containerInfo),oi(t,a,i),Dr=c;break;case 22:t.memoizedState===null&&(c=t.alternate,c!==null&&c.memoizedState!==null?(c=gs,gs=16777216,oi(t,a,i),gs=c):oi(t,a,i));break;default:oi(t,a,i)}}function Xx(t){var a=t.alternate;if(a!==null&&(t=a.child,t!==null)){a.child=null;do a=t.sibling,t.sibling=null,t=a;while(t!==null)}}function xs(t){var a=t.deletions;if((t.flags&16)!==0){if(a!==null)for(var i=0;i<a.length;i++){var c=a[i];kn=c,Zx(c,t)}Xx(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Kx(t),t=t.sibling}function Kx(t){switch(t.tag){case 0:case 11:case 15:xs(t),t.flags&2048&&Ha(9,t,t.return);break;case 3:xs(t);break;case 12:xs(t);break;case 22:var a=t.stateNode;t.memoizedState!==null&&a._visibility&2&&(t.return===null||t.return.tag!==13)?(a._visibility&=-3,su(t)):xs(t);break;default:xs(t)}}function su(t){var a=t.deletions;if((t.flags&16)!==0){if(a!==null)for(var i=0;i<a.length;i++){var c=a[i];kn=c,Zx(c,t)}Xx(t)}for(t=t.child;t!==null;){switch(a=t,a.tag){case 0:case 11:case 15:Ha(8,a,a.return),su(a);break;case 22:i=a.stateNode,i._visibility&2&&(i._visibility&=-3,su(a));break;default:su(a)}t=t.sibling}}function Zx(t,a){for(;kn!==null;){var i=kn;switch(i.tag){case 0:case 11:case 15:Ha(8,i,a);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var c=i.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:es(i.memoizedState.cache)}if(c=i.child,c!==null)c.return=i,kn=c;else e:for(i=t;kn!==null;){c=kn;var m=c.sibling,b=c.return;if(Ux(c),c===i){kn=null;break e}if(m!==null){m.return=b,kn=m;break e}kn=b}}}var iE={getCacheForType:function(t){var a=_n(un),i=a.data.get(t);return i===void 0&&(i=t(),a.data.set(t,i)),i},cacheSignal:function(){return _n(un).controller.signal}},sE=typeof WeakMap=="function"?WeakMap:Map,wt=0,$t=null,at=null,ot=0,Ct=0,ur=null,Pa=!1,ui=!1,ud=!1,ya=0,nn=0,Fa=0,Nl=0,cd=0,cr=0,ci=0,bs=null,Zn=null,fd=!1,ou=0,Qx=0,uu=1/0,cu=null,Ga=null,xn=0,qa=null,fi=null,va=0,dd=0,hd=null,Wx=null,ys=0,pd=null;function fr(){return(wt&2)!==0&&ot!==0?ot&-ot:z.T!==null?vd():gr()}function Jx(){if(cr===0)if((ot&536870912)===0||ft){var t=sn;sn<<=1,(sn&3932160)===0&&(sn=262144),cr=t}else cr=536870912;return t=sr.current,t!==null&&(t.flags|=32),cr}function Qn(t,a,i){(t===$t&&(Ct===2||Ct===9)||t.cancelPendingCommit!==null)&&(di(t,0),Ya(t,ot,cr,!1)),Ze(t,i),((wt&2)===0||t!==$t)&&(t===$t&&((wt&2)===0&&(Nl|=i),nn===4&&Ya(t,ot,cr,!1)),Kr(t))}function eb(t,a,i){if((wt&6)!==0)throw Error(l(327));var c=!i&&(a&127)===0&&(a&t.expiredLanes)===0||ce(t,a),m=c?cE(t,a):gd(t,a,!0),b=c;do{if(m===0){ui&&!c&&Ya(t,a,0,!1);break}else{if(i=t.current.alternate,b&&!oE(i)){m=gd(t,a,!1),b=!1;continue}if(m===2){if(b=a,t.errorRecoveryDisabledLanes&b)var S=0;else S=t.pendingLanes&-536870913,S=S!==0?S:S&536870912?536870912:0;if(S!==0){a=S;e:{var C=t;m=bs;var U=C.current.memoizedState.isDehydrated;if(U&&(di(C,S).flags|=256),S=gd(C,S,!1),S!==2){if(ud&&!U){C.errorRecoveryDisabledLanes|=b,Nl|=b,m=4;break e}b=Zn,Zn=m,b!==null&&(Zn===null?Zn=b:Zn.push.apply(Zn,b))}m=S}if(b=!1,m!==2)continue}}if(m===1){di(t,0),Ya(t,a,0,!0);break}e:{switch(c=t,b=m,b){case 0:case 1:throw Error(l(345));case 4:if((a&4194048)!==a)break;case 6:Ya(c,a,cr,!Pa);break e;case 2:Zn=null;break;case 3:case 5:break;default:throw Error(l(329))}if((a&62914560)===a&&(m=ou+300-kt(),10<m)){if(Ya(c,a,cr,!Pa),H(c,0,!0)!==0)break e;va=a,c.timeoutHandle=Rb(tb.bind(null,c,i,Zn,cu,fd,a,cr,Nl,ci,Pa,b,"Throttled",-0,0),m);break e}tb(c,i,Zn,cu,fd,a,cr,Nl,ci,Pa,b,null,-0,0)}}break}while(!0);Kr(t)}function tb(t,a,i,c,m,b,S,C,U,W,ue,de,ee,ie){if(t.timeoutHandle=-1,de=a.subtreeFlags,de&8192||(de&16785408)===16785408){de={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Se},Vx(a,b,de);var je=(b&62914560)===b?ou-kt():(b&4194048)===b?Qx-kt():0;if(je=YE(de,je),je!==null){va=b,t.cancelPendingCommit=je(ub.bind(null,t,a,b,i,c,m,S,C,U,ue,de,null,ee,ie)),Ya(t,b,S,!W);return}}ub(t,a,b,i,c,m,S,C,U)}function oE(t){for(var a=t;;){var i=a.tag;if((i===0||i===11||i===15)&&a.flags&16384&&(i=a.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var c=0;c<i.length;c++){var m=i[c],b=m.getSnapshot;m=m.value;try{if(!lr(b(),m))return!1}catch{return!1}}if(i=a.child,a.subtreeFlags&16384&&i!==null)i.return=a,a=i;else{if(a===t)break;for(;a.sibling===null;){if(a.return===null||a.return===t)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function Ya(t,a,i,c){a&=~cd,a&=~Nl,t.suspendedLanes|=a,t.pingedLanes&=~a,c&&(t.warmLanes|=a),c=t.expirationTimes;for(var m=a;0<m;){var b=31-Je(m),S=1<<b;c[b]=-1,m&=~S}i!==0&&Ne(t,i,a)}function fu(){return(wt&6)===0?(vs(0),!1):!0}function md(){if(at!==null){if(Ct===0)var t=at.return;else t=at,ua=gl=null,Rf(t),ni=null,ns=0,t=at;for(;t!==null;)Mx(t.alternate,t),t=t.return;at=null}}function di(t,a){var i=t.timeoutHandle;i!==-1&&(t.timeoutHandle=-1,AE(i)),i=t.cancelPendingCommit,i!==null&&(t.cancelPendingCommit=null,i()),va=0,md(),$t=t,at=i=sa(t.current,null),ot=a,Ct=0,ur=null,Pa=!1,ui=ce(t,a),ud=!1,ci=cr=cd=Nl=Fa=nn=0,Zn=bs=null,fd=!1,(a&8)!==0&&(a|=a&32);var c=t.entangledLanes;if(c!==0)for(t=t.entanglements,c&=a;0<c;){var m=31-Je(c),b=1<<m;a|=t[m],c&=~b}return ya=a,Mo(),i}function nb(t,a){Ke=null,z.H=cs,a===ti||a===Uo?(a=bg(),Ct=3):a===yf?(a=bg(),Ct=4):Ct=a===Vf?8:a!==null&&typeof a=="object"&&typeof a.then=="function"?6:1,ur=a,at===null&&(nn=1,eu(t,kr(a,t.current)))}function rb(){var t=sr.current;return t===null?!0:(ot&4194048)===ot?Nr===null:(ot&62914560)===ot||(ot&536870912)!==0?t===Nr:!1}function ab(){var t=z.H;return z.H=cs,t===null?cs:t}function lb(){var t=z.A;return z.A=iE,t}function du(){nn=4,Pa||(ot&4194048)!==ot&&sr.current!==null||(ui=!0),(Fa&134217727)===0&&(Nl&134217727)===0||$t===null||Ya($t,ot,cr,!1)}function gd(t,a,i){var c=wt;wt|=2;var m=ab(),b=lb();($t!==t||ot!==a)&&(cu=null,di(t,a)),a=!1;var S=nn;e:do try{if(Ct!==0&&at!==null){var C=at,U=ur;switch(Ct){case 8:md(),S=6;break e;case 3:case 2:case 9:case 6:sr.current===null&&(a=!0);var W=Ct;if(Ct=0,ur=null,hi(t,C,U,W),i&&ui){S=0;break e}break;default:W=Ct,Ct=0,ur=null,hi(t,C,U,W)}}uE(),S=nn;break}catch(ue){nb(t,ue)}while(!0);return a&&t.shellSuspendCounter++,ua=gl=null,wt=c,z.H=m,z.A=b,at===null&&($t=null,ot=0,Mo()),S}function uE(){for(;at!==null;)ib(at)}function cE(t,a){var i=wt;wt|=2;var c=ab(),m=lb();$t!==t||ot!==a?(cu=null,uu=kt()+500,di(t,a)):ui=ce(t,a);e:do try{if(Ct!==0&&at!==null){a=at;var b=ur;t:switch(Ct){case 1:Ct=0,ur=null,hi(t,a,b,1);break;case 2:case 9:if(gg(b)){Ct=0,ur=null,sb(a);break}a=function(){Ct!==2&&Ct!==9||$t!==t||(Ct=7),Kr(t)},b.then(a,a);break e;case 3:Ct=7;break e;case 4:Ct=5;break e;case 7:gg(b)?(Ct=0,ur=null,sb(a)):(Ct=0,ur=null,hi(t,a,b,7));break;case 5:var S=null;switch(at.tag){case 26:S=at.memoizedState;case 5:case 27:var C=at;if(S?Yb(S):C.stateNode.complete){Ct=0,ur=null;var U=C.sibling;if(U!==null)at=U;else{var W=C.return;W!==null?(at=W,hu(W)):at=null}break t}}Ct=0,ur=null,hi(t,a,b,5);break;case 6:Ct=0,ur=null,hi(t,a,b,6);break;case 8:md(),nn=6;break e;default:throw Error(l(462))}}fE();break}catch(ue){nb(t,ue)}while(!0);return ua=gl=null,z.H=c,z.A=m,wt=i,at!==null?0:($t=null,ot=0,Mo(),nn)}function fE(){for(;at!==null&&!Pn();)ib(at)}function ib(t){var a=jx(t.alternate,t,ya);t.memoizedProps=t.pendingProps,a===null?hu(t):at=a}function sb(t){var a=t,i=a.alternate;switch(a.tag){case 15:case 0:a=Ex(i,a,a.pendingProps,a.type,void 0,ot);break;case 11:a=Ex(i,a,a.pendingProps,a.type.render,a.ref,ot);break;case 5:Rf(a);default:Mx(i,a),a=at=lg(a,ya),a=jx(i,a,ya)}t.memoizedProps=t.pendingProps,a===null?hu(t):at=a}function hi(t,a,i,c){ua=gl=null,Rf(a),ni=null,ns=0;var m=a.return;try{if(JS(t,m,a,i,ot)){nn=1,eu(t,kr(i,t.current)),at=null;return}}catch(b){if(m!==null)throw at=m,b;nn=1,eu(t,kr(i,t.current)),at=null;return}a.flags&32768?(ft||c===1?t=!0:ui||(ot&536870912)!==0?t=!1:(Pa=t=!0,(c===2||c===9||c===3||c===6)&&(c=sr.current,c!==null&&c.tag===13&&(c.flags|=16384))),ob(a,t)):hu(a)}function hu(t){var a=t;do{if((a.flags&32768)!==0){ob(a,Pa);return}t=a.return;var i=nE(a.alternate,a,ya);if(i!==null){at=i;return}if(a=a.sibling,a!==null){at=a;return}at=a=t}while(a!==null);nn===0&&(nn=5)}function ob(t,a){do{var i=rE(t.alternate,t);if(i!==null){i.flags&=32767,at=i;return}if(i=t.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!a&&(t=t.sibling,t!==null)){at=t;return}at=t=i}while(t!==null);nn=6,at=null}function ub(t,a,i,c,m,b,S,C,U){t.cancelPendingCommit=null;do pu();while(xn!==0);if((wt&6)!==0)throw Error(l(327));if(a!==null){if(a===t.current)throw Error(l(177));if(b=a.lanes|a.childLanes,b|=rf,Te(t,i,b,S,C,U),t===$t&&(at=$t=null,ot=0),fi=a,qa=t,va=i,dd=b,hd=m,Wx=c,(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,mE(re,function(){return pb(),null})):(t.callbackNode=null,t.callbackPriority=0),c=(a.flags&13878)!==0,(a.subtreeFlags&13878)!==0||c){c=z.T,z.T=null,m=V.p,V.p=2,S=wt,wt|=4;try{aE(t,a,i)}finally{wt=S,V.p=m,z.T=c}}xn=1,cb(),fb(),db()}}function cb(){if(xn===1){xn=0;var t=qa,a=fi,i=(a.flags&13878)!==0;if((a.subtreeFlags&13878)!==0||i){i=z.T,z.T=null;var c=V.p;V.p=2;var m=wt;wt|=4;try{Gx(a,t);var b=Ad,S=Zm(t.containerInfo),C=b.focusedElem,U=b.selectionRange;if(S!==C&&C&&C.ownerDocument&&Km(C.ownerDocument.documentElement,C)){if(U!==null&&Wc(C)){var W=U.start,ue=U.end;if(ue===void 0&&(ue=W),"selectionStart"in C)C.selectionStart=W,C.selectionEnd=Math.min(ue,C.value.length);else{var de=C.ownerDocument||document,ee=de&&de.defaultView||window;if(ee.getSelection){var ie=ee.getSelection(),je=C.textContent.length,Pe=Math.min(U.start,je),Lt=U.end===void 0?Pe:Math.min(U.end,je);!ie.extend&&Pe>Lt&&(S=Lt,Lt=Pe,Pe=S);var K=Xm(C,Pe),q=Xm(C,Lt);if(K&&q&&(ie.rangeCount!==1||ie.anchorNode!==K.node||ie.anchorOffset!==K.offset||ie.focusNode!==q.node||ie.focusOffset!==q.offset)){var Q=de.createRange();Q.setStart(K.node,K.offset),ie.removeAllRanges(),Pe>Lt?(ie.addRange(Q),ie.extend(q.node,q.offset)):(Q.setEnd(q.node,q.offset),ie.addRange(Q))}}}}for(de=[],ie=C;ie=ie.parentNode;)ie.nodeType===1&&de.push({element:ie,left:ie.scrollLeft,top:ie.scrollTop});for(typeof C.focus=="function"&&C.focus(),C=0;C<de.length;C++){var fe=de[C];fe.element.scrollLeft=fe.left,fe.element.scrollTop=fe.top}}_u=!!Td,Ad=Td=null}finally{wt=m,V.p=c,z.T=i}}t.current=a,xn=2}}function fb(){if(xn===2){xn=0;var t=qa,a=fi,i=(a.flags&8772)!==0;if((a.subtreeFlags&8772)!==0||i){i=z.T,z.T=null;var c=V.p;V.p=2;var m=wt;wt|=4;try{$x(t,a.alternate,a)}finally{wt=m,V.p=c,z.T=i}}xn=3}}function db(){if(xn===4||xn===3){xn=0,zn();var t=qa,a=fi,i=va,c=Wx;(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?xn=5:(xn=0,fi=qa=null,hb(t,t.pendingLanes));var m=t.pendingLanes;if(m===0&&(Ga=null),mn(i),a=a.stateNode,nt&&typeof nt.onCommitFiberRoot=="function")try{nt.onCommitFiberRoot(Pt,a,void 0,(a.current.flags&128)===128)}catch{}if(c!==null){a=z.T,m=V.p,V.p=2,z.T=null;try{for(var b=t.onRecoverableError,S=0;S<c.length;S++){var C=c[S];b(C.value,{componentStack:C.stack})}}finally{z.T=a,V.p=m}}(va&3)!==0&&pu(),Kr(t),m=t.pendingLanes,(i&261930)!==0&&(m&42)!==0?t===pd?ys++:(ys=0,pd=t):ys=0,vs(0)}}function hb(t,a){(t.pooledCacheLanes&=a)===0&&(a=t.pooledCache,a!=null&&(t.pooledCache=null,es(a)))}function pu(){return cb(),fb(),db(),pb()}function pb(){if(xn!==5)return!1;var t=qa,a=dd;dd=0;var i=mn(va),c=z.T,m=V.p;try{V.p=32>i?32:i,z.T=null,i=hd,hd=null;var b=qa,S=va;if(xn=0,fi=qa=null,va=0,(wt&6)!==0)throw Error(l(331));var C=wt;if(wt|=4,Kx(b.current),Yx(b,b.current,S,i),wt=C,vs(0,!1),nt&&typeof nt.onPostCommitFiberRoot=="function")try{nt.onPostCommitFiberRoot(Pt,b)}catch{}return!0}finally{V.p=m,z.T=c,hb(t,a)}}function mb(t,a,i){a=kr(i,a),a=Yf(t.stateNode,a,2),t=Ba(t,a,2),t!==null&&(Ze(t,2),Kr(t))}function jt(t,a,i){if(t.tag===3)mb(t,t,i);else for(;a!==null;){if(a.tag===3){mb(a,t,i);break}else if(a.tag===1){var c=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(Ga===null||!Ga.has(c))){t=kr(i,t),i=gx(2),c=Ba(a,i,2),c!==null&&(xx(i,c,a,t),Ze(c,2),Kr(c));break}}a=a.return}}function xd(t,a,i){var c=t.pingCache;if(c===null){c=t.pingCache=new sE;var m=new Set;c.set(a,m)}else m=c.get(a),m===void 0&&(m=new Set,c.set(a,m));m.has(i)||(ud=!0,m.add(i),t=dE.bind(null,t,a,i),a.then(t,t))}function dE(t,a,i){var c=t.pingCache;c!==null&&c.delete(a),t.pingedLanes|=t.suspendedLanes&i,t.warmLanes&=~i,$t===t&&(ot&i)===i&&(nn===4||nn===3&&(ot&62914560)===ot&&300>kt()-ou?(wt&2)===0&&di(t,0):cd|=i,ci===ot&&(ci=0)),Kr(t)}function gb(t,a){a===0&&(a=Le()),t=hl(t,a),t!==null&&(Ze(t,a),Kr(t))}function hE(t){var a=t.memoizedState,i=0;a!==null&&(i=a.retryLane),gb(t,i)}function pE(t,a){var i=0;switch(t.tag){case 31:case 13:var c=t.stateNode,m=t.memoizedState;m!==null&&(i=m.retryLane);break;case 19:c=t.stateNode;break;case 22:c=t.stateNode._retryCache;break;default:throw Error(l(314))}c!==null&&c.delete(a),gb(t,i)}function mE(t,a){return Wt(t,a)}var mu=null,pi=null,bd=!1,gu=!1,yd=!1,Va=0;function Kr(t){t!==pi&&t.next===null&&(pi===null?mu=pi=t:pi=pi.next=t),gu=!0,bd||(bd=!0,xE())}function vs(t,a){if(!yd&&gu){yd=!0;do for(var i=!1,c=mu;c!==null;){if(t!==0){var m=c.pendingLanes;if(m===0)var b=0;else{var S=c.suspendedLanes,C=c.pingedLanes;b=(1<<31-Je(42|t)+1)-1,b&=m&~(S&~C),b=b&201326741?b&201326741|1:b?b|2:0}b!==0&&(i=!0,vb(c,b))}else b=ot,b=H(c,c===$t?b:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(b&3)===0||ce(c,b)||(i=!0,vb(c,b));c=c.next}while(i);yd=!1}}function gE(){xb()}function xb(){gu=bd=!1;var t=0;Va!==0&&TE()&&(t=Va);for(var a=kt(),i=null,c=mu;c!==null;){var m=c.next,b=bb(c,a);b===0?(c.next=null,i===null?mu=m:i.next=m,m===null&&(pi=i)):(i=c,(t!==0||(b&3)!==0)&&(gu=!0)),c=m}xn!==0&&xn!==5||vs(t),Va!==0&&(Va=0)}function bb(t,a){for(var i=t.suspendedLanes,c=t.pingedLanes,m=t.expirationTimes,b=t.pendingLanes&-62914561;0<b;){var S=31-Je(b),C=1<<S,U=m[S];U===-1?((C&i)===0||(C&c)!==0)&&(m[S]=ye(C,a)):U<=a&&(t.expiredLanes|=C),b&=~C}if(a=$t,i=ot,i=H(t,t===a?i:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),c=t.callbackNode,i===0||t===a&&(Ct===2||Ct===9)||t.cancelPendingCommit!==null)return c!==null&&c!==null&&Sn(c),t.callbackNode=null,t.callbackPriority=0;if((i&3)===0||ce(t,i)){if(a=i&-i,a===t.callbackPriority)return a;switch(c!==null&&Sn(c),mn(i)){case 2:case 8:i=ge;break;case 32:i=re;break;case 268435456:i=$e;break;default:i=re}return c=yb.bind(null,t),i=Wt(i,c),t.callbackPriority=a,t.callbackNode=i,a}return c!==null&&c!==null&&Sn(c),t.callbackPriority=2,t.callbackNode=null,2}function yb(t,a){if(xn!==0&&xn!==5)return t.callbackNode=null,t.callbackPriority=0,null;var i=t.callbackNode;if(pu()&&t.callbackNode!==i)return null;var c=ot;return c=H(t,t===$t?c:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),c===0?null:(eb(t,c,a),bb(t,kt()),t.callbackNode!=null&&t.callbackNode===i?yb.bind(null,t):null)}function vb(t,a){if(pu())return null;eb(t,a,!0)}function xE(){CE(function(){(wt&6)!==0?Wt(se,gE):xb()})}function vd(){if(Va===0){var t=Jl;t===0&&(t=jn,jn<<=1,(jn&261888)===0&&(jn=256)),Va=t}return Va}function kb(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:ja(""+t)}function wb(t,a){var i=a.ownerDocument.createElement("input");return i.name=a.name,i.value=a.value,t.id&&i.setAttribute("form",t.id),a.parentNode.insertBefore(i,a),t=new FormData(t),i.parentNode.removeChild(i),t}function bE(t,a,i,c,m){if(a==="submit"&&i&&i.stateNode===m){var b=kb((m[Nt]||null).action),S=c.submitter;S&&(a=(a=S[Nt]||null)?kb(a.formAction):S.getAttribute("formAction"),a!==null&&(b=a,S=null));var C=new Ao("action","action",null,c,m);t.push({event:C,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(Va!==0){var U=S?wb(m,S):new FormData(m);Uf(i,{pending:!0,data:U,method:m.method,action:b},null,U)}}else typeof b=="function"&&(C.preventDefault(),U=S?wb(m,S):new FormData(m),Uf(i,{pending:!0,data:U,method:m.method,action:b},b,U))},currentTarget:m}]})}}for(var kd=0;kd<nf.length;kd++){var wd=nf[kd],yE=wd.toLowerCase(),vE=wd[0].toUpperCase()+wd.slice(1);Or(yE,"on"+vE)}Or(Jm,"onAnimationEnd"),Or(eg,"onAnimationIteration"),Or(tg,"onAnimationStart"),Or("dblclick","onDoubleClick"),Or("focusin","onFocus"),Or("focusout","onBlur"),Or(LS,"onTransitionRun"),Or(IS,"onTransitionStart"),Or(BS,"onTransitionCancel"),Or(ng,"onTransitionEnd"),xe("onMouseEnter",["mouseout","mouseover"]),xe("onMouseLeave",["mouseout","mouseover"]),xe("onPointerEnter",["pointerout","pointerover"]),xe("onPointerLeave",["pointerout","pointerover"]),vn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),vn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),vn("onBeforeInput",["compositionend","keypress","textInput","paste"]),vn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),vn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),vn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ks="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(" "),kE=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ks));function Sb(t,a){a=(a&4)!==0;for(var i=0;i<t.length;i++){var c=t[i],m=c.event;c=c.listeners;e:{var b=void 0;if(a)for(var S=c.length-1;0<=S;S--){var C=c[S],U=C.instance,W=C.currentTarget;if(C=C.listener,U!==b&&m.isPropagationStopped())break e;b=C,m.currentTarget=W;try{b(m)}catch(ue){Ro(ue)}m.currentTarget=null,b=U}else for(S=0;S<c.length;S++){if(C=c[S],U=C.instance,W=C.currentTarget,C=C.listener,U!==b&&m.isPropagationStopped())break e;b=C,m.currentTarget=W;try{b(m)}catch(ue){Ro(ue)}m.currentTarget=null,b=U}}}}function lt(t,a){var i=a[xr];i===void 0&&(i=a[xr]=new Set);var c=t+"__bubble";i.has(c)||(Eb(a,t,2,!1),i.add(c))}function Sd(t,a,i){var c=0;a&&(c|=4),Eb(i,t,c,a)}var xu="_reactListening"+Math.random().toString(36).slice(2);function Ed(t){if(!t[xu]){t[xu]=!0,Zt.forEach(function(i){i!=="selectionchange"&&(kE.has(i)||Sd(i,!1,t),Sd(i,!0,t))});var a=t.nodeType===9?t:t.ownerDocument;a===null||a[xu]||(a[xu]=!0,Sd("selectionchange",!1,a))}}function Eb(t,a,i,c){switch(Jb(a)){case 2:var m=KE;break;case 8:m=ZE;break;default:m=$d}i=m.bind(null,a,i,t),m=void 0,!Fc||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(m=!0),c?m!==void 0?t.addEventListener(a,i,{capture:!0,passive:m}):t.addEventListener(a,i,!0):m!==void 0?t.addEventListener(a,i,{passive:m}):t.addEventListener(a,i,!1)}function Nd(t,a,i,c,m){var b=c;if((a&1)===0&&(a&2)===0&&c!==null)e:for(;;){if(c===null)return;var S=c.tag;if(S===3||S===4){var C=c.stateNode.containerInfo;if(C===m)break;if(S===4)for(S=c.return;S!==null;){var U=S.tag;if((U===3||U===4)&&S.stateNode.containerInfo===m)return;S=S.return}for(;C!==null;){if(S=me(C),S===null)return;if(U=S.tag,U===5||U===6||U===26||U===27){c=b=S;continue e}C=C.parentNode}}c=c.return}Eo(function(){var W=b,ue=Xe(i),de=[];e:{var ee=rg.get(t);if(ee!==void 0){var ie=Ao,je=t;switch(t){case"keypress":if(_o(i)===0)break e;case"keydown":case"keyup":ie=pS;break;case"focusin":je="focus",ie=Vc;break;case"focusout":je="blur",ie=Vc;break;case"beforeblur":case"afterblur":ie=Vc;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ie=Mm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ie=nS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ie=xS;break;case Jm:case eg:case tg:ie=lS;break;case ng:ie=yS;break;case"scroll":case"scrollend":ie=eS;break;case"wheel":ie=kS;break;case"copy":case"cut":case"paste":ie=sS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ie=Dm;break;case"toggle":case"beforetoggle":ie=SS}var Pe=(a&4)!==0,Lt=!Pe&&(t==="scroll"||t==="scrollend"),K=Pe?ee!==null?ee+"Capture":null:ee;Pe=[];for(var q=W,Q;q!==null;){var fe=q;if(Q=fe.stateNode,fe=fe.tag,fe!==5&&fe!==26&&fe!==27||Q===null||K===null||(fe=Fi(q,K),fe!=null&&Pe.push(ws(q,fe,Q))),Lt)break;q=q.return}0<Pe.length&&(ee=new ie(ee,je,null,i,ue),de.push({event:ee,listeners:Pe}))}}if((a&7)===0){e:{if(ee=t==="mouseover"||t==="pointerover",ie=t==="mouseout"||t==="pointerout",ee&&i!==Me&&(je=i.relatedTarget||i.fromElement)&&(me(je)||je[Fn]))break e;if((ie||ee)&&(ee=ue.window===ue?ue:(ee=ue.ownerDocument)?ee.defaultView||ee.parentWindow:window,ie?(je=i.relatedTarget||i.toElement,ie=W,je=je?me(je):null,je!==null&&(Lt=o(je),Pe=je.tag,je!==Lt||Pe!==5&&Pe!==27&&Pe!==6)&&(je=null)):(ie=null,je=W),ie!==je)){if(Pe=Mm,fe="onMouseLeave",K="onMouseEnter",q="mouse",(t==="pointerout"||t==="pointerover")&&(Pe=Dm,fe="onPointerLeave",K="onPointerEnter",q="pointer"),Lt=ie==null?ee:ct(ie),Q=je==null?ee:ct(je),ee=new Pe(fe,q+"leave",ie,i,ue),ee.target=Lt,ee.relatedTarget=Q,fe=null,me(ue)===W&&(Pe=new Pe(K,q+"enter",je,i,ue),Pe.target=Q,Pe.relatedTarget=Lt,fe=Pe),Lt=fe,ie&&je)t:{for(Pe=wE,K=ie,q=je,Q=0,fe=K;fe;fe=Pe(fe))Q++;fe=0;for(var Be=q;Be;Be=Pe(Be))fe++;for(;0<Q-fe;)K=Pe(K),Q--;for(;0<fe-Q;)q=Pe(q),fe--;for(;Q--;){if(K===q||q!==null&&K===q.alternate){Pe=K;break t}K=Pe(K),q=Pe(q)}Pe=null}else Pe=null;ie!==null&&Nb(de,ee,ie,Pe,!1),je!==null&&Lt!==null&&Nb(de,Lt,je,Pe,!0)}}e:{if(ee=W?ct(W):window,ie=ee.nodeName&&ee.nodeName.toLowerCase(),ie==="select"||ie==="input"&&ee.type==="file")var yt=Pm;else if(Um(ee))if(Fm)yt=OS;else{yt=RS;var Oe=jS}else ie=ee.nodeName,!ie||ie.toLowerCase()!=="input"||ee.type!=="checkbox"&&ee.type!=="radio"?W&&Ca(W.elementType)&&(yt=Pm):yt=MS;if(yt&&(yt=yt(t,W))){Hm(de,yt,i,ue);break e}Oe&&Oe(t,ee,W),t==="focusout"&&W&&ee.type==="number"&&W.memoizedProps.value!=null&&Pl(ee,"number",ee.value)}switch(Oe=W?ct(W):window,t){case"focusin":(Um(Oe)||Oe.contentEditable==="true")&&(ql=Oe,Jc=W,Qi=null);break;case"focusout":Qi=Jc=ql=null;break;case"mousedown":ef=!0;break;case"contextmenu":case"mouseup":case"dragend":ef=!1,Qm(de,i,ue);break;case"selectionchange":if(zS)break;case"keydown":case"keyup":Qm(de,i,ue)}var Qe;if(Kc)e:{switch(t){case"compositionstart":var ut="onCompositionStart";break e;case"compositionend":ut="onCompositionEnd";break e;case"compositionupdate":ut="onCompositionUpdate";break e}ut=void 0}else Gl?Bm(t,i)&&(ut="onCompositionEnd"):t==="keydown"&&i.keyCode===229&&(ut="onCompositionStart");ut&&(zm&&i.locale!=="ko"&&(Gl||ut!=="onCompositionStart"?ut==="onCompositionEnd"&&Gl&&(Qe=jm()):(Ra=ue,Gc="value"in Ra?Ra.value:Ra.textContent,Gl=!0)),Oe=bu(W,ut),0<Oe.length&&(ut=new Om(ut,t,null,i,ue),de.push({event:ut,listeners:Oe}),Qe?ut.data=Qe:(Qe=$m(i),Qe!==null&&(ut.data=Qe)))),(Qe=NS?_S(t,i):TS(t,i))&&(ut=bu(W,"onBeforeInput"),0<ut.length&&(Oe=new Om("onBeforeInput","beforeinput",null,i,ue),de.push({event:Oe,listeners:ut}),Oe.data=Qe)),bE(de,t,W,i,ue)}Sb(de,a)})}function ws(t,a,i){return{instance:t,listener:a,currentTarget:i}}function bu(t,a){for(var i=a+"Capture",c=[];t!==null;){var m=t,b=m.stateNode;if(m=m.tag,m!==5&&m!==26&&m!==27||b===null||(m=Fi(t,i),m!=null&&c.unshift(ws(t,m,b)),m=Fi(t,a),m!=null&&c.push(ws(t,m,b))),t.tag===3)return c;t=t.return}return[]}function wE(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Nb(t,a,i,c,m){for(var b=a._reactName,S=[];i!==null&&i!==c;){var C=i,U=C.alternate,W=C.stateNode;if(C=C.tag,U!==null&&U===c)break;C!==5&&C!==26&&C!==27||W===null||(U=W,m?(W=Fi(i,b),W!=null&&S.unshift(ws(i,W,U))):m||(W=Fi(i,b),W!=null&&S.push(ws(i,W,U)))),i=i.return}S.length!==0&&t.push({event:a,listeners:S})}var SE=/\r\n?/g,EE=/\u0000|\uFFFD/g;function _b(t){return(typeof t=="string"?t:""+t).replace(SE,`
|
|
9
|
+
`).replace(EE,"")}function Tb(t,a){return a=_b(a),_b(t)===a}function zt(t,a,i,c,m,b){switch(i){case"children":typeof c=="string"?a==="body"||a==="textarea"&&c===""||Fe(t,c):(typeof c=="number"||typeof c=="bigint")&&a!=="body"&&Fe(t,""+c);break;case"className":rr(t,"class",c);break;case"tabIndex":rr(t,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":rr(t,i,c);break;case"style":At(t,c,b);break;case"data":if(a!=="object"){rr(t,"data",c);break}case"src":case"href":if(c===""&&(a!=="a"||i!=="href")){t.removeAttribute(i);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){t.removeAttribute(i);break}c=ja(""+c),t.setAttribute(i,c);break;case"action":case"formAction":if(typeof c=="function"){t.setAttribute(i,"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 b=="function"&&(i==="formAction"?(a!=="input"&&zt(t,a,"name",m.name,m,null),zt(t,a,"formEncType",m.formEncType,m,null),zt(t,a,"formMethod",m.formMethod,m,null),zt(t,a,"formTarget",m.formTarget,m,null)):(zt(t,a,"encType",m.encType,m,null),zt(t,a,"method",m.method,m,null),zt(t,a,"target",m.target,m,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){t.removeAttribute(i);break}c=ja(""+c),t.setAttribute(i,c);break;case"onClick":c!=null&&(t.onclick=Se);break;case"onScroll":c!=null&<("scroll",t);break;case"onScrollEnd":c!=null&<("scrollend",t);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(l(61));if(i=c.__html,i!=null){if(m.children!=null)throw Error(l(60));t.innerHTML=i}}break;case"multiple":t.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":t.muted=c&&typeof c!="function"&&typeof c!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(c==null||typeof c=="function"||typeof c=="boolean"||typeof c=="symbol"){t.removeAttribute("xlink:href");break}i=ja(""+c),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":c!=null&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(i,""+c):t.removeAttribute(i);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":c&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(i,""):t.removeAttribute(i);break;case"capture":case"download":c===!0?t.setAttribute(i,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(i,c):t.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?t.setAttribute(i,c):t.removeAttribute(i);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?t.removeAttribute(i):t.setAttribute(i,c);break;case"popover":lt("beforetoggle",t),lt("toggle",t),Rn(t,"popover",c);break;case"xlinkActuate":Gn(t,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":Gn(t,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":Gn(t,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":Gn(t,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":Gn(t,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":Gn(t,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":Gn(t,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":Gn(t,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":Gn(t,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":Rn(t,"is",c);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=la.get(i)||i,Rn(t,i,c))}}function _d(t,a,i,c,m,b){switch(i){case"style":At(t,c,b);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(l(61));if(i=c.__html,i!=null){if(m.children!=null)throw Error(l(60));t.innerHTML=i}}break;case"children":typeof c=="string"?Fe(t,c):(typeof c=="number"||typeof c=="bigint")&&Fe(t,""+c);break;case"onScroll":c!=null&<("scroll",t);break;case"onScrollEnd":c!=null&<("scrollend",t);break;case"onClick":c!=null&&(t.onclick=Se);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!gn.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(m=i.endsWith("Capture"),a=i.slice(2,m?i.length-7:void 0),b=t[Nt]||null,b=b!=null?b[i]:null,typeof b=="function"&&t.removeEventListener(a,b,m),typeof c=="function")){typeof b!="function"&&b!==null&&(i in t?t[i]=null:t.hasAttribute(i)&&t.removeAttribute(i)),t.addEventListener(a,c,m);break e}i in t?t[i]=c:c===!0?t.setAttribute(i,""):Rn(t,i,c)}}}function An(t,a,i){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":lt("error",t),lt("load",t);var c=!1,m=!1,b;for(b in i)if(i.hasOwnProperty(b)){var S=i[b];if(S!=null)switch(b){case"src":c=!0;break;case"srcSet":m=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(l(137,a));default:zt(t,a,b,S,i,null)}}m&&zt(t,a,"srcSet",i.srcSet,i,null),c&&zt(t,a,"src",i.src,i,null);return;case"input":lt("invalid",t);var C=b=S=m=null,U=null,W=null;for(c in i)if(i.hasOwnProperty(c)){var ue=i[c];if(ue!=null)switch(c){case"name":m=ue;break;case"type":S=ue;break;case"checked":U=ue;break;case"defaultChecked":W=ue;break;case"value":b=ue;break;case"defaultValue":C=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(l(137,a));break;default:zt(t,a,c,ue,i,null)}}ul(t,b,C,U,W,S,m,!1);return;case"select":lt("invalid",t),c=S=b=null;for(m in i)if(i.hasOwnProperty(m)&&(C=i[m],C!=null))switch(m){case"value":b=C;break;case"defaultValue":S=C;break;case"multiple":c=C;default:zt(t,a,m,C,i,null)}a=b,i=S,t.multiple=!!c,a!=null?En(t,!!c,a,!1):i!=null&&En(t,!!c,i,!0);return;case"textarea":lt("invalid",t),b=m=c=null;for(S in i)if(i.hasOwnProperty(S)&&(C=i[S],C!=null))switch(S){case"value":c=C;break;case"defaultValue":m=C;break;case"children":b=C;break;case"dangerouslySetInnerHTML":if(C!=null)throw Error(l(91));break;default:zt(t,a,S,C,i,null)}Fl(t,c,m,b);return;case"option":for(U in i)i.hasOwnProperty(U)&&(c=i[U],c!=null)&&(U==="selected"?t.selected=c&&typeof c!="function"&&typeof c!="symbol":zt(t,a,U,c,i,null));return;case"dialog":lt("beforetoggle",t),lt("toggle",t),lt("cancel",t),lt("close",t);break;case"iframe":case"object":lt("load",t);break;case"video":case"audio":for(c=0;c<ks.length;c++)lt(ks[c],t);break;case"image":lt("error",t),lt("load",t);break;case"details":lt("toggle",t);break;case"embed":case"source":case"link":lt("error",t),lt("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(W in i)if(i.hasOwnProperty(W)&&(c=i[W],c!=null))switch(W){case"children":case"dangerouslySetInnerHTML":throw Error(l(137,a));default:zt(t,a,W,c,i,null)}return;default:if(Ca(a)){for(ue in i)i.hasOwnProperty(ue)&&(c=i[ue],c!==void 0&&_d(t,a,ue,c,i,void 0));return}}for(C in i)i.hasOwnProperty(C)&&(c=i[C],c!=null&&zt(t,a,C,c,i,null))}function NE(t,a,i,c){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var m=null,b=null,S=null,C=null,U=null,W=null,ue=null;for(ie in i){var de=i[ie];if(i.hasOwnProperty(ie)&&de!=null)switch(ie){case"checked":break;case"value":break;case"defaultValue":U=de;default:c.hasOwnProperty(ie)||zt(t,a,ie,null,c,de)}}for(var ee in c){var ie=c[ee];if(de=i[ee],c.hasOwnProperty(ee)&&(ie!=null||de!=null))switch(ee){case"type":b=ie;break;case"name":m=ie;break;case"checked":W=ie;break;case"defaultChecked":ue=ie;break;case"value":S=ie;break;case"defaultValue":C=ie;break;case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(l(137,a));break;default:ie!==de&&zt(t,a,ee,ie,c,de)}}Ui(t,S,C,U,W,ue,b,m);return;case"select":ie=S=C=ee=null;for(b in i)if(U=i[b],i.hasOwnProperty(b)&&U!=null)switch(b){case"value":break;case"multiple":ie=U;default:c.hasOwnProperty(b)||zt(t,a,b,null,c,U)}for(m in c)if(b=c[m],U=i[m],c.hasOwnProperty(m)&&(b!=null||U!=null))switch(m){case"value":ee=b;break;case"defaultValue":C=b;break;case"multiple":S=b;default:b!==U&&zt(t,a,m,b,c,U)}a=C,i=S,c=ie,ee!=null?En(t,!!i,ee,!1):!!c!=!!i&&(a!=null?En(t,!!i,a,!0):En(t,!!i,i?[]:"",!1));return;case"textarea":ie=ee=null;for(C in i)if(m=i[C],i.hasOwnProperty(C)&&m!=null&&!c.hasOwnProperty(C))switch(C){case"value":break;case"children":break;default:zt(t,a,C,null,c,m)}for(S in c)if(m=c[S],b=i[S],c.hasOwnProperty(S)&&(m!=null||b!=null))switch(S){case"value":ee=m;break;case"defaultValue":ie=m;break;case"children":break;case"dangerouslySetInnerHTML":if(m!=null)throw Error(l(91));break;default:m!==b&&zt(t,a,S,m,c,b)}wo(t,ee,ie);return;case"option":for(var je in i)ee=i[je],i.hasOwnProperty(je)&&ee!=null&&!c.hasOwnProperty(je)&&(je==="selected"?t.selected=!1:zt(t,a,je,null,c,ee));for(U in c)ee=c[U],ie=i[U],c.hasOwnProperty(U)&&ee!==ie&&(ee!=null||ie!=null)&&(U==="selected"?t.selected=ee&&typeof ee!="function"&&typeof ee!="symbol":zt(t,a,U,ee,c,ie));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 Pe in i)ee=i[Pe],i.hasOwnProperty(Pe)&&ee!=null&&!c.hasOwnProperty(Pe)&&zt(t,a,Pe,null,c,ee);for(W in c)if(ee=c[W],ie=i[W],c.hasOwnProperty(W)&&ee!==ie&&(ee!=null||ie!=null))switch(W){case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(l(137,a));break;default:zt(t,a,W,ee,c,ie)}return;default:if(Ca(a)){for(var Lt in i)ee=i[Lt],i.hasOwnProperty(Lt)&&ee!==void 0&&!c.hasOwnProperty(Lt)&&_d(t,a,Lt,void 0,c,ee);for(ue in c)ee=c[ue],ie=i[ue],!c.hasOwnProperty(ue)||ee===ie||ee===void 0&&ie===void 0||_d(t,a,ue,ee,c,ie);return}}for(var K in i)ee=i[K],i.hasOwnProperty(K)&&ee!=null&&!c.hasOwnProperty(K)&&zt(t,a,K,null,c,ee);for(de in c)ee=c[de],ie=i[de],!c.hasOwnProperty(de)||ee===ie||ee==null&&ie==null||zt(t,a,de,ee,c,ie)}function Ab(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function _E(){if(typeof performance.getEntriesByType=="function"){for(var t=0,a=0,i=performance.getEntriesByType("resource"),c=0;c<i.length;c++){var m=i[c],b=m.transferSize,S=m.initiatorType,C=m.duration;if(b&&C&&Ab(S)){for(S=0,C=m.responseEnd,c+=1;c<i.length;c++){var U=i[c],W=U.startTime;if(W>C)break;var ue=U.transferSize,de=U.initiatorType;ue&&Ab(de)&&(U=U.responseEnd,S+=ue*(U<C?1:(C-W)/(U-W)))}if(--c,a+=8*(b+S)/(m.duration/1e3),t++,10<t)break}}if(0<t)return a/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var Td=null,Ad=null;function yu(t){return t.nodeType===9?t:t.ownerDocument}function Cb(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 jb(t,a){if(t===0)switch(a){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&a==="foreignObject"?0:t}function Cd(t,a){return t==="textarea"||t==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.children=="bigint"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var jd=null;function TE(){var t=window.event;return t&&t.type==="popstate"?t===jd?!1:(jd=t,!0):(jd=null,!1)}var Rb=typeof setTimeout=="function"?setTimeout:void 0,AE=typeof clearTimeout=="function"?clearTimeout:void 0,Mb=typeof Promise=="function"?Promise:void 0,CE=typeof queueMicrotask=="function"?queueMicrotask:typeof Mb<"u"?function(t){return Mb.resolve(null).then(t).catch(jE)}:Rb;function jE(t){setTimeout(function(){throw t})}function Xa(t){return t==="head"}function Ob(t,a){var i=a,c=0;do{var m=i.nextSibling;if(t.removeChild(i),m&&m.nodeType===8)if(i=m.data,i==="/$"||i==="/&"){if(c===0){t.removeChild(m),bi(a);return}c--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")c++;else if(i==="html")Ss(t.ownerDocument.documentElement);else if(i==="head"){i=t.ownerDocument.head,Ss(i);for(var b=i.firstChild;b;){var S=b.nextSibling,C=b.nodeName;b[Ce]||C==="SCRIPT"||C==="STYLE"||C==="LINK"&&b.rel.toLowerCase()==="stylesheet"||i.removeChild(b),b=S}}else i==="body"&&Ss(t.ownerDocument.body);i=m}while(i);bi(a)}function Db(t,a){var i=t;t=0;do{var c=i.nextSibling;if(i.nodeType===1?a?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(a?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),c&&c.nodeType===8)if(i=c.data,i==="/$"){if(t===0)break;t--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||t++;i=c}while(i)}function Rd(t){var a=t.firstChild;for(a&&a.nodeType===10&&(a=a.nextSibling);a;){var i=a;switch(a=a.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":Rd(i),P(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}t.removeChild(i)}}function RE(t,a,i,c){for(;t.nodeType===1;){var m=i;if(t.nodeName.toLowerCase()!==a.toLowerCase()){if(!c&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(c){if(!t[Ce])switch(a){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(b=t.getAttribute("rel"),b==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(b!==m.rel||t.getAttribute("href")!==(m.href==null||m.href===""?null:m.href)||t.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin)||t.getAttribute("title")!==(m.title==null?null:m.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(b=t.getAttribute("src"),(b!==(m.src==null?null:m.src)||t.getAttribute("type")!==(m.type==null?null:m.type)||t.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin))&&b&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(a==="input"&&t.type==="hidden"){var b=m.name==null?null:""+m.name;if(m.type==="hidden"&&t.getAttribute("name")===b)return t}else return t;if(t=_r(t.nextSibling),t===null)break}return null}function ME(t,a,i){if(a==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!i||(t=_r(t.nextSibling),t===null))return null;return t}function zb(t,a){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!a||(t=_r(t.nextSibling),t===null))return null;return t}function Md(t){return t.data==="$?"||t.data==="$~"}function Od(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function OE(t,a){var i=t.ownerDocument;if(t.data==="$~")t._reactRetry=a;else if(t.data!=="$?"||i.readyState!=="loading")a();else{var c=function(){a(),i.removeEventListener("DOMContentLoaded",c)};i.addEventListener("DOMContentLoaded",c),t._reactRetry=c}}function _r(t){for(;t!=null;t=t.nextSibling){var a=t.nodeType;if(a===1||a===3)break;if(a===8){if(a=t.data,a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"||a==="F!"||a==="F")break;if(a==="/$"||a==="/&")return null}}return t}var Dd=null;function Lb(t){t=t.nextSibling;for(var a=0;t;){if(t.nodeType===8){var i=t.data;if(i==="/$"||i==="/&"){if(a===0)return _r(t.nextSibling);a--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||a++}t=t.nextSibling}return null}function Ib(t){t=t.previousSibling;for(var a=0;t;){if(t.nodeType===8){var i=t.data;if(i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"){if(a===0)return t;a--}else i!=="/$"&&i!=="/&"||a++}t=t.previousSibling}return null}function Bb(t,a,i){switch(a=yu(i),t){case"html":if(t=a.documentElement,!t)throw Error(l(452));return t;case"head":if(t=a.head,!t)throw Error(l(453));return t;case"body":if(t=a.body,!t)throw Error(l(454));return t;default:throw Error(l(451))}}function Ss(t){for(var a=t.attributes;a.length;)t.removeAttributeNode(a[0]);P(t)}var Tr=new Map,$b=new Set;function vu(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var ka=V.d;V.d={f:DE,r:zE,D:LE,C:IE,L:BE,m:$E,X:HE,S:UE,M:PE};function DE(){var t=ka.f(),a=fu();return t||a}function zE(t){var a=_e(t);a!==null&&a.tag===5&&a.type==="form"?nx(a):ka.r(t)}var mi=typeof document>"u"?null:document;function Ub(t,a,i){var c=mi;if(c&&typeof a=="string"&&a){var m=qn(a);m='link[rel="'+t+'"][href="'+m+'"]',typeof i=="string"&&(m+='[crossorigin="'+i+'"]'),$b.has(m)||($b.add(m),t={rel:t,crossOrigin:i,href:a},c.querySelector(m)===null&&(a=c.createElement("link"),An(a,"link",t),Ve(a),c.head.appendChild(a)))}}function LE(t){ka.D(t),Ub("dns-prefetch",t,null)}function IE(t,a){ka.C(t,a),Ub("preconnect",t,a)}function BE(t,a,i){ka.L(t,a,i);var c=mi;if(c&&t&&a){var m='link[rel="preload"][as="'+qn(a)+'"]';a==="image"&&i&&i.imageSrcSet?(m+='[imagesrcset="'+qn(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(m+='[imagesizes="'+qn(i.imageSizes)+'"]')):m+='[href="'+qn(t)+'"]';var b=m;switch(a){case"style":b=gi(t);break;case"script":b=xi(t)}Tr.has(b)||(t=x({rel:"preload",href:a==="image"&&i&&i.imageSrcSet?void 0:t,as:a},i),Tr.set(b,t),c.querySelector(m)!==null||a==="style"&&c.querySelector(Es(b))||a==="script"&&c.querySelector(Ns(b))||(a=c.createElement("link"),An(a,"link",t),Ve(a),c.head.appendChild(a)))}}function $E(t,a){ka.m(t,a);var i=mi;if(i&&t){var c=a&&typeof a.as=="string"?a.as:"script",m='link[rel="modulepreload"][as="'+qn(c)+'"][href="'+qn(t)+'"]',b=m;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":b=xi(t)}if(!Tr.has(b)&&(t=x({rel:"modulepreload",href:t},a),Tr.set(b,t),i.querySelector(m)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(Ns(b)))return}c=i.createElement("link"),An(c,"link",t),Ve(c),i.head.appendChild(c)}}}function UE(t,a,i){ka.S(t,a,i);var c=mi;if(c&&t){var m=Bt(c).hoistableStyles,b=gi(t);a=a||"default";var S=m.get(b);if(!S){var C={loading:0,preload:null};if(S=c.querySelector(Es(b)))C.loading=5;else{t=x({rel:"stylesheet",href:t,"data-precedence":a},i),(i=Tr.get(b))&&zd(t,i);var U=S=c.createElement("link");Ve(U),An(U,"link",t),U._p=new Promise(function(W,ue){U.onload=W,U.onerror=ue}),U.addEventListener("load",function(){C.loading|=1}),U.addEventListener("error",function(){C.loading|=2}),C.loading|=4,ku(S,a,c)}S={type:"stylesheet",instance:S,count:1,state:C},m.set(b,S)}}}function HE(t,a){ka.X(t,a);var i=mi;if(i&&t){var c=Bt(i).hoistableScripts,m=xi(t),b=c.get(m);b||(b=i.querySelector(Ns(m)),b||(t=x({src:t,async:!0},a),(a=Tr.get(m))&&Ld(t,a),b=i.createElement("script"),Ve(b),An(b,"link",t),i.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},c.set(m,b))}}function PE(t,a){ka.M(t,a);var i=mi;if(i&&t){var c=Bt(i).hoistableScripts,m=xi(t),b=c.get(m);b||(b=i.querySelector(Ns(m)),b||(t=x({src:t,async:!0,type:"module"},a),(a=Tr.get(m))&&Ld(t,a),b=i.createElement("script"),Ve(b),An(b,"link",t),i.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},c.set(m,b))}}function Hb(t,a,i,c){var m=(m=he.current)?vu(m):null;if(!m)throw Error(l(446));switch(t){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(a=gi(i.href),i=Bt(m).hoistableStyles,c=i.get(a),c||(c={type:"style",instance:null,count:0,state:null},i.set(a,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){t=gi(i.href);var b=Bt(m).hoistableStyles,S=b.get(t);if(S||(m=m.ownerDocument||m,S={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},b.set(t,S),(b=m.querySelector(Es(t)))&&!b._p&&(S.instance=b,S.state.loading=5),Tr.has(t)||(i={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},Tr.set(t,i),b||FE(m,t,i,S.state))),a&&c===null)throw Error(l(528,""));return S}if(a&&c!==null)throw Error(l(529,""));return null;case"script":return a=i.async,i=i.src,typeof i=="string"&&a&&typeof a!="function"&&typeof a!="symbol"?(a=xi(i),i=Bt(m).hoistableScripts,c=i.get(a),c||(c={type:"script",instance:null,count:0,state:null},i.set(a,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,t))}}function gi(t){return'href="'+qn(t)+'"'}function Es(t){return'link[rel="stylesheet"]['+t+"]"}function Pb(t){return x({},t,{"data-precedence":t.precedence,precedence:null})}function FE(t,a,i,c){t.querySelector('link[rel="preload"][as="style"]['+a+"]")?c.loading=1:(a=t.createElement("link"),c.preload=a,a.addEventListener("load",function(){return c.loading|=1}),a.addEventListener("error",function(){return c.loading|=2}),An(a,"link",i),Ve(a),t.head.appendChild(a))}function xi(t){return'[src="'+qn(t)+'"]'}function Ns(t){return"script[async]"+t}function Fb(t,a,i){if(a.count++,a.instance===null)switch(a.type){case"style":var c=t.querySelector('style[data-href~="'+qn(i.href)+'"]');if(c)return a.instance=c,Ve(c),c;var m=x({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return c=(t.ownerDocument||t).createElement("style"),Ve(c),An(c,"style",m),ku(c,i.precedence,t),a.instance=c;case"stylesheet":m=gi(i.href);var b=t.querySelector(Es(m));if(b)return a.state.loading|=4,a.instance=b,Ve(b),b;c=Pb(i),(m=Tr.get(m))&&zd(c,m),b=(t.ownerDocument||t).createElement("link"),Ve(b);var S=b;return S._p=new Promise(function(C,U){S.onload=C,S.onerror=U}),An(b,"link",c),a.state.loading|=4,ku(b,i.precedence,t),a.instance=b;case"script":return b=xi(i.src),(m=t.querySelector(Ns(b)))?(a.instance=m,Ve(m),m):(c=i,(m=Tr.get(b))&&(c=x({},i),Ld(c,m)),t=t.ownerDocument||t,m=t.createElement("script"),Ve(m),An(m,"link",c),t.head.appendChild(m),a.instance=m);case"void":return null;default:throw Error(l(443,a.type))}else a.type==="stylesheet"&&(a.state.loading&4)===0&&(c=a.instance,a.state.loading|=4,ku(c,i.precedence,t));return a.instance}function ku(t,a,i){for(var c=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),m=c.length?c[c.length-1]:null,b=m,S=0;S<c.length;S++){var C=c[S];if(C.dataset.precedence===a)b=C;else if(b!==m)break}b?b.parentNode.insertBefore(t,b.nextSibling):(a=i.nodeType===9?i.head:i,a.insertBefore(t,a.firstChild))}function zd(t,a){t.crossOrigin==null&&(t.crossOrigin=a.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=a.referrerPolicy),t.title==null&&(t.title=a.title)}function Ld(t,a){t.crossOrigin==null&&(t.crossOrigin=a.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=a.referrerPolicy),t.integrity==null&&(t.integrity=a.integrity)}var wu=null;function Gb(t,a,i){if(wu===null){var c=new Map,m=wu=new Map;m.set(i,c)}else m=wu,c=m.get(i),c||(c=new Map,m.set(i,c));if(c.has(t))return c;for(c.set(t,null),i=i.getElementsByTagName(t),m=0;m<i.length;m++){var b=i[m];if(!(b[Ce]||b[Ot]||t==="link"&&b.getAttribute("rel")==="stylesheet")&&b.namespaceURI!=="http://www.w3.org/2000/svg"){var S=b.getAttribute(a)||"";S=t+S;var C=c.get(S);C?C.push(b):c.set(S,[b])}}return c}function qb(t,a,i){t=t.ownerDocument||t,t.head.insertBefore(i,a==="title"?t.querySelector("head > title"):null)}function GE(t,a,i){if(i===1||a.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof a.precedence!="string"||typeof a.href!="string"||a.href==="")break;return!0;case"link":if(typeof a.rel!="string"||typeof a.href!="string"||a.href===""||a.onLoad||a.onError)break;return a.rel==="stylesheet"?(t=a.disabled,typeof a.precedence=="string"&&t==null):!0;case"script":if(a.async&&typeof a.async!="function"&&typeof a.async!="symbol"&&!a.onLoad&&!a.onError&&a.src&&typeof a.src=="string")return!0}return!1}function Yb(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function qE(t,a,i,c){if(i.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var m=gi(c.href),b=a.querySelector(Es(m));if(b){a=b._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(t.count++,t=Su.bind(t),a.then(t,t)),i.state.loading|=4,i.instance=b,Ve(b);return}b=a.ownerDocument||a,c=Pb(c),(m=Tr.get(m))&&zd(c,m),b=b.createElement("link"),Ve(b);var S=b;S._p=new Promise(function(C,U){S.onload=C,S.onerror=U}),An(b,"link",c),i.instance=b}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(i,a),(a=i.state.preload)&&(i.state.loading&3)===0&&(t.count++,i=Su.bind(t),a.addEventListener("load",i),a.addEventListener("error",i))}}var Id=0;function YE(t,a){return t.stylesheets&&t.count===0&&Nu(t,t.stylesheets),0<t.count||0<t.imgCount?function(i){var c=setTimeout(function(){if(t.stylesheets&&Nu(t,t.stylesheets),t.unsuspend){var b=t.unsuspend;t.unsuspend=null,b()}},6e4+a);0<t.imgBytes&&Id===0&&(Id=62500*_E());var m=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Nu(t,t.stylesheets),t.unsuspend)){var b=t.unsuspend;t.unsuspend=null,b()}},(t.imgBytes>Id?50:800)+a);return t.unsuspend=i,function(){t.unsuspend=null,clearTimeout(c),clearTimeout(m)}}:null}function Su(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Nu(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Eu=null;function Nu(t,a){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Eu=new Map,a.forEach(VE,t),Eu=null,Su.call(t))}function VE(t,a){if(!(a.state.loading&4)){var i=Eu.get(t);if(i)var c=i.get(null);else{i=new Map,Eu.set(t,i);for(var m=t.querySelectorAll("link[data-precedence],style[data-precedence]"),b=0;b<m.length;b++){var S=m[b];(S.nodeName==="LINK"||S.getAttribute("media")!=="not all")&&(i.set(S.dataset.precedence,S),c=S)}c&&i.set(null,c)}m=a.instance,S=m.getAttribute("data-precedence"),b=i.get(S)||c,b===c&&i.set(null,m),i.set(S,m),this.count++,c=Su.bind(this),m.addEventListener("load",c),m.addEventListener("error",c),b?b.parentNode.insertBefore(m,b.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(m,t.firstChild)),a.state.loading|=4}}var _s={$$typeof:j,Provider:null,Consumer:null,_currentValue:ne,_currentValue2:ne,_threadCount:0};function XE(t,a,i,c,m,b,S,C,U){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=Tt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Tt(0),this.hiddenUpdates=Tt(null),this.identifierPrefix=c,this.onUncaughtError=m,this.onCaughtError=b,this.onRecoverableError=S,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=U,this.incompleteTransitions=new Map}function Vb(t,a,i,c,m,b,S,C,U,W,ue,de){return t=new XE(t,a,i,S,U,W,ue,de,C),a=1,b===!0&&(a|=24),b=ir(3,null,null,a),t.current=b,b.stateNode=t,a=gf(),a.refCount++,t.pooledCache=a,a.refCount++,b.memoizedState={element:c,isDehydrated:i,cache:a},vf(b),t}function Xb(t){return t?(t=Xl,t):Xl}function Kb(t,a,i,c,m,b){m=Xb(m),c.context===null?c.context=m:c.pendingContext=m,c=Ia(a),c.payload={element:i},b=b===void 0?null:b,b!==null&&(c.callback=b),i=Ba(t,c,a),i!==null&&(Qn(i,t,a),as(i,t,a))}function Zb(t,a){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var i=t.retryLane;t.retryLane=i!==0&&i<a?i:a}}function Bd(t,a){Zb(t,a),(t=t.alternate)&&Zb(t,a)}function Qb(t){if(t.tag===13||t.tag===31){var a=hl(t,67108864);a!==null&&Qn(a,t,67108864),Bd(t,67108864)}}function Wb(t){if(t.tag===13||t.tag===31){var a=fr();a=rt(a);var i=hl(t,a);i!==null&&Qn(i,t,a),Bd(t,a)}}var _u=!0;function KE(t,a,i,c){var m=z.T;z.T=null;var b=V.p;try{V.p=2,$d(t,a,i,c)}finally{V.p=b,z.T=m}}function ZE(t,a,i,c){var m=z.T;z.T=null;var b=V.p;try{V.p=8,$d(t,a,i,c)}finally{V.p=b,z.T=m}}function $d(t,a,i,c){if(_u){var m=Ud(c);if(m===null)Nd(t,a,c,Tu,i),ey(t,c);else if(WE(m,t,a,i,c))c.stopPropagation();else if(ey(t,c),a&4&&-1<QE.indexOf(t)){for(;m!==null;){var b=_e(m);if(b!==null)switch(b.tag){case 3:if(b=b.stateNode,b.current.memoizedState.isDehydrated){var S=en(b.pendingLanes);if(S!==0){var C=b;for(C.pendingLanes|=2,C.entangledLanes|=2;S;){var U=1<<31-Je(S);C.entanglements[1]|=U,S&=~U}Kr(b),(wt&6)===0&&(uu=kt()+500,vs(0))}}break;case 31:case 13:C=hl(b,2),C!==null&&Qn(C,b,2),fu(),Bd(b,2)}if(b=Ud(c),b===null&&Nd(t,a,c,Tu,i),b===m)break;m=b}m!==null&&c.stopPropagation()}else Nd(t,a,c,null,i)}}function Ud(t){return t=Xe(t),Hd(t)}var Tu=null;function Hd(t){if(Tu=null,t=me(t),t!==null){var a=o(t);if(a===null)t=null;else{var i=a.tag;if(i===13){if(t=u(a),t!==null)return t;t=null}else if(i===31){if(t=f(a),t!==null)return t;t=null}else if(i===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;t=null}else a!==t&&(t=null)}}return Tu=t,null}function Jb(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(pn()){case se:return 2;case ge:return 8;case re:case we:return 32;case $e:return 268435456;default:return 32}default:return 32}}var Pd=!1,Ka=null,Za=null,Qa=null,Ts=new Map,As=new Map,Wa=[],QE="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 ey(t,a){switch(t){case"focusin":case"focusout":Ka=null;break;case"dragenter":case"dragleave":Za=null;break;case"mouseover":case"mouseout":Qa=null;break;case"pointerover":case"pointerout":Ts.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":As.delete(a.pointerId)}}function Cs(t,a,i,c,m,b){return t===null||t.nativeEvent!==b?(t={blockedOn:a,domEventName:i,eventSystemFlags:c,nativeEvent:b,targetContainers:[m]},a!==null&&(a=_e(a),a!==null&&Qb(a)),t):(t.eventSystemFlags|=c,a=t.targetContainers,m!==null&&a.indexOf(m)===-1&&a.push(m),t)}function WE(t,a,i,c,m){switch(a){case"focusin":return Ka=Cs(Ka,t,a,i,c,m),!0;case"dragenter":return Za=Cs(Za,t,a,i,c,m),!0;case"mouseover":return Qa=Cs(Qa,t,a,i,c,m),!0;case"pointerover":var b=m.pointerId;return Ts.set(b,Cs(Ts.get(b)||null,t,a,i,c,m)),!0;case"gotpointercapture":return b=m.pointerId,As.set(b,Cs(As.get(b)||null,t,a,i,c,m)),!0}return!1}function ty(t){var a=me(t.target);if(a!==null){var i=o(a);if(i!==null){if(a=i.tag,a===13){if(a=u(i),a!==null){t.blockedOn=a,Mr(t.priority,function(){Wb(i)});return}}else if(a===31){if(a=f(i),a!==null){t.blockedOn=a,Mr(t.priority,function(){Wb(i)});return}}else if(a===3&&i.stateNode.current.memoizedState.isDehydrated){t.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Au(t){if(t.blockedOn!==null)return!1;for(var a=t.targetContainers;0<a.length;){var i=Ud(t.nativeEvent);if(i===null){i=t.nativeEvent;var c=new i.constructor(i.type,i);Me=c,i.target.dispatchEvent(c),Me=null}else return a=_e(i),a!==null&&Qb(a),t.blockedOn=i,!1;a.shift()}return!0}function ny(t,a,i){Au(t)&&i.delete(a)}function JE(){Pd=!1,Ka!==null&&Au(Ka)&&(Ka=null),Za!==null&&Au(Za)&&(Za=null),Qa!==null&&Au(Qa)&&(Qa=null),Ts.forEach(ny),As.forEach(ny)}function Cu(t,a){t.blockedOn===a&&(t.blockedOn=null,Pd||(Pd=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,JE)))}var ju=null;function ry(t){ju!==t&&(ju=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){ju===t&&(ju=null);for(var a=0;a<t.length;a+=3){var i=t[a],c=t[a+1],m=t[a+2];if(typeof c!="function"){if(Hd(c||i)===null)continue;break}var b=_e(i);b!==null&&(t.splice(a,3),a-=3,Uf(b,{pending:!0,data:m,method:i.method,action:c},c,m))}}))}function bi(t){function a(U){return Cu(U,t)}Ka!==null&&Cu(Ka,t),Za!==null&&Cu(Za,t),Qa!==null&&Cu(Qa,t),Ts.forEach(a),As.forEach(a);for(var i=0;i<Wa.length;i++){var c=Wa[i];c.blockedOn===t&&(c.blockedOn=null)}for(;0<Wa.length&&(i=Wa[0],i.blockedOn===null);)ty(i),i.blockedOn===null&&Wa.shift();if(i=(t.ownerDocument||t).$$reactFormReplay,i!=null)for(c=0;c<i.length;c+=3){var m=i[c],b=i[c+1],S=m[Nt]||null;if(typeof b=="function")S||ry(i);else if(S){var C=null;if(b&&b.hasAttribute("formAction")){if(m=b,S=b[Nt]||null)C=S.formAction;else if(Hd(m)!==null)continue}else C=S.action;typeof C=="function"?i[c+1]=C:(i.splice(c,3),c-=3),ry(i)}}}function ay(){function t(b){b.canIntercept&&b.info==="react-transition"&&b.intercept({handler:function(){return new Promise(function(S){return m=S})},focusReset:"manual",scroll:"manual"})}function a(){m!==null&&(m(),m=null),c||setTimeout(i,20)}function i(){if(!c&&!navigation.transition){var b=navigation.currentEntry;b&&b.url!=null&&navigation.navigate(b.url,{state:b.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var c=!1,m=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",a),navigation.addEventListener("navigateerror",a),setTimeout(i,100),function(){c=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",a),navigation.removeEventListener("navigateerror",a),m!==null&&(m(),m=null)}}}function Fd(t){this._internalRoot=t}Ru.prototype.render=Fd.prototype.render=function(t){var a=this._internalRoot;if(a===null)throw Error(l(409));var i=a.current,c=fr();Kb(i,c,t,a,null,null)},Ru.prototype.unmount=Fd.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var a=t.containerInfo;Kb(t.current,2,null,t,null,null),fu(),a[Fn]=null}};function Ru(t){this._internalRoot=t}Ru.prototype.unstable_scheduleHydration=function(t){if(t){var a=gr();t={blockedOn:null,target:t,priority:a};for(var i=0;i<Wa.length&&a!==0&&a<Wa[i].priority;i++);Wa.splice(i,0,t),i===0&&ty(t)}};var ly=n.version;if(ly!=="19.2.4")throw Error(l(527,ly,"19.2.4"));V.findDOMNode=function(t){var a=t._reactInternals;if(a===void 0)throw typeof t.render=="function"?Error(l(188)):(t=Object.keys(t).join(","),Error(l(268,t)));return t=p(a),t=t!==null?g(t):null,t=t===null?null:t.stateNode,t};var e2={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:z,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Mu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Mu.isDisabled&&Mu.supportsFiber)try{Pt=Mu.inject(e2),nt=Mu}catch{}}return Rs.createRoot=function(t,a){if(!s(t))throw Error(l(299));var i=!1,c="",m=dx,b=hx,S=px;return a!=null&&(a.unstable_strictMode===!0&&(i=!0),a.identifierPrefix!==void 0&&(c=a.identifierPrefix),a.onUncaughtError!==void 0&&(m=a.onUncaughtError),a.onCaughtError!==void 0&&(b=a.onCaughtError),a.onRecoverableError!==void 0&&(S=a.onRecoverableError)),a=Vb(t,1,!1,null,null,i,c,null,m,b,S,ay),t[Fn]=a.current,Ed(t),new Fd(a)},Rs.hydrateRoot=function(t,a,i){if(!s(t))throw Error(l(299));var c=!1,m="",b=dx,S=hx,C=px,U=null;return i!=null&&(i.unstable_strictMode===!0&&(c=!0),i.identifierPrefix!==void 0&&(m=i.identifierPrefix),i.onUncaughtError!==void 0&&(b=i.onUncaughtError),i.onCaughtError!==void 0&&(S=i.onCaughtError),i.onRecoverableError!==void 0&&(C=i.onRecoverableError),i.formState!==void 0&&(U=i.formState)),a=Vb(t,1,!0,a,i??null,c,m,U,b,S,C,ay),a.context=Xb(null),i=a.current,c=fr(),c=rt(c),m=Ia(c),m.callback=null,Ba(i,m,c),i=c,a.current.lanes=i,Ze(a,i),Kr(a),t[Fn]=a.current,Ed(t),new Ru(a)},Rs.version="19.2.4",Rs}var my;function f2(){if(my)return Yd.exports;my=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(),Yd.exports=c2(),Yd.exports}var d2=f2();const Gh="codekin-settings",Zd={token:"",fontSize:16,theme:"dark"};function h2(){try{const e=localStorage.getItem(Gh),n=e?JSON.parse(e):null,r={...Zd,token:n?.token??Zd.token,theme:n?.theme==="light"?"light":"dark"},l=new URL(window.location.href),s=l.searchParams.get("token");return s&&(r.token=s,localStorage.setItem(Gh,JSON.stringify(r)),l.searchParams.delete("token"),window.history.replaceState({},"",l.pathname+l.search+l.hash)),r}catch{return Zd}}function p2(e){localStorage.setItem(Gh,JSON.stringify(e))}function m2(){const[e,n]=k.useState(h2),r=k.useCallback(l=>{n(s=>{const o={...s,...l};return p2(o),o})},[]);return{settings:e,updateSettings:r}}function z0(e){const[n,r]=k.useState([]),[l,s]=k.useState([]),[o,u]=k.useState([]),[f,h]=k.useState(!0),[p,g]=k.useState(null),[x,y]=k.useState(!1),v=n.flatMap(T=>T.repos),[w,E]=k.useState(0);k.useEffect(()=>{const T={};e&&(T.Authorization=`Bearer ${e}`),fetch("/cc/api/repos",{headers:T}).then(R=>{if(!R.ok)throw new Error(`Failed to load repos: ${R.status}`);return R.json()}).then(R=>{r(R.groups),s(R.globalSkills??[]),u(R.globalModules??[]),y(R.ghMissing??!1),g(null)}).catch(R=>g(R.message)).finally(()=>h(!1))},[e,w]);const N=k.useCallback(()=>E(T=>T+1),[]);return{groups:n,repos:v,globalSkills:l,globalModules:o,loading:f,error:p,ghMissing:x,refresh:N}}const Ht="/cc",g2="/authelia/login";function Hr(e){return{"Content-Type":"application/json",Authorization:`Bearer ${e}`}}let gy=!1;function Vs(){gy||(gy=!0,window.location.href=g2)}function x2(e){if(e.redirected&&e.url.includes("/authelia"))return!0;if(e.status>=502&&e.status<=504)return!1;const n=e.headers.get("content-type")||"";return n.includes("application/json")?!1:!!(e.status===401||e.status===403||e.ok&&n.includes("text/html"))}async function Qd(){try{const e=await fetch(`${Ht}/auth-verify`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:""}),redirect:"manual"});return e.type==="opaqueredirect"?!1:e.status>=502&&e.status<=504?!0:!(e.headers.get("content-type")||"").includes("text/html")}catch{return!0}}async function qt(e,n){const r=n?await fetch(e,n):await fetch(e);if(x2(r))throw Vs(),new Error("Session expired");return r}async function b2(e){const n=await qt(`${Ht}/auth-verify`,{method:"POST",headers:Hr(e),body:JSON.stringify({token:e})});return n.ok?(await n.json()).valid===!0:!1}async function y2(e){const n=await qt(`${Ht}/api/sessions/list`,{headers:{Authorization:`Bearer ${e}`}});if(!n.ok)throw new Error(`Failed to list sessions: ${n.status}`);return(await n.json()).sessions??[]}async function v2(e,n,r){const l=await qt(`${Ht}/api/sessions/create`,{method:"POST",headers:Hr(e),body:JSON.stringify({name:n,workingDir:r})});if(!l.ok)throw new Error(`Failed to create session: ${l.status}`);return l.json()}async function k2(e,n,r){const l=await qt(`${Ht}/api/sessions/${n}/rename`,{method:"PATCH",headers:Hr(e),body:JSON.stringify({name:r})});if(!l.ok)throw new Error(`Failed to rename session: ${l.status}`)}async function w2(e,n){const r=await qt(`${Ht}/api/sessions/${n}`,{method:"DELETE",headers:{Authorization:`Bearer ${e}`}});if(!r.ok)throw new Error(`Failed to delete session: ${r.status}`)}async function S2(e){const n=await qt(`${Ht}/api/orchestrator/start`,{method:"POST",headers:Hr(e)});if(!n.ok)throw new Error(`Failed to start orchestrator: ${n.status}`);return n.json()}async function E2(e,n){const r=new FormData;r.append("file",n);const l=await qt(`${Ht}/api/upload`,{method:"POST",headers:{Authorization:`Bearer ${e}`},body:r});if(!l.ok)throw new Error(`Upload failed: ${l.status}`);return(await l.json()).path}async function Wd(e,n,r){const s=`[Attached files: ${(await Promise.all(n.map(o=>E2(e,o)))).join(", ")}]`;return r.trim()?`${s}
|
|
10
|
+
${r}`:s}async function Ms(e,n){const r=new URLSearchParams({path:n}),l=await qt(`${Ht}/api/approvals?${r}`,{headers:{Authorization:`Bearer ${e}`}});if(!l.ok)throw new Error(`Failed to fetch approvals: ${l.status}`);return l.json()}async function N2(e,n,r){const l=new URLSearchParams({path:n}),s=await qt(`${Ht}/api/approvals?${l}`,{method:"DELETE",headers:Hr(e),body:JSON.stringify(r)});if(!s.ok)throw new Error(`Failed to remove approval: ${s.status}`)}async function _2(e,n,r){const l=new URLSearchParams({path:n}),s=await qt(`${Ht}/api/approvals?${l}`,{method:"DELETE",headers:Hr(e),body:JSON.stringify({items:r})});if(!s.ok)throw new Error(`Failed to bulk remove approvals: ${s.status}`)}async function L0(e,n){const r=new URLSearchParams;n&&r.set("workingDir",n);const l=r.toString(),s=await qt(`${Ht}/api/sessions/archived${l?`?${l}`:""}`,{headers:{Authorization:`Bearer ${e}`}});if(!s.ok)throw new Error(`Failed to list archived sessions: ${s.status}`);return(await s.json()).sessions??[]}async function xy(e,n){const r=await qt(`${Ht}/api/sessions/archived/${n}`,{headers:{Authorization:`Bearer ${e}`}});if(!r.ok)throw new Error(`Failed to get archived session: ${r.status}`);return r.json()}async function T2(e,n){const r=await qt(`${Ht}/api/sessions/archived/${n}`,{method:"DELETE",headers:{Authorization:`Bearer ${e}`}});if(!r.ok)throw new Error(`Failed to delete archived session: ${r.status}`)}async function I0(e){const n=await qt(`${Ht}/api/settings/retention`,{headers:{Authorization:`Bearer ${e}`}});if(!n.ok)throw new Error(`Failed to get retention settings: ${n.status}`);return(await n.json()).days}async function B0(e,n){const r=await qt(`${Ht}/api/settings/retention`,{method:"PUT",headers:Hr(e),body:JSON.stringify({days:n})});if(!r.ok)throw new Error(`Failed to update retention settings: ${r.status}`);return(await r.json()).days}async function $0(e){const n=await qt(`${Ht}/api/settings/repos-path`,{headers:{Authorization:`Bearer ${e}`}});if(!n.ok)throw new Error(`Failed to get repos path: ${n.status}`);return(await n.json()).path}async function U0(e,n){const r=await qt(`${Ht}/api/settings/repos-path`,{method:"PUT",headers:Hr(e),body:JSON.stringify({path:n})});if(!r.ok){const s=await r.json().catch(()=>({error:"Failed to save repos path"}));throw new Error(s.error||`Failed to set repos path: ${r.status}`)}return(await r.json()).path}async function H0(e){const n=await qt(`${Ht}/api/settings/queue-messages`,{headers:{Authorization:`Bearer ${e}`}});if(!n.ok)throw new Error(`Failed to get queue messages setting: ${n.status}`);return(await n.json()).enabled}async function A2(e,n){const r=await qt(`${Ht}/api/settings/queue-messages`,{method:"PUT",headers:Hr(e),body:JSON.stringify({enabled:n})});if(!r.ok)throw new Error(`Failed to update queue messages setting: ${r.status}`);return(await r.json()).enabled}async function C2(e){const n=await qt(`${Ht}/api/settings/worktree-prefix`,{headers:{Authorization:`Bearer ${e}`}});if(!n.ok)throw new Error(`Failed to get worktree prefix: ${n.status}`);return(await n.json()).prefix}async function j2(e,n){const r=await qt(`${Ht}/api/settings/worktree-prefix`,{method:"PUT",headers:Hr(e),body:JSON.stringify({prefix:n})});if(!r.ok){const s=await r.json().catch(()=>({error:"Failed to save worktree prefix"}));throw new Error(s.error||`Failed to set worktree prefix: ${r.status}`)}return(await r.json()).prefix}async function R2(e){const n=await qt(`${Ht}/api/settings/agent-name`,{headers:{Authorization:`Bearer ${e}`}});if(!n.ok)throw new Error(`Failed to get agent name: ${n.status}`);return(await n.json()).name}async function by(e,n){const r=await qt(`${Ht}/api/settings/agent-name`,{method:"PUT",headers:Hr(e),body:JSON.stringify({name:n})});if(!r.ok){const s=await r.json().catch(()=>({error:"Failed to save agent name"}));throw new Error(s.error||`Failed to set agent name: ${r.status}`)}return(await r.json()).name}async function M2(e,n){const r=n?`?path=${encodeURIComponent(n)}`:"",l=await qt(`${Ht}/api/browse-dirs${r}`,{headers:{Authorization:`Bearer ${e}`}});if(!l.ok){const s=await l.json().catch(()=>({error:"Failed to browse directory"}));throw new Error(s.error||`Failed to browse: ${l.status}`)}return l.json()}async function O2(e){const n=await qt(`${Ht}/api/webhooks/config`,{headers:{Authorization:`Bearer ${e}`}});if(!n.ok)throw new Error(`Failed to get webhook config: ${n.status}`);return(await n.json()).config}async function D2(e){const n=await qt(`${Ht}/api/webhooks/events`,{headers:{Authorization:`Bearer ${e}`}});if(!n.ok)throw new Error(`Failed to get webhook events: ${n.status}`);return(await n.json()).events??[]}function z2(){return`${location.protocol==="https:"?"wss:":"ws:"}//${location.host}/cc/`}function L2(e){const[n,r]=k.useState([]),[l,s]=k.useState(!1),[o,u]=k.useState(null),f=k.useRef(null),h=k.useCallback(async()=>{if(e)try{const y=await y2(e);r(y),u(null)}catch(y){u(y instanceof Error?y.message:"Failed to load sessions")}},[e]),p=k.useCallback(async(y,v)=>{if(!e)return null;s(!0);try{const w=await v2(e,y,v);return await h(),w.sessionId}catch(w){return u(w instanceof Error?w.message:"Failed to create session"),null}finally{s(!1)}},[e,h]),g=k.useCallback(async(y,v)=>{if(e)try{await k2(e,y,v),await h()}catch(w){u(w instanceof Error?w.message:"Failed to rename session")}},[e,h]),x=k.useCallback(async y=>{if(e)try{await w2(e,y),await h()}catch(v){u(v instanceof Error?v.message:"Failed to delete session")}},[e,h]);return k.useEffect(()=>{if(e)return h(),f.current=setInterval(()=>{h()},1e4),()=>{f.current&&clearInterval(f.current)}},[e,h]),{sessions:n,loading:l,error:o,refresh:h,create:p,rename:g,remove:x}}function I2(){const[e,n]=k.useState(new Map),r=k.useCallback((p,g)=>{const x=p.requestId??crypto?.randomUUID?.()??`local-${Date.now()}-${Math.random().toString(36).slice(2,9)}`,y={requestId:x,options:p.options,question:p.question||null,multiSelect:p.multiSelect??!1,promptType:p.promptType??null,questions:p.questions,approvePattern:p.approvePattern};n(v=>{const w=new Map(v),E=new Map(v.get(g)??new Map);return E.set(x,y),w.set(g,E),w})},[]),l=k.useCallback(p=>{n(g=>{if(p){for(const[x,y]of g)if(y.has(p)){const v=new Map(g),w=new Map(y);return w.delete(p),w.size===0?v.delete(x):v.set(x,w),v}return g}return g})},[]),s=k.useCallback(p=>{n(g=>{if(!g.has(p))return g;const x=new Map(g);return x.delete(p),x})},[]),o=k.useCallback(()=>{n(p=>p.size===0?p:new Map)},[]),u=k.useCallback(p=>{if(!p)return null;const g=e.get(p);return!g||g.size===0?null:g.values().next().value??null},[e]),f=k.useCallback(p=>p?e.get(p)?.size??0:0,[e]),h=k.useMemo(()=>{const p={};for(const[g,x]of e)x.size>0&&(p[g]=!0);return p},[e]);return{getActive:u,getQueueSize:f,waitingSessions:h,enqueue:r,dismiss:l,clearForSession:s,clearAll:o}}const B2=6e4;function $2({token:e,onMessageRef:n,onDisconnect:r,onHealthPong:l}){const s=k.useRef(null),[o,u]=k.useState("disconnected"),f=k.useRef(null),h=k.useRef(null),p=k.useRef(1e3),g=k.useRef(!1),x=k.useRef(()=>{}),y=k.useRef(!1),v=k.useRef(!1),w=k.useRef(null),E=k.useRef(r),N=k.useRef(l);k.useEffect(()=>{E.current=r},[r]),k.useEffect(()=>{N.current=l},[l]);const T=k.useCallback(()=>{h.current&&(clearInterval(h.current),h.current=null),f.current&&(clearTimeout(f.current),f.current=null),w.current&&(clearTimeout(w.current),w.current=null)},[]),R=k.useCallback(_=>{const D=s.current;D&&D.readyState===WebSocket.OPEN&&D.send(JSON.stringify(_))},[]),j=k.useCallback(()=>{if(!e)return;T(),u("connecting");const _=new WebSocket(z2());s.current=_,_.onopen=()=>{_.send(JSON.stringify({type:"auth",token:e})),u("connected"),p.current=1e3,h.current=setInterval(()=>{R({type:"ping"})},3e4)},_.onmessage=D=>{let F;try{F=JSON.parse(D.data)}catch{return}F.type==="pong"&&v.current&&(v.current=!1,w.current&&(clearTimeout(w.current),w.current=null),N.current?.(R)),n.current?.(F)},_.onclose=D=>{if(u("disconnected"),T(),s.current=null,E.current?.(),D.code===4001){Vs();return}g.current||Qd().then(F=>{if(!F){Vs();return}f.current=setTimeout(()=>{p.current=Math.min(p.current*2,3e4),x.current()},p.current)}).catch(()=>{f.current=setTimeout(x.current,p.current)})},_.onerror=()=>{}},[e,T,R,n]);k.useEffect(()=>{x.current=j},[j]);const $=k.useCallback(()=>{g.current=!0,T(),s.current?.close(),s.current=null,u("disconnected")},[T]),B=k.useCallback(()=>{if(y.current)return;y.current=!0,setTimeout(()=>{y.current=!1},3e3);const _=s.current;if(_&&_.readyState===WebSocket.OPEN){v.current=!0,w.current=setTimeout(()=>{v.current=!1,w.current=null,p.current=1e3,_.close()},2e3),R({type:"ping"});return}_&&_.readyState===WebSocket.CONNECTING||Qd().then(D=>{if(!D){Vs();return}p.current=1e3,f.current&&(clearTimeout(f.current),f.current=null),j()}).catch(()=>{f.current=setTimeout(x.current,p.current)})},[R,j]);return k.useEffect(()=>(e&&(g.current=!1,j()),()=>{$()}),[e]),k.useEffect(()=>{if(!e)return;const _=setInterval(async()=>{await Qd()||Vs()},B2);return()=>clearInterval(_)},[e]),{connState:o,send:R,disconnect:$,restoreSession:B,reconnect:j}}const yy=500;let U2=0;function Ar(){return`m${++U2}`}function P0(e,n){const r=e.length>0?e[e.length-1]:void 0;switch(n.type){case"output":return r&&r.type==="assistant"&&!r.complete?r.text+=n.data:e.push({type:"assistant",text:n.data,complete:!1,ts:Date.now(),key:Ar()}),!0;case"result":return r&&r.type==="assistant"&&!r.complete?(r.complete=!0,!0):!1;case"system_message":return e.push({type:"system",subtype:n.subtype,text:n.text,model:n.model,key:Ar()}),!0;case"user_echo":return e.push({type:"user",text:n.text,ts:Date.now(),key:Ar()}),!0;case"claude_started":return e.push({type:"system",subtype:"init",text:"Session started",key:Ar()}),!0;case"tool_active":return r&&r.type==="tool_group"?r.tools.push({name:n.toolName,active:!0}):e.push({type:"tool_group",tools:[{name:n.toolName,active:!0}],key:Ar()}),!0;case"tool_done":if(r&&r.type==="tool_group"){for(let l=r.tools.length-1;l>=0;l--)if(r.tools[l].name===n.toolName&&r.tools[l].active){r.tools[l]={name:n.toolName,summary:n.summary,active:!1};break}return!0}return!1;case"tool_output":return e.push({type:"tool_output",content:n.content,isError:n.isError,key:Ar()}),!0;case"image":return e.push({type:"image",base64:n.base64,mediaType:n.mediaType,key:Ar()}),!0;case"planning_mode":return e.push({type:"planning_mode",active:n.active,key:Ar()}),!0;default:return!1}}function wa(e,n){const r=[...e],l=r.length-1;if(l>=0){const o=r[l];o.type==="assistant"&&!o.complete?r[l]={...o}:o.type==="tool_group"&&(r[l]={...o,tools:[...o.tools]})}return P0(r,n)?r:e}function Wn(e){return e.length<=yy?e:[{type:"system",subtype:"trim",text:"Older messages trimmed",key:Ar()},...e.slice(-yy+1)]}function qh(e){const n=[];for(const r of e)P0(n,r);return n}function H2({token:e,onSessionCreated:n,onSessionJoined:r,onSessionRenamed:l,onSessionsUpdated:s,onError:o,onRawMessage:u}){const f=k.useRef({onSessionCreated:n,onSessionJoined:r,onSessionRenamed:l,onSessionsUpdated:s,onError:o,onRawMessage:u});k.useEffect(()=>{f.current={onSessionCreated:n,onSessionJoined:r,onSessionRenamed:l,onSessionsUpdated:s,onError:o,onRawMessage:u}});const[h,p]=k.useState([]),[g,x]=k.useState(!1),[y,v]=k.useState(!1),[w,E]=k.useState([]),[N,T]=k.useState(()=>localStorage.getItem("claude-model")??null),[R,j]=k.useState(()=>localStorage.getItem("claude-permission-mode")||"acceptEdits"),[$,B]=k.useState(null),_=I2(),D=k.useRef(null),[F,Y]=k.useState(null),L=_.getActive(F),X=_.getQueueSize(F),Z=k.useRef(""),te=k.useRef(null),J=k.useCallback(()=>{te.current=null;const ve=Z.current;ve&&(Z.current="",p(Ee=>{const mt=Ee[Ee.length-1];if(mt&&mt.type==="assistant"&&!mt.complete){const ze=[...Ee];return ze[ze.length-1]={...mt,text:mt.text+ve},Wn(ze)}return Wn([...Ee,{type:"assistant",text:ve,complete:!1,ts:Date.now(),key:Ar()}])}))},[]),G=k.useCallback(()=>{Z.current&&(te.current&&(cancelAnimationFrame(te.current),te.current=null),J())},[J]),z=k.useCallback(ve=>{switch(f.current.onRawMessage?.(ve),ve.type){case"thinking":B(ve.summary),v(!0);break;case"output":{B(null),v(!0),Z.current+=ve.data,te.current||(te.current=requestAnimationFrame(J));break}case"result":v(!1),B(null),G(),p(Ee=>Wn(wa(Ee,ve)));break;case"system_message":ve.subtype==="init"&&ve.model&&(T(ve.model),localStorage.setItem("claude-model",ve.model)),G(),p(Ee=>Wn(wa(Ee,ve)));break;case"user_echo":G(),p(Ee=>Wn(wa(Ee,ve)));break;case"tool_active":B(null),v(!0),G(),p(Ee=>Wn(wa(Ee,ve)));break;case"tool_done":G(),p(Ee=>Wn(wa(Ee,ve)));break;case"tool_output":G(),p(Ee=>Wn(wa(Ee,ve)));break;case"image":G(),p(Ee=>Wn(wa(Ee,ve)));break;case"planning_mode":x(ve.active),p(Ee=>Wn(wa(Ee,ve)));break;case"todo_update":E(ve.tasks);break;case"prompt":{const Ee=ve.sessionId??D.current;if(!Ee)break;_.enqueue(ve,Ee),Ee===D.current&&(v(!1),B(null));break}case"prompt_dismiss":{_.dismiss(ve.requestId);break}case"session_created":D.current=ve.sessionId,Y(ve.sessionId),p([]),E([]),v(!1),B(null),f.current.onSessionCreated?.(ve.sessionId);break;case"session_joined":{D.current=ve.sessionId,Y(ve.sessionId),v(!1),B(null),ve.model&&(T(ve.model),localStorage.setItem("claude-model",ve.model)),ve.permissionMode&&(j(ve.permissionMode),localStorage.setItem("claude-permission-mode",ve.permissionMode));let Ee=[],mt=!1,ze=[];if(ve.outputBuffer?.length){Ee=qh(ve.outputBuffer);for(const gt of ve.outputBuffer)gt.type==="planning_mode"&&(mt=gt.active),gt.type==="todo_update"&&(ze=gt.tasks)}x(mt),E(ze),p(Wn(Ee)),f.current.onSessionJoined?.(ve.sessionId);break}case"claude_started":p(Ee=>Wn(wa(Ee,ve)));break;case"claude_stopped":case"exit":{v(!1),B(null);const Ee=D.current;Ee&&_.clearForSession(Ee);break}case"error":f.current.onError?.(ve.message);break;case"session_deleted":p(Ee=>Wn([...Ee,{type:"system",subtype:"error",text:"Session was deleted",key:Ar()}]));break;case"connected":case"pong":break;case"session_name_update":f.current.onSessionRenamed?.(ve.sessionId,ve.name);break;case"sessions_updated":f.current.onSessionsUpdated?.();break;case"worktree_created":f.current.onSessionsUpdated?.();break}},[J,G,_]),V=k.useRef(z);k.useEffect(()=>{V.current=z},[z]);const ne=k.useCallback(()=>{v(!1),B(null),te.current&&(cancelAnimationFrame(te.current),te.current=null)},[]),be=k.useCallback(ve=>{const Ee=D.current;Ee&&ve({type:"join_session",sessionId:Ee})},[]),{connState:M,send:O,disconnect:I,restoreSession:A,reconnect:oe}=$2({token:e,onMessageRef:V,onDisconnect:ne,onHealthPong:be}),le=k.useCallback(ve=>{O({type:"join_session",sessionId:ve})},[O]),he=k.useCallback((ve,Ee,mt,ze)=>{O({type:"create_session",name:ve,workingDir:Ee,useWorktree:mt,permissionMode:ze})},[O]),pe=k.useCallback((ve,Ee)=>{O({type:"input",data:ve,...Ee?{displayText:Ee}:{}}),v(!0);const mt=D.current;mt&&_.clearForSession(mt)},[O,_]),Ae=k.useCallback(ve=>{const Ee=L?.requestId;O({type:"prompt_response",value:ve,requestId:Ee}),Ee&&_.dismiss(Ee),v(!0)},[O,L?.requestId,_]),Re=k.useCallback(()=>{O({type:"leave_session"}),D.current=null,Y(null),v(!1),B(null)},[O]),qe=k.useCallback(()=>{p([])},[]),pt=k.useCallback((ve,Ee="notification")=>{p(mt=>Wn([...mt,{type:"system",subtype:Ee,text:ve,key:Ar()}]))},[]),St=k.useCallback(ve=>{O({type:"set_model",model:ve}),T(ve),localStorage.setItem("claude-model",ve)},[O]),Ge=k.useCallback(()=>{O({type:"move_to_worktree"})},[O]),Et=k.useCallback(ve=>{O({type:"set_permission_mode",permissionMode:ve}),j(ve),localStorage.setItem("claude-permission-mode",ve)},[O]);return{connState:M,messages:h,tasks:w,planningMode:g,isProcessing:y,thinkingSummary:$,waitingSessions:_.waitingSessions,activePrompt:L,promptQueueSize:X,currentModel:N,send:O,joinSession:le,createSession:he,sendInput:pe,sendPromptResponse:Ae,leaveSession:Re,clearMessages:qe,addSystemMessage:pt,disconnect:I,reconnect:oe,restoreSession:A,setModel:St,currentPermissionMode:R,setPermissionMode:Et,moveToWorktree:Ge}}function P2(e){const n=k.useRef(e);k.useEffect(()=>{n.current=e}),k.useEffect(()=>{function r(){document.visibilityState==="visible"&&n.current()}return document.addEventListener("visibilitychange",r),()=>document.removeEventListener("visibilitychange",r)},[])}function Jd(e){if(e==="/joe"||e==="/joe/"||e==="/orchestrator"||e==="/orchestrator/")return{path:e,sessionId:null,view:"orchestrator"};if(e==="/workflows"||e==="/workflows/")return{path:e,sessionId:null,view:"workflows"};const n=e.match(/^\/s\/([a-f0-9-]+)\/?$/);return{path:e,sessionId:n?n[1]:null,view:"chat"}}function F2(){const[e,n]=k.useState(()=>Jd(window.location.pathname));k.useEffect(()=>{function l(){n(Jd(window.location.pathname))}return window.addEventListener("popstate",l),()=>window.removeEventListener("popstate",l)},[]);const r=k.useCallback((l,s=!1)=>{l!==window.location.pathname&&(s?history.replaceState(null,"",l):history.pushState(null,"",l),n(Jd(l)))},[]);return{...e,navigate:r}}const ic="codekin-tentative-";function vy(e,n){const r=`${ic}${e}`;n.length===0?localStorage.removeItem(r):localStorage.setItem(r,JSON.stringify(n.map(l=>l.text)))}function G2(e){try{const n=localStorage.getItem(`${ic}${e}`);if(n)return JSON.parse(n).map(l=>({text:l,files:[]}))}catch{}return[]}function q2(){const e={};try{for(let n=0;n<localStorage.length;n++){const r=localStorage.key(n);if(r?.startsWith(ic)){const l=r.slice(ic.length),s=G2(l);s.length>0&&(e[l]=s)}}}catch{}return e}function Y2(){const[e,n]=k.useState(q2),r=k.useCallback((s,o,u=[])=>{n(f=>{const h={...f,[s]:[...f[s]??[],{text:o,files:u}]};return vy(s,h[s]),h})},[]),l=k.useCallback(s=>{n(o=>{if(!o[s])return o;const u=Object.fromEntries(Object.entries(o).filter(([f])=>f!==s));return vy(s,[]),u})},[]);return{queues:e,addToQueue:r,clearQueue:l}}function Lr(e){return e.groupDir??e.workingDir}function V2({sessions:e,repos:n,activeSessionId:r,setActiveSessionId:l,joinSession:s,leaveSession:o,clearMessages:u,wsCreateSession:f,removeSession:h,pendingContextRef:p,useWorktreeRef:g,permissionModeRef:x}){const y=r?e.find(B=>B.id===r)??null:null,v=y?Lr(y):null,w=k.useCallback(B=>{const _=e.filter(D=>Lr(D)===B.workingDir);if(_.length>0){const D=_[_.length-1];u(),o(),s(D.id);return}u(),o(),f(`hub:${B.id}`,B.workingDir,g.current,x.current)},[e,s,f,o,u,g,x]),E=k.useCallback(B=>{B!==r&&(u(),o(),s(B))},[r,o,s,u]),N=k.useCallback(async B=>{if(B===r){u(),o();const _=e.find(F=>F.id===B),D=e.filter(F=>F.id!==B);if(D.length>0){const F=_?D.filter(L=>Lr(L)===Lr(_)):[],Y=F.length>0?F[0]:D[0];s(Y.id)}else l(null)}await h(B)},[r,e,u,o,s,l,h]),T=k.useCallback(B=>{if(B===v)return;const _=e.filter(D=>Lr(D)===B);if(_.length>0){const D=_[_.length-1];u(),o(),s(D.id)}},[v,e,u,o,s]),R=k.useCallback(async B=>{const _=e.filter(F=>Lr(F)===B);if(_.some(F=>F.id===r)){u(),o();const F=e.filter(Y=>Lr(Y)!==B);F.length>0?s(F[0].id):l(null)}for(const F of _)await h(F.id)},[e,r,u,o,s,l,h]),j=k.useCallback(()=>{if(!v)return;const B=n.find(F=>F.workingDir===v),_=B?.workingDir??v,D=B?.id??_.split("/").pop()??"session";u(),o(),f(`hub:${D}`,_,g.current,x.current)},[v,n,u,o,f,x,g]),$=k.useCallback((B,_)=>{const D=n.find(F=>F.workingDir===B);D&&(p.current=_,u(),o(),f(`hub:${D.id}`,D.workingDir,g.current,x.current))},[n,u,o,f,p,x,g]);return{activeSession:y,activeWorkingDir:v,handleOpenSession:w,handleSelectSession:E,handleDeleteSession:N,handleSelectRepo:T,handleDeleteRepo:R,handleNewSessionForRepo:j,handleNewSessionFromArchive:$}}const ky="/cc",F0="codekin-starred-docs";function X2(){try{return JSON.parse(localStorage.getItem(F0)||"{}")}catch{return{}}}function K2(e){localStorage.setItem(F0,JSON.stringify(e))}function Z2(){const[e,n]=k.useState(null),[r,l]=k.useState(null),[s,o]=k.useState(!1),[u,f]=k.useState(null),[h,p]=k.useState(!1),[g,x]=k.useState(null),[y,v]=k.useState(!1),[w,E]=k.useState([]),[N,T]=k.useState(!1),[R,j]=k.useState(null),[$,B]=k.useState(X2),_=k.useCallback(async(G,z)=>{j(G),v(!0),T(!0),E([]);try{const V=new URLSearchParams({repo:G}),ne=await fetch(`${ky}/api/docs?${V}`,{headers:{Authorization:`Bearer ${z}`}});if(!ne.ok)throw new Error(`Failed to list docs: ${ne.status}`);const be=await ne.json();E(be.files??[])}catch{E([])}finally{T(!1)}},[]),D=k.useCallback(()=>{v(!1)},[]),F=k.useCallback(async(G,z,V)=>{x(G),n(z),l(null),f(null),o(!0),p(!1),v(!1);try{const ne=new URLSearchParams({repo:G,file:z}),be=await fetch(`${ky}/api/docs/file?${ne}`,{headers:{Authorization:`Bearer ${V}`}});if(!be.ok)throw new Error(`Failed to load file: ${be.status}`);const M=await be.json();l(M.content)}catch(ne){f(ne instanceof Error?ne.message:"Failed to load file")}finally{o(!1)}},[]),Y=k.useCallback(()=>{n(null),l(null),f(null),o(!1),p(!1),x(null)},[]),L=k.useCallback(()=>{p(G=>!G)},[]),X=g?$[g]??[]:[],Z=e!==null&&X.includes(e),te=k.useCallback(()=>{!g||!e||B(G=>{const z=G[g]??[],V=z.includes(e)?z.filter(be=>be!==e):[...z,e],ne={...G,[g]:V};return K2(ne),ne})},[g,e]),J=R?$[R]??[]:[];return{isOpen:e!==null,selectedFile:e,content:r,loading:s,error:u,rawMode:h,toggleRawMode:L,openFile:F,close:Y,repoWorkingDir:g,pickerOpen:y,pickerFiles:w,pickerLoading:N,openPicker:_,closePicker:D,pickerRepoDir:R,starredDocs:J,isCurrentFileStarred:Z,toggleStarCurrentFile:te}}const Q2=1024;function W2(e=Q2){const[n,r]=k.useState(()=>typeof window<"u"?window.innerWidth<e:!1);return k.useEffect(()=>{const l=window.matchMedia(`(max-width: ${e-1}px)`),s=o=>r(o.matches);return l.addEventListener("change",s),()=>l.removeEventListener("change",s)},[e]),n}const G0=[{command:"/clear",name:"Clear session",description:"Clear conversation and start fresh",category:"builtin",aliases:["/reset","/new"]},{command:"/compact",name:"Compact",description:"Compact conversation to save context",category:"builtin"},{command:"/model",name:"Model",description:"Change the active model",category:"builtin"},{command:"/help",name:"Help",description:"Show available commands",category:"builtin"},{command:"/cost",name:"Cost",description:"Show session cost info",category:"builtin"},{command:"/status",name:"Status",description:"Show session status",category:"builtin"}],Yh=new Map;for(const e of G0){Yh.set(e.command,e.command);for(const n of e.aliases??[])Yh.set(n,e.command)}function J2(e){return Yh.get(e)}const q0=[{command:"/commit",name:"Commit",description:"Create a git commit",category:"bundled"},{command:"/simplify",name:"Simplify",description:"Review and simplify changed code",category:"bundled"},{command:"/loop",name:"Loop",description:"Run a command on a recurring interval",category:"bundled"},{command:"/debug",name:"Debug",description:"Debug an issue step by step",category:"bundled"},{command:"/claude-api",name:"Claude API",description:"Help with Anthropic SDK usage",category:"bundled"}];function eN(e){const n=new Set,r=[];for(const l of e)n.has(l.command)||(n.add(l.command),r.push({command:l.command,name:l.name,description:l.description,category:"skill",content:l.content}));for(const l of q0)n.has(l.command)||(n.add(l.command),r.push(l));for(const l of G0)if(!n.has(l.command)){n.add(l.command);for(const s of l.aliases??[])n.add(s);r.push(l)}return r}const tN=new Set(q0.map(e=>e.command));function nN({token:e,activeSessionId:n,activeWorkingDir:r,sessions:l,allSkills:s,sendInput:o,onBuiltinCommand:u,tentativeQueues:f,addToQueue:h,clearQueue:p,docsContext:g,queueEnabled:x}){const[y,v]=k.useState(null),[w,E]=k.useState({}),N=k.useMemo(()=>n?w[n]??[]:[],[n,w]),T=k.useCallback(Y=>{n&&E(L=>({...L,[n]:[...L[n]??[],...Y]}))},[n]),R=k.useCallback(Y=>{n&&E(L=>({...L,[n]:(L[n]??[]).filter((X,Z)=>Z!==Y)}))},[n]),j=k.useCallback(Y=>{const L=Y.trim();if(!L.startsWith("/"))return{expanded:Y,handled:!1};const X=L.indexOf(" "),Z=X===-1?L:L.slice(0,X),te=X===-1?"":L.slice(X+1).trim(),J=J2(Z);if(J)return u(J,te),{expanded:Y,handled:!0};const G=s.find(z=>z.command===Z);if(G?.content){const z=G.content.replace(/\$ARGUMENTS/g,te||"(no arguments provided)"),V=[`[Skill: ${G.name}]`,"",z];return te&&V.push("",`User instructions: ${te}`),{expanded:V.join(`
|
|
11
|
+
`),displayText:Y,handled:!1}}return tN.has(Z)?{expanded:Y,displayText:Y,handled:!1}:{expanded:Y,handled:!1}},[s,u]),$=k.useCallback(async Y=>{if(!e)return;const{expanded:L,displayText:X,handled:Z}=j(Y);if(Z)return;const te=g.isOpen&&g.selectedFile&&g.repoWorkingDir?`[Viewing doc: ${g.selectedFile} in ${g.repoWorkingDir}]
|
|
12
|
+
|
|
13
|
+
`:"",J=(f[n??""]?.length??0)>0,G=!!r&&l.some(V=>Lr(V)===r&&V.isProcessing&&V.id!==n);if(x&&n&&(J||G)){if(N.length>0){E(V=>({...V,[n]:[]})),v("Uploading files...");try{const V=await Wd(e,N,te+L);h(n,V),v(null)}catch(V){h(n,te+L),v(`Upload failed: ${V instanceof Error?V.message:"unknown error"}`),setTimeout(()=>v(null),3e3)}}else h(n,te+L);return}const z=N;if(z.length===0){o(te+L,X);return}v("Uploading files...");try{const V=await Wd(e,z,te+L);n&&E(ne=>({...ne,[n]:[]})),v(null),o(V)}catch(V){v(`Upload failed: ${V instanceof Error?V.message:"unknown error"}`),setTimeout(()=>v(null),3e3)}},[e,n,r,l,f,h,N,j,o,g.isOpen,g.selectedFile,g.repoWorkingDir,x]),B=k.useCallback(async Y=>{const L=f[Y]??[];p(Y);for(let X=0;X<L.length;X++){const Z=L[X];if(X>0&&await new Promise(te=>setTimeout(te,100)),Z.files.length>0&&e)try{const te=await Wd(e,Z.files,Z.text);o(te)}catch{o(Z.text)}else o(Z.text)}},[f,p,o,e]),_=k.useCallback(Y=>{p(Y)},[p]);k.useEffect(()=>{for(const[Y,L]of Object.entries(f)){if(L.length===0)continue;const X=l.find(J=>J.id===Y);if(!X)continue;const Z=Lr(X);l.filter(J=>Lr(J)===Z&&J.isProcessing&&J.id!==Y).length===0&&Y===n&&(B(Y),setTimeout(()=>{v("Session finished — starting queued session."),setTimeout(()=>v(null),3e3)},0))}},[l,n,f,B]);const D=n?(f[n]??[]).map((Y,L)=>({type:"tentative",text:Y.files.length>0?`${Y.text}
|
|
14
|
+
📎 ${Y.files.length} file${Y.files.length>1?"s":""} attached`:Y.text,index:L,key:`tentative-${L}`})):[],F=n?f[n]?.length??0:0;return{handleSend:$,handleExecuteTentative:B,handleDiscardTentative:_,tentativeMessages:D,activeTentativeCount:F,pendingFiles:N,addFiles:T,removeFile:R,uploadStatus:y}}function rN(e,n,r){const l=e[e.length-1];if(l&&l.type==="assistant"&&!l.complete)return"Writing...";for(let s=e.length-1;s>=0;s--){const o=e[s];if(o.type==="tool_group"){const u=o.tools.find(f=>f.active);if(u)return`Running ${u.name}...`;break}if(o.type!=="planning_mode"&&o.type!=="tool_output")break}if(n)return r?`Thinking: ${r}`:"Thinking..."}var aN={outline:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},filled:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"currentColor",stroke:"none"}};const De=(e,n,r,l)=>{const s=k.forwardRef(({color:o="currentColor",size:u=24,stroke:f=2,title:h,className:p,children:g,...x},y)=>k.createElement("svg",{ref:y,...aN[e],width:u,height:u,className:["tabler-icon",`tabler-icon-${n}`,p].join(" "),...e==="filled"?{fill:o}:{strokeWidth:f,stroke:o},...x},[h&&k.createElement("title",{key:"svg-title"},h),...l.map(([v,w])=>k.createElement(v,w)),...Array.isArray(g)?g:[g]]));return s.displayName=`${r}`,s};const lN=[["path",{d:"M12 9v4",key:"svg-0"}],["path",{d:"M10.363 3.591l-8.106 13.534a1.914 1.914 0 0 0 1.636 2.871h16.214a1.914 1.914 0 0 0 1.636 -2.87l-8.106 -13.536a1.914 1.914 0 0 0 -3.274 0",key:"svg-1"}],["path",{d:"M12 16h.01",key:"svg-2"}]],iN=De("outline","alert-triangle","AlertTriangle",lN);const sN=[["path",{d:"M3 6a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2",key:"svg-0"}],["path",{d:"M5 8v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-10",key:"svg-1"}],["path",{d:"M10 12l4 0",key:"svg-2"}]],eo=De("outline","archive","Archive",sN);const oN=[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M18 13l-6 6",key:"svg-1"}],["path",{d:"M6 13l6 6",key:"svg-2"}]],uN=De("outline","arrow-down","ArrowDown",oN);const cN=[["path",{d:"M5 12l14 0",key:"svg-0"}],["path",{d:"M5 12l6 6",key:"svg-1"}],["path",{d:"M5 12l6 -6",key:"svg-2"}]],fN=De("outline","arrow-left","ArrowLeft",cN);const dN=[["path",{d:"M5 12l14 0",key:"svg-0"}],["path",{d:"M13 18l6 -6",key:"svg-1"}],["path",{d:"M13 6l6 6",key:"svg-2"}]],Y0=De("outline","arrow-right","ArrowRight",dN);const hN=[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M18 11l-6 -6",key:"svg-1"}],["path",{d:"M6 11l6 -6",key:"svg-2"}]],pN=De("outline","arrow-up","ArrowUp",hN);const mN=[["path",{d:"M10 5a2 2 0 1 1 4 0a7 7 0 0 1 4 6v3a4 4 0 0 0 2 3h-16a4 4 0 0 0 2 -3v-3a7 7 0 0 1 4 -6",key:"svg-0"}],["path",{d:"M9 17v1a3 3 0 0 0 6 0v-1",key:"svg-1"}]],gN=De("outline","bell","Bell",mN);const xN=[["path",{d:"M3 19a9 9 0 0 1 9 0a9 9 0 0 1 9 0",key:"svg-0"}],["path",{d:"M3 6a9 9 0 0 1 9 0a9 9 0 0 1 9 0",key:"svg-1"}],["path",{d:"M3 6l0 13",key:"svg-2"}],["path",{d:"M12 6l0 13",key:"svg-3"}],["path",{d:"M21 6l0 13",key:"svg-4"}]],bN=De("outline","book","Book",xN);const yN=[["path",{d:"M9 19c-4.3 1.4 -4.3 -2.5 -6 -3m12 5v-3.5c0 -1 .1 -1.4 -.5 -2c2.8 -.3 5.5 -1.4 5.5 -6a4.6 4.6 0 0 0 -1.3 -3.2a4.2 4.2 0 0 0 -.1 -3.2s-1.1 -.3 -3.5 1.3a12.3 12.3 0 0 0 -6.2 0c-2.4 -1.6 -3.5 -1.3 -3.5 -1.3a4.2 4.2 0 0 0 -.1 3.2a4.6 4.6 0 0 0 -1.3 3.2c0 4.6 2.7 5.7 5.5 6c-.6 .6 -.6 1.2 -.5 2v3.5",key:"svg-0"}]],vN=De("outline","brand-github","BrandGithub",yN);const kN=[["path",{d:"M4 7a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2l0 -12",key:"svg-0"}],["path",{d:"M16 3l0 4",key:"svg-1"}],["path",{d:"M8 3l0 4",key:"svg-2"}],["path",{d:"M4 11l16 0",key:"svg-3"}],["path",{d:"M8 15h2v2h-2l0 -2",key:"svg-4"}]],wN=De("outline","calendar-event","CalendarEvent",kN);const SN=[["path",{d:"M5 12l5 5l10 -10",key:"svg-0"}]],jl=De("outline","check","Check",SN);const EN=[["path",{d:"M6 9l6 6l6 -6",key:"svg-0"}]],jr=De("outline","chevron-down","ChevronDown",EN);const NN=[["path",{d:"M15 6l-6 6l6 6",key:"svg-0"}]],V0=De("outline","chevron-left","ChevronLeft",NN);const _N=[["path",{d:"M9 6l6 6l-6 6",key:"svg-0"}]],Ea=De("outline","chevron-right","ChevronRight",_N);const TN=[["path",{d:"M6 15l6 -6l6 6",key:"svg-0"}]],AN=De("outline","chevron-up","ChevronUp",TN);const CN=[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",key:"svg-0"}]],jN=De("outline","circle","Circle",CN);const RN=[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M12 7v5l3 3",key:"svg-1"}]],MN=De("outline","clock","Clock",RN);const ON=[["path",{d:"M6.657 18c-2.572 0 -4.657 -2.007 -4.657 -4.483c0 -2.475 2.085 -4.482 4.657 -4.482c.393 -1.762 1.794 -3.2 3.675 -3.773c1.88 -.572 3.956 -.193 5.444 1c1.488 1.19 2.162 3.007 1.77 4.769h.99c1.913 0 3.464 1.56 3.464 3.486c0 1.927 -1.551 3.487 -3.465 3.487h-11.878",key:"svg-0"}]],DN=De("outline","cloud","Cloud",ON);const zN=[["path",{d:"M7 9.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667l0 -8.666",key:"svg-0"}],["path",{d:"M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1",key:"svg-1"}]],X0=De("outline","copy","Copy",zN);const LN=[["path",{d:"M4 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-0"}],["path",{d:"M11 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-1"}],["path",{d:"M18 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-2"}]],IN=De("outline","dots","Dots",LN);const BN=[["path",{d:"M12 6h-6a2 2 0 0 0 -2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-6",key:"svg-0"}],["path",{d:"M11 13l9 -9",key:"svg-1"}],["path",{d:"M15 4h5v5",key:"svg-2"}]],K0=De("outline","external-link","ExternalLink",BN);const $N=[["path",{d:"M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0",key:"svg-0"}],["path",{d:"M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6",key:"svg-1"}]],UN=De("outline","eye","Eye",$N);const HN=[["path",{d:"M14 3v4a1 1 0 0 0 1 1h4",key:"svg-0"}],["path",{d:"M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2",key:"svg-1"}],["path",{d:"M10 13l-1 2l1 2",key:"svg-2"}],["path",{d:"M14 13l1 2l-1 2",key:"svg-3"}]],PN=De("outline","file-code","FileCode",HN);const FN=[["path",{d:"M14 3v4a1 1 0 0 0 1 1h4",key:"svg-0"}],["path",{d:"M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2",key:"svg-1"}],["path",{d:"M9 9l1 0",key:"svg-2"}],["path",{d:"M9 13l6 0",key:"svg-3"}],["path",{d:"M9 17l6 0",key:"svg-4"}]],Vh=De("outline","file-text","FileText",FN);const GN=[["path",{d:"M14 3v4a1 1 0 0 0 1 1h4",key:"svg-0"}],["path",{d:"M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2",key:"svg-1"}]],qN=De("outline","file","File",GN);const YN=[["path",{d:"M5 19l2.757 -7.351a1 1 0 0 1 .936 -.649h12.307a1 1 0 0 1 .986 1.164l-.996 5.211a2 2 0 0 1 -1.964 1.625h-14.026a2 2 0 0 1 -2 -2v-11a2 2 0 0 1 2 -2h4l3 3h7a2 2 0 0 1 2 2v2",key:"svg-0"}]],VN=De("outline","folder-open","FolderOpen",YN);const XN=[["path",{d:"M5 4h4l3 3h7a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-11a2 2 0 0 1 2 -2",key:"svg-0"}]],Xh=De("outline","folder","Folder",XN);const KN=[["path",{d:"M5 18a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-0"}],["path",{d:"M5 6a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-1"}],["path",{d:"M15 6a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-2"}],["path",{d:"M7 8l0 8",key:"svg-3"}],["path",{d:"M9 18h6a2 2 0 0 0 2 -2v-5",key:"svg-4"}],["path",{d:"M14 14l3 -3l3 3",key:"svg-5"}]],nl=De("outline","git-branch","GitBranch",KN);const ZN=[["path",{d:"M16.555 3.843l3.602 3.602a2.877 2.877 0 0 1 0 4.069l-2.643 2.643a2.877 2.877 0 0 1 -4.069 0l-.301 -.301l-6.558 6.558a2 2 0 0 1 -1.239 .578l-.175 .008h-1.172a1 1 0 0 1 -.993 -.883l-.007 -.117v-1.172a2 2 0 0 1 .467 -1.284l.119 -.13l.414 -.414h2v-2h2v-2l2.144 -2.144l-.301 -.301a2.877 2.877 0 0 1 0 -4.069l2.643 -2.643a2.877 2.877 0 0 1 4.069 0",key:"svg-0"}],["path",{d:"M15 9h.01",key:"svg-1"}]],QN=De("outline","key","Key",ZN);const WN=[["path",{d:"M12 3a9 9 0 1 0 9 9",key:"svg-0"}]],Ur=De("outline","loader-2","Loader2",WN);const JN=[["path",{d:"M14 8v-2a2 2 0 0 0 -2 -2h-7a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h7a2 2 0 0 0 2 -2v-2",key:"svg-0"}],["path",{d:"M9 12h12l-3 -3",key:"svg-1"}],["path",{d:"M18 15l3 -3",key:"svg-2"}]],e_=De("outline","logout","Logout",JN);const t_=[["path",{d:"M12 18.5l-3 -1.5l-6 3v-13l6 -3l6 3l6 -3v7.5",key:"svg-0"}],["path",{d:"M9 4v13",key:"svg-1"}],["path",{d:"M15 7v5.5",key:"svg-2"}],["path",{d:"M21.121 20.121a3 3 0 1 0 -4.242 0c.418 .419 1.125 1.045 2.121 1.879c1.051 -.89 1.759 -1.516 2.121 -1.879",key:"svg-3"}],["path",{d:"M19 18v.01",key:"svg-4"}]],n_=De("outline","map-2","Map2",t_);const r_=[["path",{d:"M4 6l16 0",key:"svg-0"}],["path",{d:"M4 12l16 0",key:"svg-1"}],["path",{d:"M4 18l16 0",key:"svg-2"}]],a_=De("outline","menu-2","Menu2",r_);const l_=[["path",{d:"M8 9h8",key:"svg-0"}],["path",{d:"M8 13h6",key:"svg-1"}],["path",{d:"M12.01 18.594l-4.01 2.406v-3h-2a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v5.5",key:"svg-2"}],["path",{d:"M16 19h6",key:"svg-3"}],["path",{d:"M19 16v6",key:"svg-4"}]],i_=De("outline","message-plus","MessagePlus",l_);const s_=[["path",{d:"M5 12l14 0",key:"svg-0"}]],Z0=De("outline","minus","Minus",s_);const o_=[["path",{d:"M12 3c.132 0 .263 0 .393 0a7.5 7.5 0 0 0 7.92 12.446a9 9 0 1 1 -8.313 -12.454l0 .008",key:"svg-0"}]],wy=De("outline","moon","Moon",o_);const u_=[["path",{d:"M12 21a9 9 0 0 1 0 -18c4.97 0 9 3.582 9 8c0 1.06 -.474 2.078 -1.318 2.828c-.844 .75 -1.989 1.172 -3.182 1.172h-2.5a2 2 0 0 0 -1 3.75a1.3 1.3 0 0 1 -1 2.25",key:"svg-0"}],["path",{d:"M7.5 10.5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-1"}],["path",{d:"M11.5 7.5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-2"}],["path",{d:"M15.5 10.5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-3"}]],c_=De("outline","palette","Palette",u_);const f_=[["path",{d:"M15 7l-6.5 6.5a1.5 1.5 0 0 0 3 3l6.5 -6.5a3 3 0 0 0 -6 -6l-6.5 6.5a4.5 4.5 0 0 0 9 9l6.5 -6.5",key:"svg-0"}]],Ou=De("outline","paperclip","Paperclip",f_);const d_=[["path",{d:"M4 20h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4",key:"svg-0"}],["path",{d:"M13.5 6.5l4 4",key:"svg-1"}]],jp=De("outline","pencil","Pencil",d_);const h_=[["path",{d:"M6 6a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1l0 -12",key:"svg-0"}],["path",{d:"M14 6a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1l0 -12",key:"svg-1"}]],Q0=De("outline","player-pause","PlayerPause",h_);const p_=[["path",{d:"M7 4v16l13 -8l-13 -8",key:"svg-0"}]],Sy=De("outline","player-play","PlayerPlay",p_);const m_=[["path",{d:"M5 7a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2l0 -10",key:"svg-0"}]],g_=De("outline","player-stop","PlayerStop",m_);const x_=[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M5 12l14 0",key:"svg-1"}]],to=De("outline","plus","Plus",x_);const b_=[["path",{d:"M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4",key:"svg-0"}],["path",{d:"M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4",key:"svg-1"}]],y_=De("outline","refresh","Refresh",b_);const v_=[["path",{d:"M6 5h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2",key:"svg-0"}],["path",{d:"M9 16c1 .667 2 1 3 1s2 -.333 3 -1",key:"svg-1"}],["path",{d:"M9 7l-1 -4",key:"svg-2"}],["path",{d:"M15 7l1 -4",key:"svg-3"}],["path",{d:"M9 12v-1",key:"svg-4"}],["path",{d:"M15 12v-1",key:"svg-5"}]],Cl=De("outline","robot-face","RobotFace",v_);const k_=[["path",{d:"M6 6a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v4a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2l0 -4",key:"svg-0"}],["path",{d:"M12 2v2",key:"svg-1"}],["path",{d:"M9 12v9",key:"svg-2"}],["path",{d:"M15 12v9",key:"svg-3"}],["path",{d:"M5 16l4 -2",key:"svg-4"}],["path",{d:"M15 14l4 2",key:"svg-5"}],["path",{d:"M9 18h6",key:"svg-6"}],["path",{d:"M10 8v.01",key:"svg-7"}],["path",{d:"M14 8v.01",key:"svg-8"}]],Ks=De("outline","robot","Robot",k_);const w_=[["path",{d:"M10 14l11 -11",key:"svg-0"}],["path",{d:"M21 3l-6.5 18a.55 .55 0 0 1 -1 0l-3.5 -7l-7 -3.5a.55 .55 0 0 1 0 -1l18 -6.5",key:"svg-1"}]],Du=De("outline","send","Send",w_);const S_=[["path",{d:"M10.325 4.317c.426 -1.756 2.924 -1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543 -.94 3.31 .826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756 .426 1.756 2.924 0 3.35a1.724 1.724 0 0 0 -1.066 2.573c.94 1.543 -.826 3.31 -2.37 2.37a1.724 1.724 0 0 0 -2.572 1.065c-.426 1.756 -2.924 1.756 -3.35 0a1.724 1.724 0 0 0 -2.573 -1.066c-1.543 .94 -3.31 -.826 -2.37 -2.37a1.724 1.724 0 0 0 -1.065 -2.572c-1.756 -.426 -1.756 -2.924 0 -3.35a1.724 1.724 0 0 0 1.066 -2.573c-.94 -1.543 .826 -3.31 2.37 -2.37c1 .608 2.296 .07 2.572 -1.065",key:"svg-0"}],["path",{d:"M9 12a3 3 0 1 0 6 0a3 3 0 0 0 -6 0",key:"svg-1"}]],W0=De("outline","settings","Settings",S_);const E_=[["path",{d:"M11.46 20.846a12 12 0 0 1 -7.96 -14.846a12 12 0 0 0 8.5 -3a12 12 0 0 0 8.5 3a12 12 0 0 1 -.09 7.06",key:"svg-0"}],["path",{d:"M15 19l2 2l4 -4",key:"svg-1"}]],J0=De("outline","shield-check","ShieldCheck",E_);const N_=[["path",{d:"M16 18a2 2 0 0 1 2 2a2 2 0 0 1 2 -2a2 2 0 0 1 -2 -2a2 2 0 0 1 -2 2m0 -12a2 2 0 0 1 2 2a2 2 0 0 1 2 -2a2 2 0 0 1 -2 -2a2 2 0 0 1 -2 2m-7 12a6 6 0 0 1 6 -6a6 6 0 0 1 -6 -6a6 6 0 0 1 -6 6a6 6 0 0 1 6 6",key:"svg-0"}]],ev=De("outline","sparkles","Sparkles",N_);const __=[["path",{d:"M12 17.75l-6.172 3.245l1.179 -6.873l-5 -4.867l6.9 -1l3.086 -6.253l3.086 6.253l6.9 1l-5 4.867l1.179 6.873l-6.158 -3.245",key:"svg-0"}]],T_=De("outline","star","Star",__);const A_=[["path",{d:"M8 12a4 4 0 1 0 8 0a4 4 0 1 0 -8 0",key:"svg-0"}],["path",{d:"M3 12h1m8 -9v1m8 8h1m-9 8v1m-6.4 -15.4l.7 .7m12.1 -.7l-.7 .7m0 11.4l.7 .7m-12.1 -.7l-.7 .7",key:"svg-1"}]],Ey=De("outline","sun","Sun",A_);const C_=[["path",{d:"M8 9l3 3l-3 3",key:"svg-0"}],["path",{d:"M13 15l3 0",key:"svg-1"}],["path",{d:"M3 6a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2l0 -12",key:"svg-2"}]],Kh=De("outline","terminal-2","Terminal2",C_);const j_=[["path",{d:"M4 16l6 -7l5 5l5 -6",key:"svg-0"}],["path",{d:"M14 14a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-1"}],["path",{d:"M9 9a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-2"}],["path",{d:"M3 16a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-3"}],["path",{d:"M19 8a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-4"}]],R_=De("outline","timeline","Timeline",j_);const M_=[["path",{d:"M4 7l16 0",key:"svg-0"}],["path",{d:"M10 11l0 6",key:"svg-1"}],["path",{d:"M14 11l0 6",key:"svg-2"}],["path",{d:"M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12",key:"svg-3"}],["path",{d:"M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3",key:"svg-4"}]],kc=De("outline","trash","Trash",M_);const O_=[["path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2",key:"svg-0"}],["path",{d:"M7 9l5 -5l5 5",key:"svg-1"}],["path",{d:"M12 4l0 12",key:"svg-2"}]],D_=De("outline","upload","Upload",O_);const z_=[["path",{d:"M18 6l-12 12",key:"svg-0"}],["path",{d:"M6 6l12 12",key:"svg-1"}]],ta=De("outline","x","X",z_);const L_=[["path",{d:"M17 3.34a10 10 0 1 1 -14.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 14.995 -8.336zm-1.293 5.953a1 1 0 0 0 -1.32 -.083l-.094 .083l-3.293 3.292l-1.293 -1.292l-.094 -.083a1 1 0 0 0 -1.403 1.403l.083 .094l2 2l.094 .083a1 1 0 0 0 1.226 0l.094 -.083l4 -4l.083 -.094a1 1 0 0 0 -.083 -1.32z",key:"svg-0"}]],I_=De("filled","circle-check-filled","CircleCheckFilled",L_);const B_=[["path",{d:"M17 3.34a10 10 0 1 1 -14.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 14.995 -8.336zm-6.489 5.8a1 1 0 0 0 -1.218 1.567l1.292 1.293l-1.292 1.293l-.083 .094a1 1 0 0 0 1.497 1.32l1.293 -1.292l1.293 1.292l.094 .083a1 1 0 0 0 1.32 -1.497l-1.292 -1.293l1.292 -1.293l.083 -.094a1 1 0 0 0 -1.497 -1.32l-1.293 1.292l-1.293 -1.292l-.094 -.083z",key:"svg-0"}]],$_=De("filled","circle-x-filled","CircleXFilled",B_);const U_=[["path",{d:"M8.243 7.34l-6.38 .925l-.113 .023a1 1 0 0 0 -.44 1.684l4.622 4.499l-1.09 6.355l-.013 .11a1 1 0 0 0 1.464 .944l5.706 -3l5.693 3l.1 .046a1 1 0 0 0 1.352 -1.1l-1.091 -6.355l4.624 -4.5l.078 -.085a1 1 0 0 0 -.633 -1.62l-6.38 -.926l-2.852 -5.78a1 1 0 0 0 -1.794 0l-2.853 5.78z",key:"svg-0"}]],tv=De("filled","star-filled","StarFilled",U_);function nv({value:e,token:n,placeholder:r="~/repos (default)",helpText:l,onSave:s,inputClass:o}){const[u,f]=k.useState(e),[h,p]=k.useState(e),[g,x]=k.useState(!1),[y,v]=k.useState(null),[w,E]=k.useState(!1),[N,T]=k.useState(null),[R,j]=k.useState([]),[$,B]=k.useState(!1),[_,D]=k.useState(null),F=k.useRef(null);k.useEffect(()=>{f(e),p(e)},[e]),k.useEffect(()=>{if(!w)return;function G(z){F.current&&!F.current.contains(z.target)&&E(!1)}return document.addEventListener("mousedown",G),()=>document.removeEventListener("mousedown",G)},[w]);async function Y(){if(!(!n||u===h)){x(!0),v(null);try{await s(u),p(u)}catch(G){v(G instanceof Error?G.message:"Failed to save path")}finally{x(!1)}}}async function L(G){if(n){B(!0),D(null);try{const z=await M2(n,G);T(z.path),j(z.dirs),E(!0)}catch(z){D(z instanceof Error?z.message:"Failed to browse directory")}finally{B(!1)}}}function X(){if(!N)return;const G=N.replace(/\/[^/]+\/?$/,"")||"/";L(G)}function Z(G){const z=N==="/"?`/${G}`:`${N}/${G}`;L(z)}function te(){N&&(f(N),E(!1))}const J=o??"text-[13px]";return d.jsxs("div",{className:"relative",children:[d.jsx("label",{className:"mb-1.5 block text-neutral-5",style:{fontSize:o?void 0:"13px"},children:d.jsxs("span",{className:"flex items-center gap-1.5",children:[d.jsx(Xh,{size:13,className:"text-neutral-6"}),"Repositories Path"]})}),d.jsxs("div",{className:"flex gap-1.5",children:[d.jsx("input",{type:"text",value:u,onChange:G=>{f(G.target.value),v(null)},onBlur:()=>{Y()},onKeyDown:G=>{G.key==="Enter"&&Y()},placeholder:r,disabled:g,className:`flex-1 rounded border border-neutral-9 bg-neutral-10 px-3 py-2 ${J} font-mono text-neutral-3 outline-none focus:border-primary-7 disabled:opacity-50`}),d.jsx("button",{type:"button",onClick:()=>w?E(!1):void L(u||void 0),disabled:!n||$,className:"flex items-center gap-1 rounded border border-neutral-9 bg-neutral-10 px-2.5 py-2 text-[13px] text-neutral-4 hover:border-neutral-7 hover:text-neutral-3 disabled:opacity-50",title:"Browse folders",children:$?d.jsx("span",{className:"h-4 w-4 animate-spin rounded-full border-2 border-neutral-6 border-t-transparent"}):d.jsx(VN,{size:16})})]}),(y||_)&&d.jsx("p",{className:"mt-1 text-[12px] text-red-400",children:y||_}),l&&!y&&!_&&d.jsx("p",{className:"mt-1 text-[12px] text-neutral-6",children:l}),w&&N!==null&&d.jsxs("div",{ref:F,className:"absolute z-50 mt-1 w-full rounded-lg border border-neutral-8 bg-neutral-10 shadow-lg",children:[d.jsxs("div",{className:"flex items-center gap-2 border-b border-neutral-8 px-3 py-2",children:[d.jsx("button",{type:"button",onClick:X,className:"rounded p-0.5 text-neutral-5 hover:bg-neutral-8 hover:text-neutral-3",title:"Go up",children:d.jsx(pN,{size:14})}),d.jsx("span",{className:"flex-1 truncate font-mono text-[12px] text-neutral-4",children:N}),d.jsx("button",{type:"button",onClick:()=>E(!1),className:"rounded p-0.5 text-neutral-5 hover:bg-neutral-8 hover:text-neutral-3",children:d.jsx(ta,{size:14})})]}),d.jsx("div",{className:"max-h-48 overflow-y-auto py-1",children:R.length===0?d.jsx("p",{className:"px-3 py-2 text-[12px] text-neutral-6",children:"No subdirectories"}):R.map(G=>d.jsxs("button",{type:"button",onClick:()=>Z(G),className:"flex w-full items-center gap-2 px-3 py-1.5 text-left text-[13px] text-neutral-3 hover:bg-neutral-8",children:[d.jsx(Xh,{size:14,className:"shrink-0 text-neutral-5"}),d.jsx("span",{className:"truncate",children:G}),d.jsx(Ea,{size:12,className:"ml-auto shrink-0 text-neutral-6"})]},G))}),d.jsx("div",{className:"border-t border-neutral-8 px-3 py-2",children:d.jsx("button",{type:"button",onClick:te,className:"w-full rounded bg-primary-7 px-3 py-1.5 text-[13px] font-medium text-white hover:bg-primary-6",children:"Select this folder"})})]})]})}function eh({icon:e,title:n,children:r}){return d.jsxs("section",{className:"settings-section-card rounded-lg border border-neutral-9/60 bg-neutral-10/30",children:[d.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-b border-neutral-9/40",children:[d.jsx("span",{className:"text-neutral-5",children:e}),d.jsx("h3",{className:"text-[13px] font-semibold uppercase tracking-wide text-neutral-5",children:n})]}),d.jsx("div",{className:"px-4 py-4",children:r})]})}function H_({text:e}){const[n,r]=k.useState(!1),l=k.useCallback(()=>{navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),2e3)},[e]);return d.jsx("button",{onClick:l,className:"rounded p-1.5 text-neutral-5 hover:bg-neutral-9 hover:text-neutral-2 transition-colors",title:"Copy to clipboard",children:n?d.jsx(jl,{size:14,className:"text-success-6"}):d.jsx(X0,{size:14})})}function P_({status:e}){const n={completed:"bg-success-9/30 text-success-5",session_created:"bg-primary-9/30 text-primary-5",processing:"bg-yellow-900/30 text-yellow-500",error:"bg-error-9/30 text-error-5",filtered:"bg-neutral-9/50 text-neutral-5",duplicate:"bg-neutral-9/50 text-neutral-5",received:"bg-neutral-9/50 text-neutral-4"};return d.jsx("span",{className:`rounded px-1.5 py-0.5 text-[11px] font-medium ${n[e]||n.received}`,children:e.replace("_"," ")})}function F_({open:e,onClose:n,settings:r,onUpdate:l,isMobile:s=!1,autoWorktree:o=!1,onAutoWorktreeChange:u,agentName:f="Joe",onAgentNameChange:h}){const[p,g]=k.useState(r.token),[x,y]=k.useState(!1),[v,w]=k.useState("idle"),[E,N]=k.useState(7),[T,R]=k.useState(""),[j,$]=k.useState("wt/"),[B,_]=k.useState(!1),[D,F]=k.useState(null),[Y,L]=k.useState(null),[X,Z]=k.useState([]),[te,J]=k.useState(!1),[G,z]=k.useState(!1);if(k.useEffect(()=>{g(r.token),w("idle"),F(null)},[r.token,e]),k.useEffect(()=>{!e||!r.token||(I0(r.token).then(N).catch(()=>{}),$0(r.token).then(R).catch(()=>{}),C2(r.token).then($).catch(()=>{}),H0(r.token).then(_).catch(()=>{}),O2(r.token).then(L).catch(()=>{}),D2(r.token).then(Z).catch(()=>{}))},[e,r.token]),!e)return null;const V=`${location.protocol}//${location.host}/cc/api/webhooks/github`;async function ne(){if(p.trim()){y(!0),w("idle");try{const M=await b2(p.trim());w(M?"valid":"invalid"),M&&l({token:p.trim()})}catch{w("invalid")}finally{y(!1)}}}function be(){l({token:p.trim()}),n()}return d.jsx("div",{className:`fixed inset-0 z-50 flex bg-black/60 ${s?"items-end":"items-center justify-center"}`,children:d.jsxs("div",{className:`w-full bg-neutral-11 shadow-xl flex flex-col ${s?"max-h-[95vh] rounded-t-xl":"max-w-2xl rounded-lg border border-neutral-10 max-h-[85vh]"}`,children:[d.jsx("div",{className:"flex-shrink-0 px-6 pt-5 pb-4 border-b border-neutral-10",children:d.jsx("h2",{className:"text-[19px] font-semibold text-neutral-2",children:"Settings"})}),d.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-5 space-y-4",children:[d.jsxs(eh,{icon:d.jsx(QN,{size:15}),title:"Authentication",children:[d.jsx("label",{className:"mb-1 block text-[15px] text-neutral-4",children:"Claude Code Web Token"}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("input",{type:"password",value:p,onChange:M=>{g(M.target.value),w("idle")},placeholder:"Enter your auth token",className:"flex-1 rounded border border-neutral-9 bg-neutral-10 px-3 py-2 text-[15px] text-neutral-2 outline-none focus:border-primary-7",onKeyDown:M=>M.key==="Enter"&&ne()}),d.jsx("button",{onClick:ne,disabled:x||!p.trim(),className:"rounded bg-primary-8 px-3 py-2 text-[15px] font-medium text-neutral-1 hover:bg-primary-7 disabled:opacity-50",children:x?"...":"Verify"})]}),v==="valid"&&d.jsx("p",{className:"mt-1 text-[13px] text-success-6",children:"Token verified successfully"}),v==="invalid"&&d.jsx("p",{className:"mt-1 text-[13px] text-error-5",children:"Invalid token"})]}),d.jsx(eh,{icon:d.jsx(c_,{size:15}),title:"Preferences",children:d.jsxs("div",{className:"space-y-5",children:[d.jsxs("div",{children:[d.jsx("label",{className:"mb-1.5 block text-[15px] text-neutral-4",children:d.jsxs("span",{className:"flex items-center gap-1.5",children:[d.jsx(Ks,{size:14,className:"text-neutral-5"}),"Agent Name"]})}),d.jsx("div",{className:"flex items-center gap-2",children:d.jsx("input",{type:"text",value:f,onChange:M=>{const O=M.target.value;h?.(O)},onBlur:M=>{const O=M.target.value.trim();O&&O!==f&&by(r.token,O).then(I=>h?.(I)).catch(()=>F("Failed to save agent name"))},onKeyDown:M=>{if(M.key==="Enter"){const O=M.target.value.trim();O&&by(r.token,O).then(I=>h?.(I)).catch(()=>F("Failed to save agent name"))}},placeholder:"Joe",maxLength:30,className:"w-40 rounded border border-neutral-9 bg-neutral-10 px-3 py-2 text-[15px] text-neutral-2 outline-none focus:border-primary-7"})}),d.jsx("p",{className:"mt-1 text-[13px] text-neutral-6",children:"Display name for the orchestrator agent in the sidebar and chat"})]}),d.jsx("div",{className:"border-t border-neutral-9/40"}),d.jsxs("div",{className:"grid grid-cols-2 gap-x-6 gap-y-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:"mb-1.5 block text-[15px] text-neutral-4",children:"Theme"}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("button",{onClick:()=>l({theme:"dark"}),className:`rounded px-4 py-1.5 text-[15px] font-medium transition-colors ${r.theme!=="light"?"bg-primary-8 text-neutral-1":"border border-neutral-9 bg-neutral-10 text-neutral-3 hover:bg-neutral-9"}`,children:"Dark"}),d.jsx("button",{onClick:()=>l({theme:"light"}),className:`rounded px-4 py-1.5 text-[15px] font-medium transition-colors ${r.theme==="light"?"bg-primary-8 text-neutral-1":"border border-neutral-9 bg-neutral-10 text-neutral-3 hover:bg-neutral-9"}`,children:"Light"})]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-1.5 block text-[15px] text-neutral-4",children:d.jsxs("span",{className:"flex items-center gap-1.5",children:[d.jsx(eo,{size:14,className:"text-neutral-5"}),"Archived Session Retention"]})}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("input",{type:"number",min:1,max:365,value:E,onChange:M=>{const O=Math.max(1,Math.min(365,Number(M.target.value)));N(O),B0(r.token,O).catch(()=>F("Failed to save retention setting"))},className:"w-20 rounded border border-neutral-9 bg-neutral-10 px-3 py-2 text-[15px] text-neutral-2 outline-none focus:border-primary-7"}),d.jsx("span",{className:"text-[15px] text-neutral-5",children:"days"})]}),d.jsx("p",{className:"mt-1 text-[13px] text-neutral-6",children:"Auto-delete archived sessions older than this"})]})]}),d.jsx("div",{className:"border-t border-neutral-9/40"}),d.jsxs("div",{children:[d.jsxs("label",{className:"flex items-center gap-2.5 cursor-pointer group",children:[d.jsx("input",{type:"checkbox",checked:B,onChange:M=>{const O=M.target.checked;_(O),A2(r.token,O).catch(()=>F("Failed to save queue messages setting"))},className:"h-4 w-4 rounded border-neutral-7 bg-neutral-10 text-primary-7 accent-primary-7 cursor-pointer"}),d.jsx("span",{className:"text-[15px] text-neutral-4 group-hover:text-neutral-3 transition-colors",children:"Queue messages across sessions"})]}),d.jsx("p",{className:"mt-1 ml-[26px] text-[13px] text-neutral-6",children:"When enabled, messages sent while another session for the same repo is processing will be queued and sent automatically when it finishes."})]}),d.jsx("div",{className:"border-t border-neutral-9/40"}),d.jsxs("div",{className:"space-y-4",children:[d.jsx(nv,{value:T,token:r.token,placeholder:"~/repos (default)",helpText:"Absolute path to your locally cloned repositories. Leave empty to use the server default.",inputClass:"text-[15px]",onSave:async M=>{await U0(r.token,M),R(M)}}),d.jsxs("div",{children:[d.jsxs("label",{className:"flex items-center gap-2.5 cursor-pointer group",children:[d.jsx("input",{type:"checkbox",checked:o,onChange:M=>u?.(M.target.checked),className:"h-4 w-4 rounded border-neutral-7 bg-neutral-10 text-primary-7 accent-primary-7 cursor-pointer"}),d.jsxs("span",{className:"flex items-center gap-1.5 text-[15px] text-neutral-4 group-hover:text-neutral-3 transition-colors",children:[d.jsx(nl,{size:14,className:"text-neutral-5"}),"Auto-enable worktrees for new sessions"]})]}),d.jsx("p",{className:"mt-1 ml-[26px] text-[13px] text-neutral-6",children:"When enabled, new sessions will automatically start in a git worktree"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"mb-1.5 block text-[15px] text-neutral-4",children:"Worktree Branch Prefix"}),d.jsx("div",{className:"flex items-center gap-2",children:d.jsx("input",{type:"text",value:j,onChange:M=>{const O=M.target.value;$(O),j2(r.token,O).catch(()=>F("Failed to save worktree prefix"))},placeholder:"wt/",className:"w-40 rounded border border-neutral-9 bg-neutral-10 px-3 py-2 text-[15px] text-neutral-2 outline-none focus:border-primary-7"})}),d.jsx("p",{className:"mt-1 text-[13px] text-neutral-6",children:"Prefix for worktree branch names (e.g. wt/ → wt/abc12345)"})]})]})]})}),d.jsxs(eh,{icon:d.jsx(vN,{size:15}),title:"GitHub Webhooks",children:[d.jsx("div",{className:"flex items-center gap-2 mb-3",children:Y?Y.enabled?d.jsxs(d.Fragment,{children:[d.jsx(I_,{size:16,className:"text-success-6"}),d.jsx("span",{className:"text-[15px] text-success-5 font-medium",children:"Active"}),d.jsxs("span",{className:"text-[13px] text-neutral-6",children:["· max ",Y.maxConcurrentSessions," concurrent sessions"]})]}):d.jsxs(d.Fragment,{children:[d.jsx($_,{size:16,className:"text-neutral-6"}),d.jsx("span",{className:"text-[15px] text-neutral-5",children:"Disabled"})]}):d.jsx("span",{className:"text-[13px] text-neutral-6",children:"Loading..."})}),d.jsx("p",{className:"text-[13px] text-neutral-5 mb-3",children:"Automatically create Claude sessions to diagnose and fix CI failures. When a GitHub Actions workflow fails, a webhook triggers Codekin to analyze logs, identify the issue, and propose a fix."}),d.jsxs("div",{className:"mb-3",children:[d.jsx("label",{className:"mb-1 block text-[12px] font-medium text-neutral-5 uppercase tracking-wide",children:"Webhook URL"}),d.jsxs("div",{className:"flex items-center gap-1 rounded border border-neutral-9 bg-neutral-10 px-3 py-2",children:[d.jsx("code",{className:"flex-1 text-[13px] text-neutral-3 font-mono truncate select-all",children:V}),d.jsx(H_,{text:V})]})]}),d.jsxs("button",{onClick:()=>J(!te),className:"flex items-center gap-1.5 text-[13px] text-primary-6 hover:text-primary-5 mb-2 transition-colors",children:[te?d.jsx(jr,{size:14}):d.jsx(Ea,{size:14}),"Setup instructions"]}),te&&d.jsxs("div",{className:"rounded border border-neutral-9 bg-neutral-10/50 px-4 py-3 mb-3 text-[13px] text-neutral-4 space-y-2.5",children:[d.jsxs("div",{className:"flex gap-2",children:[d.jsx("span",{className:"text-primary-6 font-semibold shrink-0",children:"1."}),d.jsxs("span",{children:["In your GitHub repo, go to ",d.jsx("strong",{className:"text-neutral-3",children:"Settings → Webhooks → Add webhook"})]})]}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("span",{className:"text-primary-6 font-semibold shrink-0",children:"2."}),d.jsxs("span",{children:["Set ",d.jsx("strong",{className:"text-neutral-3",children:"Payload URL"})," to the webhook URL above. Set ",d.jsx("strong",{className:"text-neutral-3",children:"Content type"})," to ",d.jsx("code",{className:"text-neutral-3 bg-neutral-9/50 px-1 rounded",children:"application/json"})]})]}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("span",{className:"text-primary-6 font-semibold shrink-0",children:"3."}),d.jsxs("span",{children:["Set a ",d.jsx("strong",{className:"text-neutral-3",children:"Secret"})," matching the server's ",d.jsx("code",{className:"text-neutral-3 bg-neutral-9/50 px-1 rounded",children:"GITHUB_WEBHOOK_SECRET"})," env var"]})]}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("span",{className:"text-primary-6 font-semibold shrink-0",children:"4."}),d.jsxs("span",{children:["Under ",d.jsx("strong",{className:"text-neutral-3",children:"“Which events?”"}),", select ",d.jsx("strong",{className:"text-neutral-3",children:"Let me select individual events"})," and check ",d.jsx("strong",{className:"text-neutral-3",children:"Workflow runs"})]})]}),d.jsxs("p",{className:"text-[13px] text-neutral-6 pt-1 border-t border-neutral-9/50",children:["Failed workflow runs will automatically spawn a ",d.jsx(Ks,{size:12,className:"inline -mt-0.5"})," session that analyzes logs and proposes fixes."]})]}),X.length>0&&d.jsxs(d.Fragment,{children:[d.jsxs("button",{onClick:()=>z(!G),className:"flex items-center gap-1.5 text-[13px] text-primary-6 hover:text-primary-5 transition-colors",children:[G?d.jsx(jr,{size:14}):d.jsx(Ea,{size:14}),"Recent events (",X.length,")"]}),G&&d.jsx("div",{className:"mt-2 rounded border border-neutral-9 bg-neutral-10/50 divide-y divide-neutral-9/50 max-h-48 overflow-y-auto",children:X.slice(0,10).map(M=>d.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 text-[12px]",children:[d.jsx(Ks,{size:13,className:"text-neutral-6 shrink-0"}),d.jsx("span",{className:"text-neutral-3 font-mono truncate flex-1",children:M.repo}),d.jsx("span",{className:"text-neutral-5 truncate max-w-24",children:M.workflow}),d.jsx(P_,{status:M.status})]},M.id))})]}),Y&&!Y.enabled&&d.jsxs("p",{className:"mt-3 text-[13px] text-neutral-6",children:["Set ",d.jsx("code",{className:"bg-neutral-9/50 px-1 rounded text-neutral-4",children:"GITHUB_WEBHOOK_ENABLED=true"})," and ",d.jsx("code",{className:"bg-neutral-9/50 px-1 rounded text-neutral-4",children:"GITHUB_WEBHOOK_SECRET"})," on the server to enable."]})]})]}),d.jsxs("div",{className:"flex-shrink-0 px-6 py-4 border-t border-neutral-10 flex items-center justify-between",children:[d.jsx("div",{children:D&&d.jsx("p",{className:"text-[13px] text-error-5",children:D})}),d.jsxs("div",{className:"flex gap-2",children:[r.token&&d.jsx("button",{onClick:n,className:"rounded px-4 py-2 text-[15px] text-neutral-6 hover:text-neutral-2",children:"Cancel"}),d.jsx("button",{onClick:be,disabled:!p.trim(),className:"rounded bg-primary-8 px-4 py-2 text-[15px] font-medium text-neutral-1 hover:bg-primary-7 disabled:opacity-50",children:"Save"})]})]})]})})}function Zh({size:e=24,className:n=""}){return d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:n,children:[d.jsx("circle",{cx:"12",cy:"12",r:"2.5"}),d.jsx("circle",{cx:"12",cy:"12",r:"0.75",fill:"currentColor",stroke:"none"}),d.jsx("path",{d:"M8 20.1a9 9 0 0 1 -5 -7.1"}),d.jsx("path",{d:"M16 20.1a9 9 0 0 0 5 -7.1"}),d.jsx("path",{d:"M6.2 5a9 9 0 0 1 11.4 0"}),d.jsx("circle",{cx:"12",cy:"21",r:"1",fill:"currentColor",stroke:"none"}),d.jsx("circle",{cx:"3",cy:"9",r:"1",fill:"currentColor",stroke:"none"}),d.jsx("circle",{cx:"21",cy:"9",r:"1",fill:"currentColor",stroke:"none"})]})}function Rp({groups:e,selectedId:n,onSelect:r,cloningId:l,maxHeight:s="240px",autoFocus:o}){const[u,f]=k.useState(""),h=k.useRef(null);k.useEffect(()=>{o&&h.current?.focus()},[o]);const p=u.trim()?e.map(x=>({...x,repos:x.repos.filter(y=>y.name.toLowerCase().includes(u.toLowerCase())||y.description?.toLowerCase().includes(u.toLowerCase()))})).filter(x=>x.repos.length>0):e;return e.reduce((x,y)=>x+y.repos.length,0)===0?d.jsx("p",{className:"text-center text-[15px] text-neutral-6 py-2",children:"No repositories available"}):d.jsxs(d.Fragment,{children:[d.jsx("input",{ref:h,type:"text",value:u,onChange:x=>f(x.target.value),placeholder:"Search repos…",className:"mb-2 w-full rounded-lg border border-neutral-7 bg-neutral-11/50 px-3 py-2 text-[15px] text-neutral-2 placeholder-neutral-5 focus:border-accent-6 focus:outline-none"}),d.jsx("div",{className:"overflow-y-auto rounded-lg border border-neutral-7 bg-neutral-11/50",style:{maxHeight:s},children:p.length===0?d.jsx("p",{className:"px-3 py-3 text-[13px] text-neutral-5 text-center",children:"No matching repos"}):p.map(x=>d.jsxs("div",{children:[d.jsx("div",{className:"sticky top-0 z-10 bg-neutral-8 backdrop-blur-sm px-3 py-1.5 text-[13px] font-medium uppercase tracking-wider text-neutral-4 border-b border-neutral-7",children:x.owner}),x.repos.map(y=>{const v=l===y.id,w=n===y.id;return d.jsxs("button",{type:"button",onClick:()=>r(y),disabled:!!l,className:`group flex w-full items-start gap-3 border-b border-neutral-7/50 px-3 py-2.5 text-left transition last:border-b-0 ${w?"bg-accent-9/20 border-l-2 border-l-accent-6":l?"cursor-wait opacity-60":"hover:bg-neutral-7/20"}`,children:[d.jsx("div",{className:"mt-0.5 flex-shrink-0 text-neutral-4 group-hover:text-neutral-3 transition-colors",children:y.cloned?d.jsx(nl,{size:16,stroke:1.5}):d.jsx(DN,{size:16,stroke:1.5})}),d.jsxs("div",{className:"min-w-0 flex-1",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-[15px] font-medium text-neutral-2 group-hover:text-neutral-1 transition-colors truncate",children:y.name}),v&&d.jsx("span",{className:"flex-shrink-0 rounded bg-primary-9/30 px-1.5 py-0.5 text-[13px] text-primary-4 animate-pulse",children:"cloning..."}),!y.cloned&&!v&&d.jsx("span",{className:"flex-shrink-0 rounded border border-neutral-6 bg-neutral-8/50 px-1.5 py-0.5 text-[13px] text-neutral-3",children:"remote"})]}),y.description&&d.jsx("div",{className:"mt-0.5 text-[13px] text-neutral-6 truncate",children:y.description})]})]},y.id)})]},x.owner))})]})}function G_({groups:e,token:n,onOpen:r}){const[l,s]=k.useState(!1),[o,u]=k.useState(null),f=k.useRef(null),h=k.useRef(null);k.useLayoutEffect(()=>{if(!l||!f.current||!h.current)return;const g=f.current.getBoundingClientRect(),x=h.current,y=288,v=g.bottom+6,w=Math.max(8,Math.min(g.right-y,window.innerWidth-y-8));x.style.top=`${v}px`,x.style.left=`${w}px`},[l]),k.useEffect(()=>{if(!l)return;function g(y){y.key==="Escape"&&s(!1)}function x(y){const v=y.target;f.current&&!f.current.contains(v)&&h.current&&!h.current.contains(v)&&s(!1)}return document.addEventListener("keydown",g),document.addEventListener("mousedown",x),()=>{document.removeEventListener("keydown",g),document.removeEventListener("mousedown",x)}},[l]);async function p(g){if(!o){if(!g.cloned){u(g.id);try{const x={"Content-Type":"application/json"};n&&(x.Authorization=`Bearer ${n}`);const y=await fetch("/cc/api/clone",{method:"POST",headers:x,body:JSON.stringify({owner:g.owner,name:g.name})});if(!y.ok){const v=await y.json();throw new Error(v.error||"Clone failed")}g.cloned=!0}catch{u(null);return}u(null)}s(!1),r(g)}}return d.jsxs("div",{ref:f,className:"relative h-full flex items-center",children:[d.jsx("button",{onClick:()=>s(!l),className:`app-new-session-btn rounded p-1.5 transition ${l?"bg-neutral-6 text-neutral-1":"text-neutral-3 hover:bg-neutral-6 hover:text-neutral-1"}`,title:"New session",children:d.jsx(to,{size:16,stroke:2})}),l&&d.jsxs("div",{ref:h,className:"fixed z-50 w-72 rounded-md border border-neutral-10 bg-neutral-12 shadow-lg",children:[d.jsxs("div",{className:"px-3 pt-3 pb-1",children:[d.jsx("h3",{className:"text-[15px] font-medium text-neutral-3",children:"New Session"}),d.jsx("p",{className:"mt-0.5 text-[13px] text-neutral-6",children:"Choose a repository to work on"})]}),d.jsx("div",{className:"px-2 pb-2",children:d.jsx(Rp,{groups:e,onSelect:p,cloningId:o,maxHeight:"240px",autoFocus:!0})})]})]})}function q_({token:e,workingDir:n,visible:r}){const[l,s]=k.useState(null),[o,u]=k.useState(!1),[f,h]=k.useState(!1);if(k.useEffect(()=>{if(!r||!n||!e)return;let y=!1;return u(!0),h(!1),Ms(e,n).then(v=>{y||s(v)}).catch(()=>{y||(s(null),h(!0))}).finally(()=>{y||u(!1)}),()=>{y=!0}},[r,n,e]),!r)return null;async function p(y){if(!(!n||!e))try{await N2(e,n,y);const v=await Ms(e,n);s(v)}catch{Ms(e,n).then(s).catch(()=>{})}}async function g(y){if(!(!n||!e||y.length===0))try{await _2(e,n,y);const v=await Ms(e,n);s(v)}catch{Ms(e,n).then(s).catch(()=>{})}}if(!n)return d.jsx("div",{className:"border-t border-neutral-8/30 px-3 py-3",children:d.jsx("p",{className:"text-[13px] text-neutral-5",children:"Select a session to manage approvals."})});if(o)return d.jsx("div",{className:"border-t border-neutral-8/30 px-3 py-3",children:d.jsx("p",{className:"text-[13px] text-neutral-5",children:"Loading..."})});if(f||!l)return d.jsx("div",{className:"border-t border-neutral-8/30 px-3 py-3",children:d.jsx("p",{className:"text-[13px] text-neutral-5",children:"Could not load approvals."})});const x=n.split("/").pop()||n;return d.jsx("div",{className:"border-t border-neutral-8/30 flex flex-col min-h-0",children:d.jsxs("div",{className:"ml-3 border-l border-neutral-7/30 flex flex-col min-h-0",children:[d.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 flex-shrink-0",children:[d.jsx("span",{className:"text-[13px] font-medium text-neutral-5 uppercase tracking-wider flex-shrink-0",children:"Approvals"}),d.jsx("span",{className:"text-[12px] font-mono text-neutral-6 truncate",title:n,children:x})]}),d.jsx(Y_,{approvals:l,onRemove:p,onRevokeMultiple:g})]})})}function Y_({approvals:e,onRemove:n,onRevokeMultiple:r}){const[l,s]=k.useState(new Set(["__tools__","__commands__","__patterns__"])),o=e.tools.length+e.commands.length+e.patterns.length,u=o===0;function f(E){s(N=>{const T=new Set(N);return T.has(E)?T.delete(E):T.add(E),T})}const h=k.useMemo(()=>[...e.tools].sort(),[e.tools]),p=k.useMemo(()=>[...e.patterns??[]].sort(),[e.patterns]),g=k.useMemo(()=>V_(e.commands),[e.commands]),x=Object.entries(g),y=h.length>0,v=p.length>0,w=x.length>0;return d.jsxs(d.Fragment,{children:[!u&&d.jsx("div",{className:"flex-shrink-0 px-3 pb-1.5",children:d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("span",{className:"text-[13px] text-neutral-5",children:[o," rule",o!==1?"s":""]}),d.jsx("button",{onClick:()=>{const E=[...e.tools.map(N=>({tool:N})),...e.commands.map(N=>({command:N})),...(e.patterns??[]).map(N=>({pattern:N}))];confirm(`Revoke all ${o} approval rules?`)&&r(E)},className:"text-[13px] text-neutral-5 hover:text-error-5 transition-colors",children:"Revoke All"})]})}),d.jsxs("div",{className:"overflow-y-auto min-h-0 flex-1 px-2 py-1 approvals-scroll",children:[!y&&!v&&!w&&d.jsx("p",{className:"text-[13px] text-neutral-6 py-2 text-center",children:"No auto-approval rules yet."}),d.jsxs("div",{className:"space-y-2",children:[v&&d.jsx(th,{title:"Patterns",count:p.length,collapsed:l.has("__patterns__"),onToggle:()=>f("__patterns__"),onRevokeAll:()=>{confirm(`Revoke all ${p.length} pattern approvals?`)&&r(p.map(E=>({pattern:E})))},children:d.jsx("ul",{className:"space-y-0.5",children:p.map(E=>d.jsxs("li",{className:"group flex items-center justify-between rounded-md px-2 py-1 text-[13px] text-neutral-3 hover:bg-neutral-6/50 hover:text-neutral-1 transition-colors",children:[d.jsx("code",{className:"truncate font-mono",children:E}),d.jsx("button",{onClick:()=>n({pattern:E}),className:"ml-2 flex-shrink-0 text-neutral-5 opacity-0 group-hover:opacity-100 hover:text-error-5 transition-all",children:"×"})]},E))})}),y&&d.jsx(th,{title:"Tools",count:h.length,collapsed:l.has("__tools__"),onToggle:()=>f("__tools__"),onRevokeAll:()=>{confirm(`Revoke all ${h.length} tool approvals?`)&&r(h.map(E=>({tool:E})))},children:d.jsx("ul",{className:"space-y-0.5",children:h.map(E=>d.jsxs("li",{className:"group flex items-center justify-between rounded-md px-2 py-1 text-[13px] text-neutral-3 hover:bg-neutral-6/50 hover:text-neutral-1 transition-colors",children:[d.jsx("span",{className:"truncate",children:E}),d.jsx("button",{onClick:()=>n({tool:E}),className:"ml-2 flex-shrink-0 text-neutral-5 opacity-0 group-hover:opacity-100 hover:text-error-5 transition-all",children:"×"})]},E))})}),w&&d.jsx(th,{title:"Commands",count:e.commands.length,collapsed:l.has("__commands__"),onToggle:()=>f("__commands__"),onRevokeAll:()=>{const E=e.commands;confirm(`Revoke all ${E.length} command approvals?`)&&r(E.map(N=>({command:N})))},children:d.jsx("div",{className:"space-y-1.5",children:x.map(([E,N])=>d.jsx(X_,{prefix:E,commands:N,collapsed:l.has(`cmd:${E}`),onToggle:()=>f(`cmd:${E}`),onRemove:T=>n({command:T}),onRevokeAll:()=>{confirm(`Revoke all ${N.length} "${E}" approvals?`)&&r(N.map(T=>({command:T})))}},E))})})]})]})]})}function V_(e){const n={};for(const l of e){const s=l.split(/\s+/)[0]||"other";n[s]||(n[s]=[]),n[s].push(l)}const r={};for(const l of Object.keys(n).sort())r[l]=n[l].sort();return r}function th({title:e,count:n,collapsed:r,onToggle:l,onRevokeAll:s,children:o}){return d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center justify-between mb-1",children:[d.jsxs("button",{onClick:l,className:"flex items-center gap-1.5 text-[15px] text-neutral-4 hover:text-neutral-2 transition-colors",children:[d.jsx("svg",{className:`w-2.5 h-2.5 transition-transform flex-shrink-0 ${r?"":"rotate-90"}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})}),d.jsx("span",{className:"font-medium",children:e}),d.jsx("span",{className:"text-[13px] text-neutral-5",children:n})]}),!r&&n>1&&d.jsx("button",{onClick:s,className:"text-[13px] text-neutral-5 hover:text-error-5 transition-colors",children:"revoke all"})]}),!r&&o]})}function X_({prefix:e,commands:n,collapsed:r,onToggle:l,onRemove:s,onRevokeAll:o}){return n.length===1?d.jsxs("div",{className:"group flex items-center justify-between rounded-md px-2 py-1 hover:bg-neutral-6/50 transition-colors",children:[d.jsxs("code",{className:"truncate font-mono text-[13px] text-neutral-3",title:n[0],children:["$ ",n[0]]}),d.jsx("button",{onClick:()=>s(n[0]),className:"ml-2 flex-shrink-0 text-neutral-5 opacity-0 group-hover:opacity-100 hover:text-error-5 transition-all",children:"×"})]}):d.jsxs("div",{className:"rounded-md overflow-hidden",children:[d.jsxs("div",{className:"flex items-center justify-between px-2 py-0.5",children:[d.jsxs("button",{onClick:l,className:"flex items-center gap-1 text-[13px] text-neutral-4 hover:text-neutral-2 transition-colors",children:[d.jsx("svg",{className:`w-2 h-2 transition-transform flex-shrink-0 ${r?"":"rotate-90"}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})}),d.jsx("code",{className:"font-mono font-medium",children:e}),d.jsx("span",{className:"text-[13px] text-neutral-5",children:n.length})]}),!r&&d.jsx("button",{onClick:o,className:"text-[13px] text-neutral-5 hover:text-error-5 transition-colors",children:"revoke all"})]}),!r&&d.jsx("ul",{className:"pl-3",children:n.map(u=>d.jsxs("li",{className:"group flex items-center justify-between rounded-md px-2 py-1 hover:bg-neutral-6/50 transition-colors",children:[d.jsxs("code",{className:"truncate font-mono text-[13px] text-neutral-3",title:u,children:["$ ",u]}),d.jsx("button",{onClick:()=>s(u),className:"ml-2 flex-shrink-0 text-neutral-5 opacity-0 group-hover:opacity-100 hover:text-error-5 transition-all",children:"×"})]},u))})]})}function K_({files:e,loading:n,starredDocs:r,onSelect:l,onClose:s}){const[o,u]=k.useState(""),f=k.useRef(null);k.useEffect(()=>{function w(E){E.key==="Escape"&&s()}return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[s]);const h=new Set(r),p=o.trim()?e.filter(w=>w.path.toLowerCase().includes(o.toLowerCase())):e,g=p.filter(w=>h.has(w.path)),x=p.filter(w=>w.pinned&&!h.has(w.path)),y=p.filter(w=>!w.pinned&&!h.has(w.path)),v=(g.length>0?1:0)+(x.length>0?1:0)+(y.length>0?1:0)>1;return d.jsx("div",{ref:f,className:"mt-1 border-t border-neutral-8/30 pt-1",children:n?d.jsx("div",{className:"flex items-center justify-center py-3",children:d.jsx(Ur,{size:14,className:"animate-spin text-neutral-5"})}):e.length===0?d.jsx("div",{className:"pl-10 pr-2 py-1 text-[13px] text-neutral-5",children:"No markdown files found"}):d.jsxs(d.Fragment,{children:[e.length>5&&d.jsx("div",{className:"px-2 pb-1",children:d.jsx("input",{type:"text",value:o,onChange:w=>u(w.target.value),placeholder:"Filter docs...",autoFocus:!0,className:"w-full rounded border border-neutral-7 bg-neutral-10/50 px-2 py-1 text-[13px] text-neutral-2 placeholder-neutral-5 focus:border-accent-6 focus:outline-none"})}),d.jsx("div",{className:"overflow-y-auto",style:{maxHeight:"320px"},children:p.length===0?d.jsx("div",{className:"pl-10 pr-2 py-1 text-[13px] text-neutral-5",children:"No matching files"}):d.jsxs(d.Fragment,{children:[g.map(w=>d.jsxs("button",{onClick:()=>l(w.path),className:"group w-full flex items-center gap-2 pl-10 pr-2 py-1 text-left text-[15px] text-neutral-2 font-medium hover:bg-neutral-6/50 hover:text-neutral-1 transition-colors cursor-pointer rounded-md",children:[d.jsx(tv,{size:13,className:"flex-shrink-0 text-primary-5"}),d.jsx("span",{className:"flex-1 truncate",children:w.path})]},w.path)),g.length>0&&v&&d.jsx("div",{className:"border-t border-neutral-8/30 my-0.5 mx-10"}),x.map(w=>d.jsxs("button",{onClick:()=>l(w.path),className:"group w-full flex items-center gap-2 pl-10 pr-2 py-1 text-left text-[15px] text-neutral-2 font-medium hover:bg-neutral-6/50 hover:text-neutral-1 transition-colors cursor-pointer rounded-md",children:[d.jsx(Vh,{size:13,className:"flex-shrink-0 text-neutral-5"}),d.jsx("span",{className:"flex-1 truncate",children:w.path})]},w.path)),x.length>0&&y.length>0&&d.jsx("div",{className:"border-t border-neutral-8/30 my-0.5 mx-10"}),y.map(w=>d.jsxs("button",{onClick:()=>l(w.path),className:"group w-full flex items-center gap-2 pl-10 pr-2 py-1 text-left text-[15px] text-neutral-4 hover:bg-neutral-6/50 hover:text-neutral-2 transition-colors cursor-pointer rounded-md",children:[d.jsx(Vh,{size:13,className:"flex-shrink-0 text-neutral-6"}),d.jsx("span",{className:"flex-1 truncate",children:w.path})]},w.path))]})})]})})}const Ny=5;function Z_({session:e}){if(!e.worktreePath)return null;const n=e.worktreePath.split("/").pop()??e.worktreePath;return d.jsx("span",{title:`Worktree: ${n}`,className:"flex-shrink-0 text-primary-6",children:d.jsx(nl,{size:12,stroke:2})})}function _y(e){const n=e.name||e.id.slice(0,8);return n.startsWith("hub:")?"new session":n}function Q_(e){const n=e.name||e.id.slice(0,8);return n.startsWith("hub:")?"unnamed session":n}function W_(e){const n=Math.floor((Date.now()-new Date(e).getTime())/1e3);if(n<60)return`${n}s`;const r=Math.floor(n/60);if(r<60)return`${r}m`;const l=Math.floor(r/60);return l<24?`${l}h`:`${Math.floor(l/24)}d`}function J_(e){return!e.includes("T")&&!e.includes("Z")&&!e.includes("+")?new Date(e.replace(" ","T")+"Z"):new Date(e)}function eT(e){const n=Math.floor((Date.now()-J_(e).getTime())/1e3);if(n<60)return`${n}s`;const r=Math.floor(n/60);if(r<60)return`${r}m`;const l=Math.floor(r/60);return l<24?`${l}h`:`${Math.floor(l/24)}d`}function tT({node:e,isActive:n,activeSessionId:r,waitingSessions:l,tentativeQueues:s,token:o,archiveRefreshKey:u,onSelectSession:f,onDeleteSession:h,onRenameSession:p,onNewSession:g,onSelectRepo:x,onDeleteRepo:y,onViewArchivedSession:v,onBrowseDocs:w,docsPickerOpen:E,docsPickerRepoDir:N,docsPickerFiles:T,docsPickerLoading:R,onDocsPickerSelect:j,onDocsPickerClose:$,docsStarredDocs:B,isMobile:_}){const[D,F]=k.useState(n||!!_),[Y,L]=k.useState(!1),[X,Z]=k.useState(!1),[te,J]=k.useState(!1),[G,z]=k.useState([]),[V,ne]=k.useState(null),[be,M]=k.useState("");k.useEffect(()=>{n&&F(!0)},[n]),k.useEffect(()=>{!X||!o||L0(o,e.workingDir).then(z).catch(()=>{})},[X,o,e.workingDir,u]);const[O,I]=e.hasTentative?["bg-accent-6 animate-pulse","Queued"]:e.hasWaiting?["bg-warning-5 animate-pulse","Waiting for input"]:e.hasActive?["bg-success-6 animate-pulse","Processing"]:["bg-neutral-6","Idle"],A=te?G:G.slice(0,Ny),oe=G.length>Ny,le=pe=>{ne(pe.id),M(_y(pe))},he=()=>{V&&be.trim()&&p(V,be.trim()),ne(null)};return d.jsxs("div",{className:"group/repo",children:[d.jsxs("div",{className:"group flex items-center gap-1.5 px-2 py-1",children:[d.jsxs("button",{onClick:()=>{F(!D),n||x(e.workingDir)},className:"flex flex-1 items-center gap-2 min-w-0 rounded px-2 py-0.5 text-left transition-colors text-neutral-3 hover:text-neutral-2",children:[D?d.jsx(jr,{size:14,stroke:2.5,className:"flex-shrink-0 text-neutral-5 opacity-0 group-hover/repo:opacity-100 transition-opacity"}):d.jsx(Ea,{size:14,stroke:2.5,className:"flex-shrink-0 text-neutral-5 opacity-0 group-hover/repo:opacity-100 transition-opacity"}),d.jsx("span",{className:`inline-block h-1.5 w-1.5 rounded-full flex-shrink-0 ${O}`,title:I}),d.jsx("span",{className:`truncate font-semibold tracking-wide ${_?"text-[17px]":"text-[15px]"}`,children:e.displayName}),!D&&e.sessions.length>1&&d.jsxs("span",{className:"text-[12px] text-neutral-6 flex-shrink-0",children:["(",e.sessions.length,")"]})]}),w&&d.jsx("button",{onClick:pe=>{pe.stopPropagation(),w(e.workingDir)},className:`flex-shrink-0 rounded p-0.5 transition-colors opacity-0 group-hover:opacity-100 ${E&&N===e.workingDir?"text-primary-5 opacity-100!":"text-neutral-5 hover:text-neutral-2"}`,title:"Browse docs",children:d.jsx(Vh,{size:14,stroke:2})}),d.jsx("button",{onClick:()=>L(!Y),className:`flex-shrink-0 rounded p-0.5 transition-colors opacity-0 group-hover:opacity-100 ${Y?"text-primary-5 opacity-100!":"text-neutral-5 hover:text-neutral-2"}`,title:"Repo approvals",children:d.jsx(J0,{size:16,stroke:2})}),d.jsx("button",{onClick:()=>Z(!X),className:`flex-shrink-0 rounded p-0.5 transition-colors opacity-0 group-hover:opacity-100 ${X?"text-primary-5 opacity-100!":"text-neutral-5 hover:text-neutral-2"}`,title:"Archived sessions",children:d.jsx(eo,{size:16,stroke:2})}),d.jsx("span",{onClick:pe=>{pe.stopPropagation(),y(e.workingDir)},className:"cursor-pointer text-[15px] text-transparent hover:text-error-5 group-hover:text-neutral-6 flex-shrink-0 px-0.5",children:"×"})]}),D&&d.jsxs("div",{className:"px-2 pb-1",children:[e.sessions.map(pe=>{const Ae=pe.id===r,Re=(s[pe.id]?.length??0)>0,[qe,pt]=Re?["bg-accent-6 animate-pulse","Queued"]:l[pe.id]?["bg-warning-5 animate-pulse","Waiting for input"]:pe.isProcessing?["bg-success-6 animate-pulse","Processing"]:pe.active?["bg-neutral-5","Idle"]:["bg-neutral-7","Inactive"],St=V===pe.id;return d.jsxs("div",{onClick:()=>{St||f(pe.id)},className:`group w-full flex items-baseline gap-2 pl-10 pr-2 py-1 text-left ${_?"text-[17px]":"text-[15px]"} transition-colors rounded-md cursor-pointer ${Ae?"bg-accent-9/30 text-accent-2":"text-neutral-3 hover:bg-neutral-6/50 hover:text-neutral-1"}`,children:[pe.source==="workflow"?d.jsx(ev,{size:12,className:`flex-shrink-0 self-center ${qe.replace(/bg-/g,"text-")}`,title:pt}):pe.source==="webhook"?d.jsx(Ks,{size:12,className:`flex-shrink-0 self-center ${qe.replace(/bg-/g,"text-")}`,title:pt}):pe.source==="orchestrator"||pe.source==="agent"?d.jsx(Cl,{size:12,className:`flex-shrink-0 self-center ${qe.replace(/bg-/g,"text-")}`,title:pt}):d.jsx("span",{className:"inline-flex items-center justify-center w-[12px] flex-shrink-0 self-center",title:pt,children:d.jsx("span",{className:`inline-block h-1.5 w-1.5 rounded-full ${qe}`})}),St?d.jsx("input",{autoFocus:!0,value:be,onChange:Ge=>M(Ge.target.value),onBlur:he,onKeyDown:Ge=>{Ge.key==="Enter"&&he(),Ge.key==="Escape"&&ne(null)},onClick:Ge=>Ge.stopPropagation(),className:"flex-1 min-w-0 bg-neutral-10 border border-neutral-7 rounded px-1 py-0 text-[15px] text-neutral-1 outline-none focus:border-primary-6"}):d.jsxs("span",{className:"flex-1 truncate font-normal flex items-center gap-1",children:[d.jsx(Z_,{session:pe}),_y(pe)]}),!St&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"text-[13px] text-neutral-6 tabular-nums flex-shrink-0",children:W_(pe.created)}),d.jsx("span",{onClick:Ge=>{Ge.stopPropagation(),le(pe)},className:"cursor-pointer flex-shrink-0 text-transparent group-hover:text-neutral-5 hover:text-neutral-2! transition-colors",title:"Rename session",children:d.jsx(jp,{size:13,stroke:2})}),d.jsx("span",{onClick:Ge=>{Ge.stopPropagation(),h(pe.id)},className:"cursor-pointer text-[15px] text-transparent hover:text-error-5 group-hover:text-neutral-6 flex-shrink-0",children:"×"})]})]},pe.id)}),g&&d.jsx("div",{className:"pl-10 opacity-0 group-hover/repo:opacity-100",children:d.jsxs("button",{onClick:g,className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-md text-[13px] text-neutral-5 hover:text-neutral-2 hover:bg-neutral-6/50 transition-colors",children:[d.jsx(to,{size:12,stroke:2,className:"flex-shrink-0"}),d.jsx("span",{children:"New session"})]})}),E&&N===e.workingDir&&j&&$&&d.jsx(K_,{files:T??[],loading:R??!1,starredDocs:B??[],onSelect:j,onClose:$}),Y&&d.jsx("div",{className:"mt-1 border-t border-neutral-8/30",children:d.jsx(q_,{token:o,workingDir:e.workingDir,visible:Y})}),X&&d.jsx("div",{className:"mt-1 border-t border-neutral-8/30 pt-1",children:G.length===0?d.jsx("div",{className:"pl-12 pr-2 py-1 text-[13px] text-neutral-5",children:"No archived sessions"}):d.jsxs(d.Fragment,{children:[A.map(pe=>d.jsxs("button",{onClick:()=>v(pe.id),className:"group w-full flex items-baseline gap-2 pl-12 pr-2 py-0.5 text-left text-[15px] text-neutral-4 hover:bg-neutral-6/50 hover:text-neutral-2 transition-colors",children:[d.jsx(eo,{size:12,className:"flex-shrink-0 self-center opacity-40"}),d.jsx("span",{className:"flex-1 truncate",children:Q_(pe)}),d.jsx("span",{className:"shrink-0 text-[13px] text-neutral-6 tabular-nums",children:eT(pe.archivedAt)})]},pe.id)),oe&&!te&&d.jsxs("button",{onClick:()=>J(!0),className:"w-full pl-12 pr-2 py-0.5 text-left text-[13px] text-neutral-5 hover:text-neutral-2 transition-colors",children:["Show all ",G.length," archived..."]}),te&&oe&&d.jsx("button",{onClick:()=>J(!1),className:"w-full pl-12 pr-2 py-0.5 text-left text-[13px] text-neutral-5 hover:text-neutral-2 transition-colors",children:"Show less"})]})})]})]})}function nT(e,n){const r={};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const rT=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,aT=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,lT={};function Ty(e,n){return(lT.jsx?aT:rT).test(e)}const iT=/[ \t\n\f\r]/g;function sT(e){return typeof e=="object"?e.type==="text"?Ay(e.value):!1:Ay(e)}function Ay(e){return e.replace(iT,"")===""}class ho{constructor(n,r,l){this.normal=r,this.property=n,l&&(this.space=l)}}ho.prototype.normal={};ho.prototype.property={};ho.prototype.space=void 0;function rv(e,n){const r={},l={};for(const s of e)Object.assign(r,s.property),Object.assign(l,s.normal);return new ho(r,l,n)}function Qh(e){return e.toLowerCase()}class tr{constructor(n,r){this.attribute=r,this.property=n}}tr.prototype.attribute="";tr.prototype.booleanish=!1;tr.prototype.boolean=!1;tr.prototype.commaOrSpaceSeparated=!1;tr.prototype.commaSeparated=!1;tr.prototype.defined=!1;tr.prototype.mustUseProperty=!1;tr.prototype.number=!1;tr.prototype.overloadedBoolean=!1;tr.prototype.property="";tr.prototype.spaceSeparated=!1;tr.prototype.space=void 0;let oT=0;const We=zl(),hn=zl(),Wh=zl(),ke=zl(),Gt=zl(),Ri=zl(),dr=zl();function zl(){return 2**++oT}const Jh=Object.freeze(Object.defineProperty({__proto__:null,boolean:We,booleanish:hn,commaOrSpaceSeparated:dr,commaSeparated:Ri,number:ke,overloadedBoolean:Wh,spaceSeparated:Gt},Symbol.toStringTag,{value:"Module"})),nh=Object.keys(Jh);class Mp extends tr{constructor(n,r,l,s){let o=-1;if(super(n,r),Cy(this,"space",s),typeof l=="number")for(;++o<nh.length;){const u=nh[o];Cy(this,nh[o],(l&Jh[u])===Jh[u])}}}Mp.prototype.defined=!0;function Cy(e,n,r){r&&(e[n]=r)}function Li(e){const n={},r={};for(const[l,s]of Object.entries(e.properties)){const o=new Mp(l,e.transform(e.attributes||{},l),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(l)&&(o.mustUseProperty=!0),n[l]=o,r[Qh(l)]=l,r[Qh(o.attribute)]=l}return new ho(n,r,e.space)}const av=Li({properties:{ariaActiveDescendant:null,ariaAtomic:hn,ariaAutoComplete:null,ariaBusy:hn,ariaChecked:hn,ariaColCount:ke,ariaColIndex:ke,ariaColSpan:ke,ariaControls:Gt,ariaCurrent:null,ariaDescribedBy:Gt,ariaDetails:null,ariaDisabled:hn,ariaDropEffect:Gt,ariaErrorMessage:null,ariaExpanded:hn,ariaFlowTo:Gt,ariaGrabbed:hn,ariaHasPopup:null,ariaHidden:hn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Gt,ariaLevel:ke,ariaLive:null,ariaModal:hn,ariaMultiLine:hn,ariaMultiSelectable:hn,ariaOrientation:null,ariaOwns:Gt,ariaPlaceholder:null,ariaPosInSet:ke,ariaPressed:hn,ariaReadOnly:hn,ariaRelevant:null,ariaRequired:hn,ariaRoleDescription:Gt,ariaRowCount:ke,ariaRowIndex:ke,ariaRowSpan:ke,ariaSelected:hn,ariaSetSize:ke,ariaSort:null,ariaValueMax:ke,ariaValueMin:ke,ariaValueNow:ke,ariaValueText:null,role:null},transform(e,n){return n==="role"?n:"aria-"+n.slice(4).toLowerCase()}});function lv(e,n){return n in e?e[n]:n}function iv(e,n){return lv(e,n.toLowerCase())}const uT=Li({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ri,acceptCharset:Gt,accessKey:Gt,action:null,allow:null,allowFullScreen:We,allowPaymentRequest:We,allowUserMedia:We,alt:null,as:null,async:We,autoCapitalize:null,autoComplete:Gt,autoFocus:We,autoPlay:We,blocking:Gt,capture:null,charSet:null,checked:We,cite:null,className:Gt,cols:ke,colSpan:null,content:null,contentEditable:hn,controls:We,controlsList:Gt,coords:ke|Ri,crossOrigin:null,data:null,dateTime:null,decoding:null,default:We,defer:We,dir:null,dirName:null,disabled:We,download:Wh,draggable:hn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:We,formTarget:null,headers:Gt,height:ke,hidden:Wh,high:ke,href:null,hrefLang:null,htmlFor:Gt,httpEquiv:Gt,id:null,imageSizes:null,imageSrcSet:null,inert:We,inputMode:null,integrity:null,is:null,isMap:We,itemId:null,itemProp:Gt,itemRef:Gt,itemScope:We,itemType:Gt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:We,low:ke,manifest:null,max:null,maxLength:ke,media:null,method:null,min:null,minLength:ke,multiple:We,muted:We,name:null,nonce:null,noModule:We,noValidate:We,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:We,optimum:ke,pattern:null,ping:Gt,placeholder:null,playsInline:We,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:We,referrerPolicy:null,rel:Gt,required:We,reversed:We,rows:ke,rowSpan:ke,sandbox:Gt,scope:null,scoped:We,seamless:We,selected:We,shadowRootClonable:We,shadowRootDelegatesFocus:We,shadowRootMode:null,shape:null,size:ke,sizes:null,slot:null,span:ke,spellCheck:hn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ke,step:null,style:null,tabIndex:ke,target:null,title:null,translate:null,type:null,typeMustMatch:We,useMap:null,value:hn,width:ke,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Gt,axis:null,background:null,bgColor:null,border:ke,borderColor:null,bottomMargin:ke,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:We,declare:We,event:null,face:null,frame:null,frameBorder:null,hSpace:ke,leftMargin:ke,link:null,longDesc:null,lowSrc:null,marginHeight:ke,marginWidth:ke,noResize:We,noHref:We,noShade:We,noWrap:We,object:null,profile:null,prompt:null,rev:null,rightMargin:ke,rules:null,scheme:null,scrolling:hn,standby:null,summary:null,text:null,topMargin:ke,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ke,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:We,disableRemotePlayback:We,prefix:null,property:null,results:ke,security:null,unselectable:null},space:"html",transform:iv}),cT=Li({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:dr,accentHeight:ke,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ke,amplitude:ke,arabicForm:null,ascent:ke,attributeName:null,attributeType:null,azimuth:ke,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ke,by:null,calcMode:null,capHeight:ke,className:Gt,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:ke,diffuseConstant:ke,direction:null,display:null,dur:null,divisor:ke,dominantBaseline:null,download:We,dx:null,dy:null,edgeMode:null,editable:null,elevation:ke,enableBackground:null,end:null,event:null,exponent:ke,externalResourcesRequired:null,fill:null,fillOpacity:ke,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:Ri,g2:Ri,glyphName:Ri,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ke,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ke,horizOriginX:ke,horizOriginY:ke,id:null,ideographic:ke,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ke,k:ke,k1:ke,k2:ke,k3:ke,k4:ke,kernelMatrix:dr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ke,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:ke,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:ke,overlineThickness:ke,paintOrder:null,panose1:null,path:null,pathLength:ke,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Gt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ke,pointsAtY:ke,pointsAtZ:ke,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:dr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:dr,rev:dr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:dr,requiredFeatures:dr,requiredFonts:dr,requiredFormats:dr,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:ke,specularExponent:ke,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ke,strikethroughThickness:ke,string:null,stroke:null,strokeDashArray:dr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ke,strokeOpacity:ke,strokeWidth:null,style:null,surfaceScale:ke,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:dr,tabIndex:ke,tableValues:null,target:null,targetX:ke,targetY:ke,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:dr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ke,underlineThickness:ke,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ke,values:null,vAlphabetic:ke,vMathematical:ke,vectorEffect:null,vHanging:ke,vIdeographic:ke,version:null,vertAdvY:ke,vertOriginX:ke,vertOriginY:ke,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ke,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:lv}),sv=Li({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()}}),ov=Li({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:iv}),uv=Li({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,n){return"xml:"+n.slice(3).toLowerCase()}}),fT={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"},dT=/[A-Z]/g,jy=/-[a-z]/g,hT=/^data[-\w.:]+$/i;function pT(e,n){const r=Qh(n);let l=n,s=tr;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&hT.test(n)){if(n.charAt(4)==="-"){const o=n.slice(5).replace(jy,gT);l="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=n.slice(4);if(!jy.test(o)){let u=o.replace(dT,mT);u.charAt(0)!=="-"&&(u="-"+u),n="data"+u}}s=Mp}return new s(l,n)}function mT(e){return"-"+e.toLowerCase()}function gT(e){return e.charAt(1).toUpperCase()}const xT=rv([av,uT,sv,ov,uv],"html"),Op=rv([av,cT,sv,ov,uv],"svg");function bT(e){return e.join(" ").trim()}var yi={},rh,Ry;function yT(){if(Ry)return rh;Ry=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,r=/^\s*/,l=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,f=/^\s+|\s+$/g,h=`
|
|
15
|
+
`,p="/",g="*",x="",y="comment",v="declaration";function w(N,T){if(typeof N!="string")throw new TypeError("First argument must be a string");if(!N)return[];T=T||{};var R=1,j=1;function $(J){var G=J.match(n);G&&(R+=G.length);var z=J.lastIndexOf(h);j=~z?J.length-z:j+J.length}function B(){var J={line:R,column:j};return function(G){return G.position=new _(J),Y(),G}}function _(J){this.start=J,this.end={line:R,column:j},this.source=T.source}_.prototype.content=N;function D(J){var G=new Error(T.source+":"+R+":"+j+": "+J);if(G.reason=J,G.filename=T.source,G.line=R,G.column=j,G.source=N,!T.silent)throw G}function F(J){var G=J.exec(N);if(G){var z=G[0];return $(z),N=N.slice(z.length),G}}function Y(){F(r)}function L(J){var G;for(J=J||[];G=X();)G!==!1&&J.push(G);return J}function X(){var J=B();if(!(p!=N.charAt(0)||g!=N.charAt(1))){for(var G=2;x!=N.charAt(G)&&(g!=N.charAt(G)||p!=N.charAt(G+1));)++G;if(G+=2,x===N.charAt(G-1))return D("End of comment missing");var z=N.slice(2,G-2);return j+=2,$(z),N=N.slice(G),j+=2,J({type:y,comment:z})}}function Z(){var J=B(),G=F(l);if(G){if(X(),!F(s))return D("property missing ':'");var z=F(o),V=J({type:v,property:E(G[0].replace(e,x)),value:z?E(z[0].replace(e,x)):x});return F(u),V}}function te(){var J=[];L(J);for(var G;G=Z();)G!==!1&&(J.push(G),L(J));return J}return Y(),te()}function E(N){return N?N.replace(f,x):x}return rh=w,rh}var My;function vT(){if(My)return yi;My=1;var e=yi&&yi.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(yi,"__esModule",{value:!0}),yi.default=r;const n=e(yT());function r(l,s){let o=null;if(!l||typeof l!="string")return o;const u=(0,n.default)(l),f=typeof s=="function";return u.forEach(h=>{if(h.type!=="declaration")return;const{property:p,value:g}=h;f?s(p,g,h):g&&(o=o||{},o[p]=g)}),o}return yi}var Os={},Oy;function kT(){if(Oy)return Os;Oy=1,Object.defineProperty(Os,"__esModule",{value:!0}),Os.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,l=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,o=function(p){return!p||r.test(p)||e.test(p)},u=function(p,g){return g.toUpperCase()},f=function(p,g){return"".concat(g,"-")},h=function(p,g){return g===void 0&&(g={}),o(p)?p:(p=p.toLowerCase(),g.reactCompat?p=p.replace(s,f):p=p.replace(l,f),p.replace(n,u))};return Os.camelCase=h,Os}var Ds,Dy;function wT(){if(Dy)return Ds;Dy=1;var e=Ds&&Ds.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},n=e(vT()),r=kT();function l(s,o){var u={};return!s||typeof s!="string"||(0,n.default)(s,function(f,h){f&&h&&(u[(0,r.camelCase)(f,o)]=h)}),u}return l.default=l,Ds=l,Ds}var ST=wT();const ET=fo(ST),cv=fv("end"),Dp=fv("start");function fv(e){return n;function n(r){const l=r&&r.position&&r.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 NT(e){const n=Dp(e),r=cv(e);if(n&&r)return{start:n,end:r}}function Zs(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?zy(e.position):"start"in e||"end"in e?zy(e):"line"in e||"column"in e?ep(e):""}function ep(e){return Ly(e&&e.line)+":"+Ly(e&&e.column)}function zy(e){return ep(e&&e.start)+"-"+ep(e&&e.end)}function Ly(e){return e&&typeof e=="number"?e:1}class Dn extends Error{constructor(n,r,l){super(),typeof r=="string"&&(l=r,r=void 0);let s="",o={},u=!1;if(r&&("line"in r&&"column"in r?o={place:r}:"start"in r&&"end"in r?o={place:r}:"type"in r?o={ancestors:[r],place:r.position}:o={...r}),typeof n=="string"?s=n:!o.cause&&n&&(u=!0,s=n.message,o.cause=n),!o.ruleId&&!o.source&&typeof l=="string"){const h=l.indexOf(":");h===-1?o.ruleId=l:(o.source=l.slice(0,h),o.ruleId=l.slice(h+1))}if(!o.place&&o.ancestors&&o.ancestors){const h=o.ancestors[o.ancestors.length-1];h&&(o.place=h.position)}const f=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=f?f.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=f?f.line:void 0,this.name=Zs(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=u&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Dn.prototype.file="";Dn.prototype.name="";Dn.prototype.reason="";Dn.prototype.message="";Dn.prototype.stack="";Dn.prototype.column=void 0;Dn.prototype.line=void 0;Dn.prototype.ancestors=void 0;Dn.prototype.cause=void 0;Dn.prototype.fatal=void 0;Dn.prototype.place=void 0;Dn.prototype.ruleId=void 0;Dn.prototype.source=void 0;const zp={}.hasOwnProperty,_T=new Map,TT=/[A-Z]/g,AT=new Set(["table","tbody","thead","tfoot","tr"]),CT=new Set(["td","th"]),dv="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function jT(e,n){if(!n||n.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const r=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=BT(r,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=IT(r,n.jsx,n.jsxs)}const s={Fragment:n.Fragment,ancestors:[],components:n.components||{},create:l,elementAttributeNameCase:n.elementAttributeNameCase||"react",evaluater:n.createEvaluater?n.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:n.ignoreInvalidStyle||!1,passKeys:n.passKeys!==!1,passNode:n.passNode||!1,schema:n.space==="svg"?Op:xT,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},o=hv(s,e,void 0);return o&&typeof o!="string"?o:s.create(e,s.Fragment,{children:o||void 0},void 0)}function hv(e,n,r){if(n.type==="element")return RT(e,n,r);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return MT(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return DT(e,n,r);if(n.type==="mdxjsEsm")return OT(e,n);if(n.type==="root")return zT(e,n,r);if(n.type==="text")return LT(e,n)}function RT(e,n,r){const l=e.schema;let s=l;n.tagName.toLowerCase()==="svg"&&l.space==="html"&&(s=Op,e.schema=s),e.ancestors.push(n);const o=mv(e,n.tagName,!1),u=$T(e,n);let f=Ip(e,n);return AT.has(n.tagName)&&(f=f.filter(function(h){return typeof h=="string"?!sT(h):!0})),pv(e,u,o,n),Lp(u,f),e.ancestors.pop(),e.schema=l,e.create(n,o,u,r)}function MT(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)}no(e,n.position)}function OT(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);no(e,n.position)}function DT(e,n,r){const l=e.schema;let s=l;n.name==="svg"&&l.space==="html"&&(s=Op,e.schema=s),e.ancestors.push(n);const o=n.name===null?e.Fragment:mv(e,n.name,!0),u=UT(e,n),f=Ip(e,n);return pv(e,u,o,n),Lp(u,f),e.ancestors.pop(),e.schema=l,e.create(n,o,u,r)}function zT(e,n,r){const l={};return Lp(l,Ip(e,n)),e.create(n,e.Fragment,l,r)}function LT(e,n){return n.value}function pv(e,n,r,l){typeof r!="string"&&r!==e.Fragment&&e.passNode&&(n.node=l)}function Lp(e,n){if(n.length>0){const r=n.length>1?n:n[0];r&&(e.children=r)}}function IT(e,n,r){return l;function l(s,o,u,f){const p=Array.isArray(u.children)?r:n;return f?p(o,u,f):p(o,u)}}function BT(e,n){return r;function r(l,s,o,u){const f=Array.isArray(o.children),h=Dp(l);return n(s,o,u,f,{columnNumber:h?h.column-1:void 0,fileName:e,lineNumber:h?h.line:void 0},void 0)}}function $T(e,n){const r={};let l,s;for(s in n.properties)if(s!=="children"&&zp.call(n.properties,s)){const o=HT(e,s,n.properties[s]);if(o){const[u,f]=o;e.tableCellAlignToStyle&&u==="align"&&typeof f=="string"&&CT.has(n.tagName)?l=f:r[u]=f}}if(l){const o=r.style||(r.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=l}return r}function UT(e,n){const r={};for(const l of n.attributes)if(l.type==="mdxJsxExpressionAttribute")if(l.data&&l.data.estree&&e.evaluater){const o=l.data.estree.body[0];o.type;const u=o.expression;u.type;const f=u.properties[0];f.type,Object.assign(r,e.evaluater.evaluateExpression(f.argument))}else no(e,n.position);else{const s=l.name;let o;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,o=e.evaluater.evaluateExpression(f.expression)}else no(e,n.position);else o=l.value===null?!0:l.value;r[s]=o}return r}function Ip(e,n){const r=[];let l=-1;const s=e.passKeys?new Map:_T;for(;++l<n.children.length;){const o=n.children[l];let u;if(e.passKeys){const h=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(h){const p=s.get(h)||0;u=h+"-"+p,s.set(h,p+1)}}const f=hv(e,o,u);f!==void 0&&r.push(f)}return r}function HT(e,n,r){const l=pT(e.schema,n);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=l.commaSeparated?nT(r):bT(r)),l.property==="style"){let s=typeof r=="object"?r:PT(e,String(r));return e.stylePropertyNameCase==="css"&&(s=FT(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&l.space?fT[l.property]||l.property:l.attribute,r]}}function PT(e,n){try{return ET(n,{reactCompat:!0})}catch(r){if(e.ignoreInvalidStyle)return{};const l=r,s=new Dn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:l,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=dv+"#cannot-parse-style-attribute",s}}function mv(e,n,r){let l;if(!r)l={type:"Literal",value:n};else if(n.includes(".")){const s=n.split(".");let o=-1,u;for(;++o<s.length;){const f=Ty(s[o])?{type:"Identifier",name:s[o]}:{type:"Literal",value:s[o]};u=u?{type:"MemberExpression",object:u,property:f,computed:!!(o&&f.type==="Literal"),optional:!1}:f}l=u}else l=Ty(n)&&!/^[a-z]/.test(n)?{type:"Identifier",name:n}:{type:"Literal",value:n};if(l.type==="Literal"){const s=l.value;return zp.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(l);no(e)}function no(e,n){const r=new Dn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:n,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=dv+"#cannot-handle-mdx-estrees-without-createevaluater",r}function FT(e){const n={};let r;for(r in e)zp.call(e,r)&&(n[GT(r)]=e[r]);return n}function GT(e){let n=e.replace(TT,qT);return n.slice(0,3)==="ms-"&&(n="-"+n),n}function qT(e){return"-"+e.toLowerCase()}const ah={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"]},YT={};function Bp(e,n){const r=YT,l=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,s=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return gv(e,l,s)}function gv(e,n,r){if(VT(e)){if("value"in e)return e.type==="html"&&!r?"":e.value;if(n&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Iy(e.children,n,r)}return Array.isArray(e)?Iy(e,n,r):""}function Iy(e,n,r){const l=[];let s=-1;for(;++s<e.length;)l[s]=gv(e[s],n,r);return l.join("")}function VT(e){return!!(e&&typeof e=="object")}const By=document.createElement("i");function $p(e){const n="&"+e+";";By.innerHTML=n;const r=By.textContent;return r.charCodeAt(r.length-1)===59&&e!=="semi"||r===n?!1:r}function mr(e,n,r,l){const s=e.length;let o=0,u;if(n<0?n=-n>s?0:s+n:n=n>s?s:n,r=r>0?r:0,l.length<1e4)u=Array.from(l),u.unshift(n,r),e.splice(...u);else for(r&&e.splice(n,r);o<l.length;)u=l.slice(o,o+1e4),u.unshift(n,0),e.splice(...u),o+=1e4,n+=1e4}function Cr(e,n){return e.length>0?(mr(e,e.length,0,n),e):n}const $y={}.hasOwnProperty;function xv(e){const n={};let r=-1;for(;++r<e.length;)XT(n,e[r]);return n}function XT(e,n){let r;for(r in n){const s=($y.call(e,r)?e[r]:void 0)||(e[r]={}),o=n[r];let u;if(o)for(u in o){$y.call(s,u)||(s[u]=[]);const f=o[u];KT(s[u],Array.isArray(f)?f:f?[f]:[])}}}function KT(e,n){let r=-1;const l=[];for(;++r<n.length;)(n[r].add==="after"?e:l).push(n[r]);mr(e,0,0,l)}function bv(e,n){const r=Number.parseInt(e,n);return r<9||r===11||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"�":String.fromCodePoint(r)}function $r(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Bn=sl(/[A-Za-z]/),On=sl(/[\dA-Za-z]/),ZT=sl(/[#-'*+\--9=?A-Z^-~]/);function sc(e){return e!==null&&(e<32||e===127)}const tp=sl(/\d/),QT=sl(/[\dA-Fa-f]/),WT=sl(/[!-/:-@[-`{-~]/);function He(e){return e!==null&&e<-2}function Ut(e){return e!==null&&(e<0||e===32)}function it(e){return e===-2||e===-1||e===32}const wc=sl(new RegExp("\\p{P}|\\p{S}","u")),Rl=sl(/\s/);function sl(e){return n;function n(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}function Ii(e){const n=[];let r=-1,l=0,s=0;for(;++r<e.length;){const o=e.charCodeAt(r);let u="";if(o===37&&On(e.charCodeAt(r+1))&&On(e.charCodeAt(r+2)))s=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(u=String.fromCharCode(o));else if(o>55295&&o<57344){const f=e.charCodeAt(r+1);o<56320&&f>56319&&f<57344?(u=String.fromCharCode(o,f),s=1):u="�"}else u=String.fromCharCode(o);u&&(n.push(e.slice(l,r),encodeURIComponent(u)),l=r+s+1,u=""),s&&(r+=s,s=0)}return n.join("")+e.slice(l)}function dt(e,n,r,l){const s=l?l-1:Number.POSITIVE_INFINITY;let o=0;return u;function u(h){return it(h)?(e.enter(r),f(h)):n(h)}function f(h){return it(h)&&o++<s?(e.consume(h),f):(e.exit(r),n(h))}}const JT={tokenize:eA};function eA(e){const n=e.attempt(this.parser.constructs.contentInitial,l,s);let r;return n;function l(f){if(f===null){e.consume(f);return}return e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),dt(e,n,"linePrefix")}function s(f){return e.enter("paragraph"),o(f)}function o(f){const h=e.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=h),r=h,u(f)}function u(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return He(f)?(e.consume(f),e.exit("chunkText"),o):(e.consume(f),u)}}const tA={tokenize:nA},Uy={tokenize:rA};function nA(e){const n=this,r=[];let l=0,s,o,u;return f;function f(j){if(l<r.length){const $=r[l];return n.containerState=$[1],e.attempt($[0].continuation,h,p)(j)}return p(j)}function h(j){if(l++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,s&&R();const $=n.events.length;let B=$,_;for(;B--;)if(n.events[B][0]==="exit"&&n.events[B][1].type==="chunkFlow"){_=n.events[B][1].end;break}T(l);let D=$;for(;D<n.events.length;)n.events[D][1].end={..._},D++;return mr(n.events,B+1,0,n.events.slice($)),n.events.length=D,p(j)}return f(j)}function p(j){if(l===r.length){if(!s)return y(j);if(s.currentConstruct&&s.currentConstruct.concrete)return w(j);n.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(Uy,g,x)(j)}function g(j){return s&&R(),T(l),y(j)}function x(j){return n.parser.lazy[n.now().line]=l!==r.length,u=n.now().offset,w(j)}function y(j){return n.containerState={},e.attempt(Uy,v,w)(j)}function v(j){return l++,r.push([n.currentConstruct,n.containerState]),y(j)}function w(j){if(j===null){s&&R(),T(0),e.consume(j);return}return s=s||n.parser.flow(n.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:o}),E(j)}function E(j){if(j===null){N(e.exit("chunkFlow"),!0),T(0),e.consume(j);return}return He(j)?(e.consume(j),N(e.exit("chunkFlow")),l=0,n.interrupt=void 0,f):(e.consume(j),E)}function N(j,$){const B=n.sliceStream(j);if($&&B.push(null),j.previous=o,o&&(o.next=j),o=j,s.defineSkip(j.start),s.write(B),n.parser.lazy[j.start.line]){let _=s.events.length;for(;_--;)if(s.events[_][1].start.offset<u&&(!s.events[_][1].end||s.events[_][1].end.offset>u))return;const D=n.events.length;let F=D,Y,L;for(;F--;)if(n.events[F][0]==="exit"&&n.events[F][1].type==="chunkFlow"){if(Y){L=n.events[F][1].end;break}Y=!0}for(T(l),_=D;_<n.events.length;)n.events[_][1].end={...L},_++;mr(n.events,F+1,0,n.events.slice(D)),n.events.length=_}}function T(j){let $=r.length;for(;$-- >j;){const B=r[$];n.containerState=B[1],B[0].exit.call(n,e)}r.length=j}function R(){s.write([null]),o=void 0,s=void 0,n.containerState._closeFlow=void 0}}function rA(e,n,r){return dt(e,e.attempt(this.parser.constructs.document,n,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Oi(e){if(e===null||Ut(e)||Rl(e))return 1;if(wc(e))return 2}function Sc(e,n,r){const l=[];let s=-1;for(;++s<e.length;){const o=e[s].resolveAll;o&&!l.includes(o)&&(n=o(n,r),l.push(o))}return n}const np={name:"attention",resolveAll:aA,tokenize:lA};function aA(e,n){let r=-1,l,s,o,u,f,h,p,g;for(;++r<e.length;)if(e[r][0]==="enter"&&e[r][1].type==="attentionSequence"&&e[r][1]._close){for(l=r;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[r][1]).charCodeAt(0)){if((e[l][1]._close||e[r][1]._open)&&(e[r][1].end.offset-e[r][1].start.offset)%3&&!((e[l][1].end.offset-e[l][1].start.offset+e[r][1].end.offset-e[r][1].start.offset)%3))continue;h=e[l][1].end.offset-e[l][1].start.offset>1&&e[r][1].end.offset-e[r][1].start.offset>1?2:1;const x={...e[l][1].end},y={...e[r][1].start};Hy(x,-h),Hy(y,h),u={type:h>1?"strongSequence":"emphasisSequence",start:x,end:{...e[l][1].end}},f={type:h>1?"strongSequence":"emphasisSequence",start:{...e[r][1].start},end:y},o={type:h>1?"strongText":"emphasisText",start:{...e[l][1].end},end:{...e[r][1].start}},s={type:h>1?"strong":"emphasis",start:{...u.start},end:{...f.end}},e[l][1].end={...u.start},e[r][1].start={...f.end},p=[],e[l][1].end.offset-e[l][1].start.offset&&(p=Cr(p,[["enter",e[l][1],n],["exit",e[l][1],n]])),p=Cr(p,[["enter",s,n],["enter",u,n],["exit",u,n],["enter",o,n]]),p=Cr(p,Sc(n.parser.constructs.insideSpan.null,e.slice(l+1,r),n)),p=Cr(p,[["exit",o,n],["enter",f,n],["exit",f,n],["exit",s,n]]),e[r][1].end.offset-e[r][1].start.offset?(g=2,p=Cr(p,[["enter",e[r][1],n],["exit",e[r][1],n]])):g=0,mr(e,l-1,r-l+3,p),r=l+p.length-g-2;break}}for(r=-1;++r<e.length;)e[r][1].type==="attentionSequence"&&(e[r][1].type="data");return e}function lA(e,n){const r=this.parser.constructs.attentionMarkers.null,l=this.previous,s=Oi(l);let o;return u;function u(h){return o=h,e.enter("attentionSequence"),f(h)}function f(h){if(h===o)return e.consume(h),f;const p=e.exit("attentionSequence"),g=Oi(h),x=!g||g===2&&s||r.includes(h),y=!s||s===2&&g||r.includes(l);return p._open=!!(o===42?x:x&&(s||!y)),p._close=!!(o===42?y:y&&(g||!x)),n(h)}}function Hy(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}const iA={name:"autolink",tokenize:sA};function sA(e,n,r){let l=0;return s;function s(v){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(v){return Bn(v)?(e.consume(v),u):v===64?r(v):p(v)}function u(v){return v===43||v===45||v===46||On(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||On(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||sc(v)?r(v):(e.consume(v),h)}function p(v){return v===64?(e.consume(v),g):ZT(v)?(e.consume(v),p):r(v)}function g(v){return On(v)?x(v):r(v)}function x(v){return v===46?(e.consume(v),l=0,g):v===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),n):y(v)}function y(v){if((v===45||On(v))&&l++<63){const w=v===45?y:x;return e.consume(v),w}return r(v)}}const po={partial:!0,tokenize:oA};function oA(e,n,r){return l;function l(o){return it(o)?dt(e,s,"linePrefix")(o):s(o)}function s(o){return o===null||He(o)?n(o):r(o)}}const yv={continuation:{tokenize:cA},exit:fA,name:"blockQuote",tokenize:uA};function uA(e,n,r){const l=this;return s;function s(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"),o}return r(u)}function o(u){return it(u)?(e.enter("blockQuotePrefixWhitespace"),e.consume(u),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),n):(e.exit("blockQuotePrefix"),n(u))}}function cA(e,n,r){const l=this;return s;function s(u){return it(u)?dt(e,o,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u):o(u)}function o(u){return e.attempt(yv,n,r)(u)}}function fA(e){e.exit("blockQuote")}const vv={name:"characterEscape",tokenize:dA};function dA(e,n,r){return l;function l(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),s}function s(o){return WT(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):r(o)}}const kv={name:"characterReference",tokenize:hA};function hA(e,n,r){const l=this;let s=0,o,u;return f;function f(x){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(x),e.exit("characterReferenceMarker"),h}function h(x){return x===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(x),e.exit("characterReferenceMarkerNumeric"),p):(e.enter("characterReferenceValue"),o=31,u=On,g(x))}function p(x){return x===88||x===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(x),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,u=QT,g):(e.enter("characterReferenceValue"),o=7,u=tp,g(x))}function g(x){if(x===59&&s){const y=e.exit("characterReferenceValue");return u===On&&!$p(l.sliceSerialize(y))?r(x):(e.enter("characterReferenceMarker"),e.consume(x),e.exit("characterReferenceMarker"),e.exit("characterReference"),n)}return u(x)&&s++<o?(e.consume(x),g):r(x)}}const Py={partial:!0,tokenize:mA},Fy={concrete:!0,name:"codeFenced",tokenize:pA};function pA(e,n,r){const l=this,s={partial:!0,tokenize:B};let o=0,u=0,f;return h;function h(_){return p(_)}function p(_){const D=l.events[l.events.length-1];return o=D&&D[1].type==="linePrefix"?D[2].sliceSerialize(D[1],!0).length:0,f=_,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),g(_)}function g(_){return _===f?(u++,e.consume(_),g):u<3?r(_):(e.exit("codeFencedFenceSequence"),it(_)?dt(e,x,"whitespace")(_):x(_))}function x(_){return _===null||He(_)?(e.exit("codeFencedFence"),l.interrupt?n(_):e.check(Py,E,$)(_)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),y(_))}function y(_){return _===null||He(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),x(_)):it(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),dt(e,v,"whitespace")(_)):_===96&&_===f?r(_):(e.consume(_),y)}function v(_){return _===null||He(_)?x(_):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),w(_))}function w(_){return _===null||He(_)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),x(_)):_===96&&_===f?r(_):(e.consume(_),w)}function E(_){return e.attempt(s,$,N)(_)}function N(_){return e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),T}function T(_){return o>0&&it(_)?dt(e,R,"linePrefix",o+1)(_):R(_)}function R(_){return _===null||He(_)?e.check(Py,E,$)(_):(e.enter("codeFlowValue"),j(_))}function j(_){return _===null||He(_)?(e.exit("codeFlowValue"),R(_)):(e.consume(_),j)}function $(_){return e.exit("codeFenced"),n(_)}function B(_,D,F){let Y=0;return L;function L(G){return _.enter("lineEnding"),_.consume(G),_.exit("lineEnding"),X}function X(G){return _.enter("codeFencedFence"),it(G)?dt(_,Z,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(G):Z(G)}function Z(G){return G===f?(_.enter("codeFencedFenceSequence"),te(G)):F(G)}function te(G){return G===f?(Y++,_.consume(G),te):Y>=u?(_.exit("codeFencedFenceSequence"),it(G)?dt(_,J,"whitespace")(G):J(G)):F(G)}function J(G){return G===null||He(G)?(_.exit("codeFencedFence"),D(G)):F(G)}}}function mA(e,n,r){const l=this;return s;function s(u){return u===null?r(u):(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),o)}function o(u){return l.parser.lazy[l.now().line]?r(u):n(u)}}const lh={name:"codeIndented",tokenize:xA},gA={partial:!0,tokenize:bA};function xA(e,n,r){const l=this;return s;function s(p){return e.enter("codeIndented"),dt(e,o,"linePrefix",5)(p)}function o(p){const g=l.events[l.events.length-1];return g&&g[1].type==="linePrefix"&&g[2].sliceSerialize(g[1],!0).length>=4?u(p):r(p)}function u(p){return p===null?h(p):He(p)?e.attempt(gA,u,h)(p):(e.enter("codeFlowValue"),f(p))}function f(p){return p===null||He(p)?(e.exit("codeFlowValue"),u(p)):(e.consume(p),f)}function h(p){return e.exit("codeIndented"),n(p)}}function bA(e,n,r){const l=this;return s;function s(u){return l.parser.lazy[l.now().line]?r(u):He(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),s):dt(e,o,"linePrefix",5)(u)}function o(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):He(u)?s(u):r(u)}}const yA={name:"codeText",previous:kA,resolve:vA,tokenize:wA};function vA(e){let n=e.length-4,r=3,l,s;if((e[r][1].type==="lineEnding"||e[r][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(l=r;++l<n;)if(e[l][1].type==="codeTextData"){e[r][1].type="codeTextPadding",e[n][1].type="codeTextPadding",r+=2,n-=2;break}}for(l=r-1,n++;++l<=n;)s===void 0?l!==n&&e[l][1].type!=="lineEnding"&&(s=l):(l===n||e[l][1].type==="lineEnding")&&(e[s][1].type="codeTextData",l!==s+2&&(e[s][1].end=e[l-1][1].end,e.splice(s+2,l-s-2),n-=l-s-2,l=s+2),s=void 0);return e}function kA(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function wA(e,n,r){let l=0,s,o;return u;function u(x){return e.enter("codeText"),e.enter("codeTextSequence"),f(x)}function f(x){return x===96?(e.consume(x),l++,f):(e.exit("codeTextSequence"),h(x))}function h(x){return x===null?r(x):x===32?(e.enter("space"),e.consume(x),e.exit("space"),h):x===96?(o=e.enter("codeTextSequence"),s=0,g(x)):He(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),h):(e.enter("codeTextData"),p(x))}function p(x){return x===null||x===32||x===96||He(x)?(e.exit("codeTextData"),h(x)):(e.consume(x),p)}function g(x){return x===96?(e.consume(x),s++,g):s===l?(e.exit("codeTextSequence"),e.exit("codeText"),n(x)):(o.type="codeTextData",p(x))}}class SA{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,r){const l=r??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,r,l){const s=r||0;this.setCursor(Math.trunc(n));const o=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return l&&zs(this.left,l),o.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),zs(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),zs(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 r=this.left.splice(n,Number.POSITIVE_INFINITY);zs(this.right,r.reverse())}else{const r=this.right.splice(this.left.length+this.right.length-n,Number.POSITIVE_INFINITY);zs(this.left,r.reverse())}}}function zs(e,n){let r=0;if(n.length<1e4)e.push(...n);else for(;r<n.length;)e.push(...n.slice(r,r+1e4)),r+=1e4}function wv(e){const n={};let r=-1,l,s,o,u,f,h,p;const g=new SA(e);for(;++r<g.length;){for(;r in n;)r=n[r];if(l=g.get(r),r&&l[1].type==="chunkFlow"&&g.get(r-1)[1].type==="listItemPrefix"&&(h=l[1]._tokenizer.events,o=0,o<h.length&&h[o][1].type==="lineEndingBlank"&&(o+=2),o<h.length&&h[o][1].type==="content"))for(;++o<h.length&&h[o][1].type!=="content";)h[o][1].type==="chunkText"&&(h[o][1]._isInFirstContentOfListItem=!0,o++);if(l[0]==="enter")l[1].contentType&&(Object.assign(n,EA(g,r)),r=n[r],p=!0);else if(l[1]._container){for(o=r,s=void 0;o--;)if(u=g.get(o),u[1].type==="lineEnding"||u[1].type==="lineEndingBlank")u[0]==="enter"&&(s&&(g.get(s)[1].type="lineEndingBlank"),u[1].type="lineEnding",s=o);else if(!(u[1].type==="linePrefix"||u[1].type==="listItemIndent"))break;s&&(l[1].end={...g.get(s)[1].start},f=g.slice(s,r),f.unshift(l),g.splice(s,r-s+1,f))}}return mr(e,0,Number.POSITIVE_INFINITY,g.slice(0)),!p}function EA(e,n){const r=e.get(n)[1],l=e.get(n)[2];let s=n-1;const o=[];let u=r._tokenizer;u||(u=l.parser[r.contentType](r.start),r._contentTypeTextTrailing&&(u._contentTypeTextTrailing=!0));const f=u.events,h=[],p={};let g,x,y=-1,v=r,w=0,E=0;const N=[E];for(;v;){for(;e.get(++s)[1]!==v;);o.push(s),v._tokenizer||(g=l.sliceStream(v),v.next||g.push(null),x&&u.defineSkip(v.start),v._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=!0),u.write(g),v._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=void 0)),x=v,v=v.next}for(v=r;++y<f.length;)f[y][0]==="exit"&&f[y-1][0]==="enter"&&f[y][1].type===f[y-1][1].type&&f[y][1].start.line!==f[y][1].end.line&&(E=y+1,N.push(E),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(u.events=[],v?(v._tokenizer=void 0,v.previous=void 0):N.pop(),y=N.length;y--;){const T=f.slice(N[y],N[y+1]),R=o.pop();h.push([R,R+T.length-1]),e.splice(R,2,T)}for(h.reverse(),y=-1;++y<h.length;)p[w+h[y][0]]=w+h[y][1],w+=h[y][1]-h[y][0]-1;return p}const NA={resolve:TA,tokenize:AA},_A={partial:!0,tokenize:CA};function TA(e){return wv(e),e}function AA(e,n){let r;return l;function l(f){return e.enter("content"),r=e.enter("chunkContent",{contentType:"content"}),s(f)}function s(f){return f===null?o(f):He(f)?e.check(_A,u,o)(f):(e.consume(f),s)}function o(f){return e.exit("chunkContent"),e.exit("content"),n(f)}function u(f){return e.consume(f),e.exit("chunkContent"),r.next=e.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,s}}function CA(e,n,r){const l=this;return s;function s(u){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),dt(e,o,"linePrefix")}function o(u){if(u===null||He(u))return r(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,r,n)(u)}}function Sv(e,n,r,l,s,o,u,f,h){const p=h||Number.POSITIVE_INFINITY;let g=0;return x;function x(T){return T===60?(e.enter(l),e.enter(s),e.enter(o),e.consume(T),e.exit(o),y):T===null||T===32||T===41||sc(T)?r(T):(e.enter(l),e.enter(u),e.enter(f),e.enter("chunkString",{contentType:"string"}),E(T))}function y(T){return T===62?(e.enter(o),e.consume(T),e.exit(o),e.exit(s),e.exit(l),n):(e.enter(f),e.enter("chunkString",{contentType:"string"}),v(T))}function v(T){return T===62?(e.exit("chunkString"),e.exit(f),y(T)):T===null||T===60||He(T)?r(T):(e.consume(T),T===92?w:v)}function w(T){return T===60||T===62||T===92?(e.consume(T),v):v(T)}function E(T){return!g&&(T===null||T===41||Ut(T))?(e.exit("chunkString"),e.exit(f),e.exit(u),e.exit(l),n(T)):g<p&&T===40?(e.consume(T),g++,E):T===41?(e.consume(T),g--,E):T===null||T===32||T===40||sc(T)?r(T):(e.consume(T),T===92?N:E)}function N(T){return T===40||T===41||T===92?(e.consume(T),E):E(T)}}function Ev(e,n,r,l,s,o){const u=this;let f=0,h;return p;function p(v){return e.enter(l),e.enter(s),e.consume(v),e.exit(s),e.enter(o),g}function g(v){return f>999||v===null||v===91||v===93&&!h||v===94&&!f&&"_hiddenFootnoteSupport"in u.parser.constructs?r(v):v===93?(e.exit(o),e.enter(s),e.consume(v),e.exit(s),e.exit(l),n):He(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),g):(e.enter("chunkString",{contentType:"string"}),x(v))}function x(v){return v===null||v===91||v===93||He(v)||f++>999?(e.exit("chunkString"),g(v)):(e.consume(v),h||(h=!it(v)),v===92?y:x)}function y(v){return v===91||v===92||v===93?(e.consume(v),f++,x):x(v)}}function Nv(e,n,r,l,s,o){let u;return f;function f(y){return y===34||y===39||y===40?(e.enter(l),e.enter(s),e.consume(y),e.exit(s),u=y===40?41:y,h):r(y)}function h(y){return y===u?(e.enter(s),e.consume(y),e.exit(s),e.exit(l),n):(e.enter(o),p(y))}function p(y){return y===u?(e.exit(o),h(u)):y===null?r(y):He(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),dt(e,p,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),g(y))}function g(y){return y===u||y===null||He(y)?(e.exit("chunkString"),p(y)):(e.consume(y),y===92?x:g)}function x(y){return y===u||y===92?(e.consume(y),g):g(y)}}function Qs(e,n){let r;return l;function l(s){return He(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),r=!0,l):it(s)?dt(e,l,r?"linePrefix":"lineSuffix")(s):n(s)}}const jA={name:"definition",tokenize:MA},RA={partial:!0,tokenize:OA};function MA(e,n,r){const l=this;let s;return o;function o(v){return e.enter("definition"),u(v)}function u(v){return Ev.call(l,e,f,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function f(v){return s=$r(l.sliceSerialize(l.events[l.events.length-1][1]).slice(1,-1)),v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),h):r(v)}function h(v){return Ut(v)?Qs(e,p)(v):p(v)}function p(v){return Sv(e,g,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function g(v){return e.attempt(RA,x,x)(v)}function x(v){return it(v)?dt(e,y,"whitespace")(v):y(v)}function y(v){return v===null||He(v)?(e.exit("definition"),l.parser.defined.push(s),n(v)):r(v)}}function OA(e,n,r){return l;function l(f){return Ut(f)?Qs(e,s)(f):r(f)}function s(f){return Nv(e,o,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function o(f){return it(f)?dt(e,u,"whitespace")(f):u(f)}function u(f){return f===null||He(f)?n(f):r(f)}}const DA={name:"hardBreakEscape",tokenize:zA};function zA(e,n,r){return l;function l(o){return e.enter("hardBreakEscape"),e.consume(o),s}function s(o){return He(o)?(e.exit("hardBreakEscape"),n(o)):r(o)}}const LA={name:"headingAtx",resolve:IA,tokenize:BA};function IA(e,n){let r=e.length-2,l=3,s,o;return e[l][1].type==="whitespace"&&(l+=2),r-2>l&&e[r][1].type==="whitespace"&&(r-=2),e[r][1].type==="atxHeadingSequence"&&(l===r-1||r-4>l&&e[r-2][1].type==="whitespace")&&(r-=l+1===r?2:4),r>l&&(s={type:"atxHeadingText",start:e[l][1].start,end:e[r][1].end},o={type:"chunkText",start:e[l][1].start,end:e[r][1].end,contentType:"text"},mr(e,l,r-l+1,[["enter",s,n],["enter",o,n],["exit",o,n],["exit",s,n]])),e}function BA(e,n,r){let l=0;return s;function s(g){return e.enter("atxHeading"),o(g)}function o(g){return e.enter("atxHeadingSequence"),u(g)}function u(g){return g===35&&l++<6?(e.consume(g),u):g===null||Ut(g)?(e.exit("atxHeadingSequence"),f(g)):r(g)}function f(g){return g===35?(e.enter("atxHeadingSequence"),h(g)):g===null||He(g)?(e.exit("atxHeading"),n(g)):it(g)?dt(e,f,"whitespace")(g):(e.enter("atxHeadingText"),p(g))}function h(g){return g===35?(e.consume(g),h):(e.exit("atxHeadingSequence"),f(g))}function p(g){return g===null||g===35||Ut(g)?(e.exit("atxHeadingText"),f(g)):(e.consume(g),p)}}const $A=["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"],Gy=["pre","script","style","textarea"],UA={concrete:!0,name:"htmlFlow",resolveTo:FA,tokenize:GA},HA={partial:!0,tokenize:YA},PA={partial:!0,tokenize:qA};function FA(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 GA(e,n,r){const l=this;let s,o,u,f,h;return p;function p(A){return g(A)}function g(A){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(A),x}function x(A){return A===33?(e.consume(A),y):A===47?(e.consume(A),o=!0,E):A===63?(e.consume(A),s=3,l.interrupt?n:M):Bn(A)?(e.consume(A),u=String.fromCharCode(A),N):r(A)}function y(A){return A===45?(e.consume(A),s=2,v):A===91?(e.consume(A),s=5,f=0,w):Bn(A)?(e.consume(A),s=4,l.interrupt?n:M):r(A)}function v(A){return A===45?(e.consume(A),l.interrupt?n:M):r(A)}function w(A){const oe="CDATA[";return A===oe.charCodeAt(f++)?(e.consume(A),f===oe.length?l.interrupt?n:Z:w):r(A)}function E(A){return Bn(A)?(e.consume(A),u=String.fromCharCode(A),N):r(A)}function N(A){if(A===null||A===47||A===62||Ut(A)){const oe=A===47,le=u.toLowerCase();return!oe&&!o&&Gy.includes(le)?(s=1,l.interrupt?n(A):Z(A)):$A.includes(u.toLowerCase())?(s=6,oe?(e.consume(A),T):l.interrupt?n(A):Z(A)):(s=7,l.interrupt&&!l.parser.lazy[l.now().line]?r(A):o?R(A):j(A))}return A===45||On(A)?(e.consume(A),u+=String.fromCharCode(A),N):r(A)}function T(A){return A===62?(e.consume(A),l.interrupt?n:Z):r(A)}function R(A){return it(A)?(e.consume(A),R):L(A)}function j(A){return A===47?(e.consume(A),L):A===58||A===95||Bn(A)?(e.consume(A),$):it(A)?(e.consume(A),j):L(A)}function $(A){return A===45||A===46||A===58||A===95||On(A)?(e.consume(A),$):B(A)}function B(A){return A===61?(e.consume(A),_):it(A)?(e.consume(A),B):j(A)}function _(A){return A===null||A===60||A===61||A===62||A===96?r(A):A===34||A===39?(e.consume(A),h=A,D):it(A)?(e.consume(A),_):F(A)}function D(A){return A===h?(e.consume(A),h=null,Y):A===null||He(A)?r(A):(e.consume(A),D)}function F(A){return A===null||A===34||A===39||A===47||A===60||A===61||A===62||A===96||Ut(A)?B(A):(e.consume(A),F)}function Y(A){return A===47||A===62||it(A)?j(A):r(A)}function L(A){return A===62?(e.consume(A),X):r(A)}function X(A){return A===null||He(A)?Z(A):it(A)?(e.consume(A),X):r(A)}function Z(A){return A===45&&s===2?(e.consume(A),z):A===60&&s===1?(e.consume(A),V):A===62&&s===4?(e.consume(A),O):A===63&&s===3?(e.consume(A),M):A===93&&s===5?(e.consume(A),be):He(A)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(HA,I,te)(A)):A===null||He(A)?(e.exit("htmlFlowData"),te(A)):(e.consume(A),Z)}function te(A){return e.check(PA,J,I)(A)}function J(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),G}function G(A){return A===null||He(A)?te(A):(e.enter("htmlFlowData"),Z(A))}function z(A){return A===45?(e.consume(A),M):Z(A)}function V(A){return A===47?(e.consume(A),u="",ne):Z(A)}function ne(A){if(A===62){const oe=u.toLowerCase();return Gy.includes(oe)?(e.consume(A),O):Z(A)}return Bn(A)&&u.length<8?(e.consume(A),u+=String.fromCharCode(A),ne):Z(A)}function be(A){return A===93?(e.consume(A),M):Z(A)}function M(A){return A===62?(e.consume(A),O):A===45&&s===2?(e.consume(A),M):Z(A)}function O(A){return A===null||He(A)?(e.exit("htmlFlowData"),I(A)):(e.consume(A),O)}function I(A){return e.exit("htmlFlow"),n(A)}}function qA(e,n,r){const l=this;return s;function s(u){return He(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),o):r(u)}function o(u){return l.parser.lazy[l.now().line]?r(u):n(u)}}function YA(e,n,r){return l;function l(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(po,n,r)}}const VA={name:"htmlText",tokenize:XA};function XA(e,n,r){const l=this;let s,o,u;return f;function f(M){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(M),h}function h(M){return M===33?(e.consume(M),p):M===47?(e.consume(M),B):M===63?(e.consume(M),j):Bn(M)?(e.consume(M),F):r(M)}function p(M){return M===45?(e.consume(M),g):M===91?(e.consume(M),o=0,w):Bn(M)?(e.consume(M),R):r(M)}function g(M){return M===45?(e.consume(M),v):r(M)}function x(M){return M===null?r(M):M===45?(e.consume(M),y):He(M)?(u=x,V(M)):(e.consume(M),x)}function y(M){return M===45?(e.consume(M),v):x(M)}function v(M){return M===62?z(M):M===45?y(M):x(M)}function w(M){const O="CDATA[";return M===O.charCodeAt(o++)?(e.consume(M),o===O.length?E:w):r(M)}function E(M){return M===null?r(M):M===93?(e.consume(M),N):He(M)?(u=E,V(M)):(e.consume(M),E)}function N(M){return M===93?(e.consume(M),T):E(M)}function T(M){return M===62?z(M):M===93?(e.consume(M),T):E(M)}function R(M){return M===null||M===62?z(M):He(M)?(u=R,V(M)):(e.consume(M),R)}function j(M){return M===null?r(M):M===63?(e.consume(M),$):He(M)?(u=j,V(M)):(e.consume(M),j)}function $(M){return M===62?z(M):j(M)}function B(M){return Bn(M)?(e.consume(M),_):r(M)}function _(M){return M===45||On(M)?(e.consume(M),_):D(M)}function D(M){return He(M)?(u=D,V(M)):it(M)?(e.consume(M),D):z(M)}function F(M){return M===45||On(M)?(e.consume(M),F):M===47||M===62||Ut(M)?Y(M):r(M)}function Y(M){return M===47?(e.consume(M),z):M===58||M===95||Bn(M)?(e.consume(M),L):He(M)?(u=Y,V(M)):it(M)?(e.consume(M),Y):z(M)}function L(M){return M===45||M===46||M===58||M===95||On(M)?(e.consume(M),L):X(M)}function X(M){return M===61?(e.consume(M),Z):He(M)?(u=X,V(M)):it(M)?(e.consume(M),X):Y(M)}function Z(M){return M===null||M===60||M===61||M===62||M===96?r(M):M===34||M===39?(e.consume(M),s=M,te):He(M)?(u=Z,V(M)):it(M)?(e.consume(M),Z):(e.consume(M),J)}function te(M){return M===s?(e.consume(M),s=void 0,G):M===null?r(M):He(M)?(u=te,V(M)):(e.consume(M),te)}function J(M){return M===null||M===34||M===39||M===60||M===61||M===96?r(M):M===47||M===62||Ut(M)?Y(M):(e.consume(M),J)}function G(M){return M===47||M===62||Ut(M)?Y(M):r(M)}function z(M){return M===62?(e.consume(M),e.exit("htmlTextData"),e.exit("htmlText"),n):r(M)}function V(M){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),ne}function ne(M){return it(M)?dt(e,be,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):be(M)}function be(M){return e.enter("htmlTextData"),u(M)}}const Up={name:"labelEnd",resolveAll:WA,resolveTo:JA,tokenize:eC},KA={tokenize:tC},ZA={tokenize:nC},QA={tokenize:rC};function WA(e){let n=-1;const r=[];for(;++n<e.length;){const l=e[n][1];if(r.push(e[n]),l.type==="labelImage"||l.type==="labelLink"||l.type==="labelEnd"){const s=l.type==="labelImage"?4:2;l.type="data",n+=s}}return e.length!==r.length&&mr(e,0,e.length,r),e}function JA(e,n){let r=e.length,l=0,s,o,u,f;for(;r--;)if(s=e[r][1],o){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[r][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(u){if(e[r][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(o=r,s.type!=="labelLink")){l=2;break}}else s.type==="labelEnd"&&(u=r);const h={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},p={type:"label",start:{...e[o][1].start},end:{...e[u][1].end}},g={type:"labelText",start:{...e[o+l+2][1].end},end:{...e[u-2][1].start}};return f=[["enter",h,n],["enter",p,n]],f=Cr(f,e.slice(o+1,o+l+3)),f=Cr(f,[["enter",g,n]]),f=Cr(f,Sc(n.parser.constructs.insideSpan.null,e.slice(o+l+4,u-3),n)),f=Cr(f,[["exit",g,n],e[u-2],e[u-1],["exit",p,n]]),f=Cr(f,e.slice(u+1)),f=Cr(f,[["exit",h,n]]),mr(e,o,e.length,f),e}function eC(e,n,r){const l=this;let s=l.events.length,o,u;for(;s--;)if((l.events[s][1].type==="labelImage"||l.events[s][1].type==="labelLink")&&!l.events[s][1]._balanced){o=l.events[s][1];break}return f;function f(y){return o?o._inactive?x(y):(u=l.parser.defined.includes($r(l.sliceSerialize({start:o.end,end:l.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(y),e.exit("labelMarker"),e.exit("labelEnd"),h):r(y)}function h(y){return y===40?e.attempt(KA,g,u?g:x)(y):y===91?e.attempt(ZA,g,u?p:x)(y):u?g(y):x(y)}function p(y){return e.attempt(QA,g,x)(y)}function g(y){return n(y)}function x(y){return o._balanced=!0,r(y)}}function tC(e,n,r){return l;function l(x){return e.enter("resource"),e.enter("resourceMarker"),e.consume(x),e.exit("resourceMarker"),s}function s(x){return Ut(x)?Qs(e,o)(x):o(x)}function o(x){return x===41?g(x):Sv(e,u,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(x)}function u(x){return Ut(x)?Qs(e,h)(x):g(x)}function f(x){return r(x)}function h(x){return x===34||x===39||x===40?Nv(e,p,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(x):g(x)}function p(x){return Ut(x)?Qs(e,g)(x):g(x)}function g(x){return x===41?(e.enter("resourceMarker"),e.consume(x),e.exit("resourceMarker"),e.exit("resource"),n):r(x)}}function nC(e,n,r){const l=this;return s;function s(f){return Ev.call(l,e,o,u,"reference","referenceMarker","referenceString")(f)}function o(f){return l.parser.defined.includes($r(l.sliceSerialize(l.events[l.events.length-1][1]).slice(1,-1)))?n(f):r(f)}function u(f){return r(f)}}function rC(e,n,r){return l;function l(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),s}function s(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),n):r(o)}}const aC={name:"labelStartImage",resolveAll:Up.resolveAll,tokenize:lC};function lC(e,n,r){const l=this;return s;function s(f){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(f),e.exit("labelImageMarker"),o}function o(f){return f===91?(e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelImage"),u):r(f)}function u(f){return f===94&&"_hiddenFootnoteSupport"in l.parser.constructs?r(f):n(f)}}const iC={name:"labelStartLink",resolveAll:Up.resolveAll,tokenize:sC};function sC(e,n,r){const l=this;return s;function s(u){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelLink"),o}function o(u){return u===94&&"_hiddenFootnoteSupport"in l.parser.constructs?r(u):n(u)}}const ih={name:"lineEnding",tokenize:oC};function oC(e,n){return r;function r(l){return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),dt(e,n,"linePrefix")}}const Ju={name:"thematicBreak",tokenize:uC};function uC(e,n,r){let l=0,s;return o;function o(p){return e.enter("thematicBreak"),u(p)}function u(p){return s=p,f(p)}function f(p){return p===s?(e.enter("thematicBreakSequence"),h(p)):l>=3&&(p===null||He(p))?(e.exit("thematicBreak"),n(p)):r(p)}function h(p){return p===s?(e.consume(p),l++,h):(e.exit("thematicBreakSequence"),it(p)?dt(e,f,"whitespace")(p):f(p))}}const Jn={continuation:{tokenize:hC},exit:mC,name:"list",tokenize:dC},cC={partial:!0,tokenize:gC},fC={partial:!0,tokenize:pC};function dC(e,n,r){const l=this,s=l.events[l.events.length-1];let o=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,u=0;return f;function f(v){const w=l.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!l.containerState.marker||v===l.containerState.marker:tp(v)){if(l.containerState.type||(l.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(Ju,r,p)(v):p(v);if(!l.interrupt||v===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),h(v)}return r(v)}function h(v){return tp(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)):r(v)}function p(v){return e.enter("listItemMarker"),e.consume(v),e.exit("listItemMarker"),l.containerState.marker=l.containerState.marker||v,e.check(po,l.interrupt?r:g,e.attempt(cC,y,x))}function g(v){return l.containerState.initialBlankLine=!0,o++,y(v)}function x(v){return it(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),y):r(v)}function y(v){return l.containerState.size=o+l.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(v)}}function hC(e,n,r){const l=this;return l.containerState._closeFlow=void 0,e.check(po,s,o);function s(f){return l.containerState.furtherBlankLines=l.containerState.furtherBlankLines||l.containerState.initialBlankLine,dt(e,n,"listItemIndent",l.containerState.size+1)(f)}function o(f){return l.containerState.furtherBlankLines||!it(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(fC,n,u)(f))}function u(f){return l.containerState._closeFlow=!0,l.interrupt=void 0,dt(e,e.attempt(Jn,n,r),"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function pC(e,n,r){const l=this;return dt(e,s,"listItemIndent",l.containerState.size+1);function s(o){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(o):r(o)}}function mC(e){e.exit(this.containerState.type)}function gC(e,n,r){const l=this;return dt(e,s,"listItemPrefixWhitespace",l.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(o){const u=l.events[l.events.length-1];return!it(o)&&u&&u[1].type==="listItemPrefixWhitespace"?n(o):r(o)}}const qy={name:"setextUnderline",resolveTo:xC,tokenize:bC};function xC(e,n){let r=e.length,l,s,o;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){l=r;break}e[r][1].type==="paragraph"&&(s=r)}else e[r][1].type==="content"&&e.splice(r,1),!o&&e[r][1].type==="definition"&&(o=r);const u={type:"setextHeading",start:{...e[l][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",o?(e.splice(s,0,["enter",u,n]),e.splice(o+1,0,["exit",e[l][1],n]),e[l][1].end={...e[o][1].end}):e[l][1]=u,e.push(["exit",u,n]),e}function bC(e,n,r){const l=this;let s;return o;function o(p){let g=l.events.length,x;for(;g--;)if(l.events[g][1].type!=="lineEnding"&&l.events[g][1].type!=="linePrefix"&&l.events[g][1].type!=="content"){x=l.events[g][1].type==="paragraph";break}return!l.parser.lazy[l.now().line]&&(l.interrupt||x)?(e.enter("setextHeadingLine"),s=p,u(p)):r(p)}function u(p){return e.enter("setextHeadingLineSequence"),f(p)}function f(p){return p===s?(e.consume(p),f):(e.exit("setextHeadingLineSequence"),it(p)?dt(e,h,"lineSuffix")(p):h(p))}function h(p){return p===null||He(p)?(e.exit("setextHeadingLine"),n(p)):r(p)}}const yC={tokenize:vC};function vC(e){const n=this,r=e.attempt(po,l,e.attempt(this.parser.constructs.flowInitial,s,dt(e,e.attempt(this.parser.constructs.flow,s,e.attempt(NA,s)),"linePrefix")));return r;function l(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),n.currentConstruct=void 0,r}function s(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n.currentConstruct=void 0,r}}const kC={resolveAll:Tv()},wC=_v("string"),SC=_v("text");function _v(e){return{resolveAll:Tv(e==="text"?EC:void 0),tokenize:n};function n(r){const l=this,s=this.parser.constructs[e],o=r.attempt(s,u,f);return u;function u(g){return p(g)?o(g):f(g)}function f(g){if(g===null){r.consume(g);return}return r.enter("data"),r.consume(g),h}function h(g){return p(g)?(r.exit("data"),o(g)):(r.consume(g),h)}function p(g){if(g===null)return!0;const x=s[g];let y=-1;if(x)for(;++y<x.length;){const v=x[y];if(!v.previous||v.previous.call(l,l.previous))return!0}return!1}}}function Tv(e){return n;function n(r,l){let s=-1,o;for(;++s<=r.length;)o===void 0?r[s]&&r[s][1].type==="data"&&(o=s,s++):(!r[s]||r[s][1].type!=="data")&&(s!==o+2&&(r[o][1].end=r[s-1][1].end,r.splice(o+2,s-o-2),s=o+2),o=void 0);return e?e(r,l):r}}function EC(e,n){let r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type==="lineEnding")&&e[r-1][1].type==="data"){const l=e[r-1][1],s=n.sliceStream(l);let o=s.length,u=-1,f=0,h;for(;o--;){const p=s[o];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){o++;break}}if(n._contentTypeTextTrailing&&r===e.length&&(f=0),f){const p={type:r===e.length||h||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?u:l.start._bufferIndex+u,_index:l.start._index+o,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(r,0,["enter",p,n],["exit",p,n]),r+=2)}r++}return e}const NC={42:Jn,43:Jn,45:Jn,48:Jn,49:Jn,50:Jn,51:Jn,52:Jn,53:Jn,54:Jn,55:Jn,56:Jn,57:Jn,62:yv},_C={91:jA},TC={[-2]:lh,[-1]:lh,32:lh},AC={35:LA,42:Ju,45:[qy,Ju],60:UA,61:qy,95:Ju,96:Fy,126:Fy},CC={38:kv,92:vv},jC={[-5]:ih,[-4]:ih,[-3]:ih,33:aC,38:kv,42:np,60:[iA,VA],91:iC,92:[DA,vv],93:Up,95:np,96:yA},RC={null:[np,kC]},MC={null:[42,95]},OC={null:[]},DC=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:MC,contentInitial:_C,disable:OC,document:NC,flow:AC,flowInitial:TC,insideSpan:RC,string:CC,text:jC},Symbol.toStringTag,{value:"Module"}));function zC(e,n,r){let l={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0};const s={},o=[];let u=[],f=[];const h={attempt:D(B),check:D(_),consume:R,enter:j,exit:$,interrupt:D(_,{interrupt:!0})},p={code:null,containerState:{},defineSkip:E,events:[],now:w,parser:e,previous:null,sliceSerialize:y,sliceStream:v,write:x};let g=n.tokenize.call(p,h);return n.resolveAll&&o.push(n),p;function x(X){return u=Cr(u,X),N(),u[u.length-1]!==null?[]:(F(n,0),p.events=Sc(o,p.events,p),p.events)}function y(X,Z){return IC(v(X),Z)}function v(X){return LC(u,X)}function w(){const{_bufferIndex:X,_index:Z,line:te,column:J,offset:G}=l;return{_bufferIndex:X,_index:Z,line:te,column:J,offset:G}}function E(X){s[X.line]=X.column,L()}function N(){let X;for(;l._index<u.length;){const Z=u[l._index];if(typeof Z=="string")for(X=l._index,l._bufferIndex<0&&(l._bufferIndex=0);l._index===X&&l._bufferIndex<Z.length;)T(Z.charCodeAt(l._bufferIndex));else T(Z)}}function T(X){g=g(X)}function R(X){He(X)?(l.line++,l.column=1,l.offset+=X===-3?2:1,L()):X!==-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=X}function j(X,Z){const te=Z||{};return te.type=X,te.start=w(),p.events.push(["enter",te,p]),f.push(te),te}function $(X){const Z=f.pop();return Z.end=w(),p.events.push(["exit",Z,p]),Z}function B(X,Z){F(X,Z.from)}function _(X,Z){Z.restore()}function D(X,Z){return te;function te(J,G,z){let V,ne,be,M;return Array.isArray(J)?I(J):"tokenize"in J?I([J]):O(J);function O(he){return pe;function pe(Ae){const Re=Ae!==null&&he[Ae],qe=Ae!==null&&he.null,pt=[...Array.isArray(Re)?Re:Re?[Re]:[],...Array.isArray(qe)?qe:qe?[qe]:[]];return I(pt)(Ae)}}function I(he){return V=he,ne=0,he.length===0?z:A(he[ne])}function A(he){return pe;function pe(Ae){return M=Y(),be=he,he.partial||(p.currentConstruct=he),he.name&&p.parser.constructs.disable.null.includes(he.name)?le():he.tokenize.call(Z?Object.assign(Object.create(p),Z):p,h,oe,le)(Ae)}}function oe(he){return X(be,M),G}function le(he){return M.restore(),++ne<V.length?A(V[ne]):z}}}function F(X,Z){X.resolveAll&&!o.includes(X)&&o.push(X),X.resolve&&mr(p.events,Z,p.events.length-Z,X.resolve(p.events.slice(Z),p)),X.resolveTo&&(p.events=X.resolveTo(p.events,p))}function Y(){const X=w(),Z=p.previous,te=p.currentConstruct,J=p.events.length,G=Array.from(f);return{from:J,restore:z};function z(){l=X,p.previous=Z,p.currentConstruct=te,p.events.length=J,f=G,L()}}function L(){l.line in s&&l.column<2&&(l.column=s[l.line],l.offset+=s[l.line]-1)}}function LC(e,n){const r=n.start._index,l=n.start._bufferIndex,s=n.end._index,o=n.end._bufferIndex;let u;if(r===s)u=[e[r].slice(l,o)];else{if(u=e.slice(r,s),l>-1){const f=u[0];typeof f=="string"?u[0]=f.slice(l):u.shift()}o>0&&u.push(e[s].slice(0,o))}return u}function IC(e,n){let r=-1;const l=[];let s;for(;++r<e.length;){const o=e[r];let u;if(typeof o=="string")u=o;else switch(o){case-5:{u="\r";break}case-4:{u=`
|
|
16
|
+
`;break}case-3:{u=`\r
|
|
17
|
+
`;break}case-2:{u=n?" ":" ";break}case-1:{if(!n&&s)continue;u=" ";break}default:u=String.fromCharCode(o)}s=o===-2,l.push(u)}return l.join("")}function BC(e){const l={constructs:xv([DC,...(e||{}).extensions||[]]),content:s(JT),defined:[],document:s(tA),flow:s(yC),lazy:{},string:s(wC),text:s(SC)};return l;function s(o){return u;function u(f){return zC(l,o,f)}}}function $C(e){for(;!wv(e););return e}const Yy=/[\0\t\n\r]/g;function UC(){let e=1,n="",r=!0,l;return s;function s(o,u,f){const h=[];let p,g,x,y,v;for(o=n+(typeof o=="string"?o.toString():new TextDecoder(u||void 0).decode(o)),x=0,n="",r&&(o.charCodeAt(0)===65279&&x++,r=void 0);x<o.length;){if(Yy.lastIndex=x,p=Yy.exec(o),y=p&&p.index!==void 0?p.index:o.length,v=o.charCodeAt(y),!p){n=o.slice(x);break}if(v===10&&x===y&&l)h.push(-3),l=void 0;else switch(l&&(h.push(-5),l=void 0),x<y&&(h.push(o.slice(x,y)),e+=y-x),v){case 0:{h.push(65533),e++;break}case 9:{for(g=Math.ceil(e/4)*4,h.push(-2);e++<g;)h.push(-1);break}case 10:{h.push(-4),e=1;break}default:l=!0,e=1}x=y+1}return f&&(l&&h.push(-5),n&&h.push(n),h.push(null)),h}}const HC=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function PC(e){return e.replace(HC,FC)}function FC(e,n,r){if(n)return n;if(r.charCodeAt(0)===35){const s=r.charCodeAt(1),o=s===120||s===88;return bv(r.slice(o?2:1),o?16:10)}return $p(r)||e}const Av={}.hasOwnProperty;function GC(e,n,r){return n&&typeof n=="object"&&(r=n,n=void 0),qC(r)($C(BC(r).document().write(UC()(e,n,!0))))}function qC(e){const n={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(gt),autolinkProtocol:Y,autolinkEmail:Y,atxHeading:o(ve),blockQuote:o(qe),characterEscape:Y,characterReference:Y,codeFenced:o(pt),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:o(pt,u),codeText:o(St,u),codeTextData:Y,data:Y,codeFlowValue:Y,definition:o(Ge),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:o(Et),hardBreakEscape:o(Ee),hardBreakTrailing:o(Ee),htmlFlow:o(mt,u),htmlFlowData:Y,htmlText:o(mt,u),htmlTextData:Y,image:o(ze),label:u,link:o(gt),listItem:o(Sn),listItemValue:y,listOrdered:o(Wt,x),listUnordered:o(Wt),paragraph:o(Pn),reference:A,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:o(ve),strong:o(zn),thematicBreak:o(pn)},exit:{atxHeading:h(),atxHeadingSequence:B,autolink:h(),autolinkEmail:Re,autolinkProtocol:Ae,blockQuote:h(),characterEscapeValue:L,characterReferenceMarkerHexadecimal:le,characterReferenceMarkerNumeric:le,characterReferenceValue:he,characterReference:pe,codeFenced:h(N),codeFencedFence:E,codeFencedFenceInfo:v,codeFencedFenceMeta:w,codeFlowValue:L,codeIndented:h(T),codeText:h(G),codeTextData:L,data:L,definition:h(),definitionDestinationString:$,definitionLabelString:R,definitionTitleString:j,emphasis:h(),hardBreakEscape:h(Z),hardBreakTrailing:h(Z),htmlFlow:h(te),htmlFlowData:L,htmlText:h(J),htmlTextData:L,image:h(V),label:be,labelText:ne,lineEnding:X,link:h(z),listItem:h(),listOrdered:h(),listUnordered:h(),paragraph:h(),referenceString:oe,resourceDestinationString:M,resourceTitleString:O,resource:I,setextHeading:h(F),setextHeadingLineSequence:D,setextHeadingText:_,strong:h(),thematicBreak:h()}};Cv(n,(e||{}).mdastExtensions||[]);const r={};return l;function l(se){let ge={type:"root",children:[]};const re={stack:[ge],tokenStack:[],config:n,enter:f,exit:p,buffer:u,resume:g,data:r},we=[];let $e=-1;for(;++$e<se.length;)if(se[$e][1].type==="listOrdered"||se[$e][1].type==="listUnordered")if(se[$e][0]==="enter")we.push($e);else{const xt=we.pop();$e=s(se,xt,$e)}for($e=-1;++$e<se.length;){const xt=n[se[$e][0]];Av.call(xt,se[$e][1].type)&&xt[se[$e][1].type].call(Object.assign({sliceSerialize:se[$e][2].sliceSerialize},re),se[$e][1])}if(re.tokenStack.length>0){const xt=re.tokenStack[re.tokenStack.length-1];(xt[1]||Vy).call(re,void 0,xt[0])}for(ge.position={start:el(se.length>0?se[0][1].start:{line:1,column:1,offset:0}),end:el(se.length>0?se[se.length-2][1].end:{line:1,column:1,offset:0})},$e=-1;++$e<n.transforms.length;)ge=n.transforms[$e](ge)||ge;return ge}function s(se,ge,re){let we=ge-1,$e=-1,xt=!1,Mt,Pt,nt,bt;for(;++we<=re;){const Je=se[we];switch(Je[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Je[0]==="enter"?$e++:$e--,bt=void 0;break}case"lineEndingBlank":{Je[0]==="enter"&&(Mt&&!bt&&!$e&&!nt&&(nt=we),bt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:bt=void 0}if(!$e&&Je[0]==="enter"&&Je[1].type==="listItemPrefix"||$e===-1&&Je[0]==="exit"&&(Je[1].type==="listUnordered"||Je[1].type==="listOrdered")){if(Mt){let bn=we;for(Pt=void 0;bn--;){const Jt=se[bn];if(Jt[1].type==="lineEnding"||Jt[1].type==="lineEndingBlank"){if(Jt[0]==="exit")continue;Pt&&(se[Pt][1].type="lineEndingBlank",xt=!0),Jt[1].type="lineEnding",Pt=bn}else if(!(Jt[1].type==="linePrefix"||Jt[1].type==="blockQuotePrefix"||Jt[1].type==="blockQuotePrefixWhitespace"||Jt[1].type==="blockQuoteMarker"||Jt[1].type==="listItemIndent"))break}nt&&(!Pt||nt<Pt)&&(Mt._spread=!0),Mt.end=Object.assign({},Pt?se[Pt][1].start:Je[1].end),se.splice(Pt||we,0,["exit",Mt,Je[2]]),we++,re++}if(Je[1].type==="listItemPrefix"){const bn={type:"listItem",_spread:!1,start:Object.assign({},Je[1].start),end:void 0};Mt=bn,se.splice(we,0,["enter",bn,Je[2]]),we++,re++,nt=void 0,bt=!0}}}return se[ge][1]._spread=xt,re}function o(se,ge){return re;function re(we){f.call(this,se(we),we),ge&&ge.call(this,we)}}function u(){this.stack.push({type:"fragment",children:[]})}function f(se,ge,re){this.stack[this.stack.length-1].children.push(se),this.stack.push(se),this.tokenStack.push([ge,re||void 0]),se.position={start:el(ge.start),end:void 0}}function h(se){return ge;function ge(re){se&&se.call(this,re),p.call(this,re)}}function p(se,ge){const re=this.stack.pop(),we=this.tokenStack.pop();if(we)we[0].type!==se.type&&(ge?ge.call(this,se,we[0]):(we[1]||Vy).call(this,se,we[0]));else throw new Error("Cannot close `"+se.type+"` ("+Zs({start:se.start,end:se.end})+"): it’s not open");re.position.end=el(se.end)}function g(){return Bp(this.stack.pop())}function x(){this.data.expectingFirstListItemValue=!0}function y(se){if(this.data.expectingFirstListItemValue){const ge=this.stack[this.stack.length-2];ge.start=Number.parseInt(this.sliceSerialize(se),10),this.data.expectingFirstListItemValue=void 0}}function v(){const se=this.resume(),ge=this.stack[this.stack.length-1];ge.lang=se}function w(){const se=this.resume(),ge=this.stack[this.stack.length-1];ge.meta=se}function E(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function N(){const se=this.resume(),ge=this.stack[this.stack.length-1];ge.value=se.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function T(){const se=this.resume(),ge=this.stack[this.stack.length-1];ge.value=se.replace(/(\r?\n|\r)$/g,"")}function R(se){const ge=this.resume(),re=this.stack[this.stack.length-1];re.label=ge,re.identifier=$r(this.sliceSerialize(se)).toLowerCase()}function j(){const se=this.resume(),ge=this.stack[this.stack.length-1];ge.title=se}function $(){const se=this.resume(),ge=this.stack[this.stack.length-1];ge.url=se}function B(se){const ge=this.stack[this.stack.length-1];if(!ge.depth){const re=this.sliceSerialize(se).length;ge.depth=re}}function _(){this.data.setextHeadingSlurpLineEnding=!0}function D(se){const ge=this.stack[this.stack.length-1];ge.depth=this.sliceSerialize(se).codePointAt(0)===61?1:2}function F(){this.data.setextHeadingSlurpLineEnding=void 0}function Y(se){const re=this.stack[this.stack.length-1].children;let we=re[re.length-1];(!we||we.type!=="text")&&(we=kt(),we.position={start:el(se.start),end:void 0},re.push(we)),this.stack.push(we)}function L(se){const ge=this.stack.pop();ge.value+=this.sliceSerialize(se),ge.position.end=el(se.end)}function X(se){const ge=this.stack[this.stack.length-1];if(this.data.atHardBreak){const re=ge.children[ge.children.length-1];re.position.end=el(se.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&n.canContainEols.includes(ge.type)&&(Y.call(this,se),L.call(this,se))}function Z(){this.data.atHardBreak=!0}function te(){const se=this.resume(),ge=this.stack[this.stack.length-1];ge.value=se}function J(){const se=this.resume(),ge=this.stack[this.stack.length-1];ge.value=se}function G(){const se=this.resume(),ge=this.stack[this.stack.length-1];ge.value=se}function z(){const se=this.stack[this.stack.length-1];if(this.data.inReference){const ge=this.data.referenceType||"shortcut";se.type+="Reference",se.referenceType=ge,delete se.url,delete se.title}else delete se.identifier,delete se.label;this.data.referenceType=void 0}function V(){const se=this.stack[this.stack.length-1];if(this.data.inReference){const ge=this.data.referenceType||"shortcut";se.type+="Reference",se.referenceType=ge,delete se.url,delete se.title}else delete se.identifier,delete se.label;this.data.referenceType=void 0}function ne(se){const ge=this.sliceSerialize(se),re=this.stack[this.stack.length-2];re.label=PC(ge),re.identifier=$r(ge).toLowerCase()}function be(){const se=this.stack[this.stack.length-1],ge=this.resume(),re=this.stack[this.stack.length-1];if(this.data.inReference=!0,re.type==="link"){const we=se.children;re.children=we}else re.alt=ge}function M(){const se=this.resume(),ge=this.stack[this.stack.length-1];ge.url=se}function O(){const se=this.resume(),ge=this.stack[this.stack.length-1];ge.title=se}function I(){this.data.inReference=void 0}function A(){this.data.referenceType="collapsed"}function oe(se){const ge=this.resume(),re=this.stack[this.stack.length-1];re.label=ge,re.identifier=$r(this.sliceSerialize(se)).toLowerCase(),this.data.referenceType="full"}function le(se){this.data.characterReferenceType=se.type}function he(se){const ge=this.sliceSerialize(se),re=this.data.characterReferenceType;let we;re?(we=bv(ge,re==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):we=$p(ge);const $e=this.stack[this.stack.length-1];$e.value+=we}function pe(se){const ge=this.stack.pop();ge.position.end=el(se.end)}function Ae(se){L.call(this,se);const ge=this.stack[this.stack.length-1];ge.url=this.sliceSerialize(se)}function Re(se){L.call(this,se);const ge=this.stack[this.stack.length-1];ge.url="mailto:"+this.sliceSerialize(se)}function qe(){return{type:"blockquote",children:[]}}function pt(){return{type:"code",lang:null,meta:null,value:""}}function St(){return{type:"inlineCode",value:""}}function Ge(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Et(){return{type:"emphasis",children:[]}}function ve(){return{type:"heading",depth:0,children:[]}}function Ee(){return{type:"break"}}function mt(){return{type:"html",value:""}}function ze(){return{type:"image",title:null,url:"",alt:null}}function gt(){return{type:"link",title:null,url:"",children:[]}}function Wt(se){return{type:"list",ordered:se.type==="listOrdered",start:null,spread:se._spread,children:[]}}function Sn(se){return{type:"listItem",spread:se._spread,checked:null,children:[]}}function Pn(){return{type:"paragraph",children:[]}}function zn(){return{type:"strong",children:[]}}function kt(){return{type:"text",value:""}}function pn(){return{type:"thematicBreak"}}}function el(e){return{line:e.line,column:e.column,offset:e.offset}}function Cv(e,n){let r=-1;for(;++r<n.length;){const l=n[r];Array.isArray(l)?Cv(e,l):YC(e,l)}}function YC(e,n){let r;for(r in n)if(Av.call(n,r))switch(r){case"canContainEols":{const l=n[r];l&&e[r].push(...l);break}case"transforms":{const l=n[r];l&&e[r].push(...l);break}case"enter":case"exit":{const l=n[r];l&&Object.assign(e[r],l);break}}}function Vy(e,n){throw e?new Error("Cannot close `"+e.type+"` ("+Zs({start:e.start,end:e.end})+"): a different token (`"+n.type+"`, "+Zs({start:n.start,end:n.end})+") is open"):new Error("Cannot close document, a token (`"+n.type+"`, "+Zs({start:n.start,end:n.end})+") is still open")}function VC(e){const n=this;n.parser=r;function r(l){return GC(l,{...n.data("settings"),...e,extensions:n.data("micromarkExtensions")||[],mdastExtensions:n.data("fromMarkdownExtensions")||[]})}}function XC(e,n){const r={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(n),!0)};return e.patch(n,r),e.applyData(n,r)}function KC(e,n){const r={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,r),[e.applyData(n,r),{type:"text",value:`
|
|
18
|
+
`}]}function ZC(e,n){const r=n.value?n.value+`
|
|
19
|
+
`:"",l={},s=n.lang?n.lang.split(/\s+/):[];s.length>0&&(l.className=["language-"+s[0]]);let o={type:"element",tagName:"code",properties:l,children:[{type:"text",value:r}]};return n.meta&&(o.data={meta:n.meta}),e.patch(n,o),o=e.applyData(n,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(n,o),o}function QC(e,n){const r={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function WC(e,n){const r={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function JC(e,n){const r=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",l=String(n.identifier).toUpperCase(),s=Ii(l.toLowerCase()),o=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=o+1,f+=1,e.footnoteCounts.set(l,f);const h={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+s,id:r+"fnref-"+s+(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 ej(e,n){const r={type:"element",tagName:"h"+n.depth,properties:{},children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function tj(e,n){if(e.options.allowDangerousHtml){const r={type:"raw",value:n.value};return e.patch(n,r),e.applyData(n,r)}}function jv(e,n){const r=n.referenceType;let l="]";if(r==="collapsed"?l+="[]":r==="full"&&(l+="["+(n.label||n.identifier)+"]"),n.type==="imageReference")return[{type:"text",value:"!["+n.alt+l}];const s=e.all(n),o=s[0];o&&o.type==="text"?o.value="["+o.value:s.unshift({type:"text",value:"["});const u=s[s.length-1];return u&&u.type==="text"?u.value+=l:s.push({type:"text",value:l}),s}function nj(e,n){const r=String(n.identifier).toUpperCase(),l=e.definitionById.get(r);if(!l)return jv(e,n);const s={src:Ii(l.url||""),alt:n.alt};l.title!==null&&l.title!==void 0&&(s.title=l.title);const o={type:"element",tagName:"img",properties:s,children:[]};return e.patch(n,o),e.applyData(n,o)}function rj(e,n){const r={src:Ii(n.url)};n.alt!==null&&n.alt!==void 0&&(r.alt=n.alt),n.title!==null&&n.title!==void 0&&(r.title=n.title);const l={type:"element",tagName:"img",properties:r,children:[]};return e.patch(n,l),e.applyData(n,l)}function aj(e,n){const r={type:"text",value:n.value.replace(/\r?\n|\r/g," ")};e.patch(n,r);const l={type:"element",tagName:"code",properties:{},children:[r]};return e.patch(n,l),e.applyData(n,l)}function lj(e,n){const r=String(n.identifier).toUpperCase(),l=e.definitionById.get(r);if(!l)return jv(e,n);const s={href:Ii(l.url||"")};l.title!==null&&l.title!==void 0&&(s.title=l.title);const o={type:"element",tagName:"a",properties:s,children:e.all(n)};return e.patch(n,o),e.applyData(n,o)}function ij(e,n){const r={href:Ii(n.url)};n.title!==null&&n.title!==void 0&&(r.title=n.title);const l={type:"element",tagName:"a",properties:r,children:e.all(n)};return e.patch(n,l),e.applyData(n,l)}function sj(e,n,r){const l=e.all(n),s=r?oj(r):Rv(n),o={},u=[];if(typeof n.checked=="boolean"){const g=l[0];let x;g&&g.type==="element"&&g.tagName==="p"?x=g:(x={type:"element",tagName:"p",properties:{},children:[]},l.unshift(x)),x.children.length>0&&x.children.unshift({type:"text",value:" "}),x.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:n.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let f=-1;for(;++f<l.length;){const g=l[f];(s||f!==0||g.type!=="element"||g.tagName!=="p")&&u.push({type:"text",value:`
|
|
20
|
+
`}),g.type==="element"&&g.tagName==="p"&&!s?u.push(...g.children):u.push(g)}const h=l[l.length-1];h&&(s||h.type!=="element"||h.tagName!=="p")&&u.push({type:"text",value:`
|
|
21
|
+
`});const p={type:"element",tagName:"li",properties:o,children:u};return e.patch(n,p),e.applyData(n,p)}function oj(e){let n=!1;if(e.type==="list"){n=e.spread||!1;const r=e.children;let l=-1;for(;!n&&++l<r.length;)n=Rv(r[l])}return n}function Rv(e){const n=e.spread;return n??e.children.length>1}function uj(e,n){const r={},l=e.all(n);let s=-1;for(typeof n.start=="number"&&n.start!==1&&(r.start=n.start);++s<l.length;){const u=l[s];if(u.type==="element"&&u.tagName==="li"&&u.properties&&Array.isArray(u.properties.className)&&u.properties.className.includes("task-list-item")){r.className=["contains-task-list"];break}}const o={type:"element",tagName:n.ordered?"ol":"ul",properties:r,children:e.wrap(l,!0)};return e.patch(n,o),e.applyData(n,o)}function cj(e,n){const r={type:"element",tagName:"p",properties:{},children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function fj(e,n){const r={type:"root",children:e.wrap(e.all(n))};return e.patch(n,r),e.applyData(n,r)}function dj(e,n){const r={type:"element",tagName:"strong",properties:{},children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function hj(e,n){const r=e.all(n),l=r.shift(),s=[];if(l){const u={type:"element",tagName:"thead",properties:{},children:e.wrap([l],!0)};e.patch(n.children[0],u),s.push(u)}if(r.length>0){const u={type:"element",tagName:"tbody",properties:{},children:e.wrap(r,!0)},f=Dp(n.children[1]),h=cv(n.children[n.children.length-1]);f&&h&&(u.position={start:f,end:h}),s.push(u)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(n,o),e.applyData(n,o)}function pj(e,n,r){const l=r?r.children:void 0,o=(l?l.indexOf(n):1)===0?"th":"td",u=r&&r.type==="table"?r.align:void 0,f=u?u.length:n.children.length;let h=-1;const p=[];for(;++h<f;){const x=n.children[h],y={},v=u?u[h]:void 0;v&&(y.align=v);let w={type:"element",tagName:o,properties:y,children:[]};x&&(w.children=e.all(x),e.patch(x,w),w=e.applyData(x,w)),p.push(w)}const g={type:"element",tagName:"tr",properties:{},children:e.wrap(p,!0)};return e.patch(n,g),e.applyData(n,g)}function mj(e,n){const r={type:"element",tagName:"td",properties:{},children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}const Xy=9,Ky=32;function gj(e){const n=String(e),r=/\r?\n|\r/g;let l=r.exec(n),s=0;const o=[];for(;l;)o.push(Zy(n.slice(s,l.index),s>0,!0),l[0]),s=l.index+l[0].length,l=r.exec(n);return o.push(Zy(n.slice(s),s>0,!1)),o.join("")}function Zy(e,n,r){let l=0,s=e.length;if(n){let o=e.codePointAt(l);for(;o===Xy||o===Ky;)l++,o=e.codePointAt(l)}if(r){let o=e.codePointAt(s-1);for(;o===Xy||o===Ky;)s--,o=e.codePointAt(s-1)}return s>l?e.slice(l,s):""}function xj(e,n){const r={type:"text",value:gj(String(n.value))};return e.patch(n,r),e.applyData(n,r)}function bj(e,n){const r={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,r),e.applyData(n,r)}const yj={blockquote:XC,break:KC,code:ZC,delete:QC,emphasis:WC,footnoteReference:JC,heading:ej,html:tj,imageReference:nj,image:rj,inlineCode:aj,linkReference:lj,link:ij,listItem:sj,list:uj,paragraph:cj,root:fj,strong:dj,table:hj,tableCell:mj,tableRow:pj,text:xj,thematicBreak:bj,toml:zu,yaml:zu,definition:zu,footnoteDefinition:zu};function zu(){}const Mv=-1,Ec=0,Ws=1,oc=2,Hp=3,Pp=4,Fp=5,Gp=6,Ov=7,Dv=8,Qy=typeof self=="object"?self:globalThis,vj=(e,n)=>{const r=(s,o)=>(e.set(o,s),s),l=s=>{if(e.has(s))return e.get(s);const[o,u]=n[s];switch(o){case Ec:case Mv:return r(u,s);case Ws:{const f=r([],s);for(const h of u)f.push(l(h));return f}case oc:{const f=r({},s);for(const[h,p]of u)f[l(h)]=l(p);return f}case Hp:return r(new Date(u),s);case Pp:{const{source:f,flags:h}=u;return r(new RegExp(f,h),s)}case Fp:{const f=r(new Map,s);for(const[h,p]of u)f.set(l(h),l(p));return f}case Gp:{const f=r(new Set,s);for(const h of u)f.add(l(h));return f}case Ov:{const{name:f,message:h}=u;return r(new Qy[f](h),s)}case Dv:return r(BigInt(u),s);case"BigInt":return r(Object(BigInt(u)),s);case"ArrayBuffer":return r(new Uint8Array(u).buffer,u);case"DataView":{const{buffer:f}=new Uint8Array(u);return r(new DataView(f),u)}}return r(new Qy[o](u),s)};return l},Wy=e=>vj(new Map,e)(0),vi="",{toString:kj}={},{keys:wj}=Object,Ls=e=>{const n=typeof e;if(n!=="object"||!e)return[Ec,n];const r=kj.call(e).slice(8,-1);switch(r){case"Array":return[Ws,vi];case"Object":return[oc,vi];case"Date":return[Hp,vi];case"RegExp":return[Pp,vi];case"Map":return[Fp,vi];case"Set":return[Gp,vi];case"DataView":return[Ws,r]}return r.includes("Array")?[Ws,r]:r.includes("Error")?[Ov,r]:[oc,r]},Lu=([e,n])=>e===Ec&&(n==="function"||n==="symbol"),Sj=(e,n,r,l)=>{const s=(u,f)=>{const h=l.push(u)-1;return r.set(f,h),h},o=u=>{if(r.has(u))return r.get(u);let[f,h]=Ls(u);switch(f){case Ec:{let g=u;switch(h){case"bigint":f=Dv,g=u.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+h);g=null;break;case"undefined":return s([Mv],u)}return s([f,g],u)}case Ws:{if(h){let y=u;return h==="DataView"?y=new Uint8Array(u.buffer):h==="ArrayBuffer"&&(y=new Uint8Array(u)),s([h,[...y]],u)}const g=[],x=s([f,g],u);for(const y of u)g.push(o(y));return x}case oc:{if(h)switch(h){case"BigInt":return s([h,u.toString()],u);case"Boolean":case"Number":case"String":return s([h,u.valueOf()],u)}if(n&&"toJSON"in u)return o(u.toJSON());const g=[],x=s([f,g],u);for(const y of wj(u))(e||!Lu(Ls(u[y])))&&g.push([o(y),o(u[y])]);return x}case Hp:return s([f,u.toISOString()],u);case Pp:{const{source:g,flags:x}=u;return s([f,{source:g,flags:x}],u)}case Fp:{const g=[],x=s([f,g],u);for(const[y,v]of u)(e||!(Lu(Ls(y))||Lu(Ls(v))))&&g.push([o(y),o(v)]);return x}case Gp:{const g=[],x=s([f,g],u);for(const y of u)(e||!Lu(Ls(y)))&&g.push(o(y));return x}}const{message:p}=u;return s([f,{name:h,message:p}],u)};return o},Jy=(e,{json:n,lossy:r}={})=>{const l=[];return Sj(!(n||r),!!n,new Map,l)(e),l},uc=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?Wy(Jy(e,n)):structuredClone(e):(e,n)=>Wy(Jy(e,n));function Ej(e,n){const r=[{type:"text",value:"↩"}];return n>1&&r.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(n)}]}),r}function Nj(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function _j(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=e.options.footnoteBackContent||Ej,l=e.options.footnoteBackLabel||Nj,s=e.options.footnoteLabel||"Footnotes",o=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 g=e.all(p),x=String(p.identifier).toUpperCase(),y=Ii(x.toLowerCase());let v=0;const w=[],E=e.footnoteCounts.get(x);for(;E!==void 0&&++v<=E;){w.length>0&&w.push({type:"text",value:" "});let R=typeof r=="string"?r:r(h,v);typeof R=="string"&&(R={type:"text",value:R}),w.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+y+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof l=="string"?l:l(h,v),className:["data-footnote-backref"]},children:Array.isArray(R)?R:[R]})}const N=g[g.length-1];if(N&&N.type==="element"&&N.tagName==="p"){const R=N.children[N.children.length-1];R&&R.type==="text"?R.value+=" ":N.children.push({type:"text",value:" "}),N.children.push(...w)}else g.push(...w);const T={type:"element",tagName:"li",properties:{id:n+"fn-"+y},children:e.wrap(g,!0)};e.patch(p,T),f.push(T)}if(f.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...uc(u),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
|
|
22
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(f,!0)},{type:"text",value:`
|
|
23
|
+
`}]}}const Nc=(function(e){if(e==null)return jj;if(typeof e=="function")return _c(e);if(typeof e=="object")return Array.isArray(e)?Tj(e):Aj(e);if(typeof e=="string")return Cj(e);throw new Error("Expected function, string, or object as test")});function Tj(e){const n=[];let r=-1;for(;++r<e.length;)n[r]=Nc(e[r]);return _c(l);function l(...s){let o=-1;for(;++o<n.length;)if(n[o].apply(this,s))return!0;return!1}}function Aj(e){const n=e;return _c(r);function r(l){const s=l;let o;for(o in e)if(s[o]!==n[o])return!1;return!0}}function Cj(e){return _c(n);function n(r){return r&&r.type===e}}function _c(e){return n;function n(r,l,s){return!!(Rj(r)&&e.call(this,r,typeof l=="number"?l:void 0,s||void 0))}}function jj(){return!0}function Rj(e){return e!==null&&typeof e=="object"&&"type"in e}const zv=[],Mj=!0,rp=!1,Oj="skip";function Lv(e,n,r,l){let s;typeof n=="function"&&typeof r!="function"?(l=r,r=n):s=n;const o=Nc(s),u=l?-1:1;f(e,void 0,[])();function f(h,p,g){const x=h&&typeof h=="object"?h:{};if(typeof x.type=="string"){const v=typeof x.tagName=="string"?x.tagName:typeof x.name=="string"?x.name:void 0;Object.defineProperty(y,"name",{value:"node ("+(h.type+(v?"<"+v+">":""))+")"})}return y;function y(){let v=zv,w,E,N;if((!n||o(h,p,g[g.length-1]||void 0))&&(v=Dj(r(h,g)),v[0]===rp))return v;if("children"in h&&h.children){const T=h;if(T.children&&v[0]!==Oj)for(E=(l?T.children.length:-1)+u,N=g.concat(T);E>-1&&E<T.children.length;){const R=T.children[E];if(w=f(R,E,N)(),w[0]===rp)return w;E=typeof w[1]=="number"?w[1]:E+u}}return v}}}function Dj(e){return Array.isArray(e)?e:typeof e=="number"?[Mj,e]:e==null?zv:[e]}function qp(e,n,r,l){let s,o,u;typeof n=="function"&&typeof r!="function"?(o=void 0,u=n,s=r):(o=n,u=r,s=l),Lv(e,o,f,s);function f(h,p){const g=p[p.length-1],x=g?g.children.indexOf(h):void 0;return u(h,x,g)}}const ap={}.hasOwnProperty,zj={};function Lj(e,n){const r=n||zj,l=new Map,s=new Map,o=new Map,u={...yj,...r.handlers},f={all:p,applyData:Bj,definitionById:l,footnoteById:s,footnoteCounts:o,footnoteOrder:[],handlers:u,one:h,options:r,patch:Ij,wrap:Uj};return qp(e,function(g){if(g.type==="definition"||g.type==="footnoteDefinition"){const x=g.type==="definition"?l:s,y=String(g.identifier).toUpperCase();x.has(y)||x.set(y,g)}}),f;function h(g,x){const y=g.type,v=f.handlers[y];if(ap.call(f.handlers,y)&&v)return v(f,g,x);if(f.options.passThrough&&f.options.passThrough.includes(y)){if("children"in g){const{children:E,...N}=g,T=uc(N);return T.children=f.all(g),T}return uc(g)}return(f.options.unknownHandler||$j)(f,g,x)}function p(g){const x=[];if("children"in g){const y=g.children;let v=-1;for(;++v<y.length;){const w=f.one(y[v],g);if(w){if(v&&y[v-1].type==="break"&&(!Array.isArray(w)&&w.type==="text"&&(w.value=e1(w.value)),!Array.isArray(w)&&w.type==="element")){const E=w.children[0];E&&E.type==="text"&&(E.value=e1(E.value))}Array.isArray(w)?x.push(...w):x.push(w)}}}return x}}function Ij(e,n){e.position&&(n.position=NT(e))}function Bj(e,n){let r=n;if(e&&e.data){const l=e.data.hName,s=e.data.hChildren,o=e.data.hProperties;if(typeof l=="string")if(r.type==="element")r.tagName=l;else{const u="children"in r?r.children:[r];r={type:"element",tagName:l,properties:{},children:u}}r.type==="element"&&o&&Object.assign(r.properties,uc(o)),"children"in r&&r.children&&s!==null&&s!==void 0&&(r.children=s)}return r}function $j(e,n){const r=n.data||{},l="value"in n&&!(ap.call(r,"hProperties")||ap.call(r,"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 Uj(e,n){const r=[];let l=-1;for(n&&r.push({type:"text",value:`
|
|
24
|
+
`});++l<e.length;)l&&r.push({type:"text",value:`
|
|
25
|
+
`}),r.push(e[l]);return n&&e.length>0&&r.push({type:"text",value:`
|
|
26
|
+
`}),r}function e1(e){let n=0,r=e.charCodeAt(n);for(;r===9||r===32;)n++,r=e.charCodeAt(n);return e.slice(n)}function t1(e,n){const r=Lj(e,n),l=r.one(e,void 0),s=_j(r),o=Array.isArray(l)?{type:"root",children:l}:l||{type:"root",children:[]};return s&&o.children.push({type:"text",value:`
|
|
27
|
+
`},s),o}function Hj(e,n){return e&&"run"in e?async function(r,l){const s=t1(r,{file:l,...n});await e.run(s,l)}:function(r,l){return t1(r,{file:l,...e||n})}}function n1(e){if(e)throw e}var sh,r1;function Pj(){if(r1)return sh;r1=1;var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,l=Object.getOwnPropertyDescriptor,s=function(p){return typeof Array.isArray=="function"?Array.isArray(p):n.call(p)==="[object Array]"},o=function(p){if(!p||n.call(p)!=="[object Object]")return!1;var g=e.call(p,"constructor"),x=p.constructor&&p.constructor.prototype&&e.call(p.constructor.prototype,"isPrototypeOf");if(p.constructor&&!g&&!x)return!1;var y;for(y in p);return typeof y>"u"||e.call(p,y)},u=function(p,g){r&&g.name==="__proto__"?r(p,g.name,{enumerable:!0,configurable:!0,value:g.newValue,writable:!0}):p[g.name]=g.newValue},f=function(p,g){if(g==="__proto__")if(e.call(p,g)){if(l)return l(p,g).value}else return;return p[g]};return sh=function h(){var p,g,x,y,v,w,E=arguments[0],N=1,T=arguments.length,R=!1;for(typeof E=="boolean"&&(R=E,E=arguments[1]||{},N=2),(E==null||typeof E!="object"&&typeof E!="function")&&(E={});N<T;++N)if(p=arguments[N],p!=null)for(g in p)x=f(E,g),y=f(p,g),E!==y&&(R&&y&&(o(y)||(v=s(y)))?(v?(v=!1,w=x&&s(x)?x:[]):w=x&&o(x)?x:{},u(E,{name:g,newValue:h(R,w,y)})):typeof y<"u"&&u(E,{name:g,newValue:y}));return E},sh}var Fj=Pj();const oh=fo(Fj);function lp(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 Gj(){const e=[],n={run:r,use:l};return n;function r(...s){let o=-1;const u=s.pop();if(typeof u!="function")throw new TypeError("Expected function as last argument, not "+u);f(null,...s);function f(h,...p){const g=e[++o];let x=-1;if(h){u(h);return}for(;++x<s.length;)(p[x]===null||p[x]===void 0)&&(p[x]=s[x]);s=p,g?qj(g,f)(...p):u(null,...p)}}function l(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),n}}function qj(e,n){let r;return l;function l(...u){const f=e.length>u.length;let h;f&&u.push(s);try{h=e.apply(this,u)}catch(p){const g=p;if(f&&r)throw g;return s(g)}f||(h&&h.then&&typeof h.then=="function"?h.then(o,s):h instanceof Error?s(h):o(h))}function s(u,...f){r||(r=!0,n(u,...f))}function o(u){s(null,u)}}const Wr={basename:Yj,dirname:Vj,extname:Xj,join:Kj,sep:"/"};function Yj(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');mo(e);let r=0,l=-1,s=e.length,o;if(n===void 0||n.length===0||n.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(o){r=s+1;break}}else l<0&&(o=!0,l=s+1);return l<0?"":e.slice(r,l)}if(n===e)return"";let u=-1,f=n.length-1;for(;s--;)if(e.codePointAt(s)===47){if(o){r=s+1;break}}else u<0&&(o=!0,u=s+1),f>-1&&(e.codePointAt(s)===n.codePointAt(f--)?f<0&&(l=s):(f=-1,l=u));return r===l?l=u:l<0&&(l=e.length),e.slice(r,l)}function Vj(e){if(mo(e),e.length===0)return".";let n=-1,r=e.length,l;for(;--r;)if(e.codePointAt(r)===47){if(l){n=r;break}}else l||(l=!0);return n<0?e.codePointAt(0)===47?"/":".":n===1&&e.codePointAt(0)===47?"//":e.slice(0,n)}function Xj(e){mo(e);let n=e.length,r=-1,l=0,s=-1,o=0,u;for(;n--;){const f=e.codePointAt(n);if(f===47){if(u){l=n+1;break}continue}r<0&&(u=!0,r=n+1),f===46?s<0?s=n:o!==1&&(o=1):s>-1&&(o=-1)}return s<0||r<0||o===0||o===1&&s===r-1&&s===l+1?"":e.slice(s,r)}function Kj(...e){let n=-1,r;for(;++n<e.length;)mo(e[n]),e[n]&&(r=r===void 0?e[n]:r+"/"+e[n]);return r===void 0?".":Zj(r)}function Zj(e){mo(e);const n=e.codePointAt(0)===47;let r=Qj(e,!n);return r.length===0&&!n&&(r="."),r.length>0&&e.codePointAt(e.length-1)===47&&(r+="/"),n?"/"+r:r}function Qj(e,n){let r="",l=0,s=-1,o=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(!(s===u-1||o===1))if(s!==u-1&&o===2){if(r.length<2||l!==2||r.codePointAt(r.length-1)!==46||r.codePointAt(r.length-2)!==46){if(r.length>2){if(h=r.lastIndexOf("/"),h!==r.length-1){h<0?(r="",l=0):(r=r.slice(0,h),l=r.length-1-r.lastIndexOf("/")),s=u,o=0;continue}}else if(r.length>0){r="",l=0,s=u,o=0;continue}}n&&(r=r.length>0?r+"/..":"..",l=2)}else r.length>0?r+="/"+e.slice(s+1,u):r=e.slice(s+1,u),l=u-s-1;s=u,o=0}else f===46&&o>-1?o++:o=-1}return r}function mo(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Wj={cwd:Jj};function Jj(){return"/"}function ip(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function e3(e){if(typeof e=="string")e=new URL(e);else if(!ip(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 t3(e)}function t3(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 r=-1;for(;++r<n.length;)if(n.codePointAt(r)===37&&n.codePointAt(r+1)===50){const l=n.codePointAt(r+2);if(l===70||l===102){const s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(n)}const uh=["history","path","basename","stem","extname","dirname"];class Iv{constructor(n){let r;n?ip(n)?r={path:n}:typeof n=="string"||n3(n)?r={value:n}:r=n:r={},this.cwd="cwd"in r?"":Wj.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let l=-1;for(;++l<uh.length;){const o=uh[l];o in r&&r[o]!==void 0&&r[o]!==null&&(this[o]=o==="history"?[...r[o]]:r[o])}let s;for(s in r)uh.includes(s)||(this[s]=r[s])}get basename(){return typeof this.path=="string"?Wr.basename(this.path):void 0}set basename(n){fh(n,"basename"),ch(n,"basename"),this.path=Wr.join(this.dirname||"",n)}get dirname(){return typeof this.path=="string"?Wr.dirname(this.path):void 0}set dirname(n){a1(this.basename,"dirname"),this.path=Wr.join(n||"",this.basename)}get extname(){return typeof this.path=="string"?Wr.extname(this.path):void 0}set extname(n){if(ch(n,"extname"),a1(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=Wr.join(this.dirname,this.stem+(n||""))}get path(){return this.history[this.history.length-1]}set path(n){ip(n)&&(n=e3(n)),fh(n,"path"),this.path!==n&&this.history.push(n)}get stem(){return typeof this.path=="string"?Wr.basename(this.path,this.extname):void 0}set stem(n){fh(n,"stem"),ch(n,"stem"),this.path=Wr.join(this.dirname||"",n+(this.extname||""))}fail(n,r,l){const s=this.message(n,r,l);throw s.fatal=!0,s}info(n,r,l){const s=this.message(n,r,l);return s.fatal=void 0,s}message(n,r,l){const s=new Dn(n,r,l);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(n){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(n||void 0).decode(this.value)}}function ch(e,n){if(e&&e.includes(Wr.sep))throw new Error("`"+n+"` cannot be a path: did not expect `"+Wr.sep+"`")}function fh(e,n){if(!e)throw new Error("`"+n+"` cannot be empty")}function a1(e,n){if(!e)throw new Error("Setting `"+n+"` requires `path` to be set too")}function n3(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const r3=(function(e){const l=this.constructor.prototype,s=l[e],o=function(){return s.apply(o,arguments)};return Object.setPrototypeOf(o,l),o}),a3={}.hasOwnProperty;class Yp extends r3{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=Gj()}copy(){const n=new Yp;let r=-1;for(;++r<this.attachers.length;){const l=this.attachers[r];n.use(...l)}return n.data(oh(!0,{},this.namespace)),n}data(n,r){return typeof n=="string"?arguments.length===2?(ph("data",this.frozen),this.namespace[n]=r,this):a3.call(this.namespace,n)&&this.namespace[n]||void 0:n?(ph("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[r,...l]=this.attachers[this.freezeIndex];if(l[0]===!1)continue;l[0]===!0&&(l[0]=void 0);const s=r.call(n,...l);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(n){this.freeze();const r=Iu(n),l=this.parser||this.Parser;return dh("parse",l),l(String(r),r)}process(n,r){const l=this;return this.freeze(),dh("process",this.parser||this.Parser),hh("process",this.compiler||this.Compiler),r?s(void 0,r):new Promise(s);function s(o,u){const f=Iu(n),h=l.parse(f);l.run(h,f,function(g,x,y){if(g||!x||!y)return p(g);const v=x,w=l.stringify(v,y);s3(w)?y.value=w:y.result=w,p(g,y)});function p(g,x){g||!x?u(g):o?o(x):r(void 0,x)}}}processSync(n){let r=!1,l;return this.freeze(),dh("processSync",this.parser||this.Parser),hh("processSync",this.compiler||this.Compiler),this.process(n,s),i1("processSync","process",r),l;function s(o,u){r=!0,n1(o),l=u}}run(n,r,l){l1(n),this.freeze();const s=this.transformers;return!l&&typeof r=="function"&&(l=r,r=void 0),l?o(void 0,l):new Promise(o);function o(u,f){const h=Iu(r);s.run(n,h,p);function p(g,x,y){const v=x||n;g?f(g):u?u(v):l(void 0,v,y)}}}runSync(n,r){let l=!1,s;return this.run(n,r,o),i1("runSync","run",l),s;function o(u,f){n1(u),s=f,l=!0}}stringify(n,r){this.freeze();const l=Iu(r),s=this.compiler||this.Compiler;return hh("stringify",s),l1(n),s(n,l)}use(n,...r){const l=this.attachers,s=this.namespace;if(ph("use",this.frozen),n!=null)if(typeof n=="function")h(n,r);else if(typeof n=="object")Array.isArray(n)?f(n):u(n);else throw new TypeError("Expected usable value, not `"+n+"`");return this;function o(p){if(typeof p=="function")h(p,[]);else if(typeof p=="object")if(Array.isArray(p)){const[g,...x]=p;h(g,x)}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&&(s.settings=oh(!0,s.settings,p.settings))}function f(p){let g=-1;if(p!=null)if(Array.isArray(p))for(;++g<p.length;){const x=p[g];o(x)}else throw new TypeError("Expected a list of plugins, not `"+p+"`")}function h(p,g){let x=-1,y=-1;for(;++x<l.length;)if(l[x][0]===p){y=x;break}if(y===-1)l.push([p,...g]);else if(g.length>0){let[v,...w]=g;const E=l[y][1];lp(E)&&lp(v)&&(v=oh(!0,E,v)),l[y]=[p,v,...w]}}}}const l3=new Yp().freeze();function dh(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function hh(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function ph(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 l1(e){if(!lp(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function i1(e,n,r){if(!r)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function Iu(e){return i3(e)?e:new Iv(e)}function i3(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function s3(e){return typeof e=="string"||o3(e)}function o3(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const u3="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",s1=[],o1={allowDangerousHtml:!0},c3=/^(https?|ircs?|mailto|xmpp)$/i,f3=[{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 d3(e){const n=h3(e),r=p3(e);return m3(n.runSync(n.parse(r),r),e)}function h3(e){const n=e.rehypePlugins||s1,r=e.remarkPlugins||s1,l=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...o1}:o1;return l3().use(VC).use(r).use(Hj,l).use(n)}function p3(e){const n=e.children||"",r=new Iv;return typeof n=="string"&&(r.value=n),r}function m3(e,n){const r=n.allowedElements,l=n.allowElement,s=n.components,o=n.disallowedElements,u=n.skipHtml,f=n.unwrapDisallowed,h=n.urlTransform||g3;for(const g of f3)Object.hasOwn(n,g.from)&&(""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+u3+g.id,void 0);return qp(e,p),jT(e,{Fragment:d.Fragment,components:s,ignoreInvalidStyle:!0,jsx:d.jsx,jsxs:d.jsxs,passKeys:!0,passNode:!0});function p(g,x,y){if(g.type==="raw"&&y&&typeof x=="number")return u?y.children.splice(x,1):y.children[x]={type:"text",value:g.value},x;if(g.type==="element"){let v;for(v in ah)if(Object.hasOwn(ah,v)&&Object.hasOwn(g.properties,v)){const w=g.properties[v],E=ah[v];(E===null||E.includes(g.tagName))&&(g.properties[v]=h(String(w||""),v,g))}}if(g.type==="element"){let v=r?!r.includes(g.tagName):o?o.includes(g.tagName):!1;if(!v&&l&&typeof x=="number"&&(v=!l(g,x,y)),v&&y&&typeof x=="number")return f&&g.children?y.children.splice(x,1,...g.children):y.children.splice(x,1),x}}}function g3(e){const n=e.indexOf(":"),r=e.indexOf("?"),l=e.indexOf("#"),s=e.indexOf("/");return n===-1||s!==-1&&n>s||r!==-1&&n>r||l!==-1&&n>l||c3.test(e.slice(0,n))?e:""}function u1(e,n){const r=String(e);if(typeof n!="string")throw new TypeError("Expected character");let l=0,s=r.indexOf(n);for(;s!==-1;)l++,s=r.indexOf(n,s+n.length);return l}function x3(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function b3(e,n,r){const s=Nc((r||{}).ignore||[]),o=y3(n);let u=-1;for(;++u<o.length;)Lv(e,"text",f);function f(p,g){let x=-1,y;for(;++x<g.length;){const v=g[x],w=y?y.children:void 0;if(s(v,w?w.indexOf(v):void 0,y))return;y=v}if(y)return h(p,g)}function h(p,g){const x=g[g.length-1],y=o[u][0],v=o[u][1];let w=0;const N=x.children.indexOf(p);let T=!1,R=[];y.lastIndex=0;let j=y.exec(p.value);for(;j;){const $=j.index,B={index:j.index,input:j.input,stack:[...g,p]};let _=v(...j,B);if(typeof _=="string"&&(_=_.length>0?{type:"text",value:_}:void 0),_===!1?y.lastIndex=$+1:(w!==$&&R.push({type:"text",value:p.value.slice(w,$)}),Array.isArray(_)?R.push(..._):_&&R.push(_),w=$+j[0].length,T=!0),!y.global)break;j=y.exec(p.value)}return T?(w<p.value.length&&R.push({type:"text",value:p.value.slice(w)}),x.children.splice(N,1,...R)):R=[p],N+R.length}}function y3(e){const n=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const r=!e[0]||Array.isArray(e[0])?e:[e];let l=-1;for(;++l<r.length;){const s=r[l];n.push([v3(s[0]),k3(s[1])])}return n}function v3(e){return typeof e=="string"?new RegExp(x3(e),"g"):e}function k3(e){return typeof e=="function"?e:function(){return e}}const mh="phrasing",gh=["autolink","link","image","label"];function w3(){return{transforms:[C3],enter:{literalAutolink:E3,literalAutolinkEmail:xh,literalAutolinkHttp:xh,literalAutolinkWww:xh},exit:{literalAutolink:A3,literalAutolinkEmail:T3,literalAutolinkHttp:N3,literalAutolinkWww:_3}}}function S3(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:mh,notInConstruct:gh},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:mh,notInConstruct:gh},{character:":",before:"[ps]",after:"\\/",inConstruct:mh,notInConstruct:gh}]}}function E3(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function xh(e){this.config.enter.autolinkProtocol.call(this,e)}function N3(e){this.config.exit.autolinkProtocol.call(this,e)}function _3(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 T3(e){this.config.exit.autolinkEmail.call(this,e)}function A3(e){this.exit(e)}function C3(e){b3(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,j3],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),R3]],{ignore:["link","linkReference"]})}function j3(e,n,r,l,s){let o="";if(!Bv(s)||(/^w/i.test(n)&&(r=n+r,n="",o="http://"),!M3(r)))return!1;const u=O3(r+l);if(!u[0])return!1;const f={type:"link",title:null,url:o+n+u[0],children:[{type:"text",value:n+u[0]}]};return u[1]?[f,{type:"text",value:u[1]}]:f}function R3(e,n,r,l){return!Bv(l,!0)||/[-\d_]$/.test(r)?!1:{type:"link",title:null,url:"mailto:"+n+"@"+r,children:[{type:"text",value:n+"@"+r}]}}function M3(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 O3(e){const n=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let r=n[0],l=r.indexOf(")");const s=u1(e,"(");let o=u1(e,")");for(;l!==-1&&s>o;)e+=r.slice(0,l+1),r=r.slice(l+1),l=r.indexOf(")"),o++;return[e,r]}function Bv(e,n){const r=e.input.charCodeAt(e.index-1);return(e.index===0||Rl(r)||wc(r))&&(!n||r!==47)}$v.peek=P3;function D3(){this.buffer()}function z3(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function L3(){this.buffer()}function I3(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function B3(e){const n=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=$r(this.sliceSerialize(e)).toLowerCase(),r.label=n}function $3(e){this.exit(e)}function U3(e){const n=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=$r(this.sliceSerialize(e)).toLowerCase(),r.label=n}function H3(e){this.exit(e)}function P3(){return"["}function $v(e,n,r,l){const s=r.createTracker(l);let o=s.move("[^");const u=r.enter("footnoteReference"),f=r.enter("reference");return o+=s.move(r.safe(r.associationId(e),{after:"]",before:o})),f(),u(),o+=s.move("]"),o}function F3(){return{enter:{gfmFootnoteCallString:D3,gfmFootnoteCall:z3,gfmFootnoteDefinitionLabelString:L3,gfmFootnoteDefinition:I3},exit:{gfmFootnoteCallString:B3,gfmFootnoteCall:$3,gfmFootnoteDefinitionLabelString:U3,gfmFootnoteDefinition:H3}}}function G3(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:r,footnoteReference:$v},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function r(l,s,o,u){const f=o.createTracker(u);let h=f.move("[^");const p=o.enter("footnoteDefinition"),g=o.enter("label");return h+=f.move(o.safe(o.associationId(l),{before:h,after:"]"})),g(),h+=f.move("]:"),l.children&&l.children.length>0&&(f.shift(4),h+=f.move((n?`
|
|
28
|
+
`:" ")+o.indentLines(o.containerFlow(l,f.current()),n?Uv:q3))),p(),h}}function q3(e,n,r){return n===0?e:Uv(e,n,r)}function Uv(e,n,r){return(r?"":" ")+e}const Y3=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Hv.peek=Q3;function V3(){return{canContainEols:["delete"],enter:{strikethrough:K3},exit:{strikethrough:Z3}}}function X3(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Y3}],handlers:{delete:Hv}}}function K3(e){this.enter({type:"delete",children:[]},e)}function Z3(e){this.exit(e)}function Hv(e,n,r,l){const s=r.createTracker(l),o=r.enter("strikethrough");let u=s.move("~~");return u+=r.containerPhrasing(e,{...s.current(),before:u,after:"~"}),u+=s.move("~~"),o(),u}function Q3(){return"~"}function W3(e){return e.length}function J3(e,n){const r=n||{},l=(r.align||[]).concat(),s=r.stringLength||W3,o=[],u=[],f=[],h=[];let p=0,g=-1;for(;++g<e.length;){const E=[],N=[];let T=-1;for(e[g].length>p&&(p=e[g].length);++T<e[g].length;){const R=eR(e[g][T]);if(r.alignDelimiters!==!1){const j=s(R);N[T]=j,(h[T]===void 0||j>h[T])&&(h[T]=j)}E.push(R)}u[g]=E,f[g]=N}let x=-1;if(typeof l=="object"&&"length"in l)for(;++x<p;)o[x]=c1(l[x]);else{const E=c1(l);for(;++x<p;)o[x]=E}x=-1;const y=[],v=[];for(;++x<p;){const E=o[x];let N="",T="";E===99?(N=":",T=":"):E===108?N=":":E===114&&(T=":");let R=r.alignDelimiters===!1?1:Math.max(1,h[x]-N.length-T.length);const j=N+"-".repeat(R)+T;r.alignDelimiters!==!1&&(R=N.length+R+T.length,R>h[x]&&(h[x]=R),v[x]=R),y[x]=j}u.splice(1,0,y),f.splice(1,0,v),g=-1;const w=[];for(;++g<u.length;){const E=u[g],N=f[g];x=-1;const T=[];for(;++x<p;){const R=E[x]||"";let j="",$="";if(r.alignDelimiters!==!1){const B=h[x]-(N[x]||0),_=o[x];_===114?j=" ".repeat(B):_===99?B%2?(j=" ".repeat(B/2+.5),$=" ".repeat(B/2-.5)):(j=" ".repeat(B/2),$=j):$=" ".repeat(B)}r.delimiterStart!==!1&&!x&&T.push("|"),r.padding!==!1&&!(r.alignDelimiters===!1&&R==="")&&(r.delimiterStart!==!1||x)&&T.push(" "),r.alignDelimiters!==!1&&T.push(j),T.push(R),r.alignDelimiters!==!1&&T.push($),r.padding!==!1&&T.push(" "),(r.delimiterEnd!==!1||x!==p-1)&&T.push("|")}w.push(r.delimiterEnd===!1?T.join("").replace(/ +$/,""):T.join(""))}return w.join(`
|
|
29
|
+
`)}function eR(e){return e==null?"":String(e)}function c1(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 tR(e,n,r,l){const s=r.enter("blockquote"),o=r.createTracker(l);o.move("> "),o.shift(2);const u=r.indentLines(r.containerFlow(e,o.current()),nR);return s(),u}function nR(e,n,r){return">"+(r?"":" ")+e}function rR(e,n){return f1(e,n.inConstruct,!0)&&!f1(e,n.notInConstruct,!1)}function f1(e,n,r){if(typeof n=="string"&&(n=[n]),!n||n.length===0)return r;let l=-1;for(;++l<n.length;)if(e.includes(n[l]))return!0;return!1}function d1(e,n,r,l){let s=-1;for(;++s<r.unsafe.length;)if(r.unsafe[s].character===`
|
|
30
|
+
`&&rR(r.stack,r.unsafe[s]))return/[ \t]/.test(l.before)?"":" ";return`\\
|
|
31
|
+
`}function aR(e,n){const r=String(e);let l=r.indexOf(n),s=l,o=0,u=0;if(typeof n!="string")throw new TypeError("Expected substring");for(;l!==-1;)l===s?++o>u&&(u=o):o=1,s=l+n.length,l=r.indexOf(n,s);return u}function lR(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 iR(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 sR(e,n,r,l){const s=iR(r),o=e.value||"",u=s==="`"?"GraveAccent":"Tilde";if(lR(e,r)){const x=r.enter("codeIndented"),y=r.indentLines(o,oR);return x(),y}const f=r.createTracker(l),h=s.repeat(Math.max(aR(o,s)+1,3)),p=r.enter("codeFenced");let g=f.move(h);if(e.lang){const x=r.enter(`codeFencedLang${u}`);g+=f.move(r.safe(e.lang,{before:g,after:" ",encode:["`"],...f.current()})),x()}if(e.lang&&e.meta){const x=r.enter(`codeFencedMeta${u}`);g+=f.move(" "),g+=f.move(r.safe(e.meta,{before:g,after:`
|
|
32
|
+
`,encode:["`"],...f.current()})),x()}return g+=f.move(`
|
|
33
|
+
`),o&&(g+=f.move(o+`
|
|
34
|
+
`)),g+=f.move(h),p(),g}function oR(e,n,r){return(r?"":" ")+e}function Vp(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 uR(e,n,r,l){const s=Vp(r),o=s==='"'?"Quote":"Apostrophe",u=r.enter("definition");let f=r.enter("label");const h=r.createTracker(l);let p=h.move("[");return p+=h.move(r.safe(r.associationId(e),{before:p,after:"]",...h.current()})),p+=h.move("]: "),f(),!e.url||/[\0- \u007F]/.test(e.url)?(f=r.enter("destinationLiteral"),p+=h.move("<"),p+=h.move(r.safe(e.url,{before:p,after:">",...h.current()})),p+=h.move(">")):(f=r.enter("destinationRaw"),p+=h.move(r.safe(e.url,{before:p,after:e.title?" ":`
|
|
35
|
+
`,...h.current()}))),f(),e.title&&(f=r.enter(`title${o}`),p+=h.move(" "+s),p+=h.move(r.safe(e.title,{before:p,after:s,...h.current()})),p+=h.move(s),f()),u(),p}function cR(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 ro(e){return"&#x"+e.toString(16).toUpperCase()+";"}function cc(e,n,r){const l=Oi(e),s=Oi(n);return l===void 0?s===void 0?r==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:l===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Pv.peek=fR;function Pv(e,n,r,l){const s=cR(r),o=r.enter("emphasis"),u=r.createTracker(l),f=u.move(s);let h=u.move(r.containerPhrasing(e,{after:s,before:f,...u.current()}));const p=h.charCodeAt(0),g=cc(l.before.charCodeAt(l.before.length-1),p,s);g.inside&&(h=ro(p)+h.slice(1));const x=h.charCodeAt(h.length-1),y=cc(l.after.charCodeAt(0),x,s);y.inside&&(h=h.slice(0,-1)+ro(x));const v=u.move(s);return o(),r.attentionEncodeSurroundingInfo={after:y.outside,before:g.outside},f+h+v}function fR(e,n,r){return r.options.emphasis||"*"}function dR(e,n){let r=!1;return qp(e,function(l){if("value"in l&&/\r?\n|\r/.test(l.value)||l.type==="break")return r=!0,rp}),!!((!e.depth||e.depth<3)&&Bp(e)&&(n.options.setext||r))}function hR(e,n,r,l){const s=Math.max(Math.min(6,e.depth||1),1),o=r.createTracker(l);if(dR(e,r)){const g=r.enter("headingSetext"),x=r.enter("phrasing"),y=r.containerPhrasing(e,{...o.current(),before:`
|
|
36
|
+
`,after:`
|
|
37
|
+
`});return x(),g(),y+`
|
|
38
|
+
`+(s===1?"=":"-").repeat(y.length-(Math.max(y.lastIndexOf("\r"),y.lastIndexOf(`
|
|
39
|
+
`))+1))}const u="#".repeat(s),f=r.enter("headingAtx"),h=r.enter("phrasing");o.move(u+" ");let p=r.containerPhrasing(e,{before:"# ",after:`
|
|
40
|
+
`,...o.current()});return/^[\t ]/.test(p)&&(p=ro(p.charCodeAt(0))+p.slice(1)),p=p?u+" "+p:u,r.options.closeAtx&&(p+=" "+u),h(),f(),p}Fv.peek=pR;function Fv(e){return e.value||""}function pR(){return"<"}Gv.peek=mR;function Gv(e,n,r,l){const s=Vp(r),o=s==='"'?"Quote":"Apostrophe",u=r.enter("image");let f=r.enter("label");const h=r.createTracker(l);let p=h.move("![");return p+=h.move(r.safe(e.alt,{before:p,after:"]",...h.current()})),p+=h.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=r.enter("destinationLiteral"),p+=h.move("<"),p+=h.move(r.safe(e.url,{before:p,after:">",...h.current()})),p+=h.move(">")):(f=r.enter("destinationRaw"),p+=h.move(r.safe(e.url,{before:p,after:e.title?" ":")",...h.current()}))),f(),e.title&&(f=r.enter(`title${o}`),p+=h.move(" "+s),p+=h.move(r.safe(e.title,{before:p,after:s,...h.current()})),p+=h.move(s),f()),p+=h.move(")"),u(),p}function mR(){return"!"}qv.peek=gR;function qv(e,n,r,l){const s=e.referenceType,o=r.enter("imageReference");let u=r.enter("label");const f=r.createTracker(l);let h=f.move("![");const p=r.safe(e.alt,{before:h,after:"]",...f.current()});h+=f.move(p+"]["),u();const g=r.stack;r.stack=[],u=r.enter("reference");const x=r.safe(r.associationId(e),{before:h,after:"]",...f.current()});return u(),r.stack=g,o(),s==="full"||!p||p!==x?h+=f.move(x+"]"):s==="shortcut"?h=h.slice(0,-1):h+=f.move("]"),h}function gR(){return"!"}Yv.peek=xR;function Yv(e,n,r){let l=e.value||"",s="`",o=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(l);)s+="`";for(/[^ \r\n]/.test(l)&&(/^[ \r\n]/.test(l)&&/[ \r\n]$/.test(l)||/^`|`$/.test(l))&&(l=" "+l+" ");++o<r.unsafe.length;){const u=r.unsafe[o],f=r.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 s+l+s}function xR(){return"`"}function Vv(e,n){const r=Bp(e);return!!(!n.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(r===e.url||"mailto:"+r===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Xv.peek=bR;function Xv(e,n,r,l){const s=Vp(r),o=s==='"'?"Quote":"Apostrophe",u=r.createTracker(l);let f,h;if(Vv(e,r)){const g=r.stack;r.stack=[],f=r.enter("autolink");let x=u.move("<");return x+=u.move(r.containerPhrasing(e,{before:x,after:">",...u.current()})),x+=u.move(">"),f(),r.stack=g,x}f=r.enter("link"),h=r.enter("label");let p=u.move("[");return p+=u.move(r.containerPhrasing(e,{before:p,after:"](",...u.current()})),p+=u.move("]("),h(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(h=r.enter("destinationLiteral"),p+=u.move("<"),p+=u.move(r.safe(e.url,{before:p,after:">",...u.current()})),p+=u.move(">")):(h=r.enter("destinationRaw"),p+=u.move(r.safe(e.url,{before:p,after:e.title?" ":")",...u.current()}))),h(),e.title&&(h=r.enter(`title${o}`),p+=u.move(" "+s),p+=u.move(r.safe(e.title,{before:p,after:s,...u.current()})),p+=u.move(s),h()),p+=u.move(")"),f(),p}function bR(e,n,r){return Vv(e,r)?"<":"["}Kv.peek=yR;function Kv(e,n,r,l){const s=e.referenceType,o=r.enter("linkReference");let u=r.enter("label");const f=r.createTracker(l);let h=f.move("[");const p=r.containerPhrasing(e,{before:h,after:"]",...f.current()});h+=f.move(p+"]["),u();const g=r.stack;r.stack=[],u=r.enter("reference");const x=r.safe(r.associationId(e),{before:h,after:"]",...f.current()});return u(),r.stack=g,o(),s==="full"||!p||p!==x?h+=f.move(x+"]"):s==="shortcut"?h=h.slice(0,-1):h+=f.move("]"),h}function yR(){return"["}function Xp(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 vR(e){const n=Xp(e),r=e.options.bulletOther;if(!r)return n==="*"?"-":"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(r===n)throw new Error("Expected `bullet` (`"+n+"`) and `bulletOther` (`"+r+"`) to be different");return r}function kR(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 Zv(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 wR(e,n,r,l){const s=r.enter("list"),o=r.bulletCurrent;let u=e.ordered?kR(r):Xp(r);const f=e.ordered?u==="."?")":".":vR(r);let h=n&&r.bulletLastUsed?u===r.bulletLastUsed:!1;if(!e.ordered){const g=e.children?e.children[0]:void 0;if((u==="*"||u==="-")&&g&&(!g.children||!g.children[0])&&r.stack[r.stack.length-1]==="list"&&r.stack[r.stack.length-2]==="listItem"&&r.stack[r.stack.length-3]==="list"&&r.stack[r.stack.length-4]==="listItem"&&r.indexStack[r.indexStack.length-1]===0&&r.indexStack[r.indexStack.length-2]===0&&r.indexStack[r.indexStack.length-3]===0&&(h=!0),Zv(r)===u&&g){let x=-1;for(;++x<e.children.length;){const y=e.children[x];if(y&&y.type==="listItem"&&y.children&&y.children[0]&&y.children[0].type==="thematicBreak"){h=!0;break}}}}h&&(u=f),r.bulletCurrent=u;const p=r.containerFlow(e,l);return r.bulletLastUsed=u,r.bulletCurrent=o,s(),p}function SR(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 ER(e,n,r,l){const s=SR(r);let o=r.bulletCurrent||Xp(r);n&&n.type==="list"&&n.ordered&&(o=(typeof n.start=="number"&&n.start>-1?n.start:1)+(r.options.incrementListMarker===!1?0:n.children.indexOf(e))+o);let u=o.length+1;(s==="tab"||s==="mixed"&&(n&&n.type==="list"&&n.spread||e.spread))&&(u=Math.ceil(u/4)*4);const f=r.createTracker(l);f.move(o+" ".repeat(u-o.length)),f.shift(u);const h=r.enter("listItem"),p=r.indentLines(r.containerFlow(e,f.current()),g);return h(),p;function g(x,y,v){return y?(v?"":" ".repeat(u))+x:(v?o:o+" ".repeat(u-o.length))+x}}function NR(e,n,r,l){const s=r.enter("paragraph"),o=r.enter("phrasing"),u=r.containerPhrasing(e,l);return o(),s(),u}const _R=Nc(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function TR(e,n,r,l){return(e.children.some(function(u){return _R(u)})?r.containerPhrasing:r.containerFlow).call(r,e,l)}function AR(e){const n=e.options.strong||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize strong with `"+n+"` for `options.strong`, expected `*`, or `_`");return n}Qv.peek=CR;function Qv(e,n,r,l){const s=AR(r),o=r.enter("strong"),u=r.createTracker(l),f=u.move(s+s);let h=u.move(r.containerPhrasing(e,{after:s,before:f,...u.current()}));const p=h.charCodeAt(0),g=cc(l.before.charCodeAt(l.before.length-1),p,s);g.inside&&(h=ro(p)+h.slice(1));const x=h.charCodeAt(h.length-1),y=cc(l.after.charCodeAt(0),x,s);y.inside&&(h=h.slice(0,-1)+ro(x));const v=u.move(s+s);return o(),r.attentionEncodeSurroundingInfo={after:y.outside,before:g.outside},f+h+v}function CR(e,n,r){return r.options.strong||"*"}function jR(e,n,r,l){return r.safe(e.value,l)}function RR(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 MR(e,n,r){const l=(Zv(r)+(r.options.ruleSpaces?" ":"")).repeat(RR(r));return r.options.ruleSpaces?l.slice(0,-1):l}const Wv={blockquote:tR,break:d1,code:sR,definition:uR,emphasis:Pv,hardBreak:d1,heading:hR,html:Fv,image:Gv,imageReference:qv,inlineCode:Yv,link:Xv,linkReference:Kv,list:wR,listItem:ER,paragraph:NR,root:TR,strong:Qv,text:jR,thematicBreak:MR};function OR(){return{enter:{table:DR,tableData:h1,tableHeader:h1,tableRow:LR},exit:{codeText:IR,table:zR,tableData:bh,tableHeader:bh,tableRow:bh}}}function DR(e){const n=e._align;this.enter({type:"table",align:n.map(function(r){return r==="none"?null:r}),children:[]},e),this.data.inTable=!0}function zR(e){this.exit(e),this.data.inTable=void 0}function LR(e){this.enter({type:"tableRow",children:[]},e)}function bh(e){this.exit(e)}function h1(e){this.enter({type:"tableCell",children:[]},e)}function IR(e){let n=this.resume();this.data.inTable&&(n=n.replace(/\\([\\|])/g,BR));const r=this.stack[this.stack.length-1];r.type,r.value=n,this.exit(e)}function BR(e,n){return n==="|"?n:e}function $R(e){const n=e||{},r=n.tableCellPadding,l=n.tablePipeAlign,s=n.stringLength,o=r?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
41
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:y,table:u,tableCell:h,tableRow:f}};function u(v,w,E,N){return p(g(v,E,N),v.align)}function f(v,w,E,N){const T=x(v,E,N),R=p([T]);return R.slice(0,R.indexOf(`
|
|
42
|
+
`))}function h(v,w,E,N){const T=E.enter("tableCell"),R=E.enter("phrasing"),j=E.containerPhrasing(v,{...N,before:o,after:o});return R(),T(),j}function p(v,w){return J3(v,{align:w,alignDelimiters:l,padding:r,stringLength:s})}function g(v,w,E){const N=v.children;let T=-1;const R=[],j=w.enter("table");for(;++T<N.length;)R[T]=x(N[T],w,E);return j(),R}function x(v,w,E){const N=v.children;let T=-1;const R=[],j=w.enter("tableRow");for(;++T<N.length;)R[T]=h(N[T],v,w,E);return j(),R}function y(v,w,E){let N=Wv.inlineCode(v,w,E);return E.stack.includes("tableCell")&&(N=N.replace(/\|/g,"\\$&")),N}}function UR(){return{exit:{taskListCheckValueChecked:p1,taskListCheckValueUnchecked:p1,paragraph:PR}}}function HR(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:FR}}}function p1(e){const n=this.stack[this.stack.length-2];n.type,n.checked=e.type==="taskListCheckValueChecked"}function PR(e){const n=this.stack[this.stack.length-2];if(n&&n.type==="listItem"&&typeof n.checked=="boolean"){const r=this.stack[this.stack.length-1];r.type;const l=r.children[0];if(l&&l.type==="text"){const s=n.children;let o=-1,u;for(;++o<s.length;){const f=s[o];if(f.type==="paragraph"){u=f;break}}u===r&&(l.value=l.value.slice(1),l.value.length===0?r.children.shift():r.position&&l.position&&typeof l.position.start.offset=="number"&&(l.position.start.column++,l.position.start.offset++,r.position.start=Object.assign({},l.position.start)))}}this.exit(e)}function FR(e,n,r,l){const s=e.children[0],o=typeof e.checked=="boolean"&&s&&s.type==="paragraph",u="["+(e.checked?"x":" ")+"] ",f=r.createTracker(l);o&&f.move(u);let h=Wv.listItem(e,n,r,{...l,...f.current()});return o&&(h=h.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,p)),h;function p(g){return g+u}}function GR(){return[w3(),F3(),V3(),OR(),UR()]}function qR(e){return{extensions:[S3(),G3(e),X3(),$R(e),HR()]}}const YR={tokenize:WR,partial:!0},Jv={tokenize:JR,partial:!0},ek={tokenize:eM,partial:!0},tk={tokenize:tM,partial:!0},VR={tokenize:nM,partial:!0},nk={name:"wwwAutolink",tokenize:ZR,previous:ak},rk={name:"protocolAutolink",tokenize:QR,previous:lk},Ta={name:"emailAutolink",tokenize:KR,previous:ik},na={};function XR(){return{text:na}}let _l=48;for(;_l<123;)na[_l]=Ta,_l++,_l===58?_l=65:_l===91&&(_l=97);na[43]=Ta;na[45]=Ta;na[46]=Ta;na[95]=Ta;na[72]=[Ta,rk];na[104]=[Ta,rk];na[87]=[Ta,nk];na[119]=[Ta,nk];function KR(e,n,r){const l=this;let s,o;return u;function u(x){return!sp(x)||!ik.call(l,l.previous)||Kp(l.events)?r(x):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),f(x))}function f(x){return sp(x)?(e.consume(x),f):x===64?(e.consume(x),h):r(x)}function h(x){return x===46?e.check(VR,g,p)(x):x===45||x===95||On(x)?(o=!0,e.consume(x),h):g(x)}function p(x){return e.consume(x),s=!0,h}function g(x){return o&&s&&Bn(l.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),n(x)):r(x)}}function ZR(e,n,r){const l=this;return s;function s(u){return u!==87&&u!==119||!ak.call(l,l.previous)||Kp(l.events)?r(u):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(YR,e.attempt(Jv,e.attempt(ek,o),r),r)(u))}function o(u){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),n(u)}}function QR(e,n,r){const l=this;let s="",o=!1;return u;function u(x){return(x===72||x===104)&&lk.call(l,l.previous)&&!Kp(l.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(x),e.consume(x),f):r(x)}function f(x){if(Bn(x)&&s.length<5)return s+=String.fromCodePoint(x),e.consume(x),f;if(x===58){const y=s.toLowerCase();if(y==="http"||y==="https")return e.consume(x),h}return r(x)}function h(x){return x===47?(e.consume(x),o?p:(o=!0,h)):r(x)}function p(x){return x===null||sc(x)||Ut(x)||Rl(x)||wc(x)?r(x):e.attempt(Jv,e.attempt(ek,g),r)(x)}function g(x){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),n(x)}}function WR(e,n,r){let l=0;return s;function s(u){return(u===87||u===119)&&l<3?(l++,e.consume(u),s):u===46&&l===3?(e.consume(u),o):r(u)}function o(u){return u===null?r(u):n(u)}}function JR(e,n,r){let l,s,o;return u;function u(p){return p===46||p===95?e.check(tk,h,f)(p):p===null||Ut(p)||Rl(p)||p!==45&&wc(p)?h(p):(o=!0,e.consume(p),u)}function f(p){return p===95?l=!0:(s=l,l=void 0),e.consume(p),u}function h(p){return s||l||!o?r(p):n(p)}}function eM(e,n){let r=0,l=0;return s;function s(u){return u===40?(r++,e.consume(u),s):u===41&&l<r?o(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(tk,n,o)(u):u===null||Ut(u)||Rl(u)?n(u):(e.consume(u),s)}function o(u){return u===41&&l++,e.consume(u),s}}function tM(e,n,r){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),o):f===93?(e.consume(f),s):f===60||f===null||Ut(f)||Rl(f)?n(f):r(f)}function s(f){return f===null||f===40||f===91||Ut(f)||Rl(f)?n(f):l(f)}function o(f){return Bn(f)?u(f):r(f)}function u(f){return f===59?(e.consume(f),l):Bn(f)?(e.consume(f),u):r(f)}}function nM(e,n,r){return l;function l(o){return e.consume(o),s}function s(o){return On(o)?r(o):n(o)}}function ak(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Ut(e)}function lk(e){return!Bn(e)}function ik(e){return!(e===47||sp(e))}function sp(e){return e===43||e===45||e===46||e===95||On(e)}function Kp(e){let n=e.length,r=!1;for(;n--;){const l=e[n][1];if((l.type==="labelLink"||l.type==="labelImage")&&!l._balanced){r=!0;break}if(l._gfmAutolinkLiteralWalkedInto){r=!1;break}}return e.length>0&&!r&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),r}const rM={tokenize:fM,partial:!0};function aM(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:oM,continuation:{tokenize:uM},exit:cM}},text:{91:{name:"gfmFootnoteCall",tokenize:sM},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:lM,resolveTo:iM}}}}function lM(e,n,r){const l=this;let s=l.events.length;const o=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]);let u;for(;s--;){const h=l.events[s][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 r(h);const p=$r(l.sliceSerialize({start:u.end,end:l.now()}));return p.codePointAt(0)!==94||!o.includes(p.slice(1))?r(h):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),n(h))}}function iM(e,n){let r=e.length;for(;r--;)if(e[r][1].type==="labelImage"&&e[r][0]==="enter"){e[r][1];break}e[r+1][1].type="data",e[r+3][1].type="gfmFootnoteCallLabelMarker";const l={type:"gfmFootnoteCall",start:Object.assign({},e[r+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[r+3][1].end),end:Object.assign({},e[r+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},u={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},f=[e[r+1],e[r+2],["enter",l,n],e[r+3],e[r+4],["enter",s,n],["exit",s,n],["enter",o,n],["enter",u,n],["exit",u,n],["exit",o,n],e[e.length-2],e[e.length-1],["exit",l,n]];return e.splice(r,e.length-r+1,...f),e}function sM(e,n,r){const l=this,s=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]);let o=0,u;return f;function f(x){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(x),e.exit("gfmFootnoteCallLabelMarker"),h}function h(x){return x!==94?r(x):(e.enter("gfmFootnoteCallMarker"),e.consume(x),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",p)}function p(x){if(o>999||x===93&&!u||x===null||x===91||Ut(x))return r(x);if(x===93){e.exit("chunkString");const y=e.exit("gfmFootnoteCallString");return s.includes($r(l.sliceSerialize(y)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(x),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),n):r(x)}return Ut(x)||(u=!0),o++,e.consume(x),x===92?g:p}function g(x){return x===91||x===92||x===93?(e.consume(x),o++,p):p(x)}}function oM(e,n,r){const l=this,s=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]);let o,u=0,f;return h;function h(w){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),p}function p(w){return w===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",g):r(w)}function g(w){if(u>999||w===93&&!f||w===null||w===91||Ut(w))return r(w);if(w===93){e.exit("chunkString");const E=e.exit("gfmFootnoteDefinitionLabelString");return o=$r(l.sliceSerialize(E)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),y}return Ut(w)||(f=!0),u++,e.consume(w),w===92?x:g}function x(w){return w===91||w===92||w===93?(e.consume(w),u++,g):g(w)}function y(w){return w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),s.includes(o)||s.push(o),dt(e,v,"gfmFootnoteDefinitionWhitespace")):r(w)}function v(w){return n(w)}}function uM(e,n,r){return e.check(po,n,e.attempt(rM,n,r))}function cM(e){e.exit("gfmFootnoteDefinition")}function fM(e,n,r){const l=this;return dt(e,s,"gfmFootnoteDefinitionIndent",5);function s(o){const u=l.events[l.events.length-1];return u&&u[1].type==="gfmFootnoteDefinitionIndent"&&u[2].sliceSerialize(u[1],!0).length===4?n(o):r(o)}}function dM(e){let r=(e||{}).singleTilde;const l={name:"strikethrough",tokenize:o,resolveAll:s};return r==null&&(r=!0),{text:{126:l},insideSpan:{null:[l]},attentionMarkers:{null:[126]}};function s(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 g={type:"strikethrough",start:Object.assign({},u[p][1].start),end:Object.assign({},u[h][1].end)},x={type:"strikethroughText",start:Object.assign({},u[p][1].end),end:Object.assign({},u[h][1].start)},y=[["enter",g,f],["enter",u[p][1],f],["exit",u[p][1],f],["enter",x,f]],v=f.parser.constructs.insideSpan.null;v&&mr(y,y.length,0,Sc(v,u.slice(p+1,h),f)),mr(y,y.length,0,[["exit",x,f],["enter",u[h][1],f],["exit",u[h][1],f],["exit",g,f]]),mr(u,p-1,h-p+3,y),h=p+y.length-2;break}}for(h=-1;++h<u.length;)u[h][1].type==="strikethroughSequenceTemporary"&&(u[h][1].type="data");return u}function o(u,f,h){const p=this.previous,g=this.events;let x=0;return y;function y(w){return p===126&&g[g.length-1][1].type!=="characterEscape"?h(w):(u.enter("strikethroughSequenceTemporary"),v(w))}function v(w){const E=Oi(p);if(w===126)return x>1?h(w):(u.consume(w),x++,v);if(x<2&&!r)return h(w);const N=u.exit("strikethroughSequenceTemporary"),T=Oi(w);return N._open=!T||T===2&&!!E,N._close=!E||E===2&&!!T,f(w)}}}class hM{constructor(){this.map=[]}add(n,r,l){pM(this,n,r,l)}consume(n){if(this.map.sort(function(o,u){return o[0]-u[0]}),this.map.length===0)return;let r=this.map.length;const l=[];for(;r>0;)r-=1,l.push(n.slice(this.map[r][0]+this.map[r][1]),this.map[r][2]),n.length=this.map[r][0];l.push(n.slice()),n.length=0;let s=l.pop();for(;s;){for(const o of s)n.push(o);s=l.pop()}this.map.length=0}}function pM(e,n,r,l){let s=0;if(!(r===0&&l.length===0)){for(;s<e.map.length;){if(e.map[s][0]===n){e.map[s][1]+=r,e.map[s][2].push(...l);return}s+=1}e.map.push([n,r,l])}}function mM(e,n){let r=!1;const l=[];for(;n<e.length;){const s=e[n];if(r){if(s[0]==="enter")s[1].type==="tableContent"&&l.push(e[n+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(e[n-1][1].type==="tableDelimiterMarker"){const o=l.length-1;l[o]=l[o]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(r=!0);n+=1}return l}function gM(){return{flow:{null:{name:"table",tokenize:xM,resolveAll:bM}}}}function xM(e,n,r){const l=this;let s=0,o=0,u;return f;function f(L){let X=l.events.length-1;for(;X>-1;){const J=l.events[X][1].type;if(J==="lineEnding"||J==="linePrefix")X--;else break}const Z=X>-1?l.events[X][1].type:null,te=Z==="tableHead"||Z==="tableRow"?_:h;return te===_&&l.parser.lazy[l.now().line]?r(L):te(L)}function h(L){return e.enter("tableHead"),e.enter("tableRow"),p(L)}function p(L){return L===124||(u=!0,o+=1),g(L)}function g(L){return L===null?r(L):He(L)?o>1?(o=0,l.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),v):r(L):it(L)?dt(e,g,"whitespace")(L):(o+=1,u&&(u=!1,s+=1),L===124?(e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),u=!0,g):(e.enter("data"),x(L)))}function x(L){return L===null||L===124||Ut(L)?(e.exit("data"),g(L)):(e.consume(L),L===92?y:x)}function y(L){return L===92||L===124?(e.consume(L),x):x(L)}function v(L){return l.interrupt=!1,l.parser.lazy[l.now().line]?r(L):(e.enter("tableDelimiterRow"),u=!1,it(L)?dt(e,w,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):w(L))}function w(L){return L===45||L===58?N(L):L===124?(u=!0,e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),E):B(L)}function E(L){return it(L)?dt(e,N,"whitespace")(L):N(L)}function N(L){return L===58?(o+=1,u=!0,e.enter("tableDelimiterMarker"),e.consume(L),e.exit("tableDelimiterMarker"),T):L===45?(o+=1,T(L)):L===null||He(L)?$(L):B(L)}function T(L){return L===45?(e.enter("tableDelimiterFiller"),R(L)):B(L)}function R(L){return L===45?(e.consume(L),R):L===58?(u=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(L),e.exit("tableDelimiterMarker"),j):(e.exit("tableDelimiterFiller"),j(L))}function j(L){return it(L)?dt(e,$,"whitespace")(L):$(L)}function $(L){return L===124?w(L):L===null||He(L)?!u||s!==o?B(L):(e.exit("tableDelimiterRow"),e.exit("tableHead"),n(L)):B(L)}function B(L){return r(L)}function _(L){return e.enter("tableRow"),D(L)}function D(L){return L===124?(e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),D):L===null||He(L)?(e.exit("tableRow"),n(L)):it(L)?dt(e,D,"whitespace")(L):(e.enter("data"),F(L))}function F(L){return L===null||L===124||Ut(L)?(e.exit("data"),D(L)):(e.consume(L),L===92?Y:F)}function Y(L){return L===92||L===124?(e.consume(L),F):F(L)}}function bM(e,n){let r=-1,l=!0,s=0,o=[0,0,0,0],u=[0,0,0,0],f=!1,h=0,p,g,x;const y=new hM;for(;++r<e.length;){const v=e[r],w=v[1];v[0]==="enter"?w.type==="tableHead"?(f=!1,h!==0&&(m1(y,n,h,p,g),g=void 0,h=0),p={type:"table",start:Object.assign({},w.start),end:Object.assign({},w.end)},y.add(r,0,[["enter",p,n]])):w.type==="tableRow"||w.type==="tableDelimiterRow"?(l=!0,x=void 0,o=[0,0,0,0],u=[0,r+1,0,0],f&&(f=!1,g={type:"tableBody",start:Object.assign({},w.start),end:Object.assign({},w.end)},y.add(r,0,[["enter",g,n]])),s=w.type==="tableDelimiterRow"?2:g?3:1):s&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")?(l=!1,u[2]===0&&(o[1]!==0&&(u[0]=u[1],x=Bu(y,n,o,s,void 0,x),o=[0,0,0,0]),u[2]=r)):w.type==="tableCellDivider"&&(l?l=!1:(o[1]!==0&&(u[0]=u[1],x=Bu(y,n,o,s,void 0,x)),o=u,u=[o[1],r,0,0])):w.type==="tableHead"?(f=!0,h=r):w.type==="tableRow"||w.type==="tableDelimiterRow"?(h=r,o[1]!==0?(u[0]=u[1],x=Bu(y,n,o,s,r,x)):u[1]!==0&&(x=Bu(y,n,u,s,r,x)),s=0):s&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")&&(u[3]=r)}for(h!==0&&m1(y,n,h,p,g),y.consume(n.events),r=-1;++r<n.events.length;){const v=n.events[r];v[0]==="enter"&&v[1].type==="table"&&(v[1]._align=mM(n.events,r))}return e}function Bu(e,n,r,l,s,o){const u=l===1?"tableHeader":l===2?"tableDelimiter":"tableData",f="tableContent";r[0]!==0&&(o.end=Object.assign({},Ei(n.events,r[0])),e.add(r[0],0,[["exit",o,n]]));const h=Ei(n.events,r[1]);if(o={type:u,start:Object.assign({},h),end:Object.assign({},h)},e.add(r[1],0,[["enter",o,n]]),r[2]!==0){const p=Ei(n.events,r[2]),g=Ei(n.events,r[3]),x={type:f,start:Object.assign({},p),end:Object.assign({},g)};if(e.add(r[2],0,[["enter",x,n]]),l!==2){const y=n.events[r[2]],v=n.events[r[3]];if(y[1].end=Object.assign({},v[1].end),y[1].type="chunkText",y[1].contentType="text",r[3]>r[2]+1){const w=r[2]+1,E=r[3]-r[2]-1;e.add(w,E,[])}}e.add(r[3]+1,0,[["exit",x,n]])}return s!==void 0&&(o.end=Object.assign({},Ei(n.events,s)),e.add(s,0,[["exit",o,n]]),o=void 0),o}function m1(e,n,r,l,s){const o=[],u=Ei(n.events,r);s&&(s.end=Object.assign({},u),o.push(["exit",s,n])),l.end=Object.assign({},u),o.push(["exit",l,n]),e.add(r+1,0,o)}function Ei(e,n){const r=e[n],l=r[0]==="enter"?"start":"end";return r[1][l]}const yM={name:"tasklistCheck",tokenize:kM};function vM(){return{text:{91:yM}}}function kM(e,n,r){const l=this;return s;function s(h){return l.previous!==null||!l._gfmTasklistFirstContentOfListItem?r(h):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),o)}function o(h){return Ut(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):r(h)}function u(h){return h===93?(e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),f):r(h)}function f(h){return He(h)?n(h):it(h)?e.check({tokenize:wM},n,r)(h):r(h)}}function wM(e,n,r){return dt(e,l,"whitespace");function l(s){return s===null?r(s):n(s)}}function SM(e){return xv([XR(),aM(),dM(e),gM(),vM()])}const EM={};function NM(e){const n=this,r=e||EM,l=n.data(),s=l.micromarkExtensions||(l.micromarkExtensions=[]),o=l.fromMarkdownExtensions||(l.fromMarkdownExtensions=[]),u=l.toMarkdownExtensions||(l.toMarkdownExtensions=[]);s.push(SM(r)),o.push(GR()),u.push(qR(r))}var yh,g1;function _M(){if(g1)return yh;g1=1;function e(H){return H instanceof Map?H.clear=H.delete=H.set=function(){throw new Error("map is read-only")}:H instanceof Set&&(H.add=H.clear=H.delete=function(){throw new Error("set is read-only")}),Object.freeze(H),Object.getOwnPropertyNames(H).forEach(ce=>{const ye=H[ce],Le=typeof ye;(Le==="object"||Le==="function")&&!Object.isFrozen(ye)&&e(ye)}),H}class n{constructor(ce){ce.data===void 0&&(ce.data={}),this.data=ce.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function r(H){return H.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function l(H,...ce){const ye=Object.create(null);for(const Le in H)ye[Le]=H[Le];return ce.forEach(function(Le){for(const Tt in Le)ye[Tt]=Le[Tt]}),ye}const s="</span>",o=H=>!!H.scope,u=(H,{prefix:ce})=>{if(H.startsWith("language:"))return H.replace("language:","language-");if(H.includes(".")){const ye=H.split(".");return[`${ce}${ye.shift()}`,...ye.map((Le,Tt)=>`${Le}${"_".repeat(Tt+1)}`)].join(" ")}return`${ce}${H}`};class f{constructor(ce,ye){this.buffer="",this.classPrefix=ye.classPrefix,ce.walk(this)}addText(ce){this.buffer+=r(ce)}openNode(ce){if(!o(ce))return;const ye=u(ce.scope,{prefix:this.classPrefix});this.span(ye)}closeNode(ce){o(ce)&&(this.buffer+=s)}value(){return this.buffer}span(ce){this.buffer+=`<span class="${ce}">`}}const h=(H={})=>{const ce={children:[]};return Object.assign(ce,H),ce};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(ce){this.top.children.push(ce)}openNode(ce){const ye=h({scope:ce});this.add(ye),this.stack.push(ye)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(ce){return this.constructor._walk(ce,this.rootNode)}static _walk(ce,ye){return typeof ye=="string"?ce.addText(ye):ye.children&&(ce.openNode(ye),ye.children.forEach(Le=>this._walk(ce,Le)),ce.closeNode(ye)),ce}static _collapse(ce){typeof ce!="string"&&ce.children&&(ce.children.every(ye=>typeof ye=="string")?ce.children=[ce.children.join("")]:ce.children.forEach(ye=>{p._collapse(ye)}))}}class g extends p{constructor(ce){super(),this.options=ce}addText(ce){ce!==""&&this.add(ce)}startScope(ce){this.openNode(ce)}endScope(){this.closeNode()}__addSublanguage(ce,ye){const Le=ce.root;ye&&(Le.scope=`language:${ye}`),this.add(Le)}toHTML(){return new f(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function x(H){return H?typeof H=="string"?H:H.source:null}function y(H){return E("(?=",H,")")}function v(H){return E("(?:",H,")*")}function w(H){return E("(?:",H,")?")}function E(...H){return H.map(ye=>x(ye)).join("")}function N(H){const ce=H[H.length-1];return typeof ce=="object"&&ce.constructor===Object?(H.splice(H.length-1,1),ce):{}}function T(...H){return"("+(N(H).capture?"":"?:")+H.map(Le=>x(Le)).join("|")+")"}function R(H){return new RegExp(H.toString()+"|").exec("").length-1}function j(H,ce){const ye=H&&H.exec(ce);return ye&&ye.index===0}const $=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function B(H,{joinWith:ce}){let ye=0;return H.map(Le=>{ye+=1;const Tt=ye;let Ze=x(Le),Te="";for(;Ze.length>0;){const Ne=$.exec(Ze);if(!Ne){Te+=Ze;break}Te+=Ze.substring(0,Ne.index),Ze=Ze.substring(Ne.index+Ne[0].length),Ne[0][0]==="\\"&&Ne[1]?Te+="\\"+String(Number(Ne[1])+Tt):(Te+=Ne[0],Ne[0]==="("&&ye++)}return Te}).map(Le=>`(${Le})`).join(ce)}const _=/\b\B/,D="[a-zA-Z]\\w*",F="[a-zA-Z_]\\w*",Y="\\b\\d+(\\.\\d+)?",L="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",X="\\b(0b[01]+)",Z="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",te=(H={})=>{const ce=/^#![ ]*\//;return H.binary&&(H.begin=E(ce,/.*\b/,H.binary,/\b.*/)),l({scope:"meta",begin:ce,end:/$/,relevance:0,"on:begin":(ye,Le)=>{ye.index!==0&&Le.ignoreMatch()}},H)},J={begin:"\\\\[\\s\\S]",relevance:0},G={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[J]},z={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[J]},V={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/},ne=function(H,ce,ye={}){const Le=l({scope:"comment",begin:H,end:ce,contains:[]},ye);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 Tt=T("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:E(/[ ]+/,"(",Tt,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),Le},be=ne("//","$"),M=ne("/\\*","\\*/"),O=ne("#","$"),I={scope:"number",begin:Y,relevance:0},A={scope:"number",begin:L,relevance:0},oe={scope:"number",begin:X,relevance:0},le={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[J,{begin:/\[/,end:/\]/,relevance:0,contains:[J]}]},he={scope:"title",begin:D,relevance:0},pe={scope:"title",begin:F,relevance:0},Ae={begin:"\\.\\s*"+F,relevance:0};var qe=Object.freeze({__proto__:null,APOS_STRING_MODE:G,BACKSLASH_ESCAPE:J,BINARY_NUMBER_MODE:oe,BINARY_NUMBER_RE:X,COMMENT:ne,C_BLOCK_COMMENT_MODE:M,C_LINE_COMMENT_MODE:be,C_NUMBER_MODE:A,C_NUMBER_RE:L,END_SAME_AS_BEGIN:function(H){return Object.assign(H,{"on:begin":(ce,ye)=>{ye.data._beginMatch=ce[1]},"on:end":(ce,ye)=>{ye.data._beginMatch!==ce[1]&&ye.ignoreMatch()}})},HASH_COMMENT_MODE:O,IDENT_RE:D,MATCH_NOTHING_RE:_,METHOD_GUARD:Ae,NUMBER_MODE:I,NUMBER_RE:Y,PHRASAL_WORDS_MODE:V,QUOTE_STRING_MODE:z,REGEXP_MODE:le,RE_STARTERS_RE:Z,SHEBANG:te,TITLE_MODE:he,UNDERSCORE_IDENT_RE:F,UNDERSCORE_TITLE_MODE:pe});function pt(H,ce){H.input[H.index-1]==="."&&ce.ignoreMatch()}function St(H,ce){H.className!==void 0&&(H.scope=H.className,delete H.className)}function Ge(H,ce){ce&&H.beginKeywords&&(H.begin="\\b("+H.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",H.__beforeBegin=pt,H.keywords=H.keywords||H.beginKeywords,delete H.beginKeywords,H.relevance===void 0&&(H.relevance=0))}function Et(H,ce){Array.isArray(H.illegal)&&(H.illegal=T(...H.illegal))}function ve(H,ce){if(H.match){if(H.begin||H.end)throw new Error("begin & end are not supported with match");H.begin=H.match,delete H.match}}function Ee(H,ce){H.relevance===void 0&&(H.relevance=1)}const mt=(H,ce)=>{if(!H.beforeMatch)return;if(H.starts)throw new Error("beforeMatch cannot be used with starts");const ye=Object.assign({},H);Object.keys(H).forEach(Le=>{delete H[Le]}),H.keywords=ye.keywords,H.begin=E(ye.beforeMatch,y(ye.begin)),H.starts={relevance:0,contains:[Object.assign(ye,{endsParent:!0})]},H.relevance=0,delete ye.beforeMatch},ze=["of","and","for","in","not","or","if","then","parent","list","value"],gt="keyword";function Wt(H,ce,ye=gt){const Le=Object.create(null);return typeof H=="string"?Tt(ye,H.split(" ")):Array.isArray(H)?Tt(ye,H):Object.keys(H).forEach(function(Ze){Object.assign(Le,Wt(H[Ze],ce,Ze))}),Le;function Tt(Ze,Te){ce&&(Te=Te.map(Ne=>Ne.toLowerCase())),Te.forEach(function(Ne){const Ue=Ne.split("|");Le[Ue[0]]=[Ze,Sn(Ue[0],Ue[1])]})}}function Sn(H,ce){return ce?Number(ce):Pn(H)?0:1}function Pn(H){return ze.includes(H.toLowerCase())}const zn={},kt=H=>{console.error(H)},pn=(H,...ce)=>{console.log(`WARN: ${H}`,...ce)},se=(H,ce)=>{zn[`${H}/${ce}`]||(console.log(`Deprecated as of ${H}. ${ce}`),zn[`${H}/${ce}`]=!0)},ge=new Error;function re(H,ce,{key:ye}){let Le=0;const Tt=H[ye],Ze={},Te={};for(let Ne=1;Ne<=ce.length;Ne++)Te[Ne+Le]=Tt[Ne],Ze[Ne+Le]=!0,Le+=R(ce[Ne-1]);H[ye]=Te,H[ye]._emit=Ze,H[ye]._multi=!0}function we(H){if(Array.isArray(H.begin)){if(H.skip||H.excludeBegin||H.returnBegin)throw kt("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),ge;if(typeof H.beginScope!="object"||H.beginScope===null)throw kt("beginScope must be object"),ge;re(H,H.begin,{key:"beginScope"}),H.begin=B(H.begin,{joinWith:""})}}function $e(H){if(Array.isArray(H.end)){if(H.skip||H.excludeEnd||H.returnEnd)throw kt("skip, excludeEnd, returnEnd not compatible with endScope: {}"),ge;if(typeof H.endScope!="object"||H.endScope===null)throw kt("endScope must be object"),ge;re(H,H.end,{key:"endScope"}),H.end=B(H.end,{joinWith:""})}}function xt(H){H.scope&&typeof H.scope=="object"&&H.scope!==null&&(H.beginScope=H.scope,delete H.scope)}function Mt(H){xt(H),typeof H.beginScope=="string"&&(H.beginScope={_wrap:H.beginScope}),typeof H.endScope=="string"&&(H.endScope={_wrap:H.endScope}),we(H),$e(H)}function Pt(H){function ce(Te,Ne){return new RegExp(x(Te),"m"+(H.case_insensitive?"i":"")+(H.unicodeRegex?"u":"")+(Ne?"g":""))}class ye{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(Ne,Ue){Ue.position=this.position++,this.matchIndexes[this.matchAt]=Ue,this.regexes.push([Ue,Ne]),this.matchAt+=R(Ne)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const Ne=this.regexes.map(Ue=>Ue[1]);this.matcherRe=ce(B(Ne,{joinWith:"|"}),!0),this.lastIndex=0}exec(Ne){this.matcherRe.lastIndex=this.lastIndex;const Ue=this.matcherRe.exec(Ne);if(!Ue)return null;const It=Ue.findIndex((mn,gr)=>gr>0&&mn!==void 0),rt=this.matchIndexes[It];return Ue.splice(0,It),Object.assign(Ue,rt)}}class Le{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(Ne){if(this.multiRegexes[Ne])return this.multiRegexes[Ne];const Ue=new ye;return this.rules.slice(Ne).forEach(([It,rt])=>Ue.addRule(It,rt)),Ue.compile(),this.multiRegexes[Ne]=Ue,Ue}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(Ne,Ue){this.rules.push([Ne,Ue]),Ue.type==="begin"&&this.count++}exec(Ne){const Ue=this.getMatcher(this.regexIndex);Ue.lastIndex=this.lastIndex;let It=Ue.exec(Ne);if(this.resumingScanAtSamePosition()&&!(It&&It.index===this.lastIndex)){const rt=this.getMatcher(0);rt.lastIndex=this.lastIndex+1,It=rt.exec(Ne)}return It&&(this.regexIndex+=It.position+1,this.regexIndex===this.count&&this.considerAll()),It}}function Tt(Te){const Ne=new Le;return Te.contains.forEach(Ue=>Ne.addRule(Ue.begin,{rule:Ue,type:"begin"})),Te.terminatorEnd&&Ne.addRule(Te.terminatorEnd,{type:"end"}),Te.illegal&&Ne.addRule(Te.illegal,{type:"illegal"}),Ne}function Ze(Te,Ne){const Ue=Te;if(Te.isCompiled)return Ue;[St,ve,Mt,mt].forEach(rt=>rt(Te,Ne)),H.compilerExtensions.forEach(rt=>rt(Te,Ne)),Te.__beforeBegin=null,[Ge,Et,Ee].forEach(rt=>rt(Te,Ne)),Te.isCompiled=!0;let It=null;return typeof Te.keywords=="object"&&Te.keywords.$pattern&&(Te.keywords=Object.assign({},Te.keywords),It=Te.keywords.$pattern,delete Te.keywords.$pattern),It=It||/\w+/,Te.keywords&&(Te.keywords=Wt(Te.keywords,H.case_insensitive)),Ue.keywordPatternRe=ce(It,!0),Ne&&(Te.begin||(Te.begin=/\B|\b/),Ue.beginRe=ce(Ue.begin),!Te.end&&!Te.endsWithParent&&(Te.end=/\B|\b/),Te.end&&(Ue.endRe=ce(Ue.end)),Ue.terminatorEnd=x(Ue.end)||"",Te.endsWithParent&&Ne.terminatorEnd&&(Ue.terminatorEnd+=(Te.end?"|":"")+Ne.terminatorEnd)),Te.illegal&&(Ue.illegalRe=ce(Te.illegal)),Te.contains||(Te.contains=[]),Te.contains=[].concat(...Te.contains.map(function(rt){return bt(rt==="self"?Te:rt)})),Te.contains.forEach(function(rt){Ze(rt,Ue)}),Te.starts&&Ze(Te.starts,Ne),Ue.matcher=Tt(Ue),Ue}if(H.compilerExtensions||(H.compilerExtensions=[]),H.contains&&H.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return H.classNameAliases=l(H.classNameAliases||{}),Ze(H)}function nt(H){return H?H.endsWithParent||nt(H.starts):!1}function bt(H){return H.variants&&!H.cachedVariants&&(H.cachedVariants=H.variants.map(function(ce){return l(H,{variants:null},ce)})),H.cachedVariants?H.cachedVariants:nt(H)?l(H,{starts:H.starts?l(H.starts):null}):Object.isFrozen(H)?l(H):H}var Je="11.11.1";class bn extends Error{constructor(ce,ye){super(ce),this.name="HTMLInjectionError",this.html=ye}}const Jt=r,ra=l,jn=Symbol("nomatch"),sn=7,nr=function(H){const ce=Object.create(null),ye=Object.create(null),Le=[];let Tt=!0;const Ze="Could not find the language '{}', did you forget to load/include a language module?",Te={disableAutodetect:!0,name:"Plain text",contains:[]};let Ne={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:g};function Ue(xe){return Ne.noHighlightRe.test(xe)}function It(xe){let ae=xe.className+" ";ae+=xe.parentNode?xe.parentNode.className:"";const Ie=Ne.languageDetectRe.exec(ae);if(Ie){const et=me(Ie[1]);return et||(pn(Ze.replace("{}",Ie[1])),pn("Falling back to no-highlight mode for this block.",xe)),et?Ie[1]:"no-highlight"}return ae.split(/\s+/).find(et=>Ue(et)||me(et))}function rt(xe,ae,Ie){let et="",rn="";typeof ae=="object"?(et=xe,Ie=ae.ignoreIllegals,rn=ae.language):(se("10.7.0","highlight(lang, code, ...args) has been deprecated."),se("10.7.0",`Please use highlight(code, options) instead.
|
|
43
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),rn=xe,et=ae),Ie===void 0&&(Ie=!0);const Rn={code:et,language:rn};gn("before:highlight",Rn);const rr=Rn.result?Rn.result:mn(Rn.language,Rn.code,Ie);return rr.code=Rn.code,gn("after:highlight",rr),rr}function mn(xe,ae,Ie,et){const rn=Object.create(null);function Rn(Se,Me){return Se.keywords[Me]}function rr(){if(!Fe.keywords){on.addText(At);return}let Se=0;Fe.keywordPatternRe.lastIndex=0;let Me=Fe.keywordPatternRe.exec(At),Xe="";for(;Me;){Xe+=At.substring(Se,Me.index);const st=En.case_insensitive?Me[0].toLowerCase():Me[0],Qt=Rn(Fe,st);if(Qt){const[yr,Pi]=Qt;if(on.addText(Xe),Xe="",rn[st]=(rn[st]||0)+1,rn[st]<=sn&&(Ca+=Pi),yr.startsWith("_"))Xe+=Me[0];else{const Eo=En.classNameAliases[yr]||yr;ar(Me[0],Eo)}}else Xe+=Me[0];Se=Fe.keywordPatternRe.lastIndex,Me=Fe.keywordPatternRe.exec(At)}Xe+=At.substring(Se),on.addText(Xe)}function Gn(){if(At==="")return;let Se=null;if(typeof Fe.subLanguage=="string"){if(!ce[Fe.subLanguage]){on.addText(At);return}Se=mn(Fe.subLanguage,At,!0,So[Fe.subLanguage]),So[Fe.subLanguage]=Se._top}else Se=Mr(At,Fe.subLanguage.length?Fe.subLanguage:null);Fe.relevance>0&&(Ca+=Se.relevance),on.__addSublanguage(Se._emitter,Se.language)}function Ft(){Fe.subLanguage!=null?Gn():rr(),At=""}function ar(Se,Me){Se!==""&&(on.startScope(Me),on.addText(Se),on.endScope())}function ko(Se,Me){let Xe=1;const st=Me.length-1;for(;Xe<=st;){if(!Se._emit[Xe]){Xe++;continue}const Qt=En.classNameAliases[Se[Xe]]||Se[Xe],yr=Me[Xe];Qt?ar(yr,Qt):(At=yr,rr(),At=""),Xe++}}function Ul(Se,Me){return Se.scope&&typeof Se.scope=="string"&&on.openNode(En.classNameAliases[Se.scope]||Se.scope),Se.beginScope&&(Se.beginScope._wrap?(ar(At,En.classNameAliases[Se.beginScope._wrap]||Se.beginScope._wrap),At=""):Se.beginScope._multi&&(ko(Se.beginScope,Me),At="")),Fe=Object.create(Se,{parent:{value:Fe}}),Fe}function $i(Se,Me,Xe){let st=j(Se.endRe,Xe);if(st){if(Se["on:end"]){const Qt=new n(Se);Se["on:end"](Me,Qt),Qt.isMatchIgnored&&(st=!1)}if(st){for(;Se.endsParent&&Se.parent;)Se=Se.parent;return Se}}if(Se.endsWithParent)return $i(Se.parent,Me,Xe)}function Hl(Se){return Fe.matcher.regexIndex===0?(At+=Se[0],1):(ja=!0,0)}function Pc(Se){const Me=Se[0],Xe=Se.rule,st=new n(Xe),Qt=[Xe.__beforeBegin,Xe["on:begin"]];for(const yr of Qt)if(yr&&(yr(Se,st),st.isMatchIgnored))return Hl(Me);return Xe.skip?At+=Me:(Xe.excludeBegin&&(At+=Me),Ft(),!Xe.returnBegin&&!Xe.excludeBegin&&(At=Me)),Ul(Xe,Se),Xe.returnBegin?0:Me.length}function qn(Se){const Me=Se[0],Xe=ae.substring(Se.index),st=$i(Fe,Se,Xe);if(!st)return jn;const Qt=Fe;Fe.endScope&&Fe.endScope._wrap?(Ft(),ar(Me,Fe.endScope._wrap)):Fe.endScope&&Fe.endScope._multi?(Ft(),ko(Fe.endScope,Se)):Qt.skip?At+=Me:(Qt.returnEnd||Qt.excludeEnd||(At+=Me),Ft(),Qt.excludeEnd&&(At=Me));do Fe.scope&&on.closeNode(),!Fe.skip&&!Fe.subLanguage&&(Ca+=Fe.relevance),Fe=Fe.parent;while(Fe!==st.parent);return st.starts&&Ul(st.starts,Se),Qt.returnEnd?0:Me.length}function Ui(){const Se=[];for(let Me=Fe;Me!==En;Me=Me.parent)Me.scope&&Se.unshift(Me.scope);Se.forEach(Me=>on.openNode(Me))}let ul={};function Pl(Se,Me){const Xe=Me&&Me[0];if(At+=Se,Xe==null)return Ft(),0;if(ul.type==="begin"&&Me.type==="end"&&ul.index===Me.index&&Xe===""){if(At+=ae.slice(Me.index,Me.index+1),!Tt){const st=new Error(`0 width match regex (${xe})`);throw st.languageName=xe,st.badRule=ul.rule,st}return 1}if(ul=Me,Me.type==="begin")return Pc(Me);if(Me.type==="illegal"&&!Ie){const st=new Error('Illegal lexeme "'+Xe+'" for mode "'+(Fe.scope||"<unnamed>")+'"');throw st.mode=Fe,st}else if(Me.type==="end"){const st=qn(Me);if(st!==jn)return st}if(Me.type==="illegal"&&Xe==="")return At+=`
|
|
44
|
+
`,1;if(Hi>1e5&&Hi>Me.index*3)throw new Error("potential infinite loop, way more iterations than matches");return At+=Xe,Xe.length}const En=me(xe);if(!En)throw kt(Ze.replace("{}",xe)),new Error('Unknown language: "'+xe+'"');const wo=Pt(En);let Fl="",Fe=et||wo;const So={},on=new Ne.__emitter(Ne);Ui();let At="",Ca=0,la=0,Hi=0,ja=!1;try{if(En.__emitTokens)En.__emitTokens(ae,on);else{for(Fe.matcher.considerAll();;){Hi++,ja?ja=!1:Fe.matcher.considerAll(),Fe.matcher.lastIndex=la;const Se=Fe.matcher.exec(ae);if(!Se)break;const Me=ae.substring(la,Se.index),Xe=Pl(Me,Se);la=Se.index+Xe}Pl(ae.substring(la))}return on.finalize(),Fl=on.toHTML(),{language:xe,value:Fl,relevance:Ca,illegal:!1,_emitter:on,_top:Fe}}catch(Se){if(Se.message&&Se.message.includes("Illegal"))return{language:xe,value:Jt(ae),illegal:!0,relevance:0,_illegalBy:{message:Se.message,index:la,context:ae.slice(la-100,la+100),mode:Se.mode,resultSoFar:Fl},_emitter:on};if(Tt)return{language:xe,value:Jt(ae),illegal:!1,relevance:0,errorRaised:Se,_emitter:on,_top:Fe};throw Se}}function gr(xe){const ae={value:Jt(xe),illegal:!1,relevance:0,_top:Te,_emitter:new Ne.__emitter(Ne)};return ae._emitter.addText(xe),ae}function Mr(xe,ae){ae=ae||Ne.languages||Object.keys(ce);const Ie=gr(xe),et=ae.filter(me).filter(ct).map(Ft=>mn(Ft,xe,!1));et.unshift(Ie);const rn=et.sort((Ft,ar)=>{if(Ft.relevance!==ar.relevance)return ar.relevance-Ft.relevance;if(Ft.language&&ar.language){if(me(Ft.language).supersetOf===ar.language)return 1;if(me(ar.language).supersetOf===Ft.language)return-1}return 0}),[Rn,rr]=rn,Gn=Rn;return Gn.secondBest=rr,Gn}function yn(xe,ae,Ie){const et=ae&&ye[ae]||Ie;xe.classList.add("hljs"),xe.classList.add(`language-${et}`)}function Ot(xe){let ae=null;const Ie=It(xe);if(Ue(Ie))return;if(gn("before:highlightElement",{el:xe,language:Ie}),xe.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",xe);return}if(xe.children.length>0&&(Ne.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(xe)),Ne.throwUnescapedHTML))throw new bn("One of your code blocks includes unescaped HTML.",xe.innerHTML);ae=xe;const et=ae.textContent,rn=Ie?rt(et,{language:Ie,ignoreIllegals:!0}):Mr(et);xe.innerHTML=rn.value,xe.dataset.highlighted="yes",yn(xe,Ie,rn.language),xe.result={language:rn.language,re:rn.relevance,relevance:rn.relevance},rn.secondBest&&(xe.secondBest={language:rn.secondBest.language,relevance:rn.secondBest.relevance}),gn("after:highlightElement",{el:xe,result:rn,text:et})}function Nt(xe){Ne=ra(Ne,xe)}const Fn=()=>{br(),se("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function xr(){br(),se("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let aa=!1;function br(){function xe(){br()}if(document.readyState==="loading"){aa||window.addEventListener("DOMContentLoaded",xe,!1),aa=!0;return}document.querySelectorAll(Ne.cssSelector).forEach(Ot)}function qr(xe,ae){let Ie=null;try{Ie=ae(H)}catch(et){if(kt("Language definition for '{}' could not be registered.".replace("{}",xe)),Tt)kt(et);else throw et;Ie=Te}Ie.name||(Ie.name=xe),ce[xe]=Ie,Ie.rawDefinition=ae.bind(null,H),Ie.aliases&&_e(Ie.aliases,{languageName:xe})}function Ce(xe){delete ce[xe];for(const ae of Object.keys(ye))ye[ae]===xe&&delete ye[ae]}function P(){return Object.keys(ce)}function me(xe){return xe=(xe||"").toLowerCase(),ce[xe]||ce[ye[xe]]}function _e(xe,{languageName:ae}){typeof xe=="string"&&(xe=[xe]),xe.forEach(Ie=>{ye[Ie.toLowerCase()]=ae})}function ct(xe){const ae=me(xe);return ae&&!ae.disableAutodetect}function Bt(xe){xe["before:highlightBlock"]&&!xe["before:highlightElement"]&&(xe["before:highlightElement"]=ae=>{xe["before:highlightBlock"](Object.assign({block:ae.el},ae))}),xe["after:highlightBlock"]&&!xe["after:highlightElement"]&&(xe["after:highlightElement"]=ae=>{xe["after:highlightBlock"](Object.assign({block:ae.el},ae))})}function Ve(xe){Bt(xe),Le.push(xe)}function Zt(xe){const ae=Le.indexOf(xe);ae!==-1&&Le.splice(ae,1)}function gn(xe,ae){const Ie=xe;Le.forEach(function(et){et[Ie]&&et[Ie](ae)})}function vn(xe){return se("10.7.0","highlightBlock will be removed entirely in v12.0"),se("10.7.0","Please use highlightElement now."),Ot(xe)}Object.assign(H,{highlight:rt,highlightAuto:Mr,highlightAll:br,highlightElement:Ot,highlightBlock:vn,configure:Nt,initHighlighting:Fn,initHighlightingOnLoad:xr,registerLanguage:qr,unregisterLanguage:Ce,listLanguages:P,getLanguage:me,registerAliases:_e,autoDetection:ct,inherit:ra,addPlugin:Ve,removePlugin:Zt}),H.debugMode=function(){Tt=!1},H.safeMode=function(){Tt=!0},H.versionString=Je,H.regex={concat:E,lookahead:y,either:T,optional:w,anyNumberOfTimes:v};for(const xe in qe)typeof qe[xe]=="object"&&e(qe[xe]);return Object.assign(H,qe),H},en=nr({});return en.newInstance=()=>nr({}),yh=en,en.HighlightJS=en,en.default=en,yh}var TM=_M();const Rt=fo(TM),fc="[A-Za-z$_][0-9A-Za-z$_]*",sk=["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"],ok=["true","false","null","undefined","NaN","Infinity"],uk=["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"],ck=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],fk=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],dk=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],hk=[].concat(fk,uk,ck);function AM(e){const n=e.regex,r=(ne,{after:be})=>{const M="</"+ne[0].slice(1);return ne.input.indexOf(M,be)!==-1},l=fc,s={begin:"<>",end:"</>"},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,u={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(ne,be)=>{const M=ne[0].length+ne.index,O=ne.input[M];if(O==="<"||O===","){be.ignoreMatch();return}O===">"&&(r(ne,{after:M})||be.ignoreMatch());let I;const A=ne.input.substring(M);if(I=A.match(/^\s*=/)){be.ignoreMatch();return}if((I=A.match(/^\s+extends\s+/))&&I.index===0){be.ignoreMatch();return}}},f={$pattern:fc,keyword:sk,literal:ok,built_in:hk,"variable.language":dk},h="[0-9](_?[0-9])*",p=`\\.(${h})`,g="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",x={className:"number",variants:[{begin:`(\\b(${g})((${p})|\\.)?|(${p}))[eE][+-]?(${h})\\b`},{begin:`\\b(${g})\\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},y={className:"subst",begin:"\\$\\{",end:"\\}",keywords:f,contains:[]},v={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"xml"}},w={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"css"}},E={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"graphql"}},N={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,y]},R={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]},j=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,v,w,E,N,{match:/\$\d+/},x];y.contains=j.concat({begin:/\{/,end:/\}/,keywords:f,contains:["self"].concat(j)});const $=[].concat(R,y.contains),B=$.concat([{begin:/(\s*)\(/,end:/\)/,keywords:f,contains:["self"].concat($)}]),_={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:B},D={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"}}]},F={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:{_:[...uk,...ck]}},Y={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},L={variants:[{match:[/function/,/\s+/,l,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[_],illegal:/%/},X={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Z(ne){return n.concat("(?!",ne.join("|"),")")}const te={match:n.concat(/\b/,Z([...fk,"super","import"].map(ne=>`${ne}\\s*\\(`)),l,n.lookahead(/\s*\(/)),className:"title.function",relevance:0},J={begin:n.concat(/\./,n.lookahead(n.concat(l,/(?![0-9A-Za-z$_(])/))),end:l,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},G={match:[/get|set/,/\s+/,l,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},_]},z="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",V={match:[/const|var|let/,/\s+/,l,/\s*/,/=\s*/,/(async\s*)?/,n.lookahead(z)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[_]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:f,exports:{PARAMS_CONTAINS:B,CLASS_REFERENCE:F},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),Y,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,v,w,E,N,R,{match:/\$\d+/},x,F,{scope:"attr",match:l+n.lookahead(":"),relevance:0},V,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[R,e.REGEXP_MODE,{className:"function",begin:z,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:B}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:s.begin,end:s.end},{match:o},{begin:u.begin,"on:begin":u.isTrulyOpeningTag,end:u.end}],subLanguage:"xml",contains:[{begin:u.begin,end:u.end,skip:!0,contains:["self"]}]}]},L,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[_,e.inherit(e.TITLE_MODE,{begin:l,className:"title.function"})]},{match:/\.\.\./,relevance:0},J,{match:"\\$"+l,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[_]},te,X,D,G,{match:/\$[(.]/}]}}function Zp(e){const n=e.regex,r=AM(e),l=fc,s=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],o={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},u={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:s},contains:[r.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:fc,keyword:sk.concat(h),literal:ok,built_in:hk.concat(s),"variable.language":dk},g={className:"meta",begin:"@"+l},x=(E,N,T)=>{const R=E.contains.findIndex(j=>j.label===N);if(R===-1)throw new Error("can not find mode to replace");E.contains.splice(R,1,T)};Object.assign(r.keywords,p),r.exports.PARAMS_CONTAINS.push(g);const y=r.contains.find(E=>E.scope==="attr"),v=Object.assign({},y,{match:n.concat(l,n.lookahead(/\s*\?:/))});r.exports.PARAMS_CONTAINS.push([r.exports.CLASS_REFERENCE,y,v]),r.contains=r.contains.concat([g,o,u,v]),x(r,"shebang",e.SHEBANG()),x(r,"use_strict",f);const w=r.contains.find(E=>E.label==="func.def");return w.relevance=0,Object.assign(r,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),r}const x1="[A-Za-z$_][0-9A-Za-z$_]*",CM=["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"],jM=["true","false","null","undefined","NaN","Infinity"],pk=["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"],mk=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],gk=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],RM=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],MM=[].concat(gk,pk,mk);function Qp(e){const n=e.regex,r=(ne,{after:be})=>{const M="</"+ne[0].slice(1);return ne.input.indexOf(M,be)!==-1},l=x1,s={begin:"<>",end:"</>"},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,u={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(ne,be)=>{const M=ne[0].length+ne.index,O=ne.input[M];if(O==="<"||O===","){be.ignoreMatch();return}O===">"&&(r(ne,{after:M})||be.ignoreMatch());let I;const A=ne.input.substring(M);if(I=A.match(/^\s*=/)){be.ignoreMatch();return}if((I=A.match(/^\s+extends\s+/))&&I.index===0){be.ignoreMatch();return}}},f={$pattern:x1,keyword:CM,literal:jM,built_in:MM,"variable.language":RM},h="[0-9](_?[0-9])*",p=`\\.(${h})`,g="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",x={className:"number",variants:[{begin:`(\\b(${g})((${p})|\\.)?|(${p}))[eE][+-]?(${h})\\b`},{begin:`\\b(${g})\\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},y={className:"subst",begin:"\\$\\{",end:"\\}",keywords:f,contains:[]},v={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"xml"}},w={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"css"}},E={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"graphql"}},N={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,y]},R={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]},j=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,v,w,E,N,{match:/\$\d+/},x];y.contains=j.concat({begin:/\{/,end:/\}/,keywords:f,contains:["self"].concat(j)});const $=[].concat(R,y.contains),B=$.concat([{begin:/(\s*)\(/,end:/\)/,keywords:f,contains:["self"].concat($)}]),_={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:B},D={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"}}]},F={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:{_:[...pk,...mk]}},Y={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},L={variants:[{match:[/function/,/\s+/,l,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[_],illegal:/%/},X={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Z(ne){return n.concat("(?!",ne.join("|"),")")}const te={match:n.concat(/\b/,Z([...gk,"super","import"].map(ne=>`${ne}\\s*\\(`)),l,n.lookahead(/\s*\(/)),className:"title.function",relevance:0},J={begin:n.concat(/\./,n.lookahead(n.concat(l,/(?![0-9A-Za-z$_(])/))),end:l,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},G={match:[/get|set/,/\s+/,l,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},_]},z="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",V={match:[/const|var|let/,/\s+/,l,/\s*/,/=\s*/,/(async\s*)?/,n.lookahead(z)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[_]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:f,exports:{PARAMS_CONTAINS:B,CLASS_REFERENCE:F},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),Y,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,v,w,E,N,R,{match:/\$\d+/},x,F,{scope:"attr",match:l+n.lookahead(":"),relevance:0},V,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[R,e.REGEXP_MODE,{className:"function",begin:z,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:B}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:s.begin,end:s.end},{match:o},{begin:u.begin,"on:begin":u.isTrulyOpeningTag,end:u.end}],subLanguage:"xml",contains:[{begin:u.begin,end:u.end,skip:!0,contains:["self"]}]}]},L,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[_,e.inherit(e.TITLE_MODE,{begin:l,className:"title.function"})]},{match:/\.\.\./,relevance:0},J,{match:"\\$"+l,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[_]},te,X,D,G,{match:/\$[(.]/}]}}function OM(e){const n={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},r={match:/[{}[\],:]/,className:"punctuation",relevance:0},l=["true","false","null"],s={scope:"literal",beginKeywords:l.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:l},contains:[n,r,e.QUOTE_STRING_MODE,s,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function Tc(e){const n=e.regex,r={},l={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[r]}]};Object.assign(r,{className:"variable",variants:[{begin:n.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},l]});const s={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},o=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,r,s]};s.contains.push(f);const h={match:/\\"/},p={className:"string",begin:/'/,end:/'/},g={match:/\\'/},x={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,r]},y=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],v=e.SHEBANG({binary:`(${y.join("|")})`,relevance:10}),w={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},E=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],N=["true","false"],T={match:/(\/[a-z._-]+)+/},R=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],j=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],$=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],B=["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:E,literal:N,built_in:[...R,...j,"set","shopt",...$,...B]},contains:[v,e.SHEBANG(),w,x,o,u,T,f,h,p,g,r]}}function xk(e){const n=e.regex,r=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:/#/},g={begin:/\{\{/,relevance:0},x={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,g,p]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,h,g,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,g,p]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,g,p]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},y="[0-9](_?[0-9])*",v=`(\\b(${y}))?\\.(${y})|\\b(${y})\\.`,w=`\\b|${l.join("|")}`,E={className:"number",relevance:0,variants:[{begin:`(\\b(${y})|(${v}))[eE][+-]?(${y})[jJ]?(?=${w})`},{begin:`(${v})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${w})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${w})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${w})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${w})`},{begin:`\\b(${y})[jJ](?=${w})`}]},N={className:"comment",begin:n.lookahead(/# type:/),end:/$/,keywords:f,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},T={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:["self",h,E,x,e.HASH_COMMENT_MODE]}]};return p.contains=[x,E,h],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:f,illegal:/(<\/|\?)|=>/,contains:[h,E,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},x,N,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,r],scope:{1:"keyword",3:"title.function"},contains:[T]},{variants:[{match:[/\bclass/,/\s+/,r,/\s*/,/\(\s*/,r,/\s*\)/]},{match:[/\bclass/,/\s+/,r]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[E,T,x]}]}}function DM(e){const o={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:o,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:o,illegal:/["']/}]}]}}function bk(e){const n="true false yes no null",r="[\\w#;/?:@&=+$,.~*'()[\\]]+",l={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},s={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},o={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,s]},f=e.inherit(u,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),y={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},v={end:",",endsWithParent:!0,excludeEnd:!0,keywords:n,relevance:0},w={begin:/\{/,end:/\}/,contains:[v],illegal:"\\n",relevance:0},E={begin:"\\[",end:"\\]",contains:[v],illegal:"\\n",relevance:0},N=[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+!"+r},{className:"type",begin:"!<"+r+">"},{className:"type",begin:"!"+r},{className:"type",begin:"!!"+r},{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}},y,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},w,E,o,u],T=[...N];return T.pop(),T.push(f),v.contains=T,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:N}}function yk(e){const n=e.regex,r={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},l={begin:"^[-\\*]{3,}",end:"$"},s={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}]},o={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}/}]},g={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},x=e.inherit(p,{contains:[]}),y=e.inherit(g,{contains:[]});p.contains.push(y),g.contains.push(x);let v=[r,h];return[p,g,x,y].forEach(T=>{T.contains=T.contains.concat(v)}),v=v.concat(p,g),{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}]}]},r,o,p,g,{className:"quote",begin:"^>\\s+",contains:v,end:"$"},s,l,h,u,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function vk(e){const n=e.regex,r=n.concat(/[\p{L}_]/u,n.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),l=/[\p{L}0-9._:-]+/u,s={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},o={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},u=e.inherit(o,{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:[s]},{begin:/'/,end:/'/,contains:[s]},{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:[o,h,f,u,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[o,u,h,f]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},s,{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(r,n.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:r,relevance:0,starts:p}]},{className:"tag",begin:n.concat(/<\//,n.lookahead(n.concat(r,/>/))),contains:[{className:"name",begin:r,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}const zM=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_-]*/}}),LM=["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"],IM=["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"],BM=[...LM,...IM],$M=["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(),UM=["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(),HM=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),PM=["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 FM(e){const n=e.regex,r=zM(e),l={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},s="and or not only",o=/@-?\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:[r.BLOCK_COMMENT,l,r.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+u,relevance:0},r.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+UM.join("|")+")"},{begin:":(:)?("+HM.join("|")+")"}]},r.CSS_VARIABLE,{className:"attribute",begin:"\\b("+PM.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[r.BLOCK_COMMENT,r.HEXCOLOR,r.IMPORTANT,r.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}]},r.FUNCTION_DISPATCH]},{begin:n.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:o},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:s,attribute:$M.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...f,r.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+BM.join("|")+")\\b"}]}}function kk(e){const n=e.regex,r=/(r#)?/,l=n.concat(r,e.UNDERSCORE_IDENT_RE),s=n.concat(r,e.IDENT_RE),o={className:"title.function.invoke",relevance:0,begin:n.concat(/\b/,/(?!let|for|while|if|else|match\b)/,s,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!"],g=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:g,keyword: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:g}},{className:"punctuation",begin:"->"},o]}}function GM(e){const n=e.regex,r=e.COMMENT("--","$"),l={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},s={begin:/"/,end:/"/,contains:[{match:/""/}]},o=["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"],g=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],x=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],y=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],v=g,w=[...p,...h].filter(B=>!g.includes(B)),E={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},N={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},T={match:n.concat(/\b/,n.either(...v),/\s*\(/),relevance:0,keywords:{built_in:v}};function R(B){return n.concat(/\b/,n.either(...B.map(_=>_.replace(/\s+/,"\\s+"))),/\b/)}const j={scope:"keyword",match:R(y),relevance:0};function $(B,{exceptions:_,when:D}={}){const F=D;return _=_||[],B.map(Y=>Y.match(/\|\d+$/)||_.includes(Y)?Y:F(Y)?`${Y}|0`:Y)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:$(w,{when:B=>B.length<3}),literal:o,type:f,built_in:x},contains:[{scope:"type",match:R(u)},j,T,E,l,s,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,r,N]}}function qM(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:/$/}]}}Rt.registerLanguage("typescript",Zp);Rt.registerLanguage("ts",Zp);Rt.registerLanguage("tsx",Zp);Rt.registerLanguage("javascript",Qp);Rt.registerLanguage("js",Qp);Rt.registerLanguage("jsx",Qp);Rt.registerLanguage("json",OM);Rt.registerLanguage("bash",Tc);Rt.registerLanguage("sh",Tc);Rt.registerLanguage("shell",Tc);Rt.registerLanguage("zsh",Tc);Rt.registerLanguage("python",xk);Rt.registerLanguage("py",xk);Rt.registerLanguage("go",DM);Rt.registerLanguage("yaml",bk);Rt.registerLanguage("yml",bk);Rt.registerLanguage("markdown",yk);Rt.registerLanguage("md",yk);Rt.registerLanguage("html",vk);Rt.registerLanguage("xml",vk);Rt.registerLanguage("css",FM);Rt.registerLanguage("rust",kk);Rt.registerLanguage("rs",kk);Rt.registerLanguage("sql",GM);Rt.registerLanguage("diff",qM);function YM(e){const n=e.match(/^claude-(\w+)-(\d+)-(\d+)/);return n?`${n[1].charAt(0).toUpperCase()+n[1].slice(1)} ${n[2]}.${n[3]}`:e}function VM(e){return e.replace(/\[Attached files?: ([^\]]+)\]/g,(n,r)=>`📎 ${r.split(", ").map(s=>s.split("/").pop()||s).join(", ")}`)}function XM(e){const n=e.match(/^(.*?)\s*(\{.+\})\s*$/);if(!n)return null;try{const r=JSON.parse(n[2]);if(r?.error?.message)return{prefix:n[1].replace(/\s*$/,""),errorType:r.error.type||"error",message:r.error.message,requestId:r.request_id}}catch{}return null}function KM({msg:e}){const n=e.subtype==="init"?"text-success-5":e.subtype==="notification"?"text-primary-5":e.subtype==="exit"||e.subtype==="stall"||e.subtype==="restart"?"text-warning-5":e.subtype==="info"?"text-neutral-5":"text-error-5",r=e.subtype==="init"?"bg-success-5":e.subtype==="notification"?"bg-primary-5":e.subtype==="exit"||e.subtype==="stall"||e.subtype==="restart"?"bg-warning-5":e.subtype==="info"?"bg-neutral-5":"bg-error-5",l=e.model?` (${YM(e.model)})`:"",s=e.subtype==="error"?XM(e.text):null;return s?d.jsxs("div",{className:`px-4 py-2 text-[15px] ${n}`,children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:`inline-block h-1.5 w-1.5 rounded-full ${r} flex-shrink-0`}),d.jsx("span",{className:"font-semibold",children:s.prefix||"API Error"})]}),d.jsxs("div",{className:"ml-3.5 mt-1 space-y-0.5 text-[14px] opacity-90",children:[d.jsx("div",{children:s.message}),s.requestId&&d.jsxs("div",{className:"opacity-50 text-[12px] font-mono",children:["Request ID: ",s.requestId]})]})]}):d.jsxs("div",{className:`px-4 py-1.5 text-[15px] ${n} flex items-center gap-2`,children:[d.jsx("span",{className:`inline-block h-1.5 w-1.5 rounded-full ${r} flex-shrink-0`}),e.text,l]})}function ZM({msg:e,fontSize:n,isMobile:r}){return d.jsx("div",{className:"px-4 py-2",children:d.jsx("div",{className:`user-bubble rounded-lg bg-neutral-10/60 px-3 py-2 text-neutral-3 whitespace-pre-wrap ${r?"max-w-[95%]":"max-w-[80%]"}`,style:{fontSize:`${n}px`},children:VM(e.text)})})}function QM({code:e}){const[n,r]=k.useState(!1),l=k.useCallback(()=>{navigator.clipboard.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)})},[e]);return d.jsx("button",{onClick:l,className:"absolute top-2 right-2 rounded p-1 opacity-0 transition-opacity group-hover/codeblock:opacity-100 bg-neutral-8/80 hover:bg-neutral-7 text-neutral-4 hover:text-neutral-2 cursor-pointer",title:"Copy to clipboard",children:n?d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:d.jsx("path",{d:"M20 6L9 17l-5-5"})}):d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),d.jsx("path",{d:"M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"})]})})}function WM(e,n){return Rt.getLanguage(n)?Rt.highlight(e,{language:n}).value:e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function JM({msg:e,fontSize:n,variant:r="default"}){return d.jsx("div",{className:`px-4 py-2 ${r==="orchestrator"?"orchestrator-assistant-msg":""}`,children:d.jsx("div",{className:"prose prose-themed max-w-none",style:{fontSize:`${n}px`},children:d.jsx(d3,{remarkPlugins:[NM],components:{code({className:l,children:s,...o}){const u=/language-(\w+)/.exec(l||""),f=String(s).replace(/\n$/,"");return u?d.jsxs("div",{className:"group/codeblock relative",children:[d.jsx("div",{className:"hljs",style:{margin:"0.5em 0",borderRadius:"6px",fontSize:`${n-1}px`,padding:"1em",overflowX:"auto"},dangerouslySetInnerHTML:{__html:WM(f,u[1])}}),d.jsx(QM,{code:f})]}):d.jsx("code",{className:`${l||""} rounded bg-neutral-10 px-1.5 py-0.5`,...o,children:s})},a({href:l,children:s,...o}){const u=l&&/^(https?:|mailto:|\/|#)/i.test(l)?l:"#";return d.jsx("a",{href:u,target:"_blank",rel:"noopener noreferrer",...o,children:s})},img({src:l,alt:s,...o}){return d.jsx("img",{src:l,alt:s||"Image",className:"max-w-full max-h-96 rounded-lg border border-neutral-8 my-2",loading:"lazy",...o})}},children:e.text})})})}function eO({msg:e,fontSize:n}){const r=n-1;return d.jsx("div",{className:"flex flex-wrap gap-x-4 gap-y-0.5 text-neutral-4",style:{fontSize:`${r}px`,fontFamily:"'Inconsolata', monospace"},children:e.tools.map((l,s)=>d.jsxs("span",{className:"flex items-center gap-1.5 whitespace-nowrap overflow-hidden",children:[l.active?d.jsx("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-primary-5 animate-pulse flex-shrink-0"}):d.jsx("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-neutral-6 flex-shrink-0"}),d.jsx("span",{className:"text-accent-6",children:l.name}),l.summary&&d.jsx("span",{className:"text-neutral-5 truncate max-w-[400px]",children:l.summary})]},s))})}function tO({msg:e,fontSize:n}){const[r,l]=k.useState(!1),s=n-1,o=e.isError?"text-error-5":"text-neutral-5",u=e.content.split(`
|
|
45
|
+
`),f=u.length>3,h=f&&!r?u.slice(0,3).join(`
|
|
46
|
+
`):e.content;return d.jsxs("div",{className:`pl-4 py-0.5 ${o}`,style:{fontSize:`${s}px`,fontFamily:"'Inconsolata', monospace"},children:[d.jsx("div",{className:"whitespace-pre-wrap break-all",children:h}),f&&d.jsx("button",{onClick:()=>l(!r),className:"text-neutral-6 hover:text-neutral-3 transition-colors mt-0.5",style:{fontSize:`${s}px`},children:r?"▴ collapse":`▾ ${u.length-3} more lines`})]})}function nO({run:e,fontSize:n}){const r=e.groups.some(x=>x.tools.some(y=>y.active)),[l,s]=k.useState(!1),o=r||l,u=n-1,f=e.groups.flatMap(x=>x.tools),h=[...new Set(f.map(x=>x.name))],p=f.length,g=e.outputs.filter(x=>x.isError).length;return d.jsxs("div",{className:"px-4 py-0.5",children:[d.jsxs("button",{onClick:()=>s(!o),className:"flex items-center gap-1.5 text-neutral-5 hover:text-neutral-3 transition-colors w-full text-left",style:{fontSize:`${u}px`,fontFamily:"'Inconsolata', monospace"},children:[r?d.jsx("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-primary-5 animate-pulse flex-shrink-0"}):d.jsx("span",{className:"text-neutral-6 flex-shrink-0",children:o?"▾":"▸"}),d.jsxs("span",{className:"text-neutral-5",children:[p," tool",p!==1?" calls":" call"," — ",d.jsxs("span",{className:"text-accent-6",children:[h.slice(0,4).join(", "),h.length>4?` +${h.length-4}`:""]}),g>0&&d.jsxs("span",{className:"text-error-5 ml-1",children:["(",g," error",g!==1?"s":"",")"]})]})]}),o&&d.jsxs("div",{className:"pl-3 mt-0.5 border-l border-neutral-9/50",children:[e.groups.map((x,y)=>d.jsx("div",{children:d.jsx(eO,{msg:x,fontSize:n})},`g-${y}`)),e.outputs.map((x,y)=>d.jsx(tO,{msg:x,fontSize:n},`o-${y}`))]}),e.images.map((x,y)=>d.jsx(rO,{msg:x},`img-${y}`))]})}function rO({msg:e}){const[n,r]=k.useState(!1),o=`data:${new Set(["image/png","image/jpeg","image/gif","image/webp","image/svg+xml"]).has(e.mediaType)?e.mediaType:"image/png"};base64,${e.base64}`;return d.jsx("div",{className:"pl-4 py-1",children:d.jsx("img",{src:o,alt:"Tool output",className:`rounded-lg border border-neutral-8 cursor-pointer transition-all ${n?"max-w-full":"max-w-xs max-h-48 object-contain"}`,onClick:()=>r(!n)})})}function aO({msg:e,fontSize:n}){return d.jsx("div",{className:"px-4 py-2",children:d.jsxs("div",{className:"max-w-[80%] rounded-lg border-l-2 border-warning-6 bg-warning-11/20 px-3 py-2 text-neutral-4 whitespace-pre-wrap",style:{fontSize:`${n}px`},children:[d.jsx("div",{className:"mb-1 text-[13px] text-warning-5 uppercase tracking-wider",children:"queued"}),e.text]})})}function lO({msg:e}){return d.jsxs("div",{className:"px-4 py-1.5 text-[15px] text-primary-5 flex items-center gap-2",children:[d.jsx("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-primary-5 flex-shrink-0"}),e.active?"Entered plan mode":"Exited plan mode"]})}function iO(){return d.jsx("div",{className:"flex flex-1 items-center justify-center px-6",children:d.jsxs("div",{className:"max-w-md text-center",children:[d.jsx("div",{className:"mx-auto mb-4 flex h-14 w-14 items-center justify-center rounded-2xl bg-accent-9/40",children:d.jsx(Cl,{size:28,className:"text-accent-5"})}),d.jsx("h2",{className:"mb-2 text-[18px] font-semibold text-neutral-2",children:"Orchestrator"}),d.jsx("p",{className:"mb-5 text-[15px] leading-relaxed text-neutral-4",children:"Your AI ops manager for triaging reports, spawning implementation sessions, and keeping your repositories healthy."}),d.jsxs("div",{className:"mx-auto grid max-w-sm gap-2 text-left text-[14px]",children:[d.jsxs("div",{className:"flex items-start gap-2.5 rounded-lg bg-neutral-10/60 px-3 py-2",children:[d.jsx("span",{className:"mt-0.5 h-1.5 w-1.5 flex-shrink-0 rounded-full bg-accent-6"}),d.jsx("span",{className:"text-neutral-3",children:"Ask questions about concepts, architecture, or design decisions"})]}),d.jsxs("div",{className:"flex items-start gap-2.5 rounded-lg bg-neutral-10/60 px-3 py-2",children:[d.jsx("span",{className:"mt-0.5 h-1.5 w-1.5 flex-shrink-0 rounded-full bg-accent-6"}),d.jsx("span",{className:"text-neutral-3",children:"Brainstorm ideas, draft plans, or think through tradeoffs"})]}),d.jsxs("div",{className:"flex items-start gap-2.5 rounded-lg bg-neutral-10/60 px-3 py-2",children:[d.jsx("span",{className:"mt-0.5 h-1.5 w-1.5 flex-shrink-0 rounded-full bg-accent-6"}),d.jsx("span",{className:"text-neutral-3",children:"Write or review prose — docs, emails, specs, messages"})]})]})]})})}function sO({label:e,variant:n="default"}){const[r,l]=k.useState(0),s=k.useRef(0);return k.useEffect(()=>{s.current=Date.now(),l(0);const o=setInterval(()=>{l(Math.floor((Date.now()-s.current)/1e3))},1e3);return()=>clearInterval(o)},[e]),d.jsx("div",{className:"px-4 pt-4 pb-2",children:d.jsxs("div",{className:"app-thinking-badge inline-flex items-center gap-2 rounded-lg bg-neutral-9/80 px-3.5 py-2",children:[d.jsxs("svg",{className:"h-4 w-4 animate-[spin_3s_linear_infinite]",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",style:{color:n==="orchestrator"?"var(--color-accent-7)":"var(--color-primary-7)"},children:[d.jsx("path",{d:"M9 12a3 3 0 1 0 6 0a3 3 0 1 0 -6 0"}),d.jsx("path",{d:"M12 21l0 .01"}),d.jsx("path",{d:"M3 9l0 .01"}),d.jsx("path",{d:"M21 9l0 .01"}),d.jsx("path",{d:"M8 20.1a9 9 0 0 1 -5 -7.1"}),d.jsx("path",{d:"M16 20.1a9 9 0 0 0 5 -7.1"}),d.jsx("path",{d:"M6.2 5a9 9 0 0 1 11.4 0"})]}),d.jsx("span",{className:"text-[13px] text-neutral-4 tracking-wide",children:e}),r>=10&&d.jsxs("span",{className:"text-[12px] text-neutral-5",children:[r,"s"]})]})})}function Wp({messages:e,fontSize:n,disabled:r,planningMode:l,activityLabel:s,isMobile:o,variant:u="default"}){const f=k.useRef(null),[h,p]=k.useState(!1),g=k.useRef(!0),x=k.useCallback(()=>{const v=f.current;if(!v)return;const E=v.scrollHeight-v.scrollTop-v.clientHeight<100;g.current=E,p(!E)},[]);k.useEffect(()=>{g.current&&f.current&&(f.current.scrollTop=f.current.scrollHeight)},[e]);const y=k.useCallback(()=>{f.current&&(f.current.scrollTop=f.current.scrollHeight,p(!1),g.current=!0)},[]);return d.jsxs("div",{className:"relative flex flex-1 min-h-0 w-full flex-col",children:[l&&d.jsxs("div",{className:"z-10 flex items-center gap-2 border-b border-primary-9/50 bg-primary-11/80 px-4 py-1.5 text-[15px] text-primary-5 backdrop-blur-sm flex-shrink-0",children:[d.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-primary-5 animate-pulse"}),"Plan Mode"]}),d.jsx("div",{ref:f,className:"chat-scroll flex-1 overflow-y-auto overflow-x-hidden min-h-0",onScroll:x,children:u==="orchestrator"&&e.length===0&&!s?d.jsx(iO,{}):d.jsxs("div",{className:"flex flex-col py-2",children:[(()=>{let v=0;const w=[];let E=0;for(;E<e.length;){const N=e[E],T=N.ts;if(T&&(N.type==="user"||N.type==="assistant")&&T-v>=6e4){v=T;const j=new Date(T),$=String(j.getHours()).padStart(2,"0"),B=String(j.getMinutes()).padStart(2,"0");w.push(d.jsxs("div",{className:"px-4 pt-3 pb-0.5 text-[13px] text-neutral-6",children:[$,":",B]},`ts-${N.key||E}`))}if(N.type==="tool_group"||N.type==="tool_output"||N.type==="image"){const j={groups:[],outputs:[],images:[]},$=E;for(;E<e.length&&(e[E].type==="tool_group"||e[E].type==="tool_output"||e[E].type==="image");){const _=e[E];_.type==="tool_group"&&j.groups.push(_),_.type==="tool_output"&&j.outputs.push(_),_.type==="image"&&j.images.push(_),E++}const B=j.groups[0]?.key||j.outputs[0]?.key||`ta-${$}`;w.push(d.jsx(nO,{run:j,fontSize:n},B));continue}let R;switch(N.type){case"system":if(N.subtype==="trim"){R=d.jsxs("div",{className:"px-4 py-1.5 text-[15px] text-neutral-6 flex items-center gap-2",children:[d.jsx("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-neutral-6 flex-shrink-0"}),"Older messages trimmed"]},N.key||E);break}R=d.jsx(KM,{msg:N},N.key||E);break;case"user":R=d.jsx(ZM,{msg:N,fontSize:n,isMobile:o},N.key||E);break;case"assistant":R=d.jsx(JM,{msg:N,fontSize:n,variant:u},N.key||E);break;case"planning_mode":R=d.jsx(lO,{msg:N},N.key||E);break;case"todo_list":R=null;break;case"tentative":R=d.jsx(aO,{msg:N,fontSize:n},N.key||`tentative-${N.index}`);break}w.push(R),E++}return w})(),s&&d.jsx(sO,{label:s,variant:u})]})}),h&&d.jsx("button",{onClick:y,className:"absolute bottom-3 left-1/2 -translate-x-1/2 rounded-full bg-neutral-8/90 p-2 text-neutral-3 shadow-lg transition hover:bg-neutral-7 hover:text-neutral-1",title:"Scroll to bottom",children:d.jsx(uN,{size:16,stroke:2})}),r&&d.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-neutral-12/80",children:d.jsx("p",{className:"text-[15px] text-neutral-3",children:"Configure token in Settings to use chat"})})]})}function oO(e){return!e.includes("T")&&!e.includes("Z")&&!e.includes("+")?new Date(e.replace(" ","T")+"Z"):new Date(e)}function b1(e){const n=Math.floor((Date.now()-oO(e).getTime())/1e3);if(n<60)return`${n}s`;const r=Math.floor(n/60);if(r<60)return`${r}m`;const l=Math.floor(r/60);return l<24?`${l}h`:`${Math.floor(l/24)}d`}function vh(e){const n=e.name||e.id.slice(0,8);return n.startsWith("hub:")?"unnamed session":n}function uO(e,n){const r=[];r.push(`Here is the conversation from a previous session "${n}" for context:
|
|
47
|
+
`);for(const l of e)l.type==="user"?r.push(`**User:** ${l.text}`):l.type==="assistant"&&r.push(`**Assistant:** ${l.text}`);return r.push(`
|
|
48
|
+
---
|
|
49
|
+
Please continue from where this conversation left off. What would you like to work on?`),r.join(`
|
|
50
|
+
|
|
51
|
+
`)}function cO({token:e,visible:n,fontSize:r,workingDir:l,refreshKey:s,onNewSessionFromArchive:o,initialViewId:u,onClose:f}){const[h,p]=k.useState([]),[g,x]=k.useState(null),[y,v]=k.useState(!1),[w,E]=k.useState(7),N=k.useCallback(async()=>{if(e)try{const[_,D]=await Promise.all([L0(e,l??void 0),I0(e)]);p(_),E(D)}catch(_){console.error("Failed to load archived sessions:",_)}},[e,l]);k.useEffect(()=>{n&&!u&&N()},[n,u,N,s]),k.useEffect(()=>{!n||!u||!e||(v(!0),xy(e,u).then(x).catch(_=>console.error("Failed to load archived session:",_)).finally(()=>v(!1)))},[n,u,e]);const T=k.useCallback(async _=>{v(!0);try{const D=await xy(e,_);x(D)}catch(D){console.error("Failed to load archived session:",D)}finally{v(!1)}},[e]),R=k.useCallback(async(_,D)=>{D.stopPropagation();try{await T2(e,_),p(F=>F.filter(Y=>Y.id!==_)),g?.id===_&&x(null)}catch(F){console.error("Failed to delete archived session:",F)}},[e,g]),j=k.useCallback(async _=>{try{const D=await B0(e,_);E(D)}catch(D){console.error("Failed to update retention:",D)}},[e]),$=k.useCallback(()=>{if(!g||!o)return;const _=qh(g.outputHistory),D=uO(_,vh(g));o(g.workingDir,D),x(null),f?.()},[g,o,f]),B=k.useCallback(()=>{x(null),f?.()},[f]);if(!n)return null;if(u&&y&&!g)return d.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-neutral-12",children:d.jsx(Ur,{size:24,className:"text-neutral-4 animate-spin"})});if(g){const _=qh(g.outputHistory);return d.jsxs("div",{className:"fixed inset-0 z-50 flex flex-col bg-neutral-12",children:[d.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 bg-neutral-9/70 border-b border-neutral-8/40 flex-shrink-0",children:[d.jsx(eo,{size:16,className:"text-neutral-4"}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("span",{className:"text-[15px] font-medium text-neutral-1 truncate block",children:vh(g)}),d.jsxs("span",{className:"text-[13px] text-neutral-5",children:["Archived ",b1(g.archivedAt)," ago · ",g.messageCount," messages"]})]}),o&&d.jsxs("button",{onClick:$,className:"flex items-center gap-1.5 rounded px-2.5 py-1.5 text-[13px] font-medium text-primary-4 bg-primary-10/30 hover:bg-primary-9/40 hover:text-primary-3 transition-colors",title:"Start a new session with this conversation as context",children:[d.jsx(i_,{size:16,stroke:2}),d.jsx("span",{children:"Continue in new session"})]}),d.jsx("button",{onClick:B,className:"rounded p-1 text-neutral-4 hover:text-neutral-1 hover:bg-neutral-8 transition-colors",title:"Close",children:d.jsx(ta,{size:16,stroke:2})})]}),d.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:d.jsx(Wp,{messages:_,fontSize:r,planningMode:!1,activityLabel:void 0})})]})}return u?null:d.jsxs("div",{className:"flex flex-col min-h-0 flex-1",children:[d.jsxs("div",{className:"flex items-center justify-between px-3 py-2 bg-neutral-9/70 border-b border-neutral-8/40 flex-shrink-0",children:[d.jsx("span",{className:"text-[13px] font-semibold text-neutral-1 uppercase tracking-wider",children:"Archived Sessions"}),d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx("label",{className:"text-[12px] text-neutral-5",title:"Auto-delete after this many days",children:"Keep"}),d.jsx("input",{type:"number",min:1,max:365,value:w,onChange:_=>j(Number(_.target.value)),className:"w-10 text-[13px] text-neutral-2 bg-neutral-8 border border-neutral-7 rounded px-1 py-0.5 text-center"}),d.jsx("span",{className:"text-[12px] text-neutral-5",children:"d"})]})]}),h.length===0?d.jsx("div",{className:"px-3 py-4 text-[13px] text-neutral-5 text-center",children:"No archived sessions"}):d.jsx("div",{className:"flex flex-col py-0.5 overflow-y-auto flex-1 min-h-0",children:h.map(_=>d.jsxs("button",{onClick:()=>T(_.id),className:"group flex items-center gap-2 px-3 py-1 text-left transition-colors text-neutral-3 hover:bg-neutral-8/50 hover:text-neutral-1",children:[_.source==="workflow"?d.jsx(R_,{size:12,className:"shrink-0 opacity-50"}):_.source==="joe"||_.source==="agent"?d.jsx(Cl,{size:12,className:"shrink-0 opacity-50"}):_.source==="webhook"?d.jsx(Ks,{size:12,className:"shrink-0 opacity-50"}):d.jsx(eo,{size:12,className:"shrink-0 opacity-50"}),d.jsx("span",{className:"flex-1 truncate text-[15px]",children:vh(_)}),d.jsx("span",{className:"shrink-0 text-[13px] text-neutral-5 tabular-nums",children:b1(_.archivedAt)}),y?d.jsx(Ur,{size:14,className:"shrink-0 text-neutral-5 animate-spin"}):d.jsx("span",{onClick:D=>R(_.id,D),className:"cursor-pointer text-transparent hover:text-error-5 group-hover:text-neutral-5 flex-shrink-0",children:d.jsx(kc,{size:14})})]},_.id))})]})}function fO({repo:e,globalModules:n=[],onSendModule:r,disabled:l}){const s=e?.modules??[];return n.length===0&&s.length===0?null:d.jsxs("div",{className:"mt-3 border-t border-neutral-10 pt-3",children:[d.jsx("h3",{className:"mb-2 text-[15px] font-medium uppercase tracking-wider text-neutral-5",children:"Modules"}),n.length>0&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"mb-1 px-2 text-[12px] font-medium uppercase tracking-wider text-neutral-5",children:"Global"}),d.jsx("div",{className:"flex flex-col gap-1",children:n.map(o=>d.jsxs("button",{onClick:()=>r(o),disabled:l,className:"group rounded px-2 py-1.5 text-left transition hover:bg-neutral-10/50 disabled:opacity-50 disabled:pointer-events-none",children:[d.jsx("div",{className:"text-[15px] font-medium text-primary-6 group-hover:text-primary-5",children:o.name}),o.description&&d.jsx("div",{className:"text-[13px] text-neutral-4 group-hover:text-neutral-4",children:o.description})]},o.id))})]}),s.length>0&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"mb-1 mt-2 px-2 text-[12px] font-medium uppercase tracking-wider text-neutral-5",children:e?.name}),d.jsx("div",{className:"flex flex-col gap-1",children:s.map(o=>d.jsxs("button",{onClick:()=>r(o),disabled:l,className:"group rounded px-2 py-1.5 text-left transition hover:bg-neutral-10/50 disabled:opacity-50 disabled:pointer-events-none",children:[d.jsx("div",{className:"text-[15px] font-medium text-primary-6 group-hover:text-primary-5",children:o.name}),o.description&&d.jsx("div",{className:"text-[13px] text-neutral-4 group-hover:text-neutral-4",children:o.description})]},o.id))})]})]})}const y1="codekin-left-sidebar-width",dO=224,v1=160,k1=480;function hO(e){const n=e.replace(/\/+$/,"").split("/");return n[n.length-1]||e}function pO(e,n,r){const l=new Map;for(const s of e){if(s.source==="orchestrator")continue;const o=Lr(s),u=l.get(o)??[];u.push(s),l.set(o,u)}return Array.from(l.entries()).sort((s,o)=>{const u=s[0].replace(/\/+$/,"").split("/").pop()??s[0],f=o[0].replace(/\/+$/,"").split("/").pop()??o[0];return u.localeCompare(f)}).map(([s,o])=>({workingDir:s,displayName:hO(s),sessions:o,hasWaiting:o.some(u=>n[u.id]),hasActive:o.some(u=>u.isProcessing),hasTentative:o.some(u=>(r[u.id]?.length??0)>0)}))}function mO({sessions:e,activeSessionId:n,activeWorkingDir:r,waitingSessions:l,tentativeQueues:s,groups:o,globalModules:u,activeRepo:f,token:h,theme:p,fontSize:g,connState:x,view:y,archiveRefreshKey:v,onSelectSession:w,onDeleteSession:E,onRenameSession:N,onNewSession:T,onNewSessionFromArchive:R,onOpenSession:j,onSelectRepo:$,onDeleteRepo:B,onSettingsOpen:_,onUpdateTheme:D,onSendModule:F,agentName:Y="Joe",onNavigateToWorkflows:L,onNavigateToOrchestrator:X,onBrowseDocs:Z,docsPicker:te={},mobile:J={}}){const{isMobile:G=!1,mobileOpen:z=!1,onMobileClose:V}=J,[ne,be]=k.useState(()=>localStorage.getItem("codekin-left-sidebar-collapsed")==="true"),[M,O]=k.useState(()=>{const ze=localStorage.getItem(y1);return ze?Math.max(v1,Math.min(k1,Number(ze))):dO}),[I,A]=k.useState(!1),[oe,le]=k.useState(null),he=k.useRef(null),pe=k.useRef(!1),Ae=k.useRef(0),Re=k.useRef(0);k.useEffect(()=>{localStorage.setItem("codekin-left-sidebar-collapsed",String(ne))},[ne]),k.useEffect(()=>{localStorage.setItem(y1,String(M))},[M]),k.useEffect(()=>{if(!I)return;function ze(gt){he.current&&!he.current.contains(gt.target)&&A(!1)}return document.addEventListener("mousedown",ze),()=>document.removeEventListener("mousedown",ze)},[I]);const qe=k.useCallback(ze=>{ze.preventDefault(),pe.current=!0,Ae.current=ze.clientX,Re.current=M;const gt=Sn=>{if(!pe.current)return;const Pn=Sn.clientX-Ae.current;O(Math.max(v1,Math.min(k1,Re.current+Pn)))},Wt=()=>{pe.current=!1,document.removeEventListener("mousemove",gt),document.removeEventListener("mouseup",Wt),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",gt),document.addEventListener("mouseup",Wt)},[M]),pt=pO(e,l,s),St=x==="connected"?"bg-success-7":x==="connecting"?"bg-warning-6":"bg-error-7",Ge=e.find(ze=>ze.source==="orchestrator"),Et=Ge?(s[Ge.id]?.length??0)>0?"!text-accent-5 animate-pulse":l[Ge.id]?"!text-warning-5 animate-pulse":Ge.isProcessing?"!text-success-6 animate-pulse":Ge.active?"!text-neutral-5":"":"",ve=u.length>0||f&&f.modules.length>0,Ee=k.useCallback(ze=>{w(ze),G&&V?.()},[w,G,V]);if(!G&&ne)return d.jsxs("div",{className:"app-left-sidebar flex flex-col items-center w-12 flex-shrink-0 bg-neutral-12 py-3 gap-3 border-r border-neutral-8/30",children:[d.jsx("div",{className:"app-logo-circle flex items-center justify-center rounded-full",style:{width:28,height:28},children:d.jsx(Zh,{size:26,className:"text-primary-7"})}),d.jsx("button",{onClick:()=>be(!1),className:"rounded-lg p-1.5 text-neutral-3 hover:bg-neutral-6 hover:text-neutral-1",title:"Expand sidebar",children:d.jsx(Ea,{size:14,stroke:2})}),d.jsxs("div",{className:"mt-auto flex flex-col items-center gap-2",children:[d.jsx("button",{onClick:()=>D(p==="dark"?"light":"dark"),className:"rounded-lg p-1.5 text-neutral-3 hover:bg-neutral-6 hover:text-neutral-1",title:p==="dark"?"Switch to light mode":"Switch to dark mode",children:p==="dark"?d.jsx(Ey,{size:14,stroke:2}):d.jsx(wy,{size:14,stroke:2})}),d.jsx("div",{title:x.charAt(0).toUpperCase()+x.slice(1),children:d.jsx("span",{className:`inline-block h-2 w-2 rounded-full ${St}`})})]})]});const mt=d.jsxs("div",{className:`app-left-sidebar relative flex flex-col bg-neutral-12 min-h-0 h-full ${G?"w-[280px] max-w-[85vw]":"flex-shrink-0 border-r border-neutral-8/30"}`,style:G?void 0:{width:M},children:[!G&&d.jsx("div",{className:"absolute right-0 top-0 bottom-0 w-1 cursor-col-resize hover:bg-primary-7/50 active:bg-primary-6/60 z-10",onMouseDown:qe}),d.jsxs("div",{className:"group/header flex items-center gap-2 px-3 py-2.5 border-b border-neutral-8/30 flex-shrink-0",children:[d.jsx("div",{className:"app-logo-circle flex items-center justify-center rounded-full flex-shrink-0",style:{width:26,height:26},children:d.jsx(Zh,{size:24,className:"text-primary-7"})}),d.jsx("span",{className:"flex-1 text-[17px] font-semibold text-neutral-2 truncate",children:"Codekin"}),G?d.jsx("button",{onClick:V,className:"rounded p-1 text-neutral-3 hover:text-neutral-2 hover:bg-neutral-6 transition-colors flex-shrink-0",title:"Close menu",children:d.jsx(ta,{size:18,stroke:2})}):d.jsx("button",{onClick:()=>be(!0),className:"rounded p-1 text-neutral-3 hover:text-neutral-2 hover:bg-neutral-6 transition-colors flex-shrink-0 opacity-0 group-hover/header:opacity-100",title:"Collapse sidebar",children:d.jsx(V0,{size:16,stroke:2})}),d.jsx(G_,{groups:o,token:h,onOpen:ze=>{j(ze),G&&V?.()}})]}),d.jsxs("div",{className:"flex-1 overflow-y-auto py-1 min-h-0",children:[d.jsxs("div",{className:"px-2 py-1",children:[d.jsxs("button",{onClick:()=>{L(),G&&V?.()},className:`w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-[15px] transition-colors ${y==="workflows"?"bg-accent-9/30 text-accent-2":"text-neutral-3 hover:text-neutral-1 hover:bg-neutral-6"}`,children:[d.jsx(ev,{size:16,stroke:2,className:"flex-shrink-0"}),d.jsx("span",{className:"flex-1 text-left",children:"AI Workflows"})]}),d.jsxs("button",{onClick:()=>{X(),G&&V?.()},className:`w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-[15px] transition-colors ${y==="orchestrator"?"bg-accent-9/30 text-accent-2":"text-neutral-3 hover:text-neutral-1 hover:bg-neutral-6"}`,children:[d.jsx(Cl,{size:16,stroke:2,className:`flex-shrink-0 ${Et}`}),d.jsxs("span",{className:"flex-1 text-left",children:["Agent ",Y]})]}),ve&&d.jsxs("div",{ref:he,className:"relative",children:[d.jsxs("button",{onClick:()=>A(!I),className:`w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-[15px] transition-colors ${I?"bg-accent-9/30 text-accent-2":"text-neutral-3 hover:text-neutral-1 hover:bg-neutral-6/50"}`,children:[d.jsx(bN,{size:16,stroke:2,className:"flex-shrink-0"}),d.jsx("span",{className:"flex-1",children:"Modules"})]}),I&&d.jsx("div",{className:"absolute left-full top-0 ml-1 w-64 z-50 rounded-md border border-neutral-10 bg-neutral-12 px-3 pb-3 shadow-lg",children:d.jsx(fO,{repo:f,globalModules:u,onSendModule:ze=>{F(ze),A(!1)},disabled:!n})})]})]}),d.jsx("div",{className:"mx-3 my-1 border-t border-neutral-8/40"}),pt.length>0&&d.jsx("div",{className:"px-4 pt-1.5 pb-0.5 text-[11px] font-medium uppercase tracking-wider text-neutral-6",children:"Active sessions"}),pt.map(ze=>d.jsx(tT,{node:ze,isActive:ze.workingDir===r,activeSessionId:n,waitingSessions:l,tentativeQueues:s,token:h,archiveRefreshKey:v,onSelectSession:Ee,onDeleteSession:E,onRenameSession:N,onNewSession:ze.workingDir===r?T:void 0,onSelectRepo:gt=>{$(gt),G&&V?.()},onDeleteRepo:B,onViewArchivedSession:le,onBrowseDocs:Z,docsPickerOpen:te.open,docsPickerRepoDir:te.repoDir,docsPickerFiles:te.files,docsPickerLoading:te.loading,onDocsPickerSelect:te.onSelect,onDocsPickerClose:te.onClose,docsStarredDocs:te.starredDocs,isMobile:G},ze.workingDir)),pt.length===0&&d.jsxs("div",{className:"px-4 py-6 text-center text-[13px] text-neutral-5",children:["No sessions yet.",d.jsx("br",{}),"Click + to start one."]}),d.jsx(cO,{token:h,visible:oe!==null,fontSize:g,workingDir:r,refreshKey:v,onNewSessionFromArchive:R,initialViewId:oe,onClose:()=>le(null)})]}),d.jsx("div",{className:"flex flex-col border-t border-neutral-8/30 flex-shrink-0",children:d.jsxs("div",{className:`flex items-center gap-0.5 px-2 ${G?"gap-1 py-3":"py-2"}`,children:[d.jsx("div",{className:"flex items-center justify-center px-1 py-1",title:x.charAt(0).toUpperCase()+x.slice(1),children:d.jsx("span",{className:`inline-block h-2 w-2 rounded-full ${St}`})}),d.jsx("button",{onClick:_,className:`flex items-center gap-1 rounded text-[13px] text-neutral-3 hover:text-neutral-1 hover:bg-neutral-6 transition-colors ${G?"px-2 py-2":"px-1.5 py-1"}`,title:"Settings",children:d.jsx(W0,{size:G?24:20,stroke:2})}),d.jsx("div",{className:"flex-1"}),d.jsx("button",{onClick:()=>D(p==="dark"?"light":"dark"),className:`rounded text-neutral-3 hover:bg-neutral-6 hover:text-neutral-1 transition-colors ${G?"px-2 py-2":"px-1.5 py-1"}`,title:p==="dark"?"Switch to light mode":"Switch to dark mode",children:p==="dark"?d.jsx(Ey,{size:G?24:20,stroke:2}):d.jsx(wy,{size:G?24:20,stroke:2})}),d.jsx("button",{onClick:()=>{window.location.href="/authelia/logout"},className:`rounded text-neutral-3 hover:bg-neutral-6 hover:text-neutral-1 transition-colors ${G?"px-2 py-2":"px-1.5 py-1"}`,title:"Logout",children:d.jsx(e_,{size:G?24:20,stroke:2})})]})})]});return G?d.jsx("div",{className:`fixed inset-0 z-40 transition-colors duration-200 ${z?"bg-black/50":"bg-transparent pointer-events-none"}`,onClick:V,children:d.jsx("div",{className:`h-full w-fit transition-transform duration-200 ease-out ${z?"translate-x-0":"-translate-x-full"}`,onClick:ze=>ze.stopPropagation(),children:mt})}):mt}function gO({repoName:e,sessionName:n,onMenuOpen:r,onNewSession:l,onSettingsOpen:s}){return d.jsxs("div",{className:"app-left-sidebar mobile-top-bar-safe flex items-center h-12 px-1.5 border-b border-neutral-8/30 bg-neutral-12 flex-shrink-0",children:[d.jsx("button",{onClick:r,className:"flex items-center justify-center rounded-lg size-[34px] text-neutral-3 hover:text-neutral-1 hover:bg-neutral-6 transition-colors","aria-label":"Open menu",children:d.jsx(a_,{size:24,stroke:2})}),d.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0 px-1.5",children:[d.jsx(Zh,{size:24,className:"text-primary-7 flex-shrink-0"}),d.jsx("div",{className:"flex-1 min-w-0 truncate text-[16px] text-neutral-2",children:e?d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"font-semibold",children:e}),n&&d.jsxs("span",{className:"text-neutral-5 ml-1.5",children:["/ ",n]})]}):d.jsx("span",{className:"font-semibold",children:"Codekin"})})]}),d.jsxs("div",{className:"flex items-center gap-0.5",children:[d.jsx("button",{onClick:s,className:"flex items-center justify-center rounded-lg size-[34px] text-neutral-4 hover:text-neutral-1 hover:bg-neutral-6 transition-colors","aria-label":"Settings",children:d.jsx(W0,{size:24,stroke:2})}),d.jsx("button",{onClick:l,className:"flex items-center justify-center rounded-lg size-[34px] text-neutral-4 hover:text-neutral-1 hover:bg-neutral-6 transition-colors","aria-label":"New session",children:d.jsx(to,{size:24,stroke:2})})]})]})}const Pr="/cc/api/workflows";function Fr(e){return{"Content-Type":"application/json",Authorization:`Bearer ${e}`}}async function xO(e,n){const r=new URLSearchParams;n&&r.set("repoPath",n);const l=r.toString(),s=await fetch(`${Pr}/kinds${l?`?${l}`:""}`,{headers:Fr(e)});if(!s.ok)throw new Error(`Failed to list kinds: ${s.status}`);return(await s.json()).kinds}async function bO(e,n){const r=new URLSearchParams;n?.kind&&r.set("kind",n.kind),n?.status&&r.set("status",n.status),r.set("limit",String(n.limit)),n?.offset&&r.set("offset",String(n.offset));const l=r.toString(),s=await fetch(`${Pr}/runs${l?`?${l}`:""}`,{headers:Fr(e)});if(!s.ok)throw new Error(`Failed to list runs: ${s.status}`);return(await s.json()).runs}async function w1(e,n){const r=await fetch(`${Pr}/runs/${n}`,{headers:Fr(e)});if(!r.ok)throw new Error(`Failed to get run: ${r.status}`);return(await r.json()).run}async function yO(e,n,r={}){const l=await fetch(`${Pr}/runs`,{method:"POST",headers:Fr(e),body:JSON.stringify({kind:n,input:r})});if(!l.ok)throw new Error(`Failed to trigger run: ${l.status}`);return(await l.json()).run}async function vO(e,n){const r=await fetch(`${Pr}/runs/${n}/cancel`,{method:"POST",headers:Fr(e)});if(!r.ok)throw new Error(`Failed to cancel run: ${r.status}`)}async function kO(e){const n=await fetch(`${Pr}/schedules`,{headers:Fr(e)});if(!n.ok)throw new Error(`Failed to list schedules: ${n.status}`);return(await n.json()).schedules}async function wO(e,n){const r=await fetch(`${Pr}/schedules/${n}/trigger`,{method:"POST",headers:Fr(e)});if(!r.ok)throw new Error(`Failed to trigger schedule: ${r.status}`);return(await r.json()).run}async function SO(e){const n=await fetch(`${Pr}/config`,{headers:Fr(e)});if(!n.ok)throw new Error(`Failed to get config: ${n.status}`);return(await n.json()).config}async function EO(e,n){const r=await fetch(`${Pr}/config/repos`,{method:"POST",headers:Fr(e),body:JSON.stringify(n)});if(!r.ok)throw new Error(`Failed to add repo config: ${r.status}`);return(await r.json()).config}async function NO(e,n){const r=await fetch(`${Pr}/config/repos/${n}`,{method:"DELETE",headers:Fr(e)});if(!r.ok)throw new Error(`Failed to remove repo config: ${r.status}`);return(await r.json()).config}async function S1(e,n,r){const l=await fetch(`${Pr}/config/repos/${n}`,{method:"PATCH",headers:Fr(e),body:JSON.stringify(r)});if(!l.ok)throw new Error(`Failed to update repo config: ${l.status}`);return(await l.json()).config}const _O=5e3,TO=15e3;function AO(e){const[n,r]=k.useState([]),[l,s]=k.useState([]),[o,u]=k.useState(null),[f,h]=k.useState(!0),[p,g]=k.useState(null),x=k.useRef(null),y=k.useCallback(async()=>{if(e)try{const[_,D,F]=await Promise.all([bO(e,{limit:50}),kO(e),SO(e)]);r(_),s(D),u(F),g(null)}catch(_){g(_ instanceof Error?_.message:"Failed to load workflow data")}finally{h(!1)}},[e]),w=n.some(_=>_.status==="running"||_.status==="queued")?_O:TO;k.useEffect(()=>(y(),x.current=setInterval(y,w),()=>{x.current&&clearInterval(x.current)}),[y,w]);const E=k.useCallback(async(_,D)=>{try{await yO(e,_,D),await y()}catch(F){g(F instanceof Error?F.message:"Failed to trigger run")}},[e,y]),N=k.useCallback(async _=>{try{await vO(e,_),await y()}catch(D){g(D instanceof Error?D.message:"Failed to cancel run")}},[e,y]),T=k.useCallback(async _=>{try{await wO(e,_),await y()}catch(D){g(D instanceof Error?D.message:"Failed to trigger schedule")}},[e,y]),R=k.useCallback(async _=>{await EO(e,_),await y()},[e,y]),j=k.useCallback(async _=>{await NO(e,_),await y()},[e,y]),$=k.useCallback(async(_,D)=>{await S1(e,_,D),await y()},[e,y]),B=k.useCallback(async(_,D)=>{await S1(e,_,{enabled:D}),await y()},[e,y]);return{runs:n,schedules:l,config:o,loading:f,error:p,refresh:y,triggerRun:E,cancelRun:N,triggerSchedule:T,addRepo:R,removeRepo:j,updateRepo:$,toggleScheduleEnabled:B}}const Ac=[{value:"coverage.daily",label:"Coverage Assessment",category:"assessment"},{value:"code-review.daily",label:"Code Review",category:"assessment"},{value:"commit-review",label:"Commit Review",category:"event"},{value:"comment-assessment.daily",label:"Comment Assessment",category:"assessment"},{value:"dependency-health.daily",label:"Dependency Health",category:"assessment"},{value:"security-audit.weekly",label:"Security Audit",category:"assessment"},{value:"complexity.weekly",label:"Complexity Report",category:"assessment"},{value:"repo-health.weekly",label:"Repository Health",category:"assessment"},{value:"docs-audit.weekly",label:"Documentation Audit",category:"assessment"}],CO=new Set(["commit-review"]);function Cc(e){return CO.has(e)}const Jp=[{value:"",label:"Default (Opus)"},{value:"claude-sonnet-4-6",label:"Sonnet 4.6"},{value:"claude-haiku-4-5-20251001",label:"Haiku 4.5"}],wk=[{label:"Daily",dow:"*"},{label:"Weekdays",dow:"1-5"}],dc=[{label:"Mon",dow:"1"},{label:"Tue",dow:"2"},{label:"Wed",dow:"3"},{label:"Thu",dow:"4"},{label:"Fri",dow:"5"},{label:"Sat",dow:"6"},{label:"Sun",dow:"0"}];function Js(e){return e.startsWith("biweekly")}function jO(e){const n=e.split("-");return n.length>=2?n.slice(1).join("-"):"*"}function hc(e,n,r=0){return Js(n)?`${r} ${e} */14 * ${jO(n)}`:`${r} ${e} * * ${n}`}function RO(e){const n=e.trim().split(/\s+/);if(n.length===5){const l=n[2]==="*/14"?n[4]==="*"?"biweekly":`biweekly-${n[4]}`:n[4];return{hour:parseInt(n[1])||0,minute:parseInt(n[0])||0,dow:l}}return{hour:6,minute:0,dow:"*"}}const em="event";function pc(e){if(e===em)return"On commit";const n=e.trim().split(/\s+/);if(n.length!==5)return e;const[r,l,s,,o]=n,u=g=>g.length===1?`0${g}`:g,f=`${u(l)}:${u(r)}`,h=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];return s==="*/14"?`Bi-weekly${o!=="*"?` ${h[parseInt(o)]??o}`:""} at ${f}`:o==="*"?`Daily at ${f}`:o==="1-5"?`Weekdays at ${f}`:`Weekly ${h[parseInt(o)]??o} at ${f}`}function E1(e){return e?Jp.find(n=>n.value===e)?.label??e:null}function tm(e){return Ac.find(n=>n.value===e)?.label??e}function Sk(e){return Ac.find(n=>n.value===e)?.category??"assessment"}function N1(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")}function nm(e,n){if(!e)return"—";const l=(n?new Date(n):new Date).getTime()-new Date(e).getTime();return l<1e3?"<1s":l<6e4?`${Math.round(l/1e3)}s`:`${Math.round(l/6e4)}m`}function rm(e){return e?new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"—"}function MO(e){return e.input.repoName||e.input.repoPath?.split("/").pop()||e.kind}function OO(e){switch(e){case"succeeded":return"bg-success-7 text-success-2";case"failed":return"bg-error-8 text-error-2";case"running":return"bg-accent-8 text-accent-2 animate-pulse";case"queued":return"bg-neutral-8 text-neutral-3";case"canceled":return"bg-warning-8 text-warning-2";case"skipped":return"bg-neutral-8 text-neutral-5";default:return"bg-neutral-8 text-neutral-3"}}function Ek({kind:e}){const n=Sk(e),r={assessment:"border-accent-7/60 bg-accent-9/30 text-accent-4",organizer:"border-success-7/60 bg-success-9/30 text-success-4",executor:"border-warning-7/60 bg-warning-9/30 text-warning-4",event:"border-purple-700/60 bg-purple-900/30 text-purple-400"};return d.jsx("span",{className:`inline-flex items-center rounded-full border px-2.5 py-0.5 text-[13px] font-medium capitalize ${r[n]}`,children:n})}function am({status:e}){switch(e){case"succeeded":return d.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-success-7/60 bg-success-8/40 px-2.5 py-0.5 text-[13px] font-medium text-success-4",children:[d.jsx(jl,{size:12,stroke:2.5}),"succeeded"]});case"failed":return d.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-error-7/60 bg-error-9/40 px-2.5 py-0.5 text-[13px] font-medium text-error-4",children:[d.jsx(ta,{size:12,stroke:2.5}),"failed"]});case"running":return d.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-accent-7/60 bg-accent-9/40 px-2.5 py-0.5 text-[13px] font-medium text-accent-4",children:[d.jsx(Ur,{size:12,stroke:2,className:"animate-spin"}),"running"]});case"queued":return d.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-neutral-7/60 bg-neutral-9/40 px-2.5 py-0.5 text-[13px] font-medium text-neutral-4",children:[d.jsx(MN,{size:12,stroke:2}),"queued"]});case"canceled":return d.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-warning-7/60 bg-warning-9/40 px-2.5 py-0.5 text-[13px] font-medium text-warning-4",children:[d.jsx(Z0,{size:12,stroke:2}),"canceled"]});case"skipped":return d.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-neutral-7/60 bg-neutral-9/40 px-2.5 py-0.5 text-[13px] font-medium text-neutral-5",children:[d.jsx(Q0,{size:12,stroke:2}),"skipped"]});default:return d.jsx("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-neutral-7/60 bg-neutral-9/40 px-2.5 py-0.5 text-[13px] font-medium text-neutral-4",children:e})}}const DO=Array.from({length:24},(e,n)=>n);function Nk({hour:e,minute:n,onChange:r,step:l=15,className:s=""}){const[o,u]=k.useState(!1),f=k.useRef(null),h=k.useRef(null),p=k.useRef(null),g=Array.from({length:60/l},(v,w)=>w*l),x=v=>String(v).padStart(2,"0");k.useEffect(()=>{if(!o)return;const v=w=>{f.current&&!f.current.contains(w.target)&&u(!1)};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[o]),k.useEffect(()=>{o&&requestAnimationFrame(()=>{h.current?.querySelector('[data-selected="true"]')?.scrollIntoView({block:"nearest"}),p.current?.querySelector('[data-selected="true"]')?.scrollIntoView({block:"nearest"})})},[o]);const y=k.useCallback(v=>{v.key==="Escape"&&u(!1)},[]);return d.jsxs("div",{ref:f,className:`relative inline-block ${s}`,onKeyDown:y,children:[d.jsxs("button",{type:"button",onClick:()=>u(v=>!v),className:"flex items-center gap-2 rounded-md border border-neutral-7 bg-neutral-10 px-3 py-2 text-[15px] font-mono text-neutral-1 focus:border-accent-6 focus:outline-none w-40 cursor-pointer hover:border-neutral-5 transition-colors",children:[d.jsxs("span",{className:"flex-1 text-left",children:[x(e),":",x(n)]}),d.jsxs("svg",{className:"w-4 h-4 text-neutral-3",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("circle",{cx:"12",cy:"12",r:"10"}),d.jsx("polyline",{points:"12 6 12 12 16 14"})]})]}),o&&d.jsxs("div",{className:"absolute top-full left-0 z-50 mt-1 flex rounded-md border border-neutral-7 bg-neutral-10 shadow-lg overflow-hidden",children:[d.jsx("div",{ref:h,className:"h-52 overflow-y-auto scrollbar-thin",children:DO.map(v=>d.jsx("button",{type:"button","data-selected":v===e,onClick:()=>{r(v,n)},className:`block w-full px-4 py-1.5 text-center font-mono text-[14px] transition-colors cursor-pointer
|
|
52
|
+
${v===e?"bg-accent-8 text-accent-2":"text-neutral-2 hover:bg-neutral-8"}`,children:x(v)},v))}),d.jsx("div",{className:"w-px bg-neutral-7"}),d.jsx("div",{ref:p,className:"h-52 overflow-y-auto scrollbar-thin",children:g.map(v=>d.jsx("button",{type:"button","data-selected":v===n,onClick:()=>{r(e,v)},className:`block w-full px-4 py-1.5 text-center font-mono text-[14px] transition-colors cursor-pointer
|
|
53
|
+
${v===n?"bg-accent-8 text-accent-2":"text-neutral-2 hover:bg-neutral-8"}`,children:x(v)},v))})]})]})}function zO({current:e,eventDriven:n}){const r=[{num:1,label:"Repository"},{num:2,label:"Workflow"},{num:3,label:n?"Configure":"Schedule"}];return d.jsx("div",{className:"flex items-center gap-1 mb-5",children:r.map((l,s)=>d.jsxs("div",{className:"flex items-center gap-1 flex-1",children:[d.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[d.jsx("span",{className:`w-6 h-6 rounded-full flex items-center justify-center text-[12px] font-semibold shrink-0 ${l.num<e?"bg-success-7 text-white":l.num===e?"bg-accent-7 text-white":"bg-neutral-9 text-neutral-5"}`,children:l.num<e?d.jsx(jl,{size:12,stroke:3}):l.num}),d.jsx("span",{className:`text-[13px] font-medium ${l.num===e?"text-neutral-1":"text-neutral-5"}`,children:l.label})]}),s<r.length-1&&d.jsx("div",{className:`h-px flex-1 mx-1 ${l.num<e?"bg-success-7":"bg-neutral-8"}`})]},l.num))})}function LO({token:e,selectedRepoId:n,onSelect:r}){const{groups:l,loading:s,error:o}=z0(e),u=l.flatMap(f=>f.repos);return s?d.jsxs("div",{className:"flex items-center gap-2 py-8 justify-center text-[13px] text-neutral-5",children:[d.jsx(Ur,{size:16,stroke:2,className:"animate-spin"}),"Loading repositories…"]}):o?d.jsxs("div",{className:"rounded-md bg-error-10/50 px-3 py-2 text-[13px] text-error-4",children:["Failed to load repos: ",o]}):d.jsxs("div",{children:[d.jsx("p",{className:"text-[13px] text-neutral-4 mb-3",children:"Choose which repository this workflow will run against."}),d.jsx(Rp,{groups:l,selectedId:n,onSelect:f=>{const h=u.find(p=>p.id===f.id);h&&r(h.id,h.path,h.name)},maxHeight:"320px"})]})}function IO({token:e,repoPath:n,selectedKind:r,onSelect:l}){const[s,o]=k.useState(Ac.map(p=>({kind:p.value,name:p.label,source:"builtin"}))),[u,f]=k.useState(!0);k.useEffect(()=>{let p=!1;return xO(e,n||void 0).then(g=>{p||g.length>0&&o(g)}).catch(()=>{}).finally(()=>{p||f(!1)}),()=>{p=!0}},[e,n]);const h=new Map;for(const p of s){const g=Sk(p.kind);h.has(g)||h.set(g,[]),h.get(g).push(p)}return d.jsxs("div",{children:[d.jsx("p",{className:"text-[13px] text-neutral-4 mb-3",children:"Select the type of automated workflow to run."}),u&&d.jsxs("div",{className:"flex items-center gap-2 py-2 text-[13px] text-neutral-5 mb-2",children:[d.jsx(Ur,{size:14,stroke:2,className:"animate-spin"}),"Checking for repo-specific workflows…"]}),d.jsx("div",{className:"space-y-4",children:Array.from(h.entries()).map(([p,g])=>d.jsxs("div",{children:[d.jsx("div",{className:"flex items-center gap-2 mb-2",children:d.jsx(Ek,{kind:g[0].kind})}),d.jsx("div",{className:"grid grid-cols-2 gap-2",children:g.map(x=>d.jsxs("button",{type:"button",onClick:()=>l(x.kind),className:`rounded-lg border px-3 py-2.5 text-left transition-colors ${r===x.kind?"border-accent-6 bg-accent-9/30 ring-1 ring-accent-6/30":"border-neutral-7 bg-neutral-10 hover:border-neutral-6"}`,children:[d.jsx("span",{className:`block text-[15px] font-medium ${r===x.kind?"text-accent-2":"text-neutral-2"}`,children:x.name}),x.source==="repo"&&d.jsx("span",{className:"block text-[11px] text-neutral-5 mt-0.5",children:"repo-specific"})]},x.kind))})]},p))}),!u&&d.jsxs("p",{className:"mt-4 text-[12px] text-neutral-5 leading-relaxed",children:["You can define custom workflow types by adding ",d.jsx("code",{className:"text-neutral-4",children:".md"})," files to ",d.jsxs("code",{className:"text-neutral-4",children:[n,"/.codekin/workflows/"]}),". See the guide on the Workflows page for details."]})]})}function $u({label:e,dow:n,selected:r,onSelect:l}){return d.jsx("button",{type:"button",onClick:()=>l(n),className:`rounded-md border px-3 py-1.5 text-[13px] font-medium transition-colors ${r?"border-accent-6 bg-accent-9/40 text-accent-2":"border-neutral-7 bg-neutral-10 text-neutral-3 hover:border-neutral-6 hover:text-neutral-2"}`,children:e})}function BO({form:e,onChange:n}){const r=Cc(e.kind);return d.jsxs("div",{className:"space-y-5",children:[r?d.jsxs("div",{children:[d.jsx("p",{className:"text-[13px] text-neutral-4 mb-3",children:"This workflow runs automatically on every commit via a post-commit hook."}),d.jsxs("div",{className:"rounded-lg border border-purple-700/40 bg-purple-900/20 px-4 py-3",children:[d.jsx("span",{className:"text-[14px] font-medium text-purple-400",children:"Trigger: On commit"}),d.jsx("p",{className:"text-[13px] text-neutral-4 mt-1",children:"Each commit will be reviewed automatically. No schedule needed."})]})]}):d.jsxs(d.Fragment,{children:[d.jsxs("div",{children:[d.jsx("p",{className:"text-[13px] text-neutral-4 mb-3",children:"Choose when this workflow should run automatically."}),d.jsx("label",{className:"block text-[13px] font-medium text-neutral-3 mb-2",children:"Time"}),d.jsx(Nk,{hour:e.cronHour,minute:e.cronMinute,onChange:(l,s)=>n({cronHour:l,cronMinute:s})})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-[13px] font-medium text-neutral-3 mb-2",children:"Frequency"}),d.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2",children:wk.map(l=>{const s=e.cronDow===l.dow;return d.jsx($u,{label:l.label,dow:l.dow,selected:s,onSelect:o=>n({cronDow:o})},l.dow)})}),d.jsx("div",{className:"flex gap-1.5",children:dc.map(l=>{const o=(Js(e.cronDow)?e.cronDow.split("-").slice(1).join("-"):e.cronDow)===l.dow;return d.jsx($u,{label:l.label,dow:l.dow,selected:o,onSelect:u=>{const f=Js(e.cronDow);n({cronDow:f?`biweekly-${u}`:u})}},l.dow)})}),(()=>{if(!dc.some(u=>u.dow===e.cronDow||e.cronDow===`biweekly-${u.dow}`))return null;const s=Js(e.cronDow),o=s?e.cronDow.split("-").slice(1).join("-"):e.cronDow;return d.jsxs("div",{className:"flex gap-1.5 mt-2",children:[d.jsx($u,{label:"Every week",dow:o,selected:!s,onSelect:u=>n({cronDow:u})}),d.jsx($u,{label:"Every 2 weeks",dow:`biweekly-${o}`,selected:s,onSelect:u=>n({cronDow:u})})]})})(),d.jsx("div",{className:"mt-2 text-[13px] text-neutral-5",children:pc(hc(e.cronHour,e.cronDow,e.cronMinute))})]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-[13px] font-medium text-neutral-3 mb-2",children:"Model"}),d.jsx("div",{className:"flex gap-1.5",children:Jp.map(l=>d.jsx("button",{type:"button",onClick:()=>n({model:l.value}),className:`rounded-md border px-3 py-1.5 text-[13px] font-medium transition-colors ${e.model===l.value?"border-accent-6 bg-accent-9/40 text-accent-2":"border-neutral-7 bg-neutral-10 text-neutral-3 hover:border-neutral-6 hover:text-neutral-2"}`,children:l.label},l.value))})]}),d.jsxs("div",{children:[d.jsxs("label",{className:"block text-[13px] font-medium text-neutral-3 mb-1.5",children:["Focus areas ",d.jsx("span",{className:"text-neutral-5 font-normal",children:"(optional)"})]}),d.jsx("textarea",{value:e.customPrompt,onChange:l=>n({customPrompt:l.target.value}),rows:3,placeholder:"e.g. Focus on the auth module and payment flows",className:"w-full rounded-md border border-neutral-7 bg-neutral-10 px-3 py-2 text-[15px] text-neutral-1 placeholder-neutral-5 focus:border-accent-6 focus:outline-none resize-none"})]})]})}function $O({token:e,onClose:n,onAdd:r}){const[l,s]=k.useState(1),[o,u]=k.useState(""),[f,h]=k.useState({kind:"",repoPath:"",repoName:"",cronHour:6,cronMinute:0,cronDow:"*",customPrompt:"",model:""}),[p,g]=k.useState(!1),[x,y]=k.useState(null),v=Cc(f.kind),w=j=>h($=>({...$,...j})),E=()=>l===1?!!f.repoPath:l===2?!!f.kind:!0,N=()=>{if(y(null),l===1&&!f.repoPath){y("Please select a repository");return}if(l===2&&!f.kind){y("Please select a workflow");return}l<3&&s(l+1)},T=()=>{y(null),l>1&&s(l-1)},R=async()=>{g(!0),y(null);try{const j=f.repoName||f.repoPath.split("/").pop()||"workflow",$=v?em:hc(f.cronHour,f.cronDow,f.cronMinute);await r({id:`${N1(j)}-${N1(f.kind)}`,name:j,repoPath:f.repoPath.trim(),cronExpression:$,kind:f.kind,enabled:!0,customPrompt:f.customPrompt.trim()||void 0,model:f.model||void 0}),n()}catch(j){y(j instanceof Error?j.message:"Failed to add workflow")}finally{g(!1)}};return d.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",onClick:n,children:d.jsxs("div",{className:"w-[520px] max-h-[90vh] overflow-y-auto rounded-xl border border-neutral-7 bg-neutral-11 p-6 shadow-2xl",onClick:j=>j.stopPropagation(),children:[d.jsxs("div",{className:"flex items-center justify-between mb-1",children:[d.jsx("h2",{className:"text-[19px] font-semibold text-neutral-1",children:"New Workflow"}),d.jsx("button",{onClick:n,className:"rounded p-1 text-neutral-4 hover:text-neutral-1 hover:bg-neutral-9",children:d.jsx(ta,{size:16,stroke:2})})]}),d.jsx(zO,{current:l,eventDriven:v}),d.jsxs("div",{className:"min-h-[200px]",children:[l===1&&d.jsx(LO,{token:e,selectedRepoId:o,onSelect:(j,$,B)=>{u(j),w({repoPath:$,repoName:B})}}),l===2&&d.jsx(IO,{token:e,repoPath:f.repoPath,selectedKind:f.kind,onSelect:j=>w({kind:j})}),l===3&&d.jsx(BO,{form:f,onChange:w})]}),x&&d.jsx("div",{className:"rounded-md bg-error-10/50 px-3 py-2 text-[13px] text-error-4 mt-3",children:x}),d.jsxs("div",{className:"flex gap-2 mt-5 pt-4 border-t border-neutral-8/50",children:[l>1?d.jsxs("button",{type:"button",onClick:T,className:"flex items-center gap-1.5 rounded-md border border-neutral-7 bg-neutral-10 px-4 py-2 text-[15px] text-neutral-3 hover:bg-neutral-9 hover:text-neutral-1 transition-colors",children:[d.jsx(fN,{size:14,stroke:2}),"Back"]}):d.jsx("button",{type:"button",onClick:n,className:"rounded-md border border-neutral-7 bg-neutral-10 px-4 py-2 text-[15px] text-neutral-3 hover:bg-neutral-9 hover:text-neutral-1 transition-colors",children:"Cancel"}),d.jsx("div",{className:"flex-1"}),l<3?d.jsxs("button",{type:"button",onClick:N,disabled:!E(),className:"flex items-center gap-1.5 rounded-md bg-primary-8 px-4 py-2 text-[15px] font-medium text-neutral-1 hover:bg-primary-7 disabled:opacity-40 transition-colors",children:["Next",d.jsx(Y0,{size:14,stroke:2})]}):d.jsx("button",{type:"button",onClick:R,disabled:p,className:"flex items-center gap-1.5 rounded-md bg-primary-8 px-4 py-2 text-[15px] font-medium text-neutral-1 hover:bg-primary-7 disabled:opacity-50 transition-colors",children:p?d.jsxs(d.Fragment,{children:[d.jsx(Ur,{size:14,stroke:2,className:"animate-spin"}),"Creating…"]}):d.jsxs(d.Fragment,{children:[d.jsx(jl,{size:14,stroke:2}),"Create Workflow"]})})]})]})})}const Is=e=>`rounded-md border px-3 py-1.5 text-[13px] font-medium transition-colors ${e?"border-accent-6 bg-accent-9/40 text-accent-2":"border-neutral-7 bg-neutral-10 text-neutral-3 hover:border-neutral-6 hover:text-neutral-2"}`;function UO({repo:e,onClose:n,onSave:r}){const l=RO(e.cronExpression),[s,o]=k.useState({kind:e.kind??"coverage.daily",cronHour:l.hour,cronMinute:l.minute,cronDow:l.dow,customPrompt:e.customPrompt??"",model:e.model??""}),[u,f]=k.useState(!1),[h,p]=k.useState(null),g=Cc(s.kind),x=async N=>{N.preventDefault(),f(!0),p(null);try{const T=g?em:hc(s.cronHour,s.cronDow,s.cronMinute);await r(e.id,{kind:s.kind,cronExpression:T,customPrompt:s.customPrompt.trim()||void 0,model:s.model||void 0}),n()}catch(T){p(T instanceof Error?T.message:"Failed to save workflow")}finally{f(!1)}},y=e.repoPath.split("/").pop()||e.name,v=Js(s.cronDow),w=v?s.cronDow.split("-").slice(1).join("-"):s.cronDow,E=dc.some(N=>N.dow===w);return d.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",onClick:n,children:d.jsxs("div",{className:"w-[480px] max-h-[90vh] overflow-y-auto rounded-xl border border-neutral-7 bg-neutral-11 p-6 shadow-2xl",onClick:N=>N.stopPropagation(),children:[d.jsxs("div",{className:"flex items-center justify-between mb-5",children:[d.jsxs("div",{children:[d.jsx("h2",{className:"text-[19px] font-semibold text-neutral-1",children:"Edit Workflow"}),d.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[d.jsx("span",{className:"text-[13px] text-neutral-4",children:y}),d.jsx("span",{className:"text-neutral-7",children:"·"}),d.jsx("span",{className:"text-[13px] text-neutral-4",children:tm(e.kind??"")})]})]}),d.jsx("button",{onClick:n,className:"rounded p-1 text-neutral-4 hover:text-neutral-1 hover:bg-neutral-9",children:d.jsx(ta,{size:16,stroke:2})})]}),d.jsxs("form",{onSubmit:x,className:"space-y-5",children:[d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center justify-between mb-2",children:[d.jsx("label",{className:"text-[13px] font-medium text-neutral-3",children:"Workflow type"}),d.jsx(Ek,{kind:s.kind})]}),d.jsx("div",{className:"grid grid-cols-2 gap-2",children:Ac.map(N=>d.jsx("button",{type:"button",onClick:()=>o(T=>({...T,kind:N.value})),className:`rounded-lg border px-3 py-2.5 text-left transition-colors ${s.kind===N.value?"border-accent-6 bg-accent-9/30 ring-1 ring-accent-6/30":"border-neutral-7 bg-neutral-10 hover:border-neutral-6"}`,children:d.jsx("span",{className:`block text-[15px] font-medium ${s.kind===N.value?"text-accent-2":"text-neutral-2"}`,children:N.label})},N.value))})]}),g?d.jsxs("div",{className:"rounded-lg border border-purple-700/40 bg-purple-900/20 px-4 py-3",children:[d.jsx("span",{className:"text-[14px] font-medium text-purple-400",children:"Trigger: On commit"}),d.jsx("p",{className:"text-[13px] text-neutral-4 mt-1",children:"Each commit will be reviewed automatically. No schedule needed."})]}):d.jsxs("div",{children:[d.jsx("label",{className:"block text-[13px] font-medium text-neutral-3 mb-2",children:"Time"}),d.jsx(Nk,{hour:s.cronHour,minute:s.cronMinute,onChange:(N,T)=>o(R=>({...R,cronHour:N,cronMinute:T})),className:"mb-3"}),d.jsx("label",{className:"block text-[13px] font-medium text-neutral-3 mb-2",children:"Frequency"}),d.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2",children:wk.map(N=>d.jsx("button",{type:"button",onClick:()=>o(T=>({...T,cronDow:N.dow})),className:Is(s.cronDow===N.dow),children:N.label},N.dow))}),d.jsx("div",{className:"flex gap-1.5",children:dc.map(N=>d.jsx("button",{type:"button",onClick:()=>o(T=>({...T,cronDow:v?`biweekly-${N.dow}`:N.dow})),className:Is(w===N.dow),children:N.label},N.dow))}),E&&d.jsxs("div",{className:"flex gap-1.5 mt-2",children:[d.jsx("button",{type:"button",onClick:()=>o(N=>({...N,cronDow:w})),className:Is(!v),children:"Every week"}),d.jsx("button",{type:"button",onClick:()=>o(N=>({...N,cronDow:`biweekly-${w}`})),className:Is(v),children:"Every 2 weeks"})]}),d.jsx("div",{className:"mt-2 text-[13px] text-neutral-5",children:pc(hc(s.cronHour,s.cronDow,s.cronMinute))})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-[13px] font-medium text-neutral-3 mb-2",children:"Model"}),d.jsx("div",{className:"flex gap-1.5",children:Jp.map(N=>d.jsx("button",{type:"button",onClick:()=>o(T=>({...T,model:N.value})),className:Is(s.model===N.value),children:N.label},N.value))})]}),d.jsxs("div",{children:[d.jsxs("label",{className:"block text-[13px] font-medium text-neutral-3 mb-1.5",children:["Focus areas ",d.jsx("span",{className:"text-neutral-5 font-normal",children:"(optional)"})]}),d.jsx("textarea",{value:s.customPrompt,onChange:N=>o(T=>({...T,customPrompt:N.target.value})),rows:3,placeholder:"e.g. Focus on the auth module and payment flows",className:"w-full rounded-md border border-neutral-7 bg-neutral-10 px-3 py-2 text-[15px] text-neutral-1 placeholder-neutral-5 focus:border-accent-6 focus:outline-none resize-none"})]}),h&&d.jsx("div",{className:"rounded-md bg-error-10/50 px-3 py-2 text-[13px] text-error-4",children:h}),d.jsxs("div",{className:"flex gap-2 pt-2 border-t border-neutral-8/50",children:[d.jsx("button",{type:"button",onClick:n,className:"flex-1 rounded-md border border-neutral-7 bg-neutral-10 py-2 text-[15px] text-neutral-3 hover:bg-neutral-9 hover:text-neutral-1 transition-colors",children:"Cancel"}),d.jsx("button",{type:"submit",disabled:u,className:"flex-1 rounded-md bg-primary-8 py-2 text-[15px] font-medium text-neutral-1 hover:bg-primary-7 disabled:opacity-50 transition-colors flex items-center justify-center gap-1.5",children:u?d.jsxs(d.Fragment,{children:[d.jsx(Ur,{size:14,stroke:2,className:"animate-spin"}),"Saving…"]}):"Save Changes"})]})]})]})})}function op({status:e}){if(!e)return d.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-neutral-7 shrink-0",title:"No runs yet"});const n={succeeded:"bg-success-5",failed:"bg-error-5",running:"bg-accent-5 animate-pulse",queued:"bg-neutral-5 animate-pulse",canceled:"bg-warning-5",skipped:"bg-neutral-6"};return d.jsx("span",{className:`w-2.5 h-2.5 rounded-full shrink-0 ${n[e]||"bg-neutral-7"}`,title:e})}function HO({status:e}){const n="shrink-0";switch(e){case"succeeded":return d.jsx(jl,{size:14,stroke:2.5,className:`${n} text-success-4`});case"failed":return d.jsx(ta,{size:14,stroke:2.5,className:`${n} text-error-4`});case"running":return d.jsx(Ur,{size:14,stroke:2,className:`${n} text-accent-4 animate-spin`});case"skipped":return d.jsx(Z0,{size:14,stroke:2,className:`${n} text-neutral-6`});default:return d.jsx(jN,{size:14,stroke:2,className:`${n} text-neutral-6`})}}function up({label:e,data:n,defaultOpen:r=!1}){if(!n||Object.keys(n).length===0)return null;const l=JSON.stringify(n,null,2),s=l.length>4e3?l.slice(0,4e3)+`
|
|
54
|
+
… (truncated)`:l;return d.jsxs("details",{open:r,className:"mt-1.5",children:[d.jsxs("summary",{className:"cursor-pointer select-none text-[14px] text-neutral-5 hover:text-neutral-3 list-none flex items-center gap-1",children:[d.jsx(Ea,{size:12,stroke:2,className:"details-arrow transition-transform"}),e,d.jsxs("span",{className:"text-neutral-6",children:["(",Object.keys(n).length," fields)"]})]}),d.jsx("pre",{className:"mt-1 overflow-x-auto rounded-md bg-neutral-12 p-2.5 text-[14px] text-neutral-3 font-mono leading-relaxed max-h-64 overflow-y-auto",children:s})]})}function PO({step:e}){return d.jsxs("div",{className:"rounded-md border border-neutral-8/40 bg-neutral-11/60 px-3 py-2",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(HO,{status:e.status}),d.jsx("span",{className:"font-mono text-[14px] text-neutral-2 font-medium",children:e.key}),d.jsx("span",{className:`ml-auto inline-flex items-center rounded px-1.5 py-0.5 text-[13px] font-medium ${OO(e.status)}`,children:e.status}),d.jsx("span",{className:"text-[14px] text-neutral-5 tabular-nums",children:nm(e.startedAt,e.completedAt)})]}),e.error&&d.jsx("div",{className:"mt-1.5 rounded bg-error-10/50 px-2 py-1 text-[14px] text-error-4 font-mono",children:e.error}),d.jsxs("div",{className:"mt-0.5",children:[d.jsx(up,{label:"input",data:e.input}),d.jsx(up,{label:"output",data:e.output})]})]})}function FO({run:e}){return d.jsxs("div",{className:"mt-2 space-y-1.5 border-l-2 border-neutral-8/50 pl-3",children:[d.jsx("div",{className:"text-[14px] font-medium text-neutral-5 uppercase tracking-wider mb-2",children:"Steps"}),e.steps.length===0?d.jsx("div",{className:"text-[14px] text-neutral-5 py-1",children:"No steps recorded yet."}):e.steps.map(n=>d.jsx(PO,{step:n},n.id)),e.output&&Object.keys(e.output).length>0&&d.jsx("div",{className:"pt-1",children:d.jsx(up,{label:"run output",data:e.output,defaultOpen:!0})}),e.error&&d.jsx("div",{className:"rounded-md bg-error-10/50 px-3 py-2 text-[14px] text-error-4 font-mono",children:e.error})]})}function GO({run:e,selected:n,detail:r,detailLoading:l,onToggle:s,onCancel:o,onNavigateToSession:u}){const f=e.output?.sessionId||e.input?.sessionId;return d.jsxs("div",{children:[d.jsxs("div",{onClick:s,className:`flex items-center gap-3 px-3 py-2 cursor-pointer transition-colors rounded-md ${n?"bg-neutral-10":"hover:bg-neutral-10/50"}`,children:[d.jsx("span",{className:"text-neutral-5 w-4 shrink-0",children:n?d.jsx(jr,{size:13,stroke:2}):d.jsx(Ea,{size:13,stroke:2})}),d.jsx("span",{className:"text-[14px] text-neutral-4 tabular-nums whitespace-nowrap",children:rm(e.createdAt)}),d.jsx("span",{className:"text-[14px] text-neutral-4 tabular-nums whitespace-nowrap",children:nm(e.startedAt,e.completedAt)}),d.jsx("span",{className:"ml-auto",children:d.jsx(am,{status:e.status})}),d.jsxs("div",{className:"flex items-center gap-0.5 shrink-0",onClick:h=>h.stopPropagation(),children:[e.status==="running"&&d.jsx("button",{onClick:()=>o(e.id),className:"rounded p-1 text-neutral-4 hover:text-error-4 hover:bg-neutral-9 transition-colors",title:"Cancel",children:d.jsx(g_,{size:13,stroke:2})}),f&&u&&d.jsx("button",{onClick:()=>u(f),className:"rounded p-1 text-neutral-4 hover:text-accent-3 hover:bg-neutral-9 transition-colors",title:"View session",children:d.jsx(K0,{size:13,stroke:2})})]})]}),n&&d.jsx("div",{className:"px-3 pb-2",children:l?d.jsxs("div",{className:"flex items-center gap-2 py-3 text-[14px] text-neutral-5",children:[d.jsx(Ur,{size:16,stroke:2,className:"animate-spin"}),"Loading steps…"]}):r?d.jsx(FO,{run:r}):null})]})}function qO({repo:e,schedule:n,recentRuns:r,selectedRunId:l,runDetail:s,detailLoading:o,onTrigger:u,onToggleEnabled:f,onEdit:h,onDelete:p,onToggleRun:g,onCancel:x,onNavigateToSession:y}){const[v,w]=k.useState(!1),E=Cc(e.kind??""),N=n?!n.enabled:!1,T=r[0];return d.jsxs("div",{children:[d.jsxs("div",{className:`group flex items-center gap-3 px-3 py-2 rounded-md transition-colors hover:bg-neutral-10/50 ${N&&!E?"opacity-60":""}`,children:[d.jsx(op,{status:T?.status}),d.jsx("span",{className:`text-[14px] font-medium min-w-0 truncate ${N&&!E?"text-neutral-5":"text-neutral-2"}`,children:tm(e.kind??"")}),N&&!E&&d.jsx("span",{className:"text-[12px] text-warning-5 shrink-0",children:"paused"}),d.jsx("span",{className:`text-[14px] whitespace-nowrap shrink-0 ${E?"text-purple-400":"text-neutral-5"}`,children:E?"On commit":pc(n?n.cronExpression:e.cronExpression)}),E1(e.model)&&d.jsx("span",{className:"text-[12px] text-neutral-5 bg-neutral-9 rounded px-1.5 py-0.5 shrink-0",children:E1(e.model)}),T&&d.jsxs(d.Fragment,{children:[d.jsx(am,{status:T.status}),d.jsx("span",{className:"text-[13px] text-neutral-5 tabular-nums whitespace-nowrap shrink-0",children:rm(T.createdAt)})]}),r.length>0&&d.jsx("button",{onClick:()=>w(!v),className:"flex items-center gap-0.5 shrink-0 rounded px-1 py-0.5 hover:bg-neutral-9 transition-colors",title:`${r.length} recent runs`,children:r.slice(0,5).map(R=>d.jsx(op,{status:R.status},R.id))}),d.jsxs("div",{className:"flex items-center gap-0.5 shrink-0 ml-auto opacity-0 group-hover:opacity-100 transition-opacity",children:[!E&&d.jsx("button",{onClick:()=>u(e.id),className:"rounded p-1 text-neutral-5 hover:text-accent-3 hover:bg-neutral-9 transition-colors",title:"Run now",children:d.jsx(Sy,{size:14,stroke:2})}),!E&&d.jsx("button",{onClick:()=>f(e.id,!n?.enabled),className:`rounded p-1 transition-colors ${N?"text-success-5 hover:text-success-3 hover:bg-neutral-9":"text-neutral-5 hover:text-warning-4 hover:bg-neutral-9"}`,title:N?"Resume":"Pause",children:N?d.jsx(Sy,{size:14,stroke:2}):d.jsx(Q0,{size:14,stroke:2})}),d.jsx("button",{onClick:()=>h(e),className:"rounded p-1 text-neutral-5 hover:text-neutral-2 hover:bg-neutral-9 transition-colors",title:"Edit",children:d.jsx(jp,{size:14,stroke:2})}),d.jsx("button",{onClick:()=>p(e.id),className:"rounded p-1 text-neutral-6 hover:text-error-4 hover:bg-neutral-9 transition-colors",title:"Delete",children:d.jsx(kc,{size:14,stroke:2})})]})]}),v&&r.length>0&&d.jsx("div",{className:"ml-6 border-l border-neutral-8/40 pl-2 pb-1",children:r.map(R=>d.jsx(GO,{run:R,selected:l===R.id,detail:l===R.id?s:null,detailLoading:l===R.id?o:!1,onToggle:()=>g(R.id),onCancel:x,onNavigateToSession:y},R.id))})]})}function YO({repoPath:e,workflows:n,scheduleMap:r,runsPerRepo:l,selectedRunId:s,runDetail:o,detailLoading:u,onTrigger:f,onToggleEnabled:h,onEdit:p,onDelete:g,onToggleRun:x,onCancel:y,onNavigateToSession:v}){const w=e.split("/").pop()||e;return d.jsxs("div",{className:"workflow-card rounded-lg border border-neutral-9/60 bg-neutral-10/30 overflow-hidden",children:[d.jsxs("div",{className:"flex items-baseline gap-2 px-4 py-2.5 border-b border-neutral-9/40 bg-neutral-10/20",children:[d.jsx("span",{className:"text-[15px] font-semibold text-neutral-2",children:w}),d.jsx("span",{className:"text-[13px] text-neutral-6",children:n.length})]}),d.jsx("div",{className:"py-1 px-1",children:n.map(E=>d.jsx(qO,{repo:E,schedule:r.get(E.id),recentRuns:l.get(E.id)??[],selectedRunId:s,runDetail:o,detailLoading:u,onTrigger:f,onToggleEnabled:h,onEdit:p,onDelete:g,onToggleRun:x,onCancel:y,onNavigateToSession:v},E.id))})]})}function VO({run:e,onNavigateToSession:n}){const r=e.output?.sessionId||e.input?.sessionId;return d.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 hover:bg-neutral-10/30 transition-colors rounded-md",children:[d.jsx(op,{status:e.status}),d.jsx("span",{className:"text-[15px] font-medium text-neutral-2 min-w-0 truncate max-w-[140px]",children:MO(e)}),d.jsx("span",{className:"text-[14px] text-neutral-4",children:tm(e.kind)}),d.jsx("span",{className:"text-[14px] text-neutral-5 tabular-nums ml-auto whitespace-nowrap",children:rm(e.createdAt)}),d.jsx("span",{className:"text-[14px] text-neutral-5 tabular-nums whitespace-nowrap",children:nm(e.startedAt,e.completedAt)}),d.jsx(am,{status:e.status}),r&&n&&d.jsx("button",{onClick:()=>n(r),className:"rounded p-1 text-neutral-5 hover:text-accent-3 hover:bg-neutral-9 transition-colors shrink-0",title:"View session",children:d.jsx(K0,{size:13,stroke:2})})]})}function XO(){const[e,n]=k.useState(!1);return d.jsxs("div",{className:"workflow-card mt-6 rounded-lg border border-neutral-9/60 bg-neutral-10/30",children:[d.jsxs("button",{onClick:()=>n(!e),className:"w-full flex items-center gap-2 px-4 py-3 text-left text-[15px] font-medium text-neutral-3 hover:text-neutral-1 transition-colors",children:[e?d.jsx(jr,{size:14,stroke:2,className:"text-neutral-5"}):d.jsx(Ea,{size:14,stroke:2,className:"text-neutral-5"}),"Defining Custom Workflows",d.jsx("span",{className:"text-[13px] text-neutral-5 font-normal ml-1",children:"via workflow.md files"})]}),e&&d.jsxs("div",{className:"px-4 pb-4 text-[14px] text-neutral-4 space-y-3 border-t border-neutral-9/40 pt-3",children:[d.jsxs("p",{children:["You can define custom workflow types per-repo by adding ",d.jsx("code",{className:"text-accent-3 bg-neutral-10 px-1 rounded",children:".md"})," files to:"]}),d.jsx("pre",{className:"rounded-md bg-neutral-12 px-3 py-2 text-[14px] text-neutral-3 font-mono overflow-x-auto",children:"<repo>/.codekin/workflows/<kind>.md"}),d.jsx("p",{children:"Each file uses YAML frontmatter + a prompt body:"}),d.jsx("pre",{className:"rounded-md bg-neutral-12 px-3 py-2 text-[14px] text-neutral-3 font-mono overflow-x-auto leading-relaxed",children:`---
|
|
55
|
+
kind: api-docs.weekly
|
|
56
|
+
name: API Documentation Check
|
|
57
|
+
sessionPrefix: api-docs
|
|
58
|
+
outputDir: .codekin/reports/api-docs
|
|
59
|
+
filenameSuffix: _api-docs.md
|
|
60
|
+
commitMessage: chore: api docs check
|
|
61
|
+
---
|
|
62
|
+
You are reviewing the API documentation for this project.
|
|
63
|
+
|
|
64
|
+
1. Find all REST endpoints and verify they have docs
|
|
65
|
+
2. Check for outdated examples or missing parameters
|
|
66
|
+
3. Produce a Markdown report
|
|
67
|
+
|
|
68
|
+
Important: Do NOT modify any source files.`}),d.jsxs("div",{className:"space-y-1.5 text-[14px]",children:[d.jsx("p",{className:"font-medium text-neutral-3",children:"Frontmatter fields:"}),d.jsxs("ul",{className:"list-disc list-inside space-y-0.5 text-neutral-4 ml-1",children:[d.jsxs("li",{children:[d.jsx("code",{className:"text-neutral-3",children:"kind"})," — unique ID, e.g. ",d.jsx("code",{className:"text-neutral-3",children:"code-review.daily"})]}),d.jsxs("li",{children:[d.jsx("code",{className:"text-neutral-3",children:"name"})," — display name shown in the UI"]}),d.jsxs("li",{children:[d.jsx("code",{className:"text-neutral-3",children:"sessionPrefix"})," — prefix for the session name"]}),d.jsxs("li",{children:[d.jsx("code",{className:"text-neutral-3",children:"outputDir"})," — where reports are saved in the repo"]}),d.jsxs("li",{children:[d.jsx("code",{className:"text-neutral-3",children:"filenameSuffix"})," — appended to the date for the report filename"]}),d.jsxs("li",{children:[d.jsx("code",{className:"text-neutral-3",children:"commitMessage"})," — git commit message prefix"]})]})]}),d.jsxs("p",{className:"text-neutral-5",children:["Custom workflows appear automatically when adding a new workflow for that repo. To override a built-in workflow","'","s prompt, use the same ",d.jsx("code",{className:"text-neutral-3",children:"kind"})," value."]})]})]})}function KO({token:e,onNavigateToSession:n}){const{runs:r,schedules:l,config:s,error:o,cancelRun:u,triggerSchedule:f,addRepo:h,removeRepo:p,updateRepo:g,toggleScheduleEnabled:x}=AO(e),[y,v]=k.useState(null),[w,E]=k.useState(null),[N,T]=k.useState(!1),[R,j]=k.useState(null),[$,B]=k.useState(!1),_=y!==null&&(w===null||w.id!==y),D=new Map;if(s)for(const z of s.reviewRepos)D.set(z.id,z);const F=new Map;for(const z of l)F.set(z.id,z);const Y=new Map;for(const z of r){const V=z.input.repoPath;if(!V)continue;const ne=s?.reviewRepos.find(be=>be.repoPath===V&&be.kind===z.kind);if(ne){const be=ne.id;Y.has(be)||Y.set(be,[]),Y.get(be).push(z)}}const L=new Set;for(const z of Y.values())for(const V of z)L.add(V.id);k.useEffect(()=>{if(!y)return;let z=!1;return w1(e,y).then(V=>{z||E(V)}).catch(()=>{z||E(null)}),()=>{z=!0}},[y,e]),k.useEffect(()=>{!y||!w||(w.status==="running"||w.status==="queued")&&w1(e,y).then(E).catch(()=>{})},[r]);const X=k.useCallback(z=>{v(V=>V===z?null:z)},[]),Z=k.useCallback(async z=>{try{await p(z)}catch{}},[p]),te=k.useCallback(async(z,V)=>{try{await x(z,V)}catch{}},[x]),J=s?.reviewRepos??[],G=new Map;for(const z of J)G.has(z.repoPath)||G.set(z.repoPath,[]),G.get(z.repoPath).push(z);return d.jsxs("div",{className:"flex h-full flex-col overflow-hidden",children:[d.jsxs("div",{className:"flex items-center justify-between border-b border-neutral-8/50 px-5 py-3",children:[d.jsx("h1",{className:"text-[18px] font-medium text-neutral-1",children:"Workflows"}),d.jsx("div",{className:"flex items-center gap-1.5",children:d.jsxs("button",{onClick:()=>T(!0),className:"flex items-center gap-1.5 rounded-md bg-primary-8 px-3 py-1.5 text-[15px] font-medium text-neutral-1 hover:bg-primary-7 transition-colors",children:[d.jsx(to,{size:14,stroke:2}),"New Workflow"]})})]}),d.jsxs("div",{className:"flex-1 overflow-y-auto p-5",children:[o&&d.jsx("div",{className:"rounded-lg border border-error-8/50 bg-error-10/30 px-4 py-2 text-[16px] text-error-4 mb-4",children:o}),J.length===0?d.jsxs("div",{className:"rounded-xl border border-dashed border-neutral-8 px-6 py-10 text-center",children:[d.jsxs("div",{className:"text-neutral-5 mb-1",children:[d.jsx(wN,{size:32,stroke:1.5,className:"mx-auto mb-3 text-neutral-6"}),d.jsx("div",{className:"text-[16px] text-neutral-3 font-medium mb-1",children:"No workflows configured"}),d.jsx("div",{className:"text-[14px] text-neutral-5",children:"Set up automated code reviews, security audits, and more."})]}),d.jsxs("button",{onClick:()=>T(!0),className:"mt-4 inline-flex items-center gap-1.5 rounded-md bg-primary-8 px-4 py-2 text-[15px] font-medium text-neutral-1 hover:bg-primary-7 transition-colors",children:[d.jsx(to,{size:14,stroke:2}),"Create your first workflow"]})]}):d.jsx("div",{className:"space-y-3",children:Array.from(G.entries()).map(([z,V])=>d.jsx(YO,{repoPath:z,workflows:V,scheduleMap:F,runsPerRepo:Y,selectedRunId:y,runDetail:w,detailLoading:_,onTrigger:f,onToggleEnabled:te,onEdit:j,onDelete:Z,onToggleRun:X,onCancel:u,onNavigateToSession:n},z))}),r.length>0&&d.jsxs("div",{className:"mt-6",children:[d.jsxs("button",{onClick:()=>B(!$),className:"flex items-center gap-2 text-[15px] font-medium text-neutral-3 hover:text-neutral-1 transition-colors mb-2",children:[$?d.jsx(jr,{size:14,stroke:2}):d.jsx(Y0,{size:14,stroke:2}),"Recent Activity",d.jsxs("span",{className:"text-[13px] text-neutral-5 font-normal",children:["(",r.length," runs)"]})]}),$&&d.jsx("div",{className:"workflow-card rounded-lg border border-neutral-9/60 bg-neutral-10/30 py-1 divide-y divide-neutral-9/30",children:r.slice(0,20).map(z=>d.jsx(VO,{run:z,onNavigateToSession:n},z.id))})]}),d.jsx(XO,{})]}),N&&d.jsx($O,{token:e,onClose:()=>T(!1),onAdd:h}),R&&d.jsx(UO,{repo:R,schedules:l.filter(z=>z.id===R.id),recentRuns:r.filter(z=>z.input.repoPath===R.repoPath||z.input.repoName===R.name),onClose:()=>j(null),onSave:g})]})}var _1=1,ZO=.9,QO=.8,WO=.17,kh=.1,wh=.999,JO=.9999,e5=.99,t5=/[\\\/_+.#"@\[\(\{&]/,n5=/[\\\/_+.#"@\[\(\{&]/g,r5=/[\s-]/,_k=/[\s-]/g;function cp(e,n,r,l,s,o,u){if(o===n.length)return s===e.length?_1:e5;var f=`${s},${o}`;if(u[f]!==void 0)return u[f];for(var h=l.charAt(o),p=r.indexOf(h,s),g=0,x,y,v,w;p>=0;)x=cp(e,n,r,l,p+1,o+1,u),x>g&&(p===s?x*=_1:t5.test(e.charAt(p-1))?(x*=QO,v=e.slice(s,p-1).match(n5),v&&s>0&&(x*=Math.pow(wh,v.length))):r5.test(e.charAt(p-1))?(x*=ZO,w=e.slice(s,p-1).match(_k),w&&s>0&&(x*=Math.pow(wh,w.length))):(x*=WO,s>0&&(x*=Math.pow(wh,p-s))),e.charAt(p)!==n.charAt(o)&&(x*=JO)),(x<kh&&r.charAt(p-1)===l.charAt(o+1)||l.charAt(o+1)===l.charAt(o)&&r.charAt(p-1)!==l.charAt(o))&&(y=cp(e,n,r,l,p+1,o+2,u),y*kh>x&&(x=y*kh)),x>g&&(g=x),p=r.indexOf(h,p+1);return u[f]=g,g}function T1(e){return e.toLowerCase().replace(_k," ")}function a5(e,n,r){return e=r&&r.length>0?`${e+" "+r.join(" ")}`:e,cp(e,n,T1(e),T1(n),0,0,{})}function rl(e,n,{checkForDefaultPrevented:r=!0}={}){return function(s){if(e?.(s),r===!1||!s.defaultPrevented)return n?.(s)}}function A1(e,n){if(typeof e=="function")return e(n);e!=null&&(e.current=n)}function ll(...e){return n=>{let r=!1;const l=e.map(s=>{const o=A1(s,n);return!r&&typeof o=="function"&&(r=!0),o});if(r)return()=>{for(let s=0;s<l.length;s++){const o=l[s];typeof o=="function"?o():A1(e[s],null)}}}}function Ll(...e){return k.useCallback(ll(...e),e)}function l5(e,n){const r=k.createContext(n),l=o=>{const{children:u,...f}=o,h=k.useMemo(()=>f,Object.values(f));return d.jsx(r.Provider,{value:h,children:u})};l.displayName=e+"Provider";function s(o){const u=k.useContext(r);if(u)return u;if(n!==void 0)return n;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[l,s]}function i5(e,n=[]){let r=[];function l(o,u){const f=k.createContext(u),h=r.length;r=[...r,u];const p=x=>{const{scope:y,children:v,...w}=x,E=y?.[e]?.[h]||f,N=k.useMemo(()=>w,Object.values(w));return d.jsx(E.Provider,{value:N,children:v})};p.displayName=o+"Provider";function g(x,y){const v=y?.[e]?.[h]||f,w=k.useContext(v);if(w)return w;if(u!==void 0)return u;throw new Error(`\`${x}\` must be used within \`${o}\``)}return[p,g]}const s=()=>{const o=r.map(u=>k.createContext(u));return function(f){const h=f?.[e]||o;return k.useMemo(()=>({[`__scope${e}`]:{...f,[e]:h}}),[f,h])}};return s.scopeName=e,[l,s5(s,...n)]}function s5(...e){const n=e[0];if(e.length===1)return n;const r=()=>{const l=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const u=l.reduce((f,{useScope:h,scopeName:p})=>{const x=h(o)[`__scope${p}`];return{...f,...x}},{});return k.useMemo(()=>({[`__scope${n.scopeName}`]:u}),[u])}};return r.scopeName=n.scopeName,r}var ao=globalThis?.document?k.useLayoutEffect:()=>{},o5=Cp[" useId ".trim().toString()]||(()=>{}),u5=0;function Sa(e){const[n,r]=k.useState(o5());return ao(()=>{r(l=>l??String(u5++))},[e]),n?`radix-${n}`:""}var c5=Cp[" useInsertionEffect ".trim().toString()]||ao;function f5({prop:e,defaultProp:n,onChange:r=()=>{},caller:l}){const[s,o,u]=d5({defaultProp:n,onChange:r}),f=e!==void 0,h=f?e:s;{const g=k.useRef(e!==void 0);k.useEffect(()=>{const x=g.current;x!==f&&console.warn(`${l} is changing from ${x?"controlled":"uncontrolled"} to ${f?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),g.current=f},[f,l])}const p=k.useCallback(g=>{if(f){const x=h5(g)?g(e):g;x!==e&&u.current?.(x)}else o(g)},[f,e,o,u]);return[h,p]}function d5({defaultProp:e,onChange:n}){const[r,l]=k.useState(e),s=k.useRef(r),o=k.useRef(n);return c5(()=>{o.current=n},[n]),k.useEffect(()=>{s.current!==r&&(o.current?.(r),s.current=r)},[r,s]),[r,l,o]}function h5(e){return typeof e=="function"}var Tk=D0();const p5=fo(Tk);function go(e){const n=m5(e),r=k.forwardRef((l,s)=>{const{children:o,...u}=l,f=k.Children.toArray(o),h=f.find(x5);if(h){const p=h.props.children,g=f.map(x=>x===h?k.Children.count(p)>1?k.Children.only(null):k.isValidElement(p)?p.props.children:null:x);return d.jsx(n,{...u,ref:s,children:k.isValidElement(p)?k.cloneElement(p,void 0,g):null})}return d.jsx(n,{...u,ref:s,children:o})});return r.displayName=`${e}.Slot`,r}function m5(e){const n=k.forwardRef((r,l)=>{const{children:s,...o}=r;if(k.isValidElement(s)){const u=y5(s),f=b5(o,s.props);return s.type!==k.Fragment&&(f.ref=l?ll(l,u):u),k.cloneElement(s,f)}return k.Children.count(s)>1?k.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var g5=Symbol("radix.slottable");function x5(e){return k.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===g5}function b5(e,n){const r={...n};for(const l in n){const s=e[l],o=n[l];/^on[A-Z]/.test(l)?s&&o?r[l]=(...f)=>{const h=o(...f);return s(...f),h}:s&&(r[l]=s):l==="style"?r[l]={...s,...o}:l==="className"&&(r[l]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}function y5(e){let n=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=n&&"isReactWarning"in n&&n.isReactWarning;return r?e.ref:(n=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=n&&"isReactWarning"in n&&n.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var v5=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ak=v5.reduce((e,n)=>{const r=go(`Primitive.${n}`),l=k.forwardRef((s,o)=>{const{asChild:u,...f}=s,h=u?r:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(h,{...f,ref:o})});return l.displayName=`Primitive.${n}`,{...e,[n]:l}},{});function k5(e,n){e&&Tk.flushSync(()=>e.dispatchEvent(n))}function lo(e){const n=k.useRef(e);return k.useEffect(()=>{n.current=e}),k.useMemo(()=>(...r)=>n.current?.(...r),[])}function w5(e,n=globalThis?.document){const r=lo(e);k.useEffect(()=>{const l=s=>{s.key==="Escape"&&r(s)};return n.addEventListener("keydown",l,{capture:!0}),()=>n.removeEventListener("keydown",l,{capture:!0})},[r,n])}var S5="DismissableLayer",fp="dismissableLayer.update",E5="dismissableLayer.pointerDownOutside",N5="dismissableLayer.focusOutside",C1,Ck=k.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),jk=k.forwardRef((e,n)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:l,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:u,onDismiss:f,...h}=e,p=k.useContext(Ck),[g,x]=k.useState(null),y=g?.ownerDocument??globalThis?.document,[,v]=k.useState({}),w=Ll(n,D=>x(D)),E=Array.from(p.layers),[N]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),T=E.indexOf(N),R=g?E.indexOf(g):-1,j=p.layersWithOutsidePointerEventsDisabled.size>0,$=R>=T,B=A5(D=>{const F=D.target,Y=[...p.branches].some(L=>L.contains(F));!$||Y||(s?.(D),u?.(D),D.defaultPrevented||f?.())},y),_=C5(D=>{const F=D.target;[...p.branches].some(L=>L.contains(F))||(o?.(D),u?.(D),D.defaultPrevented||f?.())},y);return w5(D=>{R===p.layers.size-1&&(l?.(D),!D.defaultPrevented&&f&&(D.preventDefault(),f()))},y),k.useEffect(()=>{if(g)return r&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(C1=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(g)),p.layers.add(g),j1(),()=>{r&&p.layersWithOutsidePointerEventsDisabled.size===1&&(y.body.style.pointerEvents=C1)}},[g,y,r,p]),k.useEffect(()=>()=>{g&&(p.layers.delete(g),p.layersWithOutsidePointerEventsDisabled.delete(g),j1())},[g,p]),k.useEffect(()=>{const D=()=>v({});return document.addEventListener(fp,D),()=>document.removeEventListener(fp,D)},[]),d.jsx(Ak.div,{...h,ref:w,style:{pointerEvents:j?$?"auto":"none":void 0,...e.style},onFocusCapture:rl(e.onFocusCapture,_.onFocusCapture),onBlurCapture:rl(e.onBlurCapture,_.onBlurCapture),onPointerDownCapture:rl(e.onPointerDownCapture,B.onPointerDownCapture)})});jk.displayName=S5;var _5="DismissableLayerBranch",T5=k.forwardRef((e,n)=>{const r=k.useContext(Ck),l=k.useRef(null),s=Ll(n,l);return k.useEffect(()=>{const o=l.current;if(o)return r.branches.add(o),()=>{r.branches.delete(o)}},[r.branches]),d.jsx(Ak.div,{...e,ref:s})});T5.displayName=_5;function A5(e,n=globalThis?.document){const r=lo(e),l=k.useRef(!1),s=k.useRef(()=>{});return k.useEffect(()=>{const o=f=>{if(f.target&&!l.current){let h=function(){Rk(E5,r,p,{discrete:!0})};const p={originalEvent:f};f.pointerType==="touch"?(n.removeEventListener("click",s.current),s.current=h,n.addEventListener("click",s.current,{once:!0})):h()}else n.removeEventListener("click",s.current);l.current=!1},u=window.setTimeout(()=>{n.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(u),n.removeEventListener("pointerdown",o),n.removeEventListener("click",s.current)}},[n,r]),{onPointerDownCapture:()=>l.current=!0}}function C5(e,n=globalThis?.document){const r=lo(e),l=k.useRef(!1);return k.useEffect(()=>{const s=o=>{o.target&&!l.current&&Rk(N5,r,{originalEvent:o},{discrete:!1})};return n.addEventListener("focusin",s),()=>n.removeEventListener("focusin",s)},[n,r]),{onFocusCapture:()=>l.current=!0,onBlurCapture:()=>l.current=!1}}function j1(){const e=new CustomEvent(fp);document.dispatchEvent(e)}function Rk(e,n,r,{discrete:l}){const s=r.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});n&&s.addEventListener(e,n,{once:!0}),l?k5(s,o):s.dispatchEvent(o)}var j5=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],R5=j5.reduce((e,n)=>{const r=go(`Primitive.${n}`),l=k.forwardRef((s,o)=>{const{asChild:u,...f}=s,h=u?r:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(h,{...f,ref:o})});return l.displayName=`Primitive.${n}`,{...e,[n]:l}},{}),Sh="focusScope.autoFocusOnMount",Eh="focusScope.autoFocusOnUnmount",R1={bubbles:!1,cancelable:!0},M5="FocusScope",Mk=k.forwardRef((e,n)=>{const{loop:r=!1,trapped:l=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...u}=e,[f,h]=k.useState(null),p=lo(s),g=lo(o),x=k.useRef(null),y=Ll(n,E=>h(E)),v=k.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;k.useEffect(()=>{if(l){let E=function(j){if(v.paused||!f)return;const $=j.target;f.contains($)?x.current=$:tl(x.current,{select:!0})},N=function(j){if(v.paused||!f)return;const $=j.relatedTarget;$!==null&&(f.contains($)||tl(x.current,{select:!0}))},T=function(j){if(document.activeElement===document.body)for(const B of j)B.removedNodes.length>0&&tl(f)};document.addEventListener("focusin",E),document.addEventListener("focusout",N);const R=new MutationObserver(T);return f&&R.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",E),document.removeEventListener("focusout",N),R.disconnect()}}},[l,f,v.paused]),k.useEffect(()=>{if(f){O1.add(v);const E=document.activeElement;if(!f.contains(E)){const T=new CustomEvent(Sh,R1);f.addEventListener(Sh,p),f.dispatchEvent(T),T.defaultPrevented||(O5(B5(Ok(f)),{select:!0}),document.activeElement===E&&tl(f))}return()=>{f.removeEventListener(Sh,p),setTimeout(()=>{const T=new CustomEvent(Eh,R1);f.addEventListener(Eh,g),f.dispatchEvent(T),T.defaultPrevented||tl(E??document.body,{select:!0}),f.removeEventListener(Eh,g),O1.remove(v)},0)}}},[f,p,g,v]);const w=k.useCallback(E=>{if(!r&&!l||v.paused)return;const N=E.key==="Tab"&&!E.altKey&&!E.ctrlKey&&!E.metaKey,T=document.activeElement;if(N&&T){const R=E.currentTarget,[j,$]=D5(R);j&&$?!E.shiftKey&&T===$?(E.preventDefault(),r&&tl(j,{select:!0})):E.shiftKey&&T===j&&(E.preventDefault(),r&&tl($,{select:!0})):T===R&&E.preventDefault()}},[r,l,v.paused]);return d.jsx(R5.div,{tabIndex:-1,...u,ref:y,onKeyDown:w})});Mk.displayName=M5;function O5(e,{select:n=!1}={}){const r=document.activeElement;for(const l of e)if(tl(l,{select:n}),document.activeElement!==r)return}function D5(e){const n=Ok(e),r=M1(n,e),l=M1(n.reverse(),e);return[r,l]}function Ok(e){const n=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:l=>{const s=l.tagName==="INPUT"&&l.type==="hidden";return l.disabled||l.hidden||s?NodeFilter.FILTER_SKIP:l.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)n.push(r.currentNode);return n}function M1(e,n){for(const r of e)if(!z5(r,{upTo:n}))return r}function z5(e,{upTo:n}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(n!==void 0&&e===n)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function L5(e){return e instanceof HTMLInputElement&&"select"in e}function tl(e,{select:n=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&L5(e)&&n&&e.select()}}var O1=I5();function I5(){let e=[];return{add(n){const r=e[0];n!==r&&r?.pause(),e=D1(e,n),e.unshift(n)},remove(n){e=D1(e,n),e[0]?.resume()}}}function D1(e,n){const r=[...e],l=r.indexOf(n);return l!==-1&&r.splice(l,1),r}function B5(e){return e.filter(n=>n.tagName!=="A")}var $5=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],U5=$5.reduce((e,n)=>{const r=go(`Primitive.${n}`),l=k.forwardRef((s,o)=>{const{asChild:u,...f}=s,h=u?r:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(h,{...f,ref:o})});return l.displayName=`Primitive.${n}`,{...e,[n]:l}},{}),H5="Portal",Dk=k.forwardRef((e,n)=>{const{container:r,...l}=e,[s,o]=k.useState(!1);ao(()=>o(!0),[]);const u=r||s&&globalThis?.document?.body;return u?p5.createPortal(d.jsx(U5.div,{...l,ref:n}),u):null});Dk.displayName=H5;function P5(e,n){return k.useReducer((r,l)=>n[r][l]??r,e)}var jc=e=>{const{present:n,children:r}=e,l=F5(n),s=typeof r=="function"?r({present:l.isPresent}):k.Children.only(r),o=Ll(l.ref,G5(s));return typeof r=="function"||l.isPresent?k.cloneElement(s,{ref:o}):null};jc.displayName="Presence";function F5(e){const[n,r]=k.useState(),l=k.useRef(null),s=k.useRef(e),o=k.useRef("none"),u=e?"mounted":"unmounted",[f,h]=P5(u,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return k.useEffect(()=>{const p=Uu(l.current);o.current=f==="mounted"?p:"none"},[f]),ao(()=>{const p=l.current,g=s.current;if(g!==e){const y=o.current,v=Uu(p);e?h("MOUNT"):v==="none"||p?.display==="none"?h("UNMOUNT"):h(g&&y!==v?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,h]),ao(()=>{if(n){let p;const g=n.ownerDocument.defaultView??window,x=v=>{const E=Uu(l.current).includes(CSS.escape(v.animationName));if(v.target===n&&E&&(h("ANIMATION_END"),!s.current)){const N=n.style.animationFillMode;n.style.animationFillMode="forwards",p=g.setTimeout(()=>{n.style.animationFillMode==="forwards"&&(n.style.animationFillMode=N)})}},y=v=>{v.target===n&&(o.current=Uu(l.current))};return n.addEventListener("animationstart",y),n.addEventListener("animationcancel",x),n.addEventListener("animationend",x),()=>{g.clearTimeout(p),n.removeEventListener("animationstart",y),n.removeEventListener("animationcancel",x),n.removeEventListener("animationend",x)}}else h("ANIMATION_END")},[n,h]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:k.useCallback(p=>{l.current=p?getComputedStyle(p):null,r(p)},[])}}function Uu(e){return e?.animationName||"none"}function G5(e){let n=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=n&&"isReactWarning"in n&&n.isReactWarning;return r?e.ref:(n=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=n&&"isReactWarning"in n&&n.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var q5=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],xo=q5.reduce((e,n)=>{const r=go(`Primitive.${n}`),l=k.forwardRef((s,o)=>{const{asChild:u,...f}=s,h=u?r:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(h,{...f,ref:o})});return l.displayName=`Primitive.${n}`,{...e,[n]:l}},{}),Nh=0;function Y5(){k.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??z1()),document.body.insertAdjacentElement("beforeend",e[1]??z1()),Nh++,()=>{Nh===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(n=>n.remove()),Nh--}},[])}function z1(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Jr=function(){return Jr=Object.assign||function(n){for(var r,l=1,s=arguments.length;l<s;l++){r=arguments[l];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[o]=r[o])}return n},Jr.apply(this,arguments)};function zk(e,n){var r={};for(var l in e)Object.prototype.hasOwnProperty.call(e,l)&&n.indexOf(l)<0&&(r[l]=e[l]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,l=Object.getOwnPropertySymbols(e);s<l.length;s++)n.indexOf(l[s])<0&&Object.prototype.propertyIsEnumerable.call(e,l[s])&&(r[l[s]]=e[l[s]]);return r}function V5(e,n,r){if(r||arguments.length===2)for(var l=0,s=n.length,o;l<s;l++)(o||!(l in n))&&(o||(o=Array.prototype.slice.call(n,0,l)),o[l]=n[l]);return e.concat(o||Array.prototype.slice.call(n))}var ec="right-scroll-bar-position",tc="width-before-scroll-bar",X5="with-scroll-bars-hidden",K5="--removed-body-scroll-bar-size";function _h(e,n){return typeof e=="function"?e(n):e&&(e.current=n),e}function Z5(e,n){var r=k.useState(function(){return{value:e,callback:n,facade:{get current(){return r.value},set current(l){var s=r.value;s!==l&&(r.value=l,r.callback(l,s))}}}})[0];return r.callback=n,r.facade}var Q5=typeof window<"u"?k.useLayoutEffect:k.useEffect,L1=new WeakMap;function W5(e,n){var r=Z5(null,function(l){return e.forEach(function(s){return _h(s,l)})});return Q5(function(){var l=L1.get(r);if(l){var s=new Set(l),o=new Set(e),u=r.current;s.forEach(function(f){o.has(f)||_h(f,null)}),o.forEach(function(f){s.has(f)||_h(f,u)})}L1.set(r,e)},[e]),r}function J5(e){return e}function eD(e,n){n===void 0&&(n=J5);var r=[],l=!1,s={read:function(){if(l)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(o){var u=n(o,l);return r.push(u),function(){r=r.filter(function(f){return f!==u})}},assignSyncMedium:function(o){for(l=!0;r.length;){var u=r;r=[],u.forEach(o)}r={push:function(f){return o(f)},filter:function(){return r}}},assignMedium:function(o){l=!0;var u=[];if(r.length){var f=r;r=[],f.forEach(o),u=r}var h=function(){var g=u;u=[],g.forEach(o)},p=function(){return Promise.resolve().then(h)};p(),r={push:function(g){u.push(g),p()},filter:function(g){return u=u.filter(g),r}}}};return s}function tD(e){e===void 0&&(e={});var n=eD(null);return n.options=Jr({async:!0,ssr:!1},e),n}var Lk=function(e){var n=e.sideCar,r=zk(e,["sideCar"]);if(!n)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var l=n.read();if(!l)throw new Error("Sidecar medium not found");return k.createElement(l,Jr({},r))};Lk.isSideCarExport=!0;function nD(e,n){return e.useMedium(n),Lk}var Ik=tD(),Th=function(){},Rc=k.forwardRef(function(e,n){var r=k.useRef(null),l=k.useState({onScrollCapture:Th,onWheelCapture:Th,onTouchMoveCapture:Th}),s=l[0],o=l[1],u=e.forwardProps,f=e.children,h=e.className,p=e.removeScrollBar,g=e.enabled,x=e.shards,y=e.sideCar,v=e.noRelative,w=e.noIsolation,E=e.inert,N=e.allowPinchZoom,T=e.as,R=T===void 0?"div":T,j=e.gapMode,$=zk(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),B=y,_=W5([r,n]),D=Jr(Jr({},$),s);return k.createElement(k.Fragment,null,g&&k.createElement(B,{sideCar:Ik,removeScrollBar:p,shards:x,noRelative:v,noIsolation:w,inert:E,setCallbacks:o,allowPinchZoom:!!N,lockRef:r,gapMode:j}),u?k.cloneElement(k.Children.only(f),Jr(Jr({},D),{ref:_})):k.createElement(R,Jr({},D,{className:h,ref:_}),f))});Rc.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Rc.classNames={fullWidth:tc,zeroRight:ec};var rD=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function aD(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var n=rD();return n&&e.setAttribute("nonce",n),e}function lD(e,n){e.styleSheet?e.styleSheet.cssText=n:e.appendChild(document.createTextNode(n))}function iD(e){var n=document.head||document.getElementsByTagName("head")[0];n.appendChild(e)}var sD=function(){var e=0,n=null;return{add:function(r){e==0&&(n=aD())&&(lD(n,r),iD(n)),e++},remove:function(){e--,!e&&n&&(n.parentNode&&n.parentNode.removeChild(n),n=null)}}},oD=function(){var e=sD();return function(n,r){k.useEffect(function(){return e.add(n),function(){e.remove()}},[n&&r])}},Bk=function(){var e=oD(),n=function(r){var l=r.styles,s=r.dynamic;return e(l,s),null};return n},uD={left:0,top:0,right:0,gap:0},Ah=function(e){return parseInt(e||"",10)||0},cD=function(e){var n=window.getComputedStyle(document.body),r=n[e==="padding"?"paddingLeft":"marginLeft"],l=n[e==="padding"?"paddingTop":"marginTop"],s=n[e==="padding"?"paddingRight":"marginRight"];return[Ah(r),Ah(l),Ah(s)]},fD=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return uD;var n=cD(e),r=document.documentElement.clientWidth,l=window.innerWidth;return{left:n[0],top:n[1],right:n[2],gap:Math.max(0,l-r+n[2]-n[0])}},dD=Bk(),Mi="data-scroll-locked",hD=function(e,n,r,l){var s=e.left,o=e.top,u=e.right,f=e.gap;return r===void 0&&(r="margin"),`
|
|
69
|
+
.`.concat(X5,` {
|
|
70
|
+
overflow: hidden `).concat(l,`;
|
|
71
|
+
padding-right: `).concat(f,"px ").concat(l,`;
|
|
72
|
+
}
|
|
73
|
+
body[`).concat(Mi,`] {
|
|
74
|
+
overflow: hidden `).concat(l,`;
|
|
75
|
+
overscroll-behavior: contain;
|
|
76
|
+
`).concat([n&&"position: relative ".concat(l,";"),r==="margin"&&`
|
|
77
|
+
padding-left: `.concat(s,`px;
|
|
78
|
+
padding-top: `).concat(o,`px;
|
|
79
|
+
padding-right: `).concat(u,`px;
|
|
80
|
+
margin-left:0;
|
|
81
|
+
margin-top:0;
|
|
82
|
+
margin-right: `).concat(f,"px ").concat(l,`;
|
|
83
|
+
`),r==="padding"&&"padding-right: ".concat(f,"px ").concat(l,";")].filter(Boolean).join(""),`
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.`).concat(ec,` {
|
|
87
|
+
right: `).concat(f,"px ").concat(l,`;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.`).concat(tc,` {
|
|
91
|
+
margin-right: `).concat(f,"px ").concat(l,`;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.`).concat(ec," .").concat(ec,` {
|
|
95
|
+
right: 0 `).concat(l,`;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.`).concat(tc," .").concat(tc,` {
|
|
99
|
+
margin-right: 0 `).concat(l,`;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
body[`).concat(Mi,`] {
|
|
103
|
+
`).concat(K5,": ").concat(f,`px;
|
|
104
|
+
}
|
|
105
|
+
`)},I1=function(){var e=parseInt(document.body.getAttribute(Mi)||"0",10);return isFinite(e)?e:0},pD=function(){k.useEffect(function(){return document.body.setAttribute(Mi,(I1()+1).toString()),function(){var e=I1()-1;e<=0?document.body.removeAttribute(Mi):document.body.setAttribute(Mi,e.toString())}},[])},mD=function(e){var n=e.noRelative,r=e.noImportant,l=e.gapMode,s=l===void 0?"margin":l;pD();var o=k.useMemo(function(){return fD(s)},[s]);return k.createElement(dD,{styles:hD(o,!n,s,r?"":"!important")})},dp=!1;if(typeof window<"u")try{var Hu=Object.defineProperty({},"passive",{get:function(){return dp=!0,!0}});window.addEventListener("test",Hu,Hu),window.removeEventListener("test",Hu,Hu)}catch{dp=!1}var ki=dp?{passive:!1}:!1,gD=function(e){return e.tagName==="TEXTAREA"},$k=function(e,n){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[n]!=="hidden"&&!(r.overflowY===r.overflowX&&!gD(e)&&r[n]==="visible")},xD=function(e){return $k(e,"overflowY")},bD=function(e){return $k(e,"overflowX")},B1=function(e,n){var r=n.ownerDocument,l=n;do{typeof ShadowRoot<"u"&&l instanceof ShadowRoot&&(l=l.host);var s=Uk(e,l);if(s){var o=Hk(e,l),u=o[1],f=o[2];if(u>f)return!0}l=l.parentNode}while(l&&l!==r.body);return!1},yD=function(e){var n=e.scrollTop,r=e.scrollHeight,l=e.clientHeight;return[n,r,l]},vD=function(e){var n=e.scrollLeft,r=e.scrollWidth,l=e.clientWidth;return[n,r,l]},Uk=function(e,n){return e==="v"?xD(n):bD(n)},Hk=function(e,n){return e==="v"?yD(n):vD(n)},kD=function(e,n){return e==="h"&&n==="rtl"?-1:1},wD=function(e,n,r,l,s){var o=kD(e,window.getComputedStyle(n).direction),u=o*l,f=r.target,h=n.contains(f),p=!1,g=u>0,x=0,y=0;do{if(!f)break;var v=Hk(e,f),w=v[0],E=v[1],N=v[2],T=E-N-o*w;(w||T)&&Uk(e,f)&&(x+=T,y+=w);var R=f.parentNode;f=R&&R.nodeType===Node.DOCUMENT_FRAGMENT_NODE?R.host:R}while(!h&&f!==document.body||h&&(n.contains(f)||n===f));return(g&&Math.abs(x)<1||!g&&Math.abs(y)<1)&&(p=!0),p},Pu=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},$1=function(e){return[e.deltaX,e.deltaY]},U1=function(e){return e&&"current"in e?e.current:e},SD=function(e,n){return e[0]===n[0]&&e[1]===n[1]},ED=function(e){return`
|
|
106
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
107
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
108
|
+
`)},ND=0,wi=[];function _D(e){var n=k.useRef([]),r=k.useRef([0,0]),l=k.useRef(),s=k.useState(ND++)[0],o=k.useState(Bk)[0],u=k.useRef(e);k.useEffect(function(){u.current=e},[e]),k.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var E=V5([e.lockRef.current],(e.shards||[]).map(U1),!0).filter(Boolean);return E.forEach(function(N){return N.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),E.forEach(function(N){return N.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var f=k.useCallback(function(E,N){if("touches"in E&&E.touches.length===2||E.type==="wheel"&&E.ctrlKey)return!u.current.allowPinchZoom;var T=Pu(E),R=r.current,j="deltaX"in E?E.deltaX:R[0]-T[0],$="deltaY"in E?E.deltaY:R[1]-T[1],B,_=E.target,D=Math.abs(j)>Math.abs($)?"h":"v";if("touches"in E&&D==="h"&&_.type==="range")return!1;var F=window.getSelection(),Y=F&&F.anchorNode,L=Y?Y===_||Y.contains(_):!1;if(L)return!1;var X=B1(D,_);if(!X)return!0;if(X?B=D:(B=D==="v"?"h":"v",X=B1(D,_)),!X)return!1;if(!l.current&&"changedTouches"in E&&(j||$)&&(l.current=B),!B)return!0;var Z=l.current||B;return wD(Z,N,E,Z==="h"?j:$)},[]),h=k.useCallback(function(E){var N=E;if(!(!wi.length||wi[wi.length-1]!==o)){var T="deltaY"in N?$1(N):Pu(N),R=n.current.filter(function(B){return B.name===N.type&&(B.target===N.target||N.target===B.shadowParent)&&SD(B.delta,T)})[0];if(R&&R.should){N.cancelable&&N.preventDefault();return}if(!R){var j=(u.current.shards||[]).map(U1).filter(Boolean).filter(function(B){return B.contains(N.target)}),$=j.length>0?f(N,j[0]):!u.current.noIsolation;$&&N.cancelable&&N.preventDefault()}}},[]),p=k.useCallback(function(E,N,T,R){var j={name:E,delta:N,target:T,should:R,shadowParent:TD(T)};n.current.push(j),setTimeout(function(){n.current=n.current.filter(function($){return $!==j})},1)},[]),g=k.useCallback(function(E){r.current=Pu(E),l.current=void 0},[]),x=k.useCallback(function(E){p(E.type,$1(E),E.target,f(E,e.lockRef.current))},[]),y=k.useCallback(function(E){p(E.type,Pu(E),E.target,f(E,e.lockRef.current))},[]);k.useEffect(function(){return wi.push(o),e.setCallbacks({onScrollCapture:x,onWheelCapture:x,onTouchMoveCapture:y}),document.addEventListener("wheel",h,ki),document.addEventListener("touchmove",h,ki),document.addEventListener("touchstart",g,ki),function(){wi=wi.filter(function(E){return E!==o}),document.removeEventListener("wheel",h,ki),document.removeEventListener("touchmove",h,ki),document.removeEventListener("touchstart",g,ki)}},[]);var v=e.removeScrollBar,w=e.inert;return k.createElement(k.Fragment,null,w?k.createElement(o,{styles:ED(s)}):null,v?k.createElement(mD,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function TD(e){for(var n=null;e!==null;)e instanceof ShadowRoot&&(n=e.host,e=e.host),e=e.parentNode;return n}const AD=nD(Ik,_D);var Pk=k.forwardRef(function(e,n){return k.createElement(Rc,Jr({},e,{ref:n,sideCar:AD}))});Pk.classNames=Rc.classNames;var CD=function(e){if(typeof document>"u")return null;var n=Array.isArray(e)?e[0]:e;return n.ownerDocument.body},Si=new WeakMap,Fu=new WeakMap,Gu={},Ch=0,Fk=function(e){return e&&(e.host||Fk(e.parentNode))},jD=function(e,n){return n.map(function(r){if(e.contains(r))return r;var l=Fk(r);return l&&e.contains(l)?l:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},RD=function(e,n,r,l){var s=jD(n,Array.isArray(e)?e:[e]);Gu[r]||(Gu[r]=new WeakMap);var o=Gu[r],u=[],f=new Set,h=new Set(s),p=function(x){!x||f.has(x)||(f.add(x),p(x.parentNode))};s.forEach(p);var g=function(x){!x||h.has(x)||Array.prototype.forEach.call(x.children,function(y){if(f.has(y))g(y);else try{var v=y.getAttribute(l),w=v!==null&&v!=="false",E=(Si.get(y)||0)+1,N=(o.get(y)||0)+1;Si.set(y,E),o.set(y,N),u.push(y),E===1&&w&&Fu.set(y,!0),N===1&&y.setAttribute(r,"true"),w||y.setAttribute(l,"true")}catch(T){console.error("aria-hidden: cannot operate on ",y,T)}})};return g(n),f.clear(),Ch++,function(){u.forEach(function(x){var y=Si.get(x)-1,v=o.get(x)-1;Si.set(x,y),o.set(x,v),y||(Fu.has(x)||x.removeAttribute(l),Fu.delete(x)),v||x.removeAttribute(r)}),Ch--,Ch||(Si=new WeakMap,Si=new WeakMap,Fu=new WeakMap,Gu={})}},MD=function(e,n,r){r===void 0&&(r="data-aria-hidden");var l=Array.from(Array.isArray(e)?e:[e]),s=CD(e);return s?(l.push.apply(l,Array.from(s.querySelectorAll("[aria-live], script"))),RD(l,s,r,"aria-hidden")):function(){return null}},Mc="Dialog",[Gk]=i5(Mc),[OD,Gr]=Gk(Mc),qk=e=>{const{__scopeDialog:n,children:r,open:l,defaultOpen:s,onOpenChange:o,modal:u=!0}=e,f=k.useRef(null),h=k.useRef(null),[p,g]=f5({prop:l,defaultProp:s??!1,onChange:o,caller:Mc});return d.jsx(OD,{scope:n,triggerRef:f,contentRef:h,contentId:Sa(),titleId:Sa(),descriptionId:Sa(),open:p,onOpenChange:g,onOpenToggle:k.useCallback(()=>g(x=>!x),[g]),modal:u,children:r})};qk.displayName=Mc;var Yk="DialogTrigger",DD=k.forwardRef((e,n)=>{const{__scopeDialog:r,...l}=e,s=Gr(Yk,r),o=Ll(n,s.triggerRef);return d.jsx(xo.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":sm(s.open),...l,ref:o,onClick:rl(e.onClick,s.onOpenToggle)})});DD.displayName=Yk;var lm="DialogPortal",[zD,Vk]=Gk(lm,{forceMount:void 0}),Xk=e=>{const{__scopeDialog:n,forceMount:r,children:l,container:s}=e,o=Gr(lm,n);return d.jsx(zD,{scope:n,forceMount:r,children:k.Children.map(l,u=>d.jsx(jc,{present:r||o.open,children:d.jsx(Dk,{asChild:!0,container:s,children:u})}))})};Xk.displayName=lm;var mc="DialogOverlay",Kk=k.forwardRef((e,n)=>{const r=Vk(mc,e.__scopeDialog),{forceMount:l=r.forceMount,...s}=e,o=Gr(mc,e.__scopeDialog);return o.modal?d.jsx(jc,{present:l||o.open,children:d.jsx(ID,{...s,ref:n})}):null});Kk.displayName=mc;var LD=go("DialogOverlay.RemoveScroll"),ID=k.forwardRef((e,n)=>{const{__scopeDialog:r,...l}=e,s=Gr(mc,r);return d.jsx(Pk,{as:LD,allowPinchZoom:!0,shards:[s.contentRef],children:d.jsx(xo.div,{"data-state":sm(s.open),...l,ref:n,style:{pointerEvents:"auto",...l.style}})})}),Ml="DialogContent",Zk=k.forwardRef((e,n)=>{const r=Vk(Ml,e.__scopeDialog),{forceMount:l=r.forceMount,...s}=e,o=Gr(Ml,e.__scopeDialog);return d.jsx(jc,{present:l||o.open,children:o.modal?d.jsx(BD,{...s,ref:n}):d.jsx($D,{...s,ref:n})})});Zk.displayName=Ml;var BD=k.forwardRef((e,n)=>{const r=Gr(Ml,e.__scopeDialog),l=k.useRef(null),s=Ll(n,r.contentRef,l);return k.useEffect(()=>{const o=l.current;if(o)return MD(o)},[]),d.jsx(Qk,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:rl(e.onCloseAutoFocus,o=>{o.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:rl(e.onPointerDownOutside,o=>{const u=o.detail.originalEvent,f=u.button===0&&u.ctrlKey===!0;(u.button===2||f)&&o.preventDefault()}),onFocusOutside:rl(e.onFocusOutside,o=>o.preventDefault())})}),$D=k.forwardRef((e,n)=>{const r=Gr(Ml,e.__scopeDialog),l=k.useRef(!1),s=k.useRef(!1);return d.jsx(Qk,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{e.onCloseAutoFocus?.(o),o.defaultPrevented||(l.current||r.triggerRef.current?.focus(),o.preventDefault()),l.current=!1,s.current=!1},onInteractOutside:o=>{e.onInteractOutside?.(o),o.defaultPrevented||(l.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const u=o.target;r.triggerRef.current?.contains(u)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),Qk=k.forwardRef((e,n)=>{const{__scopeDialog:r,trapFocus:l,onOpenAutoFocus:s,onCloseAutoFocus:o,...u}=e,f=Gr(Ml,r),h=k.useRef(null),p=Ll(n,h);return Y5(),d.jsxs(d.Fragment,{children:[d.jsx(Mk,{asChild:!0,loop:!0,trapped:l,onMountAutoFocus:s,onUnmountAutoFocus:o,children:d.jsx(jk,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionId,"aria-labelledby":f.titleId,"data-state":sm(f.open),...u,ref:p,onDismiss:()=>f.onOpenChange(!1)})}),d.jsxs(d.Fragment,{children:[d.jsx(FD,{titleId:f.titleId}),d.jsx(qD,{contentRef:h,descriptionId:f.descriptionId})]})]})}),im="DialogTitle",UD=k.forwardRef((e,n)=>{const{__scopeDialog:r,...l}=e,s=Gr(im,r);return d.jsx(xo.h2,{id:s.titleId,...l,ref:n})});UD.displayName=im;var Wk="DialogDescription",HD=k.forwardRef((e,n)=>{const{__scopeDialog:r,...l}=e,s=Gr(Wk,r);return d.jsx(xo.p,{id:s.descriptionId,...l,ref:n})});HD.displayName=Wk;var Jk="DialogClose",PD=k.forwardRef((e,n)=>{const{__scopeDialog:r,...l}=e,s=Gr(Jk,r);return d.jsx(xo.button,{type:"button",...l,ref:n,onClick:rl(e.onClick,()=>s.onOpenChange(!1))})});PD.displayName=Jk;function sm(e){return e?"open":"closed"}var ew="DialogTitleWarning",[R9,tw]=l5(ew,{contentName:Ml,titleName:im,docsSlug:"dialog"}),FD=({titleId:e})=>{const n=tw(ew),r=`\`${n.contentName}\` requires a \`${n.titleName}\` for the component to be accessible for screen reader users.
|
|
109
|
+
|
|
110
|
+
If you want to hide the \`${n.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
111
|
+
|
|
112
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${n.docsSlug}`;return k.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},GD="DialogDescriptionWarning",qD=({contentRef:e,descriptionId:n})=>{const l=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${tw(GD).contentName}}.`;return k.useEffect(()=>{const s=e.current?.getAttribute("aria-describedby");n&&s&&(document.getElementById(n)||console.warn(l))},[l,e,n]),null},YD=qk,VD=Xk,XD=Kk,KD=Zk,ZD=Symbol.for("react.lazy"),gc=Cp[" use ".trim().toString()];function QD(e){return typeof e=="object"&&e!==null&&"then"in e}function nw(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===ZD&&"_payload"in e&&QD(e._payload)}function WD(e){const n=JD(e),r=k.forwardRef((l,s)=>{let{children:o,...u}=l;nw(o)&&typeof gc=="function"&&(o=gc(o._payload));const f=k.Children.toArray(o),h=f.find(t4);if(h){const p=h.props.children,g=f.map(x=>x===h?k.Children.count(p)>1?k.Children.only(null):k.isValidElement(p)?p.props.children:null:x);return d.jsx(n,{...u,ref:s,children:k.isValidElement(p)?k.cloneElement(p,void 0,g):null})}return d.jsx(n,{...u,ref:s,children:o})});return r.displayName=`${e}.Slot`,r}function JD(e){const n=k.forwardRef((r,l)=>{let{children:s,...o}=r;if(nw(s)&&typeof gc=="function"&&(s=gc(s._payload)),k.isValidElement(s)){const u=r4(s),f=n4(o,s.props);return s.type!==k.Fragment&&(f.ref=l?ll(l,u):u),k.cloneElement(s,f)}return k.Children.count(s)>1?k.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var e4=Symbol("radix.slottable");function t4(e){return k.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===e4}function n4(e,n){const r={...n};for(const l in n){const s=e[l],o=n[l];/^on[A-Z]/.test(l)?s&&o?r[l]=(...f)=>{const h=o(...f);return s(...f),h}:s&&(r[l]=s):l==="style"?r[l]={...s,...o}:l==="className"&&(r[l]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}function r4(e){let n=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=n&&"isReactWarning"in n&&n.isReactWarning;return r?e.ref:(n=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=n&&"isReactWarning"in n&&n.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var a4=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ol=a4.reduce((e,n)=>{const r=WD(`Primitive.${n}`),l=k.forwardRef((s,o)=>{const{asChild:u,...f}=s,h=u?r:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(h,{...f,ref:o})});return l.displayName=`Primitive.${n}`,{...e,[n]:l}},{}),Bs='[cmdk-group=""]',jh='[cmdk-group-items=""]',l4='[cmdk-group-heading=""]',rw='[cmdk-item=""]',H1=`${rw}:not([aria-disabled="true"])`,hp="cmdk-item-select",Ni="data-value",i4=(e,n,r)=>a5(e,n,r),aw=k.createContext(void 0),bo=()=>k.useContext(aw),lw=k.createContext(void 0),om=()=>k.useContext(lw),iw=k.createContext(void 0),sw=k.forwardRef((e,n)=>{let r=_i(()=>{var I,A;return{search:"",value:(A=(I=e.value)!=null?I:e.defaultValue)!=null?A:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),l=_i(()=>new Set),s=_i(()=>new Map),o=_i(()=>new Map),u=_i(()=>new Set),f=ow(e),{label:h,children:p,value:g,onValueChange:x,filter:y,shouldFilter:v,loop:w,disablePointerSelection:E=!1,vimBindings:N=!0,...T}=e,R=Sa(),j=Sa(),$=Sa(),B=k.useRef(null),_=x4();Ol(()=>{if(g!==void 0){let I=g.trim();r.current.value=I,D.emit()}},[g]),Ol(()=>{_(6,te)},[]);let D=k.useMemo(()=>({subscribe:I=>(u.current.add(I),()=>u.current.delete(I)),snapshot:()=>r.current,setState:(I,A,oe)=>{var le,he,pe,Ae;if(!Object.is(r.current[I],A)){if(r.current[I]=A,I==="search")Z(),L(),_(1,X);else if(I==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let Re=document.getElementById($);Re?Re.focus():(le=document.getElementById(R))==null||le.focus()}if(_(7,()=>{var Re;r.current.selectedItemId=(Re=J())==null?void 0:Re.id,D.emit()}),oe||_(5,te),((he=f.current)==null?void 0:he.value)!==void 0){let Re=A??"";(Ae=(pe=f.current).onValueChange)==null||Ae.call(pe,Re);return}}D.emit()}},emit:()=>{u.current.forEach(I=>I())}}),[]),F=k.useMemo(()=>({value:(I,A,oe)=>{var le;A!==((le=o.current.get(I))==null?void 0:le.value)&&(o.current.set(I,{value:A,keywords:oe}),r.current.filtered.items.set(I,Y(A,oe)),_(2,()=>{L(),D.emit()}))},item:(I,A)=>(l.current.add(I),A&&(s.current.has(A)?s.current.get(A).add(I):s.current.set(A,new Set([I]))),_(3,()=>{Z(),L(),r.current.value||X(),D.emit()}),()=>{o.current.delete(I),l.current.delete(I),r.current.filtered.items.delete(I);let oe=J();_(4,()=>{Z(),oe?.getAttribute("id")===I&&X(),D.emit()})}),group:I=>(s.current.has(I)||s.current.set(I,new Set),()=>{o.current.delete(I),s.current.delete(I)}),filter:()=>f.current.shouldFilter,label:h||e["aria-label"],getDisablePointerSelection:()=>f.current.disablePointerSelection,listId:R,inputId:$,labelId:j,listInnerRef:B}),[]);function Y(I,A){var oe,le;let he=(le=(oe=f.current)==null?void 0:oe.filter)!=null?le:i4;return I?he(I,r.current.search,A):0}function L(){if(!r.current.search||f.current.shouldFilter===!1)return;let I=r.current.filtered.items,A=[];r.current.filtered.groups.forEach(le=>{let he=s.current.get(le),pe=0;he.forEach(Ae=>{let Re=I.get(Ae);pe=Math.max(Re,pe)}),A.push([le,pe])});let oe=B.current;G().sort((le,he)=>{var pe,Ae;let Re=le.getAttribute("id"),qe=he.getAttribute("id");return((pe=I.get(qe))!=null?pe:0)-((Ae=I.get(Re))!=null?Ae:0)}).forEach(le=>{let he=le.closest(jh);he?he.appendChild(le.parentElement===he?le:le.closest(`${jh} > *`)):oe.appendChild(le.parentElement===oe?le:le.closest(`${jh} > *`))}),A.sort((le,he)=>he[1]-le[1]).forEach(le=>{var he;let pe=(he=B.current)==null?void 0:he.querySelector(`${Bs}[${Ni}="${encodeURIComponent(le[0])}"]`);pe?.parentElement.appendChild(pe)})}function X(){let I=G().find(oe=>oe.getAttribute("aria-disabled")!=="true"),A=I?.getAttribute(Ni);D.setState("value",A||void 0)}function Z(){var I,A,oe,le;if(!r.current.search||f.current.shouldFilter===!1){r.current.filtered.count=l.current.size;return}r.current.filtered.groups=new Set;let he=0;for(let pe of l.current){let Ae=(A=(I=o.current.get(pe))==null?void 0:I.value)!=null?A:"",Re=(le=(oe=o.current.get(pe))==null?void 0:oe.keywords)!=null?le:[],qe=Y(Ae,Re);r.current.filtered.items.set(pe,qe),qe>0&&he++}for(let[pe,Ae]of s.current)for(let Re of Ae)if(r.current.filtered.items.get(Re)>0){r.current.filtered.groups.add(pe);break}r.current.filtered.count=he}function te(){var I,A,oe;let le=J();le&&(((I=le.parentElement)==null?void 0:I.firstChild)===le&&((oe=(A=le.closest(Bs))==null?void 0:A.querySelector(l4))==null||oe.scrollIntoView({block:"nearest"})),le.scrollIntoView({block:"nearest"}))}function J(){var I;return(I=B.current)==null?void 0:I.querySelector(`${rw}[aria-selected="true"]`)}function G(){var I;return Array.from(((I=B.current)==null?void 0:I.querySelectorAll(H1))||[])}function z(I){let A=G()[I];A&&D.setState("value",A.getAttribute(Ni))}function V(I){var A;let oe=J(),le=G(),he=le.findIndex(Ae=>Ae===oe),pe=le[he+I];(A=f.current)!=null&&A.loop&&(pe=he+I<0?le[le.length-1]:he+I===le.length?le[0]:le[he+I]),pe&&D.setState("value",pe.getAttribute(Ni))}function ne(I){let A=J(),oe=A?.closest(Bs),le;for(;oe&&!le;)oe=I>0?m4(oe,Bs):g4(oe,Bs),le=oe?.querySelector(H1);le?D.setState("value",le.getAttribute(Ni)):V(I)}let be=()=>z(G().length-1),M=I=>{I.preventDefault(),I.metaKey?be():I.altKey?ne(1):V(1)},O=I=>{I.preventDefault(),I.metaKey?z(0):I.altKey?ne(-1):V(-1)};return k.createElement(ol.div,{ref:n,tabIndex:-1,...T,"cmdk-root":"",onKeyDown:I=>{var A;(A=T.onKeyDown)==null||A.call(T,I);let oe=I.nativeEvent.isComposing||I.keyCode===229;if(!(I.defaultPrevented||oe))switch(I.key){case"n":case"j":{N&&I.ctrlKey&&M(I);break}case"ArrowDown":{M(I);break}case"p":case"k":{N&&I.ctrlKey&&O(I);break}case"ArrowUp":{O(I);break}case"Home":{I.preventDefault(),z(0);break}case"End":{I.preventDefault(),be();break}case"Enter":{I.preventDefault();let le=J();if(le){let he=new Event(hp);le.dispatchEvent(he)}}}}},k.createElement("label",{"cmdk-label":"",htmlFor:F.inputId,id:F.labelId,style:y4},h),Oc(e,I=>k.createElement(lw.Provider,{value:D},k.createElement(aw.Provider,{value:F},I))))}),s4=k.forwardRef((e,n)=>{var r,l;let s=Sa(),o=k.useRef(null),u=k.useContext(iw),f=bo(),h=ow(e),p=(l=(r=h.current)==null?void 0:r.forceMount)!=null?l:u?.forceMount;Ol(()=>{if(!p)return f.item(s,u?.id)},[p]);let g=uw(s,o,[e.value,e.children,o],e.keywords),x=om(),y=il(_=>_.value&&_.value===g.current),v=il(_=>p||f.filter()===!1?!0:_.search?_.filtered.items.get(s)>0:!0);k.useEffect(()=>{let _=o.current;if(!(!_||e.disabled))return _.addEventListener(hp,w),()=>_.removeEventListener(hp,w)},[v,e.onSelect,e.disabled]);function w(){var _,D;E(),(D=(_=h.current).onSelect)==null||D.call(_,g.current)}function E(){x.setState("value",g.current,!0)}if(!v)return null;let{disabled:N,value:T,onSelect:R,forceMount:j,keywords:$,...B}=e;return k.createElement(ol.div,{ref:ll(o,n),...B,id:s,"cmdk-item":"",role:"option","aria-disabled":!!N,"aria-selected":!!y,"data-disabled":!!N,"data-selected":!!y,onPointerMove:N||f.getDisablePointerSelection()?void 0:E,onClick:N?void 0:w},e.children)}),o4=k.forwardRef((e,n)=>{let{heading:r,children:l,forceMount:s,...o}=e,u=Sa(),f=k.useRef(null),h=k.useRef(null),p=Sa(),g=bo(),x=il(v=>s||g.filter()===!1?!0:v.search?v.filtered.groups.has(u):!0);Ol(()=>g.group(u),[]),uw(u,f,[e.value,e.heading,h]);let y=k.useMemo(()=>({id:u,forceMount:s}),[s]);return k.createElement(ol.div,{ref:ll(f,n),...o,"cmdk-group":"",role:"presentation",hidden:x?void 0:!0},r&&k.createElement("div",{ref:h,"cmdk-group-heading":"","aria-hidden":!0,id:p},r),Oc(e,v=>k.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?p:void 0},k.createElement(iw.Provider,{value:y},v))))}),u4=k.forwardRef((e,n)=>{let{alwaysRender:r,...l}=e,s=k.useRef(null),o=il(u=>!u.search);return!r&&!o?null:k.createElement(ol.div,{ref:ll(s,n),...l,"cmdk-separator":"",role:"separator"})}),c4=k.forwardRef((e,n)=>{let{onValueChange:r,...l}=e,s=e.value!=null,o=om(),u=il(p=>p.search),f=il(p=>p.selectedItemId),h=bo();return k.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),k.createElement(ol.input,{ref:n,...l,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":h.listId,"aria-labelledby":h.labelId,"aria-activedescendant":f,id:h.inputId,type:"text",value:s?e.value:u,onChange:p=>{s||o.setState("search",p.target.value),r?.(p.target.value)}})}),f4=k.forwardRef((e,n)=>{let{children:r,label:l="Suggestions",...s}=e,o=k.useRef(null),u=k.useRef(null),f=il(p=>p.selectedItemId),h=bo();return k.useEffect(()=>{if(u.current&&o.current){let p=u.current,g=o.current,x,y=new ResizeObserver(()=>{x=requestAnimationFrame(()=>{let v=p.offsetHeight;g.style.setProperty("--cmdk-list-height",v.toFixed(1)+"px")})});return y.observe(p),()=>{cancelAnimationFrame(x),y.unobserve(p)}}},[]),k.createElement(ol.div,{ref:ll(o,n),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":f,"aria-label":l,id:h.listId},Oc(e,p=>k.createElement("div",{ref:ll(u,h.listInnerRef),"cmdk-list-sizer":""},p)))}),d4=k.forwardRef((e,n)=>{let{open:r,onOpenChange:l,overlayClassName:s,contentClassName:o,container:u,...f}=e;return k.createElement(YD,{open:r,onOpenChange:l},k.createElement(VD,{container:u},k.createElement(XD,{"cmdk-overlay":"",className:s}),k.createElement(KD,{"aria-label":e.label,"cmdk-dialog":"",className:o},k.createElement(sw,{ref:n,...f}))))}),h4=k.forwardRef((e,n)=>il(r=>r.filtered.count===0)?k.createElement(ol.div,{ref:n,...e,"cmdk-empty":"",role:"presentation"}):null),p4=k.forwardRef((e,n)=>{let{progress:r,children:l,label:s="Loading...",...o}=e;return k.createElement(ol.div,{ref:n,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},Oc(e,u=>k.createElement("div",{"aria-hidden":!0},u)))}),wn=Object.assign(sw,{List:f4,Item:s4,Input:c4,Group:o4,Separator:u4,Dialog:d4,Empty:h4,Loading:p4});function m4(e,n){let r=e.nextElementSibling;for(;r;){if(r.matches(n))return r;r=r.nextElementSibling}}function g4(e,n){let r=e.previousElementSibling;for(;r;){if(r.matches(n))return r;r=r.previousElementSibling}}function ow(e){let n=k.useRef(e);return Ol(()=>{n.current=e}),n}var Ol=typeof window>"u"?k.useEffect:k.useLayoutEffect;function _i(e){let n=k.useRef();return n.current===void 0&&(n.current=e()),n}function il(e){let n=om(),r=()=>e(n.snapshot());return k.useSyncExternalStore(n.subscribe,r,r)}function uw(e,n,r,l=[]){let s=k.useRef(),o=bo();return Ol(()=>{var u;let f=(()=>{var p;for(let g of r){if(typeof g=="string")return g.trim();if(typeof g=="object"&&"current"in g)return g.current?(p=g.current.textContent)==null?void 0:p.trim():s.current}})(),h=l.map(p=>p.trim());o.value(e,f,h),(u=n.current)==null||u.setAttribute(Ni,f),s.current=f}),s}var x4=()=>{let[e,n]=k.useState(),r=_i(()=>new Map);return Ol(()=>{r.current.forEach(l=>l()),r.current=new Map},[e]),(l,s)=>{r.current.set(l,s),n({})}};function b4(e){let n=e.type;return typeof n=="function"?n(e.props):"render"in n?n.render(e.props):e}function Oc({asChild:e,children:n},r){return e&&k.isValidElement(n)?k.cloneElement(b4(n),{ref:n.ref},r(n.props.children)):r(n)}var y4={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function v4({open:e,onClose:n,repos:r,globalSkills:l=[],globalModules:s=[],onOpenRepo:o,onSendSkill:u,onSendModule:f,onOpenSettings:h,isMobile:p=!1}){return e?d.jsx("div",{className:`fixed inset-0 z-50 flex bg-black/60 ${p?"items-end":"items-start justify-center pt-[20vh]"}`,onClick:n,children:d.jsx("div",{onClick:g=>g.stopPropagation(),className:`w-full ${p?"":"max-w-lg"}`,children:d.jsxs(wn,{className:"rounded-lg border border-neutral-10 bg-neutral-11 shadow-2xl",label:"Command palette",children:[d.jsx(wn.Input,{placeholder:"Search repos, skills, modules, actions...",className:"w-full border-b border-neutral-10 bg-transparent px-4 py-3 text-[15px] text-neutral-2 outline-none placeholder:text-neutral-5",autoFocus:!0}),d.jsxs(wn.List,{className:"max-h-72 overflow-y-auto p-2",children:[d.jsx(wn.Empty,{className:"px-4 py-8 text-center text-[15px] text-neutral-5",children:"No results found."}),d.jsx(wn.Group,{heading:"Repos",className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:pb-1 [&_[cmdk-group-heading]]:text-[12px] [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:uppercase [&_[cmdk-group-heading]]:tracking-wider [&_[cmdk-group-heading]]:text-neutral-5",children:r.map(g=>d.jsxs(wn.Item,{value:`repo ${g.name} ${g.tags.join(" ")}`,onSelect:()=>{o(g),n()},className:"flex cursor-pointer items-center gap-2 rounded px-2 py-1.5 text-[15px] text-neutral-4 aria-selected:bg-primary-8/20 aria-selected:text-primary-4",children:[d.jsx("span",{className:"text-neutral-5",children:"▢"}),g.name,d.jsx("span",{className:"ml-auto text-[12px] text-neutral-5",children:g.tags.join(", ")})]},g.id))}),d.jsxs(wn.Group,{heading:"Skills",className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:pb-1 [&_[cmdk-group-heading]]:pt-2 [&_[cmdk-group-heading]]:text-[12px] [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:uppercase [&_[cmdk-group-heading]]:tracking-wider [&_[cmdk-group-heading]]:text-neutral-5",children:[l.map(g=>d.jsxs(wn.Item,{value:`skill ${g.name} ${g.command} global`,onSelect:()=>{u(g.command),n()},className:"flex cursor-pointer items-center gap-2 rounded px-2 py-1.5 text-[15px] text-neutral-4 aria-selected:bg-primary-8/20 aria-selected:text-primary-4",children:[d.jsx("span",{className:"text-accent-6",children:"/"}),d.jsx("span",{children:g.name}),d.jsx("span",{className:"ml-auto text-[12px] text-neutral-5",children:"global"})]},`global-${g.id}`)),r.flatMap(g=>g.skills.map(x=>d.jsxs(wn.Item,{value:`skill ${x.name} ${x.command} ${g.name}`,onSelect:()=>{u(x.command),n()},className:"flex cursor-pointer items-center gap-2 rounded px-2 py-1.5 text-[15px] text-neutral-4 aria-selected:bg-primary-8/20 aria-selected:text-primary-4",children:[d.jsx("span",{className:"text-accent-6",children:"/"}),d.jsx("span",{children:x.name}),d.jsx("span",{className:"ml-auto text-[12px] text-neutral-5",children:g.name})]},`${g.id}-${x.id}`)))]}),d.jsx(wn.Group,{heading:"Modules",className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:pb-1 [&_[cmdk-group-heading]]:pt-2 [&_[cmdk-group-heading]]:text-[12px] [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:uppercase [&_[cmdk-group-heading]]:tracking-wider [&_[cmdk-group-heading]]:text-neutral-5",children:s.map(g=>d.jsxs(wn.Item,{value:`module ${g.name} ${g.description} global`,onSelect:()=>{f(g),n()},className:"flex cursor-pointer items-center gap-2 rounded px-2 py-1.5 text-[15px] text-neutral-4 aria-selected:bg-primary-8/20 aria-selected:text-primary-4",children:[d.jsx("span",{className:"text-primary-6",children:"◆"}),d.jsx("span",{children:g.name}),d.jsx("span",{className:"ml-auto text-[12px] text-neutral-5",children:"global"})]},`module-${g.id}`))}),d.jsx(wn.Group,{heading:"Actions",className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:pb-1 [&_[cmdk-group-heading]]:pt-2 [&_[cmdk-group-heading]]:text-[12px] [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:uppercase [&_[cmdk-group-heading]]:tracking-wider [&_[cmdk-group-heading]]:text-neutral-5",children:d.jsxs(wn.Item,{value:"settings token configure",onSelect:()=>{h(),n()},className:"flex cursor-pointer items-center gap-2 rounded px-2 py-1.5 text-[15px] text-neutral-4 aria-selected:bg-primary-8/20 aria-selected:text-primary-4",children:[d.jsx("span",{className:"text-neutral-5",children:"⚙"}),"Settings"]})})]})]})})}):null}function k4({groups:e,token:n,ghMissing:r,onOpen:l,onRefreshRepos:s}){const[o,u]=k.useState(null),[f,h]=k.useState("");k.useEffect(()=>{n&&$0(n).then(y=>{h(y)}).catch(()=>{})},[n]);async function p(y){n&&(await U0(n,y),h(y),s?.())}async function g(y){if(!o){if(!y.cloned){u(y.id);try{const v={"Content-Type":"application/json"};n&&(v.Authorization=`Bearer ${n}`);const w=await fetch("/cc/api/clone",{method:"POST",headers:v,body:JSON.stringify({owner:y.owner,name:y.name})});if(!w.ok){const E=await w.json();throw new Error(E.error||"Clone failed")}y.cloned=!0}catch{u(null);return}u(null)}l(y)}}const x=e.reduce((y,v)=>y+v.repos.length,0);return d.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:d.jsxs("div",{className:"w-full max-w-md",children:[d.jsxs("div",{className:"mb-6 text-center",children:[d.jsx("div",{className:"mx-auto mb-3 flex h-10 w-10 items-center justify-center rounded-full bg-neutral-7/50",children:d.jsx(nl,{size:24,stroke:1.5,className:"text-neutral-3"})}),d.jsx("h2",{className:"text-[19px] font-medium text-neutral-2",children:"Choose a repository to start a Claude Code session"})]}),r?d.jsxs("div",{className:"rounded-lg border border-amber-500/30 bg-amber-500/10 px-4 py-3 text-[13px] leading-relaxed text-neutral-3",children:[d.jsx("p",{className:"mb-2 font-medium text-amber-400",children:"GitHub CLI (gh) not found"}),d.jsxs("p",{className:"text-neutral-4",children:["The repo browser needs ",d.jsx("code",{className:"rounded bg-neutral-8 px-1 py-0.5 text-neutral-3",children:"gh"})," to list and clone your repositories."]}),d.jsxs("p",{className:"mt-2 text-neutral-4",children:["Install it:"," ",d.jsx("a",{href:"https://cli.github.com",target:"_blank",rel:"noreferrer",className:"text-amber-400 underline underline-offset-2 hover:text-amber-300",children:"https://cli.github.com"})]}),d.jsxs("p",{className:"mt-1 text-neutral-4",children:["Then run: ",d.jsx("code",{className:"rounded bg-neutral-8 px-1 py-0.5 text-neutral-3",children:"gh auth login"})]})]}):x===0?d.jsx("p",{className:"text-center text-[17px] text-neutral-6",children:"No repositories configured"}):d.jsx(Rp,{groups:e,onSelect:g,cloningId:o,autoFocus:!0}),d.jsx("div",{className:"mt-6 border-t border-neutral-8 pt-5",children:d.jsx(nv,{value:f,token:n,helpText:"Absolute path to your locally cloned repositories",onSave:p})})]})})}const w4=["ls","cat","echo","grep","git log","git status","pwd","which","node -e","head","tail","wc","file","stat","find","type","env","printenv"];function S4({send:e,isOpen:n}){const[r,l]=k.useState([]),[s,o]=k.useState({filesChanged:0,insertions:0,deletions:0,truncated:!1}),[u,f]=k.useState(""),[h,p]=k.useState("all"),[g,x]=k.useState(!1),[y,v]=k.useState(null),w=k.useRef(h),E=k.useRef(n),N=k.useRef(null);k.useEffect(()=>{w.current=h},[h]),k.useEffect(()=>{E.current=n},[n]);const T=k.useCallback(()=>{E.current&&(x(!0),v(null),e({type:"get_diff",scope:w.current}))},[e]),R=k.useCallback(F=>{p(F),w.current=F,E.current&&(x(!0),v(null),e({type:"get_diff",scope:F}))},[e]),j=k.useCallback((F,Y)=>{x(!0),e({type:"discard_changes",scope:w.current,paths:F,statuses:Y})},[e]),$=k.useCallback(F=>{F.type==="diff_result"?(l(F.files),o(F.summary),f(F.branch),p(F.scope),w.current=F.scope,x(!1),v(null)):F.type==="diff_error"&&(v(F.message),x(!1))},[]),B=k.useCallback(()=>{N.current&&clearTimeout(N.current),N.current=setTimeout(()=>{N.current=null,T()},500)},[T]),_=k.useCallback((F,Y)=>{if(E.current){if(F==="Edit"||F==="Write"){B();return}if(F==="Bash"&&Y){const L=Y.trim().toLowerCase();if(w4.some(Z=>L.startsWith(Z)))return}F==="Bash"&&B()}},[B]),D=k.useRef(!1);return k.useEffect(()=>{n&&!D.current&&e({type:"get_diff",scope:w.current}),D.current=n},[n,e]),k.useEffect(()=>()=>{N.current&&clearTimeout(N.current)},[]),{files:r,summary:s,branch:u,scope:h,loading:g,error:y,refresh:T,changeScope:R,discard:j,handleMessage:$,handleToolDone:_}}const P1={all:"Uncommitted changes",staged:"Staged",unstaged:"Unstaged"};function E4({branch:e,scope:n,summary:r,loading:l,hasUntrackedFiles:s,onScopeChange:o,onRefresh:u,onDiscardAll:f}){const[h,p]=k.useState(!1),[g,x]=k.useState(!1),y=()=>{if(!g){x(!0),setTimeout(()=>x(!1),3e3);return}f(),x(!1)};return d.jsxs("div",{className:"sticky top-0 z-10 bg-neutral-10 border-b border-neutral-9 px-3 py-2 flex flex-col gap-2",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs("div",{className:"flex items-center gap-1 text-xs text-neutral-4 shrink-0",children:[d.jsx(nl,{size:13}),d.jsx("span",{className:"truncate max-w-[120px]",title:e,children:e})]}),d.jsxs("div",{className:"relative flex-1",children:[d.jsxs("button",{className:"flex items-center gap-1 text-xs text-neutral-2 bg-neutral-10 hover:bg-neutral-9 rounded px-2 py-1",onClick:()=>p(!h),children:[d.jsx("span",{children:P1[n]}),r.filesChanged>0&&d.jsxs("span",{className:"text-neutral-5",children:["(",r.filesChanged,")"]}),d.jsx(jr,{size:12})]}),h&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>p(!1)}),d.jsx("div",{className:"absolute top-full left-0 mt-1 bg-neutral-10 border border-neutral-8 rounded shadow-lg z-20 min-w-[160px]",children:["all","staged","unstaged"].map(v=>d.jsx("button",{className:`block w-full text-left px-3 py-1.5 text-xs hover:bg-neutral-9 ${v===n?"text-primary-5":"text-neutral-2"}`,onClick:()=>{o(v),p(!1)},children:P1[v]},v))})]})]}),d.jsx("button",{className:`p-1 rounded hover:bg-neutral-9 text-neutral-4 hover:text-neutral-2 ${l?"animate-spin":""}`,onClick:u,title:"Refresh diff",disabled:l,children:d.jsx(y_,{size:14})}),d.jsx("button",{className:`p-1 rounded text-xs ${r.filesChanged===0?"text-neutral-7 cursor-not-allowed":g?"text-error-4 bg-error-950/30 hover:bg-error-950/50":"text-error-5 hover:bg-error-950/30"}`,onClick:y,disabled:r.filesChanged===0,title:g?s?"Click again — untracked files will be deleted!":"Click again to confirm discard all":"Discard all changes",children:d.jsx(kc,{size:14})})]}),r.filesChanged>0&&d.jsxs("div",{className:"flex items-center gap-2 text-xs text-neutral-4",children:[d.jsxs("span",{className:"flex items-center gap-1",children:[r.truncated&&d.jsx("span",{className:"text-warning-5",title:r.truncationReason,children:"truncated"}),d.jsxs("span",{children:[r.filesChanged," file",r.filesChanged!==1?"s":""," changed"]})]}),d.jsxs("span",{className:"text-success-5",children:["+",r.insertions]}),d.jsxs("span",{className:"text-error-5",children:["−",r.deletions]})]})]})}const N4={modified:{label:"M",color:"text-warning-5 bg-warning-950/40"},added:{label:"A",color:"text-success-5 bg-success-950/40"},deleted:{label:"D",color:"text-error-5 bg-error-950/40"},renamed:{label:"R",color:"text-accent-5 bg-accent-950/40"}};function _4({files:e,activeFile:n,onSelectFile:r}){return e.length===0?null:d.jsx("div",{className:"flex flex-col text-xs",children:e.map(l=>{const s=N4[l.status],o=l.path===n,u=l.status==="renamed"&&l.oldPath?`${l.oldPath} → ${l.path}`:l.path;return d.jsxs("button",{className:`flex items-center gap-2 px-3 py-1.5 text-left hover:bg-neutral-10 transition-colors ${o?"bg-neutral-10 text-neutral-1":"text-neutral-3"}`,onClick:()=>r(l.path),children:[d.jsx("span",{className:`inline-flex items-center justify-center w-4 h-4 rounded text-[10px] font-bold shrink-0 ${s.color}`,children:s.label}),d.jsx("span",{className:"font-mono truncate flex-1",title:u,children:u}),!l.isBinary&&(l.additions>0||l.deletions>0)&&d.jsxs("span",{className:"whitespace-nowrap shrink-0",children:[l.additions>0&&d.jsxs("span",{className:"text-success-5",children:["+",l.additions]}),l.additions>0&&l.deletions>0&&" ",l.deletions>0&&d.jsxs("span",{className:"text-error-5",children:["−",l.deletions]})]}),l.isBinary&&d.jsx("span",{className:"text-neutral-6 italic shrink-0",children:"binary"})]},l.path)})})}function F1(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);n&&(l=l.filter((function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable}))),r.push.apply(r,l)}return r}function Cn(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?F1(Object(r),!0).forEach((function(l){pp(e,l,r[l])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):F1(Object(r)).forEach((function(l){Object.defineProperty(e,l,Object.getOwnPropertyDescriptor(r,l))}))}return e}function pp(e,n,r){return(n=(function(l){var s=(function(o,u){if(typeof o!="object"||o===null)return o;var f=o[Symbol.toPrimitive];if(f!==void 0){var h=f.call(o,u);if(typeof h!="object")return h;throw new TypeError("@@toPrimitive must return a primitive value.")}return(u==="string"?String:Number)(o)})(l,"string");return typeof s=="symbol"?s:String(s)})(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function Di(e,n){if(e==null)return{};var r,l,s=(function(u,f){if(u==null)return{};var h,p,g={},x=Object.keys(u);for(p=0;p<x.length;p++)h=x[p],f.indexOf(h)>=0||(g[h]=u[h]);return g})(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(l=0;l<o.length;l++)r=o[l],n.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function Na(e,n){return A4(e)||(function(r,l){var s=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(s!=null){var o,u,f,h,p=[],g=!0,x=!1;try{if(f=(s=s.call(r)).next,l===0){if(Object(s)!==s)return;g=!1}else for(;!(g=(o=f.call(s)).done)&&(p.push(o.value),p.length!==l);g=!0);}catch(y){x=!0,u=y}finally{try{if(!g&&s.return!=null&&(h=s.return(),Object(h)!==h))return}finally{if(x)throw u}}return p}})(e,n)||um(e,n)||j4()}function T4(e){return(function(n){if(Array.isArray(n))return mp(n)})(e)||C4(e)||um(e)||(function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
113
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function A4(e){if(Array.isArray(e))return e}function C4(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function um(e,n){if(e){if(typeof e=="string")return mp(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?mp(e,n):void 0}}function mp(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,l=new Array(n);r<n;r++)l[r]=e[r];return l}function j4(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
114
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function R4(e,n){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=um(e))||n){r&&(e=r);var l=0,s=function(){};return{s,n:function(){return l>=e.length?{done:!0}:{done:!1,value:e[l++]}},e:function(h){throw h},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
115
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o,u=!0,f=!1;return{s:function(){r=r.call(e)},n:function(){var h=r.next();return u=h.done,h},e:function(h){f=!0,o=h},f:function(){try{u||r.return==null||r.return()}finally{if(f)throw o}}}}var qu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function yo(e,n){return e(n={exports:{}},n.exports),n.exports}var pr=yo((function(e){(function(){var n={}.hasOwnProperty;function r(){for(var l=[],s=0;s<arguments.length;s++){var o=arguments[s];if(o){var u=typeof o;if(u==="string"||u==="number")l.push(o);else if(Array.isArray(o)){if(o.length){var f=r.apply(null,o);f&&l.push(f)}}else if(u==="object"){if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]")){l.push(o.toString());continue}for(var h in o)n.call(o,h)&&o[h]&&l.push(h)}}}return l.join(" ")}e.exports?(r.default=r,e.exports=r):window.classNames=r})()})),er={hunkClassName:"",lineClassName:"",gutterClassName:"",codeClassName:"",monotonous:!1,gutterType:"default",viewType:"split",widgets:{},hideGutter:!1,selectedChanges:[],generateAnchorID:function(){},generateLineClassName:function(){},renderGutter:function(e){var n=e.renderDefault;return(0,e.wrapInAnchor)(n())},codeEvents:{},gutterEvents:{}},cw=k.createContext(er),M4=cw.Provider,O4=function(){return k.useContext(cw)};yo((function(e,n){(function(r){function l(o){var u=o.slice(11),f=null,h=null;switch(u.indexOf('"')){case-1:f=(x=u.split(" "))[0].slice(2),h=x[1].slice(2);break;case 0:var p=u.indexOf('"',2);f=u.slice(3,p);var g=u.indexOf('"',p+1);h=g<0?u.slice(p+4):u.slice(g+3,-1);break;default:var x;f=(x=u.split(" "))[0].slice(2),h=x[1].slice(3,-1)}return{oldPath:f,newPath:h}}var s={parse:function(o){for(var u,f,h,p,g,x=[],y=2,v=o.split(`
|
|
116
|
+
`),w=v.length,E=0;E<w;){var N=v[E];if(N.indexOf("diff --git")===0){u={hunks:[],oldEndingNewLine:!0,newEndingNewLine:!0,oldPath:(g=l(N)).oldPath,newPath:g.newPath},x.push(u);var T,R=null;e:for(;T=v[++E];){var j=T.indexOf(" "),$=j>-1?T.slice(0,j):$;switch($){case"diff":E--;break e;case"deleted":case"new":var B=T.slice(j+1);B.indexOf("file mode")===0&&(u[$==="new"?"newMode":"oldMode"]=B.slice(10));break;case"similarity":u.similarity=parseInt(T.split(" ")[2],10);break;case"index":var _=T.slice(j+1).split(" "),D=_[0].split("..");u.oldRevision=D[0],u.newRevision=D[1],_[1]&&(u.oldMode=u.newMode=_[1]);break;case"copy":case"rename":var F=T.slice(j+1);F.indexOf("from")===0?u.oldPath=F.slice(5):u.newPath=F.slice(3),R=$;break;case"---":var Y=T.slice(j+1),L=v[++E].slice(4);Y==="/dev/null"?(L=L.slice(2),R="add"):L==="/dev/null"?(Y=Y.slice(2),R="delete"):(R="modify",Y=Y.slice(2),L=L.slice(2)),Y&&(u.oldPath=Y),L&&(u.newPath=L),y=5;break e}}u.type=R||"modify"}else if(N.indexOf("Binary")===0)u.isBinary=!0,u.type=N.indexOf("/dev/null and")>=0?"add":N.indexOf("and /dev/null")>=0?"delete":"modify",y=2,u=null;else if(y===5)if(N.indexOf("@@")===0){var X=/^@@\s+-([0-9]+)(,([0-9]+))?\s+\+([0-9]+)(,([0-9]+))?/.exec(N);f={content:N,oldStart:X[1]-0,newStart:X[4]-0,oldLines:X[3]-0||1,newLines:X[6]-0||1,changes:[]},u.hunks.push(f),h=f.oldStart,p=f.newStart}else{var Z=N.slice(0,1),te={content:N.slice(1)};switch(Z){case"+":te.type="insert",te.isInsert=!0,te.lineNumber=p,p++;break;case"-":te.type="delete",te.isDelete=!0,te.lineNumber=h,h++;break;case" ":te.type="normal",te.isNormal=!0,te.oldLineNumber=h,te.newLineNumber=p,h++,p++;break;case"\\":var J=f.changes[f.changes.length-1];J.isDelete||(u.newEndingNewLine=!1),J.isInsert||(u.oldEndingNewLine=!1)}te.type&&f.changes.push(te)}E++}return x}};e.exports=s})()}));function Dc(e){return e.type==="insert"}function io(e){return e.type==="delete"}function so(e){return e.type==="normal"}function D4(e){return e[0]}function z4(e){return e[e.length-1]}function gp(e){return["".concat(e,"Start"),"".concat(e,"Lines")]}function oo(e){return e==="old"?function(n){return Dc(n)?-1:so(n)?n.oldLineNumber:n.lineNumber}:function(n){return io(n)?-1:so(n)?n.newLineNumber:n.lineNumber}}function fw(e,n){return function(r,l){var s=r[e],o=s+r[n];return l>=s&&l<o}}function L4(e,n){return function(r,l,s){var o=r[e]+r[n],u=l[e];return s>=o&&s<u}}function dw(e){var n=oo(e),r=(function(l){var s=Na(gp(l),2),o=fw(s[0],s[1]);return function(u,f){return u.find((function(h){return o(h,f)}))}})(e);return function(l,s){var o=r(l,s);if(o)return o.changes.find((function(u){return n(u)===s}))}}function cm(e){var n=e==="old"?"new":"old",r=Na(gp(e),2),l=r[0],s=r[1],o=Na(gp(n),2),u=o[0],f=o[1],h=oo(e),p=oo(n),g=fw(l,s),x=L4(l,s);return function(y,v){var w=D4(y);if(v<w[l]){var E=w[l]-v;return w[u]-E}var N=z4(y);if(N[l]+N[s]<=v){var T=v-N[l]-N[s];return N[u]+N[f]+T}for(var R=0;R<y.length;R++){var j=y[R],$=y[R+1];if(g(j,v)){var B=j.changes.findIndex((function(X){return h(X)===v})),_=j.changes[B];if(so(_))return p(_);var D=io(_)?B+1:B-1,F=j.changes[D];if(!F)return-1;var Y=Dc(_)?"delete":"insert";return F.type===Y?p(F):-1}if(x(j,$,v)){var L=v-j[l]-j[s];return j[u]+j[f]+L}}throw new Error("Unexpected line position ".concat(v))}}var I4=function(){this.__data__=[],this.size=0},hw=function(e,n){return e===n||e!=e&&n!=n},zc=function(e,n){for(var r=e.length;r--;)if(hw(e[r][0],n))return r;return-1},B4=Array.prototype.splice,$4=function(e){var n=this.__data__,r=zc(n,e);return!(r<0)&&(r==n.length-1?n.pop():B4.call(n,r,1),--this.size,!0)},U4=function(e){var n=this.__data__,r=zc(n,e);return r<0?void 0:n[r][1]},H4=function(e){return zc(this.__data__,e)>-1},P4=function(e,n){var r=this.__data__,l=zc(r,e);return l<0?(++this.size,r.push([e,n])):r[l][1]=n,this};function Ti(e){var n=-1,r=e==null?0:e.length;for(this.clear();++n<r;){var l=e[n];this.set(l[0],l[1])}}Ti.prototype.clear=I4,Ti.prototype.delete=$4,Ti.prototype.get=U4,Ti.prototype.has=H4,Ti.prototype.set=P4;var Lc=Ti,F4=function(){this.__data__=new Lc,this.size=0},G4=function(e){var n=this.__data__,r=n.delete(e);return this.size=n.size,r},q4=function(e){return this.__data__.get(e)},Y4=function(e){return this.__data__.has(e)},pw=typeof qu=="object"&&qu&&qu.Object===Object&&qu,V4=typeof self=="object"&&self&&self.Object===Object&&self,Aa=pw||V4||Function("return this")(),ea=Aa.Symbol,mw=Object.prototype,X4=mw.hasOwnProperty,K4=mw.toString,$s=ea?ea.toStringTag:void 0,Z4=function(e){var n=X4.call(e,$s),r=e[$s];try{e[$s]=void 0;var l=!0}catch{}var s=K4.call(e);return l&&(n?e[$s]=r:delete e[$s]),s},Q4=Object.prototype.toString,W4=function(e){return Q4.call(e)},G1=ea?ea.toStringTag:void 0,Bi=function(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":G1&&G1 in Object(e)?Z4(e):W4(e)},fm=function(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")},gw=function(e){if(!fm(e))return!1;var n=Bi(e);return n=="[object Function]"||n=="[object GeneratorFunction]"||n=="[object AsyncFunction]"||n=="[object Proxy]"},Rh=Aa["__core-js_shared__"],q1=(function(){var e=/[^.]+$/.exec(Rh&&Rh.keys&&Rh.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})(),J4=function(e){return!!q1&&q1 in e},ez=Function.prototype.toString,Il=function(e){if(e!=null){try{return ez.call(e)}catch{}try{return e+""}catch{}}return""},tz=/^\[object .+?Constructor\]$/,nz=Function.prototype,rz=Object.prototype,az=nz.toString,lz=rz.hasOwnProperty,iz=RegExp("^"+az.call(lz).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),sz=function(e){return!(!fm(e)||J4(e))&&(gw(e)?iz:tz).test(Il(e))},oz=function(e,n){return e?.[n]},Bl=function(e,n){var r=oz(e,n);return sz(r)?r:void 0},uo=Bl(Aa,"Map"),co=Bl(Object,"create"),uz=function(){this.__data__=co?co(null):{},this.size=0},cz=function(e){var n=this.has(e)&&delete this.__data__[e];return this.size-=n?1:0,n},fz=Object.prototype.hasOwnProperty,dz=function(e){var n=this.__data__;if(co){var r=n[e];return r==="__lodash_hash_undefined__"?void 0:r}return fz.call(n,e)?n[e]:void 0},hz=Object.prototype.hasOwnProperty,pz=function(e){var n=this.__data__;return co?n[e]!==void 0:hz.call(n,e)},mz=function(e,n){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=co&&n===void 0?"__lodash_hash_undefined__":n,this};function Ai(e){var n=-1,r=e==null?0:e.length;for(this.clear();++n<r;){var l=e[n];this.set(l[0],l[1])}}Ai.prototype.clear=uz,Ai.prototype.delete=cz,Ai.prototype.get=dz,Ai.prototype.has=pz,Ai.prototype.set=mz;var Y1=Ai,gz=function(){this.size=0,this.__data__={hash:new Y1,map:new(uo||Lc),string:new Y1}},xz=function(e){var n=typeof e;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?e!=="__proto__":e===null},Ic=function(e,n){var r=e.__data__;return xz(n)?r[typeof n=="string"?"string":"hash"]:r.map},bz=function(e){var n=Ic(this,e).delete(e);return this.size-=n?1:0,n},yz=function(e){return Ic(this,e).get(e)},vz=function(e){return Ic(this,e).has(e)},kz=function(e,n){var r=Ic(this,e),l=r.size;return r.set(e,n),this.size+=r.size==l?0:1,this};function Ci(e){var n=-1,r=e==null?0:e.length;for(this.clear();++n<r;){var l=e[n];this.set(l[0],l[1])}}Ci.prototype.clear=gz,Ci.prototype.delete=bz,Ci.prototype.get=yz,Ci.prototype.has=vz,Ci.prototype.set=kz;var Bc=Ci,wz=function(e,n){var r=this.__data__;if(r instanceof Lc){var l=r.__data__;if(!uo||l.length<199)return l.push([e,n]),this.size=++r.size,this;r=this.__data__=new Bc(l)}return r.set(e,n),this.size=r.size,this};function ji(e){var n=this.__data__=new Lc(e);this.size=n.size}ji.prototype.clear=F4,ji.prototype.delete=G4,ji.prototype.get=q4,ji.prototype.has=Y4,ji.prototype.set=wz;var nc=ji,Sz=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Ez=function(e){return this.__data__.has(e)};function rc(e){var n=-1,r=e==null?0:e.length;for(this.__data__=new Bc;++n<r;)this.add(e[n])}rc.prototype.add=rc.prototype.push=Sz,rc.prototype.has=Ez;var Nz=rc,_z=function(e,n){for(var r=-1,l=e==null?0:e.length;++r<l;)if(n(e[r],r,e))return!0;return!1},Tz=function(e,n){return e.has(n)},xw=function(e,n,r,l,s,o){var u=1&r,f=e.length,h=n.length;if(f!=h&&!(u&&h>f))return!1;var p=o.get(e),g=o.get(n);if(p&&g)return p==n&&g==e;var x=-1,y=!0,v=2&r?new Nz:void 0;for(o.set(e,n),o.set(n,e);++x<f;){var w=e[x],E=n[x];if(l)var N=u?l(E,w,x,n,e,o):l(w,E,x,e,n,o);if(N!==void 0){if(N)continue;y=!1;break}if(v){if(!_z(n,(function(T,R){if(!Tz(v,R)&&(w===T||s(w,T,r,l,o)))return v.push(R)}))){y=!1;break}}else if(w!==E&&!s(w,E,r,l,o)){y=!1;break}}return o.delete(e),o.delete(n),y},V1=Aa.Uint8Array,Az=function(e){var n=-1,r=Array(e.size);return e.forEach((function(l,s){r[++n]=[s,l]})),r},Cz=function(e){var n=-1,r=Array(e.size);return e.forEach((function(l){r[++n]=l})),r},X1=ea?ea.prototype:void 0,Mh=X1?X1.valueOf:void 0,jz=function(e,n,r,l,s,o,u){switch(r){case"[object DataView]":if(e.byteLength!=n.byteLength||e.byteOffset!=n.byteOffset)return!1;e=e.buffer,n=n.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=n.byteLength||!o(new V1(e),new V1(n)));case"[object Boolean]":case"[object Date]":case"[object Number]":return hw(+e,+n);case"[object Error]":return e.name==n.name&&e.message==n.message;case"[object RegExp]":case"[object String]":return e==n+"";case"[object Map]":var f=Az;case"[object Set]":var h=1&l;if(f||(f=Cz),e.size!=n.size&&!h)return!1;var p=u.get(e);if(p)return p==n;l|=2,u.set(e,n);var g=xw(f(e),f(n),l,s,o,u);return u.delete(e),g;case"[object Symbol]":if(Mh)return Mh.call(e)==Mh.call(n)}return!1},Rz=function(e,n){for(var r=-1,l=n.length,s=e.length;++r<l;)e[s+r]=n[r];return e},_a=Array.isArray,Mz=function(e,n,r){var l=n(e);return _a(e)?l:Rz(l,r(e))},Oz=function(e,n){for(var r=-1,l=e==null?0:e.length,s=0,o=[];++r<l;){var u=e[r];n(u,r,e)&&(o[s++]=u)}return o},Dz=function(){return[]},zz=Object.prototype.propertyIsEnumerable,K1=Object.getOwnPropertySymbols,Lz=K1?function(e){return e==null?[]:(e=Object(e),Oz(K1(e),(function(n){return zz.call(e,n)})))}:Dz,Iz=function(e,n){for(var r=-1,l=Array(e);++r<e;)l[r]=n(r);return l},zi=function(e){return e!=null&&typeof e=="object"},Z1=function(e){return zi(e)&&Bi(e)=="[object Arguments]"},bw=Object.prototype,Bz=bw.hasOwnProperty,$z=bw.propertyIsEnumerable,yw=Z1((function(){return arguments})())?Z1:function(e){return zi(e)&&Bz.call(e,"callee")&&!$z.call(e,"callee")},Uz=function(){return!1},xp=yo((function(e,n){var r=n&&!n.nodeType&&n,l=r&&e&&!e.nodeType&&e,s=l&&l.exports===r?Aa.Buffer:void 0,o=(s?s.isBuffer:void 0)||Uz;e.exports=o})),Hz=/^(?:0|[1-9]\d*)$/,vw=function(e,n){var r=typeof e;return!!(n=n??9007199254740991)&&(r=="number"||r!="symbol"&&Hz.test(e))&&e>-1&&e%1==0&&e<n},dm=function(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=9007199254740991},Xt={};Xt["[object Float32Array]"]=Xt["[object Float64Array]"]=Xt["[object Int8Array]"]=Xt["[object Int16Array]"]=Xt["[object Int32Array]"]=Xt["[object Uint8Array]"]=Xt["[object Uint8ClampedArray]"]=Xt["[object Uint16Array]"]=Xt["[object Uint32Array]"]=!0,Xt["[object Arguments]"]=Xt["[object Array]"]=Xt["[object ArrayBuffer]"]=Xt["[object Boolean]"]=Xt["[object DataView]"]=Xt["[object Date]"]=Xt["[object Error]"]=Xt["[object Function]"]=Xt["[object Map]"]=Xt["[object Number]"]=Xt["[object Object]"]=Xt["[object RegExp]"]=Xt["[object Set]"]=Xt["[object String]"]=Xt["[object WeakMap]"]=!1;var Pz=function(e){return zi(e)&&dm(e.length)&&!!Xt[Bi(e)]},Fz=function(e){return function(n){return e(n)}},Q1=yo((function(e,n){var r=n&&!n.nodeType&&n,l=r&&e&&!e.nodeType&&e,s=l&&l.exports===r&&pw.process,o=(function(){try{var u=l&&l.require&&l.require("util").types;return u||s&&s.binding&&s.binding("util")}catch{}})();e.exports=o})),W1=Q1&&Q1.isTypedArray,kw=W1?Fz(W1):Pz,Gz=Object.prototype.hasOwnProperty,qz=function(e,n){var r=_a(e),l=!r&&yw(e),s=!r&&!l&&xp(e),o=!r&&!l&&!s&&kw(e),u=r||l||s||o,f=u?Iz(e.length,String):[],h=f.length;for(var p in e)!Gz.call(e,p)||u&&(p=="length"||s&&(p=="offset"||p=="parent")||o&&(p=="buffer"||p=="byteLength"||p=="byteOffset")||vw(p,h))||f.push(p);return f},Yz=Object.prototype,Vz=function(e){var n=e&&e.constructor;return e===(typeof n=="function"&&n.prototype||Yz)},Xz=(function(e,n){return function(r){return e(n(r))}})(Object.keys,Object),Kz=Object.prototype.hasOwnProperty,Zz=function(e){if(!Vz(e))return Xz(e);var n=[];for(var r in Object(e))Kz.call(e,r)&&r!="constructor"&&n.push(r);return n},Qz=function(e){return e!=null&&dm(e.length)&&!gw(e)},hm=function(e){return Qz(e)?qz(e):Zz(e)},J1=function(e){return Mz(e,hm,Lz)},Wz=Object.prototype.hasOwnProperty,Jz=function(e,n,r,l,s,o){var u=1&r,f=J1(e),h=f.length;if(h!=J1(n).length&&!u)return!1;for(var p=h;p--;){var g=f[p];if(!(u?g in n:Wz.call(n,g)))return!1}var x=o.get(e),y=o.get(n);if(x&&y)return x==n&&y==e;var v=!0;o.set(e,n),o.set(n,e);for(var w=u;++p<h;){var E=e[g=f[p]],N=n[g];if(l)var T=u?l(N,E,g,n,e,o):l(E,N,g,e,n,o);if(!(T===void 0?E===N||s(E,N,r,l,o):T)){v=!1;break}w||(w=g=="constructor")}if(v&&!w){var R=e.constructor,j=n.constructor;R==j||!("constructor"in e)||!("constructor"in n)||typeof R=="function"&&R instanceof R&&typeof j=="function"&&j instanceof j||(v=!1)}return o.delete(e),o.delete(n),v},bp=Bl(Aa,"DataView"),yp=Bl(Aa,"Promise"),vp=Bl(Aa,"Set"),kp=Bl(Aa,"WeakMap"),e6=Il(bp),t6=Il(uo),n6=Il(yp),r6=Il(vp),a6=Il(kp),Tl=Bi;(bp&&Tl(new bp(new ArrayBuffer(1)))!="[object DataView]"||uo&&Tl(new uo)!="[object Map]"||yp&&Tl(yp.resolve())!="[object Promise]"||vp&&Tl(new vp)!="[object Set]"||kp&&Tl(new kp)!="[object WeakMap]")&&(Tl=function(e){var n=Bi(e),r=n=="[object Object]"?e.constructor:void 0,l=r?Il(r):"";if(l)switch(l){case e6:return"[object DataView]";case t6:return"[object Map]";case n6:return"[object Promise]";case r6:return"[object Set]";case a6:return"[object WeakMap]"}return n});var e0=Tl,Yu="[object Object]",t0=Object.prototype.hasOwnProperty,l6=function(e,n,r,l,s,o){var u=_a(e),f=_a(n),h=u?"[object Array]":e0(e),p=f?"[object Array]":e0(n),g=(h=h=="[object Arguments]"?Yu:h)==Yu,x=(p=p=="[object Arguments]"?Yu:p)==Yu,y=h==p;if(y&&xp(e)){if(!xp(n))return!1;u=!0,g=!1}if(y&&!g)return o||(o=new nc),u||kw(e)?xw(e,n,r,l,s,o):jz(e,n,h,r,l,s,o);if(!(1&r)){var v=g&&t0.call(e,"__wrapped__"),w=x&&t0.call(n,"__wrapped__");if(v||w){var E=v?e.value():e,N=w?n.value():n;return o||(o=new nc),s(E,N,r,l,o)}}return!!y&&(o||(o=new nc),Jz(e,n,r,l,s,o))},ww=function e(n,r,l,s,o){return n===r||(n==null||r==null||!zi(n)&&!zi(r)?n!=n&&r!=r:l6(n,r,l,s,e,o))},i6=function(e,n,r,l){var s=r.length,o=s;if(e==null)return!o;for(e=Object(e);s--;){var u=r[s];if(u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++s<o;){var f=(u=r[s])[0],h=e[f],p=u[1];if(u[2]){if(h===void 0&&!(f in e))return!1}else{var g=new nc,x;if(!(x===void 0?ww(p,h,3,l,g):x))return!1}}return!0},Sw=function(e){return e==e&&!fm(e)},s6=function(e){for(var n=hm(e),r=n.length;r--;){var l=n[r],s=e[l];n[r]=[l,s,Sw(s)]}return n},Ew=function(e,n){return function(r){return r!=null&&r[e]===n&&(n!==void 0||e in Object(r))}},o6=function(e){var n=s6(e);return n.length==1&&n[0][2]?Ew(n[0][0],n[0][1]):function(r){return r===e||i6(r,e,n)}},pm=function(e){return typeof e=="symbol"||zi(e)&&Bi(e)=="[object Symbol]"},u6=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,c6=/^\w*$/,mm=function(e,n){if(_a(e))return!1;var r=typeof e;return!(r!="number"&&r!="symbol"&&r!="boolean"&&e!=null&&!pm(e))||c6.test(e)||!u6.test(e)||n!=null&&e in Object(n)};function gm(e,n){if(typeof e!="function"||n!=null&&typeof n!="function")throw new TypeError("Expected a function");var r=function(){var l=arguments,s=n?n.apply(this,l):l[0],o=r.cache;if(o.has(s))return o.get(s);var u=e.apply(this,l);return r.cache=o.set(s,u)||o,u};return r.cache=new(gm.Cache||Bc),r}gm.Cache=Bc;var f6=gm,d6=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,h6=/\\(\\)?/g,p6=(function(e){var n=f6(e,(function(l){return r.size===500&&r.clear(),l})),r=n.cache;return n})((function(e){var n=[];return e.charCodeAt(0)===46&&n.push(""),e.replace(d6,(function(r,l,s,o){n.push(s?o.replace(h6,"$1"):l||r)})),n})),m6=function(e,n){for(var r=-1,l=e==null?0:e.length,s=Array(l);++r<l;)s[r]=n(e[r],r,e);return s},n0=ea?ea.prototype:void 0,r0=n0?n0.toString:void 0,g6=function e(n){if(typeof n=="string")return n;if(_a(n))return m6(n,e)+"";if(pm(n))return r0?r0.call(n):"";var r=n+"";return r=="0"&&1/n==-1/0?"-0":r},x6=function(e){return e==null?"":g6(e)},Nw=function(e,n){return _a(e)?e:mm(e,n)?[e]:p6(x6(e))},$c=function(e){if(typeof e=="string"||pm(e))return e;var n=e+"";return n=="0"&&1/e==-1/0?"-0":n},_w=function(e,n){for(var r=0,l=(n=Nw(n,e)).length;e!=null&&r<l;)e=e[$c(n[r++])];return r&&r==l?e:void 0},b6=function(e,n,r){var l=e==null?void 0:_w(e,n);return l===void 0?r:l},y6=function(e,n){return e!=null&&n in Object(e)},v6=function(e,n,r){for(var l=-1,s=(n=Nw(n,e)).length,o=!1;++l<s;){var u=$c(n[l]);if(!(o=e!=null&&r(e,u)))break;e=e[u]}return o||++l!=s?o:!!(s=e==null?0:e.length)&&dm(s)&&vw(u,s)&&(_a(e)||yw(e))},k6=function(e,n){return e!=null&&v6(e,n,y6)},w6=function(e,n){return mm(e)&&Sw(n)?Ew($c(e),n):function(r){var l=b6(r,e);return l===void 0&&l===n?k6(r,e):ww(n,l,3)}},S6=function(e){return e},E6=function(e){return function(n){return n?.[e]}},N6=function(e){return function(n){return _w(n,e)}},_6=function(e){return mm(e)?E6($c(e)):N6(e)},T6=function(e){return typeof e=="function"?e:e==null?S6:typeof e=="object"?_a(e)?w6(e[0],e[1]):o6(e):_6(e)};function al(e){if(!e)throw new Error("change is not provided");if(so(e))return"N".concat(e.oldLineNumber);var n=Dc(e)?"I":"D";return"".concat(n).concat(e.lineNumber)}cm("old");var xm=oo("old"),bm=oo("new");dw("old");dw("new");cm("new");cm("old");var a0=(function(){try{var e=Bl(Object,"defineProperty");return e({},"",{}),e}catch{}})(),A6=function(e,n,r){n=="__proto__"&&a0?a0(e,n,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[n]=r},C6=function(e){return function(n,r,l){for(var s=-1,o=Object(n),u=l(n),f=u.length;f--;){var h=u[++s];if(r(o[h],h,o)===!1)break}return n}},j6=C6(),R6=function(e,n){return e&&j6(e,n,hm)},Tw=function(e,n){var r={};return n=T6(n),R6(e,(function(l,s,o){A6(r,s,n(l,s,o))})),r},M6=["changeKey","text","tokens","renderToken"],l0=function e(n,r){var l=n.type,s=n.value,o=n.markType,u=n.properties,f=n.className,h=n.children,p=function(x){return d.jsx("span",{className:x,children:s||h&&h.map(e)},r)};switch(l){case"text":return s;case"mark":return p("diff-code-mark diff-code-mark-".concat(o));case"edit":return p("diff-code-edit");default:var g=u&&u.className;return p(pr(f||g))}};function O6(e){if(!Array.isArray(e))return!0;if(e.length>1)return!1;if(e.length===1){var n=Na(e,1)[0];return n.type==="text"&&!n.value}return!0}function D6(e){var n=e.changeKey,r=e.text,l=e.tokens,s=e.renderToken,o=Di(e,M6),u=s?function(f,h){return s(f,l0,h)}:l0;return d.jsx("td",Cn(Cn({},o),{},{"data-change-key":n,children:l?O6(l)?" ":l.map(u):r||" "}))}var Aw=k.memo(D6);function Cw(e,n){return function(){var r=n==="old"?xm(e):bm(e);return r===-1?void 0:r}}function jw(e,n){return function(r){return e&&r?d.jsx("a",{href:n?"#"+n:void 0,children:r}):r}}function xc(e,n){return n?function(r){e(),n(r)}:e}function i0(e,n,r,l){return k.useMemo((function(){var s=Tw(e,(function(o){return function(u){return o&&o(n,u)}}));return s.onMouseEnter=xc(r,s.onMouseEnter),s.onMouseLeave=xc(l,s.onMouseLeave),s}),[e,r,l,n])}function s0(e,n,r,l,s,o,u,f,h){var p={change:n,side:l,inHoverState:f,renderDefault:Cw(n,l),wrapInAnchor:jw(s,o)};return d.jsx("td",Cn(Cn({className:e},u),{},{"data-change-key":r,children:h(p)}))}function z6(e){var n,r,l,s=e.change,o=e.selected,u=e.tokens,f=e.className,h=e.generateLineClassName,p=e.gutterClassName,g=e.codeClassName,x=e.gutterEvents,y=e.codeEvents,v=e.hideGutter,w=e.gutterAnchor,E=e.generateAnchorID,N=e.renderToken,T=e.renderGutter,R=s.type,j=s.content,$=al(s),B=(n=Na(k.useState(!1),2),r=n[0],l=n[1],[r,k.useCallback((function(){return l(!0)}),[]),k.useCallback((function(){return l(!1)}),[])]),_=Na(B,3),D=_[0],F=_[1],Y=_[2],L=k.useMemo((function(){return{change:s}}),[s]),X=i0(x,L,F,Y),Z=i0(y,L,F,Y),te=E(s),J=h({changes:[s],defaultGenerate:function(){return f}}),G=pr("diff-gutter","diff-gutter-".concat(R),p,{"diff-gutter-selected":o}),z=pr("diff-code","diff-code-".concat(R),g,{"diff-code-selected":o});return d.jsxs("tr",{id:te,className:pr("diff-line",J),children:[!v&&s0(G,s,$,"old",w,te,X,D,T),!v&&s0(G,s,$,"new",w,te,X,D,T),d.jsx(Aw,Cn({className:z,changeKey:$,text:j,tokens:u,renderToken:N},Z))]})}var L6=k.memo(z6);function I6(e){var n=e.hideGutter,r=e.element;return d.jsx("tr",{className:"diff-widget",children:d.jsx("td",{colSpan:n?1:3,className:"diff-widget-content",children:r})})}var B6=["hideGutter","selectedChanges","tokens","lineClassName"],$6=["hunk","widgets","className"];function U6(e){var n=e.hunk,r=e.widgets,l=e.className,s=Di(e,$6),o=(function(u,f){return u.reduce((function(h,p){var g=al(p);h.push(["change",g,p]);var x=f[g];return x&&h.push(["widget",g,x]),h}),[])})(n.changes,r);return d.jsx("tbody",{className:pr("diff-hunk",l),children:o.map((function(u){return(function(f,h){var p=Na(f,3),g=p[0],x=p[1],y=p[2],v=h.hideGutter,w=h.selectedChanges,E=h.tokens,N=h.lineClassName,T=Di(h,B6);if(g==="change"){var R=io(y)?"old":"new",j=io(y)?xm(y):bm(y),$=E?E[R][j-1]:null;return d.jsx(L6,Cn({className:N,change:y,hideGutter:v,selected:w.includes(x),tokens:$},T),"change".concat(x))}return g==="widget"?d.jsx(I6,{hideGutter:v,element:y},"widget".concat(x)):null})(u,s)}))})}var Rw=0;function Vu(e,n,r,l){var s=k.useCallback((function(){return n(e)}),[e,n]),o=k.useCallback((function(){return n("")}),[n]);return k.useMemo((function(){var u=Tw(l,(function(f){return function(h){return f&&f({side:e,change:r},h)}}));return u.onMouseEnter=xc(s,u.onMouseEnter),u.onMouseLeave=xc(o,u.onMouseLeave),u}),[r,l,s,e,o])}function Oh(e){var n=e.change,r=e.side,l=e.selected,s=e.tokens,o=e.gutterClassName,u=e.codeClassName,f=e.gutterEvents,h=e.codeEvents,p=e.anchorID,g=e.gutterAnchor,x=e.gutterAnchorTarget,y=e.hideGutter,v=e.hover,w=e.renderToken,E=e.renderGutter;if(!n){var N=pr("diff-gutter","diff-gutter-omit",o),T=pr("diff-code","diff-code-omit",u);return[!y&&d.jsx("td",{className:N},"gutter"),d.jsx("td",{className:T},"code")]}var R=n.type,j=n.content,$=al(n),B=r===Rw?"old":"new",_=Cn({id:p||void 0,className:pr("diff-gutter","diff-gutter-".concat(R),pp({"diff-gutter-selected":l},"diff-line-hover-"+B,v),o),children:E({change:n,side:B,inHoverState:v,renderDefault:Cw(n,B),wrapInAnchor:jw(g,x)})},f),D=pr("diff-code","diff-code-".concat(R),pp({"diff-code-selected":l},"diff-line-hover-"+B,v),u);return[!y&&d.jsx("td",Cn(Cn({},_),{},{"data-change-key":$}),"gutter"),d.jsx(Aw,Cn({className:D,changeKey:$,text:j,tokens:s,renderToken:w},h),"code")]}function H6(e){var n=e.className,r=e.oldChange,l=e.newChange,s=e.oldSelected,o=e.newSelected,u=e.oldTokens,f=e.newTokens,h=e.monotonous,p=e.gutterClassName,g=e.codeClassName,x=e.gutterEvents,y=e.codeEvents,v=e.hideGutter,w=e.generateAnchorID,E=e.generateLineClassName,N=e.gutterAnchor,T=e.renderToken,R=e.renderGutter,j=Na(k.useState(""),2),$=j[0],B=j[1],_=Vu("old",B,r,x),D=Vu("new",B,l,x),F=Vu("old",B,r,y),Y=Vu("new",B,l,y),L=r&&w(r),X=l&&w(l),Z=E({changes:[r,l],defaultGenerate:function(){return n}}),te={monotonous:h,hideGutter:v,gutterClassName:p,codeClassName:g,gutterEvents:x,codeEvents:y,renderToken:T,renderGutter:R},J=Cn(Cn({},te),{},{change:r,side:Rw,selected:s,tokens:u,gutterEvents:_,codeEvents:F,anchorID:L,gutterAnchor:N,gutterAnchorTarget:L,hover:$==="old"}),G=Cn(Cn({},te),{},{change:l,side:1,selected:o,tokens:f,gutterEvents:D,codeEvents:Y,anchorID:r===l?null:X,gutterAnchor:N,gutterAnchorTarget:r===l?L:X,hover:$==="new"});if(h)return d.jsx("tr",{className:pr("diff-line",Z),children:Oh(r?J:G)});var z=(function(V,ne){return V&&!ne?"diff-line-old-only":!V&&ne?"diff-line-new-only":V===ne?"diff-line-normal":"diff-line-compare"})(r,l);return d.jsxs("tr",{className:pr("diff-line",z,Z),children:[Oh(J),Oh(G)]})}var P6=k.memo(H6);function F6(e){var n=e.hideGutter,r=e.oldElement,l=e.newElement;return e.monotonous?d.jsx("tr",{className:"diff-widget",children:d.jsx("td",{colSpan:n?1:2,className:"diff-widget-content",children:r||l})}):r===l?d.jsx("tr",{className:"diff-widget",children:d.jsx("td",{colSpan:n?2:4,className:"diff-widget-content",children:r})}):d.jsxs("tr",{className:"diff-widget",children:[d.jsx("td",{colSpan:n?1:2,className:"diff-widget-content",children:r}),d.jsx("td",{colSpan:n?1:2,className:"diff-widget-content",children:l})]})}var G6=["selectedChanges","monotonous","hideGutter","tokens","lineClassName"],q6=["hunk","widgets","className"];function Xu(e,n){return(e?al(e):"00")+(n?al(n):"00")}function Y6(e){var n=e.hunk,r=e.widgets,l=e.className,s=Di(e,q6),o=(function(u,f){for(var h=function(T){if(!T)return null;var R=al(T);return f[R]||null},p=[],g=0;g<u.length;g++){var x=u[g];if(so(x))p.push(["change",Xu(x,x),x,x]);else if(io(x)){var y=u[g+1];y&&Dc(y)?(g+=1,p.push(["change",Xu(x,y),x,y])):p.push(["change",Xu(x,null),x,null])}else p.push(["change",Xu(null,x),null,x]);var v=p[p.length-1],w=h(v[2]),E=h(v[3]);if(w||E){var N=v[1];p.push(["widget",N,w,E])}}return p})(n.changes,r);return d.jsx("tbody",{className:pr("diff-hunk",l),children:o.map((function(u){return(function(f,h){var p=Na(f,4),g=p[0],x=p[1],y=p[2],v=p[3],w=h.selectedChanges,E=h.monotonous,N=h.hideGutter,T=h.tokens,R=h.lineClassName,j=Di(h,G6);if(g==="change"){var $=!!y&&w.includes(al(y)),B=!!v&&w.includes(al(v)),_=y&&T?T.old[xm(y)-1]:null,D=v&&T?T.new[bm(v)-1]:null;return d.jsx(P6,Cn({className:R,oldChange:y,newChange:v,monotonous:E,hideGutter:N,oldSelected:$,newSelected:B,oldTokens:_,newTokens:D},j),"change".concat(x))}return g==="widget"?d.jsx(F6,{monotonous:E,hideGutter:N,oldElement:y,newElement:v},"widget".concat(x)):null})(u,s)}))})}var V6=["gutterType","hunkClassName"];function Mw(e){var n=e.hunk,r=O4(),l=r.gutterType,s=r.hunkClassName,o=Di(r,V6),u=l==="none",f=l==="anchor",h=o.viewType==="unified"?U6:Y6;return d.jsx(h,Cn(Cn({},o),{},{hunk:n,hideGutter:u,gutterAnchor:f,className:s}))}function X6(){}function o0(e,n){var r=n?"auto":"none";e instanceof HTMLElement&&e.style.userSelect!==r&&(e.style.userSelect=r)}function K6(e){return e.map((function(n){return d.jsx(Mw,{hunk:n},(function(r){return"-".concat(r.oldStart,",").concat(r.oldLines," +").concat(r.newStart,",").concat(r.newLines)})(n))}))}function Z6(e){var n=e.diffType,r=e.hunks,l=e.optimizeSelection,s=e.className,o=e.hunkClassName,u=o===void 0?er.hunkClassName:o,f=e.lineClassName,h=f===void 0?er.lineClassName:f,p=e.generateLineClassName,g=p===void 0?er.generateLineClassName:p,x=e.gutterClassName,y=x===void 0?er.gutterClassName:x,v=e.codeClassName,w=v===void 0?er.codeClassName:v,E=e.gutterType,N=E===void 0?er.gutterType:E,T=e.viewType,R=T===void 0?er.viewType:T,j=e.gutterEvents,$=j===void 0?er.gutterEvents:j,B=e.codeEvents,_=B===void 0?er.codeEvents:B,D=e.generateAnchorID,F=D===void 0?er.generateAnchorID:D,Y=e.selectedChanges,L=Y===void 0?er.selectedChanges:Y,X=e.widgets,Z=X===void 0?er.widgets:X,te=e.renderGutter,J=te===void 0?er.renderGutter:te,G=e.tokens,z=e.renderToken,V=e.children,ne=V===void 0?K6:V,be=k.useRef(null),M=k.useCallback((function(he){var pe=he.target;if(he.button===0){var Ae=(function(Et,ve){for(var Ee=Et;Ee&&Ee!==document.documentElement&&!Ee.classList.contains(ve);)Ee=Ee.parentElement;return Ee===document.documentElement?null:Ee})(pe,"diff-code");if(Ae&&Ae.parentElement){var Re=window.getSelection();Re&&Re.removeAllRanges();var qe=T4(Ae.parentElement.children).indexOf(Ae);if(qe===1||qe===3){var pt,St=R4(be.current?be.current.querySelectorAll(".diff-line"):[]);try{for(St.s();!(pt=St.n()).done;){var Ge=pt.value.children;o0(Ge[1],qe===1),o0(Ge[3],qe===3)}}catch(Et){St.e(Et)}finally{St.f()}}}}}),[]),O=N==="none",I=n==="add"||n==="delete",A=R==="split"&&!I&&l?M:X6,oe=k.useMemo((function(){return d.jsxs("colgroup",R==="unified"?{children:[!O&&d.jsx("col",{className:"diff-gutter-col"}),!O&&d.jsx("col",{className:"diff-gutter-col"}),d.jsx("col",{})]}:I?{children:[!O&&d.jsx("col",{className:"diff-gutter-col"}),d.jsx("col",{})]}:{children:[!O&&d.jsx("col",{className:"diff-gutter-col"}),d.jsx("col",{}),!O&&d.jsx("col",{className:"diff-gutter-col"}),d.jsx("col",{})]})}),[R,I,O]),le=k.useMemo((function(){return{hunkClassName:u,lineClassName:h,generateLineClassName:g,gutterClassName:y,codeClassName:w,monotonous:I,hideGutter:O,viewType:R,gutterType:N,codeEvents:_,gutterEvents:$,generateAnchorID:F,selectedChanges:L,widgets:Z,renderGutter:J,tokens:G,renderToken:z}}),[w,_,F,y,$,N,O,u,h,g,I,J,z,L,G,R,Z]);return d.jsx(M4,{value:le,children:d.jsxs("table",{ref:be,className:pr("diff","diff-".concat(R),s),onMouseDown:A,children:[oe,ne(r)]})})}var Q6=k.memo(Z6);ea&&ea.isConcatSpreadable;var ym=yo((function(e){var n=function(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32};n.Diff=function(r,l){return[r,l]},n.prototype.diff_main=function(r,l,s,o){o===void 0&&(o=this.Diff_Timeout<=0?Number.MAX_VALUE:new Date().getTime()+1e3*this.Diff_Timeout);var u=o;if(r==null||l==null)throw new Error("Null input. (diff_main)");if(r==l)return r?[new n.Diff(0,r)]:[];s===void 0&&(s=!0);var f=s,h=this.diff_commonPrefix(r,l),p=r.substring(0,h);r=r.substring(h),l=l.substring(h),h=this.diff_commonSuffix(r,l);var g=r.substring(r.length-h);r=r.substring(0,r.length-h),l=l.substring(0,l.length-h);var x=this.diff_compute_(r,l,f,u);return p&&x.unshift(new n.Diff(0,p)),g&&x.push(new n.Diff(0,g)),this.diff_cleanupMerge(x),x},n.prototype.diff_compute_=function(r,l,s,o){var u;if(!r)return[new n.Diff(1,l)];if(!l)return[new n.Diff(-1,r)];var f=r.length>l.length?r:l,h=r.length>l.length?l:r,p=f.indexOf(h);if(p!=-1)return u=[new n.Diff(1,f.substring(0,p)),new n.Diff(0,h),new n.Diff(1,f.substring(p+h.length))],r.length>l.length&&(u[0][0]=u[2][0]=-1),u;if(h.length==1)return[new n.Diff(-1,r),new n.Diff(1,l)];var g=this.diff_halfMatch_(r,l);if(g){var x=g[0],y=g[1],v=g[2],w=g[3],E=g[4],N=this.diff_main(x,v,s,o),T=this.diff_main(y,w,s,o);return N.concat([new n.Diff(0,E)],T)}return s&&r.length>100&&l.length>100?this.diff_lineMode_(r,l,o):this.diff_bisect_(r,l,o)},n.prototype.diff_lineMode_=function(r,l,s){var o=this.diff_linesToChars_(r,l);r=o.chars1,l=o.chars2;var u=o.lineArray,f=this.diff_main(r,l,!1,s);this.diff_charsToLines_(f,u),this.diff_cleanupSemantic(f),f.push(new n.Diff(0,""));for(var h=0,p=0,g=0,x="",y="";h<f.length;){switch(f[h][0]){case 1:g++,y+=f[h][1];break;case-1:p++,x+=f[h][1];break;case 0:if(p>=1&&g>=1){f.splice(h-p-g,p+g),h=h-p-g;for(var v=this.diff_main(x,y,!1,s),w=v.length-1;w>=0;w--)f.splice(h,0,v[w]);h+=v.length}g=0,p=0,x="",y=""}h++}return f.pop(),f},n.prototype.diff_bisect_=function(r,l,s){for(var o=r.length,u=l.length,f=Math.ceil((o+u)/2),h=f,p=2*f,g=new Array(p),x=new Array(p),y=0;y<p;y++)g[y]=-1,x[y]=-1;g[h+1]=0,x[h+1]=0;for(var v=o-u,w=v%2!=0,E=0,N=0,T=0,R=0,j=0;j<f&&!(new Date().getTime()>s);j++){for(var $=-j+E;$<=j-N;$+=2){for(var B=h+$,_=(X=$==-j||$!=j&&g[B-1]<g[B+1]?g[B+1]:g[B-1]+1)-$;X<o&&_<u&&r.charAt(X)==l.charAt(_);)X++,_++;if(g[B]=X,X>o)N+=2;else if(_>u)E+=2;else if(w&&(Y=h+v-$)>=0&&Y<p&&x[Y]!=-1&&X>=(F=o-x[Y]))return this.diff_bisectSplit_(r,l,X,_,s)}for(var D=-j+T;D<=j-R;D+=2){for(var F,Y=h+D,L=(F=D==-j||D!=j&&x[Y-1]<x[Y+1]?x[Y+1]:x[Y-1]+1)-D;F<o&&L<u&&r.charAt(o-F-1)==l.charAt(u-L-1);)F++,L++;if(x[Y]=F,F>o)R+=2;else if(L>u)T+=2;else if(!w&&(B=h+v-D)>=0&&B<p&&g[B]!=-1){var X;if(_=h+(X=g[B])-B,X>=(F=o-F))return this.diff_bisectSplit_(r,l,X,_,s)}}}return[new n.Diff(-1,r),new n.Diff(1,l)]},n.prototype.diff_bisectSplit_=function(r,l,s,o,u){var f=r.substring(0,s),h=l.substring(0,o),p=r.substring(s),g=l.substring(o),x=this.diff_main(f,h,!1,u),y=this.diff_main(p,g,!1,u);return x.concat(y)},n.prototype.diff_linesToChars_=function(r,l){var s=[],o={};function u(p){for(var g="",x=0,y=-1,v=s.length;y<p.length-1;){(y=p.indexOf(`
|
|
117
|
+
`,x))==-1&&(y=p.length-1);var w=p.substring(x,y+1);(o.hasOwnProperty?o.hasOwnProperty(w):o[w]!==void 0)?g+=String.fromCharCode(o[w]):(v==f&&(w=p.substring(x),y=p.length),g+=String.fromCharCode(v),o[w]=v,s[v++]=w),x=y+1}return g}s[0]="";var f=4e4,h=u(r);return f=65535,{chars1:h,chars2:u(l),lineArray:s}},n.prototype.diff_charsToLines_=function(r,l){for(var s=0;s<r.length;s++){for(var o=r[s][1],u=[],f=0;f<o.length;f++)u[f]=l[o.charCodeAt(f)];r[s][1]=u.join("")}},n.prototype.diff_commonPrefix=function(r,l){if(!r||!l||r.charAt(0)!=l.charAt(0))return 0;for(var s=0,o=Math.min(r.length,l.length),u=o,f=0;s<u;)r.substring(f,u)==l.substring(f,u)?f=s=u:o=u,u=Math.floor((o-s)/2+s);return u},n.prototype.diff_commonSuffix=function(r,l){if(!r||!l||r.charAt(r.length-1)!=l.charAt(l.length-1))return 0;for(var s=0,o=Math.min(r.length,l.length),u=o,f=0;s<u;)r.substring(r.length-u,r.length-f)==l.substring(l.length-u,l.length-f)?f=s=u:o=u,u=Math.floor((o-s)/2+s);return u},n.prototype.diff_commonOverlap_=function(r,l){var s=r.length,o=l.length;if(s==0||o==0)return 0;s>o?r=r.substring(s-o):s<o&&(l=l.substring(0,s));var u=Math.min(s,o);if(r==l)return u;for(var f=0,h=1;;){var p=r.substring(u-h),g=l.indexOf(p);if(g==-1)return f;h+=g,g!=0&&r.substring(u-h)!=l.substring(0,h)||(f=h,h++)}},n.prototype.diff_halfMatch_=function(r,l){if(this.Diff_Timeout<=0)return null;var s=r.length>l.length?r:l,o=r.length>l.length?l:r;if(s.length<4||2*o.length<s.length)return null;var u=this;function f(E,N,T){for(var R,j,$,B,_=E.substring(T,T+Math.floor(E.length/4)),D=-1,F="";(D=N.indexOf(_,D+1))!=-1;){var Y=u.diff_commonPrefix(E.substring(T),N.substring(D)),L=u.diff_commonSuffix(E.substring(0,T),N.substring(0,D));F.length<L+Y&&(F=N.substring(D-L,D)+N.substring(D,D+Y),R=E.substring(0,T-L),j=E.substring(T+Y),$=N.substring(0,D-L),B=N.substring(D+Y))}return 2*F.length>=E.length?[R,j,$,B,F]:null}var h,p,g,x,y,v=f(s,o,Math.ceil(s.length/4)),w=f(s,o,Math.ceil(s.length/2));return v||w?(h=w?v&&v[4].length>w[4].length?v:w:v,r.length>l.length?(p=h[0],g=h[1],x=h[2],y=h[3]):(x=h[0],y=h[1],p=h[2],g=h[3]),[p,g,x,y,h[4]]):null},n.prototype.diff_cleanupSemantic=function(r){for(var l=!1,s=[],o=0,u=null,f=0,h=0,p=0,g=0,x=0;f<r.length;)r[f][0]==0?(s[o++]=f,h=g,p=x,g=0,x=0,u=r[f][1]):(r[f][0]==1?g+=r[f][1].length:x+=r[f][1].length,u&&u.length<=Math.max(h,p)&&u.length<=Math.max(g,x)&&(r.splice(s[o-1],0,new n.Diff(-1,u)),r[s[o-1]+1][0]=1,o--,f=--o>0?s[o-1]:-1,h=0,p=0,g=0,x=0,u=null,l=!0)),f++;for(l&&this.diff_cleanupMerge(r),this.diff_cleanupSemanticLossless(r),f=1;f<r.length;){if(r[f-1][0]==-1&&r[f][0]==1){var y=r[f-1][1],v=r[f][1],w=this.diff_commonOverlap_(y,v),E=this.diff_commonOverlap_(v,y);w>=E?(w>=y.length/2||w>=v.length/2)&&(r.splice(f,0,new n.Diff(0,v.substring(0,w))),r[f-1][1]=y.substring(0,y.length-w),r[f+1][1]=v.substring(w),f++):(E>=y.length/2||E>=v.length/2)&&(r.splice(f,0,new n.Diff(0,y.substring(0,E))),r[f-1][0]=1,r[f-1][1]=v.substring(0,v.length-E),r[f+1][0]=-1,r[f+1][1]=y.substring(E),f++),f++}f++}},n.prototype.diff_cleanupSemanticLossless=function(r){function l(E,N){if(!E||!N)return 6;var T=E.charAt(E.length-1),R=N.charAt(0),j=T.match(n.nonAlphaNumericRegex_),$=R.match(n.nonAlphaNumericRegex_),B=j&&T.match(n.whitespaceRegex_),_=$&&R.match(n.whitespaceRegex_),D=B&&T.match(n.linebreakRegex_),F=_&&R.match(n.linebreakRegex_),Y=D&&E.match(n.blanklineEndRegex_),L=F&&N.match(n.blanklineStartRegex_);return Y||L?5:D||F?4:j&&!B&&_?3:B||_?2:j||$?1:0}for(var s=1;s<r.length-1;){if(r[s-1][0]==0&&r[s+1][0]==0){var o=r[s-1][1],u=r[s][1],f=r[s+1][1],h=this.diff_commonSuffix(o,u);if(h){var p=u.substring(u.length-h);o=o.substring(0,o.length-h),u=p+u.substring(0,u.length-h),f=p+f}for(var g=o,x=u,y=f,v=l(o,u)+l(u,f);u.charAt(0)===f.charAt(0);){o+=u.charAt(0),u=u.substring(1)+f.charAt(0),f=f.substring(1);var w=l(o,u)+l(u,f);w>=v&&(v=w,g=o,x=u,y=f)}r[s-1][1]!=g&&(g?r[s-1][1]=g:(r.splice(s-1,1),s--),r[s][1]=x,y?r[s+1][1]=y:(r.splice(s+1,1),s--))}s++}},n.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,n.whitespaceRegex_=/\s/,n.linebreakRegex_=/[\r\n]/,n.blanklineEndRegex_=/\n\r?\n$/,n.blanklineStartRegex_=/^\r?\n\r?\n/,n.prototype.diff_cleanupEfficiency=function(r){for(var l=!1,s=[],o=0,u=null,f=0,h=!1,p=!1,g=!1,x=!1;f<r.length;)r[f][0]==0?(r[f][1].length<this.Diff_EditCost&&(g||x)?(s[o++]=f,h=g,p=x,u=r[f][1]):(o=0,u=null),g=x=!1):(r[f][0]==-1?x=!0:g=!0,u&&(h&&p&&g&&x||u.length<this.Diff_EditCost/2&&h+p+g+x==3)&&(r.splice(s[o-1],0,new n.Diff(-1,u)),r[s[o-1]+1][0]=1,o--,u=null,h&&p?(g=x=!0,o=0):(f=--o>0?s[o-1]:-1,g=x=!1),l=!0)),f++;l&&this.diff_cleanupMerge(r)},n.prototype.diff_cleanupMerge=function(r){r.push(new n.Diff(0,""));for(var l,s=0,o=0,u=0,f="",h="";s<r.length;)switch(r[s][0]){case 1:u++,h+=r[s][1],s++;break;case-1:o++,f+=r[s][1],s++;break;case 0:o+u>1?(o!==0&&u!==0&&((l=this.diff_commonPrefix(h,f))!==0&&(s-o-u>0&&r[s-o-u-1][0]==0?r[s-o-u-1][1]+=h.substring(0,l):(r.splice(0,0,new n.Diff(0,h.substring(0,l))),s++),h=h.substring(l),f=f.substring(l)),(l=this.diff_commonSuffix(h,f))!==0&&(r[s][1]=h.substring(h.length-l)+r[s][1],h=h.substring(0,h.length-l),f=f.substring(0,f.length-l))),s-=o+u,r.splice(s,o+u),f.length&&(r.splice(s,0,new n.Diff(-1,f)),s++),h.length&&(r.splice(s,0,new n.Diff(1,h)),s++),s++):s!==0&&r[s-1][0]==0?(r[s-1][1]+=r[s][1],r.splice(s,1)):s++,u=0,o=0,f="",h=""}r[r.length-1][1]===""&&r.pop();var p=!1;for(s=1;s<r.length-1;)r[s-1][0]==0&&r[s+1][0]==0&&(r[s][1].substring(r[s][1].length-r[s-1][1].length)==r[s-1][1]?(r[s][1]=r[s-1][1]+r[s][1].substring(0,r[s][1].length-r[s-1][1].length),r[s+1][1]=r[s-1][1]+r[s+1][1],r.splice(s-1,1),p=!0):r[s][1].substring(0,r[s+1][1].length)==r[s+1][1]&&(r[s-1][1]+=r[s+1][1],r[s][1]=r[s][1].substring(r[s+1][1].length)+r[s+1][1],r.splice(s+1,1),p=!0)),s++;p&&this.diff_cleanupMerge(r)},n.prototype.diff_xIndex=function(r,l){var s,o=0,u=0,f=0,h=0;for(s=0;s<r.length&&(r[s][0]!==1&&(o+=r[s][1].length),r[s][0]!==-1&&(u+=r[s][1].length),!(o>l));s++)f=o,h=u;return r.length!=s&&r[s][0]===-1?h:h+(l-f)},n.prototype.diff_prettyHtml=function(r){for(var l=[],s=/&/g,o=/</g,u=/>/g,f=/\n/g,h=0;h<r.length;h++){var p=r[h][0],g=r[h][1].replace(s,"&").replace(o,"<").replace(u,">").replace(f,"¶<br>");switch(p){case 1:l[h]='<ins style="background:#e6ffe6;">'+g+"</ins>";break;case-1:l[h]='<del style="background:#ffe6e6;">'+g+"</del>";break;case 0:l[h]="<span>"+g+"</span>"}}return l.join("")},n.prototype.diff_text1=function(r){for(var l=[],s=0;s<r.length;s++)r[s][0]!==1&&(l[s]=r[s][1]);return l.join("")},n.prototype.diff_text2=function(r){for(var l=[],s=0;s<r.length;s++)r[s][0]!==-1&&(l[s]=r[s][1]);return l.join("")},n.prototype.diff_levenshtein=function(r){for(var l=0,s=0,o=0,u=0;u<r.length;u++){var f=r[u][0],h=r[u][1];switch(f){case 1:s+=h.length;break;case-1:o+=h.length;break;case 0:l+=Math.max(s,o),s=0,o=0}}return l+=Math.max(s,o)},n.prototype.diff_toDelta=function(r){for(var l=[],s=0;s<r.length;s++)switch(r[s][0]){case 1:l[s]="+"+encodeURI(r[s][1]);break;case-1:l[s]="-"+r[s][1].length;break;case 0:l[s]="="+r[s][1].length}return l.join(" ").replace(/%20/g," ")},n.prototype.diff_fromDelta=function(r,l){for(var s=[],o=0,u=0,f=l.split(/\t/g),h=0;h<f.length;h++){var p=f[h].substring(1);switch(f[h].charAt(0)){case"+":try{s[o++]=new n.Diff(1,decodeURI(p))}catch{throw new Error("Illegal escape in diff_fromDelta: "+p)}break;case"-":case"=":var g=parseInt(p,10);if(isNaN(g)||g<0)throw new Error("Invalid number in diff_fromDelta: "+p);var x=r.substring(u,u+=g);f[h].charAt(0)=="="?s[o++]=new n.Diff(0,x):s[o++]=new n.Diff(-1,x);break;default:if(f[h])throw new Error("Invalid diff operation in diff_fromDelta: "+f[h])}}if(u!=r.length)throw new Error("Delta length ("+u+") does not equal source text length ("+r.length+").");return s},n.prototype.match_main=function(r,l,s){if(r==null||l==null||s==null)throw new Error("Null input. (match_main)");return s=Math.max(0,Math.min(s,r.length)),r==l?0:r.length?r.substring(s,s+l.length)==l?s:this.match_bitap_(r,l,s):-1},n.prototype.match_bitap_=function(r,l,s){if(l.length>this.Match_MaxBits)throw new Error("Pattern too long for this browser.");var o=this.match_alphabet_(l),u=this;function f(_,D){var F=_/l.length,Y=Math.abs(s-D);return u.Match_Distance?F+Y/u.Match_Distance:Y?1:F}var h=this.Match_Threshold,p=r.indexOf(l,s);p!=-1&&(h=Math.min(f(0,p),h),(p=r.lastIndexOf(l,s+l.length))!=-1&&(h=Math.min(f(0,p),h)));var g,x,y=1<<l.length-1;p=-1;for(var v,w=l.length+r.length,E=0;E<l.length;E++){for(g=0,x=w;g<x;)f(E,s+x)<=h?g=x:w=x,x=Math.floor((w-g)/2+g);w=x;var N=Math.max(1,s-x+1),T=Math.min(s+x,r.length)+l.length,R=Array(T+2);R[T+1]=(1<<E)-1;for(var j=T;j>=N;j--){var $=o[r.charAt(j-1)];if(R[j]=E===0?(R[j+1]<<1|1)&$:(R[j+1]<<1|1)&$|(v[j+1]|v[j])<<1|1|v[j+1],R[j]&y){var B=f(E,j-1);if(B<=h){if(h=B,!((p=j-1)>s))break;N=Math.max(1,2*s-p)}}}if(f(E+1,s)>h)break;v=R}return p},n.prototype.match_alphabet_=function(r){for(var l={},s=0;s<r.length;s++)l[r.charAt(s)]=0;for(s=0;s<r.length;s++)l[r.charAt(s)]|=1<<r.length-s-1;return l},n.prototype.patch_addContext_=function(r,l){if(l.length!=0){if(r.start2===null)throw Error("patch not initialized");for(var s=l.substring(r.start2,r.start2+r.length1),o=0;l.indexOf(s)!=l.lastIndexOf(s)&&s.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin;)o+=this.Patch_Margin,s=l.substring(r.start2-o,r.start2+r.length1+o);o+=this.Patch_Margin;var u=l.substring(r.start2-o,r.start2);u&&r.diffs.unshift(new n.Diff(0,u));var f=l.substring(r.start2+r.length1,r.start2+r.length1+o);f&&r.diffs.push(new n.Diff(0,f)),r.start1-=u.length,r.start2-=u.length,r.length1+=u.length+f.length,r.length2+=u.length+f.length}},n.prototype.patch_make=function(r,l,s){var o,u;if(typeof r=="string"&&typeof l=="string"&&s===void 0)o=r,(u=this.diff_main(o,l,!0)).length>2&&(this.diff_cleanupSemantic(u),this.diff_cleanupEfficiency(u));else if(r&&typeof r=="object"&&l===void 0&&s===void 0)u=r,o=this.diff_text1(u);else if(typeof r=="string"&&l&&typeof l=="object"&&s===void 0)o=r,u=l;else{if(typeof r!="string"||typeof l!="string"||!s||typeof s!="object")throw new Error("Unknown call format to patch_make.");o=r,u=s}if(u.length===0)return[];for(var f=[],h=new n.patch_obj,p=0,g=0,x=0,y=o,v=o,w=0;w<u.length;w++){var E=u[w][0],N=u[w][1];switch(p||E===0||(h.start1=g,h.start2=x),E){case 1:h.diffs[p++]=u[w],h.length2+=N.length,v=v.substring(0,x)+N+v.substring(x);break;case-1:h.length1+=N.length,h.diffs[p++]=u[w],v=v.substring(0,x)+v.substring(x+N.length);break;case 0:N.length<=2*this.Patch_Margin&&p&&u.length!=w+1?(h.diffs[p++]=u[w],h.length1+=N.length,h.length2+=N.length):N.length>=2*this.Patch_Margin&&p&&(this.patch_addContext_(h,y),f.push(h),h=new n.patch_obj,p=0,y=v,g=x)}E!==1&&(g+=N.length),E!==-1&&(x+=N.length)}return p&&(this.patch_addContext_(h,y),f.push(h)),f},n.prototype.patch_deepCopy=function(r){for(var l=[],s=0;s<r.length;s++){var o=r[s],u=new n.patch_obj;u.diffs=[];for(var f=0;f<o.diffs.length;f++)u.diffs[f]=new n.Diff(o.diffs[f][0],o.diffs[f][1]);u.start1=o.start1,u.start2=o.start2,u.length1=o.length1,u.length2=o.length2,l[s]=u}return l},n.prototype.patch_apply=function(r,l){if(r.length==0)return[l,[]];r=this.patch_deepCopy(r);var s=this.patch_addPadding(r);l=s+l+s,this.patch_splitMax(r);for(var o=0,u=[],f=0;f<r.length;f++){var h,p,g=r[f].start2+o,x=this.diff_text1(r[f].diffs),y=-1;if(x.length>this.Match_MaxBits?(h=this.match_main(l,x.substring(0,this.Match_MaxBits),g))!=-1&&((y=this.match_main(l,x.substring(x.length-this.Match_MaxBits),g+x.length-this.Match_MaxBits))==-1||h>=y)&&(h=-1):h=this.match_main(l,x,g),h==-1)u[f]=!1,o-=r[f].length2-r[f].length1;else if(u[f]=!0,o=h-g,x==(p=y==-1?l.substring(h,h+x.length):l.substring(h,y+this.Match_MaxBits)))l=l.substring(0,h)+this.diff_text2(r[f].diffs)+l.substring(h+x.length);else{var v=this.diff_main(x,p,!1);if(x.length>this.Match_MaxBits&&this.diff_levenshtein(v)/x.length>this.Patch_DeleteThreshold)u[f]=!1;else{this.diff_cleanupSemanticLossless(v);for(var w,E=0,N=0;N<r[f].diffs.length;N++){var T=r[f].diffs[N];T[0]!==0&&(w=this.diff_xIndex(v,E)),T[0]===1?l=l.substring(0,h+w)+T[1]+l.substring(h+w):T[0]===-1&&(l=l.substring(0,h+w)+l.substring(h+this.diff_xIndex(v,E+T[1].length))),T[0]!==-1&&(E+=T[1].length)}}}}return[l=l.substring(s.length,l.length-s.length),u]},n.prototype.patch_addPadding=function(r){for(var l=this.Patch_Margin,s="",o=1;o<=l;o++)s+=String.fromCharCode(o);for(o=0;o<r.length;o++)r[o].start1+=l,r[o].start2+=l;var u=r[0],f=u.diffs;if(f.length==0||f[0][0]!=0)f.unshift(new n.Diff(0,s)),u.start1-=l,u.start2-=l,u.length1+=l,u.length2+=l;else if(l>f[0][1].length){var h=l-f[0][1].length;f[0][1]=s.substring(f[0][1].length)+f[0][1],u.start1-=h,u.start2-=h,u.length1+=h,u.length2+=h}return(f=(u=r[r.length-1]).diffs).length==0||f[f.length-1][0]!=0?(f.push(new n.Diff(0,s)),u.length1+=l,u.length2+=l):l>f[f.length-1][1].length&&(h=l-f[f.length-1][1].length,f[f.length-1][1]+=s.substring(0,h),u.length1+=h,u.length2+=h),s},n.prototype.patch_splitMax=function(r){for(var l=this.Match_MaxBits,s=0;s<r.length;s++)if(!(r[s].length1<=l)){var o=r[s];r.splice(s--,1);for(var u=o.start1,f=o.start2,h="";o.diffs.length!==0;){var p=new n.patch_obj,g=!0;for(p.start1=u-h.length,p.start2=f-h.length,h!==""&&(p.length1=p.length2=h.length,p.diffs.push(new n.Diff(0,h)));o.diffs.length!==0&&p.length1<l-this.Patch_Margin;){var x=o.diffs[0][0],y=o.diffs[0][1];x===1?(p.length2+=y.length,f+=y.length,p.diffs.push(o.diffs.shift()),g=!1):x===-1&&p.diffs.length==1&&p.diffs[0][0]==0&&y.length>2*l?(p.length1+=y.length,u+=y.length,g=!1,p.diffs.push(new n.Diff(x,y)),o.diffs.shift()):(y=y.substring(0,l-p.length1-this.Patch_Margin),p.length1+=y.length,u+=y.length,x===0?(p.length2+=y.length,f+=y.length):g=!1,p.diffs.push(new n.Diff(x,y)),y==o.diffs[0][1]?o.diffs.shift():o.diffs[0][1]=o.diffs[0][1].substring(y.length))}h=(h=this.diff_text2(p.diffs)).substring(h.length-this.Patch_Margin);var v=this.diff_text1(o.diffs).substring(0,this.Patch_Margin);v!==""&&(p.length1+=v.length,p.length2+=v.length,p.diffs.length!==0&&p.diffs[p.diffs.length-1][0]===0?p.diffs[p.diffs.length-1][1]+=v:p.diffs.push(new n.Diff(0,v))),g||r.splice(++s,0,p)}}},n.prototype.patch_toText=function(r){for(var l=[],s=0;s<r.length;s++)l[s]=r[s];return l.join("")},n.prototype.patch_fromText=function(r){var l=[];if(!r)return l;for(var s=r.split(`
|
|
118
|
+
`),o=0,u=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;o<s.length;){var f=s[o].match(u);if(!f)throw new Error("Invalid patch string: "+s[o]);var h=new n.patch_obj;for(l.push(h),h.start1=parseInt(f[1],10),f[2]===""?(h.start1--,h.length1=1):f[2]=="0"?h.length1=0:(h.start1--,h.length1=parseInt(f[2],10)),h.start2=parseInt(f[3],10),f[4]===""?(h.start2--,h.length2=1):f[4]=="0"?h.length2=0:(h.start2--,h.length2=parseInt(f[4],10)),o++;o<s.length;){var p=s[o].charAt(0);try{var g=decodeURI(s[o].substring(1))}catch{throw new Error("Illegal escape in patch_fromText: "+g)}if(p=="-")h.diffs.push(new n.Diff(-1,g));else if(p=="+")h.diffs.push(new n.Diff(1,g));else if(p==" ")h.diffs.push(new n.Diff(0,g));else{if(p=="@")break;if(p!=="")throw new Error('Invalid patch mode "'+p+'" in: '+g)}o++}}return l},(n.patch_obj=function(){this.diffs=[],this.start1=null,this.start2=null,this.length1=0,this.length2=0}).prototype.toString=function(){for(var r,l=["@@ -"+(this.length1===0?this.start1+",0":this.length1==1?this.start1+1:this.start1+1+","+this.length1)+" +"+(this.length2===0?this.start2+",0":this.length2==1?this.start2+1:this.start2+1+","+this.length2)+` @@
|
|
119
|
+
`],s=0;s<this.diffs.length;s++){switch(this.diffs[s][0]){case 1:r="+";break;case-1:r="-";break;case 0:r=" "}l[s+1]=r+encodeURI(this.diffs[s][1])+`
|
|
120
|
+
`}return l.join("").replace(/%20/g," ")},e.exports=n,e.exports.diff_match_patch=n,e.exports.DIFF_DELETE=-1,e.exports.DIFF_INSERT=1,e.exports.DIFF_EQUAL=0}));ym.DIFF_EQUAL;ym.DIFF_DELETE;ym.DIFF_INSERT;function W6(e){return e.map(n=>{const r=n.lines.map(l=>l.type==="add"?{type:"insert",isInsert:!0,lineNumber:l.newLineNo??0,content:l.content}:l.type==="delete"?{type:"delete",isDelete:!0,lineNumber:l.oldLineNo??0,content:l.content}:{type:"normal",isNormal:!0,oldLineNumber:l.oldLineNo??0,newLineNumber:l.newLineNo??0,content:l.content});return{content:n.header,oldStart:n.oldStart,oldLines:n.oldLines,newStart:n.newStart,newLines:n.newLines,changes:r}})}function u0({hunks:e}){if(e.length===0)return null;const n=W6(e);return d.jsx("div",{className:"diff-hunk-view text-xs font-mono overflow-x-auto",children:d.jsx(Q6,{viewType:"unified",diffType:"modify",hunks:n,children:r=>r.map((l,s)=>d.jsx(Mw,{hunk:l},`${l.oldStart}:${l.newStart}:${s}`))})})}const J6=300;function eL({file:e,isActive:n,onDiscard:r,onScrollRef:l}){const s=e.additions+e.deletions,o=s>J6,[u,f]=k.useState(!o),[h,p]=k.useState(!1),g=e.status==="renamed"&&e.oldPath?`${e.oldPath} → ${e.path}`:e.path,x=()=>{navigator.clipboard.writeText(e.path)},y=()=>{if(!h){p(!0),setTimeout(()=>p(!1),3e3);return}r(e.path,e.status),p(!1)};return d.jsxs("div",{ref:l,className:`border rounded-lg overflow-hidden ${n?"border-primary-6":"border-neutral-9"}`,children:[d.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 bg-neutral-9 cursor-pointer select-none",onClick:()=>f(!u),children:[u?d.jsx(jr,{size:14,className:"text-neutral-5 shrink-0"}):d.jsx(Ea,{size:14,className:"text-neutral-5 shrink-0"}),d.jsx("span",{className:"font-mono text-xs text-neutral-2 truncate flex-1",title:g,children:g}),!e.isBinary&&d.jsxs("span",{className:"text-xs whitespace-nowrap",children:[e.additions>0&&d.jsxs("span",{className:"text-success-5",children:["+",e.additions]}),e.additions>0&&e.deletions>0&&d.jsx("span",{className:"text-neutral-5 mx-0.5",children:" "}),e.deletions>0&&d.jsxs("span",{className:"text-error-5",children:["−",e.deletions]})]}),e.isBinary&&d.jsx("span",{className:"text-xs text-neutral-5 italic",children:"binary"}),d.jsxs("div",{className:"flex items-center gap-1 ml-1",onClick:v=>v.stopPropagation(),children:[d.jsx("button",{className:"p-1 rounded hover:bg-neutral-8 text-neutral-4 hover:text-neutral-2",onClick:x,title:"Copy path",children:d.jsx(X0,{size:13})}),d.jsx("button",{className:`p-1 rounded hover:bg-error-950/50 ${h?"text-error-5":"text-neutral-4 hover:text-error-5"}`,onClick:y,title:h?"Click again to confirm":"Discard file changes",children:d.jsx(kc,{size:13})})]})]}),u&&d.jsx("div",{className:"border-t border-neutral-9",children:e.isBinary?d.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 text-neutral-5 text-xs italic",children:[d.jsx(qN,{size:14}),"Binary file"]}):o&&e.hunks.length>0?d.jsx("div",{className:"px-4 py-3",children:d.jsx(u0,{hunks:e.hunks})}):e.hunks.length>0?d.jsx("div",{className:"px-0",children:d.jsx(u0,{hunks:e.hunks})}):d.jsx("div",{className:"px-4 py-3 text-neutral-5 text-xs italic",children:"No changes"})}),!u&&o&&d.jsxs("div",{className:"border-t border-neutral-9 px-4 py-2 text-xs text-neutral-5 italic cursor-pointer hover:text-neutral-3",onClick:()=>f(!0),children:["Large diff (",s," lines) — click to expand"]})]})}const Dh=280,zh=1200,tL=400,c0="codekin-diff-panel-width";function nL({isOpen:e,onClose:n,send:r,onHandleMessage:l,onHandleToolDone:s}){const[o,u]=k.useState(()=>{const j=localStorage.getItem(c0);return j?Math.max(Dh,Math.min(zh,Number(j))):tL}),f=S4({send:r,isOpen:e}),h=k.useRef(new Map),[p,g]=k.useState(null),x=k.useRef(!1),y=k.useRef(0),v=k.useRef(0);k.useEffect(()=>{l(f.handleMessage)},[f.handleMessage,l]),k.useEffect(()=>{s(f.handleToolDone)},[f.handleToolDone,s]),k.useEffect(()=>{localStorage.setItem(c0,String(o))},[o]);const w=k.useCallback(j=>{j.preventDefault(),x.current=!0,y.current=j.clientX,v.current=o;const $=_=>{if(!x.current)return;const D=y.current-_.clientX;u(Math.max(Dh,Math.min(zh,v.current+D)))},B=()=>{x.current=!1,document.body.style.cursor="",document.removeEventListener("mousemove",$),document.removeEventListener("mouseup",B)};document.body.style.cursor="col-resize",document.addEventListener("mousemove",$),document.addEventListener("mouseup",B)},[o]),E=k.useCallback(j=>{g(j);const $=h.current.get(j);$&&$.scrollIntoView({behavior:"smooth",block:"nearest"})},[]),N=k.useCallback((j,$)=>{f.discard([j],{[j]:$})},[f]),T=k.useCallback(()=>{f.discard()},[f]);if(k.useEffect(()=>{if(!e)return;const j=$=>{$.key==="Escape"&&n()};return document.addEventListener("keydown",j),()=>document.removeEventListener("keydown",j)},[e,n]),!e)return null;const R=f.files.some(j=>j.status==="added");return d.jsxs("div",{className:"relative flex flex-col h-full bg-neutral-12 border-l border-neutral-9 overflow-hidden transition-[width] duration-150",style:{width:o,minWidth:Dh,maxWidth:zh},children:[d.jsx("div",{className:"absolute left-0 top-0 bottom-0 w-1 cursor-col-resize hover:bg-primary-6/40 z-20",onMouseDown:w}),d.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-neutral-9 shrink-0",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[f.summary.filesChanged>0&&d.jsx("span",{className:"w-2 h-2 rounded-full bg-success-5"}),d.jsx("span",{className:"text-sm font-medium text-neutral-2",children:"Changes"})]}),d.jsx("button",{className:"p-1 rounded hover:bg-neutral-9 text-neutral-4 hover:text-neutral-2",onClick:n,title:"Close diff panel",children:d.jsx(ta,{size:14})})]}),d.jsx(E4,{branch:f.branch,scope:f.scope,summary:f.summary,loading:f.loading,hasUntrackedFiles:R,onScopeChange:f.changeScope,onRefresh:f.refresh,onDiscardAll:T}),f.error&&d.jsx("div",{className:"px-3 py-2 text-xs text-error-5 bg-error-950/20",children:f.error}),d.jsxs("div",{className:"flex-1 overflow-y-auto min-h-0",children:[f.files.length>0&&d.jsx("div",{className:"border-b border-neutral-9",children:d.jsx(_4,{files:f.files,activeFile:p,onSelectFile:E})}),d.jsxs("div",{className:"px-2 py-2 flex flex-col gap-2",children:[f.files.length===0&&!f.loading&&!f.error&&d.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-neutral-6",children:[d.jsx(PN,{size:32,className:"mb-2 opacity-50"}),d.jsx("span",{className:"text-xs",children:"No changes detected"})]}),f.summary.truncated&&d.jsx("div",{className:"px-3 py-2 text-xs text-warning-5 bg-warning-950/20 rounded",children:"Diff truncated — showing partial results"}),f.files.map(j=>d.jsx(eL,{file:j,isActive:j.path===p,onDiscard:N,onScrollRef:$=>{$?h.current.set(j.path,$):h.current.delete(j.path)}},j.path))]})]})]})}function Lh({label:e,value:n,icon:r}){return d.jsxs("div",{className:"flex items-center gap-2.5 rounded-lg bg-neutral-11 px-3 py-2 min-w-[120px]",children:[d.jsx("div",{className:"text-neutral-5",children:r}),d.jsxs("div",{children:[d.jsx("div",{className:"text-[18px] font-semibold text-neutral-2 leading-tight",children:n}),d.jsx("div",{className:"text-[12px] text-neutral-5 leading-tight",children:e})]})]})}function rL({token:e,onOrchestratorSessionReady:n,sessionJoined:r,agentName:l}){const[s,o]=k.useState("loading"),[u,f]=k.useState(null),[h,p]=k.useState(null),[g,x]=k.useState("Joe"),y=l??g,v=k.useCallback(async()=>{if(e)try{const w=await fetch("/cc/api/orchestrator/dashboard",{headers:{Authorization:`Bearer ${e}`}});if(w.ok){const E=await w.json();p(E.stats)}}catch{}},[e]);return k.useEffect(()=>{if(!e)return;let w=!1;async function E(){try{const N=await S2(e);if(w)return;N.agentName&&x(N.agentName),o("active"),n(N.sessionId),v()}catch(N){if(w)return;f(N instanceof Error?N.message:"Failed to start orchestrator"),o("error")}}return E(),()=>{w=!0}},[e]),k.useEffect(()=>{if(s!=="active"||!e)return;const w=setInterval(()=>{v()},3e4);return()=>clearInterval(w)},[s,e,v]),s==="loading"?d.jsx("div",{className:"flex flex-1 items-center justify-center",children:d.jsxs("div",{className:"flex items-center gap-3 text-neutral-4",children:[d.jsx(Cl,{size:20,stroke:2}),d.jsxs("span",{className:"text-[15px]",children:["Starting Agent ",y,"..."]})]})}):s==="error"?d.jsx("div",{className:"flex flex-1 items-center justify-center",children:d.jsxs("div",{className:"text-center",children:[d.jsxs("div",{className:"flex items-center justify-center gap-2 text-error-5 mb-2",children:[d.jsx(Cl,{size:20,stroke:2}),d.jsxs("span",{className:"text-[15px] font-medium",children:["Failed to start Agent ",y]})]}),d.jsx("p",{className:"text-[14px] text-neutral-5",children:u})]})}):r?d.jsxs("div",{className:"flex items-center gap-3 px-4 py-2.5 border-b border-neutral-10 bg-neutral-12",children:[d.jsxs("div",{className:"flex items-center gap-2 text-neutral-2",children:[d.jsx(Cl,{size:18,stroke:2,className:"text-accent-5"}),d.jsxs("span",{className:"text-[15px] font-medium",children:["Agent ",y]})]}),h&&d.jsxs("div",{className:"flex items-center gap-2 ml-auto",children:[h.managedRepos>0&&d.jsx(Lh,{label:"repos",value:h.managedRepos,icon:d.jsx(Xh,{size:15})}),h.pendingNotifications>0&&d.jsx(Lh,{label:"pending",value:h.pendingNotifications,icon:d.jsx(gN,{size:15})}),h.activeChildSessions>0&&d.jsx(Lh,{label:"sessions",value:h.activeChildSessions,icon:d.jsx(Kh,{size:15})})]})]}):null}function Ow({tasks:e}){const[n,r]=k.useState(!1),[l,s]=k.useState(!1),o=k.useRef(0),u=k.useRef(!1),f=k.useRef(0),h=k.useRef(new Map),p=e.filter(x=>x.status==="completed").length,g=e.length>0&&p===e.length;return k.useEffect(()=>{e.length>o.current&&(r(!0),s(!1)),o.current=e.length},[e.length]),k.useEffect(()=>{!g&&e.length>0&&(u.current=!0)},[e,g]),k.useEffect(()=>{if(g){const x=u.current?1e4:0,y=setTimeout(()=>s(!0),x);return()=>clearTimeout(y)}s(!1)},[g]),k.useEffect(()=>{if(p>f.current&&!g){const x=e.find(y=>y.status!=="completed");x&&h.current.get(x.id)?.scrollIntoView({behavior:"smooth",block:"nearest"})}f.current=p},[p,g,e]),e.length===0||l?null:n?d.jsxs("div",{className:"absolute top-14 right-3 z-20 w-64 rounded-lg bg-neutral-9/90 backdrop-blur border border-neutral-8/60 shadow-lg",children:[d.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-neutral-8/40",children:[d.jsxs("span",{className:"text-[13px] font-semibold text-neutral-1 uppercase tracking-wider flex items-center gap-1.5",children:[!g&&d.jsx("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-primary-5 animate-pulse"}),"Tasks",d.jsxs("span",{className:`text-[13px] font-medium ml-1 ${g?"text-success-5":"text-neutral-5"}`,children:[p,"/",e.length]})]}),d.jsxs("div",{className:"flex items-center gap-0.5",children:[d.jsx("button",{onClick:()=>r(!1),className:"rounded p-0.5 text-neutral-4 hover:text-neutral-2 hover:bg-neutral-8/60 transition-colors",title:"Collapse",children:d.jsx(AN,{size:14})}),d.jsx("button",{onClick:()=>s(!0),className:"rounded p-0.5 text-neutral-4 hover:text-neutral-2 hover:bg-neutral-8/60 transition-colors",title:"Dismiss",children:d.jsx(ta,{size:14})})]})]}),d.jsx("div",{className:"flex flex-col gap-1 px-3 py-2 max-h-[50vh] overflow-y-auto",children:e.map(x=>d.jsxs("div",{ref:y=>{y?h.current.set(x.id,y):h.current.delete(x.id)},className:"flex items-start gap-2 text-[15px]",children:[x.status==="completed"?d.jsx("span",{className:"flex-shrink-0 text-success-5 text-[13px] mt-[3px]",children:"✓"}):x.status==="in_progress"?d.jsx("span",{className:"inline-block h-2 w-2 mt-[7px] rounded-full bg-primary-5 animate-pulse flex-shrink-0"}):d.jsx("span",{className:"inline-block h-2 w-2 mt-[7px] rounded-full border border-neutral-5 flex-shrink-0"}),d.jsx("span",{className:x.status==="completed"?"text-neutral-4 line-through":"text-neutral-2",children:x.status==="in_progress"&&x.activeForm?x.activeForm:x.subject})]},x.id))})]}):d.jsx("div",{className:"absolute top-14 right-3 z-20",children:d.jsxs("button",{onClick:()=>r(!0),className:"flex items-center gap-1.5 rounded-lg bg-neutral-9/90 backdrop-blur border border-neutral-8/60 px-2.5 py-1.5 shadow-lg hover:bg-neutral-8/90 transition-colors",children:[!g&&d.jsx("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-primary-5 animate-pulse"}),d.jsxs("span",{className:"text-[13px] font-semibold text-neutral-2",children:[p,"/",e.length]}),d.jsx(jr,{size:14,className:"text-neutral-4"})]})})}function Dw({options:e,question:n,multiSelect:r,promptType:l,questions:s,approvePattern:o,onSelect:u,isMobile:f=!1}){const h=l==="permission",p=l==="question",g=f?"px-4 py-2.5 text-[16px] min-h-[34px]":p?"px-4 py-1.5 text-[15px]":"px-3 py-0.5 text-[13px]",[x,y]=k.useState(15),v=s&&s.length>1,[w,E]=k.useState(0),[N,T]=k.useState({}),[R,j]=k.useState(new Set),$=v?s[w]:null,B=$?$.question:n,_=$?$.options:e,D=$?$.multiSelect:r,F=k.useCallback(Z=>{if(!v||!$){u(Z);return}const te={...N,[$.question]:Z};w+1<s.length?(T(te),E(w+1),j(new Set)):u(JSON.stringify(te))},[v,$,N,w,s,u]),Y=k.useRef(F);Y.current=F,k.useEffect(()=>{if(!h||!e.find(z=>z.value==="allow")||!e.some(z=>z.value==="always_allow"))return;let J=15;const G=setInterval(()=>{J--,y(J),J<=0&&(clearInterval(G),Y.current("allow"))},1e3);return()=>clearInterval(G)},[h,e]);const L=k.useCallback(Z=>{const te=Z.join(", ");if(!v||!$){u(Z);return}const J={...N,[$.question]:te};w+1<s.length?(T(J),E(w+1),j(new Set)):u(JSON.stringify(J))},[v,$,N,w,s,u]),X=v?`(${w+1}/${s.length})`:null;if(D){const Z=J=>{j(G=>{const z=new Set(G);return z.has(J)?z.delete(J):z.add(J),z})},te=()=>{L(Array.from(R)),j(new Set)};return d.jsxs("div",{className:`border-t ${p?"px-4 py-3":"px-3 py-2"} ${h?"border-warning-9/50 bg-warning-11/30":"border-neutral-10 bg-neutral-11"}`,children:[B&&d.jsxs("p",{className:`${p?"text-[15px] mb-2":"text-[13px] mb-1.5"} ${h?"text-warning-4":"text-neutral-3"}`,children:[X&&d.jsx("span",{className:"text-neutral-5 mr-1",children:X}),B]}),d.jsxs("div",{className:`flex flex-wrap items-center ${f?"gap-2.5":p?"gap-2":"gap-1.5"}`,children:[_.map(J=>d.jsx("button",{onClick:()=>Z(J.value),title:J.description,className:`rounded-full border ${g} transition-colors ${R.has(J.value)?"border-primary-6 bg-primary-9 text-primary-3":"border-neutral-8 bg-neutral-10 text-neutral-2 hover:border-primary-7 hover:bg-neutral-9 hover:text-neutral-1"}`,children:J.label},J.value)),R.size>0&&d.jsxs("button",{onClick:te,className:`rounded-full border border-primary-7 bg-primary-9 ${g} text-primary-3 hover:bg-primary-8 transition-colors`,children:["Confirm (",R.size,")"]})]})]})}return d.jsxs("div",{className:`border-t ${p?"px-4 py-3":"px-3 py-2"} ${h?"border-warning-9/50 bg-warning-11/30":"border-neutral-10 bg-neutral-11"}`,children:[B&&d.jsxs("p",{className:`${p?"text-[15px] mb-2":"text-[13px] mb-1.5"} ${h?"text-warning-4":"text-neutral-3"}`,children:[X&&d.jsx("span",{className:"text-neutral-5 mr-1",children:X}),B]}),d.jsx("div",{className:`flex flex-wrap items-center ${p?"gap-2":"gap-1.5"}`,children:_.map(Z=>{const te=h&&Z.value==="allow",J=h&&Z.value==="always_allow",G=J?o?`Auto-approve: ${o}`:"Auto-approve this exact command":void 0,z=h&&Z.value==="deny";let V=`rounded-full border ${g} transition-colors `;return te?V+="border-success-7 bg-success-10/50 text-success-4 hover:bg-success-9/50":J?V+="border-primary-7 bg-primary-10/50 text-primary-4 hover:bg-primary-9/50":z?V+="border-error-7 bg-error-10/50 text-error-4 hover:bg-error-9/50":V+="border-neutral-8 bg-neutral-10 text-neutral-2 hover:border-primary-7 hover:bg-neutral-9 hover:text-neutral-1",d.jsxs("button",{onClick:()=>F(Z.value),title:G??Z.description,className:V,children:[Z.label,te&&e.some(ne=>ne.value==="always_allow")&&` (${x}s)`]},Z.value)})})]})}function f0({groups:e,onSelectSkill:n,onClose:r}){const l=k.useRef(null);k.useEffect(()=>{function o(f){l.current&&!l.current.contains(f.target)&&r()}function u(f){f.key==="Escape"&&r()}return document.addEventListener("mousedown",o),document.addEventListener("keydown",u),()=>{document.removeEventListener("mousedown",o),document.removeEventListener("keydown",u)}},[r]);const s=e.filter(o=>o.skills.length>0);return s.length===0?null:d.jsxs("div",{ref:l,className:"absolute bottom-full right-0 mb-1 w-56 rounded-lg border border-neutral-6 bg-neutral-8 py-1 shadow-lg z-50",children:[d.jsx("div",{className:"px-3 py-1.5 text-[13px] font-semibold text-neutral-3 border-b border-neutral-7 mb-1",children:"Claude Skills"}),s.map((o,u)=>d.jsxs("div",{children:[u>0&&d.jsx("div",{className:"my-1 border-t border-neutral-7"}),d.jsx("div",{className:"px-3 py-1 text-[12px] font-medium uppercase tracking-wider text-neutral-5",children:o.label}),o.skills.map(f=>d.jsxs("button",{onClick:()=>n(f.command),className:"flex w-full flex-col px-3 py-1.5 text-left hover:bg-neutral-7 transition-colors",children:[d.jsx("span",{className:"text-[15px] font-medium text-accent-6",children:f.command}),f.description&&d.jsx("span",{className:"text-[13px] text-neutral-4",children:f.description})]},f.id))]},o.label))]})}const aL={skill:{label:"skill",className:"bg-accent-9/30 text-accent-5"},bundled:{label:"built-in",className:"bg-primary-9/30 text-primary-5"},builtin:{label:"command",className:"bg-neutral-8 text-neutral-4"}},lL={skill:"text-accent-6",bundled:"text-primary-5",builtin:"text-neutral-5"};function iL({commands:e,filter:n,onSelect:r,onClose:l}){const s=k.useRef(null),o=k.useRef(null);k.useEffect(()=>{function f(h){s.current&&!s.current.contains(h.target)&&l()}return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[l]);const u=k.useCallback(f=>{const h=e.find(p=>p.command===f);h&&r(h)},[e,r]);return d.jsx("div",{ref:s,className:"absolute bottom-full left-0 mb-1 z-50 w-72",children:d.jsxs(wn,{className:"rounded-lg border border-neutral-10 bg-neutral-11 shadow-2xl",label:"Slash commands",filter:(f,h)=>{const p=h.toLowerCase();return f.toLowerCase().includes(p)?1:0},children:[d.jsx(wn.Input,{value:n,className:"sr-only","aria-hidden":!0,tabIndex:-1,readOnly:!0}),d.jsxs(wn.List,{ref:o,className:"max-h-64 overflow-y-auto p-1",children:[d.jsx(wn.Empty,{className:"px-3 py-4 text-center text-[13px] text-neutral-5",children:"No matching commands."}),e.map(f=>{const h=aL[f.category],p=lL[f.category];return d.jsxs(wn.Item,{value:`${f.command.slice(1)} ${f.name}`,onSelect:()=>u(f.command),className:"flex cursor-pointer items-center gap-2 rounded px-2 py-1.5 text-[14px] text-neutral-3 aria-selected:bg-primary-8/20 aria-selected:text-primary-4",children:[d.jsx("span",{className:`font-mono text-[13px] ${p}`,children:"/"}),d.jsxs("span",{className:"flex-1 truncate",children:[d.jsx("span",{className:"font-medium",children:f.name}),d.jsx("span",{className:"ml-1.5 text-[12px] text-neutral-5",children:f.description})]}),d.jsx("span",{className:`flex-shrink-0 rounded-full px-1.5 py-0.5 text-[10px] font-medium ${h.className}`,children:h.label})]},f.command)})]})]})})}function d0(e){const n=[];for(const r of Array.from(e.items)){const l=r.getAsFile();l&&n.push(l)}if(n.length===0)for(const r of Array.from(e.files))n.push(r);return n}function sL({onUpload:e,disabled:n}){const[r,l]=k.useState(!1),s=k.useRef(0);return k.useEffect(()=>{if(n)return;function o(p){p.preventDefault(),s.current++,s.current===1&&l(!0)}function u(p){p.preventDefault(),s.current--,s.current===0&&l(!1)}function f(p){p.preventDefault()}function h(p){if(p.preventDefault(),s.current=0,l(!1),p.dataTransfer){const g=d0(p.dataTransfer);g.length>0&&e(g)}}return window.addEventListener("dragenter",o),window.addEventListener("dragleave",u),window.addEventListener("dragover",f),window.addEventListener("drop",h),()=>{window.removeEventListener("dragenter",o),window.removeEventListener("dragleave",u),window.removeEventListener("dragover",f),window.removeEventListener("drop",h)}},[e,n]),k.useEffect(()=>{if(n)return;function o(u){if(!u.clipboardData)return;const f=d0(u.clipboardData);f.length>0&&(u.preventDefault(),e(f))}return window.addEventListener("paste",o),()=>window.removeEventListener("paste",o)},[e,n]),!r||n?null:d.jsx("div",{className:"absolute inset-0 z-50 flex items-center justify-center rounded border-2 border-dashed border-primary-7 bg-primary-11/60 backdrop-blur-sm pointer-events-none",children:d.jsxs("div",{className:"text-center",children:[d.jsx(D_,{className:"mx-auto mb-2 text-primary-6",size:40,stroke:1.5}),d.jsx("p",{className:"text-[15px] font-medium text-primary-5",children:"Drop files here"})]})})}const Ku=[{id:"default",label:"Ask permissions",description:"Always ask before making changes",icon:"shield"},{id:"acceptEdits",label:"Auto accept edits",description:"Automatically accept all file edits",icon:"pencil"},{id:"plan",label:"Plan mode",description:"Read-only: proposes changes without applying them",icon:"map"},{id:"bypassPermissions",label:"Bypass permissions",description:"Accepts all permissions without asking",icon:"warning",dangerous:!0}],Ih={shield:J0,pencil:jp,map:n_,warning:iN},wp=[{id:"claude-opus-4-6",label:"Opus 4.6"},{id:"claude-sonnet-4-6",label:"Sonnet 4.6"},{id:"claude-haiku-4-5-20251001",label:"Haiku 4.5"}];function oL(e){return wp.find(n=>n.id===e)?.label??e.replace(/^claude-/,"")}const h0="inputBarHeight",uL=120,p0=60,m0=600,vm=k.forwardRef(function({onSendInput:n,isWaiting:r,disabled:l,onEscape:s,pendingFiles:o,onAddFiles:u,onRemoveFile:f,skillGroups:h,slashCommands:p,initialValue:g="",onValueChange:x,currentModel:y,onModelChange:v,placeholder:w,isMobile:E=!1,showWorktreeToggle:N=!1,useWorktree:T=!1,onWorktreeChange:R,currentPermissionMode:j,onPermissionModeChange:$,onMoveToWorktree:B,worktreePath:_,variant:D="default"},F){const Y=D==="orchestrator",[L,X]=k.useState(g),[Z,te]=k.useState(!1),[J,G]=k.useState(!1),[z,V]=k.useState(!1),[ne,be]=k.useState(!1),[M,O]=k.useState(!1),I=k.useCallback(re=>{re!=="skill"&&te(!1),re!=="model"&&G(!1),re!=="perm"&&V(!1)},[]),[A,oe]=k.useState(""),le=k.useRef(null),he=k.useRef(null),pe=k.useRef(null),Ae=100,Re="orchestratorInputBarHeight",qe=90,[pt,St]=k.useState(()=>{if(E)return Ae;const re=Y?Re:h0,we=Y?qe:uL,$e=localStorage.getItem(re);return $e?Math.max(p0,Math.min(m0,parseInt($e,10))):we}),Ge=k.useRef(null),Et=k.useRef(null),ve=k.useRef(!1),Ee=k.useRef(pt);k.useImperativeHandle(F,()=>({insertText(re){X(re),setTimeout(()=>Ge.current?.focus(),0)}})),k.useEffect(()=>{r&&!ve.current&&!E&&Ge.current?.focus(),ve.current=r},[r,E]),k.useEffect(()=>{if(!ne)return;const re=we=>{le.current&&!le.current.contains(we.target)&&be(!1)};return document.addEventListener("mousedown",re),()=>document.removeEventListener("mousedown",re)},[ne]),k.useEffect(()=>{if(!z)return;const re=we=>{he.current&&!he.current.contains(we.target)&&V(!1)};return document.addEventListener("mousedown",re),()=>document.removeEventListener("mousedown",re)},[z]),k.useEffect(()=>{if(!J)return;const re=we=>{pe.current&&!pe.current.contains(we.target)&&G(!1)};return document.addEventListener("mousedown",re),()=>document.removeEventListener("mousedown",re)},[J]);const mt=k.useCallback(re=>{re.preventDefault();const we=re.clientY,$e=Ee.current,xt=Pt=>{const nt=Math.max(p0,Math.min(m0,$e+(we-Pt.clientY)));Ee.current=nt,St(nt),localStorage.setItem(Y?Re:h0,String(nt))},Mt=()=>{document.removeEventListener("mousemove",xt),document.removeEventListener("mouseup",Mt)};document.addEventListener("mousemove",xt),document.addEventListener("mouseup",Mt)},[Y]),ze=k.useCallback(()=>{!L.trim()&&o.length===0||(O(!1),n(L),X(""),x?.(""))},[L,o,n,x]),gt=k.useCallback(re=>{const we=re.trimStart();if(we.startsWith("/")&&we.indexOf(" ")===-1){oe(we.slice(1)),O(!0);return}O(!1),oe("")},[]),Wt=k.useCallback(re=>{const we=re.target.value;X(we),x?.(we),gt(we)},[x,gt]),Sn=k.useCallback(re=>{const we=re.command+" ";X(we),x?.(we),O(!1),oe(""),setTimeout(()=>Ge.current?.focus(),0)},[x]),Pn=k.useCallback(re=>{if(!re.nativeEvent.isComposing){if(M&&re.key==="Escape"){re.preventDefault(),O(!1);return}re.key==="Enter"&&!re.shiftKey?M||(re.preventDefault(),ze()):re.key==="c"&&re.ctrlKey?(re.preventDefault(),n("")):re.key==="Escape"&&(re.preventDefault(),Ge.current?.blur(),s())}},[M,ze,n,s]),zn=k.useCallback(()=>{Et.current?.click()},[]),kt=k.useCallback(re=>{const we=re.target.files;we&&we.length>0&&u(Array.from(we)),re.target.value=""},[u]),pn=k.useCallback(re=>{re==="bypassPermissions"&&!window.confirm(`Warning: Bypass permissions mode will accept ALL tool calls without asking.
|
|
121
|
+
|
|
122
|
+
This includes file writes, bash commands, and web requests. Only use this if you fully trust the task.
|
|
123
|
+
|
|
124
|
+
Are you sure?`)||($?.(re),V(!1))},[$]),se=!Y&&h&&h.some(re=>re.skills.length>0),ge=!Y&&p&&p.length>0;return d.jsxs("div",{className:`app-input-bar relative flex flex-col border-l bg-neutral-10 ${Y?"orchestrator-input-bar border-t border-neutral-9":"border-t border-neutral-9"}`,style:E?{minHeight:Ae}:{height:pt},children:[d.jsx(sL,{onUpload:u,disabled:l}),M&&ge&&d.jsx(iL,{commands:p,filter:A,onSelect:Sn,onClose:()=>O(!1)}),!E&&d.jsx("div",{className:"h-1 flex-shrink-0 cursor-row-resize hover:bg-primary-7/40 active:bg-primary-7/60 transition-colors",onMouseDown:mt}),o.length>0&&d.jsx("div",{className:"flex flex-wrap gap-1.5 px-3 pt-1.5 flex-shrink-0",children:o.map((re,we)=>d.jsxs("span",{className:"flex items-center gap-1 rounded bg-neutral-7 px-2 py-0.5 text-[13px] text-neutral-2",children:[d.jsx("span",{className:"max-w-[150px] truncate",children:re.name}),d.jsx("button",{onClick:()=>f(we),className:"flex-shrink-0 rounded p-0.5 text-neutral-4 hover:text-neutral-1",children:d.jsx(ta,{size:12,stroke:2})})]},`${re.name}-${we}`))}),d.jsxs("div",{className:"flex flex-1 min-h-0 gap-2 px-3 pt-2 pb-1",children:[r&&d.jsx("span",{className:`mt-1 h-2 w-2 flex-shrink-0 rounded-full animate-pulse ${Y?"bg-accent-5":"bg-primary-5"}`}),d.jsx("textarea",{ref:Ge,value:L,onChange:Wt,onKeyDown:Pn,disabled:l,autoFocus:!0,placeholder:w??(Y?"Ask the orchestrator...":r?"Type response...":"What do you want to build?"),className:`flex-1 min-h-0 resize-none bg-transparent ${E?"text-[16px]":"text-[15px]"} leading-snug text-neutral-1 placeholder:text-neutral-5 outline-none disabled:opacity-50 overflow-y-auto`}),d.jsx("input",{ref:Et,type:"file",multiple:!0,accept:"image/png,image/jpeg,image/gif,image/webp,text/markdown,.md",onChange:kt,className:"hidden"})]}),d.jsxs("div",{className:"flex flex-shrink-0 items-center justify-between px-3 pb-2 pt-0",children:[!E&&!Y&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"flex items-center gap-1",children:[j&&$&&d.jsxs("div",{className:"relative",ref:he,children:[d.jsxs("button",{onClick:()=>{I("perm"),V(!z)},className:`flex items-center gap-1 rounded-md px-2 py-1 text-[12px] font-medium transition-colors ${j==="bypassPermissions"?"text-error-5 hover:text-error-4 hover:bg-error-9/30":"text-neutral-4 hover:text-neutral-2 hover:bg-neutral-7"}`,title:"Permission mode",children:[(()=>{const re=Ku.find($e=>$e.id===j),we=Ih[re?.icon??"shield"];return d.jsx(we,{size:14,stroke:2})})(),d.jsx("span",{className:"hidden lg:inline",children:Ku.find(re=>re.id===j)?.label??j}),d.jsx(jr,{size:12,stroke:2})]}),z&&d.jsx("div",{className:"absolute bottom-full mb-1 left-0 z-50 min-w-[260px] rounded-lg border border-neutral-6 bg-neutral-8 shadow-lg py-1",children:Ku.map(re=>{const we=Ih[re.icon],$e=re.id===j;return d.jsxs("button",{onClick:()=>pn(re.id),className:`w-full text-left px-3 py-2 hover:bg-neutral-7 transition-colors flex items-start gap-2.5 ${re.dangerous?"hover:bg-error-9/20":""}`,children:[d.jsx(we,{size:16,stroke:2,className:`mt-0.5 flex-shrink-0 ${re.dangerous?"text-error-5":$e?"text-primary-4":"text-neutral-4"}`}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("div",{className:`text-[13px] font-medium ${re.dangerous?"text-error-5":$e?"text-primary-4":"text-neutral-2"}`,children:re.label}),d.jsx("div",{className:`text-[12px] ${re.dangerous?"text-error-6":"text-neutral-5"}`,children:re.description})]}),$e&&d.jsx(jl,{size:14,stroke:2.5,className:"mt-0.5 flex-shrink-0 text-primary-4"})]},re.id)})})]}),_?d.jsxs("span",{className:"flex items-center gap-1 rounded-md px-2 py-1 text-[12px] font-medium text-primary-5",title:_,children:[d.jsx(nl,{size:14,stroke:2}),d.jsx("span",{className:"hidden lg:inline max-w-[120px] truncate",children:_.split("/").pop()})]}):N&&R?d.jsxs("button",{onClick:()=>R(!T),className:`flex items-center gap-1 rounded-md px-2 py-1 text-[12px] font-medium transition-colors ${T?"text-primary-5 bg-primary-9/30 hover:bg-primary-9/50":"text-neutral-4 hover:text-neutral-2 hover:bg-neutral-7"}`,title:T?"Worktree enabled — session will use a git worktree":"Enable git worktree for this session",children:[d.jsx(nl,{size:14,stroke:2}),d.jsx("span",{className:"hidden lg:inline",children:"Worktree"})]}):B?d.jsxs("button",{onClick:B,className:"flex items-center gap-1 rounded-md px-2 py-1 text-[12px] font-medium text-neutral-4 hover:text-neutral-2 hover:bg-neutral-7 transition-colors",title:"Move session to a git worktree",children:[d.jsx(nl,{size:14,stroke:2}),d.jsx("span",{className:"hidden lg:inline",children:"Worktree"})]}):null]}),d.jsxs("div",{className:"flex items-center gap-1",children:[y&&v&&d.jsxs("div",{className:"relative",ref:pe,children:[d.jsxs("button",{onClick:()=>{I("model"),G(!J)},className:"flex items-center gap-1 rounded-md px-2 py-1 text-[12px] font-medium text-neutral-4 hover:text-neutral-2 hover:bg-neutral-7 transition-colors",title:"Change model",children:[oL(y),d.jsx(jr,{size:12,stroke:2})]}),J&&d.jsx("div",{className:"absolute bottom-full mb-1 right-0 z-50 min-w-[160px] rounded-lg border border-neutral-6 bg-neutral-8 shadow-lg py-1",children:wp.map(re=>d.jsx("button",{onClick:()=>{v(re.id),G(!1)},className:`w-full text-left px-3 py-1.5 text-[13px] hover:bg-neutral-7 transition-colors ${re.id===y?"text-primary-4":"text-neutral-2"}`,children:re.label},re.id))})]}),se&&d.jsxs("div",{className:"relative",children:[d.jsxs("button",{onClick:()=>{I("skill"),te(!Z)},disabled:l,className:"flex items-center gap-1 rounded-md px-2 py-1 text-[12px] font-medium text-neutral-4 hover:text-neutral-2 hover:bg-neutral-7 transition-colors disabled:opacity-30",title:"Claude Skills",children:[d.jsx(Kh,{size:14,stroke:2}),d.jsx("span",{className:"hidden lg:inline",children:"Skills"}),d.jsx(jr,{size:12,stroke:2})]}),Z&&d.jsx(f0,{groups:h??[],onSelectSkill:re=>{X(re+" "),te(!1),setTimeout(()=>Ge.current?.focus(),0)},onClose:()=>te(!1)})]}),d.jsx("button",{onClick:zn,disabled:l,className:"flex items-center justify-center rounded-md p-1 text-neutral-4 hover:text-neutral-2 hover:bg-neutral-7 transition-colors disabled:opacity-30",title:"Attach files",children:d.jsx(Ou,{size:16,stroke:2})}),d.jsx("button",{onClick:ze,disabled:l||!L.trim()&&o.length===0,className:`flex items-center justify-center rounded-md p-1 transition-colors disabled:opacity-30 ${L.trim()||o.length>0?"bg-primary-8 text-neutral-1 hover:bg-primary-7":"text-neutral-5"}`,title:"Send (Enter)",children:d.jsx(Du,{size:16,stroke:2})})]})]}),!E&&Y&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"flex-1"}),d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("button",{onClick:zn,disabled:l,className:"flex items-center justify-center rounded-full p-1.5 text-neutral-4 hover:text-accent-4 hover:bg-accent-9/30 transition-colors disabled:opacity-30",title:"Attach files",children:d.jsx(Ou,{size:16,stroke:2})}),d.jsx("button",{onClick:ze,disabled:l||!L.trim()&&o.length===0,className:`flex items-center justify-center rounded-full px-3 py-1 transition-colors disabled:opacity-30 ${L.trim()||o.length>0?"bg-accent-7 text-neutral-1 hover:bg-accent-6":"text-neutral-5"}`,title:"Send (Enter)",children:d.jsx(Du,{size:16,stroke:2})})]})]}),E&&!Y&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"flex-1"}),d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsxs("div",{className:"relative",ref:le,children:[d.jsx("button",{onClick:()=>be(!ne),disabled:l,className:"flex items-center justify-center rounded min-w-[34px] min-h-[34px] p-1.5 text-neutral-3 hover:text-neutral-1 hover:bg-neutral-7 transition-colors disabled:opacity-30",title:"More options",children:d.jsx(IN,{size:24,stroke:2})}),ne&&d.jsxs("div",{className:"absolute bottom-full mb-1 right-0 z-50 min-w-[220px] rounded-lg border border-neutral-6 bg-neutral-8 shadow-lg py-1",children:[j&&$&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"px-3 py-1.5 text-[12px] text-neutral-5 uppercase tracking-wider",children:"Permissions"}),Ku.map(re=>{const we=Ih[re.icon],$e=re.id===j;return d.jsxs("button",{onClick:()=>{pn(re.id),be(!1)},className:`w-full text-left px-3 py-2 text-[14px] hover:bg-neutral-7 transition-colors flex items-center gap-2 ${re.dangerous?"hover:bg-error-9/20":""}`,children:[d.jsx(we,{size:16,stroke:2,className:re.dangerous?"text-error-5":$e?"text-primary-4":"text-neutral-4"}),d.jsx("span",{className:re.dangerous?"text-error-5":$e?"text-primary-4":"text-neutral-2",children:re.label}),$e&&d.jsx(jl,{size:14,stroke:2.5,className:"ml-auto text-primary-4"})]},re.id)}),d.jsx("div",{className:"my-1 border-t border-neutral-7"})]}),y&&v&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"px-3 py-1.5 text-[12px] text-neutral-5 uppercase tracking-wider",children:"Model"}),wp.map(re=>d.jsx("button",{onClick:()=>{v(re.id),be(!1)},className:`w-full text-left px-3 py-2 text-[14px] hover:bg-neutral-7 transition-colors ${re.id===y?"text-primary-4":"text-neutral-2"}`,children:re.label},re.id)),d.jsx("div",{className:"my-1 border-t border-neutral-7"})]}),se&&d.jsxs("button",{onClick:()=>{be(!1),te(!Z)},className:"flex items-center gap-2 w-full text-left px-3 py-2 text-[14px] text-neutral-2 hover:bg-neutral-7 transition-colors",children:[d.jsx(Kh,{size:18,stroke:2,className:"text-neutral-4"}),"Skills"]}),d.jsxs("button",{onClick:()=>{be(!1),zn()},className:"flex items-center gap-2 w-full text-left px-3 py-2 text-[14px] text-neutral-2 hover:bg-neutral-7 transition-colors",children:[d.jsx(Ou,{size:18,stroke:2,className:"text-neutral-4"}),"Attach files"]})]}),Z&&d.jsx(f0,{groups:h??[],onSelectSkill:re=>{X(re+" "),te(!1),setTimeout(()=>Ge.current?.focus(),0)},onClose:()=>te(!1)})]}),d.jsx("button",{onClick:ze,disabled:l||!L.trim()&&o.length===0,className:`flex items-center justify-center rounded min-w-[34px] min-h-[34px] p-1.5 transition-colors disabled:opacity-30 ${L.trim()||o.length>0?"bg-primary-8 text-neutral-1 hover:bg-primary-7":"text-neutral-5"}`,title:"Send (Enter)",children:d.jsx(Du,{size:24,stroke:2})})]})]}),E&&Y&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"flex-1"}),d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("button",{onClick:zn,disabled:l,className:"flex items-center justify-center rounded-full min-w-[34px] min-h-[34px] p-1.5 text-neutral-4 hover:text-accent-4 hover:bg-accent-9/30 transition-colors disabled:opacity-30",title:"Attach files",children:d.jsx(Ou,{size:24,stroke:2})}),d.jsx("button",{onClick:ze,disabled:l||!L.trim()&&o.length===0,className:`flex items-center justify-center rounded-full min-w-[34px] min-h-[34px] p-1.5 transition-colors disabled:opacity-30 ${L.trim()||o.length>0?"bg-accent-7 text-neutral-1 hover:bg-accent-6":"text-neutral-5"}`,title:"Send (Enter)",children:d.jsx(Du,{size:24,stroke:2})})]})]})]})]})});function cL({token:e,onOrchestratorSessionReady:n,sessionJoined:r,activeSessionId:l,messages:s,fontSize:o,isMobile:u,planningMode:f,activityLabel:h,tasks:p,activePrompt:g,sendPromptResponse:x,inputBarRef:y,onSendInput:v,pendingFiles:w,onAddFiles:E,onRemoveFile:N,skillGroups:T,slashCommands:R,currentModel:j,onModelChange:$,currentPermissionMode:B,onPermissionModeChange:_,disabled:D,agentName:F}){return d.jsxs(d.Fragment,{children:[d.jsx(rL,{token:e,onOrchestratorSessionReady:n,sessionJoined:r,agentName:F}),l&&d.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden min-h-0",children:[d.jsxs("div",{className:"relative flex-1 min-h-0 flex flex-col",children:[d.jsx(Wp,{messages:s,fontSize:o,disabled:D,planningMode:f,activityLabel:h,isMobile:u,variant:"orchestrator"}),d.jsx(Ow,{tasks:p})]}),g&&d.jsx(Dw,{options:g.options,question:g.question,multiSelect:g.multiSelect,promptType:g.promptType,questions:g.questions,approvePattern:g.approvePattern,onSelect:x,isMobile:u},g.requestId),d.jsx(vm,{variant:"orchestrator",ref:y,onSendInput:v,isWaiting:!!g,disabled:D,onEscape:()=>{},pendingFiles:w,onAddFiles:E,onRemoveFile:N,skillGroups:T,slashCommands:R,placeholder:`Ask Agent ${F??"Joe"} to work on your code...`,initialValue:"",onValueChange:()=>{},currentModel:j,onModelChange:$,isMobile:u,currentPermissionMode:B,onPermissionModeChange:_},`orchestrator-${l}`)]})]})}function km(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var $l=km();function zw(e){$l=e}var Al={exec:()=>null};function ht(e,n=""){let r=typeof e=="string"?e:e.source,l={replace:(s,o)=>{let u=typeof o=="string"?o:o.source;return u=u.replace($n.caret,"$1"),r=r.replace(s,u),l},getRegex:()=>new RegExp(r,n)};return l}var fL=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),$n={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}>`)},dL=/^(?:[ \t]*(?:\n|$))+/,hL=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,pL=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,vo=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,mL=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,wm=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Lw=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Iw=ht(Lw).replace(/bull/g,wm).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),gL=ht(Lw).replace(/bull/g,wm).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Sm=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,xL=/^[^\n]+/,Em=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,bL=ht(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Em).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),yL=ht(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,wm).getRegex(),Uc="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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Nm=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,vL=ht("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Nm).replace("tag",Uc).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Bw=ht(Sm).replace("hr",vo).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Uc).getRegex(),kL=ht(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Bw).getRegex(),_m={blockquote:kL,code:hL,def:bL,fences:pL,heading:mL,hr:vo,html:vL,lheading:Iw,list:yL,newline:dL,paragraph:Bw,table:Al,text:xL},g0=ht("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",vo).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Uc).getRegex(),wL={..._m,lheading:gL,table:g0,paragraph:ht(Sm).replace("hr",vo).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",g0).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Uc).getRegex()},SL={..._m,html:ht(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Nm).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Al,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ht(Sm).replace("hr",vo).replace("heading",` *#{1,6} *[^
|
|
125
|
+
]`).replace("lheading",Iw).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},EL=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,NL=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,$w=/^( {2,}|\\)\n(?!\s*$)/,_L=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Hc=/[\p{P}\p{S}]/u,Tm=/[\s\p{P}\p{S}]/u,Uw=/[^\s\p{P}\p{S}]/u,TL=ht(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Tm).getRegex(),Hw=/(?!~)[\p{P}\p{S}]/u,AL=/(?!~)[\s\p{P}\p{S}]/u,CL=/(?:[^\s\p{P}\p{S}]|~)/u,Pw=/(?![*_])[\p{P}\p{S}]/u,jL=/(?![*_])[\s\p{P}\p{S}]/u,RL=/(?:[^\s\p{P}\p{S}]|[*_])/u,ML=ht(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",fL?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Fw=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,OL=ht(Fw,"u").replace(/punct/g,Hc).getRegex(),DL=ht(Fw,"u").replace(/punct/g,Hw).getRegex(),Gw="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",zL=ht(Gw,"gu").replace(/notPunctSpace/g,Uw).replace(/punctSpace/g,Tm).replace(/punct/g,Hc).getRegex(),LL=ht(Gw,"gu").replace(/notPunctSpace/g,CL).replace(/punctSpace/g,AL).replace(/punct/g,Hw).getRegex(),IL=ht("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Uw).replace(/punctSpace/g,Tm).replace(/punct/g,Hc).getRegex(),BL=ht(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Pw).getRegex(),$L="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",UL=ht($L,"gu").replace(/notPunctSpace/g,RL).replace(/punctSpace/g,jL).replace(/punct/g,Pw).getRegex(),HL=ht(/\\(punct)/,"gu").replace(/punct/g,Hc).getRegex(),PL=ht(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),FL=ht(Nm).replace("(?:-->|$)","-->").getRegex(),GL=ht("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",FL).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),bc=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,qL=ht(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",bc).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),qw=ht(/^!?\[(label)\]\[(ref)\]/).replace("label",bc).replace("ref",Em).getRegex(),Yw=ht(/^!?\[(ref)\](?:\[\])?/).replace("ref",Em).getRegex(),YL=ht("reflink|nolink(?!\\()","g").replace("reflink",qw).replace("nolink",Yw).getRegex(),x0=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Am={_backpedal:Al,anyPunctuation:HL,autolink:PL,blockSkip:ML,br:$w,code:NL,del:Al,delLDelim:Al,delRDelim:Al,emStrongLDelim:OL,emStrongRDelimAst:zL,emStrongRDelimUnd:IL,escape:EL,link:qL,nolink:Yw,punctuation:TL,reflink:qw,reflinkSearch:YL,tag:GL,text:_L,url:Al},VL={...Am,link:ht(/^!?\[(label)\]\((.*?)\)/).replace("label",bc).getRegex(),reflink:ht(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",bc).getRegex()},Sp={...Am,emStrongRDelimAst:LL,emStrongLDelim:DL,delLDelim:BL,delRDelim:UL,url:ht(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",x0).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:ht(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",x0).getRegex()},XL={...Sp,br:ht($w).replace("{2,}","*").getRegex(),text:ht(Sp.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Zu={normal:_m,gfm:wL,pedantic:SL},Us={normal:Am,gfm:Sp,breaks:XL,pedantic:VL},KL={"&":"&","<":"<",">":">",'"':""","'":"'"},b0=e=>KL[e];function Zr(e,n){if(n){if($n.escapeTest.test(e))return e.replace($n.escapeReplace,b0)}else if($n.escapeTestNoEncode.test(e))return e.replace($n.escapeReplaceNoEncode,b0);return e}function y0(e){try{e=encodeURI(e).replace($n.percentDecode,"%")}catch{return null}return e}function v0(e,n){let r=e.replace($n.findPipe,(o,u,f)=>{let h=!1,p=u;for(;--p>=0&&f[p]==="\\";)h=!h;return h?"|":" |"}),l=r.split($n.splitPipe),s=0;if(l[0].trim()||l.shift(),l.length>0&&!l.at(-1)?.trim()&&l.pop(),n)if(l.length>n)l.splice(n);else for(;l.length<n;)l.push("");for(;s<l.length;s++)l[s]=l[s].trim().replace($n.slashPipe,"|");return l}function Hs(e,n,r){let l=e.length;if(l===0)return"";let s=0;for(;s<l&&e.charAt(l-s-1)===n;)s++;return e.slice(0,l-s)}function ZL(e,n){if(e.indexOf(n[1])===-1)return-1;let r=0;for(let l=0;l<e.length;l++)if(e[l]==="\\")l++;else if(e[l]===n[0])r++;else if(e[l]===n[1]&&(r--,r<0))return l;return r>0?-2:-1}function QL(e,n=0){let r=n,l="";for(let s of e)if(s===" "){let o=4-r%4;l+=" ".repeat(o),r+=o}else l+=s,r++;return l}function k0(e,n,r,l,s){let o=n.href,u=n.title||null,f=e[1].replace(s.other.outputLinkReplace,"$1");l.state.inLink=!0;let h={type:e[0].charAt(0)==="!"?"image":"link",raw:r,href:o,title:u,text:f,tokens:l.inlineTokens(f)};return l.state.inLink=!1,h}function WL(e,n,r){let l=e.match(r.other.indentCodeCompensation);if(l===null)return n;let s=l[1];return n.split(`
|
|
126
|
+
`).map(o=>{let u=o.match(r.other.beginningSpace);if(u===null)return o;let[f]=u;return f.length>=s.length?o.slice(s.length):o}).join(`
|
|
127
|
+
`)}var yc=class{options;rules;lexer;constructor(e){this.options=e||$l}space(e){let n=this.rules.block.newline.exec(e);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(e){let n=this.rules.block.code.exec(e);if(n){let r=n[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?r:Hs(r,`
|
|
128
|
+
`)}}}fences(e){let n=this.rules.block.fences.exec(e);if(n){let r=n[0],l=WL(r,n[3]||"",this.rules);return{type:"code",raw:r,lang:n[2]?n[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):n[2],text:l}}}heading(e){let n=this.rules.block.heading.exec(e);if(n){let r=n[2].trim();if(this.rules.other.endingHash.test(r)){let l=Hs(r,"#");(this.options.pedantic||!l||this.rules.other.endingSpaceChar.test(l))&&(r=l.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(e){let n=this.rules.block.hr.exec(e);if(n)return{type:"hr",raw:Hs(n[0],`
|
|
129
|
+
`)}}blockquote(e){let n=this.rules.block.blockquote.exec(e);if(n){let r=Hs(n[0],`
|
|
130
|
+
`).split(`
|
|
131
|
+
`),l="",s="",o=[];for(;r.length>0;){let u=!1,f=[],h;for(h=0;h<r.length;h++)if(this.rules.other.blockquoteStart.test(r[h]))f.push(r[h]),u=!0;else if(!u)f.push(r[h]);else break;r=r.slice(h);let p=f.join(`
|
|
132
|
+
`),g=p.replace(this.rules.other.blockquoteSetextReplace,`
|
|
133
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");l=l?`${l}
|
|
134
|
+
${p}`:p,s=s?`${s}
|
|
135
|
+
${g}`:g;let x=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(g,o,!0),this.lexer.state.top=x,r.length===0)break;let y=o.at(-1);if(y?.type==="code")break;if(y?.type==="blockquote"){let v=y,w=v.raw+`
|
|
136
|
+
`+r.join(`
|
|
137
|
+
`),E=this.blockquote(w);o[o.length-1]=E,l=l.substring(0,l.length-v.raw.length)+E.raw,s=s.substring(0,s.length-v.text.length)+E.text;break}else if(y?.type==="list"){let v=y,w=v.raw+`
|
|
138
|
+
`+r.join(`
|
|
139
|
+
`),E=this.list(w);o[o.length-1]=E,l=l.substring(0,l.length-y.raw.length)+E.raw,s=s.substring(0,s.length-v.raw.length)+E.raw,r=w.substring(o.at(-1).raw.length).split(`
|
|
140
|
+
`);continue}}return{type:"blockquote",raw:l,tokens:o,text:s}}}list(e){let n=this.rules.block.list.exec(e);if(n){let r=n[1].trim(),l=r.length>1,s={type:"list",raw:"",ordered:l,start:l?+r.slice(0,-1):"",loose:!1,items:[]};r=l?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=l?r:"[*+-]");let o=this.rules.other.listItemRegex(r),u=!1;for(;e;){let h=!1,p="",g="";if(!(n=o.exec(e))||this.rules.block.hr.test(e))break;p=n[0],e=e.substring(p.length);let x=QL(n[2].split(`
|
|
141
|
+
`,1)[0],n[1].length),y=e.split(`
|
|
142
|
+
`,1)[0],v=!x.trim(),w=0;if(this.options.pedantic?(w=2,g=x.trimStart()):v?w=n[1].length+1:(w=x.search(this.rules.other.nonSpaceChar),w=w>4?1:w,g=x.slice(w),w+=n[1].length),v&&this.rules.other.blankLine.test(y)&&(p+=y+`
|
|
143
|
+
`,e=e.substring(y.length+1),h=!0),!h){let E=this.rules.other.nextBulletRegex(w),N=this.rules.other.hrRegex(w),T=this.rules.other.fencesBeginRegex(w),R=this.rules.other.headingBeginRegex(w),j=this.rules.other.htmlBeginRegex(w),$=this.rules.other.blockquoteBeginRegex(w);for(;e;){let B=e.split(`
|
|
144
|
+
`,1)[0],_;if(y=B,this.options.pedantic?(y=y.replace(this.rules.other.listReplaceNesting," "),_=y):_=y.replace(this.rules.other.tabCharGlobal," "),T.test(y)||R.test(y)||j.test(y)||$.test(y)||E.test(y)||N.test(y))break;if(_.search(this.rules.other.nonSpaceChar)>=w||!y.trim())g+=`
|
|
145
|
+
`+_.slice(w);else{if(v||x.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||T.test(x)||R.test(x)||N.test(x))break;g+=`
|
|
146
|
+
`+y}v=!y.trim(),p+=B+`
|
|
147
|
+
`,e=e.substring(B.length+1),x=_.slice(w)}}s.loose||(u?s.loose=!0:this.rules.other.doubleBlankLine.test(p)&&(u=!0)),s.items.push({type:"list_item",raw:p,task:!!this.options.gfm&&this.rules.other.listIsTask.test(g),loose:!1,text:g,tokens:[]}),s.raw+=p}let f=s.items.at(-1);if(f)f.raw=f.raw.trimEnd(),f.text=f.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let h of s.items){if(this.lexer.state.top=!1,h.tokens=this.lexer.blockTokens(h.text,[]),h.task){if(h.text=h.text.replace(this.rules.other.listReplaceTask,""),h.tokens[0]?.type==="text"||h.tokens[0]?.type==="paragraph"){h.tokens[0].raw=h.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),h.tokens[0].text=h.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let g=this.lexer.inlineQueue.length-1;g>=0;g--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[g].src)){this.lexer.inlineQueue[g].src=this.lexer.inlineQueue[g].src.replace(this.rules.other.listReplaceTask,"");break}}let p=this.rules.other.listTaskCheckbox.exec(h.raw);if(p){let g={type:"checkbox",raw:p[0]+" ",checked:p[0]!=="[ ]"};h.checked=g.checked,s.loose?h.tokens[0]&&["paragraph","text"].includes(h.tokens[0].type)&&"tokens"in h.tokens[0]&&h.tokens[0].tokens?(h.tokens[0].raw=g.raw+h.tokens[0].raw,h.tokens[0].text=g.raw+h.tokens[0].text,h.tokens[0].tokens.unshift(g)):h.tokens.unshift({type:"paragraph",raw:g.raw,text:g.raw,tokens:[g]}):h.tokens.unshift(g)}}if(!s.loose){let p=h.tokens.filter(x=>x.type==="space"),g=p.length>0&&p.some(x=>this.rules.other.anyLine.test(x.raw));s.loose=g}}if(s.loose)for(let h of s.items){h.loose=!0;for(let p of h.tokens)p.type==="text"&&(p.type="paragraph")}return s}}html(e){let n=this.rules.block.html.exec(e);if(n)return{type:"html",block:!0,raw:n[0],pre:n[1]==="pre"||n[1]==="script"||n[1]==="style",text:n[0]}}def(e){let n=this.rules.block.def.exec(e);if(n){let r=n[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),l=n[2]?n[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=n[3]?n[3].substring(1,n[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):n[3];return{type:"def",tag:r,raw:n[0],href:l,title:s}}}table(e){let n=this.rules.block.table.exec(e);if(!n||!this.rules.other.tableDelimiter.test(n[2]))return;let r=v0(n[1]),l=n[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=n[3]?.trim()?n[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
148
|
+
`):[],o={type:"table",raw:n[0],header:[],align:[],rows:[]};if(r.length===l.length){for(let u of l)this.rules.other.tableAlignRight.test(u)?o.align.push("right"):this.rules.other.tableAlignCenter.test(u)?o.align.push("center"):this.rules.other.tableAlignLeft.test(u)?o.align.push("left"):o.align.push(null);for(let u=0;u<r.length;u++)o.header.push({text:r[u],tokens:this.lexer.inline(r[u]),header:!0,align:o.align[u]});for(let u of s)o.rows.push(v0(u,o.header.length).map((f,h)=>({text:f,tokens:this.lexer.inline(f),header:!1,align:o.align[h]})));return o}}lheading(e){let n=this.rules.block.lheading.exec(e);if(n)return{type:"heading",raw:n[0],depth:n[2].charAt(0)==="="?1:2,text:n[1],tokens:this.lexer.inline(n[1])}}paragraph(e){let n=this.rules.block.paragraph.exec(e);if(n){let r=n[1].charAt(n[1].length-1)===`
|
|
149
|
+
`?n[1].slice(0,-1):n[1];return{type:"paragraph",raw:n[0],text:r,tokens:this.lexer.inline(r)}}}text(e){let n=this.rules.block.text.exec(e);if(n)return{type:"text",raw:n[0],text:n[0],tokens:this.lexer.inline(n[0])}}escape(e){let n=this.rules.inline.escape.exec(e);if(n)return{type:"escape",raw:n[0],text:n[1]}}tag(e){let n=this.rules.inline.tag.exec(e);if(n)return!this.lexer.state.inLink&&this.rules.other.startATag.test(n[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(n[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(n[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(n[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:n[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:n[0]}}link(e){let n=this.rules.inline.link.exec(e);if(n){let r=n[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let o=Hs(r.slice(0,-1),"\\");if((r.length-o.length)%2===0)return}else{let o=ZL(n[2],"()");if(o===-2)return;if(o>-1){let u=(n[0].indexOf("!")===0?5:4)+n[1].length+o;n[2]=n[2].substring(0,o),n[0]=n[0].substring(0,u).trim(),n[3]=""}}let l=n[2],s="";if(this.options.pedantic){let o=this.rules.other.pedanticHrefTitle.exec(l);o&&(l=o[1],s=o[3])}else s=n[3]?n[3].slice(1,-1):"";return l=l.trim(),this.rules.other.startAngleBracket.test(l)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?l=l.slice(1):l=l.slice(1,-1)),k0(n,{href:l&&l.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},n[0],this.lexer,this.rules)}}reflink(e,n){let r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){let l=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=n[l.toLowerCase()];if(!s){let o=r[0].charAt(0);return{type:"text",raw:o,text:o}}return k0(r,s,r[0],this.lexer,this.rules)}}emStrong(e,n,r=""){let l=this.rules.inline.emStrongLDelim.exec(e);if(!(!l||l[3]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(l[1]||l[2])||!r||this.rules.inline.punctuation.exec(r))){let s=[...l[0]].length-1,o,u,f=s,h=0,p=l[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(p.lastIndex=0,n=n.slice(-1*e.length+s);(l=p.exec(n))!=null;){if(o=l[1]||l[2]||l[3]||l[4]||l[5]||l[6],!o)continue;if(u=[...o].length,l[3]||l[4]){f+=u;continue}else if((l[5]||l[6])&&s%3&&!((s+u)%3)){h+=u;continue}if(f-=u,f>0)continue;u=Math.min(u,u+f+h);let g=[...l[0]][0].length,x=e.slice(0,s+l.index+g+u);if(Math.min(s,u)%2){let v=x.slice(1,-1);return{type:"em",raw:x,text:v,tokens:this.lexer.inlineTokens(v)}}let y=x.slice(2,-2);return{type:"strong",raw:x,text:y,tokens:this.lexer.inlineTokens(y)}}}}codespan(e){let n=this.rules.inline.code.exec(e);if(n){let r=n[2].replace(this.rules.other.newLineCharGlobal," "),l=this.rules.other.nonSpaceChar.test(r),s=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return l&&s&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:n[0],text:r}}}br(e){let n=this.rules.inline.br.exec(e);if(n)return{type:"br",raw:n[0]}}del(e,n,r=""){let l=this.rules.inline.delLDelim.exec(e);if(l&&(!l[1]||!r||this.rules.inline.punctuation.exec(r))){let s=[...l[0]].length-1,o,u,f=s,h=this.rules.inline.delRDelim;for(h.lastIndex=0,n=n.slice(-1*e.length+s);(l=h.exec(n))!=null;){if(o=l[1]||l[2]||l[3]||l[4]||l[5]||l[6],!o||(u=[...o].length,u!==s))continue;if(l[3]||l[4]){f+=u;continue}if(f-=u,f>0)continue;u=Math.min(u,u+f);let p=[...l[0]][0].length,g=e.slice(0,s+l.index+p+u),x=g.slice(s,-s);return{type:"del",raw:g,text:x,tokens:this.lexer.inlineTokens(x)}}}}autolink(e){let n=this.rules.inline.autolink.exec(e);if(n){let r,l;return n[2]==="@"?(r=n[1],l="mailto:"+r):(r=n[1],l=r),{type:"link",raw:n[0],text:r,href:l,tokens:[{type:"text",raw:r,text:r}]}}}url(e){let n;if(n=this.rules.inline.url.exec(e)){let r,l;if(n[2]==="@")r=n[0],l="mailto:"+r;else{let s;do s=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])?.[0]??"";while(s!==n[0]);r=n[0],n[1]==="www."?l="http://"+n[0]:l=n[0]}return{type:"link",raw:n[0],text:r,href:l,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(e){let n=this.rules.inline.text.exec(e);if(n){let r=this.lexer.state.inRawBlock;return{type:"text",raw:n[0],text:n[0],escaped:r}}}},Ir=class Ep{tokens;options;state;inlineQueue;tokenizer;constructor(n){this.tokens=[],this.tokens.links=Object.create(null),this.options=n||$l,this.options.tokenizer=this.options.tokenizer||new yc,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:$n,block:Zu.normal,inline:Us.normal};this.options.pedantic?(r.block=Zu.pedantic,r.inline=Us.pedantic):this.options.gfm&&(r.block=Zu.gfm,this.options.breaks?r.inline=Us.breaks:r.inline=Us.gfm),this.tokenizer.rules=r}static get rules(){return{block:Zu,inline:Us}}static lex(n,r){return new Ep(r).lex(n)}static lexInline(n,r){return new Ep(r).inlineTokens(n)}lex(n){n=n.replace($n.carriageReturn,`
|
|
150
|
+
`),this.blockTokens(n,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let l=this.inlineQueue[r];this.inlineTokens(l.src,l.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(n,r=[],l=!1){for(this.options.pedantic&&(n=n.replace($n.tabCharGlobal," ").replace($n.spaceLine,""));n;){let s;if(this.options.extensions?.block?.some(u=>(s=u.call({lexer:this},n,r))?(n=n.substring(s.raw.length),r.push(s),!0):!1))continue;if(s=this.tokenizer.space(n)){n=n.substring(s.raw.length);let u=r.at(-1);s.raw.length===1&&u!==void 0?u.raw+=`
|
|
151
|
+
`:r.push(s);continue}if(s=this.tokenizer.code(n)){n=n.substring(s.raw.length);let u=r.at(-1);u?.type==="paragraph"||u?.type==="text"?(u.raw+=(u.raw.endsWith(`
|
|
152
|
+
`)?"":`
|
|
153
|
+
`)+s.raw,u.text+=`
|
|
154
|
+
`+s.text,this.inlineQueue.at(-1).src=u.text):r.push(s);continue}if(s=this.tokenizer.fences(n)){n=n.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.heading(n)){n=n.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.hr(n)){n=n.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.blockquote(n)){n=n.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.list(n)){n=n.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.html(n)){n=n.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.def(n)){n=n.substring(s.raw.length);let u=r.at(-1);u?.type==="paragraph"||u?.type==="text"?(u.raw+=(u.raw.endsWith(`
|
|
155
|
+
`)?"":`
|
|
156
|
+
`)+s.raw,u.text+=`
|
|
157
|
+
`+s.raw,this.inlineQueue.at(-1).src=u.text):this.tokens.links[s.tag]||(this.tokens.links[s.tag]={href:s.href,title:s.title},r.push(s));continue}if(s=this.tokenizer.table(n)){n=n.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.lheading(n)){n=n.substring(s.raw.length),r.push(s);continue}let o=n;if(this.options.extensions?.startBlock){let u=1/0,f=n.slice(1),h;this.options.extensions.startBlock.forEach(p=>{h=p.call({lexer:this},f),typeof h=="number"&&h>=0&&(u=Math.min(u,h))}),u<1/0&&u>=0&&(o=n.substring(0,u+1))}if(this.state.top&&(s=this.tokenizer.paragraph(o))){let u=r.at(-1);l&&u?.type==="paragraph"?(u.raw+=(u.raw.endsWith(`
|
|
158
|
+
`)?"":`
|
|
159
|
+
`)+s.raw,u.text+=`
|
|
160
|
+
`+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):r.push(s),l=o.length!==n.length,n=n.substring(s.raw.length);continue}if(s=this.tokenizer.text(n)){n=n.substring(s.raw.length);let u=r.at(-1);u?.type==="text"?(u.raw+=(u.raw.endsWith(`
|
|
161
|
+
`)?"":`
|
|
162
|
+
`)+s.raw,u.text+=`
|
|
163
|
+
`+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):r.push(s);continue}if(n){let u="Infinite loop on byte: "+n.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return this.state.top=!0,r}inline(n,r=[]){return this.inlineQueue.push({src:n,tokens:r}),r}inlineTokens(n,r=[]){let l=n,s=null;if(this.tokens.links){let h=Object.keys(this.tokens.links);if(h.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(l))!=null;)h.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(l))!=null;)l=l.slice(0,s.index)+"++"+l.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let o;for(;(s=this.tokenizer.rules.inline.blockSkip.exec(l))!=null;)o=s[2]?s[2].length:0,l=l.slice(0,s.index+o)+"["+"a".repeat(s[0].length-o-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);l=this.options.hooks?.emStrongMask?.call({lexer:this},l)??l;let u=!1,f="";for(;n;){u||(f=""),u=!1;let h;if(this.options.extensions?.inline?.some(g=>(h=g.call({lexer:this},n,r))?(n=n.substring(h.raw.length),r.push(h),!0):!1))continue;if(h=this.tokenizer.escape(n)){n=n.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.tag(n)){n=n.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.link(n)){n=n.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.reflink(n,this.tokens.links)){n=n.substring(h.raw.length);let g=r.at(-1);h.type==="text"&&g?.type==="text"?(g.raw+=h.raw,g.text+=h.text):r.push(h);continue}if(h=this.tokenizer.emStrong(n,l,f)){n=n.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.codespan(n)){n=n.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.br(n)){n=n.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.del(n,l,f)){n=n.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.autolink(n)){n=n.substring(h.raw.length),r.push(h);continue}if(!this.state.inLink&&(h=this.tokenizer.url(n))){n=n.substring(h.raw.length),r.push(h);continue}let p=n;if(this.options.extensions?.startInline){let g=1/0,x=n.slice(1),y;this.options.extensions.startInline.forEach(v=>{y=v.call({lexer:this},x),typeof y=="number"&&y>=0&&(g=Math.min(g,y))}),g<1/0&&g>=0&&(p=n.substring(0,g+1))}if(h=this.tokenizer.inlineText(p)){n=n.substring(h.raw.length),h.raw.slice(-1)!=="_"&&(f=h.raw.slice(-1)),u=!0;let g=r.at(-1);g?.type==="text"?(g.raw+=h.raw,g.text+=h.text):r.push(h);continue}if(n){let g="Infinite loop on byte: "+n.charCodeAt(0);if(this.options.silent){console.error(g);break}else throw new Error(g)}}return r}},vc=class{options;parser;constructor(e){this.options=e||$l}space(e){return""}code({text:e,lang:n,escaped:r}){let l=(n||"").match($n.notSpaceStart)?.[0],s=e.replace($n.endingNewline,"")+`
|
|
164
|
+
`;return l?'<pre><code class="language-'+Zr(l)+'">'+(r?s:Zr(s,!0))+`</code></pre>
|
|
165
|
+
`:"<pre><code>"+(r?s:Zr(s,!0))+`</code></pre>
|
|
166
|
+
`}blockquote({tokens:e}){return`<blockquote>
|
|
167
|
+
${this.parser.parse(e)}</blockquote>
|
|
168
|
+
`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:n}){return`<h${n}>${this.parser.parseInline(e)}</h${n}>
|
|
169
|
+
`}hr(e){return`<hr>
|
|
170
|
+
`}list(e){let n=e.ordered,r=e.start,l="";for(let u=0;u<e.items.length;u++){let f=e.items[u];l+=this.listitem(f)}let s=n?"ol":"ul",o=n&&r!==1?' start="'+r+'"':"";return"<"+s+o+`>
|
|
171
|
+
`+l+"</"+s+`>
|
|
172
|
+
`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
|
|
173
|
+
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
174
|
+
`}table(e){let n="",r="";for(let s=0;s<e.header.length;s++)r+=this.tablecell(e.header[s]);n+=this.tablerow({text:r});let l="";for(let s=0;s<e.rows.length;s++){let o=e.rows[s];r="";for(let u=0;u<o.length;u++)r+=this.tablecell(o[u]);l+=this.tablerow({text:r})}return l&&(l=`<tbody>${l}</tbody>`),`<table>
|
|
175
|
+
<thead>
|
|
176
|
+
`+n+`</thead>
|
|
177
|
+
`+l+`</table>
|
|
178
|
+
`}tablerow({text:e}){return`<tr>
|
|
179
|
+
${e}</tr>
|
|
180
|
+
`}tablecell(e){let n=this.parser.parseInline(e.tokens),r=e.header?"th":"td";return(e.align?`<${r} align="${e.align}">`:`<${r}>`)+n+`</${r}>
|
|
181
|
+
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Zr(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:n,tokens:r}){let l=this.parser.parseInline(r),s=y0(e);if(s===null)return l;e=s;let o='<a href="'+e+'"';return n&&(o+=' title="'+Zr(n)+'"'),o+=">"+l+"</a>",o}image({href:e,title:n,text:r,tokens:l}){l&&(r=this.parser.parseInline(l,this.parser.textRenderer));let s=y0(e);if(s===null)return Zr(r);e=s;let o=`<img src="${e}" alt="${Zr(r)}"`;return n&&(o+=` title="${Zr(n)}"`),o+=">",o}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Zr(e.text)}},Cm=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},Br=class Np{options;renderer;textRenderer;constructor(n){this.options=n||$l,this.options.renderer=this.options.renderer||new vc,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Cm}static parse(n,r){return new Np(r).parse(n)}static parseInline(n,r){return new Np(r).parseInline(n)}parse(n){let r="";for(let l=0;l<n.length;l++){let s=n[l];if(this.options.extensions?.renderers?.[s.type]){let u=s,f=this.options.extensions.renderers[u.type].call({parser:this},u);if(f!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(u.type)){r+=f||"";continue}}let o=s;switch(o.type){case"space":{r+=this.renderer.space(o);break}case"hr":{r+=this.renderer.hr(o);break}case"heading":{r+=this.renderer.heading(o);break}case"code":{r+=this.renderer.code(o);break}case"table":{r+=this.renderer.table(o);break}case"blockquote":{r+=this.renderer.blockquote(o);break}case"list":{r+=this.renderer.list(o);break}case"checkbox":{r+=this.renderer.checkbox(o);break}case"html":{r+=this.renderer.html(o);break}case"def":{r+=this.renderer.def(o);break}case"paragraph":{r+=this.renderer.paragraph(o);break}case"text":{r+=this.renderer.text(o);break}default:{let u='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return r}parseInline(n,r=this.renderer){let l="";for(let s=0;s<n.length;s++){let o=n[s];if(this.options.extensions?.renderers?.[o.type]){let f=this.options.extensions.renderers[o.type].call({parser:this},o);if(f!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type)){l+=f||"";continue}}let u=o;switch(u.type){case"escape":{l+=r.text(u);break}case"html":{l+=r.html(u);break}case"link":{l+=r.link(u);break}case"image":{l+=r.image(u);break}case"checkbox":{l+=r.checkbox(u);break}case"strong":{l+=r.strong(u);break}case"em":{l+=r.em(u);break}case"codespan":{l+=r.codespan(u);break}case"br":{l+=r.br(u);break}case"del":{l+=r.del(u);break}case"text":{l+=r.text(u);break}default:{let f='Token with "'+u.type+'" type was not found.';if(this.options.silent)return console.error(f),"";throw new Error(f)}}}return l}},Xs=class{options;block;constructor(e){this.options=e||$l}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?Ir.lex:Ir.lexInline}provideParser(){return this.block?Br.parse:Br.parseInline}},JL=class{defaults=km();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Br;Renderer=vc;TextRenderer=Cm;Lexer=Ir;Tokenizer=yc;Hooks=Xs;constructor(...e){this.use(...e)}walkTokens(e,n){let r=[];for(let l of e)switch(r=r.concat(n.call(this,l)),l.type){case"table":{let s=l;for(let o of s.header)r=r.concat(this.walkTokens(o.tokens,n));for(let o of s.rows)for(let u of o)r=r.concat(this.walkTokens(u.tokens,n));break}case"list":{let s=l;r=r.concat(this.walkTokens(s.items,n));break}default:{let s=l;this.defaults.extensions?.childTokens?.[s.type]?this.defaults.extensions.childTokens[s.type].forEach(o=>{let u=s[o].flat(1/0);r=r.concat(this.walkTokens(u,n))}):s.tokens&&(r=r.concat(this.walkTokens(s.tokens,n)))}}return r}use(...e){let n=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(r=>{let l={...r};if(l.async=this.defaults.async||l.async||!1,r.extensions&&(r.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let o=n.renderers[s.name];o?n.renderers[s.name]=function(...u){let f=s.renderer.apply(this,u);return f===!1&&(f=o.apply(this,u)),f}:n.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let o=n[s.level];o?o.unshift(s.tokenizer):n[s.level]=[s.tokenizer],s.start&&(s.level==="block"?n.startBlock?n.startBlock.push(s.start):n.startBlock=[s.start]:s.level==="inline"&&(n.startInline?n.startInline.push(s.start):n.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(n.childTokens[s.name]=s.childTokens)}),l.extensions=n),r.renderer){let s=this.defaults.renderer||new vc(this.defaults);for(let o in r.renderer){if(!(o in s))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;let u=o,f=r.renderer[u],h=s[u];s[u]=(...p)=>{let g=f.apply(s,p);return g===!1&&(g=h.apply(s,p)),g||""}}l.renderer=s}if(r.tokenizer){let s=this.defaults.tokenizer||new yc(this.defaults);for(let o in r.tokenizer){if(!(o in s))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;let u=o,f=r.tokenizer[u],h=s[u];s[u]=(...p)=>{let g=f.apply(s,p);return g===!1&&(g=h.apply(s,p)),g}}l.tokenizer=s}if(r.hooks){let s=this.defaults.hooks||new Xs;for(let o in r.hooks){if(!(o in s))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;let u=o,f=r.hooks[u],h=s[u];Xs.passThroughHooks.has(o)?s[u]=p=>{if(this.defaults.async&&Xs.passThroughHooksRespectAsync.has(o))return(async()=>{let x=await f.call(s,p);return h.call(s,x)})();let g=f.call(s,p);return h.call(s,g)}:s[u]=(...p)=>{if(this.defaults.async)return(async()=>{let x=await f.apply(s,p);return x===!1&&(x=await h.apply(s,p)),x})();let g=f.apply(s,p);return g===!1&&(g=h.apply(s,p)),g}}l.hooks=s}if(r.walkTokens){let s=this.defaults.walkTokens,o=r.walkTokens;l.walkTokens=function(u){let f=[];return f.push(o.call(this,u)),s&&(f=f.concat(s.call(this,u))),f}}this.defaults={...this.defaults,...l}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,n){return Ir.lex(e,n??this.defaults)}parser(e,n){return Br.parse(e,n??this.defaults)}parseMarkdown(e){return(n,r)=>{let l={...r},s={...this.defaults,...l},o=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&l.async===!1)return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=e),s.async)return(async()=>{let u=s.hooks?await s.hooks.preprocess(n):n,f=await(s.hooks?await s.hooks.provideLexer():e?Ir.lex:Ir.lexInline)(u,s),h=s.hooks?await s.hooks.processAllTokens(f):f;s.walkTokens&&await Promise.all(this.walkTokens(h,s.walkTokens));let p=await(s.hooks?await s.hooks.provideParser():e?Br.parse:Br.parseInline)(h,s);return s.hooks?await s.hooks.postprocess(p):p})().catch(o);try{s.hooks&&(n=s.hooks.preprocess(n));let u=(s.hooks?s.hooks.provideLexer():e?Ir.lex:Ir.lexInline)(n,s);s.hooks&&(u=s.hooks.processAllTokens(u)),s.walkTokens&&this.walkTokens(u,s.walkTokens);let f=(s.hooks?s.hooks.provideParser():e?Br.parse:Br.parseInline)(u,s);return s.hooks&&(f=s.hooks.postprocess(f)),f}catch(u){return o(u)}}}onError(e,n){return r=>{if(r.message+=`
|
|
182
|
+
Please report this to https://github.com/markedjs/marked.`,e){let l="<p>An error occurred:</p><pre>"+Zr(r.message+"",!0)+"</pre>";return n?Promise.resolve(l):l}if(n)return Promise.reject(r);throw r}}},Dl=new JL;function _t(e,n){return Dl.parse(e,n)}_t.options=_t.setOptions=function(e){return Dl.setOptions(e),_t.defaults=Dl.defaults,zw(_t.defaults),_t};_t.getDefaults=km;_t.defaults=$l;_t.use=function(...e){return Dl.use(...e),_t.defaults=Dl.defaults,zw(_t.defaults),_t};_t.walkTokens=function(e,n){return Dl.walkTokens(e,n)};_t.parseInline=Dl.parseInline;_t.Parser=Br;_t.parser=Br.parse;_t.Renderer=vc;_t.TextRenderer=Cm;_t.Lexer=Ir;_t.lexer=Ir.lex;_t.Tokenizer=yc;_t.Hooks=Xs;_t.parse=_t;_t.options;_t.setOptions;_t.use;_t.walkTokens;_t.parseInline;Br.parse;Ir.lex;function e9(e){if(typeof e=="function"&&(e={highlight:e}),!e||typeof e.highlight!="function")throw new Error("Must provide highlight function");return typeof e.langPrefix!="string"&&(e.langPrefix="language-"),typeof e.emptyLangClass!="string"&&(e.emptyLangClass=""),{async:!!e.async,walkTokens(n){if(n.type!=="code")return;const r=w0(n.lang);if(e.async)return Promise.resolve(e.highlight(n.text,r,n.lang||"")).then(S0(n));const l=e.highlight(n.text,r,n.lang||"");if(l instanceof Promise)throw new Error("markedHighlight is not set to async but the highlight function is async. Set the async option to true on markedHighlight to await the async highlight function.");S0(n)(l)},useNewRenderer:!0,renderer:{code(n,r,l){typeof n=="object"&&(l=n.escaped,r=n.lang,n=n.text);const s=w0(r),o=s?e.langPrefix+N0(s):e.emptyLangClass,u=o?` class="${o}"`:"";return n=n.replace(/\n$/,""),`<pre><code${u}>${l?n:N0(n,!0)}
|
|
183
|
+
</code></pre>`}}}}function w0(e){return(e||"").match(/\S*/)[0]}function S0(e){return n=>{typeof n=="string"&&n!==e.text&&(e.escaped=!0,e.text=n)}}const Vw=/[&<>"']/,t9=new RegExp(Vw.source,"g"),Xw=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,n9=new RegExp(Xw.source,"g"),r9={"&":"&","<":"<",">":">",'"':""","'":"'"},E0=e=>r9[e];function N0(e,n){if(n){if(Vw.test(e))return e.replace(t9,E0)}else if(Xw.test(e))return e.replace(n9,E0);return e}const{entries:Kw,setPrototypeOf:_0,isFrozen:a9,getPrototypeOf:l9,getOwnPropertyDescriptor:i9}=Object;let{freeze:Un,seal:Rr,create:ac}=Object,{apply:_p,construct:Tp}=typeof Reflect<"u"&&Reflect;Un||(Un=function(n){return n});Rr||(Rr=function(n){return n});_p||(_p=function(n,r){for(var l=arguments.length,s=new Array(l>2?l-2:0),o=2;o<l;o++)s[o-2]=arguments[o];return n.apply(r,s)});Tp||(Tp=function(n){for(var r=arguments.length,l=new Array(r>1?r-1:0),s=1;s<r;s++)l[s-1]=arguments[s];return new n(...l)});const Qu=Hn(Array.prototype.forEach),s9=Hn(Array.prototype.lastIndexOf),T0=Hn(Array.prototype.pop),Ps=Hn(Array.prototype.push),o9=Hn(Array.prototype.splice),lc=Hn(String.prototype.toLowerCase),Bh=Hn(String.prototype.toString),$h=Hn(String.prototype.match),Fs=Hn(String.prototype.replace),u9=Hn(String.prototype.indexOf),c9=Hn(String.prototype.trim),hr=Hn(Object.prototype.hasOwnProperty),In=Hn(RegExp.prototype.test),Gs=f9(TypeError);function Hn(e){return function(n){n instanceof RegExp&&(n.lastIndex=0);for(var r=arguments.length,l=new Array(r>1?r-1:0),s=1;s<r;s++)l[s-1]=arguments[s];return _p(e,n,l)}}function f9(e){return function(){for(var n=arguments.length,r=new Array(n),l=0;l<n;l++)r[l]=arguments[l];return Tp(e,r)}}function tt(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:lc;_0&&_0(e,null);let l=n.length;for(;l--;){let s=n[l];if(typeof s=="string"){const o=r(s);o!==s&&(a9(n)||(n[l]=o),s=o)}e[s]=!0}return e}function d9(e){for(let n=0;n<e.length;n++)hr(e,n)||(e[n]=null);return e}function Qr(e){const n=ac(null);for(const[r,l]of Kw(e))hr(e,r)&&(Array.isArray(l)?n[r]=d9(l):l&&typeof l=="object"&&l.constructor===Object?n[r]=Qr(l):n[r]=l);return n}function qs(e,n){for(;e!==null;){const l=i9(e,n);if(l){if(l.get)return Hn(l.get);if(typeof l.value=="function")return Hn(l.value)}e=l9(e)}function r(){return null}return r}const A0=Un(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Uh=Un(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Hh=Un(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),h9=Un(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Ph=Un(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),p9=Un(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),C0=Un(["#text"]),j0=Un(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Fh=Un(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),R0=Un(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Wu=Un(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),m9=Rr(/\{\{[\w\W]*|[\w\W]*\}\}/gm),g9=Rr(/<%[\w\W]*|[\w\W]*%>/gm),x9=Rr(/\$\{[\w\W]*/gm),b9=Rr(/^data-[\-\w.\u00B7-\uFFFF]+$/),y9=Rr(/^aria-[\-\w]+$/),Zw=Rr(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),v9=Rr(/^(?:\w+script|data):/i),k9=Rr(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Qw=Rr(/^html$/i),w9=Rr(/^[a-z][.\w]*(-[.\w]+)+$/i);var M0=Object.freeze({__proto__:null,ARIA_ATTR:y9,ATTR_WHITESPACE:k9,CUSTOM_ELEMENT:w9,DATA_ATTR:b9,DOCTYPE_NAME:Qw,ERB_EXPR:g9,IS_ALLOWED_URI:Zw,IS_SCRIPT_OR_DATA:v9,MUSTACHE_EXPR:m9,TMPLIT_EXPR:x9});const Ys={element:1,text:3,progressingInstruction:7,comment:8,document:9},S9=function(){return typeof window>"u"?null:window},E9=function(n,r){if(typeof n!="object"||typeof n.createPolicy!="function")return null;let l=null;const s="data-tt-policy-suffix";r&&r.hasAttribute(s)&&(l=r.getAttribute(s));const o="dompurify"+(l?"#"+l:"");try{return n.createPolicy(o,{createHTML(u){return u},createScriptURL(u){return u}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},O0=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Ww(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:S9();const n=Ce=>Ww(Ce);if(n.version="3.3.3",n.removed=[],!e||!e.document||e.document.nodeType!==Ys.document||!e.Element)return n.isSupported=!1,n;let{document:r}=e;const l=r,s=l.currentScript,{DocumentFragment:o,HTMLTemplateElement:u,Node:f,Element:h,NodeFilter:p,NamedNodeMap:g=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:x,DOMParser:y,trustedTypes:v}=e,w=h.prototype,E=qs(w,"cloneNode"),N=qs(w,"remove"),T=qs(w,"nextSibling"),R=qs(w,"childNodes"),j=qs(w,"parentNode");if(typeof u=="function"){const Ce=r.createElement("template");Ce.content&&Ce.content.ownerDocument&&(r=Ce.content.ownerDocument)}let $,B="";const{implementation:_,createNodeIterator:D,createDocumentFragment:F,getElementsByTagName:Y}=r,{importNode:L}=l;let X=O0();n.isSupported=typeof Kw=="function"&&typeof j=="function"&&_&&_.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:Z,ERB_EXPR:te,TMPLIT_EXPR:J,DATA_ATTR:G,ARIA_ATTR:z,IS_SCRIPT_OR_DATA:V,ATTR_WHITESPACE:ne,CUSTOM_ELEMENT:be}=M0;let{IS_ALLOWED_URI:M}=M0,O=null;const I=tt({},[...A0,...Uh,...Hh,...Ph,...C0]);let A=null;const oe=tt({},[...j0,...Fh,...R0,...Wu]);let le=Object.seal(ac(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),he=null,pe=null;const Ae=Object.seal(ac(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Re=!0,qe=!0,pt=!1,St=!0,Ge=!1,Et=!0,ve=!1,Ee=!1,mt=!1,ze=!1,gt=!1,Wt=!1,Sn=!0,Pn=!1;const zn="user-content-";let kt=!0,pn=!1,se={},ge=null;const re=tt({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let we=null;const $e=tt({},["audio","video","img","source","image","track"]);let xt=null;const Mt=tt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Pt="http://www.w3.org/1998/Math/MathML",nt="http://www.w3.org/2000/svg",bt="http://www.w3.org/1999/xhtml";let Je=bt,bn=!1,Jt=null;const ra=tt({},[Pt,nt,bt],Bh);let jn=tt({},["mi","mo","mn","ms","mtext"]),sn=tt({},["annotation-xml"]);const nr=tt({},["title","style","font","a","script"]);let en=null;const H=["application/xhtml+xml","text/html"],ce="text/html";let ye=null,Le=null;const Tt=r.createElement("form"),Ze=function(P){return P instanceof RegExp||P instanceof Function},Te=function(){let P=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Le&&Le===P)){if((!P||typeof P!="object")&&(P={}),P=Qr(P),en=H.indexOf(P.PARSER_MEDIA_TYPE)===-1?ce:P.PARSER_MEDIA_TYPE,ye=en==="application/xhtml+xml"?Bh:lc,O=hr(P,"ALLOWED_TAGS")?tt({},P.ALLOWED_TAGS,ye):I,A=hr(P,"ALLOWED_ATTR")?tt({},P.ALLOWED_ATTR,ye):oe,Jt=hr(P,"ALLOWED_NAMESPACES")?tt({},P.ALLOWED_NAMESPACES,Bh):ra,xt=hr(P,"ADD_URI_SAFE_ATTR")?tt(Qr(Mt),P.ADD_URI_SAFE_ATTR,ye):Mt,we=hr(P,"ADD_DATA_URI_TAGS")?tt(Qr($e),P.ADD_DATA_URI_TAGS,ye):$e,ge=hr(P,"FORBID_CONTENTS")?tt({},P.FORBID_CONTENTS,ye):re,he=hr(P,"FORBID_TAGS")?tt({},P.FORBID_TAGS,ye):Qr({}),pe=hr(P,"FORBID_ATTR")?tt({},P.FORBID_ATTR,ye):Qr({}),se=hr(P,"USE_PROFILES")?P.USE_PROFILES:!1,Re=P.ALLOW_ARIA_ATTR!==!1,qe=P.ALLOW_DATA_ATTR!==!1,pt=P.ALLOW_UNKNOWN_PROTOCOLS||!1,St=P.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ge=P.SAFE_FOR_TEMPLATES||!1,Et=P.SAFE_FOR_XML!==!1,ve=P.WHOLE_DOCUMENT||!1,ze=P.RETURN_DOM||!1,gt=P.RETURN_DOM_FRAGMENT||!1,Wt=P.RETURN_TRUSTED_TYPE||!1,mt=P.FORCE_BODY||!1,Sn=P.SANITIZE_DOM!==!1,Pn=P.SANITIZE_NAMED_PROPS||!1,kt=P.KEEP_CONTENT!==!1,pn=P.IN_PLACE||!1,M=P.ALLOWED_URI_REGEXP||Zw,Je=P.NAMESPACE||bt,jn=P.MATHML_TEXT_INTEGRATION_POINTS||jn,sn=P.HTML_INTEGRATION_POINTS||sn,le=P.CUSTOM_ELEMENT_HANDLING||{},P.CUSTOM_ELEMENT_HANDLING&&Ze(P.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(le.tagNameCheck=P.CUSTOM_ELEMENT_HANDLING.tagNameCheck),P.CUSTOM_ELEMENT_HANDLING&&Ze(P.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(le.attributeNameCheck=P.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),P.CUSTOM_ELEMENT_HANDLING&&typeof P.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(le.allowCustomizedBuiltInElements=P.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ge&&(qe=!1),gt&&(ze=!0),se&&(O=tt({},C0),A=ac(null),se.html===!0&&(tt(O,A0),tt(A,j0)),se.svg===!0&&(tt(O,Uh),tt(A,Fh),tt(A,Wu)),se.svgFilters===!0&&(tt(O,Hh),tt(A,Fh),tt(A,Wu)),se.mathMl===!0&&(tt(O,Ph),tt(A,R0),tt(A,Wu))),hr(P,"ADD_TAGS")||(Ae.tagCheck=null),hr(P,"ADD_ATTR")||(Ae.attributeCheck=null),P.ADD_TAGS&&(typeof P.ADD_TAGS=="function"?Ae.tagCheck=P.ADD_TAGS:(O===I&&(O=Qr(O)),tt(O,P.ADD_TAGS,ye))),P.ADD_ATTR&&(typeof P.ADD_ATTR=="function"?Ae.attributeCheck=P.ADD_ATTR:(A===oe&&(A=Qr(A)),tt(A,P.ADD_ATTR,ye))),P.ADD_URI_SAFE_ATTR&&tt(xt,P.ADD_URI_SAFE_ATTR,ye),P.FORBID_CONTENTS&&(ge===re&&(ge=Qr(ge)),tt(ge,P.FORBID_CONTENTS,ye)),P.ADD_FORBID_CONTENTS&&(ge===re&&(ge=Qr(ge)),tt(ge,P.ADD_FORBID_CONTENTS,ye)),kt&&(O["#text"]=!0),ve&&tt(O,["html","head","body"]),O.table&&(tt(O,["tbody"]),delete he.tbody),P.TRUSTED_TYPES_POLICY){if(typeof P.TRUSTED_TYPES_POLICY.createHTML!="function")throw Gs('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof P.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Gs('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');$=P.TRUSTED_TYPES_POLICY,B=$.createHTML("")}else $===void 0&&($=E9(v,s)),$!==null&&typeof B=="string"&&(B=$.createHTML(""));Un&&Un(P),Le=P}},Ne=tt({},[...Uh,...Hh,...h9]),Ue=tt({},[...Ph,...p9]),It=function(P){let me=j(P);(!me||!me.tagName)&&(me={namespaceURI:Je,tagName:"template"});const _e=lc(P.tagName),ct=lc(me.tagName);return Jt[P.namespaceURI]?P.namespaceURI===nt?me.namespaceURI===bt?_e==="svg":me.namespaceURI===Pt?_e==="svg"&&(ct==="annotation-xml"||jn[ct]):!!Ne[_e]:P.namespaceURI===Pt?me.namespaceURI===bt?_e==="math":me.namespaceURI===nt?_e==="math"&&sn[ct]:!!Ue[_e]:P.namespaceURI===bt?me.namespaceURI===nt&&!sn[ct]||me.namespaceURI===Pt&&!jn[ct]?!1:!Ue[_e]&&(nr[_e]||!Ne[_e]):!!(en==="application/xhtml+xml"&&Jt[P.namespaceURI]):!1},rt=function(P){Ps(n.removed,{element:P});try{j(P).removeChild(P)}catch{N(P)}},mn=function(P,me){try{Ps(n.removed,{attribute:me.getAttributeNode(P),from:me})}catch{Ps(n.removed,{attribute:null,from:me})}if(me.removeAttribute(P),P==="is")if(ze||gt)try{rt(me)}catch{}else try{me.setAttribute(P,"")}catch{}},gr=function(P){let me=null,_e=null;if(mt)P="<remove></remove>"+P;else{const Ve=$h(P,/^[\r\n\t ]+/);_e=Ve&&Ve[0]}en==="application/xhtml+xml"&&Je===bt&&(P='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+P+"</body></html>");const ct=$?$.createHTML(P):P;if(Je===bt)try{me=new y().parseFromString(ct,en)}catch{}if(!me||!me.documentElement){me=_.createDocument(Je,"template",null);try{me.documentElement.innerHTML=bn?B:ct}catch{}}const Bt=me.body||me.documentElement;return P&&_e&&Bt.insertBefore(r.createTextNode(_e),Bt.childNodes[0]||null),Je===bt?Y.call(me,ve?"html":"body")[0]:ve?me.documentElement:Bt},Mr=function(P){return D.call(P.ownerDocument||P,P,p.SHOW_ELEMENT|p.SHOW_COMMENT|p.SHOW_TEXT|p.SHOW_PROCESSING_INSTRUCTION|p.SHOW_CDATA_SECTION,null)},yn=function(P){return P instanceof x&&(typeof P.nodeName!="string"||typeof P.textContent!="string"||typeof P.removeChild!="function"||!(P.attributes instanceof g)||typeof P.removeAttribute!="function"||typeof P.setAttribute!="function"||typeof P.namespaceURI!="string"||typeof P.insertBefore!="function"||typeof P.hasChildNodes!="function")},Ot=function(P){return typeof f=="function"&&P instanceof f};function Nt(Ce,P,me){Qu(Ce,_e=>{_e.call(n,P,me,Le)})}const Fn=function(P){let me=null;if(Nt(X.beforeSanitizeElements,P,null),yn(P))return rt(P),!0;const _e=ye(P.nodeName);if(Nt(X.uponSanitizeElement,P,{tagName:_e,allowedTags:O}),Et&&P.hasChildNodes()&&!Ot(P.firstElementChild)&&In(/<[/\w!]/g,P.innerHTML)&&In(/<[/\w!]/g,P.textContent)||P.nodeType===Ys.progressingInstruction||Et&&P.nodeType===Ys.comment&&In(/<[/\w]/g,P.data))return rt(P),!0;if(!(Ae.tagCheck instanceof Function&&Ae.tagCheck(_e))&&(!O[_e]||he[_e])){if(!he[_e]&&aa(_e)&&(le.tagNameCheck instanceof RegExp&&In(le.tagNameCheck,_e)||le.tagNameCheck instanceof Function&&le.tagNameCheck(_e)))return!1;if(kt&&!ge[_e]){const ct=j(P)||P.parentNode,Bt=R(P)||P.childNodes;if(Bt&&ct){const Ve=Bt.length;for(let Zt=Ve-1;Zt>=0;--Zt){const gn=E(Bt[Zt],!0);gn.__removalCount=(P.__removalCount||0)+1,ct.insertBefore(gn,T(P))}}}return rt(P),!0}return P instanceof h&&!It(P)||(_e==="noscript"||_e==="noembed"||_e==="noframes")&&In(/<\/no(script|embed|frames)/i,P.innerHTML)?(rt(P),!0):(Ge&&P.nodeType===Ys.text&&(me=P.textContent,Qu([Z,te,J],ct=>{me=Fs(me,ct," ")}),P.textContent!==me&&(Ps(n.removed,{element:P.cloneNode()}),P.textContent=me)),Nt(X.afterSanitizeElements,P,null),!1)},xr=function(P,me,_e){if(pe[me]||Sn&&(me==="id"||me==="name")&&(_e in r||_e in Tt))return!1;if(!(qe&&!pe[me]&&In(G,me))){if(!(Re&&In(z,me))){if(!(Ae.attributeCheck instanceof Function&&Ae.attributeCheck(me,P))){if(!A[me]||pe[me]){if(!(aa(P)&&(le.tagNameCheck instanceof RegExp&&In(le.tagNameCheck,P)||le.tagNameCheck instanceof Function&&le.tagNameCheck(P))&&(le.attributeNameCheck instanceof RegExp&&In(le.attributeNameCheck,me)||le.attributeNameCheck instanceof Function&&le.attributeNameCheck(me,P))||me==="is"&&le.allowCustomizedBuiltInElements&&(le.tagNameCheck instanceof RegExp&&In(le.tagNameCheck,_e)||le.tagNameCheck instanceof Function&&le.tagNameCheck(_e))))return!1}else if(!xt[me]){if(!In(M,Fs(_e,ne,""))){if(!((me==="src"||me==="xlink:href"||me==="href")&&P!=="script"&&u9(_e,"data:")===0&&we[P])){if(!(pt&&!In(V,Fs(_e,ne,"")))){if(_e)return!1}}}}}}}return!0},aa=function(P){return P!=="annotation-xml"&&$h(P,be)},br=function(P){Nt(X.beforeSanitizeAttributes,P,null);const{attributes:me}=P;if(!me||yn(P))return;const _e={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:A,forceKeepAttr:void 0};let ct=me.length;for(;ct--;){const Bt=me[ct],{name:Ve,namespaceURI:Zt,value:gn}=Bt,vn=ye(Ve),xe=gn;let ae=Ve==="value"?xe:c9(xe);if(_e.attrName=vn,_e.attrValue=ae,_e.keepAttr=!0,_e.forceKeepAttr=void 0,Nt(X.uponSanitizeAttribute,P,_e),ae=_e.attrValue,Pn&&(vn==="id"||vn==="name")&&(mn(Ve,P),ae=zn+ae),Et&&In(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,ae)){mn(Ve,P);continue}if(vn==="attributename"&&$h(ae,"href")){mn(Ve,P);continue}if(_e.forceKeepAttr)continue;if(!_e.keepAttr){mn(Ve,P);continue}if(!St&&In(/\/>/i,ae)){mn(Ve,P);continue}Ge&&Qu([Z,te,J],et=>{ae=Fs(ae,et," ")});const Ie=ye(P.nodeName);if(!xr(Ie,vn,ae)){mn(Ve,P);continue}if($&&typeof v=="object"&&typeof v.getAttributeType=="function"&&!Zt)switch(v.getAttributeType(Ie,vn)){case"TrustedHTML":{ae=$.createHTML(ae);break}case"TrustedScriptURL":{ae=$.createScriptURL(ae);break}}if(ae!==xe)try{Zt?P.setAttributeNS(Zt,Ve,ae):P.setAttribute(Ve,ae),yn(P)?rt(P):T0(n.removed)}catch{mn(Ve,P)}}Nt(X.afterSanitizeAttributes,P,null)},qr=function Ce(P){let me=null;const _e=Mr(P);for(Nt(X.beforeSanitizeShadowDOM,P,null);me=_e.nextNode();)Nt(X.uponSanitizeShadowNode,me,null),Fn(me),br(me),me.content instanceof o&&Ce(me.content);Nt(X.afterSanitizeShadowDOM,P,null)};return n.sanitize=function(Ce){let P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},me=null,_e=null,ct=null,Bt=null;if(bn=!Ce,bn&&(Ce="<!-->"),typeof Ce!="string"&&!Ot(Ce))if(typeof Ce.toString=="function"){if(Ce=Ce.toString(),typeof Ce!="string")throw Gs("dirty is not a string, aborting")}else throw Gs("toString is not a function");if(!n.isSupported)return Ce;if(Ee||Te(P),n.removed=[],typeof Ce=="string"&&(pn=!1),pn){if(Ce.nodeName){const gn=ye(Ce.nodeName);if(!O[gn]||he[gn])throw Gs("root node is forbidden and cannot be sanitized in-place")}}else if(Ce instanceof f)me=gr("<!---->"),_e=me.ownerDocument.importNode(Ce,!0),_e.nodeType===Ys.element&&_e.nodeName==="BODY"||_e.nodeName==="HTML"?me=_e:me.appendChild(_e);else{if(!ze&&!Ge&&!ve&&Ce.indexOf("<")===-1)return $&&Wt?$.createHTML(Ce):Ce;if(me=gr(Ce),!me)return ze?null:Wt?B:""}me&&mt&&rt(me.firstChild);const Ve=Mr(pn?Ce:me);for(;ct=Ve.nextNode();)Fn(ct),br(ct),ct.content instanceof o&&qr(ct.content);if(pn)return Ce;if(ze){if(gt)for(Bt=F.call(me.ownerDocument);me.firstChild;)Bt.appendChild(me.firstChild);else Bt=me;return(A.shadowroot||A.shadowrootmode)&&(Bt=L.call(l,Bt,!0)),Bt}let Zt=ve?me.outerHTML:me.innerHTML;return ve&&O["!doctype"]&&me.ownerDocument&&me.ownerDocument.doctype&&me.ownerDocument.doctype.name&&In(Qw,me.ownerDocument.doctype.name)&&(Zt="<!DOCTYPE "+me.ownerDocument.doctype.name+`>
|
|
184
|
+
`+Zt),Ge&&Qu([Z,te,J],gn=>{Zt=Fs(Zt,gn," ")}),$&&Wt?$.createHTML(Zt):Zt},n.setConfig=function(){let Ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Te(Ce),Ee=!0},n.clearConfig=function(){Le=null,Ee=!1},n.isValidAttribute=function(Ce,P,me){Le||Te({});const _e=ye(Ce),ct=ye(P);return xr(_e,ct,me)},n.addHook=function(Ce,P){typeof P=="function"&&Ps(X[Ce],P)},n.removeHook=function(Ce,P){if(P!==void 0){const me=s9(X[Ce],P);return me===-1?void 0:o9(X[Ce],me,1)[0]}return T0(X[Ce])},n.removeHooks=function(Ce){X[Ce]=[]},n.removeAllHooks=function(){X=O0()},n}var Jw=Ww();_t.use(e9({langPrefix:"hljs language-",highlight(e,n){return n&&Rt.getLanguage(n)?Rt.highlight(e,{language:n}).value:e}}));Jw.addHook("afterSanitizeAttributes",e=>{e.tagName==="A"&&e.getAttribute("href")?.startsWith("http")&&(e.setAttribute("target","_blank"),e.setAttribute("rel","noopener noreferrer"))});function N9({content:e}){const n=k.useMemo(()=>Jw.sanitize(_t.parse(e,{gfm:!0})),[e]);return d.jsx("div",{className:"docs-prose",dangerouslySetInnerHTML:{__html:n}})}function _9({repoName:e,filePath:n,content:r,loading:l,error:s,rawMode:o,isStarred:u,onToggleRaw:f,onToggleStar:h,onClose:p}){return d.jsxs("div",{className:"relative flex flex-1 min-h-0 w-full flex-col",children:[d.jsxs("div",{className:"docs-header flex items-center gap-2 px-4 py-2 border-b flex-shrink-0",children:[d.jsxs("button",{onClick:p,className:"docs-header-back flex items-center gap-1 text-[13px] transition-colors cursor-pointer",children:[d.jsx(V0,{size:14,stroke:2.5}),"Back"]}),d.jsxs("span",{className:"docs-header-path flex-1 text-[13px] text-center truncate",children:[e," ",d.jsx("span",{className:"docs-header-slash",children:"/"})," ",n]}),d.jsx("button",{onClick:h,className:`docs-header-star transition-colors cursor-pointer ${u?"is-starred":""}`,title:u?"Remove from favourites":"Add to favourites",children:u?d.jsx(tv,{size:15}):d.jsx(T_,{size:15})}),d.jsx("button",{onClick:f,className:`docs-header-toggle rounded px-2 py-0.5 text-[13px] transition-colors cursor-pointer ${o?"is-active":""}`,children:o?"Rendered":"Raw"})]}),d.jsxs("div",{className:"chat-scroll flex-1 overflow-y-auto min-h-0",children:[d.jsx("div",{className:"border-t-2 border-accent-8/40"}),l?d.jsx("div",{className:"flex items-center justify-center py-12",children:d.jsx(Ur,{size:20,className:"animate-spin text-neutral-5"})}):s?d.jsx("div",{className:"rounded-md bg-error-10/50 px-3 py-2 text-[13px] text-error-4 mx-4 mt-4",children:s}):r!==null?o?d.jsx("pre",{className:"px-6 py-4 text-[14px] text-neutral-3 whitespace-pre-wrap",style:{fontFamily:"'Inconsolata', monospace"},children:r}):d.jsx("div",{className:"mx-auto max-w-[720px] px-6 py-4",children:d.jsx(N9,{content:r})}):null]})]})}function T9({docsRepoName:e,filePath:n,content:r,loading:l,error:s,rawMode:o,isStarred:u,onToggleRaw:f,onToggleStar:h,onClose:p,activeSessionId:g,inputBarRef:x,onSendInput:y,activePrompt:v,disabled:w,pendingFiles:E,onAddFiles:N,onRemoveFile:T,skillGroups:R,slashCommands:j,sessionInputs:$,onSessionInputChange:B,currentModel:_,onModelChange:D,isMobile:F,currentPermissionMode:Y,onPermissionModeChange:L,moveToWorktree:X,worktreePath:Z}){return d.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden min-h-0",children:[d.jsx(_9,{repoName:e,filePath:n,content:r,loading:l,error:s,rawMode:o,isStarred:u,onToggleRaw:f,onToggleStar:h,onClose:p}),g?d.jsx(vm,{ref:x,onSendInput:y,isWaiting:!!v,disabled:w,onEscape:p,pendingFiles:E,onAddFiles:N,onRemoveFile:T,skillGroups:R,slashCommands:j,placeholder:"Ask Claude about this doc, or request changes...",initialValue:g?$[g]??"":"",onValueChange:te=>{g&&B(g,te)},currentModel:_,onModelChange:D,isMobile:F,currentPermissionMode:Y,onPermissionModeChange:L,onMoveToWorktree:X,worktreePath:Z},`docs-${g}`):d.jsx("div",{className:"px-4 py-3 border-t border-neutral-10",children:d.jsx("div",{className:"rounded-lg bg-neutral-11 px-3 py-2 text-[15px] text-neutral-5 opacity-40",children:"Start a session to edit this doc"})})]})}function A9({count:e,repoName:n,onExecute:r,onDiscard:l}){return d.jsxs("div",{className:"flex items-center justify-between border-t border-warning-8/50 bg-warning-11/30 px-4 py-2 flex-shrink-0",children:[d.jsxs("span",{className:"text-[15px] text-warning-4",children:["⏸ ",e," message",e!==1?"s":""," queued — waiting for"," ",d.jsx("span",{className:"font-medium text-warning-3",children:n})," session to finish"]}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("button",{onClick:r,className:"rounded px-2.5 py-1 text-[13px] bg-warning-9/30 hover:bg-warning-8/50 text-warning-3 transition-colors",children:"Execute now"}),d.jsx("button",{onClick:l,className:"rounded px-2.5 py-1 text-[13px] text-neutral-4 hover:text-neutral-2 hover:bg-neutral-8/50 transition-colors",children:"Discard"})]})]})}function C9({activeSessionId:e,messages:n,fontSize:r,isMobile:l,planningMode:s,activityLabel:o,tasks:u,disabled:f,hasFileChanges:h,diffPanelOpen:p,onOpenDiffPanel:g,activePrompt:x,promptQueueSize:y,sendPromptResponse:v,activeTentativeCount:w,activeRepoName:E,onExecuteTentative:N,onDiscardTentative:T,inputBarRef:R,onSendInput:j,pendingFiles:$,onAddFiles:B,onRemoveFile:_,skillGroups:D,slashCommands:F,sessionInputs:Y,onSessionInputChange:L,currentModel:X,onModelChange:Z,hasUserMessages:te,useWorktree:J,onWorktreeChange:G,currentPermissionMode:z,onPermissionModeChange:V,moveToWorktree:ne,worktreePath:be}){return d.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden min-h-0",children:[d.jsxs("div",{className:"relative flex-1 min-h-0 flex flex-col",children:[d.jsx(Wp,{messages:n,fontSize:r,disabled:f,planningMode:s,activityLabel:o,isMobile:l}),d.jsx(Ow,{tasks:u}),h&&!p&&d.jsxs("button",{className:"absolute top-3 right-3 z-10 flex items-center gap-1.5 rounded-lg bg-primary-8 px-3 py-1.5 text-[13px] font-medium text-neutral-1 shadow-lg backdrop-blur-sm transition-colors hover:bg-primary-7",onClick:g,title:"Review code changes (Ctrl+Shift+D)",children:[d.jsx(UN,{size:15}),"Diff view"]})]}),x&&d.jsx(Dw,{options:x.options,question:x.question,multiSelect:x.multiSelect,promptType:x.promptType,questions:x.questions,approvePattern:x.approvePattern,onSelect:v,isMobile:l},x.requestId),y>1&&d.jsxs("div",{className:"px-3 py-1 text-[12px] text-neutral-5 bg-neutral-11 border-t border-neutral-10",children:[y-1," more pending"]}),w>0&&d.jsx(A9,{count:w,repoName:E,onExecute:N,onDiscard:T}),d.jsx(vm,{ref:R,onSendInput:j,isWaiting:!!x,disabled:f,onEscape:()=>{},pendingFiles:$,onAddFiles:B,onRemoveFile:_,skillGroups:D,slashCommands:F,initialValue:Y[e]??"",onValueChange:M=>{L(e,M)},currentModel:X,onModelChange:Z,isMobile:l,showWorktreeToggle:!te,useWorktree:J,onWorktreeChange:G,currentPermissionMode:z,onPermissionModeChange:V,onMoveToWorktree:ne,worktreePath:be},e??"no-session")]})}function j9(){const{settings:e,updateSettings:n}=m2(),{groups:r,repos:l,globalSkills:s,globalModules:o,ghMissing:u,refresh:f}=z0(e.token),{sessions:h,rename:p,remove:g,refresh:x}=L2(e.token),{queues:y,addToQueue:v,clearQueue:w}=Y2(),{sessionId:E,view:N,navigate:T}=F2(),R=Z2(),j=W2(),[$,B]=k.useState(!1),[_,D]=k.useState(()=>E??localStorage.getItem("codekin-active-session")),F=k.useCallback(ae=>{D(ae),N!=="orchestrator"&&(ae?T(`/s/${ae}`):T("/",!0))},[T,N]),[Y,L]=k.useState(!e.token),[X,Z]=k.useState(!1),[te,J]=k.useState(!1),G=k.useRef(()=>{}),z=k.useRef(()=>{}),[V,ne]=k.useState(!1),[be,M]=k.useState(0),[O,I]=k.useState(null),A=k.useRef(null),oe=k.useRef(null),le=k.useRef(()=>{}),[he,pe]=k.useState(()=>localStorage.getItem("codekin-use-worktree")==="true"),Ae=k.useRef(he);k.useEffect(()=>{Ae.current=he},[he]);const Re=k.useCallback(ae=>{pe(ae),localStorage.setItem("codekin-use-worktree",String(ae))},[]),[qe,pt]=k.useState(!1);k.useEffect(()=>{e.token&&H0(e.token).then(pt).catch(()=>{})},[e.token]);const[St,Ge]=k.useState("Joe");k.useEffect(()=>{e.token&&R2(e.token).then(Ge).catch(()=>{})},[e.token]);const Et=k.useRef(localStorage.getItem("claude-permission-mode")||"acceptEdits"),ve=k.useRef(null),[Ee,mt]=k.useState({}),{connState:ze,messages:gt,tasks:Wt,planningMode:Sn,isProcessing:Pn,thinkingSummary:zn,waitingSessions:kt,activePrompt:pn,promptQueueSize:se,joinSession:ge,createSession:re,sendInput:we,sendPromptResponse:$e,leaveSession:xt,clearMessages:Mt,restoreSession:Pt,currentModel:nt,setModel:bt,send:Je,currentPermissionMode:bn,setPermissionMode:Jt,moveToWorktree:ra}=H2({token:e.token,onSessionCreated:ae=>{if(F(ae),x(),oe.current){const Ie=oe.current;oe.current=null,setTimeout(()=>le.current(Ie),500)}},onSessionJoined:ae=>{F(ae)},onSessionRenamed:()=>{x()},onSessionsUpdated:()=>{x(),M(ae=>ae+1)},onError:ae=>{A.current&&clearTimeout(A.current),I(ae),A.current=setTimeout(()=>I(null),5e3),ae.toLowerCase().includes("not found")&&F(null)},onRawMessage:ae=>{ae.type==="diff_result"||ae.type==="diff_error"?G.current(ae):ae.type==="tool_done"&&(z.current(ae.toolName,ae.summary),(ae.toolName==="Edit"||ae.toolName==="Write")&&ne(!0))}}),jn=k.useCallback(ae=>{Et.current=ae,Jt(ae)},[Jt]);k.useEffect(()=>{ne(!1)},[_]);const{activeWorkingDir:sn,handleOpenSession:nr,handleSelectSession:en,handleDeleteSession:H,handleSelectRepo:ce,handleDeleteRepo:ye,handleNewSessionForRepo:Le,handleNewSessionFromArchive:Tt}=V2({sessions:h,repos:l,activeSessionId:_,setActiveSessionId:F,joinSession:ge,leaveSession:xt,clearMessages:Mt,wsCreateSession:re,removeSession:g,pendingContextRef:oe,useWorktreeRef:Ae,permissionModeRef:Et}),Ze=sn?l.find(ae=>ae.workingDir===sn)??null:null,Te=k.useMemo(()=>[...s,...Ze?.skills??[]],[s,Ze?.skills]),Ne=k.useMemo(()=>eN(Te),[Te]),Ue=k.useCallback((ae,Ie)=>{switch(ae){case"/clear":case"/reset":case"/new":xt(),Mt(),sn&&Le();break;case"/compact":we("Please compact the conversation context to save tokens while preserving important context.");break;case"/model":Ie?bt(Ie):we(`Current model: ${nt??"default"}. To change, use the model selector in the input bar.`);break;case"/help":we("[Codekin] Available commands: /clear, /compact, /model, /cost, /status, /help. Skills: type / to see autocomplete.");break;default:we(`[Codekin] Command ${ae} is not available in the web UI.`);break}},[xt,Mt,sn,Le,we,nt,bt]),{handleSend:It,handleExecuteTentative:rt,handleDiscardTentative:mn,tentativeMessages:gr,activeTentativeCount:Mr,pendingFiles:yn,addFiles:Ot,removeFile:Nt,uploadStatus:Fn}=nN({token:e.token,activeSessionId:_,activeWorkingDir:sn,sessions:h,allSkills:Te,sendInput:we,onBuiltinCommand:Ue,tentativeQueues:y,addToQueue:v,clearQueue:w,docsContext:{isOpen:R.isOpen,selectedFile:R.selectedFile,repoWorkingDir:R.repoWorkingDir},queueEnabled:qe});k.useEffect(()=>{le.current=we},[we]),k.useEffect(()=>{function ae(Ie){(Ie.metaKey||Ie.ctrlKey)&&Ie.key==="k"&&(Ie.preventDefault(),Z(et=>!et)),(Ie.metaKey||Ie.ctrlKey)&&Ie.shiftKey&&Ie.key==="D"&&(Ie.preventDefault(),J(et=>!et))}return window.addEventListener("keydown",ae),()=>window.removeEventListener("keydown",ae)},[]),k.useEffect(()=>{_?localStorage.setItem("codekin-active-session",_):localStorage.removeItem("codekin-active-session")},[_]);const xr=k.useRef(!1);k.useEffect(()=>{ze==="disconnected"&&(xr.current=!1)},[ze]),k.useEffect(()=>{xr.current||!_||ze!=="connected"||(xr.current=!0,ge(_))},[_,ze,ge]),k.useEffect(()=>{E!==_&&(E?(Mt(),xt(),ge(E),D(E)):(Mt(),xt(),D(null)))},[E]),k.useEffect(()=>{_&&window.location.pathname==="/"&&T(`/s/${_}`,!0)},[]),P2(()=>{Pt()}),k.useEffect(()=>{e.token||L(!0)},[e.token]),k.useEffect(()=>{R.isOpen&&R.close()},[_]);const aa=k.useCallback(ae=>{ve.current?.insertText(ae+" ")},[]),br=k.useCallback(ae=>{we(`[Module: ${ae.name}]
|
|
185
|
+
|
|
186
|
+
${ae.content}`)},[we]),qr=[{label:"Global",skills:s},...Ze&&Ze.skills.length>0?[{label:Ze.name,skills:Ze.skills}]:[]],Ce=rN(gt,Pn,zn),P=k.useMemo(()=>{if(!R.repoWorkingDir)return"";const ae=R.repoWorkingDir.replace(/\/+$/,"").split("/");return ae[ae.length-1]||R.repoWorkingDir},[R.repoWorkingDir]),me=k.useRef(null),_e=k.useCallback(()=>{T("/orchestrator"),me.current&&(Mt(),xt(),ge(me.current))},[T,Mt,xt,ge]),ct=k.useCallback(ae=>{me.current=ae,Mt(),xt(),ge(ae)},[Mt,xt,ge]),Bt=k.useCallback(ae=>{R.pickerOpen&&R.pickerRepoDir===ae?R.closePicker():R.openPicker(ae,e.token)},[R,e.token]),Ve=k.useCallback(ae=>{R.pickerRepoDir&&R.openFile(R.pickerRepoDir,ae,e.token)},[R,e.token]);k.useEffect(()=>{document.documentElement.dataset.theme=e.theme},[e.theme]);const Zt=h.find(ae=>ae.id===_),gn=Zt?.name??null,vn=Ze?.name??sn?.split("/").pop()??null,xe=k.useCallback((ae,Ie)=>{mt(et=>({...et,[ae]:Ie}))},[]);return d.jsxs("div",{className:"flex h-full bg-neutral-7",children:[d.jsx(mO,{sessions:h,activeSessionId:_,activeWorkingDir:sn,waitingSessions:kt,tentativeQueues:y,groups:r,globalModules:o,activeRepo:Ze,token:e.token,theme:e.theme,fontSize:e.fontSize,connState:ze,view:N,archiveRefreshKey:be,onSelectSession:ae=>{R.close(),N==="orchestrator"&&T(`/s/${ae}`),en(ae)},onDeleteSession:H,onRenameSession:p,onNewSession:Le,onNewSessionFromArchive:Tt,onOpenSession:nr,onSelectRepo:ce,onDeleteRepo:ye,onSettingsOpen:()=>L(!0),onUpdateTheme:ae=>n({theme:ae}),onSendModule:br,agentName:St,onNavigateToWorkflows:()=>T("/workflows"),onNavigateToOrchestrator:()=>_e(),onBrowseDocs:Bt,docsPicker:{open:R.pickerOpen,repoDir:R.pickerRepoDir,files:R.pickerFiles,loading:R.pickerLoading,onSelect:Ve,onClose:R.closePicker,starredDocs:R.starredDocs},mobile:{isMobile:j,mobileOpen:$,onMobileClose:()=>B(!1)}}),d.jsxs("div",{className:"terminal-area flex flex-1 flex-col overflow-hidden bg-neutral-12",children:[j&&d.jsx(gO,{repoName:vn,sessionName:gn,onMenuOpen:()=>B(!0),onNewSession:Le,onSettingsOpen:()=>L(!0),activeRepo:Ze}),O&&d.jsx("div",{className:"border-b border-error-9/50 bg-error-10/50 px-4 py-2 text-[15px] text-error-5",children:O}),Fn&&d.jsx("div",{className:"border-b border-primary-9/50 bg-primary-10/50 px-4 py-2 text-[15px] text-primary-5",children:Fn}),N==="orchestrator"?d.jsx(cL,{token:e.token,onOrchestratorSessionReady:ct,sessionJoined:!!_,activeSessionId:_,messages:[...gt,...gr],fontSize:e.fontSize+(j?1:0),isMobile:j,planningMode:Sn,activityLabel:Ce,tasks:Wt,activePrompt:pn,sendPromptResponse:$e,inputBarRef:ve,onSendInput:It,pendingFiles:yn,onAddFiles:Ot,onRemoveFile:Nt,skillGroups:qr,slashCommands:Ne,currentModel:nt,onModelChange:bt,currentPermissionMode:bn,onPermissionModeChange:jn,disabled:!e.token,agentName:St}):N==="workflows"?d.jsx(KO,{token:e.token,onNavigateToSession:ae=>{Mt(),xt(),ge(ae),T(`/s/${ae}`)}}):R.isOpen?d.jsx(T9,{docsRepoName:P,filePath:R.selectedFile,content:R.content,loading:R.loading,error:R.error,rawMode:R.rawMode,isStarred:R.isCurrentFileStarred,onToggleRaw:R.toggleRawMode,onToggleStar:R.toggleStarCurrentFile,onClose:R.close,activeSessionId:_,inputBarRef:ve,onSendInput:It,activePrompt:pn,disabled:!e.token,pendingFiles:yn,onAddFiles:Ot,onRemoveFile:Nt,skillGroups:qr,slashCommands:Ne,sessionInputs:Ee,onSessionInputChange:xe,currentModel:nt,onModelChange:bt,isMobile:j,currentPermissionMode:bn,onPermissionModeChange:jn,moveToWorktree:ra,worktreePath:Zt?.worktreePath}):_?d.jsx(C9,{activeSessionId:_,messages:[...gt,...gr],fontSize:e.fontSize+(j?1:0),isMobile:j,planningMode:Sn,activityLabel:Ce,tasks:Wt,disabled:!e.token,hasFileChanges:V,diffPanelOpen:te,onOpenDiffPanel:()=>J(!0),activePrompt:pn,promptQueueSize:se,sendPromptResponse:$e,activeTentativeCount:Mr,activeRepoName:Ze?.name??sn?.split("/").pop()??"this repo",onExecuteTentative:()=>rt(_),onDiscardTentative:()=>mn(_),inputBarRef:ve,onSendInput:It,pendingFiles:yn,onAddFiles:Ot,onRemoveFile:Nt,skillGroups:qr,slashCommands:Ne,sessionInputs:Ee,onSessionInputChange:xe,currentModel:nt,onModelChange:bt,hasUserMessages:gt.some(ae=>ae.type==="user"),useWorktree:he,onWorktreeChange:Re,currentPermissionMode:bn,onPermissionModeChange:jn,moveToWorktree:ra,worktreePath:Zt?.worktreePath}):d.jsx(k4,{groups:r,token:e.token,ghMissing:u,onOpen:nr,onRefreshRepos:f})]}),_&&d.jsx(nL,{isOpen:te,onClose:()=>J(!1),send:Je,onHandleMessage:ae=>{G.current=ae},onHandleToolDone:ae=>{z.current=ae}}),d.jsx(F_,{open:Y,onClose:()=>L(!1),settings:e,onUpdate:n,isMobile:j,autoWorktree:he,onAutoWorktreeChange:Re,agentName:St,onAgentNameChange:Ge}),d.jsx(v4,{open:X,onClose:()=>Z(!1),repos:l,globalSkills:s,globalModules:o,onOpenRepo:nr,onSendSkill:aa,onSendModule:br,onOpenSettings:()=>L(!0),isMobile:j})]})}d2.createRoot(document.getElementById("root")).render(d.jsx(k.StrictMode,{children:d.jsx(j9,{})}));
|