@sulala/agent 0.1.35 → 0.1.37
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/dashboard/dist/assets/index-BU3kjyvC.css +1 -0
- package/dashboard/dist/assets/index-Db1PdBM4.js +88 -0
- package/dashboard/dist/index.html +2 -2
- package/dist/agent/skill-install.d.ts +4 -0
- package/dist/agent/skill-install.d.ts.map +1 -1
- package/dist/agent/skill-install.js +19 -5
- package/dist/agent/skill-install.js.map +1 -1
- package/dist/agent/tool/spec-loader.d.ts.map +1 -1
- package/dist/agent/tool/spec-loader.js +14 -0
- package/dist/agent/tool/spec-loader.js.map +1 -1
- package/dist/agent/tools.d.ts.map +1 -1
- package/dist/agent/tools.js +72 -1
- package/dist/agent/tools.js.map +1 -1
- package/dist/gateway/server.d.ts.map +1 -1
- package/dist/gateway/server.js +103 -6
- package/dist/gateway/server.js.map +1 -1
- package/package.json +3 -2
- package/dashboard/dist/assets/index-CEqYOGG3.js +0 -88
- package/dashboard/dist/assets/index-MhFl8acB.css +0 -1
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
function Ej(e,r){for(var a=0;a<r.length;a++){const i=r[a];if(typeof i!="string"&&!Array.isArray(i)){for(const s in i)if(s!=="default"&&!(s in e)){const o=Object.getOwnPropertyDescriptor(i,s);o&&Object.defineProperty(e,s,o.get?o:{enumerable:!0,get:()=>i[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(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"&&i(u)}).observe(document,{childList:!0,subtree:!0});function a(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 i(s){if(s.ep)return;s.ep=!0;const o=a(s);fetch(s.href,o)}})();var nc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function _s(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Rf={exports:{}},ns={};var lv;function Nj(){if(lv)return ns;lv=1;var e=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function a(i,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:i,key:u,ref:s!==void 0?s:null,props:o}}return ns.Fragment=r,ns.jsx=a,ns.jsxs=a,ns}var sv;function Aj(){return sv||(sv=1,Rf.exports=Nj()),Rf.exports}var d=Aj(),Of={exports:{}},Ve={};var ov;function Tj(){if(ov)return Ve;ov=1;var e=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),i=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"),m=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),b=Symbol.iterator;function x(R){return R===null||typeof R!="object"?null:(R=b&&R[b]||R["@@iterator"],typeof R=="function"?R:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,_={};function k(R,F,L){this.props=R,this.context=F,this.refs=_,this.updater=L||S}k.prototype.isReactComponent={},k.prototype.setState=function(R,F){if(typeof R!="object"&&typeof R!="function"&&R!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,R,F,"setState")},k.prototype.forceUpdate=function(R){this.updater.enqueueForceUpdate(this,R,"forceUpdate")};function N(){}N.prototype=k.prototype;function A(R,F,L){this.props=R,this.context=F,this.refs=_,this.updater=L||S}var O=A.prototype=new N;O.constructor=A,w(O,k.prototype),O.isPureReactComponent=!0;var M=Array.isArray;function D(){}var B={H:null,A:null,T:null,S:null},V=Object.prototype.hasOwnProperty;function K(R,F,L){var le=L.ref;return{$$typeof:e,type:R,key:F,ref:le!==void 0?le:null,props:L}}function U(R,F){return K(R.type,F,R.props)}function te(R){return typeof R=="object"&&R!==null&&R.$$typeof===e}function I(R){var F={"=":"=0",":":"=2"};return"$"+R.replace(/[=:]/g,function(L){return F[L]})}var Z=/\/+/g;function E(R,F){return typeof R=="object"&&R!==null&&R.key!=null?I(""+R.key):F.toString(36)}function q(R){switch(R.status){case"fulfilled":return R.value;case"rejected":throw R.reason;default:switch(typeof R.status=="string"?R.then(D,D):(R.status="pending",R.then(function(F){R.status==="pending"&&(R.status="fulfilled",R.value=F)},function(F){R.status==="pending"&&(R.status="rejected",R.reason=F)})),R.status){case"fulfilled":return R.value;case"rejected":throw R.reason}}throw R}function $(R,F,L,le,oe){var ve=typeof R;(ve==="undefined"||ve==="boolean")&&(R=null);var Ce=!1;if(R===null)Ce=!0;else switch(ve){case"bigint":case"string":case"number":Ce=!0;break;case"object":switch(R.$$typeof){case e:case r:Ce=!0;break;case y:return Ce=R._init,$(Ce(R._payload),F,L,le,oe)}}if(Ce)return oe=oe(R),Ce=le===""?"."+E(R,0):le,M(oe)?(L="",Ce!=null&&(L=Ce.replace(Z,"$&/")+"/"),$(oe,F,L,"",function(Ge){return Ge})):oe!=null&&(te(oe)&&(oe=U(oe,L+(oe.key==null||R&&R.key===oe.key?"":(""+oe.key).replace(Z,"$&/")+"/")+Ce)),F.push(oe)),1;Ce=0;var Ae=le===""?".":le+":";if(M(R))for(var Ne=0;Ne<R.length;Ne++)le=R[Ne],ve=Ae+E(le,Ne),Ce+=$(le,F,L,ve,oe);else if(Ne=x(R),typeof Ne=="function")for(R=Ne.call(R),Ne=0;!(le=R.next()).done;)le=le.value,ve=Ae+E(le,Ne++),Ce+=$(le,F,L,ve,oe);else if(ve==="object"){if(typeof R.then=="function")return $(q(R),F,L,le,oe);throw F=String(R),Error("Objects are not valid as a React child (found: "+(F==="[object Object]"?"object with keys {"+Object.keys(R).join(", ")+"}":F)+"). If you meant to render a collection of children, use an array instead.")}return Ce}function X(R,F,L){if(R==null)return R;var le=[],oe=0;return $(R,le,"","",function(ve){return F.call(L,ve,oe++)}),le}function re(R){if(R._status===-1){var F=R._result;F=F(),F.then(function(L){(R._status===0||R._status===-1)&&(R._status=1,R._result=L)},function(L){(R._status===0||R._status===-1)&&(R._status=2,R._result=L)}),R._status===-1&&(R._status=0,R._result=F)}if(R._status===1)return R._result.default;throw R._result}var Y=typeof reportError=="function"?reportError:function(R){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var F=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof R=="object"&&R!==null&&typeof R.message=="string"?String(R.message):String(R),error:R});if(!window.dispatchEvent(F))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",R);return}console.error(R)},z={map:X,forEach:function(R,F,L){X(R,function(){F.apply(this,arguments)},L)},count:function(R){var F=0;return X(R,function(){F++}),F},toArray:function(R){return X(R,function(F){return F})||[]},only:function(R){if(!te(R))throw Error("React.Children.only expected to receive a single React element child.");return R}};return Ve.Activity=p,Ve.Children=z,Ve.Component=k,Ve.Fragment=a,Ve.Profiler=s,Ve.PureComponent=A,Ve.StrictMode=i,Ve.Suspense=h,Ve.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=B,Ve.__COMPILER_RUNTIME={__proto__:null,c:function(R){return B.H.useMemoCache(R)}},Ve.cache=function(R){return function(){return R.apply(null,arguments)}},Ve.cacheSignal=function(){return null},Ve.cloneElement=function(R,F,L){if(R==null)throw Error("The argument must be a React element, but you passed "+R+".");var le=w({},R.props),oe=R.key;if(F!=null)for(ve in F.key!==void 0&&(oe=""+F.key),F)!V.call(F,ve)||ve==="key"||ve==="__self"||ve==="__source"||ve==="ref"&&F.ref===void 0||(le[ve]=F[ve]);var ve=arguments.length-2;if(ve===1)le.children=L;else if(1<ve){for(var Ce=Array(ve),Ae=0;Ae<ve;Ae++)Ce[Ae]=arguments[Ae+2];le.children=Ce}return K(R.type,oe,le)},Ve.createContext=function(R){return R={$$typeof:u,_currentValue:R,_currentValue2:R,_threadCount:0,Provider:null,Consumer:null},R.Provider=R,R.Consumer={$$typeof:o,_context:R},R},Ve.createElement=function(R,F,L){var le,oe={},ve=null;if(F!=null)for(le in F.key!==void 0&&(ve=""+F.key),F)V.call(F,le)&&le!=="key"&&le!=="__self"&&le!=="__source"&&(oe[le]=F[le]);var Ce=arguments.length-2;if(Ce===1)oe.children=L;else if(1<Ce){for(var Ae=Array(Ce),Ne=0;Ne<Ce;Ne++)Ae[Ne]=arguments[Ne+2];oe.children=Ae}if(R&&R.defaultProps)for(le in Ce=R.defaultProps,Ce)oe[le]===void 0&&(oe[le]=Ce[le]);return K(R,ve,oe)},Ve.createRef=function(){return{current:null}},Ve.forwardRef=function(R){return{$$typeof:f,render:R}},Ve.isValidElement=te,Ve.lazy=function(R){return{$$typeof:y,_payload:{_status:-1,_result:R},_init:re}},Ve.memo=function(R,F){return{$$typeof:m,type:R,compare:F===void 0?null:F}},Ve.startTransition=function(R){var F=B.T,L={};B.T=L;try{var le=R(),oe=B.S;oe!==null&&oe(L,le),typeof le=="object"&&le!==null&&typeof le.then=="function"&&le.then(D,Y)}catch(ve){Y(ve)}finally{F!==null&&L.types!==null&&(F.types=L.types),B.T=F}},Ve.unstable_useCacheRefresh=function(){return B.H.useCacheRefresh()},Ve.use=function(R){return B.H.use(R)},Ve.useActionState=function(R,F,L){return B.H.useActionState(R,F,L)},Ve.useCallback=function(R,F){return B.H.useCallback(R,F)},Ve.useContext=function(R){return B.H.useContext(R)},Ve.useDebugValue=function(){},Ve.useDeferredValue=function(R,F){return B.H.useDeferredValue(R,F)},Ve.useEffect=function(R,F){return B.H.useEffect(R,F)},Ve.useEffectEvent=function(R){return B.H.useEffectEvent(R)},Ve.useId=function(){return B.H.useId()},Ve.useImperativeHandle=function(R,F,L){return B.H.useImperativeHandle(R,F,L)},Ve.useInsertionEffect=function(R,F){return B.H.useInsertionEffect(R,F)},Ve.useLayoutEffect=function(R,F){return B.H.useLayoutEffect(R,F)},Ve.useMemo=function(R,F){return B.H.useMemo(R,F)},Ve.useOptimistic=function(R,F){return B.H.useOptimistic(R,F)},Ve.useReducer=function(R,F,L){return B.H.useReducer(R,F,L)},Ve.useRef=function(R){return B.H.useRef(R)},Ve.useState=function(R){return B.H.useState(R)},Ve.useSyncExternalStore=function(R,F,L){return B.H.useSyncExternalStore(R,F,L)},Ve.useTransition=function(){return B.H.useTransition()},Ve.version="19.2.4",Ve}var cv;function Uc(){return cv||(cv=1,Of.exports=Tj()),Of.exports}var j=Uc();const da=_s(j),o0=Ej({__proto__:null,default:da},[j]);var zf={exports:{}},rs={},Mf={exports:{}},Df={};var uv;function Rj(){return uv||(uv=1,(function(e){function r($,X){var re=$.length;$.push(X);e:for(;0<re;){var Y=re-1>>>1,z=$[Y];if(0<s(z,X))$[Y]=X,$[re]=z,re=Y;else break e}}function a($){return $.length===0?null:$[0]}function i($){if($.length===0)return null;var X=$[0],re=$.pop();if(re!==X){$[0]=re;e:for(var Y=0,z=$.length,R=z>>>1;Y<R;){var F=2*(Y+1)-1,L=$[F],le=F+1,oe=$[le];if(0>s(L,re))le<z&&0>s(oe,L)?($[Y]=oe,$[le]=re,Y=le):($[Y]=L,$[F]=re,Y=F);else if(le<z&&0>s(oe,re))$[Y]=oe,$[le]=re,Y=le;else break e}}return X}function s($,X){var re=$.sortIndex-X.sortIndex;return re!==0?re:$.id-X.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=[],m=[],y=1,p=null,b=3,x=!1,S=!1,w=!1,_=!1,k=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;function O($){for(var X=a(m);X!==null;){if(X.callback===null)i(m);else if(X.startTime<=$)i(m),X.sortIndex=X.expirationTime,r(h,X);else break;X=a(m)}}function M($){if(w=!1,O($),!S)if(a(h)!==null)S=!0,D||(D=!0,I());else{var X=a(m);X!==null&&q(M,X.startTime-$)}}var D=!1,B=-1,V=5,K=-1;function U(){return _?!0:!(e.unstable_now()-K<V)}function te(){if(_=!1,D){var $=e.unstable_now();K=$;var X=!0;try{e:{S=!1,w&&(w=!1,N(B),B=-1),x=!0;var re=b;try{t:{for(O($),p=a(h);p!==null&&!(p.expirationTime>$&&U());){var Y=p.callback;if(typeof Y=="function"){p.callback=null,b=p.priorityLevel;var z=Y(p.expirationTime<=$);if($=e.unstable_now(),typeof z=="function"){p.callback=z,O($),X=!0;break t}p===a(h)&&i(h),O($)}else i(h);p=a(h)}if(p!==null)X=!0;else{var R=a(m);R!==null&&q(M,R.startTime-$),X=!1}}break e}finally{p=null,b=re,x=!1}X=void 0}}finally{X?I():D=!1}}}var I;if(typeof A=="function")I=function(){A(te)};else if(typeof MessageChannel<"u"){var Z=new MessageChannel,E=Z.port2;Z.port1.onmessage=te,I=function(){E.postMessage(null)}}else I=function(){k(te,0)};function q($,X){B=k(function(){$(e.unstable_now())},X)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function($){$.callback=null},e.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):V=0<$?Math.floor(1e3/$):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function($){switch(b){case 1:case 2:case 3:var X=3;break;default:X=b}var re=b;b=X;try{return $()}finally{b=re}},e.unstable_requestPaint=function(){_=!0},e.unstable_runWithPriority=function($,X){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var re=b;b=$;try{return X()}finally{b=re}},e.unstable_scheduleCallback=function($,X,re){var Y=e.unstable_now();switch(typeof re=="object"&&re!==null?(re=re.delay,re=typeof re=="number"&&0<re?Y+re:Y):re=Y,$){case 1:var z=-1;break;case 2:z=250;break;case 5:z=1073741823;break;case 4:z=1e4;break;default:z=5e3}return z=re+z,$={id:y++,callback:X,priorityLevel:$,startTime:re,expirationTime:z,sortIndex:-1},re>Y?($.sortIndex=re,r(m,$),a(h)===null&&$===a(m)&&(w?(N(B),B=-1):w=!0,q(M,re-Y))):($.sortIndex=z,r(h,$),S||x||(S=!0,D||(D=!0,I()))),$},e.unstable_shouldYield=U,e.unstable_wrapCallback=function($){var X=b;return function(){var re=b;b=X;try{return $.apply(this,arguments)}finally{b=re}}}})(Df)),Df}var dv;function Oj(){return dv||(dv=1,Mf.exports=Rj()),Mf.exports}var Lf={exports:{}},nn={};var fv;function zj(){if(fv)return nn;fv=1;var e=Uc();function r(h){var m="https://react.dev/errors/"+h;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)m+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+h+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var i={d:{f:a,r:function(){throw Error(r(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},s=Symbol.for("react.portal");function o(h,m,y){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:p==null?null:""+p,children:h,containerInfo:m,implementation:y}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(h,m){if(h==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return nn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,nn.createPortal=function(h,m){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(r(299));return o(h,m,null,y)},nn.flushSync=function(h){var m=u.T,y=i.p;try{if(u.T=null,i.p=2,h)return h()}finally{u.T=m,i.p=y,i.d.f()}},nn.preconnect=function(h,m){typeof h=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,i.d.C(h,m))},nn.prefetchDNS=function(h){typeof h=="string"&&i.d.D(h)},nn.preinit=function(h,m){if(typeof h=="string"&&m&&typeof m.as=="string"){var y=m.as,p=f(y,m.crossOrigin),b=typeof m.integrity=="string"?m.integrity:void 0,x=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;y==="style"?i.d.S(h,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:p,integrity:b,fetchPriority:x}):y==="script"&&i.d.X(h,{crossOrigin:p,integrity:b,fetchPriority:x,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},nn.preinitModule=function(h,m){if(typeof h=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var y=f(m.as,m.crossOrigin);i.d.M(h,{crossOrigin:y,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&i.d.M(h)},nn.preload=function(h,m){if(typeof h=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var y=m.as,p=f(y,m.crossOrigin);i.d.L(h,y,{crossOrigin:p,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},nn.preloadModule=function(h,m){if(typeof h=="string")if(m){var y=f(m.as,m.crossOrigin);i.d.m(h,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:y,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else i.d.m(h)},nn.requestFormReset=function(h){i.d.r(h)},nn.unstable_batchedUpdates=function(h,m){return h(m)},nn.useFormState=function(h,m,y){return u.H.useFormState(h,m,y)},nn.useFormStatus=function(){return u.H.useHostTransitionStatus()},nn.version="19.2.4",nn}var hv;function c0(){if(hv)return Lf.exports;hv=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(r){console.error(r)}}return e(),Lf.exports=zj(),Lf.exports}var mv;function Mj(){if(mv)return rs;mv=1;var e=Oj(),r=Uc(),a=c0();function i(t){var n="https://react.dev/errors/"+t;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)n+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+t+"; visit "+n+" 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 n=t,l=t;if(t.alternate)for(;n.return;)n=n.return;else{t=n;do n=t,(n.flags&4098)!==0&&(l=n.return),t=n.return;while(t)}return n.tag===3?l:null}function u(t){if(t.tag===13){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function f(t){if(t.tag===31){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function h(t){if(o(t)!==t)throw Error(i(188))}function m(t){var n=t.alternate;if(!n){if(n=o(t),n===null)throw Error(i(188));return n!==t?null:t}for(var l=t,c=n;;){var g=l.return;if(g===null)break;var v=g.alternate;if(v===null){if(c=g.return,c!==null){l=c;continue}break}if(g.child===v.child){for(v=g.child;v;){if(v===l)return h(g),t;if(v===c)return h(g),n;v=v.sibling}throw Error(i(188))}if(l.return!==c.return)l=g,c=v;else{for(var C=!1,P=g.child;P;){if(P===l){C=!0,l=g,c=v;break}if(P===c){C=!0,c=g,l=v;break}P=P.sibling}if(!C){for(P=v.child;P;){if(P===l){C=!0,l=v,c=g;break}if(P===c){C=!0,c=v,l=g;break}P=P.sibling}if(!C)throw Error(i(189))}}if(l.alternate!==c)throw Error(i(190))}if(l.tag!==3)throw Error(i(188));return l.stateNode.current===l?t:n}function y(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t;for(t=t.child;t!==null;){if(n=y(t),n!==null)return n;t=t.sibling}return null}var p=Object.assign,b=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),_=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),N=Symbol.for("react.consumer"),A=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),B=Symbol.for("react.memo"),V=Symbol.for("react.lazy"),K=Symbol.for("react.activity"),U=Symbol.for("react.memo_cache_sentinel"),te=Symbol.iterator;function I(t){return t===null||typeof t!="object"?null:(t=te&&t[te]||t["@@iterator"],typeof t=="function"?t:null)}var Z=Symbol.for("react.client.reference");function E(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===Z?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case w:return"Fragment";case k:return"Profiler";case _:return"StrictMode";case M:return"Suspense";case D:return"SuspenseList";case K:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case S:return"Portal";case A:return t.displayName||"Context";case N:return(t._context.displayName||"Context")+".Consumer";case O:var n=t.render;return t=t.displayName,t||(t=n.displayName||n.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case B:return n=t.displayName||null,n!==null?n:E(t.type)||"Memo";case V:n=t._payload,t=t._init;try{return E(t(n))}catch{}}return null}var q=Array.isArray,$=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re={pending:!1,data:null,method:null,action:null},Y=[],z=-1;function R(t){return{current:t}}function F(t){0>z||(t.current=Y[z],Y[z]=null,z--)}function L(t,n){z++,Y[z]=t.current,t.current=n}var le=R(null),oe=R(null),ve=R(null),Ce=R(null);function Ae(t,n){switch(L(ve,n),L(oe,t),L(le,null),n.nodeType){case 9:case 11:t=(t=n.documentElement)&&(t=t.namespaceURI)?Ax(t):0;break;default:if(t=n.tagName,n=n.namespaceURI)n=Ax(n),t=Tx(n,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}F(le),L(le,t)}function Ne(){F(le),F(oe),F(ve)}function Ge(t){t.memoizedState!==null&&L(Ce,t);var n=le.current,l=Tx(n,t.type);n!==l&&(L(oe,t),L(le,l))}function $e(t){oe.current===t&&(F(le),F(oe)),Ce.current===t&&(F(Ce),Wl._currentValue=re)}var dt,ot;function T(t){if(dt===void 0)try{throw Error()}catch(l){var n=l.stack.trim().match(/\n( *(at )?)/);dt=n&&n[1]||"",ot=-1<l.stack.indexOf(`
|
|
2
|
-
at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
-
`+dt+t+ot}var ie=!1;function Q(t,n){if(!t||ie)return"";ie=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(n){var we=function(){throw Error()};if(Object.defineProperty(we.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(we,[])}catch(me){var fe=me}Reflect.construct(t,[],we)}else{try{we.call()}catch(me){fe=me}t.call(we.prototype)}}else{try{throw Error()}catch(me){fe=me}(we=t())&&typeof we.catch=="function"&&we.catch(function(){})}}catch(me){if(me&&fe&&typeof me.stack=="string")return[me.stack,fe.stack]}return[null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var g=Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name");g&&g.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var v=c.DetermineComponentFrameRoot(),C=v[0],P=v[1];if(C&&P){var W=C.split(`
|
|
4
|
-
`),de=P.split(`
|
|
5
|
-
`);for(g=c=0;c<W.length&&!W[c].includes("DetermineComponentFrameRoot");)c++;for(;g<de.length&&!de[g].includes("DetermineComponentFrameRoot");)g++;if(c===W.length||g===de.length)for(c=W.length-1,g=de.length-1;1<=c&&0<=g&&W[c]!==de[g];)g--;for(;1<=c&&0<=g;c--,g--)if(W[c]!==de[g]){if(c!==1||g!==1)do if(c--,g--,0>g||W[c]!==de[g]){var ge=`
|
|
6
|
-
`+W[c].replace(" at new "," at ");return t.displayName&&ge.includes("<anonymous>")&&(ge=ge.replace("<anonymous>",t.displayName)),ge}while(1<=c&&0<=g);break}}}finally{ie=!1,Error.prepareStackTrace=l}return(l=t?t.displayName||t.name:"")?T(l):""}function G(t,n){switch(t.tag){case 26:case 27:case 5:return T(t.type);case 16:return T("Lazy");case 13:return t.child!==n&&n!==null?T("Suspense Fallback"):T("Suspense");case 19:return T("SuspenseList");case 0:case 15:return Q(t.type,!1);case 11:return Q(t.type.render,!1);case 1:return Q(t.type,!0);case 31:return T("Activity");default:return""}}function H(t){try{var n="",l=null;do n+=G(t,l),l=t,t=t.return;while(t);return n}catch(c){return`
|
|
7
|
-
Error generating stack: `+c.message+`
|
|
8
|
-
`+c.stack}}var J=Object.prototype.hasOwnProperty,ye=e.unstable_scheduleCallback,Se=e.unstable_cancelCallback,ue=e.unstable_shouldYield,he=e.unstable_requestPaint,xe=e.unstable_now,ke=e.unstable_getCurrentPriorityLevel,ne=e.unstable_ImmediatePriority,pe=e.unstable_UserBlockingPriority,_e=e.unstable_NormalPriority,se=e.unstable_LowPriority,Te=e.unstable_IdlePriority,He=e.log,ht=e.unstable_setDisableYieldValue,Ue=null,at=null;function $t(t){if(typeof He=="function"&&ht(t),at&&typeof at.setStrictMode=="function")try{at.setStrictMode(Ue,t)}catch{}}var We=Math.clz32?Math.clz32:yu,Kn=Math.log,wn=Math.LN2;function yu(t){return t>>>=0,t===0?32:31-(Kn(t)/wn|0)|0}var ri=256,Sa=262144,nr=4194304;function zn(t){var n=t&42;if(n!==0)return n;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 Hs(t,n,l){var c=t.pendingLanes;if(c===0)return 0;var g=0,v=t.suspendedLanes,C=t.pingedLanes;t=t.warmLanes;var P=c&134217727;return P!==0?(c=P&~v,c!==0?g=zn(c):(C&=P,C!==0?g=zn(C):l||(l=P&~t,l!==0&&(g=zn(l))))):(P=c&~v,P!==0?g=zn(P):C!==0?g=zn(C):l||(l=c&~t,l!==0&&(g=zn(l)))),g===0?0:n!==0&&n!==g&&(n&v)===0&&(v=g&-g,l=n&-n,v>=l||v===32&&(l&4194048)!==0)?n:g}function dl(t,n){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&n)===0}function m2(t,n){switch(t){case 1:case 2:case 4:case 8:case 64:return n+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 n+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 up(){var t=nr;return nr<<=1,(nr&62914560)===0&&(nr=4194304),t}function xu(t){for(var n=[],l=0;31>l;l++)n.push(t);return n}function fl(t,n){t.pendingLanes|=n,n!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function p2(t,n,l,c,g,v){var C=t.pendingLanes;t.pendingLanes=l,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=l,t.entangledLanes&=l,t.errorRecoveryDisabledLanes&=l,t.shellSuspendCounter=0;var P=t.entanglements,W=t.expirationTimes,de=t.hiddenUpdates;for(l=C&~l;0<l;){var ge=31-We(l),we=1<<ge;P[ge]=0,W[ge]=-1;var fe=de[ge];if(fe!==null)for(de[ge]=null,ge=0;ge<fe.length;ge++){var me=fe[ge];me!==null&&(me.lane&=-536870913)}l&=~we}c!==0&&dp(t,c,0),v!==0&&g===0&&t.tag!==0&&(t.suspendedLanes|=v&~(C&~n))}function dp(t,n,l){t.pendingLanes|=n,t.suspendedLanes&=~n;var c=31-We(n);t.entangledLanes|=n,t.entanglements[c]=t.entanglements[c]|1073741824|l&261930}function fp(t,n){var l=t.entangledLanes|=n;for(t=t.entanglements;l;){var c=31-We(l),g=1<<c;g&n|t[c]&n&&(t[c]|=n),l&=~g}}function hp(t,n){var l=n&-n;return l=(l&42)!==0?1:vu(l),(l&(t.suspendedLanes|n))!==0?0:l}function vu(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 bu(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function mp(){var t=X.p;return t!==0?t:(t=window.event,t===void 0?32:Jx(t.type))}function pp(t,n){var l=X.p;try{return X.p=t,n()}finally{X.p=l}}var Pr=Math.random().toString(36).slice(2),Zt="__reactFiber$"+Pr,fn="__reactProps$"+Pr,ai="__reactContainer$"+Pr,wu="__reactEvents$"+Pr,g2="__reactListeners$"+Pr,y2="__reactHandles$"+Pr,gp="__reactResources$"+Pr,hl="__reactMarker$"+Pr;function Su(t){delete t[Zt],delete t[fn],delete t[wu],delete t[g2],delete t[y2]}function ii(t){var n=t[Zt];if(n)return n;for(var l=t.parentNode;l;){if(n=l[ai]||l[Zt]){if(l=n.alternate,n.child!==null||l!==null&&l.child!==null)for(t=Ix(t);t!==null;){if(l=t[Zt])return l;t=Ix(t)}return n}t=l,l=t.parentNode}return null}function li(t){if(t=t[Zt]||t[ai]){var n=t.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return t}return null}function ml(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t.stateNode;throw Error(i(33))}function si(t){var n=t[gp];return n||(n=t[gp]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function Vt(t){t[hl]=!0}var yp=new Set,xp={};function ka(t,n){oi(t,n),oi(t+"Capture",n)}function oi(t,n){for(xp[t]=n,t=0;t<n.length;t++)yp.add(n[t])}var x2=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]*$"),vp={},bp={};function v2(t){return J.call(bp,t)?!0:J.call(vp,t)?!1:x2.test(t)?bp[t]=!0:(vp[t]=!0,!1)}function qs(t,n,l){if(v2(n))if(l===null)t.removeAttribute(n);else{switch(typeof l){case"undefined":case"function":case"symbol":t.removeAttribute(n);return;case"boolean":var c=n.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){t.removeAttribute(n);return}}t.setAttribute(n,""+l)}}function Gs(t,n,l){if(l===null)t.removeAttribute(n);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(n);return}t.setAttribute(n,""+l)}}function gr(t,n,l,c){if(c===null)t.removeAttribute(l);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(l);return}t.setAttributeNS(n,l,""+c)}}function Mn(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function wp(t){var n=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function b2(t,n,l){var c=Object.getOwnPropertyDescriptor(t.constructor.prototype,n);if(!t.hasOwnProperty(n)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var g=c.get,v=c.set;return Object.defineProperty(t,n,{configurable:!0,get:function(){return g.call(this)},set:function(C){l=""+C,v.call(this,C)}}),Object.defineProperty(t,n,{enumerable:c.enumerable}),{getValue:function(){return l},setValue:function(C){l=""+C},stopTracking:function(){t._valueTracker=null,delete t[n]}}}}function ku(t){if(!t._valueTracker){var n=wp(t)?"checked":"value";t._valueTracker=b2(t,n,""+t[n])}}function Sp(t){if(!t)return!1;var n=t._valueTracker;if(!n)return!0;var l=n.getValue(),c="";return t&&(c=wp(t)?t.checked?"true":"false":t.value),t=c,t!==l?(n.setValue(t),!0):!1}function Ys(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 w2=/[\n"\\]/g;function Dn(t){return t.replace(w2,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function _u(t,n,l,c,g,v,C,P){t.name="",C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?t.type=C:t.removeAttribute("type"),n!=null?C==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+Mn(n)):t.value!==""+Mn(n)&&(t.value=""+Mn(n)):C!=="submit"&&C!=="reset"||t.removeAttribute("value"),n!=null?ju(t,C,Mn(n)):l!=null?ju(t,C,Mn(l)):c!=null&&t.removeAttribute("value"),g==null&&v!=null&&(t.defaultChecked=!!v),g!=null&&(t.checked=g&&typeof g!="function"&&typeof g!="symbol"),P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"?t.name=""+Mn(P):t.removeAttribute("name")}function kp(t,n,l,c,g,v,C,P){if(v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(t.type=v),n!=null||l!=null){if(!(v!=="submit"&&v!=="reset"||n!=null)){ku(t);return}l=l!=null?""+Mn(l):"",n=n!=null?""+Mn(n):l,P||n===t.value||(t.value=n),t.defaultValue=n}c=c??g,c=typeof c!="function"&&typeof c!="symbol"&&!!c,t.checked=P?t.checked:!!c,t.defaultChecked=!!c,C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"&&(t.name=C),ku(t)}function ju(t,n,l){n==="number"&&Ys(t.ownerDocument)===t||t.defaultValue===""+l||(t.defaultValue=""+l)}function ci(t,n,l,c){if(t=t.options,n){n={};for(var g=0;g<l.length;g++)n["$"+l[g]]=!0;for(l=0;l<t.length;l++)g=n.hasOwnProperty("$"+t[l].value),t[l].selected!==g&&(t[l].selected=g),g&&c&&(t[l].defaultSelected=!0)}else{for(l=""+Mn(l),n=null,g=0;g<t.length;g++){if(t[g].value===l){t[g].selected=!0,c&&(t[g].defaultSelected=!0);return}n!==null||t[g].disabled||(n=t[g])}n!==null&&(n.selected=!0)}}function _p(t,n,l){if(n!=null&&(n=""+Mn(n),n!==t.value&&(t.value=n),l==null)){t.defaultValue!==n&&(t.defaultValue=n);return}t.defaultValue=l!=null?""+Mn(l):""}function jp(t,n,l,c){if(n==null){if(c!=null){if(l!=null)throw Error(i(92));if(q(c)){if(1<c.length)throw Error(i(93));c=c[0]}l=c}l==null&&(l=""),n=l}l=Mn(n),t.defaultValue=l,c=t.textContent,c===l&&c!==""&&c!==null&&(t.value=c),ku(t)}function ui(t,n){if(n){var l=t.firstChild;if(l&&l===t.lastChild&&l.nodeType===3){l.nodeValue=n;return}}t.textContent=n}var S2=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 Cp(t,n,l){var c=n.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?c?t.setProperty(n,""):n==="float"?t.cssFloat="":t[n]="":c?t.setProperty(n,l):typeof l!="number"||l===0||S2.has(n)?n==="float"?t.cssFloat=l:t[n]=(""+l).trim():t[n]=l+"px"}function Ep(t,n,l){if(n!=null&&typeof n!="object")throw Error(i(62));if(t=t.style,l!=null){for(var c in l)!l.hasOwnProperty(c)||n!=null&&n.hasOwnProperty(c)||(c.indexOf("--")===0?t.setProperty(c,""):c==="float"?t.cssFloat="":t[c]="");for(var g in n)c=n[g],n.hasOwnProperty(g)&&l[g]!==c&&Cp(t,g,c)}else for(var v in n)n.hasOwnProperty(v)&&Cp(t,v,n[v])}function Cu(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 k2=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"]]),_2=/^[\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 $s(t){return _2.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function yr(){}var Eu=null;function Nu(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var di=null,fi=null;function Np(t){var n=li(t);if(n&&(t=n.stateNode)){var l=t[fn]||null;e:switch(t=n.stateNode,n.type){case"input":if(_u(t,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),n=l.name,l.type==="radio"&&n!=null){for(l=t;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+Dn(""+n)+'"][type="radio"]'),n=0;n<l.length;n++){var c=l[n];if(c!==t&&c.form===t.form){var g=c[fn]||null;if(!g)throw Error(i(90));_u(c,g.value,g.defaultValue,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name)}}for(n=0;n<l.length;n++)c=l[n],c.form===t.form&&Sp(c)}break e;case"textarea":_p(t,l.value,l.defaultValue);break e;case"select":n=l.value,n!=null&&ci(t,!!l.multiple,n,!1)}}}var Au=!1;function Ap(t,n,l){if(Au)return t(n,l);Au=!0;try{var c=t(n);return c}finally{if(Au=!1,(di!==null||fi!==null)&&(Mo(),di&&(n=di,t=fi,fi=di=null,Np(n),t)))for(n=0;n<t.length;n++)Np(t[n])}}function pl(t,n){var l=t.stateNode;if(l===null)return null;var c=l[fn]||null;if(c===null)return null;l=c[n];e:switch(n){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(l&&typeof l!="function")throw Error(i(231,n,typeof l));return l}var xr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Tu=!1;if(xr)try{var gl={};Object.defineProperty(gl,"passive",{get:function(){Tu=!0}}),window.addEventListener("test",gl,gl),window.removeEventListener("test",gl,gl)}catch{Tu=!1}var Ur=null,Ru=null,Vs=null;function Tp(){if(Vs)return Vs;var t,n=Ru,l=n.length,c,g="value"in Ur?Ur.value:Ur.textContent,v=g.length;for(t=0;t<l&&n[t]===g[t];t++);var C=l-t;for(c=1;c<=C&&n[l-c]===g[v-c];c++);return Vs=g.slice(t,1<c?1-c:void 0)}function Ks(t){var n=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&n===13&&(t=13)):t=n,t===10&&(t=13),32<=t||t===13?t:0}function Xs(){return!0}function Rp(){return!1}function hn(t){function n(l,c,g,v,C){this._reactName=l,this._targetInst=g,this.type=c,this.nativeEvent=v,this.target=C,this.currentTarget=null;for(var P in t)t.hasOwnProperty(P)&&(l=t[P],this[P]=l?l(v):v[P]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?Xs:Rp,this.isPropagationStopped=Rp,this}return p(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=Xs)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Xs)},persist:function(){},isPersistent:Xs}),n}var _a={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Zs=hn(_a),yl=p({},_a,{view:0,detail:0}),j2=hn(yl),Ou,zu,xl,Qs=p({},yl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Du,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!==xl&&(xl&&t.type==="mousemove"?(Ou=t.screenX-xl.screenX,zu=t.screenY-xl.screenY):zu=Ou=0,xl=t),Ou)},movementY:function(t){return"movementY"in t?t.movementY:zu}}),Op=hn(Qs),C2=p({},Qs,{dataTransfer:0}),E2=hn(C2),N2=p({},yl,{relatedTarget:0}),Mu=hn(N2),A2=p({},_a,{animationName:0,elapsedTime:0,pseudoElement:0}),T2=hn(A2),R2=p({},_a,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),O2=hn(R2),z2=p({},_a,{data:0}),zp=hn(z2),M2={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},D2={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"},L2={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function I2(t){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(t):(t=L2[t])?!!n[t]:!1}function Du(){return I2}var P2=p({},yl,{key:function(t){if(t.key){var n=M2[t.key]||t.key;if(n!=="Unidentified")return n}return t.type==="keypress"?(t=Ks(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?D2[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Du,charCode:function(t){return t.type==="keypress"?Ks(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Ks(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),U2=hn(P2),B2=p({},Qs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Mp=hn(B2),F2=p({},yl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Du}),H2=hn(F2),q2=p({},_a,{propertyName:0,elapsedTime:0,pseudoElement:0}),G2=hn(q2),Y2=p({},Qs,{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}),$2=hn(Y2),V2=p({},_a,{newState:0,oldState:0}),K2=hn(V2),X2=[9,13,27,32],Lu=xr&&"CompositionEvent"in window,vl=null;xr&&"documentMode"in document&&(vl=document.documentMode);var Z2=xr&&"TextEvent"in window&&!vl,Dp=xr&&(!Lu||vl&&8<vl&&11>=vl),Lp=" ",Ip=!1;function Pp(t,n){switch(t){case"keyup":return X2.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Up(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var hi=!1;function Q2(t,n){switch(t){case"compositionend":return Up(n);case"keypress":return n.which!==32?null:(Ip=!0,Lp);case"textInput":return t=n.data,t===Lp&&Ip?null:t;default:return null}}function W2(t,n){if(hi)return t==="compositionend"||!Lu&&Pp(t,n)?(t=Tp(),Vs=Ru=Ur=null,hi=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return Dp&&n.locale!=="ko"?null:n.data;default:return null}}var J2={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 Bp(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n==="input"?!!J2[t.type]:n==="textarea"}function Fp(t,n,l,c){di?fi?fi.push(c):fi=[c]:di=c,n=Fo(n,"onChange"),0<n.length&&(l=new Zs("onChange","change",null,l,c),t.push({event:l,listeners:n}))}var bl=null,wl=null;function e_(t){kx(t,0)}function Ws(t){var n=ml(t);if(Sp(n))return t}function Hp(t,n){if(t==="change")return n}var qp=!1;if(xr){var Iu;if(xr){var Pu="oninput"in document;if(!Pu){var Gp=document.createElement("div");Gp.setAttribute("oninput","return;"),Pu=typeof Gp.oninput=="function"}Iu=Pu}else Iu=!1;qp=Iu&&(!document.documentMode||9<document.documentMode)}function Yp(){bl&&(bl.detachEvent("onpropertychange",$p),wl=bl=null)}function $p(t){if(t.propertyName==="value"&&Ws(wl)){var n=[];Fp(n,wl,t,Nu(t)),Ap(e_,n)}}function t_(t,n,l){t==="focusin"?(Yp(),bl=n,wl=l,bl.attachEvent("onpropertychange",$p)):t==="focusout"&&Yp()}function n_(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Ws(wl)}function r_(t,n){if(t==="click")return Ws(n)}function a_(t,n){if(t==="input"||t==="change")return Ws(n)}function i_(t,n){return t===n&&(t!==0||1/t===1/n)||t!==t&&n!==n}var Sn=typeof Object.is=="function"?Object.is:i_;function Sl(t,n){if(Sn(t,n))return!0;if(typeof t!="object"||t===null||typeof n!="object"||n===null)return!1;var l=Object.keys(t),c=Object.keys(n);if(l.length!==c.length)return!1;for(c=0;c<l.length;c++){var g=l[c];if(!J.call(n,g)||!Sn(t[g],n[g]))return!1}return!0}function Vp(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Kp(t,n){var l=Vp(t);t=0;for(var c;l;){if(l.nodeType===3){if(c=t+l.textContent.length,t<=n&&c>=n)return{node:l,offset:n-t};t=c}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Vp(l)}}function Xp(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?Xp(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function Zp(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var n=Ys(t.document);n instanceof t.HTMLIFrameElement;){try{var l=typeof n.contentWindow.location.href=="string"}catch{l=!1}if(l)t=n.contentWindow;else break;n=Ys(t.document)}return n}function Uu(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n&&(n==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||n==="textarea"||t.contentEditable==="true")}var l_=xr&&"documentMode"in document&&11>=document.documentMode,mi=null,Bu=null,kl=null,Fu=!1;function Qp(t,n,l){var c=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Fu||mi==null||mi!==Ys(c)||(c=mi,"selectionStart"in c&&Uu(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}),kl&&Sl(kl,c)||(kl=c,c=Fo(Bu,"onSelect"),0<c.length&&(n=new Zs("onSelect","select",null,n,l),t.push({event:n,listeners:c}),n.target=mi)))}function ja(t,n){var l={};return l[t.toLowerCase()]=n.toLowerCase(),l["Webkit"+t]="webkit"+n,l["Moz"+t]="moz"+n,l}var pi={animationend:ja("Animation","AnimationEnd"),animationiteration:ja("Animation","AnimationIteration"),animationstart:ja("Animation","AnimationStart"),transitionrun:ja("Transition","TransitionRun"),transitionstart:ja("Transition","TransitionStart"),transitioncancel:ja("Transition","TransitionCancel"),transitionend:ja("Transition","TransitionEnd")},Hu={},Wp={};xr&&(Wp=document.createElement("div").style,"AnimationEvent"in window||(delete pi.animationend.animation,delete pi.animationiteration.animation,delete pi.animationstart.animation),"TransitionEvent"in window||delete pi.transitionend.transition);function Ca(t){if(Hu[t])return Hu[t];if(!pi[t])return t;var n=pi[t],l;for(l in n)if(n.hasOwnProperty(l)&&l in Wp)return Hu[t]=n[l];return t}var Jp=Ca("animationend"),eg=Ca("animationiteration"),tg=Ca("animationstart"),s_=Ca("transitionrun"),o_=Ca("transitionstart"),c_=Ca("transitioncancel"),ng=Ca("transitionend"),rg=new Map,qu="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(" ");qu.push("scrollEnd");function Xn(t,n){rg.set(t,n),ka(n,[t])}var Js=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=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(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},Ln=[],gi=0,Gu=0;function eo(){for(var t=gi,n=Gu=gi=0;n<t;){var l=Ln[n];Ln[n++]=null;var c=Ln[n];Ln[n++]=null;var g=Ln[n];Ln[n++]=null;var v=Ln[n];if(Ln[n++]=null,c!==null&&g!==null){var C=c.pending;C===null?g.next=g:(g.next=C.next,C.next=g),c.pending=g}v!==0&&ag(l,g,v)}}function to(t,n,l,c){Ln[gi++]=t,Ln[gi++]=n,Ln[gi++]=l,Ln[gi++]=c,Gu|=c,t.lanes|=c,t=t.alternate,t!==null&&(t.lanes|=c)}function Yu(t,n,l,c){return to(t,n,l,c),no(t)}function Ea(t,n){return to(t,null,null,n),no(t)}function ag(t,n,l){t.lanes|=l;var c=t.alternate;c!==null&&(c.lanes|=l);for(var g=!1,v=t.return;v!==null;)v.childLanes|=l,c=v.alternate,c!==null&&(c.childLanes|=l),v.tag===22&&(t=v.stateNode,t===null||t._visibility&1||(g=!0)),t=v,v=v.return;return t.tag===3?(v=t.stateNode,g&&n!==null&&(g=31-We(l),t=v.hiddenUpdates,c=t[g],c===null?t[g]=[n]:c.push(n),n.lane=l|536870912),v):null}function no(t){if(50<Yl)throw Yl=0,ef=null,Error(i(185));for(var n=t.return;n!==null;)t=n,n=t.return;return t.tag===3?t.stateNode:null}var yi={};function u_(t,n,l,c){this.tag=t,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,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 kn(t,n,l,c){return new u_(t,n,l,c)}function $u(t){return t=t.prototype,!(!t||!t.isReactComponent)}function vr(t,n){var l=t.alternate;return l===null?(l=kn(t.tag,n,t.key,t.mode),l.elementType=t.elementType,l.type=t.type,l.stateNode=t.stateNode,l.alternate=t,t.alternate=l):(l.pendingProps=n,l.type=t.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=t.flags&65011712,l.childLanes=t.childLanes,l.lanes=t.lanes,l.child=t.child,l.memoizedProps=t.memoizedProps,l.memoizedState=t.memoizedState,l.updateQueue=t.updateQueue,n=t.dependencies,l.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},l.sibling=t.sibling,l.index=t.index,l.ref=t.ref,l.refCleanup=t.refCleanup,l}function ig(t,n){t.flags&=65011714;var l=t.alternate;return l===null?(t.childLanes=0,t.lanes=n,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=l.childLanes,t.lanes=l.lanes,t.child=l.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=l.memoizedProps,t.memoizedState=l.memoizedState,t.updateQueue=l.updateQueue,t.type=l.type,n=l.dependencies,t.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),t}function ro(t,n,l,c,g,v){var C=0;if(c=t,typeof t=="function")$u(t)&&(C=1);else if(typeof t=="string")C=pj(t,l,le.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case K:return t=kn(31,l,n,g),t.elementType=K,t.lanes=v,t;case w:return Na(l.children,g,v,n);case _:C=8,g|=24;break;case k:return t=kn(12,l,n,g|2),t.elementType=k,t.lanes=v,t;case M:return t=kn(13,l,n,g),t.elementType=M,t.lanes=v,t;case D:return t=kn(19,l,n,g),t.elementType=D,t.lanes=v,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case A:C=10;break e;case N:C=9;break e;case O:C=11;break e;case B:C=14;break e;case V:C=16,c=null;break e}C=29,l=Error(i(130,t===null?"null":typeof t,"")),c=null}return n=kn(C,l,n,g),n.elementType=t,n.type=c,n.lanes=v,n}function Na(t,n,l,c){return t=kn(7,t,c,n),t.lanes=l,t}function Vu(t,n,l){return t=kn(6,t,null,n),t.lanes=l,t}function lg(t){var n=kn(18,null,null,0);return n.stateNode=t,n}function Ku(t,n,l){return n=kn(4,t.children!==null?t.children:[],t.key,n),n.lanes=l,n.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},n}var sg=new WeakMap;function In(t,n){if(typeof t=="object"&&t!==null){var l=sg.get(t);return l!==void 0?l:(n={value:t,source:n,stack:H(n)},sg.set(t,n),n)}return{value:t,source:n,stack:H(n)}}var xi=[],vi=0,ao=null,_l=0,Pn=[],Un=0,Br=null,rr=1,ar="";function br(t,n){xi[vi++]=_l,xi[vi++]=ao,ao=t,_l=n}function og(t,n,l){Pn[Un++]=rr,Pn[Un++]=ar,Pn[Un++]=Br,Br=t;var c=rr;t=ar;var g=32-We(c)-1;c&=~(1<<g),l+=1;var v=32-We(n)+g;if(30<v){var C=g-g%5;v=(c&(1<<C)-1).toString(32),c>>=C,g-=C,rr=1<<32-We(n)+g|l<<g|c,ar=v+t}else rr=1<<v|l<<g|c,ar=t}function Xu(t){t.return!==null&&(br(t,1),og(t,1,0))}function Zu(t){for(;t===ao;)ao=xi[--vi],xi[vi]=null,_l=xi[--vi],xi[vi]=null;for(;t===Br;)Br=Pn[--Un],Pn[Un]=null,ar=Pn[--Un],Pn[Un]=null,rr=Pn[--Un],Pn[Un]=null}function cg(t,n){Pn[Un++]=rr,Pn[Un++]=ar,Pn[Un++]=Br,rr=n.id,ar=n.overflow,Br=t}var Qt=null,_t=null,it=!1,Fr=null,Bn=!1,Qu=Error(i(519));function Hr(t){var n=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw jl(In(n,t)),Qu}function ug(t){var n=t.stateNode,l=t.type,c=t.memoizedProps;switch(n[Zt]=t,n[fn]=c,l){case"dialog":et("cancel",n),et("close",n);break;case"iframe":case"object":case"embed":et("load",n);break;case"video":case"audio":for(l=0;l<Vl.length;l++)et(Vl[l],n);break;case"source":et("error",n);break;case"img":case"image":case"link":et("error",n),et("load",n);break;case"details":et("toggle",n);break;case"input":et("invalid",n),kp(n,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":et("invalid",n);break;case"textarea":et("invalid",n),jp(n,c.value,c.defaultValue,c.children)}l=c.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||n.textContent===""+l||c.suppressHydrationWarning===!0||Ex(n.textContent,l)?(c.popover!=null&&(et("beforetoggle",n),et("toggle",n)),c.onScroll!=null&&et("scroll",n),c.onScrollEnd!=null&&et("scrollend",n),c.onClick!=null&&(n.onclick=yr),n=!0):n=!1,n||Hr(t,!0)}function dg(t){for(Qt=t.return;Qt;)switch(Qt.tag){case 5:case 31:case 13:Bn=!1;return;case 27:case 3:Bn=!0;return;default:Qt=Qt.return}}function bi(t){if(t!==Qt)return!1;if(!it)return dg(t),it=!0,!1;var n=t.tag,l;if((l=n!==3&&n!==27)&&((l=n===5)&&(l=t.type,l=!(l!=="form"&&l!=="button")||gf(t.type,t.memoizedProps)),l=!l),l&&_t&&Hr(t),dg(t),n===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(i(317));_t=Lx(t)}else if(n===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(i(317));_t=Lx(t)}else n===27?(n=_t,na(t.type)?(t=wf,wf=null,_t=t):_t=n):_t=Qt?Hn(t.stateNode.nextSibling):null;return!0}function Aa(){_t=Qt=null,it=!1}function Wu(){var t=Fr;return t!==null&&(yn===null?yn=t:yn.push.apply(yn,t),Fr=null),t}function jl(t){Fr===null?Fr=[t]:Fr.push(t)}var Ju=R(null),Ta=null,wr=null;function qr(t,n,l){L(Ju,n._currentValue),n._currentValue=l}function Sr(t){t._currentValue=Ju.current,F(Ju)}function ed(t,n,l){for(;t!==null;){var c=t.alternate;if((t.childLanes&n)!==n?(t.childLanes|=n,c!==null&&(c.childLanes|=n)):c!==null&&(c.childLanes&n)!==n&&(c.childLanes|=n),t===l)break;t=t.return}}function td(t,n,l,c){var g=t.child;for(g!==null&&(g.return=t);g!==null;){var v=g.dependencies;if(v!==null){var C=g.child;v=v.firstContext;e:for(;v!==null;){var P=v;v=g;for(var W=0;W<n.length;W++)if(P.context===n[W]){v.lanes|=l,P=v.alternate,P!==null&&(P.lanes|=l),ed(v.return,l,t),c||(C=null);break e}v=P.next}}else if(g.tag===18){if(C=g.return,C===null)throw Error(i(341));C.lanes|=l,v=C.alternate,v!==null&&(v.lanes|=l),ed(C,l,t),C=null}else C=g.child;if(C!==null)C.return=g;else for(C=g;C!==null;){if(C===t){C=null;break}if(g=C.sibling,g!==null){g.return=C.return,C=g;break}C=C.return}g=C}}function wi(t,n,l,c){t=null;for(var g=n,v=!1;g!==null;){if(!v){if((g.flags&524288)!==0)v=!0;else if((g.flags&262144)!==0)break}if(g.tag===10){var C=g.alternate;if(C===null)throw Error(i(387));if(C=C.memoizedProps,C!==null){var P=g.type;Sn(g.pendingProps.value,C.value)||(t!==null?t.push(P):t=[P])}}else if(g===Ce.current){if(C=g.alternate,C===null)throw Error(i(387));C.memoizedState.memoizedState!==g.memoizedState.memoizedState&&(t!==null?t.push(Wl):t=[Wl])}g=g.return}t!==null&&td(n,t,l,c),n.flags|=262144}function io(t){for(t=t.firstContext;t!==null;){if(!Sn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Ra(t){Ta=t,wr=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Wt(t){return fg(Ta,t)}function lo(t,n){return Ta===null&&Ra(t),fg(t,n)}function fg(t,n){var l=n._currentValue;if(n={context:n,memoizedValue:l,next:null},wr===null){if(t===null)throw Error(i(308));wr=n,t.dependencies={lanes:0,firstContext:n},t.flags|=524288}else wr=wr.next=n;return l}var d_=typeof AbortController<"u"?AbortController:function(){var t=[],n=this.signal={aborted:!1,addEventListener:function(l,c){t.push(c)}};this.abort=function(){n.aborted=!0,t.forEach(function(l){return l()})}},f_=e.unstable_scheduleCallback,h_=e.unstable_NormalPriority,Pt={$$typeof:A,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function nd(){return{controller:new d_,data:new Map,refCount:0}}function Cl(t){t.refCount--,t.refCount===0&&f_(h_,function(){t.controller.abort()})}var El=null,rd=0,Si=0,ki=null;function m_(t,n){if(El===null){var l=El=[];rd=0,Si=sf(),ki={status:"pending",value:void 0,then:function(c){l.push(c)}}}return rd++,n.then(hg,hg),n}function hg(){if(--rd===0&&El!==null){ki!==null&&(ki.status="fulfilled");var t=El;El=null,Si=0,ki=null;for(var n=0;n<t.length;n++)(0,t[n])()}}function p_(t,n){var l=[],c={status:"pending",value:null,reason:null,then:function(g){l.push(g)}};return t.then(function(){c.status="fulfilled",c.value=n;for(var g=0;g<l.length;g++)(0,l[g])(n)},function(g){for(c.status="rejected",c.reason=g,g=0;g<l.length;g++)(0,l[g])(void 0)}),c}var mg=$.S;$.S=function(t,n){Qy=xe(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&m_(t,n),mg!==null&&mg(t,n)};var Oa=R(null);function ad(){var t=Oa.current;return t!==null?t:vt.pooledCache}function so(t,n){n===null?L(Oa,Oa.current):L(Oa,n.pool)}function pg(){var t=ad();return t===null?null:{parent:Pt._currentValue,pool:t}}var _i=Error(i(460)),id=Error(i(474)),oo=Error(i(542)),co={then:function(){}};function gg(t){return t=t.status,t==="fulfilled"||t==="rejected"}function yg(t,n,l){switch(l=t[l],l===void 0?t.push(n):l!==n&&(n.then(yr,yr),n=l),n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,vg(t),t;default:if(typeof n.status=="string")n.then(yr,yr);else{if(t=vt,t!==null&&100<t.shellSuspendCounter)throw Error(i(482));t=n,t.status="pending",t.then(function(c){if(n.status==="pending"){var g=n;g.status="fulfilled",g.value=c}},function(c){if(n.status==="pending"){var g=n;g.status="rejected",g.reason=c}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,vg(t),t}throw Ma=n,_i}}function za(t){try{var n=t._init;return n(t._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(Ma=l,_i):l}}var Ma=null;function xg(){if(Ma===null)throw Error(i(459));var t=Ma;return Ma=null,t}function vg(t){if(t===_i||t===oo)throw Error(i(483))}var ji=null,Nl=0;function uo(t){var n=Nl;return Nl+=1,ji===null&&(ji=[]),yg(ji,t,n)}function Al(t,n){n=n.props.ref,t.ref=n!==void 0?n:null}function fo(t,n){throw n.$$typeof===b?Error(i(525)):(t=Object.prototype.toString.call(n),Error(i(31,t==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":t)))}function bg(t){function n(ae,ee){if(t){var ce=ae.deletions;ce===null?(ae.deletions=[ee],ae.flags|=16):ce.push(ee)}}function l(ae,ee){if(!t)return null;for(;ee!==null;)n(ae,ee),ee=ee.sibling;return null}function c(ae){for(var ee=new Map;ae!==null;)ae.key!==null?ee.set(ae.key,ae):ee.set(ae.index,ae),ae=ae.sibling;return ee}function g(ae,ee){return ae=vr(ae,ee),ae.index=0,ae.sibling=null,ae}function v(ae,ee,ce){return ae.index=ce,t?(ce=ae.alternate,ce!==null?(ce=ce.index,ce<ee?(ae.flags|=67108866,ee):ce):(ae.flags|=67108866,ee)):(ae.flags|=1048576,ee)}function C(ae){return t&&ae.alternate===null&&(ae.flags|=67108866),ae}function P(ae,ee,ce,be){return ee===null||ee.tag!==6?(ee=Vu(ce,ae.mode,be),ee.return=ae,ee):(ee=g(ee,ce),ee.return=ae,ee)}function W(ae,ee,ce,be){var Be=ce.type;return Be===w?ge(ae,ee,ce.props.children,be,ce.key):ee!==null&&(ee.elementType===Be||typeof Be=="object"&&Be!==null&&Be.$$typeof===V&&za(Be)===ee.type)?(ee=g(ee,ce.props),Al(ee,ce),ee.return=ae,ee):(ee=ro(ce.type,ce.key,ce.props,null,ae.mode,be),Al(ee,ce),ee.return=ae,ee)}function de(ae,ee,ce,be){return ee===null||ee.tag!==4||ee.stateNode.containerInfo!==ce.containerInfo||ee.stateNode.implementation!==ce.implementation?(ee=Ku(ce,ae.mode,be),ee.return=ae,ee):(ee=g(ee,ce.children||[]),ee.return=ae,ee)}function ge(ae,ee,ce,be,Be){return ee===null||ee.tag!==7?(ee=Na(ce,ae.mode,be,Be),ee.return=ae,ee):(ee=g(ee,ce),ee.return=ae,ee)}function we(ae,ee,ce){if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return ee=Vu(""+ee,ae.mode,ce),ee.return=ae,ee;if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case x:return ce=ro(ee.type,ee.key,ee.props,null,ae.mode,ce),Al(ce,ee),ce.return=ae,ce;case S:return ee=Ku(ee,ae.mode,ce),ee.return=ae,ee;case V:return ee=za(ee),we(ae,ee,ce)}if(q(ee)||I(ee))return ee=Na(ee,ae.mode,ce,null),ee.return=ae,ee;if(typeof ee.then=="function")return we(ae,uo(ee),ce);if(ee.$$typeof===A)return we(ae,lo(ae,ee),ce);fo(ae,ee)}return null}function fe(ae,ee,ce,be){var Be=ee!==null?ee.key:null;if(typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint")return Be!==null?null:P(ae,ee,""+ce,be);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case x:return ce.key===Be?W(ae,ee,ce,be):null;case S:return ce.key===Be?de(ae,ee,ce,be):null;case V:return ce=za(ce),fe(ae,ee,ce,be)}if(q(ce)||I(ce))return Be!==null?null:ge(ae,ee,ce,be,null);if(typeof ce.then=="function")return fe(ae,ee,uo(ce),be);if(ce.$$typeof===A)return fe(ae,ee,lo(ae,ce),be);fo(ae,ce)}return null}function me(ae,ee,ce,be,Be){if(typeof be=="string"&&be!==""||typeof be=="number"||typeof be=="bigint")return ae=ae.get(ce)||null,P(ee,ae,""+be,Be);if(typeof be=="object"&&be!==null){switch(be.$$typeof){case x:return ae=ae.get(be.key===null?ce:be.key)||null,W(ee,ae,be,Be);case S:return ae=ae.get(be.key===null?ce:be.key)||null,de(ee,ae,be,Be);case V:return be=za(be),me(ae,ee,ce,be,Be)}if(q(be)||I(be))return ae=ae.get(ce)||null,ge(ee,ae,be,Be,null);if(typeof be.then=="function")return me(ae,ee,ce,uo(be),Be);if(be.$$typeof===A)return me(ae,ee,ce,lo(ee,be),Be);fo(ee,be)}return null}function Oe(ae,ee,ce,be){for(var Be=null,ct=null,Pe=ee,Xe=ee=0,rt=null;Pe!==null&&Xe<ce.length;Xe++){Pe.index>Xe?(rt=Pe,Pe=null):rt=Pe.sibling;var ut=fe(ae,Pe,ce[Xe],be);if(ut===null){Pe===null&&(Pe=rt);break}t&&Pe&&ut.alternate===null&&n(ae,Pe),ee=v(ut,ee,Xe),ct===null?Be=ut:ct.sibling=ut,ct=ut,Pe=rt}if(Xe===ce.length)return l(ae,Pe),it&&br(ae,Xe),Be;if(Pe===null){for(;Xe<ce.length;Xe++)Pe=we(ae,ce[Xe],be),Pe!==null&&(ee=v(Pe,ee,Xe),ct===null?Be=Pe:ct.sibling=Pe,ct=Pe);return it&&br(ae,Xe),Be}for(Pe=c(Pe);Xe<ce.length;Xe++)rt=me(Pe,ae,Xe,ce[Xe],be),rt!==null&&(t&&rt.alternate!==null&&Pe.delete(rt.key===null?Xe:rt.key),ee=v(rt,ee,Xe),ct===null?Be=rt:ct.sibling=rt,ct=rt);return t&&Pe.forEach(function(sa){return n(ae,sa)}),it&&br(ae,Xe),Be}function Ye(ae,ee,ce,be){if(ce==null)throw Error(i(151));for(var Be=null,ct=null,Pe=ee,Xe=ee=0,rt=null,ut=ce.next();Pe!==null&&!ut.done;Xe++,ut=ce.next()){Pe.index>Xe?(rt=Pe,Pe=null):rt=Pe.sibling;var sa=fe(ae,Pe,ut.value,be);if(sa===null){Pe===null&&(Pe=rt);break}t&&Pe&&sa.alternate===null&&n(ae,Pe),ee=v(sa,ee,Xe),ct===null?Be=sa:ct.sibling=sa,ct=sa,Pe=rt}if(ut.done)return l(ae,Pe),it&&br(ae,Xe),Be;if(Pe===null){for(;!ut.done;Xe++,ut=ce.next())ut=we(ae,ut.value,be),ut!==null&&(ee=v(ut,ee,Xe),ct===null?Be=ut:ct.sibling=ut,ct=ut);return it&&br(ae,Xe),Be}for(Pe=c(Pe);!ut.done;Xe++,ut=ce.next())ut=me(Pe,ae,Xe,ut.value,be),ut!==null&&(t&&ut.alternate!==null&&Pe.delete(ut.key===null?Xe:ut.key),ee=v(ut,ee,Xe),ct===null?Be=ut:ct.sibling=ut,ct=ut);return t&&Pe.forEach(function(Cj){return n(ae,Cj)}),it&&br(ae,Xe),Be}function xt(ae,ee,ce,be){if(typeof ce=="object"&&ce!==null&&ce.type===w&&ce.key===null&&(ce=ce.props.children),typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case x:e:{for(var Be=ce.key;ee!==null;){if(ee.key===Be){if(Be=ce.type,Be===w){if(ee.tag===7){l(ae,ee.sibling),be=g(ee,ce.props.children),be.return=ae,ae=be;break e}}else if(ee.elementType===Be||typeof Be=="object"&&Be!==null&&Be.$$typeof===V&&za(Be)===ee.type){l(ae,ee.sibling),be=g(ee,ce.props),Al(be,ce),be.return=ae,ae=be;break e}l(ae,ee);break}else n(ae,ee);ee=ee.sibling}ce.type===w?(be=Na(ce.props.children,ae.mode,be,ce.key),be.return=ae,ae=be):(be=ro(ce.type,ce.key,ce.props,null,ae.mode,be),Al(be,ce),be.return=ae,ae=be)}return C(ae);case S:e:{for(Be=ce.key;ee!==null;){if(ee.key===Be)if(ee.tag===4&&ee.stateNode.containerInfo===ce.containerInfo&&ee.stateNode.implementation===ce.implementation){l(ae,ee.sibling),be=g(ee,ce.children||[]),be.return=ae,ae=be;break e}else{l(ae,ee);break}else n(ae,ee);ee=ee.sibling}be=Ku(ce,ae.mode,be),be.return=ae,ae=be}return C(ae);case V:return ce=za(ce),xt(ae,ee,ce,be)}if(q(ce))return Oe(ae,ee,ce,be);if(I(ce)){if(Be=I(ce),typeof Be!="function")throw Error(i(150));return ce=Be.call(ce),Ye(ae,ee,ce,be)}if(typeof ce.then=="function")return xt(ae,ee,uo(ce),be);if(ce.$$typeof===A)return xt(ae,ee,lo(ae,ce),be);fo(ae,ce)}return typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint"?(ce=""+ce,ee!==null&&ee.tag===6?(l(ae,ee.sibling),be=g(ee,ce),be.return=ae,ae=be):(l(ae,ee),be=Vu(ce,ae.mode,be),be.return=ae,ae=be),C(ae)):l(ae,ee)}return function(ae,ee,ce,be){try{Nl=0;var Be=xt(ae,ee,ce,be);return ji=null,Be}catch(Pe){if(Pe===_i||Pe===oo)throw Pe;var ct=kn(29,Pe,null,ae.mode);return ct.lanes=be,ct.return=ae,ct}}}var Da=bg(!0),wg=bg(!1),Gr=!1;function ld(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function sd(t,n){t=t.updateQueue,n.updateQueue===t&&(n.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Yr(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function $r(t,n,l){var c=t.updateQueue;if(c===null)return null;if(c=c.shared,(ft&2)!==0){var g=c.pending;return g===null?n.next=n:(n.next=g.next,g.next=n),c.pending=n,n=no(t),ag(t,null,l),n}return to(t,c,n,l),no(t)}function Tl(t,n,l){if(n=n.updateQueue,n!==null&&(n=n.shared,(l&4194048)!==0)){var c=n.lanes;c&=t.pendingLanes,l|=c,n.lanes=l,fp(t,l)}}function od(t,n){var l=t.updateQueue,c=t.alternate;if(c!==null&&(c=c.updateQueue,l===c)){var g=null,v=null;if(l=l.firstBaseUpdate,l!==null){do{var C={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};v===null?g=v=C:v=v.next=C,l=l.next}while(l!==null);v===null?g=v=n:v=v.next=n}else g=v=n;l={baseState:c.baseState,firstBaseUpdate:g,lastBaseUpdate:v,shared:c.shared,callbacks:c.callbacks},t.updateQueue=l;return}t=l.lastBaseUpdate,t===null?l.firstBaseUpdate=n:t.next=n,l.lastBaseUpdate=n}var cd=!1;function Rl(){if(cd){var t=ki;if(t!==null)throw t}}function Ol(t,n,l,c){cd=!1;var g=t.updateQueue;Gr=!1;var v=g.firstBaseUpdate,C=g.lastBaseUpdate,P=g.shared.pending;if(P!==null){g.shared.pending=null;var W=P,de=W.next;W.next=null,C===null?v=de:C.next=de,C=W;var ge=t.alternate;ge!==null&&(ge=ge.updateQueue,P=ge.lastBaseUpdate,P!==C&&(P===null?ge.firstBaseUpdate=de:P.next=de,ge.lastBaseUpdate=W))}if(v!==null){var we=g.baseState;C=0,ge=de=W=null,P=v;do{var fe=P.lane&-536870913,me=fe!==P.lane;if(me?(nt&fe)===fe:(c&fe)===fe){fe!==0&&fe===Si&&(cd=!0),ge!==null&&(ge=ge.next={lane:0,tag:P.tag,payload:P.payload,callback:null,next:null});e:{var Oe=t,Ye=P;fe=n;var xt=l;switch(Ye.tag){case 1:if(Oe=Ye.payload,typeof Oe=="function"){we=Oe.call(xt,we,fe);break e}we=Oe;break e;case 3:Oe.flags=Oe.flags&-65537|128;case 0:if(Oe=Ye.payload,fe=typeof Oe=="function"?Oe.call(xt,we,fe):Oe,fe==null)break e;we=p({},we,fe);break e;case 2:Gr=!0}}fe=P.callback,fe!==null&&(t.flags|=64,me&&(t.flags|=8192),me=g.callbacks,me===null?g.callbacks=[fe]:me.push(fe))}else me={lane:fe,tag:P.tag,payload:P.payload,callback:P.callback,next:null},ge===null?(de=ge=me,W=we):ge=ge.next=me,C|=fe;if(P=P.next,P===null){if(P=g.shared.pending,P===null)break;me=P,P=me.next,me.next=null,g.lastBaseUpdate=me,g.shared.pending=null}}while(!0);ge===null&&(W=we),g.baseState=W,g.firstBaseUpdate=de,g.lastBaseUpdate=ge,v===null&&(g.shared.lanes=0),Qr|=C,t.lanes=C,t.memoizedState=we}}function Sg(t,n){if(typeof t!="function")throw Error(i(191,t));t.call(n)}function kg(t,n){var l=t.callbacks;if(l!==null)for(t.callbacks=null,t=0;t<l.length;t++)Sg(l[t],n)}var Ci=R(null),ho=R(0);function _g(t,n){t=Rr,L(ho,t),L(Ci,n),Rr=t|n.baseLanes}function ud(){L(ho,Rr),L(Ci,Ci.current)}function dd(){Rr=ho.current,F(Ci),F(ho)}var _n=R(null),Fn=null;function Vr(t){var n=t.alternate;L(Dt,Dt.current&1),L(_n,t),Fn===null&&(n===null||Ci.current!==null||n.memoizedState!==null)&&(Fn=t)}function fd(t){L(Dt,Dt.current),L(_n,t),Fn===null&&(Fn=t)}function jg(t){t.tag===22?(L(Dt,Dt.current),L(_n,t),Fn===null&&(Fn=t)):Kr()}function Kr(){L(Dt,Dt.current),L(_n,_n.current)}function jn(t){F(_n),Fn===t&&(Fn=null),F(Dt)}var Dt=R(0);function mo(t){for(var n=t;n!==null;){if(n.tag===13){var l=n.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||vf(l)||bf(l)))return n}else if(n.tag===19&&(n.memoizedProps.revealOrder==="forwards"||n.memoizedProps.revealOrder==="backwards"||n.memoizedProps.revealOrder==="unstable_legacy-backwards"||n.memoizedProps.revealOrder==="together")){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var kr=0,Ke=null,gt=null,Ut=null,po=!1,Ei=!1,La=!1,go=0,zl=0,Ni=null,g_=0;function Ot(){throw Error(i(321))}function hd(t,n){if(n===null)return!1;for(var l=0;l<n.length&&l<t.length;l++)if(!Sn(t[l],n[l]))return!1;return!0}function md(t,n,l,c,g,v){return kr=v,Ke=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,$.H=t===null||t.memoizedState===null?oy:Ad,La=!1,v=l(c,g),La=!1,Ei&&(v=Eg(n,l,c,g)),Cg(t),v}function Cg(t){$.H=Ll;var n=gt!==null&>.next!==null;if(kr=0,Ut=gt=Ke=null,po=!1,zl=0,Ni=null,n)throw Error(i(300));t===null||Bt||(t=t.dependencies,t!==null&&io(t)&&(Bt=!0))}function Eg(t,n,l,c){Ke=t;var g=0;do{if(Ei&&(Ni=null),zl=0,Ei=!1,25<=g)throw Error(i(301));if(g+=1,Ut=gt=null,t.updateQueue!=null){var v=t.updateQueue;v.lastEffect=null,v.events=null,v.stores=null,v.memoCache!=null&&(v.memoCache.index=0)}$.H=cy,v=n(l,c)}while(Ei);return v}function y_(){var t=$.H,n=t.useState()[0];return n=typeof n.then=="function"?Ml(n):n,t=t.useState()[0],(gt!==null?gt.memoizedState:null)!==t&&(Ke.flags|=1024),n}function pd(){var t=go!==0;return go=0,t}function gd(t,n,l){n.updateQueue=t.updateQueue,n.flags&=-2053,t.lanes&=~l}function yd(t){if(po){for(t=t.memoizedState;t!==null;){var n=t.queue;n!==null&&(n.pending=null),t=t.next}po=!1}kr=0,Ut=gt=Ke=null,Ei=!1,zl=go=0,Ni=null}function sn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ut===null?Ke.memoizedState=Ut=t:Ut=Ut.next=t,Ut}function Lt(){if(gt===null){var t=Ke.alternate;t=t!==null?t.memoizedState:null}else t=gt.next;var n=Ut===null?Ke.memoizedState:Ut.next;if(n!==null)Ut=n,gt=t;else{if(t===null)throw Ke.alternate===null?Error(i(467)):Error(i(310));gt=t,t={memoizedState:gt.memoizedState,baseState:gt.baseState,baseQueue:gt.baseQueue,queue:gt.queue,next:null},Ut===null?Ke.memoizedState=Ut=t:Ut=Ut.next=t}return Ut}function yo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ml(t){var n=zl;return zl+=1,Ni===null&&(Ni=[]),t=yg(Ni,t,n),n=Ke,(Ut===null?n.memoizedState:Ut.next)===null&&(n=n.alternate,$.H=n===null||n.memoizedState===null?oy:Ad),t}function xo(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Ml(t);if(t.$$typeof===A)return Wt(t)}throw Error(i(438,String(t)))}function xd(t){var n=null,l=Ke.updateQueue;if(l!==null&&(n=l.memoCache),n==null){var c=Ke.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(n={data:c.data.map(function(g){return g.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),l===null&&(l=yo(),Ke.updateQueue=l),l.memoCache=n,l=n.data[n.index],l===void 0)for(l=n.data[n.index]=Array(t),c=0;c<t;c++)l[c]=U;return n.index++,l}function _r(t,n){return typeof n=="function"?n(t):n}function vo(t){var n=Lt();return vd(n,gt,t)}function vd(t,n,l){var c=t.queue;if(c===null)throw Error(i(311));c.lastRenderedReducer=l;var g=t.baseQueue,v=c.pending;if(v!==null){if(g!==null){var C=g.next;g.next=v.next,v.next=C}n.baseQueue=g=v,c.pending=null}if(v=t.baseState,g===null)t.memoizedState=v;else{n=g.next;var P=C=null,W=null,de=n,ge=!1;do{var we=de.lane&-536870913;if(we!==de.lane?(nt&we)===we:(kr&we)===we){var fe=de.revertLane;if(fe===0)W!==null&&(W=W.next={lane:0,revertLane:0,gesture:null,action:de.action,hasEagerState:de.hasEagerState,eagerState:de.eagerState,next:null}),we===Si&&(ge=!0);else if((kr&fe)===fe){de=de.next,fe===Si&&(ge=!0);continue}else we={lane:0,revertLane:de.revertLane,gesture:null,action:de.action,hasEagerState:de.hasEagerState,eagerState:de.eagerState,next:null},W===null?(P=W=we,C=v):W=W.next=we,Ke.lanes|=fe,Qr|=fe;we=de.action,La&&l(v,we),v=de.hasEagerState?de.eagerState:l(v,we)}else fe={lane:we,revertLane:de.revertLane,gesture:de.gesture,action:de.action,hasEagerState:de.hasEagerState,eagerState:de.eagerState,next:null},W===null?(P=W=fe,C=v):W=W.next=fe,Ke.lanes|=we,Qr|=we;de=de.next}while(de!==null&&de!==n);if(W===null?C=v:W.next=P,!Sn(v,t.memoizedState)&&(Bt=!0,ge&&(l=ki,l!==null)))throw l;t.memoizedState=v,t.baseState=C,t.baseQueue=W,c.lastRenderedState=v}return g===null&&(c.lanes=0),[t.memoizedState,c.dispatch]}function bd(t){var n=Lt(),l=n.queue;if(l===null)throw Error(i(311));l.lastRenderedReducer=t;var c=l.dispatch,g=l.pending,v=n.memoizedState;if(g!==null){l.pending=null;var C=g=g.next;do v=t(v,C.action),C=C.next;while(C!==g);Sn(v,n.memoizedState)||(Bt=!0),n.memoizedState=v,n.baseQueue===null&&(n.baseState=v),l.lastRenderedState=v}return[v,c]}function Ng(t,n,l){var c=Ke,g=Lt(),v=it;if(v){if(l===void 0)throw Error(i(407));l=l()}else l=n();var C=!Sn((gt||g).memoizedState,l);if(C&&(g.memoizedState=l,Bt=!0),g=g.queue,kd(Rg.bind(null,c,g,t),[t]),g.getSnapshot!==n||C||Ut!==null&&Ut.memoizedState.tag&1){if(c.flags|=2048,Ai(9,{destroy:void 0},Tg.bind(null,c,g,l,n),null),vt===null)throw Error(i(349));v||(kr&127)!==0||Ag(c,n,l)}return l}function Ag(t,n,l){t.flags|=16384,t={getSnapshot:n,value:l},n=Ke.updateQueue,n===null?(n=yo(),Ke.updateQueue=n,n.stores=[t]):(l=n.stores,l===null?n.stores=[t]:l.push(t))}function Tg(t,n,l,c){n.value=l,n.getSnapshot=c,Og(n)&&zg(t)}function Rg(t,n,l){return l(function(){Og(n)&&zg(t)})}function Og(t){var n=t.getSnapshot;t=t.value;try{var l=n();return!Sn(t,l)}catch{return!0}}function zg(t){var n=Ea(t,2);n!==null&&xn(n,t,2)}function wd(t){var n=sn();if(typeof t=="function"){var l=t;if(t=l(),La){$t(!0);try{l()}finally{$t(!1)}}}return n.memoizedState=n.baseState=t,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:_r,lastRenderedState:t},n}function Mg(t,n,l,c){return t.baseState=l,vd(t,gt,typeof c=="function"?c:_r)}function x_(t,n,l,c,g){if(So(t))throw Error(i(485));if(t=n.action,t!==null){var v={payload:g,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(C){v.listeners.push(C)}};$.T!==null?l(!0):v.isTransition=!1,c(v),l=n.pending,l===null?(v.next=n.pending=v,Dg(n,v)):(v.next=l.next,n.pending=l.next=v)}}function Dg(t,n){var l=n.action,c=n.payload,g=t.state;if(n.isTransition){var v=$.T,C={};$.T=C;try{var P=l(g,c),W=$.S;W!==null&&W(C,P),Lg(t,n,P)}catch(de){Sd(t,n,de)}finally{v!==null&&C.types!==null&&(v.types=C.types),$.T=v}}else try{v=l(g,c),Lg(t,n,v)}catch(de){Sd(t,n,de)}}function Lg(t,n,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(c){Ig(t,n,c)},function(c){return Sd(t,n,c)}):Ig(t,n,l)}function Ig(t,n,l){n.status="fulfilled",n.value=l,Pg(n),t.state=l,n=t.pending,n!==null&&(l=n.next,l===n?t.pending=null:(l=l.next,n.next=l,Dg(t,l)))}function Sd(t,n,l){var c=t.pending;if(t.pending=null,c!==null){c=c.next;do n.status="rejected",n.reason=l,Pg(n),n=n.next;while(n!==c)}t.action=null}function Pg(t){t=t.listeners;for(var n=0;n<t.length;n++)(0,t[n])()}function Ug(t,n){return n}function Bg(t,n){if(it){var l=vt.formState;if(l!==null){e:{var c=Ke;if(it){if(_t){t:{for(var g=_t,v=Bn;g.nodeType!==8;){if(!v){g=null;break t}if(g=Hn(g.nextSibling),g===null){g=null;break t}}v=g.data,g=v==="F!"||v==="F"?g:null}if(g){_t=Hn(g.nextSibling),c=g.data==="F!";break e}}Hr(c)}c=!1}c&&(n=l[0])}}return l=sn(),l.memoizedState=l.baseState=n,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ug,lastRenderedState:n},l.queue=c,l=iy.bind(null,Ke,c),c.dispatch=l,c=wd(!1),v=Nd.bind(null,Ke,!1,c.queue),c=sn(),g={state:n,dispatch:null,action:t,pending:null},c.queue=g,l=x_.bind(null,Ke,g,v,l),g.dispatch=l,c.memoizedState=t,[n,l,!1]}function Fg(t){var n=Lt();return Hg(n,gt,t)}function Hg(t,n,l){if(n=vd(t,n,Ug)[0],t=vo(_r)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var c=Ml(n)}catch(C){throw C===_i?oo:C}else c=n;n=Lt();var g=n.queue,v=g.dispatch;return l!==n.memoizedState&&(Ke.flags|=2048,Ai(9,{destroy:void 0},v_.bind(null,g,l),null)),[c,v,t]}function v_(t,n){t.action=n}function qg(t){var n=Lt(),l=gt;if(l!==null)return Hg(n,l,t);Lt(),n=n.memoizedState,l=Lt();var c=l.queue.dispatch;return l.memoizedState=t,[n,c,!1]}function Ai(t,n,l,c){return t={tag:t,create:l,deps:c,inst:n,next:null},n=Ke.updateQueue,n===null&&(n=yo(),Ke.updateQueue=n),l=n.lastEffect,l===null?n.lastEffect=t.next=t:(c=l.next,l.next=t,t.next=c,n.lastEffect=t),t}function Gg(){return Lt().memoizedState}function bo(t,n,l,c){var g=sn();Ke.flags|=t,g.memoizedState=Ai(1|n,{destroy:void 0},l,c===void 0?null:c)}function wo(t,n,l,c){var g=Lt();c=c===void 0?null:c;var v=g.memoizedState.inst;gt!==null&&c!==null&&hd(c,gt.memoizedState.deps)?g.memoizedState=Ai(n,v,l,c):(Ke.flags|=t,g.memoizedState=Ai(1|n,v,l,c))}function Yg(t,n){bo(8390656,8,t,n)}function kd(t,n){wo(2048,8,t,n)}function b_(t){Ke.flags|=4;var n=Ke.updateQueue;if(n===null)n=yo(),Ke.updateQueue=n,n.events=[t];else{var l=n.events;l===null?n.events=[t]:l.push(t)}}function $g(t){var n=Lt().memoizedState;return b_({ref:n,nextImpl:t}),function(){if((ft&2)!==0)throw Error(i(440));return n.impl.apply(void 0,arguments)}}function Vg(t,n){return wo(4,2,t,n)}function Kg(t,n){return wo(4,4,t,n)}function Xg(t,n){if(typeof n=="function"){t=t();var l=n(t);return function(){typeof l=="function"?l():n(null)}}if(n!=null)return t=t(),n.current=t,function(){n.current=null}}function Zg(t,n,l){l=l!=null?l.concat([t]):null,wo(4,4,Xg.bind(null,n,t),l)}function _d(){}function Qg(t,n){var l=Lt();n=n===void 0?null:n;var c=l.memoizedState;return n!==null&&hd(n,c[1])?c[0]:(l.memoizedState=[t,n],t)}function Wg(t,n){var l=Lt();n=n===void 0?null:n;var c=l.memoizedState;if(n!==null&&hd(n,c[1]))return c[0];if(c=t(),La){$t(!0);try{t()}finally{$t(!1)}}return l.memoizedState=[c,n],c}function jd(t,n,l){return l===void 0||(kr&1073741824)!==0&&(nt&261930)===0?t.memoizedState=n:(t.memoizedState=l,t=Jy(),Ke.lanes|=t,Qr|=t,l)}function Jg(t,n,l,c){return Sn(l,n)?l:Ci.current!==null?(t=jd(t,l,c),Sn(t,n)||(Bt=!0),t):(kr&42)===0||(kr&1073741824)!==0&&(nt&261930)===0?(Bt=!0,t.memoizedState=l):(t=Jy(),Ke.lanes|=t,Qr|=t,n)}function ey(t,n,l,c,g){var v=X.p;X.p=v!==0&&8>v?v:8;var C=$.T,P={};$.T=P,Nd(t,!1,n,l);try{var W=g(),de=$.S;if(de!==null&&de(P,W),W!==null&&typeof W=="object"&&typeof W.then=="function"){var ge=p_(W,c);Dl(t,n,ge,Nn(t))}else Dl(t,n,c,Nn(t))}catch(we){Dl(t,n,{then:function(){},status:"rejected",reason:we},Nn())}finally{X.p=v,C!==null&&P.types!==null&&(C.types=P.types),$.T=C}}function w_(){}function Cd(t,n,l,c){if(t.tag!==5)throw Error(i(476));var g=ty(t).queue;ey(t,g,n,re,l===null?w_:function(){return ny(t),l(c)})}function ty(t){var n=t.memoizedState;if(n!==null)return n;n={memoizedState:re,baseState:re,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:_r,lastRenderedState:re},next:null};var l={};return n.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:_r,lastRenderedState:l},next:null},t.memoizedState=n,t=t.alternate,t!==null&&(t.memoizedState=n),n}function ny(t){var n=ty(t);n.next===null&&(n=t.alternate.memoizedState),Dl(t,n.next.queue,{},Nn())}function Ed(){return Wt(Wl)}function ry(){return Lt().memoizedState}function ay(){return Lt().memoizedState}function S_(t){for(var n=t.return;n!==null;){switch(n.tag){case 24:case 3:var l=Nn();t=Yr(l);var c=$r(n,t,l);c!==null&&(xn(c,n,l),Tl(c,n,l)),n={cache:nd()},t.payload=n;return}n=n.return}}function k_(t,n,l){var c=Nn();l={lane:c,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},So(t)?ly(n,l):(l=Yu(t,n,l,c),l!==null&&(xn(l,t,c),sy(l,n,c)))}function iy(t,n,l){var c=Nn();Dl(t,n,l,c)}function Dl(t,n,l,c){var g={lane:c,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(So(t))ly(n,g);else{var v=t.alternate;if(t.lanes===0&&(v===null||v.lanes===0)&&(v=n.lastRenderedReducer,v!==null))try{var C=n.lastRenderedState,P=v(C,l);if(g.hasEagerState=!0,g.eagerState=P,Sn(P,C))return to(t,n,g,0),vt===null&&eo(),!1}catch{}if(l=Yu(t,n,g,c),l!==null)return xn(l,t,c),sy(l,n,c),!0}return!1}function Nd(t,n,l,c){if(c={lane:2,revertLane:sf(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},So(t)){if(n)throw Error(i(479))}else n=Yu(t,l,c,2),n!==null&&xn(n,t,2)}function So(t){var n=t.alternate;return t===Ke||n!==null&&n===Ke}function ly(t,n){Ei=po=!0;var l=t.pending;l===null?n.next=n:(n.next=l.next,l.next=n),t.pending=n}function sy(t,n,l){if((l&4194048)!==0){var c=n.lanes;c&=t.pendingLanes,l|=c,n.lanes=l,fp(t,l)}}var Ll={readContext:Wt,use:xo,useCallback:Ot,useContext:Ot,useEffect:Ot,useImperativeHandle:Ot,useLayoutEffect:Ot,useInsertionEffect:Ot,useMemo:Ot,useReducer:Ot,useRef:Ot,useState:Ot,useDebugValue:Ot,useDeferredValue:Ot,useTransition:Ot,useSyncExternalStore:Ot,useId:Ot,useHostTransitionStatus:Ot,useFormState:Ot,useActionState:Ot,useOptimistic:Ot,useMemoCache:Ot,useCacheRefresh:Ot};Ll.useEffectEvent=Ot;var oy={readContext:Wt,use:xo,useCallback:function(t,n){return sn().memoizedState=[t,n===void 0?null:n],t},useContext:Wt,useEffect:Yg,useImperativeHandle:function(t,n,l){l=l!=null?l.concat([t]):null,bo(4194308,4,Xg.bind(null,n,t),l)},useLayoutEffect:function(t,n){return bo(4194308,4,t,n)},useInsertionEffect:function(t,n){bo(4,2,t,n)},useMemo:function(t,n){var l=sn();n=n===void 0?null:n;var c=t();if(La){$t(!0);try{t()}finally{$t(!1)}}return l.memoizedState=[c,n],c},useReducer:function(t,n,l){var c=sn();if(l!==void 0){var g=l(n);if(La){$t(!0);try{l(n)}finally{$t(!1)}}}else g=n;return c.memoizedState=c.baseState=g,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:g},c.queue=t,t=t.dispatch=k_.bind(null,Ke,t),[c.memoizedState,t]},useRef:function(t){var n=sn();return t={current:t},n.memoizedState=t},useState:function(t){t=wd(t);var n=t.queue,l=iy.bind(null,Ke,n);return n.dispatch=l,[t.memoizedState,l]},useDebugValue:_d,useDeferredValue:function(t,n){var l=sn();return jd(l,t,n)},useTransition:function(){var t=wd(!1);return t=ey.bind(null,Ke,t.queue,!0,!1),sn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,n,l){var c=Ke,g=sn();if(it){if(l===void 0)throw Error(i(407));l=l()}else{if(l=n(),vt===null)throw Error(i(349));(nt&127)!==0||Ag(c,n,l)}g.memoizedState=l;var v={value:l,getSnapshot:n};return g.queue=v,Yg(Rg.bind(null,c,v,t),[t]),c.flags|=2048,Ai(9,{destroy:void 0},Tg.bind(null,c,v,l,n),null),l},useId:function(){var t=sn(),n=vt.identifierPrefix;if(it){var l=ar,c=rr;l=(c&~(1<<32-We(c)-1)).toString(32)+l,n="_"+n+"R_"+l,l=go++,0<l&&(n+="H"+l.toString(32)),n+="_"}else l=g_++,n="_"+n+"r_"+l.toString(32)+"_";return t.memoizedState=n},useHostTransitionStatus:Ed,useFormState:Bg,useActionState:Bg,useOptimistic:function(t){var n=sn();n.memoizedState=n.baseState=t;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=l,n=Nd.bind(null,Ke,!0,l),l.dispatch=n,[t,n]},useMemoCache:xd,useCacheRefresh:function(){return sn().memoizedState=S_.bind(null,Ke)},useEffectEvent:function(t){var n=sn(),l={impl:t};return n.memoizedState=l,function(){if((ft&2)!==0)throw Error(i(440));return l.impl.apply(void 0,arguments)}}},Ad={readContext:Wt,use:xo,useCallback:Qg,useContext:Wt,useEffect:kd,useImperativeHandle:Zg,useInsertionEffect:Vg,useLayoutEffect:Kg,useMemo:Wg,useReducer:vo,useRef:Gg,useState:function(){return vo(_r)},useDebugValue:_d,useDeferredValue:function(t,n){var l=Lt();return Jg(l,gt.memoizedState,t,n)},useTransition:function(){var t=vo(_r)[0],n=Lt().memoizedState;return[typeof t=="boolean"?t:Ml(t),n]},useSyncExternalStore:Ng,useId:ry,useHostTransitionStatus:Ed,useFormState:Fg,useActionState:Fg,useOptimistic:function(t,n){var l=Lt();return Mg(l,gt,t,n)},useMemoCache:xd,useCacheRefresh:ay};Ad.useEffectEvent=$g;var cy={readContext:Wt,use:xo,useCallback:Qg,useContext:Wt,useEffect:kd,useImperativeHandle:Zg,useInsertionEffect:Vg,useLayoutEffect:Kg,useMemo:Wg,useReducer:bd,useRef:Gg,useState:function(){return bd(_r)},useDebugValue:_d,useDeferredValue:function(t,n){var l=Lt();return gt===null?jd(l,t,n):Jg(l,gt.memoizedState,t,n)},useTransition:function(){var t=bd(_r)[0],n=Lt().memoizedState;return[typeof t=="boolean"?t:Ml(t),n]},useSyncExternalStore:Ng,useId:ry,useHostTransitionStatus:Ed,useFormState:qg,useActionState:qg,useOptimistic:function(t,n){var l=Lt();return gt!==null?Mg(l,gt,t,n):(l.baseState=t,[t,l.queue.dispatch])},useMemoCache:xd,useCacheRefresh:ay};cy.useEffectEvent=$g;function Td(t,n,l,c){n=t.memoizedState,l=l(c,n),l=l==null?n:p({},n,l),t.memoizedState=l,t.lanes===0&&(t.updateQueue.baseState=l)}var Rd={enqueueSetState:function(t,n,l){t=t._reactInternals;var c=Nn(),g=Yr(c);g.payload=n,l!=null&&(g.callback=l),n=$r(t,g,c),n!==null&&(xn(n,t,c),Tl(n,t,c))},enqueueReplaceState:function(t,n,l){t=t._reactInternals;var c=Nn(),g=Yr(c);g.tag=1,g.payload=n,l!=null&&(g.callback=l),n=$r(t,g,c),n!==null&&(xn(n,t,c),Tl(n,t,c))},enqueueForceUpdate:function(t,n){t=t._reactInternals;var l=Nn(),c=Yr(l);c.tag=2,n!=null&&(c.callback=n),n=$r(t,c,l),n!==null&&(xn(n,t,l),Tl(n,t,l))}};function uy(t,n,l,c,g,v,C){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(c,v,C):n.prototype&&n.prototype.isPureReactComponent?!Sl(l,c)||!Sl(g,v):!0}function dy(t,n,l,c){t=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(l,c),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(l,c),n.state!==t&&Rd.enqueueReplaceState(n,n.state,null)}function Ia(t,n){var l=n;if("ref"in n){l={};for(var c in n)c!=="ref"&&(l[c]=n[c])}if(t=t.defaultProps){l===n&&(l=p({},l));for(var g in t)l[g]===void 0&&(l[g]=t[g])}return l}function fy(t){Js(t)}function hy(t){console.error(t)}function my(t){Js(t)}function ko(t,n){try{var l=t.onUncaughtError;l(n.value,{componentStack:n.stack})}catch(c){setTimeout(function(){throw c})}}function py(t,n,l){try{var c=t.onCaughtError;c(l.value,{componentStack:l.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(g){setTimeout(function(){throw g})}}function Od(t,n,l){return l=Yr(l),l.tag=3,l.payload={element:null},l.callback=function(){ko(t,n)},l}function gy(t){return t=Yr(t),t.tag=3,t}function yy(t,n,l,c){var g=l.type.getDerivedStateFromError;if(typeof g=="function"){var v=c.value;t.payload=function(){return g(v)},t.callback=function(){py(n,l,c)}}var C=l.stateNode;C!==null&&typeof C.componentDidCatch=="function"&&(t.callback=function(){py(n,l,c),typeof g!="function"&&(Wr===null?Wr=new Set([this]):Wr.add(this));var P=c.stack;this.componentDidCatch(c.value,{componentStack:P!==null?P:""})})}function __(t,n,l,c,g){if(l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(n=l.alternate,n!==null&&wi(n,l,g,!0),l=_n.current,l!==null){switch(l.tag){case 31:case 13:return Fn===null?Do():l.alternate===null&&zt===0&&(zt=3),l.flags&=-257,l.flags|=65536,l.lanes=g,c===co?l.flags|=16384:(n=l.updateQueue,n===null?l.updateQueue=new Set([c]):n.add(c),rf(t,c,g)),!1;case 22:return l.flags|=65536,c===co?l.flags|=16384:(n=l.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([c])},l.updateQueue=n):(l=n.retryQueue,l===null?n.retryQueue=new Set([c]):l.add(c)),rf(t,c,g)),!1}throw Error(i(435,l.tag))}return rf(t,c,g),Do(),!1}if(it)return n=_n.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=g,c!==Qu&&(t=Error(i(422),{cause:c}),jl(In(t,l)))):(c!==Qu&&(n=Error(i(423),{cause:c}),jl(In(n,l))),t=t.current.alternate,t.flags|=65536,g&=-g,t.lanes|=g,c=In(c,l),g=Od(t.stateNode,c,g),od(t,g),zt!==4&&(zt=2)),!1;var v=Error(i(520),{cause:c});if(v=In(v,l),Gl===null?Gl=[v]:Gl.push(v),zt!==4&&(zt=2),n===null)return!0;c=In(c,l),l=n;do{switch(l.tag){case 3:return l.flags|=65536,t=g&-g,l.lanes|=t,t=Od(l.stateNode,c,t),od(l,t),!1;case 1:if(n=l.type,v=l.stateNode,(l.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(Wr===null||!Wr.has(v))))return l.flags|=65536,g&=-g,l.lanes|=g,g=gy(g),yy(g,t,l,c),od(l,g),!1}l=l.return}while(l!==null);return!1}var zd=Error(i(461)),Bt=!1;function Jt(t,n,l,c){n.child=t===null?wg(n,null,l,c):Da(n,t.child,l,c)}function xy(t,n,l,c,g){l=l.render;var v=n.ref;if("ref"in c){var C={};for(var P in c)P!=="ref"&&(C[P]=c[P])}else C=c;return Ra(n),c=md(t,n,l,C,v,g),P=pd(),t!==null&&!Bt?(gd(t,n,g),jr(t,n,g)):(it&&P&&Xu(n),n.flags|=1,Jt(t,n,c,g),n.child)}function vy(t,n,l,c,g){if(t===null){var v=l.type;return typeof v=="function"&&!$u(v)&&v.defaultProps===void 0&&l.compare===null?(n.tag=15,n.type=v,by(t,n,v,c,g)):(t=ro(l.type,null,c,n,n.mode,g),t.ref=n.ref,t.return=n,n.child=t)}if(v=t.child,!Fd(t,g)){var C=v.memoizedProps;if(l=l.compare,l=l!==null?l:Sl,l(C,c)&&t.ref===n.ref)return jr(t,n,g)}return n.flags|=1,t=vr(v,c),t.ref=n.ref,t.return=n,n.child=t}function by(t,n,l,c,g){if(t!==null){var v=t.memoizedProps;if(Sl(v,c)&&t.ref===n.ref)if(Bt=!1,n.pendingProps=c=v,Fd(t,g))(t.flags&131072)!==0&&(Bt=!0);else return n.lanes=t.lanes,jr(t,n,g)}return Md(t,n,l,c,g)}function wy(t,n,l,c){var g=c.children,v=t!==null?t.memoizedState:null;if(t===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.mode==="hidden"){if((n.flags&128)!==0){if(v=v!==null?v.baseLanes|l:l,t!==null){for(c=n.child=t.child,g=0;c!==null;)g=g|c.lanes|c.childLanes,c=c.sibling;c=g&~v}else c=0,n.child=null;return Sy(t,n,v,l,c)}if((l&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},t!==null&&so(n,v!==null?v.cachePool:null),v!==null?_g(n,v):ud(),jg(n);else return c=n.lanes=536870912,Sy(t,n,v!==null?v.baseLanes|l:l,l,c)}else v!==null?(so(n,v.cachePool),_g(n,v),Kr(),n.memoizedState=null):(t!==null&&so(n,null),ud(),Kr());return Jt(t,n,g,l),n.child}function Il(t,n){return t!==null&&t.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function Sy(t,n,l,c,g){var v=ad();return v=v===null?null:{parent:Pt._currentValue,pool:v},n.memoizedState={baseLanes:l,cachePool:v},t!==null&&so(n,null),ud(),jg(n),t!==null&&wi(t,n,c,!0),n.childLanes=g,null}function _o(t,n){return n=Co({mode:n.mode,children:n.children},t.mode),n.ref=t.ref,t.child=n,n.return=t,n}function ky(t,n,l){return Da(n,t.child,null,l),t=_o(n,n.pendingProps),t.flags|=2,jn(n),n.memoizedState=null,t}function j_(t,n,l){var c=n.pendingProps,g=(n.flags&128)!==0;if(n.flags&=-129,t===null){if(it){if(c.mode==="hidden")return t=_o(n,c),n.lanes=536870912,Il(null,t);if(fd(n),(t=_t)?(t=Dx(t,Bn),t=t!==null&&t.data==="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:Br!==null?{id:rr,overflow:ar}:null,retryLane:536870912,hydrationErrors:null},l=lg(t),l.return=n,n.child=l,Qt=n,_t=null)):t=null,t===null)throw Hr(n);return n.lanes=536870912,null}return _o(n,c)}var v=t.memoizedState;if(v!==null){var C=v.dehydrated;if(fd(n),g)if(n.flags&256)n.flags&=-257,n=ky(t,n,l);else if(n.memoizedState!==null)n.child=t.child,n.flags|=128,n=null;else throw Error(i(558));else if(Bt||wi(t,n,l,!1),g=(l&t.childLanes)!==0,Bt||g){if(c=vt,c!==null&&(C=hp(c,l),C!==0&&C!==v.retryLane))throw v.retryLane=C,Ea(t,C),xn(c,t,C),zd;Do(),n=ky(t,n,l)}else t=v.treeContext,_t=Hn(C.nextSibling),Qt=n,it=!0,Fr=null,Bn=!1,t!==null&&cg(n,t),n=_o(n,c),n.flags|=4096;return n}return t=vr(t.child,{mode:c.mode,children:c.children}),t.ref=n.ref,n.child=t,t.return=n,t}function jo(t,n){var l=n.ref;if(l===null)t!==null&&t.ref!==null&&(n.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(i(284));(t===null||t.ref!==l)&&(n.flags|=4194816)}}function Md(t,n,l,c,g){return Ra(n),l=md(t,n,l,c,void 0,g),c=pd(),t!==null&&!Bt?(gd(t,n,g),jr(t,n,g)):(it&&c&&Xu(n),n.flags|=1,Jt(t,n,l,g),n.child)}function _y(t,n,l,c,g,v){return Ra(n),n.updateQueue=null,l=Eg(n,c,l,g),Cg(t),c=pd(),t!==null&&!Bt?(gd(t,n,v),jr(t,n,v)):(it&&c&&Xu(n),n.flags|=1,Jt(t,n,l,v),n.child)}function jy(t,n,l,c,g){if(Ra(n),n.stateNode===null){var v=yi,C=l.contextType;typeof C=="object"&&C!==null&&(v=Wt(C)),v=new l(c,v),n.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=Rd,n.stateNode=v,v._reactInternals=n,v=n.stateNode,v.props=c,v.state=n.memoizedState,v.refs={},ld(n),C=l.contextType,v.context=typeof C=="object"&&C!==null?Wt(C):yi,v.state=n.memoizedState,C=l.getDerivedStateFromProps,typeof C=="function"&&(Td(n,l,C,c),v.state=n.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(C=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),C!==v.state&&Rd.enqueueReplaceState(v,v.state,null),Ol(n,c,v,g),Rl(),v.state=n.memoizedState),typeof v.componentDidMount=="function"&&(n.flags|=4194308),c=!0}else if(t===null){v=n.stateNode;var P=n.memoizedProps,W=Ia(l,P);v.props=W;var de=v.context,ge=l.contextType;C=yi,typeof ge=="object"&&ge!==null&&(C=Wt(ge));var we=l.getDerivedStateFromProps;ge=typeof we=="function"||typeof v.getSnapshotBeforeUpdate=="function",P=n.pendingProps!==P,ge||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(P||de!==C)&&dy(n,v,c,C),Gr=!1;var fe=n.memoizedState;v.state=fe,Ol(n,c,v,g),Rl(),de=n.memoizedState,P||fe!==de||Gr?(typeof we=="function"&&(Td(n,l,we,c),de=n.memoizedState),(W=Gr||uy(n,l,W,c,fe,de,C))?(ge||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(n.flags|=4194308)):(typeof v.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=c,n.memoizedState=de),v.props=c,v.state=de,v.context=C,c=W):(typeof v.componentDidMount=="function"&&(n.flags|=4194308),c=!1)}else{v=n.stateNode,sd(t,n),C=n.memoizedProps,ge=Ia(l,C),v.props=ge,we=n.pendingProps,fe=v.context,de=l.contextType,W=yi,typeof de=="object"&&de!==null&&(W=Wt(de)),P=l.getDerivedStateFromProps,(de=typeof P=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(C!==we||fe!==W)&&dy(n,v,c,W),Gr=!1,fe=n.memoizedState,v.state=fe,Ol(n,c,v,g),Rl();var me=n.memoizedState;C!==we||fe!==me||Gr||t!==null&&t.dependencies!==null&&io(t.dependencies)?(typeof P=="function"&&(Td(n,l,P,c),me=n.memoizedState),(ge=Gr||uy(n,l,ge,c,fe,me,W)||t!==null&&t.dependencies!==null&&io(t.dependencies))?(de||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(c,me,W),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(c,me,W)),typeof v.componentDidUpdate=="function"&&(n.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof v.componentDidUpdate!="function"||C===t.memoizedProps&&fe===t.memoizedState||(n.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||C===t.memoizedProps&&fe===t.memoizedState||(n.flags|=1024),n.memoizedProps=c,n.memoizedState=me),v.props=c,v.state=me,v.context=W,c=ge):(typeof v.componentDidUpdate!="function"||C===t.memoizedProps&&fe===t.memoizedState||(n.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||C===t.memoizedProps&&fe===t.memoizedState||(n.flags|=1024),c=!1)}return v=c,jo(t,n),c=(n.flags&128)!==0,v||c?(v=n.stateNode,l=c&&typeof l.getDerivedStateFromError!="function"?null:v.render(),n.flags|=1,t!==null&&c?(n.child=Da(n,t.child,null,g),n.child=Da(n,null,l,g)):Jt(t,n,l,g),n.memoizedState=v.state,t=n.child):t=jr(t,n,g),t}function Cy(t,n,l,c){return Aa(),n.flags|=256,Jt(t,n,l,c),n.child}var Dd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ld(t){return{baseLanes:t,cachePool:pg()}}function Id(t,n,l){return t=t!==null?t.childLanes&~l:0,n&&(t|=En),t}function Ey(t,n,l){var c=n.pendingProps,g=!1,v=(n.flags&128)!==0,C;if((C=v)||(C=t!==null&&t.memoizedState===null?!1:(Dt.current&2)!==0),C&&(g=!0,n.flags&=-129),C=(n.flags&32)!==0,n.flags&=-33,t===null){if(it){if(g?Vr(n):Kr(),(t=_t)?(t=Dx(t,Bn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:Br!==null?{id:rr,overflow:ar}:null,retryLane:536870912,hydrationErrors:null},l=lg(t),l.return=n,n.child=l,Qt=n,_t=null)):t=null,t===null)throw Hr(n);return bf(t)?n.lanes=32:n.lanes=536870912,null}var P=c.children;return c=c.fallback,g?(Kr(),g=n.mode,P=Co({mode:"hidden",children:P},g),c=Na(c,g,l,null),P.return=n,c.return=n,P.sibling=c,n.child=P,c=n.child,c.memoizedState=Ld(l),c.childLanes=Id(t,C,l),n.memoizedState=Dd,Il(null,c)):(Vr(n),Pd(n,P))}var W=t.memoizedState;if(W!==null&&(P=W.dehydrated,P!==null)){if(v)n.flags&256?(Vr(n),n.flags&=-257,n=Ud(t,n,l)):n.memoizedState!==null?(Kr(),n.child=t.child,n.flags|=128,n=null):(Kr(),P=c.fallback,g=n.mode,c=Co({mode:"visible",children:c.children},g),P=Na(P,g,l,null),P.flags|=2,c.return=n,P.return=n,c.sibling=P,n.child=c,Da(n,t.child,null,l),c=n.child,c.memoizedState=Ld(l),c.childLanes=Id(t,C,l),n.memoizedState=Dd,n=Il(null,c));else if(Vr(n),bf(P)){if(C=P.nextSibling&&P.nextSibling.dataset,C)var de=C.dgst;C=de,c=Error(i(419)),c.stack="",c.digest=C,jl({value:c,source:null,stack:null}),n=Ud(t,n,l)}else if(Bt||wi(t,n,l,!1),C=(l&t.childLanes)!==0,Bt||C){if(C=vt,C!==null&&(c=hp(C,l),c!==0&&c!==W.retryLane))throw W.retryLane=c,Ea(t,c),xn(C,t,c),zd;vf(P)||Do(),n=Ud(t,n,l)}else vf(P)?(n.flags|=192,n.child=t.child,n=null):(t=W.treeContext,_t=Hn(P.nextSibling),Qt=n,it=!0,Fr=null,Bn=!1,t!==null&&cg(n,t),n=Pd(n,c.children),n.flags|=4096);return n}return g?(Kr(),P=c.fallback,g=n.mode,W=t.child,de=W.sibling,c=vr(W,{mode:"hidden",children:c.children}),c.subtreeFlags=W.subtreeFlags&65011712,de!==null?P=vr(de,P):(P=Na(P,g,l,null),P.flags|=2),P.return=n,c.return=n,c.sibling=P,n.child=c,Il(null,c),c=n.child,P=t.child.memoizedState,P===null?P=Ld(l):(g=P.cachePool,g!==null?(W=Pt._currentValue,g=g.parent!==W?{parent:W,pool:W}:g):g=pg(),P={baseLanes:P.baseLanes|l,cachePool:g}),c.memoizedState=P,c.childLanes=Id(t,C,l),n.memoizedState=Dd,Il(t.child,c)):(Vr(n),l=t.child,t=l.sibling,l=vr(l,{mode:"visible",children:c.children}),l.return=n,l.sibling=null,t!==null&&(C=n.deletions,C===null?(n.deletions=[t],n.flags|=16):C.push(t)),n.child=l,n.memoizedState=null,l)}function Pd(t,n){return n=Co({mode:"visible",children:n},t.mode),n.return=t,t.child=n}function Co(t,n){return t=kn(22,t,null,n),t.lanes=0,t}function Ud(t,n,l){return Da(n,t.child,null,l),t=Pd(n,n.pendingProps.children),t.flags|=2,n.memoizedState=null,t}function Ny(t,n,l){t.lanes|=n;var c=t.alternate;c!==null&&(c.lanes|=n),ed(t.return,n,l)}function Bd(t,n,l,c,g,v){var C=t.memoizedState;C===null?t.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:c,tail:l,tailMode:g,treeForkCount:v}:(C.isBackwards=n,C.rendering=null,C.renderingStartTime=0,C.last=c,C.tail=l,C.tailMode=g,C.treeForkCount=v)}function Ay(t,n,l){var c=n.pendingProps,g=c.revealOrder,v=c.tail;c=c.children;var C=Dt.current,P=(C&2)!==0;if(P?(C=C&1|2,n.flags|=128):C&=1,L(Dt,C),Jt(t,n,c,l),c=it?_l:0,!P&&t!==null&&(t.flags&128)!==0)e:for(t=n.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Ny(t,l,n);else if(t.tag===19)Ny(t,l,n);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===n)break e;for(;t.sibling===null;){if(t.return===null||t.return===n)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(g){case"forwards":for(l=n.child,g=null;l!==null;)t=l.alternate,t!==null&&mo(t)===null&&(g=l),l=l.sibling;l=g,l===null?(g=n.child,n.child=null):(g=l.sibling,l.sibling=null),Bd(n,!1,g,l,v,c);break;case"backwards":case"unstable_legacy-backwards":for(l=null,g=n.child,n.child=null;g!==null;){if(t=g.alternate,t!==null&&mo(t)===null){n.child=g;break}t=g.sibling,g.sibling=l,l=g,g=t}Bd(n,!0,l,null,v,c);break;case"together":Bd(n,!1,null,null,void 0,c);break;default:n.memoizedState=null}return n.child}function jr(t,n,l){if(t!==null&&(n.dependencies=t.dependencies),Qr|=n.lanes,(l&n.childLanes)===0)if(t!==null){if(wi(t,n,l,!1),(l&n.childLanes)===0)return null}else return null;if(t!==null&&n.child!==t.child)throw Error(i(153));if(n.child!==null){for(t=n.child,l=vr(t,t.pendingProps),n.child=l,l.return=n;t.sibling!==null;)t=t.sibling,l=l.sibling=vr(t,t.pendingProps),l.return=n;l.sibling=null}return n.child}function Fd(t,n){return(t.lanes&n)!==0?!0:(t=t.dependencies,!!(t!==null&&io(t)))}function C_(t,n,l){switch(n.tag){case 3:Ae(n,n.stateNode.containerInfo),qr(n,Pt,t.memoizedState.cache),Aa();break;case 27:case 5:Ge(n);break;case 4:Ae(n,n.stateNode.containerInfo);break;case 10:qr(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,fd(n),null;break;case 13:var c=n.memoizedState;if(c!==null)return c.dehydrated!==null?(Vr(n),n.flags|=128,null):(l&n.child.childLanes)!==0?Ey(t,n,l):(Vr(n),t=jr(t,n,l),t!==null?t.sibling:null);Vr(n);break;case 19:var g=(t.flags&128)!==0;if(c=(l&n.childLanes)!==0,c||(wi(t,n,l,!1),c=(l&n.childLanes)!==0),g){if(c)return Ay(t,n,l);n.flags|=128}if(g=n.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),L(Dt,Dt.current),c)break;return null;case 22:return n.lanes=0,wy(t,n,l,n.pendingProps);case 24:qr(n,Pt,t.memoizedState.cache)}return jr(t,n,l)}function Ty(t,n,l){if(t!==null)if(t.memoizedProps!==n.pendingProps)Bt=!0;else{if(!Fd(t,l)&&(n.flags&128)===0)return Bt=!1,C_(t,n,l);Bt=(t.flags&131072)!==0}else Bt=!1,it&&(n.flags&1048576)!==0&&og(n,_l,n.index);switch(n.lanes=0,n.tag){case 16:e:{var c=n.pendingProps;if(t=za(n.elementType),n.type=t,typeof t=="function")$u(t)?(c=Ia(t,c),n.tag=1,n=jy(null,n,t,c,l)):(n.tag=0,n=Md(null,n,t,c,l));else{if(t!=null){var g=t.$$typeof;if(g===O){n.tag=11,n=xy(null,n,t,c,l);break e}else if(g===B){n.tag=14,n=vy(null,n,t,c,l);break e}}throw n=E(t)||t,Error(i(306,n,""))}}return n;case 0:return Md(t,n,n.type,n.pendingProps,l);case 1:return c=n.type,g=Ia(c,n.pendingProps),jy(t,n,c,g,l);case 3:e:{if(Ae(n,n.stateNode.containerInfo),t===null)throw Error(i(387));c=n.pendingProps;var v=n.memoizedState;g=v.element,sd(t,n),Ol(n,c,null,l);var C=n.memoizedState;if(c=C.cache,qr(n,Pt,c),c!==v.cache&&td(n,[Pt],l,!0),Rl(),c=C.element,v.isDehydrated)if(v={element:c,isDehydrated:!1,cache:C.cache},n.updateQueue.baseState=v,n.memoizedState=v,n.flags&256){n=Cy(t,n,c,l);break e}else if(c!==g){g=In(Error(i(424)),n),jl(g),n=Cy(t,n,c,l);break e}else for(t=n.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,_t=Hn(t.firstChild),Qt=n,it=!0,Fr=null,Bn=!0,l=wg(n,null,c,l),n.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(Aa(),c===g){n=jr(t,n,l);break e}Jt(t,n,c,l)}n=n.child}return n;case 26:return jo(t,n),t===null?(l=Fx(n.type,null,n.pendingProps,null))?n.memoizedState=l:it||(l=n.type,t=n.pendingProps,c=Ho(ve.current).createElement(l),c[Zt]=n,c[fn]=t,en(c,l,t),Vt(c),n.stateNode=c):n.memoizedState=Fx(n.type,t.memoizedProps,n.pendingProps,t.memoizedState),null;case 27:return Ge(n),t===null&&it&&(c=n.stateNode=Px(n.type,n.pendingProps,ve.current),Qt=n,Bn=!0,g=_t,na(n.type)?(wf=g,_t=Hn(c.firstChild)):_t=g),Jt(t,n,n.pendingProps.children,l),jo(t,n),t===null&&(n.flags|=4194304),n.child;case 5:return t===null&&it&&((g=c=_t)&&(c=nj(c,n.type,n.pendingProps,Bn),c!==null?(n.stateNode=c,Qt=n,_t=Hn(c.firstChild),Bn=!1,g=!0):g=!1),g||Hr(n)),Ge(n),g=n.type,v=n.pendingProps,C=t!==null?t.memoizedProps:null,c=v.children,gf(g,v)?c=null:C!==null&&gf(g,C)&&(n.flags|=32),n.memoizedState!==null&&(g=md(t,n,y_,null,null,l),Wl._currentValue=g),jo(t,n),Jt(t,n,c,l),n.child;case 6:return t===null&&it&&((t=l=_t)&&(l=rj(l,n.pendingProps,Bn),l!==null?(n.stateNode=l,Qt=n,_t=null,t=!0):t=!1),t||Hr(n)),null;case 13:return Ey(t,n,l);case 4:return Ae(n,n.stateNode.containerInfo),c=n.pendingProps,t===null?n.child=Da(n,null,c,l):Jt(t,n,c,l),n.child;case 11:return xy(t,n,n.type,n.pendingProps,l);case 7:return Jt(t,n,n.pendingProps,l),n.child;case 8:return Jt(t,n,n.pendingProps.children,l),n.child;case 12:return Jt(t,n,n.pendingProps.children,l),n.child;case 10:return c=n.pendingProps,qr(n,n.type,c.value),Jt(t,n,c.children,l),n.child;case 9:return g=n.type._context,c=n.pendingProps.children,Ra(n),g=Wt(g),c=c(g),n.flags|=1,Jt(t,n,c,l),n.child;case 14:return vy(t,n,n.type,n.pendingProps,l);case 15:return by(t,n,n.type,n.pendingProps,l);case 19:return Ay(t,n,l);case 31:return j_(t,n,l);case 22:return wy(t,n,l,n.pendingProps);case 24:return Ra(n),c=Wt(Pt),t===null?(g=ad(),g===null&&(g=vt,v=nd(),g.pooledCache=v,v.refCount++,v!==null&&(g.pooledCacheLanes|=l),g=v),n.memoizedState={parent:c,cache:g},ld(n),qr(n,Pt,g)):((t.lanes&l)!==0&&(sd(t,n),Ol(n,null,null,l),Rl()),g=t.memoizedState,v=n.memoizedState,g.parent!==c?(g={parent:c,cache:c},n.memoizedState=g,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=g),qr(n,Pt,c)):(c=v.cache,qr(n,Pt,c),c!==g.cache&&td(n,[Pt],l,!0))),Jt(t,n,n.pendingProps.children,l),n.child;case 29:throw n.pendingProps}throw Error(i(156,n.tag))}function Cr(t){t.flags|=4}function Hd(t,n,l,c,g){if((n=(t.mode&32)!==0)&&(n=!1),n){if(t.flags|=16777216,(g&335544128)===g)if(t.stateNode.complete)t.flags|=8192;else if(rx())t.flags|=8192;else throw Ma=co,id}else t.flags&=-16777217}function Ry(t,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!$x(n))if(rx())t.flags|=8192;else throw Ma=co,id}function Eo(t,n){n!==null&&(t.flags|=4),t.flags&16384&&(n=t.tag!==22?up():536870912,t.lanes|=n,zi|=n)}function Pl(t,n){if(!it)switch(t.tailMode){case"hidden":n=t.tail;for(var l=null;n!==null;)n.alternate!==null&&(l=n),n=n.sibling;l===null?t.tail=null:l.sibling=null;break;case"collapsed":l=t.tail;for(var c=null;l!==null;)l.alternate!==null&&(c=l),l=l.sibling;c===null?n||t.tail===null?t.tail=null:t.tail.sibling=null:c.sibling=null}}function jt(t){var n=t.alternate!==null&&t.alternate.child===t.child,l=0,c=0;if(n)for(var g=t.child;g!==null;)l|=g.lanes|g.childLanes,c|=g.subtreeFlags&65011712,c|=g.flags&65011712,g.return=t,g=g.sibling;else for(g=t.child;g!==null;)l|=g.lanes|g.childLanes,c|=g.subtreeFlags,c|=g.flags,g.return=t,g=g.sibling;return t.subtreeFlags|=c,t.childLanes=l,n}function E_(t,n,l){var c=n.pendingProps;switch(Zu(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return jt(n),null;case 1:return jt(n),null;case 3:return l=n.stateNode,c=null,t!==null&&(c=t.memoizedState.cache),n.memoizedState.cache!==c&&(n.flags|=2048),Sr(Pt),Ne(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(t===null||t.child===null)&&(bi(n)?Cr(n):t===null||t.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,Wu())),jt(n),null;case 26:var g=n.type,v=n.memoizedState;return t===null?(Cr(n),v!==null?(jt(n),Ry(n,v)):(jt(n),Hd(n,g,null,c,l))):v?v!==t.memoizedState?(Cr(n),jt(n),Ry(n,v)):(jt(n),n.flags&=-16777217):(t=t.memoizedProps,t!==c&&Cr(n),jt(n),Hd(n,g,t,c,l)),null;case 27:if($e(n),l=ve.current,g=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==c&&Cr(n);else{if(!c){if(n.stateNode===null)throw Error(i(166));return jt(n),null}t=le.current,bi(n)?ug(n):(t=Px(g,c,l),n.stateNode=t,Cr(n))}return jt(n),null;case 5:if($e(n),g=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==c&&Cr(n);else{if(!c){if(n.stateNode===null)throw Error(i(166));return jt(n),null}if(v=le.current,bi(n))ug(n);else{var C=Ho(ve.current);switch(v){case 1:v=C.createElementNS("http://www.w3.org/2000/svg",g);break;case 2:v=C.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;default:switch(g){case"svg":v=C.createElementNS("http://www.w3.org/2000/svg",g);break;case"math":v=C.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;case"script":v=C.createElement("div"),v.innerHTML="<script><\/script>",v=v.removeChild(v.firstChild);break;case"select":v=typeof c.is=="string"?C.createElement("select",{is:c.is}):C.createElement("select"),c.multiple?v.multiple=!0:c.size&&(v.size=c.size);break;default:v=typeof c.is=="string"?C.createElement(g,{is:c.is}):C.createElement(g)}}v[Zt]=n,v[fn]=c;e:for(C=n.child;C!==null;){if(C.tag===5||C.tag===6)v.appendChild(C.stateNode);else if(C.tag!==4&&C.tag!==27&&C.child!==null){C.child.return=C,C=C.child;continue}if(C===n)break e;for(;C.sibling===null;){if(C.return===null||C.return===n)break e;C=C.return}C.sibling.return=C.return,C=C.sibling}n.stateNode=v;e:switch(en(v,g,c),g){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}c&&Cr(n)}}return jt(n),Hd(n,n.type,t===null?null:t.memoizedProps,n.pendingProps,l),null;case 6:if(t&&n.stateNode!=null)t.memoizedProps!==c&&Cr(n);else{if(typeof c!="string"&&n.stateNode===null)throw Error(i(166));if(t=ve.current,bi(n)){if(t=n.stateNode,l=n.memoizedProps,c=null,g=Qt,g!==null)switch(g.tag){case 27:case 5:c=g.memoizedProps}t[Zt]=n,t=!!(t.nodeValue===l||c!==null&&c.suppressHydrationWarning===!0||Ex(t.nodeValue,l)),t||Hr(n,!0)}else t=Ho(t).createTextNode(c),t[Zt]=n,n.stateNode=t}return jt(n),null;case 31:if(l=n.memoizedState,t===null||t.memoizedState!==null){if(c=bi(n),l!==null){if(t===null){if(!c)throw Error(i(318));if(t=n.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(i(557));t[Zt]=n}else Aa(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;jt(n),t=!1}else l=Wu(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=l),t=!0;if(!t)return n.flags&256?(jn(n),n):(jn(n),null);if((n.flags&128)!==0)throw Error(i(558))}return jt(n),null;case 13:if(c=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(g=bi(n),c!==null&&c.dehydrated!==null){if(t===null){if(!g)throw Error(i(318));if(g=n.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error(i(317));g[Zt]=n}else Aa(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;jt(n),g=!1}else g=Wu(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=g),g=!0;if(!g)return n.flags&256?(jn(n),n):(jn(n),null)}return jn(n),(n.flags&128)!==0?(n.lanes=l,n):(l=c!==null,t=t!==null&&t.memoizedState!==null,l&&(c=n.child,g=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(g=c.alternate.memoizedState.cachePool.pool),v=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(v=c.memoizedState.cachePool.pool),v!==g&&(c.flags|=2048)),l!==t&&l&&(n.child.flags|=8192),Eo(n,n.updateQueue),jt(n),null);case 4:return Ne(),t===null&&df(n.stateNode.containerInfo),jt(n),null;case 10:return Sr(n.type),jt(n),null;case 19:if(F(Dt),c=n.memoizedState,c===null)return jt(n),null;if(g=(n.flags&128)!==0,v=c.rendering,v===null)if(g)Pl(c,!1);else{if(zt!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if(v=mo(t),v!==null){for(n.flags|=128,Pl(c,!1),t=v.updateQueue,n.updateQueue=t,Eo(n,t),n.subtreeFlags=0,t=l,l=n.child;l!==null;)ig(l,t),l=l.sibling;return L(Dt,Dt.current&1|2),it&&br(n,c.treeForkCount),n.child}t=t.sibling}c.tail!==null&&xe()>Oo&&(n.flags|=128,g=!0,Pl(c,!1),n.lanes=4194304)}else{if(!g)if(t=mo(v),t!==null){if(n.flags|=128,g=!0,t=t.updateQueue,n.updateQueue=t,Eo(n,t),Pl(c,!0),c.tail===null&&c.tailMode==="hidden"&&!v.alternate&&!it)return jt(n),null}else 2*xe()-c.renderingStartTime>Oo&&l!==536870912&&(n.flags|=128,g=!0,Pl(c,!1),n.lanes=4194304);c.isBackwards?(v.sibling=n.child,n.child=v):(t=c.last,t!==null?t.sibling=v:n.child=v,c.last=v)}return c.tail!==null?(t=c.tail,c.rendering=t,c.tail=t.sibling,c.renderingStartTime=xe(),t.sibling=null,l=Dt.current,L(Dt,g?l&1|2:l&1),it&&br(n,c.treeForkCount),t):(jt(n),null);case 22:case 23:return jn(n),dd(),c=n.memoizedState!==null,t!==null?t.memoizedState!==null!==c&&(n.flags|=8192):c&&(n.flags|=8192),c?(l&536870912)!==0&&(n.flags&128)===0&&(jt(n),n.subtreeFlags&6&&(n.flags|=8192)):jt(n),l=n.updateQueue,l!==null&&Eo(n,l.retryQueue),l=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),c=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(c=n.memoizedState.cachePool.pool),c!==l&&(n.flags|=2048),t!==null&&F(Oa),null;case 24:return l=null,t!==null&&(l=t.memoizedState.cache),n.memoizedState.cache!==l&&(n.flags|=2048),Sr(Pt),jt(n),null;case 25:return null;case 30:return null}throw Error(i(156,n.tag))}function N_(t,n){switch(Zu(n),n.tag){case 1:return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 3:return Sr(Pt),Ne(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 26:case 27:case 5:return $e(n),null;case 31:if(n.memoizedState!==null){if(jn(n),n.alternate===null)throw Error(i(340));Aa()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 13:if(jn(n),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(i(340));Aa()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return F(Dt),null;case 4:return Ne(),null;case 10:return Sr(n.type),null;case 22:case 23:return jn(n),dd(),t!==null&&F(Oa),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 24:return Sr(Pt),null;case 25:return null;default:return null}}function Oy(t,n){switch(Zu(n),n.tag){case 3:Sr(Pt),Ne();break;case 26:case 27:case 5:$e(n);break;case 4:Ne();break;case 31:n.memoizedState!==null&&jn(n);break;case 13:jn(n);break;case 19:F(Dt);break;case 10:Sr(n.type);break;case 22:case 23:jn(n),dd(),t!==null&&F(Oa);break;case 24:Sr(Pt)}}function Ul(t,n){try{var l=n.updateQueue,c=l!==null?l.lastEffect:null;if(c!==null){var g=c.next;l=g;do{if((l.tag&t)===t){c=void 0;var v=l.create,C=l.inst;c=v(),C.destroy=c}l=l.next}while(l!==g)}}catch(P){pt(n,n.return,P)}}function Xr(t,n,l){try{var c=n.updateQueue,g=c!==null?c.lastEffect:null;if(g!==null){var v=g.next;c=v;do{if((c.tag&t)===t){var C=c.inst,P=C.destroy;if(P!==void 0){C.destroy=void 0,g=n;var W=l,de=P;try{de()}catch(ge){pt(g,W,ge)}}}c=c.next}while(c!==v)}}catch(ge){pt(n,n.return,ge)}}function zy(t){var n=t.updateQueue;if(n!==null){var l=t.stateNode;try{kg(n,l)}catch(c){pt(t,t.return,c)}}}function My(t,n,l){l.props=Ia(t.type,t.memoizedProps),l.state=t.memoizedState;try{l.componentWillUnmount()}catch(c){pt(t,n,c)}}function Bl(t,n){try{var l=t.ref;if(l!==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 l=="function"?t.refCleanup=l(c):l.current=c}}catch(g){pt(t,n,g)}}function ir(t,n){var l=t.ref,c=t.refCleanup;if(l!==null)if(typeof c=="function")try{c()}catch(g){pt(t,n,g)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(g){pt(t,n,g)}else l.current=null}function Dy(t){var n=t.type,l=t.memoizedProps,c=t.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":l.autoFocus&&c.focus();break e;case"img":l.src?c.src=l.src:l.srcSet&&(c.srcset=l.srcSet)}}catch(g){pt(t,t.return,g)}}function qd(t,n,l){try{var c=t.stateNode;Z_(c,t.type,l,n),c[fn]=n}catch(g){pt(t,t.return,g)}}function Ly(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&na(t.type)||t.tag===4}function Gd(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Ly(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&&na(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 Yd(t,n,l){var c=t.tag;if(c===5||c===6)t=t.stateNode,n?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(t,n):(n=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,n.appendChild(t),l=l._reactRootContainer,l!=null||n.onclick!==null||(n.onclick=yr));else if(c!==4&&(c===27&&na(t.type)&&(l=t.stateNode,n=null),t=t.child,t!==null))for(Yd(t,n,l),t=t.sibling;t!==null;)Yd(t,n,l),t=t.sibling}function No(t,n,l){var c=t.tag;if(c===5||c===6)t=t.stateNode,n?l.insertBefore(t,n):l.appendChild(t);else if(c!==4&&(c===27&&na(t.type)&&(l=t.stateNode),t=t.child,t!==null))for(No(t,n,l),t=t.sibling;t!==null;)No(t,n,l),t=t.sibling}function Iy(t){var n=t.stateNode,l=t.memoizedProps;try{for(var c=t.type,g=n.attributes;g.length;)n.removeAttributeNode(g[0]);en(n,c,l),n[Zt]=t,n[fn]=l}catch(v){pt(t,t.return,v)}}var Er=!1,Ft=!1,$d=!1,Py=typeof WeakSet=="function"?WeakSet:Set,Kt=null;function A_(t,n){if(t=t.containerInfo,mf=Xo,t=Zp(t),Uu(t)){if("selectionStart"in t)var l={start:t.selectionStart,end:t.selectionEnd};else e:{l=(l=t.ownerDocument)&&l.defaultView||window;var c=l.getSelection&&l.getSelection();if(c&&c.rangeCount!==0){l=c.anchorNode;var g=c.anchorOffset,v=c.focusNode;c=c.focusOffset;try{l.nodeType,v.nodeType}catch{l=null;break e}var C=0,P=-1,W=-1,de=0,ge=0,we=t,fe=null;t:for(;;){for(var me;we!==l||g!==0&&we.nodeType!==3||(P=C+g),we!==v||c!==0&&we.nodeType!==3||(W=C+c),we.nodeType===3&&(C+=we.nodeValue.length),(me=we.firstChild)!==null;)fe=we,we=me;for(;;){if(we===t)break t;if(fe===l&&++de===g&&(P=C),fe===v&&++ge===c&&(W=C),(me=we.nextSibling)!==null)break;we=fe,fe=we.parentNode}we=me}l=P===-1||W===-1?null:{start:P,end:W}}else l=null}l=l||{start:0,end:0}}else l=null;for(pf={focusedElem:t,selectionRange:l},Xo=!1,Kt=n;Kt!==null;)if(n=Kt,t=n.child,(n.subtreeFlags&1028)!==0&&t!==null)t.return=n,Kt=t;else for(;Kt!==null;){switch(n=Kt,v=n.alternate,t=n.flags,n.tag){case 0:if((t&4)!==0&&(t=n.updateQueue,t=t!==null?t.events:null,t!==null))for(l=0;l<t.length;l++)g=t[l],g.ref.impl=g.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&v!==null){t=void 0,l=n,g=v.memoizedProps,v=v.memoizedState,c=l.stateNode;try{var Oe=Ia(l.type,g);t=c.getSnapshotBeforeUpdate(Oe,v),c.__reactInternalSnapshotBeforeUpdate=t}catch(Ye){pt(l,l.return,Ye)}}break;case 3:if((t&1024)!==0){if(t=n.stateNode.containerInfo,l=t.nodeType,l===9)xf(t);else if(l===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":xf(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(i(163))}if(t=n.sibling,t!==null){t.return=n.return,Kt=t;break}Kt=n.return}}function Uy(t,n,l){var c=l.flags;switch(l.tag){case 0:case 11:case 15:Ar(t,l),c&4&&Ul(5,l);break;case 1:if(Ar(t,l),c&4)if(t=l.stateNode,n===null)try{t.componentDidMount()}catch(C){pt(l,l.return,C)}else{var g=Ia(l.type,n.memoizedProps);n=n.memoizedState;try{t.componentDidUpdate(g,n,t.__reactInternalSnapshotBeforeUpdate)}catch(C){pt(l,l.return,C)}}c&64&&zy(l),c&512&&Bl(l,l.return);break;case 3:if(Ar(t,l),c&64&&(t=l.updateQueue,t!==null)){if(n=null,l.child!==null)switch(l.child.tag){case 27:case 5:n=l.child.stateNode;break;case 1:n=l.child.stateNode}try{kg(t,n)}catch(C){pt(l,l.return,C)}}break;case 27:n===null&&c&4&&Iy(l);case 26:case 5:Ar(t,l),n===null&&c&4&&Dy(l),c&512&&Bl(l,l.return);break;case 12:Ar(t,l);break;case 31:Ar(t,l),c&4&&Hy(t,l);break;case 13:Ar(t,l),c&4&&qy(t,l),c&64&&(t=l.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(l=P_.bind(null,l),aj(t,l))));break;case 22:if(c=l.memoizedState!==null||Er,!c){n=n!==null&&n.memoizedState!==null||Ft,g=Er;var v=Ft;Er=c,(Ft=n)&&!v?Tr(t,l,(l.subtreeFlags&8772)!==0):Ar(t,l),Er=g,Ft=v}break;case 30:break;default:Ar(t,l)}}function By(t){var n=t.alternate;n!==null&&(t.alternate=null,By(n)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(n=t.stateNode,n!==null&&Su(n)),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 Et=null,mn=!1;function Nr(t,n,l){for(l=l.child;l!==null;)Fy(t,n,l),l=l.sibling}function Fy(t,n,l){if(at&&typeof at.onCommitFiberUnmount=="function")try{at.onCommitFiberUnmount(Ue,l)}catch{}switch(l.tag){case 26:Ft||ir(l,n),Nr(t,n,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:Ft||ir(l,n);var c=Et,g=mn;na(l.type)&&(Et=l.stateNode,mn=!1),Nr(t,n,l),Xl(l.stateNode),Et=c,mn=g;break;case 5:Ft||ir(l,n);case 6:if(c=Et,g=mn,Et=null,Nr(t,n,l),Et=c,mn=g,Et!==null)if(mn)try{(Et.nodeType===9?Et.body:Et.nodeName==="HTML"?Et.ownerDocument.body:Et).removeChild(l.stateNode)}catch(v){pt(l,n,v)}else try{Et.removeChild(l.stateNode)}catch(v){pt(l,n,v)}break;case 18:Et!==null&&(mn?(t=Et,zx(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,l.stateNode),Fi(t)):zx(Et,l.stateNode));break;case 4:c=Et,g=mn,Et=l.stateNode.containerInfo,mn=!0,Nr(t,n,l),Et=c,mn=g;break;case 0:case 11:case 14:case 15:Xr(2,l,n),Ft||Xr(4,l,n),Nr(t,n,l);break;case 1:Ft||(ir(l,n),c=l.stateNode,typeof c.componentWillUnmount=="function"&&My(l,n,c)),Nr(t,n,l);break;case 21:Nr(t,n,l);break;case 22:Ft=(c=Ft)||l.memoizedState!==null,Nr(t,n,l),Ft=c;break;default:Nr(t,n,l)}}function Hy(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Fi(t)}catch(l){pt(n,n.return,l)}}}function qy(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Fi(t)}catch(l){pt(n,n.return,l)}}function T_(t){switch(t.tag){case 31:case 13:case 19:var n=t.stateNode;return n===null&&(n=t.stateNode=new Py),n;case 22:return t=t.stateNode,n=t._retryCache,n===null&&(n=t._retryCache=new Py),n;default:throw Error(i(435,t.tag))}}function Ao(t,n){var l=T_(t);n.forEach(function(c){if(!l.has(c)){l.add(c);var g=U_.bind(null,t,c);c.then(g,g)}})}function pn(t,n){var l=n.deletions;if(l!==null)for(var c=0;c<l.length;c++){var g=l[c],v=t,C=n,P=C;e:for(;P!==null;){switch(P.tag){case 27:if(na(P.type)){Et=P.stateNode,mn=!1;break e}break;case 5:Et=P.stateNode,mn=!1;break e;case 3:case 4:Et=P.stateNode.containerInfo,mn=!0;break e}P=P.return}if(Et===null)throw Error(i(160));Fy(v,C,g),Et=null,mn=!1,v=g.alternate,v!==null&&(v.return=null),g.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)Gy(n,t),n=n.sibling}var Zn=null;function Gy(t,n){var l=t.alternate,c=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:pn(n,t),gn(t),c&4&&(Xr(3,t,t.return),Ul(3,t),Xr(5,t,t.return));break;case 1:pn(n,t),gn(t),c&512&&(Ft||l===null||ir(l,l.return)),c&64&&Er&&(t=t.updateQueue,t!==null&&(c=t.callbacks,c!==null&&(l=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=l===null?c:l.concat(c))));break;case 26:var g=Zn;if(pn(n,t),gn(t),c&512&&(Ft||l===null||ir(l,l.return)),c&4){var v=l!==null?l.memoizedState:null;if(c=t.memoizedState,l===null)if(c===null)if(t.stateNode===null){e:{c=t.type,l=t.memoizedProps,g=g.ownerDocument||g;t:switch(c){case"title":v=g.getElementsByTagName("title")[0],(!v||v[hl]||v[Zt]||v.namespaceURI==="http://www.w3.org/2000/svg"||v.hasAttribute("itemprop"))&&(v=g.createElement(c),g.head.insertBefore(v,g.querySelector("head > title"))),en(v,c,l),v[Zt]=t,Vt(v),c=v;break e;case"link":var C=Gx("link","href",g).get(c+(l.href||""));if(C){for(var P=0;P<C.length;P++)if(v=C[P],v.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&v.getAttribute("rel")===(l.rel==null?null:l.rel)&&v.getAttribute("title")===(l.title==null?null:l.title)&&v.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){C.splice(P,1);break t}}v=g.createElement(c),en(v,c,l),g.head.appendChild(v);break;case"meta":if(C=Gx("meta","content",g).get(c+(l.content||""))){for(P=0;P<C.length;P++)if(v=C[P],v.getAttribute("content")===(l.content==null?null:""+l.content)&&v.getAttribute("name")===(l.name==null?null:l.name)&&v.getAttribute("property")===(l.property==null?null:l.property)&&v.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&v.getAttribute("charset")===(l.charSet==null?null:l.charSet)){C.splice(P,1);break t}}v=g.createElement(c),en(v,c,l),g.head.appendChild(v);break;default:throw Error(i(468,c))}v[Zt]=t,Vt(v),c=v}t.stateNode=c}else Yx(g,t.type,t.stateNode);else t.stateNode=qx(g,c,t.memoizedProps);else v!==c?(v===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):v.count--,c===null?Yx(g,t.type,t.stateNode):qx(g,c,t.memoizedProps)):c===null&&t.stateNode!==null&&qd(t,t.memoizedProps,l.memoizedProps)}break;case 27:pn(n,t),gn(t),c&512&&(Ft||l===null||ir(l,l.return)),l!==null&&c&4&&qd(t,t.memoizedProps,l.memoizedProps);break;case 5:if(pn(n,t),gn(t),c&512&&(Ft||l===null||ir(l,l.return)),t.flags&32){g=t.stateNode;try{ui(g,"")}catch(Oe){pt(t,t.return,Oe)}}c&4&&t.stateNode!=null&&(g=t.memoizedProps,qd(t,g,l!==null?l.memoizedProps:g)),c&1024&&($d=!0);break;case 6:if(pn(n,t),gn(t),c&4){if(t.stateNode===null)throw Error(i(162));c=t.memoizedProps,l=t.stateNode;try{l.nodeValue=c}catch(Oe){pt(t,t.return,Oe)}}break;case 3:if(Yo=null,g=Zn,Zn=qo(n.containerInfo),pn(n,t),Zn=g,gn(t),c&4&&l!==null&&l.memoizedState.isDehydrated)try{Fi(n.containerInfo)}catch(Oe){pt(t,t.return,Oe)}$d&&($d=!1,Yy(t));break;case 4:c=Zn,Zn=qo(t.stateNode.containerInfo),pn(n,t),gn(t),Zn=c;break;case 12:pn(n,t),gn(t);break;case 31:pn(n,t),gn(t),c&4&&(c=t.updateQueue,c!==null&&(t.updateQueue=null,Ao(t,c)));break;case 13:pn(n,t),gn(t),t.child.flags&8192&&t.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Ro=xe()),c&4&&(c=t.updateQueue,c!==null&&(t.updateQueue=null,Ao(t,c)));break;case 22:g=t.memoizedState!==null;var W=l!==null&&l.memoizedState!==null,de=Er,ge=Ft;if(Er=de||g,Ft=ge||W,pn(n,t),Ft=ge,Er=de,gn(t),c&8192)e:for(n=t.stateNode,n._visibility=g?n._visibility&-2:n._visibility|1,g&&(l===null||W||Er||Ft||Pa(t)),l=null,n=t;;){if(n.tag===5||n.tag===26){if(l===null){W=l=n;try{if(v=W.stateNode,g)C=v.style,typeof C.setProperty=="function"?C.setProperty("display","none","important"):C.display="none";else{P=W.stateNode;var we=W.memoizedProps.style,fe=we!=null&&we.hasOwnProperty("display")?we.display:null;P.style.display=fe==null||typeof fe=="boolean"?"":(""+fe).trim()}}catch(Oe){pt(W,W.return,Oe)}}}else if(n.tag===6){if(l===null){W=n;try{W.stateNode.nodeValue=g?"":W.memoizedProps}catch(Oe){pt(W,W.return,Oe)}}}else if(n.tag===18){if(l===null){W=n;try{var me=W.stateNode;g?Mx(me,!0):Mx(W.stateNode,!1)}catch(Oe){pt(W,W.return,Oe)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===t)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break e;for(;n.sibling===null;){if(n.return===null||n.return===t)break e;l===n&&(l=null),n=n.return}l===n&&(l=null),n.sibling.return=n.return,n=n.sibling}c&4&&(c=t.updateQueue,c!==null&&(l=c.retryQueue,l!==null&&(c.retryQueue=null,Ao(t,l))));break;case 19:pn(n,t),gn(t),c&4&&(c=t.updateQueue,c!==null&&(t.updateQueue=null,Ao(t,c)));break;case 30:break;case 21:break;default:pn(n,t),gn(t)}}function gn(t){var n=t.flags;if(n&2){try{for(var l,c=t.return;c!==null;){if(Ly(c)){l=c;break}c=c.return}if(l==null)throw Error(i(160));switch(l.tag){case 27:var g=l.stateNode,v=Gd(t);No(t,v,g);break;case 5:var C=l.stateNode;l.flags&32&&(ui(C,""),l.flags&=-33);var P=Gd(t);No(t,P,C);break;case 3:case 4:var W=l.stateNode.containerInfo,de=Gd(t);Yd(t,de,W);break;default:throw Error(i(161))}}catch(ge){pt(t,t.return,ge)}t.flags&=-3}n&4096&&(t.flags&=-4097)}function Yy(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var n=t;Yy(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),t=t.sibling}}function Ar(t,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)Uy(t,n.alternate,n),n=n.sibling}function Pa(t){for(t=t.child;t!==null;){var n=t;switch(n.tag){case 0:case 11:case 14:case 15:Xr(4,n,n.return),Pa(n);break;case 1:ir(n,n.return);var l=n.stateNode;typeof l.componentWillUnmount=="function"&&My(n,n.return,l),Pa(n);break;case 27:Xl(n.stateNode);case 26:case 5:ir(n,n.return),Pa(n);break;case 22:n.memoizedState===null&&Pa(n);break;case 30:Pa(n);break;default:Pa(n)}t=t.sibling}}function Tr(t,n,l){for(l=l&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var c=n.alternate,g=t,v=n,C=v.flags;switch(v.tag){case 0:case 11:case 15:Tr(g,v,l),Ul(4,v);break;case 1:if(Tr(g,v,l),c=v,g=c.stateNode,typeof g.componentDidMount=="function")try{g.componentDidMount()}catch(de){pt(c,c.return,de)}if(c=v,g=c.updateQueue,g!==null){var P=c.stateNode;try{var W=g.shared.hiddenCallbacks;if(W!==null)for(g.shared.hiddenCallbacks=null,g=0;g<W.length;g++)Sg(W[g],P)}catch(de){pt(c,c.return,de)}}l&&C&64&&zy(v),Bl(v,v.return);break;case 27:Iy(v);case 26:case 5:Tr(g,v,l),l&&c===null&&C&4&&Dy(v),Bl(v,v.return);break;case 12:Tr(g,v,l);break;case 31:Tr(g,v,l),l&&C&4&&Hy(g,v);break;case 13:Tr(g,v,l),l&&C&4&&qy(g,v);break;case 22:v.memoizedState===null&&Tr(g,v,l),Bl(v,v.return);break;case 30:break;default:Tr(g,v,l)}n=n.sibling}}function Vd(t,n){var l=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),t=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(t=n.memoizedState.cachePool.pool),t!==l&&(t!=null&&t.refCount++,l!=null&&Cl(l))}function Kd(t,n){t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&Cl(t))}function Qn(t,n,l,c){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)$y(t,n,l,c),n=n.sibling}function $y(t,n,l,c){var g=n.flags;switch(n.tag){case 0:case 11:case 15:Qn(t,n,l,c),g&2048&&Ul(9,n);break;case 1:Qn(t,n,l,c);break;case 3:Qn(t,n,l,c),g&2048&&(t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&Cl(t)));break;case 12:if(g&2048){Qn(t,n,l,c),t=n.stateNode;try{var v=n.memoizedProps,C=v.id,P=v.onPostCommit;typeof P=="function"&&P(C,n.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(W){pt(n,n.return,W)}}else Qn(t,n,l,c);break;case 31:Qn(t,n,l,c);break;case 13:Qn(t,n,l,c);break;case 23:break;case 22:v=n.stateNode,C=n.alternate,n.memoizedState!==null?v._visibility&2?Qn(t,n,l,c):Fl(t,n):v._visibility&2?Qn(t,n,l,c):(v._visibility|=2,Ti(t,n,l,c,(n.subtreeFlags&10256)!==0||!1)),g&2048&&Vd(C,n);break;case 24:Qn(t,n,l,c),g&2048&&Kd(n.alternate,n);break;default:Qn(t,n,l,c)}}function Ti(t,n,l,c,g){for(g=g&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var v=t,C=n,P=l,W=c,de=C.flags;switch(C.tag){case 0:case 11:case 15:Ti(v,C,P,W,g),Ul(8,C);break;case 23:break;case 22:var ge=C.stateNode;C.memoizedState!==null?ge._visibility&2?Ti(v,C,P,W,g):Fl(v,C):(ge._visibility|=2,Ti(v,C,P,W,g)),g&&de&2048&&Vd(C.alternate,C);break;case 24:Ti(v,C,P,W,g),g&&de&2048&&Kd(C.alternate,C);break;default:Ti(v,C,P,W,g)}n=n.sibling}}function Fl(t,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var l=t,c=n,g=c.flags;switch(c.tag){case 22:Fl(l,c),g&2048&&Vd(c.alternate,c);break;case 24:Fl(l,c),g&2048&&Kd(c.alternate,c);break;default:Fl(l,c)}n=n.sibling}}var Hl=8192;function Ri(t,n,l){if(t.subtreeFlags&Hl)for(t=t.child;t!==null;)Vy(t,n,l),t=t.sibling}function Vy(t,n,l){switch(t.tag){case 26:Ri(t,n,l),t.flags&Hl&&t.memoizedState!==null&&gj(l,Zn,t.memoizedState,t.memoizedProps);break;case 5:Ri(t,n,l);break;case 3:case 4:var c=Zn;Zn=qo(t.stateNode.containerInfo),Ri(t,n,l),Zn=c;break;case 22:t.memoizedState===null&&(c=t.alternate,c!==null&&c.memoizedState!==null?(c=Hl,Hl=16777216,Ri(t,n,l),Hl=c):Ri(t,n,l));break;default:Ri(t,n,l)}}function Ky(t){var n=t.alternate;if(n!==null&&(t=n.child,t!==null)){n.child=null;do n=t.sibling,t.sibling=null,t=n;while(t!==null)}}function ql(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var l=0;l<n.length;l++){var c=n[l];Kt=c,Zy(c,t)}Ky(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Xy(t),t=t.sibling}function Xy(t){switch(t.tag){case 0:case 11:case 15:ql(t),t.flags&2048&&Xr(9,t,t.return);break;case 3:ql(t);break;case 12:ql(t);break;case 22:var n=t.stateNode;t.memoizedState!==null&&n._visibility&2&&(t.return===null||t.return.tag!==13)?(n._visibility&=-3,To(t)):ql(t);break;default:ql(t)}}function To(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var l=0;l<n.length;l++){var c=n[l];Kt=c,Zy(c,t)}Ky(t)}for(t=t.child;t!==null;){switch(n=t,n.tag){case 0:case 11:case 15:Xr(8,n,n.return),To(n);break;case 22:l=n.stateNode,l._visibility&2&&(l._visibility&=-3,To(n));break;default:To(n)}t=t.sibling}}function Zy(t,n){for(;Kt!==null;){var l=Kt;switch(l.tag){case 0:case 11:case 15:Xr(8,l,n);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var c=l.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:Cl(l.memoizedState.cache)}if(c=l.child,c!==null)c.return=l,Kt=c;else e:for(l=t;Kt!==null;){c=Kt;var g=c.sibling,v=c.return;if(By(c),c===l){Kt=null;break e}if(g!==null){g.return=v,Kt=g;break e}Kt=v}}}var R_={getCacheForType:function(t){var n=Wt(Pt),l=n.data.get(t);return l===void 0&&(l=t(),n.data.set(t,l)),l},cacheSignal:function(){return Wt(Pt).controller.signal}},O_=typeof WeakMap=="function"?WeakMap:Map,ft=0,vt=null,Je=null,nt=0,mt=0,Cn=null,Zr=!1,Oi=!1,Xd=!1,Rr=0,zt=0,Qr=0,Ua=0,Zd=0,En=0,zi=0,Gl=null,yn=null,Qd=!1,Ro=0,Qy=0,Oo=1/0,zo=null,Wr=null,Gt=0,Jr=null,Mi=null,Or=0,Wd=0,Jd=null,Wy=null,Yl=0,ef=null;function Nn(){return(ft&2)!==0&&nt!==0?nt&-nt:$.T!==null?sf():mp()}function Jy(){if(En===0)if((nt&536870912)===0||it){var t=Sa;Sa<<=1,(Sa&3932160)===0&&(Sa=262144),En=t}else En=536870912;return t=_n.current,t!==null&&(t.flags|=32),En}function xn(t,n,l){(t===vt&&(mt===2||mt===9)||t.cancelPendingCommit!==null)&&(Di(t,0),ea(t,nt,En,!1)),fl(t,l),((ft&2)===0||t!==vt)&&(t===vt&&((ft&2)===0&&(Ua|=l),zt===4&&ea(t,nt,En,!1)),lr(t))}function ex(t,n,l){if((ft&6)!==0)throw Error(i(327));var c=!l&&(n&127)===0&&(n&t.expiredLanes)===0||dl(t,n),g=c?D_(t,n):nf(t,n,!0),v=c;do{if(g===0){Oi&&!c&&ea(t,n,0,!1);break}else{if(l=t.current.alternate,v&&!z_(l)){g=nf(t,n,!1),v=!1;continue}if(g===2){if(v=n,t.errorRecoveryDisabledLanes&v)var C=0;else C=t.pendingLanes&-536870913,C=C!==0?C:C&536870912?536870912:0;if(C!==0){n=C;e:{var P=t;g=Gl;var W=P.current.memoizedState.isDehydrated;if(W&&(Di(P,C).flags|=256),C=nf(P,C,!1),C!==2){if(Xd&&!W){P.errorRecoveryDisabledLanes|=v,Ua|=v,g=4;break e}v=yn,yn=g,v!==null&&(yn===null?yn=v:yn.push.apply(yn,v))}g=C}if(v=!1,g!==2)continue}}if(g===1){Di(t,0),ea(t,n,0,!0);break}e:{switch(c=t,v=g,v){case 0:case 1:throw Error(i(345));case 4:if((n&4194048)!==n)break;case 6:ea(c,n,En,!Zr);break e;case 2:yn=null;break;case 3:case 5:break;default:throw Error(i(329))}if((n&62914560)===n&&(g=Ro+300-xe(),10<g)){if(ea(c,n,En,!Zr),Hs(c,0,!0)!==0)break e;Or=n,c.timeoutHandle=Rx(tx.bind(null,c,l,yn,zo,Qd,n,En,Ua,zi,Zr,v,"Throttled",-0,0),g);break e}tx(c,l,yn,zo,Qd,n,En,Ua,zi,Zr,v,null,-0,0)}}break}while(!0);lr(t)}function tx(t,n,l,c,g,v,C,P,W,de,ge,we,fe,me){if(t.timeoutHandle=-1,we=n.subtreeFlags,we&8192||(we&16785408)===16785408){we={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:yr},Vy(n,v,we);var Oe=(v&62914560)===v?Ro-xe():(v&4194048)===v?Qy-xe():0;if(Oe=yj(we,Oe),Oe!==null){Or=v,t.cancelPendingCommit=Oe(cx.bind(null,t,n,v,l,c,g,C,P,W,ge,we,null,fe,me)),ea(t,v,C,!de);return}}cx(t,n,v,l,c,g,C,P,W)}function z_(t){for(var n=t;;){var l=n.tag;if((l===0||l===11||l===15)&&n.flags&16384&&(l=n.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var c=0;c<l.length;c++){var g=l[c],v=g.getSnapshot;g=g.value;try{if(!Sn(v(),g))return!1}catch{return!1}}if(l=n.child,n.subtreeFlags&16384&&l!==null)l.return=n,n=l;else{if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function ea(t,n,l,c){n&=~Zd,n&=~Ua,t.suspendedLanes|=n,t.pingedLanes&=~n,c&&(t.warmLanes|=n),c=t.expirationTimes;for(var g=n;0<g;){var v=31-We(g),C=1<<v;c[v]=-1,g&=~C}l!==0&&dp(t,l,n)}function Mo(){return(ft&6)===0?($l(0),!1):!0}function tf(){if(Je!==null){if(mt===0)var t=Je.return;else t=Je,wr=Ta=null,yd(t),ji=null,Nl=0,t=Je;for(;t!==null;)Oy(t.alternate,t),t=t.return;Je=null}}function Di(t,n){var l=t.timeoutHandle;l!==-1&&(t.timeoutHandle=-1,J_(l)),l=t.cancelPendingCommit,l!==null&&(t.cancelPendingCommit=null,l()),Or=0,tf(),vt=t,Je=l=vr(t.current,null),nt=n,mt=0,Cn=null,Zr=!1,Oi=dl(t,n),Xd=!1,zi=En=Zd=Ua=Qr=zt=0,yn=Gl=null,Qd=!1,(n&8)!==0&&(n|=n&32);var c=t.entangledLanes;if(c!==0)for(t=t.entanglements,c&=n;0<c;){var g=31-We(c),v=1<<g;n|=t[g],c&=~v}return Rr=n,eo(),l}function nx(t,n){Ke=null,$.H=Ll,n===_i||n===oo?(n=xg(),mt=3):n===id?(n=xg(),mt=4):mt=n===zd?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,Cn=n,Je===null&&(zt=1,ko(t,In(n,t.current)))}function rx(){var t=_n.current;return t===null?!0:(nt&4194048)===nt?Fn===null:(nt&62914560)===nt||(nt&536870912)!==0?t===Fn:!1}function ax(){var t=$.H;return $.H=Ll,t===null?Ll:t}function ix(){var t=$.A;return $.A=R_,t}function Do(){zt=4,Zr||(nt&4194048)!==nt&&_n.current!==null||(Oi=!0),(Qr&134217727)===0&&(Ua&134217727)===0||vt===null||ea(vt,nt,En,!1)}function nf(t,n,l){var c=ft;ft|=2;var g=ax(),v=ix();(vt!==t||nt!==n)&&(zo=null,Di(t,n)),n=!1;var C=zt;e:do try{if(mt!==0&&Je!==null){var P=Je,W=Cn;switch(mt){case 8:tf(),C=6;break e;case 3:case 2:case 9:case 6:_n.current===null&&(n=!0);var de=mt;if(mt=0,Cn=null,Li(t,P,W,de),l&&Oi){C=0;break e}break;default:de=mt,mt=0,Cn=null,Li(t,P,W,de)}}M_(),C=zt;break}catch(ge){nx(t,ge)}while(!0);return n&&t.shellSuspendCounter++,wr=Ta=null,ft=c,$.H=g,$.A=v,Je===null&&(vt=null,nt=0,eo()),C}function M_(){for(;Je!==null;)lx(Je)}function D_(t,n){var l=ft;ft|=2;var c=ax(),g=ix();vt!==t||nt!==n?(zo=null,Oo=xe()+500,Di(t,n)):Oi=dl(t,n);e:do try{if(mt!==0&&Je!==null){n=Je;var v=Cn;t:switch(mt){case 1:mt=0,Cn=null,Li(t,n,v,1);break;case 2:case 9:if(gg(v)){mt=0,Cn=null,sx(n);break}n=function(){mt!==2&&mt!==9||vt!==t||(mt=7),lr(t)},v.then(n,n);break e;case 3:mt=7;break e;case 4:mt=5;break e;case 7:gg(v)?(mt=0,Cn=null,sx(n)):(mt=0,Cn=null,Li(t,n,v,7));break;case 5:var C=null;switch(Je.tag){case 26:C=Je.memoizedState;case 5:case 27:var P=Je;if(C?$x(C):P.stateNode.complete){mt=0,Cn=null;var W=P.sibling;if(W!==null)Je=W;else{var de=P.return;de!==null?(Je=de,Lo(de)):Je=null}break t}}mt=0,Cn=null,Li(t,n,v,5);break;case 6:mt=0,Cn=null,Li(t,n,v,6);break;case 8:tf(),zt=6;break e;default:throw Error(i(462))}}L_();break}catch(ge){nx(t,ge)}while(!0);return wr=Ta=null,$.H=c,$.A=g,ft=l,Je!==null?0:(vt=null,nt=0,eo(),zt)}function L_(){for(;Je!==null&&!ue();)lx(Je)}function lx(t){var n=Ty(t.alternate,t,Rr);t.memoizedProps=t.pendingProps,n===null?Lo(t):Je=n}function sx(t){var n=t,l=n.alternate;switch(n.tag){case 15:case 0:n=_y(l,n,n.pendingProps,n.type,void 0,nt);break;case 11:n=_y(l,n,n.pendingProps,n.type.render,n.ref,nt);break;case 5:yd(n);default:Oy(l,n),n=Je=ig(n,Rr),n=Ty(l,n,Rr)}t.memoizedProps=t.pendingProps,n===null?Lo(t):Je=n}function Li(t,n,l,c){wr=Ta=null,yd(n),ji=null,Nl=0;var g=n.return;try{if(__(t,g,n,l,nt)){zt=1,ko(t,In(l,t.current)),Je=null;return}}catch(v){if(g!==null)throw Je=g,v;zt=1,ko(t,In(l,t.current)),Je=null;return}n.flags&32768?(it||c===1?t=!0:Oi||(nt&536870912)!==0?t=!1:(Zr=t=!0,(c===2||c===9||c===3||c===6)&&(c=_n.current,c!==null&&c.tag===13&&(c.flags|=16384))),ox(n,t)):Lo(n)}function Lo(t){var n=t;do{if((n.flags&32768)!==0){ox(n,Zr);return}t=n.return;var l=E_(n.alternate,n,Rr);if(l!==null){Je=l;return}if(n=n.sibling,n!==null){Je=n;return}Je=n=t}while(n!==null);zt===0&&(zt=5)}function ox(t,n){do{var l=N_(t.alternate,t);if(l!==null){l.flags&=32767,Je=l;return}if(l=t.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!n&&(t=t.sibling,t!==null)){Je=t;return}Je=t=l}while(t!==null);zt=6,Je=null}function cx(t,n,l,c,g,v,C,P,W){t.cancelPendingCommit=null;do Io();while(Gt!==0);if((ft&6)!==0)throw Error(i(327));if(n!==null){if(n===t.current)throw Error(i(177));if(v=n.lanes|n.childLanes,v|=Gu,p2(t,l,v,C,P,W),t===vt&&(Je=vt=null,nt=0),Mi=n,Jr=t,Or=l,Wd=v,Jd=g,Wy=c,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,B_(_e,function(){return mx(),null})):(t.callbackNode=null,t.callbackPriority=0),c=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||c){c=$.T,$.T=null,g=X.p,X.p=2,C=ft,ft|=4;try{A_(t,n,l)}finally{ft=C,X.p=g,$.T=c}}Gt=1,ux(),dx(),fx()}}function ux(){if(Gt===1){Gt=0;var t=Jr,n=Mi,l=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||l){l=$.T,$.T=null;var c=X.p;X.p=2;var g=ft;ft|=4;try{Gy(n,t);var v=pf,C=Zp(t.containerInfo),P=v.focusedElem,W=v.selectionRange;if(C!==P&&P&&P.ownerDocument&&Xp(P.ownerDocument.documentElement,P)){if(W!==null&&Uu(P)){var de=W.start,ge=W.end;if(ge===void 0&&(ge=de),"selectionStart"in P)P.selectionStart=de,P.selectionEnd=Math.min(ge,P.value.length);else{var we=P.ownerDocument||document,fe=we&&we.defaultView||window;if(fe.getSelection){var me=fe.getSelection(),Oe=P.textContent.length,Ye=Math.min(W.start,Oe),xt=W.end===void 0?Ye:Math.min(W.end,Oe);!me.extend&&Ye>xt&&(C=xt,xt=Ye,Ye=C);var ae=Kp(P,Ye),ee=Kp(P,xt);if(ae&&ee&&(me.rangeCount!==1||me.anchorNode!==ae.node||me.anchorOffset!==ae.offset||me.focusNode!==ee.node||me.focusOffset!==ee.offset)){var ce=we.createRange();ce.setStart(ae.node,ae.offset),me.removeAllRanges(),Ye>xt?(me.addRange(ce),me.extend(ee.node,ee.offset)):(ce.setEnd(ee.node,ee.offset),me.addRange(ce))}}}}for(we=[],me=P;me=me.parentNode;)me.nodeType===1&&we.push({element:me,left:me.scrollLeft,top:me.scrollTop});for(typeof P.focus=="function"&&P.focus(),P=0;P<we.length;P++){var be=we[P];be.element.scrollLeft=be.left,be.element.scrollTop=be.top}}Xo=!!mf,pf=mf=null}finally{ft=g,X.p=c,$.T=l}}t.current=n,Gt=2}}function dx(){if(Gt===2){Gt=0;var t=Jr,n=Mi,l=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||l){l=$.T,$.T=null;var c=X.p;X.p=2;var g=ft;ft|=4;try{Uy(t,n.alternate,n)}finally{ft=g,X.p=c,$.T=l}}Gt=3}}function fx(){if(Gt===4||Gt===3){Gt=0,he();var t=Jr,n=Mi,l=Or,c=Wy;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?Gt=5:(Gt=0,Mi=Jr=null,hx(t,t.pendingLanes));var g=t.pendingLanes;if(g===0&&(Wr=null),bu(l),n=n.stateNode,at&&typeof at.onCommitFiberRoot=="function")try{at.onCommitFiberRoot(Ue,n,void 0,(n.current.flags&128)===128)}catch{}if(c!==null){n=$.T,g=X.p,X.p=2,$.T=null;try{for(var v=t.onRecoverableError,C=0;C<c.length;C++){var P=c[C];v(P.value,{componentStack:P.stack})}}finally{$.T=n,X.p=g}}(Or&3)!==0&&Io(),lr(t),g=t.pendingLanes,(l&261930)!==0&&(g&42)!==0?t===ef?Yl++:(Yl=0,ef=t):Yl=0,$l(0)}}function hx(t,n){(t.pooledCacheLanes&=n)===0&&(n=t.pooledCache,n!=null&&(t.pooledCache=null,Cl(n)))}function Io(){return ux(),dx(),fx(),mx()}function mx(){if(Gt!==5)return!1;var t=Jr,n=Wd;Wd=0;var l=bu(Or),c=$.T,g=X.p;try{X.p=32>l?32:l,$.T=null,l=Jd,Jd=null;var v=Jr,C=Or;if(Gt=0,Mi=Jr=null,Or=0,(ft&6)!==0)throw Error(i(331));var P=ft;if(ft|=4,Xy(v.current),$y(v,v.current,C,l),ft=P,$l(0,!1),at&&typeof at.onPostCommitFiberRoot=="function")try{at.onPostCommitFiberRoot(Ue,v)}catch{}return!0}finally{X.p=g,$.T=c,hx(t,n)}}function px(t,n,l){n=In(l,n),n=Od(t.stateNode,n,2),t=$r(t,n,2),t!==null&&(fl(t,2),lr(t))}function pt(t,n,l){if(t.tag===3)px(t,t,l);else for(;n!==null;){if(n.tag===3){px(n,t,l);break}else if(n.tag===1){var c=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(Wr===null||!Wr.has(c))){t=In(l,t),l=gy(2),c=$r(n,l,2),c!==null&&(yy(l,c,n,t),fl(c,2),lr(c));break}}n=n.return}}function rf(t,n,l){var c=t.pingCache;if(c===null){c=t.pingCache=new O_;var g=new Set;c.set(n,g)}else g=c.get(n),g===void 0&&(g=new Set,c.set(n,g));g.has(l)||(Xd=!0,g.add(l),t=I_.bind(null,t,n,l),n.then(t,t))}function I_(t,n,l){var c=t.pingCache;c!==null&&c.delete(n),t.pingedLanes|=t.suspendedLanes&l,t.warmLanes&=~l,vt===t&&(nt&l)===l&&(zt===4||zt===3&&(nt&62914560)===nt&&300>xe()-Ro?(ft&2)===0&&Di(t,0):Zd|=l,zi===nt&&(zi=0)),lr(t)}function gx(t,n){n===0&&(n=up()),t=Ea(t,n),t!==null&&(fl(t,n),lr(t))}function P_(t){var n=t.memoizedState,l=0;n!==null&&(l=n.retryLane),gx(t,l)}function U_(t,n){var l=0;switch(t.tag){case 31:case 13:var c=t.stateNode,g=t.memoizedState;g!==null&&(l=g.retryLane);break;case 19:c=t.stateNode;break;case 22:c=t.stateNode._retryCache;break;default:throw Error(i(314))}c!==null&&c.delete(n),gx(t,l)}function B_(t,n){return ye(t,n)}var Po=null,Ii=null,af=!1,Uo=!1,lf=!1,ta=0;function lr(t){t!==Ii&&t.next===null&&(Ii===null?Po=Ii=t:Ii=Ii.next=t),Uo=!0,af||(af=!0,H_())}function $l(t,n){if(!lf&&Uo){lf=!0;do for(var l=!1,c=Po;c!==null;){if(t!==0){var g=c.pendingLanes;if(g===0)var v=0;else{var C=c.suspendedLanes,P=c.pingedLanes;v=(1<<31-We(42|t)+1)-1,v&=g&~(C&~P),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(l=!0,bx(c,v))}else v=nt,v=Hs(c,c===vt?v:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(v&3)===0||dl(c,v)||(l=!0,bx(c,v));c=c.next}while(l);lf=!1}}function F_(){yx()}function yx(){Uo=af=!1;var t=0;ta!==0&&W_()&&(t=ta);for(var n=xe(),l=null,c=Po;c!==null;){var g=c.next,v=xx(c,n);v===0?(c.next=null,l===null?Po=g:l.next=g,g===null&&(Ii=l)):(l=c,(t!==0||(v&3)!==0)&&(Uo=!0)),c=g}Gt!==0&&Gt!==5||$l(t),ta!==0&&(ta=0)}function xx(t,n){for(var l=t.suspendedLanes,c=t.pingedLanes,g=t.expirationTimes,v=t.pendingLanes&-62914561;0<v;){var C=31-We(v),P=1<<C,W=g[C];W===-1?((P&l)===0||(P&c)!==0)&&(g[C]=m2(P,n)):W<=n&&(t.expiredLanes|=P),v&=~P}if(n=vt,l=nt,l=Hs(t,t===n?l:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),c=t.callbackNode,l===0||t===n&&(mt===2||mt===9)||t.cancelPendingCommit!==null)return c!==null&&c!==null&&Se(c),t.callbackNode=null,t.callbackPriority=0;if((l&3)===0||dl(t,l)){if(n=l&-l,n===t.callbackPriority)return n;switch(c!==null&&Se(c),bu(l)){case 2:case 8:l=pe;break;case 32:l=_e;break;case 268435456:l=Te;break;default:l=_e}return c=vx.bind(null,t),l=ye(l,c),t.callbackPriority=n,t.callbackNode=l,n}return c!==null&&c!==null&&Se(c),t.callbackPriority=2,t.callbackNode=null,2}function vx(t,n){if(Gt!==0&&Gt!==5)return t.callbackNode=null,t.callbackPriority=0,null;var l=t.callbackNode;if(Io()&&t.callbackNode!==l)return null;var c=nt;return c=Hs(t,t===vt?c:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),c===0?null:(ex(t,c,n),xx(t,xe()),t.callbackNode!=null&&t.callbackNode===l?vx.bind(null,t):null)}function bx(t,n){if(Io())return null;ex(t,n,!0)}function H_(){ej(function(){(ft&6)!==0?ye(ne,F_):yx()})}function sf(){if(ta===0){var t=Si;t===0&&(t=ri,ri<<=1,(ri&261888)===0&&(ri=256)),ta=t}return ta}function wx(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:$s(""+t)}function Sx(t,n){var l=n.ownerDocument.createElement("input");return l.name=n.name,l.value=n.value,t.id&&l.setAttribute("form",t.id),n.parentNode.insertBefore(l,n),t=new FormData(t),l.parentNode.removeChild(l),t}function q_(t,n,l,c,g){if(n==="submit"&&l&&l.stateNode===g){var v=wx((g[fn]||null).action),C=c.submitter;C&&(n=(n=C[fn]||null)?wx(n.formAction):C.getAttribute("formAction"),n!==null&&(v=n,C=null));var P=new Zs("action","action",null,c,g);t.push({event:P,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(ta!==0){var W=C?Sx(g,C):new FormData(g);Cd(l,{pending:!0,data:W,method:g.method,action:v},null,W)}}else typeof v=="function"&&(P.preventDefault(),W=C?Sx(g,C):new FormData(g),Cd(l,{pending:!0,data:W,method:g.method,action:v},v,W))},currentTarget:g}]})}}for(var of=0;of<qu.length;of++){var cf=qu[of],G_=cf.toLowerCase(),Y_=cf[0].toUpperCase()+cf.slice(1);Xn(G_,"on"+Y_)}Xn(Jp,"onAnimationEnd"),Xn(eg,"onAnimationIteration"),Xn(tg,"onAnimationStart"),Xn("dblclick","onDoubleClick"),Xn("focusin","onFocus"),Xn("focusout","onBlur"),Xn(s_,"onTransitionRun"),Xn(o_,"onTransitionStart"),Xn(c_,"onTransitionCancel"),Xn(ng,"onTransitionEnd"),oi("onMouseEnter",["mouseout","mouseover"]),oi("onMouseLeave",["mouseout","mouseover"]),oi("onPointerEnter",["pointerout","pointerover"]),oi("onPointerLeave",["pointerout","pointerover"]),ka("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ka("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ka("onBeforeInput",["compositionend","keypress","textInput","paste"]),ka("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ka("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ka("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Vl="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(" "),$_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Vl));function kx(t,n){n=(n&4)!==0;for(var l=0;l<t.length;l++){var c=t[l],g=c.event;c=c.listeners;e:{var v=void 0;if(n)for(var C=c.length-1;0<=C;C--){var P=c[C],W=P.instance,de=P.currentTarget;if(P=P.listener,W!==v&&g.isPropagationStopped())break e;v=P,g.currentTarget=de;try{v(g)}catch(ge){Js(ge)}g.currentTarget=null,v=W}else for(C=0;C<c.length;C++){if(P=c[C],W=P.instance,de=P.currentTarget,P=P.listener,W!==v&&g.isPropagationStopped())break e;v=P,g.currentTarget=de;try{v(g)}catch(ge){Js(ge)}g.currentTarget=null,v=W}}}}function et(t,n){var l=n[wu];l===void 0&&(l=n[wu]=new Set);var c=t+"__bubble";l.has(c)||(_x(n,t,2,!1),l.add(c))}function uf(t,n,l){var c=0;n&&(c|=4),_x(l,t,c,n)}var Bo="_reactListening"+Math.random().toString(36).slice(2);function df(t){if(!t[Bo]){t[Bo]=!0,yp.forEach(function(l){l!=="selectionchange"&&($_.has(l)||uf(l,!1,t),uf(l,!0,t))});var n=t.nodeType===9?t:t.ownerDocument;n===null||n[Bo]||(n[Bo]=!0,uf("selectionchange",!1,n))}}function _x(t,n,l,c){switch(Jx(n)){case 2:var g=bj;break;case 8:g=wj;break;default:g=Cf}l=g.bind(null,n,l,t),g=void 0,!Tu||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(g=!0),c?g!==void 0?t.addEventListener(n,l,{capture:!0,passive:g}):t.addEventListener(n,l,!0):g!==void 0?t.addEventListener(n,l,{passive:g}):t.addEventListener(n,l,!1)}function ff(t,n,l,c,g){var v=c;if((n&1)===0&&(n&2)===0&&c!==null)e:for(;;){if(c===null)return;var C=c.tag;if(C===3||C===4){var P=c.stateNode.containerInfo;if(P===g)break;if(C===4)for(C=c.return;C!==null;){var W=C.tag;if((W===3||W===4)&&C.stateNode.containerInfo===g)return;C=C.return}for(;P!==null;){if(C=ii(P),C===null)return;if(W=C.tag,W===5||W===6||W===26||W===27){c=v=C;continue e}P=P.parentNode}}c=c.return}Ap(function(){var de=v,ge=Nu(l),we=[];e:{var fe=rg.get(t);if(fe!==void 0){var me=Zs,Oe=t;switch(t){case"keypress":if(Ks(l)===0)break e;case"keydown":case"keyup":me=U2;break;case"focusin":Oe="focus",me=Mu;break;case"focusout":Oe="blur",me=Mu;break;case"beforeblur":case"afterblur":me=Mu;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":me=Op;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":me=E2;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":me=H2;break;case Jp:case eg:case tg:me=T2;break;case ng:me=G2;break;case"scroll":case"scrollend":me=j2;break;case"wheel":me=$2;break;case"copy":case"cut":case"paste":me=O2;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":me=Mp;break;case"toggle":case"beforetoggle":me=K2}var Ye=(n&4)!==0,xt=!Ye&&(t==="scroll"||t==="scrollend"),ae=Ye?fe!==null?fe+"Capture":null:fe;Ye=[];for(var ee=de,ce;ee!==null;){var be=ee;if(ce=be.stateNode,be=be.tag,be!==5&&be!==26&&be!==27||ce===null||ae===null||(be=pl(ee,ae),be!=null&&Ye.push(Kl(ee,be,ce))),xt)break;ee=ee.return}0<Ye.length&&(fe=new me(fe,Oe,null,l,ge),we.push({event:fe,listeners:Ye}))}}if((n&7)===0){e:{if(fe=t==="mouseover"||t==="pointerover",me=t==="mouseout"||t==="pointerout",fe&&l!==Eu&&(Oe=l.relatedTarget||l.fromElement)&&(ii(Oe)||Oe[ai]))break e;if((me||fe)&&(fe=ge.window===ge?ge:(fe=ge.ownerDocument)?fe.defaultView||fe.parentWindow:window,me?(Oe=l.relatedTarget||l.toElement,me=de,Oe=Oe?ii(Oe):null,Oe!==null&&(xt=o(Oe),Ye=Oe.tag,Oe!==xt||Ye!==5&&Ye!==27&&Ye!==6)&&(Oe=null)):(me=null,Oe=de),me!==Oe)){if(Ye=Op,be="onMouseLeave",ae="onMouseEnter",ee="mouse",(t==="pointerout"||t==="pointerover")&&(Ye=Mp,be="onPointerLeave",ae="onPointerEnter",ee="pointer"),xt=me==null?fe:ml(me),ce=Oe==null?fe:ml(Oe),fe=new Ye(be,ee+"leave",me,l,ge),fe.target=xt,fe.relatedTarget=ce,be=null,ii(ge)===de&&(Ye=new Ye(ae,ee+"enter",Oe,l,ge),Ye.target=ce,Ye.relatedTarget=xt,be=Ye),xt=be,me&&Oe)t:{for(Ye=V_,ae=me,ee=Oe,ce=0,be=ae;be;be=Ye(be))ce++;be=0;for(var Be=ee;Be;Be=Ye(Be))be++;for(;0<ce-be;)ae=Ye(ae),ce--;for(;0<be-ce;)ee=Ye(ee),be--;for(;ce--;){if(ae===ee||ee!==null&&ae===ee.alternate){Ye=ae;break t}ae=Ye(ae),ee=Ye(ee)}Ye=null}else Ye=null;me!==null&&jx(we,fe,me,Ye,!1),Oe!==null&&xt!==null&&jx(we,xt,Oe,Ye,!0)}}e:{if(fe=de?ml(de):window,me=fe.nodeName&&fe.nodeName.toLowerCase(),me==="select"||me==="input"&&fe.type==="file")var ct=Hp;else if(Bp(fe))if(qp)ct=a_;else{ct=n_;var Pe=t_}else me=fe.nodeName,!me||me.toLowerCase()!=="input"||fe.type!=="checkbox"&&fe.type!=="radio"?de&&Cu(de.elementType)&&(ct=Hp):ct=r_;if(ct&&(ct=ct(t,de))){Fp(we,ct,l,ge);break e}Pe&&Pe(t,fe,de),t==="focusout"&&de&&fe.type==="number"&&de.memoizedProps.value!=null&&ju(fe,"number",fe.value)}switch(Pe=de?ml(de):window,t){case"focusin":(Bp(Pe)||Pe.contentEditable==="true")&&(mi=Pe,Bu=de,kl=null);break;case"focusout":kl=Bu=mi=null;break;case"mousedown":Fu=!0;break;case"contextmenu":case"mouseup":case"dragend":Fu=!1,Qp(we,l,ge);break;case"selectionchange":if(l_)break;case"keydown":case"keyup":Qp(we,l,ge)}var Xe;if(Lu)e:{switch(t){case"compositionstart":var rt="onCompositionStart";break e;case"compositionend":rt="onCompositionEnd";break e;case"compositionupdate":rt="onCompositionUpdate";break e}rt=void 0}else hi?Pp(t,l)&&(rt="onCompositionEnd"):t==="keydown"&&l.keyCode===229&&(rt="onCompositionStart");rt&&(Dp&&l.locale!=="ko"&&(hi||rt!=="onCompositionStart"?rt==="onCompositionEnd"&&hi&&(Xe=Tp()):(Ur=ge,Ru="value"in Ur?Ur.value:Ur.textContent,hi=!0)),Pe=Fo(de,rt),0<Pe.length&&(rt=new zp(rt,t,null,l,ge),we.push({event:rt,listeners:Pe}),Xe?rt.data=Xe:(Xe=Up(l),Xe!==null&&(rt.data=Xe)))),(Xe=Z2?Q2(t,l):W2(t,l))&&(rt=Fo(de,"onBeforeInput"),0<rt.length&&(Pe=new zp("onBeforeInput","beforeinput",null,l,ge),we.push({event:Pe,listeners:rt}),Pe.data=Xe)),q_(we,t,de,l,ge)}kx(we,n)})}function Kl(t,n,l){return{instance:t,listener:n,currentTarget:l}}function Fo(t,n){for(var l=n+"Capture",c=[];t!==null;){var g=t,v=g.stateNode;if(g=g.tag,g!==5&&g!==26&&g!==27||v===null||(g=pl(t,l),g!=null&&c.unshift(Kl(t,g,v)),g=pl(t,n),g!=null&&c.push(Kl(t,g,v))),t.tag===3)return c;t=t.return}return[]}function V_(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function jx(t,n,l,c,g){for(var v=n._reactName,C=[];l!==null&&l!==c;){var P=l,W=P.alternate,de=P.stateNode;if(P=P.tag,W!==null&&W===c)break;P!==5&&P!==26&&P!==27||de===null||(W=de,g?(de=pl(l,v),de!=null&&C.unshift(Kl(l,de,W))):g||(de=pl(l,v),de!=null&&C.push(Kl(l,de,W)))),l=l.return}C.length!==0&&t.push({event:n,listeners:C})}var K_=/\r\n?/g,X_=/\u0000|\uFFFD/g;function Cx(t){return(typeof t=="string"?t:""+t).replace(K_,`
|
|
9
|
-
`).replace(X_,"")}function Ex(t,n){return n=Cx(n),Cx(t)===n}function yt(t,n,l,c,g,v){switch(l){case"children":typeof c=="string"?n==="body"||n==="textarea"&&c===""||ui(t,c):(typeof c=="number"||typeof c=="bigint")&&n!=="body"&&ui(t,""+c);break;case"className":Gs(t,"class",c);break;case"tabIndex":Gs(t,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":Gs(t,l,c);break;case"style":Ep(t,c,v);break;case"data":if(n!=="object"){Gs(t,"data",c);break}case"src":case"href":if(c===""&&(n!=="a"||l!=="href")){t.removeAttribute(l);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){t.removeAttribute(l);break}c=$s(""+c),t.setAttribute(l,c);break;case"action":case"formAction":if(typeof c=="function"){t.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof v=="function"&&(l==="formAction"?(n!=="input"&&yt(t,n,"name",g.name,g,null),yt(t,n,"formEncType",g.formEncType,g,null),yt(t,n,"formMethod",g.formMethod,g,null),yt(t,n,"formTarget",g.formTarget,g,null)):(yt(t,n,"encType",g.encType,g,null),yt(t,n,"method",g.method,g,null),yt(t,n,"target",g.target,g,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){t.removeAttribute(l);break}c=$s(""+c),t.setAttribute(l,c);break;case"onClick":c!=null&&(t.onclick=yr);break;case"onScroll":c!=null&&et("scroll",t);break;case"onScrollEnd":c!=null&&et("scrollend",t);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(i(61));if(l=c.__html,l!=null){if(g.children!=null)throw Error(i(60));t.innerHTML=l}}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}l=$s(""+c),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":c!=null&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(l,""+c):t.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":c&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(l,""):t.removeAttribute(l);break;case"capture":case"download":c===!0?t.setAttribute(l,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(l,c):t.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?t.setAttribute(l,c):t.removeAttribute(l);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?t.removeAttribute(l):t.setAttribute(l,c);break;case"popover":et("beforetoggle",t),et("toggle",t),qs(t,"popover",c);break;case"xlinkActuate":gr(t,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":gr(t,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":gr(t,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":gr(t,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":gr(t,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":gr(t,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":gr(t,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":gr(t,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":gr(t,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":qs(t,"is",c);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=k2.get(l)||l,qs(t,l,c))}}function hf(t,n,l,c,g,v){switch(l){case"style":Ep(t,c,v);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(i(61));if(l=c.__html,l!=null){if(g.children!=null)throw Error(i(60));t.innerHTML=l}}break;case"children":typeof c=="string"?ui(t,c):(typeof c=="number"||typeof c=="bigint")&&ui(t,""+c);break;case"onScroll":c!=null&&et("scroll",t);break;case"onScrollEnd":c!=null&&et("scrollend",t);break;case"onClick":c!=null&&(t.onclick=yr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!xp.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(g=l.endsWith("Capture"),n=l.slice(2,g?l.length-7:void 0),v=t[fn]||null,v=v!=null?v[l]:null,typeof v=="function"&&t.removeEventListener(n,v,g),typeof c=="function")){typeof v!="function"&&v!==null&&(l in t?t[l]=null:t.hasAttribute(l)&&t.removeAttribute(l)),t.addEventListener(n,c,g);break e}l in t?t[l]=c:c===!0?t.setAttribute(l,""):qs(t,l,c)}}}function en(t,n,l){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":et("error",t),et("load",t);var c=!1,g=!1,v;for(v in l)if(l.hasOwnProperty(v)){var C=l[v];if(C!=null)switch(v){case"src":c=!0;break;case"srcSet":g=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,n));default:yt(t,n,v,C,l,null)}}g&&yt(t,n,"srcSet",l.srcSet,l,null),c&&yt(t,n,"src",l.src,l,null);return;case"input":et("invalid",t);var P=v=C=g=null,W=null,de=null;for(c in l)if(l.hasOwnProperty(c)){var ge=l[c];if(ge!=null)switch(c){case"name":g=ge;break;case"type":C=ge;break;case"checked":W=ge;break;case"defaultChecked":de=ge;break;case"value":v=ge;break;case"defaultValue":P=ge;break;case"children":case"dangerouslySetInnerHTML":if(ge!=null)throw Error(i(137,n));break;default:yt(t,n,c,ge,l,null)}}kp(t,v,P,W,de,C,g,!1);return;case"select":et("invalid",t),c=C=v=null;for(g in l)if(l.hasOwnProperty(g)&&(P=l[g],P!=null))switch(g){case"value":v=P;break;case"defaultValue":C=P;break;case"multiple":c=P;default:yt(t,n,g,P,l,null)}n=v,l=C,t.multiple=!!c,n!=null?ci(t,!!c,n,!1):l!=null&&ci(t,!!c,l,!0);return;case"textarea":et("invalid",t),v=g=c=null;for(C in l)if(l.hasOwnProperty(C)&&(P=l[C],P!=null))switch(C){case"value":c=P;break;case"defaultValue":g=P;break;case"children":v=P;break;case"dangerouslySetInnerHTML":if(P!=null)throw Error(i(91));break;default:yt(t,n,C,P,l,null)}jp(t,c,g,v);return;case"option":for(W in l)l.hasOwnProperty(W)&&(c=l[W],c!=null)&&(W==="selected"?t.selected=c&&typeof c!="function"&&typeof c!="symbol":yt(t,n,W,c,l,null));return;case"dialog":et("beforetoggle",t),et("toggle",t),et("cancel",t),et("close",t);break;case"iframe":case"object":et("load",t);break;case"video":case"audio":for(c=0;c<Vl.length;c++)et(Vl[c],t);break;case"image":et("error",t),et("load",t);break;case"details":et("toggle",t);break;case"embed":case"source":case"link":et("error",t),et("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(de in l)if(l.hasOwnProperty(de)&&(c=l[de],c!=null))switch(de){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,n));default:yt(t,n,de,c,l,null)}return;default:if(Cu(n)){for(ge in l)l.hasOwnProperty(ge)&&(c=l[ge],c!==void 0&&hf(t,n,ge,c,l,void 0));return}}for(P in l)l.hasOwnProperty(P)&&(c=l[P],c!=null&&yt(t,n,P,c,l,null))}function Z_(t,n,l,c){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var g=null,v=null,C=null,P=null,W=null,de=null,ge=null;for(me in l){var we=l[me];if(l.hasOwnProperty(me)&&we!=null)switch(me){case"checked":break;case"value":break;case"defaultValue":W=we;default:c.hasOwnProperty(me)||yt(t,n,me,null,c,we)}}for(var fe in c){var me=c[fe];if(we=l[fe],c.hasOwnProperty(fe)&&(me!=null||we!=null))switch(fe){case"type":v=me;break;case"name":g=me;break;case"checked":de=me;break;case"defaultChecked":ge=me;break;case"value":C=me;break;case"defaultValue":P=me;break;case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(i(137,n));break;default:me!==we&&yt(t,n,fe,me,c,we)}}_u(t,C,P,W,de,ge,v,g);return;case"select":me=C=P=fe=null;for(v in l)if(W=l[v],l.hasOwnProperty(v)&&W!=null)switch(v){case"value":break;case"multiple":me=W;default:c.hasOwnProperty(v)||yt(t,n,v,null,c,W)}for(g in c)if(v=c[g],W=l[g],c.hasOwnProperty(g)&&(v!=null||W!=null))switch(g){case"value":fe=v;break;case"defaultValue":P=v;break;case"multiple":C=v;default:v!==W&&yt(t,n,g,v,c,W)}n=P,l=C,c=me,fe!=null?ci(t,!!l,fe,!1):!!c!=!!l&&(n!=null?ci(t,!!l,n,!0):ci(t,!!l,l?[]:"",!1));return;case"textarea":me=fe=null;for(P in l)if(g=l[P],l.hasOwnProperty(P)&&g!=null&&!c.hasOwnProperty(P))switch(P){case"value":break;case"children":break;default:yt(t,n,P,null,c,g)}for(C in c)if(g=c[C],v=l[C],c.hasOwnProperty(C)&&(g!=null||v!=null))switch(C){case"value":fe=g;break;case"defaultValue":me=g;break;case"children":break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(i(91));break;default:g!==v&&yt(t,n,C,g,c,v)}_p(t,fe,me);return;case"option":for(var Oe in l)fe=l[Oe],l.hasOwnProperty(Oe)&&fe!=null&&!c.hasOwnProperty(Oe)&&(Oe==="selected"?t.selected=!1:yt(t,n,Oe,null,c,fe));for(W in c)fe=c[W],me=l[W],c.hasOwnProperty(W)&&fe!==me&&(fe!=null||me!=null)&&(W==="selected"?t.selected=fe&&typeof fe!="function"&&typeof fe!="symbol":yt(t,n,W,fe,c,me));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 Ye in l)fe=l[Ye],l.hasOwnProperty(Ye)&&fe!=null&&!c.hasOwnProperty(Ye)&&yt(t,n,Ye,null,c,fe);for(de in c)if(fe=c[de],me=l[de],c.hasOwnProperty(de)&&fe!==me&&(fe!=null||me!=null))switch(de){case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(i(137,n));break;default:yt(t,n,de,fe,c,me)}return;default:if(Cu(n)){for(var xt in l)fe=l[xt],l.hasOwnProperty(xt)&&fe!==void 0&&!c.hasOwnProperty(xt)&&hf(t,n,xt,void 0,c,fe);for(ge in c)fe=c[ge],me=l[ge],!c.hasOwnProperty(ge)||fe===me||fe===void 0&&me===void 0||hf(t,n,ge,fe,c,me);return}}for(var ae in l)fe=l[ae],l.hasOwnProperty(ae)&&fe!=null&&!c.hasOwnProperty(ae)&&yt(t,n,ae,null,c,fe);for(we in c)fe=c[we],me=l[we],!c.hasOwnProperty(we)||fe===me||fe==null&&me==null||yt(t,n,we,fe,c,me)}function Nx(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Q_(){if(typeof performance.getEntriesByType=="function"){for(var t=0,n=0,l=performance.getEntriesByType("resource"),c=0;c<l.length;c++){var g=l[c],v=g.transferSize,C=g.initiatorType,P=g.duration;if(v&&P&&Nx(C)){for(C=0,P=g.responseEnd,c+=1;c<l.length;c++){var W=l[c],de=W.startTime;if(de>P)break;var ge=W.transferSize,we=W.initiatorType;ge&&Nx(we)&&(W=W.responseEnd,C+=ge*(W<P?1:(P-de)/(W-de)))}if(--c,n+=8*(v+C)/(g.duration/1e3),t++,10<t)break}}if(0<t)return n/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var mf=null,pf=null;function Ho(t){return t.nodeType===9?t:t.ownerDocument}function Ax(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 Tx(t,n){if(t===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&n==="foreignObject"?0:t}function gf(t,n){return t==="textarea"||t==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var yf=null;function W_(){var t=window.event;return t&&t.type==="popstate"?t===yf?!1:(yf=t,!0):(yf=null,!1)}var Rx=typeof setTimeout=="function"?setTimeout:void 0,J_=typeof clearTimeout=="function"?clearTimeout:void 0,Ox=typeof Promise=="function"?Promise:void 0,ej=typeof queueMicrotask=="function"?queueMicrotask:typeof Ox<"u"?function(t){return Ox.resolve(null).then(t).catch(tj)}:Rx;function tj(t){setTimeout(function(){throw t})}function na(t){return t==="head"}function zx(t,n){var l=n,c=0;do{var g=l.nextSibling;if(t.removeChild(l),g&&g.nodeType===8)if(l=g.data,l==="/$"||l==="/&"){if(c===0){t.removeChild(g),Fi(n);return}c--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")c++;else if(l==="html")Xl(t.ownerDocument.documentElement);else if(l==="head"){l=t.ownerDocument.head,Xl(l);for(var v=l.firstChild;v;){var C=v.nextSibling,P=v.nodeName;v[hl]||P==="SCRIPT"||P==="STYLE"||P==="LINK"&&v.rel.toLowerCase()==="stylesheet"||l.removeChild(v),v=C}}else l==="body"&&Xl(t.ownerDocument.body);l=g}while(l);Fi(n)}function Mx(t,n){var l=t;t=0;do{var c=l.nextSibling;if(l.nodeType===1?n?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(n?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),c&&c.nodeType===8)if(l=c.data,l==="/$"){if(t===0)break;t--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||t++;l=c}while(l)}function xf(t){var n=t.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var l=n;switch(n=n.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":xf(l),Su(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}t.removeChild(l)}}function nj(t,n,l,c){for(;t.nodeType===1;){var g=l;if(t.nodeName.toLowerCase()!==n.toLowerCase()){if(!c&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(c){if(!t[hl])switch(n){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(v=t.getAttribute("rel"),v==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(v!==g.rel||t.getAttribute("href")!==(g.href==null||g.href===""?null:g.href)||t.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin)||t.getAttribute("title")!==(g.title==null?null:g.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(v=t.getAttribute("src"),(v!==(g.src==null?null:g.src)||t.getAttribute("type")!==(g.type==null?null:g.type)||t.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin))&&v&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(n==="input"&&t.type==="hidden"){var v=g.name==null?null:""+g.name;if(g.type==="hidden"&&t.getAttribute("name")===v)return t}else return t;if(t=Hn(t.nextSibling),t===null)break}return null}function rj(t,n,l){if(n==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!l||(t=Hn(t.nextSibling),t===null))return null;return t}function Dx(t,n){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=Hn(t.nextSibling),t===null))return null;return t}function vf(t){return t.data==="$?"||t.data==="$~"}function bf(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function aj(t,n){var l=t.ownerDocument;if(t.data==="$~")t._reactRetry=n;else if(t.data!=="$?"||l.readyState!=="loading")n();else{var c=function(){n(),l.removeEventListener("DOMContentLoaded",c)};l.addEventListener("DOMContentLoaded",c),t._reactRetry=c}}function Hn(t){for(;t!=null;t=t.nextSibling){var n=t.nodeType;if(n===1||n===3)break;if(n===8){if(n=t.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return t}var wf=null;function Lx(t){t=t.nextSibling;for(var n=0;t;){if(t.nodeType===8){var l=t.data;if(l==="/$"||l==="/&"){if(n===0)return Hn(t.nextSibling);n--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||n++}t=t.nextSibling}return null}function Ix(t){t=t.previousSibling;for(var n=0;t;){if(t.nodeType===8){var l=t.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(n===0)return t;n--}else l!=="/$"&&l!=="/&"||n++}t=t.previousSibling}return null}function Px(t,n,l){switch(n=Ho(l),t){case"html":if(t=n.documentElement,!t)throw Error(i(452));return t;case"head":if(t=n.head,!t)throw Error(i(453));return t;case"body":if(t=n.body,!t)throw Error(i(454));return t;default:throw Error(i(451))}}function Xl(t){for(var n=t.attributes;n.length;)t.removeAttributeNode(n[0]);Su(t)}var qn=new Map,Ux=new Set;function qo(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var zr=X.d;X.d={f:ij,r:lj,D:sj,C:oj,L:cj,m:uj,X:fj,S:dj,M:hj};function ij(){var t=zr.f(),n=Mo();return t||n}function lj(t){var n=li(t);n!==null&&n.tag===5&&n.type==="form"?ny(n):zr.r(t)}var Pi=typeof document>"u"?null:document;function Bx(t,n,l){var c=Pi;if(c&&typeof n=="string"&&n){var g=Dn(n);g='link[rel="'+t+'"][href="'+g+'"]',typeof l=="string"&&(g+='[crossorigin="'+l+'"]'),Ux.has(g)||(Ux.add(g),t={rel:t,crossOrigin:l,href:n},c.querySelector(g)===null&&(n=c.createElement("link"),en(n,"link",t),Vt(n),c.head.appendChild(n)))}}function sj(t){zr.D(t),Bx("dns-prefetch",t,null)}function oj(t,n){zr.C(t,n),Bx("preconnect",t,n)}function cj(t,n,l){zr.L(t,n,l);var c=Pi;if(c&&t&&n){var g='link[rel="preload"][as="'+Dn(n)+'"]';n==="image"&&l&&l.imageSrcSet?(g+='[imagesrcset="'+Dn(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(g+='[imagesizes="'+Dn(l.imageSizes)+'"]')):g+='[href="'+Dn(t)+'"]';var v=g;switch(n){case"style":v=Ui(t);break;case"script":v=Bi(t)}qn.has(v)||(t=p({rel:"preload",href:n==="image"&&l&&l.imageSrcSet?void 0:t,as:n},l),qn.set(v,t),c.querySelector(g)!==null||n==="style"&&c.querySelector(Zl(v))||n==="script"&&c.querySelector(Ql(v))||(n=c.createElement("link"),en(n,"link",t),Vt(n),c.head.appendChild(n)))}}function uj(t,n){zr.m(t,n);var l=Pi;if(l&&t){var c=n&&typeof n.as=="string"?n.as:"script",g='link[rel="modulepreload"][as="'+Dn(c)+'"][href="'+Dn(t)+'"]',v=g;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=Bi(t)}if(!qn.has(v)&&(t=p({rel:"modulepreload",href:t},n),qn.set(v,t),l.querySelector(g)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Ql(v)))return}c=l.createElement("link"),en(c,"link",t),Vt(c),l.head.appendChild(c)}}}function dj(t,n,l){zr.S(t,n,l);var c=Pi;if(c&&t){var g=si(c).hoistableStyles,v=Ui(t);n=n||"default";var C=g.get(v);if(!C){var P={loading:0,preload:null};if(C=c.querySelector(Zl(v)))P.loading=5;else{t=p({rel:"stylesheet",href:t,"data-precedence":n},l),(l=qn.get(v))&&Sf(t,l);var W=C=c.createElement("link");Vt(W),en(W,"link",t),W._p=new Promise(function(de,ge){W.onload=de,W.onerror=ge}),W.addEventListener("load",function(){P.loading|=1}),W.addEventListener("error",function(){P.loading|=2}),P.loading|=4,Go(C,n,c)}C={type:"stylesheet",instance:C,count:1,state:P},g.set(v,C)}}}function fj(t,n){zr.X(t,n);var l=Pi;if(l&&t){var c=si(l).hoistableScripts,g=Bi(t),v=c.get(g);v||(v=l.querySelector(Ql(g)),v||(t=p({src:t,async:!0},n),(n=qn.get(g))&&kf(t,n),v=l.createElement("script"),Vt(v),en(v,"link",t),l.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},c.set(g,v))}}function hj(t,n){zr.M(t,n);var l=Pi;if(l&&t){var c=si(l).hoistableScripts,g=Bi(t),v=c.get(g);v||(v=l.querySelector(Ql(g)),v||(t=p({src:t,async:!0,type:"module"},n),(n=qn.get(g))&&kf(t,n),v=l.createElement("script"),Vt(v),en(v,"link",t),l.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},c.set(g,v))}}function Fx(t,n,l,c){var g=(g=ve.current)?qo(g):null;if(!g)throw Error(i(446));switch(t){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(n=Ui(l.href),l=si(g).hoistableStyles,c=l.get(n),c||(c={type:"style",instance:null,count:0,state:null},l.set(n,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){t=Ui(l.href);var v=si(g).hoistableStyles,C=v.get(t);if(C||(g=g.ownerDocument||g,C={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(t,C),(v=g.querySelector(Zl(t)))&&!v._p&&(C.instance=v,C.state.loading=5),qn.has(t)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},qn.set(t,l),v||mj(g,t,l,C.state))),n&&c===null)throw Error(i(528,""));return C}if(n&&c!==null)throw Error(i(529,""));return null;case"script":return n=l.async,l=l.src,typeof l=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=Bi(l),l=si(g).hoistableScripts,c=l.get(n),c||(c={type:"script",instance:null,count:0,state:null},l.set(n,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,t))}}function Ui(t){return'href="'+Dn(t)+'"'}function Zl(t){return'link[rel="stylesheet"]['+t+"]"}function Hx(t){return p({},t,{"data-precedence":t.precedence,precedence:null})}function mj(t,n,l,c){t.querySelector('link[rel="preload"][as="style"]['+n+"]")?c.loading=1:(n=t.createElement("link"),c.preload=n,n.addEventListener("load",function(){return c.loading|=1}),n.addEventListener("error",function(){return c.loading|=2}),en(n,"link",l),Vt(n),t.head.appendChild(n))}function Bi(t){return'[src="'+Dn(t)+'"]'}function Ql(t){return"script[async]"+t}function qx(t,n,l){if(n.count++,n.instance===null)switch(n.type){case"style":var c=t.querySelector('style[data-href~="'+Dn(l.href)+'"]');if(c)return n.instance=c,Vt(c),c;var g=p({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return c=(t.ownerDocument||t).createElement("style"),Vt(c),en(c,"style",g),Go(c,l.precedence,t),n.instance=c;case"stylesheet":g=Ui(l.href);var v=t.querySelector(Zl(g));if(v)return n.state.loading|=4,n.instance=v,Vt(v),v;c=Hx(l),(g=qn.get(g))&&Sf(c,g),v=(t.ownerDocument||t).createElement("link"),Vt(v);var C=v;return C._p=new Promise(function(P,W){C.onload=P,C.onerror=W}),en(v,"link",c),n.state.loading|=4,Go(v,l.precedence,t),n.instance=v;case"script":return v=Bi(l.src),(g=t.querySelector(Ql(v)))?(n.instance=g,Vt(g),g):(c=l,(g=qn.get(v))&&(c=p({},l),kf(c,g)),t=t.ownerDocument||t,g=t.createElement("script"),Vt(g),en(g,"link",c),t.head.appendChild(g),n.instance=g);case"void":return null;default:throw Error(i(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(c=n.instance,n.state.loading|=4,Go(c,l.precedence,t));return n.instance}function Go(t,n,l){for(var c=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),g=c.length?c[c.length-1]:null,v=g,C=0;C<c.length;C++){var P=c[C];if(P.dataset.precedence===n)v=P;else if(v!==g)break}v?v.parentNode.insertBefore(t,v.nextSibling):(n=l.nodeType===9?l.head:l,n.insertBefore(t,n.firstChild))}function Sf(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.title==null&&(t.title=n.title)}function kf(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.integrity==null&&(t.integrity=n.integrity)}var Yo=null;function Gx(t,n,l){if(Yo===null){var c=new Map,g=Yo=new Map;g.set(l,c)}else g=Yo,c=g.get(l),c||(c=new Map,g.set(l,c));if(c.has(t))return c;for(c.set(t,null),l=l.getElementsByTagName(t),g=0;g<l.length;g++){var v=l[g];if(!(v[hl]||v[Zt]||t==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var C=v.getAttribute(n)||"";C=t+C;var P=c.get(C);P?P.push(v):c.set(C,[v])}}return c}function Yx(t,n,l){t=t.ownerDocument||t,t.head.insertBefore(l,n==="title"?t.querySelector("head > title"):null)}function pj(t,n,l){if(l===1||n.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;return n.rel==="stylesheet"?(t=n.disabled,typeof n.precedence=="string"&&t==null):!0;case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function $x(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function gj(t,n,l,c){if(l.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var g=Ui(c.href),v=n.querySelector(Zl(g));if(v){n=v._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(t.count++,t=$o.bind(t),n.then(t,t)),l.state.loading|=4,l.instance=v,Vt(v);return}v=n.ownerDocument||n,c=Hx(c),(g=qn.get(g))&&Sf(c,g),v=v.createElement("link"),Vt(v);var C=v;C._p=new Promise(function(P,W){C.onload=P,C.onerror=W}),en(v,"link",c),l.instance=v}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(l,n),(n=l.state.preload)&&(l.state.loading&3)===0&&(t.count++,l=$o.bind(t),n.addEventListener("load",l),n.addEventListener("error",l))}}var _f=0;function yj(t,n){return t.stylesheets&&t.count===0&&Ko(t,t.stylesheets),0<t.count||0<t.imgCount?function(l){var c=setTimeout(function(){if(t.stylesheets&&Ko(t,t.stylesheets),t.unsuspend){var v=t.unsuspend;t.unsuspend=null,v()}},6e4+n);0<t.imgBytes&&_f===0&&(_f=62500*Q_());var g=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Ko(t,t.stylesheets),t.unsuspend)){var v=t.unsuspend;t.unsuspend=null,v()}},(t.imgBytes>_f?50:800)+n);return t.unsuspend=l,function(){t.unsuspend=null,clearTimeout(c),clearTimeout(g)}}:null}function $o(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ko(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Vo=null;function Ko(t,n){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Vo=new Map,n.forEach(xj,t),Vo=null,$o.call(t))}function xj(t,n){if(!(n.state.loading&4)){var l=Vo.get(t);if(l)var c=l.get(null);else{l=new Map,Vo.set(t,l);for(var g=t.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<g.length;v++){var C=g[v];(C.nodeName==="LINK"||C.getAttribute("media")!=="not all")&&(l.set(C.dataset.precedence,C),c=C)}c&&l.set(null,c)}g=n.instance,C=g.getAttribute("data-precedence"),v=l.get(C)||c,v===c&&l.set(null,g),l.set(C,g),this.count++,c=$o.bind(this),g.addEventListener("load",c),g.addEventListener("error",c),v?v.parentNode.insertBefore(g,v.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(g,t.firstChild)),n.state.loading|=4}}var Wl={$$typeof:A,Provider:null,Consumer:null,_currentValue:re,_currentValue2:re,_threadCount:0};function vj(t,n,l,c,g,v,C,P,W){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=xu(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=xu(0),this.hiddenUpdates=xu(null),this.identifierPrefix=c,this.onUncaughtError=g,this.onCaughtError=v,this.onRecoverableError=C,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=W,this.incompleteTransitions=new Map}function Vx(t,n,l,c,g,v,C,P,W,de,ge,we){return t=new vj(t,n,l,C,W,de,ge,we,P),n=1,v===!0&&(n|=24),v=kn(3,null,null,n),t.current=v,v.stateNode=t,n=nd(),n.refCount++,t.pooledCache=n,n.refCount++,v.memoizedState={element:c,isDehydrated:l,cache:n},ld(v),t}function Kx(t){return t?(t=yi,t):yi}function Xx(t,n,l,c,g,v){g=Kx(g),c.context===null?c.context=g:c.pendingContext=g,c=Yr(n),c.payload={element:l},v=v===void 0?null:v,v!==null&&(c.callback=v),l=$r(t,c,n),l!==null&&(xn(l,t,n),Tl(l,t,n))}function Zx(t,n){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var l=t.retryLane;t.retryLane=l!==0&&l<n?l:n}}function jf(t,n){Zx(t,n),(t=t.alternate)&&Zx(t,n)}function Qx(t){if(t.tag===13||t.tag===31){var n=Ea(t,67108864);n!==null&&xn(n,t,67108864),jf(t,67108864)}}function Wx(t){if(t.tag===13||t.tag===31){var n=Nn();n=vu(n);var l=Ea(t,n);l!==null&&xn(l,t,n),jf(t,n)}}var Xo=!0;function bj(t,n,l,c){var g=$.T;$.T=null;var v=X.p;try{X.p=2,Cf(t,n,l,c)}finally{X.p=v,$.T=g}}function wj(t,n,l,c){var g=$.T;$.T=null;var v=X.p;try{X.p=8,Cf(t,n,l,c)}finally{X.p=v,$.T=g}}function Cf(t,n,l,c){if(Xo){var g=Ef(c);if(g===null)ff(t,n,c,Zo,l),ev(t,c);else if(kj(g,t,n,l,c))c.stopPropagation();else if(ev(t,c),n&4&&-1<Sj.indexOf(t)){for(;g!==null;){var v=li(g);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var C=zn(v.pendingLanes);if(C!==0){var P=v;for(P.pendingLanes|=2,P.entangledLanes|=2;C;){var W=1<<31-We(C);P.entanglements[1]|=W,C&=~W}lr(v),(ft&6)===0&&(Oo=xe()+500,$l(0))}}break;case 31:case 13:P=Ea(v,2),P!==null&&xn(P,v,2),Mo(),jf(v,2)}if(v=Ef(c),v===null&&ff(t,n,c,Zo,l),v===g)break;g=v}g!==null&&c.stopPropagation()}else ff(t,n,c,null,l)}}function Ef(t){return t=Nu(t),Nf(t)}var Zo=null;function Nf(t){if(Zo=null,t=ii(t),t!==null){var n=o(t);if(n===null)t=null;else{var l=n.tag;if(l===13){if(t=u(n),t!==null)return t;t=null}else if(l===31){if(t=f(n),t!==null)return t;t=null}else if(l===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;t=null}else n!==t&&(t=null)}}return Zo=t,null}function Jx(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(ke()){case ne:return 2;case pe:return 8;case _e:case se:return 32;case Te:return 268435456;default:return 32}default:return 32}}var Af=!1,ra=null,aa=null,ia=null,Jl=new Map,es=new Map,la=[],Sj="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 ev(t,n){switch(t){case"focusin":case"focusout":ra=null;break;case"dragenter":case"dragleave":aa=null;break;case"mouseover":case"mouseout":ia=null;break;case"pointerover":case"pointerout":Jl.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":es.delete(n.pointerId)}}function ts(t,n,l,c,g,v){return t===null||t.nativeEvent!==v?(t={blockedOn:n,domEventName:l,eventSystemFlags:c,nativeEvent:v,targetContainers:[g]},n!==null&&(n=li(n),n!==null&&Qx(n)),t):(t.eventSystemFlags|=c,n=t.targetContainers,g!==null&&n.indexOf(g)===-1&&n.push(g),t)}function kj(t,n,l,c,g){switch(n){case"focusin":return ra=ts(ra,t,n,l,c,g),!0;case"dragenter":return aa=ts(aa,t,n,l,c,g),!0;case"mouseover":return ia=ts(ia,t,n,l,c,g),!0;case"pointerover":var v=g.pointerId;return Jl.set(v,ts(Jl.get(v)||null,t,n,l,c,g)),!0;case"gotpointercapture":return v=g.pointerId,es.set(v,ts(es.get(v)||null,t,n,l,c,g)),!0}return!1}function tv(t){var n=ii(t.target);if(n!==null){var l=o(n);if(l!==null){if(n=l.tag,n===13){if(n=u(l),n!==null){t.blockedOn=n,pp(t.priority,function(){Wx(l)});return}}else if(n===31){if(n=f(l),n!==null){t.blockedOn=n,pp(t.priority,function(){Wx(l)});return}}else if(n===3&&l.stateNode.current.memoizedState.isDehydrated){t.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Qo(t){if(t.blockedOn!==null)return!1;for(var n=t.targetContainers;0<n.length;){var l=Ef(t.nativeEvent);if(l===null){l=t.nativeEvent;var c=new l.constructor(l.type,l);Eu=c,l.target.dispatchEvent(c),Eu=null}else return n=li(l),n!==null&&Qx(n),t.blockedOn=l,!1;n.shift()}return!0}function nv(t,n,l){Qo(t)&&l.delete(n)}function _j(){Af=!1,ra!==null&&Qo(ra)&&(ra=null),aa!==null&&Qo(aa)&&(aa=null),ia!==null&&Qo(ia)&&(ia=null),Jl.forEach(nv),es.forEach(nv)}function Wo(t,n){t.blockedOn===n&&(t.blockedOn=null,Af||(Af=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,_j)))}var Jo=null;function rv(t){Jo!==t&&(Jo=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Jo===t&&(Jo=null);for(var n=0;n<t.length;n+=3){var l=t[n],c=t[n+1],g=t[n+2];if(typeof c!="function"){if(Nf(c||l)===null)continue;break}var v=li(l);v!==null&&(t.splice(n,3),n-=3,Cd(v,{pending:!0,data:g,method:l.method,action:c},c,g))}}))}function Fi(t){function n(W){return Wo(W,t)}ra!==null&&Wo(ra,t),aa!==null&&Wo(aa,t),ia!==null&&Wo(ia,t),Jl.forEach(n),es.forEach(n);for(var l=0;l<la.length;l++){var c=la[l];c.blockedOn===t&&(c.blockedOn=null)}for(;0<la.length&&(l=la[0],l.blockedOn===null);)tv(l),l.blockedOn===null&&la.shift();if(l=(t.ownerDocument||t).$$reactFormReplay,l!=null)for(c=0;c<l.length;c+=3){var g=l[c],v=l[c+1],C=g[fn]||null;if(typeof v=="function")C||rv(l);else if(C){var P=null;if(v&&v.hasAttribute("formAction")){if(g=v,C=v[fn]||null)P=C.formAction;else if(Nf(g)!==null)continue}else P=C.action;typeof P=="function"?l[c+1]=P:(l.splice(c,3),c-=3),rv(l)}}}function av(){function t(v){v.canIntercept&&v.info==="react-transition"&&v.intercept({handler:function(){return new Promise(function(C){return g=C})},focusReset:"manual",scroll:"manual"})}function n(){g!==null&&(g(),g=null),c||setTimeout(l,20)}function l(){if(!c&&!navigation.transition){var v=navigation.currentEntry;v&&v.url!=null&&navigation.navigate(v.url,{state:v.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var c=!1,g=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(l,100),function(){c=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),g!==null&&(g(),g=null)}}}function Tf(t){this._internalRoot=t}ec.prototype.render=Tf.prototype.render=function(t){var n=this._internalRoot;if(n===null)throw Error(i(409));var l=n.current,c=Nn();Xx(l,c,t,n,null,null)},ec.prototype.unmount=Tf.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var n=t.containerInfo;Xx(t.current,2,null,t,null,null),Mo(),n[ai]=null}};function ec(t){this._internalRoot=t}ec.prototype.unstable_scheduleHydration=function(t){if(t){var n=mp();t={blockedOn:null,target:t,priority:n};for(var l=0;l<la.length&&n!==0&&n<la[l].priority;l++);la.splice(l,0,t),l===0&&tv(t)}};var iv=r.version;if(iv!=="19.2.4")throw Error(i(527,iv,"19.2.4"));X.findDOMNode=function(t){var n=t._reactInternals;if(n===void 0)throw typeof t.render=="function"?Error(i(188)):(t=Object.keys(t).join(","),Error(i(268,t)));return t=m(n),t=t!==null?y(t):null,t=t===null?null:t.stateNode,t};var jj={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:$,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var tc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!tc.isDisabled&&tc.supportsFiber)try{Ue=tc.inject(jj),at=tc}catch{}}return rs.createRoot=function(t,n){if(!s(t))throw Error(i(299));var l=!1,c="",g=fy,v=hy,C=my;return n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(c=n.identifierPrefix),n.onUncaughtError!==void 0&&(g=n.onUncaughtError),n.onCaughtError!==void 0&&(v=n.onCaughtError),n.onRecoverableError!==void 0&&(C=n.onRecoverableError)),n=Vx(t,1,!1,null,null,l,c,null,g,v,C,av),t[ai]=n.current,df(t),new Tf(n)},rs.hydrateRoot=function(t,n,l){if(!s(t))throw Error(i(299));var c=!1,g="",v=fy,C=hy,P=my,W=null;return l!=null&&(l.unstable_strictMode===!0&&(c=!0),l.identifierPrefix!==void 0&&(g=l.identifierPrefix),l.onUncaughtError!==void 0&&(v=l.onUncaughtError),l.onCaughtError!==void 0&&(C=l.onCaughtError),l.onRecoverableError!==void 0&&(P=l.onRecoverableError),l.formState!==void 0&&(W=l.formState)),n=Vx(t,1,!0,n,l??null,c,g,W,v,C,P,av),n.context=Kx(null),l=n.current,c=Nn(),c=vu(c),g=Yr(c),g.callback=null,$r(l,g,c),l=c,n.current.lanes=l,fl(n,l),lr(n),t[ai]=n.current,df(t),new ec(n)},rs.version="19.2.4",rs}var pv;function Dj(){if(pv)return zf.exports;pv=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(r){console.error(r)}}return e(),zf.exports=Mj(),zf.exports}var Lj=Dj();function u0(e){var r,a,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(r=0;r<s;r++)e[r]&&(a=u0(e[r]))&&(i&&(i+=" "),i+=a)}else for(a in e)e[a]&&(i&&(i+=" "),i+=a);return i}function d0(){for(var e,r,a=0,i="",s=arguments.length;a<s;a++)(e=arguments[a])&&(r=u0(e))&&(i&&(i+=" "),i+=r);return i}const gv=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,yv=d0,Bc=(e,r)=>a=>{var i;if(r?.variants==null)return yv(e,a?.class,a?.className);const{variants:s,defaultVariants:o}=r,u=Object.keys(s).map(m=>{const y=a?.[m],p=o?.[m];if(y===null)return null;const b=gv(y)||gv(p);return s[m][b]}),f=a&&Object.entries(a).reduce((m,y)=>{let[p,b]=y;return b===void 0||(m[p]=b),m},{}),h=r==null||(i=r.compoundVariants)===null||i===void 0?void 0:i.reduce((m,y)=>{let{class:p,className:b,...x}=y;return Object.entries(x).every(S=>{let[w,_]=S;return Array.isArray(_)?_.includes({...o,...f}[w]):{...o,...f}[w]===_})?[...m,p,b]:m},[]);return yv(e,u,h,a?.class,a?.className)};var em=c0();const Ij=_s(em);function xv(e,r){if(typeof e=="function")return e(r);e!=null&&(e.current=r)}function Fc(...e){return r=>{let a=!1;const i=e.map(s=>{const o=xv(s,r);return!a&&typeof o=="function"&&(a=!0),o});if(a)return()=>{for(let s=0;s<i.length;s++){const o=i[s];typeof o=="function"?o():xv(e[s],null)}}}}function Ct(...e){return j.useCallback(Fc(...e),e)}function Ji(e){const r=Pj(e),a=j.forwardRef((i,s)=>{const{children:o,...u}=i,f=j.Children.toArray(o),h=f.find(Bj);if(h){const m=h.props.children,y=f.map(p=>p===h?j.Children.count(m)>1?j.Children.only(null):j.isValidElement(m)?m.props.children:null:p);return d.jsx(r,{...u,ref:s,children:j.isValidElement(m)?j.cloneElement(m,void 0,y):null})}return d.jsx(r,{...u,ref:s,children:o})});return a.displayName=`${e}.Slot`,a}var Hc=Ji("Slot");function Pj(e){const r=j.forwardRef((a,i)=>{const{children:s,...o}=a;if(j.isValidElement(s)){const u=Hj(s),f=Fj(o,s.props);return s.type!==j.Fragment&&(f.ref=i?Fc(i,u):u),j.cloneElement(s,f)}return j.Children.count(s)>1?j.Children.only(null):null});return r.displayName=`${e}.SlotClone`,r}var f0=Symbol("radix.slottable");function Uj(e){const r=({children:a})=>d.jsx(d.Fragment,{children:a});return r.displayName=`${e}.Slottable`,r.__radixId=f0,r}function Bj(e){return j.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===f0}function Fj(e,r){const a={...r};for(const i in r){const s=e[i],o=r[i];/^on[A-Z]/.test(i)?s&&o?a[i]=(...f)=>{const h=o(...f);return s(...f),h}:s&&(a[i]=s):i==="style"?a[i]={...s,...o}:i==="className"&&(a[i]=[s,o].filter(Boolean).join(" "))}return{...e,...a}}function Hj(e){let r=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,a=r&&"isReactWarning"in r&&r.isReactWarning;return a?e.ref:(r=Object.getOwnPropertyDescriptor(e,"ref")?.get,a=r&&"isReactWarning"in r&&r.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var qj=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],st=qj.reduce((e,r)=>{const a=Ji(`Primitive.${r}`),i=j.forwardRef((s,o)=>{const{asChild:u,...f}=s,h=u?a:r;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(h,{...f,ref:o})});return i.displayName=`Primitive.${r}`,{...e,[r]:i}},{});function h0(e,r){e&&em.flushSync(()=>e.dispatchEvent(r))}var Gj=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Yj="VisuallyHidden",m0=j.forwardRef((e,r)=>d.jsx(st.span,{...e,ref:r,style:{...Gj,...e.style}}));m0.displayName=Yj;var $j=m0;function Vj(e,r){const a=j.createContext(r),i=o=>{const{children:u,...f}=o,h=j.useMemo(()=>f,Object.values(f));return d.jsx(a.Provider,{value:h,children:u})};i.displayName=e+"Provider";function s(o){const u=j.useContext(a);if(u)return u;if(r!==void 0)return r;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[i,s]}function fr(e,r=[]){let a=[];function i(o,u){const f=j.createContext(u),h=a.length;a=[...a,u];const m=p=>{const{scope:b,children:x,...S}=p,w=b?.[e]?.[h]||f,_=j.useMemo(()=>S,Object.values(S));return d.jsx(w.Provider,{value:_,children:x})};m.displayName=o+"Provider";function y(p,b){const x=b?.[e]?.[h]||f,S=j.useContext(x);if(S)return S;if(u!==void 0)return u;throw new Error(`\`${p}\` must be used within \`${o}\``)}return[m,y]}const s=()=>{const o=a.map(u=>j.createContext(u));return function(f){const h=f?.[e]||o;return j.useMemo(()=>({[`__scope${e}`]:{...f,[e]:h}}),[f,h])}};return s.scopeName=e,[i,Kj(s,...r)]}function Kj(...e){const r=e[0];if(e.length===1)return r;const a=()=>{const i=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const u=i.reduce((f,{useScope:h,scopeName:m})=>{const p=h(o)[`__scope${m}`];return{...f,...p}},{});return j.useMemo(()=>({[`__scope${r.scopeName}`]:u}),[u])}};return a.scopeName=r.scopeName,a}function p0(e){const r=e+"CollectionProvider",[a,i]=fr(r),[s,o]=a(r,{collectionRef:{current:null},itemMap:new Map}),u=w=>{const{scope:_,children:k}=w,N=da.useRef(null),A=da.useRef(new Map).current;return d.jsx(s,{scope:_,itemMap:A,collectionRef:N,children:k})};u.displayName=r;const f=e+"CollectionSlot",h=Ji(f),m=da.forwardRef((w,_)=>{const{scope:k,children:N}=w,A=o(f,k),O=Ct(_,A.collectionRef);return d.jsx(h,{ref:O,children:N})});m.displayName=f;const y=e+"CollectionItemSlot",p="data-radix-collection-item",b=Ji(y),x=da.forwardRef((w,_)=>{const{scope:k,children:N,...A}=w,O=da.useRef(null),M=Ct(_,O),D=o(y,k);return da.useEffect(()=>(D.itemMap.set(O,{ref:O,...A}),()=>{D.itemMap.delete(O)})),d.jsx(b,{[p]:"",ref:M,children:N})});x.displayName=y;function S(w){const _=o(e+"CollectionConsumer",w);return da.useCallback(()=>{const N=_.collectionRef.current;if(!N)return[];const A=Array.from(N.querySelectorAll(`[${p}]`));return Array.from(_.itemMap.values()).sort((D,B)=>A.indexOf(D.ref.current)-A.indexOf(B.ref.current))},[_.collectionRef,_.itemMap])}return[{Provider:u,Slot:m,ItemSlot:x},S,i]}function Fe(e,r,{checkForDefaultPrevented:a=!0}={}){return function(s){if(e?.(s),a===!1||!s.defaultPrevented)return r?.(s)}}var $n=globalThis?.document?j.useLayoutEffect:()=>{},Xj=o0[" useInsertionEffect ".trim().toString()]||$n;function js({prop:e,defaultProp:r,onChange:a=()=>{},caller:i}){const[s,o,u]=Zj({defaultProp:r,onChange:a}),f=e!==void 0,h=f?e:s;{const y=j.useRef(e!==void 0);j.useEffect(()=>{const p=y.current;p!==f&&console.warn(`${i} is changing from ${p?"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.`),y.current=f},[f,i])}const m=j.useCallback(y=>{if(f){const p=Qj(y)?y(e):y;p!==e&&u.current?.(p)}else o(y)},[f,e,o,u]);return[h,m]}function Zj({defaultProp:e,onChange:r}){const[a,i]=j.useState(e),s=j.useRef(a),o=j.useRef(r);return Xj(()=>{o.current=r},[r]),j.useEffect(()=>{s.current!==a&&(o.current?.(a),s.current=a)},[a,s]),[a,i,o]}function Qj(e){return typeof e=="function"}function Wj(e,r){return j.useReducer((a,i)=>r[a][i]??a,e)}var un=e=>{const{present:r,children:a}=e,i=Jj(r),s=typeof a=="function"?a({present:i.isPresent}):j.Children.only(a),o=Ct(i.ref,eC(s));return typeof a=="function"||i.isPresent?j.cloneElement(s,{ref:o}):null};un.displayName="Presence";function Jj(e){const[r,a]=j.useState(),i=j.useRef(null),s=j.useRef(e),o=j.useRef("none"),u=e?"mounted":"unmounted",[f,h]=Wj(u,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return j.useEffect(()=>{const m=rc(i.current);o.current=f==="mounted"?m:"none"},[f]),$n(()=>{const m=i.current,y=s.current;if(y!==e){const b=o.current,x=rc(m);e?h("MOUNT"):x==="none"||m?.display==="none"?h("UNMOUNT"):h(y&&b!==x?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,h]),$n(()=>{if(r){let m;const y=r.ownerDocument.defaultView??window,p=x=>{const w=rc(i.current).includes(CSS.escape(x.animationName));if(x.target===r&&w&&(h("ANIMATION_END"),!s.current)){const _=r.style.animationFillMode;r.style.animationFillMode="forwards",m=y.setTimeout(()=>{r.style.animationFillMode==="forwards"&&(r.style.animationFillMode=_)})}},b=x=>{x.target===r&&(o.current=rc(i.current))};return r.addEventListener("animationstart",b),r.addEventListener("animationcancel",p),r.addEventListener("animationend",p),()=>{y.clearTimeout(m),r.removeEventListener("animationstart",b),r.removeEventListener("animationcancel",p),r.removeEventListener("animationend",p)}}else h("ANIMATION_END")},[r,h]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:j.useCallback(m=>{i.current=m?getComputedStyle(m):null,a(m)},[])}}function rc(e){return e?.animationName||"none"}function eC(e){let r=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,a=r&&"isReactWarning"in r&&r.isReactWarning;return a?e.ref:(r=Object.getOwnPropertyDescriptor(e,"ref")?.get,a=r&&"isReactWarning"in r&&r.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var tC=o0[" useId ".trim().toString()]||(()=>{}),nC=0;function pa(e){const[r,a]=j.useState(tC());return $n(()=>{a(i=>i??String(nC++))},[e]),e||(r?`radix-${r}`:"")}var rC=j.createContext(void 0);function qc(e){const r=j.useContext(rC);return e||r||"ltr"}function tn(e){const r=j.useRef(e);return j.useEffect(()=>{r.current=e}),j.useMemo(()=>(...a)=>r.current?.(...a),[])}function aC(e,r=globalThis?.document){const a=tn(e);j.useEffect(()=>{const i=s=>{s.key==="Escape"&&a(s)};return r.addEventListener("keydown",i,{capture:!0}),()=>r.removeEventListener("keydown",i,{capture:!0})},[a,r])}var iC="DismissableLayer",wh="dismissableLayer.update",lC="dismissableLayer.pointerDownOutside",sC="dismissableLayer.focusOutside",vv,g0=j.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Gc=j.forwardRef((e,r)=>{const{disableOutsidePointerEvents:a=!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:u,onDismiss:f,...h}=e,m=j.useContext(g0),[y,p]=j.useState(null),b=y?.ownerDocument??globalThis?.document,[,x]=j.useState({}),S=Ct(r,B=>p(B)),w=Array.from(m.layers),[_]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),k=w.indexOf(_),N=y?w.indexOf(y):-1,A=m.layersWithOutsidePointerEventsDisabled.size>0,O=N>=k,M=uC(B=>{const V=B.target,K=[...m.branches].some(U=>U.contains(V));!O||K||(s?.(B),u?.(B),B.defaultPrevented||f?.())},b),D=dC(B=>{const V=B.target;[...m.branches].some(U=>U.contains(V))||(o?.(B),u?.(B),B.defaultPrevented||f?.())},b);return aC(B=>{N===m.layers.size-1&&(i?.(B),!B.defaultPrevented&&f&&(B.preventDefault(),f()))},b),j.useEffect(()=>{if(y)return a&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(vv=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(y)),m.layers.add(y),bv(),()=>{a&&m.layersWithOutsidePointerEventsDisabled.size===1&&(b.body.style.pointerEvents=vv)}},[y,b,a,m]),j.useEffect(()=>()=>{y&&(m.layers.delete(y),m.layersWithOutsidePointerEventsDisabled.delete(y),bv())},[y,m]),j.useEffect(()=>{const B=()=>x({});return document.addEventListener(wh,B),()=>document.removeEventListener(wh,B)},[]),d.jsx(st.div,{...h,ref:S,style:{pointerEvents:A?O?"auto":"none":void 0,...e.style},onFocusCapture:Fe(e.onFocusCapture,D.onFocusCapture),onBlurCapture:Fe(e.onBlurCapture,D.onBlurCapture),onPointerDownCapture:Fe(e.onPointerDownCapture,M.onPointerDownCapture)})});Gc.displayName=iC;var oC="DismissableLayerBranch",cC=j.forwardRef((e,r)=>{const a=j.useContext(g0),i=j.useRef(null),s=Ct(r,i);return j.useEffect(()=>{const o=i.current;if(o)return a.branches.add(o),()=>{a.branches.delete(o)}},[a.branches]),d.jsx(st.div,{...e,ref:s})});cC.displayName=oC;function uC(e,r=globalThis?.document){const a=tn(e),i=j.useRef(!1),s=j.useRef(()=>{});return j.useEffect(()=>{const o=f=>{if(f.target&&!i.current){let h=function(){y0(lC,a,m,{discrete:!0})};const m={originalEvent:f};f.pointerType==="touch"?(r.removeEventListener("click",s.current),s.current=h,r.addEventListener("click",s.current,{once:!0})):h()}else r.removeEventListener("click",s.current);i.current=!1},u=window.setTimeout(()=>{r.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(u),r.removeEventListener("pointerdown",o),r.removeEventListener("click",s.current)}},[r,a]),{onPointerDownCapture:()=>i.current=!0}}function dC(e,r=globalThis?.document){const a=tn(e),i=j.useRef(!1);return j.useEffect(()=>{const s=o=>{o.target&&!i.current&&y0(sC,a,{originalEvent:o},{discrete:!1})};return r.addEventListener("focusin",s),()=>r.removeEventListener("focusin",s)},[r,a]),{onFocusCapture:()=>i.current=!0,onBlurCapture:()=>i.current=!1}}function bv(){const e=new CustomEvent(wh);document.dispatchEvent(e)}function y0(e,r,a,{discrete:i}){const s=a.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:a});r&&s.addEventListener(e,r,{once:!0}),i?h0(s,o):s.dispatchEvent(o)}var If="focusScope.autoFocusOnMount",Pf="focusScope.autoFocusOnUnmount",wv={bubbles:!1,cancelable:!0},fC="FocusScope",tm=j.forwardRef((e,r)=>{const{loop:a=!1,trapped:i=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...u}=e,[f,h]=j.useState(null),m=tn(s),y=tn(o),p=j.useRef(null),b=Ct(r,w=>h(w)),x=j.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;j.useEffect(()=>{if(i){let w=function(A){if(x.paused||!f)return;const O=A.target;f.contains(O)?p.current=O:fa(p.current,{select:!0})},_=function(A){if(x.paused||!f)return;const O=A.relatedTarget;O!==null&&(f.contains(O)||fa(p.current,{select:!0}))},k=function(A){if(document.activeElement===document.body)for(const M of A)M.removedNodes.length>0&&fa(f)};document.addEventListener("focusin",w),document.addEventListener("focusout",_);const N=new MutationObserver(k);return f&&N.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",_),N.disconnect()}}},[i,f,x.paused]),j.useEffect(()=>{if(f){kv.add(x);const w=document.activeElement;if(!f.contains(w)){const k=new CustomEvent(If,wv);f.addEventListener(If,m),f.dispatchEvent(k),k.defaultPrevented||(hC(xC(x0(f)),{select:!0}),document.activeElement===w&&fa(f))}return()=>{f.removeEventListener(If,m),setTimeout(()=>{const k=new CustomEvent(Pf,wv);f.addEventListener(Pf,y),f.dispatchEvent(k),k.defaultPrevented||fa(w??document.body,{select:!0}),f.removeEventListener(Pf,y),kv.remove(x)},0)}}},[f,m,y,x]);const S=j.useCallback(w=>{if(!a&&!i||x.paused)return;const _=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,k=document.activeElement;if(_&&k){const N=w.currentTarget,[A,O]=mC(N);A&&O?!w.shiftKey&&k===O?(w.preventDefault(),a&&fa(A,{select:!0})):w.shiftKey&&k===A&&(w.preventDefault(),a&&fa(O,{select:!0})):k===N&&w.preventDefault()}},[a,i,x.paused]);return d.jsx(st.div,{tabIndex:-1,...u,ref:b,onKeyDown:S})});tm.displayName=fC;function hC(e,{select:r=!1}={}){const a=document.activeElement;for(const i of e)if(fa(i,{select:r}),document.activeElement!==a)return}function mC(e){const r=x0(e),a=Sv(r,e),i=Sv(r.reverse(),e);return[a,i]}function x0(e){const r=[],a=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const s=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||s?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;a.nextNode();)r.push(a.currentNode);return r}function Sv(e,r){for(const a of e)if(!pC(a,{upTo:r}))return a}function pC(e,{upTo:r}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(r!==void 0&&e===r)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function gC(e){return e instanceof HTMLInputElement&&"select"in e}function fa(e,{select:r=!1}={}){if(e&&e.focus){const a=document.activeElement;e.focus({preventScroll:!0}),e!==a&&gC(e)&&r&&e.select()}}var kv=yC();function yC(){let e=[];return{add(r){const a=e[0];r!==a&&a?.pause(),e=_v(e,r),e.unshift(r)},remove(r){e=_v(e,r),e[0]?.resume()}}}function _v(e,r){const a=[...e],i=a.indexOf(r);return i!==-1&&a.splice(i,1),a}function xC(e){return e.filter(r=>r.tagName!=="A")}var vC="Portal",Yc=j.forwardRef((e,r)=>{const{container:a,...i}=e,[s,o]=j.useState(!1);$n(()=>o(!0),[]);const u=a||s&&globalThis?.document?.body;return u?Ij.createPortal(d.jsx(st.div,{...i,ref:r}),u):null});Yc.displayName=vC;var Uf=0;function v0(){j.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??jv()),document.body.insertAdjacentElement("beforeend",e[1]??jv()),Uf++,()=>{Uf===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),Uf--}},[])}function jv(){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 or=function(){return or=Object.assign||function(r){for(var a,i=1,s=arguments.length;i<s;i++){a=arguments[i];for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[o]=a[o])}return r},or.apply(this,arguments)};function b0(e,r){var a={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&r.indexOf(i)<0&&(a[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(e);s<i.length;s++)r.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(a[i[s]]=e[i[s]]);return a}function bC(e,r,a){if(a||arguments.length===2)for(var i=0,s=r.length,o;i<s;i++)(o||!(i in r))&&(o||(o=Array.prototype.slice.call(r,0,i)),o[i]=r[i]);return e.concat(o||Array.prototype.slice.call(r))}var yc="right-scroll-bar-position",xc="width-before-scroll-bar",wC="with-scroll-bars-hidden",SC="--removed-body-scroll-bar-size";function Bf(e,r){return typeof e=="function"?e(r):e&&(e.current=r),e}function kC(e,r){var a=j.useState(function(){return{value:e,callback:r,facade:{get current(){return a.value},set current(i){var s=a.value;s!==i&&(a.value=i,a.callback(i,s))}}}})[0];return a.callback=r,a.facade}var _C=typeof window<"u"?j.useLayoutEffect:j.useEffect,Cv=new WeakMap;function jC(e,r){var a=kC(null,function(i){return e.forEach(function(s){return Bf(s,i)})});return _C(function(){var i=Cv.get(a);if(i){var s=new Set(i),o=new Set(e),u=a.current;s.forEach(function(f){o.has(f)||Bf(f,null)}),o.forEach(function(f){s.has(f)||Bf(f,u)})}Cv.set(a,e)},[e]),a}function CC(e){return e}function EC(e,r){r===void 0&&(r=CC);var a=[],i=!1,s={read:function(){if(i)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return a.length?a[a.length-1]:e},useMedium:function(o){var u=r(o,i);return a.push(u),function(){a=a.filter(function(f){return f!==u})}},assignSyncMedium:function(o){for(i=!0;a.length;){var u=a;a=[],u.forEach(o)}a={push:function(f){return o(f)},filter:function(){return a}}},assignMedium:function(o){i=!0;var u=[];if(a.length){var f=a;a=[],f.forEach(o),u=a}var h=function(){var y=u;u=[],y.forEach(o)},m=function(){return Promise.resolve().then(h)};m(),a={push:function(y){u.push(y),m()},filter:function(y){return u=u.filter(y),a}}}};return s}function NC(e){e===void 0&&(e={});var r=EC(null);return r.options=or({async:!0,ssr:!1},e),r}var w0=function(e){var r=e.sideCar,a=b0(e,["sideCar"]);if(!r)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var i=r.read();if(!i)throw new Error("Sidecar medium not found");return j.createElement(i,or({},a))};w0.isSideCarExport=!0;function AC(e,r){return e.useMedium(r),w0}var S0=NC(),Ff=function(){},$c=j.forwardRef(function(e,r){var a=j.useRef(null),i=j.useState({onScrollCapture:Ff,onWheelCapture:Ff,onTouchMoveCapture:Ff}),s=i[0],o=i[1],u=e.forwardProps,f=e.children,h=e.className,m=e.removeScrollBar,y=e.enabled,p=e.shards,b=e.sideCar,x=e.noRelative,S=e.noIsolation,w=e.inert,_=e.allowPinchZoom,k=e.as,N=k===void 0?"div":k,A=e.gapMode,O=b0(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),M=b,D=jC([a,r]),B=or(or({},O),s);return j.createElement(j.Fragment,null,y&&j.createElement(M,{sideCar:S0,removeScrollBar:m,shards:p,noRelative:x,noIsolation:S,inert:w,setCallbacks:o,allowPinchZoom:!!_,lockRef:a,gapMode:A}),u?j.cloneElement(j.Children.only(f),or(or({},B),{ref:D})):j.createElement(N,or({},B,{className:h,ref:D}),f))});$c.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};$c.classNames={fullWidth:xc,zeroRight:yc};var TC=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function RC(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var r=TC();return r&&e.setAttribute("nonce",r),e}function OC(e,r){e.styleSheet?e.styleSheet.cssText=r:e.appendChild(document.createTextNode(r))}function zC(e){var r=document.head||document.getElementsByTagName("head")[0];r.appendChild(e)}var MC=function(){var e=0,r=null;return{add:function(a){e==0&&(r=RC())&&(OC(r,a),zC(r)),e++},remove:function(){e--,!e&&r&&(r.parentNode&&r.parentNode.removeChild(r),r=null)}}},DC=function(){var e=MC();return function(r,a){j.useEffect(function(){return e.add(r),function(){e.remove()}},[r&&a])}},k0=function(){var e=DC(),r=function(a){var i=a.styles,s=a.dynamic;return e(i,s),null};return r},LC={left:0,top:0,right:0,gap:0},Hf=function(e){return parseInt(e||"",10)||0},IC=function(e){var r=window.getComputedStyle(document.body),a=r[e==="padding"?"paddingLeft":"marginLeft"],i=r[e==="padding"?"paddingTop":"marginTop"],s=r[e==="padding"?"paddingRight":"marginRight"];return[Hf(a),Hf(i),Hf(s)]},PC=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return LC;var r=IC(e),a=document.documentElement.clientWidth,i=window.innerWidth;return{left:r[0],top:r[1],right:r[2],gap:Math.max(0,i-a+r[2]-r[0])}},UC=k0(),Ki="data-scroll-locked",BC=function(e,r,a,i){var s=e.left,o=e.top,u=e.right,f=e.gap;return a===void 0&&(a="margin"),`
|
|
10
|
-
.`.concat(wC,` {
|
|
11
|
-
overflow: hidden `).concat(i,`;
|
|
12
|
-
padding-right: `).concat(f,"px ").concat(i,`;
|
|
13
|
-
}
|
|
14
|
-
body[`).concat(Ki,`] {
|
|
15
|
-
overflow: hidden `).concat(i,`;
|
|
16
|
-
overscroll-behavior: contain;
|
|
17
|
-
`).concat([r&&"position: relative ".concat(i,";"),a==="margin"&&`
|
|
18
|
-
padding-left: `.concat(s,`px;
|
|
19
|
-
padding-top: `).concat(o,`px;
|
|
20
|
-
padding-right: `).concat(u,`px;
|
|
21
|
-
margin-left:0;
|
|
22
|
-
margin-top:0;
|
|
23
|
-
margin-right: `).concat(f,"px ").concat(i,`;
|
|
24
|
-
`),a==="padding"&&"padding-right: ".concat(f,"px ").concat(i,";")].filter(Boolean).join(""),`
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.`).concat(yc,` {
|
|
28
|
-
right: `).concat(f,"px ").concat(i,`;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.`).concat(xc,` {
|
|
32
|
-
margin-right: `).concat(f,"px ").concat(i,`;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.`).concat(yc," .").concat(yc,` {
|
|
36
|
-
right: 0 `).concat(i,`;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.`).concat(xc," .").concat(xc,` {
|
|
40
|
-
margin-right: 0 `).concat(i,`;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
body[`).concat(Ki,`] {
|
|
44
|
-
`).concat(SC,": ").concat(f,`px;
|
|
45
|
-
}
|
|
46
|
-
`)},Ev=function(){var e=parseInt(document.body.getAttribute(Ki)||"0",10);return isFinite(e)?e:0},FC=function(){j.useEffect(function(){return document.body.setAttribute(Ki,(Ev()+1).toString()),function(){var e=Ev()-1;e<=0?document.body.removeAttribute(Ki):document.body.setAttribute(Ki,e.toString())}},[])},HC=function(e){var r=e.noRelative,a=e.noImportant,i=e.gapMode,s=i===void 0?"margin":i;FC();var o=j.useMemo(function(){return PC(s)},[s]);return j.createElement(UC,{styles:BC(o,!r,s,a?"":"!important")})},Sh=!1;if(typeof window<"u")try{var ac=Object.defineProperty({},"passive",{get:function(){return Sh=!0,!0}});window.addEventListener("test",ac,ac),window.removeEventListener("test",ac,ac)}catch{Sh=!1}var Hi=Sh?{passive:!1}:!1,qC=function(e){return e.tagName==="TEXTAREA"},_0=function(e,r){if(!(e instanceof Element))return!1;var a=window.getComputedStyle(e);return a[r]!=="hidden"&&!(a.overflowY===a.overflowX&&!qC(e)&&a[r]==="visible")},GC=function(e){return _0(e,"overflowY")},YC=function(e){return _0(e,"overflowX")},Nv=function(e,r){var a=r.ownerDocument,i=r;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var s=j0(e,i);if(s){var o=C0(e,i),u=o[1],f=o[2];if(u>f)return!0}i=i.parentNode}while(i&&i!==a.body);return!1},$C=function(e){var r=e.scrollTop,a=e.scrollHeight,i=e.clientHeight;return[r,a,i]},VC=function(e){var r=e.scrollLeft,a=e.scrollWidth,i=e.clientWidth;return[r,a,i]},j0=function(e,r){return e==="v"?GC(r):YC(r)},C0=function(e,r){return e==="v"?$C(r):VC(r)},KC=function(e,r){return e==="h"&&r==="rtl"?-1:1},XC=function(e,r,a,i,s){var o=KC(e,window.getComputedStyle(r).direction),u=o*i,f=a.target,h=r.contains(f),m=!1,y=u>0,p=0,b=0;do{if(!f)break;var x=C0(e,f),S=x[0],w=x[1],_=x[2],k=w-_-o*S;(S||k)&&j0(e,f)&&(p+=k,b+=S);var N=f.parentNode;f=N&&N.nodeType===Node.DOCUMENT_FRAGMENT_NODE?N.host:N}while(!h&&f!==document.body||h&&(r.contains(f)||r===f));return(y&&Math.abs(p)<1||!y&&Math.abs(b)<1)&&(m=!0),m},ic=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Av=function(e){return[e.deltaX,e.deltaY]},Tv=function(e){return e&&"current"in e?e.current:e},ZC=function(e,r){return e[0]===r[0]&&e[1]===r[1]},QC=function(e){return`
|
|
47
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
48
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
49
|
-
`)},WC=0,qi=[];function JC(e){var r=j.useRef([]),a=j.useRef([0,0]),i=j.useRef(),s=j.useState(WC++)[0],o=j.useState(k0)[0],u=j.useRef(e);j.useEffect(function(){u.current=e},[e]),j.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var w=bC([e.lockRef.current],(e.shards||[]).map(Tv),!0).filter(Boolean);return w.forEach(function(_){return _.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),w.forEach(function(_){return _.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var f=j.useCallback(function(w,_){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!u.current.allowPinchZoom;var k=ic(w),N=a.current,A="deltaX"in w?w.deltaX:N[0]-k[0],O="deltaY"in w?w.deltaY:N[1]-k[1],M,D=w.target,B=Math.abs(A)>Math.abs(O)?"h":"v";if("touches"in w&&B==="h"&&D.type==="range")return!1;var V=window.getSelection(),K=V&&V.anchorNode,U=K?K===D||K.contains(D):!1;if(U)return!1;var te=Nv(B,D);if(!te)return!0;if(te?M=B:(M=B==="v"?"h":"v",te=Nv(B,D)),!te)return!1;if(!i.current&&"changedTouches"in w&&(A||O)&&(i.current=M),!M)return!0;var I=i.current||M;return XC(I,_,w,I==="h"?A:O)},[]),h=j.useCallback(function(w){var _=w;if(!(!qi.length||qi[qi.length-1]!==o)){var k="deltaY"in _?Av(_):ic(_),N=r.current.filter(function(M){return M.name===_.type&&(M.target===_.target||_.target===M.shadowParent)&&ZC(M.delta,k)})[0];if(N&&N.should){_.cancelable&&_.preventDefault();return}if(!N){var A=(u.current.shards||[]).map(Tv).filter(Boolean).filter(function(M){return M.contains(_.target)}),O=A.length>0?f(_,A[0]):!u.current.noIsolation;O&&_.cancelable&&_.preventDefault()}}},[]),m=j.useCallback(function(w,_,k,N){var A={name:w,delta:_,target:k,should:N,shadowParent:eE(k)};r.current.push(A),setTimeout(function(){r.current=r.current.filter(function(O){return O!==A})},1)},[]),y=j.useCallback(function(w){a.current=ic(w),i.current=void 0},[]),p=j.useCallback(function(w){m(w.type,Av(w),w.target,f(w,e.lockRef.current))},[]),b=j.useCallback(function(w){m(w.type,ic(w),w.target,f(w,e.lockRef.current))},[]);j.useEffect(function(){return qi.push(o),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:b}),document.addEventListener("wheel",h,Hi),document.addEventListener("touchmove",h,Hi),document.addEventListener("touchstart",y,Hi),function(){qi=qi.filter(function(w){return w!==o}),document.removeEventListener("wheel",h,Hi),document.removeEventListener("touchmove",h,Hi),document.removeEventListener("touchstart",y,Hi)}},[]);var x=e.removeScrollBar,S=e.inert;return j.createElement(j.Fragment,null,S?j.createElement(o,{styles:QC(s)}):null,x?j.createElement(HC,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function eE(e){for(var r=null;e!==null;)e instanceof ShadowRoot&&(r=e.host,e=e.host),e=e.parentNode;return r}const tE=AC(S0,JC);var nm=j.forwardRef(function(e,r){return j.createElement($c,or({},e,{ref:r,sideCar:tE}))});nm.classNames=$c.classNames;var nE=function(e){if(typeof document>"u")return null;var r=Array.isArray(e)?e[0]:e;return r.ownerDocument.body},Gi=new WeakMap,lc=new WeakMap,sc={},qf=0,E0=function(e){return e&&(e.host||E0(e.parentNode))},rE=function(e,r){return r.map(function(a){if(e.contains(a))return a;var i=E0(a);return i&&e.contains(i)?i:(console.error("aria-hidden",a,"in not contained inside",e,". Doing nothing"),null)}).filter(function(a){return!!a})},aE=function(e,r,a,i){var s=rE(r,Array.isArray(e)?e:[e]);sc[a]||(sc[a]=new WeakMap);var o=sc[a],u=[],f=new Set,h=new Set(s),m=function(p){!p||f.has(p)||(f.add(p),m(p.parentNode))};s.forEach(m);var y=function(p){!p||h.has(p)||Array.prototype.forEach.call(p.children,function(b){if(f.has(b))y(b);else try{var x=b.getAttribute(i),S=x!==null&&x!=="false",w=(Gi.get(b)||0)+1,_=(o.get(b)||0)+1;Gi.set(b,w),o.set(b,_),u.push(b),w===1&&S&&lc.set(b,!0),_===1&&b.setAttribute(a,"true"),S||b.setAttribute(i,"true")}catch(k){console.error("aria-hidden: cannot operate on ",b,k)}})};return y(r),f.clear(),qf++,function(){u.forEach(function(p){var b=Gi.get(p)-1,x=o.get(p)-1;Gi.set(p,b),o.set(p,x),b||(lc.has(p)||p.removeAttribute(i),lc.delete(p)),x||p.removeAttribute(a)}),qf--,qf||(Gi=new WeakMap,Gi=new WeakMap,lc=new WeakMap,sc={})}},N0=function(e,r,a){a===void 0&&(a="data-aria-hidden");var i=Array.from(Array.isArray(e)?e:[e]),s=nE(e);return s?(i.push.apply(i,Array.from(s.querySelectorAll("[aria-live], script"))),aE(i,s,a,"aria-hidden")):function(){return null}},Vc="Dialog",[A0]=fr(Vc),[iE,tr]=A0(Vc),T0=e=>{const{__scopeDialog:r,children:a,open:i,defaultOpen:s,onOpenChange:o,modal:u=!0}=e,f=j.useRef(null),h=j.useRef(null),[m,y]=js({prop:i,defaultProp:s??!1,onChange:o,caller:Vc});return d.jsx(iE,{scope:r,triggerRef:f,contentRef:h,contentId:pa(),titleId:pa(),descriptionId:pa(),open:m,onOpenChange:y,onOpenToggle:j.useCallback(()=>y(p=>!p),[y]),modal:u,children:a})};T0.displayName=Vc;var R0="DialogTrigger",lE=j.forwardRef((e,r)=>{const{__scopeDialog:a,...i}=e,s=tr(R0,a),o=Ct(r,s.triggerRef);return d.jsx(st.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":im(s.open),...i,ref:o,onClick:Fe(e.onClick,s.onOpenToggle)})});lE.displayName=R0;var rm="DialogPortal",[sE,O0]=A0(rm,{forceMount:void 0}),z0=e=>{const{__scopeDialog:r,forceMount:a,children:i,container:s}=e,o=tr(rm,r);return d.jsx(sE,{scope:r,forceMount:a,children:j.Children.map(i,u=>d.jsx(un,{present:a||o.open,children:d.jsx(Yc,{asChild:!0,container:s,children:u})}))})};z0.displayName=rm;var kc="DialogOverlay",M0=j.forwardRef((e,r)=>{const a=O0(kc,e.__scopeDialog),{forceMount:i=a.forceMount,...s}=e,o=tr(kc,e.__scopeDialog);return o.modal?d.jsx(un,{present:i||o.open,children:d.jsx(cE,{...s,ref:r})}):null});M0.displayName=kc;var oE=Ji("DialogOverlay.RemoveScroll"),cE=j.forwardRef((e,r)=>{const{__scopeDialog:a,...i}=e,s=tr(kc,a);return d.jsx(nm,{as:oE,allowPinchZoom:!0,shards:[s.contentRef],children:d.jsx(st.div,{"data-state":im(s.open),...i,ref:r,style:{pointerEvents:"auto",...i.style}})})}),Ha="DialogContent",D0=j.forwardRef((e,r)=>{const a=O0(Ha,e.__scopeDialog),{forceMount:i=a.forceMount,...s}=e,o=tr(Ha,e.__scopeDialog);return d.jsx(un,{present:i||o.open,children:o.modal?d.jsx(uE,{...s,ref:r}):d.jsx(dE,{...s,ref:r})})});D0.displayName=Ha;var uE=j.forwardRef((e,r)=>{const a=tr(Ha,e.__scopeDialog),i=j.useRef(null),s=Ct(r,a.contentRef,i);return j.useEffect(()=>{const o=i.current;if(o)return N0(o)},[]),d.jsx(L0,{...e,ref:s,trapFocus:a.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Fe(e.onCloseAutoFocus,o=>{o.preventDefault(),a.triggerRef.current?.focus()}),onPointerDownOutside:Fe(e.onPointerDownOutside,o=>{const u=o.detail.originalEvent,f=u.button===0&&u.ctrlKey===!0;(u.button===2||f)&&o.preventDefault()}),onFocusOutside:Fe(e.onFocusOutside,o=>o.preventDefault())})}),dE=j.forwardRef((e,r)=>{const a=tr(Ha,e.__scopeDialog),i=j.useRef(!1),s=j.useRef(!1);return d.jsx(L0,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{e.onCloseAutoFocus?.(o),o.defaultPrevented||(i.current||a.triggerRef.current?.focus(),o.preventDefault()),i.current=!1,s.current=!1},onInteractOutside:o=>{e.onInteractOutside?.(o),o.defaultPrevented||(i.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const u=o.target;a.triggerRef.current?.contains(u)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),L0=j.forwardRef((e,r)=>{const{__scopeDialog:a,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:o,...u}=e,f=tr(Ha,a),h=j.useRef(null),m=Ct(r,h);return v0(),d.jsxs(d.Fragment,{children:[d.jsx(tm,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:s,onUnmountAutoFocus:o,children:d.jsx(Gc,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionId,"aria-labelledby":f.titleId,"data-state":im(f.open),...u,ref:m,onDismiss:()=>f.onOpenChange(!1)})}),d.jsxs(d.Fragment,{children:[d.jsx(fE,{titleId:f.titleId}),d.jsx(mE,{contentRef:h,descriptionId:f.descriptionId})]})]})}),am="DialogTitle",I0=j.forwardRef((e,r)=>{const{__scopeDialog:a,...i}=e,s=tr(am,a);return d.jsx(st.h2,{id:s.titleId,...i,ref:r})});I0.displayName=am;var P0="DialogDescription",U0=j.forwardRef((e,r)=>{const{__scopeDialog:a,...i}=e,s=tr(P0,a);return d.jsx(st.p,{id:s.descriptionId,...i,ref:r})});U0.displayName=P0;var B0="DialogClose",F0=j.forwardRef((e,r)=>{const{__scopeDialog:a,...i}=e,s=tr(B0,a);return d.jsx(st.button,{type:"button",...i,ref:r,onClick:Fe(e.onClick,()=>s.onOpenChange(!1))})});F0.displayName=B0;function im(e){return e?"open":"closed"}var H0="DialogTitleWarning",[NI,q0]=Vj(H0,{contentName:Ha,titleName:am,docsSlug:"dialog"}),fE=({titleId:e})=>{const r=q0(H0),a=`\`${r.contentName}\` requires a \`${r.titleName}\` for the component to be accessible for screen reader users.
|
|
50
|
-
|
|
51
|
-
If you want to hide the \`${r.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
52
|
-
|
|
53
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${r.docsSlug}`;return j.useEffect(()=>{e&&(document.getElementById(e)||console.error(a))},[a,e]),null},hE="DialogDescriptionWarning",mE=({contentRef:e,descriptionId:r})=>{const i=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${q0(hE).contentName}}.`;return j.useEffect(()=>{const s=e.current?.getAttribute("aria-describedby");r&&s&&(document.getElementById(r)||console.warn(i))},[i,e,r]),null},G0=T0,Y0=z0,$0=M0,V0=D0,K0=I0,X0=U0,Z0=F0,Gf={exports:{}},Yf={};var Rv;function pE(){if(Rv)return Yf;Rv=1;var e=Uc();function r(p,b){return p===b&&(p!==0||1/p===1/b)||p!==p&&b!==b}var a=typeof Object.is=="function"?Object.is:r,i=e.useState,s=e.useEffect,o=e.useLayoutEffect,u=e.useDebugValue;function f(p,b){var x=b(),S=i({inst:{value:x,getSnapshot:b}}),w=S[0].inst,_=S[1];return o(function(){w.value=x,w.getSnapshot=b,h(w)&&_({inst:w})},[p,x,b]),s(function(){return h(w)&&_({inst:w}),p(function(){h(w)&&_({inst:w})})},[p]),u(x),x}function h(p){var b=p.getSnapshot;p=p.value;try{var x=b();return!a(p,x)}catch{return!0}}function m(p,b){return b()}var y=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?m:f;return Yf.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:y,Yf}var Ov;function gE(){return Ov||(Ov=1,Gf.exports=pE()),Gf.exports}var yE=gE();function xE(){return yE.useSyncExternalStore(vE,()=>!0,()=>!1)}function vE(){return()=>{}}var lm="Avatar",[bE]=fr(lm),[wE,Q0]=bE(lm),W0=j.forwardRef((e,r)=>{const{__scopeAvatar:a,...i}=e,[s,o]=j.useState("idle");return d.jsx(wE,{scope:a,imageLoadingStatus:s,onImageLoadingStatusChange:o,children:d.jsx(st.span,{...i,ref:r})})});W0.displayName=lm;var J0="AvatarImage",SE=j.forwardRef((e,r)=>{const{__scopeAvatar:a,src:i,onLoadingStatusChange:s=()=>{},...o}=e,u=Q0(J0,a),f=kE(i,o),h=tn(m=>{s(m),u.onImageLoadingStatusChange(m)});return $n(()=>{f!=="idle"&&h(f)},[f,h]),f==="loaded"?d.jsx(st.img,{...o,ref:r,src:i}):null});SE.displayName=J0;var e1="AvatarFallback",t1=j.forwardRef((e,r)=>{const{__scopeAvatar:a,delayMs:i,...s}=e,o=Q0(e1,a),[u,f]=j.useState(i===void 0);return j.useEffect(()=>{if(i!==void 0){const h=window.setTimeout(()=>f(!0),i);return()=>window.clearTimeout(h)}},[i]),u&&o.imageLoadingStatus!=="loaded"?d.jsx(st.span,{...s,ref:r}):null});t1.displayName=e1;function zv(e,r){return e?r?(e.src!==r&&(e.src=r),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function kE(e,{referrerPolicy:r,crossOrigin:a}){const i=xE(),s=j.useRef(null),o=i?(s.current||(s.current=new window.Image),s.current):null,[u,f]=j.useState(()=>zv(o,e));return $n(()=>{f(zv(o,e))},[o,e]),$n(()=>{const h=p=>()=>{f(p)};if(!o)return;const m=h("loaded"),y=h("error");return o.addEventListener("load",m),o.addEventListener("error",y),r&&(o.referrerPolicy=r),typeof a=="string"&&(o.crossOrigin=a),()=>{o.removeEventListener("load",m),o.removeEventListener("error",y)}},[o,a,r]),u}var _E=W0,jE=t1;function CE(e){const[r,a]=j.useState(void 0);return $n(()=>{if(e){a({width:e.offsetWidth,height:e.offsetHeight});const i=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const o=s[0];let u,f;if("borderBoxSize"in o){const h=o.borderBoxSize,m=Array.isArray(h)?h[0]:h;u=m.inlineSize,f=m.blockSize}else u=e.offsetWidth,f=e.offsetHeight;a({width:u,height:f})});return i.observe(e,{box:"border-box"}),()=>i.unobserve(e)}else a(void 0)},[e]),r}const EE=["top","right","bottom","left"],ya=Math.min,Tn=Math.max,_c=Math.round,oc=Math.floor,ur=e=>({x:e,y:e}),NE={left:"right",right:"left",bottom:"top",top:"bottom"},AE={start:"end",end:"start"};function kh(e,r,a){return Tn(e,ya(r,a))}function Dr(e,r){return typeof e=="function"?e(r):e}function Lr(e){return e.split("-")[0]}function il(e){return e.split("-")[1]}function sm(e){return e==="x"?"y":"x"}function om(e){return e==="y"?"height":"width"}const TE=new Set(["top","bottom"]);function cr(e){return TE.has(Lr(e))?"y":"x"}function cm(e){return sm(cr(e))}function RE(e,r,a){a===void 0&&(a=!1);const i=il(e),s=cm(e),o=om(s);let u=s==="x"?i===(a?"end":"start")?"right":"left":i==="start"?"bottom":"top";return r.reference[o]>r.floating[o]&&(u=jc(u)),[u,jc(u)]}function OE(e){const r=jc(e);return[_h(e),r,_h(r)]}function _h(e){return e.replace(/start|end/g,r=>AE[r])}const Mv=["left","right"],Dv=["right","left"],zE=["top","bottom"],ME=["bottom","top"];function DE(e,r,a){switch(e){case"top":case"bottom":return a?r?Dv:Mv:r?Mv:Dv;case"left":case"right":return r?zE:ME;default:return[]}}function LE(e,r,a,i){const s=il(e);let o=DE(Lr(e),a==="start",i);return s&&(o=o.map(u=>u+"-"+s),r&&(o=o.concat(o.map(_h)))),o}function jc(e){return e.replace(/left|right|bottom|top/g,r=>NE[r])}function IE(e){return{top:0,right:0,bottom:0,left:0,...e}}function n1(e){return typeof e!="number"?IE(e):{top:e,right:e,bottom:e,left:e}}function Cc(e){const{x:r,y:a,width:i,height:s}=e;return{width:i,height:s,top:a,left:r,right:r+i,bottom:a+s,x:r,y:a}}function Lv(e,r,a){let{reference:i,floating:s}=e;const o=cr(r),u=cm(r),f=om(u),h=Lr(r),m=o==="y",y=i.x+i.width/2-s.width/2,p=i.y+i.height/2-s.height/2,b=i[f]/2-s[f]/2;let x;switch(h){case"top":x={x:y,y:i.y-s.height};break;case"bottom":x={x:y,y:i.y+i.height};break;case"right":x={x:i.x+i.width,y:p};break;case"left":x={x:i.x-s.width,y:p};break;default:x={x:i.x,y:i.y}}switch(il(r)){case"start":x[u]-=b*(a&&m?-1:1);break;case"end":x[u]+=b*(a&&m?-1:1);break}return x}async function PE(e,r){var a;r===void 0&&(r={});const{x:i,y:s,platform:o,rects:u,elements:f,strategy:h}=e,{boundary:m="clippingAncestors",rootBoundary:y="viewport",elementContext:p="floating",altBoundary:b=!1,padding:x=0}=Dr(r,e),S=n1(x),_=f[b?p==="floating"?"reference":"floating":p],k=Cc(await o.getClippingRect({element:(a=await(o.isElement==null?void 0:o.isElement(_)))==null||a?_:_.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(f.floating)),boundary:m,rootBoundary:y,strategy:h})),N=p==="floating"?{x:i,y:s,width:u.floating.width,height:u.floating.height}:u.reference,A=await(o.getOffsetParent==null?void 0:o.getOffsetParent(f.floating)),O=await(o.isElement==null?void 0:o.isElement(A))?await(o.getScale==null?void 0:o.getScale(A))||{x:1,y:1}:{x:1,y:1},M=Cc(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:N,offsetParent:A,strategy:h}):N);return{top:(k.top-M.top+S.top)/O.y,bottom:(M.bottom-k.bottom+S.bottom)/O.y,left:(k.left-M.left+S.left)/O.x,right:(M.right-k.right+S.right)/O.x}}const UE=async(e,r,a)=>{const{placement:i="bottom",strategy:s="absolute",middleware:o=[],platform:u}=a,f=o.filter(Boolean),h=await(u.isRTL==null?void 0:u.isRTL(r));let m=await u.getElementRects({reference:e,floating:r,strategy:s}),{x:y,y:p}=Lv(m,i,h),b=i,x={},S=0;for(let _=0;_<f.length;_++){var w;const{name:k,fn:N}=f[_],{x:A,y:O,data:M,reset:D}=await N({x:y,y:p,initialPlacement:i,placement:b,strategy:s,middlewareData:x,rects:m,platform:{...u,detectOverflow:(w=u.detectOverflow)!=null?w:PE},elements:{reference:e,floating:r}});y=A??y,p=O??p,x={...x,[k]:{...x[k],...M}},D&&S<=50&&(S++,typeof D=="object"&&(D.placement&&(b=D.placement),D.rects&&(m=D.rects===!0?await u.getElementRects({reference:e,floating:r,strategy:s}):D.rects),{x:y,y:p}=Lv(m,b,h)),_=-1)}return{x:y,y:p,placement:b,strategy:s,middlewareData:x}},BE=e=>({name:"arrow",options:e,async fn(r){const{x:a,y:i,placement:s,rects:o,platform:u,elements:f,middlewareData:h}=r,{element:m,padding:y=0}=Dr(e,r)||{};if(m==null)return{};const p=n1(y),b={x:a,y:i},x=cm(s),S=om(x),w=await u.getDimensions(m),_=x==="y",k=_?"top":"left",N=_?"bottom":"right",A=_?"clientHeight":"clientWidth",O=o.reference[S]+o.reference[x]-b[x]-o.floating[S],M=b[x]-o.reference[x],D=await(u.getOffsetParent==null?void 0:u.getOffsetParent(m));let B=D?D[A]:0;(!B||!await(u.isElement==null?void 0:u.isElement(D)))&&(B=f.floating[A]||o.floating[S]);const V=O/2-M/2,K=B/2-w[S]/2-1,U=ya(p[k],K),te=ya(p[N],K),I=U,Z=B-w[S]-te,E=B/2-w[S]/2+V,q=kh(I,E,Z),$=!h.arrow&&il(s)!=null&&E!==q&&o.reference[S]/2-(E<I?U:te)-w[S]/2<0,X=$?E<I?E-I:E-Z:0;return{[x]:b[x]+X,data:{[x]:q,centerOffset:E-q-X,...$&&{alignmentOffset:X}},reset:$}}}),FE=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(r){var a,i;const{placement:s,middlewareData:o,rects:u,initialPlacement:f,platform:h,elements:m}=r,{mainAxis:y=!0,crossAxis:p=!0,fallbackPlacements:b,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:w=!0,..._}=Dr(e,r);if((a=o.arrow)!=null&&a.alignmentOffset)return{};const k=Lr(s),N=cr(f),A=Lr(f)===f,O=await(h.isRTL==null?void 0:h.isRTL(m.floating)),M=b||(A||!w?[jc(f)]:OE(f)),D=S!=="none";!b&&D&&M.push(...LE(f,w,S,O));const B=[f,...M],V=await h.detectOverflow(r,_),K=[];let U=((i=o.flip)==null?void 0:i.overflows)||[];if(y&&K.push(V[k]),p){const E=RE(s,u,O);K.push(V[E[0]],V[E[1]])}if(U=[...U,{placement:s,overflows:K}],!K.every(E=>E<=0)){var te,I;const E=(((te=o.flip)==null?void 0:te.index)||0)+1,q=B[E];if(q&&(!(p==="alignment"?N!==cr(q):!1)||U.every(re=>cr(re.placement)===N?re.overflows[0]>0:!0)))return{data:{index:E,overflows:U},reset:{placement:q}};let $=(I=U.filter(X=>X.overflows[0]<=0).sort((X,re)=>X.overflows[1]-re.overflows[1])[0])==null?void 0:I.placement;if(!$)switch(x){case"bestFit":{var Z;const X=(Z=U.filter(re=>{if(D){const Y=cr(re.placement);return Y===N||Y==="y"}return!0}).map(re=>[re.placement,re.overflows.filter(Y=>Y>0).reduce((Y,z)=>Y+z,0)]).sort((re,Y)=>re[1]-Y[1])[0])==null?void 0:Z[0];X&&($=X);break}case"initialPlacement":$=f;break}if(s!==$)return{reset:{placement:$}}}return{}}}};function Iv(e,r){return{top:e.top-r.height,right:e.right-r.width,bottom:e.bottom-r.height,left:e.left-r.width}}function Pv(e){return EE.some(r=>e[r]>=0)}const HE=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(r){const{rects:a,platform:i}=r,{strategy:s="referenceHidden",...o}=Dr(e,r);switch(s){case"referenceHidden":{const u=await i.detectOverflow(r,{...o,elementContext:"reference"}),f=Iv(u,a.reference);return{data:{referenceHiddenOffsets:f,referenceHidden:Pv(f)}}}case"escaped":{const u=await i.detectOverflow(r,{...o,altBoundary:!0}),f=Iv(u,a.floating);return{data:{escapedOffsets:f,escaped:Pv(f)}}}default:return{}}}}},r1=new Set(["left","top"]);async function qE(e,r){const{placement:a,platform:i,elements:s}=e,o=await(i.isRTL==null?void 0:i.isRTL(s.floating)),u=Lr(a),f=il(a),h=cr(a)==="y",m=r1.has(u)?-1:1,y=o&&h?-1:1,p=Dr(r,e);let{mainAxis:b,crossAxis:x,alignmentAxis:S}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return f&&typeof S=="number"&&(x=f==="end"?S*-1:S),h?{x:x*y,y:b*m}:{x:b*m,y:x*y}}const GE=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(r){var a,i;const{x:s,y:o,placement:u,middlewareData:f}=r,h=await qE(r,e);return u===((a=f.offset)==null?void 0:a.placement)&&(i=f.arrow)!=null&&i.alignmentOffset?{}:{x:s+h.x,y:o+h.y,data:{...h,placement:u}}}}},YE=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(r){const{x:a,y:i,placement:s,platform:o}=r,{mainAxis:u=!0,crossAxis:f=!1,limiter:h={fn:k=>{let{x:N,y:A}=k;return{x:N,y:A}}},...m}=Dr(e,r),y={x:a,y:i},p=await o.detectOverflow(r,m),b=cr(Lr(s)),x=sm(b);let S=y[x],w=y[b];if(u){const k=x==="y"?"top":"left",N=x==="y"?"bottom":"right",A=S+p[k],O=S-p[N];S=kh(A,S,O)}if(f){const k=b==="y"?"top":"left",N=b==="y"?"bottom":"right",A=w+p[k],O=w-p[N];w=kh(A,w,O)}const _=h.fn({...r,[x]:S,[b]:w});return{..._,data:{x:_.x-a,y:_.y-i,enabled:{[x]:u,[b]:f}}}}}},$E=function(e){return e===void 0&&(e={}),{options:e,fn(r){const{x:a,y:i,placement:s,rects:o,middlewareData:u}=r,{offset:f=0,mainAxis:h=!0,crossAxis:m=!0}=Dr(e,r),y={x:a,y:i},p=cr(s),b=sm(p);let x=y[b],S=y[p];const w=Dr(f,r),_=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(h){const A=b==="y"?"height":"width",O=o.reference[b]-o.floating[A]+_.mainAxis,M=o.reference[b]+o.reference[A]-_.mainAxis;x<O?x=O:x>M&&(x=M)}if(m){var k,N;const A=b==="y"?"width":"height",O=r1.has(Lr(s)),M=o.reference[p]-o.floating[A]+(O&&((k=u.offset)==null?void 0:k[p])||0)+(O?0:_.crossAxis),D=o.reference[p]+o.reference[A]+(O?0:((N=u.offset)==null?void 0:N[p])||0)-(O?_.crossAxis:0);S<M?S=M:S>D&&(S=D)}return{[b]:x,[p]:S}}}},VE=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(r){var a,i;const{placement:s,rects:o,platform:u,elements:f}=r,{apply:h=()=>{},...m}=Dr(e,r),y=await u.detectOverflow(r,m),p=Lr(s),b=il(s),x=cr(s)==="y",{width:S,height:w}=o.floating;let _,k;p==="top"||p==="bottom"?(_=p,k=b===(await(u.isRTL==null?void 0:u.isRTL(f.floating))?"start":"end")?"left":"right"):(k=p,_=b==="end"?"top":"bottom");const N=w-y.top-y.bottom,A=S-y.left-y.right,O=ya(w-y[_],N),M=ya(S-y[k],A),D=!r.middlewareData.shift;let B=O,V=M;if((a=r.middlewareData.shift)!=null&&a.enabled.x&&(V=A),(i=r.middlewareData.shift)!=null&&i.enabled.y&&(B=N),D&&!b){const U=Tn(y.left,0),te=Tn(y.right,0),I=Tn(y.top,0),Z=Tn(y.bottom,0);x?V=S-2*(U!==0||te!==0?U+te:Tn(y.left,y.right)):B=w-2*(I!==0||Z!==0?I+Z:Tn(y.top,y.bottom))}await h({...r,availableWidth:V,availableHeight:B});const K=await u.getDimensions(f.floating);return S!==K.width||w!==K.height?{reset:{rects:!0}}:{}}}};function Kc(){return typeof window<"u"}function ll(e){return a1(e)?(e.nodeName||"").toLowerCase():"#document"}function Rn(e){var r;return(e==null||(r=e.ownerDocument)==null?void 0:r.defaultView)||window}function hr(e){var r;return(r=(a1(e)?e.ownerDocument:e.document)||window.document)==null?void 0:r.documentElement}function a1(e){return Kc()?e instanceof Node||e instanceof Rn(e).Node:!1}function Jn(e){return Kc()?e instanceof Element||e instanceof Rn(e).Element:!1}function dr(e){return Kc()?e instanceof HTMLElement||e instanceof Rn(e).HTMLElement:!1}function Uv(e){return!Kc()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Rn(e).ShadowRoot}const KE=new Set(["inline","contents"]);function Cs(e){const{overflow:r,overflowX:a,overflowY:i,display:s}=er(e);return/auto|scroll|overlay|hidden|clip/.test(r+i+a)&&!KE.has(s)}const XE=new Set(["table","td","th"]);function ZE(e){return XE.has(ll(e))}const QE=[":popover-open",":modal"];function Xc(e){return QE.some(r=>{try{return e.matches(r)}catch{return!1}})}const WE=["transform","translate","scale","rotate","perspective"],JE=["transform","translate","scale","rotate","perspective","filter"],eN=["paint","layout","strict","content"];function um(e){const r=dm(),a=Jn(e)?er(e):e;return WE.some(i=>a[i]?a[i]!=="none":!1)||(a.containerType?a.containerType!=="normal":!1)||!r&&(a.backdropFilter?a.backdropFilter!=="none":!1)||!r&&(a.filter?a.filter!=="none":!1)||JE.some(i=>(a.willChange||"").includes(i))||eN.some(i=>(a.contain||"").includes(i))}function tN(e){let r=xa(e);for(;dr(r)&&!el(r);){if(um(r))return r;if(Xc(r))return null;r=xa(r)}return null}function dm(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const nN=new Set(["html","body","#document"]);function el(e){return nN.has(ll(e))}function er(e){return Rn(e).getComputedStyle(e)}function Zc(e){return Jn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function xa(e){if(ll(e)==="html")return e;const r=e.assignedSlot||e.parentNode||Uv(e)&&e.host||hr(e);return Uv(r)?r.host:r}function i1(e){const r=xa(e);return el(r)?e.ownerDocument?e.ownerDocument.body:e.body:dr(r)&&Cs(r)?r:i1(r)}function xs(e,r,a){var i;r===void 0&&(r=[]),a===void 0&&(a=!0);const s=i1(e),o=s===((i=e.ownerDocument)==null?void 0:i.body),u=Rn(s);if(o){const f=jh(u);return r.concat(u,u.visualViewport||[],Cs(s)?s:[],f&&a?xs(f):[])}return r.concat(s,xs(s,[],a))}function jh(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function l1(e){const r=er(e);let a=parseFloat(r.width)||0,i=parseFloat(r.height)||0;const s=dr(e),o=s?e.offsetWidth:a,u=s?e.offsetHeight:i,f=_c(a)!==o||_c(i)!==u;return f&&(a=o,i=u),{width:a,height:i,$:f}}function fm(e){return Jn(e)?e:e.contextElement}function Xi(e){const r=fm(e);if(!dr(r))return ur(1);const a=r.getBoundingClientRect(),{width:i,height:s,$:o}=l1(r);let u=(o?_c(a.width):a.width)/i,f=(o?_c(a.height):a.height)/s;return(!u||!Number.isFinite(u))&&(u=1),(!f||!Number.isFinite(f))&&(f=1),{x:u,y:f}}const rN=ur(0);function s1(e){const r=Rn(e);return!dm()||!r.visualViewport?rN:{x:r.visualViewport.offsetLeft,y:r.visualViewport.offsetTop}}function aN(e,r,a){return r===void 0&&(r=!1),!a||r&&a!==Rn(e)?!1:r}function qa(e,r,a,i){r===void 0&&(r=!1),a===void 0&&(a=!1);const s=e.getBoundingClientRect(),o=fm(e);let u=ur(1);r&&(i?Jn(i)&&(u=Xi(i)):u=Xi(e));const f=aN(o,a,i)?s1(o):ur(0);let h=(s.left+f.x)/u.x,m=(s.top+f.y)/u.y,y=s.width/u.x,p=s.height/u.y;if(o){const b=Rn(o),x=i&&Jn(i)?Rn(i):i;let S=b,w=jh(S);for(;w&&i&&x!==S;){const _=Xi(w),k=w.getBoundingClientRect(),N=er(w),A=k.left+(w.clientLeft+parseFloat(N.paddingLeft))*_.x,O=k.top+(w.clientTop+parseFloat(N.paddingTop))*_.y;h*=_.x,m*=_.y,y*=_.x,p*=_.y,h+=A,m+=O,S=Rn(w),w=jh(S)}}return Cc({width:y,height:p,x:h,y:m})}function Qc(e,r){const a=Zc(e).scrollLeft;return r?r.left+a:qa(hr(e)).left+a}function o1(e,r){const a=e.getBoundingClientRect(),i=a.left+r.scrollLeft-Qc(e,a),s=a.top+r.scrollTop;return{x:i,y:s}}function iN(e){let{elements:r,rect:a,offsetParent:i,strategy:s}=e;const o=s==="fixed",u=hr(i),f=r?Xc(r.floating):!1;if(i===u||f&&o)return a;let h={scrollLeft:0,scrollTop:0},m=ur(1);const y=ur(0),p=dr(i);if((p||!p&&!o)&&((ll(i)!=="body"||Cs(u))&&(h=Zc(i)),dr(i))){const x=qa(i);m=Xi(i),y.x=x.x+i.clientLeft,y.y=x.y+i.clientTop}const b=u&&!p&&!o?o1(u,h):ur(0);return{width:a.width*m.x,height:a.height*m.y,x:a.x*m.x-h.scrollLeft*m.x+y.x+b.x,y:a.y*m.y-h.scrollTop*m.y+y.y+b.y}}function lN(e){return Array.from(e.getClientRects())}function sN(e){const r=hr(e),a=Zc(e),i=e.ownerDocument.body,s=Tn(r.scrollWidth,r.clientWidth,i.scrollWidth,i.clientWidth),o=Tn(r.scrollHeight,r.clientHeight,i.scrollHeight,i.clientHeight);let u=-a.scrollLeft+Qc(e);const f=-a.scrollTop;return er(i).direction==="rtl"&&(u+=Tn(r.clientWidth,i.clientWidth)-s),{width:s,height:o,x:u,y:f}}const Bv=25;function oN(e,r){const a=Rn(e),i=hr(e),s=a.visualViewport;let o=i.clientWidth,u=i.clientHeight,f=0,h=0;if(s){o=s.width,u=s.height;const y=dm();(!y||y&&r==="fixed")&&(f=s.offsetLeft,h=s.offsetTop)}const m=Qc(i);if(m<=0){const y=i.ownerDocument,p=y.body,b=getComputedStyle(p),x=y.compatMode==="CSS1Compat"&&parseFloat(b.marginLeft)+parseFloat(b.marginRight)||0,S=Math.abs(i.clientWidth-p.clientWidth-x);S<=Bv&&(o-=S)}else m<=Bv&&(o+=m);return{width:o,height:u,x:f,y:h}}const cN=new Set(["absolute","fixed"]);function uN(e,r){const a=qa(e,!0,r==="fixed"),i=a.top+e.clientTop,s=a.left+e.clientLeft,o=dr(e)?Xi(e):ur(1),u=e.clientWidth*o.x,f=e.clientHeight*o.y,h=s*o.x,m=i*o.y;return{width:u,height:f,x:h,y:m}}function Fv(e,r,a){let i;if(r==="viewport")i=oN(e,a);else if(r==="document")i=sN(hr(e));else if(Jn(r))i=uN(r,a);else{const s=s1(e);i={x:r.x-s.x,y:r.y-s.y,width:r.width,height:r.height}}return Cc(i)}function c1(e,r){const a=xa(e);return a===r||!Jn(a)||el(a)?!1:er(a).position==="fixed"||c1(a,r)}function dN(e,r){const a=r.get(e);if(a)return a;let i=xs(e,[],!1).filter(f=>Jn(f)&&ll(f)!=="body"),s=null;const o=er(e).position==="fixed";let u=o?xa(e):e;for(;Jn(u)&&!el(u);){const f=er(u),h=um(u);!h&&f.position==="fixed"&&(s=null),(o?!h&&!s:!h&&f.position==="static"&&!!s&&cN.has(s.position)||Cs(u)&&!h&&c1(e,u))?i=i.filter(y=>y!==u):s=f,u=xa(u)}return r.set(e,i),i}function fN(e){let{element:r,boundary:a,rootBoundary:i,strategy:s}=e;const u=[...a==="clippingAncestors"?Xc(r)?[]:dN(r,this._c):[].concat(a),i],f=u[0],h=u.reduce((m,y)=>{const p=Fv(r,y,s);return m.top=Tn(p.top,m.top),m.right=ya(p.right,m.right),m.bottom=ya(p.bottom,m.bottom),m.left=Tn(p.left,m.left),m},Fv(r,f,s));return{width:h.right-h.left,height:h.bottom-h.top,x:h.left,y:h.top}}function hN(e){const{width:r,height:a}=l1(e);return{width:r,height:a}}function mN(e,r,a){const i=dr(r),s=hr(r),o=a==="fixed",u=qa(e,!0,o,r);let f={scrollLeft:0,scrollTop:0};const h=ur(0);function m(){h.x=Qc(s)}if(i||!i&&!o)if((ll(r)!=="body"||Cs(s))&&(f=Zc(r)),i){const x=qa(r,!0,o,r);h.x=x.x+r.clientLeft,h.y=x.y+r.clientTop}else s&&m();o&&!i&&s&&m();const y=s&&!i&&!o?o1(s,f):ur(0),p=u.left+f.scrollLeft-h.x-y.x,b=u.top+f.scrollTop-h.y-y.y;return{x:p,y:b,width:u.width,height:u.height}}function $f(e){return er(e).position==="static"}function Hv(e,r){if(!dr(e)||er(e).position==="fixed")return null;if(r)return r(e);let a=e.offsetParent;return hr(e)===a&&(a=a.ownerDocument.body),a}function u1(e,r){const a=Rn(e);if(Xc(e))return a;if(!dr(e)){let s=xa(e);for(;s&&!el(s);){if(Jn(s)&&!$f(s))return s;s=xa(s)}return a}let i=Hv(e,r);for(;i&&ZE(i)&&$f(i);)i=Hv(i,r);return i&&el(i)&&$f(i)&&!um(i)?a:i||tN(e)||a}const pN=async function(e){const r=this.getOffsetParent||u1,a=this.getDimensions,i=await a(e.floating);return{reference:mN(e.reference,await r(e.floating),e.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function gN(e){return er(e).direction==="rtl"}const yN={convertOffsetParentRelativeRectToViewportRelativeRect:iN,getDocumentElement:hr,getClippingRect:fN,getOffsetParent:u1,getElementRects:pN,getClientRects:lN,getDimensions:hN,getScale:Xi,isElement:Jn,isRTL:gN};function d1(e,r){return e.x===r.x&&e.y===r.y&&e.width===r.width&&e.height===r.height}function xN(e,r){let a=null,i;const s=hr(e);function o(){var f;clearTimeout(i),(f=a)==null||f.disconnect(),a=null}function u(f,h){f===void 0&&(f=!1),h===void 0&&(h=1),o();const m=e.getBoundingClientRect(),{left:y,top:p,width:b,height:x}=m;if(f||r(),!b||!x)return;const S=oc(p),w=oc(s.clientWidth-(y+b)),_=oc(s.clientHeight-(p+x)),k=oc(y),A={rootMargin:-S+"px "+-w+"px "+-_+"px "+-k+"px",threshold:Tn(0,ya(1,h))||1};let O=!0;function M(D){const B=D[0].intersectionRatio;if(B!==h){if(!O)return u();B?u(!1,B):i=setTimeout(()=>{u(!1,1e-7)},1e3)}B===1&&!d1(m,e.getBoundingClientRect())&&u(),O=!1}try{a=new IntersectionObserver(M,{...A,root:s.ownerDocument})}catch{a=new IntersectionObserver(M,A)}a.observe(e)}return u(!0),o}function vN(e,r,a,i){i===void 0&&(i={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:f=typeof IntersectionObserver=="function",animationFrame:h=!1}=i,m=fm(e),y=s||o?[...m?xs(m):[],...xs(r)]:[];y.forEach(k=>{s&&k.addEventListener("scroll",a,{passive:!0}),o&&k.addEventListener("resize",a)});const p=m&&f?xN(m,a):null;let b=-1,x=null;u&&(x=new ResizeObserver(k=>{let[N]=k;N&&N.target===m&&x&&(x.unobserve(r),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var A;(A=x)==null||A.observe(r)})),a()}),m&&!h&&x.observe(m),x.observe(r));let S,w=h?qa(e):null;h&&_();function _(){const k=qa(e);w&&!d1(w,k)&&a(),w=k,S=requestAnimationFrame(_)}return a(),()=>{var k;y.forEach(N=>{s&&N.removeEventListener("scroll",a),o&&N.removeEventListener("resize",a)}),p?.(),(k=x)==null||k.disconnect(),x=null,h&&cancelAnimationFrame(S)}}const bN=GE,wN=YE,SN=FE,kN=VE,_N=HE,qv=BE,jN=$E,CN=(e,r,a)=>{const i=new Map,s={platform:yN,...a},o={...s.platform,_c:i};return UE(e,r,{...s,platform:o})};var EN=typeof document<"u",NN=function(){},vc=EN?j.useLayoutEffect:NN;function Ec(e,r){if(e===r)return!0;if(typeof e!=typeof r)return!1;if(typeof e=="function"&&e.toString()===r.toString())return!0;let a,i,s;if(e&&r&&typeof e=="object"){if(Array.isArray(e)){if(a=e.length,a!==r.length)return!1;for(i=a;i--!==0;)if(!Ec(e[i],r[i]))return!1;return!0}if(s=Object.keys(e),a=s.length,a!==Object.keys(r).length)return!1;for(i=a;i--!==0;)if(!{}.hasOwnProperty.call(r,s[i]))return!1;for(i=a;i--!==0;){const o=s[i];if(!(o==="_owner"&&e.$$typeof)&&!Ec(e[o],r[o]))return!1}return!0}return e!==e&&r!==r}function f1(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Gv(e,r){const a=f1(e);return Math.round(r*a)/a}function Vf(e){const r=j.useRef(e);return vc(()=>{r.current=e}),r}function AN(e){e===void 0&&(e={});const{placement:r="bottom",strategy:a="absolute",middleware:i=[],platform:s,elements:{reference:o,floating:u}={},transform:f=!0,whileElementsMounted:h,open:m}=e,[y,p]=j.useState({x:0,y:0,strategy:a,placement:r,middlewareData:{},isPositioned:!1}),[b,x]=j.useState(i);Ec(b,i)||x(i);const[S,w]=j.useState(null),[_,k]=j.useState(null),N=j.useCallback(re=>{re!==D.current&&(D.current=re,w(re))},[]),A=j.useCallback(re=>{re!==B.current&&(B.current=re,k(re))},[]),O=o||S,M=u||_,D=j.useRef(null),B=j.useRef(null),V=j.useRef(y),K=h!=null,U=Vf(h),te=Vf(s),I=Vf(m),Z=j.useCallback(()=>{if(!D.current||!B.current)return;const re={placement:r,strategy:a,middleware:b};te.current&&(re.platform=te.current),CN(D.current,B.current,re).then(Y=>{const z={...Y,isPositioned:I.current!==!1};E.current&&!Ec(V.current,z)&&(V.current=z,em.flushSync(()=>{p(z)}))})},[b,r,a,te,I]);vc(()=>{m===!1&&V.current.isPositioned&&(V.current.isPositioned=!1,p(re=>({...re,isPositioned:!1})))},[m]);const E=j.useRef(!1);vc(()=>(E.current=!0,()=>{E.current=!1}),[]),vc(()=>{if(O&&(D.current=O),M&&(B.current=M),O&&M){if(U.current)return U.current(O,M,Z);Z()}},[O,M,Z,U,K]);const q=j.useMemo(()=>({reference:D,floating:B,setReference:N,setFloating:A}),[N,A]),$=j.useMemo(()=>({reference:O,floating:M}),[O,M]),X=j.useMemo(()=>{const re={position:a,left:0,top:0};if(!$.floating)return re;const Y=Gv($.floating,y.x),z=Gv($.floating,y.y);return f?{...re,transform:"translate("+Y+"px, "+z+"px)",...f1($.floating)>=1.5&&{willChange:"transform"}}:{position:a,left:Y,top:z}},[a,f,$.floating,y.x,y.y]);return j.useMemo(()=>({...y,update:Z,refs:q,elements:$,floatingStyles:X}),[y,Z,q,$,X])}const TN=e=>{function r(a){return{}.hasOwnProperty.call(a,"current")}return{name:"arrow",options:e,fn(a){const{element:i,padding:s}=typeof e=="function"?e(a):e;return i&&r(i)?i.current!=null?qv({element:i.current,padding:s}).fn(a):{}:i?qv({element:i,padding:s}).fn(a):{}}}},RN=(e,r)=>({...bN(e),options:[e,r]}),ON=(e,r)=>({...wN(e),options:[e,r]}),zN=(e,r)=>({...jN(e),options:[e,r]}),MN=(e,r)=>({...SN(e),options:[e,r]}),DN=(e,r)=>({...kN(e),options:[e,r]}),LN=(e,r)=>({..._N(e),options:[e,r]}),IN=(e,r)=>({...TN(e),options:[e,r]});var PN="Arrow",h1=j.forwardRef((e,r)=>{const{children:a,width:i=10,height:s=5,...o}=e;return d.jsx(st.svg,{...o,ref:r,width:i,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?a:d.jsx("polygon",{points:"0,0 30,0 15,10"})})});h1.displayName=PN;var UN=h1,hm="Popper",[m1,Wc]=fr(hm),[BN,p1]=m1(hm),g1=e=>{const{__scopePopper:r,children:a}=e,[i,s]=j.useState(null);return d.jsx(BN,{scope:r,anchor:i,onAnchorChange:s,children:a})};g1.displayName=hm;var y1="PopperAnchor",x1=j.forwardRef((e,r)=>{const{__scopePopper:a,virtualRef:i,...s}=e,o=p1(y1,a),u=j.useRef(null),f=Ct(r,u),h=j.useRef(null);return j.useEffect(()=>{const m=h.current;h.current=i?.current||u.current,m!==h.current&&o.onAnchorChange(h.current)}),i?null:d.jsx(st.div,{...s,ref:f})});x1.displayName=y1;var mm="PopperContent",[FN,HN]=m1(mm),v1=j.forwardRef((e,r)=>{const{__scopePopper:a,side:i="bottom",sideOffset:s=0,align:o="center",alignOffset:u=0,arrowPadding:f=0,avoidCollisions:h=!0,collisionBoundary:m=[],collisionPadding:y=0,sticky:p="partial",hideWhenDetached:b=!1,updatePositionStrategy:x="optimized",onPlaced:S,...w}=e,_=p1(mm,a),[k,N]=j.useState(null),A=Ct(r,Ce=>N(Ce)),[O,M]=j.useState(null),D=CE(O),B=D?.width??0,V=D?.height??0,K=i+(o!=="center"?"-"+o:""),U=typeof y=="number"?y:{top:0,right:0,bottom:0,left:0,...y},te=Array.isArray(m)?m:[m],I=te.length>0,Z={padding:U,boundary:te.filter(GN),altBoundary:I},{refs:E,floatingStyles:q,placement:$,isPositioned:X,middlewareData:re}=AN({strategy:"fixed",placement:K,whileElementsMounted:(...Ce)=>vN(...Ce,{animationFrame:x==="always"}),elements:{reference:_.anchor},middleware:[RN({mainAxis:s+V,alignmentAxis:u}),h&&ON({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?zN():void 0,...Z}),h&&MN({...Z}),DN({...Z,apply:({elements:Ce,rects:Ae,availableWidth:Ne,availableHeight:Ge})=>{const{width:$e,height:dt}=Ae.reference,ot=Ce.floating.style;ot.setProperty("--radix-popper-available-width",`${Ne}px`),ot.setProperty("--radix-popper-available-height",`${Ge}px`),ot.setProperty("--radix-popper-anchor-width",`${$e}px`),ot.setProperty("--radix-popper-anchor-height",`${dt}px`)}}),O&&IN({element:O,padding:f}),YN({arrowWidth:B,arrowHeight:V}),b&&LN({strategy:"referenceHidden",...Z})]}),[Y,z]=S1($),R=tn(S);$n(()=>{X&&R?.()},[X,R]);const F=re.arrow?.x,L=re.arrow?.y,le=re.arrow?.centerOffset!==0,[oe,ve]=j.useState();return $n(()=>{k&&ve(window.getComputedStyle(k).zIndex)},[k]),d.jsx("div",{ref:E.setFloating,"data-radix-popper-content-wrapper":"",style:{...q,transform:X?q.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:oe,"--radix-popper-transform-origin":[re.transformOrigin?.x,re.transformOrigin?.y].join(" "),...re.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:d.jsx(FN,{scope:a,placedSide:Y,onArrowChange:M,arrowX:F,arrowY:L,shouldHideArrow:le,children:d.jsx(st.div,{"data-side":Y,"data-align":z,...w,ref:A,style:{...w.style,animation:X?void 0:"none"}})})})});v1.displayName=mm;var b1="PopperArrow",qN={top:"bottom",right:"left",bottom:"top",left:"right"},w1=j.forwardRef(function(r,a){const{__scopePopper:i,...s}=r,o=HN(b1,i),u=qN[o.placedSide];return d.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[u]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:d.jsx(UN,{...s,ref:a,style:{...s.style,display:"block"}})})});w1.displayName=b1;function GN(e){return e!==null}var YN=e=>({name:"transformOrigin",options:e,fn(r){const{placement:a,rects:i,middlewareData:s}=r,u=s.arrow?.centerOffset!==0,f=u?0:e.arrowWidth,h=u?0:e.arrowHeight,[m,y]=S1(a),p={start:"0%",center:"50%",end:"100%"}[y],b=(s.arrow?.x??0)+f/2,x=(s.arrow?.y??0)+h/2;let S="",w="";return m==="bottom"?(S=u?p:`${b}px`,w=`${-h}px`):m==="top"?(S=u?p:`${b}px`,w=`${i.floating.height+h}px`):m==="right"?(S=`${-h}px`,w=u?p:`${x}px`):m==="left"&&(S=`${i.floating.width+h}px`,w=u?p:`${x}px`),{data:{x:S,y:w}}}});function S1(e){const[r,a="center"]=e.split("-");return[r,a]}var k1=g1,_1=x1,j1=v1,C1=w1,Kf="rovingFocusGroup.onEntryFocus",$N={bubbles:!1,cancelable:!0},Es="RovingFocusGroup",[Ch,E1,VN]=p0(Es),[KN,Jc]=fr(Es,[VN]),[XN,ZN]=KN(Es),N1=j.forwardRef((e,r)=>d.jsx(Ch.Provider,{scope:e.__scopeRovingFocusGroup,children:d.jsx(Ch.Slot,{scope:e.__scopeRovingFocusGroup,children:d.jsx(QN,{...e,ref:r})})}));N1.displayName=Es;var QN=j.forwardRef((e,r)=>{const{__scopeRovingFocusGroup:a,orientation:i,loop:s=!1,dir:o,currentTabStopId:u,defaultCurrentTabStopId:f,onCurrentTabStopIdChange:h,onEntryFocus:m,preventScrollOnEntryFocus:y=!1,...p}=e,b=j.useRef(null),x=Ct(r,b),S=qc(o),[w,_]=js({prop:u,defaultProp:f??null,onChange:h,caller:Es}),[k,N]=j.useState(!1),A=tn(m),O=E1(a),M=j.useRef(!1),[D,B]=j.useState(0);return j.useEffect(()=>{const V=b.current;if(V)return V.addEventListener(Kf,A),()=>V.removeEventListener(Kf,A)},[A]),d.jsx(XN,{scope:a,orientation:i,dir:S,loop:s,currentTabStopId:w,onItemFocus:j.useCallback(V=>_(V),[_]),onItemShiftTab:j.useCallback(()=>N(!0),[]),onFocusableItemAdd:j.useCallback(()=>B(V=>V+1),[]),onFocusableItemRemove:j.useCallback(()=>B(V=>V-1),[]),children:d.jsx(st.div,{tabIndex:k||D===0?-1:0,"data-orientation":i,...p,ref:x,style:{outline:"none",...e.style},onMouseDown:Fe(e.onMouseDown,()=>{M.current=!0}),onFocus:Fe(e.onFocus,V=>{const K=!M.current;if(V.target===V.currentTarget&&K&&!k){const U=new CustomEvent(Kf,$N);if(V.currentTarget.dispatchEvent(U),!U.defaultPrevented){const te=O().filter($=>$.focusable),I=te.find($=>$.active),Z=te.find($=>$.id===w),q=[I,Z,...te].filter(Boolean).map($=>$.ref.current);R1(q,y)}}M.current=!1}),onBlur:Fe(e.onBlur,()=>N(!1))})})}),A1="RovingFocusGroupItem",T1=j.forwardRef((e,r)=>{const{__scopeRovingFocusGroup:a,focusable:i=!0,active:s=!1,tabStopId:o,children:u,...f}=e,h=pa(),m=o||h,y=ZN(A1,a),p=y.currentTabStopId===m,b=E1(a),{onFocusableItemAdd:x,onFocusableItemRemove:S,currentTabStopId:w}=y;return j.useEffect(()=>{if(i)return x(),()=>S()},[i,x,S]),d.jsx(Ch.ItemSlot,{scope:a,id:m,focusable:i,active:s,children:d.jsx(st.span,{tabIndex:p?0:-1,"data-orientation":y.orientation,...f,ref:r,onMouseDown:Fe(e.onMouseDown,_=>{i?y.onItemFocus(m):_.preventDefault()}),onFocus:Fe(e.onFocus,()=>y.onItemFocus(m)),onKeyDown:Fe(e.onKeyDown,_=>{if(_.key==="Tab"&&_.shiftKey){y.onItemShiftTab();return}if(_.target!==_.currentTarget)return;const k=eA(_,y.orientation,y.dir);if(k!==void 0){if(_.metaKey||_.ctrlKey||_.altKey||_.shiftKey)return;_.preventDefault();let A=b().filter(O=>O.focusable).map(O=>O.ref.current);if(k==="last")A.reverse();else if(k==="prev"||k==="next"){k==="prev"&&A.reverse();const O=A.indexOf(_.currentTarget);A=y.loop?tA(A,O+1):A.slice(O+1)}setTimeout(()=>R1(A))}}),children:typeof u=="function"?u({isCurrentTabStop:p,hasTabStop:w!=null}):u})})});T1.displayName=A1;var WN={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function JN(e,r){return r!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function eA(e,r,a){const i=JN(e.key,a);if(!(r==="vertical"&&["ArrowLeft","ArrowRight"].includes(i))&&!(r==="horizontal"&&["ArrowUp","ArrowDown"].includes(i)))return WN[i]}function R1(e,r=!1){const a=document.activeElement;for(const i of e)if(i===a||(i.focus({preventScroll:r}),document.activeElement!==a))return}function tA(e,r){return e.map((a,i)=>e[(r+i)%e.length])}var O1=N1,z1=T1,Eh=["Enter"," "],nA=["ArrowDown","PageUp","Home"],M1=["ArrowUp","PageDown","End"],rA=[...nA,...M1],aA={ltr:[...Eh,"ArrowRight"],rtl:[...Eh,"ArrowLeft"]},iA={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Ns="Menu",[vs,lA,sA]=p0(Ns),[Wa,D1]=fr(Ns,[sA,Wc,Jc]),eu=Wc(),L1=Jc(),[oA,Ja]=Wa(Ns),[cA,As]=Wa(Ns),I1=e=>{const{__scopeMenu:r,open:a=!1,children:i,dir:s,onOpenChange:o,modal:u=!0}=e,f=eu(r),[h,m]=j.useState(null),y=j.useRef(!1),p=tn(o),b=qc(s);return j.useEffect(()=>{const x=()=>{y.current=!0,document.addEventListener("pointerdown",S,{capture:!0,once:!0}),document.addEventListener("pointermove",S,{capture:!0,once:!0})},S=()=>y.current=!1;return document.addEventListener("keydown",x,{capture:!0}),()=>{document.removeEventListener("keydown",x,{capture:!0}),document.removeEventListener("pointerdown",S,{capture:!0}),document.removeEventListener("pointermove",S,{capture:!0})}},[]),d.jsx(k1,{...f,children:d.jsx(oA,{scope:r,open:a,onOpenChange:p,content:h,onContentChange:m,children:d.jsx(cA,{scope:r,onClose:j.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:y,dir:b,modal:u,children:i})})})};I1.displayName=Ns;var uA="MenuAnchor",pm=j.forwardRef((e,r)=>{const{__scopeMenu:a,...i}=e,s=eu(a);return d.jsx(_1,{...s,...i,ref:r})});pm.displayName=uA;var gm="MenuPortal",[dA,P1]=Wa(gm,{forceMount:void 0}),U1=e=>{const{__scopeMenu:r,forceMount:a,children:i,container:s}=e,o=Ja(gm,r);return d.jsx(dA,{scope:r,forceMount:a,children:d.jsx(un,{present:a||o.open,children:d.jsx(Yc,{asChild:!0,container:s,children:i})})})};U1.displayName=gm;var Yn="MenuContent",[fA,ym]=Wa(Yn),B1=j.forwardRef((e,r)=>{const a=P1(Yn,e.__scopeMenu),{forceMount:i=a.forceMount,...s}=e,o=Ja(Yn,e.__scopeMenu),u=As(Yn,e.__scopeMenu);return d.jsx(vs.Provider,{scope:e.__scopeMenu,children:d.jsx(un,{present:i||o.open,children:d.jsx(vs.Slot,{scope:e.__scopeMenu,children:u.modal?d.jsx(hA,{...s,ref:r}):d.jsx(mA,{...s,ref:r})})})})}),hA=j.forwardRef((e,r)=>{const a=Ja(Yn,e.__scopeMenu),i=j.useRef(null),s=Ct(r,i);return j.useEffect(()=>{const o=i.current;if(o)return N0(o)},[]),d.jsx(xm,{...e,ref:s,trapFocus:a.open,disableOutsidePointerEvents:a.open,disableOutsideScroll:!0,onFocusOutside:Fe(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>a.onOpenChange(!1)})}),mA=j.forwardRef((e,r)=>{const a=Ja(Yn,e.__scopeMenu);return d.jsx(xm,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>a.onOpenChange(!1)})}),pA=Ji("MenuContent.ScrollLock"),xm=j.forwardRef((e,r)=>{const{__scopeMenu:a,loop:i=!1,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:u,disableOutsidePointerEvents:f,onEntryFocus:h,onEscapeKeyDown:m,onPointerDownOutside:y,onFocusOutside:p,onInteractOutside:b,onDismiss:x,disableOutsideScroll:S,...w}=e,_=Ja(Yn,a),k=As(Yn,a),N=eu(a),A=L1(a),O=lA(a),[M,D]=j.useState(null),B=j.useRef(null),V=Ct(r,B,_.onContentChange),K=j.useRef(0),U=j.useRef(""),te=j.useRef(0),I=j.useRef(null),Z=j.useRef("right"),E=j.useRef(0),q=S?nm:j.Fragment,$=S?{as:pA,allowPinchZoom:!0}:void 0,X=Y=>{const z=U.current+Y,R=O().filter(Ce=>!Ce.disabled),F=document.activeElement,L=R.find(Ce=>Ce.ref.current===F)?.textValue,le=R.map(Ce=>Ce.textValue),oe=EA(le,z,L),ve=R.find(Ce=>Ce.textValue===oe)?.ref.current;(function Ce(Ae){U.current=Ae,window.clearTimeout(K.current),Ae!==""&&(K.current=window.setTimeout(()=>Ce(""),1e3))})(z),ve&&setTimeout(()=>ve.focus())};j.useEffect(()=>()=>window.clearTimeout(K.current),[]),v0();const re=j.useCallback(Y=>Z.current===I.current?.side&&AA(Y,I.current?.area),[]);return d.jsx(fA,{scope:a,searchRef:U,onItemEnter:j.useCallback(Y=>{re(Y)&&Y.preventDefault()},[re]),onItemLeave:j.useCallback(Y=>{re(Y)||(B.current?.focus(),D(null))},[re]),onTriggerLeave:j.useCallback(Y=>{re(Y)&&Y.preventDefault()},[re]),pointerGraceTimerRef:te,onPointerGraceIntentChange:j.useCallback(Y=>{I.current=Y},[]),children:d.jsx(q,{...$,children:d.jsx(tm,{asChild:!0,trapped:s,onMountAutoFocus:Fe(o,Y=>{Y.preventDefault(),B.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:u,children:d.jsx(Gc,{asChild:!0,disableOutsidePointerEvents:f,onEscapeKeyDown:m,onPointerDownOutside:y,onFocusOutside:p,onInteractOutside:b,onDismiss:x,children:d.jsx(O1,{asChild:!0,...A,dir:k.dir,orientation:"vertical",loop:i,currentTabStopId:M,onCurrentTabStopIdChange:D,onEntryFocus:Fe(h,Y=>{k.isUsingKeyboardRef.current||Y.preventDefault()}),preventScrollOnEntryFocus:!0,children:d.jsx(j1,{role:"menu","aria-orientation":"vertical","data-state":nw(_.open),"data-radix-menu-content":"",dir:k.dir,...N,...w,ref:V,style:{outline:"none",...w.style},onKeyDown:Fe(w.onKeyDown,Y=>{const R=Y.target.closest("[data-radix-menu-content]")===Y.currentTarget,F=Y.ctrlKey||Y.altKey||Y.metaKey,L=Y.key.length===1;R&&(Y.key==="Tab"&&Y.preventDefault(),!F&&L&&X(Y.key));const le=B.current;if(Y.target!==le||!rA.includes(Y.key))return;Y.preventDefault();const ve=O().filter(Ce=>!Ce.disabled).map(Ce=>Ce.ref.current);M1.includes(Y.key)&&ve.reverse(),jA(ve)}),onBlur:Fe(e.onBlur,Y=>{Y.currentTarget.contains(Y.target)||(window.clearTimeout(K.current),U.current="")}),onPointerMove:Fe(e.onPointerMove,bs(Y=>{const z=Y.target,R=E.current!==Y.clientX;if(Y.currentTarget.contains(z)&&R){const F=Y.clientX>E.current?"right":"left";Z.current=F,E.current=Y.clientX}}))})})})})})})});B1.displayName=Yn;var gA="MenuGroup",vm=j.forwardRef((e,r)=>{const{__scopeMenu:a,...i}=e;return d.jsx(st.div,{role:"group",...i,ref:r})});vm.displayName=gA;var yA="MenuLabel",F1=j.forwardRef((e,r)=>{const{__scopeMenu:a,...i}=e;return d.jsx(st.div,{...i,ref:r})});F1.displayName=yA;var Nc="MenuItem",Yv="menu.itemSelect",tu=j.forwardRef((e,r)=>{const{disabled:a=!1,onSelect:i,...s}=e,o=j.useRef(null),u=As(Nc,e.__scopeMenu),f=ym(Nc,e.__scopeMenu),h=Ct(r,o),m=j.useRef(!1),y=()=>{const p=o.current;if(!a&&p){const b=new CustomEvent(Yv,{bubbles:!0,cancelable:!0});p.addEventListener(Yv,x=>i?.(x),{once:!0}),h0(p,b),b.defaultPrevented?m.current=!1:u.onClose()}};return d.jsx(H1,{...s,ref:h,disabled:a,onClick:Fe(e.onClick,y),onPointerDown:p=>{e.onPointerDown?.(p),m.current=!0},onPointerUp:Fe(e.onPointerUp,p=>{m.current||p.currentTarget?.click()}),onKeyDown:Fe(e.onKeyDown,p=>{const b=f.searchRef.current!=="";a||b&&p.key===" "||Eh.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});tu.displayName=Nc;var H1=j.forwardRef((e,r)=>{const{__scopeMenu:a,disabled:i=!1,textValue:s,...o}=e,u=ym(Nc,a),f=L1(a),h=j.useRef(null),m=Ct(r,h),[y,p]=j.useState(!1),[b,x]=j.useState("");return j.useEffect(()=>{const S=h.current;S&&x((S.textContent??"").trim())},[o.children]),d.jsx(vs.ItemSlot,{scope:a,disabled:i,textValue:s??b,children:d.jsx(z1,{asChild:!0,...f,focusable:!i,children:d.jsx(st.div,{role:"menuitem","data-highlighted":y?"":void 0,"aria-disabled":i||void 0,"data-disabled":i?"":void 0,...o,ref:m,onPointerMove:Fe(e.onPointerMove,bs(S=>{i?u.onItemLeave(S):(u.onItemEnter(S),S.defaultPrevented||S.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Fe(e.onPointerLeave,bs(S=>u.onItemLeave(S))),onFocus:Fe(e.onFocus,()=>p(!0)),onBlur:Fe(e.onBlur,()=>p(!1))})})})}),xA="MenuCheckboxItem",q1=j.forwardRef((e,r)=>{const{checked:a=!1,onCheckedChange:i,...s}=e;return d.jsx(K1,{scope:e.__scopeMenu,checked:a,children:d.jsx(tu,{role:"menuitemcheckbox","aria-checked":Ac(a)?"mixed":a,...s,ref:r,"data-state":wm(a),onSelect:Fe(s.onSelect,()=>i?.(Ac(a)?!0:!a),{checkForDefaultPrevented:!1})})})});q1.displayName=xA;var G1="MenuRadioGroup",[vA,bA]=Wa(G1,{value:void 0,onValueChange:()=>{}}),Y1=j.forwardRef((e,r)=>{const{value:a,onValueChange:i,...s}=e,o=tn(i);return d.jsx(vA,{scope:e.__scopeMenu,value:a,onValueChange:o,children:d.jsx(vm,{...s,ref:r})})});Y1.displayName=G1;var $1="MenuRadioItem",V1=j.forwardRef((e,r)=>{const{value:a,...i}=e,s=bA($1,e.__scopeMenu),o=a===s.value;return d.jsx(K1,{scope:e.__scopeMenu,checked:o,children:d.jsx(tu,{role:"menuitemradio","aria-checked":o,...i,ref:r,"data-state":wm(o),onSelect:Fe(i.onSelect,()=>s.onValueChange?.(a),{checkForDefaultPrevented:!1})})})});V1.displayName=$1;var bm="MenuItemIndicator",[K1,wA]=Wa(bm,{checked:!1}),X1=j.forwardRef((e,r)=>{const{__scopeMenu:a,forceMount:i,...s}=e,o=wA(bm,a);return d.jsx(un,{present:i||Ac(o.checked)||o.checked===!0,children:d.jsx(st.span,{...s,ref:r,"data-state":wm(o.checked)})})});X1.displayName=bm;var SA="MenuSeparator",Z1=j.forwardRef((e,r)=>{const{__scopeMenu:a,...i}=e;return d.jsx(st.div,{role:"separator","aria-orientation":"horizontal",...i,ref:r})});Z1.displayName=SA;var kA="MenuArrow",Q1=j.forwardRef((e,r)=>{const{__scopeMenu:a,...i}=e,s=eu(a);return d.jsx(C1,{...s,...i,ref:r})});Q1.displayName=kA;var _A="MenuSub",[AI,W1]=Wa(_A),cs="MenuSubTrigger",J1=j.forwardRef((e,r)=>{const a=Ja(cs,e.__scopeMenu),i=As(cs,e.__scopeMenu),s=W1(cs,e.__scopeMenu),o=ym(cs,e.__scopeMenu),u=j.useRef(null),{pointerGraceTimerRef:f,onPointerGraceIntentChange:h}=o,m={__scopeMenu:e.__scopeMenu},y=j.useCallback(()=>{u.current&&window.clearTimeout(u.current),u.current=null},[]);return j.useEffect(()=>y,[y]),j.useEffect(()=>{const p=f.current;return()=>{window.clearTimeout(p),h(null)}},[f,h]),d.jsx(pm,{asChild:!0,...m,children:d.jsx(H1,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":s.contentId,"data-state":nw(a.open),...e,ref:Fc(r,s.onTriggerChange),onClick:p=>{e.onClick?.(p),!(e.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),a.open||a.onOpenChange(!0))},onPointerMove:Fe(e.onPointerMove,bs(p=>{o.onItemEnter(p),!p.defaultPrevented&&!e.disabled&&!a.open&&!u.current&&(o.onPointerGraceIntentChange(null),u.current=window.setTimeout(()=>{a.onOpenChange(!0),y()},100))})),onPointerLeave:Fe(e.onPointerLeave,bs(p=>{y();const b=a.content?.getBoundingClientRect();if(b){const x=a.content?.dataset.side,S=x==="right",w=S?-5:5,_=b[S?"left":"right"],k=b[S?"right":"left"];o.onPointerGraceIntentChange({area:[{x:p.clientX+w,y:p.clientY},{x:_,y:b.top},{x:k,y:b.top},{x:k,y:b.bottom},{x:_,y:b.bottom}],side:x}),window.clearTimeout(f.current),f.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(p),p.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Fe(e.onKeyDown,p=>{const b=o.searchRef.current!=="";e.disabled||b&&p.key===" "||aA[i.dir].includes(p.key)&&(a.onOpenChange(!0),a.content?.focus(),p.preventDefault())})})})});J1.displayName=cs;var ew="MenuSubContent",tw=j.forwardRef((e,r)=>{const a=P1(Yn,e.__scopeMenu),{forceMount:i=a.forceMount,...s}=e,o=Ja(Yn,e.__scopeMenu),u=As(Yn,e.__scopeMenu),f=W1(ew,e.__scopeMenu),h=j.useRef(null),m=Ct(r,h);return d.jsx(vs.Provider,{scope:e.__scopeMenu,children:d.jsx(un,{present:i||o.open,children:d.jsx(vs.Slot,{scope:e.__scopeMenu,children:d.jsx(xm,{id:f.contentId,"aria-labelledby":f.triggerId,...s,ref:m,align:"start",side:u.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:y=>{u.isUsingKeyboardRef.current&&h.current?.focus(),y.preventDefault()},onCloseAutoFocus:y=>y.preventDefault(),onFocusOutside:Fe(e.onFocusOutside,y=>{y.target!==f.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:Fe(e.onEscapeKeyDown,y=>{u.onClose(),y.preventDefault()}),onKeyDown:Fe(e.onKeyDown,y=>{const p=y.currentTarget.contains(y.target),b=iA[u.dir].includes(y.key);p&&b&&(o.onOpenChange(!1),f.trigger?.focus(),y.preventDefault())})})})})})});tw.displayName=ew;function nw(e){return e?"open":"closed"}function Ac(e){return e==="indeterminate"}function wm(e){return Ac(e)?"indeterminate":e?"checked":"unchecked"}function jA(e){const r=document.activeElement;for(const a of e)if(a===r||(a.focus(),document.activeElement!==r))return}function CA(e,r){return e.map((a,i)=>e[(r+i)%e.length])}function EA(e,r,a){const s=r.length>1&&Array.from(r).every(m=>m===r[0])?r[0]:r,o=a?e.indexOf(a):-1;let u=CA(e,Math.max(o,0));s.length===1&&(u=u.filter(m=>m!==a));const h=u.find(m=>m.toLowerCase().startsWith(s.toLowerCase()));return h!==a?h:void 0}function NA(e,r){const{x:a,y:i}=e;let s=!1;for(let o=0,u=r.length-1;o<r.length;u=o++){const f=r[o],h=r[u],m=f.x,y=f.y,p=h.x,b=h.y;y>i!=b>i&&a<(p-m)*(i-y)/(b-y)+m&&(s=!s)}return s}function AA(e,r){if(!r)return!1;const a={x:e.clientX,y:e.clientY};return NA(a,r)}function bs(e){return r=>r.pointerType==="mouse"?e(r):void 0}var TA=I1,RA=pm,OA=U1,zA=B1,MA=vm,DA=F1,LA=tu,IA=q1,PA=Y1,UA=V1,BA=X1,FA=Z1,HA=Q1,qA=J1,GA=tw,nu="DropdownMenu",[YA]=fr(nu,[D1]),dn=D1(),[$A,rw]=YA(nu),aw=e=>{const{__scopeDropdownMenu:r,children:a,dir:i,open:s,defaultOpen:o,onOpenChange:u,modal:f=!0}=e,h=dn(r),m=j.useRef(null),[y,p]=js({prop:s,defaultProp:o??!1,onChange:u,caller:nu});return d.jsx($A,{scope:r,triggerId:pa(),triggerRef:m,contentId:pa(),open:y,onOpenChange:p,onOpenToggle:j.useCallback(()=>p(b=>!b),[p]),modal:f,children:d.jsx(TA,{...h,open:y,onOpenChange:p,dir:i,modal:f,children:a})})};aw.displayName=nu;var iw="DropdownMenuTrigger",lw=j.forwardRef((e,r)=>{const{__scopeDropdownMenu:a,disabled:i=!1,...s}=e,o=rw(iw,a),u=dn(a);return d.jsx(RA,{asChild:!0,...u,children:d.jsx(st.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":i?"":void 0,disabled:i,...s,ref:Fc(r,o.triggerRef),onPointerDown:Fe(e.onPointerDown,f=>{!i&&f.button===0&&f.ctrlKey===!1&&(o.onOpenToggle(),o.open||f.preventDefault())}),onKeyDown:Fe(e.onKeyDown,f=>{i||(["Enter"," "].includes(f.key)&&o.onOpenToggle(),f.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(f.key)&&f.preventDefault())})})})});lw.displayName=iw;var VA="DropdownMenuPortal",sw=e=>{const{__scopeDropdownMenu:r,...a}=e,i=dn(r);return d.jsx(OA,{...i,...a})};sw.displayName=VA;var ow="DropdownMenuContent",cw=j.forwardRef((e,r)=>{const{__scopeDropdownMenu:a,...i}=e,s=rw(ow,a),o=dn(a),u=j.useRef(!1);return d.jsx(zA,{id:s.contentId,"aria-labelledby":s.triggerId,...o,...i,ref:r,onCloseAutoFocus:Fe(e.onCloseAutoFocus,f=>{u.current||s.triggerRef.current?.focus(),u.current=!1,f.preventDefault()}),onInteractOutside:Fe(e.onInteractOutside,f=>{const h=f.detail.originalEvent,m=h.button===0&&h.ctrlKey===!0,y=h.button===2||m;(!s.modal||y)&&(u.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});cw.displayName=ow;var KA="DropdownMenuGroup",XA=j.forwardRef((e,r)=>{const{__scopeDropdownMenu:a,...i}=e,s=dn(a);return d.jsx(MA,{...s,...i,ref:r})});XA.displayName=KA;var ZA="DropdownMenuLabel",QA=j.forwardRef((e,r)=>{const{__scopeDropdownMenu:a,...i}=e,s=dn(a);return d.jsx(DA,{...s,...i,ref:r})});QA.displayName=ZA;var WA="DropdownMenuItem",uw=j.forwardRef((e,r)=>{const{__scopeDropdownMenu:a,...i}=e,s=dn(a);return d.jsx(LA,{...s,...i,ref:r})});uw.displayName=WA;var JA="DropdownMenuCheckboxItem",eT=j.forwardRef((e,r)=>{const{__scopeDropdownMenu:a,...i}=e,s=dn(a);return d.jsx(IA,{...s,...i,ref:r})});eT.displayName=JA;var tT="DropdownMenuRadioGroup",nT=j.forwardRef((e,r)=>{const{__scopeDropdownMenu:a,...i}=e,s=dn(a);return d.jsx(PA,{...s,...i,ref:r})});nT.displayName=tT;var rT="DropdownMenuRadioItem",aT=j.forwardRef((e,r)=>{const{__scopeDropdownMenu:a,...i}=e,s=dn(a);return d.jsx(UA,{...s,...i,ref:r})});aT.displayName=rT;var iT="DropdownMenuItemIndicator",lT=j.forwardRef((e,r)=>{const{__scopeDropdownMenu:a,...i}=e,s=dn(a);return d.jsx(BA,{...s,...i,ref:r})});lT.displayName=iT;var sT="DropdownMenuSeparator",oT=j.forwardRef((e,r)=>{const{__scopeDropdownMenu:a,...i}=e,s=dn(a);return d.jsx(FA,{...s,...i,ref:r})});oT.displayName=sT;var cT="DropdownMenuArrow",uT=j.forwardRef((e,r)=>{const{__scopeDropdownMenu:a,...i}=e,s=dn(a);return d.jsx(HA,{...s,...i,ref:r})});uT.displayName=cT;var dT="DropdownMenuSubTrigger",fT=j.forwardRef((e,r)=>{const{__scopeDropdownMenu:a,...i}=e,s=dn(a);return d.jsx(qA,{...s,...i,ref:r})});fT.displayName=dT;var hT="DropdownMenuSubContent",mT=j.forwardRef((e,r)=>{const{__scopeDropdownMenu:a,...i}=e,s=dn(a);return d.jsx(GA,{...s,...i,ref:r,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});mT.displayName=hT;var pT=aw,gT=lw,yT=sw,xT=cw,vT=uw;function bT(e,[r,a]){return Math.min(a,Math.max(r,e))}function wT(e,r){return j.useReducer((a,i)=>r[a][i]??a,e)}var Sm="ScrollArea",[dw]=fr(Sm),[ST,Vn]=dw(Sm),fw=j.forwardRef((e,r)=>{const{__scopeScrollArea:a,type:i="hover",dir:s,scrollHideDelay:o=600,...u}=e,[f,h]=j.useState(null),[m,y]=j.useState(null),[p,b]=j.useState(null),[x,S]=j.useState(null),[w,_]=j.useState(null),[k,N]=j.useState(0),[A,O]=j.useState(0),[M,D]=j.useState(!1),[B,V]=j.useState(!1),K=Ct(r,te=>h(te)),U=qc(s);return d.jsx(ST,{scope:a,type:i,dir:U,scrollHideDelay:o,scrollArea:f,viewport:m,onViewportChange:y,content:p,onContentChange:b,scrollbarX:x,onScrollbarXChange:S,scrollbarXEnabled:M,onScrollbarXEnabledChange:D,scrollbarY:w,onScrollbarYChange:_,scrollbarYEnabled:B,onScrollbarYEnabledChange:V,onCornerWidthChange:N,onCornerHeightChange:O,children:d.jsx(st.div,{dir:U,...u,ref:K,style:{position:"relative","--radix-scroll-area-corner-width":k+"px","--radix-scroll-area-corner-height":A+"px",...e.style}})})});fw.displayName=Sm;var hw="ScrollAreaViewport",mw=j.forwardRef((e,r)=>{const{__scopeScrollArea:a,children:i,nonce:s,...o}=e,u=Vn(hw,a),f=j.useRef(null),h=Ct(r,f,u.onViewportChange);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),d.jsx(st.div,{"data-radix-scroll-area-viewport":"",...o,ref:h,style:{overflowX:u.scrollbarXEnabled?"scroll":"hidden",overflowY:u.scrollbarYEnabled?"scroll":"hidden",...e.style},children:d.jsx("div",{ref:u.onContentChange,style:{minWidth:"100%",display:"table"},children:i})})]})});mw.displayName=hw;var mr="ScrollAreaScrollbar",pw=j.forwardRef((e,r)=>{const{forceMount:a,...i}=e,s=Vn(mr,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:u}=s,f=e.orientation==="horizontal";return j.useEffect(()=>(f?o(!0):u(!0),()=>{f?o(!1):u(!1)}),[f,o,u]),s.type==="hover"?d.jsx(kT,{...i,ref:r,forceMount:a}):s.type==="scroll"?d.jsx(_T,{...i,ref:r,forceMount:a}):s.type==="auto"?d.jsx(gw,{...i,ref:r,forceMount:a}):s.type==="always"?d.jsx(km,{...i,ref:r}):null});pw.displayName=mr;var kT=j.forwardRef((e,r)=>{const{forceMount:a,...i}=e,s=Vn(mr,e.__scopeScrollArea),[o,u]=j.useState(!1);return j.useEffect(()=>{const f=s.scrollArea;let h=0;if(f){const m=()=>{window.clearTimeout(h),u(!0)},y=()=>{h=window.setTimeout(()=>u(!1),s.scrollHideDelay)};return f.addEventListener("pointerenter",m),f.addEventListener("pointerleave",y),()=>{window.clearTimeout(h),f.removeEventListener("pointerenter",m),f.removeEventListener("pointerleave",y)}}},[s.scrollArea,s.scrollHideDelay]),d.jsx(un,{present:a||o,children:d.jsx(gw,{"data-state":o?"visible":"hidden",...i,ref:r})})}),_T=j.forwardRef((e,r)=>{const{forceMount:a,...i}=e,s=Vn(mr,e.__scopeScrollArea),o=e.orientation==="horizontal",u=au(()=>h("SCROLL_END"),100),[f,h]=wT("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return j.useEffect(()=>{if(f==="idle"){const m=window.setTimeout(()=>h("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(m)}},[f,s.scrollHideDelay,h]),j.useEffect(()=>{const m=s.viewport,y=o?"scrollLeft":"scrollTop";if(m){let p=m[y];const b=()=>{const x=m[y];p!==x&&(h("SCROLL"),u()),p=x};return m.addEventListener("scroll",b),()=>m.removeEventListener("scroll",b)}},[s.viewport,o,h,u]),d.jsx(un,{present:a||f!=="hidden",children:d.jsx(km,{"data-state":f==="hidden"?"hidden":"visible",...i,ref:r,onPointerEnter:Fe(e.onPointerEnter,()=>h("POINTER_ENTER")),onPointerLeave:Fe(e.onPointerLeave,()=>h("POINTER_LEAVE"))})})}),gw=j.forwardRef((e,r)=>{const a=Vn(mr,e.__scopeScrollArea),{forceMount:i,...s}=e,[o,u]=j.useState(!1),f=e.orientation==="horizontal",h=au(()=>{if(a.viewport){const m=a.viewport.offsetWidth<a.viewport.scrollWidth,y=a.viewport.offsetHeight<a.viewport.scrollHeight;u(f?m:y)}},10);return tl(a.viewport,h),tl(a.content,h),d.jsx(un,{present:i||o,children:d.jsx(km,{"data-state":o?"visible":"hidden",...s,ref:r})})}),km=j.forwardRef((e,r)=>{const{orientation:a="vertical",...i}=e,s=Vn(mr,e.__scopeScrollArea),o=j.useRef(null),u=j.useRef(0),[f,h]=j.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),m=ww(f.viewport,f.content),y={...i,sizes:f,onSizesChange:h,hasThumb:m>0&&m<1,onThumbChange:b=>o.current=b,onThumbPointerUp:()=>u.current=0,onThumbPointerDown:b=>u.current=b};function p(b,x){return TT(b,u.current,f,x)}return a==="horizontal"?d.jsx(jT,{...y,ref:r,onThumbPositionChange:()=>{if(s.viewport&&o.current){const b=s.viewport.scrollLeft,x=$v(b,f,s.dir);o.current.style.transform=`translate3d(${x}px, 0, 0)`}},onWheelScroll:b=>{s.viewport&&(s.viewport.scrollLeft=b)},onDragScroll:b=>{s.viewport&&(s.viewport.scrollLeft=p(b,s.dir))}}):a==="vertical"?d.jsx(CT,{...y,ref:r,onThumbPositionChange:()=>{if(s.viewport&&o.current){const b=s.viewport.scrollTop,x=$v(b,f);o.current.style.transform=`translate3d(0, ${x}px, 0)`}},onWheelScroll:b=>{s.viewport&&(s.viewport.scrollTop=b)},onDragScroll:b=>{s.viewport&&(s.viewport.scrollTop=p(b))}}):null}),jT=j.forwardRef((e,r)=>{const{sizes:a,onSizesChange:i,...s}=e,o=Vn(mr,e.__scopeScrollArea),[u,f]=j.useState(),h=j.useRef(null),m=Ct(r,h,o.onScrollbarXChange);return j.useEffect(()=>{h.current&&f(getComputedStyle(h.current))},[h]),d.jsx(xw,{"data-orientation":"horizontal",...s,ref:m,sizes:a,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":ru(a)+"px",...e.style},onThumbPointerDown:y=>e.onThumbPointerDown(y.x),onDragScroll:y=>e.onDragScroll(y.x),onWheelScroll:(y,p)=>{if(o.viewport){const b=o.viewport.scrollLeft+y.deltaX;e.onWheelScroll(b),kw(b,p)&&y.preventDefault()}},onResize:()=>{h.current&&o.viewport&&u&&i({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:h.current.clientWidth,paddingStart:Rc(u.paddingLeft),paddingEnd:Rc(u.paddingRight)}})}})}),CT=j.forwardRef((e,r)=>{const{sizes:a,onSizesChange:i,...s}=e,o=Vn(mr,e.__scopeScrollArea),[u,f]=j.useState(),h=j.useRef(null),m=Ct(r,h,o.onScrollbarYChange);return j.useEffect(()=>{h.current&&f(getComputedStyle(h.current))},[h]),d.jsx(xw,{"data-orientation":"vertical",...s,ref:m,sizes:a,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":ru(a)+"px",...e.style},onThumbPointerDown:y=>e.onThumbPointerDown(y.y),onDragScroll:y=>e.onDragScroll(y.y),onWheelScroll:(y,p)=>{if(o.viewport){const b=o.viewport.scrollTop+y.deltaY;e.onWheelScroll(b),kw(b,p)&&y.preventDefault()}},onResize:()=>{h.current&&o.viewport&&u&&i({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:h.current.clientHeight,paddingStart:Rc(u.paddingTop),paddingEnd:Rc(u.paddingBottom)}})}})}),[ET,yw]=dw(mr),xw=j.forwardRef((e,r)=>{const{__scopeScrollArea:a,sizes:i,hasThumb:s,onThumbChange:o,onThumbPointerUp:u,onThumbPointerDown:f,onThumbPositionChange:h,onDragScroll:m,onWheelScroll:y,onResize:p,...b}=e,x=Vn(mr,a),[S,w]=j.useState(null),_=Ct(r,K=>w(K)),k=j.useRef(null),N=j.useRef(""),A=x.viewport,O=i.content-i.viewport,M=tn(y),D=tn(h),B=au(p,10);function V(K){if(k.current){const U=K.clientX-k.current.left,te=K.clientY-k.current.top;m({x:U,y:te})}}return j.useEffect(()=>{const K=U=>{const te=U.target;S?.contains(te)&&M(U,O)};return document.addEventListener("wheel",K,{passive:!1}),()=>document.removeEventListener("wheel",K,{passive:!1})},[A,S,O,M]),j.useEffect(D,[i,D]),tl(S,B),tl(x.content,B),d.jsx(ET,{scope:a,scrollbar:S,hasThumb:s,onThumbChange:tn(o),onThumbPointerUp:tn(u),onThumbPositionChange:D,onThumbPointerDown:tn(f),children:d.jsx(st.div,{...b,ref:_,style:{position:"absolute",...b.style},onPointerDown:Fe(e.onPointerDown,K=>{K.button===0&&(K.target.setPointerCapture(K.pointerId),k.current=S.getBoundingClientRect(),N.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",x.viewport&&(x.viewport.style.scrollBehavior="auto"),V(K))}),onPointerMove:Fe(e.onPointerMove,V),onPointerUp:Fe(e.onPointerUp,K=>{const U=K.target;U.hasPointerCapture(K.pointerId)&&U.releasePointerCapture(K.pointerId),document.body.style.webkitUserSelect=N.current,x.viewport&&(x.viewport.style.scrollBehavior=""),k.current=null})})})}),Tc="ScrollAreaThumb",vw=j.forwardRef((e,r)=>{const{forceMount:a,...i}=e,s=yw(Tc,e.__scopeScrollArea);return d.jsx(un,{present:a||s.hasThumb,children:d.jsx(NT,{ref:r,...i})})}),NT=j.forwardRef((e,r)=>{const{__scopeScrollArea:a,style:i,...s}=e,o=Vn(Tc,a),u=yw(Tc,a),{onThumbPositionChange:f}=u,h=Ct(r,p=>u.onThumbChange(p)),m=j.useRef(void 0),y=au(()=>{m.current&&(m.current(),m.current=void 0)},100);return j.useEffect(()=>{const p=o.viewport;if(p){const b=()=>{if(y(),!m.current){const x=RT(p,f);m.current=x,f()}};return f(),p.addEventListener("scroll",b),()=>p.removeEventListener("scroll",b)}},[o.viewport,y,f]),d.jsx(st.div,{"data-state":u.hasThumb?"visible":"hidden",...s,ref:h,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...i},onPointerDownCapture:Fe(e.onPointerDownCapture,p=>{const x=p.target.getBoundingClientRect(),S=p.clientX-x.left,w=p.clientY-x.top;u.onThumbPointerDown({x:S,y:w})}),onPointerUp:Fe(e.onPointerUp,u.onThumbPointerUp)})});vw.displayName=Tc;var _m="ScrollAreaCorner",bw=j.forwardRef((e,r)=>{const a=Vn(_m,e.__scopeScrollArea),i=!!(a.scrollbarX&&a.scrollbarY);return a.type!=="scroll"&&i?d.jsx(AT,{...e,ref:r}):null});bw.displayName=_m;var AT=j.forwardRef((e,r)=>{const{__scopeScrollArea:a,...i}=e,s=Vn(_m,a),[o,u]=j.useState(0),[f,h]=j.useState(0),m=!!(o&&f);return tl(s.scrollbarX,()=>{const y=s.scrollbarX?.offsetHeight||0;s.onCornerHeightChange(y),h(y)}),tl(s.scrollbarY,()=>{const y=s.scrollbarY?.offsetWidth||0;s.onCornerWidthChange(y),u(y)}),m?d.jsx(st.div,{...i,ref:r,style:{width:o,height:f,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Rc(e){return e?parseInt(e,10):0}function ww(e,r){const a=e/r;return isNaN(a)?0:a}function ru(e){const r=ww(e.viewport,e.content),a=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,i=(e.scrollbar.size-a)*r;return Math.max(i,18)}function TT(e,r,a,i="ltr"){const s=ru(a),o=s/2,u=r||o,f=s-u,h=a.scrollbar.paddingStart+u,m=a.scrollbar.size-a.scrollbar.paddingEnd-f,y=a.content-a.viewport,p=i==="ltr"?[0,y]:[y*-1,0];return Sw([h,m],p)(e)}function $v(e,r,a="ltr"){const i=ru(r),s=r.scrollbar.paddingStart+r.scrollbar.paddingEnd,o=r.scrollbar.size-s,u=r.content-r.viewport,f=o-i,h=a==="ltr"?[0,u]:[u*-1,0],m=bT(e,h);return Sw([0,u],[0,f])(m)}function Sw(e,r){return a=>{if(e[0]===e[1]||r[0]===r[1])return r[0];const i=(r[1]-r[0])/(e[1]-e[0]);return r[0]+i*(a-e[0])}}function kw(e,r){return e>0&&e<r}var RT=(e,r=()=>{})=>{let a={left:e.scrollLeft,top:e.scrollTop},i=0;return(function s(){const o={left:e.scrollLeft,top:e.scrollTop},u=a.left!==o.left,f=a.top!==o.top;(u||f)&&r(),a=o,i=window.requestAnimationFrame(s)})(),()=>window.cancelAnimationFrame(i)};function au(e,r){const a=tn(e),i=j.useRef(0);return j.useEffect(()=>()=>window.clearTimeout(i.current),[]),j.useCallback(()=>{window.clearTimeout(i.current),i.current=window.setTimeout(a,r)},[a,r])}function tl(e,r){const a=tn(r);$n(()=>{let i=0;if(e){const s=new ResizeObserver(()=>{cancelAnimationFrame(i),i=window.requestAnimationFrame(a)});return s.observe(e),()=>{window.cancelAnimationFrame(i),s.unobserve(e)}}},[e,a])}var OT=fw,zT=mw,MT=bw,iu="Tabs",[DT]=fr(iu,[Jc]),_w=Jc(),[LT,jm]=DT(iu),jw=j.forwardRef((e,r)=>{const{__scopeTabs:a,value:i,onValueChange:s,defaultValue:o,orientation:u="horizontal",dir:f,activationMode:h="automatic",...m}=e,y=qc(f),[p,b]=js({prop:i,onChange:s,defaultProp:o??"",caller:iu});return d.jsx(LT,{scope:a,baseId:pa(),value:p,onValueChange:b,orientation:u,dir:y,activationMode:h,children:d.jsx(st.div,{dir:y,"data-orientation":u,...m,ref:r})})});jw.displayName=iu;var Cw="TabsList",Ew=j.forwardRef((e,r)=>{const{__scopeTabs:a,loop:i=!0,...s}=e,o=jm(Cw,a),u=_w(a);return d.jsx(O1,{asChild:!0,...u,orientation:o.orientation,dir:o.dir,loop:i,children:d.jsx(st.div,{role:"tablist","aria-orientation":o.orientation,...s,ref:r})})});Ew.displayName=Cw;var Nw="TabsTrigger",Aw=j.forwardRef((e,r)=>{const{__scopeTabs:a,value:i,disabled:s=!1,...o}=e,u=jm(Nw,a),f=_w(a),h=Ow(u.baseId,i),m=zw(u.baseId,i),y=i===u.value;return d.jsx(z1,{asChild:!0,...f,focusable:!s,active:y,children:d.jsx(st.button,{type:"button",role:"tab","aria-selected":y,"aria-controls":m,"data-state":y?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:h,...o,ref:r,onMouseDown:Fe(e.onMouseDown,p=>{!s&&p.button===0&&p.ctrlKey===!1?u.onValueChange(i):p.preventDefault()}),onKeyDown:Fe(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&u.onValueChange(i)}),onFocus:Fe(e.onFocus,()=>{const p=u.activationMode!=="manual";!y&&!s&&p&&u.onValueChange(i)})})})});Aw.displayName=Nw;var Tw="TabsContent",Rw=j.forwardRef((e,r)=>{const{__scopeTabs:a,value:i,forceMount:s,children:o,...u}=e,f=jm(Tw,a),h=Ow(f.baseId,i),m=zw(f.baseId,i),y=i===f.value,p=j.useRef(y);return j.useEffect(()=>{const b=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(b)},[]),d.jsx(un,{present:s||y,children:({present:b})=>d.jsx(st.div,{"data-state":y?"active":"inactive","data-orientation":f.orientation,role:"tabpanel","aria-labelledby":h,hidden:!b,id:m,tabIndex:0,...u,ref:r,style:{...e.style,animationDuration:p.current?"0s":void 0},children:b&&o})})});Rw.displayName=Tw;function Ow(e,r){return`${e}-trigger-${r}`}function zw(e,r){return`${e}-content-${r}`}var IT=jw,PT=Ew,UT=Aw,BT=Rw,[lu]=fr("Tooltip",[Wc]),su=Wc(),Mw="TooltipProvider",FT=700,Nh="tooltip.open",[HT,Cm]=lu(Mw),Dw=e=>{const{__scopeTooltip:r,delayDuration:a=FT,skipDelayDuration:i=300,disableHoverableContent:s=!1,children:o}=e,u=j.useRef(!0),f=j.useRef(!1),h=j.useRef(0);return j.useEffect(()=>{const m=h.current;return()=>window.clearTimeout(m)},[]),d.jsx(HT,{scope:r,isOpenDelayedRef:u,delayDuration:a,onOpen:j.useCallback(()=>{window.clearTimeout(h.current),u.current=!1},[]),onClose:j.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>u.current=!0,i)},[i]),isPointerInTransitRef:f,onPointerInTransitChange:j.useCallback(m=>{f.current=m},[]),disableHoverableContent:s,children:o})};Dw.displayName=Mw;var ws="Tooltip",[qT,Ts]=lu(ws),Lw=e=>{const{__scopeTooltip:r,children:a,open:i,defaultOpen:s,onOpenChange:o,disableHoverableContent:u,delayDuration:f}=e,h=Cm(ws,e.__scopeTooltip),m=su(r),[y,p]=j.useState(null),b=pa(),x=j.useRef(0),S=u??h.disableHoverableContent,w=f??h.delayDuration,_=j.useRef(!1),[k,N]=js({prop:i,defaultProp:s??!1,onChange:B=>{B?(h.onOpen(),document.dispatchEvent(new CustomEvent(Nh))):h.onClose(),o?.(B)},caller:ws}),A=j.useMemo(()=>k?_.current?"delayed-open":"instant-open":"closed",[k]),O=j.useCallback(()=>{window.clearTimeout(x.current),x.current=0,_.current=!1,N(!0)},[N]),M=j.useCallback(()=>{window.clearTimeout(x.current),x.current=0,N(!1)},[N]),D=j.useCallback(()=>{window.clearTimeout(x.current),x.current=window.setTimeout(()=>{_.current=!0,N(!0),x.current=0},w)},[w,N]);return j.useEffect(()=>()=>{x.current&&(window.clearTimeout(x.current),x.current=0)},[]),d.jsx(k1,{...m,children:d.jsx(qT,{scope:r,contentId:b,open:k,stateAttribute:A,trigger:y,onTriggerChange:p,onTriggerEnter:j.useCallback(()=>{h.isOpenDelayedRef.current?D():O()},[h.isOpenDelayedRef,D,O]),onTriggerLeave:j.useCallback(()=>{S?M():(window.clearTimeout(x.current),x.current=0)},[M,S]),onOpen:O,onClose:M,disableHoverableContent:S,children:a})})};Lw.displayName=ws;var Ah="TooltipTrigger",Iw=j.forwardRef((e,r)=>{const{__scopeTooltip:a,...i}=e,s=Ts(Ah,a),o=Cm(Ah,a),u=su(a),f=j.useRef(null),h=Ct(r,f,s.onTriggerChange),m=j.useRef(!1),y=j.useRef(!1),p=j.useCallback(()=>m.current=!1,[]);return j.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),d.jsx(_1,{asChild:!0,...u,children:d.jsx(st.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...i,ref:h,onPointerMove:Fe(e.onPointerMove,b=>{b.pointerType!=="touch"&&!y.current&&!o.isPointerInTransitRef.current&&(s.onTriggerEnter(),y.current=!0)}),onPointerLeave:Fe(e.onPointerLeave,()=>{s.onTriggerLeave(),y.current=!1}),onPointerDown:Fe(e.onPointerDown,()=>{s.open&&s.onClose(),m.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:Fe(e.onFocus,()=>{m.current||s.onOpen()}),onBlur:Fe(e.onBlur,s.onClose),onClick:Fe(e.onClick,s.onClose)})})});Iw.displayName=Ah;var Em="TooltipPortal",[GT,YT]=lu(Em,{forceMount:void 0}),Pw=e=>{const{__scopeTooltip:r,forceMount:a,children:i,container:s}=e,o=Ts(Em,r);return d.jsx(GT,{scope:r,forceMount:a,children:d.jsx(un,{present:a||o.open,children:d.jsx(Yc,{asChild:!0,container:s,children:i})})})};Pw.displayName=Em;var nl="TooltipContent",Uw=j.forwardRef((e,r)=>{const a=YT(nl,e.__scopeTooltip),{forceMount:i=a.forceMount,side:s="top",...o}=e,u=Ts(nl,e.__scopeTooltip);return d.jsx(un,{present:i||u.open,children:u.disableHoverableContent?d.jsx(Bw,{side:s,...o,ref:r}):d.jsx($T,{side:s,...o,ref:r})})}),$T=j.forwardRef((e,r)=>{const a=Ts(nl,e.__scopeTooltip),i=Cm(nl,e.__scopeTooltip),s=j.useRef(null),o=Ct(r,s),[u,f]=j.useState(null),{trigger:h,onClose:m}=a,y=s.current,{onPointerInTransitChange:p}=i,b=j.useCallback(()=>{f(null),p(!1)},[p]),x=j.useCallback((S,w)=>{const _=S.currentTarget,k={x:S.clientX,y:S.clientY},N=ZT(k,_.getBoundingClientRect()),A=QT(k,N),O=WT(w.getBoundingClientRect()),M=e3([...A,...O]);f(M),p(!0)},[p]);return j.useEffect(()=>()=>b(),[b]),j.useEffect(()=>{if(h&&y){const S=_=>x(_,y),w=_=>x(_,h);return h.addEventListener("pointerleave",S),y.addEventListener("pointerleave",w),()=>{h.removeEventListener("pointerleave",S),y.removeEventListener("pointerleave",w)}}},[h,y,x,b]),j.useEffect(()=>{if(u){const S=w=>{const _=w.target,k={x:w.clientX,y:w.clientY},N=h?.contains(_)||y?.contains(_),A=!JT(k,u);N?b():A&&(b(),m())};return document.addEventListener("pointermove",S),()=>document.removeEventListener("pointermove",S)}},[h,y,u,m,b]),d.jsx(Bw,{...e,ref:o})}),[VT,KT]=lu(ws,{isInside:!1}),XT=Uj("TooltipContent"),Bw=j.forwardRef((e,r)=>{const{__scopeTooltip:a,children:i,"aria-label":s,onEscapeKeyDown:o,onPointerDownOutside:u,...f}=e,h=Ts(nl,a),m=su(a),{onClose:y}=h;return j.useEffect(()=>(document.addEventListener(Nh,y),()=>document.removeEventListener(Nh,y)),[y]),j.useEffect(()=>{if(h.trigger){const p=b=>{b.target?.contains(h.trigger)&&y()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[h.trigger,y]),d.jsx(Gc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:u,onFocusOutside:p=>p.preventDefault(),onDismiss:y,children:d.jsxs(j1,{"data-state":h.stateAttribute,...m,...f,ref:r,style:{...f.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[d.jsx(XT,{children:i}),d.jsx(VT,{scope:a,isInside:!0,children:d.jsx($j,{id:h.contentId,role:"tooltip",children:s||i})})]})})});Uw.displayName=nl;var Fw="TooltipArrow",Hw=j.forwardRef((e,r)=>{const{__scopeTooltip:a,...i}=e,s=su(a);return KT(Fw,a).isInside?null:d.jsx(C1,{...s,...i,ref:r})});Hw.displayName=Fw;function ZT(e,r){const a=Math.abs(r.top-e.y),i=Math.abs(r.bottom-e.y),s=Math.abs(r.right-e.x),o=Math.abs(r.left-e.x);switch(Math.min(a,i,s,o)){case o:return"left";case s:return"right";case a:return"top";case i:return"bottom";default:throw new Error("unreachable")}}function QT(e,r,a=5){const i=[];switch(r){case"top":i.push({x:e.x-a,y:e.y+a},{x:e.x+a,y:e.y+a});break;case"bottom":i.push({x:e.x-a,y:e.y-a},{x:e.x+a,y:e.y-a});break;case"left":i.push({x:e.x+a,y:e.y-a},{x:e.x+a,y:e.y+a});break;case"right":i.push({x:e.x-a,y:e.y-a},{x:e.x-a,y:e.y+a});break}return i}function WT(e){const{top:r,right:a,bottom:i,left:s}=e;return[{x:s,y:r},{x:a,y:r},{x:a,y:i},{x:s,y:i}]}function JT(e,r){const{x:a,y:i}=e;let s=!1;for(let o=0,u=r.length-1;o<r.length;u=o++){const f=r[o],h=r[u],m=f.x,y=f.y,p=h.x,b=h.y;y>i!=b>i&&a<(p-m)*(i-y)/(b-y)+m&&(s=!s)}return s}function e3(e){const r=e.slice();return r.sort((a,i)=>a.x<i.x?-1:a.x>i.x?1:a.y<i.y?-1:a.y>i.y?1:0),t3(r)}function t3(e){if(e.length<=1)return e.slice();const r=[];for(let i=0;i<e.length;i++){const s=e[i];for(;r.length>=2;){const o=r[r.length-1],u=r[r.length-2];if((o.x-u.x)*(s.y-u.y)>=(o.y-u.y)*(s.x-u.x))r.pop();else break}r.push(s)}r.pop();const a=[];for(let i=e.length-1;i>=0;i--){const s=e[i];for(;a.length>=2;){const o=a[a.length-1],u=a[a.length-2];if((o.x-u.x)*(s.y-u.y)>=(o.y-u.y)*(s.x-u.x))a.pop();else break}a.push(s)}return a.pop(),r.length===1&&a.length===1&&r[0].x===a[0].x&&r[0].y===a[0].y?r:r.concat(a)}var n3=Dw,r3=Lw,a3=Iw,i3=Pw,l3=Uw,s3=Hw;const o3=(e,r)=>{const a=new Array(e.length+r.length);for(let i=0;i<e.length;i++)a[i]=e[i];for(let i=0;i<r.length;i++)a[e.length+i]=r[i];return a},c3=(e,r)=>({classGroupId:e,validator:r}),qw=(e=new Map,r=null,a)=>({nextPart:e,validators:r,classGroupId:a}),Oc="-",Vv=[],u3="arbitrary..",d3=e=>{const r=h3(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:i}=e;return{getClassGroupId:u=>{if(u.startsWith("[")&&u.endsWith("]"))return f3(u);const f=u.split(Oc),h=f[0]===""&&f.length>1?1:0;return Gw(f,h,r)},getConflictingClassGroupIds:(u,f)=>{if(f){const h=i[u],m=a[u];return h?m?o3(m,h):h:m||Vv}return a[u]||Vv}}},Gw=(e,r,a)=>{if(e.length-r===0)return a.classGroupId;const s=e[r],o=a.nextPart.get(s);if(o){const m=Gw(e,r+1,o);if(m)return m}const u=a.validators;if(u===null)return;const f=r===0?e.join(Oc):e.slice(r).join(Oc),h=u.length;for(let m=0;m<h;m++){const y=u[m];if(y.validator(f))return y.classGroupId}},f3=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const r=e.slice(1,-1),a=r.indexOf(":"),i=r.slice(0,a);return i?u3+i:void 0})(),h3=e=>{const{theme:r,classGroups:a}=e;return m3(a,r)},m3=(e,r)=>{const a=qw();for(const i in e){const s=e[i];Nm(s,a,i,r)}return a},Nm=(e,r,a,i)=>{const s=e.length;for(let o=0;o<s;o++){const u=e[o];p3(u,r,a,i)}},p3=(e,r,a,i)=>{if(typeof e=="string"){g3(e,r,a);return}if(typeof e=="function"){y3(e,r,a,i);return}x3(e,r,a,i)},g3=(e,r,a)=>{const i=e===""?r:Yw(r,e);i.classGroupId=a},y3=(e,r,a,i)=>{if(v3(e)){Nm(e(i),r,a,i);return}r.validators===null&&(r.validators=[]),r.validators.push(c3(a,e))},x3=(e,r,a,i)=>{const s=Object.entries(e),o=s.length;for(let u=0;u<o;u++){const[f,h]=s[u];Nm(h,Yw(r,f),a,i)}},Yw=(e,r)=>{let a=e;const i=r.split(Oc),s=i.length;for(let o=0;o<s;o++){const u=i[o];let f=a.nextPart.get(u);f||(f=qw(),a.nextPart.set(u,f)),a=f}return a},v3=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,b3=e=>{if(e<1)return{get:()=>{},set:()=>{}};let r=0,a=Object.create(null),i=Object.create(null);const s=(o,u)=>{a[o]=u,r++,r>e&&(r=0,i=a,a=Object.create(null))};return{get(o){let u=a[o];if(u!==void 0)return u;if((u=i[o])!==void 0)return s(o,u),u},set(o,u){o in a?a[o]=u:s(o,u)}}},Th="!",Kv=":",w3=[],Xv=(e,r,a,i,s)=>({modifiers:e,hasImportantModifier:r,baseClassName:a,maybePostfixModifierPosition:i,isExternal:s}),S3=e=>{const{prefix:r,experimentalParseClassName:a}=e;let i=s=>{const o=[];let u=0,f=0,h=0,m;const y=s.length;for(let w=0;w<y;w++){const _=s[w];if(u===0&&f===0){if(_===Kv){o.push(s.slice(h,w)),h=w+1;continue}if(_==="/"){m=w;continue}}_==="["?u++:_==="]"?u--:_==="("?f++:_===")"&&f--}const p=o.length===0?s:s.slice(h);let b=p,x=!1;p.endsWith(Th)?(b=p.slice(0,-1),x=!0):p.startsWith(Th)&&(b=p.slice(1),x=!0);const S=m&&m>h?m-h:void 0;return Xv(o,x,b,S)};if(r){const s=r+Kv,o=i;i=u=>u.startsWith(s)?o(u.slice(s.length)):Xv(w3,!1,u,void 0,!0)}if(a){const s=i;i=o=>a({className:o,parseClassName:s})}return i},k3=e=>{const r=new Map;return e.orderSensitiveModifiers.forEach((a,i)=>{r.set(a,1e6+i)}),a=>{const i=[];let s=[];for(let o=0;o<a.length;o++){const u=a[o],f=u[0]==="[",h=r.has(u);f||h?(s.length>0&&(s.sort(),i.push(...s),s=[]),i.push(u)):s.push(u)}return s.length>0&&(s.sort(),i.push(...s)),i}},_3=e=>({cache:b3(e.cacheSize),parseClassName:S3(e),sortModifiers:k3(e),...d3(e)}),j3=/\s+/,C3=(e,r)=>{const{parseClassName:a,getClassGroupId:i,getConflictingClassGroupIds:s,sortModifiers:o}=r,u=[],f=e.trim().split(j3);let h="";for(let m=f.length-1;m>=0;m-=1){const y=f[m],{isExternal:p,modifiers:b,hasImportantModifier:x,baseClassName:S,maybePostfixModifierPosition:w}=a(y);if(p){h=y+(h.length>0?" "+h:h);continue}let _=!!w,k=i(_?S.substring(0,w):S);if(!k){if(!_){h=y+(h.length>0?" "+h:h);continue}if(k=i(S),!k){h=y+(h.length>0?" "+h:h);continue}_=!1}const N=b.length===0?"":b.length===1?b[0]:o(b).join(":"),A=x?N+Th:N,O=A+k;if(u.indexOf(O)>-1)continue;u.push(O);const M=s(k,_);for(let D=0;D<M.length;++D){const B=M[D];u.push(A+B)}h=y+(h.length>0?" "+h:h)}return h},E3=(...e)=>{let r=0,a,i,s="";for(;r<e.length;)(a=e[r++])&&(i=$w(a))&&(s&&(s+=" "),s+=i);return s},$w=e=>{if(typeof e=="string")return e;let r,a="";for(let i=0;i<e.length;i++)e[i]&&(r=$w(e[i]))&&(a&&(a+=" "),a+=r);return a},N3=(e,...r)=>{let a,i,s,o;const u=h=>{const m=r.reduce((y,p)=>p(y),e());return a=_3(m),i=a.cache.get,s=a.cache.set,o=f,f(h)},f=h=>{const m=i(h);if(m)return m;const y=C3(h,a);return s(h,y),y};return o=u,(...h)=>o(E3(...h))},A3=[],Yt=e=>{const r=a=>a[e]||A3;return r.isThemeGetter=!0,r},Vw=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Kw=/^\((?:(\w[\w-]*):)?(.+)\)$/i,T3=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,R3=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,O3=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,z3=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,M3=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,D3=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,oa=e=>T3.test(e),Qe=e=>!!e&&!Number.isNaN(Number(e)),ca=e=>!!e&&Number.isInteger(Number(e)),Xf=e=>e.endsWith("%")&&Qe(e.slice(0,-1)),Mr=e=>R3.test(e),Xw=()=>!0,L3=e=>O3.test(e)&&!z3.test(e),Am=()=>!1,I3=e=>M3.test(e),P3=e=>D3.test(e),U3=e=>!Me(e)&&!Le(e),B3=e=>ba(e,Ww,Am),Me=e=>Vw.test(e),Ba=e=>ba(e,Jw,L3),Zv=e=>ba(e,K3,Qe),F3=e=>ba(e,tS,Xw),H3=e=>ba(e,eS,Am),Qv=e=>ba(e,Zw,Am),q3=e=>ba(e,Qw,P3),cc=e=>ba(e,nS,I3),Le=e=>Kw.test(e),as=e=>ei(e,Jw),G3=e=>ei(e,eS),Wv=e=>ei(e,Zw),Y3=e=>ei(e,Ww),$3=e=>ei(e,Qw),uc=e=>ei(e,nS,!0),V3=e=>ei(e,tS,!0),ba=(e,r,a)=>{const i=Vw.exec(e);return i?i[1]?r(i[1]):a(i[2]):!1},ei=(e,r,a=!1)=>{const i=Kw.exec(e);return i?i[1]?r(i[1]):a:!1},Zw=e=>e==="position"||e==="percentage",Qw=e=>e==="image"||e==="url",Ww=e=>e==="length"||e==="size"||e==="bg-size",Jw=e=>e==="length",K3=e=>e==="number",eS=e=>e==="family-name",tS=e=>e==="number"||e==="weight",nS=e=>e==="shadow",X3=()=>{const e=Yt("color"),r=Yt("font"),a=Yt("text"),i=Yt("font-weight"),s=Yt("tracking"),o=Yt("leading"),u=Yt("breakpoint"),f=Yt("container"),h=Yt("spacing"),m=Yt("radius"),y=Yt("shadow"),p=Yt("inset-shadow"),b=Yt("text-shadow"),x=Yt("drop-shadow"),S=Yt("blur"),w=Yt("perspective"),_=Yt("aspect"),k=Yt("ease"),N=Yt("animate"),A=()=>["auto","avoid","all","avoid-page","page","left","right","column"],O=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],M=()=>[...O(),Le,Me],D=()=>["auto","hidden","clip","visible","scroll"],B=()=>["auto","contain","none"],V=()=>[Le,Me,h],K=()=>[oa,"full","auto",...V()],U=()=>[ca,"none","subgrid",Le,Me],te=()=>["auto",{span:["full",ca,Le,Me]},ca,Le,Me],I=()=>[ca,"auto",Le,Me],Z=()=>["auto","min","max","fr",Le,Me],E=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],q=()=>["start","end","center","stretch","center-safe","end-safe"],$=()=>["auto",...V()],X=()=>[oa,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...V()],re=()=>[oa,"screen","full","dvw","lvw","svw","min","max","fit",...V()],Y=()=>[oa,"screen","full","lh","dvh","lvh","svh","min","max","fit",...V()],z=()=>[e,Le,Me],R=()=>[...O(),Wv,Qv,{position:[Le,Me]}],F=()=>["no-repeat",{repeat:["","x","y","space","round"]}],L=()=>["auto","cover","contain",Y3,B3,{size:[Le,Me]}],le=()=>[Xf,as,Ba],oe=()=>["","none","full",m,Le,Me],ve=()=>["",Qe,as,Ba],Ce=()=>["solid","dashed","dotted","double"],Ae=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Ne=()=>[Qe,Xf,Wv,Qv],Ge=()=>["","none",S,Le,Me],$e=()=>["none",Qe,Le,Me],dt=()=>["none",Qe,Le,Me],ot=()=>[Qe,Le,Me],T=()=>[oa,"full",...V()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Mr],breakpoint:[Mr],color:[Xw],container:[Mr],"drop-shadow":[Mr],ease:["in","out","in-out"],font:[U3],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Mr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Mr],shadow:[Mr],spacing:["px",Qe],text:[Mr],"text-shadow":[Mr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",oa,Me,Le,_]}],container:["container"],columns:[{columns:[Qe,Me,Le,f]}],"break-after":[{"break-after":A()}],"break-before":[{"break-before":A()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:M()}],overflow:[{overflow:D()}],"overflow-x":[{"overflow-x":D()}],"overflow-y":[{"overflow-y":D()}],overscroll:[{overscroll:B()}],"overscroll-x":[{"overscroll-x":B()}],"overscroll-y":[{"overscroll-y":B()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:K()}],"inset-x":[{"inset-x":K()}],"inset-y":[{"inset-y":K()}],start:[{"inset-s":K(),start:K()}],end:[{"inset-e":K(),end:K()}],"inset-bs":[{"inset-bs":K()}],"inset-be":[{"inset-be":K()}],top:[{top:K()}],right:[{right:K()}],bottom:[{bottom:K()}],left:[{left:K()}],visibility:["visible","invisible","collapse"],z:[{z:[ca,"auto",Le,Me]}],basis:[{basis:[oa,"full","auto",f,...V()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Qe,oa,"auto","initial","none",Me]}],grow:[{grow:["",Qe,Le,Me]}],shrink:[{shrink:["",Qe,Le,Me]}],order:[{order:[ca,"first","last","none",Le,Me]}],"grid-cols":[{"grid-cols":U()}],"col-start-end":[{col:te()}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":U()}],"row-start-end":[{row:te()}],"row-start":[{"row-start":I()}],"row-end":[{"row-end":I()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Z()}],"auto-rows":[{"auto-rows":Z()}],gap:[{gap:V()}],"gap-x":[{"gap-x":V()}],"gap-y":[{"gap-y":V()}],"justify-content":[{justify:[...E(),"normal"]}],"justify-items":[{"justify-items":[...q(),"normal"]}],"justify-self":[{"justify-self":["auto",...q()]}],"align-content":[{content:["normal",...E()]}],"align-items":[{items:[...q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...q(),{baseline:["","last"]}]}],"place-content":[{"place-content":E()}],"place-items":[{"place-items":[...q(),"baseline"]}],"place-self":[{"place-self":["auto",...q()]}],p:[{p:V()}],px:[{px:V()}],py:[{py:V()}],ps:[{ps:V()}],pe:[{pe:V()}],pbs:[{pbs:V()}],pbe:[{pbe:V()}],pt:[{pt:V()}],pr:[{pr:V()}],pb:[{pb:V()}],pl:[{pl:V()}],m:[{m:$()}],mx:[{mx:$()}],my:[{my:$()}],ms:[{ms:$()}],me:[{me:$()}],mbs:[{mbs:$()}],mbe:[{mbe:$()}],mt:[{mt:$()}],mr:[{mr:$()}],mb:[{mb:$()}],ml:[{ml:$()}],"space-x":[{"space-x":V()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":V()}],"space-y-reverse":["space-y-reverse"],size:[{size:X()}],"inline-size":[{inline:["auto",...re()]}],"min-inline-size":[{"min-inline":["auto",...re()]}],"max-inline-size":[{"max-inline":["none",...re()]}],"block-size":[{block:["auto",...Y()]}],"min-block-size":[{"min-block":["auto",...Y()]}],"max-block-size":[{"max-block":["none",...Y()]}],w:[{w:[f,"screen",...X()]}],"min-w":[{"min-w":[f,"screen","none",...X()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[u]},...X()]}],h:[{h:["screen","lh",...X()]}],"min-h":[{"min-h":["screen","lh","none",...X()]}],"max-h":[{"max-h":["screen","lh",...X()]}],"font-size":[{text:["base",a,as,Ba]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,V3,F3]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Xf,Me]}],"font-family":[{font:[G3,H3,r]}],"font-features":[{"font-features":[Me]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,Le,Me]}],"line-clamp":[{"line-clamp":[Qe,"none",Le,Zv]}],leading:[{leading:[o,...V()]}],"list-image":[{"list-image":["none",Le,Me]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Le,Me]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:z()}],"text-color":[{text:z()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ce(),"wavy"]}],"text-decoration-thickness":[{decoration:[Qe,"from-font","auto",Le,Ba]}],"text-decoration-color":[{decoration:z()}],"underline-offset":[{"underline-offset":[Qe,"auto",Le,Me]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:V()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Le,Me]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Le,Me]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:R()}],"bg-repeat":[{bg:F()}],"bg-size":[{bg:L()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ca,Le,Me],radial:["",Le,Me],conic:[ca,Le,Me]},$3,q3]}],"bg-color":[{bg:z()}],"gradient-from-pos":[{from:le()}],"gradient-via-pos":[{via:le()}],"gradient-to-pos":[{to:le()}],"gradient-from":[{from:z()}],"gradient-via":[{via:z()}],"gradient-to":[{to:z()}],rounded:[{rounded:oe()}],"rounded-s":[{"rounded-s":oe()}],"rounded-e":[{"rounded-e":oe()}],"rounded-t":[{"rounded-t":oe()}],"rounded-r":[{"rounded-r":oe()}],"rounded-b":[{"rounded-b":oe()}],"rounded-l":[{"rounded-l":oe()}],"rounded-ss":[{"rounded-ss":oe()}],"rounded-se":[{"rounded-se":oe()}],"rounded-ee":[{"rounded-ee":oe()}],"rounded-es":[{"rounded-es":oe()}],"rounded-tl":[{"rounded-tl":oe()}],"rounded-tr":[{"rounded-tr":oe()}],"rounded-br":[{"rounded-br":oe()}],"rounded-bl":[{"rounded-bl":oe()}],"border-w":[{border:ve()}],"border-w-x":[{"border-x":ve()}],"border-w-y":[{"border-y":ve()}],"border-w-s":[{"border-s":ve()}],"border-w-e":[{"border-e":ve()}],"border-w-bs":[{"border-bs":ve()}],"border-w-be":[{"border-be":ve()}],"border-w-t":[{"border-t":ve()}],"border-w-r":[{"border-r":ve()}],"border-w-b":[{"border-b":ve()}],"border-w-l":[{"border-l":ve()}],"divide-x":[{"divide-x":ve()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ve()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Ce(),"hidden","none"]}],"divide-style":[{divide:[...Ce(),"hidden","none"]}],"border-color":[{border:z()}],"border-color-x":[{"border-x":z()}],"border-color-y":[{"border-y":z()}],"border-color-s":[{"border-s":z()}],"border-color-e":[{"border-e":z()}],"border-color-bs":[{"border-bs":z()}],"border-color-be":[{"border-be":z()}],"border-color-t":[{"border-t":z()}],"border-color-r":[{"border-r":z()}],"border-color-b":[{"border-b":z()}],"border-color-l":[{"border-l":z()}],"divide-color":[{divide:z()}],"outline-style":[{outline:[...Ce(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Qe,Le,Me]}],"outline-w":[{outline:["",Qe,as,Ba]}],"outline-color":[{outline:z()}],shadow:[{shadow:["","none",y,uc,cc]}],"shadow-color":[{shadow:z()}],"inset-shadow":[{"inset-shadow":["none",p,uc,cc]}],"inset-shadow-color":[{"inset-shadow":z()}],"ring-w":[{ring:ve()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:z()}],"ring-offset-w":[{"ring-offset":[Qe,Ba]}],"ring-offset-color":[{"ring-offset":z()}],"inset-ring-w":[{"inset-ring":ve()}],"inset-ring-color":[{"inset-ring":z()}],"text-shadow":[{"text-shadow":["none",b,uc,cc]}],"text-shadow-color":[{"text-shadow":z()}],opacity:[{opacity:[Qe,Le,Me]}],"mix-blend":[{"mix-blend":[...Ae(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Ae()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Qe]}],"mask-image-linear-from-pos":[{"mask-linear-from":Ne()}],"mask-image-linear-to-pos":[{"mask-linear-to":Ne()}],"mask-image-linear-from-color":[{"mask-linear-from":z()}],"mask-image-linear-to-color":[{"mask-linear-to":z()}],"mask-image-t-from-pos":[{"mask-t-from":Ne()}],"mask-image-t-to-pos":[{"mask-t-to":Ne()}],"mask-image-t-from-color":[{"mask-t-from":z()}],"mask-image-t-to-color":[{"mask-t-to":z()}],"mask-image-r-from-pos":[{"mask-r-from":Ne()}],"mask-image-r-to-pos":[{"mask-r-to":Ne()}],"mask-image-r-from-color":[{"mask-r-from":z()}],"mask-image-r-to-color":[{"mask-r-to":z()}],"mask-image-b-from-pos":[{"mask-b-from":Ne()}],"mask-image-b-to-pos":[{"mask-b-to":Ne()}],"mask-image-b-from-color":[{"mask-b-from":z()}],"mask-image-b-to-color":[{"mask-b-to":z()}],"mask-image-l-from-pos":[{"mask-l-from":Ne()}],"mask-image-l-to-pos":[{"mask-l-to":Ne()}],"mask-image-l-from-color":[{"mask-l-from":z()}],"mask-image-l-to-color":[{"mask-l-to":z()}],"mask-image-x-from-pos":[{"mask-x-from":Ne()}],"mask-image-x-to-pos":[{"mask-x-to":Ne()}],"mask-image-x-from-color":[{"mask-x-from":z()}],"mask-image-x-to-color":[{"mask-x-to":z()}],"mask-image-y-from-pos":[{"mask-y-from":Ne()}],"mask-image-y-to-pos":[{"mask-y-to":Ne()}],"mask-image-y-from-color":[{"mask-y-from":z()}],"mask-image-y-to-color":[{"mask-y-to":z()}],"mask-image-radial":[{"mask-radial":[Le,Me]}],"mask-image-radial-from-pos":[{"mask-radial-from":Ne()}],"mask-image-radial-to-pos":[{"mask-radial-to":Ne()}],"mask-image-radial-from-color":[{"mask-radial-from":z()}],"mask-image-radial-to-color":[{"mask-radial-to":z()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":O()}],"mask-image-conic-pos":[{"mask-conic":[Qe]}],"mask-image-conic-from-pos":[{"mask-conic-from":Ne()}],"mask-image-conic-to-pos":[{"mask-conic-to":Ne()}],"mask-image-conic-from-color":[{"mask-conic-from":z()}],"mask-image-conic-to-color":[{"mask-conic-to":z()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:R()}],"mask-repeat":[{mask:F()}],"mask-size":[{mask:L()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Le,Me]}],filter:[{filter:["","none",Le,Me]}],blur:[{blur:Ge()}],brightness:[{brightness:[Qe,Le,Me]}],contrast:[{contrast:[Qe,Le,Me]}],"drop-shadow":[{"drop-shadow":["","none",x,uc,cc]}],"drop-shadow-color":[{"drop-shadow":z()}],grayscale:[{grayscale:["",Qe,Le,Me]}],"hue-rotate":[{"hue-rotate":[Qe,Le,Me]}],invert:[{invert:["",Qe,Le,Me]}],saturate:[{saturate:[Qe,Le,Me]}],sepia:[{sepia:["",Qe,Le,Me]}],"backdrop-filter":[{"backdrop-filter":["","none",Le,Me]}],"backdrop-blur":[{"backdrop-blur":Ge()}],"backdrop-brightness":[{"backdrop-brightness":[Qe,Le,Me]}],"backdrop-contrast":[{"backdrop-contrast":[Qe,Le,Me]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Qe,Le,Me]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Qe,Le,Me]}],"backdrop-invert":[{"backdrop-invert":["",Qe,Le,Me]}],"backdrop-opacity":[{"backdrop-opacity":[Qe,Le,Me]}],"backdrop-saturate":[{"backdrop-saturate":[Qe,Le,Me]}],"backdrop-sepia":[{"backdrop-sepia":["",Qe,Le,Me]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":V()}],"border-spacing-x":[{"border-spacing-x":V()}],"border-spacing-y":[{"border-spacing-y":V()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Le,Me]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Qe,"initial",Le,Me]}],ease:[{ease:["linear","initial",k,Le,Me]}],delay:[{delay:[Qe,Le,Me]}],animate:[{animate:["none",N,Le,Me]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,Le,Me]}],"perspective-origin":[{"perspective-origin":M()}],rotate:[{rotate:$e()}],"rotate-x":[{"rotate-x":$e()}],"rotate-y":[{"rotate-y":$e()}],"rotate-z":[{"rotate-z":$e()}],scale:[{scale:dt()}],"scale-x":[{"scale-x":dt()}],"scale-y":[{"scale-y":dt()}],"scale-z":[{"scale-z":dt()}],"scale-3d":["scale-3d"],skew:[{skew:ot()}],"skew-x":[{"skew-x":ot()}],"skew-y":[{"skew-y":ot()}],transform:[{transform:[Le,Me,"","none","gpu","cpu"]}],"transform-origin":[{origin:M()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:T()}],"translate-x":[{"translate-x":T()}],"translate-y":[{"translate-y":T()}],"translate-z":[{"translate-z":T()}],"translate-none":["translate-none"],accent:[{accent:z()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:z()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Le,Me]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":V()}],"scroll-mx":[{"scroll-mx":V()}],"scroll-my":[{"scroll-my":V()}],"scroll-ms":[{"scroll-ms":V()}],"scroll-me":[{"scroll-me":V()}],"scroll-mbs":[{"scroll-mbs":V()}],"scroll-mbe":[{"scroll-mbe":V()}],"scroll-mt":[{"scroll-mt":V()}],"scroll-mr":[{"scroll-mr":V()}],"scroll-mb":[{"scroll-mb":V()}],"scroll-ml":[{"scroll-ml":V()}],"scroll-p":[{"scroll-p":V()}],"scroll-px":[{"scroll-px":V()}],"scroll-py":[{"scroll-py":V()}],"scroll-ps":[{"scroll-ps":V()}],"scroll-pe":[{"scroll-pe":V()}],"scroll-pbs":[{"scroll-pbs":V()}],"scroll-pbe":[{"scroll-pbe":V()}],"scroll-pt":[{"scroll-pt":V()}],"scroll-pr":[{"scroll-pr":V()}],"scroll-pb":[{"scroll-pb":V()}],"scroll-pl":[{"scroll-pl":V()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Le,Me]}],fill:[{fill:["none",...z()]}],"stroke-w":[{stroke:[Qe,as,Ba,Zv]}],stroke:[{stroke:["none",...z()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Z3=N3(X3);function ze(...e){return Z3(d0(e))}const Q3=Bc("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function je({className:e,variant:r="default",size:a="default",asChild:i=!1,...s}){const o=i?Hc:"button";return d.jsx(o,{"data-slot":"button","data-variant":r,"data-size":a,className:ze(Q3({variant:r,size:a,className:e})),...s})}const rS=(...e)=>e.filter((r,a,i)=>!!r&&r.trim()!==""&&i.indexOf(r)===a).join(" ").trim();const W3=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const J3=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(r,a,i)=>i?i.toUpperCase():a.toLowerCase());const Jv=e=>{const r=J3(e);return r.charAt(0).toUpperCase()+r.slice(1)};var e4={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"};const t4=e=>{for(const r in e)if(r.startsWith("aria-")||r==="role"||r==="title")return!0;return!1};const n4=j.forwardRef(({color:e="currentColor",size:r=24,strokeWidth:a=2,absoluteStrokeWidth:i,className:s="",children:o,iconNode:u,...f},h)=>j.createElement("svg",{ref:h,...e4,width:r,height:r,stroke:e,strokeWidth:i?Number(a)*24/Number(r):a,className:rS("lucide",s),...!o&&!t4(f)&&{"aria-hidden":"true"},...f},[...u.map(([m,y])=>j.createElement(m,y)),...Array.isArray(o)?o:[o]]));const De=(e,r)=>{const a=j.forwardRef(({className:i,...s},o)=>j.createElement(n4,{ref:o,iconNode:r,className:rS(`lucide-${W3(Jv(e))}`,`lucide-${e}`,i),...s}));return a.displayName=Jv(e),a};const r4=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],a4=De("activity",r4);const i4=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],l4=De("arrow-left",i4);const s4=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],aS=De("book-open",s4);const o4=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],iS=De("brain",o4);const c4=[["path",{d:"M16 14v2.2l1.6 1",key:"fo4ql5"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]],u4=De("calendar-clock",c4);const d4=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],f4=De("calendar",d4);const h4=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Rh=De("check",h4);const m4=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],p4=De("chevron-down",m4);const g4=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Tm=De("chevron-left",g4);const y4=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Ga=De("chevron-right",y4);const x4=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],v4=De("chevron-up",x4);const b4=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],w4=De("cloud",b4);const S4=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],eb=De("copy",S4);const k4=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],lS=De("cpu",k4);const _4=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],j4=De("download",_4);const C4=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],E4=De("ellipsis-vertical",C4);const N4=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],A4=De("ellipsis",N4);const T4=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],sS=De("external-link",T4);const R4=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],O4=De("eye-off",R4);const z4=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],M4=De("eye",z4);const D4=[["path",{d:"M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z",key:"1jg4f8"}]],L4=De("facebook",D4);const I4=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]],oS=De("file-down",I4);const P4=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Rm=De("file-text",P4);const U4=[["path",{d:"M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z",key:"1fr9dc"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M12 10v2",key:"hh53o1"}],["path",{d:"M16 10v6",key:"1d6xys"}]],tb=De("folder-kanban",U4);const B4=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],F4=De("folder-open",B4);const H4=[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]],q4=De("github",H4);const G4=[["path",{d:"M10 16h.01",key:"1bzywj"}],["path",{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"18tbho"}],["path",{d:"M21.946 12.013H2.054",key:"zqlbp7"}],["path",{d:"M6 16h.01",key:"1pmjb7"}]],cS=De("hard-drive",G4);const Y4=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],$4=De("history",Y4);const V4=[["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5",key:"1ue2ih"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]],K4=De("image-plus",V4);const X4=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],Z4=De("layout-dashboard",X4);const Q4=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],W4=De("layout-grid",Q4);const J4=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],uS=De("lightbulb",J4);const e5=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]],t5=De("list-todo",e5);const n5=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],nb=De("loader-circle",n5);const r5=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],a5=De("lock",r5);const i5=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],rb=De("mail",i5);const l5=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],us=De("message-circle",l5);const s5=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],o5=De("message-square",s5);const c5=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],u5=De("panel-left",c5);const d5=[["path",{d:"M15.707 21.293a1 1 0 0 1-1.414 0l-1.586-1.586a1 1 0 0 1 0-1.414l5.586-5.586a1 1 0 0 1 1.414 0l1.586 1.586a1 1 0 0 1 0 1.414z",key:"nt11vn"}],["path",{d:"m18 13-1.375-6.874a1 1 0 0 0-.746-.776L3.235 2.028a1 1 0 0 0-1.207 1.207L5.35 15.879a1 1 0 0 0 .776.746L13 18",key:"15qc1e"}],["path",{d:"m2.3 2.3 7.286 7.286",key:"1wuzzi"}],["circle",{cx:"11",cy:"11",r:"2",key:"xmgehs"}]],f5=De("pen-tool",d5);const h5=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],m5=De("pencil",h5);const p5=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],g5=De("play",p5);const y5=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],dS=De("plus",y5);const x5=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],v5=De("power",x5);const b5=[["path",{d:"M2 3h20",key:"91anmk"}],["path",{d:"M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3",key:"2k9sn8"}],["path",{d:"m7 21 5-5 5 5",key:"bip4we"}]],w5=De("presentation",b5);const S5=[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]],fS=De("puzzle",S5);const k5=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],_5=De("refresh-cw",k5);const j5=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],C5=De("search",j5);const E5=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],N5=De("send",E5);const A5=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],Oh=De("server",A5);const T5=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],Om=De("settings-2",T5);const R5=[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]],hS=De("share-2",R5);const O5=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["line",{x1:"3",x2:"21",y1:"9",y2:"9",key:"1vqk6q"}],["line",{x1:"3",x2:"21",y1:"15",y2:"15",key:"o2sbyz"}],["line",{x1:"9",x2:"9",y1:"9",y2:"21",key:"1ib60c"}],["line",{x1:"15",x2:"15",y1:"9",y2:"21",key:"1n26ft"}]],z5=De("sheet",O5);const M5=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],ab=De("shield-alert",M5);const D5=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],L5=De("sparkles",D5);const I5=[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],P5=De("square-check-big",I5);const U5=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],zh=De("trash-2",U5);const B5=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],F5=De("upload",B5);const H5=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],q5=De("user",H5);const G5=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],Y5=De("users",G5);const $5=[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]],V5=De("video",$5);const K5=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ms=De("x",K5);const X5=[["path",{d:"M2.5 17a24.12 24.12 0 0 1 0-10 2 2 0 0 1 1.4-1.4 49.56 49.56 0 0 1 16.2 0A2 2 0 0 1 21.5 7a24.12 24.12 0 0 1 0 10 2 2 0 0 1-1.4 1.4 49.55 49.55 0 0 1-16.2 0A2 2 0 0 1 2.5 17",key:"1q2vi4"}],["path",{d:"m10 15 5-3-5-3z",key:"1jp15x"}]],Z5=De("youtube",X5);const Q5=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],W5=De("zap",Q5),Zf=768;function J5(){const[e,r]=j.useState(void 0);return j.useEffect(()=>{const a=window.matchMedia(`(max-width: ${Zf-1}px)`),i=()=>{r(window.innerWidth<Zf)};return a.addEventListener("change",i),r(window.innerWidth<Zf),()=>a.removeEventListener("change",i)},[]),!!e}function It({className:e,type:r,...a}){return d.jsx("input",{type:r,"data-slot":"input",className:ze("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...a})}function Rs({...e}){return d.jsx(G0,{"data-slot":"sheet",...e})}function eR({...e}){return d.jsx(Y0,{"data-slot":"sheet-portal",...e})}function tR({className:e,...r}){return d.jsx($0,{"data-slot":"sheet-overlay",className:ze("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...r})}function Os({className:e,children:r,side:a="right",showCloseButton:i=!0,...s}){return d.jsxs(eR,{children:[d.jsx(tR,{}),d.jsxs(V0,{"data-slot":"sheet-content",className:ze("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",a==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",a==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",a==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",a==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",e),...s,children:[r,i&&d.jsxs(Z0,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[d.jsx(ms,{className:"size-4"}),d.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function zs({className:e,...r}){return d.jsx("div",{"data-slot":"sheet-header",className:ze("flex flex-col gap-1.5 p-4",e),...r})}function Ms({className:e,...r}){return d.jsx(K0,{"data-slot":"sheet-title",className:ze("text-foreground font-semibold",e),...r})}function Ds({className:e,...r}){return d.jsx(X0,{"data-slot":"sheet-description",className:ze("text-muted-foreground text-sm",e),...r})}function nR({delayDuration:e=0,...r}){return d.jsx(n3,{"data-slot":"tooltip-provider",delayDuration:e,...r})}function rR({...e}){return d.jsx(r3,{"data-slot":"tooltip",...e})}function aR({...e}){return d.jsx(a3,{"data-slot":"tooltip-trigger",...e})}function iR({className:e,sideOffset:r=0,children:a,...i}){return d.jsx(i3,{children:d.jsxs(l3,{"data-slot":"tooltip-content",sideOffset:r,className:ze("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...i,children:[a,d.jsx(s3,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}const lR="sidebar_state",sR=3600*24*7,oR="16rem",cR="18rem",uR="3rem",dR="b",mS=j.createContext(null);function ou(){const e=j.useContext(mS);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function fR({defaultOpen:e=!0,open:r,onOpenChange:a,className:i,style:s,children:o,...u}){const f=J5(),[h,m]=j.useState(!1),[y,p]=j.useState(e),b=r??y,x=j.useCallback(k=>{const N=typeof k=="function"?k(b):k;a?a(N):p(N),document.cookie=`${lR}=${N}; path=/; max-age=${sR}`},[a,b]),S=j.useCallback(()=>f?m(k=>!k):x(k=>!k),[f,x,m]);j.useEffect(()=>{const k=N=>{N.key===dR&&(N.metaKey||N.ctrlKey)&&(N.preventDefault(),S())};return window.addEventListener("keydown",k),()=>window.removeEventListener("keydown",k)},[S]);const w=b?"expanded":"collapsed",_=j.useMemo(()=>({state:w,open:b,setOpen:x,isMobile:f,openMobile:h,setOpenMobile:m,toggleSidebar:S}),[w,b,x,f,h,m,S]);return d.jsx(mS.Provider,{value:_,children:d.jsx(nR,{delayDuration:0,children:d.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":oR,"--sidebar-width-icon":uR,...s},className:ze("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",i),...u,children:o})})})}function hR({side:e="left",variant:r="sidebar",collapsible:a="offcanvas",className:i,children:s,...o}){const{isMobile:u,state:f,openMobile:h,setOpenMobile:m}=ou();return a==="none"?d.jsx("div",{"data-slot":"sidebar",className:ze("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",i),...o,children:s}):u?d.jsx(Rs,{open:h,onOpenChange:m,...o,children:d.jsxs(Os,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":cR},side:e,children:[d.jsxs(zs,{className:"sr-only",children:[d.jsx(Ms,{children:"Sidebar"}),d.jsx(Ds,{children:"Displays the mobile sidebar."})]}),d.jsx("div",{className:"flex h-full w-full flex-col",children:s})]})}):d.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":f,"data-collapsible":f==="collapsed"?a:"","data-variant":r,"data-side":e,"data-slot":"sidebar",children:[d.jsx("div",{"data-slot":"sidebar-gap",className:ze("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",r==="floating"||r==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),d.jsx("div",{"data-slot":"sidebar-container",className:ze("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",r==="floating"||r==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",i),...o,children:d.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:s})})]})}function mR({className:e,onClick:r,...a}){const{toggleSidebar:i}=ou();return d.jsxs(je,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:ze("size-7",e),onClick:s=>{r?.(s),i()},...a,children:[d.jsx(u5,{}),d.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function pR({className:e,...r}){const{toggleSidebar:a}=ou();return d.jsx("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:a,title:"Toggle Sidebar",className:ze("hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex","in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...r})}function gR({className:e,...r}){return d.jsx("main",{"data-slot":"sidebar-inset",className:ze("bg-background relative flex w-full flex-1 flex-col","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",e),...r})}function yR({className:e,...r}){return d.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:ze("flex flex-col gap-2 p-2",e),...r})}function xR({className:e,...r}){return d.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:ze("flex flex-col gap-2 p-2",e),...r})}function vR({className:e,...r}){return d.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:ze("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...r})}function bR({className:e,...r}){return d.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:ze("relative flex w-full min-w-0 flex-col p-2",e),...r})}function wR({className:e,asChild:r=!1,...a}){const i=r?Hc:"div";return d.jsx(i,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:ze("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...a})}function Qf({className:e,...r}){return d.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:ze("flex w-full min-w-0 flex-col gap-1",e),...r})}function Wf({className:e,...r}){return d.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:ze("group/menu-item relative",e),...r})}const SR=Bc("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function Jf({asChild:e=!1,isActive:r=!1,variant:a="default",size:i="default",tooltip:s,className:o,...u}){const f=e?Hc:"button",{isMobile:h,state:m}=ou(),y=d.jsx(f,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":i,"data-active":r,className:ze(SR({variant:a,size:i}),o),...u});return s?(typeof s=="string"&&(s={children:s}),d.jsxs(rR,{children:[d.jsx(aR,{asChild:!0,children:y}),d.jsx(iR,{side:"right",align:"center",hidden:m!=="collapsed"||h,...s})]})):y}const kR=[{page:"chat",label:"AI Chat",icon:o5},{page:"skills",label:"Skills",icon:aS},{page:"jobs",label:"Jobs",icon:u4},{page:"settings",label:"Settings",icon:Om}];function _R({activePage:e,onNavigate:r,...a}){return d.jsxs(hR,{collapsible:"icon",...a,children:[d.jsx(yR,{children:d.jsx(Qf,{children:d.jsx(Wf,{children:d.jsxs(Jf,{size:"lg",className:"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",children:[d.jsxs("div",{className:"bg-sidebar-primary text-sidebar-primary-foreground flex aspect-square size-8 items-center justify-center overflow-hidden rounded-lg p-1",children:[d.jsx("img",{src:"/logo_white.svg",alt:"",className:"size-full object-contain dark:hidden","aria-hidden":!0}),d.jsx("img",{src:"/logo_white.svg",alt:"",className:"size-full object-contain hidden dark:block","aria-hidden":!0})]}),d.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[d.jsx("span",{className:"truncate font-semibold",children:"Sulala Agent"}),d.jsx("span",{className:"truncate text-xs text-muted-foreground",children:"Local AI orchestration"})]})]})})})}),d.jsx(vR,{children:d.jsxs(bR,{children:[d.jsx(wR,{children:"Main"}),d.jsx(Qf,{children:kR.map(i=>d.jsx(Wf,{children:d.jsxs(Jf,{tooltip:i.label,isActive:e===i.page,onClick:()=>r(i.page),children:[d.jsx(i.icon,{className:"size-4"}),d.jsx("span",{children:i.label})]})},i.page))})]})}),d.jsx(xR,{children:d.jsx(Qf,{children:d.jsx(Wf,{children:d.jsx(Jf,{size:"lg",className:"text-muted-foreground cursor-default",children:d.jsx("span",{className:"truncate text-xs",children:"127.0.0.1"})})})})}),d.jsx(pR,{})]})}const pS="sulala-theme";function jR(){if(typeof window>"u")return"light";const e=localStorage.getItem(pS);return e==="dark"||e==="light"?e:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function CR(e){if(typeof document>"u")return;const r=document.documentElement;e==="dark"?r.classList.add("dark"):r.classList.remove("dark")}function ER(){const[e,r]=j.useState(jR);return j.useEffect(()=>{CR(e),localStorage.setItem(pS,e)},[e]),{theme:e,setTheme:s=>{r(o=>typeof s=="function"?s(o):s)},toggle:()=>r(s=>s==="dark"?"light":"dark")}}function NR({activePage:e,onNavigate:r,error:a,children:i}){const{theme:s,toggle:o}=ER();return d.jsxs(fR,{children:[d.jsx(_R,{activePage:e,onNavigate:r}),d.jsxs(gR,{children:[d.jsxs("header",{className:"flex h-14 shrink-0 items-center gap-2 border-b px-4",children:[d.jsx(mR,{className:"-ml-1"}),d.jsx("div",{className:"flex-1"}),d.jsx(je,{variant:"outline",size:"sm",onClick:o,"aria-label":"Toggle theme",children:s==="dark"?"Light":"Dark"})]}),d.jsxs("div",{className:"flex flex-1 flex-col gap-4 p-4 md:p-6 w-full",children:[a&&d.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/10 px-4 py-2 text-sm text-destructive",children:a}),i]})]})]})}const Re="http://localhost:2026".trim?.()||(typeof window<"u"?window.location.origin:"http://127.0.0.1:2026"),ib="https://hub.sulala.ai".trim?.()||null;function Ie(e={}){return{"Content-Type":"application/json",...e}}async function gS(){const e=await fetch(`${Re}/api/schedules`,{headers:Ie()});if(!e.ok)throw new Error(`Failed to fetch schedules: ${e.status}`);return e.json()}async function yS(e){const r=await fetch(`${Re}/api/schedules`,{method:"POST",headers:Ie(),body:JSON.stringify(e)});if(!r.ok){const a=await r.json().catch(()=>({}));throw new Error(a.error||`Create schedule failed: ${r.status}`)}return r.json()}async function xS(e){const r=await fetch(`${Re}/api/jobs/parse`,{method:"POST",headers:Ie(),body:JSON.stringify(e)});if(!r.ok){const a=await r.json().catch(()=>({}));throw new Error(a.error||`Parse failed: ${r.status}`)}return r.json()}async function vS(e,r){const a=await fetch(`${Re}/api/schedules/${encodeURIComponent(e)}`,{method:"PATCH",headers:Ie(),body:JSON.stringify(r)});if(!a.ok){const i=await a.json().catch(()=>({}));throw new Error(i.error||`Update schedule failed: ${a.status}`)}return a.json()}async function bS(e){const r=await fetch(`${Re}/api/schedules/${encodeURIComponent(e)}`,{method:"DELETE",headers:Ie()});if(!r.ok){const a=await r.json().catch(()=>({}));throw new Error(a.error||`Delete schedule failed: ${r.status}`)}}async function wS(e){const r=await fetch(`${Re}/api/schedules/${encodeURIComponent(e)}/run`,{method:"POST",headers:Ie()});if(!r.ok){const a=await r.json().catch(()=>({}));throw new Error(a.error||`Run job failed: ${r.status}`)}return r.json()}async function cu(){const e=await fetch(`${Re}/api/channels/telegram`,{headers:Ie()});if(!e.ok){const r=await e.json().catch(()=>({}));throw new Error(r.error||`Fetch Telegram channel failed: ${e.status}`)}return e.json()}async function SS(e){const r=await fetch(`${Re}/api/channels/telegram`,{method:"PUT",headers:Ie(),body:JSON.stringify(e)});if(!r.ok){const a=await r.json().catch(()=>({}));throw new Error(a.error||`Update Telegram channel failed: ${r.status}`)}return r.json()}async function kS(){const e=await fetch(`${Re}/api/channels/discord`,{headers:Ie()});if(!e.ok){const r=await e.json().catch(()=>({}));throw new Error(r.error||`Fetch Discord channel failed: ${e.status}`)}return e.json()}async function _S(e){const r=await fetch(`${Re}/api/channels/discord`,{method:"PUT",headers:Ie(),body:JSON.stringify(e)});if(!r.ok){const a=await r.json().catch(()=>({}));throw new Error(a.error||`Update Discord channel failed: ${r.status}`)}return r.json()}async function jS(e,r=30){const a=await fetch(`${Re}/api/schedules/${encodeURIComponent(e)}/runs?limit=${r}`,{headers:Ie()});if(!a.ok){const i=await a.json().catch(()=>({}));throw new Error(i.error||`Fetch runs failed: ${a.status}`)}return a.json()}async function zm(){const e=await fetch(`${Re}/api/onboard/status`,{headers:Ie()});return e.ok?e.json():{complete:!1}}async function CS(){const e=await fetch(`${Re}/api/onboard/complete`,{method:"PUT",headers:Ie()});if(!e.ok)throw new Error(`Failed to complete onboarding: ${e.status}`);return e.json()}async function va(){const e=await fetch(`${Re}/api/onboard/env`,{headers:Ie()});return e.ok?e.json():{keys:{}}}async function uu(e){const r=await fetch(`${Re}/api/onboard/env`,{method:"PUT",headers:Ie(),body:JSON.stringify(e)});if(!r.ok)throw new Error(`Failed to save API keys: ${r.status}`);return r.json()}async function ES(){const e=await fetch(`${Re}/api/onboard/recommended-models`,{headers:Ie()});return e.ok?e.json():{models:[]}}async function NS(e){const r=await fetch(`${Re}/api/ollama/pull`,{method:"POST",headers:Ie(),body:JSON.stringify({model:e})});if(!r.ok)throw new Error(`Failed to pull model: ${r.status}`);return r.json()}async function AS(){const e=await fetch(`${Re}/health`,{headers:Ie()});if(!e.ok)throw new Error(`Gateway health check failed: ${e.status}`);return e.json()}async function TS(e=50){const r=await fetch(`${Re}/api/tasks?limit=${e}`,{headers:Ie()});if(!r.ok)throw new Error(`Failed to fetch tasks: ${r.status}`);return r.json()}async function RS(e=100){const r=await fetch(`${Re}/api/logs?limit=${e}`,{headers:Ie()});if(!r.ok)throw new Error(`Failed to fetch logs: ${r.status}`);return r.json()}async function OS(e=200){const r=await fetch(`${Re}/api/file-states?limit=${e}`,{headers:Ie()});if(!r.ok)throw new Error(`Failed to fetch file states: ${r.status}`);return r.json()}async function zS(e){const r=await fetch(`${Re}/api/tasks`,{method:"POST",headers:Ie(),body:JSON.stringify(e)});if(!r.ok){const a=await r.json().catch(()=>({}));throw new Error(a.error||`Failed to enqueue task: ${r.status}`)}return r.json()}function MS(){const e=new URL(Re);return e.protocol=e.protocol==="https:"?"wss:":"ws:",`${e.origin}/ws`}async function Ls(e){const r=await fetch(`${Re}/api/agent/models?provider=${encodeURIComponent(e)}`,{headers:Ie()});if(!r.ok)throw new Error(`Failed to fetch models: ${r.status}`);return r.json()}async function DS(e){const r=e?`?session_id=${encodeURIComponent(e)}`:"",a=await fetch(`${Re}/api/agent/pending-actions${r}`,{headers:Ie()});if(!a.ok)throw new Error(`Failed to fetch pending actions: ${a.status}`);return a.json()}async function LS(e){const r=await fetch(`${Re}/api/agent/pending-actions/${encodeURIComponent(e)}/approve`,{method:"POST",headers:Ie()});if(!r.ok)throw new Error(`Failed to approve: ${r.status}`);return r.json()}async function IS(e){const r=await fetch(`${Re}/api/agent/pending-actions/${encodeURIComponent(e)}/reject`,{method:"POST",headers:Ie()});if(!r.ok)throw new Error(`Failed to reject: ${r.status}`);return r.json()}async function sl(){const e=await fetch(`${Re}/api/config`,{headers:Ie(),cache:"no-store"});if(!e.ok)throw new Error(`Failed to fetch config: ${e.status}`);return e.json()}async function Mm(){const e=await fetch(`${Re}/api/mcp/config`,{headers:Ie(),cache:"no-store"});if(!e.ok){const r=await e.json().catch(()=>({}));throw new Error(r.error||`Failed to fetch MCP config: ${e.status}`)}return e.json()}async function Mh(e){const r=await fetch(`${Re}/api/mcp/config`,{method:"PUT",headers:Ie(),body:JSON.stringify({servers:e})});if(!r.ok){const a=await r.json().catch(()=>({}));throw new Error(a.error||`Failed to save MCP config: ${r.status}`)}return r.json()}async function PS(){const e=await fetch(`${Re}/api/mcp/reload`,{method:"POST",headers:Ie()});if(!e.ok){const r=await e.json().catch(()=>({}));throw new Error(r.error||`Failed to reload MCP config: ${e.status}`)}return e.json()}async function zc(){const e=await fetch(`${Re}/api/settings/job-default`,{headers:Ie()});if(!e.ok)throw new Error(`Failed to fetch job default: ${e.status}`);return e.json()}async function US(e){const r=await fetch(`${Re}/api/settings/job-default`,{method:"PUT",headers:Ie(),body:JSON.stringify(e)});if(!r.ok)throw new Error(`Failed to update job default: ${r.status}`);return r.json()}async function rl(){const e=await fetch(`${Re}/api/ollama/status`,{headers:Ie()});return e.ok?e.json():{running:!1}}async function BS(){const e=await fetch(`${Re}/api/system/capabilities`,{headers:Ie()});return e.ok?e.json():{storageFreeBytes:null,isCloudOrContainer:!1,cloudReason:"",ollamaSuitable:!0,ollamaSuitableReason:"Check unavailable"}}async function FS(){const e=await fetch(`${Re}/api/ollama/install`,{method:"POST",headers:Ie()});if(!e.ok)throw new Error(`Install failed: ${e.status}`);return e.json()}async function HS(){const e=await fetch(`${Re}/api/ollama/pull-status`,{headers:Ie()});return e.ok?e.json():{inProgress:!1,model:"",lastLine:"",percent:0}}async function qS(e){const r=await fetch(`${Re}/api/tasks/${encodeURIComponent(e)}`,{method:"PATCH",headers:Ie(),body:JSON.stringify({action:"cancel"})});if(!r.ok){const a=await r.json().catch(()=>({}));throw new Error(a.error||`Cancel failed: ${r.status}`)}return r.json()}async function GS(e){const r=await fetch(`${Re}/api/tasks/${encodeURIComponent(e)}`,{method:"PATCH",headers:Ie(),body:JSON.stringify({action:"retry"})});if(!r.ok){const a=await r.json().catch(()=>({}));throw new Error(a.error||`Retry failed: ${r.status}`)}return r.json()}async function YS(){const e=await fetch(`${Re}/api/oauth-providers`,{headers:Ie()});if(!e.ok)throw new Error(`Failed to fetch OAuth providers: ${e.status}`);return e.json()}async function ds(){const e=await fetch(`${Re}/api/agent/skills/config`,{headers:Ie()});if(!e.ok)throw new Error(`Failed to fetch skills config: ${e.status}`);return e.json()}async function Dh(e){const r=await fetch(`${Re}/api/agent/skills/config`,{method:"PUT",headers:Ie(),body:JSON.stringify({skills:e})});if(!r.ok)throw new Error(`Failed to save skills config: ${r.status}`);return r.json()}async function $S(){const e=await fetch(`${Re}/api/agent/skills/updates`,{headers:Ie()});if(!e.ok)throw new Error(`Failed to fetch updates: ${e.status}`);return e.json()}function ti(){return ib?ib.replace(/\/$/,""):null}function Zi(){const e=ti();return e?`${e}/api/sulalahub/registry`:null}function Dm(){const e=ti();return e?`${e}/api/sulalahub/system/registry`:null}function fs(e){const r=ti();return r?`${r}/api/sulalahub/skills/${e}`:null}function Lh(e){const r=ti();return r?`${r}/skills/${encodeURIComponent(e)}`:null}async function Mc(){const e=Zi(),r=e?`${Re}/api/agent/skills/registry?url=${encodeURIComponent(e)}`:`${Re}/api/agent/skills/registry`,a=await fetch(r,{headers:Ie()});if(!a.ok){const i=await a.json().catch(()=>({}));throw new Error(i.error||`Failed to fetch registry: ${a.status}`)}return a.json()}async function Ih(){const e=Dm();if(!e)return{skills:[]};const r=`${Re}/api/agent/skills/registry?url=${encodeURIComponent(e)}`,a=await fetch(r,{headers:Ie()});if(!a.ok)throw new Error(`Failed to fetch system registry: ${a.status}`);return a.json()}async function VS(){const e=await fetch(`${Re}/api/agent/skills/update`,{method:"POST",headers:Ie()});if(!e.ok){const r=await e.json().catch(()=>({}));throw new Error(r.error||`Update failed: ${e.status}`)}return e.json()}async function KS(e,r){const a=await fetch(`${Re}/api/agent/skills/uninstall`,{method:"POST",headers:Ie(),body:JSON.stringify({slug:e,target:r})});if(!a.ok){const i=await a.json().catch(()=>({}));throw new Error(i.error||`Uninstall failed: ${a.status}`)}return a.json()}async function XS(e,r,a){const i=await fetch(`${Re}/api/agent/skills/upload`,{method:"POST",headers:Ie(),body:JSON.stringify({markdown:e,slug:r,toolsYaml:a||void 0})});if(!i.ok){const s=await i.json().catch(()=>({}));throw new Error(s.error||`Upload failed: ${i.status}`)}return i.json()}async function Lm(e,r,a){const i={slug:e,target:r},s=a?.registryUrl??(a?.system?Dm():null)??Zi()??void 0;s&&(i.registryUrl=s);const o=await fetch(`${Re}/api/agent/skills/install`,{method:"POST",headers:Ie(),body:JSON.stringify(i)});if(!o.ok){const u=await o.json().catch(()=>({}));throw new Error(u.error||`Install failed: ${o.status}`)}return o.json()}async function ZS(){const e=await fetch(`${Re}/api/agent/skills`,{headers:Ie()});if(!e.ok){const r=await e.json().catch(()=>({}));throw new Error(r.error||`Failed to fetch skills: ${e.status}`)}return e.json()}async function Ph(){const r=await(await fetch(`${Re}/api/agent/skills/publish-status`,{headers:Ie()})).json().catch(()=>({}));return{submissions:Array.isArray(r.submissions)?r.submissions:[]}}async function QS(e,r){const a=await fetch(`${Re}/api/agent/skills/publish`,{method:"POST",headers:Ie(),body:JSON.stringify({slug:e,priceIntent:r?.priceIntent??"free",intendedPriceCents:r?.intendedPriceCents})}),i=await a.json().catch(()=>({}));if(!a.ok)throw new Error(i.error||`Publish failed: ${a.status}`);return i}async function WS(){const e=await fetch(`${Re}/api/agent/skills/wizard-apps`,{headers:Ie()});if(!e.ok)throw new Error(`Failed to fetch wizard options: ${e.status}`);return e.json()}async function Uh(e){const r=await fetch(`${Re}/api/agent/skills/generate`,{method:"POST",headers:Ie(),body:JSON.stringify(e)});if(!r.ok){const a=await r.json().catch(()=>({}));throw new Error(a.error||`Generate failed: ${r.status}`)}return r.json()}async function bc(e=50){const r=await fetch(`${Re}/api/agent/sessions?limit=${encodeURIComponent(String(e))}`,{headers:Ie()});if(!r.ok){const a=await r.json().catch(()=>({}));throw new Error(a.error||`Failed to list sessions: ${r.status}`)}return r.json()}async function Bh(e){const r=await fetch(`${Re}/api/agent/sessions`,{method:"POST",headers:Ie(),body:JSON.stringify(e??{})});if(!r.ok){const a=await r.json().catch(()=>({}));throw new Error(a.error||`Failed to create session: ${r.status}`)}return r.json()}async function JS(){const e=await fetch(`${Re}/api/agent/memory/scope-keys`,{headers:Ie()});if(!e.ok){const r=await e.json().catch(()=>({}));throw new Error(r.error||`Failed to fetch memory scope keys: ${e.status}`)}return e.json()}async function ek(e){const r=new URLSearchParams;r.set("scope",e.scope),r.set("scope_key",e.scope_key),r.set("limit",String(e.limit));const a=await fetch(`${Re}/api/agent/memory?${r.toString()}`,{headers:Ie()});if(!a.ok){const i=await a.json().catch(()=>({}));throw new Error(i.error||`Failed to fetch memory: ${a.status}`)}return a.json()}async function tk(e){const r=await fetch(`${Re}/api/agent/memory/search`,{method:"POST",headers:{...Ie(),"Content-Type":"application/json"},body:JSON.stringify({query:e.query,scope:e.scope,scope_key:e.scope_key,limit:e.limit})});if(!r.ok){const a=await r.json().catch(()=>({}));throw new Error(a.error||`Memory search failed: ${r.status}`)}return r.json()}async function nk(e){const r=new URLSearchParams;r.set("scope",e.scope),r.set("scope_key",e.scope_key);const a=await fetch(`${Re}/api/agent/memory/export?${r.toString()}`,{headers:Ie()});if(!a.ok){const i=await a.json().catch(()=>({}));throw new Error(i.error||`Memory export failed: ${a.status}`)}return a.json()}async function ha(e){const r=await fetch(`${Re}/api/agent/sessions/${encodeURIComponent(e)}`,{headers:Ie()});if(!r.ok){const a=await r.json().catch(()=>({}));throw new Error(a.error||`Failed to load session: ${r.status}`)}return r.json()}async function rk(e){const r=await new Promise((i,s)=>{const o=new FileReader;o.onload=()=>{const u=o.result,f=u.includes(",")?u.slice(u.indexOf(",")+1):u;i(f)},o.onerror=()=>s(new Error("Failed to read file")),o.readAsDataURL(e)}),a=await fetch(`${Re}/api/upload`,{method:"POST",headers:Ie(),body:JSON.stringify({filename:e.name,content_type:e.type,data:r})});if(!a.ok){const i=await a.json().catch(()=>({}));throw new Error(i.error||`Upload failed: ${a.status}`)}return a.json()}async function ak(e,r){const a=`${Re}/api/agent/sessions/${encodeURIComponent(e)}/messages`;try{const i=await fetch(a,{method:"POST",headers:Ie(),body:JSON.stringify(r)});if(!i.ok){const s=await i.json().catch(()=>({}));if(i.status===422&&s.type==="missing_integrations"&&Array.isArray(s.missing)){const u=new Error(s.error||"Missing required integrations");throw u.missing=s.missing,u}const o=s.error||`Agent request failed: ${i.status}`;throw console.error("[chat] fetchAgentSendMessage failed:",i.status,a,o),new Error(o)}return i.json()}catch(i){throw console.error("[chat] fetchAgentSendMessage fetch error:",a,i),i}}async function Fh(e,r,a){const i=`${Re}/api/agent/sessions/${encodeURIComponent(e)}/messages/stream`;let s;try{s=await fetch(i,{method:"POST",headers:Ie(),body:JSON.stringify(r)})}catch(m){console.error("[chat] fetchAgentSendMessageStream fetch error:",i,m),a.onError(m instanceof Error?m.message:"Fetch failed");return}if(!s.ok){const m=await s.json().catch(()=>({}));s.status===422&&m.type==="missing_integrations"&&Array.isArray(m.missing)&&a.onMissingIntegrations?.(m.missing);const y=m.error||`Stream failed: ${s.status}`;console.error("[chat] fetchAgentSendMessageStream failed:",s.status,i,y),a.onError(y);return}const o=s.body?.getReader();if(!o){a.onError("No response body");return}const u=new TextDecoder;let f="",h="";try{for(;;){const{done:m,value:y}=await o.read();if(m)break;f+=u.decode(y,{stream:!0});const p=f.split(`
|
|
54
|
-
`);f=p.pop()??"";for(const b of p)if(b.startsWith("event:"))h=b.slice(6).trim();else if(b.startsWith("data:")&&h){try{const x=JSON.parse(b.slice(5).trim());h==="assistant"&&x.delta?a.onDelta(x.delta):h==="thinking"&&x.delta?a.onThinking?.(x.delta):h==="done"&&x.finalContent!=null?a.onDone(x.finalContent):h==="pending_approval"&&x.pendingActionId?a.onPendingApproval?.(x.pendingActionId):h==="error"&&x.message&&a.onError(x.message)}catch{}h=""}}if(f.trim()&&h&&f.startsWith("data:"))try{const m=JSON.parse(f.slice(5).trim());h==="done"&&m.finalContent!=null&&a.onDone(m.finalContent)}catch{}}finally{o.releaseLock()}}const AR=Object.freeze(Object.defineProperty({__proto__:null,GATEWAY_URL:Re,approvePendingAction:LS,createSchedule:yS,deleteSchedule:bS,enqueueTask:zS,fetchAgentMemory:ek,fetchAgentMemoryExport:nk,fetchAgentMemoryScopeKeys:JS,fetchAgentMemorySearch:tk,fetchAgentModels:Ls,fetchAgentSendMessage:ak,fetchAgentSendMessageStream:Fh,fetchAgentSession:ha,fetchAgentSessionCreate:Bh,fetchAgentSessions:bc,fetchAgentSkillGenerate:Uh,fetchAgentSkillInstall:Lm,fetchAgentSkillPublish:QS,fetchAgentSkillUninstall:KS,fetchAgentSkillUpload:XS,fetchAgentSkillWizardApps:WS,fetchAgentSkills:ZS,fetchAgentSkillsConfig:ds,fetchAgentSkillsConfigSave:Dh,fetchAgentSkillsPublishStatus:Ph,fetchAgentSkillsRegistry:Mc,fetchAgentSkillsSystemRegistry:Ih,fetchAgentSkillsUpdate:VS,fetchAgentSkillsUpdates:$S,fetchChannelsDiscord:kS,fetchChannelsTelegram:cu,fetchConfig:sl,fetchFileStates:OS,fetchHealth:AS,fetchJobDefault:zc,fetchLogs:RS,fetchMcpConfig:Mm,fetchOAuthProviders:YS,fetchOllamaPullStatus:HS,fetchOllamaStatus:rl,fetchOnboardEnv:va,fetchOnboardStatus:zm,fetchParseJobPrompt:xS,fetchPendingActions:DS,fetchRecommendedModels:ES,fetchScheduleRuns:jS,fetchSchedules:gS,fetchSystemCapabilities:BS,fetchTasks:TS,fetchUploadFile:rk,getHubBaseUrl:ti,getHubRegistryUrl:Zi,getHubSkillContentUrl:fs,getHubSkillPageUrl:Lh,getHubSystemRegistryUrl:Dm,postOllamaInstall:FS,postOllamaPull:NS,putOnboardComplete:CS,putOnboardEnv:uu,rejectPendingAction:IS,reloadMcpConfig:PS,runScheduleJob:wS,taskCancel:qS,taskRetry:GS,updateChannelsDiscord:_S,updateChannelsTelegram:SS,updateJobDefault:US,updateMcpConfig:Mh,updateSchedule:vS,wsUrl:MS},Symbol.toStringTag,{value:"Module"}));function TR(e){const[r,a]=j.useState(null),[i,s]=j.useState([]),[o,u]=j.useState([]),[f,h]=j.useState([]),[m,y]=j.useState([]),[p,b]=j.useState(!0),[x,S]=j.useState("heartbeat"),[w,_]=j.useState("{}"),[k,N]=j.useState(!1),[A,O]=j.useState(null),M=async()=>{b(!0);try{const[q,$,X,re,Y]=await Promise.all([AS(),TS(),RS(),OS(),gS()]);a(q),s($.tasks),u(X.logs),h(re.fileStates),y(Y.schedules)}catch(q){e(q instanceof Error?q.message:"Failed to load"),a(null),s([]),u([]),h([]),y([])}finally{b(!1)}},D=j.useRef(M);return D.current=M,j.useEffect(()=>{D.current()},[]),j.useEffect(()=>{const q=setInterval(()=>D.current(),3e4);return()=>clearInterval(q)},[]),{health:r,tasks:i,logs:o,fileStates:f,schedules:m,loading:p,load:M,enqueueType:x,setEnqueueType:S,enqueuePayload:w,setEnqueuePayload:_,enqueueing:k,actionTaskId:A,handleTaskCancel:async q=>{O(q);try{await qS(q),await M()}catch($){e($ instanceof Error?$.message:"Cancel failed")}finally{O(null)}},handleTaskRetry:async q=>{O(q);try{await GS(q),await M()}catch($){e($ instanceof Error?$.message:"Retry failed")}finally{O(null)}},handleEnqueue:async()=>{N(!0);try{let q=null;try{q=w.trim()?JSON.parse(w):null}catch{e("Payload must be valid JSON");return}await zS({type:x,payload:q}),await M()}catch(q){e(q instanceof Error?q.message:"Enqueue failed")}finally{N(!1)}},handleCreateSchedule:async q=>{try{await yS(q),await M()}catch($){e($ instanceof Error?$.message:"Create schedule failed")}},handleUpdateSchedule:async(q,$)=>{try{await vS(q,$),await M()}catch(X){e(X instanceof Error?X.message:"Update schedule failed")}},handleDeleteSchedule:async q=>{try{await bS(q),await M()}catch($){e($ instanceof Error?$.message:"Delete schedule failed")}},handleRunSchedule:async q=>wS(q),handleFetchScheduleRuns:async q=>jS(q)}}const RR=Bc("inline-flex items-center justify-center rounded-full border border-transparent px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",ghost:"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",link:"text-primary underline-offset-4 [a&]:hover:underline"}},defaultVariants:{variant:"default"}});function qt({className:e,variant:r="default",asChild:a=!1,...i}){const s=a?Hc:"span";return d.jsx(s,{"data-slot":"badge","data-variant":r,className:ze(RR({variant:r}),e),...i})}function St({className:e,...r}){return d.jsx("div",{"data-slot":"card",className:ze("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...r})}function At({className:e,...r}){return d.jsx("div",{"data-slot":"card-header",className:ze("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...r})}function Tt({className:e,...r}){return d.jsx("div",{"data-slot":"card-title",className:ze("leading-none font-semibold",e),...r})}function Rt({className:e,...r}){return d.jsx("div",{"data-slot":"card-description",className:ze("text-muted-foreground text-sm",e),...r})}function kt({className:e,...r}){return d.jsx("div",{"data-slot":"card-content",className:ze("px-6",e),...r})}function ol({className:e,children:r,...a}){return d.jsxs(OT,{"data-slot":"scroll-area",className:ze("relative",e),...a,children:[d.jsx(zT,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:r}),d.jsx(OR,{}),d.jsx(MT,{})]})}function OR({className:e,orientation:r="vertical",...a}){return d.jsx(pw,{"data-slot":"scroll-area-scrollbar",orientation:r,className:ze("flex touch-none p-px transition-colors select-none",r==="vertical"&&"h-full w-2.5 border-l border-l-transparent",r==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",e),...a,children:d.jsx(vw,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}function Is(e){return new Date(e).toLocaleTimeString()}function ik(e){const r=new Date(e),a=new Date;return r.getDate()===a.getDate()&&r.getMonth()===a.getMonth()&&r.getFullYear()===a.getFullYear()?r.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):r.toLocaleDateString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function zR({event:e}){return e.type==="connected"||e.type==="pong"?d.jsxs("div",{className:"text-muted-foreground text-sm",children:[e.type," @ ",Is(e.ts)]}):e.type==="file_event"?d.jsxs("div",{className:"rounded border bg-muted/30 px-2 py-1 text-sm",children:[d.jsx("span",{className:"font-medium",children:e.payload.event})," ",d.jsx("span",{className:"text-muted-foreground break-all",children:e.payload.path})]}):e.type==="task_done"?d.jsxs("div",{className:"text-sm",children:["Task done: ",d.jsx("span",{className:"font-mono text-xs",children:e.taskId})]}):null}function MR({health:e,loading:r,connected:a,events:i}){return d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[d.jsxs(St,{children:[d.jsxs(At,{children:[d.jsx(Tt,{className:"text-base",children:"Gateway"}),d.jsx(Rt,{children:"API server status"})]}),d.jsx(kt,{className:"flex items-center gap-2",children:r?d.jsx("span",{className:"text-muted-foreground text-sm",children:"Checking…"}):e?d.jsx(qt,{variant:"default",children:e.status}):d.jsx(qt,{variant:"destructive",children:"Unreachable"})})]}),d.jsxs(St,{children:[d.jsxs(At,{children:[d.jsx(Tt,{className:"text-base",children:"WebSocket"}),d.jsx(Rt,{children:"Live event stream"})]}),d.jsx(kt,{className:"flex items-center gap-2",children:d.jsx(qt,{variant:a?"default":"secondary",children:a?"Connected":"Disconnected"})})]})]}),d.jsxs(St,{children:[d.jsxs(At,{children:[d.jsx(Tt,{className:"text-base",children:"Live events"}),d.jsx(Rt,{children:"File and task events from the gateway"})]}),d.jsx(kt,{children:d.jsx(ol,{className:"h-[280px] rounded-md border p-3",children:d.jsx("div",{className:"space-y-2",children:i.length===0?d.jsx("p",{className:"text-muted-foreground text-sm",children:"No events yet. Change a file in a watched folder or run a task."}):i.map((s,o)=>d.jsx(zR,{event:s},o))})})})]})]})}function DR(e){const[r,a]=j.useState([]),[i,s]=j.useState(!1),[o,u]=j.useState(""),[f,h]=j.useState([]),[m,y]=j.useState(!1),[p,b]=j.useState([]),[x,S]=j.useState(!1),[w,_]=j.useState(null),[k,N]=j.useState(!1),[A,O]=j.useState(null),[M,D]=j.useState(null),[B,V]=j.useState(!1),[K,U]=j.useState(null),[te,I]=j.useState("~/.sulala/config.json"),[Z,E]=j.useState(new Set),[q,$]=j.useState("installed"),[X,re]=j.useState({}),[Y,z]=j.useState({}),[R,F]=j.useState([]),L=()=>{s(!0),ZS().then(ie=>a(ie.skills||[])).catch(()=>a([])).finally(()=>s(!1))},le=()=>{L(),y(!0),S(!0),ds().then(ie=>{U(ie.skills??null),ie.configPath&&I(ie.configPath)}).catch(()=>U(null)),$S().then(ie=>E(new Set(ie.updates.map(Q=>Q.slug)))).catch(()=>E(new Set)),Promise.all([Mc().then(ie=>h(ie.skills||[])).catch(()=>h([])),Ih().then(ie=>b(ie.skills||[])).catch(()=>b([]))]).finally(()=>{y(!1),S(!1)}),Ph().then(ie=>{const Q={};for(const G of ie.submissions)Q[G.slug]=G.status;z(Q)}).catch(()=>z({})),YS().then(ie=>F(ie.providers||[])).catch(()=>F([]))},oe=(ie,Q,G)=>{const H={};for(const J of Q){const ye=ie[J]??G?.[J];typeof ye=="string"&&ye.trim()||(H[J]=`Required (${J})`)}return{valid:Object.keys(H).length===0,errors:H}};return{skills:r,skillsLoading:i,skillsSearch:o,setSkillsSearch:u,registrySkills:f,registryLoading:m,systemRegistrySkills:p,systemRegistryLoading:x,installingSlug:w,uploadingSkill:k,publishingSlug:A,selectedHubSkill:M,setSelectedHubSkill:D,skillsUpdating:B,skillsConfig:K,skillsConfigPath:te,skillsUpdates:Z,skillsTab:q,setSkillsTab:$,visibleSecretKeys:X,setVisibleSecretKeys:re,loadSkills:L,loadSkillsData:le,handleSkillConfigToggle:async(ie,Q)=>{const G=K?.entries?.[ie]??{},H={...K,entries:{...K?.entries,[ie]:{...G,enabled:Q}}};U(H);try{const J=await Dh(H);J.configPath&&I(J.configPath),L()}catch(J){e(J instanceof Error?J.message:"Failed to save config")}},handleSkillEntryUpdate:(ie,Q)=>{const G=K?.entries?.[ie]??{};U({...K,entries:{...K?.entries,[ie]:{...G,...Q}}})},handleSkillEntrySave:async(ie,Q,G)=>{if(K){if(ie&&Q?.length){const H=K?.entries?.[ie]??{},{valid:J,errors:ye}=oe(H,Q,G);if(!J){e(`Set required values: ${Object.keys(ye).join(", ")}`);return}}try{await Dh(K),e(null)}catch(H){e(H instanceof Error?H.message:"Failed to save config")}}},handleInstallSkill:async(ie,Q)=>{_(ie);try{await Lm(ie,Q,{system:ie.startsWith("system-")}),L();const G=await ds();U(G.skills??null),G.configPath&&I(G.configPath)}catch(G){e(G instanceof Error?G.message:"Install failed")}finally{_(null)}},handleUploadSkill:async(ie,Q,G)=>{N(!0);try{await XS(ie,Q,G),L();const H=await ds();U(H.skills??null),H.configPath&&I(H.configPath)}catch(H){throw e(H instanceof Error?H.message:"Upload failed"),H}finally{N(!1)}},handleUninstallSkill:async(ie,Q)=>{const G=Q==="user"?"user":"managed";try{await KS(ie,G),L();const H=await ds();U(H.skills??null),H.configPath&&I(H.configPath)}catch(H){e(H instanceof Error?H.message:"Uninstall failed")}},handlePublishSkill:async(ie,Q)=>{O(ie);try{await QS(ie,Q),e(""),Ph().then(G=>{const H={};for(const J of G.submissions)H[J.slug]=J.status;z(H)}).catch(()=>{})}catch(G){throw e(G instanceof Error?G.message:"Publish failed"),G}finally{O(null)}},handleUpdateSkills:async()=>{V(!0);try{const ie=await VS();L(),ie.failed.length>0&&e(`Update failed: ${ie.failed.map(Q=>Q.slug).join(", ")}`)}catch(ie){e(ie instanceof Error?ie.message:"Update failed")}finally{V(!1)}},refreshRegistry:()=>{y(!0),S(!0),Promise.all([Mc().then(ie=>h(ie.skills||[])).catch(()=>h([])),Ih().then(ie=>b(ie.skills||[])).catch(()=>b([]))]).finally(()=>{y(!1),S(!1)})},validateSkillEnvConfig:oe,publishStatusMap:Y,oauthProviders:R}}function Im({className:e,orientation:r="horizontal",...a}){return d.jsx(IT,{"data-slot":"tabs","data-orientation":r,orientation:r,className:ze("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",e),...a})}const LR=Bc("rounded-lg p-[3px] group-data-[orientation=horizontal]/tabs:h-9 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function Pm({className:e,variant:r="default",...a}){return d.jsx(PT,{"data-slot":"tabs-list","data-variant":r,className:ze(LR({variant:r}),e),...a})}function Qi({className:e,...r}){return d.jsx(UT,{"data-slot":"tabs-trigger",className:ze("focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent","data-[state=active]:bg-background dark:data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 data-[state=active]:text-foreground","after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",e),...r})}function on({className:e,...r}){return d.jsx(BT,{"data-slot":"tabs-content",className:ze("flex-1 outline-none",e),...r})}function Ya({...e}){return d.jsx(G0,{"data-slot":"dialog",...e})}function IR({...e}){return d.jsx(Y0,{"data-slot":"dialog-portal",...e})}function PR({className:e,...r}){return d.jsx($0,{"data-slot":"dialog-overlay",className:ze("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...r})}function $a({className:e,children:r,showCloseButton:a=!0,...i}){return d.jsxs(IR,{children:[d.jsx(PR,{}),d.jsxs(V0,{"data-slot":"dialog-content",className:ze("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg max-h-[90vh] overflow-y-auto",e),...i,children:[r,a&&d.jsxs(Z0,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[d.jsx(ms,{className:"size-4"}),d.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Va({className:e,...r}){return d.jsx("div",{"data-slot":"dialog-header",className:ze("flex flex-col gap-1.5 text-left",e),...r})}function Ka({className:e,...r}){return d.jsx("div",{"data-slot":"dialog-footer",className:ze("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...r})}function Xa({className:e,...r}){return d.jsx(K0,{"data-slot":"dialog-title",className:ze("text-foreground font-semibold text-lg",e),...r})}function Za({className:e,...r}){return d.jsx(X0,{"data-slot":"dialog-description",className:ze("text-muted-foreground text-sm",e),...r})}function Um({...e}){return d.jsx(pT,{"data-slot":"dropdown-menu",...e})}function Bm({...e}){return d.jsx(gT,{"data-slot":"dropdown-menu-trigger",...e})}function Fm({className:e,sideOffset:r=4,...a}){return d.jsx(yT,{children:d.jsx(xT,{"data-slot":"dropdown-menu-content",sideOffset:r,className:ze("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...a})})}function ma({className:e,inset:r,variant:a="default",...i}){return d.jsx(vT,{"data-slot":"dropdown-menu-item","data-inset":r,"data-variant":a,className:ze("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...i})}const lk=j.forwardRef(({className:e,orientation:r="vertical",...a},i)=>d.jsx("div",{ref:i,role:"group","data-slot":"field",className:ze(r==="horizontal"?"flex flex-row items-center gap-2":"flex flex-col gap-1.5",e),...a}));lk.displayName="Field";function UR({className:e,...r}){return d.jsx("label",{"data-slot":"field-label",className:ze("text-foreground text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...r})}function BR({className:e,...r}){return d.jsx("p",{"data-slot":"field-description",className:ze("text-muted-foreground text-xs",e),...r})}function FR({className:e,...r}){return d.jsx("p",{"data-slot":"field-error",role:"alert",className:ze("text-destructive text-xs",e),...r})}function Mt({className:e,...r}){return d.jsx("label",{"data-slot":"label",className:ze("text-foreground text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...r})}function Hm({className:e,value:r=0,...a}){return d.jsx("div",{role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":r,"data-slot":"progress",className:ze("bg-primary/20 relative h-2 w-full overflow-hidden rounded-full",e),...a,children:d.jsx("div",{className:"bg-primary h-full rounded-full transition-[width]",style:{width:`${Math.min(100,Math.max(0,r))}%`}})})}const hs=["What should this skill do?","Which app to connect?","When should it run?","Review & create"],eh=`# Optional: add tool definitions for this skill.
|
|
55
|
-
# Schema: tools[].name, description, profile, auth, request (method, url, queryParams, bodyType, bodyKeys), parameters, response.
|
|
56
|
-
tools: []
|
|
57
|
-
`;function HR(e){const[r,a]=j.useState({step:0,goal:"",app:"other",trigger:"manual",apps:[],triggers:[],spec:null,editableReadme:"",editableToolsYaml:eh,loading:!1,error:null}),i=j.useCallback(async()=>{try{const{apps:x,triggers:S}=await WS();a(w=>({...w,apps:x,triggers:S}))}catch(x){a(S=>({...S,error:x instanceof Error?x.message:"Failed to load options"}))}},[]);j.useEffect(()=>{i()},[i]);const s=j.useCallback(x=>{a(S=>({...S,step:Math.max(0,Math.min(x,hs.length-1)),error:null}))},[]),o=j.useCallback(x=>{a(S=>({...S,goal:x}))},[]),u=j.useCallback(x=>{a(S=>({...S,app:x}))},[]),f=j.useCallback(x=>{a(S=>({...S,trigger:x}))},[]),h=j.useCallback(async()=>{a(x=>({...x,loading:!0,error:null}));try{const{spec:x}=await Uh({goal:r.goal,app:r.app,trigger:r.trigger,write:!1});return a(S=>({...S,spec:x,editableReadme:x?x.frontmatter+x.body:"",editableToolsYaml:eh,loading:!1})),x}catch(x){return a(S=>({...S,loading:!1,error:x instanceof Error?x.message:"Failed to generate preview"})),null}},[r.goal,r.app,r.trigger]),m=j.useCallback(x=>{a(S=>({...S,editableReadme:x}))},[]),y=j.useCallback(x=>{a(S=>({...S,editableToolsYaml:x}))},[]),p=j.useCallback(async()=>{a(x=>({...x,loading:!0,error:null}));try{const x=await Uh({goal:r.goal,app:r.app,trigger:r.trigger,write:!0,markdown:r.editableReadme.trim()||void 0,toolsYaml:r.editableToolsYaml.trim()||void 0});return a(S=>({...S,loading:!1})),e?.(),x}catch(x){return a(S=>({...S,loading:!1,error:x instanceof Error?x.message:"Failed to create skill"})),null}},[r.goal,r.app,r.trigger,r.editableReadme,r.editableToolsYaml,e]),b=j.useCallback(()=>{a({step:0,goal:"",app:"other",trigger:"manual",apps:r.apps,triggers:r.triggers,spec:null,editableReadme:"",editableToolsYaml:eh,loading:!1,error:null})},[r.apps,r.triggers]);return{state:r,setStep:s,setGoal:o,setApp:u,setTrigger:f,setEditableReadme:m,setEditableToolsYaml:y,generatePreview:h,createSkill:p,loadApps:i,reset:b}}const sk=j.createContext(null);function du(){const e=j.useContext(sk);if(!e)throw new Error("SkillWizardFlow must wrap steps");return e}function qR(){const{state:e,setGoal:r,setStep:a}=du();return d.jsxs("div",{className:"space-y-6",children:[d.jsx("p",{className:"text-muted-foreground text-sm",children:'Describe what you want this agent to do. For example: "Summarize my important emails daily" or "Post updates to Slack when I deploy."'}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Mt,{htmlFor:"wizard-goal",children:"What should this skill do?"}),d.jsx("textarea",{id:"wizard-goal",placeholder:"e.g. Check Gmail and summarize important emails daily",value:e.goal,onChange:i=>r(i.target.value),rows:4,className:ze("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 w-full min-w-0 rounded-md border bg-transparent px-3 py-2 text-sm shadow-xs outline-none focus-visible:ring-[3px] resize-none")})]}),d.jsx("div",{className:"flex justify-end",children:d.jsxs(je,{onClick:()=>a(1),disabled:!e.goal.trim(),children:["Next",d.jsx(Ga,{className:"ml-1 size-4"})]})})]})}function GR(){const{state:e,setApp:r,setStep:a}=du(),i=e.apps.length?e.apps:[{id:"gmail",label:"Gmail",envHint:"API key or connect later"},{id:"slack",label:"Slack",envHint:"Token or connect later"},{id:"notion",label:"Notion",envHint:"API key or connect later"},{id:"github",label:"GitHub",envHint:"Token or connect later"},{id:"calendar",label:"Google Calendar",envHint:"Credentials or connect later"},{id:"webhook",label:"Webhook",envHint:"Optional"},{id:"other",label:"Other",envHint:"Depends on skill"}];return d.jsxs("div",{className:"space-y-6",children:[d.jsx("p",{className:"text-muted-foreground text-sm",children:"Choose the app or service this skill will use. You can add API keys or connect the app later on the Skills page."}),d.jsx("div",{className:"grid gap-2",children:i.map(s=>d.jsxs("label",{className:`border-input flex cursor-pointer items-center gap-3 rounded-lg border p-3 transition-colors hover:bg-muted/50 ${e.app===s.id?"border-primary bg-muted/50":""}`,children:[d.jsx("input",{type:"radio",name:"wizard-app",value:s.id,checked:e.app===s.id,onChange:()=>r(s.id),className:"size-4"}),d.jsxs("div",{className:"flex-1",children:[d.jsx("span",{className:"font-medium",children:s.label}),d.jsxs("span",{className:"text-muted-foreground ml-2 text-xs",children:["(",s.envHint,")"]})]})]},s.id))}),d.jsxs("div",{className:"flex justify-between",children:[d.jsxs(je,{variant:"outline",onClick:()=>a(0),children:[d.jsx(Tm,{className:"mr-1 size-4"}),"Back"]}),d.jsxs(je,{onClick:()=>a(2),children:["Next",d.jsx(Ga,{className:"ml-1 size-4"})]})]})]})}function YR(){const{state:e,setTrigger:r,setStep:a,generatePreview:i}=du(),s=e.triggers.length?e.triggers:[{id:"manual",label:"When I ask (manual)"},{id:"schedule",label:"On a schedule (cron)"},{id:"webhook",label:"When a webhook is called"},{id:"message",label:"When I send a message (e.g. Telegram)"}];return d.jsxs("div",{className:"space-y-6",children:[d.jsx("p",{className:"text-muted-foreground text-sm",children:"When should this skill run? You can configure schedules or webhooks later in Jobs."}),d.jsx("div",{className:"grid gap-2",children:s.map(o=>d.jsxs("label",{className:`border-input flex cursor-pointer items-center gap-3 rounded-lg border p-3 transition-colors hover:bg-muted/50 ${e.trigger===o.id?"border-primary bg-muted/50":""}`,children:[d.jsx("input",{type:"radio",name:"wizard-trigger",value:o.id,checked:e.trigger===o.id,onChange:()=>r(o.id),className:"size-4"}),d.jsx("span",{className:"font-medium",children:o.label})]},o.id))}),d.jsxs("div",{className:"flex justify-between",children:[d.jsxs(je,{variant:"outline",onClick:()=>a(1),children:[d.jsx(Tm,{className:"mr-1 size-4"}),"Back"]}),d.jsxs(je,{onClick:async()=>{await i(),a(3)},disabled:e.loading,children:[e.loading?"Generating…":"Review",d.jsx(Ga,{className:"ml-1 size-4"})]})]})]})}function $R(){const{state:e,setStep:r,createSkill:a,setEditableReadme:i,setEditableToolsYaml:s}=du(),o=e.spec,u=async()=>{(await a())?.written};return!o&&!e.loading?d.jsxs("div",{className:"space-y-4",children:[d.jsx("p",{className:"text-muted-foreground text-sm",children:"Preview not loaded. Go back and click Review again."}),d.jsx(je,{variant:"outline",onClick:()=>r(2),children:"Back"})]}):d.jsxs("div",{className:"space-y-4",children:[o&&d.jsxs("div",{className:"rounded-lg border bg-muted/30 p-3 space-y-1",children:[d.jsx("div",{className:"font-medium text-sm",children:o.name}),d.jsxs("div",{className:"text-muted-foreground text-xs",children:["Slug: ",d.jsx("code",{className:"rounded bg-muted px-1",children:o.slug}),o.requiredEnv.length>0&&d.jsxs(d.Fragment,{children:[" · Required: ",o.requiredEnv.join(", ")]})]})]}),d.jsx("p",{className:"text-muted-foreground text-xs",children:"Edit the README and tools below if you want, then click Create. The skill will be saved under My skills."}),d.jsxs(Im,{defaultValue:"readme",className:"w-full",children:[d.jsxs(Pm,{className:"grid w-full grid-cols-2",children:[d.jsx(Qi,{value:"readme",children:"README.md"}),d.jsx(Qi,{value:"tools",children:"tools.yaml"})]}),d.jsxs(on,{value:"readme",className:"mt-2",children:[d.jsx(Mt,{htmlFor:"wizard-readme",className:"sr-only",children:"Skill README"}),d.jsx("textarea",{id:"wizard-readme",value:e.editableReadme,onChange:f=>i(f.target.value),rows:10,className:ze("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 w-full min-w-0 rounded-md border bg-transparent px-3 py-2 text-sm font-mono shadow-xs outline-none focus-visible:ring-[3px] resize-y"),placeholder:"README content (frontmatter + body)"})]}),d.jsxs(on,{value:"tools",className:"mt-2",children:[d.jsx(Mt,{htmlFor:"wizard-tools",className:"sr-only",children:"tools.yaml"}),d.jsx("textarea",{id:"wizard-tools",value:e.editableToolsYaml,onChange:f=>s(f.target.value),rows:8,className:ze("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 w-full min-w-0 rounded-md border bg-transparent px-3 py-2 text-sm font-mono shadow-xs outline-none focus-visible:ring-[3px] resize-y"),placeholder:"tools: []"})]})]}),e.error&&d.jsx("p",{className:"text-destructive text-sm",children:e.error}),d.jsxs("div",{className:"flex justify-between pt-1",children:[d.jsxs(je,{variant:"outline",onClick:()=>r(2),children:[d.jsx(Tm,{className:"mr-1 size-4"}),"Back"]}),d.jsx(je,{onClick:u,disabled:e.loading,children:e.loading?"Creating…":"Create skill"})]})]})}function VR({open:e,onOpenChange:r,onSuccess:a}){const i=HR(()=>{a?.(),r(!1),i.reset()}),{state:s}=i,o=Math.max(0,Math.min(s.step,hs.length-1));return d.jsx(sk.Provider,{value:i,children:d.jsx(Ya,{open:e,onOpenChange:r,children:d.jsxs($a,{className:"w-full max-w-lg sm:max-w-xl",showCloseButton:!0,children:[d.jsxs(Va,{className:"space-y-2 pb-4 border-b",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"bg-primary/10 text-primary flex size-10 shrink-0 items-center justify-center rounded-lg",children:d.jsx(fS,{className:"size-5"})}),d.jsxs("div",{children:[d.jsx(Xa,{children:"Create a skill"}),d.jsxs(Za,{children:["Step ",o+1," of ",hs.length,": ",hs[o]]})]})]}),d.jsx(Hm,{value:(o+1)/hs.length*100,className:"h-2"})]}),d.jsxs("div",{className:"pt-4",children:[s.error&&d.jsx("div",{className:"mb-4 rounded-lg border border-destructive/50 bg-destructive/10 p-3 text-sm text-destructive",children:s.error}),o===0&&d.jsx(qR,{}),o===1&&d.jsx(GR,{}),o===2&&d.jsx(YR,{}),o===3&&d.jsx($R,{})]})]})})})}function KR(e){const[r,a]=j.useState(!1),[i,s]=j.useState(!1),[o,u]=j.useState(null),{skills:f,skillsLoading:h,skillsSearch:m,setSkillsSearch:y,registrySkills:p,registryLoading:b,systemRegistrySkills:x,systemRegistryLoading:S,installingSlug:w,uploadingSkill:_,publishingSlug:k,selectedHubSkill:N,setSelectedHubSkill:A,skillsUpdating:O,skillsConfig:M,skillsConfigPath:D,skillsUpdates:B,skillsTab:V,setSkillsTab:K,visibleSecretKeys:U,setVisibleSecretKeys:te,loadSkills:I,handleSkillConfigToggle:Z,handleSkillEntryUpdate:E,handleSkillEntrySave:q,handleInstallSkill:$,handleUploadSkill:X,handleUninstallSkill:re,handlePublishSkill:Y,handleUpdateSkills:z,refreshRegistry:R,validateSkillEnvConfig:F,publishStatusMap:L,oauthProviders:le,onNavigateToSettings:oe}=e;return d.jsxs(d.Fragment,{children:[d.jsxs(St,{children:[d.jsxs(At,{className:"flex flex-row flex-wrap items-center justify-between gap-2",children:[d.jsxs("div",{children:[d.jsx(Tt,{className:"text-base",children:"Skills"}),d.jsxs(Rt,{children:["Config: ",D]})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs(je,{variant:"default",size:"sm",onClick:()=>a(!0),children:[d.jsx(dS,{className:"mr-1 size-4"}),"Create skill"]}),d.jsxs(je,{variant:"outline",size:"sm",onClick:()=>s(!0),children:[d.jsx(F5,{className:"mr-1 size-4"}),"Upload skill"]}),d.jsx("input",{className:"border-input bg-background h-9 w-48 rounded-md border px-3 text-sm placeholder:text-muted-foreground",placeholder:"Search…",value:m,onChange:ve=>y(ve.target.value)}),V==="installed"||V==="myskills"?d.jsxs(d.Fragment,{children:[d.jsx(je,{variant:"outline",size:"sm",onClick:I,disabled:h,children:h?"…":"Refresh"}),V==="installed"&&d.jsx(je,{variant:"secondary",size:"sm",onClick:z,disabled:O,children:O?"…":"Update all"})]}):d.jsx(je,{variant:"outline",size:"sm",onClick:R,disabled:b,children:b?"…":"Refresh"})]})]}),d.jsxs(kt,{children:[oe&&d.jsxs("p",{className:"text-muted-foreground text-sm mb-3",children:["Using an MCP server?"," ",d.jsx(je,{variant:"link",className:"h-auto p-0 text-sm font-normal",onClick:oe,children:"Configure it in Settings → MCP servers"})]}),d.jsxs(Im,{value:V,onValueChange:ve=>K(ve),children:[d.jsxs(Pm,{className:"mb-4",children:[d.jsx(Qi,{value:"installed",children:"Installed"}),d.jsx(Qi,{value:"myskills",children:"My skills"}),d.jsx(Qi,{value:"hub",children:"From Hub"})]}),d.jsx(on,{value:"installed",className:"mt-0",children:d.jsx(lb,{skills:f,skillsLoading:h,skillsSearch:m,skillsConfig:M,skillsUpdates:B,visibleSecretKeys:U,setVisibleSecretKeys:te,handleSkillConfigToggle:Z,handleSkillEntryUpdate:E,handleSkillEntrySave:q,handleUninstallSkill:re,onPublishOpen:(ve,Ce)=>u({slug:ve,name:Ce}),validateSkillEnvConfig:F,publishStatusMap:L,oauthProviders:le})}),d.jsx(on,{value:"myskills",className:"mt-0",children:d.jsx(lb,{skills:f.filter(ve=>ve.source==="user"),skillsLoading:h,skillsSearch:m,skillsConfig:M,skillsUpdates:B,visibleSecretKeys:U,setVisibleSecretKeys:te,handleSkillConfigToggle:Z,handleSkillEntryUpdate:E,handleSkillEntrySave:q,handleUninstallSkill:re,onPublishOpen:(ve,Ce)=>u({slug:ve,name:Ce}),validateSkillEnvConfig:F,publishStatusMap:L,oauthProviders:le,emptyMessage:d.jsxs(d.Fragment,{children:["Skills you or the AI created appear here. They’re stored in"," ",d.jsx("code",{className:"text-xs",children:"~/.sulala/workspace/skills/my/<name>/README.md"}),'. Create one via "Create skill" or ask the agent to create a skill for you.']})})}),d.jsx(on,{value:"hub",className:"mt-0",children:d.jsx(tO,{skills:f,registrySkills:p,registryLoading:b,systemRegistrySkills:x,systemRegistryLoading:S,skillsSearch:m,setSelectedHubSkill:A})})]})]})]}),d.jsx(nO,{skill:N,installingSlug:w,onClose:()=>A(null),onInstall:$}),d.jsx(VR,{open:r,onOpenChange:a,onSuccess:I}),d.jsx(XR,{open:i,onOpenChange:s,onUpload:X,uploading:_}),d.jsx(ZR,{slug:o?.slug,name:o?.name,onClose:()=>u(null),onPublish:Y,publishingSlug:k})]})}function lb({skills:e,skillsLoading:r,skillsSearch:a,skillsConfig:i,skillsUpdates:s,visibleSecretKeys:o,setVisibleSecretKeys:u,handleSkillConfigToggle:f,handleSkillEntryUpdate:h,handleSkillEntrySave:m,handleUninstallSkill:y,onPublishOpen:p,validateSkillEnvConfig:b,publishStatusMap:x,oauthProviders:S,emptyMessage:w}){const _=e.filter(k=>!a.trim()||k.name.toLowerCase().includes(a.toLowerCase())||k.description.toLowerCase().includes(a.toLowerCase()));return r&&!e.length?d.jsx("p",{className:"text-muted-foreground text-sm",children:"Loading…"}):_.length===0?d.jsx("p",{className:"text-muted-foreground text-sm",children:w??d.jsx(d.Fragment,{children:"No installed skills. Add skills to ~/.sulala/workspace/skills/<name>/README.md, or install from the From Hub tab."})}):d.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:_.map(k=>{const A={slug:k.slug??k.filePath.split(/[/\\]/).pop()?.replace(/\.md$/,"")??k.name,name:k.name,description:k.description},O=i?.entries?.[A.slug]??{},M=O.enabled!==!1;return console.debug("[InstalledTab] skill",A.slug,"env",k.env,"envHints",k.envHints),d.jsx(QR,{slug:A.slug,name:A.name,description:k.description,category:k.category,version:k.version,tags:k.tags,status:k.status,source:k.source,requiredSkills:k.requiredSkills,missingRequiredSkills:k.missingRequiredSkills,requiredSetup:k.requiredSetup,requiredScopes:k.requiredScopes,env:k.env,requiredEnv:k.requiredEnv,envHints:k.envHints,oauthScopes:k.oauthScopes,missing:k.missing,enabled:M,hasUpdate:s.has(A.slug),entry:O,visibleSecretKeys:o,setVisibleSecretKeys:u,onToggle:()=>f(A.slug,!M),onEntryUpdate:D=>h(A.slug,D),onEntrySave:(D,B)=>m(A.slug,D,B),canUninstall:k.source==="user"||k.source==="installed",onUninstall:()=>y(A.slug,k.source),canPublish:k.source==="user"&&!!p,onPublish:p?()=>p(A.slug,A.name):void 0,publishStatus:x?.[A.slug],validateSkillEnvConfig:b,oauthProvider:S.find(D=>D.skillSlug===A.slug)??void 0},A.slug)})})}function XR({open:e,onOpenChange:r,onUpload:a,uploading:i}){const s=j.useRef(null),o=j.useRef(null),[u,f]=j.useState(""),[h,m]=j.useState(""),[y,p]=j.useState(""),[b,x]=j.useState(null),S=N=>{const A=N.target.files?.[0];if(A?.name.endsWith(".md")){const O=new FileReader;O.onload=()=>f(String(O.result??"")),O.readAsText(A)}N.target.value=""},w=N=>{const A=N.target.files?.[0];if(A&&(A.name.endsWith(".yaml")||A.name.endsWith(".yml"))){const O=new FileReader;O.onload=()=>p(String(O.result??"")),O.readAsText(A)}N.target.value=""},_=async N=>{N.preventDefault(),x(null);const A=u.trim();if(!A){x("Paste or upload a skill markdown file.");return}try{await a(A,h.trim()||void 0,y.trim()||void 0),f(""),m(""),p(""),r(!1)}catch{}},k=()=>{f(""),m(""),p(""),x(null),r(!1)};return d.jsx(Ya,{open:e,onOpenChange:N=>!N&&k(),children:d.jsxs($a,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",showCloseButton:!0,children:[d.jsxs(Va,{children:[d.jsx(Xa,{children:"Upload skill"}),d.jsx(Za,{children:"Paste or upload a skill .md file (required) and optional tools.yaml. The skill will be saved to your workspace and enabled."})]}),d.jsxs("form",{onSubmit:_,className:"space-y-4 pt-2",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(je,{type:"button",variant:"outline",size:"sm",onClick:()=>s.current?.click(),children:"Choose file (.md)"}),d.jsx("input",{ref:s,type:"file",accept:".md",className:"hidden",onChange:S})]}),d.jsx(Mt,{htmlFor:"upload-markdown",children:"Skill Markdown (full file with frontmatter)"}),d.jsx("textarea",{id:"upload-markdown",className:"min-h-[200px] w-full rounded-md border border-input bg-background px-3 py-2 font-mono text-sm",value:u,onChange:N=>f(N.target.value),placeholder:"---\\nname: my-skill\\ndescription: Use when...\\n---\\n\\n# My Skill\\n..."})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(je,{type:"button",variant:"outline",size:"sm",onClick:()=>o.current?.click(),children:"Choose file (.yaml)"}),d.jsx("input",{ref:o,type:"file",accept:".yaml,.yml",className:"hidden",onChange:w})]}),d.jsx(Mt,{htmlFor:"upload-tools",children:"tools.yaml (optional)"}),d.jsx("textarea",{id:"upload-tools",className:"min-h-[120px] w-full rounded-md border border-input bg-background px-3 py-2 font-mono text-sm",value:y,onChange:N=>p(N.target.value),placeholder:"tools:\\n - name: my_tool\\n description: ...\\n auth: none\\n request: ..."})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Mt,{htmlFor:"upload-slug",children:"Slug (optional, derived from name if empty)"}),d.jsx(It,{id:"upload-slug",placeholder:"my-skill",value:h,onChange:N=>m(N.target.value)})]}),b&&d.jsx("p",{className:"text-sm text-destructive",children:b}),d.jsxs(Ka,{children:[d.jsx(je,{type:"button",variant:"outline",onClick:k,children:"Cancel"}),d.jsx(je,{type:"submit",disabled:i,children:i?"Uploading…":"Upload & use"})]})]})]})})}function ZR({slug:e,name:r,onClose:a,onPublish:i,publishingSlug:s}){const[o,u]=j.useState("free"),[f,h]=j.useState(""),[m,y]=j.useState(!1),[p,b]=j.useState(null),x=!!e,S=async _=>{if(_.preventDefault(),!!e){b(null);try{const k=o==="paid"&&f.trim()!==""?Math.round(parseFloat(f)*100):void 0;await i(e,{priceIntent:o,intendedPriceCents:k!==void 0&&Number.isFinite(k)?k:void 0}),y(!0)}catch(k){b(k instanceof Error?k.message:"Publish failed. Set SKILLS_REGISTRY_URL in the agent .env to your store (e.g. http://localhost:3002).")}}},w=()=>{y(!1),b(null),u("free"),h(""),a()};return d.jsx(Ya,{open:x,onOpenChange:_=>!_&&w(),children:d.jsxs($a,{className:"max-w-md",showCloseButton:!0,children:[d.jsxs(Va,{children:[d.jsx(Xa,{children:"Publish to store"}),d.jsxs(Za,{children:['Submit "',r??e,'" to the skill store. Others can install it after an admin approves. Set ',d.jsx("code",{className:"text-xs",children:"SKILLS_REGISTRY_URL"})," in the agent .env to your store URL (e.g. http://localhost:3002). No API key needed unless your store requires one."]})]}),m?d.jsxs("div",{className:"space-y-4 py-2",children:[d.jsx("p",{className:"text-sm text-muted-foreground",children:"Submitted to the store. An admin will review it. You can track it under My skills on the store."}),d.jsx(Ka,{children:d.jsx(je,{onClick:w,children:"Close"})})]}):d.jsxs("form",{onSubmit:S,className:"space-y-4 pt-2",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(Mt,{children:"Price"}),d.jsxs("div",{className:"flex gap-4",children:[d.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[d.jsx("input",{type:"radio",name:"priceIntent",checked:o==="free",onChange:()=>u("free")}),"Free"]}),d.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[d.jsx("input",{type:"radio",name:"priceIntent",checked:o==="paid",onChange:()=>u("paid")}),"Paid"]})]})]}),o==="paid"&&d.jsxs("div",{className:"space-y-2",children:[d.jsx(Mt,{htmlFor:"publish-price",children:"Price (USD)"}),d.jsx(It,{id:"publish-price",type:"number",min:0,step:.01,placeholder:"4.99",value:f,onChange:_=>h(_.target.value)})]}),p&&d.jsx("p",{className:"text-sm text-destructive",children:p}),d.jsxs(Ka,{className:"gap-2 pt-2",children:[d.jsx(je,{type:"button",variant:"outline",onClick:w,children:"Cancel"}),d.jsx(je,{type:"submit",disabled:!!s,children:s===e?"Submitting…":"Submit to store"})]})]})]})})}function QR({slug:e,name:r,description:a,category:i,version:s,tags:o,status:u,source:f,requiredSkills:h,missingRequiredSkills:m,requiredSetup:y,requiredScopes:p,env:b,requiredEnv:x,envHints:S,oauthScopes:w,missing:_,enabled:k,hasUpdate:N,entry:A,visibleSecretKeys:O,setVisibleSecretKeys:M,onToggle:D,onEntryUpdate:B,onEntrySave:V,canUninstall:K,onUninstall:U,canPublish:te,onPublish:I,publishStatus:Z,validateSkillEnvConfig:E,oauthProvider:q}){const[$,X]=j.useState(!1),[re,Y]=j.useState(!1);return d.jsxs("article",{className:"border-border/70 p-6 bg-card/30 relative flex flex-col gap-3 rounded-xl border p-4 ",children:[d.jsx("div",{className:"absolute right-3 top-3",children:d.jsxs(Um,{children:[d.jsx(Bm,{asChild:!0,children:d.jsxs(je,{variant:"ghost",size:"icon",className:"text-muted-foreground hover:text-foreground size-8 shrink-0",children:[d.jsx(E4,{className:"size-4"}),d.jsx("span",{className:"sr-only",children:"Actions"})]})}),d.jsxs(Fm,{align:"end",children:[d.jsx(ma,{onClick:D,children:k?"Disable":"Enable"}),te&&I&&!Z&&d.jsxs(ma,{onClick:I,children:[d.jsx(hS,{className:"size-4"}),"Publish to store"]}),K&&U&&d.jsx(ma,{variant:"destructive",onClick:()=>X(!0),children:"Uninstall"})]})]})}),d.jsxs("div",{className:"flex flex-1 flex-col gap-2 min-w-0",children:[d.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[d.jsx(qt,{variant:"secondary",className:"text-xs",children:"Free"}),i&&d.jsx(qt,{variant:"outline",className:"text-xs",children:i}),s&&d.jsxs("span",{className:"text-xs text-muted-foreground",children:["v",s]}),N&&d.jsx(qt,{variant:"outline",className:"text-xs text-amber-600 dark:text-amber-400",children:"Update"}),Z==="approved"&&d.jsx(qt,{variant:"default",className:"text-xs",children:"Approved"}),Z==="pending"&&d.jsx(qt,{variant:"secondary",className:"text-xs",children:"Pending review"}),d.jsx(qt,{variant:u==="eligible"?"default":u==="blocked"?"destructive":"secondary",children:u})]}),d.jsx("h3",{className:"font-semibold text-sm",children:r}),d.jsx("p",{className:"text-muted-foreground line-clamp-3 text-xs flex-1",children:a}),o&&o.length>0&&d.jsx("div",{className:"flex flex-wrap gap-1",children:o.slice(0,4).map(z=>d.jsxs("span",{className:"text-xs text-muted-foreground/80",children:["#",z]},z))}),d.jsxs("div",{className:"flex flex-wrap items-center gap-2 pt-1",children:[Z==="pending"&&d.jsx("span",{className:"text-muted-foreground text-xs",children:"Already submitted"}),Z==="approved"&&d.jsx("span",{className:"text-muted-foreground text-xs",children:"Published"}),f&&d.jsx("span",{className:"text-xs text-muted-foreground capitalize",children:f})]}),h&&h.length>0&&d.jsxs("p",{className:"text-muted-foreground text-xs",children:["Requires:"," ",h.map((z,R)=>{const F=Lh(z);return d.jsxs("span",{children:[R>0&&", ",F?d.jsx("a",{href:F,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:z}):z]},z)})]}),m&&m.length>0&&d.jsxs("p",{className:"text-amber-600 dark:text-amber-500 text-xs font-medium",children:["Missing required skills:"," ",m.map((z,R)=>{const F=Lh(z);return d.jsxs("span",{children:[R>0&&", ",F?d.jsx("a",{href:F,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:z}):z]},z)})]}),y&&d.jsxs("p",{className:"text-muted-foreground text-xs",children:[d.jsx("span",{className:"font-medium",children:"Setup:"})," ",y]}),p&&p.length>0&&d.jsxs("p",{className:"text-muted-foreground text-xs",children:[d.jsx("span",{className:"font-medium",children:"Scopes to add in required skill:"})," ",p.map((z,R)=>d.jsxs("span",{children:[R>0&&", ",d.jsx("code",{className:"rounded bg-muted px-0.5 text-[10px]",children:z})]},z))]})]}),d.jsx(Ya,{open:$,onOpenChange:X,children:d.jsxs($a,{className:"sm:max-w-sm ",children:[d.jsxs(Va,{children:[d.jsx(Xa,{children:"Remove skill?"}),d.jsxs(Za,{children:['"',r,'" will be uninstalled. You can install it again from the hub later.']})]}),d.jsxs(Ka,{children:[d.jsx(je,{variant:"outline",onClick:()=>X(!1),children:"Cancel"}),d.jsx(je,{variant:"destructive",onClick:()=>{U?.(),X(!1)},children:"Remove"})]})]})}),d.jsxs("div",{className:"flex flex-wrap items-center gap-2 pt-1 border-t",children:[d.jsxs(je,{variant:"outline",size:"sm",onClick:()=>Y(!0),children:[d.jsx(Om,{className:"mr-1.5 size-4"}),"Setup"]}),_&&_.length>0&&d.jsxs("span",{className:"text-muted-foreground text-xs",children:["Missing bins: ",_.join(", ")]})]}),d.jsx(Rs,{open:re,onOpenChange:Y,children:d.jsxs(Os,{side:"right",className:"w-full max-w-xl overflow-y-auto sm:max-w-2xl p-6 sm:p-8",children:[d.jsxs(zs,{className:"space-y-2 border-b border-border pb-6",children:[d.jsxs(Ms,{children:["Setup — ",r]}),d.jsx(Ds,{children:"Configure permissions, API keys, and OAuth for this skill."})]}),d.jsxs("div",{className:"mt-8 space-y-10 pb-10",children:[d.jsx(WR,{entry:A,onEntryUpdate:B,onEntrySave:V}),b&&b.length>0&&d.jsx(eO,{slug:e,env:b,requiredEnv:x,envHints:S,entry:A,visibleSecretKeys:O,setVisibleSecretKeys:M,onEntryUpdate:B,onEntrySave:V,validateSkillEnvConfig:E,oauthProvider:q}),(w?.length||Array.isArray(A.oauthScopes)&&A.oauthScopes.length>0)&&d.jsx(JR,{slug:e,defaultScopes:w,entry:A,onEntryUpdate:B,onEntrySave:V,env:b})]})]})})]})}function WR({entry:e,onEntryUpdate:r,onEntrySave:a}){const i=e.readOnly===!0,s=Array.isArray(e.allowedTools)?e.allowedTools.join(", "):typeof e.allowedTools=="string"?e.allowedTools:"",o=f=>{r({...e,readOnly:f}),a(void 0,void 0)},u=f=>{const h=f.split(",").map(m=>m.trim()).filter(Boolean);r({...e,allowedTools:h.length?h:void 0})};return d.jsxs("section",{className:"flex flex-col gap-4",children:[d.jsxs("div",{className:"text-muted-foreground flex items-center gap-2 font-medium text-sm",children:[d.jsx(a5,{className:"size-4"}),"Permissions"]}),d.jsxs("label",{className:"flex cursor-pointer items-center gap-3",children:[d.jsx("input",{type:"checkbox",checked:i,onChange:f=>o(f.target.checked),className:"size-4 rounded border-input"}),d.jsx("span",{className:"text-muted-foreground text-sm",children:"Read only"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{className:"text-muted-foreground block text-sm",children:"Allowed tools"}),d.jsx("input",{type:"text",placeholder:"Leave empty for global allowlist",value:s,onChange:f=>u(f.target.value),onBlur:()=>a(void 0,void 0),className:"border-input bg-background w-full rounded-md border px-3 py-2 text-sm","aria-label":"Allowed tools"}),d.jsx("p",{className:"text-muted-foreground text-xs",children:"Comma-separated (e.g. read_file, run_task). Empty = use global."})]})]})}function JR({slug:e,defaultScopes:r,entry:a,onEntryUpdate:i,onEntrySave:s,env:o}){const f=(Array.isArray(a.oauthScopes)?a.oauthScopes:void 0)??r??[],h=f.join(`
|
|
58
|
-
`),m=p=>{const x=p.target.value.split(/\n/).map(S=>S.trim()).filter(Boolean);i({...a,oauthScopes:x})},y=()=>{s(o,void 0)};return d.jsxs("section",{className:"flex flex-col gap-4 border-t border-border/50 pt-6",children:[d.jsx("div",{className:"text-muted-foreground font-medium text-sm",children:"OAuth scopes"}),d.jsx("textarea",{id:`skill-${e}-oauth-scopes`,placeholder:"One scope URL per line (e.g. https://www.googleapis.com/auth/gmail.readonly)",value:h,onChange:m,onBlur:y,rows:Math.min(6,Math.max(2,f.length+1)),className:"border-input bg-background w-full resize-y rounded-md border px-3 py-2 text-sm font-mono","aria-label":"OAuth scopes"}),d.jsx("p",{className:"text-muted-foreground text-xs",children:"Used when building the auth URL for own-credentials flow. Edit to add or remove scopes; saved in skill config."})]})}function eO({slug:e,env:r,requiredEnv:a,envHints:i,entry:s,visibleSecretKeys:o,setVisibleSecretKeys:u,onEntryUpdate:f,onEntrySave:h,validateSkillEnvConfig:m,oauthProvider:y}){const p=e==="bluesky"?{BSKY_HANDLE:s.handle,BSKY_APP_PASSWORD:s.apiKey}:void 0,b=a??r,x=m(s,b,p),S=w=>/PASSWORD|SECRET|KEY|TOKEN/i.test(w);return d.jsxs("div",{className:"flex flex-col gap-6 border-t border-border/50 pt-6",children:[r.map(w=>{const _=s[w]??p?.[w],k=_==="set",N=k?"":String(_??""),A=x.errors[w],O=`skill-${e}-${w}`,M=`${e}-${w}`,D=o[M],B=i?.[w];let V=null;if(B){const U=B.match(/https?:\/\/\S+/);if(U){const te=U[0].replace(/[),.]+$/,""),I=B.indexOf(U[0]),Z=B.slice(0,I),E=B.slice(I+U[0].length);V=d.jsxs(d.Fragment,{children:[Z,d.jsx("a",{href:te,target:"_blank",rel:"noreferrer",className:"underline underline-offset-2",children:te}),E]})}else V=B}console.debug("[SkillEnvForm] envVar",e,w,"hint",B);const K=w==="GOOGLE_SCOPES";return d.jsxs(lk,{className:"w-full gap-3",children:[d.jsx(UR,{htmlFor:O,children:w}),d.jsx("div",{className:"relative",children:K?d.jsx("textarea",{id:O,placeholder:k?"(already set)":"Space- or newline-separated scope URLs (e.g. Gmail, Calendar)",value:N,onChange:U=>{const te=U.target.value;f({...s,[w]:te})},onBlur:()=>h(b,p),rows:4,className:`w-full resize-y rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 ${A?"border-destructive":""}`,"aria-invalid":!!A,"aria-describedby":A?`${O}-err`:void 0}):d.jsxs(d.Fragment,{children:[d.jsx(It,{id:O,type:S(w)?D?"text":"password":"text",placeholder:k?"(already set)":`Enter ${w}`,value:N,onChange:U=>{const te=U.target.value,I={...s,[w]:te};e==="bluesky"&&w==="BSKY_HANDLE"&&(I.handle=te),e==="bluesky"&&w==="BSKY_APP_PASSWORD"&&(I.apiKey=te),f(I)},onBlur:()=>h(b,p),className:`h-9 text-sm ${S(w)?"pr-9":""} ${A?"border-destructive":""}`,"aria-invalid":!!A,"aria-describedby":A?`${O}-err`:void 0,autoComplete:"off"}),S(w)&&d.jsx(je,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-9 w-9 shrink-0 text-muted-foreground hover:text-foreground",onClick:()=>u(U=>({...U,[M]:!U[M]})),"aria-label":D?"Hide":"Show",children:D?d.jsx(O4,{className:"h-4 w-4"}):d.jsx(M4,{className:"h-4 w-4"})})]})}),A&&d.jsx(FR,{id:`${O}-err`,children:A}),(S(w)||V)&&d.jsxs(BR,{children:[V&&d.jsxs(d.Fragment,{children:[V,d.jsx("br",{})]}),S(w)?"Tokens and keys are stored securely. Use the eye icon to show or hide.":null]})]},w)}),y&&d.jsxs("div",{className:"w-full mt-6 pt-6 border-t border-border/50 space-y-4",children:[d.jsxs("p",{className:"text-muted-foreground text-sm",children:["Add this ",d.jsx("strong",{children:"Authorized redirect URI"})," in your OAuth client settings:"]}),d.jsxs("code",{className:"block text-sm bg-muted/50 px-3 py-2 rounded-md break-all",children:[Re,"/api/oauth/",y.providerId,"/callback"]}),d.jsxs("div",{className:"flex flex-col gap-3",children:[d.jsx(je,{asChild:!0,variant:"default",size:"sm",className:"w-fit",children:d.jsx("a",{href:`${Re}/api/oauth/${y.providerId}/authorize`,target:"_blank",rel:"noopener noreferrer",children:"Get refresh token"})}),d.jsx("p",{className:"text-muted-foreground text-sm",children:"Save your client ID and secret first, then click the link. Token is saved automatically."})]})]})]})}function tO({skills:e,registrySkills:r,registryLoading:a,systemRegistrySkills:i,systemRegistryLoading:s,skillsSearch:o,setSelectedHubSkill:u}){const f=new Set(e.filter(S=>S.source==="user"||S.source==="workspace"||S.source==="managed").map(S=>S.slug??S.name)),h=S=>S.filter(w=>!f.has(w.slug)).filter(w=>!o.trim()||(w.name||w.slug).toLowerCase().includes(o.toLowerCase())||(w.description||"").toLowerCase().includes(o.toLowerCase())),m=h(i),y=h(r),p=a||s,b=m.length>0||y.length>0;if(p&&!r.length&&!i.length)return d.jsx("p",{className:"text-muted-foreground text-sm",children:"Loading…"});if(!b)return d.jsx("p",{className:"text-muted-foreground text-sm",children:i.length===0&&r.length===0?"Hub registry is empty or not configured. Set VITE_SKILLS_REGISTRY_URL to your store URL.":"All listed skills are already installed, or no matching search."});const x=({r:S})=>{const w=S.priceCents!=null&&S.priceCents>0?`$${(S.priceCents/100).toFixed(2)}`:"Free";return d.jsxs("article",{className:"border-border/70 bg-card/30 flex flex-col gap-3 rounded-xl border p-4",children:[d.jsx("span",{className:"bg-primary/10 text-primary flex size-10 shrink-0 items-center justify-center rounded-lg",children:d.jsx(fS,{className:"size-5"})}),d.jsxs("div",{className:"flex flex-1 flex-col gap-2 min-w-0",children:[d.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[d.jsx(qt,{variant:"secondary",className:"text-xs",children:w}),S.category&&d.jsx(qt,{variant:"outline",className:"text-xs",children:S.category}),S.version&&d.jsxs("span",{className:"text-xs text-muted-foreground",children:["v",S.version]})]}),d.jsx("h3",{className:"font-semibold text-sm",children:S.name||S.slug}),d.jsx("p",{className:"text-muted-foreground line-clamp-3 text-xs flex-1",children:S.description||""}),S.tags&&S.tags.length>0&&d.jsx("div",{className:"flex flex-wrap gap-1",children:S.tags.slice(0,4).map(_=>d.jsxs("span",{className:"text-xs text-muted-foreground/80",children:["#",_]},_))}),d.jsx(je,{variant:"outline",size:"sm",className:"w-fit mt-1",onClick:()=>u(S),children:"View & install"})]})]},S.slug)};return d.jsxs("div",{className:"space-y-6",children:[m.length>0&&d.jsxs("section",{children:[d.jsx("h3",{className:"text-muted-foreground mb-3 text-sm font-medium",children:"System skills"}),d.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:m.map(S=>d.jsx(x,{r:S},S.slug))})]}),y.length>0&&d.jsxs("section",{children:[d.jsx("h3",{className:"text-muted-foreground mb-3 text-sm font-medium",children:"Community / Hub"}),d.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:y.map(S=>d.jsx(x,{r:S},S.slug))})]})]})}function nO({skill:e,installingSlug:r,onClose:a,onInstall:i}){if(!e)return null;const s=(e.priceCents??0)>0,o=ti(),u=o?`${o}/skills/${e.slug}`:null;return d.jsx(Rs,{open:!!e,onOpenChange:f=>!f&&a(),children:d.jsxs(Os,{side:"right",className:" w-full max-w-lg sm:max-w-xl overflow-y-auto p-12 sm:p-8",children:[d.jsxs(zs,{className:"space-y-3 p-0 pb-6 border-b border-border",children:[d.jsxs(je,{variant:"ghost",size:"sm",className:"w-fit -ml-2",onClick:a,children:[d.jsx(l4,{className:"h-4 w-4 mr-1"}),"Back to skills"]}),d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d.jsx(qt,{variant:s?"default":"secondary",children:s?`$${(e.priceCents/100).toFixed(2)}`:"Free"}),e.category&&d.jsx(qt,{variant:"outline",children:e.category}),e.version&&d.jsxs(qt,{variant:"secondary",children:["v",e.version]}),e.tags?.map(f=>d.jsxs(qt,{variant:"secondary",className:"font-normal",children:["#",f]},f))]}),d.jsx(Ms,{className:"text-left",children:e.name||e.slug}),d.jsx(Ds,{className:"text-left",children:e.description}),(e.creatorName||e.creatorId)&&d.jsxs("p",{className:"text-xs text-muted-foreground",children:["Creator: ",e.creatorName??e.creatorId]})]}),d.jsx("div",{className:"mt-6 space-y-6 px-1 pb-8",children:s?d.jsxs(St,{className:"p-4",children:[d.jsxs(At,{className:"px-0 pt-0 pb-3",children:[d.jsx(Tt,{className:"text-sm",children:"Purchase required"}),d.jsx(Rt,{className:"text-xs mt-1.5",children:"This skill is paid. Buy it on the store to get an install URL with your license."})]}),d.jsx(kt,{className:"px-0 pb-0 pt-2 space-y-3",children:u?d.jsx(je,{asChild:!0,children:d.jsx("a",{href:u,target:"_blank",rel:"noopener noreferrer",children:"Buy on store"})}):d.jsx("p",{className:"text-xs text-muted-foreground",children:"Set VITE_SKILLS_REGISTRY_URL to the hub base URL to see the store link."})})]}):d.jsxs(d.Fragment,{children:[d.jsxs("div",{children:[d.jsx("h4",{className:"text-sm font-medium mb-2",children:"Install directly"}),d.jsx(je,{disabled:r!==null,onClick:async()=>{await i(e.slug,"managed"),a()},children:r===e.slug?"Installing…":"Install"})]}),d.jsxs(St,{children:[d.jsxs(At,{className:"py-3",children:[d.jsx(Tt,{className:"text-sm",children:"Install via URL or CLI"}),d.jsx(Rt,{className:"text-xs",children:"For users who want to install from the command line or use the install URL."})]}),d.jsxs(kt,{className:"space-y-3 pt-0",children:[fs(e.slug)&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{children:[d.jsx("label",{className:"text-xs text-muted-foreground block mb-1",children:"Install URL"}),d.jsxs("div",{className:"flex gap-1",children:[d.jsx("input",{readOnly:!0,className:"border-input bg-muted flex-1 rounded px-2 py-1.5 font-mono text-xs",value:fs(e.slug)}),d.jsx(je,{variant:"outline",size:"icon",className:"shrink-0 h-8 w-8",onClick:()=>navigator.clipboard.writeText(fs(e.slug)),children:d.jsx(eb,{className:"h-4 w-4"})})]})]}),d.jsxs("p",{className:"text-xs text-muted-foreground",children:["CLI:"," ",d.jsxs("code",{className:"rounded bg-muted px-1 py-0.5",children:['sulala skill install --from-url="',fs(e.slug),'"']})]})]}),Zi()&&d.jsxs("div",{children:[d.jsx("label",{className:"text-xs text-muted-foreground block mb-1",children:"Registry URL (for env)"}),d.jsxs("div",{className:"flex gap-1",children:[d.jsx("input",{readOnly:!0,className:"border-input bg-muted flex-1 rounded px-2 py-1.5 font-mono text-xs",value:`SKILLS_REGISTRY_URL=${Zi()}`}),d.jsx(je,{variant:"outline",size:"icon",className:"shrink-0 h-8 w-8",onClick:()=>navigator.clipboard.writeText(`SKILLS_REGISTRY_URL=${Zi()}`),children:d.jsx(eb,{className:"h-4 w-4"})})]}),d.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Then:"," ",d.jsxs("code",{className:"rounded bg-muted px-1 py-0.5",children:["sulala skill install ",e.slug]})]})]})]})]})]})})]})})}const sb={openai:[{id:"gpt-4o-mini",name:"GPT-4o mini"},{id:"gpt-5.2",name:"GPT-5.2"},{id:"gpt-5-mini",name:"GPT-5 mini"},{id:"gpt-5-nano",name:"GPT-5 nano"},{id:"gpt-5.2-pro",name:"GPT-5.2 Pro"},{id:"gpt-4.1",name:"GPT-4.1"}],openrouter:[],claude:[{id:"claude-sonnet-4-6",name:"Claude Sonnet 4.6"},{id:"claude-opus-4-6",name:"Claude Opus 4.6"},{id:"claude-haiku-4-5",name:"Claude Haiku 4.5"}],gemini:[{id:"gemini-2.5-flash",name:"Gemini 2.5 Flash"},{id:"gemini-2.5-pro",name:"Gemini 2.5 Pro"},{id:"gemini-2.5-flash-lite",name:"Gemini 2.5 Flash Lite"},{id:"gemini-3.1-pro-preview",name:"Gemini 3.1 Pro (preview)"},{id:"gemini-3-flash-preview",name:"Gemini 3 Flash (preview)"}],ollama:[{id:"qwen3.5:27b",name:"Qwen 3.5 27B"},{id:"qwen3.5:35b",name:"Qwen 3.5 35B"},{id:"qwen3.5:122b",name:"Qwen 3.5 122B"},{id:"glm-4.7-flash",name:"GLM 4.7 Flash"},{id:"qwen3-vl:8b",name:"Qwen3-VL 8B"},{id:"qwen3-vl:30b",name:"Qwen3-VL 30B"},{id:"qwen3-vl:32b",name:"Qwen3-VL 32B"},{id:"qwen3-next:80b",name:"Qwen3-Next 80B"},{id:"nemotron-3-nano:30b",name:"Nemotron 3 Nano 30B"},{id:"gpt-oss-safeguard:20b",name:"GPT-OSS Safeguard 20B"},{id:"gpt-oss-safeguard:120b",name:"GPT-OSS Safeguard 120B"},{id:"qwen3:8b",name:"Qwen 3 8B"},{id:"qwen3:14b",name:"Qwen 3 14B"},{id:"qwen3:30b",name:"Qwen 3 30B"},{id:"qwen3:32b",name:"Qwen 3 32B"},{id:"qwen3:235b",name:"Qwen 3 235B"},{id:"gpt-oss:20b",name:"GPT-OSS 20B"},{id:"gpt-oss:120b",name:"GPT-OSS 120B"},{id:"magistral:24b",name:"Magistral 24B"},{id:"deepseek-v3.1:671b",name:"DeepSeek V3.1 671B"},{id:"deepseek-r1:7b",name:"DeepSeek R1 7B"},{id:"deepseek-r1:8b",name:"DeepSeek R1 8B"},{id:"deepseek-r1:14b",name:"DeepSeek R1 14B"},{id:"deepseek-r1:32b",name:"DeepSeek R1 32B"},{id:"deepseek-r1:70b",name:"DeepSeek R1 70B"},{id:"deepseek-r1:671b",name:"DeepSeek R1 671B"},{id:"llama3.2:3b",name:"Llama 3.2 3B"},{id:"llama3.1:8b",name:"Llama 3.1 8B"},{id:"llama3.1:70b",name:"Llama 3.1 70B"},{id:"hermes3:8b",name:"Hermes 3 8B"},{id:"hermes3:70b",name:"Hermes 3 70B"},{id:"mistral",name:"Mistral 7B"},{id:"gemma2:9b",name:"Gemma 2 9B"},{id:"qwen2:7b",name:"Qwen 2 7B"},{id:"qwen2:72b",name:"Qwen 2 72B"}]},dc="sulala_chat_provider",th="sulala_chat_model",rO={openai:"OPENAI_API_KEY",openrouter:"OPENROUTER_API_KEY",claude:"ANTHROPIC_API_KEY",gemini:["GOOGLE_GEMINI_API_KEY","GEMINI_API_KEY"],ollama:""};function aO(e,r,a){if(e==="ollama")return a===!0;const i=rO[e];return i?Array.isArray(i)?i.some(s=>r[s]==="set"):r[i]==="set":!1}function nh(e){try{const r=localStorage.getItem(e);if(typeof r=="string")return r}catch{}return""}function iO(e,r,a){const[i,s]=j.useState(null),[o,u]=j.useState({}),[f,h]=j.useState([]),[m,y]=j.useState(""),[p,b]=j.useState(()=>nh(dc)),[x,S]=j.useState(()=>nh(th)),[w,_]=j.useState([]),[k,N]=j.useState(!1),[A,O]=j.useState([]),[M,D]=j.useState(!1),[B,V]=j.useState(!1),[K,U]=j.useState(null),[te,I]=j.useState(null),[Z,E]=j.useState(!1),[q,$]=j.useState(null),[X,re]=j.useState(null),[Y,z]=j.useState(null),[R,F]=j.useState(!1),[L,le]=j.useState(null),[oe,ve]=j.useState([]),[Ce,Ae]=j.useState(null),Ne=()=>{E(!0),rl().then(he=>I(he.running)).catch(()=>I(!1)).finally(()=>E(!1))};j.useEffect(()=>{if(e!=="chat"){I(null),$(null);return}E(!0),rl().then(he=>I(he.running)).catch(()=>I(!1)).finally(()=>E(!1))},[e]),j.useEffect(()=>{if(e!=="chat"&&p!=="ollama")return;if(e!=="chat"){$(null);return}if(p!=="ollama")return;const he=()=>{HS().then($).catch(()=>$(null))};he();const xe=setInterval(he,1500);return()=>clearInterval(xe)},[e,p]),j.useEffect(()=>{e==="chat"&&Promise.all([sl(),va()]).then(([he,xe])=>{s(he??null),u(xe?.keys??{})}).catch(()=>{s(null),u({})})},[e]);const Ge=j.useMemo(()=>(i?.aiProviders??[]).filter(he=>aO(he.id,o,te)),[i?.aiProviders,o,te]);j.useEffect(()=>{if(e!=="chat"||!i?.aiProviders?.length)return;const he=nh(dc),xe=Ge;if(xe.length===0)return;const ke=pe=>{const _e=pe&&xe.some(He=>He.id===pe)?xe.find(He=>He.id===pe):null,se=xe[0],Te=_e??se;if(Te){b(Te.id),S(Te.defaultModel||"");try{localStorage.setItem(dc,Te.id),localStorage.setItem(th,Te.defaultModel||"")}catch{}}};if(!he){zc().then(pe=>ke(pe.defaultProvider??null)).catch(()=>ke(null));return}xe.some(pe=>pe.id===he)||zc().then(pe=>ke(pe.defaultProvider??null)).catch(()=>ke(null))},[e,i,Ge]),j.useEffect(()=>{if(e!=="chat"||p!=="openrouter"&&p!=="ollama"){_([]);return}N(!0),Ls(p).then(he=>_(he.models||[])).catch(()=>_([])).finally(()=>N(!1))},[e,p]),j.useEffect(()=>{e==="chat"&&(D(!0),bc(50).then(he=>O(he.sessions||[])).catch(()=>O([])).finally(()=>D(!1)))},[e,K]),j.useEffect(()=>{e==="chat"&&cu().then(he=>Ae(he.mainSessionKey?.trim()||null)).catch(()=>Ae(null))},[e]),j.useEffect(()=>{if(!X||!K){X||z(null);return}F(!0),DS(K).then(he=>{const xe=(he.pendingActions||[]).find(ke=>ke.id===X);z(xe??null)}).catch(()=>z(null)).finally(()=>F(!1))},[X,K]);const $e=async he=>{if(!he){ie();return}re(null),z(null),V(!0);try{if(he==="__unified_telegram__"&&Ce){const xe=await Bh({session_key:Ce});U(xe.id);const ke=await ha(xe.id);h(ke.messages||[]);const ne=await bc(50).catch(()=>({sessions:[]}));O(ne.sessions||[])}else{const xe=await ha(he);U(xe.id),h(xe.messages||[])}}catch(xe){r(xe instanceof Error?xe.message:"Failed to load session")}finally{V(!1)}},dt=async()=>{const he=m.trim();if(!he&&oe.length===0||B)return;const xe=[...oe];y(""),ve([]),await T(he||"(with attachments)",xe)},ot=async he=>{const xe=(he??"").trim();!xe||B||await T(xe,[])},T=async(he,xe)=>{const ke={role:"user",content:he||"(with attachments)"};h(ne=>[...ne,ke]),V(!0),r(null);try{let ne=K;if(!ne){ne=(await Bh({session_key:`chat_${Date.now()}`})).id,U(ne);const ht=await bc(50).catch(()=>({sessions:[]}));O(ht.sessions||[])}const pe=[];for(const He of xe){const{url:ht}=await rk(He);pe.push(ht)}const _e=i?.aiProviders.find(He=>He.id===p),se=x||_e?.defaultModel||(H.length>0?H[0].id:""),Te={message:he||"Post the attached image(s) as requested.",provider:p,model:se||void 0,max_tokens:1024};if(pe.length>0&&(Te.attachment_urls=pe),L&&he===L.base_prompt.trim()&&L.required_integrations.length>0&&(Te.required_integrations=L.required_integrations),p==="openai"||p==="openrouter"||p==="ollama")h(He=>[...He,{role:"assistant",content:"",thinking:""}]),await Fh(ne,Te,{onDelta:He=>{h(ht=>{const Ue=[...ht],at=Ue[Ue.length-1];return at?.role==="assistant"&&(Ue[Ue.length-1]={...at,content:(at.content??"")+He}),Ue})},onThinking:He=>{h(ht=>{const Ue=[...ht],at=Ue[Ue.length-1];return at?.role==="assistant"&&(Ue[Ue.length-1]={...at,thinking:(at.thinking??"")+He}),Ue})},onDone:async He=>{if(h(ht=>{const Ue=[...ht],at=Ue[Ue.length-1];return at?.role==="assistant"&&(Ue[Ue.length-1]={...at,content:He}),Ue}),ne&&p!=="ollama")try{const ht=await ha(ne);h(ht.messages||[])}catch{}},onPendingApproval:He=>{V(!1),re(He)},onError:r,onMissingIntegrations:a?.onMissingIntegrations});else{const He=await ak(ne,Te);He.pendingActionId&&re(He.pendingActionId);const ht=await ha(ne);h(ht.messages||[])}}catch(ne){const pe=ne;Array.isArray(pe.missing)&&pe.missing.length>0&&a?.onMissingIntegrations?.(pe.missing),r(pe instanceof Error?pe.message:"Completion failed")}finally{V(!1)}},ie=()=>{U(null),h([]),re(null),z(null),r(null)},Q=async()=>{if(!X||!K)return;const he=K;try{await LS(X),re(null),z(null);const xe=await ha(he);h(xe.messages||[]);const ke=i?.aiProviders.find(_e=>_e.id===p),ne=x||ke?.defaultModel||(H.length>0?H[0].id:"");["openai","openrouter","ollama"].includes(p)&&(V(!0),h(_e=>[..._e,{role:"assistant",content:"",thinking:""}]),await Fh(he,{continue:!0,provider:p,model:ne||void 0,max_tokens:1024},{onDelta:_e=>{h(se=>{const Te=[...se],He=Te[Te.length-1];return He?.role==="assistant"&&(Te[Te.length-1]={...He,content:(He.content??"")+_e}),Te})},onThinking:_e=>{h(se=>{const Te=[...se],He=Te[Te.length-1];return He?.role==="assistant"&&(Te[Te.length-1]={...He,thinking:(He.thinking??"")+_e}),Te})},onDone:async()=>{try{const _e=await ha(he);h(_e.messages||[])}catch{}V(!1)},onPendingApproval:_e=>{re(_e),V(!1)},onError:_e=>{V(!1),r(_e)}}))}catch(xe){r(xe instanceof Error?xe.message:"Failed to approve")}finally{V(!1)}},G=async()=>{if(X)try{if(await IS(X),re(null),z(null),K){const he=await ha(K);h(he.messages||[])}}catch(he){r(he instanceof Error?he.message:"Failed to reject")}},H=p==="ollama"?(()=>{const he=new Set(w.map(ke=>ke.id)),xe=(sb.ollama||[]).filter(ke=>!he.has(ke.id));return[...w,...xe]})():p==="openrouter"&&w.length>0?w:sb[p]||[],J=he=>{b(he);try{localStorage.setItem(dc,he)}catch{}},ye=he=>{S(he);try{localStorage.setItem(th,he)}catch{}},Se=j.useMemo(()=>!Ce||A.some(xe=>xe.session_key===Ce)?A:[{id:"__unified_telegram__",session_key:Ce,updated_at:Date.now()},...A],[A,Ce]);return{config:i,configuredProviders:Ge,chatMessages:f,chatInput:m,setChatInput:y,chatProvider:p,setChatProvider:J,chatModel:x,setChatModel:ye,chatModels:w,chatModelsLoading:k,chatSessions:A,chatSessionsDisplay:Se,chatSessionsLoading:M,getSessionLabel:he=>he.session_key===Ce||he.id==="__unified_telegram__"?"Unified with Telegram":he.session_key,chatLoading:B,chatAgentSessionId:K,models:H,ollamaRunning:te,ollamaStatusLoading:Z,ollamaPullState:q,checkOllama:Ne,handleSelectSession:$e,handleChatSend:dt,sendMessage:ot,handleNewChat:ie,pendingActionId:X,pendingActionDetails:Y,pendingActionLoading:R,handleApprovePending:Q,handleRejectPending:G,setLastAppliedIdea:le,chatAttachments:oe,setChatAttachments:ve}}function lO({className:e,size:r="default",...a}){return d.jsx(_E,{"data-slot":"avatar","data-size":r,className:ze("group/avatar relative flex size-8 shrink-0 overflow-hidden rounded-full select-none data-[size=lg]:size-10 data-[size=sm]:size-6",e),...a})}function sO({className:e,...r}){return d.jsx(jE,{"data-slot":"avatar-fallback",className:ze("bg-muted text-muted-foreground flex size-full items-center justify-center rounded-full text-sm group-data-[size=sm]/avatar:text-xs",e),...r})}function Hh({className:e}){return d.jsxs("div",{className:ze("flex items-center gap-1",e),"aria-label":"Typing",children:[d.jsx("span",{className:"bg-foreground/70 inline-block size-1.5 animate-bounce rounded-full",style:{animationDuration:"0.6s",animationDelay:"0ms"}}),d.jsx("span",{className:"bg-foreground/70 inline-block size-1.5 animate-bounce rounded-full",style:{animationDuration:"0.6s",animationDelay:"0.15s"}}),d.jsx("span",{className:"bg-foreground/70 inline-block size-1.5 animate-bounce rounded-full",style:{animationDuration:"0.6s",animationDelay:"0.3s"}})]})}function oO({className:e}){return d.jsx("span",{className:ze("inline-block h-4 w-0.5 animate-pulse bg-foreground align-middle",e),"aria-hidden":!0})}function cO(e,r){const a={};return(e[e.length-1]===""?[...e,""]:e).join((a.padRight?" ":"")+","+(a.padLeft===!1?"":" ")).trim()}const uO=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,dO=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,fO={};function ob(e,r){return(fO.jsx?dO:uO).test(e)}const hO=/[ \t\n\f\r]/g;function mO(e){return typeof e=="object"?e.type==="text"?cb(e.value):!1:cb(e)}function cb(e){return e.replace(hO,"")===""}class Ps{constructor(r,a,i){this.normal=a,this.property=r,i&&(this.space=i)}}Ps.prototype.normal={};Ps.prototype.property={};Ps.prototype.space=void 0;function ok(e,r){const a={},i={};for(const s of e)Object.assign(a,s.property),Object.assign(i,s.normal);return new Ps(a,i,r)}function qh(e){return e.toLowerCase()}class bn{constructor(r,a){this.attribute=a,this.property=r}}bn.prototype.attribute="";bn.prototype.booleanish=!1;bn.prototype.boolean=!1;bn.prototype.commaOrSpaceSeparated=!1;bn.prototype.commaSeparated=!1;bn.prototype.defined=!1;bn.prototype.mustUseProperty=!1;bn.prototype.number=!1;bn.prototype.overloadedBoolean=!1;bn.prototype.property="";bn.prototype.spaceSeparated=!1;bn.prototype.space=void 0;let pO=0;const Ze=ni(),Ht=ni(),Gh=ni(),Ee=ni(),wt=ni(),Wi=ni(),An=ni();function ni(){return 2**++pO}const Yh=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ze,booleanish:Ht,commaOrSpaceSeparated:An,commaSeparated:Wi,number:Ee,overloadedBoolean:Gh,spaceSeparated:wt},Symbol.toStringTag,{value:"Module"})),rh=Object.keys(Yh);class qm extends bn{constructor(r,a,i,s){let o=-1;if(super(r,a),ub(this,"space",s),typeof i=="number")for(;++o<rh.length;){const u=rh[o];ub(this,rh[o],(i&Yh[u])===Yh[u])}}}qm.prototype.defined=!0;function ub(e,r,a){a&&(e[r]=a)}function cl(e){const r={},a={};for(const[i,s]of Object.entries(e.properties)){const o=new qm(i,e.transform(e.attributes||{},i),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(i)&&(o.mustUseProperty=!0),r[i]=o,a[qh(i)]=i,a[qh(o.attribute)]=i}return new Ps(r,a,e.space)}const ck=cl({properties:{ariaActiveDescendant:null,ariaAtomic:Ht,ariaAutoComplete:null,ariaBusy:Ht,ariaChecked:Ht,ariaColCount:Ee,ariaColIndex:Ee,ariaColSpan:Ee,ariaControls:wt,ariaCurrent:null,ariaDescribedBy:wt,ariaDetails:null,ariaDisabled:Ht,ariaDropEffect:wt,ariaErrorMessage:null,ariaExpanded:Ht,ariaFlowTo:wt,ariaGrabbed:Ht,ariaHasPopup:null,ariaHidden:Ht,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:wt,ariaLevel:Ee,ariaLive:null,ariaModal:Ht,ariaMultiLine:Ht,ariaMultiSelectable:Ht,ariaOrientation:null,ariaOwns:wt,ariaPlaceholder:null,ariaPosInSet:Ee,ariaPressed:Ht,ariaReadOnly:Ht,ariaRelevant:null,ariaRequired:Ht,ariaRoleDescription:wt,ariaRowCount:Ee,ariaRowIndex:Ee,ariaRowSpan:Ee,ariaSelected:Ht,ariaSetSize:Ee,ariaSort:null,ariaValueMax:Ee,ariaValueMin:Ee,ariaValueNow:Ee,ariaValueText:null,role:null},transform(e,r){return r==="role"?r:"aria-"+r.slice(4).toLowerCase()}});function uk(e,r){return r in e?e[r]:r}function dk(e,r){return uk(e,r.toLowerCase())}const gO=cl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Wi,acceptCharset:wt,accessKey:wt,action:null,allow:null,allowFullScreen:Ze,allowPaymentRequest:Ze,allowUserMedia:Ze,alt:null,as:null,async:Ze,autoCapitalize:null,autoComplete:wt,autoFocus:Ze,autoPlay:Ze,blocking:wt,capture:null,charSet:null,checked:Ze,cite:null,className:wt,cols:Ee,colSpan:null,content:null,contentEditable:Ht,controls:Ze,controlsList:wt,coords:Ee|Wi,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ze,defer:Ze,dir:null,dirName:null,disabled:Ze,download:Gh,draggable:Ht,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ze,formTarget:null,headers:wt,height:Ee,hidden:Gh,high:Ee,href:null,hrefLang:null,htmlFor:wt,httpEquiv:wt,id:null,imageSizes:null,imageSrcSet:null,inert:Ze,inputMode:null,integrity:null,is:null,isMap:Ze,itemId:null,itemProp:wt,itemRef:wt,itemScope:Ze,itemType:wt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ze,low:Ee,manifest:null,max:null,maxLength:Ee,media:null,method:null,min:null,minLength:Ee,multiple:Ze,muted:Ze,name:null,nonce:null,noModule:Ze,noValidate:Ze,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:Ze,optimum:Ee,pattern:null,ping:wt,placeholder:null,playsInline:Ze,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ze,referrerPolicy:null,rel:wt,required:Ze,reversed:Ze,rows:Ee,rowSpan:Ee,sandbox:wt,scope:null,scoped:Ze,seamless:Ze,selected:Ze,shadowRootClonable:Ze,shadowRootDelegatesFocus:Ze,shadowRootMode:null,shape:null,size:Ee,sizes:null,slot:null,span:Ee,spellCheck:Ht,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ee,step:null,style:null,tabIndex:Ee,target:null,title:null,translate:null,type:null,typeMustMatch:Ze,useMap:null,value:Ht,width:Ee,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:wt,axis:null,background:null,bgColor:null,border:Ee,borderColor:null,bottomMargin:Ee,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ze,declare:Ze,event:null,face:null,frame:null,frameBorder:null,hSpace:Ee,leftMargin:Ee,link:null,longDesc:null,lowSrc:null,marginHeight:Ee,marginWidth:Ee,noResize:Ze,noHref:Ze,noShade:Ze,noWrap:Ze,object:null,profile:null,prompt:null,rev:null,rightMargin:Ee,rules:null,scheme:null,scrolling:Ht,standby:null,summary:null,text:null,topMargin:Ee,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ee,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ze,disableRemotePlayback:Ze,prefix:null,property:null,results:Ee,security:null,unselectable:null},space:"html",transform:dk}),yO=cl({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:An,accentHeight:Ee,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ee,amplitude:Ee,arabicForm:null,ascent:Ee,attributeName:null,attributeType:null,azimuth:Ee,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ee,by:null,calcMode:null,capHeight:Ee,className:wt,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:Ee,diffuseConstant:Ee,direction:null,display:null,dur:null,divisor:Ee,dominantBaseline:null,download:Ze,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ee,enableBackground:null,end:null,event:null,exponent:Ee,externalResourcesRequired:null,fill:null,fillOpacity:Ee,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:Wi,g2:Wi,glyphName:Wi,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ee,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ee,horizOriginX:Ee,horizOriginY:Ee,id:null,ideographic:Ee,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ee,k:Ee,k1:Ee,k2:Ee,k3:Ee,k4:Ee,kernelMatrix:An,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ee,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:Ee,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:Ee,overlineThickness:Ee,paintOrder:null,panose1:null,path:null,pathLength:Ee,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:wt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ee,pointsAtY:Ee,pointsAtZ:Ee,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:An,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:An,rev:An,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:An,requiredFeatures:An,requiredFonts:An,requiredFormats:An,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:Ee,specularExponent:Ee,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ee,strikethroughThickness:Ee,string:null,stroke:null,strokeDashArray:An,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ee,strokeOpacity:Ee,strokeWidth:null,style:null,surfaceScale:Ee,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:An,tabIndex:Ee,tableValues:null,target:null,targetX:Ee,targetY:Ee,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:An,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ee,underlineThickness:Ee,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ee,values:null,vAlphabetic:Ee,vMathematical:Ee,vectorEffect:null,vHanging:Ee,vIdeographic:Ee,version:null,vertAdvY:Ee,vertOriginX:Ee,vertOriginY:Ee,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ee,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:uk}),fk=cl({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,r){return"xlink:"+r.slice(5).toLowerCase()}}),hk=cl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:dk}),mk=cl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,r){return"xml:"+r.slice(3).toLowerCase()}}),xO={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"},vO=/[A-Z]/g,db=/-[a-z]/g,bO=/^data[-\w.:]+$/i;function wO(e,r){const a=qh(r);let i=r,s=bn;if(a in e.normal)return e.property[e.normal[a]];if(a.length>4&&a.slice(0,4)==="data"&&bO.test(r)){if(r.charAt(4)==="-"){const o=r.slice(5).replace(db,kO);i="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=r.slice(4);if(!db.test(o)){let u=o.replace(vO,SO);u.charAt(0)!=="-"&&(u="-"+u),r="data"+u}}s=qm}return new s(i,r)}function SO(e){return"-"+e.toLowerCase()}function kO(e){return e.charAt(1).toUpperCase()}const _O=ok([ck,gO,fk,hk,mk],"html"),Gm=ok([ck,yO,fk,hk,mk],"svg");function jO(e){return e.join(" ").trim()}var Yi={},ah,fb;function CO(){if(fb)return ah;fb=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,a=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,f=/^\s+|\s+$/g,h=`
|
|
59
|
-
`,m="/",y="*",p="",b="comment",x="declaration";function S(_,k){if(typeof _!="string")throw new TypeError("First argument must be a string");if(!_)return[];k=k||{};var N=1,A=1;function O(E){var q=E.match(r);q&&(N+=q.length);var $=E.lastIndexOf(h);A=~$?E.length-$:A+E.length}function M(){var E={line:N,column:A};return function(q){return q.position=new D(E),K(),q}}function D(E){this.start=E,this.end={line:N,column:A},this.source=k.source}D.prototype.content=_;function B(E){var q=new Error(k.source+":"+N+":"+A+": "+E);if(q.reason=E,q.filename=k.source,q.line=N,q.column=A,q.source=_,!k.silent)throw q}function V(E){var q=E.exec(_);if(q){var $=q[0];return O($),_=_.slice($.length),q}}function K(){V(a)}function U(E){var q;for(E=E||[];q=te();)q!==!1&&E.push(q);return E}function te(){var E=M();if(!(m!=_.charAt(0)||y!=_.charAt(1))){for(var q=2;p!=_.charAt(q)&&(y!=_.charAt(q)||m!=_.charAt(q+1));)++q;if(q+=2,p===_.charAt(q-1))return B("End of comment missing");var $=_.slice(2,q-2);return A+=2,O($),_=_.slice(q),A+=2,E({type:b,comment:$})}}function I(){var E=M(),q=V(i);if(q){if(te(),!V(s))return B("property missing ':'");var $=V(o),X=E({type:x,property:w(q[0].replace(e,p)),value:$?w($[0].replace(e,p)):p});return V(u),X}}function Z(){var E=[];U(E);for(var q;q=I();)q!==!1&&(E.push(q),U(E));return E}return K(),Z()}function w(_){return _?_.replace(f,p):p}return ah=S,ah}var hb;function EO(){if(hb)return Yi;hb=1;var e=Yi&&Yi.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Yi,"__esModule",{value:!0}),Yi.default=a;const r=e(CO());function a(i,s){let o=null;if(!i||typeof i!="string")return o;const u=(0,r.default)(i),f=typeof s=="function";return u.forEach(h=>{if(h.type!=="declaration")return;const{property:m,value:y}=h;f?s(m,y,h):y&&(o=o||{},o[m]=y)}),o}return Yi}var is={},mb;function NO(){if(mb)return is;mb=1,Object.defineProperty(is,"__esModule",{value:!0}),is.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,r=/-([a-z])/g,a=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,o=function(m){return!m||a.test(m)||e.test(m)},u=function(m,y){return y.toUpperCase()},f=function(m,y){return"".concat(y,"-")},h=function(m,y){return y===void 0&&(y={}),o(m)?m:(m=m.toLowerCase(),y.reactCompat?m=m.replace(s,f):m=m.replace(i,f),m.replace(r,u))};return is.camelCase=h,is}var ls,pb;function AO(){if(pb)return ls;pb=1;var e=ls&&ls.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},r=e(EO()),a=NO();function i(s,o){var u={};return!s||typeof s!="string"||(0,r.default)(s,function(f,h){f&&h&&(u[(0,a.camelCase)(f,o)]=h)}),u}return i.default=i,ls=i,ls}var TO=AO();const RO=_s(TO),pk=gk("end"),Ym=gk("start");function gk(e){return r;function r(a){const i=a&&a.position&&a.position[e]||{};if(typeof i.line=="number"&&i.line>0&&typeof i.column=="number"&&i.column>0)return{line:i.line,column:i.column,offset:typeof i.offset=="number"&&i.offset>-1?i.offset:void 0}}}function OO(e){const r=Ym(e),a=pk(e);if(r&&a)return{start:r,end:a}}function ps(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?gb(e.position):"start"in e||"end"in e?gb(e):"line"in e||"column"in e?$h(e):""}function $h(e){return yb(e&&e.line)+":"+yb(e&&e.column)}function gb(e){return $h(e&&e.start)+"-"+$h(e&&e.end)}function yb(e){return e&&typeof e=="number"?e:1}class ln extends Error{constructor(r,a,i){super(),typeof a=="string"&&(i=a,a=void 0);let s="",o={},u=!1;if(a&&("line"in a&&"column"in a?o={place:a}:"start"in a&&"end"in a?o={place:a}:"type"in a?o={ancestors:[a],place:a.position}:o={...a}),typeof r=="string"?s=r:!o.cause&&r&&(u=!0,s=r.message,o.cause=r),!o.ruleId&&!o.source&&typeof i=="string"){const h=i.indexOf(":");h===-1?o.ruleId=i:(o.source=i.slice(0,h),o.ruleId=i.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=ps(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}}ln.prototype.file="";ln.prototype.name="";ln.prototype.reason="";ln.prototype.message="";ln.prototype.stack="";ln.prototype.column=void 0;ln.prototype.line=void 0;ln.prototype.ancestors=void 0;ln.prototype.cause=void 0;ln.prototype.fatal=void 0;ln.prototype.place=void 0;ln.prototype.ruleId=void 0;ln.prototype.source=void 0;const $m={}.hasOwnProperty,zO=new Map,MO=/[A-Z]/g,DO=new Set(["table","tbody","thead","tfoot","tr"]),LO=new Set(["td","th"]),yk="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function IO(e,r){if(!r||r.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const a=r.filePath||void 0;let i;if(r.development){if(typeof r.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");i=YO(a,r.jsxDEV)}else{if(typeof r.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof r.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");i=GO(a,r.jsx,r.jsxs)}const s={Fragment:r.Fragment,ancestors:[],components:r.components||{},create:i,elementAttributeNameCase:r.elementAttributeNameCase||"react",evaluater:r.createEvaluater?r.createEvaluater():void 0,filePath:a,ignoreInvalidStyle:r.ignoreInvalidStyle||!1,passKeys:r.passKeys!==!1,passNode:r.passNode||!1,schema:r.space==="svg"?Gm:_O,stylePropertyNameCase:r.stylePropertyNameCase||"dom",tableCellAlignToStyle:r.tableCellAlignToStyle!==!1},o=xk(s,e,void 0);return o&&typeof o!="string"?o:s.create(e,s.Fragment,{children:o||void 0},void 0)}function xk(e,r,a){if(r.type==="element")return PO(e,r,a);if(r.type==="mdxFlowExpression"||r.type==="mdxTextExpression")return UO(e,r);if(r.type==="mdxJsxFlowElement"||r.type==="mdxJsxTextElement")return FO(e,r,a);if(r.type==="mdxjsEsm")return BO(e,r);if(r.type==="root")return HO(e,r,a);if(r.type==="text")return qO(e,r)}function PO(e,r,a){const i=e.schema;let s=i;r.tagName.toLowerCase()==="svg"&&i.space==="html"&&(s=Gm,e.schema=s),e.ancestors.push(r);const o=bk(e,r.tagName,!1),u=$O(e,r);let f=Km(e,r);return DO.has(r.tagName)&&(f=f.filter(function(h){return typeof h=="string"?!mO(h):!0})),vk(e,u,o,r),Vm(u,f),e.ancestors.pop(),e.schema=i,e.create(r,o,u,a)}function UO(e,r){if(r.data&&r.data.estree&&e.evaluater){const i=r.data.estree.body[0];return i.type,e.evaluater.evaluateExpression(i.expression)}Ss(e,r.position)}function BO(e,r){if(r.data&&r.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(r.data.estree);Ss(e,r.position)}function FO(e,r,a){const i=e.schema;let s=i;r.name==="svg"&&i.space==="html"&&(s=Gm,e.schema=s),e.ancestors.push(r);const o=r.name===null?e.Fragment:bk(e,r.name,!0),u=VO(e,r),f=Km(e,r);return vk(e,u,o,r),Vm(u,f),e.ancestors.pop(),e.schema=i,e.create(r,o,u,a)}function HO(e,r,a){const i={};return Vm(i,Km(e,r)),e.create(r,e.Fragment,i,a)}function qO(e,r){return r.value}function vk(e,r,a,i){typeof a!="string"&&a!==e.Fragment&&e.passNode&&(r.node=i)}function Vm(e,r){if(r.length>0){const a=r.length>1?r:r[0];a&&(e.children=a)}}function GO(e,r,a){return i;function i(s,o,u,f){const m=Array.isArray(u.children)?a:r;return f?m(o,u,f):m(o,u)}}function YO(e,r){return a;function a(i,s,o,u){const f=Array.isArray(o.children),h=Ym(i);return r(s,o,u,f,{columnNumber:h?h.column-1:void 0,fileName:e,lineNumber:h?h.line:void 0},void 0)}}function $O(e,r){const a={};let i,s;for(s in r.properties)if(s!=="children"&&$m.call(r.properties,s)){const o=KO(e,s,r.properties[s]);if(o){const[u,f]=o;e.tableCellAlignToStyle&&u==="align"&&typeof f=="string"&&LO.has(r.tagName)?i=f:a[u]=f}}if(i){const o=a.style||(a.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return a}function VO(e,r){const a={};for(const i of r.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&e.evaluater){const o=i.data.estree.body[0];o.type;const u=o.expression;u.type;const f=u.properties[0];f.type,Object.assign(a,e.evaluater.evaluateExpression(f.argument))}else Ss(e,r.position);else{const s=i.name;let o;if(i.value&&typeof i.value=="object")if(i.value.data&&i.value.data.estree&&e.evaluater){const f=i.value.data.estree.body[0];f.type,o=e.evaluater.evaluateExpression(f.expression)}else Ss(e,r.position);else o=i.value===null?!0:i.value;a[s]=o}return a}function Km(e,r){const a=[];let i=-1;const s=e.passKeys?new Map:zO;for(;++i<r.children.length;){const o=r.children[i];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 m=s.get(h)||0;u=h+"-"+m,s.set(h,m+1)}}const f=xk(e,o,u);f!==void 0&&a.push(f)}return a}function KO(e,r,a){const i=wO(e.schema,r);if(!(a==null||typeof a=="number"&&Number.isNaN(a))){if(Array.isArray(a)&&(a=i.commaSeparated?cO(a):jO(a)),i.property==="style"){let s=typeof a=="object"?a:XO(e,String(a));return e.stylePropertyNameCase==="css"&&(s=ZO(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&i.space?xO[i.property]||i.property:i.attribute,a]}}function XO(e,r){try{return RO(r,{reactCompat:!0})}catch(a){if(e.ignoreInvalidStyle)return{};const i=a,s=new ln("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:i,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=yk+"#cannot-parse-style-attribute",s}}function bk(e,r,a){let i;if(!a)i={type:"Literal",value:r};else if(r.includes(".")){const s=r.split(".");let o=-1,u;for(;++o<s.length;){const f=ob(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}i=u}else i=ob(r)&&!/^[a-z]/.test(r)?{type:"Identifier",name:r}:{type:"Literal",value:r};if(i.type==="Literal"){const s=i.value;return $m.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(i);Ss(e)}function Ss(e,r){const a=new ln("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:r,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=yk+"#cannot-handle-mdx-estrees-without-createevaluater",a}function ZO(e){const r={};let a;for(a in e)$m.call(e,a)&&(r[QO(a)]=e[a]);return r}function QO(e){let r=e.replace(MO,WO);return r.slice(0,3)==="ms-"&&(r="-"+r),r}function WO(e){return"-"+e.toLowerCase()}const ih={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"]},JO={};function Xm(e,r){const a=JO,i=typeof a.includeImageAlt=="boolean"?a.includeImageAlt:!0,s=typeof a.includeHtml=="boolean"?a.includeHtml:!0;return wk(e,i,s)}function wk(e,r,a){if(ez(e)){if("value"in e)return e.type==="html"&&!a?"":e.value;if(r&&"alt"in e&&e.alt)return e.alt;if("children"in e)return xb(e.children,r,a)}return Array.isArray(e)?xb(e,r,a):""}function xb(e,r,a){const i=[];let s=-1;for(;++s<e.length;)i[s]=wk(e[s],r,a);return i.join("")}function ez(e){return!!(e&&typeof e=="object")}const vb=document.createElement("i");function Zm(e){const r="&"+e+";";vb.innerHTML=r;const a=vb.textContent;return a.charCodeAt(a.length-1)===59&&e!=="semi"||a===r?!1:a}function On(e,r,a,i){const s=e.length;let o=0,u;if(r<0?r=-r>s?0:s+r:r=r>s?s:r,a=a>0?a:0,i.length<1e4)u=Array.from(i),u.unshift(r,a),e.splice(...u);else for(a&&e.splice(r,a);o<i.length;)u=i.slice(o,o+1e4),u.unshift(r,0),e.splice(...u),o+=1e4,r+=1e4}function Gn(e,r){return e.length>0?(On(e,e.length,0,r),e):r}const bb={}.hasOwnProperty;function Sk(e){const r={};let a=-1;for(;++a<e.length;)tz(r,e[a]);return r}function tz(e,r){let a;for(a in r){const s=(bb.call(e,a)?e[a]:void 0)||(e[a]={}),o=r[a];let u;if(o)for(u in o){bb.call(s,u)||(s[u]=[]);const f=o[u];nz(s[u],Array.isArray(f)?f:f?[f]:[])}}}function nz(e,r){let a=-1;const i=[];for(;++a<r.length;)(r[a].add==="after"?e:i).push(r[a]);On(e,0,0,i)}function kk(e,r){const a=Number.parseInt(e,r);return a<9||a===11||a>13&&a<32||a>126&&a<160||a>55295&&a<57344||a>64975&&a<65008||(a&65535)===65535||(a&65535)===65534||a>1114111?"�":String.fromCodePoint(a)}function Wn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const cn=wa(/[A-Za-z]/),an=wa(/[\dA-Za-z]/),rz=wa(/[#-'*+\--9=?A-Z^-~]/);function Dc(e){return e!==null&&(e<32||e===127)}const Vh=wa(/\d/),az=wa(/[\dA-Fa-f]/),iz=wa(/[!-/:-@[-`{-~]/);function qe(e){return e!==null&&e<-2}function bt(e){return e!==null&&(e<0||e===32)}function tt(e){return e===-2||e===-1||e===32}const fu=wa(new RegExp("\\p{P}|\\p{S}","u")),Qa=wa(/\s/);function wa(e){return r;function r(a){return a!==null&&a>-1&&e.test(String.fromCharCode(a))}}function ul(e){const r=[];let a=-1,i=0,s=0;for(;++a<e.length;){const o=e.charCodeAt(a);let u="";if(o===37&&an(e.charCodeAt(a+1))&&an(e.charCodeAt(a+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(a+1);o<56320&&f>56319&&f<57344?(u=String.fromCharCode(o,f),s=1):u="�"}else u=String.fromCharCode(o);u&&(r.push(e.slice(i,a),encodeURIComponent(u)),i=a+s+1,u=""),s&&(a+=s,s=0)}return r.join("")+e.slice(i)}function lt(e,r,a,i){const s=i?i-1:Number.POSITIVE_INFINITY;let o=0;return u;function u(h){return tt(h)?(e.enter(a),f(h)):r(h)}function f(h){return tt(h)&&o++<s?(e.consume(h),f):(e.exit(a),r(h))}}const lz={tokenize:sz};function sz(e){const r=e.attempt(this.parser.constructs.contentInitial,i,s);let a;return r;function i(f){if(f===null){e.consume(f);return}return e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),lt(e,r,"linePrefix")}function s(f){return e.enter("paragraph"),o(f)}function o(f){const h=e.enter("chunkText",{contentType:"text",previous:a});return a&&(a.next=h),a=h,u(f)}function u(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return qe(f)?(e.consume(f),e.exit("chunkText"),o):(e.consume(f),u)}}const oz={tokenize:cz},wb={tokenize:uz};function cz(e){const r=this,a=[];let i=0,s,o,u;return f;function f(A){if(i<a.length){const O=a[i];return r.containerState=O[1],e.attempt(O[0].continuation,h,m)(A)}return m(A)}function h(A){if(i++,r.containerState._closeFlow){r.containerState._closeFlow=void 0,s&&N();const O=r.events.length;let M=O,D;for(;M--;)if(r.events[M][0]==="exit"&&r.events[M][1].type==="chunkFlow"){D=r.events[M][1].end;break}k(i);let B=O;for(;B<r.events.length;)r.events[B][1].end={...D},B++;return On(r.events,M+1,0,r.events.slice(O)),r.events.length=B,m(A)}return f(A)}function m(A){if(i===a.length){if(!s)return b(A);if(s.currentConstruct&&s.currentConstruct.concrete)return S(A);r.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return r.containerState={},e.check(wb,y,p)(A)}function y(A){return s&&N(),k(i),b(A)}function p(A){return r.parser.lazy[r.now().line]=i!==a.length,u=r.now().offset,S(A)}function b(A){return r.containerState={},e.attempt(wb,x,S)(A)}function x(A){return i++,a.push([r.currentConstruct,r.containerState]),b(A)}function S(A){if(A===null){s&&N(),k(0),e.consume(A);return}return s=s||r.parser.flow(r.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:o}),w(A)}function w(A){if(A===null){_(e.exit("chunkFlow"),!0),k(0),e.consume(A);return}return qe(A)?(e.consume(A),_(e.exit("chunkFlow")),i=0,r.interrupt=void 0,f):(e.consume(A),w)}function _(A,O){const M=r.sliceStream(A);if(O&&M.push(null),A.previous=o,o&&(o.next=A),o=A,s.defineSkip(A.start),s.write(M),r.parser.lazy[A.start.line]){let D=s.events.length;for(;D--;)if(s.events[D][1].start.offset<u&&(!s.events[D][1].end||s.events[D][1].end.offset>u))return;const B=r.events.length;let V=B,K,U;for(;V--;)if(r.events[V][0]==="exit"&&r.events[V][1].type==="chunkFlow"){if(K){U=r.events[V][1].end;break}K=!0}for(k(i),D=B;D<r.events.length;)r.events[D][1].end={...U},D++;On(r.events,V+1,0,r.events.slice(B)),r.events.length=D}}function k(A){let O=a.length;for(;O-- >A;){const M=a[O];r.containerState=M[1],M[0].exit.call(r,e)}a.length=A}function N(){s.write([null]),o=void 0,s=void 0,r.containerState._closeFlow=void 0}}function uz(e,r,a){return lt(e,e.attempt(this.parser.constructs.document,r,a),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function al(e){if(e===null||bt(e)||Qa(e))return 1;if(fu(e))return 2}function hu(e,r,a){const i=[];let s=-1;for(;++s<e.length;){const o=e[s].resolveAll;o&&!i.includes(o)&&(r=o(r,a),i.push(o))}return r}const Kh={name:"attention",resolveAll:dz,tokenize:fz};function dz(e,r){let a=-1,i,s,o,u,f,h,m,y;for(;++a<e.length;)if(e[a][0]==="enter"&&e[a][1].type==="attentionSequence"&&e[a][1]._close){for(i=a;i--;)if(e[i][0]==="exit"&&e[i][1].type==="attentionSequence"&&e[i][1]._open&&r.sliceSerialize(e[i][1]).charCodeAt(0)===r.sliceSerialize(e[a][1]).charCodeAt(0)){if((e[i][1]._close||e[a][1]._open)&&(e[a][1].end.offset-e[a][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[a][1].end.offset-e[a][1].start.offset)%3))continue;h=e[i][1].end.offset-e[i][1].start.offset>1&&e[a][1].end.offset-e[a][1].start.offset>1?2:1;const p={...e[i][1].end},b={...e[a][1].start};Sb(p,-h),Sb(b,h),u={type:h>1?"strongSequence":"emphasisSequence",start:p,end:{...e[i][1].end}},f={type:h>1?"strongSequence":"emphasisSequence",start:{...e[a][1].start},end:b},o={type:h>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[a][1].start}},s={type:h>1?"strong":"emphasis",start:{...u.start},end:{...f.end}},e[i][1].end={...u.start},e[a][1].start={...f.end},m=[],e[i][1].end.offset-e[i][1].start.offset&&(m=Gn(m,[["enter",e[i][1],r],["exit",e[i][1],r]])),m=Gn(m,[["enter",s,r],["enter",u,r],["exit",u,r],["enter",o,r]]),m=Gn(m,hu(r.parser.constructs.insideSpan.null,e.slice(i+1,a),r)),m=Gn(m,[["exit",o,r],["enter",f,r],["exit",f,r],["exit",s,r]]),e[a][1].end.offset-e[a][1].start.offset?(y=2,m=Gn(m,[["enter",e[a][1],r],["exit",e[a][1],r]])):y=0,On(e,i-1,a-i+3,m),a=i+m.length-y-2;break}}for(a=-1;++a<e.length;)e[a][1].type==="attentionSequence"&&(e[a][1].type="data");return e}function fz(e,r){const a=this.parser.constructs.attentionMarkers.null,i=this.previous,s=al(i);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 m=e.exit("attentionSequence"),y=al(h),p=!y||y===2&&s||a.includes(h),b=!s||s===2&&y||a.includes(i);return m._open=!!(o===42?p:p&&(s||!b)),m._close=!!(o===42?b:b&&(y||!p)),r(h)}}function Sb(e,r){e.column+=r,e.offset+=r,e._bufferIndex+=r}const hz={name:"autolink",tokenize:mz};function mz(e,r,a){let i=0;return s;function s(x){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(x){return cn(x)?(e.consume(x),u):x===64?a(x):m(x)}function u(x){return x===43||x===45||x===46||an(x)?(i=1,f(x)):m(x)}function f(x){return x===58?(e.consume(x),i=0,h):(x===43||x===45||x===46||an(x))&&i++<32?(e.consume(x),f):(i=0,m(x))}function h(x){return x===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.exit("autolink"),r):x===null||x===32||x===60||Dc(x)?a(x):(e.consume(x),h)}function m(x){return x===64?(e.consume(x),y):rz(x)?(e.consume(x),m):a(x)}function y(x){return an(x)?p(x):a(x)}function p(x){return x===46?(e.consume(x),i=0,y):x===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.exit("autolink"),r):b(x)}function b(x){if((x===45||an(x))&&i++<63){const S=x===45?b:p;return e.consume(x),S}return a(x)}}const Us={partial:!0,tokenize:pz};function pz(e,r,a){return i;function i(o){return tt(o)?lt(e,s,"linePrefix")(o):s(o)}function s(o){return o===null||qe(o)?r(o):a(o)}}const _k={continuation:{tokenize:yz},exit:xz,name:"blockQuote",tokenize:gz};function gz(e,r,a){const i=this;return s;function s(u){if(u===62){const f=i.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 a(u)}function o(u){return tt(u)?(e.enter("blockQuotePrefixWhitespace"),e.consume(u),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),r):(e.exit("blockQuotePrefix"),r(u))}}function yz(e,r,a){const i=this;return s;function s(u){return tt(u)?lt(e,o,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u):o(u)}function o(u){return e.attempt(_k,r,a)(u)}}function xz(e){e.exit("blockQuote")}const jk={name:"characterEscape",tokenize:vz};function vz(e,r,a){return i;function i(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),s}function s(o){return iz(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),r):a(o)}}const Ck={name:"characterReference",tokenize:bz};function bz(e,r,a){const i=this;let s=0,o,u;return f;function f(p){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),h}function h(p){return p===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(p),e.exit("characterReferenceMarkerNumeric"),m):(e.enter("characterReferenceValue"),o=31,u=an,y(p))}function m(p){return p===88||p===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(p),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,u=az,y):(e.enter("characterReferenceValue"),o=7,u=Vh,y(p))}function y(p){if(p===59&&s){const b=e.exit("characterReferenceValue");return u===an&&!Zm(i.sliceSerialize(b))?a(p):(e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),e.exit("characterReference"),r)}return u(p)&&s++<o?(e.consume(p),y):a(p)}}const kb={partial:!0,tokenize:Sz},_b={concrete:!0,name:"codeFenced",tokenize:wz};function wz(e,r,a){const i=this,s={partial:!0,tokenize:M};let o=0,u=0,f;return h;function h(D){return m(D)}function m(D){const B=i.events[i.events.length-1];return o=B&&B[1].type==="linePrefix"?B[2].sliceSerialize(B[1],!0).length:0,f=D,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),y(D)}function y(D){return D===f?(u++,e.consume(D),y):u<3?a(D):(e.exit("codeFencedFenceSequence"),tt(D)?lt(e,p,"whitespace")(D):p(D))}function p(D){return D===null||qe(D)?(e.exit("codeFencedFence"),i.interrupt?r(D):e.check(kb,w,O)(D)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),b(D))}function b(D){return D===null||qe(D)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),p(D)):tt(D)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),lt(e,x,"whitespace")(D)):D===96&&D===f?a(D):(e.consume(D),b)}function x(D){return D===null||qe(D)?p(D):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),S(D))}function S(D){return D===null||qe(D)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),p(D)):D===96&&D===f?a(D):(e.consume(D),S)}function w(D){return e.attempt(s,O,_)(D)}function _(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),k}function k(D){return o>0&&tt(D)?lt(e,N,"linePrefix",o+1)(D):N(D)}function N(D){return D===null||qe(D)?e.check(kb,w,O)(D):(e.enter("codeFlowValue"),A(D))}function A(D){return D===null||qe(D)?(e.exit("codeFlowValue"),N(D)):(e.consume(D),A)}function O(D){return e.exit("codeFenced"),r(D)}function M(D,B,V){let K=0;return U;function U(q){return D.enter("lineEnding"),D.consume(q),D.exit("lineEnding"),te}function te(q){return D.enter("codeFencedFence"),tt(q)?lt(D,I,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(q):I(q)}function I(q){return q===f?(D.enter("codeFencedFenceSequence"),Z(q)):V(q)}function Z(q){return q===f?(K++,D.consume(q),Z):K>=u?(D.exit("codeFencedFenceSequence"),tt(q)?lt(D,E,"whitespace")(q):E(q)):V(q)}function E(q){return q===null||qe(q)?(D.exit("codeFencedFence"),B(q)):V(q)}}}function Sz(e,r,a){const i=this;return s;function s(u){return u===null?a(u):(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),o)}function o(u){return i.parser.lazy[i.now().line]?a(u):r(u)}}const lh={name:"codeIndented",tokenize:_z},kz={partial:!0,tokenize:jz};function _z(e,r,a){const i=this;return s;function s(m){return e.enter("codeIndented"),lt(e,o,"linePrefix",5)(m)}function o(m){const y=i.events[i.events.length-1];return y&&y[1].type==="linePrefix"&&y[2].sliceSerialize(y[1],!0).length>=4?u(m):a(m)}function u(m){return m===null?h(m):qe(m)?e.attempt(kz,u,h)(m):(e.enter("codeFlowValue"),f(m))}function f(m){return m===null||qe(m)?(e.exit("codeFlowValue"),u(m)):(e.consume(m),f)}function h(m){return e.exit("codeIndented"),r(m)}}function jz(e,r,a){const i=this;return s;function s(u){return i.parser.lazy[i.now().line]?a(u):qe(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),s):lt(e,o,"linePrefix",5)(u)}function o(u){const f=i.events[i.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?r(u):qe(u)?s(u):a(u)}}const Cz={name:"codeText",previous:Nz,resolve:Ez,tokenize:Az};function Ez(e){let r=e.length-4,a=3,i,s;if((e[a][1].type==="lineEnding"||e[a][1].type==="space")&&(e[r][1].type==="lineEnding"||e[r][1].type==="space")){for(i=a;++i<r;)if(e[i][1].type==="codeTextData"){e[a][1].type="codeTextPadding",e[r][1].type="codeTextPadding",a+=2,r-=2;break}}for(i=a-1,r++;++i<=r;)s===void 0?i!==r&&e[i][1].type!=="lineEnding"&&(s=i):(i===r||e[i][1].type==="lineEnding")&&(e[s][1].type="codeTextData",i!==s+2&&(e[s][1].end=e[i-1][1].end,e.splice(s+2,i-s-2),r-=i-s-2,i=s+2),s=void 0);return e}function Nz(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Az(e,r,a){let i=0,s,o;return u;function u(p){return e.enter("codeText"),e.enter("codeTextSequence"),f(p)}function f(p){return p===96?(e.consume(p),i++,f):(e.exit("codeTextSequence"),h(p))}function h(p){return p===null?a(p):p===32?(e.enter("space"),e.consume(p),e.exit("space"),h):p===96?(o=e.enter("codeTextSequence"),s=0,y(p)):qe(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),h):(e.enter("codeTextData"),m(p))}function m(p){return p===null||p===32||p===96||qe(p)?(e.exit("codeTextData"),h(p)):(e.consume(p),m)}function y(p){return p===96?(e.consume(p),s++,y):s===i?(e.exit("codeTextSequence"),e.exit("codeText"),r(p)):(o.type="codeTextData",m(p))}}class Tz{constructor(r){this.left=r?[...r]:[],this.right=[]}get(r){if(r<0||r>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+r+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return r<this.left.length?this.left[r]:this.right[this.right.length-r+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(r,a){const i=a??Number.POSITIVE_INFINITY;return i<this.left.length?this.left.slice(r,i):r>this.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-r+this.left.length).reverse():this.left.slice(r).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(r,a,i){const s=a||0;this.setCursor(Math.trunc(r));const o=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return i&&ss(this.left,i),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(r){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(r)}pushMany(r){this.setCursor(Number.POSITIVE_INFINITY),ss(this.left,r)}unshift(r){this.setCursor(0),this.right.push(r)}unshiftMany(r){this.setCursor(0),ss(this.right,r.reverse())}setCursor(r){if(!(r===this.left.length||r>this.left.length&&this.right.length===0||r<0&&this.left.length===0))if(r<this.left.length){const a=this.left.splice(r,Number.POSITIVE_INFINITY);ss(this.right,a.reverse())}else{const a=this.right.splice(this.left.length+this.right.length-r,Number.POSITIVE_INFINITY);ss(this.left,a.reverse())}}}function ss(e,r){let a=0;if(r.length<1e4)e.push(...r);else for(;a<r.length;)e.push(...r.slice(a,a+1e4)),a+=1e4}function Ek(e){const r={};let a=-1,i,s,o,u,f,h,m;const y=new Tz(e);for(;++a<y.length;){for(;a in r;)a=r[a];if(i=y.get(a),a&&i[1].type==="chunkFlow"&&y.get(a-1)[1].type==="listItemPrefix"&&(h=i[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(i[0]==="enter")i[1].contentType&&(Object.assign(r,Rz(y,a)),a=r[a],m=!0);else if(i[1]._container){for(o=a,s=void 0;o--;)if(u=y.get(o),u[1].type==="lineEnding"||u[1].type==="lineEndingBlank")u[0]==="enter"&&(s&&(y.get(s)[1].type="lineEndingBlank"),u[1].type="lineEnding",s=o);else if(!(u[1].type==="linePrefix"||u[1].type==="listItemIndent"))break;s&&(i[1].end={...y.get(s)[1].start},f=y.slice(s,a),f.unshift(i),y.splice(s,a-s+1,f))}}return On(e,0,Number.POSITIVE_INFINITY,y.slice(0)),!m}function Rz(e,r){const a=e.get(r)[1],i=e.get(r)[2];let s=r-1;const o=[];let u=a._tokenizer;u||(u=i.parser[a.contentType](a.start),a._contentTypeTextTrailing&&(u._contentTypeTextTrailing=!0));const f=u.events,h=[],m={};let y,p,b=-1,x=a,S=0,w=0;const _=[w];for(;x;){for(;e.get(++s)[1]!==x;);o.push(s),x._tokenizer||(y=i.sliceStream(x),x.next||y.push(null),p&&u.defineSkip(x.start),x._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=!0),u.write(y),x._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=void 0)),p=x,x=x.next}for(x=a;++b<f.length;)f[b][0]==="exit"&&f[b-1][0]==="enter"&&f[b][1].type===f[b-1][1].type&&f[b][1].start.line!==f[b][1].end.line&&(w=b+1,_.push(w),x._tokenizer=void 0,x.previous=void 0,x=x.next);for(u.events=[],x?(x._tokenizer=void 0,x.previous=void 0):_.pop(),b=_.length;b--;){const k=f.slice(_[b],_[b+1]),N=o.pop();h.push([N,N+k.length-1]),e.splice(N,2,k)}for(h.reverse(),b=-1;++b<h.length;)m[S+h[b][0]]=S+h[b][1],S+=h[b][1]-h[b][0]-1;return m}const Oz={resolve:Mz,tokenize:Dz},zz={partial:!0,tokenize:Lz};function Mz(e){return Ek(e),e}function Dz(e,r){let a;return i;function i(f){return e.enter("content"),a=e.enter("chunkContent",{contentType:"content"}),s(f)}function s(f){return f===null?o(f):qe(f)?e.check(zz,u,o)(f):(e.consume(f),s)}function o(f){return e.exit("chunkContent"),e.exit("content"),r(f)}function u(f){return e.consume(f),e.exit("chunkContent"),a.next=e.enter("chunkContent",{contentType:"content",previous:a}),a=a.next,s}}function Lz(e,r,a){const i=this;return s;function s(u){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),lt(e,o,"linePrefix")}function o(u){if(u===null||qe(u))return a(u);const f=i.events[i.events.length-1];return!i.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?r(u):e.interrupt(i.parser.constructs.flow,a,r)(u)}}function Nk(e,r,a,i,s,o,u,f,h){const m=h||Number.POSITIVE_INFINITY;let y=0;return p;function p(k){return k===60?(e.enter(i),e.enter(s),e.enter(o),e.consume(k),e.exit(o),b):k===null||k===32||k===41||Dc(k)?a(k):(e.enter(i),e.enter(u),e.enter(f),e.enter("chunkString",{contentType:"string"}),w(k))}function b(k){return k===62?(e.enter(o),e.consume(k),e.exit(o),e.exit(s),e.exit(i),r):(e.enter(f),e.enter("chunkString",{contentType:"string"}),x(k))}function x(k){return k===62?(e.exit("chunkString"),e.exit(f),b(k)):k===null||k===60||qe(k)?a(k):(e.consume(k),k===92?S:x)}function S(k){return k===60||k===62||k===92?(e.consume(k),x):x(k)}function w(k){return!y&&(k===null||k===41||bt(k))?(e.exit("chunkString"),e.exit(f),e.exit(u),e.exit(i),r(k)):y<m&&k===40?(e.consume(k),y++,w):k===41?(e.consume(k),y--,w):k===null||k===32||k===40||Dc(k)?a(k):(e.consume(k),k===92?_:w)}function _(k){return k===40||k===41||k===92?(e.consume(k),w):w(k)}}function Ak(e,r,a,i,s,o){const u=this;let f=0,h;return m;function m(x){return e.enter(i),e.enter(s),e.consume(x),e.exit(s),e.enter(o),y}function y(x){return f>999||x===null||x===91||x===93&&!h||x===94&&!f&&"_hiddenFootnoteSupport"in u.parser.constructs?a(x):x===93?(e.exit(o),e.enter(s),e.consume(x),e.exit(s),e.exit(i),r):qe(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),y):(e.enter("chunkString",{contentType:"string"}),p(x))}function p(x){return x===null||x===91||x===93||qe(x)||f++>999?(e.exit("chunkString"),y(x)):(e.consume(x),h||(h=!tt(x)),x===92?b:p)}function b(x){return x===91||x===92||x===93?(e.consume(x),f++,p):p(x)}}function Tk(e,r,a,i,s,o){let u;return f;function f(b){return b===34||b===39||b===40?(e.enter(i),e.enter(s),e.consume(b),e.exit(s),u=b===40?41:b,h):a(b)}function h(b){return b===u?(e.enter(s),e.consume(b),e.exit(s),e.exit(i),r):(e.enter(o),m(b))}function m(b){return b===u?(e.exit(o),h(u)):b===null?a(b):qe(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),lt(e,m,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),y(b))}function y(b){return b===u||b===null||qe(b)?(e.exit("chunkString"),m(b)):(e.consume(b),b===92?p:y)}function p(b){return b===u||b===92?(e.consume(b),y):y(b)}}function gs(e,r){let a;return i;function i(s){return qe(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),a=!0,i):tt(s)?lt(e,i,a?"linePrefix":"lineSuffix")(s):r(s)}}const Iz={name:"definition",tokenize:Uz},Pz={partial:!0,tokenize:Bz};function Uz(e,r,a){const i=this;let s;return o;function o(x){return e.enter("definition"),u(x)}function u(x){return Ak.call(i,e,f,a,"definitionLabel","definitionLabelMarker","definitionLabelString")(x)}function f(x){return s=Wn(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),h):a(x)}function h(x){return bt(x)?gs(e,m)(x):m(x)}function m(x){return Nk(e,y,a,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(x)}function y(x){return e.attempt(Pz,p,p)(x)}function p(x){return tt(x)?lt(e,b,"whitespace")(x):b(x)}function b(x){return x===null||qe(x)?(e.exit("definition"),i.parser.defined.push(s),r(x)):a(x)}}function Bz(e,r,a){return i;function i(f){return bt(f)?gs(e,s)(f):a(f)}function s(f){return Tk(e,o,a,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function o(f){return tt(f)?lt(e,u,"whitespace")(f):u(f)}function u(f){return f===null||qe(f)?r(f):a(f)}}const Fz={name:"hardBreakEscape",tokenize:Hz};function Hz(e,r,a){return i;function i(o){return e.enter("hardBreakEscape"),e.consume(o),s}function s(o){return qe(o)?(e.exit("hardBreakEscape"),r(o)):a(o)}}const qz={name:"headingAtx",resolve:Gz,tokenize:Yz};function Gz(e,r){let a=e.length-2,i=3,s,o;return e[i][1].type==="whitespace"&&(i+=2),a-2>i&&e[a][1].type==="whitespace"&&(a-=2),e[a][1].type==="atxHeadingSequence"&&(i===a-1||a-4>i&&e[a-2][1].type==="whitespace")&&(a-=i+1===a?2:4),a>i&&(s={type:"atxHeadingText",start:e[i][1].start,end:e[a][1].end},o={type:"chunkText",start:e[i][1].start,end:e[a][1].end,contentType:"text"},On(e,i,a-i+1,[["enter",s,r],["enter",o,r],["exit",o,r],["exit",s,r]])),e}function Yz(e,r,a){let i=0;return s;function s(y){return e.enter("atxHeading"),o(y)}function o(y){return e.enter("atxHeadingSequence"),u(y)}function u(y){return y===35&&i++<6?(e.consume(y),u):y===null||bt(y)?(e.exit("atxHeadingSequence"),f(y)):a(y)}function f(y){return y===35?(e.enter("atxHeadingSequence"),h(y)):y===null||qe(y)?(e.exit("atxHeading"),r(y)):tt(y)?lt(e,f,"whitespace")(y):(e.enter("atxHeadingText"),m(y))}function h(y){return y===35?(e.consume(y),h):(e.exit("atxHeadingSequence"),f(y))}function m(y){return y===null||y===35||bt(y)?(e.exit("atxHeadingText"),f(y)):(e.consume(y),m)}}const $z=["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"],jb=["pre","script","style","textarea"],Vz={concrete:!0,name:"htmlFlow",resolveTo:Zz,tokenize:Qz},Kz={partial:!0,tokenize:Jz},Xz={partial:!0,tokenize:Wz};function Zz(e){let r=e.length;for(;r--&&!(e[r][0]==="enter"&&e[r][1].type==="htmlFlow"););return r>1&&e[r-2][1].type==="linePrefix"&&(e[r][1].start=e[r-2][1].start,e[r+1][1].start=e[r-2][1].start,e.splice(r-2,2)),e}function Qz(e,r,a){const i=this;let s,o,u,f,h;return m;function m(L){return y(L)}function y(L){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(L),p}function p(L){return L===33?(e.consume(L),b):L===47?(e.consume(L),o=!0,w):L===63?(e.consume(L),s=3,i.interrupt?r:z):cn(L)?(e.consume(L),u=String.fromCharCode(L),_):a(L)}function b(L){return L===45?(e.consume(L),s=2,x):L===91?(e.consume(L),s=5,f=0,S):cn(L)?(e.consume(L),s=4,i.interrupt?r:z):a(L)}function x(L){return L===45?(e.consume(L),i.interrupt?r:z):a(L)}function S(L){const le="CDATA[";return L===le.charCodeAt(f++)?(e.consume(L),f===le.length?i.interrupt?r:I:S):a(L)}function w(L){return cn(L)?(e.consume(L),u=String.fromCharCode(L),_):a(L)}function _(L){if(L===null||L===47||L===62||bt(L)){const le=L===47,oe=u.toLowerCase();return!le&&!o&&jb.includes(oe)?(s=1,i.interrupt?r(L):I(L)):$z.includes(u.toLowerCase())?(s=6,le?(e.consume(L),k):i.interrupt?r(L):I(L)):(s=7,i.interrupt&&!i.parser.lazy[i.now().line]?a(L):o?N(L):A(L))}return L===45||an(L)?(e.consume(L),u+=String.fromCharCode(L),_):a(L)}function k(L){return L===62?(e.consume(L),i.interrupt?r:I):a(L)}function N(L){return tt(L)?(e.consume(L),N):U(L)}function A(L){return L===47?(e.consume(L),U):L===58||L===95||cn(L)?(e.consume(L),O):tt(L)?(e.consume(L),A):U(L)}function O(L){return L===45||L===46||L===58||L===95||an(L)?(e.consume(L),O):M(L)}function M(L){return L===61?(e.consume(L),D):tt(L)?(e.consume(L),M):A(L)}function D(L){return L===null||L===60||L===61||L===62||L===96?a(L):L===34||L===39?(e.consume(L),h=L,B):tt(L)?(e.consume(L),D):V(L)}function B(L){return L===h?(e.consume(L),h=null,K):L===null||qe(L)?a(L):(e.consume(L),B)}function V(L){return L===null||L===34||L===39||L===47||L===60||L===61||L===62||L===96||bt(L)?M(L):(e.consume(L),V)}function K(L){return L===47||L===62||tt(L)?A(L):a(L)}function U(L){return L===62?(e.consume(L),te):a(L)}function te(L){return L===null||qe(L)?I(L):tt(L)?(e.consume(L),te):a(L)}function I(L){return L===45&&s===2?(e.consume(L),$):L===60&&s===1?(e.consume(L),X):L===62&&s===4?(e.consume(L),R):L===63&&s===3?(e.consume(L),z):L===93&&s===5?(e.consume(L),Y):qe(L)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(Kz,F,Z)(L)):L===null||qe(L)?(e.exit("htmlFlowData"),Z(L)):(e.consume(L),I)}function Z(L){return e.check(Xz,E,F)(L)}function E(L){return e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),q}function q(L){return L===null||qe(L)?Z(L):(e.enter("htmlFlowData"),I(L))}function $(L){return L===45?(e.consume(L),z):I(L)}function X(L){return L===47?(e.consume(L),u="",re):I(L)}function re(L){if(L===62){const le=u.toLowerCase();return jb.includes(le)?(e.consume(L),R):I(L)}return cn(L)&&u.length<8?(e.consume(L),u+=String.fromCharCode(L),re):I(L)}function Y(L){return L===93?(e.consume(L),z):I(L)}function z(L){return L===62?(e.consume(L),R):L===45&&s===2?(e.consume(L),z):I(L)}function R(L){return L===null||qe(L)?(e.exit("htmlFlowData"),F(L)):(e.consume(L),R)}function F(L){return e.exit("htmlFlow"),r(L)}}function Wz(e,r,a){const i=this;return s;function s(u){return qe(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),o):a(u)}function o(u){return i.parser.lazy[i.now().line]?a(u):r(u)}}function Jz(e,r,a){return i;function i(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(Us,r,a)}}const eM={name:"htmlText",tokenize:tM};function tM(e,r,a){const i=this;let s,o,u;return f;function f(z){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(z),h}function h(z){return z===33?(e.consume(z),m):z===47?(e.consume(z),M):z===63?(e.consume(z),A):cn(z)?(e.consume(z),V):a(z)}function m(z){return z===45?(e.consume(z),y):z===91?(e.consume(z),o=0,S):cn(z)?(e.consume(z),N):a(z)}function y(z){return z===45?(e.consume(z),x):a(z)}function p(z){return z===null?a(z):z===45?(e.consume(z),b):qe(z)?(u=p,X(z)):(e.consume(z),p)}function b(z){return z===45?(e.consume(z),x):p(z)}function x(z){return z===62?$(z):z===45?b(z):p(z)}function S(z){const R="CDATA[";return z===R.charCodeAt(o++)?(e.consume(z),o===R.length?w:S):a(z)}function w(z){return z===null?a(z):z===93?(e.consume(z),_):qe(z)?(u=w,X(z)):(e.consume(z),w)}function _(z){return z===93?(e.consume(z),k):w(z)}function k(z){return z===62?$(z):z===93?(e.consume(z),k):w(z)}function N(z){return z===null||z===62?$(z):qe(z)?(u=N,X(z)):(e.consume(z),N)}function A(z){return z===null?a(z):z===63?(e.consume(z),O):qe(z)?(u=A,X(z)):(e.consume(z),A)}function O(z){return z===62?$(z):A(z)}function M(z){return cn(z)?(e.consume(z),D):a(z)}function D(z){return z===45||an(z)?(e.consume(z),D):B(z)}function B(z){return qe(z)?(u=B,X(z)):tt(z)?(e.consume(z),B):$(z)}function V(z){return z===45||an(z)?(e.consume(z),V):z===47||z===62||bt(z)?K(z):a(z)}function K(z){return z===47?(e.consume(z),$):z===58||z===95||cn(z)?(e.consume(z),U):qe(z)?(u=K,X(z)):tt(z)?(e.consume(z),K):$(z)}function U(z){return z===45||z===46||z===58||z===95||an(z)?(e.consume(z),U):te(z)}function te(z){return z===61?(e.consume(z),I):qe(z)?(u=te,X(z)):tt(z)?(e.consume(z),te):K(z)}function I(z){return z===null||z===60||z===61||z===62||z===96?a(z):z===34||z===39?(e.consume(z),s=z,Z):qe(z)?(u=I,X(z)):tt(z)?(e.consume(z),I):(e.consume(z),E)}function Z(z){return z===s?(e.consume(z),s=void 0,q):z===null?a(z):qe(z)?(u=Z,X(z)):(e.consume(z),Z)}function E(z){return z===null||z===34||z===39||z===60||z===61||z===96?a(z):z===47||z===62||bt(z)?K(z):(e.consume(z),E)}function q(z){return z===47||z===62||bt(z)?K(z):a(z)}function $(z){return z===62?(e.consume(z),e.exit("htmlTextData"),e.exit("htmlText"),r):a(z)}function X(z){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),re}function re(z){return tt(z)?lt(e,Y,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):Y(z)}function Y(z){return e.enter("htmlTextData"),u(z)}}const Qm={name:"labelEnd",resolveAll:iM,resolveTo:lM,tokenize:sM},nM={tokenize:oM},rM={tokenize:cM},aM={tokenize:uM};function iM(e){let r=-1;const a=[];for(;++r<e.length;){const i=e[r][1];if(a.push(e[r]),i.type==="labelImage"||i.type==="labelLink"||i.type==="labelEnd"){const s=i.type==="labelImage"?4:2;i.type="data",r+=s}}return e.length!==a.length&&On(e,0,e.length,a),e}function lM(e,r){let a=e.length,i=0,s,o,u,f;for(;a--;)if(s=e[a][1],o){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[a][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(u){if(e[a][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(o=a,s.type!=="labelLink")){i=2;break}}else s.type==="labelEnd"&&(u=a);const h={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},m={type:"label",start:{...e[o][1].start},end:{...e[u][1].end}},y={type:"labelText",start:{...e[o+i+2][1].end},end:{...e[u-2][1].start}};return f=[["enter",h,r],["enter",m,r]],f=Gn(f,e.slice(o+1,o+i+3)),f=Gn(f,[["enter",y,r]]),f=Gn(f,hu(r.parser.constructs.insideSpan.null,e.slice(o+i+4,u-3),r)),f=Gn(f,[["exit",y,r],e[u-2],e[u-1],["exit",m,r]]),f=Gn(f,e.slice(u+1)),f=Gn(f,[["exit",h,r]]),On(e,o,e.length,f),e}function sM(e,r,a){const i=this;let s=i.events.length,o,u;for(;s--;)if((i.events[s][1].type==="labelImage"||i.events[s][1].type==="labelLink")&&!i.events[s][1]._balanced){o=i.events[s][1];break}return f;function f(b){return o?o._inactive?p(b):(u=i.parser.defined.includes(Wn(i.sliceSerialize({start:o.end,end:i.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(b),e.exit("labelMarker"),e.exit("labelEnd"),h):a(b)}function h(b){return b===40?e.attempt(nM,y,u?y:p)(b):b===91?e.attempt(rM,y,u?m:p)(b):u?y(b):p(b)}function m(b){return e.attempt(aM,y,p)(b)}function y(b){return r(b)}function p(b){return o._balanced=!0,a(b)}}function oM(e,r,a){return i;function i(p){return e.enter("resource"),e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),s}function s(p){return bt(p)?gs(e,o)(p):o(p)}function o(p){return p===41?y(p):Nk(e,u,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function u(p){return bt(p)?gs(e,h)(p):y(p)}function f(p){return a(p)}function h(p){return p===34||p===39||p===40?Tk(e,m,a,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):y(p)}function m(p){return bt(p)?gs(e,y)(p):y(p)}function y(p){return p===41?(e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),e.exit("resource"),r):a(p)}}function cM(e,r,a){const i=this;return s;function s(f){return Ak.call(i,e,o,u,"reference","referenceMarker","referenceString")(f)}function o(f){return i.parser.defined.includes(Wn(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?r(f):a(f)}function u(f){return a(f)}}function uM(e,r,a){return i;function i(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"),r):a(o)}}const dM={name:"labelStartImage",resolveAll:Qm.resolveAll,tokenize:fM};function fM(e,r,a){const i=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):a(f)}function u(f){return f===94&&"_hiddenFootnoteSupport"in i.parser.constructs?a(f):r(f)}}const hM={name:"labelStartLink",resolveAll:Qm.resolveAll,tokenize:mM};function mM(e,r,a){const i=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 i.parser.constructs?a(u):r(u)}}const sh={name:"lineEnding",tokenize:pM};function pM(e,r){return a;function a(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),lt(e,r,"linePrefix")}}const wc={name:"thematicBreak",tokenize:gM};function gM(e,r,a){let i=0,s;return o;function o(m){return e.enter("thematicBreak"),u(m)}function u(m){return s=m,f(m)}function f(m){return m===s?(e.enter("thematicBreakSequence"),h(m)):i>=3&&(m===null||qe(m))?(e.exit("thematicBreak"),r(m)):a(m)}function h(m){return m===s?(e.consume(m),i++,h):(e.exit("thematicBreakSequence"),tt(m)?lt(e,f,"whitespace")(m):f(m))}}const vn={continuation:{tokenize:bM},exit:SM,name:"list",tokenize:vM},yM={partial:!0,tokenize:kM},xM={partial:!0,tokenize:wM};function vM(e,r,a){const i=this,s=i.events[i.events.length-1];let o=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,u=0;return f;function f(x){const S=i.containerState.type||(x===42||x===43||x===45?"listUnordered":"listOrdered");if(S==="listUnordered"?!i.containerState.marker||x===i.containerState.marker:Vh(x)){if(i.containerState.type||(i.containerState.type=S,e.enter(S,{_container:!0})),S==="listUnordered")return e.enter("listItemPrefix"),x===42||x===45?e.check(wc,a,m)(x):m(x);if(!i.interrupt||x===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),h(x)}return a(x)}function h(x){return Vh(x)&&++u<10?(e.consume(x),h):(!i.interrupt||u<2)&&(i.containerState.marker?x===i.containerState.marker:x===41||x===46)?(e.exit("listItemValue"),m(x)):a(x)}function m(x){return e.enter("listItemMarker"),e.consume(x),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||x,e.check(Us,i.interrupt?a:y,e.attempt(yM,b,p))}function y(x){return i.containerState.initialBlankLine=!0,o++,b(x)}function p(x){return tt(x)?(e.enter("listItemPrefixWhitespace"),e.consume(x),e.exit("listItemPrefixWhitespace"),b):a(x)}function b(x){return i.containerState.size=o+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,r(x)}}function bM(e,r,a){const i=this;return i.containerState._closeFlow=void 0,e.check(Us,s,o);function s(f){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,lt(e,r,"listItemIndent",i.containerState.size+1)(f)}function o(f){return i.containerState.furtherBlankLines||!tt(f)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,u(f)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(xM,r,u)(f))}function u(f){return i.containerState._closeFlow=!0,i.interrupt=void 0,lt(e,e.attempt(vn,r,a),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function wM(e,r,a){const i=this;return lt(e,s,"listItemIndent",i.containerState.size+1);function s(o){const u=i.events[i.events.length-1];return u&&u[1].type==="listItemIndent"&&u[2].sliceSerialize(u[1],!0).length===i.containerState.size?r(o):a(o)}}function SM(e){e.exit(this.containerState.type)}function kM(e,r,a){const i=this;return lt(e,s,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(o){const u=i.events[i.events.length-1];return!tt(o)&&u&&u[1].type==="listItemPrefixWhitespace"?r(o):a(o)}}const Cb={name:"setextUnderline",resolveTo:_M,tokenize:jM};function _M(e,r){let a=e.length,i,s,o;for(;a--;)if(e[a][0]==="enter"){if(e[a][1].type==="content"){i=a;break}e[a][1].type==="paragraph"&&(s=a)}else e[a][1].type==="content"&&e.splice(a,1),!o&&e[a][1].type==="definition"&&(o=a);const u={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",o?(e.splice(s,0,["enter",u,r]),e.splice(o+1,0,["exit",e[i][1],r]),e[i][1].end={...e[o][1].end}):e[i][1]=u,e.push(["exit",u,r]),e}function jM(e,r,a){const i=this;let s;return o;function o(m){let y=i.events.length,p;for(;y--;)if(i.events[y][1].type!=="lineEnding"&&i.events[y][1].type!=="linePrefix"&&i.events[y][1].type!=="content"){p=i.events[y][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||p)?(e.enter("setextHeadingLine"),s=m,u(m)):a(m)}function u(m){return e.enter("setextHeadingLineSequence"),f(m)}function f(m){return m===s?(e.consume(m),f):(e.exit("setextHeadingLineSequence"),tt(m)?lt(e,h,"lineSuffix")(m):h(m))}function h(m){return m===null||qe(m)?(e.exit("setextHeadingLine"),r(m)):a(m)}}const CM={tokenize:EM};function EM(e){const r=this,a=e.attempt(Us,i,e.attempt(this.parser.constructs.flowInitial,s,lt(e,e.attempt(this.parser.constructs.flow,s,e.attempt(Oz,s)),"linePrefix")));return a;function i(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),r.currentConstruct=void 0,a}function s(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),r.currentConstruct=void 0,a}}const NM={resolveAll:Ok()},AM=Rk("string"),TM=Rk("text");function Rk(e){return{resolveAll:Ok(e==="text"?RM:void 0),tokenize:r};function r(a){const i=this,s=this.parser.constructs[e],o=a.attempt(s,u,f);return u;function u(y){return m(y)?o(y):f(y)}function f(y){if(y===null){a.consume(y);return}return a.enter("data"),a.consume(y),h}function h(y){return m(y)?(a.exit("data"),o(y)):(a.consume(y),h)}function m(y){if(y===null)return!0;const p=s[y];let b=-1;if(p)for(;++b<p.length;){const x=p[b];if(!x.previous||x.previous.call(i,i.previous))return!0}return!1}}}function Ok(e){return r;function r(a,i){let s=-1,o;for(;++s<=a.length;)o===void 0?a[s]&&a[s][1].type==="data"&&(o=s,s++):(!a[s]||a[s][1].type!=="data")&&(s!==o+2&&(a[o][1].end=a[s-1][1].end,a.splice(o+2,s-o-2),s=o+2),o=void 0);return e?e(a,i):a}}function RM(e,r){let a=0;for(;++a<=e.length;)if((a===e.length||e[a][1].type==="lineEnding")&&e[a-1][1].type==="data"){const i=e[a-1][1],s=r.sliceStream(i);let o=s.length,u=-1,f=0,h;for(;o--;){const m=s[o];if(typeof m=="string"){for(u=m.length;m.charCodeAt(u-1)===32;)f++,u--;if(u)break;u=-1}else if(m===-2)h=!0,f++;else if(m!==-1){o++;break}}if(r._contentTypeTextTrailing&&a===e.length&&(f=0),f){const m={type:a===e.length||h||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?u:i.start._bufferIndex+u,_index:i.start._index+o,line:i.end.line,column:i.end.column-f,offset:i.end.offset-f},end:{...i.end}};i.end={...m.start},i.start.offset===i.end.offset?Object.assign(i,m):(e.splice(a,0,["enter",m,r],["exit",m,r]),a+=2)}a++}return e}const OM={42:vn,43:vn,45:vn,48:vn,49:vn,50:vn,51:vn,52:vn,53:vn,54:vn,55:vn,56:vn,57:vn,62:_k},zM={91:Iz},MM={[-2]:lh,[-1]:lh,32:lh},DM={35:qz,42:wc,45:[Cb,wc],60:Vz,61:Cb,95:wc,96:_b,126:_b},LM={38:Ck,92:jk},IM={[-5]:sh,[-4]:sh,[-3]:sh,33:dM,38:Ck,42:Kh,60:[hz,eM],91:hM,92:[Fz,jk],93:Qm,95:Kh,96:Cz},PM={null:[Kh,NM]},UM={null:[42,95]},BM={null:[]},FM=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:UM,contentInitial:zM,disable:BM,document:OM,flow:DM,flowInitial:MM,insideSpan:PM,string:LM,text:IM},Symbol.toStringTag,{value:"Module"}));function HM(e,r,a){let i={_bufferIndex:-1,_index:0,line:a&&a.line||1,column:a&&a.column||1,offset:a&&a.offset||0};const s={},o=[];let u=[],f=[];const h={attempt:B(M),check:B(D),consume:N,enter:A,exit:O,interrupt:B(D,{interrupt:!0})},m={code:null,containerState:{},defineSkip:w,events:[],now:S,parser:e,previous:null,sliceSerialize:b,sliceStream:x,write:p};let y=r.tokenize.call(m,h);return r.resolveAll&&o.push(r),m;function p(te){return u=Gn(u,te),_(),u[u.length-1]!==null?[]:(V(r,0),m.events=hu(o,m.events,m),m.events)}function b(te,I){return GM(x(te),I)}function x(te){return qM(u,te)}function S(){const{_bufferIndex:te,_index:I,line:Z,column:E,offset:q}=i;return{_bufferIndex:te,_index:I,line:Z,column:E,offset:q}}function w(te){s[te.line]=te.column,U()}function _(){let te;for(;i._index<u.length;){const I=u[i._index];if(typeof I=="string")for(te=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===te&&i._bufferIndex<I.length;)k(I.charCodeAt(i._bufferIndex));else k(I)}}function k(te){y=y(te)}function N(te){qe(te)?(i.line++,i.column=1,i.offset+=te===-3?2:1,U()):te!==-1&&(i.column++,i.offset++),i._bufferIndex<0?i._index++:(i._bufferIndex++,i._bufferIndex===u[i._index].length&&(i._bufferIndex=-1,i._index++)),m.previous=te}function A(te,I){const Z=I||{};return Z.type=te,Z.start=S(),m.events.push(["enter",Z,m]),f.push(Z),Z}function O(te){const I=f.pop();return I.end=S(),m.events.push(["exit",I,m]),I}function M(te,I){V(te,I.from)}function D(te,I){I.restore()}function B(te,I){return Z;function Z(E,q,$){let X,re,Y,z;return Array.isArray(E)?F(E):"tokenize"in E?F([E]):R(E);function R(ve){return Ce;function Ce(Ae){const Ne=Ae!==null&&ve[Ae],Ge=Ae!==null&&ve.null,$e=[...Array.isArray(Ne)?Ne:Ne?[Ne]:[],...Array.isArray(Ge)?Ge:Ge?[Ge]:[]];return F($e)(Ae)}}function F(ve){return X=ve,re=0,ve.length===0?$:L(ve[re])}function L(ve){return Ce;function Ce(Ae){return z=K(),Y=ve,ve.partial||(m.currentConstruct=ve),ve.name&&m.parser.constructs.disable.null.includes(ve.name)?oe():ve.tokenize.call(I?Object.assign(Object.create(m),I):m,h,le,oe)(Ae)}}function le(ve){return te(Y,z),q}function oe(ve){return z.restore(),++re<X.length?L(X[re]):$}}}function V(te,I){te.resolveAll&&!o.includes(te)&&o.push(te),te.resolve&&On(m.events,I,m.events.length-I,te.resolve(m.events.slice(I),m)),te.resolveTo&&(m.events=te.resolveTo(m.events,m))}function K(){const te=S(),I=m.previous,Z=m.currentConstruct,E=m.events.length,q=Array.from(f);return{from:E,restore:$};function $(){i=te,m.previous=I,m.currentConstruct=Z,m.events.length=E,f=q,U()}}function U(){i.line in s&&i.column<2&&(i.column=s[i.line],i.offset+=s[i.line]-1)}}function qM(e,r){const a=r.start._index,i=r.start._bufferIndex,s=r.end._index,o=r.end._bufferIndex;let u;if(a===s)u=[e[a].slice(i,o)];else{if(u=e.slice(a,s),i>-1){const f=u[0];typeof f=="string"?u[0]=f.slice(i):u.shift()}o>0&&u.push(e[s].slice(0,o))}return u}function GM(e,r){let a=-1;const i=[];let s;for(;++a<e.length;){const o=e[a];let u;if(typeof o=="string")u=o;else switch(o){case-5:{u="\r";break}case-4:{u=`
|
|
60
|
-
`;break}case-3:{u=`\r
|
|
61
|
-
`;break}case-2:{u=r?" ":" ";break}case-1:{if(!r&&s)continue;u=" ";break}default:u=String.fromCharCode(o)}s=o===-2,i.push(u)}return i.join("")}function YM(e){const i={constructs:Sk([FM,...(e||{}).extensions||[]]),content:s(lz),defined:[],document:s(oz),flow:s(CM),lazy:{},string:s(AM),text:s(TM)};return i;function s(o){return u;function u(f){return HM(i,o,f)}}}function $M(e){for(;!Ek(e););return e}const Eb=/[\0\t\n\r]/g;function VM(){let e=1,r="",a=!0,i;return s;function s(o,u,f){const h=[];let m,y,p,b,x;for(o=r+(typeof o=="string"?o.toString():new TextDecoder(u||void 0).decode(o)),p=0,r="",a&&(o.charCodeAt(0)===65279&&p++,a=void 0);p<o.length;){if(Eb.lastIndex=p,m=Eb.exec(o),b=m&&m.index!==void 0?m.index:o.length,x=o.charCodeAt(b),!m){r=o.slice(p);break}if(x===10&&p===b&&i)h.push(-3),i=void 0;else switch(i&&(h.push(-5),i=void 0),p<b&&(h.push(o.slice(p,b)),e+=b-p),x){case 0:{h.push(65533),e++;break}case 9:{for(y=Math.ceil(e/4)*4,h.push(-2);e++<y;)h.push(-1);break}case 10:{h.push(-4),e=1;break}default:i=!0,e=1}p=b+1}return f&&(i&&h.push(-5),r&&h.push(r),h.push(null)),h}}const KM=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function XM(e){return e.replace(KM,ZM)}function ZM(e,r,a){if(r)return r;if(a.charCodeAt(0)===35){const s=a.charCodeAt(1),o=s===120||s===88;return kk(a.slice(o?2:1),o?16:10)}return Zm(a)||e}const zk={}.hasOwnProperty;function QM(e,r,a){return r&&typeof r=="object"&&(a=r,r=void 0),WM(a)($M(YM(a).document().write(VM()(e,r,!0))))}function WM(e){const r={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(J),autolinkProtocol:K,autolinkEmail:K,atxHeading:o(ie),blockQuote:o(Ge),characterEscape:K,characterReference:K,codeFenced:o($e),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:o($e,u),codeText:o(dt,u),codeTextData:K,data:K,codeFlowValue:K,definition:o(ot),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:o(T),hardBreakEscape:o(Q),hardBreakTrailing:o(Q),htmlFlow:o(G,u),htmlFlowData:K,htmlText:o(G,u),htmlTextData:K,image:o(H),label:u,link:o(J),listItem:o(Se),listItemValue:b,listOrdered:o(ye,p),listUnordered:o(ye),paragraph:o(ue),reference:L,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:o(ie),strong:o(he),thematicBreak:o(ke)},exit:{atxHeading:h(),atxHeadingSequence:M,autolink:h(),autolinkEmail:Ne,autolinkProtocol:Ae,blockQuote:h(),characterEscapeValue:U,characterReferenceMarkerHexadecimal:oe,characterReferenceMarkerNumeric:oe,characterReferenceValue:ve,characterReference:Ce,codeFenced:h(_),codeFencedFence:w,codeFencedFenceInfo:x,codeFencedFenceMeta:S,codeFlowValue:U,codeIndented:h(k),codeText:h(q),codeTextData:U,data:U,definition:h(),definitionDestinationString:O,definitionLabelString:N,definitionTitleString:A,emphasis:h(),hardBreakEscape:h(I),hardBreakTrailing:h(I),htmlFlow:h(Z),htmlFlowData:U,htmlText:h(E),htmlTextData:U,image:h(X),label:Y,labelText:re,lineEnding:te,link:h($),listItem:h(),listOrdered:h(),listUnordered:h(),paragraph:h(),referenceString:le,resourceDestinationString:z,resourceTitleString:R,resource:F,setextHeading:h(V),setextHeadingLineSequence:B,setextHeadingText:D,strong:h(),thematicBreak:h()}};Mk(r,(e||{}).mdastExtensions||[]);const a={};return i;function i(ne){let pe={type:"root",children:[]};const _e={stack:[pe],tokenStack:[],config:r,enter:f,exit:m,buffer:u,resume:y,data:a},se=[];let Te=-1;for(;++Te<ne.length;)if(ne[Te][1].type==="listOrdered"||ne[Te][1].type==="listUnordered")if(ne[Te][0]==="enter")se.push(Te);else{const He=se.pop();Te=s(ne,He,Te)}for(Te=-1;++Te<ne.length;){const He=r[ne[Te][0]];zk.call(He,ne[Te][1].type)&&He[ne[Te][1].type].call(Object.assign({sliceSerialize:ne[Te][2].sliceSerialize},_e),ne[Te][1])}if(_e.tokenStack.length>0){const He=_e.tokenStack[_e.tokenStack.length-1];(He[1]||Nb).call(_e,void 0,He[0])}for(pe.position={start:ua(ne.length>0?ne[0][1].start:{line:1,column:1,offset:0}),end:ua(ne.length>0?ne[ne.length-2][1].end:{line:1,column:1,offset:0})},Te=-1;++Te<r.transforms.length;)pe=r.transforms[Te](pe)||pe;return pe}function s(ne,pe,_e){let se=pe-1,Te=-1,He=!1,ht,Ue,at,$t;for(;++se<=_e;){const We=ne[se];switch(We[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{We[0]==="enter"?Te++:Te--,$t=void 0;break}case"lineEndingBlank":{We[0]==="enter"&&(ht&&!$t&&!Te&&!at&&(at=se),$t=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:$t=void 0}if(!Te&&We[0]==="enter"&&We[1].type==="listItemPrefix"||Te===-1&&We[0]==="exit"&&(We[1].type==="listUnordered"||We[1].type==="listOrdered")){if(ht){let Kn=se;for(Ue=void 0;Kn--;){const wn=ne[Kn];if(wn[1].type==="lineEnding"||wn[1].type==="lineEndingBlank"){if(wn[0]==="exit")continue;Ue&&(ne[Ue][1].type="lineEndingBlank",He=!0),wn[1].type="lineEnding",Ue=Kn}else if(!(wn[1].type==="linePrefix"||wn[1].type==="blockQuotePrefix"||wn[1].type==="blockQuotePrefixWhitespace"||wn[1].type==="blockQuoteMarker"||wn[1].type==="listItemIndent"))break}at&&(!Ue||at<Ue)&&(ht._spread=!0),ht.end=Object.assign({},Ue?ne[Ue][1].start:We[1].end),ne.splice(Ue||se,0,["exit",ht,We[2]]),se++,_e++}if(We[1].type==="listItemPrefix"){const Kn={type:"listItem",_spread:!1,start:Object.assign({},We[1].start),end:void 0};ht=Kn,ne.splice(se,0,["enter",Kn,We[2]]),se++,_e++,at=void 0,$t=!0}}}return ne[pe][1]._spread=He,_e}function o(ne,pe){return _e;function _e(se){f.call(this,ne(se),se),pe&&pe.call(this,se)}}function u(){this.stack.push({type:"fragment",children:[]})}function f(ne,pe,_e){this.stack[this.stack.length-1].children.push(ne),this.stack.push(ne),this.tokenStack.push([pe,_e||void 0]),ne.position={start:ua(pe.start),end:void 0}}function h(ne){return pe;function pe(_e){ne&&ne.call(this,_e),m.call(this,_e)}}function m(ne,pe){const _e=this.stack.pop(),se=this.tokenStack.pop();if(se)se[0].type!==ne.type&&(pe?pe.call(this,ne,se[0]):(se[1]||Nb).call(this,ne,se[0]));else throw new Error("Cannot close `"+ne.type+"` ("+ps({start:ne.start,end:ne.end})+"): it’s not open");_e.position.end=ua(ne.end)}function y(){return Xm(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function b(ne){if(this.data.expectingFirstListItemValue){const pe=this.stack[this.stack.length-2];pe.start=Number.parseInt(this.sliceSerialize(ne),10),this.data.expectingFirstListItemValue=void 0}}function x(){const ne=this.resume(),pe=this.stack[this.stack.length-1];pe.lang=ne}function S(){const ne=this.resume(),pe=this.stack[this.stack.length-1];pe.meta=ne}function w(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function _(){const ne=this.resume(),pe=this.stack[this.stack.length-1];pe.value=ne.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function k(){const ne=this.resume(),pe=this.stack[this.stack.length-1];pe.value=ne.replace(/(\r?\n|\r)$/g,"")}function N(ne){const pe=this.resume(),_e=this.stack[this.stack.length-1];_e.label=pe,_e.identifier=Wn(this.sliceSerialize(ne)).toLowerCase()}function A(){const ne=this.resume(),pe=this.stack[this.stack.length-1];pe.title=ne}function O(){const ne=this.resume(),pe=this.stack[this.stack.length-1];pe.url=ne}function M(ne){const pe=this.stack[this.stack.length-1];if(!pe.depth){const _e=this.sliceSerialize(ne).length;pe.depth=_e}}function D(){this.data.setextHeadingSlurpLineEnding=!0}function B(ne){const pe=this.stack[this.stack.length-1];pe.depth=this.sliceSerialize(ne).codePointAt(0)===61?1:2}function V(){this.data.setextHeadingSlurpLineEnding=void 0}function K(ne){const _e=this.stack[this.stack.length-1].children;let se=_e[_e.length-1];(!se||se.type!=="text")&&(se=xe(),se.position={start:ua(ne.start),end:void 0},_e.push(se)),this.stack.push(se)}function U(ne){const pe=this.stack.pop();pe.value+=this.sliceSerialize(ne),pe.position.end=ua(ne.end)}function te(ne){const pe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const _e=pe.children[pe.children.length-1];_e.position.end=ua(ne.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&r.canContainEols.includes(pe.type)&&(K.call(this,ne),U.call(this,ne))}function I(){this.data.atHardBreak=!0}function Z(){const ne=this.resume(),pe=this.stack[this.stack.length-1];pe.value=ne}function E(){const ne=this.resume(),pe=this.stack[this.stack.length-1];pe.value=ne}function q(){const ne=this.resume(),pe=this.stack[this.stack.length-1];pe.value=ne}function $(){const ne=this.stack[this.stack.length-1];if(this.data.inReference){const pe=this.data.referenceType||"shortcut";ne.type+="Reference",ne.referenceType=pe,delete ne.url,delete ne.title}else delete ne.identifier,delete ne.label;this.data.referenceType=void 0}function X(){const ne=this.stack[this.stack.length-1];if(this.data.inReference){const pe=this.data.referenceType||"shortcut";ne.type+="Reference",ne.referenceType=pe,delete ne.url,delete ne.title}else delete ne.identifier,delete ne.label;this.data.referenceType=void 0}function re(ne){const pe=this.sliceSerialize(ne),_e=this.stack[this.stack.length-2];_e.label=XM(pe),_e.identifier=Wn(pe).toLowerCase()}function Y(){const ne=this.stack[this.stack.length-1],pe=this.resume(),_e=this.stack[this.stack.length-1];if(this.data.inReference=!0,_e.type==="link"){const se=ne.children;_e.children=se}else _e.alt=pe}function z(){const ne=this.resume(),pe=this.stack[this.stack.length-1];pe.url=ne}function R(){const ne=this.resume(),pe=this.stack[this.stack.length-1];pe.title=ne}function F(){this.data.inReference=void 0}function L(){this.data.referenceType="collapsed"}function le(ne){const pe=this.resume(),_e=this.stack[this.stack.length-1];_e.label=pe,_e.identifier=Wn(this.sliceSerialize(ne)).toLowerCase(),this.data.referenceType="full"}function oe(ne){this.data.characterReferenceType=ne.type}function ve(ne){const pe=this.sliceSerialize(ne),_e=this.data.characterReferenceType;let se;_e?(se=kk(pe,_e==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):se=Zm(pe);const Te=this.stack[this.stack.length-1];Te.value+=se}function Ce(ne){const pe=this.stack.pop();pe.position.end=ua(ne.end)}function Ae(ne){U.call(this,ne);const pe=this.stack[this.stack.length-1];pe.url=this.sliceSerialize(ne)}function Ne(ne){U.call(this,ne);const pe=this.stack[this.stack.length-1];pe.url="mailto:"+this.sliceSerialize(ne)}function Ge(){return{type:"blockquote",children:[]}}function $e(){return{type:"code",lang:null,meta:null,value:""}}function dt(){return{type:"inlineCode",value:""}}function ot(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function T(){return{type:"emphasis",children:[]}}function ie(){return{type:"heading",depth:0,children:[]}}function Q(){return{type:"break"}}function G(){return{type:"html",value:""}}function H(){return{type:"image",title:null,url:"",alt:null}}function J(){return{type:"link",title:null,url:"",children:[]}}function ye(ne){return{type:"list",ordered:ne.type==="listOrdered",start:null,spread:ne._spread,children:[]}}function Se(ne){return{type:"listItem",spread:ne._spread,checked:null,children:[]}}function ue(){return{type:"paragraph",children:[]}}function he(){return{type:"strong",children:[]}}function xe(){return{type:"text",value:""}}function ke(){return{type:"thematicBreak"}}}function ua(e){return{line:e.line,column:e.column,offset:e.offset}}function Mk(e,r){let a=-1;for(;++a<r.length;){const i=r[a];Array.isArray(i)?Mk(e,i):JM(e,i)}}function JM(e,r){let a;for(a in r)if(zk.call(r,a))switch(a){case"canContainEols":{const i=r[a];i&&e[a].push(...i);break}case"transforms":{const i=r[a];i&&e[a].push(...i);break}case"enter":case"exit":{const i=r[a];i&&Object.assign(e[a],i);break}}}function Nb(e,r){throw e?new Error("Cannot close `"+e.type+"` ("+ps({start:e.start,end:e.end})+"): a different token (`"+r.type+"`, "+ps({start:r.start,end:r.end})+") is open"):new Error("Cannot close document, a token (`"+r.type+"`, "+ps({start:r.start,end:r.end})+") is still open")}function eD(e){const r=this;r.parser=a;function a(i){return QM(i,{...r.data("settings"),...e,extensions:r.data("micromarkExtensions")||[],mdastExtensions:r.data("fromMarkdownExtensions")||[]})}}function tD(e,r){const a={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(r),!0)};return e.patch(r,a),e.applyData(r,a)}function nD(e,r){const a={type:"element",tagName:"br",properties:{},children:[]};return e.patch(r,a),[e.applyData(r,a),{type:"text",value:`
|
|
62
|
-
`}]}function rD(e,r){const a=r.value?r.value+`
|
|
63
|
-
`:"",i={},s=r.lang?r.lang.split(/\s+/):[];s.length>0&&(i.className=["language-"+s[0]]);let o={type:"element",tagName:"code",properties:i,children:[{type:"text",value:a}]};return r.meta&&(o.data={meta:r.meta}),e.patch(r,o),o=e.applyData(r,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(r,o),o}function aD(e,r){const a={type:"element",tagName:"del",properties:{},children:e.all(r)};return e.patch(r,a),e.applyData(r,a)}function iD(e,r){const a={type:"element",tagName:"em",properties:{},children:e.all(r)};return e.patch(r,a),e.applyData(r,a)}function lD(e,r){const a=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=String(r.identifier).toUpperCase(),s=ul(i.toLowerCase()),o=e.footnoteOrder.indexOf(i);let u,f=e.footnoteCounts.get(i);f===void 0?(f=0,e.footnoteOrder.push(i),u=e.footnoteOrder.length):u=o+1,f+=1,e.footnoteCounts.set(i,f);const h={type:"element",tagName:"a",properties:{href:"#"+a+"fn-"+s,id:a+"fnref-"+s+(f>1?"-"+f:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(u)}]};e.patch(r,h);const m={type:"element",tagName:"sup",properties:{},children:[h]};return e.patch(r,m),e.applyData(r,m)}function sD(e,r){const a={type:"element",tagName:"h"+r.depth,properties:{},children:e.all(r)};return e.patch(r,a),e.applyData(r,a)}function oD(e,r){if(e.options.allowDangerousHtml){const a={type:"raw",value:r.value};return e.patch(r,a),e.applyData(r,a)}}function Dk(e,r){const a=r.referenceType;let i="]";if(a==="collapsed"?i+="[]":a==="full"&&(i+="["+(r.label||r.identifier)+"]"),r.type==="imageReference")return[{type:"text",value:"!["+r.alt+i}];const s=e.all(r),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+=i:s.push({type:"text",value:i}),s}function cD(e,r){const a=String(r.identifier).toUpperCase(),i=e.definitionById.get(a);if(!i)return Dk(e,r);const s={src:ul(i.url||""),alt:r.alt};i.title!==null&&i.title!==void 0&&(s.title=i.title);const o={type:"element",tagName:"img",properties:s,children:[]};return e.patch(r,o),e.applyData(r,o)}function uD(e,r){const a={src:ul(r.url)};r.alt!==null&&r.alt!==void 0&&(a.alt=r.alt),r.title!==null&&r.title!==void 0&&(a.title=r.title);const i={type:"element",tagName:"img",properties:a,children:[]};return e.patch(r,i),e.applyData(r,i)}function dD(e,r){const a={type:"text",value:r.value.replace(/\r?\n|\r/g," ")};e.patch(r,a);const i={type:"element",tagName:"code",properties:{},children:[a]};return e.patch(r,i),e.applyData(r,i)}function fD(e,r){const a=String(r.identifier).toUpperCase(),i=e.definitionById.get(a);if(!i)return Dk(e,r);const s={href:ul(i.url||"")};i.title!==null&&i.title!==void 0&&(s.title=i.title);const o={type:"element",tagName:"a",properties:s,children:e.all(r)};return e.patch(r,o),e.applyData(r,o)}function hD(e,r){const a={href:ul(r.url)};r.title!==null&&r.title!==void 0&&(a.title=r.title);const i={type:"element",tagName:"a",properties:a,children:e.all(r)};return e.patch(r,i),e.applyData(r,i)}function mD(e,r,a){const i=e.all(r),s=a?pD(a):Lk(r),o={},u=[];if(typeof r.checked=="boolean"){const y=i[0];let p;y&&y.type==="element"&&y.tagName==="p"?p=y:(p={type:"element",tagName:"p",properties:{},children:[]},i.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:r.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let f=-1;for(;++f<i.length;){const y=i[f];(s||f!==0||y.type!=="element"||y.tagName!=="p")&&u.push({type:"text",value:`
|
|
64
|
-
`}),y.type==="element"&&y.tagName==="p"&&!s?u.push(...y.children):u.push(y)}const h=i[i.length-1];h&&(s||h.type!=="element"||h.tagName!=="p")&&u.push({type:"text",value:`
|
|
65
|
-
`});const m={type:"element",tagName:"li",properties:o,children:u};return e.patch(r,m),e.applyData(r,m)}function pD(e){let r=!1;if(e.type==="list"){r=e.spread||!1;const a=e.children;let i=-1;for(;!r&&++i<a.length;)r=Lk(a[i])}return r}function Lk(e){const r=e.spread;return r??e.children.length>1}function gD(e,r){const a={},i=e.all(r);let s=-1;for(typeof r.start=="number"&&r.start!==1&&(a.start=r.start);++s<i.length;){const u=i[s];if(u.type==="element"&&u.tagName==="li"&&u.properties&&Array.isArray(u.properties.className)&&u.properties.className.includes("task-list-item")){a.className=["contains-task-list"];break}}const o={type:"element",tagName:r.ordered?"ol":"ul",properties:a,children:e.wrap(i,!0)};return e.patch(r,o),e.applyData(r,o)}function yD(e,r){const a={type:"element",tagName:"p",properties:{},children:e.all(r)};return e.patch(r,a),e.applyData(r,a)}function xD(e,r){const a={type:"root",children:e.wrap(e.all(r))};return e.patch(r,a),e.applyData(r,a)}function vD(e,r){const a={type:"element",tagName:"strong",properties:{},children:e.all(r)};return e.patch(r,a),e.applyData(r,a)}function bD(e,r){const a=e.all(r),i=a.shift(),s=[];if(i){const u={type:"element",tagName:"thead",properties:{},children:e.wrap([i],!0)};e.patch(r.children[0],u),s.push(u)}if(a.length>0){const u={type:"element",tagName:"tbody",properties:{},children:e.wrap(a,!0)},f=Ym(r.children[1]),h=pk(r.children[r.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(r,o),e.applyData(r,o)}function wD(e,r,a){const i=a?a.children:void 0,o=(i?i.indexOf(r):1)===0?"th":"td",u=a&&a.type==="table"?a.align:void 0,f=u?u.length:r.children.length;let h=-1;const m=[];for(;++h<f;){const p=r.children[h],b={},x=u?u[h]:void 0;x&&(b.align=x);let S={type:"element",tagName:o,properties:b,children:[]};p&&(S.children=e.all(p),e.patch(p,S),S=e.applyData(p,S)),m.push(S)}const y={type:"element",tagName:"tr",properties:{},children:e.wrap(m,!0)};return e.patch(r,y),e.applyData(r,y)}function SD(e,r){const a={type:"element",tagName:"td",properties:{},children:e.all(r)};return e.patch(r,a),e.applyData(r,a)}const Ab=9,Tb=32;function kD(e){const r=String(e),a=/\r?\n|\r/g;let i=a.exec(r),s=0;const o=[];for(;i;)o.push(Rb(r.slice(s,i.index),s>0,!0),i[0]),s=i.index+i[0].length,i=a.exec(r);return o.push(Rb(r.slice(s),s>0,!1)),o.join("")}function Rb(e,r,a){let i=0,s=e.length;if(r){let o=e.codePointAt(i);for(;o===Ab||o===Tb;)i++,o=e.codePointAt(i)}if(a){let o=e.codePointAt(s-1);for(;o===Ab||o===Tb;)s--,o=e.codePointAt(s-1)}return s>i?e.slice(i,s):""}function _D(e,r){const a={type:"text",value:kD(String(r.value))};return e.patch(r,a),e.applyData(r,a)}function jD(e,r){const a={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(r,a),e.applyData(r,a)}const CD={blockquote:tD,break:nD,code:rD,delete:aD,emphasis:iD,footnoteReference:lD,heading:sD,html:oD,imageReference:cD,image:uD,inlineCode:dD,linkReference:fD,link:hD,listItem:mD,list:gD,paragraph:yD,root:xD,strong:vD,table:bD,tableCell:SD,tableRow:wD,text:_D,thematicBreak:jD,toml:fc,yaml:fc,definition:fc,footnoteDefinition:fc};function fc(){}const Ik=-1,mu=0,ys=1,Lc=2,Wm=3,Jm=4,ep=5,tp=6,Pk=7,Uk=8,Ob=typeof self=="object"?self:globalThis,ED=(e,r)=>{const a=(s,o)=>(e.set(o,s),s),i=s=>{if(e.has(s))return e.get(s);const[o,u]=r[s];switch(o){case mu:case Ik:return a(u,s);case ys:{const f=a([],s);for(const h of u)f.push(i(h));return f}case Lc:{const f=a({},s);for(const[h,m]of u)f[i(h)]=i(m);return f}case Wm:return a(new Date(u),s);case Jm:{const{source:f,flags:h}=u;return a(new RegExp(f,h),s)}case ep:{const f=a(new Map,s);for(const[h,m]of u)f.set(i(h),i(m));return f}case tp:{const f=a(new Set,s);for(const h of u)f.add(i(h));return f}case Pk:{const{name:f,message:h}=u;return a(new Ob[f](h),s)}case Uk:return a(BigInt(u),s);case"BigInt":return a(Object(BigInt(u)),s);case"ArrayBuffer":return a(new Uint8Array(u).buffer,u);case"DataView":{const{buffer:f}=new Uint8Array(u);return a(new DataView(f),u)}}return a(new Ob[o](u),s)};return i},zb=e=>ED(new Map,e)(0),$i="",{toString:ND}={},{keys:AD}=Object,os=e=>{const r=typeof e;if(r!=="object"||!e)return[mu,r];const a=ND.call(e).slice(8,-1);switch(a){case"Array":return[ys,$i];case"Object":return[Lc,$i];case"Date":return[Wm,$i];case"RegExp":return[Jm,$i];case"Map":return[ep,$i];case"Set":return[tp,$i];case"DataView":return[ys,a]}return a.includes("Array")?[ys,a]:a.includes("Error")?[Pk,a]:[Lc,a]},hc=([e,r])=>e===mu&&(r==="function"||r==="symbol"),TD=(e,r,a,i)=>{const s=(u,f)=>{const h=i.push(u)-1;return a.set(f,h),h},o=u=>{if(a.has(u))return a.get(u);let[f,h]=os(u);switch(f){case mu:{let y=u;switch(h){case"bigint":f=Uk,y=u.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+h);y=null;break;case"undefined":return s([Ik],u)}return s([f,y],u)}case ys:{if(h){let b=u;return h==="DataView"?b=new Uint8Array(u.buffer):h==="ArrayBuffer"&&(b=new Uint8Array(u)),s([h,[...b]],u)}const y=[],p=s([f,y],u);for(const b of u)y.push(o(b));return p}case Lc:{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(r&&"toJSON"in u)return o(u.toJSON());const y=[],p=s([f,y],u);for(const b of AD(u))(e||!hc(os(u[b])))&&y.push([o(b),o(u[b])]);return p}case Wm:return s([f,u.toISOString()],u);case Jm:{const{source:y,flags:p}=u;return s([f,{source:y,flags:p}],u)}case ep:{const y=[],p=s([f,y],u);for(const[b,x]of u)(e||!(hc(os(b))||hc(os(x))))&&y.push([o(b),o(x)]);return p}case tp:{const y=[],p=s([f,y],u);for(const b of u)(e||!hc(os(b)))&&y.push(o(b));return p}}const{message:m}=u;return s([f,{name:h,message:m}],u)};return o},Mb=(e,{json:r,lossy:a}={})=>{const i=[];return TD(!(r||a),!!r,new Map,i)(e),i},Ic=typeof structuredClone=="function"?(e,r)=>r&&("json"in r||"lossy"in r)?zb(Mb(e,r)):structuredClone(e):(e,r)=>zb(Mb(e,r));function RD(e,r){const a=[{type:"text",value:"↩"}];return r>1&&a.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(r)}]}),a}function OD(e,r){return"Back to reference "+(e+1)+(r>1?"-"+r:"")}function zD(e){const r=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=e.options.footnoteBackContent||RD,i=e.options.footnoteBackLabel||OD,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 m=e.footnoteById.get(e.footnoteOrder[h]);if(!m)continue;const y=e.all(m),p=String(m.identifier).toUpperCase(),b=ul(p.toLowerCase());let x=0;const S=[],w=e.footnoteCounts.get(p);for(;w!==void 0&&++x<=w;){S.length>0&&S.push({type:"text",value:" "});let N=typeof a=="string"?a:a(h,x);typeof N=="string"&&(N={type:"text",value:N}),S.push({type:"element",tagName:"a",properties:{href:"#"+r+"fnref-"+b+(x>1?"-"+x:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(h,x),className:["data-footnote-backref"]},children:Array.isArray(N)?N:[N]})}const _=y[y.length-1];if(_&&_.type==="element"&&_.tagName==="p"){const N=_.children[_.children.length-1];N&&N.type==="text"?N.value+=" ":_.children.push({type:"text",value:" "}),_.children.push(...S)}else y.push(...S);const k={type:"element",tagName:"li",properties:{id:r+"fn-"+b},children:e.wrap(y,!0)};e.patch(m,k),f.push(k)}if(f.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Ic(u),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
|
|
66
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(f,!0)},{type:"text",value:`
|
|
67
|
-
`}]}}const pu=(function(e){if(e==null)return ID;if(typeof e=="function")return gu(e);if(typeof e=="object")return Array.isArray(e)?MD(e):DD(e);if(typeof e=="string")return LD(e);throw new Error("Expected function, string, or object as test")});function MD(e){const r=[];let a=-1;for(;++a<e.length;)r[a]=pu(e[a]);return gu(i);function i(...s){let o=-1;for(;++o<r.length;)if(r[o].apply(this,s))return!0;return!1}}function DD(e){const r=e;return gu(a);function a(i){const s=i;let o;for(o in e)if(s[o]!==r[o])return!1;return!0}}function LD(e){return gu(r);function r(a){return a&&a.type===e}}function gu(e){return r;function r(a,i,s){return!!(PD(a)&&e.call(this,a,typeof i=="number"?i:void 0,s||void 0))}}function ID(){return!0}function PD(e){return e!==null&&typeof e=="object"&&"type"in e}const Bk=[],UD=!0,Xh=!1,BD="skip";function Fk(e,r,a,i){let s;typeof r=="function"&&typeof a!="function"?(i=a,a=r):s=r;const o=pu(s),u=i?-1:1;f(e,void 0,[])();function f(h,m,y){const p=h&&typeof h=="object"?h:{};if(typeof p.type=="string"){const x=typeof p.tagName=="string"?p.tagName:typeof p.name=="string"?p.name:void 0;Object.defineProperty(b,"name",{value:"node ("+(h.type+(x?"<"+x+">":""))+")"})}return b;function b(){let x=Bk,S,w,_;if((!r||o(h,m,y[y.length-1]||void 0))&&(x=FD(a(h,y)),x[0]===Xh))return x;if("children"in h&&h.children){const k=h;if(k.children&&x[0]!==BD)for(w=(i?k.children.length:-1)+u,_=y.concat(k);w>-1&&w<k.children.length;){const N=k.children[w];if(S=f(N,w,_)(),S[0]===Xh)return S;w=typeof S[1]=="number"?S[1]:w+u}}return x}}}function FD(e){return Array.isArray(e)?e:typeof e=="number"?[UD,e]:e==null?Bk:[e]}function np(e,r,a,i){let s,o,u;typeof r=="function"&&typeof a!="function"?(o=void 0,u=r,s=a):(o=r,u=a,s=i),Fk(e,o,f,s);function f(h,m){const y=m[m.length-1],p=y?y.children.indexOf(h):void 0;return u(h,p,y)}}const Zh={}.hasOwnProperty,HD={};function qD(e,r){const a=r||HD,i=new Map,s=new Map,o=new Map,u={...CD,...a.handlers},f={all:m,applyData:YD,definitionById:i,footnoteById:s,footnoteCounts:o,footnoteOrder:[],handlers:u,one:h,options:a,patch:GD,wrap:VD};return np(e,function(y){if(y.type==="definition"||y.type==="footnoteDefinition"){const p=y.type==="definition"?i:s,b=String(y.identifier).toUpperCase();p.has(b)||p.set(b,y)}}),f;function h(y,p){const b=y.type,x=f.handlers[b];if(Zh.call(f.handlers,b)&&x)return x(f,y,p);if(f.options.passThrough&&f.options.passThrough.includes(b)){if("children"in y){const{children:w,..._}=y,k=Ic(_);return k.children=f.all(y),k}return Ic(y)}return(f.options.unknownHandler||$D)(f,y,p)}function m(y){const p=[];if("children"in y){const b=y.children;let x=-1;for(;++x<b.length;){const S=f.one(b[x],y);if(S){if(x&&b[x-1].type==="break"&&(!Array.isArray(S)&&S.type==="text"&&(S.value=Db(S.value)),!Array.isArray(S)&&S.type==="element")){const w=S.children[0];w&&w.type==="text"&&(w.value=Db(w.value))}Array.isArray(S)?p.push(...S):p.push(S)}}}return p}}function GD(e,r){e.position&&(r.position=OO(e))}function YD(e,r){let a=r;if(e&&e.data){const i=e.data.hName,s=e.data.hChildren,o=e.data.hProperties;if(typeof i=="string")if(a.type==="element")a.tagName=i;else{const u="children"in a?a.children:[a];a={type:"element",tagName:i,properties:{},children:u}}a.type==="element"&&o&&Object.assign(a.properties,Ic(o)),"children"in a&&a.children&&s!==null&&s!==void 0&&(a.children=s)}return a}function $D(e,r){const a=r.data||{},i="value"in r&&!(Zh.call(a,"hProperties")||Zh.call(a,"hChildren"))?{type:"text",value:r.value}:{type:"element",tagName:"div",properties:{},children:e.all(r)};return e.patch(r,i),e.applyData(r,i)}function VD(e,r){const a=[];let i=-1;for(r&&a.push({type:"text",value:`
|
|
68
|
-
`});++i<e.length;)i&&a.push({type:"text",value:`
|
|
69
|
-
`}),a.push(e[i]);return r&&e.length>0&&a.push({type:"text",value:`
|
|
70
|
-
`}),a}function Db(e){let r=0,a=e.charCodeAt(r);for(;a===9||a===32;)r++,a=e.charCodeAt(r);return e.slice(r)}function Lb(e,r){const a=qD(e,r),i=a.one(e,void 0),s=zD(a),o=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return s&&o.children.push({type:"text",value:`
|
|
71
|
-
`},s),o}function KD(e,r){return e&&"run"in e?async function(a,i){const s=Lb(a,{file:i,...r});await e.run(s,i)}:function(a,i){return Lb(a,{file:i,...e||r})}}function Ib(e){if(e)throw e}var oh,Pb;function XD(){if(Pb)return oh;Pb=1;var e=Object.prototype.hasOwnProperty,r=Object.prototype.toString,a=Object.defineProperty,i=Object.getOwnPropertyDescriptor,s=function(m){return typeof Array.isArray=="function"?Array.isArray(m):r.call(m)==="[object Array]"},o=function(m){if(!m||r.call(m)!=="[object Object]")return!1;var y=e.call(m,"constructor"),p=m.constructor&&m.constructor.prototype&&e.call(m.constructor.prototype,"isPrototypeOf");if(m.constructor&&!y&&!p)return!1;var b;for(b in m);return typeof b>"u"||e.call(m,b)},u=function(m,y){a&&y.name==="__proto__"?a(m,y.name,{enumerable:!0,configurable:!0,value:y.newValue,writable:!0}):m[y.name]=y.newValue},f=function(m,y){if(y==="__proto__")if(e.call(m,y)){if(i)return i(m,y).value}else return;return m[y]};return oh=function h(){var m,y,p,b,x,S,w=arguments[0],_=1,k=arguments.length,N=!1;for(typeof w=="boolean"&&(N=w,w=arguments[1]||{},_=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});_<k;++_)if(m=arguments[_],m!=null)for(y in m)p=f(w,y),b=f(m,y),w!==b&&(N&&b&&(o(b)||(x=s(b)))?(x?(x=!1,S=p&&s(p)?p:[]):S=p&&o(p)?p:{},u(w,{name:y,newValue:h(N,S,b)})):typeof b<"u"&&u(w,{name:y,newValue:b}));return w},oh}var ZD=XD();const ch=_s(ZD);function Qh(e){if(typeof e!="object"||e===null)return!1;const r=Object.getPrototypeOf(e);return(r===null||r===Object.prototype||Object.getPrototypeOf(r)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function QD(){const e=[],r={run:a,use:i};return r;function a(...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,...m){const y=e[++o];let p=-1;if(h){u(h);return}for(;++p<s.length;)(m[p]===null||m[p]===void 0)&&(m[p]=s[p]);s=m,y?WD(y,f)(...m):u(null,...m)}}function i(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),r}}function WD(e,r){let a;return i;function i(...u){const f=e.length>u.length;let h;f&&u.push(s);try{h=e.apply(this,u)}catch(m){const y=m;if(f&&a)throw y;return s(y)}f||(h&&h.then&&typeof h.then=="function"?h.then(o,s):h instanceof Error?s(h):o(h))}function s(u,...f){a||(a=!0,r(u,...f))}function o(u){s(null,u)}}const sr={basename:JD,dirname:e6,extname:t6,join:n6,sep:"/"};function JD(e,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');Bs(e);let a=0,i=-1,s=e.length,o;if(r===void 0||r.length===0||r.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(o){a=s+1;break}}else i<0&&(o=!0,i=s+1);return i<0?"":e.slice(a,i)}if(r===e)return"";let u=-1,f=r.length-1;for(;s--;)if(e.codePointAt(s)===47){if(o){a=s+1;break}}else u<0&&(o=!0,u=s+1),f>-1&&(e.codePointAt(s)===r.codePointAt(f--)?f<0&&(i=s):(f=-1,i=u));return a===i?i=u:i<0&&(i=e.length),e.slice(a,i)}function e6(e){if(Bs(e),e.length===0)return".";let r=-1,a=e.length,i;for(;--a;)if(e.codePointAt(a)===47){if(i){r=a;break}}else i||(i=!0);return r<0?e.codePointAt(0)===47?"/":".":r===1&&e.codePointAt(0)===47?"//":e.slice(0,r)}function t6(e){Bs(e);let r=e.length,a=-1,i=0,s=-1,o=0,u;for(;r--;){const f=e.codePointAt(r);if(f===47){if(u){i=r+1;break}continue}a<0&&(u=!0,a=r+1),f===46?s<0?s=r:o!==1&&(o=1):s>-1&&(o=-1)}return s<0||a<0||o===0||o===1&&s===a-1&&s===i+1?"":e.slice(s,a)}function n6(...e){let r=-1,a;for(;++r<e.length;)Bs(e[r]),e[r]&&(a=a===void 0?e[r]:a+"/"+e[r]);return a===void 0?".":r6(a)}function r6(e){Bs(e);const r=e.codePointAt(0)===47;let a=a6(e,!r);return a.length===0&&!r&&(a="."),a.length>0&&e.codePointAt(e.length-1)===47&&(a+="/"),r?"/"+a:a}function a6(e,r){let a="",i=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(a.length<2||i!==2||a.codePointAt(a.length-1)!==46||a.codePointAt(a.length-2)!==46){if(a.length>2){if(h=a.lastIndexOf("/"),h!==a.length-1){h<0?(a="",i=0):(a=a.slice(0,h),i=a.length-1-a.lastIndexOf("/")),s=u,o=0;continue}}else if(a.length>0){a="",i=0,s=u,o=0;continue}}r&&(a=a.length>0?a+"/..":"..",i=2)}else a.length>0?a+="/"+e.slice(s+1,u):a=e.slice(s+1,u),i=u-s-1;s=u,o=0}else f===46&&o>-1?o++:o=-1}return a}function Bs(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const i6={cwd:l6};function l6(){return"/"}function Wh(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function s6(e){if(typeof e=="string")e=new URL(e);else if(!Wh(e)){const r=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw r.code="ERR_INVALID_ARG_TYPE",r}if(e.protocol!=="file:"){const r=new TypeError("The URL must be of scheme file");throw r.code="ERR_INVALID_URL_SCHEME",r}return o6(e)}function o6(e){if(e.hostname!==""){const i=new TypeError('File URL host must be "localhost" or empty on darwin');throw i.code="ERR_INVALID_FILE_URL_HOST",i}const r=e.pathname;let a=-1;for(;++a<r.length;)if(r.codePointAt(a)===37&&r.codePointAt(a+1)===50){const i=r.codePointAt(a+2);if(i===70||i===102){const s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(r)}const uh=["history","path","basename","stem","extname","dirname"];class Hk{constructor(r){let a;r?Wh(r)?a={path:r}:typeof r=="string"||c6(r)?a={value:r}:a=r:a={},this.cwd="cwd"in a?"":i6.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i<uh.length;){const o=uh[i];o in a&&a[o]!==void 0&&a[o]!==null&&(this[o]=o==="history"?[...a[o]]:a[o])}let s;for(s in a)uh.includes(s)||(this[s]=a[s])}get basename(){return typeof this.path=="string"?sr.basename(this.path):void 0}set basename(r){fh(r,"basename"),dh(r,"basename"),this.path=sr.join(this.dirname||"",r)}get dirname(){return typeof this.path=="string"?sr.dirname(this.path):void 0}set dirname(r){Ub(this.basename,"dirname"),this.path=sr.join(r||"",this.basename)}get extname(){return typeof this.path=="string"?sr.extname(this.path):void 0}set extname(r){if(dh(r,"extname"),Ub(this.dirname,"extname"),r){if(r.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(r.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=sr.join(this.dirname,this.stem+(r||""))}get path(){return this.history[this.history.length-1]}set path(r){Wh(r)&&(r=s6(r)),fh(r,"path"),this.path!==r&&this.history.push(r)}get stem(){return typeof this.path=="string"?sr.basename(this.path,this.extname):void 0}set stem(r){fh(r,"stem"),dh(r,"stem"),this.path=sr.join(this.dirname||"",r+(this.extname||""))}fail(r,a,i){const s=this.message(r,a,i);throw s.fatal=!0,s}info(r,a,i){const s=this.message(r,a,i);return s.fatal=void 0,s}message(r,a,i){const s=new ln(r,a,i);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(r){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(r||void 0).decode(this.value)}}function dh(e,r){if(e&&e.includes(sr.sep))throw new Error("`"+r+"` cannot be a path: did not expect `"+sr.sep+"`")}function fh(e,r){if(!e)throw new Error("`"+r+"` cannot be empty")}function Ub(e,r){if(!e)throw new Error("Setting `"+r+"` requires `path` to be set too")}function c6(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const u6=(function(e){const i=this.constructor.prototype,s=i[e],o=function(){return s.apply(o,arguments)};return Object.setPrototypeOf(o,i),o}),d6={}.hasOwnProperty;class rp extends u6{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=QD()}copy(){const r=new rp;let a=-1;for(;++a<this.attachers.length;){const i=this.attachers[a];r.use(...i)}return r.data(ch(!0,{},this.namespace)),r}data(r,a){return typeof r=="string"?arguments.length===2?(ph("data",this.frozen),this.namespace[r]=a,this):d6.call(this.namespace,r)&&this.namespace[r]||void 0:r?(ph("data",this.frozen),this.namespace=r,this):this.namespace}freeze(){if(this.frozen)return this;const r=this;for(;++this.freezeIndex<this.attachers.length;){const[a,...i]=this.attachers[this.freezeIndex];if(i[0]===!1)continue;i[0]===!0&&(i[0]=void 0);const s=a.call(r,...i);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(r){this.freeze();const a=mc(r),i=this.parser||this.Parser;return hh("parse",i),i(String(a),a)}process(r,a){const i=this;return this.freeze(),hh("process",this.parser||this.Parser),mh("process",this.compiler||this.Compiler),a?s(void 0,a):new Promise(s);function s(o,u){const f=mc(r),h=i.parse(f);i.run(h,f,function(y,p,b){if(y||!p||!b)return m(y);const x=p,S=i.stringify(x,b);m6(S)?b.value=S:b.result=S,m(y,b)});function m(y,p){y||!p?u(y):o?o(p):a(void 0,p)}}}processSync(r){let a=!1,i;return this.freeze(),hh("processSync",this.parser||this.Parser),mh("processSync",this.compiler||this.Compiler),this.process(r,s),Fb("processSync","process",a),i;function s(o,u){a=!0,Ib(o),i=u}}run(r,a,i){Bb(r),this.freeze();const s=this.transformers;return!i&&typeof a=="function"&&(i=a,a=void 0),i?o(void 0,i):new Promise(o);function o(u,f){const h=mc(a);s.run(r,h,m);function m(y,p,b){const x=p||r;y?f(y):u?u(x):i(void 0,x,b)}}}runSync(r,a){let i=!1,s;return this.run(r,a,o),Fb("runSync","run",i),s;function o(u,f){Ib(u),s=f,i=!0}}stringify(r,a){this.freeze();const i=mc(a),s=this.compiler||this.Compiler;return mh("stringify",s),Bb(r),s(r,i)}use(r,...a){const i=this.attachers,s=this.namespace;if(ph("use",this.frozen),r!=null)if(typeof r=="function")h(r,a);else if(typeof r=="object")Array.isArray(r)?f(r):u(r);else throw new TypeError("Expected usable value, not `"+r+"`");return this;function o(m){if(typeof m=="function")h(m,[]);else if(typeof m=="object")if(Array.isArray(m)){const[y,...p]=m;h(y,p)}else u(m);else throw new TypeError("Expected usable value, not `"+m+"`")}function u(m){if(!("plugins"in m)&&!("settings"in m))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(m.plugins),m.settings&&(s.settings=ch(!0,s.settings,m.settings))}function f(m){let y=-1;if(m!=null)if(Array.isArray(m))for(;++y<m.length;){const p=m[y];o(p)}else throw new TypeError("Expected a list of plugins, not `"+m+"`")}function h(m,y){let p=-1,b=-1;for(;++p<i.length;)if(i[p][0]===m){b=p;break}if(b===-1)i.push([m,...y]);else if(y.length>0){let[x,...S]=y;const w=i[b][1];Qh(w)&&Qh(x)&&(x=ch(!0,w,x)),i[b]=[m,x,...S]}}}}const f6=new rp().freeze();function hh(e,r){if(typeof r!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function mh(e,r){if(typeof r!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function ph(e,r){if(r)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Bb(e){if(!Qh(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Fb(e,r,a){if(!a)throw new Error("`"+e+"` finished async. Use `"+r+"` instead")}function mc(e){return h6(e)?e:new Hk(e)}function h6(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function m6(e){return typeof e=="string"||p6(e)}function p6(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const g6="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Hb=[],qb={allowDangerousHtml:!0},y6=/^(https?|ircs?|mailto|xmpp)$/i,x6=[{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 Gb(e){const r=v6(e),a=b6(e);return w6(r.runSync(r.parse(a),a),e)}function v6(e){const r=e.rehypePlugins||Hb,a=e.remarkPlugins||Hb,i=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...qb}:qb;return f6().use(eD).use(a).use(KD,i).use(r)}function b6(e){const r=e.children||"",a=new Hk;return typeof r=="string"&&(a.value=r),a}function w6(e,r){const a=r.allowedElements,i=r.allowElement,s=r.components,o=r.disallowedElements,u=r.skipHtml,f=r.unwrapDisallowed,h=r.urlTransform||S6;for(const y of x6)Object.hasOwn(r,y.from)&&(""+y.from+(y.to?"use `"+y.to+"` instead":"remove it")+g6+y.id,void 0);return np(e,m),IO(e,{Fragment:d.Fragment,components:s,ignoreInvalidStyle:!0,jsx:d.jsx,jsxs:d.jsxs,passKeys:!0,passNode:!0});function m(y,p,b){if(y.type==="raw"&&b&&typeof p=="number")return u?b.children.splice(p,1):b.children[p]={type:"text",value:y.value},p;if(y.type==="element"){let x;for(x in ih)if(Object.hasOwn(ih,x)&&Object.hasOwn(y.properties,x)){const S=y.properties[x],w=ih[x];(w===null||w.includes(y.tagName))&&(y.properties[x]=h(String(S||""),x,y))}}if(y.type==="element"){let x=a?!a.includes(y.tagName):o?o.includes(y.tagName):!1;if(!x&&i&&typeof p=="number"&&(x=!i(y,p,b)),x&&b&&typeof p=="number")return f&&y.children?b.children.splice(p,1,...y.children):b.children.splice(p,1),p}}}function S6(e){const r=e.indexOf(":"),a=e.indexOf("?"),i=e.indexOf("#"),s=e.indexOf("/");return r===-1||s!==-1&&r>s||a!==-1&&r>a||i!==-1&&r>i||y6.test(e.slice(0,r))?e:""}function Yb(e,r){const a=String(e);if(typeof r!="string")throw new TypeError("Expected character");let i=0,s=a.indexOf(r);for(;s!==-1;)i++,s=a.indexOf(r,s+r.length);return i}function k6(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function _6(e,r,a){const s=pu((a||{}).ignore||[]),o=j6(r);let u=-1;for(;++u<o.length;)Fk(e,"text",f);function f(m,y){let p=-1,b;for(;++p<y.length;){const x=y[p],S=b?b.children:void 0;if(s(x,S?S.indexOf(x):void 0,b))return;b=x}if(b)return h(m,y)}function h(m,y){const p=y[y.length-1],b=o[u][0],x=o[u][1];let S=0;const _=p.children.indexOf(m);let k=!1,N=[];b.lastIndex=0;let A=b.exec(m.value);for(;A;){const O=A.index,M={index:A.index,input:A.input,stack:[...y,m]};let D=x(...A,M);if(typeof D=="string"&&(D=D.length>0?{type:"text",value:D}:void 0),D===!1?b.lastIndex=O+1:(S!==O&&N.push({type:"text",value:m.value.slice(S,O)}),Array.isArray(D)?N.push(...D):D&&N.push(D),S=O+A[0].length,k=!0),!b.global)break;A=b.exec(m.value)}return k?(S<m.value.length&&N.push({type:"text",value:m.value.slice(S)}),p.children.splice(_,1,...N)):N=[m],_+N.length}}function j6(e){const r=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const a=!e[0]||Array.isArray(e[0])?e:[e];let i=-1;for(;++i<a.length;){const s=a[i];r.push([C6(s[0]),E6(s[1])])}return r}function C6(e){return typeof e=="string"?new RegExp(k6(e),"g"):e}function E6(e){return typeof e=="function"?e:function(){return e}}const gh="phrasing",yh=["autolink","link","image","label"];function N6(){return{transforms:[D6],enter:{literalAutolink:T6,literalAutolinkEmail:xh,literalAutolinkHttp:xh,literalAutolinkWww:xh},exit:{literalAutolink:M6,literalAutolinkEmail:z6,literalAutolinkHttp:R6,literalAutolinkWww:O6}}}function A6(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:gh,notInConstruct:yh},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:gh,notInConstruct:yh},{character:":",before:"[ps]",after:"\\/",inConstruct:gh,notInConstruct:yh}]}}function T6(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function xh(e){this.config.enter.autolinkProtocol.call(this,e)}function R6(e){this.config.exit.autolinkProtocol.call(this,e)}function O6(e){this.config.exit.data.call(this,e);const r=this.stack[this.stack.length-1];r.type,r.url="http://"+this.sliceSerialize(e)}function z6(e){this.config.exit.autolinkEmail.call(this,e)}function M6(e){this.exit(e)}function D6(e){_6(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,L6],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),I6]],{ignore:["link","linkReference"]})}function L6(e,r,a,i,s){let o="";if(!qk(s)||(/^w/i.test(r)&&(a=r+a,r="",o="http://"),!P6(a)))return!1;const u=U6(a+i);if(!u[0])return!1;const f={type:"link",title:null,url:o+r+u[0],children:[{type:"text",value:r+u[0]}]};return u[1]?[f,{type:"text",value:u[1]}]:f}function I6(e,r,a,i){return!qk(i,!0)||/[-\d_]$/.test(a)?!1:{type:"link",title:null,url:"mailto:"+r+"@"+a,children:[{type:"text",value:r+"@"+a}]}}function P6(e){const r=e.split(".");return!(r.length<2||r[r.length-1]&&(/_/.test(r[r.length-1])||!/[a-zA-Z\d]/.test(r[r.length-1]))||r[r.length-2]&&(/_/.test(r[r.length-2])||!/[a-zA-Z\d]/.test(r[r.length-2])))}function U6(e){const r=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!r)return[e,void 0];e=e.slice(0,r.index);let a=r[0],i=a.indexOf(")");const s=Yb(e,"(");let o=Yb(e,")");for(;i!==-1&&s>o;)e+=a.slice(0,i+1),a=a.slice(i+1),i=a.indexOf(")"),o++;return[e,a]}function qk(e,r){const a=e.input.charCodeAt(e.index-1);return(e.index===0||Qa(a)||fu(a))&&(!r||a!==47)}Gk.peek=K6;function B6(){this.buffer()}function F6(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function H6(){this.buffer()}function q6(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function G6(e){const r=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=Wn(this.sliceSerialize(e)).toLowerCase(),a.label=r}function Y6(e){this.exit(e)}function $6(e){const r=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=Wn(this.sliceSerialize(e)).toLowerCase(),a.label=r}function V6(e){this.exit(e)}function K6(){return"["}function Gk(e,r,a,i){const s=a.createTracker(i);let o=s.move("[^");const u=a.enter("footnoteReference"),f=a.enter("reference");return o+=s.move(a.safe(a.associationId(e),{after:"]",before:o})),f(),u(),o+=s.move("]"),o}function X6(){return{enter:{gfmFootnoteCallString:B6,gfmFootnoteCall:F6,gfmFootnoteDefinitionLabelString:H6,gfmFootnoteDefinition:q6},exit:{gfmFootnoteCallString:G6,gfmFootnoteCall:Y6,gfmFootnoteDefinitionLabelString:$6,gfmFootnoteDefinition:V6}}}function Z6(e){let r=!1;return e&&e.firstLineBlank&&(r=!0),{handlers:{footnoteDefinition:a,footnoteReference:Gk},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function a(i,s,o,u){const f=o.createTracker(u);let h=f.move("[^");const m=o.enter("footnoteDefinition"),y=o.enter("label");return h+=f.move(o.safe(o.associationId(i),{before:h,after:"]"})),y(),h+=f.move("]:"),i.children&&i.children.length>0&&(f.shift(4),h+=f.move((r?`
|
|
72
|
-
`:" ")+o.indentLines(o.containerFlow(i,f.current()),r?Yk:Q6))),m(),h}}function Q6(e,r,a){return r===0?e:Yk(e,r,a)}function Yk(e,r,a){return(a?"":" ")+e}const W6=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];$k.peek=rL;function J6(){return{canContainEols:["delete"],enter:{strikethrough:tL},exit:{strikethrough:nL}}}function eL(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:W6}],handlers:{delete:$k}}}function tL(e){this.enter({type:"delete",children:[]},e)}function nL(e){this.exit(e)}function $k(e,r,a,i){const s=a.createTracker(i),o=a.enter("strikethrough");let u=s.move("~~");return u+=a.containerPhrasing(e,{...s.current(),before:u,after:"~"}),u+=s.move("~~"),o(),u}function rL(){return"~"}function aL(e){return e.length}function iL(e,r){const a=r||{},i=(a.align||[]).concat(),s=a.stringLength||aL,o=[],u=[],f=[],h=[];let m=0,y=-1;for(;++y<e.length;){const w=[],_=[];let k=-1;for(e[y].length>m&&(m=e[y].length);++k<e[y].length;){const N=lL(e[y][k]);if(a.alignDelimiters!==!1){const A=s(N);_[k]=A,(h[k]===void 0||A>h[k])&&(h[k]=A)}w.push(N)}u[y]=w,f[y]=_}let p=-1;if(typeof i=="object"&&"length"in i)for(;++p<m;)o[p]=$b(i[p]);else{const w=$b(i);for(;++p<m;)o[p]=w}p=-1;const b=[],x=[];for(;++p<m;){const w=o[p];let _="",k="";w===99?(_=":",k=":"):w===108?_=":":w===114&&(k=":");let N=a.alignDelimiters===!1?1:Math.max(1,h[p]-_.length-k.length);const A=_+"-".repeat(N)+k;a.alignDelimiters!==!1&&(N=_.length+N+k.length,N>h[p]&&(h[p]=N),x[p]=N),b[p]=A}u.splice(1,0,b),f.splice(1,0,x),y=-1;const S=[];for(;++y<u.length;){const w=u[y],_=f[y];p=-1;const k=[];for(;++p<m;){const N=w[p]||"";let A="",O="";if(a.alignDelimiters!==!1){const M=h[p]-(_[p]||0),D=o[p];D===114?A=" ".repeat(M):D===99?M%2?(A=" ".repeat(M/2+.5),O=" ".repeat(M/2-.5)):(A=" ".repeat(M/2),O=A):O=" ".repeat(M)}a.delimiterStart!==!1&&!p&&k.push("|"),a.padding!==!1&&!(a.alignDelimiters===!1&&N==="")&&(a.delimiterStart!==!1||p)&&k.push(" "),a.alignDelimiters!==!1&&k.push(A),k.push(N),a.alignDelimiters!==!1&&k.push(O),a.padding!==!1&&k.push(" "),(a.delimiterEnd!==!1||p!==m-1)&&k.push("|")}S.push(a.delimiterEnd===!1?k.join("").replace(/ +$/,""):k.join(""))}return S.join(`
|
|
73
|
-
`)}function lL(e){return e==null?"":String(e)}function $b(e){const r=typeof e=="string"?e.codePointAt(0):0;return r===67||r===99?99:r===76||r===108?108:r===82||r===114?114:0}function sL(e,r,a,i){const s=a.enter("blockquote"),o=a.createTracker(i);o.move("> "),o.shift(2);const u=a.indentLines(a.containerFlow(e,o.current()),oL);return s(),u}function oL(e,r,a){return">"+(a?"":" ")+e}function cL(e,r){return Vb(e,r.inConstruct,!0)&&!Vb(e,r.notInConstruct,!1)}function Vb(e,r,a){if(typeof r=="string"&&(r=[r]),!r||r.length===0)return a;let i=-1;for(;++i<r.length;)if(e.includes(r[i]))return!0;return!1}function Kb(e,r,a,i){let s=-1;for(;++s<a.unsafe.length;)if(a.unsafe[s].character===`
|
|
74
|
-
`&&cL(a.stack,a.unsafe[s]))return/[ \t]/.test(i.before)?"":" ";return`\\
|
|
75
|
-
`}function uL(e,r){const a=String(e);let i=a.indexOf(r),s=i,o=0,u=0;if(typeof r!="string")throw new TypeError("Expected substring");for(;i!==-1;)i===s?++o>u&&(u=o):o=1,s=i+r.length,i=a.indexOf(r,s);return u}function dL(e,r){return!!(r.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function fL(e){const r=e.options.fence||"`";if(r!=="`"&&r!=="~")throw new Error("Cannot serialize code with `"+r+"` for `options.fence`, expected `` ` `` or `~`");return r}function hL(e,r,a,i){const s=fL(a),o=e.value||"",u=s==="`"?"GraveAccent":"Tilde";if(dL(e,a)){const p=a.enter("codeIndented"),b=a.indentLines(o,mL);return p(),b}const f=a.createTracker(i),h=s.repeat(Math.max(uL(o,s)+1,3)),m=a.enter("codeFenced");let y=f.move(h);if(e.lang){const p=a.enter(`codeFencedLang${u}`);y+=f.move(a.safe(e.lang,{before:y,after:" ",encode:["`"],...f.current()})),p()}if(e.lang&&e.meta){const p=a.enter(`codeFencedMeta${u}`);y+=f.move(" "),y+=f.move(a.safe(e.meta,{before:y,after:`
|
|
76
|
-
`,encode:["`"],...f.current()})),p()}return y+=f.move(`
|
|
77
|
-
`),o&&(y+=f.move(o+`
|
|
78
|
-
`)),y+=f.move(h),m(),y}function mL(e,r,a){return(a?"":" ")+e}function ap(e){const r=e.options.quote||'"';if(r!=='"'&&r!=="'")throw new Error("Cannot serialize title with `"+r+"` for `options.quote`, expected `\"`, or `'`");return r}function pL(e,r,a,i){const s=ap(a),o=s==='"'?"Quote":"Apostrophe",u=a.enter("definition");let f=a.enter("label");const h=a.createTracker(i);let m=h.move("[");return m+=h.move(a.safe(a.associationId(e),{before:m,after:"]",...h.current()})),m+=h.move("]: "),f(),!e.url||/[\0- \u007F]/.test(e.url)?(f=a.enter("destinationLiteral"),m+=h.move("<"),m+=h.move(a.safe(e.url,{before:m,after:">",...h.current()})),m+=h.move(">")):(f=a.enter("destinationRaw"),m+=h.move(a.safe(e.url,{before:m,after:e.title?" ":`
|
|
79
|
-
`,...h.current()}))),f(),e.title&&(f=a.enter(`title${o}`),m+=h.move(" "+s),m+=h.move(a.safe(e.title,{before:m,after:s,...h.current()})),m+=h.move(s),f()),u(),m}function gL(e){const r=e.options.emphasis||"*";if(r!=="*"&&r!=="_")throw new Error("Cannot serialize emphasis with `"+r+"` for `options.emphasis`, expected `*`, or `_`");return r}function ks(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Pc(e,r,a){const i=al(e),s=al(r);return i===void 0?s===void 0?a==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:i===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}}Vk.peek=yL;function Vk(e,r,a,i){const s=gL(a),o=a.enter("emphasis"),u=a.createTracker(i),f=u.move(s);let h=u.move(a.containerPhrasing(e,{after:s,before:f,...u.current()}));const m=h.charCodeAt(0),y=Pc(i.before.charCodeAt(i.before.length-1),m,s);y.inside&&(h=ks(m)+h.slice(1));const p=h.charCodeAt(h.length-1),b=Pc(i.after.charCodeAt(0),p,s);b.inside&&(h=h.slice(0,-1)+ks(p));const x=u.move(s);return o(),a.attentionEncodeSurroundingInfo={after:b.outside,before:y.outside},f+h+x}function yL(e,r,a){return a.options.emphasis||"*"}function xL(e,r){let a=!1;return np(e,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return a=!0,Xh}),!!((!e.depth||e.depth<3)&&Xm(e)&&(r.options.setext||a))}function vL(e,r,a,i){const s=Math.max(Math.min(6,e.depth||1),1),o=a.createTracker(i);if(xL(e,a)){const y=a.enter("headingSetext"),p=a.enter("phrasing"),b=a.containerPhrasing(e,{...o.current(),before:`
|
|
80
|
-
`,after:`
|
|
81
|
-
`});return p(),y(),b+`
|
|
82
|
-
`+(s===1?"=":"-").repeat(b.length-(Math.max(b.lastIndexOf("\r"),b.lastIndexOf(`
|
|
83
|
-
`))+1))}const u="#".repeat(s),f=a.enter("headingAtx"),h=a.enter("phrasing");o.move(u+" ");let m=a.containerPhrasing(e,{before:"# ",after:`
|
|
84
|
-
`,...o.current()});return/^[\t ]/.test(m)&&(m=ks(m.charCodeAt(0))+m.slice(1)),m=m?u+" "+m:u,a.options.closeAtx&&(m+=" "+u),h(),f(),m}Kk.peek=bL;function Kk(e){return e.value||""}function bL(){return"<"}Xk.peek=wL;function Xk(e,r,a,i){const s=ap(a),o=s==='"'?"Quote":"Apostrophe",u=a.enter("image");let f=a.enter("label");const h=a.createTracker(i);let m=h.move("![");return m+=h.move(a.safe(e.alt,{before:m,after:"]",...h.current()})),m+=h.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=a.enter("destinationLiteral"),m+=h.move("<"),m+=h.move(a.safe(e.url,{before:m,after:">",...h.current()})),m+=h.move(">")):(f=a.enter("destinationRaw"),m+=h.move(a.safe(e.url,{before:m,after:e.title?" ":")",...h.current()}))),f(),e.title&&(f=a.enter(`title${o}`),m+=h.move(" "+s),m+=h.move(a.safe(e.title,{before:m,after:s,...h.current()})),m+=h.move(s),f()),m+=h.move(")"),u(),m}function wL(){return"!"}Zk.peek=SL;function Zk(e,r,a,i){const s=e.referenceType,o=a.enter("imageReference");let u=a.enter("label");const f=a.createTracker(i);let h=f.move("![");const m=a.safe(e.alt,{before:h,after:"]",...f.current()});h+=f.move(m+"]["),u();const y=a.stack;a.stack=[],u=a.enter("reference");const p=a.safe(a.associationId(e),{before:h,after:"]",...f.current()});return u(),a.stack=y,o(),s==="full"||!m||m!==p?h+=f.move(p+"]"):s==="shortcut"?h=h.slice(0,-1):h+=f.move("]"),h}function SL(){return"!"}Qk.peek=kL;function Qk(e,r,a){let i=e.value||"",s="`",o=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(i);)s+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++o<a.unsafe.length;){const u=a.unsafe[o],f=a.compilePattern(u);let h;if(u.atBreak)for(;h=f.exec(i);){let m=h.index;i.charCodeAt(m)===10&&i.charCodeAt(m-1)===13&&m--,i=i.slice(0,m)+" "+i.slice(h.index+1)}}return s+i+s}function kL(){return"`"}function Wk(e,r){const a=Xm(e);return!!(!r.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(a===e.url||"mailto:"+a===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Jk.peek=_L;function Jk(e,r,a,i){const s=ap(a),o=s==='"'?"Quote":"Apostrophe",u=a.createTracker(i);let f,h;if(Wk(e,a)){const y=a.stack;a.stack=[],f=a.enter("autolink");let p=u.move("<");return p+=u.move(a.containerPhrasing(e,{before:p,after:">",...u.current()})),p+=u.move(">"),f(),a.stack=y,p}f=a.enter("link"),h=a.enter("label");let m=u.move("[");return m+=u.move(a.containerPhrasing(e,{before:m,after:"](",...u.current()})),m+=u.move("]("),h(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(h=a.enter("destinationLiteral"),m+=u.move("<"),m+=u.move(a.safe(e.url,{before:m,after:">",...u.current()})),m+=u.move(">")):(h=a.enter("destinationRaw"),m+=u.move(a.safe(e.url,{before:m,after:e.title?" ":")",...u.current()}))),h(),e.title&&(h=a.enter(`title${o}`),m+=u.move(" "+s),m+=u.move(a.safe(e.title,{before:m,after:s,...u.current()})),m+=u.move(s),h()),m+=u.move(")"),f(),m}function _L(e,r,a){return Wk(e,a)?"<":"["}e2.peek=jL;function e2(e,r,a,i){const s=e.referenceType,o=a.enter("linkReference");let u=a.enter("label");const f=a.createTracker(i);let h=f.move("[");const m=a.containerPhrasing(e,{before:h,after:"]",...f.current()});h+=f.move(m+"]["),u();const y=a.stack;a.stack=[],u=a.enter("reference");const p=a.safe(a.associationId(e),{before:h,after:"]",...f.current()});return u(),a.stack=y,o(),s==="full"||!m||m!==p?h+=f.move(p+"]"):s==="shortcut"?h=h.slice(0,-1):h+=f.move("]"),h}function jL(){return"["}function ip(e){const r=e.options.bullet||"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bullet`, expected `*`, `+`, or `-`");return r}function CL(e){const r=ip(e),a=e.options.bulletOther;if(!a)return r==="*"?"-":"*";if(a!=="*"&&a!=="+"&&a!=="-")throw new Error("Cannot serialize items with `"+a+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(a===r)throw new Error("Expected `bullet` (`"+r+"`) and `bulletOther` (`"+a+"`) to be different");return a}function EL(e){const r=e.options.bulletOrdered||".";if(r!=="."&&r!==")")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOrdered`, expected `.` or `)`");return r}function t2(e){const r=e.options.rule||"*";if(r!=="*"&&r!=="-"&&r!=="_")throw new Error("Cannot serialize rules with `"+r+"` for `options.rule`, expected `*`, `-`, or `_`");return r}function NL(e,r,a,i){const s=a.enter("list"),o=a.bulletCurrent;let u=e.ordered?EL(a):ip(a);const f=e.ordered?u==="."?")":".":CL(a);let h=r&&a.bulletLastUsed?u===a.bulletLastUsed:!1;if(!e.ordered){const y=e.children?e.children[0]:void 0;if((u==="*"||u==="-")&&y&&(!y.children||!y.children[0])&&a.stack[a.stack.length-1]==="list"&&a.stack[a.stack.length-2]==="listItem"&&a.stack[a.stack.length-3]==="list"&&a.stack[a.stack.length-4]==="listItem"&&a.indexStack[a.indexStack.length-1]===0&&a.indexStack[a.indexStack.length-2]===0&&a.indexStack[a.indexStack.length-3]===0&&(h=!0),t2(a)===u&&y){let p=-1;for(;++p<e.children.length;){const b=e.children[p];if(b&&b.type==="listItem"&&b.children&&b.children[0]&&b.children[0].type==="thematicBreak"){h=!0;break}}}}h&&(u=f),a.bulletCurrent=u;const m=a.containerFlow(e,i);return a.bulletLastUsed=u,a.bulletCurrent=o,s(),m}function AL(e){const r=e.options.listItemIndent||"one";if(r!=="tab"&&r!=="one"&&r!=="mixed")throw new Error("Cannot serialize items with `"+r+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return r}function TL(e,r,a,i){const s=AL(a);let o=a.bulletCurrent||ip(a);r&&r.type==="list"&&r.ordered&&(o=(typeof r.start=="number"&&r.start>-1?r.start:1)+(a.options.incrementListMarker===!1?0:r.children.indexOf(e))+o);let u=o.length+1;(s==="tab"||s==="mixed"&&(r&&r.type==="list"&&r.spread||e.spread))&&(u=Math.ceil(u/4)*4);const f=a.createTracker(i);f.move(o+" ".repeat(u-o.length)),f.shift(u);const h=a.enter("listItem"),m=a.indentLines(a.containerFlow(e,f.current()),y);return h(),m;function y(p,b,x){return b?(x?"":" ".repeat(u))+p:(x?o:o+" ".repeat(u-o.length))+p}}function RL(e,r,a,i){const s=a.enter("paragraph"),o=a.enter("phrasing"),u=a.containerPhrasing(e,i);return o(),s(),u}const OL=pu(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function zL(e,r,a,i){return(e.children.some(function(u){return OL(u)})?a.containerPhrasing:a.containerFlow).call(a,e,i)}function ML(e){const r=e.options.strong||"*";if(r!=="*"&&r!=="_")throw new Error("Cannot serialize strong with `"+r+"` for `options.strong`, expected `*`, or `_`");return r}n2.peek=DL;function n2(e,r,a,i){const s=ML(a),o=a.enter("strong"),u=a.createTracker(i),f=u.move(s+s);let h=u.move(a.containerPhrasing(e,{after:s,before:f,...u.current()}));const m=h.charCodeAt(0),y=Pc(i.before.charCodeAt(i.before.length-1),m,s);y.inside&&(h=ks(m)+h.slice(1));const p=h.charCodeAt(h.length-1),b=Pc(i.after.charCodeAt(0),p,s);b.inside&&(h=h.slice(0,-1)+ks(p));const x=u.move(s+s);return o(),a.attentionEncodeSurroundingInfo={after:b.outside,before:y.outside},f+h+x}function DL(e,r,a){return a.options.strong||"*"}function LL(e,r,a,i){return a.safe(e.value,i)}function IL(e){const r=e.options.ruleRepetition||3;if(r<3)throw new Error("Cannot serialize rules with repetition `"+r+"` for `options.ruleRepetition`, expected `3` or more");return r}function PL(e,r,a){const i=(t2(a)+(a.options.ruleSpaces?" ":"")).repeat(IL(a));return a.options.ruleSpaces?i.slice(0,-1):i}const r2={blockquote:sL,break:Kb,code:hL,definition:pL,emphasis:Vk,hardBreak:Kb,heading:vL,html:Kk,image:Xk,imageReference:Zk,inlineCode:Qk,link:Jk,linkReference:e2,list:NL,listItem:TL,paragraph:RL,root:zL,strong:n2,text:LL,thematicBreak:PL};function UL(){return{enter:{table:BL,tableData:Xb,tableHeader:Xb,tableRow:HL},exit:{codeText:qL,table:FL,tableData:vh,tableHeader:vh,tableRow:vh}}}function BL(e){const r=e._align;this.enter({type:"table",align:r.map(function(a){return a==="none"?null:a}),children:[]},e),this.data.inTable=!0}function FL(e){this.exit(e),this.data.inTable=void 0}function HL(e){this.enter({type:"tableRow",children:[]},e)}function vh(e){this.exit(e)}function Xb(e){this.enter({type:"tableCell",children:[]},e)}function qL(e){let r=this.resume();this.data.inTable&&(r=r.replace(/\\([\\|])/g,GL));const a=this.stack[this.stack.length-1];a.type,a.value=r,this.exit(e)}function GL(e,r){return r==="|"?r:e}function YL(e){const r=e||{},a=r.tableCellPadding,i=r.tablePipeAlign,s=r.stringLength,o=a?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
85
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:b,table:u,tableCell:h,tableRow:f}};function u(x,S,w,_){return m(y(x,w,_),x.align)}function f(x,S,w,_){const k=p(x,w,_),N=m([k]);return N.slice(0,N.indexOf(`
|
|
86
|
-
`))}function h(x,S,w,_){const k=w.enter("tableCell"),N=w.enter("phrasing"),A=w.containerPhrasing(x,{..._,before:o,after:o});return N(),k(),A}function m(x,S){return iL(x,{align:S,alignDelimiters:i,padding:a,stringLength:s})}function y(x,S,w){const _=x.children;let k=-1;const N=[],A=S.enter("table");for(;++k<_.length;)N[k]=p(_[k],S,w);return A(),N}function p(x,S,w){const _=x.children;let k=-1;const N=[],A=S.enter("tableRow");for(;++k<_.length;)N[k]=h(_[k],x,S,w);return A(),N}function b(x,S,w){let _=r2.inlineCode(x,S,w);return w.stack.includes("tableCell")&&(_=_.replace(/\|/g,"\\$&")),_}}function $L(){return{exit:{taskListCheckValueChecked:Zb,taskListCheckValueUnchecked:Zb,paragraph:KL}}}function VL(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:XL}}}function Zb(e){const r=this.stack[this.stack.length-2];r.type,r.checked=e.type==="taskListCheckValueChecked"}function KL(e){const r=this.stack[this.stack.length-2];if(r&&r.type==="listItem"&&typeof r.checked=="boolean"){const a=this.stack[this.stack.length-1];a.type;const i=a.children[0];if(i&&i.type==="text"){const s=r.children;let o=-1,u;for(;++o<s.length;){const f=s[o];if(f.type==="paragraph"){u=f;break}}u===a&&(i.value=i.value.slice(1),i.value.length===0?a.children.shift():a.position&&i.position&&typeof i.position.start.offset=="number"&&(i.position.start.column++,i.position.start.offset++,a.position.start=Object.assign({},i.position.start)))}}this.exit(e)}function XL(e,r,a,i){const s=e.children[0],o=typeof e.checked=="boolean"&&s&&s.type==="paragraph",u="["+(e.checked?"x":" ")+"] ",f=a.createTracker(i);o&&f.move(u);let h=r2.listItem(e,r,a,{...i,...f.current()});return o&&(h=h.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,m)),h;function m(y){return y+u}}function ZL(){return[N6(),X6(),J6(),UL(),$L()]}function QL(e){return{extensions:[A6(),Z6(e),eL(),YL(e),VL()]}}const WL={tokenize:a8,partial:!0},a2={tokenize:i8,partial:!0},i2={tokenize:l8,partial:!0},l2={tokenize:s8,partial:!0},JL={tokenize:o8,partial:!0},s2={name:"wwwAutolink",tokenize:n8,previous:c2},o2={name:"protocolAutolink",tokenize:r8,previous:u2},Ir={name:"emailAutolink",tokenize:t8,previous:d2},pr={};function e8(){return{text:pr}}let Fa=48;for(;Fa<123;)pr[Fa]=Ir,Fa++,Fa===58?Fa=65:Fa===91&&(Fa=97);pr[43]=Ir;pr[45]=Ir;pr[46]=Ir;pr[95]=Ir;pr[72]=[Ir,o2];pr[104]=[Ir,o2];pr[87]=[Ir,s2];pr[119]=[Ir,s2];function t8(e,r,a){const i=this;let s,o;return u;function u(p){return!Jh(p)||!d2.call(i,i.previous)||lp(i.events)?a(p):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),f(p))}function f(p){return Jh(p)?(e.consume(p),f):p===64?(e.consume(p),h):a(p)}function h(p){return p===46?e.check(JL,y,m)(p):p===45||p===95||an(p)?(o=!0,e.consume(p),h):y(p)}function m(p){return e.consume(p),s=!0,h}function y(p){return o&&s&&cn(i.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),r(p)):a(p)}}function n8(e,r,a){const i=this;return s;function s(u){return u!==87&&u!==119||!c2.call(i,i.previous)||lp(i.events)?a(u):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(WL,e.attempt(a2,e.attempt(i2,o),a),a)(u))}function o(u){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),r(u)}}function r8(e,r,a){const i=this;let s="",o=!1;return u;function u(p){return(p===72||p===104)&&u2.call(i,i.previous)&&!lp(i.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(p),e.consume(p),f):a(p)}function f(p){if(cn(p)&&s.length<5)return s+=String.fromCodePoint(p),e.consume(p),f;if(p===58){const b=s.toLowerCase();if(b==="http"||b==="https")return e.consume(p),h}return a(p)}function h(p){return p===47?(e.consume(p),o?m:(o=!0,h)):a(p)}function m(p){return p===null||Dc(p)||bt(p)||Qa(p)||fu(p)?a(p):e.attempt(a2,e.attempt(i2,y),a)(p)}function y(p){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),r(p)}}function a8(e,r,a){let i=0;return s;function s(u){return(u===87||u===119)&&i<3?(i++,e.consume(u),s):u===46&&i===3?(e.consume(u),o):a(u)}function o(u){return u===null?a(u):r(u)}}function i8(e,r,a){let i,s,o;return u;function u(m){return m===46||m===95?e.check(l2,h,f)(m):m===null||bt(m)||Qa(m)||m!==45&&fu(m)?h(m):(o=!0,e.consume(m),u)}function f(m){return m===95?i=!0:(s=i,i=void 0),e.consume(m),u}function h(m){return s||i||!o?a(m):r(m)}}function l8(e,r){let a=0,i=0;return s;function s(u){return u===40?(a++,e.consume(u),s):u===41&&i<a?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(l2,r,o)(u):u===null||bt(u)||Qa(u)?r(u):(e.consume(u),s)}function o(u){return u===41&&i++,e.consume(u),s}}function s8(e,r,a){return i;function i(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),i):f===38?(e.consume(f),o):f===93?(e.consume(f),s):f===60||f===null||bt(f)||Qa(f)?r(f):a(f)}function s(f){return f===null||f===40||f===91||bt(f)||Qa(f)?r(f):i(f)}function o(f){return cn(f)?u(f):a(f)}function u(f){return f===59?(e.consume(f),i):cn(f)?(e.consume(f),u):a(f)}}function o8(e,r,a){return i;function i(o){return e.consume(o),s}function s(o){return an(o)?a(o):r(o)}}function c2(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||bt(e)}function u2(e){return!cn(e)}function d2(e){return!(e===47||Jh(e))}function Jh(e){return e===43||e===45||e===46||e===95||an(e)}function lp(e){let r=e.length,a=!1;for(;r--;){const i=e[r][1];if((i.type==="labelLink"||i.type==="labelImage")&&!i._balanced){a=!0;break}if(i._gfmAutolinkLiteralWalkedInto){a=!1;break}}return e.length>0&&!a&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),a}const c8={tokenize:y8,partial:!0};function u8(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:m8,continuation:{tokenize:p8},exit:g8}},text:{91:{name:"gfmFootnoteCall",tokenize:h8},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:d8,resolveTo:f8}}}}function d8(e,r,a){const i=this;let s=i.events.length;const o=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let u;for(;s--;){const h=i.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 a(h);const m=Wn(i.sliceSerialize({start:u.end,end:i.now()}));return m.codePointAt(0)!==94||!o.includes(m.slice(1))?a(h):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),r(h))}}function f8(e,r){let a=e.length;for(;a--;)if(e[a][1].type==="labelImage"&&e[a][0]==="enter"){e[a][1];break}e[a+1][1].type="data",e[a+3][1].type="gfmFootnoteCallLabelMarker";const i={type:"gfmFootnoteCall",start:Object.assign({},e[a+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[a+3][1].end),end:Object.assign({},e[a+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[a+1],e[a+2],["enter",i,r],e[a+3],e[a+4],["enter",s,r],["exit",s,r],["enter",o,r],["enter",u,r],["exit",u,r],["exit",o,r],e[e.length-2],e[e.length-1],["exit",i,r]];return e.splice(a,e.length-a+1,...f),e}function h8(e,r,a){const i=this,s=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let o=0,u;return f;function f(p){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),h}function h(p){return p!==94?a(p):(e.enter("gfmFootnoteCallMarker"),e.consume(p),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",m)}function m(p){if(o>999||p===93&&!u||p===null||p===91||bt(p))return a(p);if(p===93){e.exit("chunkString");const b=e.exit("gfmFootnoteCallString");return s.includes(Wn(i.sliceSerialize(b)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),r):a(p)}return bt(p)||(u=!0),o++,e.consume(p),p===92?y:m}function y(p){return p===91||p===92||p===93?(e.consume(p),o++,m):m(p)}}function m8(e,r,a){const i=this,s=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let o,u=0,f;return h;function h(S){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),m}function m(S){return S===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",y):a(S)}function y(S){if(u>999||S===93&&!f||S===null||S===91||bt(S))return a(S);if(S===93){e.exit("chunkString");const w=e.exit("gfmFootnoteDefinitionLabelString");return o=Wn(i.sliceSerialize(w)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),b}return bt(S)||(f=!0),u++,e.consume(S),S===92?p:y}function p(S){return S===91||S===92||S===93?(e.consume(S),u++,y):y(S)}function b(S){return S===58?(e.enter("definitionMarker"),e.consume(S),e.exit("definitionMarker"),s.includes(o)||s.push(o),lt(e,x,"gfmFootnoteDefinitionWhitespace")):a(S)}function x(S){return r(S)}}function p8(e,r,a){return e.check(Us,r,e.attempt(c8,r,a))}function g8(e){e.exit("gfmFootnoteDefinition")}function y8(e,r,a){const i=this;return lt(e,s,"gfmFootnoteDefinitionIndent",5);function s(o){const u=i.events[i.events.length-1];return u&&u[1].type==="gfmFootnoteDefinitionIndent"&&u[2].sliceSerialize(u[1],!0).length===4?r(o):a(o)}}function x8(e){let a=(e||{}).singleTilde;const i={name:"strikethrough",tokenize:o,resolveAll:s};return a==null&&(a=!0),{text:{126:i},insideSpan:{null:[i]},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 m=h;for(;m--;)if(u[m][0]==="exit"&&u[m][1].type==="strikethroughSequenceTemporary"&&u[m][1]._open&&u[h][1].end.offset-u[h][1].start.offset===u[m][1].end.offset-u[m][1].start.offset){u[h][1].type="strikethroughSequence",u[m][1].type="strikethroughSequence";const y={type:"strikethrough",start:Object.assign({},u[m][1].start),end:Object.assign({},u[h][1].end)},p={type:"strikethroughText",start:Object.assign({},u[m][1].end),end:Object.assign({},u[h][1].start)},b=[["enter",y,f],["enter",u[m][1],f],["exit",u[m][1],f],["enter",p,f]],x=f.parser.constructs.insideSpan.null;x&&On(b,b.length,0,hu(x,u.slice(m+1,h),f)),On(b,b.length,0,[["exit",p,f],["enter",u[h][1],f],["exit",u[h][1],f],["exit",y,f]]),On(u,m-1,h-m+3,b),h=m+b.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 m=this.previous,y=this.events;let p=0;return b;function b(S){return m===126&&y[y.length-1][1].type!=="characterEscape"?h(S):(u.enter("strikethroughSequenceTemporary"),x(S))}function x(S){const w=al(m);if(S===126)return p>1?h(S):(u.consume(S),p++,x);if(p<2&&!a)return h(S);const _=u.exit("strikethroughSequenceTemporary"),k=al(S);return _._open=!k||k===2&&!!w,_._close=!w||w===2&&!!k,f(S)}}}class v8{constructor(){this.map=[]}add(r,a,i){b8(this,r,a,i)}consume(r){if(this.map.sort(function(o,u){return o[0]-u[0]}),this.map.length===0)return;let a=this.map.length;const i=[];for(;a>0;)a-=1,i.push(r.slice(this.map[a][0]+this.map[a][1]),this.map[a][2]),r.length=this.map[a][0];i.push(r.slice()),r.length=0;let s=i.pop();for(;s;){for(const o of s)r.push(o);s=i.pop()}this.map.length=0}}function b8(e,r,a,i){let s=0;if(!(a===0&&i.length===0)){for(;s<e.map.length;){if(e.map[s][0]===r){e.map[s][1]+=a,e.map[s][2].push(...i);return}s+=1}e.map.push([r,a,i])}}function w8(e,r){let a=!1;const i=[];for(;r<e.length;){const s=e[r];if(a){if(s[0]==="enter")s[1].type==="tableContent"&&i.push(e[r+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(e[r-1][1].type==="tableDelimiterMarker"){const o=i.length-1;i[o]=i[o]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(a=!0);r+=1}return i}function S8(){return{flow:{null:{name:"table",tokenize:k8,resolveAll:_8}}}}function k8(e,r,a){const i=this;let s=0,o=0,u;return f;function f(U){let te=i.events.length-1;for(;te>-1;){const E=i.events[te][1].type;if(E==="lineEnding"||E==="linePrefix")te--;else break}const I=te>-1?i.events[te][1].type:null,Z=I==="tableHead"||I==="tableRow"?D:h;return Z===D&&i.parser.lazy[i.now().line]?a(U):Z(U)}function h(U){return e.enter("tableHead"),e.enter("tableRow"),m(U)}function m(U){return U===124||(u=!0,o+=1),y(U)}function y(U){return U===null?a(U):qe(U)?o>1?(o=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(U),e.exit("lineEnding"),x):a(U):tt(U)?lt(e,y,"whitespace")(U):(o+=1,u&&(u=!1,s+=1),U===124?(e.enter("tableCellDivider"),e.consume(U),e.exit("tableCellDivider"),u=!0,y):(e.enter("data"),p(U)))}function p(U){return U===null||U===124||bt(U)?(e.exit("data"),y(U)):(e.consume(U),U===92?b:p)}function b(U){return U===92||U===124?(e.consume(U),p):p(U)}function x(U){return i.interrupt=!1,i.parser.lazy[i.now().line]?a(U):(e.enter("tableDelimiterRow"),u=!1,tt(U)?lt(e,S,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(U):S(U))}function S(U){return U===45||U===58?_(U):U===124?(u=!0,e.enter("tableCellDivider"),e.consume(U),e.exit("tableCellDivider"),w):M(U)}function w(U){return tt(U)?lt(e,_,"whitespace")(U):_(U)}function _(U){return U===58?(o+=1,u=!0,e.enter("tableDelimiterMarker"),e.consume(U),e.exit("tableDelimiterMarker"),k):U===45?(o+=1,k(U)):U===null||qe(U)?O(U):M(U)}function k(U){return U===45?(e.enter("tableDelimiterFiller"),N(U)):M(U)}function N(U){return U===45?(e.consume(U),N):U===58?(u=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(U),e.exit("tableDelimiterMarker"),A):(e.exit("tableDelimiterFiller"),A(U))}function A(U){return tt(U)?lt(e,O,"whitespace")(U):O(U)}function O(U){return U===124?S(U):U===null||qe(U)?!u||s!==o?M(U):(e.exit("tableDelimiterRow"),e.exit("tableHead"),r(U)):M(U)}function M(U){return a(U)}function D(U){return e.enter("tableRow"),B(U)}function B(U){return U===124?(e.enter("tableCellDivider"),e.consume(U),e.exit("tableCellDivider"),B):U===null||qe(U)?(e.exit("tableRow"),r(U)):tt(U)?lt(e,B,"whitespace")(U):(e.enter("data"),V(U))}function V(U){return U===null||U===124||bt(U)?(e.exit("data"),B(U)):(e.consume(U),U===92?K:V)}function K(U){return U===92||U===124?(e.consume(U),V):V(U)}}function _8(e,r){let a=-1,i=!0,s=0,o=[0,0,0,0],u=[0,0,0,0],f=!1,h=0,m,y,p;const b=new v8;for(;++a<e.length;){const x=e[a],S=x[1];x[0]==="enter"?S.type==="tableHead"?(f=!1,h!==0&&(Qb(b,r,h,m,y),y=void 0,h=0),m={type:"table",start:Object.assign({},S.start),end:Object.assign({},S.end)},b.add(a,0,[["enter",m,r]])):S.type==="tableRow"||S.type==="tableDelimiterRow"?(i=!0,p=void 0,o=[0,0,0,0],u=[0,a+1,0,0],f&&(f=!1,y={type:"tableBody",start:Object.assign({},S.start),end:Object.assign({},S.end)},b.add(a,0,[["enter",y,r]])),s=S.type==="tableDelimiterRow"?2:y?3:1):s&&(S.type==="data"||S.type==="tableDelimiterMarker"||S.type==="tableDelimiterFiller")?(i=!1,u[2]===0&&(o[1]!==0&&(u[0]=u[1],p=pc(b,r,o,s,void 0,p),o=[0,0,0,0]),u[2]=a)):S.type==="tableCellDivider"&&(i?i=!1:(o[1]!==0&&(u[0]=u[1],p=pc(b,r,o,s,void 0,p)),o=u,u=[o[1],a,0,0])):S.type==="tableHead"?(f=!0,h=a):S.type==="tableRow"||S.type==="tableDelimiterRow"?(h=a,o[1]!==0?(u[0]=u[1],p=pc(b,r,o,s,a,p)):u[1]!==0&&(p=pc(b,r,u,s,a,p)),s=0):s&&(S.type==="data"||S.type==="tableDelimiterMarker"||S.type==="tableDelimiterFiller")&&(u[3]=a)}for(h!==0&&Qb(b,r,h,m,y),b.consume(r.events),a=-1;++a<r.events.length;){const x=r.events[a];x[0]==="enter"&&x[1].type==="table"&&(x[1]._align=w8(r.events,a))}return e}function pc(e,r,a,i,s,o){const u=i===1?"tableHeader":i===2?"tableDelimiter":"tableData",f="tableContent";a[0]!==0&&(o.end=Object.assign({},Vi(r.events,a[0])),e.add(a[0],0,[["exit",o,r]]));const h=Vi(r.events,a[1]);if(o={type:u,start:Object.assign({},h),end:Object.assign({},h)},e.add(a[1],0,[["enter",o,r]]),a[2]!==0){const m=Vi(r.events,a[2]),y=Vi(r.events,a[3]),p={type:f,start:Object.assign({},m),end:Object.assign({},y)};if(e.add(a[2],0,[["enter",p,r]]),i!==2){const b=r.events[a[2]],x=r.events[a[3]];if(b[1].end=Object.assign({},x[1].end),b[1].type="chunkText",b[1].contentType="text",a[3]>a[2]+1){const S=a[2]+1,w=a[3]-a[2]-1;e.add(S,w,[])}}e.add(a[3]+1,0,[["exit",p,r]])}return s!==void 0&&(o.end=Object.assign({},Vi(r.events,s)),e.add(s,0,[["exit",o,r]]),o=void 0),o}function Qb(e,r,a,i,s){const o=[],u=Vi(r.events,a);s&&(s.end=Object.assign({},u),o.push(["exit",s,r])),i.end=Object.assign({},u),o.push(["exit",i,r]),e.add(a+1,0,o)}function Vi(e,r){const a=e[r],i=a[0]==="enter"?"start":"end";return a[1][i]}const j8={name:"tasklistCheck",tokenize:E8};function C8(){return{text:{91:j8}}}function E8(e,r,a){const i=this;return s;function s(h){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?a(h):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),o)}function o(h){return bt(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):a(h)}function u(h){return h===93?(e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),f):a(h)}function f(h){return qe(h)?r(h):tt(h)?e.check({tokenize:N8},r,a)(h):a(h)}}function N8(e,r,a){return lt(e,i,"whitespace");function i(s){return s===null?a(s):r(s)}}function A8(e){return Sk([e8(),u8(),x8(e),S8(),C8()])}const T8={};function Wb(e){const r=this,a=e||T8,i=r.data(),s=i.micromarkExtensions||(i.micromarkExtensions=[]),o=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),u=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);s.push(A8(a)),o.push(ZL()),u.push(QL(a))}function R8(e){return e.filter(r=>r.connections.length>0).map(r=>r.id)}function O8({ideas:e,onSelectIdea:r}){const a=i=>{r(i)};return d.jsxs("div",{className:"space-y-2",children:[d.jsxs("div",{className:"text-muted-foreground flex items-center gap-1.5 text-xs font-medium",children:[d.jsx(uS,{className:"size-3.5","aria-hidden":!0}),"Try an idea"]}),d.jsx("div",{className:"flex flex-wrap gap-2",children:e.slice(0,8).map(i=>d.jsxs("button",{type:"button",onClick:()=>a(i),className:"border-input hover:bg-muted/50 flex min-w-0 flex-col items-start gap-0.5 rounded-lg border px-3 py-2 text-left text-sm transition-colors",children:[d.jsx("span",{className:"truncate font-medium w-full",children:i.title}),d.jsx("span",{className:"text-muted-foreground line-clamp-1 text-xs font-normal w-full min-w-0",children:i.description})]},i.id))})]})}const Nt="https://cdn.simpleicons.org",z8=[{id:"github",name:"GitHub",description:"Repos, issues, and code",category:"featured",icon:q4,logoUrl:`${Nt}/github`},{id:"gmail",name:"Gmail",description:"Send and read email",category:"featured",icon:rb,logoUrl:`${Nt}/gmail`},{id:"notion",name:"Notion",description:"Pages, databases, and docs",category:"featured",icon:aS,logoUrl:`${Nt}/notion`},{id:"slack",name:"Slack",description:"Channels and messages",category:"featured",icon:us,logoUrl:`${Nt}/slack`},{id:"calendar",name:"Google Calendar",description:"Events and scheduling",category:"featured",icon:f4,logoUrl:`${Nt}/googlecalendar`},{id:"drive",name:"Google Drive",description:"Files and folders",category:"featured",icon:cS,logoUrl:`${Nt}/googledrive`},{id:"docs",name:"Google Docs",description:"Create and edit documents",category:"featured",icon:Rm,logoUrl:`${Nt}/googledocs`},{id:"sheets",name:"Google Sheets",description:"Spreadsheets and data",category:"featured",icon:z5,logoUrl:`${Nt}/googlesheets`},{id:"asana",name:"Asana",description:"Tasks and projects",category:"featured",icon:P5,logoUrl:`${Nt}/asana`},{id:"contacts",name:"Google Contacts",description:"Contacts and people",category:"featured",icon:Y5,logoUrl:`${Nt}/google`},{id:"facebook",name:"Facebook",description:"Pages and posts",category:"featured",icon:L4,logoUrl:`${Nt}/facebook`},{id:"bluesky",name:"Bluesky",description:"Posts and timeline (atproto)",category:"featured",icon:us,logoUrl:`${Nt}/bluesky`},{id:"airtable",name:"Airtable",description:"Bases, tables, and records",category:"featured",icon:W4,logoUrl:`${Nt}/airtable`},{id:"linear",name:"Linear",description:"Issues and workflows",category:"featured",icon:a4,logoUrl:`${Nt}/linear`},{id:"zoom",name:"Zoom",description:"Meetings and video",category:"featured",icon:V5,logoUrl:`${Nt}/zoom`},{id:"dropbox",name:"Dropbox",description:"Files and folders",category:"featured",icon:w4,logoUrl:`${Nt}/dropbox`},{id:"jira",name:"Jira",description:"Issues and projects",category:"featured",icon:tb,logoUrl:`${Nt}/jirasoftware`},{id:"slides",name:"Google Slides",description:"Presentations and slides",category:"featured",icon:w5,logoUrl:`${Nt}/googleslides`},{id:"figma",name:"Figma",description:"Design files and prototypes",category:"featured",icon:f5,logoUrl:`${Nt}/figma`},{id:"trello",name:"Trello",description:"Boards, lists, and cards",category:"productivity",icon:tb,logoUrl:`${Nt}/trello`},{id:"twitter",name:"Twitter / X",description:"Post and read tweets",category:"featured",icon:us,logoUrl:`${Nt}/x`},{id:"microsoft",name:"Microsoft 365",description:"Outlook, Calendar, OneDrive",category:"featured",icon:rb,logoUrl:`${Nt}/microsoft`},{id:"zendesk",name:"Zendesk",description:"Tickets and support",category:"productivity",icon:us,logoUrl:`${Nt}/zendesk`},{id:"youtube",name:"YouTube",description:"Channels, videos, and uploads",category:"featured",icon:Z5,logoUrl:`${Nt}/youtube`}],M8=new Map(z8.map(e=>[e.id,e]));function D8(e){return M8.get(e.toLowerCase())??null}function L8({open:e,onOpenChange:r,requiredIntegrations:a,connectedIds:i,ideaTitle:s,onConnect:o}){const u=h=>h.toLowerCase(),f=a.filter(h=>i.some(m=>u(m)===u(h)));return d.jsx(Ya,{open:e,onOpenChange:r,children:d.jsxs($a,{className:"max-w-md",showCloseButton:!0,children:[d.jsxs(Va,{children:[d.jsx(Xa,{children:s?`Missing integrations: ${s}`:"Missing integrations"}),d.jsx(Za,{children:"Install the required skills from the hub (Skills → Add skill from registry), then try again. Do not run the workflow until the needed capabilities are available."})]}),d.jsx("ul",{className:"space-y-2 text-sm",children:a.map(h=>{const y=D8(h)?.name??h,p=f.includes(h);return d.jsxs("li",{className:"flex items-center justify-between gap-2 rounded-md border bg-muted/30 px-3 py-2",children:[d.jsxs("span",{className:"flex items-center gap-2",children:[p?d.jsx("span",{className:"text-green-600 dark:text-green-400","aria-hidden":!0,children:"✓"}):d.jsx("span",{className:"text-muted-foreground","aria-hidden":!0,children:"✗"}),y]}),!p&&d.jsx(je,{size:"sm",variant:"outline",onClick:()=>o(h),children:"Add skill"})]},h)})}),d.jsx(Ka,{className:"gap-2 pt-2",children:d.jsx(je,{variant:"outline",onClick:()=>r(!1),children:"Close"})})]})})}const Jb=[{id:"summarize_inbox",title:"Summarize my inbox",description:"Get a brief summary of unread emails",base_prompt:"Summarize my unread emails and list the most important ones with senders and subjects.",required_integrations:["gmail"],optional_integrations:[]},{id:"create_linear_issue",title:"Create a Linear issue",description:"Turn a short description into a Linear issue",base_prompt:"Create a Linear issue from this: [describe the issue]. Use the default team and set a sensible title and description.",required_integrations:["linear"],optional_integrations:["slack"]},{id:"schedule_zoom",title:"Schedule a Zoom meeting",description:"Create a Zoom meeting and optionally invite via Slack",base_prompt:"Schedule a Zoom meeting for [time/topic]. Create the meeting and share the link.",required_integrations:["zoom"],optional_integrations:["slack","calendar"]},{id:"stripe_overview",title:"Stripe overview",description:"See recent customers and revenue",base_prompt:"Give me a short overview of my Stripe account: recent customers, revenue this month, and any failed payments.",required_integrations:["stripe"],optional_integrations:[]},{id:"send_email",title:"Send an email",description:"Draft and send an email to a recipient",base_prompt:"Send an email to [recipient] with subject [subject] and body [your message].",required_integrations:["gmail"],optional_integrations:[]},{id:"list_calendar_events",title:"List my calendar events",description:"See upcoming events for today or this week",base_prompt:"List my calendar events for today and the next 7 days.",required_integrations:["calendar"],optional_integrations:[]},{id:"create_calendar_event",title:"Create a calendar event",description:"Add a new event to your calendar",base_prompt:"Create a calendar event: [title] on [date/time] with [optional details].",required_integrations:["calendar"],optional_integrations:[]},{id:"list_slack_channels",title:"List Slack channels",description:"See all channels you're in",base_prompt:"List all Slack channels I'm a member of.",required_integrations:["slack"],optional_integrations:[]},{id:"post_to_slack",title:"Post to Slack",description:"Send a message to a Slack channel",base_prompt:"Post this message to Slack channel [channel name]: [your message].",required_integrations:["slack"],optional_integrations:[]},{id:"list_github_issues",title:"List GitHub issues",description:"See open issues for a repo",base_prompt:"List open issues in my GitHub repository [repo name].",required_integrations:["github"],optional_integrations:[]},{id:"create_github_issue",title:"Create a GitHub issue",description:"Open a new issue in a repo",base_prompt:"Create a GitHub issue in [repo]: title [title], body [description].",required_integrations:["github"],optional_integrations:[]},{id:"search_notion",title:"Search Notion",description:"Find pages and databases in Notion",base_prompt:"Search Notion for pages and databases matching [query].",required_integrations:["notion"],optional_integrations:[]},{id:"list_drive_files",title:"List Google Drive files",description:"See files in a Drive folder",base_prompt:"List files in my Google Drive root (or folder [name]).",required_integrations:["drive"],optional_integrations:[]},{id:"read_google_sheet",title:"Read a Google Sheet",description:"Get data from a spreadsheet",base_prompt:"Read and summarize the data from my Google Sheet [name or URL].",required_integrations:["sheets"],optional_integrations:[]},{id:"find_unread_important",title:"Find important unread emails",description:"Prioritize emails from key senders",base_prompt:"Find my most important unread emails (e.g. from work, invoices, or key contacts) and list them with senders and subjects.",required_integrations:["gmail"],optional_integrations:[]},{id:"archive_old_emails",title:"Archive old read emails",description:"Clean up inbox by archiving",base_prompt:"Archive read emails older than 30 days from my inbox.",required_integrations:["gmail"],optional_integrations:[]},{id:"linear_board_status",title:"Linear board status",description:"See issues by status",base_prompt:"Show me the status of Linear issues: what's in progress, blocked, and done this week.",required_integrations:["linear"],optional_integrations:[]},{id:"jira_sprint_report",title:"Jira sprint report",description:"Summarize current sprint",base_prompt:"Give me a brief report on the current Jira sprint: completed, in progress, and blocked issues.",required_integrations:["jira"],optional_integrations:[]},{id:"trello_board_summary",title:"Trello board summary",description:"Overview of a Trello board",base_prompt:"Summarize my Trello board [board name]: lists and key cards.",required_integrations:["trello"],optional_integrations:[]},{id:"asana_tasks_today",title:"Asana tasks for today",description:"List today's tasks",base_prompt:"List my Asana tasks due today.",required_integrations:["asana"],optional_integrations:[]},{id:"stripe_failed_payments",title:"Stripe failed payments",description:"See failed charges",base_prompt:"List failed payments in Stripe from the last 7 days and suggest follow-up actions.",required_integrations:["stripe"],optional_integrations:[]},{id:"zendesk_open_tickets",title:"Zendesk open tickets",description:"See unsolved support tickets",base_prompt:"List open Zendesk support tickets, sorted by priority.",required_integrations:["zendesk"],optional_integrations:[]},{id:"airtable_list_records",title:"Airtable records",description:"List records from a base",base_prompt:"List records from my Airtable base [base name], table [table name].",required_integrations:["airtable"],optional_integrations:[]},{id:"youtube_search",title:"Search YouTube",description:"Find videos by topic",base_prompt:"Search YouTube for videos about [topic] and list the top 5 results.",required_integrations:["youtube"],optional_integrations:[]},{id:"figma_list_files",title:"List Figma files",description:"See design files",base_prompt:"List my Figma files and projects.",required_integrations:["figma"],optional_integrations:[]},{id:"dropbox_list_folders",title:"List Dropbox folders",description:"See folders in Dropbox",base_prompt:"List folders in my Dropbox root.",required_integrations:["dropbox"],optional_integrations:[]},{id:"post_bluesky",title:"Post to Bluesky",description:"Share a post on Bluesky",base_prompt:"Post to Bluesky: [your message].",required_integrations:["bluesky"],optional_integrations:[]},{id:"post_twitter",title:"Post a tweet",description:"Share on X (Twitter)",base_prompt:"Post a tweet: [your message].",required_integrations:["twitter"],optional_integrations:[]},{id:"outlook_unread",title:"Outlook unread emails",description:"List unread in Outlook",base_prompt:"List my unread Outlook emails with senders and subjects.",required_integrations:["microsoft"],optional_integrations:[]},{id:"create_notion_page",title:"Create Notion page",description:"Add a new page",base_prompt:"Create a new Notion page titled [title] with content [description].",required_integrations:["notion"],optional_integrations:[]},{id:"google_docs_summary",title:"Summarize a Google Doc",description:"Get a summary of a document",base_prompt:"Summarize the Google Doc [name or URL].",required_integrations:["docs"],optional_integrations:[]},{id:"github_pr_list",title:"List GitHub PRs",description:"See open pull requests",base_prompt:"List open pull requests in [repo].",required_integrations:["github"],optional_integrations:[]},{id:"slack_unread",title:"Slack unread messages",description:"Catch up on unread",base_prompt:"Summarize my unread Slack messages across channels.",required_integrations:["slack"],optional_integrations:[]},{id:"zoom_upcoming",title:"Upcoming Zoom meetings",description:"See scheduled meetings",base_prompt:"List my upcoming Zoom meetings for the next 7 days.",required_integrations:["zoom"],optional_integrations:[]},{id:"calendar_busy_times",title:"Find free slots",description:"When am I free?",base_prompt:"Find my free time slots tomorrow (or [date]) for a [duration]-minute meeting.",required_integrations:["calendar"],optional_integrations:[]},{id:"gmail_search",title:"Search Gmail",description:"Find emails by criteria",base_prompt:"Search my Gmail for [query, e.g. from:sender, has:attachment, is:unread] and list the results.",required_integrations:["gmail"],optional_integrations:[]},{id:"reply_to_email",title:"Reply to an email",description:"Draft a reply",base_prompt:"Reply to the email [subject or ID] with: [your reply].",required_integrations:["gmail"],optional_integrations:[]},{id:"add_google_contact",title:"Add Google Contact",description:"Create a new contact",base_prompt:"Add a new Google Contact: name [name], email [email], phone [optional].",required_integrations:["contacts"],optional_integrations:[]},{id:"drive_upload",title:"Upload to Drive",description:"Upload a file to Google Drive",base_prompt:"Upload the file [path or URL] to my Google Drive folder [folder name].",required_integrations:["drive"],optional_integrations:[]},{id:"sheets_append_row",title:"Add row to Sheet",description:"Append data to a spreadsheet",base_prompt:"Append a row to my Google Sheet [name] with: [column values].",required_integrations:["sheets"],optional_integrations:[]},{id:"linear_my_issues",title:"My Linear issues",description:"Issues assigned to me",base_prompt:"List Linear issues assigned to me, grouped by status.",required_integrations:["linear"],optional_integrations:[]},{id:"stripe_customers",title:"Stripe customers list",description:"Recent customers",base_prompt:"List my most recent Stripe customers with email and subscription status.",required_integrations:["stripe"],optional_integrations:[]},{id:"slack_create_channel",title:"Create Slack channel",description:"Start a new channel",base_prompt:"Create a new Slack channel named [name] with topic [topic].",required_integrations:["slack"],optional_integrations:[]},{id:"notion_database_query",title:"Query Notion database",description:"Filter and sort database",base_prompt:"Query my Notion database [name] with filter [criteria] and return the top 10 results.",required_integrations:["notion"],optional_integrations:[]},{id:"meeting_notes",title:"Draft meeting notes",description:"Create notes from a meeting",base_prompt:"Create a Google Doc with meeting notes for [topic/meeting name] including: attendees, agenda, decisions, and action items.",required_integrations:["docs"],optional_integrations:["calendar","slack"]},{id:"weekly_summary",title:"Weekly summary",description:"Inbox, calendar, and tasks",base_prompt:"Give me a weekly summary: unread email count, calendar events this week, and any overdue tasks (from Linear, Jira, or Asana).",required_integrations:[],optional_integrations:["gmail","calendar","linear","jira","asana"]},{id:"invoice_reminder",title:"Invoice follow-up",description:"Stripe invoices to chase",base_prompt:"List Stripe invoices that are past due or unpaid, and draft a short follow-up email for each.",required_integrations:["stripe"],optional_integrations:["gmail"]},{id:"social_post",title:"Post to social media",description:"Share on Bluesky or X",base_prompt:"Post this to [Bluesky / X / both]: [your message].",required_integrations:[],optional_integrations:["bluesky","twitter"]},{id:"feedback_to_linear",title:"Turn feedback into Linear issue",description:"Create issue from user feedback",base_prompt:"Create a Linear issue from this user feedback: [paste feedback]. Set appropriate labels and priority.",required_integrations:["linear"],optional_integrations:["slack","gmail"]},{id:"slides_outline",title:"Draft presentation outline",description:"Create slides structure",base_prompt:"Create a Google Slides presentation with outline for [topic]: title slide, main points, and summary.",required_integrations:["slides"],optional_integrations:[]},{id:"todo_from_email",title:"Todo from email",description:"Extract action items",base_prompt:"Read my most recent unread emails and create a todo list of action items with due dates.",required_integrations:["gmail"],optional_integrations:["notion","linear"]},{id:"facebook_page_post",title:"Post to Facebook page",description:"Share on your page",base_prompt:"Post to my Facebook page: [your message].",required_integrations:["facebook"],optional_integrations:[]},{id:"zendesk_reply",title:"Draft Zendesk reply",description:"Reply to a ticket",base_prompt:"Draft a reply to Zendesk ticket [id] addressing the customer's issue.",required_integrations:["zendesk"],optional_integrations:[]}];function I8(e){const r=e??"";return/would you like me to create (a )?job for you/i.test(r)}const e0={p:({children:e})=>d.jsx("p",{className:"mb-2 last:mb-0",children:e}),h1:({children:e})=>d.jsx("h1",{className:"mb-2 mt-3 text-lg font-bold first:mt-0",children:e}),h2:({children:e})=>d.jsx("h2",{className:"mb-2 mt-3 text-base font-bold first:mt-0",children:e}),h3:({children:e})=>d.jsx("h3",{className:"mb-1 mt-2 text-sm font-bold first:mt-0",children:e}),ul:({children:e})=>d.jsx("ul",{className:"mb-2 list-inside list-disc space-y-0.5",children:e}),ol:({children:e})=>d.jsx("ol",{className:"mb-2 list-inside list-decimal space-y-0.5",children:e}),code:({className:e,children:r,...a})=>e?.includes("language-")?d.jsx("pre",{className:"mb-2 overflow-x-auto rounded bg-muted p-2 text-xs",children:d.jsx("code",{className:e,...a,children:r})}):d.jsx("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-xs",...a,children:r}),a:({href:e,children:r})=>d.jsx("a",{href:e,className:"text-primary underline hover:no-underline",target:"_blank",rel:"noopener noreferrer",children:r}),blockquote:({children:e})=>d.jsx("blockquote",{className:"my-2 border-l-2 border-muted-foreground/30 pl-3 italic",children:e}),img:({src:e,alt:r})=>e?d.jsx("img",{src:e,alt:r??"attachment",className:"my-1 max-h-48 max-w-full rounded object-contain"}):null};function t0(e){return e?e.replace(new RegExp(`(?<!\\]\\()(https?:\\/\\/[^\\s<>"'\\])]+(?:\\.[^\\s<>"'\\])]+)*)`,"gi"),r=>`[${r}](${r})`):""}function P8(e){return e?e.replace(/\[Attached media \(use these URLs when posting images[^\]]*\):\s*([^\]]+)\]/,(r,a)=>a.split(",").map(i=>i.trim()).filter(Boolean).map(i=>``).join(`
|
|
87
|
-
`)):""}function U8({message:e,isLast:r,isStreaming:a}){const i=e,s=i.created_at?ik(i.created_at):null,o=i.usage,u=o&&((o.prompt_tokens??0)>0||(o.completion_tokens??0)>0);if(i.role==="user"){const f=P8(i.content);return d.jsxs("div",{className:"flex items-start gap-2 justify-end",children:[d.jsxs("div",{className:"border-border bg-muted/30 flex max-w-[min(85%,42rem)] flex-col gap-0.5 rounded-lg rounded-tr-sm px-3 py-2 text-sm",children:[d.jsx("div",{className:"chat-markdown text-foreground break-words [&>*:last-child]:mb-0",children:d.jsx(Gb,{remarkPlugins:[Wb],components:e0,children:t0(f)})}),s&&d.jsx("div",{className:"text-muted-foreground text-right text-xs",children:s})]}),d.jsx(lO,{className:"size-8 shrink-0",children:d.jsx(sO,{className:"rounded-full",children:d.jsx(q5,{className:"size-4"})})})]})}if(i.role==="assistant")return d.jsxs("div",{className:"flex items-start gap-2",children:[d.jsxs("div",{className:"size-8 shrink-0 flex items-center justify-center overflow-hidden rounded-full bg-muted",children:[d.jsx("img",{src:"/icon.svg",alt:"",className:"size-5 dark:hidden","aria-hidden":!0}),d.jsx("img",{src:"/logo_white.svg",alt:"",className:"size-5 hidden dark:block","aria-hidden":!0})]}),d.jsxs("div",{className:"border-border bg-muted/30 flex max-w-[min(85%,42rem)] flex-1 flex-col gap-0.5 rounded-lg rounded-tl-sm px-3 py-2 text-sm",children:[(i.thinking??"")&&d.jsxs("details",{className:"text-muted-foreground border-border mb-2 rounded border border-dashed py-1.5 pl-2 pr-2 text-xs",open:a,children:[d.jsxs("summary",{className:"cursor-pointer font-medium flex items-center gap-2",children:["Thinking",a&&d.jsx(Hh,{className:"ml-1"})]}),d.jsx("pre",{className:"mt-1.5 whitespace-pre-wrap break-words font-sans",children:i.thinking})]}),i.content??""?d.jsxs("div",{className:"flex items-end gap-x-1",children:[d.jsx("div",{className:"chat-markdown text-foreground min-w-0 flex-1 [&>*:last-child]:mb-0",children:d.jsx(Gb,{remarkPlugins:[Wb],components:e0,children:t0(String(i.content))})}),a&&d.jsx(oO,{className:"shrink-0"})]}):a&&r?d.jsx(Hh,{}):null,i.tool_calls?.length?d.jsxs("details",{className:"text-muted-foreground mt-1 text-xs group/details",children:[d.jsxs("summary",{className:"cursor-pointer list-none flex items-center gap-1 opacity-80 hover:opacity-100 [&::-webkit-details-marker]:hidden",children:[d.jsx(Ga,{className:"size-3.5 shrink-0 transition-transform group-open/details:rotate-90"}),d.jsx("span",{children:"Show details"}),d.jsxs("span",{className:"opacity-75",children:["(",i.tool_calls.length," tool call",i.tool_calls.length!==1?"s":"",")"]})]}),d.jsx("div",{className:"mt-1.5 border-l border-border/50 pl-4",children:d.jsxs("div",{className:"opacity-80",children:["Tool calls:"," ",i.tool_calls.map(f=>`${f.name}(${f.arguments?.slice(0,40)??""}${(f.arguments?.length??0)>40?"…":""})`).join(", ")]})})]}):null,s||u||i.cost_usd!=null&&i.cost_usd>0?d.jsxs("div",{className:"text-muted-foreground mt-1 flex flex-wrap items-center gap-x-3 gap-y-0.5 text-xs opacity-80",children:[s&&d.jsx("span",{children:s}),u&&d.jsxs("span",{children:[o.prompt_tokens??0," in / ",o.completion_tokens??0," out",o.total_tokens!=null&&` (${o.total_tokens} total)`]}),i.cost_usd!=null&&i.cost_usd>0&&d.jsxs("span",{title:"Estimated cost for this response",children:["$",i.cost_usd.toFixed(6)]})]}):null]})]});if(i.role==="tool"||i.name){const f=i.name??"tool",h=String(i.content??"");return d.jsxs("details",{className:"text-muted-foreground group/tool flex gap-2 pl-10 text-xs",children:[d.jsxs("summary",{className:"cursor-pointer list-none flex flex-1 items-start gap-2 [&::-webkit-details-marker]:hidden",children:[d.jsx(Ga,{className:"size-3.5 shrink-0 mt-0.5 transition-transform group-open/tool:rotate-90"}),d.jsxs("div",{className:"flex-1 min-w-0 rounded bg-muted/20 px-2 py-1",children:[d.jsxs("span",{className:"font-medium",children:["Tool result (",f,")"]}),s&&d.jsxs("span",{className:"ml-1 opacity-75",children:["· ",s]})]})]}),d.jsx("div",{className:"pl-10 pr-2 pb-1",children:d.jsx("pre",{className:"mt-1 whitespace-pre-wrap break-words rounded bg-muted/20 p-2 text-xs font-sans",children:h||"(empty)"})})]})}return null}function B8(e){const{configuredProviders:r=[],chatMessages:a,chatInput:i,setChatInput:s,chatProvider:o,setChatProvider:u,chatModel:f,setChatModel:h,chatModelsLoading:m,chatSessions:y,chatSessionsDisplay:p,chatSessionsLoading:b,getSessionLabel:x,chatLoading:S,chatAgentSessionId:w,models:_,ollamaRunning:k,ollamaStatusLoading:N,ollamaPullState:A,checkOllama:O,handleSelectSession:M,handleChatSend:D,sendMessage:B,handleNewChat:V,pendingActionId:K,pendingActionDetails:U,pendingActionLoading:te,handleApprovePending:I,handleRejectPending:Z,setLastAppliedIdea:E,chatAttachments:q=[],setChatAttachments:$,integrations:X=[],onNavigateToIntegrations:re,missingIntegrationsFromServer:Y=null,onClearMissingIntegrationsFromServer:z}=e,[R,F]=j.useState(!1),[L,le]=j.useState([]);j.useEffect(()=>{Mm().then(({servers:Q})=>le(Q?.map(G=>G.name.toLowerCase())??[])).catch(()=>le([]))},[]);const oe=R8(X),ve=Array.from(new Set([...oe.map(Q=>Q.toLowerCase()),...L])),Ce=a.length===0&&i.length===0,Ae=Q=>{s(Q.base_prompt),E?.(Q)},Ne=Q=>{z?.(),re?.()},Ge=Q=>{M(Q),F(!1)},$e=w&&y.length>0?(()=>{const Q=y.find(G=>G.id===w);return Q?x(Q):"Current chat"})():"Chat history",dt=Q=>{Ae(Q)},ot=o==="ollama"&&k===!1&&!N,T=o==="ollama"&&A?.inProgress,ie=o==="ollama";return d.jsxs(St,{className:"flex flex-1 flex-col",children:[d.jsxs(At,{className:"flex flex-row items-center justify-between space-y-0",children:[d.jsxs("div",{children:[d.jsx(Tt,{className:"text-base",children:"AI Chat"}),d.jsx(Rt,{children:"Agent with sessions and tools (e.g. run_task). OpenAI supports tool calls."})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs(Um,{children:[d.jsx(Bm,{asChild:!0,children:d.jsxs(je,{variant:"outline",size:"sm",className:"gap-1.5",children:[d.jsx(uS,{className:"size-3.5"}),"Try an idea"]})}),d.jsx(Fm,{align:"end",className:"min-w-[220px] max-w-[min(300px,calc(100vw-2rem))] max-h-[70vh] overflow-y-auto overflow-x-hidden",children:Jb.map(Q=>d.jsxs(ma,{onClick:()=>dt(Q),className:"flex min-w-0 flex-col items-start gap-0.5 py-2",children:[d.jsx("span",{className:"truncate font-medium w-full",children:Q.title}),d.jsx("span",{className:"text-muted-foreground line-clamp-2 text-xs font-normal w-full min-w-0",children:Q.description})]},Q.id))})]}),d.jsx(je,{variant:"outline",size:"sm",onClick:V,children:"New chat"})]})]}),d.jsxs(kt,{className:"flex flex-1 flex-col gap-4",children:[ot&&d.jsxs("div",{className:"bg-muted border-border flex flex-wrap items-center justify-between gap-2 rounded-lg border p-3 text-sm",children:[d.jsx("span",{children:"Ollama is not running. Set it up to use the default AI."}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx(je,{variant:"outline",size:"sm",asChild:!0,children:d.jsx("a",{href:"/onboard",target:"_blank",rel:"noopener noreferrer",children:"Set up Ollama"})}),d.jsx(je,{variant:"secondary",size:"sm",onClick:O,disabled:N,children:"Check again"})]})]}),T&&A&&d.jsxs("div",{className:"bg-primary/10 border-primary/20 flex flex-col gap-2 rounded-lg border p-3 text-sm",children:[d.jsxs("div",{className:"font-medium",children:["Pulling model ",A.model,"…"]}),A.percent>=0&&A.percent<=100&&d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("div",{className:"bg-muted h-2 flex-1 overflow-hidden rounded-full",children:d.jsx("div",{className:"bg-primary h-full transition-[width] duration-300",style:{width:`${A.percent}%`}})}),d.jsxs("span",{className:"text-muted-foreground shrink-0 text-xs",children:[A.percent,"%"]})]}),A.lastLine&&d.jsx("div",{className:"text-muted-foreground truncate font-mono text-xs",title:A.lastLine,children:A.lastLine})]}),ie&&d.jsxs("div",{className:"bg-amber-500/10 border-amber-500/50 flex items-center gap-2 rounded-lg border p-3 text-sm",children:[d.jsx(ab,{className:"size-4 shrink-0 text-amber-600 dark:text-amber-400","aria-hidden":!0}),d.jsx("span",{className:"text-amber-700 dark:text-amber-400",children:"Ollama cannot run tools and perform like other providers (e.g. OpenAI, OpenRouter). For full tool support, switch to a cloud provider."})]}),d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d.jsxs(Rs,{open:R,onOpenChange:F,children:[d.jsxs(je,{variant:"outline",size:"sm",className:"gap-1.5 min-w-[140px] justify-between",onClick:()=>F(!0),disabled:b,children:[d.jsx($4,{className:"size-3.5 shrink-0"}),d.jsx("span",{className:"truncate",children:$e})]}),d.jsxs(Os,{side:"right",className:"flex flex-col w-full sm:max-w-md",children:[d.jsxs(zs,{children:[d.jsx(Ms,{children:"Chat history"}),d.jsx(Ds,{children:"Switch to a previous chat or start a new one."})]}),d.jsxs("div",{className:"flex-1 overflow-y-auto px-4 pb-4",children:[d.jsx(je,{variant:"outline",size:"sm",className:"w-full justify-start mb-2",onClick:()=>Ge(""),children:"New chat"}),p.length===0&&!b&&d.jsx("p",{className:"text-muted-foreground text-sm py-2",children:"No chats yet."}),b&&d.jsxs("p",{className:"text-muted-foreground text-sm py-2 flex items-center gap-2",children:[d.jsx(nb,{className:"size-4 animate-spin"}),"Loading…"]}),d.jsx("ul",{className:"space-y-1",children:p.map(Q=>d.jsx("li",{children:d.jsx("button",{type:"button",onClick:()=>Ge(Q.id),className:ze("w-full text-left rounded-md px-3 py-2 text-sm transition-colors",Q.id===w?"bg-primary/10 text-primary font-medium":"hover:bg-muted"),children:d.jsx("span",{className:"truncate block",children:x(Q)})})},Q.id))})]})]})]}),d.jsxs("select",{className:"border-input bg-background h-9 rounded-md border px-3 text-sm",value:o,onChange:Q=>{const G=Q.target.value;u(G);const H=r.find(J=>J.id===G);h(H?.defaultModel||"")},children:[(r.length===0||!o||!r.some(Q=>Q.id===o))&&d.jsx("option",{value:"",children:r.length===0?"No provider configured":"Select provider"}),r.map(Q=>d.jsx("option",{value:Q.id,children:Q.label},Q.id))]}),d.jsxs("select",{className:"border-input bg-background min-w-[200px] rounded-md border px-3 py-2 text-sm",value:f,onChange:Q=>h(Q.target.value),disabled:(o==="openrouter"||o==="ollama")&&m,children:[(o==="openrouter"||o==="ollama")&&m?d.jsx("option",{value:f,children:"Loading models…"}):_.map(Q=>d.jsx("option",{value:Q.id,children:Q.name},Q.id)),(o==="openrouter"||o==="ollama")&&!m&&_.length===0&&f&&d.jsx("option",{value:f,children:f})]})]}),d.jsx(ol,{className:"min-h-[240px] flex-1 rounded-md border p-3",children:d.jsxs("div",{className:"space-y-3",children:[a.length===0&&(Ce?d.jsx(O8,{ideas:Jb,onSelectIdea:Ae}):d.jsx("p",{className:"text-muted-foreground text-sm",children:"Send a message to start. Provider and model can be changed above."})),a.map((Q,G)=>d.jsx(U8,{message:Q,isLast:G===a.length-1,isStreaming:S&&G===a.length-1},G)),!S&&!K&&a.length>0&&a[a.length-1]?.role==="assistant"&&I8(a[a.length-1]?.content)&&d.jsxs("div",{className:"flex flex-wrap items-center gap-2 rounded-lg border border-border bg-muted/30 px-3 py-2",children:[d.jsx("span",{className:"text-muted-foreground text-sm",children:"Reply:"}),d.jsxs(je,{size:"sm",onClick:()=>B("yes"),children:[d.jsx(Rh,{className:"size-3.5"}),"Yes, create it"]}),d.jsxs(je,{size:"sm",variant:"outline",onClick:()=>B("no"),children:[d.jsx(ms,{className:"size-3.5"}),"No, don't create"]})]}),K&&d.jsxs(St,{className:"border-amber-500/50 bg-amber-500/5",children:[d.jsxs(At,{className:"pb-2",children:[d.jsxs(Tt,{className:"flex items-center gap-2 text-base",children:[d.jsx(ab,{className:"size-4 text-amber-600"}),"Approve this action"]}),d.jsx(Rt,{children:"The agent wants to run a tool that can change files or run commands. Approve to continue or reject to cancel."})]}),d.jsx(kt,{className:"space-y-3",children:te&&!U?d.jsxs("div",{className:"text-muted-foreground flex items-center gap-2 py-2",children:[d.jsx(nb,{className:"size-4 animate-spin"}),"Loading…"]}):d.jsxs(d.Fragment,{children:[U&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"font-mono text-sm font-medium",children:U.toolName}),Object.keys(U.args).length>0&&d.jsx("pre",{className:"bg-muted max-h-32 overflow-auto rounded p-2 text-xs",children:JSON.stringify(U.args,null,2)})]}),d.jsxs("div",{className:"flex gap-2",children:[d.jsxs(je,{size:"sm",onClick:I,children:[d.jsx(Rh,{className:"size-4"}),"Approve"]}),d.jsxs(je,{size:"sm",variant:"destructive",onClick:Z,children:[d.jsx(ms,{className:"size-4"}),"Reject"]})]})]})})]}),S&&a.length>0&&a[a.length-1]?.role==="user"&&d.jsxs("div",{className:"flex items-start gap-2",children:[d.jsxs("div",{className:"size-8 shrink-0 flex items-center justify-center overflow-hidden rounded-full bg-muted",children:[d.jsx("img",{src:"/icon.svg",alt:"",className:"size-5 dark:hidden","aria-hidden":!0}),d.jsx("img",{src:"/logo_white.svg",alt:"",className:"size-5 hidden dark:block","aria-hidden":!0})]}),d.jsx("div",{className:"border-border bg-muted/30 flex items-center gap-2 rounded-lg rounded-tl-sm px-3 py-2 text-sm",children:d.jsx(Hh,{})})]})]})}),q.length>0&&d.jsx("div",{className:"border-border flex flex-wrap gap-2 rounded-md border p-2",children:q.map((Q,G)=>d.jsxs("div",{className:"relative",children:[Q.type.startsWith("image/")?d.jsx("img",{src:URL.createObjectURL(Q),alt:Q.name,className:"h-14 w-14 rounded object-cover"}):d.jsx("div",{className:"border-input flex h-14 w-14 items-center justify-center rounded border text-xs",children:Q.name.slice(0,8)}),d.jsx("button",{type:"button",className:"absolute -right-1 -top-1 flex h-5 w-5 items-center justify-center rounded-full bg-muted-foreground text-muted hover:bg-foreground hover:text-background",onClick:()=>$(H=>H.filter((J,ye)=>ye!==G)),"aria-label":"Remove attachment",children:d.jsx(ms,{className:"h-3 w-3"})})]},`${Q.name}-${G}`))}),d.jsxs("div",{className:"flex gap-2 items-end",children:[d.jsxs("label",{className:"cursor-pointer shrink-0 rounded-md border border-input px-2 py-2 text-muted-foreground hover:bg-muted/50",children:[d.jsx("input",{type:"file",accept:"image/*,video/*,.mp4,.webm,.mov,.m4v,.avi",className:"sr-only",multiple:!0,onChange:Q=>{const G=Q.target.files?Array.from(Q.target.files):[];$(H=>[...H,...G]),Q.target.value=""}}),d.jsx(K4,{className:"h-5 w-5","aria-hidden":!0})]}),d.jsx("textarea",{className:"border-input bg-background field-sizing-content min-h-10 max-h-48 w-full min-w-0 flex-1 resize-none rounded-md border px-3 py-2 text-sm leading-relaxed focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",placeholder:"Type a message…",value:i,onChange:Q=>s(Q.target.value),onKeyDown:Q=>{Q.key==="Enter"&&!Q.shiftKey&&(Q.preventDefault(),D())},rows:1}),d.jsx(je,{onClick:D,disabled:S||!i.trim()&&q.length===0,children:S?"Sending…":"Send"})]}),d.jsx(L8,{open:Y!=null&&Y.length>0,onOpenChange:Q=>{Q||z?.()},requiredIntegrations:Y??[],connectedIds:ve,onConnect:Ne})]})]})}function sp({className:e,...r}){return d.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:d.jsx("table",{"data-slot":"table",className:ze("w-full caption-bottom text-sm",e),...r})})}function op({className:e,...r}){return d.jsx("thead",{"data-slot":"table-header",className:ze("[&_tr]:border-b",e),...r})}function cp({className:e,...r}){return d.jsx("tbody",{"data-slot":"table-body",className:ze("[&_tr:last-child]:border-0",e),...r})}function ga({className:e,...r}){return d.jsx("tr",{"data-slot":"table-row",className:ze("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...r})}function rn({className:e,...r}){return d.jsx("th",{"data-slot":"table-head",className:ze("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...r})}function Xt({className:e,...r}){return d.jsx("td",{"data-slot":"table-cell",className:ze("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...r})}const Sc=[{label:"Every day at 9:00 AM",value:"0 9 * * *"},{label:"Every day at 8:00 AM",value:"0 8 * * *"},{label:"Every day at 12:00 PM (noon)",value:"0 12 * * *"},{label:"Every day at 6:00 PM",value:"0 18 * * *"},{label:"Every hour",value:"0 * * * *"},{label:"Every 30 minutes",value:"*/30 * * * *"},{label:"Every 15 minutes",value:"*/15 * * * *"},{label:"Every Monday at 9:00 AM",value:"0 9 * * 1"},{label:"Every weekday at 9:00 AM",value:"0 9 * * 1-5"},{label:"Custom (advanced)",value:"__custom__"}];function n0(e){return Sc.find(a=>a.value===e&&a.value!=="__custom__")?.label??(e?`Custom: ${e}`:"—")}const F8=[{label:"Morning news → Bluesky",prompt:"Fetch daily news and post one to Bluesky every morning at 9."},{label:"Hourly RSS summary",prompt:"Summarize my RSS feeds and send a short summary every hour."},{label:"Weekday weather reminder",prompt:"Send me the weather for my location every weekday at 8 AM."},{label:"Daily digest to Telegram",prompt:"Collect top stories from my configured sources and send a daily digest to Telegram at 6 PM."},{label:"Bluesky post every 12h",prompt:"Post a tip or quote to Bluesky every 12 hours."},{label:"Backup reminder weekly",prompt:"Remind me to run my backup every Monday at 9 AM."}];function H8(e){const{schedules:r,load:a,onCreateSchedule:i,onUpdateSchedule:s,onDeleteSchedule:o,onRunSchedule:u,onFetchScheduleRuns:f,onNavigateToSettings:h}=e,[m,y]=j.useState(null),[p,b]=j.useState(""),[x,S]=j.useState(!1),[w,_]=j.useState(null),[k,N]=j.useState(null),[A,O]=j.useState(!1),[M,D]=j.useState("Morning post"),[B,V]=j.useState(""),[K,U]=j.useState("Fetch daily news and post one to Bluesky."),[te,I]=j.useState("0 9 * * *"),[Z,E]=j.useState(""),[q,$]=j.useState(!0),[X,re]=j.useState(""),[Y,z]=j.useState(""),[R,F]=j.useState([]),[L,le]=j.useState([]),[oe,ve]=j.useState(!1),[Ce,Ae]=j.useState(!1),[Ne,Ge]=j.useState(null),[$e,dt]=j.useState(null),[ot,T]=j.useState([]),[ie,Q]=j.useState(!1),[G,H]=j.useState(null),J=te==="__custom__"?Z.trim():te,ye=k?k.prompt:K.trim(),Se=k?k.cron_expression:J,ue=k?k.name:M.trim()||"Scheduled job";j.useEffect(()=>{sl().then(se=>F(se?.aiProviders??[])).catch(()=>F([]))},[]),j.useEffect(()=>{cu().then(y).catch(()=>y(null))},[]),j.useEffect(()=>{if(!X||X!=="ollama"&&X!=="openrouter"){le([]),z("");return}ve(!0),Ls(X).then(se=>le(se.models??[])).catch(()=>le([])).finally(()=>ve(!1))},[X]);const he=async()=>{const se=p.trim();if(se){_(null),S(!0);try{const Te=await xS({message:se});N(Te)}catch(Te){_(Te instanceof Error?Te.message:"Failed to understand schedule"),N(null)}finally{S(!1)}}},xe=async()=>{if(ye){Ae(!0),_(null);try{const se=q?[{channel:"telegram",target:"default"}]:[];await i({name:ue,description:B.trim()||void 0,cron_expression:Se.trim(),prompt:ye,delivery:se.length?se:void 0,provider:X.trim()||null,model:Y.trim()||null}),N(null),b(""),D("Morning post"),V(""),U("Fetch daily news and post one to Bluesky."),I("0 9 * * *"),E(""),$(!0),re(""),z("")}finally{Ae(!1)}}},ke=async se=>{Ge(se.id);try{await s(se.id,{enabled:!se.enabled})}finally{Ge(null)}},ne=async se=>{Ge(se);try{await o(se)}finally{Ge(null)}},pe=async se=>{Ge(se.id),H(null);try{const Te=await u(se.id);H({jobId:se.id,message:`Job enqueued (task ${Te.id.slice(0,12)}…)`}),a()}catch(Te){H({jobId:se.id,message:Te instanceof Error?Te.message:"Run failed"})}finally{Ge(null)}},_e=se=>{dt(se)};return j.useEffect(()=>{if(!$e){T([]);return}Q(!0),f($e.id).then(({runs:se})=>T(se)).catch(()=>T([])).finally(()=>Q(!1))},[$e?.id,f]),d.jsxs("div",{className:"space-y-4",children:[d.jsxs(St,{children:[d.jsxs(At,{children:[d.jsx(Tt,{className:"text-base",children:"New job"}),d.jsx(Rt,{children:"Describe what you want in plain language; the AI will figure out the task and schedule. The agent uses your skills (e.g. news, Bluesky) and runs on that schedule. Results can be sent to Telegram (first chat that messages the bot, or set in Settings → Channels)."})]}),d.jsxs(kt,{className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{className:"text-muted-foreground block text-sm",children:"Describe your job"}),d.jsx("p",{className:"text-muted-foreground mb-1.5 text-xs",children:"Quick ideas — click to use"}),d.jsx("div",{className:"flex flex-wrap gap-1.5",children:F8.map(se=>d.jsx(je,{variant:"outline",size:"sm",className:"h-8 text-xs font-normal",onClick:()=>b(se.prompt),disabled:x,children:se.label},se.label))}),d.jsx("textarea",{className:"border-input bg-background min-h-[88px] w-full rounded-md border px-3 py-2 text-sm",value:p,onChange:se=>b(se.target.value),placeholder:"e.g. Fetch daily news and post one to Bluesky every morning at 9",rows:3,disabled:x}),d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d.jsx(je,{onClick:he,disabled:x||!p.trim(),children:x?"Understanding…":d.jsxs(d.Fragment,{children:[d.jsx(L5,{className:"mr-1.5 size-4"}),"Understand & schedule"]})}),d.jsxs(je,{variant:"ghost",size:"sm",onClick:()=>O(se=>!se),children:[A?d.jsx(v4,{className:"size-4"}):d.jsx(p4,{className:"size-4"}),"Advanced form"]})]}),w&&d.jsx("p",{className:"text-destructive text-sm",children:w})]}),k&&d.jsxs("div",{className:"rounded-lg border border-border bg-muted/30 p-4 space-y-3",children:[d.jsx("p",{className:"text-muted-foreground text-sm font-medium",children:"Job preview — confirm or edit below"}),d.jsxs("dl",{className:"grid gap-2 text-sm",children:[d.jsxs("div",{children:[d.jsx("dt",{className:"text-muted-foreground",children:"Name"}),d.jsx("dd",{className:"font-medium",children:k.name})]}),d.jsxs("div",{children:[d.jsx("dt",{className:"text-muted-foreground",children:"Task"}),d.jsx("dd",{children:k.prompt})]}),d.jsxs("div",{children:[d.jsx("dt",{className:"text-muted-foreground",children:"Schedule"}),d.jsx("dd",{children:n0(k.cron_expression)})]})]}),d.jsxs("div",{className:"flex flex-wrap items-center gap-3 pt-1",children:[d.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[d.jsx("input",{type:"checkbox",checked:q,onChange:se=>$(se.target.checked)}),"Notify via Telegram"]}),q&&m!==null&&!m.configured&&d.jsxs("p",{className:"text-amber-600 dark:text-amber-400 text-sm w-full",children:["Telegram is not set up. Set it up in Settings → Channels to receive job notifications.",h&&d.jsx(je,{variant:"link",className:"h-auto p-0 ml-1 text-sm",onClick:h,children:"Open Settings"})]}),d.jsx(je,{onClick:xe,disabled:Ce||!ye||q&&(m===null||!m.configured),children:Ce?"Adding…":"Confirm & add job"}),d.jsx(je,{variant:"outline",size:"sm",onClick:()=>N(null),children:"Discard"})]})]}),A&&d.jsxs("div",{className:"space-y-4 border-t pt-4",children:[d.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{className:"text-muted-foreground block text-sm",children:"Name"}),d.jsx("input",{className:"border-input bg-background h-9 w-full rounded-md border px-3 text-sm",value:k?k.name:M,onChange:se=>{k?N({...k,name:se.target.value}):D(se.target.value)},placeholder:"Morning post"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{className:"text-muted-foreground block text-sm",children:"Schedule"}),d.jsx("select",{className:"border-input bg-background h-9 w-full rounded-md border px-3 text-sm",value:k?Sc.some(se=>se.value===k.cron_expression)?k.cron_expression:"__custom__":te,onChange:se=>{const Te=se.target.value;k?N({...k,cron_expression:Te==="__custom__"?k.cron_expression||"0 9 * * *":Te}):I(Te)},children:Sc.map(se=>d.jsx("option",{value:se.value,children:se.label},se.value))}),(k&&k.cron_expression&&!Sc.find(se=>se.value===k.cron_expression)||!k&&te==="__custom__")&&d.jsxs("div",{className:"mt-2 space-y-1",children:[d.jsx("label",{className:"text-muted-foreground block text-xs",children:"Cron expression"}),d.jsx("input",{className:"border-input bg-background h-9 w-full rounded-md border px-3 font-mono text-sm",value:k?k.cron_expression:Z,onChange:se=>{k?N({...k,cron_expression:se.target.value}):E(se.target.value)},placeholder:"0 9 * * *"})]})]})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{className:"text-muted-foreground block text-sm",children:"Prompt"}),d.jsx("textarea",{className:"border-input bg-background min-h-[60px] w-full rounded-md border px-3 py-2 text-sm",value:k?k.prompt:K,onChange:se=>{k?N({...k,prompt:se.target.value}):U(se.target.value)},placeholder:"e.g. Fetch daily news and post one to Bluesky.",rows:2})]}),d.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{className:"text-muted-foreground block text-sm",children:"AI Provider (optional)"}),d.jsxs("select",{className:"border-input bg-background h-9 w-full rounded-md border px-3 text-sm",value:X,onChange:se=>re(se.target.value),children:[d.jsx("option",{value:"",children:"Use default"}),R.map(se=>d.jsx("option",{value:se.id,children:se.label},se.id)),R.length===0&&d.jsxs(d.Fragment,{children:[d.jsx("option",{value:"openrouter",children:"OpenRouter"}),d.jsx("option",{value:"openai",children:"OpenAI"}),d.jsx("option",{value:"ollama",children:"Ollama"})]})]})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{className:"text-muted-foreground block text-sm",children:"Model (optional)"}),X&&(X==="ollama"||X==="openrouter")?d.jsxs("select",{className:"border-input bg-background h-9 w-full rounded-md border px-3 text-sm",value:Y,onChange:se=>z(se.target.value),disabled:oe,children:[d.jsx("option",{value:"",children:"Use provider default"}),L.map(se=>d.jsx("option",{value:se.id,children:se.name},se.id))]}):d.jsx("input",{className:"border-input bg-background h-9 w-full rounded-md border px-3 text-sm",value:Y,onChange:se=>z(se.target.value),placeholder:X?"e.g. gpt-4o-mini":"Select provider first",disabled:!X})]})]}),!k&&d.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[d.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[d.jsx("input",{type:"checkbox",checked:q,onChange:se=>$(se.target.checked)}),"Notify via Telegram"]}),q&&m!==null&&!m.configured&&d.jsxs("p",{className:"text-amber-600 dark:text-amber-400 text-sm w-full",children:["Telegram is not set up. Set it up in Settings → Channels to receive job notifications.",h&&d.jsx(je,{variant:"link",className:"h-auto p-0 ml-1 text-sm",onClick:h,children:"Open Settings"})]}),d.jsx(je,{onClick:xe,disabled:Ce||!K.trim()||!J||q&&(m===null||!m.configured),children:Ce?"Adding…":"Add job"})]})]})]})]}),d.jsxs(St,{children:[d.jsxs(At,{className:"flex flex-row items-center justify-between",children:[d.jsxs("div",{children:[d.jsx(Tt,{className:"text-base",children:"Scheduled jobs"}),d.jsx(Rt,{children:"Agent jobs (prompt + schedule). You get a Telegram notification on success or failure if delivery is set."})]}),d.jsx(je,{variant:"outline",size:"sm",onClick:a,children:"Refresh"})]}),d.jsx(kt,{children:d.jsx(ol,{className:"h-[320px]",children:d.jsxs(sp,{children:[d.jsx(op,{children:d.jsxs(ga,{children:[d.jsx(rn,{children:"Name"}),d.jsx(rn,{children:"Prompt"}),d.jsx(rn,{children:"Model"}),d.jsx(rn,{children:"Cron"}),d.jsx(rn,{children:"Delivery"}),d.jsx(rn,{children:"Enabled"}),d.jsx(rn,{children:"Created"}),d.jsx(rn,{className:"w-[70px]",children:"Actions"})]})}),d.jsx(cp,{children:r.length===0?d.jsx(ga,{children:d.jsx(Xt,{colSpan:8,className:"text-muted-foreground text-center text-sm",children:"No scheduled jobs. Add one above."})}):r.map(se=>d.jsxs(ga,{children:[d.jsx(Xt,{className:"font-medium",children:se.name||se.id}),d.jsx(Xt,{className:"max-w-[200px] truncate text-sm",children:se.prompt||se.task_type||"—"}),d.jsx(Xt,{className:"text-muted-foreground max-w-[120px] truncate text-xs",children:se.provider?`${se.provider}${se.model?` / ${se.model}`:""}`:"—"}),d.jsx(Xt,{className:"text-xs",children:n0(se.cron_expression)}),d.jsx(Xt,{children:se.delivery?d.jsx(qt,{variant:"outline",children:"Telegram"}):d.jsx("span",{className:"text-muted-foreground text-xs",children:"—"})}),d.jsx(Xt,{children:d.jsx(qt,{variant:se.enabled?"default":"secondary",children:se.enabled?"On":"Off"})}),d.jsx(Xt,{className:"text-muted-foreground text-xs",children:Is(se.created_at)}),d.jsx(Xt,{children:d.jsxs("div",{className:"flex flex-col gap-1",children:[d.jsxs(Um,{children:[d.jsx(Bm,{asChild:!0,children:d.jsx(je,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",disabled:Ne===se.id,title:"Actions",children:d.jsx(A4,{className:"size-4"})})}),d.jsxs(Fm,{align:"end",children:[d.jsxs(ma,{onClick:()=>pe(se),children:[d.jsx(g5,{className:"size-4"}),"Test"]}),d.jsxs(ma,{onClick:()=>_e(se),children:[d.jsx(Rm,{className:"size-4"}),"Logs"]}),d.jsxs(ma,{onClick:()=>ke(se),children:[d.jsx(v5,{className:"size-4"}),se.enabled?"Disable":"Enable"]}),d.jsxs(ma,{variant:"destructive",onClick:()=>ne(se.id),children:[d.jsx(zh,{className:"size-4"}),"Delete"]})]})]}),G?.jobId===se.id&&d.jsx("span",{className:"text-muted-foreground text-xs",children:G.message})]})})]},se.id))})]})})})]}),d.jsx(Rs,{open:!!$e,onOpenChange:se=>!se&&dt(null),children:d.jsxs(Os,{side:"right",className:"w-full max-w-lg overflow-y-auto",children:[d.jsxs(zs,{children:[d.jsxs(Ms,{children:[$e?.name||$e?.id," — Run logs"]}),d.jsx(Ds,{children:"Recent runs for this job. Status: pending, running, done, or failed."})]}),d.jsx("div",{className:"mt-4 space-y-3",children:ie?d.jsx("p",{className:"text-muted-foreground text-sm",children:"Loading…"}):ot.length===0?d.jsx("p",{className:"text-muted-foreground text-sm",children:"No runs yet. Use Test to run now."}):ot.map(se=>d.jsxs("div",{className:"border-input rounded-md border p-3 text-sm",children:[d.jsxs("div",{className:"flex items-center justify-between gap-2",children:[d.jsx(qt,{variant:se.status==="done"?"default":se.status==="failed"?"destructive":se.status==="running"?"secondary":"outline",children:se.status}),d.jsxs("span",{className:"text-muted-foreground font-mono text-xs",children:[se.id.slice(0,16),"…"]})]}),d.jsxs("p",{className:"text-muted-foreground mt-1 text-xs",children:[ik(se.created_at),se.finished_at!=null&&se.started_at!=null&&d.jsxs(d.Fragment,{children:[" · ",Math.round((se.finished_at-se.started_at)/1e3),"s"]})]}),se.error&&d.jsx("p",{className:"mt-2 text-destructive text-xs",children:se.error})]},se.id))})]})})]})}function q8({config:e}){return d.jsxs(St,{children:[d.jsxs(At,{children:[d.jsx(Tt,{className:"text-base",children:"Watched folders"}),d.jsx(Rt,{children:"Paths monitored by the file watcher (from env and config/watched.json). Read-only."})]}),d.jsx(kt,{children:e?.watchFolders&&e.watchFolders.length>0?d.jsx("ul",{className:"space-y-2 font-mono text-sm",children:e.watchFolders.map(r=>d.jsx("li",{className:"rounded border bg-muted/30 px-3 py-2",children:r},r))}):d.jsx("p",{className:"text-muted-foreground text-sm",children:"No watched folders configured. Set WATCH_FOLDERS in .env or add paths to config/watched.json."})})]})}function G8(e){const[r,a]=j.useState(null);return j.useEffect(()=>{(e==="config"||e==="settings")&&sl().then(a).catch(()=>a(null))},[e]),r}const r0={OPENAI_API_KEY:"OpenAI API Key",ANTHROPIC_API_KEY:"Anthropic (Claude) API Key",GOOGLE_GEMINI_API_KEY:"Google Gemini API Key",GEMINI_API_KEY:"Gemini API Key (alt)",OPENROUTER_API_KEY:"OpenRouter API Key",OLLAMA_BASE_URL:"Ollama Base URL",GATEWAY_API_KEY:"Gateway API Key"};function Y8(){const[e,r]=j.useState({}),[a,i]=j.useState({}),[s,o]=j.useState(!0),[u,f]=j.useState(!1),[h,m]=j.useState(null),[y,p]=j.useState(!1),[b,x]=j.useState(null),[S,w]=j.useState(null),[_,k]=j.useState(""),[N,A]=j.useState(""),[O,M]=j.useState([]),[D,B]=j.useState(!1),[V,K]=j.useState(!1),[U,te]=j.useState(null);j.useEffect(()=>{Promise.all([va(),rl(),sl(),zc()]).then(([q,$,X,re])=>{r(q.keys||{}),m($.running),w(X??null),k(re.defaultProvider??""),A(re.defaultModel??"")}).catch(()=>x({type:"error",text:"Failed to load"})).finally(()=>o(!1))},[]),j.useEffect(()=>{if(!_||_!=="ollama"&&_!=="openrouter"){M([]);return}B(!0),Ls(_).then(q=>M(q.models??[])).catch(()=>M([])).finally(()=>B(!1))},[_]);const I=async()=>{p(!0);try{const{running:q}=await rl();m(q)}finally{p(!1)}},Z=async()=>{f(!0),x(null);try{const q={};for(const[X,re]of Object.entries(a))typeof re=="string"&&re.trim()&&(q[X]=re.trim());await uu(q);const{keys:$}=await va();r($),i({}),x({type:"success",text:"API keys saved. Restart the agent for changes to take effect."})}catch(q){x({type:"error",text:q instanceof Error?q.message:"Failed to save"})}finally{f(!1)}},E=Object.keys(r0);return s?d.jsx(St,{children:d.jsx(kt,{className:"pt-6",children:d.jsx("p",{className:"text-muted-foreground text-sm",children:"Loading…"})})}):d.jsxs("div",{className:"space-y-6",children:[d.jsxs(St,{children:[d.jsxs(At,{children:[d.jsx(Tt,{children:"AI Providers"}),d.jsxs(Rt,{children:["Add or update API keys. Saved to ",d.jsx("code",{className:"rounded bg-muted px-1 text-xs",children:"~/.sulala/.env"}),". Restart the agent for changes."]})]}),d.jsxs(kt,{className:"space-y-4",children:[E.map(q=>d.jsxs("div",{className:"space-y-2",children:[d.jsx(Mt,{htmlFor:q,children:r0[q]??q}),d.jsx(It,{id:q,type:"password",placeholder:e[q]==="set"?"(already set)":"",value:a[q]??"",onChange:$=>i(X=>({...X,[q]:$.target.value})),autoComplete:"off"})]},q)),b&&d.jsx("p",{className:b.type==="success"?"text-green-600 dark:text-green-400 text-sm":"text-destructive text-sm",children:b.text}),d.jsx(je,{onClick:Z,disabled:u||Object.keys(a).length===0,children:u?"Saving…":"Save"})]})]}),d.jsxs(St,{children:[d.jsxs(At,{children:[d.jsx(Tt,{children:"Default for scheduled jobs"}),d.jsx(Rt,{children:'When a job uses "Use default", this provider and model are used. Set this to OpenRouter or OpenAI (not Ollama) so jobs run reliably even when Ollama is not running.'})]}),d.jsxs(kt,{className:"space-y-4",children:[d.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(Mt,{htmlFor:"job-default-provider",children:"Provider"}),d.jsxs("select",{id:"job-default-provider",className:"border-input bg-background h-9 w-full rounded-md border px-3 text-sm",value:_,onChange:q=>{k(q.target.value),A("")},children:[d.jsx("option",{value:"",children:"Use env default"}),(S?.aiProviders??[]).filter(q=>q.id!=="ollama").map(q=>d.jsx("option",{value:q.id,children:q.label},q.id)),d.jsx("option",{value:"ollama",children:"Ollama (not recommended for jobs)"})]})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Mt,{htmlFor:"job-default-model",children:"Model"}),_&&(_==="ollama"||_==="openrouter")?d.jsxs("select",{id:"job-default-model",className:"border-input bg-background h-9 w-full rounded-md border px-3 text-sm",value:N,onChange:q=>A(q.target.value),disabled:D,children:[d.jsx("option",{value:"",children:"Use provider default"}),O.map(q=>d.jsx("option",{value:q.id,children:q.name},q.id))]}):d.jsx(It,{id:"job-default-model",className:"h-9 text-sm",value:N,onChange:q=>A(q.target.value),placeholder:_?"e.g. gpt-4o-mini":"Set provider first",disabled:!_})]})]}),_==="ollama"&&d.jsx("p",{className:"text-amber-600 dark:text-amber-400 text-sm",children:"Ollama is not recommended for scheduled jobs. If Ollama is not running when the job runs, the job will fail."}),U&&d.jsx("p",{className:U.type==="success"?"text-green-600 dark:text-green-400 text-sm":"text-destructive text-sm",children:U.text}),d.jsx(je,{onClick:async()=>{K(!0),te(null);try{await US({defaultProvider:_.trim()||null,defaultModel:N.trim()||null}),te({type:"success",text:"Job default saved. New jobs using “Use default” will use this."})}catch(q){te({type:"error",text:q instanceof Error?q.message:"Failed to save"})}finally{K(!1)}},disabled:V,children:V?"Saving…":"Save job default"})]})]}),d.jsxs(St,{children:[d.jsxs(At,{children:[d.jsx(Tt,{children:"Ollama"}),d.jsx(Rt,{children:"Local AI. No API key required. Install from ollama.com"})]}),d.jsxs(kt,{children:[h?d.jsx("p",{className:"text-green-600 dark:text-green-400 text-sm",children:"Ollama is running."}):d.jsx("p",{className:"text-muted-foreground text-sm",children:"Ollama is not running."}),d.jsx(je,{variant:"outline",size:"sm",onClick:I,disabled:y,className:"mt-2",children:y?"Checking…":"Check again"}),d.jsxs("p",{className:"text-muted-foreground mt-2 text-xs",children:["Install from ",d.jsx("a",{href:"https://ollama.com",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"ollama.com"})," or run ",d.jsx("code",{children:"ollama serve"})," in terminal."]})]})]})]})}function $8(e){const{tasks:r,load:a,enqueueType:i,setEnqueueType:s,enqueuePayload:o,setEnqueuePayload:u,enqueueing:f,actionTaskId:h,handleTaskCancel:m,handleTaskRetry:y,handleEnqueue:p}=e;return d.jsxs("div",{className:"space-y-4",children:[d.jsxs(St,{children:[d.jsxs(At,{children:[d.jsx(Tt,{className:"text-base",children:"Enqueue task"}),d.jsx(Rt,{children:"Add a task to the queue"})]}),d.jsxs(kt,{className:"flex flex-wrap items-end gap-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{className:"text-muted-foreground block text-sm",children:"Type"}),d.jsx("input",{className:"border-input bg-background h-9 rounded-md border px-3 text-sm",value:i,onChange:b=>s(b.target.value),placeholder:"e.g. heartbeat"})]}),d.jsxs("div",{className:"min-w-[200px] space-y-2",children:[d.jsx("label",{className:"text-muted-foreground block text-sm",children:"Payload (JSON)"}),d.jsx("input",{className:"border-input bg-background h-9 w-full rounded-md border px-3 text-sm",value:o,onChange:b=>u(b.target.value),placeholder:'{"key": "value"}'})]}),d.jsx(je,{onClick:p,disabled:f,children:f?"Enqueueing…":"Enqueue"})]})]}),d.jsxs(St,{children:[d.jsxs(At,{className:"flex flex-row items-center justify-between",children:[d.jsxs("div",{children:[d.jsx(Tt,{className:"text-base",children:"Tasks"}),d.jsx(Rt,{children:"Recent tasks (from gateway)"})]}),d.jsx(je,{variant:"outline",size:"sm",onClick:a,children:"Refresh"})]}),d.jsx(kt,{children:d.jsx(ol,{className:"h-[400px]",children:d.jsxs(sp,{children:[d.jsx(op,{children:d.jsxs(ga,{children:[d.jsx(rn,{children:"ID"}),d.jsx(rn,{children:"Type"}),d.jsx(rn,{children:"Status"}),d.jsx(rn,{children:"Created"}),d.jsx(rn,{className:"w-[120px]",children:"Actions"})]})}),d.jsx(cp,{children:r.map(b=>d.jsxs(ga,{children:[d.jsxs(Xt,{className:"font-mono text-xs",children:[b.id.slice(0,20),"…"]}),d.jsx(Xt,{children:b.type}),d.jsx(Xt,{children:d.jsx(qt,{variant:b.status==="done"?"default":b.status==="failed"?"destructive":b.status==="cancelled"?"outline":"secondary",children:b.status})}),d.jsx(Xt,{className:"text-muted-foreground text-xs",children:Is(b.created_at)}),d.jsxs(Xt,{children:[(b.status==="pending"||b.status==="running")&&d.jsx(je,{variant:"ghost",size:"sm",className:"h-7 text-destructive hover:text-destructive",disabled:h===b.id,onClick:()=>m(b.id),children:"Cancel"}),b.status==="failed"&&d.jsx(je,{variant:"ghost",size:"sm",className:"h-7",disabled:h===b.id,onClick:()=>y(b.id),children:"Retry"})]})]},b.id))})]})})})]})]})}function V8({logs:e,load:r}){return d.jsxs(St,{children:[d.jsxs(At,{className:"flex flex-row items-center justify-between",children:[d.jsxs("div",{children:[d.jsx(Tt,{className:"text-base",children:"Logs"}),d.jsx(Rt,{children:"Recent gateway and worker logs"})]}),d.jsx(je,{variant:"outline",size:"sm",onClick:r,children:"Refresh"})]}),d.jsx(kt,{children:d.jsx(ol,{className:"h-[500px] rounded-md border p-3",children:d.jsx("div",{className:"space-y-1 font-mono text-xs",children:e.map(a=>d.jsxs("div",{className:"flex flex-wrap gap-2 border-b py-1.5 last:border-0",children:[d.jsx("span",{className:"text-muted-foreground shrink-0",children:Is(a.created_at)}),d.jsx(qt,{variant:"outline",className:"shrink-0",children:a.source}),d.jsx("span",{className:a.level==="error"?"text-destructive":a.level==="warn"?"text-amber-600 dark:text-amber-400":"",children:a.message})]},a.id))})})})]})}function K8({fileStates:e,load:r}){return d.jsxs(St,{children:[d.jsxs(At,{className:"flex flex-row items-center justify-between",children:[d.jsxs("div",{children:[d.jsx(Tt,{className:"text-base",children:"File states"}),d.jsx(Rt,{children:"Files seen by the watcher (last modified time, size)"})]}),d.jsx(je,{variant:"outline",size:"sm",onClick:r,children:"Refresh"})]}),d.jsx(kt,{children:d.jsx(ol,{className:"h-[500px]",children:d.jsxs(sp,{children:[d.jsx(op,{children:d.jsxs(ga,{children:[d.jsx(rn,{children:"Path"}),d.jsx(rn,{children:"Size"}),d.jsx(rn,{children:"Last seen"})]})}),d.jsx(cp,{children:e.length===0?d.jsx(ga,{children:d.jsx(Xt,{colSpan:3,className:"text-muted-foreground text-center",children:"No file states. Add watched folders and trigger file events."})}):e.map(a=>d.jsxs(ga,{children:[d.jsx(Xt,{className:"max-w-[400px] truncate font-mono text-xs",children:a.path}),d.jsx(Xt,{className:"text-muted-foreground text-xs",children:a.size!=null?`${a.size} B`:"—"}),d.jsx(Xt,{className:"text-muted-foreground text-xs",children:Is(a.last_seen)})]},a.path))})]})})})]})}const X8="https://discord.com/developers/applications";function Z8(){const[e,r]=j.useState(null),[a,i]=j.useState(null),[s,o]=j.useState(!0),[u,f]=j.useState(!1),[h,m]=j.useState(null),[y,p]=j.useState(!1),[b,x]=j.useState(""),[S,w]=j.useState("open"),[_,k]=j.useState(""),[N,A]=j.useState(""),[O,M]=j.useState(""),[D,B]=j.useState(""),[V,K]=j.useState([]),[U,te]=j.useState(!1),[I,Z]=j.useState(null),[E,q]=j.useState(""),[$,X]=j.useState(!1),re=async()=>{o(!0),m(null);try{const[R,F,L]=await Promise.all([cu(),kS(),sl()]);r(R),Z(F),i(L),p(R.enabled),x(""),w(R.dmPolicy||"open"),k(Array.isArray(R.allowFrom)?R.allowFrom.join(", "):""),A(R.defaultProvider??""),M(R.defaultModel??""),B(R.mainSessionKey??"")}catch(R){m(R instanceof Error?R.message:String(R))}finally{o(!1)}};j.useEffect(()=>{re()},[]),j.useEffect(()=>{if(!N||N!=="ollama"&&N!=="openrouter"){K([]);return}te(!0),Ls(N).then(R=>K(R.models??[])).catch(()=>K([])).finally(()=>te(!1))},[N]);const Y=async()=>{f(!0),m(null);try{const R=_.split(/[,;\s]+/).map(le=>parseInt(le.trim(),10)).filter(le=>!Number.isNaN(le)),F={enabled:y,dmPolicy:S,allowFrom:R,defaultProvider:N.trim()||null,defaultModel:O.trim()||null,mainSessionKey:D.trim()||null};b.trim()&&(F.botToken=b.trim());const L=await SS(F);r(L),x("")}catch(R){m(R instanceof Error?R.message:String(R))}finally{f(!1)}},z=async()=>{X(!0),m(null);try{const R=await _S({botToken:E.trim()||null});Z(R),q("")}catch(R){m(R instanceof Error?R.message:String(R))}finally{X(!1)}};return s?d.jsx(St,{children:d.jsx(kt,{className:"pt-6",children:d.jsx("p",{className:"text-muted-foreground text-sm",children:"Loading channels…"})})}):d.jsxs("div",{className:"space-y-4",children:[d.jsxs(St,{children:[d.jsxs(At,{children:[d.jsx(Tt,{className:"text-base",children:"Telegram"}),d.jsx(Rt,{children:"Connect your device to Telegram so you can chat with the agent from your phone. Create a bot with @BotFather, then paste the token below."})]}),d.jsxs(kt,{className:"space-y-4",children:[e&&d.jsxs("div",{className:"space-y-1 text-sm",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-muted-foreground",children:"Status:"}),e.status==="connected"&&e.botUsername?d.jsxs("span",{className:"text-green-600 dark:text-green-400",children:["Connected as @",e.botUsername]}):e.configured?d.jsx("span",{className:"text-amber-600 dark:text-amber-400",children:"Not connected"}):d.jsx("span",{className:"text-muted-foreground",children:"Not configured"})]}),e.error&&d.jsx("p",{className:"text-destructive text-xs",children:e.error}),e.configured&&!e.botUsername&&!e.error&&d.jsx("p",{className:"text-muted-foreground text-xs",children:"Click Save or Reconnect to start the bot. Use “Anyone” under Who can DM if you want to receive messages."})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("input",{type:"checkbox",id:"telegram-enabled",checked:y,onChange:R=>p(R.target.checked),className:"h-4 w-4 rounded border-input"}),d.jsx("label",{htmlFor:"telegram-enabled",className:"text-sm font-medium",children:"Enable Telegram channel"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{htmlFor:"telegram-token",className:"text-sm font-medium",children:"Bot token"}),d.jsx(It,{id:"telegram-token",type:"password",placeholder:e?.configured?"(already set)":"123456789:ABC…",value:b,onChange:R=>x(R.target.value),autoComplete:"off",className:"font-mono text-sm"}),d.jsx("p",{className:"text-muted-foreground text-xs",children:"Get a token from @BotFather in Telegram. Leave blank to keep the current token."})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{htmlFor:"telegram-dm-policy",className:"text-sm font-medium",children:"Who can DM the bot"}),d.jsxs("select",{id:"telegram-dm-policy",value:S,onChange:R=>w(R.target.value),className:"h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm",children:[d.jsx("option",{value:"open",children:"Anyone"}),d.jsx("option",{value:"allowlist",children:"Only allowlist (set IDs below)"}),d.jsx("option",{value:"disabled",children:"Disabled"})]}),S==="disabled"&&d.jsx("p",{className:"text-muted-foreground text-xs",children:"Bot can still connect; it won’t reply to any DMs. Choose Anyone to chat from Telegram."})]}),S==="allowlist"&&d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{htmlFor:"telegram-allow-from",className:"text-sm font-medium",children:"Allowed user IDs (comma-separated)"}),d.jsx(It,{id:"telegram-allow-from",value:_,onChange:R=>k(R.target.value),placeholder:"123456789, 987654321",className:"font-mono text-sm"})]}),d.jsxs("div",{className:"space-y-2 border-t pt-4",children:[d.jsx("label",{className:"text-sm font-medium",children:"AI for Telegram"}),d.jsx("p",{className:"text-muted-foreground text-xs",children:"Provider and model used when you chat via Telegram. Leave empty to use a connected provider (OpenRouter or OpenAI if configured, otherwise app default)."}),d.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[d.jsxs("div",{className:"space-y-1",children:[d.jsx("label",{htmlFor:"telegram-provider",className:"text-xs text-muted-foreground",children:"Provider"}),d.jsxs("select",{id:"telegram-provider",value:N,onChange:R=>{A(R.target.value),M("")},className:"h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm",children:[d.jsx("option",{value:"",children:"Use app default"}),(a?.aiProviders??[]).map(R=>d.jsx("option",{value:R.id,children:R.label},R.id))]})]}),d.jsxs("div",{className:"space-y-1",children:[d.jsx("label",{htmlFor:"telegram-model",className:"text-xs text-muted-foreground",children:"Model"}),N==="ollama"||N==="openrouter"?d.jsxs("select",{id:"telegram-model",value:O,onChange:R=>M(R.target.value),disabled:U,className:"h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm",children:[d.jsx("option",{value:"",children:"Use provider default"}),V.map(R=>d.jsx("option",{value:R.id,children:R.name},R.id))]}):d.jsx(It,{id:"telegram-model",value:O,onChange:R=>M(R.target.value),placeholder:N?"e.g. gpt-4o-mini":"Set provider first",disabled:!N,className:"h-9 text-sm"})]})]}),N==="ollama"&&d.jsx("div",{className:"rounded-lg border border-amber-500/50 bg-amber-500/10 p-3 text-sm",children:d.jsx("p",{className:"text-amber-700 dark:text-amber-400",children:"⚠️ Ollama cannot run tools and perform like other providers (e.g. OpenAI, OpenRouter). For full tool support in Telegram, use a cloud provider."})})]}),d.jsxs("div",{className:"space-y-2 border-t pt-4",children:[d.jsx("label",{htmlFor:"telegram-main-session-key",className:"text-sm font-medium",children:"Unified chat (main session key)"}),d.jsx(It,{id:"telegram-main-session-key",value:D,onChange:R=>B(R.target.value),placeholder:"main",className:"font-mono text-sm"}),d.jsx("p",{className:"text-muted-foreground text-xs",children:"When set, the primary Telegram chat (where notifications go) uses this session so you can continue the same conversation in the dashboard Chat. Leave empty for separate Telegram sessions."})]}),h&&d.jsx("p",{className:"text-destructive text-sm",children:h}),d.jsxs("div",{className:"flex flex-wrap gap-2",children:[d.jsxs(je,{onClick:Y,disabled:u,children:[d.jsx(N5,{className:"size-4"}),u?"Saving…":"Save"]}),e?.configured&&e.status!=="connected"&&d.jsx(je,{variant:"outline",onClick:Y,disabled:u,title:"Restart the bot with current settings",children:"Reconnect"})]})]})]}),d.jsxs(St,{children:[d.jsxs(At,{children:[d.jsx(Tt,{className:"text-base",children:"Discord"}),d.jsx(Rt,{children:"Let the agent post to your Discord servers. Create an app at the Discord Developer Portal, add a bot, invite it to your server with Send Messages, then paste the bot token below."})]}),d.jsxs(kt,{className:"space-y-4",children:[I&&d.jsx("div",{className:"space-y-1 text-sm",children:d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-muted-foreground",children:"Status:"}),I.configured?d.jsx("span",{className:"text-green-600 dark:text-green-400",children:"Configured"}):d.jsx("span",{className:"text-muted-foreground",children:"Not configured"})]})}),d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{htmlFor:"discord-token",className:"text-sm font-medium",children:"Bot token"}),d.jsx(It,{id:"discord-token",type:"password",placeholder:I?.configured?"(already set)":"Paste your bot token…",value:E,onChange:R=>q(R.target.value),autoComplete:"off",className:"font-mono text-sm"}),d.jsx("p",{className:"text-muted-foreground text-xs",children:"Get a token from the Discord Developer Portal (Bot section). Leave blank to keep the current token."})]}),d.jsxs("p",{className:"text-muted-foreground text-xs",children:[d.jsxs("a",{href:X8,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-primary hover:underline",children:["Open Discord Developer Portal",d.jsx(sS,{className:"size-3"})]})," ","→ create app, add bot, then OAuth2 → URL Generator (scope: bot, permissions: Send Messages) to invite the bot to your server."]}),h&&d.jsx("p",{className:"text-destructive text-sm",children:h}),d.jsx(je,{onClick:z,disabled:$,children:$?"Saving…":"Save"})]})]})]})}function gc(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var bh={exports:{}};var a0;function Q8(){return a0||(a0=1,(function(e,r){(function(a){e.exports=a()})(function(){return(function a(i,s,o){function u(m,y){if(!s[m]){if(!i[m]){var p=typeof gc=="function"&&gc;if(!y&&p)return p(m,!0);if(f)return f(m,!0);var b=new Error("Cannot find module '"+m+"'");throw b.code="MODULE_NOT_FOUND",b}var x=s[m]={exports:{}};i[m][0].call(x.exports,function(S){var w=i[m][1][S];return u(w||S)},x,x.exports,a,i,s,o)}return s[m].exports}for(var f=typeof gc=="function"&&gc,h=0;h<o.length;h++)u(o[h]);return u})({1:[function(a,i,s){var o=a("./utils"),u=a("./support"),f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";s.encode=function(h){for(var m,y,p,b,x,S,w,_=[],k=0,N=h.length,A=N,O=o.getTypeOf(h)!=="string";k<h.length;)A=N-k,p=O?(m=h[k++],y=k<N?h[k++]:0,k<N?h[k++]:0):(m=h.charCodeAt(k++),y=k<N?h.charCodeAt(k++):0,k<N?h.charCodeAt(k++):0),b=m>>2,x=(3&m)<<4|y>>4,S=1<A?(15&y)<<2|p>>6:64,w=2<A?63&p:64,_.push(f.charAt(b)+f.charAt(x)+f.charAt(S)+f.charAt(w));return _.join("")},s.decode=function(h){var m,y,p,b,x,S,w=0,_=0,k="data:";if(h.substr(0,k.length)===k)throw new Error("Invalid base64 input, it looks like a data url.");var N,A=3*(h=h.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(h.charAt(h.length-1)===f.charAt(64)&&A--,h.charAt(h.length-2)===f.charAt(64)&&A--,A%1!=0)throw new Error("Invalid base64 input, bad content length.");for(N=u.uint8array?new Uint8Array(0|A):new Array(0|A);w<h.length;)m=f.indexOf(h.charAt(w++))<<2|(b=f.indexOf(h.charAt(w++)))>>4,y=(15&b)<<4|(x=f.indexOf(h.charAt(w++)))>>2,p=(3&x)<<6|(S=f.indexOf(h.charAt(w++))),N[_++]=m,x!==64&&(N[_++]=y),S!==64&&(N[_++]=p);return N}},{"./support":30,"./utils":32}],2:[function(a,i,s){var o=a("./external"),u=a("./stream/DataWorker"),f=a("./stream/Crc32Probe"),h=a("./stream/DataLengthProbe");function m(y,p,b,x,S){this.compressedSize=y,this.uncompressedSize=p,this.crc32=b,this.compression=x,this.compressedContent=S}m.prototype={getContentWorker:function(){var y=new u(o.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new h("data_length")),p=this;return y.on("end",function(){if(this.streamInfo.data_length!==p.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),y},getCompressedWorker:function(){return new u(o.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},m.createWorkerFrom=function(y,p,b){return y.pipe(new f).pipe(new h("uncompressedSize")).pipe(p.compressWorker(b)).pipe(new h("compressedSize")).withStreamInfo("compression",p)},i.exports=m},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(a,i,s){var o=a("./stream/GenericWorker");s.STORE={magic:"\0\0",compressWorker:function(){return new o("STORE compression")},uncompressWorker:function(){return new o("STORE decompression")}},s.DEFLATE=a("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(a,i,s){var o=a("./utils"),u=(function(){for(var f,h=[],m=0;m<256;m++){f=m;for(var y=0;y<8;y++)f=1&f?3988292384^f>>>1:f>>>1;h[m]=f}return h})();i.exports=function(f,h){return f!==void 0&&f.length?o.getTypeOf(f)!=="string"?(function(m,y,p,b){var x=u,S=b+p;m^=-1;for(var w=b;w<S;w++)m=m>>>8^x[255&(m^y[w])];return-1^m})(0|h,f,f.length,0):(function(m,y,p,b){var x=u,S=b+p;m^=-1;for(var w=b;w<S;w++)m=m>>>8^x[255&(m^y.charCodeAt(w))];return-1^m})(0|h,f,f.length,0):0}},{"./utils":32}],5:[function(a,i,s){s.base64=!1,s.binary=!1,s.dir=!1,s.createFolders=!0,s.date=null,s.compression=null,s.compressionOptions=null,s.comment=null,s.unixPermissions=null,s.dosPermissions=null},{}],6:[function(a,i,s){var o=null;o=typeof Promise<"u"?Promise:a("lie"),i.exports={Promise:o}},{lie:37}],7:[function(a,i,s){var o=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",u=a("pako"),f=a("./utils"),h=a("./stream/GenericWorker"),m=o?"uint8array":"array";function y(p,b){h.call(this,"FlateWorker/"+p),this._pako=null,this._pakoAction=p,this._pakoOptions=b,this.meta={}}s.magic="\b\0",f.inherits(y,h),y.prototype.processChunk=function(p){this.meta=p.meta,this._pako===null&&this._createPako(),this._pako.push(f.transformTo(m,p.data),!1)},y.prototype.flush=function(){h.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},y.prototype.cleanUp=function(){h.prototype.cleanUp.call(this),this._pako=null},y.prototype._createPako=function(){this._pako=new u[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var p=this;this._pako.onData=function(b){p.push({data:b,meta:p.meta})}},s.compressWorker=function(p){return new y("Deflate",p)},s.uncompressWorker=function(){return new y("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(a,i,s){function o(x,S){var w,_="";for(w=0;w<S;w++)_+=String.fromCharCode(255&x),x>>>=8;return _}function u(x,S,w,_,k,N){var A,O,M=x.file,D=x.compression,B=N!==m.utf8encode,V=f.transformTo("string",N(M.name)),K=f.transformTo("string",m.utf8encode(M.name)),U=M.comment,te=f.transformTo("string",N(U)),I=f.transformTo("string",m.utf8encode(U)),Z=K.length!==M.name.length,E=I.length!==U.length,q="",$="",X="",re=M.dir,Y=M.date,z={crc32:0,compressedSize:0,uncompressedSize:0};S&&!w||(z.crc32=x.crc32,z.compressedSize=x.compressedSize,z.uncompressedSize=x.uncompressedSize);var R=0;S&&(R|=8),B||!Z&&!E||(R|=2048);var F=0,L=0;re&&(F|=16),k==="UNIX"?(L=798,F|=(function(oe,ve){var Ce=oe;return oe||(Ce=ve?16893:33204),(65535&Ce)<<16})(M.unixPermissions,re)):(L=20,F|=(function(oe){return 63&(oe||0)})(M.dosPermissions)),A=Y.getUTCHours(),A<<=6,A|=Y.getUTCMinutes(),A<<=5,A|=Y.getUTCSeconds()/2,O=Y.getUTCFullYear()-1980,O<<=4,O|=Y.getUTCMonth()+1,O<<=5,O|=Y.getUTCDate(),Z&&($=o(1,1)+o(y(V),4)+K,q+="up"+o($.length,2)+$),E&&(X=o(1,1)+o(y(te),4)+I,q+="uc"+o(X.length,2)+X);var le="";return le+=`
|
|
88
|
-
\0`,le+=o(R,2),le+=D.magic,le+=o(A,2),le+=o(O,2),le+=o(z.crc32,4),le+=o(z.compressedSize,4),le+=o(z.uncompressedSize,4),le+=o(V.length,2),le+=o(q.length,2),{fileRecord:p.LOCAL_FILE_HEADER+le+V+q,dirRecord:p.CENTRAL_FILE_HEADER+o(L,2)+le+o(te.length,2)+"\0\0\0\0"+o(F,4)+o(_,4)+V+q+te}}var f=a("../utils"),h=a("../stream/GenericWorker"),m=a("../utf8"),y=a("../crc32"),p=a("../signature");function b(x,S,w,_){h.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=S,this.zipPlatform=w,this.encodeFileName=_,this.streamFiles=x,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}f.inherits(b,h),b.prototype.push=function(x){var S=x.meta.percent||0,w=this.entriesCount,_=this._sources.length;this.accumulate?this.contentBuffer.push(x):(this.bytesWritten+=x.data.length,h.prototype.push.call(this,{data:x.data,meta:{currentFile:this.currentFile,percent:w?(S+100*(w-_-1))/w:100}}))},b.prototype.openedSource=function(x){this.currentSourceOffset=this.bytesWritten,this.currentFile=x.file.name;var S=this.streamFiles&&!x.file.dir;if(S){var w=u(x,S,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:w.fileRecord,meta:{percent:0}})}else this.accumulate=!0},b.prototype.closedSource=function(x){this.accumulate=!1;var S=this.streamFiles&&!x.file.dir,w=u(x,S,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(w.dirRecord),S)this.push({data:(function(_){return p.DATA_DESCRIPTOR+o(_.crc32,4)+o(_.compressedSize,4)+o(_.uncompressedSize,4)})(x),meta:{percent:100}});else for(this.push({data:w.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},b.prototype.flush=function(){for(var x=this.bytesWritten,S=0;S<this.dirRecords.length;S++)this.push({data:this.dirRecords[S],meta:{percent:100}});var w=this.bytesWritten-x,_=(function(k,N,A,O,M){var D=f.transformTo("string",M(O));return p.CENTRAL_DIRECTORY_END+"\0\0\0\0"+o(k,2)+o(k,2)+o(N,4)+o(A,4)+o(D.length,2)+D})(this.dirRecords.length,w,x,this.zipComment,this.encodeFileName);this.push({data:_,meta:{percent:100}})},b.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},b.prototype.registerPrevious=function(x){this._sources.push(x);var S=this;return x.on("data",function(w){S.processChunk(w)}),x.on("end",function(){S.closedSource(S.previous.streamInfo),S._sources.length?S.prepareNextSource():S.end()}),x.on("error",function(w){S.error(w)}),this},b.prototype.resume=function(){return!!h.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},b.prototype.error=function(x){var S=this._sources;if(!h.prototype.error.call(this,x))return!1;for(var w=0;w<S.length;w++)try{S[w].error(x)}catch{}return!0},b.prototype.lock=function(){h.prototype.lock.call(this);for(var x=this._sources,S=0;S<x.length;S++)x[S].lock()},i.exports=b},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(a,i,s){var o=a("../compressions"),u=a("./ZipFileWorker");s.generateWorker=function(f,h,m){var y=new u(h.streamFiles,m,h.platform,h.encodeFileName),p=0;try{f.forEach(function(b,x){p++;var S=(function(N,A){var O=N||A,M=o[O];if(!M)throw new Error(O+" is not a valid compression method !");return M})(x.options.compression,h.compression),w=x.options.compressionOptions||h.compressionOptions||{},_=x.dir,k=x.date;x._compressWorker(S,w).withStreamInfo("file",{name:b,dir:_,date:k,comment:x.comment||"",unixPermissions:x.unixPermissions,dosPermissions:x.dosPermissions}).pipe(y)}),y.entriesCount=p}catch(b){y.error(b)}return y}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(a,i,s){function o(){if(!(this instanceof o))return new o;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var u=new o;for(var f in this)typeof this[f]!="function"&&(u[f]=this[f]);return u}}(o.prototype=a("./object")).loadAsync=a("./load"),o.support=a("./support"),o.defaults=a("./defaults"),o.version="3.10.1",o.loadAsync=function(u,f){return new o().loadAsync(u,f)},o.external=a("./external"),i.exports=o},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(a,i,s){var o=a("./utils"),u=a("./external"),f=a("./utf8"),h=a("./zipEntries"),m=a("./stream/Crc32Probe"),y=a("./nodejsUtils");function p(b){return new u.Promise(function(x,S){var w=b.decompressed.getContentWorker().pipe(new m);w.on("error",function(_){S(_)}).on("end",function(){w.streamInfo.crc32!==b.decompressed.crc32?S(new Error("Corrupted zip : CRC32 mismatch")):x()}).resume()})}i.exports=function(b,x){var S=this;return x=o.extend(x||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:f.utf8decode}),y.isNode&&y.isStream(b)?u.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):o.prepareContent("the loaded zip file",b,!0,x.optimizedBinaryString,x.base64).then(function(w){var _=new h(x);return _.load(w),_}).then(function(w){var _=[u.Promise.resolve(w)],k=w.files;if(x.checkCRC32)for(var N=0;N<k.length;N++)_.push(p(k[N]));return u.Promise.all(_)}).then(function(w){for(var _=w.shift(),k=_.files,N=0;N<k.length;N++){var A=k[N],O=A.fileNameStr,M=o.resolve(A.fileNameStr);S.file(M,A.decompressed,{binary:!0,optimizedBinaryString:!0,date:A.date,dir:A.dir,comment:A.fileCommentStr.length?A.fileCommentStr:null,unixPermissions:A.unixPermissions,dosPermissions:A.dosPermissions,createFolders:x.createFolders}),A.dir||(S.file(M).unsafeOriginalName=O)}return _.zipComment.length&&(S.comment=_.zipComment),S})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(a,i,s){var o=a("../utils"),u=a("../stream/GenericWorker");function f(h,m){u.call(this,"Nodejs stream input adapter for "+h),this._upstreamEnded=!1,this._bindStream(m)}o.inherits(f,u),f.prototype._bindStream=function(h){var m=this;(this._stream=h).pause(),h.on("data",function(y){m.push({data:y,meta:{percent:0}})}).on("error",function(y){m.isPaused?this.generatedError=y:m.error(y)}).on("end",function(){m.isPaused?m._upstreamEnded=!0:m.end()})},f.prototype.pause=function(){return!!u.prototype.pause.call(this)&&(this._stream.pause(),!0)},f.prototype.resume=function(){return!!u.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},i.exports=f},{"../stream/GenericWorker":28,"../utils":32}],13:[function(a,i,s){var o=a("readable-stream").Readable;function u(f,h,m){o.call(this,h),this._helper=f;var y=this;f.on("data",function(p,b){y.push(p)||y._helper.pause(),m&&m(b)}).on("error",function(p){y.emit("error",p)}).on("end",function(){y.push(null)})}a("../utils").inherits(u,o),u.prototype._read=function(){this._helper.resume()},i.exports=u},{"../utils":32,"readable-stream":16}],14:[function(a,i,s){i.exports={isNode:typeof Buffer<"u",newBufferFrom:function(o,u){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(o,u);if(typeof o=="number")throw new Error('The "data" argument must not be a number');return new Buffer(o,u)},allocBuffer:function(o){if(Buffer.alloc)return Buffer.alloc(o);var u=new Buffer(o);return u.fill(0),u},isBuffer:function(o){return Buffer.isBuffer(o)},isStream:function(o){return o&&typeof o.on=="function"&&typeof o.pause=="function"&&typeof o.resume=="function"}}},{}],15:[function(a,i,s){function o(M,D,B){var V,K=f.getTypeOf(D),U=f.extend(B||{},y);U.date=U.date||new Date,U.compression!==null&&(U.compression=U.compression.toUpperCase()),typeof U.unixPermissions=="string"&&(U.unixPermissions=parseInt(U.unixPermissions,8)),U.unixPermissions&&16384&U.unixPermissions&&(U.dir=!0),U.dosPermissions&&16&U.dosPermissions&&(U.dir=!0),U.dir&&(M=k(M)),U.createFolders&&(V=_(M))&&N.call(this,V,!0);var te=K==="string"&&U.binary===!1&&U.base64===!1;B&&B.binary!==void 0||(U.binary=!te),(D instanceof p&&D.uncompressedSize===0||U.dir||!D||D.length===0)&&(U.base64=!1,U.binary=!0,D="",U.compression="STORE",K="string");var I=null;I=D instanceof p||D instanceof h?D:S.isNode&&S.isStream(D)?new w(M,D):f.prepareContent(M,D,U.binary,U.optimizedBinaryString,U.base64);var Z=new b(M,I,U);this.files[M]=Z}var u=a("./utf8"),f=a("./utils"),h=a("./stream/GenericWorker"),m=a("./stream/StreamHelper"),y=a("./defaults"),p=a("./compressedObject"),b=a("./zipObject"),x=a("./generate"),S=a("./nodejsUtils"),w=a("./nodejs/NodejsStreamInputAdapter"),_=function(M){M.slice(-1)==="/"&&(M=M.substring(0,M.length-1));var D=M.lastIndexOf("/");return 0<D?M.substring(0,D):""},k=function(M){return M.slice(-1)!=="/"&&(M+="/"),M},N=function(M,D){return D=D!==void 0?D:y.createFolders,M=k(M),this.files[M]||o.call(this,M,null,{dir:!0,createFolders:D}),this.files[M]};function A(M){return Object.prototype.toString.call(M)==="[object RegExp]"}var O={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(M){var D,B,V;for(D in this.files)V=this.files[D],(B=D.slice(this.root.length,D.length))&&D.slice(0,this.root.length)===this.root&&M(B,V)},filter:function(M){var D=[];return this.forEach(function(B,V){M(B,V)&&D.push(V)}),D},file:function(M,D,B){if(arguments.length!==1)return M=this.root+M,o.call(this,M,D,B),this;if(A(M)){var V=M;return this.filter(function(U,te){return!te.dir&&V.test(U)})}var K=this.files[this.root+M];return K&&!K.dir?K:null},folder:function(M){if(!M)return this;if(A(M))return this.filter(function(K,U){return U.dir&&M.test(K)});var D=this.root+M,B=N.call(this,D),V=this.clone();return V.root=B.name,V},remove:function(M){M=this.root+M;var D=this.files[M];if(D||(M.slice(-1)!=="/"&&(M+="/"),D=this.files[M]),D&&!D.dir)delete this.files[M];else for(var B=this.filter(function(K,U){return U.name.slice(0,M.length)===M}),V=0;V<B.length;V++)delete this.files[B[V].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(M){var D,B={};try{if((B=f.extend(M||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:u.utf8encode})).type=B.type.toLowerCase(),B.compression=B.compression.toUpperCase(),B.type==="binarystring"&&(B.type="string"),!B.type)throw new Error("No output type specified.");f.checkSupport(B.type),B.platform!=="darwin"&&B.platform!=="freebsd"&&B.platform!=="linux"&&B.platform!=="sunos"||(B.platform="UNIX"),B.platform==="win32"&&(B.platform="DOS");var V=B.comment||this.comment||"";D=x.generateWorker(this,B,V)}catch(K){(D=new h("error")).error(K)}return new m(D,B.type||"string",B.mimeType)},generateAsync:function(M,D){return this.generateInternalStream(M).accumulate(D)},generateNodeStream:function(M,D){return(M=M||{}).type||(M.type="nodebuffer"),this.generateInternalStream(M).toNodejsStream(D)}};i.exports=O},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(a,i,s){i.exports=a("stream")},{stream:void 0}],17:[function(a,i,s){var o=a("./DataReader");function u(f){o.call(this,f);for(var h=0;h<this.data.length;h++)f[h]=255&f[h]}a("../utils").inherits(u,o),u.prototype.byteAt=function(f){return this.data[this.zero+f]},u.prototype.lastIndexOfSignature=function(f){for(var h=f.charCodeAt(0),m=f.charCodeAt(1),y=f.charCodeAt(2),p=f.charCodeAt(3),b=this.length-4;0<=b;--b)if(this.data[b]===h&&this.data[b+1]===m&&this.data[b+2]===y&&this.data[b+3]===p)return b-this.zero;return-1},u.prototype.readAndCheckSignature=function(f){var h=f.charCodeAt(0),m=f.charCodeAt(1),y=f.charCodeAt(2),p=f.charCodeAt(3),b=this.readData(4);return h===b[0]&&m===b[1]&&y===b[2]&&p===b[3]},u.prototype.readData=function(f){if(this.checkOffset(f),f===0)return[];var h=this.data.slice(this.zero+this.index,this.zero+this.index+f);return this.index+=f,h},i.exports=u},{"../utils":32,"./DataReader":18}],18:[function(a,i,s){var o=a("../utils");function u(f){this.data=f,this.length=f.length,this.index=0,this.zero=0}u.prototype={checkOffset:function(f){this.checkIndex(this.index+f)},checkIndex:function(f){if(this.length<this.zero+f||f<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+f+"). Corrupted zip ?")},setIndex:function(f){this.checkIndex(f),this.index=f},skip:function(f){this.setIndex(this.index+f)},byteAt:function(){},readInt:function(f){var h,m=0;for(this.checkOffset(f),h=this.index+f-1;h>=this.index;h--)m=(m<<8)+this.byteAt(h);return this.index+=f,m},readString:function(f){return o.transformTo("string",this.readData(f))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var f=this.readInt(4);return new Date(Date.UTC(1980+(f>>25&127),(f>>21&15)-1,f>>16&31,f>>11&31,f>>5&63,(31&f)<<1))}},i.exports=u},{"../utils":32}],19:[function(a,i,s){var o=a("./Uint8ArrayReader");function u(f){o.call(this,f)}a("../utils").inherits(u,o),u.prototype.readData=function(f){this.checkOffset(f);var h=this.data.slice(this.zero+this.index,this.zero+this.index+f);return this.index+=f,h},i.exports=u},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(a,i,s){var o=a("./DataReader");function u(f){o.call(this,f)}a("../utils").inherits(u,o),u.prototype.byteAt=function(f){return this.data.charCodeAt(this.zero+f)},u.prototype.lastIndexOfSignature=function(f){return this.data.lastIndexOf(f)-this.zero},u.prototype.readAndCheckSignature=function(f){return f===this.readData(4)},u.prototype.readData=function(f){this.checkOffset(f);var h=this.data.slice(this.zero+this.index,this.zero+this.index+f);return this.index+=f,h},i.exports=u},{"../utils":32,"./DataReader":18}],21:[function(a,i,s){var o=a("./ArrayReader");function u(f){o.call(this,f)}a("../utils").inherits(u,o),u.prototype.readData=function(f){if(this.checkOffset(f),f===0)return new Uint8Array(0);var h=this.data.subarray(this.zero+this.index,this.zero+this.index+f);return this.index+=f,h},i.exports=u},{"../utils":32,"./ArrayReader":17}],22:[function(a,i,s){var o=a("../utils"),u=a("../support"),f=a("./ArrayReader"),h=a("./StringReader"),m=a("./NodeBufferReader"),y=a("./Uint8ArrayReader");i.exports=function(p){var b=o.getTypeOf(p);return o.checkSupport(b),b!=="string"||u.uint8array?b==="nodebuffer"?new m(p):u.uint8array?new y(o.transformTo("uint8array",p)):new f(o.transformTo("array",p)):new h(p)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(a,i,s){s.LOCAL_FILE_HEADER="PK",s.CENTRAL_FILE_HEADER="PK",s.CENTRAL_DIRECTORY_END="PK",s.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",s.ZIP64_CENTRAL_DIRECTORY_END="PK",s.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(a,i,s){var o=a("./GenericWorker"),u=a("../utils");function f(h){o.call(this,"ConvertWorker to "+h),this.destType=h}u.inherits(f,o),f.prototype.processChunk=function(h){this.push({data:u.transformTo(this.destType,h.data),meta:h.meta})},i.exports=f},{"../utils":32,"./GenericWorker":28}],25:[function(a,i,s){var o=a("./GenericWorker"),u=a("../crc32");function f(){o.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}a("../utils").inherits(f,o),f.prototype.processChunk=function(h){this.streamInfo.crc32=u(h.data,this.streamInfo.crc32||0),this.push(h)},i.exports=f},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(a,i,s){var o=a("../utils"),u=a("./GenericWorker");function f(h){u.call(this,"DataLengthProbe for "+h),this.propName=h,this.withStreamInfo(h,0)}o.inherits(f,u),f.prototype.processChunk=function(h){if(h){var m=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=m+h.data.length}u.prototype.processChunk.call(this,h)},i.exports=f},{"../utils":32,"./GenericWorker":28}],27:[function(a,i,s){var o=a("../utils"),u=a("./GenericWorker");function f(h){u.call(this,"DataWorker");var m=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,h.then(function(y){m.dataIsReady=!0,m.data=y,m.max=y&&y.length||0,m.type=o.getTypeOf(y),m.isPaused||m._tickAndRepeat()},function(y){m.error(y)})}o.inherits(f,u),f.prototype.cleanUp=function(){u.prototype.cleanUp.call(this),this.data=null},f.prototype.resume=function(){return!!u.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,o.delay(this._tickAndRepeat,[],this)),!0)},f.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(o.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},f.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var h=null,m=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":h=this.data.substring(this.index,m);break;case"uint8array":h=this.data.subarray(this.index,m);break;case"array":case"nodebuffer":h=this.data.slice(this.index,m)}return this.index=m,this.push({data:h,meta:{percent:this.max?this.index/this.max*100:0}})},i.exports=f},{"../utils":32,"./GenericWorker":28}],28:[function(a,i,s){function o(u){this.name=u||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}o.prototype={push:function(u){this.emit("data",u)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(u){this.emit("error",u)}return!0},error:function(u){return!this.isFinished&&(this.isPaused?this.generatedError=u:(this.isFinished=!0,this.emit("error",u),this.previous&&this.previous.error(u),this.cleanUp()),!0)},on:function(u,f){return this._listeners[u].push(f),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(u,f){if(this._listeners[u])for(var h=0;h<this._listeners[u].length;h++)this._listeners[u][h].call(this,f)},pipe:function(u){return u.registerPrevious(this)},registerPrevious:function(u){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=u.streamInfo,this.mergeStreamInfo(),this.previous=u;var f=this;return u.on("data",function(h){f.processChunk(h)}),u.on("end",function(){f.end()}),u.on("error",function(h){f.error(h)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var u=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),u=!0),this.previous&&this.previous.resume(),!u},flush:function(){},processChunk:function(u){this.push(u)},withStreamInfo:function(u,f){return this.extraStreamInfo[u]=f,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var u in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,u)&&(this.streamInfo[u]=this.extraStreamInfo[u])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var u="Worker "+this.name;return this.previous?this.previous+" -> "+u:u}},i.exports=o},{}],29:[function(a,i,s){var o=a("../utils"),u=a("./ConvertWorker"),f=a("./GenericWorker"),h=a("../base64"),m=a("../support"),y=a("../external"),p=null;if(m.nodestream)try{p=a("../nodejs/NodejsStreamOutputAdapter")}catch{}function b(S,w){return new y.Promise(function(_,k){var N=[],A=S._internalType,O=S._outputType,M=S._mimeType;S.on("data",function(D,B){N.push(D),w&&w(B)}).on("error",function(D){N=[],k(D)}).on("end",function(){try{var D=(function(B,V,K){switch(B){case"blob":return o.newBlob(o.transformTo("arraybuffer",V),K);case"base64":return h.encode(V);default:return o.transformTo(B,V)}})(O,(function(B,V){var K,U=0,te=null,I=0;for(K=0;K<V.length;K++)I+=V[K].length;switch(B){case"string":return V.join("");case"array":return Array.prototype.concat.apply([],V);case"uint8array":for(te=new Uint8Array(I),K=0;K<V.length;K++)te.set(V[K],U),U+=V[K].length;return te;case"nodebuffer":return Buffer.concat(V);default:throw new Error("concat : unsupported type '"+B+"'")}})(A,N),M);_(D)}catch(B){k(B)}N=[]}).resume()})}function x(S,w,_){var k=w;switch(w){case"blob":case"arraybuffer":k="uint8array";break;case"base64":k="string"}try{this._internalType=k,this._outputType=w,this._mimeType=_,o.checkSupport(k),this._worker=S.pipe(new u(k)),S.lock()}catch(N){this._worker=new f("error"),this._worker.error(N)}}x.prototype={accumulate:function(S){return b(this,S)},on:function(S,w){var _=this;return S==="data"?this._worker.on(S,function(k){w.call(_,k.data,k.meta)}):this._worker.on(S,function(){o.delay(w,arguments,_)}),this},resume:function(){return o.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(S){if(o.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new p(this,{objectMode:this._outputType!=="nodebuffer"},S)}},i.exports=x},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(a,i,s){if(s.base64=!0,s.array=!0,s.string=!0,s.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",s.nodebuffer=typeof Buffer<"u",s.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")s.blob=!1;else{var o=new ArrayBuffer(0);try{s.blob=new Blob([o],{type:"application/zip"}).size===0}catch{try{var u=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);u.append(o),s.blob=u.getBlob("application/zip").size===0}catch{s.blob=!1}}}try{s.nodestream=!!a("readable-stream").Readable}catch{s.nodestream=!1}},{"readable-stream":16}],31:[function(a,i,s){for(var o=a("./utils"),u=a("./support"),f=a("./nodejsUtils"),h=a("./stream/GenericWorker"),m=new Array(256),y=0;y<256;y++)m[y]=252<=y?6:248<=y?5:240<=y?4:224<=y?3:192<=y?2:1;m[254]=m[254]=1;function p(){h.call(this,"utf-8 decode"),this.leftOver=null}function b(){h.call(this,"utf-8 encode")}s.utf8encode=function(x){return u.nodebuffer?f.newBufferFrom(x,"utf-8"):(function(S){var w,_,k,N,A,O=S.length,M=0;for(N=0;N<O;N++)(64512&(_=S.charCodeAt(N)))==55296&&N+1<O&&(64512&(k=S.charCodeAt(N+1)))==56320&&(_=65536+(_-55296<<10)+(k-56320),N++),M+=_<128?1:_<2048?2:_<65536?3:4;for(w=u.uint8array?new Uint8Array(M):new Array(M),N=A=0;A<M;N++)(64512&(_=S.charCodeAt(N)))==55296&&N+1<O&&(64512&(k=S.charCodeAt(N+1)))==56320&&(_=65536+(_-55296<<10)+(k-56320),N++),_<128?w[A++]=_:(_<2048?w[A++]=192|_>>>6:(_<65536?w[A++]=224|_>>>12:(w[A++]=240|_>>>18,w[A++]=128|_>>>12&63),w[A++]=128|_>>>6&63),w[A++]=128|63&_);return w})(x)},s.utf8decode=function(x){return u.nodebuffer?o.transformTo("nodebuffer",x).toString("utf-8"):(function(S){var w,_,k,N,A=S.length,O=new Array(2*A);for(w=_=0;w<A;)if((k=S[w++])<128)O[_++]=k;else if(4<(N=m[k]))O[_++]=65533,w+=N-1;else{for(k&=N===2?31:N===3?15:7;1<N&&w<A;)k=k<<6|63&S[w++],N--;1<N?O[_++]=65533:k<65536?O[_++]=k:(k-=65536,O[_++]=55296|k>>10&1023,O[_++]=56320|1023&k)}return O.length!==_&&(O.subarray?O=O.subarray(0,_):O.length=_),o.applyFromCharCode(O)})(x=o.transformTo(u.uint8array?"uint8array":"array",x))},o.inherits(p,h),p.prototype.processChunk=function(x){var S=o.transformTo(u.uint8array?"uint8array":"array",x.data);if(this.leftOver&&this.leftOver.length){if(u.uint8array){var w=S;(S=new Uint8Array(w.length+this.leftOver.length)).set(this.leftOver,0),S.set(w,this.leftOver.length)}else S=this.leftOver.concat(S);this.leftOver=null}var _=(function(N,A){var O;for((A=A||N.length)>N.length&&(A=N.length),O=A-1;0<=O&&(192&N[O])==128;)O--;return O<0||O===0?A:O+m[N[O]]>A?O:A})(S),k=S;_!==S.length&&(u.uint8array?(k=S.subarray(0,_),this.leftOver=S.subarray(_,S.length)):(k=S.slice(0,_),this.leftOver=S.slice(_,S.length))),this.push({data:s.utf8decode(k),meta:x.meta})},p.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:s.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},s.Utf8DecodeWorker=p,o.inherits(b,h),b.prototype.processChunk=function(x){this.push({data:s.utf8encode(x.data),meta:x.meta})},s.Utf8EncodeWorker=b},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(a,i,s){var o=a("./support"),u=a("./base64"),f=a("./nodejsUtils"),h=a("./external");function m(w){return w}function y(w,_){for(var k=0;k<w.length;++k)_[k]=255&w.charCodeAt(k);return _}a("setimmediate"),s.newBlob=function(w,_){s.checkSupport("blob");try{return new Blob([w],{type:_})}catch{try{var k=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return k.append(w),k.getBlob(_)}catch{throw new Error("Bug : can't construct the Blob.")}}};var p={stringifyByChunk:function(w,_,k){var N=[],A=0,O=w.length;if(O<=k)return String.fromCharCode.apply(null,w);for(;A<O;)_==="array"||_==="nodebuffer"?N.push(String.fromCharCode.apply(null,w.slice(A,Math.min(A+k,O)))):N.push(String.fromCharCode.apply(null,w.subarray(A,Math.min(A+k,O)))),A+=k;return N.join("")},stringifyByChar:function(w){for(var _="",k=0;k<w.length;k++)_+=String.fromCharCode(w[k]);return _},applyCanBeUsed:{uint8array:(function(){try{return o.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}})(),nodebuffer:(function(){try{return o.nodebuffer&&String.fromCharCode.apply(null,f.allocBuffer(1)).length===1}catch{return!1}})()}};function b(w){var _=65536,k=s.getTypeOf(w),N=!0;if(k==="uint8array"?N=p.applyCanBeUsed.uint8array:k==="nodebuffer"&&(N=p.applyCanBeUsed.nodebuffer),N)for(;1<_;)try{return p.stringifyByChunk(w,k,_)}catch{_=Math.floor(_/2)}return p.stringifyByChar(w)}function x(w,_){for(var k=0;k<w.length;k++)_[k]=w[k];return _}s.applyFromCharCode=b;var S={};S.string={string:m,array:function(w){return y(w,new Array(w.length))},arraybuffer:function(w){return S.string.uint8array(w).buffer},uint8array:function(w){return y(w,new Uint8Array(w.length))},nodebuffer:function(w){return y(w,f.allocBuffer(w.length))}},S.array={string:b,array:m,arraybuffer:function(w){return new Uint8Array(w).buffer},uint8array:function(w){return new Uint8Array(w)},nodebuffer:function(w){return f.newBufferFrom(w)}},S.arraybuffer={string:function(w){return b(new Uint8Array(w))},array:function(w){return x(new Uint8Array(w),new Array(w.byteLength))},arraybuffer:m,uint8array:function(w){return new Uint8Array(w)},nodebuffer:function(w){return f.newBufferFrom(new Uint8Array(w))}},S.uint8array={string:b,array:function(w){return x(w,new Array(w.length))},arraybuffer:function(w){return w.buffer},uint8array:m,nodebuffer:function(w){return f.newBufferFrom(w)}},S.nodebuffer={string:b,array:function(w){return x(w,new Array(w.length))},arraybuffer:function(w){return S.nodebuffer.uint8array(w).buffer},uint8array:function(w){return x(w,new Uint8Array(w.length))},nodebuffer:m},s.transformTo=function(w,_){if(_=_||"",!w)return _;s.checkSupport(w);var k=s.getTypeOf(_);return S[k][w](_)},s.resolve=function(w){for(var _=w.split("/"),k=[],N=0;N<_.length;N++){var A=_[N];A==="."||A===""&&N!==0&&N!==_.length-1||(A===".."?k.pop():k.push(A))}return k.join("/")},s.getTypeOf=function(w){return typeof w=="string"?"string":Object.prototype.toString.call(w)==="[object Array]"?"array":o.nodebuffer&&f.isBuffer(w)?"nodebuffer":o.uint8array&&w instanceof Uint8Array?"uint8array":o.arraybuffer&&w instanceof ArrayBuffer?"arraybuffer":void 0},s.checkSupport=function(w){if(!o[w.toLowerCase()])throw new Error(w+" is not supported by this platform")},s.MAX_VALUE_16BITS=65535,s.MAX_VALUE_32BITS=-1,s.pretty=function(w){var _,k,N="";for(k=0;k<(w||"").length;k++)N+="\\x"+((_=w.charCodeAt(k))<16?"0":"")+_.toString(16).toUpperCase();return N},s.delay=function(w,_,k){setImmediate(function(){w.apply(k||null,_||[])})},s.inherits=function(w,_){function k(){}k.prototype=_.prototype,w.prototype=new k},s.extend=function(){var w,_,k={};for(w=0;w<arguments.length;w++)for(_ in arguments[w])Object.prototype.hasOwnProperty.call(arguments[w],_)&&k[_]===void 0&&(k[_]=arguments[w][_]);return k},s.prepareContent=function(w,_,k,N,A){return h.Promise.resolve(_).then(function(O){return o.blob&&(O instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(O))!==-1)&&typeof FileReader<"u"?new h.Promise(function(M,D){var B=new FileReader;B.onload=function(V){M(V.target.result)},B.onerror=function(V){D(V.target.error)},B.readAsArrayBuffer(O)}):O}).then(function(O){var M=s.getTypeOf(O);return M?(M==="arraybuffer"?O=s.transformTo("uint8array",O):M==="string"&&(A?O=u.decode(O):k&&N!==!0&&(O=(function(D){return y(D,o.uint8array?new Uint8Array(D.length):new Array(D.length))})(O))),O):h.Promise.reject(new Error("Can't read the data of '"+w+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(a,i,s){var o=a("./reader/readerFor"),u=a("./utils"),f=a("./signature"),h=a("./zipEntry"),m=a("./support");function y(p){this.files=[],this.loadOptions=p}y.prototype={checkSignature:function(p){if(!this.reader.readAndCheckSignature(p)){this.reader.index-=4;var b=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+u.pretty(b)+", expected "+u.pretty(p)+")")}},isSignature:function(p,b){var x=this.reader.index;this.reader.setIndex(p);var S=this.reader.readString(4)===b;return this.reader.setIndex(x),S},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var p=this.reader.readData(this.zipCommentLength),b=m.uint8array?"uint8array":"array",x=u.transformTo(b,p);this.zipComment=this.loadOptions.decodeFileName(x)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var p,b,x,S=this.zip64EndOfCentralSize-44;0<S;)p=this.reader.readInt(2),b=this.reader.readInt(4),x=this.reader.readData(b),this.zip64ExtensibleData[p]={id:p,length:b,value:x}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var p,b;for(p=0;p<this.files.length;p++)b=this.files[p],this.reader.setIndex(b.localHeaderOffset),this.checkSignature(f.LOCAL_FILE_HEADER),b.readLocalPart(this.reader),b.handleUTF8(),b.processAttributes()},readCentralDir:function(){var p;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(f.CENTRAL_FILE_HEADER);)(p=new h({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(p);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var p=this.reader.lastIndexOfSignature(f.CENTRAL_DIRECTORY_END);if(p<0)throw this.isSignature(0,f.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(p);var b=p;if(this.checkSignature(f.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===u.MAX_VALUE_16BITS||this.diskWithCentralDirStart===u.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===u.MAX_VALUE_16BITS||this.centralDirRecords===u.MAX_VALUE_16BITS||this.centralDirSize===u.MAX_VALUE_32BITS||this.centralDirOffset===u.MAX_VALUE_32BITS){if(this.zip64=!0,(p=this.reader.lastIndexOfSignature(f.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(p),this.checkSignature(f.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,f.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(f.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(f.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var x=this.centralDirOffset+this.centralDirSize;this.zip64&&(x+=20,x+=12+this.zip64EndOfCentralSize);var S=b-x;if(0<S)this.isSignature(b,f.CENTRAL_FILE_HEADER)||(this.reader.zero=S);else if(S<0)throw new Error("Corrupted zip: missing "+Math.abs(S)+" bytes.")},prepareReader:function(p){this.reader=o(p)},load:function(p){this.prepareReader(p),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},i.exports=y},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(a,i,s){var o=a("./reader/readerFor"),u=a("./utils"),f=a("./compressedObject"),h=a("./crc32"),m=a("./utf8"),y=a("./compressions"),p=a("./support");function b(x,S){this.options=x,this.loadOptions=S}b.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(x){var S,w;if(x.skip(22),this.fileNameLength=x.readInt(2),w=x.readInt(2),this.fileName=x.readData(this.fileNameLength),x.skip(w),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((S=(function(_){for(var k in y)if(Object.prototype.hasOwnProperty.call(y,k)&&y[k].magic===_)return y[k];return null})(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+u.pretty(this.compressionMethod)+" unknown (inner file : "+u.transformTo("string",this.fileName)+")");this.decompressed=new f(this.compressedSize,this.uncompressedSize,this.crc32,S,x.readData(this.compressedSize))},readCentralPart:function(x){this.versionMadeBy=x.readInt(2),x.skip(2),this.bitFlag=x.readInt(2),this.compressionMethod=x.readString(2),this.date=x.readDate(),this.crc32=x.readInt(4),this.compressedSize=x.readInt(4),this.uncompressedSize=x.readInt(4);var S=x.readInt(2);if(this.extraFieldsLength=x.readInt(2),this.fileCommentLength=x.readInt(2),this.diskNumberStart=x.readInt(2),this.internalFileAttributes=x.readInt(2),this.externalFileAttributes=x.readInt(4),this.localHeaderOffset=x.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");x.skip(S),this.readExtraFields(x),this.parseZIP64ExtraField(x),this.fileComment=x.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var x=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),x==0&&(this.dosPermissions=63&this.externalFileAttributes),x==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var x=o(this.extraFields[1].value);this.uncompressedSize===u.MAX_VALUE_32BITS&&(this.uncompressedSize=x.readInt(8)),this.compressedSize===u.MAX_VALUE_32BITS&&(this.compressedSize=x.readInt(8)),this.localHeaderOffset===u.MAX_VALUE_32BITS&&(this.localHeaderOffset=x.readInt(8)),this.diskNumberStart===u.MAX_VALUE_32BITS&&(this.diskNumberStart=x.readInt(4))}},readExtraFields:function(x){var S,w,_,k=x.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});x.index+4<k;)S=x.readInt(2),w=x.readInt(2),_=x.readData(w),this.extraFields[S]={id:S,length:w,value:_};x.setIndex(k)},handleUTF8:function(){var x=p.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=m.utf8decode(this.fileName),this.fileCommentStr=m.utf8decode(this.fileComment);else{var S=this.findExtraFieldUnicodePath();if(S!==null)this.fileNameStr=S;else{var w=u.transformTo(x,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(w)}var _=this.findExtraFieldUnicodeComment();if(_!==null)this.fileCommentStr=_;else{var k=u.transformTo(x,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(k)}}},findExtraFieldUnicodePath:function(){var x=this.extraFields[28789];if(x){var S=o(x.value);return S.readInt(1)!==1||h(this.fileName)!==S.readInt(4)?null:m.utf8decode(S.readData(x.length-5))}return null},findExtraFieldUnicodeComment:function(){var x=this.extraFields[25461];if(x){var S=o(x.value);return S.readInt(1)!==1||h(this.fileComment)!==S.readInt(4)?null:m.utf8decode(S.readData(x.length-5))}return null}},i.exports=b},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(a,i,s){function o(S,w,_){this.name=S,this.dir=_.dir,this.date=_.date,this.comment=_.comment,this.unixPermissions=_.unixPermissions,this.dosPermissions=_.dosPermissions,this._data=w,this._dataBinary=_.binary,this.options={compression:_.compression,compressionOptions:_.compressionOptions}}var u=a("./stream/StreamHelper"),f=a("./stream/DataWorker"),h=a("./utf8"),m=a("./compressedObject"),y=a("./stream/GenericWorker");o.prototype={internalStream:function(S){var w=null,_="string";try{if(!S)throw new Error("No output type specified.");var k=(_=S.toLowerCase())==="string"||_==="text";_!=="binarystring"&&_!=="text"||(_="string"),w=this._decompressWorker();var N=!this._dataBinary;N&&!k&&(w=w.pipe(new h.Utf8EncodeWorker)),!N&&k&&(w=w.pipe(new h.Utf8DecodeWorker))}catch(A){(w=new y("error")).error(A)}return new u(w,_,"")},async:function(S,w){return this.internalStream(S).accumulate(w)},nodeStream:function(S,w){return this.internalStream(S||"nodebuffer").toNodejsStream(w)},_compressWorker:function(S,w){if(this._data instanceof m&&this._data.compression.magic===S.magic)return this._data.getCompressedWorker();var _=this._decompressWorker();return this._dataBinary||(_=_.pipe(new h.Utf8EncodeWorker)),m.createWorkerFrom(_,S,w)},_decompressWorker:function(){return this._data instanceof m?this._data.getContentWorker():this._data instanceof y?this._data:new f(this._data)}};for(var p=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],b=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},x=0;x<p.length;x++)o.prototype[p[x]]=b;i.exports=o},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(a,i,s){(function(o){var u,f,h=o.MutationObserver||o.WebKitMutationObserver;if(h){var m=0,y=new h(S),p=o.document.createTextNode("");y.observe(p,{characterData:!0}),u=function(){p.data=m=++m%2}}else if(o.setImmediate||o.MessageChannel===void 0)u="document"in o&&"onreadystatechange"in o.document.createElement("script")?function(){var w=o.document.createElement("script");w.onreadystatechange=function(){S(),w.onreadystatechange=null,w.parentNode.removeChild(w),w=null},o.document.documentElement.appendChild(w)}:function(){setTimeout(S,0)};else{var b=new o.MessageChannel;b.port1.onmessage=S,u=function(){b.port2.postMessage(0)}}var x=[];function S(){var w,_;f=!0;for(var k=x.length;k;){for(_=x,x=[],w=-1;++w<k;)_[w]();k=x.length}f=!1}i.exports=function(w){x.push(w)!==1||f||u()}}).call(this,typeof nc<"u"?nc:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(a,i,s){var o=a("immediate");function u(){}var f={},h=["REJECTED"],m=["FULFILLED"],y=["PENDING"];function p(k){if(typeof k!="function")throw new TypeError("resolver must be a function");this.state=y,this.queue=[],this.outcome=void 0,k!==u&&w(this,k)}function b(k,N,A){this.promise=k,typeof N=="function"&&(this.onFulfilled=N,this.callFulfilled=this.otherCallFulfilled),typeof A=="function"&&(this.onRejected=A,this.callRejected=this.otherCallRejected)}function x(k,N,A){o(function(){var O;try{O=N(A)}catch(M){return f.reject(k,M)}O===k?f.reject(k,new TypeError("Cannot resolve promise with itself")):f.resolve(k,O)})}function S(k){var N=k&&k.then;if(k&&(typeof k=="object"||typeof k=="function")&&typeof N=="function")return function(){N.apply(k,arguments)}}function w(k,N){var A=!1;function O(B){A||(A=!0,f.reject(k,B))}function M(B){A||(A=!0,f.resolve(k,B))}var D=_(function(){N(M,O)});D.status==="error"&&O(D.value)}function _(k,N){var A={};try{A.value=k(N),A.status="success"}catch(O){A.status="error",A.value=O}return A}(i.exports=p).prototype.finally=function(k){if(typeof k!="function")return this;var N=this.constructor;return this.then(function(A){return N.resolve(k()).then(function(){return A})},function(A){return N.resolve(k()).then(function(){throw A})})},p.prototype.catch=function(k){return this.then(null,k)},p.prototype.then=function(k,N){if(typeof k!="function"&&this.state===m||typeof N!="function"&&this.state===h)return this;var A=new this.constructor(u);return this.state!==y?x(A,this.state===m?k:N,this.outcome):this.queue.push(new b(A,k,N)),A},b.prototype.callFulfilled=function(k){f.resolve(this.promise,k)},b.prototype.otherCallFulfilled=function(k){x(this.promise,this.onFulfilled,k)},b.prototype.callRejected=function(k){f.reject(this.promise,k)},b.prototype.otherCallRejected=function(k){x(this.promise,this.onRejected,k)},f.resolve=function(k,N){var A=_(S,N);if(A.status==="error")return f.reject(k,A.value);var O=A.value;if(O)w(k,O);else{k.state=m,k.outcome=N;for(var M=-1,D=k.queue.length;++M<D;)k.queue[M].callFulfilled(N)}return k},f.reject=function(k,N){k.state=h,k.outcome=N;for(var A=-1,O=k.queue.length;++A<O;)k.queue[A].callRejected(N);return k},p.resolve=function(k){return k instanceof this?k:f.resolve(new this(u),k)},p.reject=function(k){var N=new this(u);return f.reject(N,k)},p.all=function(k){var N=this;if(Object.prototype.toString.call(k)!=="[object Array]")return this.reject(new TypeError("must be an array"));var A=k.length,O=!1;if(!A)return this.resolve([]);for(var M=new Array(A),D=0,B=-1,V=new this(u);++B<A;)K(k[B],B);return V;function K(U,te){N.resolve(U).then(function(I){M[te]=I,++D!==A||O||(O=!0,f.resolve(V,M))},function(I){O||(O=!0,f.reject(V,I))})}},p.race=function(k){var N=this;if(Object.prototype.toString.call(k)!=="[object Array]")return this.reject(new TypeError("must be an array"));var A=k.length,O=!1;if(!A)return this.resolve([]);for(var M=-1,D=new this(u);++M<A;)B=k[M],N.resolve(B).then(function(V){O||(O=!0,f.resolve(D,V))},function(V){O||(O=!0,f.reject(D,V))});var B;return D}},{immediate:36}],38:[function(a,i,s){var o={};(0,a("./lib/utils/common").assign)(o,a("./lib/deflate"),a("./lib/inflate"),a("./lib/zlib/constants")),i.exports=o},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(a,i,s){var o=a("./zlib/deflate"),u=a("./utils/common"),f=a("./utils/strings"),h=a("./zlib/messages"),m=a("./zlib/zstream"),y=Object.prototype.toString,p=0,b=-1,x=0,S=8;function w(k){if(!(this instanceof w))return new w(k);this.options=u.assign({level:b,method:S,chunkSize:16384,windowBits:15,memLevel:8,strategy:x,to:""},k||{});var N=this.options;N.raw&&0<N.windowBits?N.windowBits=-N.windowBits:N.gzip&&0<N.windowBits&&N.windowBits<16&&(N.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new m,this.strm.avail_out=0;var A=o.deflateInit2(this.strm,N.level,N.method,N.windowBits,N.memLevel,N.strategy);if(A!==p)throw new Error(h[A]);if(N.header&&o.deflateSetHeader(this.strm,N.header),N.dictionary){var O;if(O=typeof N.dictionary=="string"?f.string2buf(N.dictionary):y.call(N.dictionary)==="[object ArrayBuffer]"?new Uint8Array(N.dictionary):N.dictionary,(A=o.deflateSetDictionary(this.strm,O))!==p)throw new Error(h[A]);this._dict_set=!0}}function _(k,N){var A=new w(N);if(A.push(k,!0),A.err)throw A.msg||h[A.err];return A.result}w.prototype.push=function(k,N){var A,O,M=this.strm,D=this.options.chunkSize;if(this.ended)return!1;O=N===~~N?N:N===!0?4:0,typeof k=="string"?M.input=f.string2buf(k):y.call(k)==="[object ArrayBuffer]"?M.input=new Uint8Array(k):M.input=k,M.next_in=0,M.avail_in=M.input.length;do{if(M.avail_out===0&&(M.output=new u.Buf8(D),M.next_out=0,M.avail_out=D),(A=o.deflate(M,O))!==1&&A!==p)return this.onEnd(A),!(this.ended=!0);M.avail_out!==0&&(M.avail_in!==0||O!==4&&O!==2)||(this.options.to==="string"?this.onData(f.buf2binstring(u.shrinkBuf(M.output,M.next_out))):this.onData(u.shrinkBuf(M.output,M.next_out)))}while((0<M.avail_in||M.avail_out===0)&&A!==1);return O===4?(A=o.deflateEnd(this.strm),this.onEnd(A),this.ended=!0,A===p):O!==2||(this.onEnd(p),!(M.avail_out=0))},w.prototype.onData=function(k){this.chunks.push(k)},w.prototype.onEnd=function(k){k===p&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=u.flattenChunks(this.chunks)),this.chunks=[],this.err=k,this.msg=this.strm.msg},s.Deflate=w,s.deflate=_,s.deflateRaw=function(k,N){return(N=N||{}).raw=!0,_(k,N)},s.gzip=function(k,N){return(N=N||{}).gzip=!0,_(k,N)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(a,i,s){var o=a("./zlib/inflate"),u=a("./utils/common"),f=a("./utils/strings"),h=a("./zlib/constants"),m=a("./zlib/messages"),y=a("./zlib/zstream"),p=a("./zlib/gzheader"),b=Object.prototype.toString;function x(w){if(!(this instanceof x))return new x(w);this.options=u.assign({chunkSize:16384,windowBits:0,to:""},w||{});var _=this.options;_.raw&&0<=_.windowBits&&_.windowBits<16&&(_.windowBits=-_.windowBits,_.windowBits===0&&(_.windowBits=-15)),!(0<=_.windowBits&&_.windowBits<16)||w&&w.windowBits||(_.windowBits+=32),15<_.windowBits&&_.windowBits<48&&(15&_.windowBits)==0&&(_.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new y,this.strm.avail_out=0;var k=o.inflateInit2(this.strm,_.windowBits);if(k!==h.Z_OK)throw new Error(m[k]);this.header=new p,o.inflateGetHeader(this.strm,this.header)}function S(w,_){var k=new x(_);if(k.push(w,!0),k.err)throw k.msg||m[k.err];return k.result}x.prototype.push=function(w,_){var k,N,A,O,M,D,B=this.strm,V=this.options.chunkSize,K=this.options.dictionary,U=!1;if(this.ended)return!1;N=_===~~_?_:_===!0?h.Z_FINISH:h.Z_NO_FLUSH,typeof w=="string"?B.input=f.binstring2buf(w):b.call(w)==="[object ArrayBuffer]"?B.input=new Uint8Array(w):B.input=w,B.next_in=0,B.avail_in=B.input.length;do{if(B.avail_out===0&&(B.output=new u.Buf8(V),B.next_out=0,B.avail_out=V),(k=o.inflate(B,h.Z_NO_FLUSH))===h.Z_NEED_DICT&&K&&(D=typeof K=="string"?f.string2buf(K):b.call(K)==="[object ArrayBuffer]"?new Uint8Array(K):K,k=o.inflateSetDictionary(this.strm,D)),k===h.Z_BUF_ERROR&&U===!0&&(k=h.Z_OK,U=!1),k!==h.Z_STREAM_END&&k!==h.Z_OK)return this.onEnd(k),!(this.ended=!0);B.next_out&&(B.avail_out!==0&&k!==h.Z_STREAM_END&&(B.avail_in!==0||N!==h.Z_FINISH&&N!==h.Z_SYNC_FLUSH)||(this.options.to==="string"?(A=f.utf8border(B.output,B.next_out),O=B.next_out-A,M=f.buf2string(B.output,A),B.next_out=O,B.avail_out=V-O,O&&u.arraySet(B.output,B.output,A,O,0),this.onData(M)):this.onData(u.shrinkBuf(B.output,B.next_out)))),B.avail_in===0&&B.avail_out===0&&(U=!0)}while((0<B.avail_in||B.avail_out===0)&&k!==h.Z_STREAM_END);return k===h.Z_STREAM_END&&(N=h.Z_FINISH),N===h.Z_FINISH?(k=o.inflateEnd(this.strm),this.onEnd(k),this.ended=!0,k===h.Z_OK):N!==h.Z_SYNC_FLUSH||(this.onEnd(h.Z_OK),!(B.avail_out=0))},x.prototype.onData=function(w){this.chunks.push(w)},x.prototype.onEnd=function(w){w===h.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=u.flattenChunks(this.chunks)),this.chunks=[],this.err=w,this.msg=this.strm.msg},s.Inflate=x,s.inflate=S,s.inflateRaw=function(w,_){return(_=_||{}).raw=!0,S(w,_)},s.ungzip=S},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(a,i,s){var o=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";s.assign=function(h){for(var m=Array.prototype.slice.call(arguments,1);m.length;){var y=m.shift();if(y){if(typeof y!="object")throw new TypeError(y+"must be non-object");for(var p in y)y.hasOwnProperty(p)&&(h[p]=y[p])}}return h},s.shrinkBuf=function(h,m){return h.length===m?h:h.subarray?h.subarray(0,m):(h.length=m,h)};var u={arraySet:function(h,m,y,p,b){if(m.subarray&&h.subarray)h.set(m.subarray(y,y+p),b);else for(var x=0;x<p;x++)h[b+x]=m[y+x]},flattenChunks:function(h){var m,y,p,b,x,S;for(m=p=0,y=h.length;m<y;m++)p+=h[m].length;for(S=new Uint8Array(p),m=b=0,y=h.length;m<y;m++)x=h[m],S.set(x,b),b+=x.length;return S}},f={arraySet:function(h,m,y,p,b){for(var x=0;x<p;x++)h[b+x]=m[y+x]},flattenChunks:function(h){return[].concat.apply([],h)}};s.setTyped=function(h){h?(s.Buf8=Uint8Array,s.Buf16=Uint16Array,s.Buf32=Int32Array,s.assign(s,u)):(s.Buf8=Array,s.Buf16=Array,s.Buf32=Array,s.assign(s,f))},s.setTyped(o)},{}],42:[function(a,i,s){var o=a("./common"),u=!0,f=!0;try{String.fromCharCode.apply(null,[0])}catch{u=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{f=!1}for(var h=new o.Buf8(256),m=0;m<256;m++)h[m]=252<=m?6:248<=m?5:240<=m?4:224<=m?3:192<=m?2:1;function y(p,b){if(b<65537&&(p.subarray&&f||!p.subarray&&u))return String.fromCharCode.apply(null,o.shrinkBuf(p,b));for(var x="",S=0;S<b;S++)x+=String.fromCharCode(p[S]);return x}h[254]=h[254]=1,s.string2buf=function(p){var b,x,S,w,_,k=p.length,N=0;for(w=0;w<k;w++)(64512&(x=p.charCodeAt(w)))==55296&&w+1<k&&(64512&(S=p.charCodeAt(w+1)))==56320&&(x=65536+(x-55296<<10)+(S-56320),w++),N+=x<128?1:x<2048?2:x<65536?3:4;for(b=new o.Buf8(N),w=_=0;_<N;w++)(64512&(x=p.charCodeAt(w)))==55296&&w+1<k&&(64512&(S=p.charCodeAt(w+1)))==56320&&(x=65536+(x-55296<<10)+(S-56320),w++),x<128?b[_++]=x:(x<2048?b[_++]=192|x>>>6:(x<65536?b[_++]=224|x>>>12:(b[_++]=240|x>>>18,b[_++]=128|x>>>12&63),b[_++]=128|x>>>6&63),b[_++]=128|63&x);return b},s.buf2binstring=function(p){return y(p,p.length)},s.binstring2buf=function(p){for(var b=new o.Buf8(p.length),x=0,S=b.length;x<S;x++)b[x]=p.charCodeAt(x);return b},s.buf2string=function(p,b){var x,S,w,_,k=b||p.length,N=new Array(2*k);for(x=S=0;x<k;)if((w=p[x++])<128)N[S++]=w;else if(4<(_=h[w]))N[S++]=65533,x+=_-1;else{for(w&=_===2?31:_===3?15:7;1<_&&x<k;)w=w<<6|63&p[x++],_--;1<_?N[S++]=65533:w<65536?N[S++]=w:(w-=65536,N[S++]=55296|w>>10&1023,N[S++]=56320|1023&w)}return y(N,S)},s.utf8border=function(p,b){var x;for((b=b||p.length)>p.length&&(b=p.length),x=b-1;0<=x&&(192&p[x])==128;)x--;return x<0||x===0?b:x+h[p[x]]>b?x:b}},{"./common":41}],43:[function(a,i,s){i.exports=function(o,u,f,h){for(var m=65535&o|0,y=o>>>16&65535|0,p=0;f!==0;){for(f-=p=2e3<f?2e3:f;y=y+(m=m+u[h++]|0)|0,--p;);m%=65521,y%=65521}return m|y<<16|0}},{}],44:[function(a,i,s){i.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(a,i,s){var o=(function(){for(var u,f=[],h=0;h<256;h++){u=h;for(var m=0;m<8;m++)u=1&u?3988292384^u>>>1:u>>>1;f[h]=u}return f})();i.exports=function(u,f,h,m){var y=o,p=m+h;u^=-1;for(var b=m;b<p;b++)u=u>>>8^y[255&(u^f[b])];return-1^u}},{}],46:[function(a,i,s){var o,u=a("../utils/common"),f=a("./trees"),h=a("./adler32"),m=a("./crc32"),y=a("./messages"),p=0,b=4,x=0,S=-2,w=-1,_=4,k=2,N=8,A=9,O=286,M=30,D=19,B=2*O+1,V=15,K=3,U=258,te=U+K+1,I=42,Z=113,E=1,q=2,$=3,X=4;function re(T,ie){return T.msg=y[ie],ie}function Y(T){return(T<<1)-(4<T?9:0)}function z(T){for(var ie=T.length;0<=--ie;)T[ie]=0}function R(T){var ie=T.state,Q=ie.pending;Q>T.avail_out&&(Q=T.avail_out),Q!==0&&(u.arraySet(T.output,ie.pending_buf,ie.pending_out,Q,T.next_out),T.next_out+=Q,ie.pending_out+=Q,T.total_out+=Q,T.avail_out-=Q,ie.pending-=Q,ie.pending===0&&(ie.pending_out=0))}function F(T,ie){f._tr_flush_block(T,0<=T.block_start?T.block_start:-1,T.strstart-T.block_start,ie),T.block_start=T.strstart,R(T.strm)}function L(T,ie){T.pending_buf[T.pending++]=ie}function le(T,ie){T.pending_buf[T.pending++]=ie>>>8&255,T.pending_buf[T.pending++]=255&ie}function oe(T,ie){var Q,G,H=T.max_chain_length,J=T.strstart,ye=T.prev_length,Se=T.nice_match,ue=T.strstart>T.w_size-te?T.strstart-(T.w_size-te):0,he=T.window,xe=T.w_mask,ke=T.prev,ne=T.strstart+U,pe=he[J+ye-1],_e=he[J+ye];T.prev_length>=T.good_match&&(H>>=2),Se>T.lookahead&&(Se=T.lookahead);do if(he[(Q=ie)+ye]===_e&&he[Q+ye-1]===pe&&he[Q]===he[J]&&he[++Q]===he[J+1]){J+=2,Q++;do;while(he[++J]===he[++Q]&&he[++J]===he[++Q]&&he[++J]===he[++Q]&&he[++J]===he[++Q]&&he[++J]===he[++Q]&&he[++J]===he[++Q]&&he[++J]===he[++Q]&&he[++J]===he[++Q]&&J<ne);if(G=U-(ne-J),J=ne-U,ye<G){if(T.match_start=ie,Se<=(ye=G))break;pe=he[J+ye-1],_e=he[J+ye]}}while((ie=ke[ie&xe])>ue&&--H!=0);return ye<=T.lookahead?ye:T.lookahead}function ve(T){var ie,Q,G,H,J,ye,Se,ue,he,xe,ke=T.w_size;do{if(H=T.window_size-T.lookahead-T.strstart,T.strstart>=ke+(ke-te)){for(u.arraySet(T.window,T.window,ke,ke,0),T.match_start-=ke,T.strstart-=ke,T.block_start-=ke,ie=Q=T.hash_size;G=T.head[--ie],T.head[ie]=ke<=G?G-ke:0,--Q;);for(ie=Q=ke;G=T.prev[--ie],T.prev[ie]=ke<=G?G-ke:0,--Q;);H+=ke}if(T.strm.avail_in===0)break;if(ye=T.strm,Se=T.window,ue=T.strstart+T.lookahead,he=H,xe=void 0,xe=ye.avail_in,he<xe&&(xe=he),Q=xe===0?0:(ye.avail_in-=xe,u.arraySet(Se,ye.input,ye.next_in,xe,ue),ye.state.wrap===1?ye.adler=h(ye.adler,Se,xe,ue):ye.state.wrap===2&&(ye.adler=m(ye.adler,Se,xe,ue)),ye.next_in+=xe,ye.total_in+=xe,xe),T.lookahead+=Q,T.lookahead+T.insert>=K)for(J=T.strstart-T.insert,T.ins_h=T.window[J],T.ins_h=(T.ins_h<<T.hash_shift^T.window[J+1])&T.hash_mask;T.insert&&(T.ins_h=(T.ins_h<<T.hash_shift^T.window[J+K-1])&T.hash_mask,T.prev[J&T.w_mask]=T.head[T.ins_h],T.head[T.ins_h]=J,J++,T.insert--,!(T.lookahead+T.insert<K)););}while(T.lookahead<te&&T.strm.avail_in!==0)}function Ce(T,ie){for(var Q,G;;){if(T.lookahead<te){if(ve(T),T.lookahead<te&&ie===p)return E;if(T.lookahead===0)break}if(Q=0,T.lookahead>=K&&(T.ins_h=(T.ins_h<<T.hash_shift^T.window[T.strstart+K-1])&T.hash_mask,Q=T.prev[T.strstart&T.w_mask]=T.head[T.ins_h],T.head[T.ins_h]=T.strstart),Q!==0&&T.strstart-Q<=T.w_size-te&&(T.match_length=oe(T,Q)),T.match_length>=K)if(G=f._tr_tally(T,T.strstart-T.match_start,T.match_length-K),T.lookahead-=T.match_length,T.match_length<=T.max_lazy_match&&T.lookahead>=K){for(T.match_length--;T.strstart++,T.ins_h=(T.ins_h<<T.hash_shift^T.window[T.strstart+K-1])&T.hash_mask,Q=T.prev[T.strstart&T.w_mask]=T.head[T.ins_h],T.head[T.ins_h]=T.strstart,--T.match_length!=0;);T.strstart++}else T.strstart+=T.match_length,T.match_length=0,T.ins_h=T.window[T.strstart],T.ins_h=(T.ins_h<<T.hash_shift^T.window[T.strstart+1])&T.hash_mask;else G=f._tr_tally(T,0,T.window[T.strstart]),T.lookahead--,T.strstart++;if(G&&(F(T,!1),T.strm.avail_out===0))return E}return T.insert=T.strstart<K-1?T.strstart:K-1,ie===b?(F(T,!0),T.strm.avail_out===0?$:X):T.last_lit&&(F(T,!1),T.strm.avail_out===0)?E:q}function Ae(T,ie){for(var Q,G,H;;){if(T.lookahead<te){if(ve(T),T.lookahead<te&&ie===p)return E;if(T.lookahead===0)break}if(Q=0,T.lookahead>=K&&(T.ins_h=(T.ins_h<<T.hash_shift^T.window[T.strstart+K-1])&T.hash_mask,Q=T.prev[T.strstart&T.w_mask]=T.head[T.ins_h],T.head[T.ins_h]=T.strstart),T.prev_length=T.match_length,T.prev_match=T.match_start,T.match_length=K-1,Q!==0&&T.prev_length<T.max_lazy_match&&T.strstart-Q<=T.w_size-te&&(T.match_length=oe(T,Q),T.match_length<=5&&(T.strategy===1||T.match_length===K&&4096<T.strstart-T.match_start)&&(T.match_length=K-1)),T.prev_length>=K&&T.match_length<=T.prev_length){for(H=T.strstart+T.lookahead-K,G=f._tr_tally(T,T.strstart-1-T.prev_match,T.prev_length-K),T.lookahead-=T.prev_length-1,T.prev_length-=2;++T.strstart<=H&&(T.ins_h=(T.ins_h<<T.hash_shift^T.window[T.strstart+K-1])&T.hash_mask,Q=T.prev[T.strstart&T.w_mask]=T.head[T.ins_h],T.head[T.ins_h]=T.strstart),--T.prev_length!=0;);if(T.match_available=0,T.match_length=K-1,T.strstart++,G&&(F(T,!1),T.strm.avail_out===0))return E}else if(T.match_available){if((G=f._tr_tally(T,0,T.window[T.strstart-1]))&&F(T,!1),T.strstart++,T.lookahead--,T.strm.avail_out===0)return E}else T.match_available=1,T.strstart++,T.lookahead--}return T.match_available&&(G=f._tr_tally(T,0,T.window[T.strstart-1]),T.match_available=0),T.insert=T.strstart<K-1?T.strstart:K-1,ie===b?(F(T,!0),T.strm.avail_out===0?$:X):T.last_lit&&(F(T,!1),T.strm.avail_out===0)?E:q}function Ne(T,ie,Q,G,H){this.good_length=T,this.max_lazy=ie,this.nice_length=Q,this.max_chain=G,this.func=H}function Ge(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=N,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new u.Buf16(2*B),this.dyn_dtree=new u.Buf16(2*(2*M+1)),this.bl_tree=new u.Buf16(2*(2*D+1)),z(this.dyn_ltree),z(this.dyn_dtree),z(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new u.Buf16(V+1),this.heap=new u.Buf16(2*O+1),z(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new u.Buf16(2*O+1),z(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function $e(T){var ie;return T&&T.state?(T.total_in=T.total_out=0,T.data_type=k,(ie=T.state).pending=0,ie.pending_out=0,ie.wrap<0&&(ie.wrap=-ie.wrap),ie.status=ie.wrap?I:Z,T.adler=ie.wrap===2?0:1,ie.last_flush=p,f._tr_init(ie),x):re(T,S)}function dt(T){var ie=$e(T);return ie===x&&(function(Q){Q.window_size=2*Q.w_size,z(Q.head),Q.max_lazy_match=o[Q.level].max_lazy,Q.good_match=o[Q.level].good_length,Q.nice_match=o[Q.level].nice_length,Q.max_chain_length=o[Q.level].max_chain,Q.strstart=0,Q.block_start=0,Q.lookahead=0,Q.insert=0,Q.match_length=Q.prev_length=K-1,Q.match_available=0,Q.ins_h=0})(T.state),ie}function ot(T,ie,Q,G,H,J){if(!T)return S;var ye=1;if(ie===w&&(ie=6),G<0?(ye=0,G=-G):15<G&&(ye=2,G-=16),H<1||A<H||Q!==N||G<8||15<G||ie<0||9<ie||J<0||_<J)return re(T,S);G===8&&(G=9);var Se=new Ge;return(T.state=Se).strm=T,Se.wrap=ye,Se.gzhead=null,Se.w_bits=G,Se.w_size=1<<Se.w_bits,Se.w_mask=Se.w_size-1,Se.hash_bits=H+7,Se.hash_size=1<<Se.hash_bits,Se.hash_mask=Se.hash_size-1,Se.hash_shift=~~((Se.hash_bits+K-1)/K),Se.window=new u.Buf8(2*Se.w_size),Se.head=new u.Buf16(Se.hash_size),Se.prev=new u.Buf16(Se.w_size),Se.lit_bufsize=1<<H+6,Se.pending_buf_size=4*Se.lit_bufsize,Se.pending_buf=new u.Buf8(Se.pending_buf_size),Se.d_buf=1*Se.lit_bufsize,Se.l_buf=3*Se.lit_bufsize,Se.level=ie,Se.strategy=J,Se.method=Q,dt(T)}o=[new Ne(0,0,0,0,function(T,ie){var Q=65535;for(Q>T.pending_buf_size-5&&(Q=T.pending_buf_size-5);;){if(T.lookahead<=1){if(ve(T),T.lookahead===0&&ie===p)return E;if(T.lookahead===0)break}T.strstart+=T.lookahead,T.lookahead=0;var G=T.block_start+Q;if((T.strstart===0||T.strstart>=G)&&(T.lookahead=T.strstart-G,T.strstart=G,F(T,!1),T.strm.avail_out===0)||T.strstart-T.block_start>=T.w_size-te&&(F(T,!1),T.strm.avail_out===0))return E}return T.insert=0,ie===b?(F(T,!0),T.strm.avail_out===0?$:X):(T.strstart>T.block_start&&(F(T,!1),T.strm.avail_out),E)}),new Ne(4,4,8,4,Ce),new Ne(4,5,16,8,Ce),new Ne(4,6,32,32,Ce),new Ne(4,4,16,16,Ae),new Ne(8,16,32,32,Ae),new Ne(8,16,128,128,Ae),new Ne(8,32,128,256,Ae),new Ne(32,128,258,1024,Ae),new Ne(32,258,258,4096,Ae)],s.deflateInit=function(T,ie){return ot(T,ie,N,15,8,0)},s.deflateInit2=ot,s.deflateReset=dt,s.deflateResetKeep=$e,s.deflateSetHeader=function(T,ie){return T&&T.state?T.state.wrap!==2?S:(T.state.gzhead=ie,x):S},s.deflate=function(T,ie){var Q,G,H,J;if(!T||!T.state||5<ie||ie<0)return T?re(T,S):S;if(G=T.state,!T.output||!T.input&&T.avail_in!==0||G.status===666&&ie!==b)return re(T,T.avail_out===0?-5:S);if(G.strm=T,Q=G.last_flush,G.last_flush=ie,G.status===I)if(G.wrap===2)T.adler=0,L(G,31),L(G,139),L(G,8),G.gzhead?(L(G,(G.gzhead.text?1:0)+(G.gzhead.hcrc?2:0)+(G.gzhead.extra?4:0)+(G.gzhead.name?8:0)+(G.gzhead.comment?16:0)),L(G,255&G.gzhead.time),L(G,G.gzhead.time>>8&255),L(G,G.gzhead.time>>16&255),L(G,G.gzhead.time>>24&255),L(G,G.level===9?2:2<=G.strategy||G.level<2?4:0),L(G,255&G.gzhead.os),G.gzhead.extra&&G.gzhead.extra.length&&(L(G,255&G.gzhead.extra.length),L(G,G.gzhead.extra.length>>8&255)),G.gzhead.hcrc&&(T.adler=m(T.adler,G.pending_buf,G.pending,0)),G.gzindex=0,G.status=69):(L(G,0),L(G,0),L(G,0),L(G,0),L(G,0),L(G,G.level===9?2:2<=G.strategy||G.level<2?4:0),L(G,3),G.status=Z);else{var ye=N+(G.w_bits-8<<4)<<8;ye|=(2<=G.strategy||G.level<2?0:G.level<6?1:G.level===6?2:3)<<6,G.strstart!==0&&(ye|=32),ye+=31-ye%31,G.status=Z,le(G,ye),G.strstart!==0&&(le(G,T.adler>>>16),le(G,65535&T.adler)),T.adler=1}if(G.status===69)if(G.gzhead.extra){for(H=G.pending;G.gzindex<(65535&G.gzhead.extra.length)&&(G.pending!==G.pending_buf_size||(G.gzhead.hcrc&&G.pending>H&&(T.adler=m(T.adler,G.pending_buf,G.pending-H,H)),R(T),H=G.pending,G.pending!==G.pending_buf_size));)L(G,255&G.gzhead.extra[G.gzindex]),G.gzindex++;G.gzhead.hcrc&&G.pending>H&&(T.adler=m(T.adler,G.pending_buf,G.pending-H,H)),G.gzindex===G.gzhead.extra.length&&(G.gzindex=0,G.status=73)}else G.status=73;if(G.status===73)if(G.gzhead.name){H=G.pending;do{if(G.pending===G.pending_buf_size&&(G.gzhead.hcrc&&G.pending>H&&(T.adler=m(T.adler,G.pending_buf,G.pending-H,H)),R(T),H=G.pending,G.pending===G.pending_buf_size)){J=1;break}J=G.gzindex<G.gzhead.name.length?255&G.gzhead.name.charCodeAt(G.gzindex++):0,L(G,J)}while(J!==0);G.gzhead.hcrc&&G.pending>H&&(T.adler=m(T.adler,G.pending_buf,G.pending-H,H)),J===0&&(G.gzindex=0,G.status=91)}else G.status=91;if(G.status===91)if(G.gzhead.comment){H=G.pending;do{if(G.pending===G.pending_buf_size&&(G.gzhead.hcrc&&G.pending>H&&(T.adler=m(T.adler,G.pending_buf,G.pending-H,H)),R(T),H=G.pending,G.pending===G.pending_buf_size)){J=1;break}J=G.gzindex<G.gzhead.comment.length?255&G.gzhead.comment.charCodeAt(G.gzindex++):0,L(G,J)}while(J!==0);G.gzhead.hcrc&&G.pending>H&&(T.adler=m(T.adler,G.pending_buf,G.pending-H,H)),J===0&&(G.status=103)}else G.status=103;if(G.status===103&&(G.gzhead.hcrc?(G.pending+2>G.pending_buf_size&&R(T),G.pending+2<=G.pending_buf_size&&(L(G,255&T.adler),L(G,T.adler>>8&255),T.adler=0,G.status=Z)):G.status=Z),G.pending!==0){if(R(T),T.avail_out===0)return G.last_flush=-1,x}else if(T.avail_in===0&&Y(ie)<=Y(Q)&&ie!==b)return re(T,-5);if(G.status===666&&T.avail_in!==0)return re(T,-5);if(T.avail_in!==0||G.lookahead!==0||ie!==p&&G.status!==666){var Se=G.strategy===2?(function(ue,he){for(var xe;;){if(ue.lookahead===0&&(ve(ue),ue.lookahead===0)){if(he===p)return E;break}if(ue.match_length=0,xe=f._tr_tally(ue,0,ue.window[ue.strstart]),ue.lookahead--,ue.strstart++,xe&&(F(ue,!1),ue.strm.avail_out===0))return E}return ue.insert=0,he===b?(F(ue,!0),ue.strm.avail_out===0?$:X):ue.last_lit&&(F(ue,!1),ue.strm.avail_out===0)?E:q})(G,ie):G.strategy===3?(function(ue,he){for(var xe,ke,ne,pe,_e=ue.window;;){if(ue.lookahead<=U){if(ve(ue),ue.lookahead<=U&&he===p)return E;if(ue.lookahead===0)break}if(ue.match_length=0,ue.lookahead>=K&&0<ue.strstart&&(ke=_e[ne=ue.strstart-1])===_e[++ne]&&ke===_e[++ne]&&ke===_e[++ne]){pe=ue.strstart+U;do;while(ke===_e[++ne]&&ke===_e[++ne]&&ke===_e[++ne]&&ke===_e[++ne]&&ke===_e[++ne]&&ke===_e[++ne]&&ke===_e[++ne]&&ke===_e[++ne]&&ne<pe);ue.match_length=U-(pe-ne),ue.match_length>ue.lookahead&&(ue.match_length=ue.lookahead)}if(ue.match_length>=K?(xe=f._tr_tally(ue,1,ue.match_length-K),ue.lookahead-=ue.match_length,ue.strstart+=ue.match_length,ue.match_length=0):(xe=f._tr_tally(ue,0,ue.window[ue.strstart]),ue.lookahead--,ue.strstart++),xe&&(F(ue,!1),ue.strm.avail_out===0))return E}return ue.insert=0,he===b?(F(ue,!0),ue.strm.avail_out===0?$:X):ue.last_lit&&(F(ue,!1),ue.strm.avail_out===0)?E:q})(G,ie):o[G.level].func(G,ie);if(Se!==$&&Se!==X||(G.status=666),Se===E||Se===$)return T.avail_out===0&&(G.last_flush=-1),x;if(Se===q&&(ie===1?f._tr_align(G):ie!==5&&(f._tr_stored_block(G,0,0,!1),ie===3&&(z(G.head),G.lookahead===0&&(G.strstart=0,G.block_start=0,G.insert=0))),R(T),T.avail_out===0))return G.last_flush=-1,x}return ie!==b?x:G.wrap<=0?1:(G.wrap===2?(L(G,255&T.adler),L(G,T.adler>>8&255),L(G,T.adler>>16&255),L(G,T.adler>>24&255),L(G,255&T.total_in),L(G,T.total_in>>8&255),L(G,T.total_in>>16&255),L(G,T.total_in>>24&255)):(le(G,T.adler>>>16),le(G,65535&T.adler)),R(T),0<G.wrap&&(G.wrap=-G.wrap),G.pending!==0?x:1)},s.deflateEnd=function(T){var ie;return T&&T.state?(ie=T.state.status)!==I&&ie!==69&&ie!==73&&ie!==91&&ie!==103&&ie!==Z&&ie!==666?re(T,S):(T.state=null,ie===Z?re(T,-3):x):S},s.deflateSetDictionary=function(T,ie){var Q,G,H,J,ye,Se,ue,he,xe=ie.length;if(!T||!T.state||(J=(Q=T.state).wrap)===2||J===1&&Q.status!==I||Q.lookahead)return S;for(J===1&&(T.adler=h(T.adler,ie,xe,0)),Q.wrap=0,xe>=Q.w_size&&(J===0&&(z(Q.head),Q.strstart=0,Q.block_start=0,Q.insert=0),he=new u.Buf8(Q.w_size),u.arraySet(he,ie,xe-Q.w_size,Q.w_size,0),ie=he,xe=Q.w_size),ye=T.avail_in,Se=T.next_in,ue=T.input,T.avail_in=xe,T.next_in=0,T.input=ie,ve(Q);Q.lookahead>=K;){for(G=Q.strstart,H=Q.lookahead-(K-1);Q.ins_h=(Q.ins_h<<Q.hash_shift^Q.window[G+K-1])&Q.hash_mask,Q.prev[G&Q.w_mask]=Q.head[Q.ins_h],Q.head[Q.ins_h]=G,G++,--H;);Q.strstart=G,Q.lookahead=K-1,ve(Q)}return Q.strstart+=Q.lookahead,Q.block_start=Q.strstart,Q.insert=Q.lookahead,Q.lookahead=0,Q.match_length=Q.prev_length=K-1,Q.match_available=0,T.next_in=Se,T.input=ue,T.avail_in=ye,Q.wrap=J,x},s.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(a,i,s){i.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(a,i,s){i.exports=function(o,u){var f,h,m,y,p,b,x,S,w,_,k,N,A,O,M,D,B,V,K,U,te,I,Z,E,q;f=o.state,h=o.next_in,E=o.input,m=h+(o.avail_in-5),y=o.next_out,q=o.output,p=y-(u-o.avail_out),b=y+(o.avail_out-257),x=f.dmax,S=f.wsize,w=f.whave,_=f.wnext,k=f.window,N=f.hold,A=f.bits,O=f.lencode,M=f.distcode,D=(1<<f.lenbits)-1,B=(1<<f.distbits)-1;e:do{A<15&&(N+=E[h++]<<A,A+=8,N+=E[h++]<<A,A+=8),V=O[N&D];t:for(;;){if(N>>>=K=V>>>24,A-=K,(K=V>>>16&255)===0)q[y++]=65535&V;else{if(!(16&K)){if((64&K)==0){V=O[(65535&V)+(N&(1<<K)-1)];continue t}if(32&K){f.mode=12;break e}o.msg="invalid literal/length code",f.mode=30;break e}U=65535&V,(K&=15)&&(A<K&&(N+=E[h++]<<A,A+=8),U+=N&(1<<K)-1,N>>>=K,A-=K),A<15&&(N+=E[h++]<<A,A+=8,N+=E[h++]<<A,A+=8),V=M[N&B];n:for(;;){if(N>>>=K=V>>>24,A-=K,!(16&(K=V>>>16&255))){if((64&K)==0){V=M[(65535&V)+(N&(1<<K)-1)];continue n}o.msg="invalid distance code",f.mode=30;break e}if(te=65535&V,A<(K&=15)&&(N+=E[h++]<<A,(A+=8)<K&&(N+=E[h++]<<A,A+=8)),x<(te+=N&(1<<K)-1)){o.msg="invalid distance too far back",f.mode=30;break e}if(N>>>=K,A-=K,(K=y-p)<te){if(w<(K=te-K)&&f.sane){o.msg="invalid distance too far back",f.mode=30;break e}if(Z=k,(I=0)===_){if(I+=S-K,K<U){for(U-=K;q[y++]=k[I++],--K;);I=y-te,Z=q}}else if(_<K){if(I+=S+_-K,(K-=_)<U){for(U-=K;q[y++]=k[I++],--K;);if(I=0,_<U){for(U-=K=_;q[y++]=k[I++],--K;);I=y-te,Z=q}}}else if(I+=_-K,K<U){for(U-=K;q[y++]=k[I++],--K;);I=y-te,Z=q}for(;2<U;)q[y++]=Z[I++],q[y++]=Z[I++],q[y++]=Z[I++],U-=3;U&&(q[y++]=Z[I++],1<U&&(q[y++]=Z[I++]))}else{for(I=y-te;q[y++]=q[I++],q[y++]=q[I++],q[y++]=q[I++],2<(U-=3););U&&(q[y++]=q[I++],1<U&&(q[y++]=q[I++]))}break}}break}}while(h<m&&y<b);h-=U=A>>3,N&=(1<<(A-=U<<3))-1,o.next_in=h,o.next_out=y,o.avail_in=h<m?m-h+5:5-(h-m),o.avail_out=y<b?b-y+257:257-(y-b),f.hold=N,f.bits=A}},{}],49:[function(a,i,s){var o=a("../utils/common"),u=a("./adler32"),f=a("./crc32"),h=a("./inffast"),m=a("./inftrees"),y=1,p=2,b=0,x=-2,S=1,w=852,_=592;function k(I){return(I>>>24&255)+(I>>>8&65280)+((65280&I)<<8)+((255&I)<<24)}function N(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new o.Buf16(320),this.work=new o.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function A(I){var Z;return I&&I.state?(Z=I.state,I.total_in=I.total_out=Z.total=0,I.msg="",Z.wrap&&(I.adler=1&Z.wrap),Z.mode=S,Z.last=0,Z.havedict=0,Z.dmax=32768,Z.head=null,Z.hold=0,Z.bits=0,Z.lencode=Z.lendyn=new o.Buf32(w),Z.distcode=Z.distdyn=new o.Buf32(_),Z.sane=1,Z.back=-1,b):x}function O(I){var Z;return I&&I.state?((Z=I.state).wsize=0,Z.whave=0,Z.wnext=0,A(I)):x}function M(I,Z){var E,q;return I&&I.state?(q=I.state,Z<0?(E=0,Z=-Z):(E=1+(Z>>4),Z<48&&(Z&=15)),Z&&(Z<8||15<Z)?x:(q.window!==null&&q.wbits!==Z&&(q.window=null),q.wrap=E,q.wbits=Z,O(I))):x}function D(I,Z){var E,q;return I?(q=new N,(I.state=q).window=null,(E=M(I,Z))!==b&&(I.state=null),E):x}var B,V,K=!0;function U(I){if(K){var Z;for(B=new o.Buf32(512),V=new o.Buf32(32),Z=0;Z<144;)I.lens[Z++]=8;for(;Z<256;)I.lens[Z++]=9;for(;Z<280;)I.lens[Z++]=7;for(;Z<288;)I.lens[Z++]=8;for(m(y,I.lens,0,288,B,0,I.work,{bits:9}),Z=0;Z<32;)I.lens[Z++]=5;m(p,I.lens,0,32,V,0,I.work,{bits:5}),K=!1}I.lencode=B,I.lenbits=9,I.distcode=V,I.distbits=5}function te(I,Z,E,q){var $,X=I.state;return X.window===null&&(X.wsize=1<<X.wbits,X.wnext=0,X.whave=0,X.window=new o.Buf8(X.wsize)),q>=X.wsize?(o.arraySet(X.window,Z,E-X.wsize,X.wsize,0),X.wnext=0,X.whave=X.wsize):(q<($=X.wsize-X.wnext)&&($=q),o.arraySet(X.window,Z,E-q,$,X.wnext),(q-=$)?(o.arraySet(X.window,Z,E-q,q,0),X.wnext=q,X.whave=X.wsize):(X.wnext+=$,X.wnext===X.wsize&&(X.wnext=0),X.whave<X.wsize&&(X.whave+=$))),0}s.inflateReset=O,s.inflateReset2=M,s.inflateResetKeep=A,s.inflateInit=function(I){return D(I,15)},s.inflateInit2=D,s.inflate=function(I,Z){var E,q,$,X,re,Y,z,R,F,L,le,oe,ve,Ce,Ae,Ne,Ge,$e,dt,ot,T,ie,Q,G,H=0,J=new o.Buf8(4),ye=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!I||!I.state||!I.output||!I.input&&I.avail_in!==0)return x;(E=I.state).mode===12&&(E.mode=13),re=I.next_out,$=I.output,z=I.avail_out,X=I.next_in,q=I.input,Y=I.avail_in,R=E.hold,F=E.bits,L=Y,le=z,ie=b;e:for(;;)switch(E.mode){case S:if(E.wrap===0){E.mode=13;break}for(;F<16;){if(Y===0)break e;Y--,R+=q[X++]<<F,F+=8}if(2&E.wrap&&R===35615){J[E.check=0]=255&R,J[1]=R>>>8&255,E.check=f(E.check,J,2,0),F=R=0,E.mode=2;break}if(E.flags=0,E.head&&(E.head.done=!1),!(1&E.wrap)||(((255&R)<<8)+(R>>8))%31){I.msg="incorrect header check",E.mode=30;break}if((15&R)!=8){I.msg="unknown compression method",E.mode=30;break}if(F-=4,T=8+(15&(R>>>=4)),E.wbits===0)E.wbits=T;else if(T>E.wbits){I.msg="invalid window size",E.mode=30;break}E.dmax=1<<T,I.adler=E.check=1,E.mode=512&R?10:12,F=R=0;break;case 2:for(;F<16;){if(Y===0)break e;Y--,R+=q[X++]<<F,F+=8}if(E.flags=R,(255&E.flags)!=8){I.msg="unknown compression method",E.mode=30;break}if(57344&E.flags){I.msg="unknown header flags set",E.mode=30;break}E.head&&(E.head.text=R>>8&1),512&E.flags&&(J[0]=255&R,J[1]=R>>>8&255,E.check=f(E.check,J,2,0)),F=R=0,E.mode=3;case 3:for(;F<32;){if(Y===0)break e;Y--,R+=q[X++]<<F,F+=8}E.head&&(E.head.time=R),512&E.flags&&(J[0]=255&R,J[1]=R>>>8&255,J[2]=R>>>16&255,J[3]=R>>>24&255,E.check=f(E.check,J,4,0)),F=R=0,E.mode=4;case 4:for(;F<16;){if(Y===0)break e;Y--,R+=q[X++]<<F,F+=8}E.head&&(E.head.xflags=255&R,E.head.os=R>>8),512&E.flags&&(J[0]=255&R,J[1]=R>>>8&255,E.check=f(E.check,J,2,0)),F=R=0,E.mode=5;case 5:if(1024&E.flags){for(;F<16;){if(Y===0)break e;Y--,R+=q[X++]<<F,F+=8}E.length=R,E.head&&(E.head.extra_len=R),512&E.flags&&(J[0]=255&R,J[1]=R>>>8&255,E.check=f(E.check,J,2,0)),F=R=0}else E.head&&(E.head.extra=null);E.mode=6;case 6:if(1024&E.flags&&(Y<(oe=E.length)&&(oe=Y),oe&&(E.head&&(T=E.head.extra_len-E.length,E.head.extra||(E.head.extra=new Array(E.head.extra_len)),o.arraySet(E.head.extra,q,X,oe,T)),512&E.flags&&(E.check=f(E.check,q,oe,X)),Y-=oe,X+=oe,E.length-=oe),E.length))break e;E.length=0,E.mode=7;case 7:if(2048&E.flags){if(Y===0)break e;for(oe=0;T=q[X+oe++],E.head&&T&&E.length<65536&&(E.head.name+=String.fromCharCode(T)),T&&oe<Y;);if(512&E.flags&&(E.check=f(E.check,q,oe,X)),Y-=oe,X+=oe,T)break e}else E.head&&(E.head.name=null);E.length=0,E.mode=8;case 8:if(4096&E.flags){if(Y===0)break e;for(oe=0;T=q[X+oe++],E.head&&T&&E.length<65536&&(E.head.comment+=String.fromCharCode(T)),T&&oe<Y;);if(512&E.flags&&(E.check=f(E.check,q,oe,X)),Y-=oe,X+=oe,T)break e}else E.head&&(E.head.comment=null);E.mode=9;case 9:if(512&E.flags){for(;F<16;){if(Y===0)break e;Y--,R+=q[X++]<<F,F+=8}if(R!==(65535&E.check)){I.msg="header crc mismatch",E.mode=30;break}F=R=0}E.head&&(E.head.hcrc=E.flags>>9&1,E.head.done=!0),I.adler=E.check=0,E.mode=12;break;case 10:for(;F<32;){if(Y===0)break e;Y--,R+=q[X++]<<F,F+=8}I.adler=E.check=k(R),F=R=0,E.mode=11;case 11:if(E.havedict===0)return I.next_out=re,I.avail_out=z,I.next_in=X,I.avail_in=Y,E.hold=R,E.bits=F,2;I.adler=E.check=1,E.mode=12;case 12:if(Z===5||Z===6)break e;case 13:if(E.last){R>>>=7&F,F-=7&F,E.mode=27;break}for(;F<3;){if(Y===0)break e;Y--,R+=q[X++]<<F,F+=8}switch(E.last=1&R,F-=1,3&(R>>>=1)){case 0:E.mode=14;break;case 1:if(U(E),E.mode=20,Z!==6)break;R>>>=2,F-=2;break e;case 2:E.mode=17;break;case 3:I.msg="invalid block type",E.mode=30}R>>>=2,F-=2;break;case 14:for(R>>>=7&F,F-=7&F;F<32;){if(Y===0)break e;Y--,R+=q[X++]<<F,F+=8}if((65535&R)!=(R>>>16^65535)){I.msg="invalid stored block lengths",E.mode=30;break}if(E.length=65535&R,F=R=0,E.mode=15,Z===6)break e;case 15:E.mode=16;case 16:if(oe=E.length){if(Y<oe&&(oe=Y),z<oe&&(oe=z),oe===0)break e;o.arraySet($,q,X,oe,re),Y-=oe,X+=oe,z-=oe,re+=oe,E.length-=oe;break}E.mode=12;break;case 17:for(;F<14;){if(Y===0)break e;Y--,R+=q[X++]<<F,F+=8}if(E.nlen=257+(31&R),R>>>=5,F-=5,E.ndist=1+(31&R),R>>>=5,F-=5,E.ncode=4+(15&R),R>>>=4,F-=4,286<E.nlen||30<E.ndist){I.msg="too many length or distance symbols",E.mode=30;break}E.have=0,E.mode=18;case 18:for(;E.have<E.ncode;){for(;F<3;){if(Y===0)break e;Y--,R+=q[X++]<<F,F+=8}E.lens[ye[E.have++]]=7&R,R>>>=3,F-=3}for(;E.have<19;)E.lens[ye[E.have++]]=0;if(E.lencode=E.lendyn,E.lenbits=7,Q={bits:E.lenbits},ie=m(0,E.lens,0,19,E.lencode,0,E.work,Q),E.lenbits=Q.bits,ie){I.msg="invalid code lengths set",E.mode=30;break}E.have=0,E.mode=19;case 19:for(;E.have<E.nlen+E.ndist;){for(;Ne=(H=E.lencode[R&(1<<E.lenbits)-1])>>>16&255,Ge=65535&H,!((Ae=H>>>24)<=F);){if(Y===0)break e;Y--,R+=q[X++]<<F,F+=8}if(Ge<16)R>>>=Ae,F-=Ae,E.lens[E.have++]=Ge;else{if(Ge===16){for(G=Ae+2;F<G;){if(Y===0)break e;Y--,R+=q[X++]<<F,F+=8}if(R>>>=Ae,F-=Ae,E.have===0){I.msg="invalid bit length repeat",E.mode=30;break}T=E.lens[E.have-1],oe=3+(3&R),R>>>=2,F-=2}else if(Ge===17){for(G=Ae+3;F<G;){if(Y===0)break e;Y--,R+=q[X++]<<F,F+=8}F-=Ae,T=0,oe=3+(7&(R>>>=Ae)),R>>>=3,F-=3}else{for(G=Ae+7;F<G;){if(Y===0)break e;Y--,R+=q[X++]<<F,F+=8}F-=Ae,T=0,oe=11+(127&(R>>>=Ae)),R>>>=7,F-=7}if(E.have+oe>E.nlen+E.ndist){I.msg="invalid bit length repeat",E.mode=30;break}for(;oe--;)E.lens[E.have++]=T}}if(E.mode===30)break;if(E.lens[256]===0){I.msg="invalid code -- missing end-of-block",E.mode=30;break}if(E.lenbits=9,Q={bits:E.lenbits},ie=m(y,E.lens,0,E.nlen,E.lencode,0,E.work,Q),E.lenbits=Q.bits,ie){I.msg="invalid literal/lengths set",E.mode=30;break}if(E.distbits=6,E.distcode=E.distdyn,Q={bits:E.distbits},ie=m(p,E.lens,E.nlen,E.ndist,E.distcode,0,E.work,Q),E.distbits=Q.bits,ie){I.msg="invalid distances set",E.mode=30;break}if(E.mode=20,Z===6)break e;case 20:E.mode=21;case 21:if(6<=Y&&258<=z){I.next_out=re,I.avail_out=z,I.next_in=X,I.avail_in=Y,E.hold=R,E.bits=F,h(I,le),re=I.next_out,$=I.output,z=I.avail_out,X=I.next_in,q=I.input,Y=I.avail_in,R=E.hold,F=E.bits,E.mode===12&&(E.back=-1);break}for(E.back=0;Ne=(H=E.lencode[R&(1<<E.lenbits)-1])>>>16&255,Ge=65535&H,!((Ae=H>>>24)<=F);){if(Y===0)break e;Y--,R+=q[X++]<<F,F+=8}if(Ne&&(240&Ne)==0){for($e=Ae,dt=Ne,ot=Ge;Ne=(H=E.lencode[ot+((R&(1<<$e+dt)-1)>>$e)])>>>16&255,Ge=65535&H,!($e+(Ae=H>>>24)<=F);){if(Y===0)break e;Y--,R+=q[X++]<<F,F+=8}R>>>=$e,F-=$e,E.back+=$e}if(R>>>=Ae,F-=Ae,E.back+=Ae,E.length=Ge,Ne===0){E.mode=26;break}if(32&Ne){E.back=-1,E.mode=12;break}if(64&Ne){I.msg="invalid literal/length code",E.mode=30;break}E.extra=15&Ne,E.mode=22;case 22:if(E.extra){for(G=E.extra;F<G;){if(Y===0)break e;Y--,R+=q[X++]<<F,F+=8}E.length+=R&(1<<E.extra)-1,R>>>=E.extra,F-=E.extra,E.back+=E.extra}E.was=E.length,E.mode=23;case 23:for(;Ne=(H=E.distcode[R&(1<<E.distbits)-1])>>>16&255,Ge=65535&H,!((Ae=H>>>24)<=F);){if(Y===0)break e;Y--,R+=q[X++]<<F,F+=8}if((240&Ne)==0){for($e=Ae,dt=Ne,ot=Ge;Ne=(H=E.distcode[ot+((R&(1<<$e+dt)-1)>>$e)])>>>16&255,Ge=65535&H,!($e+(Ae=H>>>24)<=F);){if(Y===0)break e;Y--,R+=q[X++]<<F,F+=8}R>>>=$e,F-=$e,E.back+=$e}if(R>>>=Ae,F-=Ae,E.back+=Ae,64&Ne){I.msg="invalid distance code",E.mode=30;break}E.offset=Ge,E.extra=15&Ne,E.mode=24;case 24:if(E.extra){for(G=E.extra;F<G;){if(Y===0)break e;Y--,R+=q[X++]<<F,F+=8}E.offset+=R&(1<<E.extra)-1,R>>>=E.extra,F-=E.extra,E.back+=E.extra}if(E.offset>E.dmax){I.msg="invalid distance too far back",E.mode=30;break}E.mode=25;case 25:if(z===0)break e;if(oe=le-z,E.offset>oe){if((oe=E.offset-oe)>E.whave&&E.sane){I.msg="invalid distance too far back",E.mode=30;break}ve=oe>E.wnext?(oe-=E.wnext,E.wsize-oe):E.wnext-oe,oe>E.length&&(oe=E.length),Ce=E.window}else Ce=$,ve=re-E.offset,oe=E.length;for(z<oe&&(oe=z),z-=oe,E.length-=oe;$[re++]=Ce[ve++],--oe;);E.length===0&&(E.mode=21);break;case 26:if(z===0)break e;$[re++]=E.length,z--,E.mode=21;break;case 27:if(E.wrap){for(;F<32;){if(Y===0)break e;Y--,R|=q[X++]<<F,F+=8}if(le-=z,I.total_out+=le,E.total+=le,le&&(I.adler=E.check=E.flags?f(E.check,$,le,re-le):u(E.check,$,le,re-le)),le=z,(E.flags?R:k(R))!==E.check){I.msg="incorrect data check",E.mode=30;break}F=R=0}E.mode=28;case 28:if(E.wrap&&E.flags){for(;F<32;){if(Y===0)break e;Y--,R+=q[X++]<<F,F+=8}if(R!==(4294967295&E.total)){I.msg="incorrect length check",E.mode=30;break}F=R=0}E.mode=29;case 29:ie=1;break e;case 30:ie=-3;break e;case 31:return-4;default:return x}return I.next_out=re,I.avail_out=z,I.next_in=X,I.avail_in=Y,E.hold=R,E.bits=F,(E.wsize||le!==I.avail_out&&E.mode<30&&(E.mode<27||Z!==4))&&te(I,I.output,I.next_out,le-I.avail_out)?(E.mode=31,-4):(L-=I.avail_in,le-=I.avail_out,I.total_in+=L,I.total_out+=le,E.total+=le,E.wrap&&le&&(I.adler=E.check=E.flags?f(E.check,$,le,I.next_out-le):u(E.check,$,le,I.next_out-le)),I.data_type=E.bits+(E.last?64:0)+(E.mode===12?128:0)+(E.mode===20||E.mode===15?256:0),(L==0&&le===0||Z===4)&&ie===b&&(ie=-5),ie)},s.inflateEnd=function(I){if(!I||!I.state)return x;var Z=I.state;return Z.window&&(Z.window=null),I.state=null,b},s.inflateGetHeader=function(I,Z){var E;return I&&I.state?(2&(E=I.state).wrap)==0?x:((E.head=Z).done=!1,b):x},s.inflateSetDictionary=function(I,Z){var E,q=Z.length;return I&&I.state?(E=I.state).wrap!==0&&E.mode!==11?x:E.mode===11&&u(1,Z,q,0)!==E.check?-3:te(I,Z,q,q)?(E.mode=31,-4):(E.havedict=1,b):x},s.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(a,i,s){var o=a("../utils/common"),u=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],f=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],h=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],m=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];i.exports=function(y,p,b,x,S,w,_,k){var N,A,O,M,D,B,V,K,U,te=k.bits,I=0,Z=0,E=0,q=0,$=0,X=0,re=0,Y=0,z=0,R=0,F=null,L=0,le=new o.Buf16(16),oe=new o.Buf16(16),ve=null,Ce=0;for(I=0;I<=15;I++)le[I]=0;for(Z=0;Z<x;Z++)le[p[b+Z]]++;for($=te,q=15;1<=q&&le[q]===0;q--);if(q<$&&($=q),q===0)return S[w++]=20971520,S[w++]=20971520,k.bits=1,0;for(E=1;E<q&&le[E]===0;E++);for($<E&&($=E),I=Y=1;I<=15;I++)if(Y<<=1,(Y-=le[I])<0)return-1;if(0<Y&&(y===0||q!==1))return-1;for(oe[1]=0,I=1;I<15;I++)oe[I+1]=oe[I]+le[I];for(Z=0;Z<x;Z++)p[b+Z]!==0&&(_[oe[p[b+Z]]++]=Z);if(B=y===0?(F=ve=_,19):y===1?(F=u,L-=257,ve=f,Ce-=257,256):(F=h,ve=m,-1),I=E,D=w,re=Z=R=0,O=-1,M=(z=1<<(X=$))-1,y===1&&852<z||y===2&&592<z)return 1;for(;;){for(V=I-re,U=_[Z]<B?(K=0,_[Z]):_[Z]>B?(K=ve[Ce+_[Z]],F[L+_[Z]]):(K=96,0),N=1<<I-re,E=A=1<<X;S[D+(R>>re)+(A-=N)]=V<<24|K<<16|U|0,A!==0;);for(N=1<<I-1;R&N;)N>>=1;if(N!==0?(R&=N-1,R+=N):R=0,Z++,--le[I]==0){if(I===q)break;I=p[b+_[Z]]}if($<I&&(R&M)!==O){for(re===0&&(re=$),D+=E,Y=1<<(X=I-re);X+re<q&&!((Y-=le[X+re])<=0);)X++,Y<<=1;if(z+=1<<X,y===1&&852<z||y===2&&592<z)return 1;S[O=R&M]=$<<24|X<<16|D-w|0}}return R!==0&&(S[D+R]=I-re<<24|64<<16|0),k.bits=$,0}},{"../utils/common":41}],51:[function(a,i,s){i.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(a,i,s){var o=a("../utils/common"),u=0,f=1;function h(H){for(var J=H.length;0<=--J;)H[J]=0}var m=0,y=29,p=256,b=p+1+y,x=30,S=19,w=2*b+1,_=15,k=16,N=7,A=256,O=16,M=17,D=18,B=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],V=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],K=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],U=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],te=new Array(2*(b+2));h(te);var I=new Array(2*x);h(I);var Z=new Array(512);h(Z);var E=new Array(256);h(E);var q=new Array(y);h(q);var $,X,re,Y=new Array(x);function z(H,J,ye,Se,ue){this.static_tree=H,this.extra_bits=J,this.extra_base=ye,this.elems=Se,this.max_length=ue,this.has_stree=H&&H.length}function R(H,J){this.dyn_tree=H,this.max_code=0,this.stat_desc=J}function F(H){return H<256?Z[H]:Z[256+(H>>>7)]}function L(H,J){H.pending_buf[H.pending++]=255&J,H.pending_buf[H.pending++]=J>>>8&255}function le(H,J,ye){H.bi_valid>k-ye?(H.bi_buf|=J<<H.bi_valid&65535,L(H,H.bi_buf),H.bi_buf=J>>k-H.bi_valid,H.bi_valid+=ye-k):(H.bi_buf|=J<<H.bi_valid&65535,H.bi_valid+=ye)}function oe(H,J,ye){le(H,ye[2*J],ye[2*J+1])}function ve(H,J){for(var ye=0;ye|=1&H,H>>>=1,ye<<=1,0<--J;);return ye>>>1}function Ce(H,J,ye){var Se,ue,he=new Array(_+1),xe=0;for(Se=1;Se<=_;Se++)he[Se]=xe=xe+ye[Se-1]<<1;for(ue=0;ue<=J;ue++){var ke=H[2*ue+1];ke!==0&&(H[2*ue]=ve(he[ke]++,ke))}}function Ae(H){var J;for(J=0;J<b;J++)H.dyn_ltree[2*J]=0;for(J=0;J<x;J++)H.dyn_dtree[2*J]=0;for(J=0;J<S;J++)H.bl_tree[2*J]=0;H.dyn_ltree[2*A]=1,H.opt_len=H.static_len=0,H.last_lit=H.matches=0}function Ne(H){8<H.bi_valid?L(H,H.bi_buf):0<H.bi_valid&&(H.pending_buf[H.pending++]=H.bi_buf),H.bi_buf=0,H.bi_valid=0}function Ge(H,J,ye,Se){var ue=2*J,he=2*ye;return H[ue]<H[he]||H[ue]===H[he]&&Se[J]<=Se[ye]}function $e(H,J,ye){for(var Se=H.heap[ye],ue=ye<<1;ue<=H.heap_len&&(ue<H.heap_len&&Ge(J,H.heap[ue+1],H.heap[ue],H.depth)&&ue++,!Ge(J,Se,H.heap[ue],H.depth));)H.heap[ye]=H.heap[ue],ye=ue,ue<<=1;H.heap[ye]=Se}function dt(H,J,ye){var Se,ue,he,xe,ke=0;if(H.last_lit!==0)for(;Se=H.pending_buf[H.d_buf+2*ke]<<8|H.pending_buf[H.d_buf+2*ke+1],ue=H.pending_buf[H.l_buf+ke],ke++,Se===0?oe(H,ue,J):(oe(H,(he=E[ue])+p+1,J),(xe=B[he])!==0&&le(H,ue-=q[he],xe),oe(H,he=F(--Se),ye),(xe=V[he])!==0&&le(H,Se-=Y[he],xe)),ke<H.last_lit;);oe(H,A,J)}function ot(H,J){var ye,Se,ue,he=J.dyn_tree,xe=J.stat_desc.static_tree,ke=J.stat_desc.has_stree,ne=J.stat_desc.elems,pe=-1;for(H.heap_len=0,H.heap_max=w,ye=0;ye<ne;ye++)he[2*ye]!==0?(H.heap[++H.heap_len]=pe=ye,H.depth[ye]=0):he[2*ye+1]=0;for(;H.heap_len<2;)he[2*(ue=H.heap[++H.heap_len]=pe<2?++pe:0)]=1,H.depth[ue]=0,H.opt_len--,ke&&(H.static_len-=xe[2*ue+1]);for(J.max_code=pe,ye=H.heap_len>>1;1<=ye;ye--)$e(H,he,ye);for(ue=ne;ye=H.heap[1],H.heap[1]=H.heap[H.heap_len--],$e(H,he,1),Se=H.heap[1],H.heap[--H.heap_max]=ye,H.heap[--H.heap_max]=Se,he[2*ue]=he[2*ye]+he[2*Se],H.depth[ue]=(H.depth[ye]>=H.depth[Se]?H.depth[ye]:H.depth[Se])+1,he[2*ye+1]=he[2*Se+1]=ue,H.heap[1]=ue++,$e(H,he,1),2<=H.heap_len;);H.heap[--H.heap_max]=H.heap[1],(function(_e,se){var Te,He,ht,Ue,at,$t,We=se.dyn_tree,Kn=se.max_code,wn=se.stat_desc.static_tree,yu=se.stat_desc.has_stree,ri=se.stat_desc.extra_bits,Sa=se.stat_desc.extra_base,nr=se.stat_desc.max_length,zn=0;for(Ue=0;Ue<=_;Ue++)_e.bl_count[Ue]=0;for(We[2*_e.heap[_e.heap_max]+1]=0,Te=_e.heap_max+1;Te<w;Te++)nr<(Ue=We[2*We[2*(He=_e.heap[Te])+1]+1]+1)&&(Ue=nr,zn++),We[2*He+1]=Ue,Kn<He||(_e.bl_count[Ue]++,at=0,Sa<=He&&(at=ri[He-Sa]),$t=We[2*He],_e.opt_len+=$t*(Ue+at),yu&&(_e.static_len+=$t*(wn[2*He+1]+at)));if(zn!==0){do{for(Ue=nr-1;_e.bl_count[Ue]===0;)Ue--;_e.bl_count[Ue]--,_e.bl_count[Ue+1]+=2,_e.bl_count[nr]--,zn-=2}while(0<zn);for(Ue=nr;Ue!==0;Ue--)for(He=_e.bl_count[Ue];He!==0;)Kn<(ht=_e.heap[--Te])||(We[2*ht+1]!==Ue&&(_e.opt_len+=(Ue-We[2*ht+1])*We[2*ht],We[2*ht+1]=Ue),He--)}})(H,J),Ce(he,pe,H.bl_count)}function T(H,J,ye){var Se,ue,he=-1,xe=J[1],ke=0,ne=7,pe=4;for(xe===0&&(ne=138,pe=3),J[2*(ye+1)+1]=65535,Se=0;Se<=ye;Se++)ue=xe,xe=J[2*(Se+1)+1],++ke<ne&&ue===xe||(ke<pe?H.bl_tree[2*ue]+=ke:ue!==0?(ue!==he&&H.bl_tree[2*ue]++,H.bl_tree[2*O]++):ke<=10?H.bl_tree[2*M]++:H.bl_tree[2*D]++,he=ue,pe=(ke=0)===xe?(ne=138,3):ue===xe?(ne=6,3):(ne=7,4))}function ie(H,J,ye){var Se,ue,he=-1,xe=J[1],ke=0,ne=7,pe=4;for(xe===0&&(ne=138,pe=3),Se=0;Se<=ye;Se++)if(ue=xe,xe=J[2*(Se+1)+1],!(++ke<ne&&ue===xe)){if(ke<pe)for(;oe(H,ue,H.bl_tree),--ke!=0;);else ue!==0?(ue!==he&&(oe(H,ue,H.bl_tree),ke--),oe(H,O,H.bl_tree),le(H,ke-3,2)):ke<=10?(oe(H,M,H.bl_tree),le(H,ke-3,3)):(oe(H,D,H.bl_tree),le(H,ke-11,7));he=ue,pe=(ke=0)===xe?(ne=138,3):ue===xe?(ne=6,3):(ne=7,4)}}h(Y);var Q=!1;function G(H,J,ye,Se){le(H,(m<<1)+(Se?1:0),3),(function(ue,he,xe,ke){Ne(ue),L(ue,xe),L(ue,~xe),o.arraySet(ue.pending_buf,ue.window,he,xe,ue.pending),ue.pending+=xe})(H,J,ye)}s._tr_init=function(H){Q||((function(){var J,ye,Se,ue,he,xe=new Array(_+1);for(ue=Se=0;ue<y-1;ue++)for(q[ue]=Se,J=0;J<1<<B[ue];J++)E[Se++]=ue;for(E[Se-1]=ue,ue=he=0;ue<16;ue++)for(Y[ue]=he,J=0;J<1<<V[ue];J++)Z[he++]=ue;for(he>>=7;ue<x;ue++)for(Y[ue]=he<<7,J=0;J<1<<V[ue]-7;J++)Z[256+he++]=ue;for(ye=0;ye<=_;ye++)xe[ye]=0;for(J=0;J<=143;)te[2*J+1]=8,J++,xe[8]++;for(;J<=255;)te[2*J+1]=9,J++,xe[9]++;for(;J<=279;)te[2*J+1]=7,J++,xe[7]++;for(;J<=287;)te[2*J+1]=8,J++,xe[8]++;for(Ce(te,b+1,xe),J=0;J<x;J++)I[2*J+1]=5,I[2*J]=ve(J,5);$=new z(te,B,p+1,b,_),X=new z(I,V,0,x,_),re=new z(new Array(0),K,0,S,N)})(),Q=!0),H.l_desc=new R(H.dyn_ltree,$),H.d_desc=new R(H.dyn_dtree,X),H.bl_desc=new R(H.bl_tree,re),H.bi_buf=0,H.bi_valid=0,Ae(H)},s._tr_stored_block=G,s._tr_flush_block=function(H,J,ye,Se){var ue,he,xe=0;0<H.level?(H.strm.data_type===2&&(H.strm.data_type=(function(ke){var ne,pe=4093624447;for(ne=0;ne<=31;ne++,pe>>>=1)if(1&pe&&ke.dyn_ltree[2*ne]!==0)return u;if(ke.dyn_ltree[18]!==0||ke.dyn_ltree[20]!==0||ke.dyn_ltree[26]!==0)return f;for(ne=32;ne<p;ne++)if(ke.dyn_ltree[2*ne]!==0)return f;return u})(H)),ot(H,H.l_desc),ot(H,H.d_desc),xe=(function(ke){var ne;for(T(ke,ke.dyn_ltree,ke.l_desc.max_code),T(ke,ke.dyn_dtree,ke.d_desc.max_code),ot(ke,ke.bl_desc),ne=S-1;3<=ne&&ke.bl_tree[2*U[ne]+1]===0;ne--);return ke.opt_len+=3*(ne+1)+5+5+4,ne})(H),ue=H.opt_len+3+7>>>3,(he=H.static_len+3+7>>>3)<=ue&&(ue=he)):ue=he=ye+5,ye+4<=ue&&J!==-1?G(H,J,ye,Se):H.strategy===4||he===ue?(le(H,2+(Se?1:0),3),dt(H,te,I)):(le(H,4+(Se?1:0),3),(function(ke,ne,pe,_e){var se;for(le(ke,ne-257,5),le(ke,pe-1,5),le(ke,_e-4,4),se=0;se<_e;se++)le(ke,ke.bl_tree[2*U[se]+1],3);ie(ke,ke.dyn_ltree,ne-1),ie(ke,ke.dyn_dtree,pe-1)})(H,H.l_desc.max_code+1,H.d_desc.max_code+1,xe+1),dt(H,H.dyn_ltree,H.dyn_dtree)),Ae(H),Se&&Ne(H)},s._tr_tally=function(H,J,ye){return H.pending_buf[H.d_buf+2*H.last_lit]=J>>>8&255,H.pending_buf[H.d_buf+2*H.last_lit+1]=255&J,H.pending_buf[H.l_buf+H.last_lit]=255&ye,H.last_lit++,J===0?H.dyn_ltree[2*ye]++:(H.matches++,J--,H.dyn_ltree[2*(E[ye]+p+1)]++,H.dyn_dtree[2*F(J)]++),H.last_lit===H.lit_bufsize-1},s._tr_align=function(H){le(H,2,3),oe(H,A,te),(function(J){J.bi_valid===16?(L(J,J.bi_buf),J.bi_buf=0,J.bi_valid=0):8<=J.bi_valid&&(J.pending_buf[J.pending++]=255&J.bi_buf,J.bi_buf>>=8,J.bi_valid-=8)})(H)}},{"../utils/common":41}],53:[function(a,i,s){i.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(a,i,s){(function(o){(function(u,f){if(!u.setImmediate){var h,m,y,p,b=1,x={},S=!1,w=u.document,_=Object.getPrototypeOf&&Object.getPrototypeOf(u);_=_&&_.setTimeout?_:u,h={}.toString.call(u.process)==="[object process]"?function(O){process.nextTick(function(){N(O)})}:(function(){if(u.postMessage&&!u.importScripts){var O=!0,M=u.onmessage;return u.onmessage=function(){O=!1},u.postMessage("","*"),u.onmessage=M,O}})()?(p="setImmediate$"+Math.random()+"$",u.addEventListener?u.addEventListener("message",A,!1):u.attachEvent("onmessage",A),function(O){u.postMessage(p+O,"*")}):u.MessageChannel?((y=new MessageChannel).port1.onmessage=function(O){N(O.data)},function(O){y.port2.postMessage(O)}):w&&"onreadystatechange"in w.createElement("script")?(m=w.documentElement,function(O){var M=w.createElement("script");M.onreadystatechange=function(){N(O),M.onreadystatechange=null,m.removeChild(M),M=null},m.appendChild(M)}):function(O){setTimeout(N,0,O)},_.setImmediate=function(O){typeof O!="function"&&(O=new Function(""+O));for(var M=new Array(arguments.length-1),D=0;D<M.length;D++)M[D]=arguments[D+1];var B={callback:O,args:M};return x[b]=B,h(b),b++},_.clearImmediate=k}function k(O){delete x[O]}function N(O){if(S)setTimeout(N,0,O);else{var M=x[O];if(M){S=!0;try{(function(D){var B=D.callback,V=D.args;switch(V.length){case 0:B();break;case 1:B(V[0]);break;case 2:B(V[0],V[1]);break;case 3:B(V[0],V[1],V[2]);break;default:B.apply(f,V)}})(M)}finally{k(O),S=!1}}}}function A(O){O.source===u&&typeof O.data=="string"&&O.data.indexOf(p)===0&&N(+O.data.slice(p.length))}})(typeof self>"u"?o===void 0?this:o:self)}).call(this,typeof nc<"u"?nc:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(bh)),bh.exports}var W8=Q8();const J8=_s(W8);function eI(){const[e,r]=j.useState(null),[a,i]=j.useState("session"),[s,o]=j.useState(""),[u,f]=j.useState([]),[h,m]=j.useState(!0),[y,p]=j.useState(!1),[b,x]=j.useState(null),[S,w]=j.useState(""),[_,k]=j.useState(!1),[N,A]=j.useState(null),[O,M]=j.useState(null),[D,B]=j.useState(!1);j.useEffect(()=>{x(null),JS().then(Z=>{r(Z),Z.session.length>0?(i("session"),o(Z.session[0])):Z.shared.length>0&&(i("shared"),o(Z.shared[0]))}).catch(Z=>x(Z instanceof Error?Z.message:String(Z))).finally(()=>m(!1))},[]);const V=a==="session"?e?.session??[]:e?.shared??[];j.useEffect(()=>{if(!s||!V.includes(s)){f([]);return}p(!0),ek({scope:a,scope_key:s,limit:200}).then(Z=>f(Z.entries??[])).catch(Z=>x(Z instanceof Error?Z.message:String(Z))).finally(()=>p(!1))},[a,s]);const K=()=>{const Z=S.trim();Z&&(M(null),A(null),k(!0),tk({query:Z,scope:a,scope_key:s||void 0,limit:10}).then(E=>A(E)).catch(E=>M(E instanceof Error?E.message:String(E))).finally(()=>k(!1)))},U=()=>{const Z=new Blob([JSON.stringify({scope:a,scope_key:s,exported_at:new Date().toISOString(),entries:u},null,2)],{type:"application/json"}),E=document.createElement("a");E.href=URL.createObjectURL(Z),E.download=`sulala-memory-${a}-${s.replace(/[^a-z0-9-_]/gi,"_")}.json`,E.click(),URL.revokeObjectURL(E.href)},te=async()=>{if(s){B(!0);try{const{files:Z}=await nk({scope:a,scope_key:s});if(Z.length===0){x("No Markdown files to export. Enable AGENT_MEMORY_FILES_ENABLED and use write_memory to create files.");return}const E=new J8;for(const X of Z)E.file(X.path,X.content);const q=await E.generateAsync({type:"blob"}),$=document.createElement("a");$.href=URL.createObjectURL(q),$.download=`sulala-memory-${a}-${s.replace(/[^a-z0-9-_]/gi,"_")}.zip`,$.click(),URL.revokeObjectURL($.href)}catch(Z){x(Z instanceof Error?Z.message:String(Z))}finally{B(!1)}}},I=Z=>new Date(Z).toLocaleString();return h?d.jsx(St,{children:d.jsx(kt,{className:"pt-6",children:d.jsx("p",{className:"text-muted-foreground text-sm",children:"Loading memory…"})})}):d.jsx("div",{className:"space-y-4",children:d.jsxs(St,{children:[d.jsxs(At,{children:[d.jsxs(Tt,{className:"flex items-center gap-2 text-base",children:[d.jsx(iS,{className:"size-4"}),"Agent memory"]}),d.jsx(Rt,{children:"View stored memory (session-scoped or shared across sessions). Use the chat to add entries via the write_memory tool."})]}),d.jsxs(kt,{className:"space-y-4",children:[b&&d.jsx("p",{className:"text-destructive text-sm",role:"alert",children:b}),d.jsxs("div",{className:"flex flex-wrap items-end gap-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(Mt,{htmlFor:"memory-scope",children:"Scope"}),d.jsxs("select",{id:"memory-scope",className:"flex h-9 w-[140px] rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm",value:a,onChange:Z=>{const E=Z.target.value;i(E);const q=E==="session"?e?.session??[]:e?.shared??[];o(q[0]??"")},children:[d.jsx("option",{value:"session",children:"Session"}),d.jsx("option",{value:"shared",children:"Shared"})]})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Mt,{htmlFor:"memory-scope-key",children:a==="session"?"Session":"Shared key"}),d.jsx("select",{id:"memory-scope-key",className:"flex h-9 min-w-[200px] max-w-[320px] rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm",value:s,onChange:Z=>o(Z.target.value),children:V.length===0?d.jsx("option",{value:"",children:"— No keys —"}):V.map(Z=>d.jsx("option",{value:Z,children:Z.length>40?Z.slice(0,37)+"…":Z},Z))})]}),u.length>0&&d.jsxs(je,{variant:"outline",size:"sm",onClick:U,children:[d.jsx(j4,{className:"size-4 mr-1"}),"Export JSON"]}),s&&d.jsxs(je,{variant:"outline",size:"sm",onClick:te,disabled:D,children:[d.jsx(oS,{className:"size-4 mr-1"}),D?"Exporting…":"Export Markdown"]})]}),d.jsx("div",{className:"flex flex-wrap items-end gap-2",children:d.jsxs("div",{className:"space-y-2",children:[d.jsx(Mt,{htmlFor:"memory-search",children:"Semantic search"}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("input",{id:"memory-search",className:"flex h-9 min-w-[200px] max-w-[320px] rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm",placeholder:"e.g. user preferences, project decisions",value:S,onChange:Z=>w(Z.target.value),onKeyDown:Z=>Z.key==="Enter"&&K()}),d.jsxs(je,{variant:"secondary",size:"sm",onClick:K,disabled:_||!S.trim(),children:[d.jsx(C5,{className:"size-4 mr-1"}),_?"Searching…":"Search"]})]})]})}),O&&d.jsx("p",{className:"text-destructive text-sm",role:"alert",children:O}),N&&d.jsxs("div",{className:"rounded-md border p-3",children:[d.jsxs("p",{className:"text-muted-foreground text-xs mb-2",children:["Search results (",N.hits.length,")"]}),N.hits.length===0?d.jsx("p",{className:"text-muted-foreground text-sm",children:"No matching memory."}):d.jsx("ul",{className:"divide-y divide-border max-h-[200px] overflow-y-auto text-sm",children:N.hits.map((Z,E)=>d.jsxs("li",{className:"py-2",children:[d.jsx("p",{className:"text-foreground",children:Z.content_snippet}),d.jsxs("p",{className:"text-muted-foreground text-xs",children:["score: ",Z.score.toFixed(2)," · ",Z.scope]})]},E))})]}),y&&d.jsx("p",{className:"text-muted-foreground text-sm",children:"Loading entries…"}),!y&&s&&V.includes(s)&&d.jsx("div",{className:"rounded-md border",children:u.length===0?d.jsxs("p",{className:"p-4 text-muted-foreground text-sm",children:["No memory entries for this ",a," key."]}):d.jsx("ul",{className:"divide-y divide-border max-h-[400px] overflow-y-auto",children:u.map(Z=>d.jsxs("li",{className:"p-3 text-sm",children:[d.jsx("p",{className:"text-foreground",children:Z.content}),d.jsx("p",{className:"mt-1 text-muted-foreground text-xs",children:I(Z.created_at)})]},Z.id))})})]})]})})}function tI(e){if(Array.isArray(e))return e;if(!e||typeof e!="object")return[];const r=e;return"servers"in r&&Array.isArray(r.servers)?r.servers:"mcpServers"in r&&r.mcpServers&&typeof r.mcpServers=="object"&&!Array.isArray(r.mcpServers)?Object.entries(r.mcpServers).map(([a,i])=>({name:a,...i&&typeof i=="object"?i:{}})):[]}function i0(e){const r=e.trim();return r?r.startsWith("http://")||r.startsWith("https://")?r:`https://cdn.simpleicons.org/${encodeURIComponent(r)}`:""}function nI(e){try{const r=JSON.parse(e),a=tI(r);if(!(Array.isArray(r)||r&&typeof r=="object"&&("servers"in r||"mcpServers"in r)))return null;const s=[];for(const o of a){const u=o&&typeof o=="object"?o:{},f=typeof u.name=="string"?u.name.trim():"",h=typeof u.command=="string"?u.command.trim():"";if(!f||!h)continue;const m=Array.isArray(u.args)?u.args.map(x=>String(x)):void 0;let y;if(u.env&&typeof u.env=="object"&&!Array.isArray(u.env)){y={};for(const[x,S]of Object.entries(u.env))typeof x=="string"&&typeof S=="string"&&(y[x]=S);Object.keys(y).length===0&&(y=void 0)}const p=typeof u.icon=="string"&&u.icon.trim()||void 0,b=typeof u.credentialsUrl=="string"&&u.credentialsUrl.trim()||void 0;s.push({name:f,command:h,args:m,env:y,icon:p,credentialsUrl:b})}return s}catch{return null}}function rI({onError:e}){const[r,a]=j.useState([]),[i,s]=j.useState(!0),[o,u]=j.useState(!1),[f,h]=j.useState(null),[m,y]=j.useState(!1),[p,b]=j.useState(null),[x,S]=j.useState(!1),[w,_]=j.useState(""),[k,N]=j.useState(null),[A,O]=j.useState({name:"",command:"npx",args:["-y","package-name"],env:{}}),[M,D]=j.useState(!1),[B,V]=j.useState(!1);j.useEffect(()=>{m&&(p!==null&&r[p]?O({...r[p],env:{...r[p].env??{}}}):O({name:"",command:"npx",args:["-y","package-name"],env:{}}))},[m,p,r]);const K=Y=>{O(z=>({...z,...Y}))},U=(Y,z)=>{O(R=>{const F={...R.env??{}};return z===""?delete F[Y]:F[Y]=z,{...R,env:F}})},te=()=>{!A.name?.trim()||!A.command?.trim()||(a(p!==null?Y=>{const z=[...Y];return z[p]={...A},z}:Y=>[...Y,{...A}]),y(!1))},I=async()=>{s(!0),h(null);try{const z=(await Mm()).servers??[];return a(z),{servers:z}}catch(Y){return h(Y instanceof Error?Y.message:String(Y)),e?.(Y instanceof Error?Y.message:String(Y)),{servers:[]}}finally{s(!1)}};j.useEffect(()=>{I()},[]);const Z=async()=>{u(!0),h(null);try{const Y=r.map(z=>({...z,env:z.env?Object.fromEntries(Object.entries(z.env).map(([R,F])=>[R,F===""?"***":F])):void 0}));await Mh(Y),await I()}catch(Y){h(Y instanceof Error?Y.message:String(Y)),e?.(Y instanceof Error?Y.message:String(Y))}finally{u(!1)}},E=async()=>{D(!0),h(null);try{const Y=await PS();a(Y.servers??[])}catch(Y){h(Y instanceof Error?Y.message:String(Y)),e?.(Y instanceof Error?Y.message:String(Y))}finally{D(!1)}},q=async()=>{N(null);const Y=nI(w);if(!Y?.length){N('Invalid or empty. Use { "servers": [ ... ] } or { "mcpServers": { "name": { ... } } }.');return}const z=[...r,...Y];a(z),h(null),V(!0);try{const R=z.map(F=>({...F,env:F.env?Object.fromEntries(Object.entries(F.env).map(([L,le])=>[L,le===""?"***":le])):void 0}));await Mh(R),await I(),_(""),S(!1)}catch(R){h(R instanceof Error?R.message:String(R)),e?.(R instanceof Error?R.message:String(R))}finally{V(!1)}},$=()=>{b(null),y(!0)},X=Y=>{b(Y),y(!0)},re=Y=>{a(z=>z.filter((R,F)=>F!==Y))};return i?d.jsx("div",{className:"text-muted-foreground text-sm",children:"Loading MCP servers…"}):d.jsxs("div",{className:"flex flex-col gap-4 max-w-2xl",children:[d.jsxs(St,{children:[d.jsxs(At,{children:[d.jsxs(Tt,{className:"flex items-center gap-2",children:[d.jsx(Oh,{className:"size-5"}),"MCP Servers"]}),d.jsxs(Rt,{className:"space-y-1",children:[d.jsx("span",{className:"block",children:"MCP is for users who want to run and configure their own servers (e.g. API keys in env)—more setup, more control or services not in Connections."}),d.jsxs("span",{className:"block",children:["Add MCP servers one at a time. Tools appear as ",d.jsx("code",{className:"rounded bg-muted px-1",children:"mcp_<name>_<tool>"}),". Config is saved to ",d.jsx("code",{className:"rounded bg-muted px-1",children:"~/.sulala/mcp.json"}),'. If you edit that file by hand, click "Reload from file" so the agent picks up changes without restarting.']}),d.jsxs("span",{className:"block",children:["Find more servers at"," ",d.jsx("a",{href:"https://mcpservers.org/",target:"_blank",rel:"noopener noreferrer",className:"text-primary underline hover:no-underline",children:"mcpservers.org"}),"."]})]})]}),d.jsxs(kt,{className:"flex flex-col gap-4",children:[f&&d.jsx("p",{className:"text-destructive text-sm",children:f}),d.jsxs("div",{className:"flex flex-wrap gap-2",children:[d.jsxs(je,{type:"button",variant:"default",size:"sm",onClick:$,children:[d.jsx(dS,{className:"size-4 mr-1"}),"Add server"]}),d.jsxs(je,{type:"button",variant:"outline",size:"sm",onClick:()=>S(!0),children:[d.jsx(oS,{className:"size-4 mr-1"}),"Import from JSON"]}),d.jsx(je,{type:"button",size:"sm",variant:"secondary",onClick:Z,disabled:o,children:o?"Saving…":"Save & reload tools"}),d.jsxs(je,{type:"button",size:"sm",variant:"outline",onClick:E,disabled:M,title:"Re-read mcp.json and reload tools (use after editing the file by hand)",children:[d.jsx(_5,{className:`size-4 mr-1 ${M?"animate-spin":""}`}),M?"Reloading…":"Reload from file"]})]}),r.length===0?d.jsx("p",{className:"text-muted-foreground text-sm",children:"No MCP servers configured. Click Add server to create one, or Import from JSON to add from a config snippet."}):d.jsx("ul",{className:"flex flex-col gap-2",children:r.map((Y,z)=>d.jsxs("li",{className:"flex items-center justify-between gap-2 rounded-lg border bg-card px-4 py-3 text-sm",children:[d.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[Y.icon?d.jsx("img",{src:i0(Y.icon),alt:"",className:"size-5 shrink-0 rounded object-contain",onError:R=>{R.target.style.display="none"}}):d.jsx(Oh,{className:"size-5 shrink-0 text-muted-foreground"}),d.jsx("span",{className:"font-medium truncate",title:Y.name||`Server ${z+1}`,children:Y.name||`Server ${z+1}`})]}),d.jsxs("span",{className:"text-muted-foreground truncate max-w-[40%]",title:[Y.command,...Y.args??[]].join(" "),children:[Y.command," ",Array.isArray(Y.args)&&Y.args.length?Y.args.join(" "):""]}),d.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[Y.credentialsUrl&&d.jsxs("a",{href:Y.credentialsUrl,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-primary text-xs inline-flex items-center gap-0.5",title:"Where to get API keys",children:[d.jsx(sS,{className:"size-3.5"}),"Get keys"]}),d.jsx(je,{type:"button",variant:"ghost",size:"icon",className:"size-8",onClick:()=>X(z),title:"Edit",children:d.jsx(m5,{className:"size-4"})}),d.jsx(je,{type:"button",variant:"ghost",size:"icon",className:"size-8 text-muted-foreground hover:text-destructive",onClick:()=>re(z),title:"Remove",children:d.jsx(zh,{className:"size-4"})})]})]},z))})]})]}),d.jsx(Ya,{open:m,onOpenChange:y,children:d.jsxs($a,{className:"max-w-lg max-h-[90vh] overflow-y-auto",showCloseButton:!0,children:[d.jsxs(Va,{children:[d.jsx(Xa,{children:p!==null?"Edit MCP server":"Add MCP server"}),d.jsxs(Za,{children:["Name is used as the tool prefix (e.g. ",d.jsx("code",{className:"rounded bg-muted px-1",children:"mcp_<name>_<tool>"}),"). Command and args are run to start the server (e.g. npx + package, or node + path)."]})]}),d.jsxs("div",{className:"grid gap-3 py-2",children:[d.jsxs("div",{className:"grid gap-2",children:[d.jsx(Mt,{className:"text-muted-foreground text-sm",children:"Icon (optional)"}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(It,{placeholder:"e.g. github, youtube or https://…",value:A.icon??"",onChange:Y=>K({icon:Y.target.value.trim()||void 0})}),A.icon&&d.jsx("img",{src:i0(A.icon),alt:"",className:"size-8 shrink-0 rounded object-contain border border-input bg-muted",onError:Y=>{Y.target.style.display="none"}})]}),d.jsxs("p",{className:"text-muted-foreground text-xs",children:["Use a"," ",d.jsx("a",{href:"https://simpleicons.org/",target:"_blank",rel:"noopener noreferrer",className:"underline hover:no-underline",children:"Simple Icons"})," ","slug (e.g. ",d.jsx("code",{className:"rounded bg-muted px-1",children:"github"}),", ",d.jsx("code",{className:"rounded bg-muted px-1",children:"youtube"}),") or any image URL."]})]}),d.jsxs("div",{className:"grid gap-2",children:[d.jsx(Mt,{className:"text-muted-foreground text-sm",children:"Name"}),d.jsx(It,{placeholder:"e.g. youtube",value:A.name,onChange:Y=>K({name:Y.target.value.trim()})})]}),d.jsxs("div",{className:"grid gap-2",children:[d.jsx(Mt,{className:"text-muted-foreground text-sm",children:"Command"}),d.jsx(It,{placeholder:"e.g. npx or node",value:A.command,onChange:Y=>K({command:Y.target.value.trim()})})]}),d.jsxs("div",{className:"grid gap-2",children:[d.jsx(Mt,{className:"text-muted-foreground text-sm",children:"Args (comma-separated)"}),d.jsx(It,{placeholder:"e.g. -y, package-name or /path/to/index.js",value:Array.isArray(A.args)?A.args.join(", "):"",onChange:Y=>K({args:Y.target.value.split(",").map(z=>z.trim()).filter(Boolean)})})]}),d.jsxs("div",{className:"grid gap-2",children:[d.jsx(Mt,{className:"text-muted-foreground text-sm",children:"Env (API keys, etc.)"}),d.jsx("p",{className:"text-muted-foreground text-xs",children:'Add a "Credentials help URL" below so users know where to get these keys.'}),d.jsxs("div",{className:"space-y-2",children:[Object.entries(A.env??{}).map(([Y,z])=>d.jsxs("div",{className:"flex gap-2 items-center",children:[d.jsx(It,{className:"flex-1 font-mono text-sm",placeholder:"KEY",value:Y,readOnly:!0}),d.jsx(It,{type:"password",className:"flex-1 font-mono text-sm",placeholder:"value",value:z==="***"?"":z,onChange:R=>U(Y,R.target.value)}),d.jsx(je,{type:"button",variant:"ghost",size:"sm",onClick:()=>U(Y,""),children:d.jsx(zh,{className:"size-4"})})]},Y)),d.jsx(aI,{onAdd:(Y,z)=>{Y&&U(Y,z)}})]}),d.jsxs("div",{className:"grid gap-2 pt-1",children:[d.jsx(Mt,{className:"text-muted-foreground text-sm",children:"Credentials help URL (optional)"}),d.jsx(It,{type:"url",placeholder:"e.g. https://developers.google.com/gmail/api/quickstart/nodejs",value:A.credentialsUrl??"",onChange:Y=>K({credentialsUrl:Y.target.value.trim()||void 0})}),d.jsx("p",{className:"text-muted-foreground text-xs",children:'Link to official docs on where and how to get API keys for this server. Shown as "Get keys" in the list.'})]})]})]}),d.jsxs(Ka,{children:[d.jsx(je,{type:"button",variant:"outline",onClick:()=>y(!1),children:"Cancel"}),d.jsx(je,{type:"button",onClick:te,disabled:!A.name?.trim()||!A.command?.trim(),children:p!==null?"Update":"Add"})]})]})}),d.jsx(Ya,{open:x,onOpenChange:Y=>{S(Y),Y||N(null)},children:d.jsxs($a,{className:"max-w-lg",showCloseButton:!0,children:[d.jsxs(Va,{children:[d.jsx(Xa,{children:"Import from JSON"}),d.jsxs(Za,{children:["Paste JSON to add servers (they will be appended). Accepts"," ",d.jsx("code",{className:"rounded bg-muted px-1",children:'{ "servers": [ ... ] }'})," or"," ",d.jsx("code",{className:"rounded bg-muted px-1",children:'{ "mcpServers": { "name": { ... } } }'}),"."]})]}),k&&d.jsx("p",{className:"text-destructive text-sm",children:k}),d.jsx("textarea",{className:"border-input bg-background min-h-[160px] w-full rounded-md border px-3 py-2 font-mono text-sm focus:outline-none focus:ring-2 focus:ring-ring",value:w,onChange:Y=>_(Y.target.value),spellCheck:!1,placeholder:'{"mcpServers":{"bluesky":{"command":"node","args":["/path/to/index.js"],"env":{...}}}}'}),d.jsxs(Ka,{children:[d.jsx(je,{type:"button",variant:"outline",onClick:()=>S(!1),children:"Cancel"}),d.jsx(je,{type:"button",onClick:q,disabled:B,children:B?"Saving to mcp.json…":"Import & save to mcp.json"})]})]})})]})}function aI({onAdd:e}){const[r,a]=j.useState(""),[i,s]=j.useState(""),o=()=>{const u=r.trim();u&&(e(u,i.trim()),a(""),s(""))};return d.jsxs("div",{className:"flex gap-2 items-center",children:[d.jsx(It,{className:"flex-1 font-mono text-sm",placeholder:"e.g. YOUTUBE_API_KEY",value:r,onChange:u=>a(u.target.value)}),d.jsx(It,{type:"password",className:"flex-1 font-mono text-sm",placeholder:"value",value:i,onChange:u=>s(u.target.value)}),d.jsx(je,{type:"button",variant:"outline",size:"sm",onClick:o,children:"Add env"})]})}function iI({storeBaseUrl:e,onSaved:r,onError:a}){const[i,s]=j.useState({}),[o,u]=j.useState(""),[f,h]=j.useState(!1),[m,y]=j.useState(!1);j.useEffect(()=>{h(!0),va().then(({keys:S})=>s(S??{})).catch(()=>s({})).finally(()=>h(!1))},[]);const p=async()=>{y(!0);try{const S={};o.trim()&&(S.STORE_PUBLISH_API_KEY=o.trim()),await uu(S);const{keys:w}=await va();s(w??{}),o.trim()&&u(""),r?.()}catch(S){a?.(S instanceof Error?S.message:"Failed to save")}finally{y(!1)}},b=i.STORE_PUBLISH_API_KEY==="set"?"(already set)":"sk_pub_...",x=e?`${e.replace(/\/$/,"")}/my-skills`:null;return d.jsxs("div",{className:"border-border bg-muted/30 flex flex-col gap-3 rounded-lg border p-4 text-sm",children:[d.jsx("p",{className:"font-medium",children:"Store publish API key"}),d.jsx("p",{className:"text-muted-foreground text-xs",children:"Publish skills from the dashboard (Skills → My skills → Publish to store). Create a key on the store (My skills → Create publish API key), then paste it here."}),f?d.jsx("p",{className:"text-muted-foreground text-xs",children:"Loading…"}):d.jsxs("form",{className:"flex flex-col gap-3",onSubmit:S=>{S.preventDefault(),p()},children:[d.jsxs("div",{className:"space-y-1",children:[d.jsx(Mt,{htmlFor:"store-publish-api-key",className:"text-xs",children:"API key"}),d.jsx(It,{id:"store-publish-api-key",type:"password",placeholder:b,value:o,onChange:S=>u(S.target.value),autoComplete:"off",className:"h-8"})]}),d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d.jsx(je,{type:"submit",variant:"secondary",size:"sm",disabled:m,children:m?"Saving…":"Save"}),x&&d.jsx("a",{href:x,target:"_blank",rel:"noreferrer",className:"text-primary hover:underline text-xs",children:"Create API key on store →"})]})]})]})}const lI=[{value:"overview",label:"Overview",icon:Z4},{value:"tasks",label:"Tasks",icon:t5},{value:"logs",label:"Logs",icon:Rm},{value:"files",label:"File states",icon:F4},{value:"ai-providers",label:"AI Providers",icon:lS},{value:"channels",label:"Channels",icon:us},{value:"memory",label:"Memory",icon:iS},{value:"mcp",label:"MCP servers",icon:Oh},{value:"store",label:"Store",icon:hS},{value:"config",label:"Watched folders",icon:Om}];function sI(e){return d.jsx("div",{className:"flex flex-1 flex-col min-h-0",children:d.jsx(Im,{defaultValue:"overview",orientation:"vertical",className:"flex flex-1 flex-col min-h-0",children:d.jsxs("div",{className:"flex flex-1 min-h-0",children:[d.jsx(Pm,{variant:"line",className:"w-52 shrink-0 flex flex-col h-auto rounded-none p-2 gap-0.5",children:lI.map(({value:r,label:a,icon:i})=>d.jsxs(Qi,{value:r,className:ze("w-full justify-start gap-2 rounded-md px-3 py-2 h-auto font-normal","data-[state=active]:bg-background data-[state=active]:shadow-sm data-[state=active]:font-medium"),children:[d.jsx(i,{className:"size-4 shrink-0"}),d.jsx("span",{className:"truncate",children:a})]},r))}),d.jsxs("div",{className:"flex-1 min-w-0 overflow-auto p-4",children:[d.jsx(on,{value:"overview",className:"mt-0 flex-1 data-[state=inactive]:hidden",children:d.jsx(MR,{health:e.health,loading:e.loading,connected:e.connected,events:e.events})}),d.jsx(on,{value:"tasks",className:"mt-0 flex-1 data-[state=inactive]:hidden",children:d.jsx($8,{tasks:e.tasks,loading:e.loading,load:e.load,enqueueType:e.enqueueType,setEnqueueType:e.setEnqueueType,enqueuePayload:e.enqueuePayload,setEnqueuePayload:e.setEnqueuePayload,enqueueing:e.enqueueing,actionTaskId:e.actionTaskId,handleTaskCancel:e.handleTaskCancel,handleTaskRetry:e.handleTaskRetry,handleEnqueue:e.handleEnqueue})}),d.jsx(on,{value:"logs",className:"mt-0 flex-1 data-[state=inactive]:hidden",children:d.jsx(V8,{logs:e.logs,load:e.load})}),d.jsx(on,{value:"files",className:"mt-0 flex-1 data-[state=inactive]:hidden",children:d.jsx(K8,{fileStates:e.fileStates,load:e.load})}),d.jsx(on,{value:"ai-providers",className:"mt-0 flex-1 data-[state=inactive]:hidden",children:d.jsx(Y8,{})}),d.jsx(on,{value:"channels",className:"mt-0 flex-1 data-[state=inactive]:hidden",children:d.jsx(Z8,{})}),d.jsx(on,{value:"memory",className:"mt-0 flex-1 data-[state=inactive]:hidden",children:d.jsx(eI,{})}),d.jsx(on,{value:"mcp",className:"mt-0 flex-1 data-[state=inactive]:hidden",children:d.jsx(rI,{onError:e.onError})}),d.jsx(on,{value:"store",className:"mt-0 flex-1 data-[state=inactive]:hidden",children:d.jsx(oI,{onError:e.onError})}),d.jsx(on,{value:"config",className:"mt-0 flex-1 data-[state=inactive]:hidden",children:d.jsx(q8,{config:e.config})})]})]})})})}function oI({onError:e}){const r=ti();return d.jsx("div",{className:"flex flex-col gap-4",children:d.jsx(iI,{storeBaseUrl:r,onError:e})})}const cI=100;function uI(e){const[r,a]=j.useState([]),[i,s]=j.useState(!1),o=j.useRef(null),u=j.useRef(e?.onSkillsChanged);return u.current=e?.onSkillsChanged,j.useEffect(()=>{const f=MS(),h=new WebSocket(f);return h.onopen=()=>s(!0),h.onclose=()=>s(!1),h.onmessage=m=>{try{const y=JSON.parse(m.data);a(p=>[y,...p].slice(0,cI)),y.type==="skills_changed"&&u.current&&u.current()}catch{}},h.onerror=()=>{},o.current=h,()=>{h.close(),o.current=null,s(!1)}},[]),{events:r,connected:i}}function dI({className:e,checked:r,onCheckedChange:a,onChange:i,...s}){const o=r===!0;return d.jsx("input",{type:"checkbox",checked:o,onChange:u=>{i?.(u),a?.(u.target.checked)},"data-slot":"checkbox",className:ze("border-input size-4 shrink-0 rounded border transition-colors","focus-visible:ring-ring focus-visible:ring-2 focus-visible:ring-offset-2","accent-primary disabled:opacity-50",e),...s})}const fI="modulepreload",hI=function(e){return"/"+e},l0={},mI=function(r,a,i){let s=Promise.resolve();if(a&&a.length>0){let m=function(y){return Promise.all(y.map(p=>Promise.resolve(p).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};var u=m;document.getElementsByTagName("link");const f=document.querySelector("meta[property=csp-nonce]"),h=f?.nonce||f?.getAttribute("nonce");s=m(a.map(y=>{if(y=hI(y),y in l0)return;l0[y]=!0;const p=y.endsWith(".css"),b=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${y}"]${b}`))return;const x=document.createElement("link");if(x.rel=p?"stylesheet":fI,p||(x.as="script"),x.crossOrigin="",x.href=y,h&&x.setAttribute("nonce",h),document.head.appendChild(x),p)return new Promise((S,w)=>{x.addEventListener("load",S),x.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${y}`)))})}))}function o(f){const h=new Event("vite:preloadError",{cancelable:!0});if(h.payload=f,window.dispatchEvent(h),!h.defaultPrevented)throw f}return s.then(f=>{for(const h of f||[])h.status==="rejected"&&o(h.reason);return r().catch(o)})},f2=[{id:"openrouter",label:"OpenRouter",envKey:"OPENROUTER_API_KEY",apiKeyUrl:"https://openrouter.ai/keys"},{id:"ollama",label:"Ollama (Local – No API Key Required)",envKey:null,apiKeyUrl:null},{id:"openai",label:"OpenAI",envKey:"OPENAI_API_KEY",apiKeyUrl:"https://platform.openai.com/api-keys"},{id:"anthropic",label:"Anthropic (Claude)",envKey:"ANTHROPIC_API_KEY",apiKeyUrl:"https://console.anthropic.com/settings/keys"},{id:"google",label:"Google / Gemini",envKey:"GOOGLE_GEMINI_API_KEY",apiKeyUrl:"https://aistudio.google.com/app/apikey"}],pI={openai:"OPENAI_API_KEY",anthropic:"ANTHROPIC_API_KEY",google:"GOOGLE_GEMINI_API_KEY",gemini:"GEMINI_API_KEY",openrouter:"OPENROUTER_API_KEY"};function gI(e){const[r,a]=j.useState({statusLoading:!0,statusComplete:null,step:0,selectedProviders:[],envKeys:{},envKeysInput:{},recommendedModels:[],registrySkills:[],selectedSkills:[],ollamaRunning:null,ollamaStatusLoading:!1,pullState:{inProgress:!1,model:"",lastLine:"",percent:0},pullingModels:new Set,loading:!1,error:null,systemCapabilities:null}),i=j.useCallback(async()=>{a(O=>({...O,statusLoading:!0}));try{const{complete:O}=await zm();return a(M=>({...M,statusComplete:O,statusLoading:!1})),O}catch(O){return a(M=>({...M,statusComplete:!1,statusLoading:!1,error:O instanceof Error?O.message:"Failed to load status"})),!1}},[]),s=j.useCallback(async()=>{try{const{keys:O}=await va();return a(M=>({...M,envKeys:O})),O}catch{return{}}},[]),o=j.useCallback(async()=>{try{const{models:O}=await ES();return a(M=>({...M,recommendedModels:O})),O}catch{return[]}},[]),u=j.useCallback(async()=>{try{const{skills:O}=await Mc();return a(M=>({...M,registrySkills:O})),O}catch{return[]}},[]),f=j.useCallback(async()=>{a(O=>({...O,ollamaStatusLoading:!0}));try{const{running:O}=await rl();return a(M=>({...M,ollamaRunning:O,ollamaStatusLoading:!1})),O}catch{return a(O=>({...O,ollamaRunning:!1,ollamaStatusLoading:!1})),!1}},[]),h=j.useCallback(async()=>{const{fetchOllamaPullStatus:O}=await mI(async()=>{const{fetchOllamaPullStatus:D}=await Promise.resolve().then(()=>AR);return{fetchOllamaPullStatus:D}},void 0),M=await O();return a(D=>({...D,pullState:M})),M},[]);j.useEffect(()=>{i()},[i]);const m=j.useCallback(async()=>{try{const O=await BS();return a(M=>({...M,systemCapabilities:O})),O}catch{return a(O=>({...O,systemCapabilities:null})),null}},[]);return j.useEffect(()=>{r.step===0&&m()},[r.step,m]),j.useEffect(()=>{(r.step===1||r.step===2)&&s()},[r.step,s]),j.useEffect(()=>{r.step===2&&r.selectedProviders.includes("ollama")&&(o(),f())},[r.step,r.selectedProviders,o,f]),j.useEffect(()=>{r.step===4&&u()},[r.step,u]),j.useEffect(()=>{if(!r.pullState.inProgress)return;const O=setInterval(h,500);return()=>clearInterval(O)},[r.pullState.inProgress,h]),{...r,loadStatus:i,loadSystemCapabilities:m,installOllama:async()=>{a(O=>({...O,error:null}));try{await FS(),await f()}catch(O){a(M=>({...M,error:O instanceof Error?O.message:"Failed to install Ollama"}))}},loadEnv:s,loadRecommendedModels:o,loadRegistrySkills:u,checkOllama:f,setStep:O=>a(M=>({...M,step:O})),setSelectedProviders:O=>a(M=>({...M,selectedProviders:O})),setEnvKeysInput:O=>a(M=>({...M,envKeysInput:O})),setSelectedSkills:O=>a(M=>({...M,selectedSkills:O})),setError:O=>a(M=>({...M,error:O})),saveEnv:async(O,M)=>{a(D=>({...D,loading:!0,error:null}));try{const D=r.envKeysInput,B={...M};for(const[K,U]of Object.entries(D))typeof U=="string"&&U.trim()&&(B[K]=U.trim());await uu(B);const{keys:V}=await va();a(K=>({...K,envKeys:V,envKeysInput:{},loading:!1,step:O??2}))}catch(D){a(B=>({...B,loading:!1,error:D instanceof Error?D.message:"Failed to save API keys"}))}},pullModel:async O=>{a(M=>({...M,pullingModels:new Set(M.pullingModels).add(O),error:null}));try{await NS(O),h()}catch(M){a(D=>({...D,pullingModels:(()=>{const B=new Set(D.pullingModels);return B.delete(O),B})(),error:M instanceof Error?M.message:"Failed to pull model"}))}},installSkill:async O=>{a(M=>({...M,loading:!0,error:null}));try{await Lm(O,"managed"),a(M=>({...M,selectedSkills:[...new Set([...M.selectedSkills,O])],loading:!1}))}catch(M){a(D=>({...D,loading:!1,error:M instanceof Error?M.message:"Failed to install skill"}))}},finishOnboarding:async()=>{a(O=>({...O,loading:!0,error:null}));try{await CS(),a(O=>({...O,statusComplete:!0,loading:!1})),e?.()}catch(O){a(M=>({...M,loading:!1,error:O instanceof Error?O.message:"Failed to complete onboarding"}))}}}}function yI(e){if(!e)return null;const r=e.match(/~?(\d+(?:\.\d+)?)\s*(GB|MB|gb|mb)/);if(!r)return null;const a=parseFloat(r[1]),i=r[2].toUpperCase();return i==="GB"?Math.round(a*1024*1024*1024):i==="MB"?Math.round(a*1024*1024):null}const h2=j.createContext(null);function Fs(){const e=j.useContext(h2);if(!e)throw new Error("OnboardingFlow must wrap steps");return e}const xI=["Choose AI Provider","Provider Configuration","Integrations","Ollama Model Setup","Finish"],vI=["Choose AI Provider","Provider Configuration","Integrations","Finish"];function bI(){const{selectedProviders:e,setSelectedProviders:r,setStep:a,systemCapabilities:i}=Fs(),s=i&&!i.ollamaSuitable,o=f=>{if(f==="ollama"&&s)return;const h=e.includes(f)?e.filter(m=>m!==f):[...e,f];r(h)},u=e.length>=1;return d.jsxs("div",{className:"space-y-6",children:[d.jsx("p",{className:"text-muted-foreground text-sm",children:"Select at least one AI provider to continue. Ollama runs locally and needs no API key."}),s&&i&&d.jsxs("div",{className:"rounded-lg border border-amber-500/50 bg-amber-500/10 p-3 text-sm",children:[d.jsxs("p",{className:"text-amber-700 dark:text-amber-400",children:["⚠️ ",i.ollamaSuitableReason]}),d.jsx("p",{className:"text-muted-foreground mt-1 text-xs",children:"Use a cloud provider (OpenAI, OpenRouter, etc.) instead."})]}),e.includes("ollama")&&d.jsx("div",{className:"rounded-lg border border-amber-500/50 bg-amber-500/10 p-3 text-sm",children:d.jsx("p",{className:"text-amber-700 dark:text-amber-400",children:"⚠️ Ollama cannot run tools and perform like other providers (e.g. OpenAI, OpenRouter). For full tool support and best results, add a cloud provider."})}),d.jsx("div",{className:"grid gap-3",children:f2.map(f=>d.jsxs("label",{className:`border-input flex items-center gap-3 rounded-lg border p-4 transition-colors ${f.id==="ollama"&&s?"cursor-not-allowed opacity-60":"hover:bg-muted/50 cursor-pointer"}`,children:[d.jsx(dI,{checked:e.includes(f.id),onCheckedChange:()=>o(f.id),disabled:f.id==="ollama"&&!!s}),d.jsxs("div",{className:"flex-1",children:[d.jsx("div",{className:"font-medium",children:f.label}),f.id==="ollama"&&s&&d.jsx("div",{className:"text-amber-600 dark:text-amber-400 mt-0.5 text-xs",children:"Not available on this system"}),f.envKey&&d.jsxs("div",{className:"text-muted-foreground mt-0.5 flex flex-wrap items-center gap-x-2 text-xs",children:[d.jsx("span",{children:"Requires API key"}),"apiKeyUrl"in f&&typeof f.apiKeyUrl=="string"&&d.jsx("a",{href:f.apiKeyUrl,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"Get API key →"})]})]})]},f.id))}),d.jsxs("div",{className:"flex justify-between",children:[d.jsx("div",{}),d.jsxs(je,{disabled:!u,onClick:()=>a(1),children:["Next",d.jsx(Ga,{className:"ml-1 size-4"})]})]})]})}function wI(){const{selectedProviders:e,envKeys:r,envKeysInput:a,setEnvKeysInput:i,saveEnv:s,setStep:o,loading:u,error:f}=Fs(),h=e.filter(w=>w!=="ollama"),m={OPENAI_API_KEY:"OpenAI API Key",ANTHROPIC_API_KEY:"Anthropic API Key",GOOGLE_GEMINI_API_KEY:"Google Gemini API Key",GEMINI_API_KEY:"Gemini API Key (alt)",OPENROUTER_API_KEY:"OpenRouter API Key"},y={};f2.forEach(w=>{w.envKey&&"apiKeyUrl"in w&&typeof w.apiKeyUrl=="string"&&(y[w.envKey]=w.apiKeyUrl)});const p=h.flatMap(w=>{const _=pI[w];return _?[_]:[]}),x=!p.some(w=>r[w]!=="set")||p.length===0,S=p.some(w=>(a[w]??"").trim().length>0);return d.jsxs("div",{className:"space-y-6",children:[h.length===0?d.jsx("p",{className:"text-muted-foreground text-sm",children:"No cloud providers selected. Skipping API keys."}):d.jsxs(d.Fragment,{children:[d.jsxs("p",{className:"text-muted-foreground text-sm",children:["Enter API keys for selected providers. Keys are saved securely to ",d.jsx("code",{className:"rounded bg-muted px-1 text-xs",children:"~/.sulala/.env"}),"."]}),d.jsx("div",{className:"grid gap-4",children:p.map(w=>d.jsxs("div",{className:"space-y-2",children:[d.jsxs("div",{className:"flex flex-wrap items-center gap-x-2",children:[d.jsx(Mt,{htmlFor:w,children:m[w]??w}),y[w]&&d.jsx("a",{href:y[w],target:"_blank",rel:"noopener noreferrer",className:"text-primary text-xs hover:underline",children:"Get API key →"})]}),d.jsx(It,{id:w,type:"password",placeholder:r[w]==="set"?"(already set)":"sk-...",value:a[w]??"",onChange:_=>i({...a,[w]:_.target.value}),autoComplete:"off"})]},w))})]}),f&&d.jsx("div",{className:"text-destructive text-sm",children:f}),d.jsxs("div",{className:"flex justify-between",children:[d.jsx(je,{variant:"outline",onClick:()=>o(0),children:"Back"}),d.jsxs("div",{className:"flex gap-2",children:[(x||S)&&d.jsx(je,{variant:"outline",onClick:()=>o(2),children:h.length===0?"Next":"Skip for now"}),S&&d.jsx(je,{onClick:()=>s(2),disabled:u,children:u?"Saving…":"Save & Next"}),x&&!S&&h.length>0&&d.jsx(je,{onClick:()=>o(2),children:"Next"})]})]})]})}function SI(){const{setStep:e,selectedProviders:r}=Fs(),i=r.includes("ollama")?4:3;return d.jsxs("div",{className:"space-y-6",children:[d.jsx("p",{className:"text-muted-foreground text-sm",children:"You can connect apps (GitHub, Gmail, Twitter, etc.) in two ways:"}),d.jsxs("ul",{className:"text-muted-foreground list-disc list-inside space-y-1 text-sm",children:[d.jsxs("li",{children:[d.jsx("strong",{children:"MCP Servers"})," — Integrations → MCP Servers tab. Add servers and API keys (e.g. YouTube, Twitter). Find more at"," ",d.jsx("a",{href:"https://mcpservers.org/",target:"_blank",rel:"noopener noreferrer",className:"text-primary underline hover:no-underline",children:"mcpservers.org"}),"."]}),d.jsxs("li",{children:[d.jsx("strong",{children:"Sulala Portal"})," — To use Portal for OAuth apps, add your API key later in ",d.jsx("strong",{children:"Settings → Portal"}),"."]})]}),d.jsx("p",{className:"text-muted-foreground text-xs",children:"Neither is required now. You can set up either option anytime from the dashboard."}),d.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[d.jsx(je,{variant:"outline",onClick:()=>e(1),children:"Back"}),d.jsxs(je,{onClick:()=>e(i),children:["Next",d.jsx(Ga,{className:"ml-1 size-4"})]})]})]})}function kI({m:e,installed:r,pulling:a,onPull:i}){return d.jsxs("div",{className:"border-input flex flex-col gap-2 rounded-lg border p-4 sm:flex-row sm:items-center sm:justify-between",children:[d.jsxs("div",{children:[d.jsx("div",{className:"font-medium",children:e.name}),d.jsx("div",{className:"text-muted-foreground text-sm",children:e.description}),d.jsxs("div",{className:"mt-1 flex flex-wrap gap-2 text-xs",children:[d.jsxs("span",{className:"flex items-center gap-1",children:[d.jsx(cS,{className:"size-3"})," ",e.size]}),d.jsxs("span",{className:"flex items-center gap-1",children:[d.jsx(W5,{className:"size-3"})," ",e.ram," RAM"]}),d.jsxs("span",{className:"flex items-center gap-1",children:[d.jsx(lS,{className:"size-3"})," ",e.cpu]}),e.gpu!=="None"&&d.jsxs("span",{children:["GPU: ",e.gpu]})]})]}),d.jsx(je,{variant:r?"secondary":"default",size:"sm",onClick:i,disabled:r||a,children:r?"Installed":a?"Installing…":"Install"})]})}function _I(){const{recommendedModels:e,ollamaRunning:r,ollamaStatusLoading:a,pullState:i,pullingModels:s,pullModel:o,installOllama:u,setStep:f,checkOllama:h,systemCapabilities:m,error:y}=Fs(),p=()=>{window.confirm("Ollama will be downloaded and installed (~500MB). This requires network access and sufficient disk space. Continue?")&&u()},b=w=>{const _=m?.storageFreeBytes??0,k=yI(w.size);if(k!=null&&_>0&&k>_){alert(`Insufficient storage. This model needs ~${w.size}. You have ${(_/1024/1024/1024).toFixed(1)}GB free.`);return}window.confirm(`Download and install ${w.name}? This will use ~${w.size} of disk space. Continue?`)&&o(w.id)},x=new Set;i.inProgress&&i.model&&x.add(i.model);const S=m&&!m.ollamaSuitable;return d.jsxs("div",{className:"space-y-6",children:[d.jsx("div",{className:"rounded-lg border border-amber-500/50 bg-amber-500/10 p-3 text-sm",children:d.jsx("p",{className:"text-amber-700 dark:text-amber-400",children:"⚠️ Ollama cannot run tools and perform like other providers (e.g. OpenAI, OpenRouter). For full tool support and best results, use a cloud provider."})}),S&&d.jsx("div",{className:"rounded-lg border border-amber-500/50 bg-amber-500/10 p-3 text-sm",children:d.jsxs("p",{className:"text-amber-700 dark:text-amber-400",children:["⚠️ ",m.ollamaSuitableReason," Ollama may not run well here."]})}),a?d.jsx("p",{className:"text-muted-foreground text-sm",children:"Checking Ollama…"}):r===!1?d.jsxs("div",{className:"rounded-lg border border-amber-500/50 bg-amber-500/10 p-4",children:[d.jsxs("p",{className:"text-amber-700 dark:text-amber-400 text-sm",children:["⚠️ Ollama is not running. Click Install to download Ollama, or install from"," ",d.jsx("a",{href:"https://ollama.com",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"ollama.com"})," ","and run ",d.jsx("code",{children:"ollama serve"}),"."]}),d.jsxs("div",{className:"mt-2 flex gap-2",children:[d.jsx(je,{variant:"default",size:"sm",onClick:p,disabled:a,children:"Install Ollama"}),d.jsx(je,{variant:"outline",size:"sm",onClick:h,disabled:a,children:"Check again"})]})]}):null,i.inProgress&&d.jsxs("div",{className:"rounded-lg border border-blue-500/50 bg-blue-500/10 p-4",children:[d.jsxs("div",{className:"font-medium",children:["Pulling ",i.model,"…"]}),i.percent>=0&&i.percent<=100&&d.jsx(Hm,{value:i.percent,className:"mt-2 h-2"}),i.lastLine&&d.jsx("div",{className:"text-muted-foreground mt-1 truncate font-mono text-xs",children:i.lastLine})]}),d.jsx("p",{className:"text-muted-foreground text-sm",children:"Select models to install. You can skip and install later from Settings."}),d.jsx("div",{className:"grid gap-3",children:e.map(w=>d.jsx(kI,{m:w,installed:!1,pulling:s.has(w.id),onPull:()=>b(w)},w.id))}),y&&d.jsx("div",{className:"text-destructive text-sm",children:y}),d.jsxs("div",{className:"flex justify-between",children:[d.jsx(je,{variant:"outline",onClick:()=>f(2),children:"Back"}),d.jsx(je,{onClick:()=>f(4),children:"Skip or Next"})]})]})}function s0(){const{selectedProviders:e,finishOnboarding:r,loading:a,error:i,setStep:s}=Fs(),o=e.includes("ollama");return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{children:[d.jsx("h3",{className:"font-semibold",children:"Summary"}),d.jsx("ul",{className:"text-muted-foreground mt-2 space-y-1 text-sm",children:d.jsxs("li",{className:"flex items-center gap-2",children:[d.jsx(Rh,{className:"size-4 text-green-600"}),"AI providers: ",e.join(", ")||"None"]})})]}),d.jsx("p",{className:"text-muted-foreground text-sm",children:"Click Finish to complete onboarding and open the dashboard. You can change providers anytime in Settings."}),i&&d.jsx("div",{className:"text-destructive text-sm",children:i}),d.jsxs("div",{className:"flex justify-between",children:[d.jsx(je,{variant:"outline",onClick:()=>s(o?3:2),children:"Back"}),d.jsx(je,{onClick:r,disabled:a,children:a?"Finishing…":"Finish"})]})]})}function jI({onComplete:e}){const r=gI(e),{step:a,selectedProviders:i}=r,s=i.includes("ollama"),o=s?5:4,u=s?xI:vI,f=Math.max(0,Math.min(a,o-1)),h={0:"Choose which AI providers you want to use.",1:"Enter API keys for cloud providers.",2:"Connect apps via MCP servers or Sulala Portal (optional). Add Portal API key in Settings → Portal if you use Portal.",...s?{3:"Install local models with Ollama.",4:"Review and complete setup."}:{3:"Review and complete setup."}};return d.jsx(h2.Provider,{value:r,children:d.jsx("div",{className:"bg-background flex min-h-screen flex-col items-center justify-center p-4",children:d.jsxs("div",{className:"w-full max-w-2xl space-y-8",children:[d.jsxs("div",{className:"text-center",children:[d.jsx("h1",{className:"text-2xl font-bold",children:"Welcome to Sulala"}),d.jsxs("p",{className:"text-muted-foreground mt-1 text-sm",children:["Step ",f+1," of ",o,": ",u[f]]}),d.jsx(Hm,{value:(f+1)/o*100,className:"mt-4 h-2"})]}),d.jsxs(St,{children:[d.jsxs(At,{children:[d.jsx(Tt,{children:u[f]}),d.jsx(Rt,{children:h[f]})]}),d.jsxs(kt,{children:[f===0&&d.jsx(bI,{}),f===1&&d.jsx(wI,{}),f===2&&d.jsx(SI,{}),f===3&&(s?d.jsx(_I,{}):d.jsx(s0,{})),f===4&&s&&d.jsx(s0,{})]})]})]})})})}function CI(){const[e,r]=j.useState(null),[a,i]=j.useState(()=>{if(typeof window>"u")return"chat";const _=new URLSearchParams(window.location.search).get("page");return["chat","skills","jobs","settings","overview","tasks","logs","files","config"].includes(_)?_:"chat"}),[s,o]=j.useState(null);j.useEffect(()=>{console.log("fetching onboarding status"),zm().then(({complete:_})=>{console.log("onboarding status",_),r(_)}).catch(_=>{console.error("error fetching onboarding status",_);const k=_.message||String(_);r(!!(k.includes("429")||k.includes("fetch")))})},[]);const[u,f]=j.useState(null),h=TR(_=>o(_)),m=DR(_=>o(_)),y=iO(a,_=>o(_),{onMissingIntegrations:_=>f(_)}),p=G8(a);j.useEffect(()=>{(a==="settings"||a==="jobs")&&h.load()},[a]);const b=j.useRef(()=>{});b.current=m.loadSkills;const{events:x,connected:S}=uI({onSkillsChanged:()=>b.current?.()});if(j.useEffect(()=>{a==="skills"&&m.loadSkillsData()},[a]),e===null)return d.jsx("div",{className:"bg-background flex min-h-screen flex-col items-center justify-center",children:d.jsx("div",{className:"text-muted-foreground text-sm",children:"Loading…"})});if(!e)return d.jsx(EI,{onComplete:()=>{window.location.reload()}});const w=_=>{if(i(_),typeof window<"u"){const k=new URL(window.location.href);k.searchParams.set("page",_),window.history.replaceState({},"",k.toString())}};return d.jsxs(NR,{activePage:a,onNavigate:w,error:s,children:[a==="chat"&&d.jsx(B8,{...y,integrations:[],onNavigateToIntegrations:()=>w("skills"),missingIntegrationsFromServer:u,onClearMissingIntegrationsFromServer:()=>f(null)}),a==="skills"&&d.jsx(KR,{...m,onNavigateToSettings:()=>w("settings")}),a==="jobs"&&d.jsx(H8,{schedules:h.schedules,loading:h.loading,load:h.load,onCreateSchedule:h.handleCreateSchedule,onUpdateSchedule:h.handleUpdateSchedule,onDeleteSchedule:h.handleDeleteSchedule,onRunSchedule:h.handleRunSchedule,onFetchScheduleRuns:h.handleFetchScheduleRuns,onNavigateToSettings:()=>w("settings")}),a==="settings"&&d.jsx(sI,{health:h.health,loading:h.loading,connected:S,events:x,tasks:h.tasks,load:h.load,enqueueType:h.enqueueType,setEnqueueType:h.setEnqueueType,enqueuePayload:h.enqueuePayload,setEnqueuePayload:h.setEnqueuePayload,enqueueing:h.enqueueing,actionTaskId:h.actionTaskId,handleTaskCancel:h.handleTaskCancel,handleTaskRetry:h.handleTaskRetry,handleEnqueue:h.handleEnqueue,logs:h.logs,fileStates:h.fileStates,config:p,onError:_=>o(_)})]})}function EI({onComplete:e}){return d.jsx(jI,{onComplete:e})}Lj.createRoot(document.getElementById("root")).render(d.jsx(j.StrictMode,{children:d.jsx(CI,{})}));
|