@mukulaggarwal/pacman 0.1.5 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,99 @@
1
+ (function(){const f=document.createElement("link").relList;if(f&&f.supports&&f.supports("modulepreload"))return;for(const N of document.querySelectorAll('link[rel="modulepreload"]'))d(N);new MutationObserver(N=>{for(const H of N)if(H.type==="childList")for(const F of H.addedNodes)F.tagName==="LINK"&&F.rel==="modulepreload"&&d(F)}).observe(document,{childList:!0,subtree:!0});function x(N){const H={};return N.integrity&&(H.integrity=N.integrity),N.referrerPolicy&&(H.referrerPolicy=N.referrerPolicy),N.crossOrigin==="use-credentials"?H.credentials="include":N.crossOrigin==="anonymous"?H.credentials="omit":H.credentials="same-origin",H}function d(N){if(N.ep)return;N.ep=!0;const H=x(N);fetch(N.href,H)}})();function Yg(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var Ao={exports:{}},Wi={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var bg;function $h(){if(bg)return Wi;bg=1;var s=Symbol.for("react.transitional.element"),f=Symbol.for("react.fragment");function x(d,N,H){var F=null;if(H!==void 0&&(F=""+H),N.key!==void 0&&(F=""+N.key),"key"in N){H={};for(var Q in N)Q!=="key"&&(H[Q]=N[Q])}else H=N;return N=H.ref,{$$typeof:s,type:d,key:F,ref:N!==void 0?N:null,props:H}}return Wi.Fragment=f,Wi.jsx=x,Wi.jsxs=x,Wi}var xg;function Wh(){return xg||(xg=1,Ao.exports=$h()),Ao.exports}var i=Wh(),Eo={exports:{}},re={};/**
10
+ * @license React
11
+ * react.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var Sg;function Ih(){if(Sg)return re;Sg=1;var s=Symbol.for("react.transitional.element"),f=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),d=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),H=Symbol.for("react.consumer"),F=Symbol.for("react.context"),Q=Symbol.for("react.forward_ref"),U=Symbol.for("react.suspense"),T=Symbol.for("react.memo"),J=Symbol.for("react.lazy"),X=Symbol.for("react.activity"),ae=Symbol.iterator;function de(h){return h===null||typeof h!="object"?null:(h=ae&&h[ae]||h["@@iterator"],typeof h=="function"?h:null)}var Ee={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},De=Object.assign,Oe={};function je(h,z,q){this.props=h,this.context=z,this.refs=Oe,this.updater=q||Ee}je.prototype.isReactComponent={},je.prototype.setState=function(h,z){if(typeof h!="object"&&typeof h!="function"&&h!=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,h,z,"setState")},je.prototype.forceUpdate=function(h){this.updater.enqueueForceUpdate(this,h,"forceUpdate")};function ce(){}ce.prototype=je.prototype;function fe(h,z,q){this.props=h,this.context=z,this.refs=Oe,this.updater=q||Ee}var Ce=fe.prototype=new ce;Ce.constructor=fe,De(Ce,je.prototype),Ce.isPureReactComponent=!0;var Ze=Array.isArray;function ge(){}var V={H:null,A:null,T:null,S:null},Ue=Object.prototype.hasOwnProperty;function me(h,z,q){var K=q.ref;return{$$typeof:s,type:h,key:z,ref:K!==void 0?K:null,props:q}}function ct(h,z){return me(h.type,z,h.props)}function st(h){return typeof h=="object"&&h!==null&&h.$$typeof===s}function ut(h){var z={"=":"=0",":":"=2"};return"$"+h.replace(/[=:]/g,function(q){return z[q]})}var Ie=/\/+/g;function yt(h,z){return typeof h=="object"&&h!==null&&h.key!=null?ut(""+h.key):z.toString(36)}function gt(h){switch(h.status){case"fulfilled":return h.value;case"rejected":throw h.reason;default:switch(typeof h.status=="string"?h.then(ge,ge):(h.status="pending",h.then(function(z){h.status==="pending"&&(h.status="fulfilled",h.value=z)},function(z){h.status==="pending"&&(h.status="rejected",h.reason=z)})),h.status){case"fulfilled":return h.value;case"rejected":throw h.reason}}throw h}function C(h,z,q,K,le){var se=typeof h;(se==="undefined"||se==="boolean")&&(h=null);var he=!1;if(h===null)he=!0;else switch(se){case"bigint":case"string":case"number":he=!0;break;case"object":switch(h.$$typeof){case s:case f:he=!0;break;case J:return he=h._init,C(he(h._payload),z,q,K,le)}}if(he)return le=le(h),he=K===""?"."+yt(h,0):K,Ze(le)?(q="",he!=null&&(q=he.replace(Ie,"$&/")+"/"),C(le,z,q,"",function(He){return He})):le!=null&&(st(le)&&(le=ct(le,q+(le.key==null||h&&h.key===le.key?"":(""+le.key).replace(Ie,"$&/")+"/")+he)),z.push(le)),1;he=0;var mt=K===""?".":K+":";if(Ze(h))for(var Ke=0;Ke<h.length;Ke++)K=h[Ke],se=mt+yt(K,Ke),he+=C(K,z,q,se,le);else if(Ke=de(h),typeof Ke=="function")for(h=Ke.call(h),Ke=0;!(K=h.next()).done;)K=K.value,se=mt+yt(K,Ke++),he+=C(K,z,q,se,le);else if(se==="object"){if(typeof h.then=="function")return C(gt(h),z,q,K,le);throw z=String(h),Error("Objects are not valid as a React child (found: "+(z==="[object Object]"?"object with keys {"+Object.keys(h).join(", ")+"}":z)+"). If you meant to render a collection of children, use an array instead.")}return he}function L(h,z,q){if(h==null)return h;var K=[],le=0;return C(h,K,"","",function(se){return z.call(q,se,le++)}),K}function W(h){if(h._status===-1){var z=h._result;z=z(),z.then(function(q){(h._status===0||h._status===-1)&&(h._status=1,h._result=q)},function(q){(h._status===0||h._status===-1)&&(h._status=2,h._result=q)}),h._status===-1&&(h._status=0,h._result=z)}if(h._status===1)return h._result.default;throw h._result}var ne=typeof reportError=="function"?reportError:function(h){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var z=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof h=="object"&&h!==null&&typeof h.message=="string"?String(h.message):String(h),error:h});if(!window.dispatchEvent(z))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",h);return}console.error(h)},ye={map:L,forEach:function(h,z,q){L(h,function(){z.apply(this,arguments)},q)},count:function(h){var z=0;return L(h,function(){z++}),z},toArray:function(h){return L(h,function(z){return z})||[]},only:function(h){if(!st(h))throw Error("React.Children.only expected to receive a single React element child.");return h}};return re.Activity=X,re.Children=ye,re.Component=je,re.Fragment=x,re.Profiler=N,re.PureComponent=fe,re.StrictMode=d,re.Suspense=U,re.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=V,re.__COMPILER_RUNTIME={__proto__:null,c:function(h){return V.H.useMemoCache(h)}},re.cache=function(h){return function(){return h.apply(null,arguments)}},re.cacheSignal=function(){return null},re.cloneElement=function(h,z,q){if(h==null)throw Error("The argument must be a React element, but you passed "+h+".");var K=De({},h.props),le=h.key;if(z!=null)for(se in z.key!==void 0&&(le=""+z.key),z)!Ue.call(z,se)||se==="key"||se==="__self"||se==="__source"||se==="ref"&&z.ref===void 0||(K[se]=z[se]);var se=arguments.length-2;if(se===1)K.children=q;else if(1<se){for(var he=Array(se),mt=0;mt<se;mt++)he[mt]=arguments[mt+2];K.children=he}return me(h.type,le,K)},re.createContext=function(h){return h={$$typeof:F,_currentValue:h,_currentValue2:h,_threadCount:0,Provider:null,Consumer:null},h.Provider=h,h.Consumer={$$typeof:H,_context:h},h},re.createElement=function(h,z,q){var K,le={},se=null;if(z!=null)for(K in z.key!==void 0&&(se=""+z.key),z)Ue.call(z,K)&&K!=="key"&&K!=="__self"&&K!=="__source"&&(le[K]=z[K]);var he=arguments.length-2;if(he===1)le.children=q;else if(1<he){for(var mt=Array(he),Ke=0;Ke<he;Ke++)mt[Ke]=arguments[Ke+2];le.children=mt}if(h&&h.defaultProps)for(K in he=h.defaultProps,he)le[K]===void 0&&(le[K]=he[K]);return me(h,se,le)},re.createRef=function(){return{current:null}},re.forwardRef=function(h){return{$$typeof:Q,render:h}},re.isValidElement=st,re.lazy=function(h){return{$$typeof:J,_payload:{_status:-1,_result:h},_init:W}},re.memo=function(h,z){return{$$typeof:T,type:h,compare:z===void 0?null:z}},re.startTransition=function(h){var z=V.T,q={};V.T=q;try{var K=h(),le=V.S;le!==null&&le(q,K),typeof K=="object"&&K!==null&&typeof K.then=="function"&&K.then(ge,ne)}catch(se){ne(se)}finally{z!==null&&q.types!==null&&(z.types=q.types),V.T=z}},re.unstable_useCacheRefresh=function(){return V.H.useCacheRefresh()},re.use=function(h){return V.H.use(h)},re.useActionState=function(h,z,q){return V.H.useActionState(h,z,q)},re.useCallback=function(h,z){return V.H.useCallback(h,z)},re.useContext=function(h){return V.H.useContext(h)},re.useDebugValue=function(){},re.useDeferredValue=function(h,z){return V.H.useDeferredValue(h,z)},re.useEffect=function(h,z){return V.H.useEffect(h,z)},re.useEffectEvent=function(h){return V.H.useEffectEvent(h)},re.useId=function(){return V.H.useId()},re.useImperativeHandle=function(h,z,q){return V.H.useImperativeHandle(h,z,q)},re.useInsertionEffect=function(h,z){return V.H.useInsertionEffect(h,z)},re.useLayoutEffect=function(h,z){return V.H.useLayoutEffect(h,z)},re.useMemo=function(h,z){return V.H.useMemo(h,z)},re.useOptimistic=function(h,z){return V.H.useOptimistic(h,z)},re.useReducer=function(h,z,q){return V.H.useReducer(h,z,q)},re.useRef=function(h){return V.H.useRef(h)},re.useState=function(h){return V.H.useState(h)},re.useSyncExternalStore=function(h,z,q){return V.H.useSyncExternalStore(h,z,q)},re.useTransition=function(){return V.H.useTransition()},re.version="19.2.4",re}var jg;function Uo(){return jg||(jg=1,Eo.exports=Ih()),Eo.exports}var R=Uo();const Xg=Yg(R);var Co={exports:{}},Ii={},Do={exports:{}},Oo={};/**
18
+ * @license React
19
+ * scheduler.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var Ng;function Ph(){return Ng||(Ng=1,(function(s){function f(C,L){var W=C.length;C.push(L);e:for(;0<W;){var ne=W-1>>>1,ye=C[ne];if(0<N(ye,L))C[ne]=L,C[W]=ye,W=ne;else break e}}function x(C){return C.length===0?null:C[0]}function d(C){if(C.length===0)return null;var L=C[0],W=C.pop();if(W!==L){C[0]=W;e:for(var ne=0,ye=C.length,h=ye>>>1;ne<h;){var z=2*(ne+1)-1,q=C[z],K=z+1,le=C[K];if(0>N(q,W))K<ye&&0>N(le,q)?(C[ne]=le,C[K]=W,ne=K):(C[ne]=q,C[z]=W,ne=z);else if(K<ye&&0>N(le,W))C[ne]=le,C[K]=W,ne=K;else break e}}return L}function N(C,L){var W=C.sortIndex-L.sortIndex;return W!==0?W:C.id-L.id}if(s.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var H=performance;s.unstable_now=function(){return H.now()}}else{var F=Date,Q=F.now();s.unstable_now=function(){return F.now()-Q}}var U=[],T=[],J=1,X=null,ae=3,de=!1,Ee=!1,De=!1,Oe=!1,je=typeof setTimeout=="function"?setTimeout:null,ce=typeof clearTimeout=="function"?clearTimeout:null,fe=typeof setImmediate<"u"?setImmediate:null;function Ce(C){for(var L=x(T);L!==null;){if(L.callback===null)d(T);else if(L.startTime<=C)d(T),L.sortIndex=L.expirationTime,f(U,L);else break;L=x(T)}}function Ze(C){if(De=!1,Ce(C),!Ee)if(x(U)!==null)Ee=!0,ge||(ge=!0,ut());else{var L=x(T);L!==null&&gt(Ze,L.startTime-C)}}var ge=!1,V=-1,Ue=5,me=-1;function ct(){return Oe?!0:!(s.unstable_now()-me<Ue)}function st(){if(Oe=!1,ge){var C=s.unstable_now();me=C;var L=!0;try{e:{Ee=!1,De&&(De=!1,ce(V),V=-1),de=!0;var W=ae;try{t:{for(Ce(C),X=x(U);X!==null&&!(X.expirationTime>C&&ct());){var ne=X.callback;if(typeof ne=="function"){X.callback=null,ae=X.priorityLevel;var ye=ne(X.expirationTime<=C);if(C=s.unstable_now(),typeof ye=="function"){X.callback=ye,Ce(C),L=!0;break t}X===x(U)&&d(U),Ce(C)}else d(U);X=x(U)}if(X!==null)L=!0;else{var h=x(T);h!==null&&gt(Ze,h.startTime-C),L=!1}}break e}finally{X=null,ae=W,de=!1}L=void 0}}finally{L?ut():ge=!1}}}var ut;if(typeof fe=="function")ut=function(){fe(st)};else if(typeof MessageChannel<"u"){var Ie=new MessageChannel,yt=Ie.port2;Ie.port1.onmessage=st,ut=function(){yt.postMessage(null)}}else ut=function(){je(st,0)};function gt(C,L){V=je(function(){C(s.unstable_now())},L)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(C){C.callback=null},s.unstable_forceFrameRate=function(C){0>C||125<C?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Ue=0<C?Math.floor(1e3/C):5},s.unstable_getCurrentPriorityLevel=function(){return ae},s.unstable_next=function(C){switch(ae){case 1:case 2:case 3:var L=3;break;default:L=ae}var W=ae;ae=L;try{return C()}finally{ae=W}},s.unstable_requestPaint=function(){Oe=!0},s.unstable_runWithPriority=function(C,L){switch(C){case 1:case 2:case 3:case 4:case 5:break;default:C=3}var W=ae;ae=C;try{return L()}finally{ae=W}},s.unstable_scheduleCallback=function(C,L,W){var ne=s.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?ne+W:ne):W=ne,C){case 1:var ye=-1;break;case 2:ye=250;break;case 5:ye=1073741823;break;case 4:ye=1e4;break;default:ye=5e3}return ye=W+ye,C={id:J++,callback:L,priorityLevel:C,startTime:W,expirationTime:ye,sortIndex:-1},W>ne?(C.sortIndex=W,f(T,C),x(U)===null&&C===x(T)&&(De?(ce(V),V=-1):De=!0,gt(Ze,W-ne))):(C.sortIndex=ye,f(U,C),Ee||de||(Ee=!0,ge||(ge=!0,ut()))),C},s.unstable_shouldYield=ct,s.unstable_wrapCallback=function(C){var L=ae;return function(){var W=ae;ae=L;try{return C.apply(this,arguments)}finally{ae=W}}}})(Oo)),Oo}var Tg;function ep(){return Tg||(Tg=1,Do.exports=Ph()),Do.exports}var zo={exports:{}},Ht={};/**
26
+ * @license React
27
+ * react-dom.production.js
28
+ *
29
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var Ag;function tp(){if(Ag)return Ht;Ag=1;var s=Uo();function f(U){var T="https://react.dev/errors/"+U;if(1<arguments.length){T+="?args[]="+encodeURIComponent(arguments[1]);for(var J=2;J<arguments.length;J++)T+="&args[]="+encodeURIComponent(arguments[J])}return"Minified React error #"+U+"; visit "+T+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function x(){}var d={d:{f:x,r:function(){throw Error(f(522))},D:x,C:x,L:x,m:x,X:x,S:x,M:x},p:0,findDOMNode:null},N=Symbol.for("react.portal");function H(U,T,J){var X=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:N,key:X==null?null:""+X,children:U,containerInfo:T,implementation:J}}var F=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function Q(U,T){if(U==="font")return"";if(typeof T=="string")return T==="use-credentials"?T:""}return Ht.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=d,Ht.createPortal=function(U,T){var J=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!T||T.nodeType!==1&&T.nodeType!==9&&T.nodeType!==11)throw Error(f(299));return H(U,T,null,J)},Ht.flushSync=function(U){var T=F.T,J=d.p;try{if(F.T=null,d.p=2,U)return U()}finally{F.T=T,d.p=J,d.d.f()}},Ht.preconnect=function(U,T){typeof U=="string"&&(T?(T=T.crossOrigin,T=typeof T=="string"?T==="use-credentials"?T:"":void 0):T=null,d.d.C(U,T))},Ht.prefetchDNS=function(U){typeof U=="string"&&d.d.D(U)},Ht.preinit=function(U,T){if(typeof U=="string"&&T&&typeof T.as=="string"){var J=T.as,X=Q(J,T.crossOrigin),ae=typeof T.integrity=="string"?T.integrity:void 0,de=typeof T.fetchPriority=="string"?T.fetchPriority:void 0;J==="style"?d.d.S(U,typeof T.precedence=="string"?T.precedence:void 0,{crossOrigin:X,integrity:ae,fetchPriority:de}):J==="script"&&d.d.X(U,{crossOrigin:X,integrity:ae,fetchPriority:de,nonce:typeof T.nonce=="string"?T.nonce:void 0})}},Ht.preinitModule=function(U,T){if(typeof U=="string")if(typeof T=="object"&&T!==null){if(T.as==null||T.as==="script"){var J=Q(T.as,T.crossOrigin);d.d.M(U,{crossOrigin:J,integrity:typeof T.integrity=="string"?T.integrity:void 0,nonce:typeof T.nonce=="string"?T.nonce:void 0})}}else T==null&&d.d.M(U)},Ht.preload=function(U,T){if(typeof U=="string"&&typeof T=="object"&&T!==null&&typeof T.as=="string"){var J=T.as,X=Q(J,T.crossOrigin);d.d.L(U,J,{crossOrigin:X,integrity:typeof T.integrity=="string"?T.integrity:void 0,nonce:typeof T.nonce=="string"?T.nonce:void 0,type:typeof T.type=="string"?T.type:void 0,fetchPriority:typeof T.fetchPriority=="string"?T.fetchPriority:void 0,referrerPolicy:typeof T.referrerPolicy=="string"?T.referrerPolicy:void 0,imageSrcSet:typeof T.imageSrcSet=="string"?T.imageSrcSet:void 0,imageSizes:typeof T.imageSizes=="string"?T.imageSizes:void 0,media:typeof T.media=="string"?T.media:void 0})}},Ht.preloadModule=function(U,T){if(typeof U=="string")if(T){var J=Q(T.as,T.crossOrigin);d.d.m(U,{as:typeof T.as=="string"&&T.as!=="script"?T.as:void 0,crossOrigin:J,integrity:typeof T.integrity=="string"?T.integrity:void 0})}else d.d.m(U)},Ht.requestFormReset=function(U){d.d.r(U)},Ht.unstable_batchedUpdates=function(U,T){return U(T)},Ht.useFormState=function(U,T,J){return F.H.useFormState(U,T,J)},Ht.useFormStatus=function(){return F.H.useHostTransitionStatus()},Ht.version="19.2.4",Ht}var Eg;function lp(){if(Eg)return zo.exports;Eg=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(f){console.error(f)}}return s(),zo.exports=tp(),zo.exports}/**
34
+ * @license React
35
+ * react-dom-client.production.js
36
+ *
37
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var Cg;function ap(){if(Cg)return Ii;Cg=1;var s=ep(),f=Uo(),x=lp();function d(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)t+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function N(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function H(e){var t=e,l=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(l=t.return),e=t.return;while(e)}return t.tag===3?l:null}function F(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Q(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function U(e){if(H(e)!==e)throw Error(d(188))}function T(e){var t=e.alternate;if(!t){if(t=H(e),t===null)throw Error(d(188));return t!==e?null:e}for(var l=e,a=t;;){var n=l.return;if(n===null)break;var c=n.alternate;if(c===null){if(a=n.return,a!==null){l=a;continue}break}if(n.child===c.child){for(c=n.child;c;){if(c===l)return U(n),e;if(c===a)return U(n),t;c=c.sibling}throw Error(d(188))}if(l.return!==a.return)l=n,a=c;else{for(var r=!1,u=n.child;u;){if(u===l){r=!0,l=n,a=c;break}if(u===a){r=!0,a=n,l=c;break}u=u.sibling}if(!r){for(u=c.child;u;){if(u===l){r=!0,l=c,a=n;break}if(u===a){r=!0,a=c,l=n;break}u=u.sibling}if(!r)throw Error(d(189))}}if(l.alternate!==a)throw Error(d(190))}if(l.tag!==3)throw Error(d(188));return l.stateNode.current===l?e:t}function J(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=J(e),t!==null)return t;e=e.sibling}return null}var X=Object.assign,ae=Symbol.for("react.element"),de=Symbol.for("react.transitional.element"),Ee=Symbol.for("react.portal"),De=Symbol.for("react.fragment"),Oe=Symbol.for("react.strict_mode"),je=Symbol.for("react.profiler"),ce=Symbol.for("react.consumer"),fe=Symbol.for("react.context"),Ce=Symbol.for("react.forward_ref"),Ze=Symbol.for("react.suspense"),ge=Symbol.for("react.suspense_list"),V=Symbol.for("react.memo"),Ue=Symbol.for("react.lazy"),me=Symbol.for("react.activity"),ct=Symbol.for("react.memo_cache_sentinel"),st=Symbol.iterator;function ut(e){return e===null||typeof e!="object"?null:(e=st&&e[st]||e["@@iterator"],typeof e=="function"?e:null)}var Ie=Symbol.for("react.client.reference");function yt(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Ie?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case De:return"Fragment";case je:return"Profiler";case Oe:return"StrictMode";case Ze:return"Suspense";case ge:return"SuspenseList";case me:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case Ee:return"Portal";case fe:return e.displayName||"Context";case ce:return(e._context.displayName||"Context")+".Consumer";case Ce:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case V:return t=e.displayName||null,t!==null?t:yt(e.type)||"Memo";case Ue:t=e._payload,e=e._init;try{return yt(e(t))}catch{}}return null}var gt=Array.isArray,C=f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L=x.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W={pending:!1,data:null,method:null,action:null},ne=[],ye=-1;function h(e){return{current:e}}function z(e){0>ye||(e.current=ne[ye],ne[ye]=null,ye--)}function q(e,t){ye++,ne[ye]=e.current,e.current=t}var K=h(null),le=h(null),se=h(null),he=h(null);function mt(e,t){switch(q(se,t),q(le,e),q(K,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?qf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=qf(t),e=Yf(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}z(K),q(K,e)}function Ke(){z(K),z(le),z(se)}function He(e){e.memoizedState!==null&&q(he,e);var t=K.current,l=Yf(t,e.type);t!==l&&(q(le,e),q(K,l))}function el(e){le.current===e&&(z(K),z(le)),he.current===e&&(z(he),Zi._currentValue=W)}var ga,tl;function lt(e){if(ga===void 0)try{throw Error()}catch(l){var t=l.stack.trim().match(/\n( *(at )?)/);ga=t&&t[1]||"",tl=-1<l.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+ga+e+tl}var Dt=!1;function ze(e,t){if(!e||Dt)return"";Dt=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(t){var G=function(){throw Error()};if(Object.defineProperty(G.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(G,[])}catch(E){var A=E}Reflect.construct(e,[],G)}else{try{G.call()}catch(E){A=E}e.call(G.prototype)}}else{try{throw Error()}catch(E){A=E}(G=e())&&typeof G.catch=="function"&&G.catch(function(){})}}catch(E){if(E&&A&&typeof E.stack=="string")return[E.stack,A.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var n=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");n&&n.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var c=a.DetermineComponentFrameRoot(),r=c[0],u=c[1];if(r&&u){var g=r.split(`
44
+ `),j=u.split(`
45
+ `);for(n=a=0;a<g.length&&!g[a].includes("DetermineComponentFrameRoot");)a++;for(;n<j.length&&!j[n].includes("DetermineComponentFrameRoot");)n++;if(a===g.length||n===j.length)for(a=g.length-1,n=j.length-1;1<=a&&0<=n&&g[a]!==j[n];)n--;for(;1<=a&&0<=n;a--,n--)if(g[a]!==j[n]){if(a!==1||n!==1)do if(a--,n--,0>n||g[a]!==j[n]){var O=`
46
+ `+g[a].replace(" at new "," at ");return e.displayName&&O.includes("<anonymous>")&&(O=O.replace("<anonymous>",e.displayName)),O}while(1<=a&&0<=n);break}}}finally{Dt=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?lt(l):""}function Yt(e,t){switch(e.tag){case 26:case 27:case 5:return lt(e.type);case 16:return lt("Lazy");case 13:return e.child!==t&&t!==null?lt("Suspense Fallback"):lt("Suspense");case 19:return lt("SuspenseList");case 0:case 15:return ze(e.type,!1);case 11:return ze(e.type.render,!1);case 1:return ze(e.type,!0);case 31:return lt("Activity");default:return""}}function ht(e){try{var t="",l=null;do t+=Yt(e,l),l=e,e=e.return;while(e);return t}catch(a){return`
47
+ Error generating stack: `+a.message+`
48
+ `+a.stack}}var rt=Object.prototype.hasOwnProperty,Tl=s.unstable_scheduleCallback,Yl=s.unstable_cancelCallback,Xt=s.unstable_shouldYield,Xl=s.unstable_requestPaint,bt=s.unstable_now,pn=s.unstable_getCurrentPriorityLevel,fl=s.unstable_ImmediatePriority,ll=s.unstable_UserBlockingPriority,Ql=s.unstable_NormalPriority,Fa=s.unstable_LowPriority,ma=s.unstable_IdlePriority,qa=s.log,Rt=s.unstable_setDisableYieldValue,al=null,at=null;function Bt(e){if(typeof qa=="function"&&Rt(e),at&&typeof at.setStrictMode=="function")try{at.setStrictMode(al,e)}catch{}}var At=Math.clz32?Math.clz32:ii,Al=Math.log,Ya=Math.LN2;function ii(e){return e>>>=0,e===0?32:31-(Al(e)/Ya|0)|0}var _l=256,m=262144,k=4194304;function _(e){var t=e&42;if(t!==0)return t;switch(e&-e){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 e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function I(e,t,l){var a=e.pendingLanes;if(a===0)return 0;var n=0,c=e.suspendedLanes,r=e.pingedLanes;e=e.warmLanes;var u=a&134217727;return u!==0?(a=u&~c,a!==0?n=_(a):(r&=u,r!==0?n=_(r):l||(l=u&~e,l!==0&&(n=_(l))))):(u=a&~c,u!==0?n=_(u):r!==0?n=_(r):l||(l=a&~e,l!==0&&(n=_(l)))),n===0?0:t!==0&&t!==n&&(t&c)===0&&(c=n&-n,l=t&-t,c>=l||c===32&&(l&4194048)!==0)?t:n}function ie(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function b(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 we(){var e=k;return k<<=1,(k&62914560)===0&&(k=4194304),e}function Vl(e){for(var t=[],l=0;31>l;l++)t.push(e);return t}function Je(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Zl(e,t,l,a,n,c){var r=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var u=e.entanglements,g=e.expirationTimes,j=e.hiddenUpdates;for(l=r&~l;0<l;){var O=31-At(l),G=1<<O;u[O]=0,g[O]=-1;var A=j[O];if(A!==null)for(j[O]=null,O=0;O<A.length;O++){var E=A[O];E!==null&&(E.lane&=-536870913)}l&=~G}a!==0&&wl(e,a,0),c!==0&&n===0&&e.tag!==0&&(e.suspendedLanes|=c&~(r&~t))}function wl(e,t,l){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-At(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|l&261930}function Mt(e,t){var l=e.entangledLanes|=t;for(e=e.entanglements;l;){var a=31-At(l),n=1<<a;n&t|e[a]&t&&(e[a]|=t),l&=~n}}function ci(e,t){var l=t&-t;return l=(l&42)!==0?1:lc(l),(l&(e.suspendedLanes|t))!==0?0:l}function lc(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Xa(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function ac(){var e=L.p;return e!==0?e:(e=window.event,e===void 0?32:fg(e.type))}function Kl(e,t){var l=L.p;try{return L.p=e,t()}finally{L.p=l}}var El=Math.random().toString(36).slice(2),$e="__reactFiber$"+El,Pe="__reactProps$"+El,Rl="__reactContainer$"+El,Qa="__reactEvents$"+El,Ts="__reactListeners$"+El,Ut="__reactHandles$"+El,Bl="__reactResources$"+El,Va="__reactMarker$"+El;function vn(e){delete e[$e],delete e[Pe],delete e[Qa],delete e[Ts],delete e[Ut]}function Jl(e){var t=e[$e];if(t)return t;for(var l=e.parentNode;l;){if(t=l[Rl]||l[$e]){if(l=t.alternate,t.child!==null||l!==null&&l.child!==null)for(e=$f(e);e!==null;){if(l=e[$e])return l;e=$f(e)}return t}e=l,l=e.parentNode}return null}function ha(e){if(e=e[$e]||e[Rl]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Za(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(d(33))}function pa(e){var t=e[Bl];return t||(t=e[Bl]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function xt(e){e[Va]=!0}var nc=new Set,si={};function gl(e,t){Cl(e,t),Cl(e+"Capture",t)}function Cl(e,t){for(si[e]=t,e=0;e<t.length;e++)nc.add(t[e])}var Qt=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]*$"),ic={},cc={};function Ge(e){return rt.call(cc,e)?!0:rt.call(ic,e)?!1:Qt.test(e)?cc[e]=!0:(ic[e]=!0,!1)}function ml(e,t,l){if(Ge(t))if(l===null)e.removeAttribute(t);else{switch(typeof l){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var a=t.toLowerCase().slice(0,5);if(a!=="data-"&&a!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+l)}}function yn(e,t,l){if(l===null)e.removeAttribute(t);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+l)}}function Dl(e,t,l,a){if(a===null)e.removeAttribute(l);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(l);return}e.setAttributeNS(t,l,""+a)}}function Vt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function sc(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function rc(e,t,l){var a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var n=a.get,c=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return n.call(this)},set:function(r){l=""+r,c.call(this,r)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return l},setValue:function(r){l=""+r},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function bn(e){if(!e._valueTracker){var t=sc(e)?"checked":"value";e._valueTracker=rc(e,t,""+e[t])}}function oc(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var l=t.getValue(),a="";return e&&(a=sc(e)?e.checked?"true":"false":e.value),e=a,e!==l?(t.setValue(e),!0):!1}function xn(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var As=/[\n"\\]/g;function Ft(e){return e.replace(As,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function ri(e,t,l,a,n,c,r,u){e.name="",r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"?e.type=r:e.removeAttribute("type"),t!=null?r==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Vt(t)):e.value!==""+Vt(t)&&(e.value=""+Vt(t)):r!=="submit"&&r!=="reset"||e.removeAttribute("value"),t!=null?Sn(e,r,Vt(t)):l!=null?Sn(e,r,Vt(l)):a!=null&&e.removeAttribute("value"),n==null&&c!=null&&(e.defaultChecked=!!c),n!=null&&(e.checked=n&&typeof n!="function"&&typeof n!="symbol"),u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"?e.name=""+Vt(u):e.removeAttribute("name")}function uc(e,t,l,a,n,c,r,u){if(c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(e.type=c),t!=null||l!=null){if(!(c!=="submit"&&c!=="reset"||t!=null)){bn(e);return}l=l!=null?""+Vt(l):"",t=t!=null?""+Vt(t):l,u||t===e.value||(e.value=t),e.defaultValue=t}a=a??n,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=u?e.checked:!!a,e.defaultChecked=!!a,r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"&&(e.name=r),bn(e)}function Sn(e,t,l){t==="number"&&xn(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function $l(e,t,l,a){if(e=e.options,t){t={};for(var n=0;n<l.length;n++)t["$"+l[n]]=!0;for(l=0;l<e.length;l++)n=t.hasOwnProperty("$"+e[l].value),e[l].selected!==n&&(e[l].selected=n),n&&a&&(e[l].defaultSelected=!0)}else{for(l=""+Vt(l),t=null,n=0;n<e.length;n++){if(e[n].value===l){e[n].selected=!0,a&&(e[n].defaultSelected=!0);return}t!==null||e[n].disabled||(t=e[n])}t!==null&&(t.selected=!0)}}function oi(e,t,l){if(t!=null&&(t=""+Vt(t),t!==e.value&&(e.value=t),l==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=l!=null?""+Vt(l):""}function ui(e,t,l,a){if(t==null){if(a!=null){if(l!=null)throw Error(d(92));if(gt(a)){if(1<a.length)throw Error(d(93));a=a[0]}l=a}l==null&&(l=""),t=l}l=Vt(t),e.defaultValue=l,a=e.textContent,a===l&&a!==""&&a!==null&&(e.value=a),bn(e)}function Wl(e,t){if(t){var l=e.firstChild;if(l&&l===e.lastChild&&l.nodeType===3){l.nodeValue=t;return}}e.textContent=t}var dc=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 jn(e,t,l){var a=t.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?a?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":a?e.setProperty(t,l):typeof l!="number"||l===0||dc.has(t)?t==="float"?e.cssFloat=l:e[t]=(""+l).trim():e[t]=l+"px"}function di(e,t,l){if(t!=null&&typeof t!="object")throw Error(d(62));if(e=e.style,l!=null){for(var a in l)!l.hasOwnProperty(a)||t!=null&&t.hasOwnProperty(a)||(a.indexOf("--")===0?e.setProperty(a,""):a==="float"?e.cssFloat="":e[a]="");for(var n in t)a=t[n],t.hasOwnProperty(n)&&l[n]!==a&&jn(e,n,a)}else for(var c in t)t.hasOwnProperty(c)&&jn(e,c,t[c])}function Nn(e){if(e.indexOf("-")===-1)return!1;switch(e){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 fc=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"]]),gc=/^[\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 Ka(e){return gc.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function hl(){}var Tn=null;function An(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var o=null,v=null;function D(e){var t=ha(e);if(t&&(e=t.stateNode)){var l=e[Pe]||null;e:switch(e=t.stateNode,t.type){case"input":if(ri(e,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),t=l.name,l.type==="radio"&&t!=null){for(l=e;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+Ft(""+t)+'"][type="radio"]'),t=0;t<l.length;t++){var a=l[t];if(a!==e&&a.form===e.form){var n=a[Pe]||null;if(!n)throw Error(d(90));ri(a,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name)}}for(t=0;t<l.length;t++)a=l[t],a.form===e.form&&oc(a)}break e;case"textarea":oi(e,l.value,l.defaultValue);break e;case"select":t=l.value,t!=null&&$l(e,!!l.multiple,t,!1)}}}var B=!1;function Z(e,t,l){if(B)return e(t,l);B=!0;try{var a=e(t);return a}finally{if(B=!1,(o!==null||v!==null)&&(Pc(),o&&(t=o,e=v,v=o=null,D(t),e)))for(t=0;t<e.length;t++)D(e[t])}}function Y(e,t){var l=e.stateNode;if(l===null)return null;var a=l[Pe]||null;if(a===null)return null;l=a[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(a=!a.disabled)||(e=e.type,a=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!a;break e;default:e=!1}if(e)return null;if(l&&typeof l!="function")throw Error(d(231,t,typeof l));return l}var w=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ne=!1;if(w)try{var Te={};Object.defineProperty(Te,"passive",{get:function(){Ne=!0}}),window.addEventListener("test",Te,Te),window.removeEventListener("test",Te,Te)}catch{Ne=!1}var Et=null,Xe=null,nl=null;function qo(){if(nl)return nl;var e,t=Xe,l=t.length,a,n="value"in Et?Et.value:Et.textContent,c=n.length;for(e=0;e<l&&t[e]===n[e];e++);var r=l-e;for(a=1;a<=r&&t[l-a]===n[c-a];a++);return nl=n.slice(e,1<a?1-a:void 0)}function mc(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function hc(){return!0}function Yo(){return!1}function Zt(e){function t(l,a,n,c,r){this._reactName=l,this._targetInst=n,this.type=a,this.nativeEvent=c,this.target=r,this.currentTarget=null;for(var u in e)e.hasOwnProperty(u)&&(l=e[u],this[u]=l?l(c):c[u]);return this.isDefaultPrevented=(c.defaultPrevented!=null?c.defaultPrevented:c.returnValue===!1)?hc:Yo,this.isPropagationStopped=Yo,this}return X(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=hc)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=hc)},persist:function(){},isPersistent:hc}),t}var Ja={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},pc=Zt(Ja),fi=X({},Ja,{view:0,detail:0}),Kg=Zt(fi),Es,Cs,gi,vc=X({},fi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Os,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==gi&&(gi&&e.type==="mousemove"?(Es=e.screenX-gi.screenX,Cs=e.screenY-gi.screenY):Cs=Es=0,gi=e),Es)},movementY:function(e){return"movementY"in e?e.movementY:Cs}}),Xo=Zt(vc),Jg=X({},vc,{dataTransfer:0}),$g=Zt(Jg),Wg=X({},fi,{relatedTarget:0}),Ds=Zt(Wg),Ig=X({},Ja,{animationName:0,elapsedTime:0,pseudoElement:0}),Pg=Zt(Ig),em=X({},Ja,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),tm=Zt(em),lm=X({},Ja,{data:0}),Qo=Zt(lm),am={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},nm={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"},im={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function cm(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=im[e])?!!t[e]:!1}function Os(){return cm}var sm=X({},fi,{key:function(e){if(e.key){var t=am[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=mc(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?nm[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Os,charCode:function(e){return e.type==="keypress"?mc(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?mc(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),rm=Zt(sm),om=X({},vc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Vo=Zt(om),um=X({},fi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Os}),dm=Zt(um),fm=X({},Ja,{propertyName:0,elapsedTime:0,pseudoElement:0}),gm=Zt(fm),mm=X({},vc,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),hm=Zt(mm),pm=X({},Ja,{newState:0,oldState:0}),vm=Zt(pm),ym=[9,13,27,32],zs=w&&"CompositionEvent"in window,mi=null;w&&"documentMode"in document&&(mi=document.documentMode);var bm=w&&"TextEvent"in window&&!mi,Zo=w&&(!zs||mi&&8<mi&&11>=mi),Ko=" ",Jo=!1;function $o(e,t){switch(e){case"keyup":return ym.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Wo(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var En=!1;function xm(e,t){switch(e){case"compositionend":return Wo(t);case"keypress":return t.which!==32?null:(Jo=!0,Ko);case"textInput":return e=t.data,e===Ko&&Jo?null:e;default:return null}}function Sm(e,t){if(En)return e==="compositionend"||!zs&&$o(e,t)?(e=qo(),nl=Xe=Et=null,En=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Zo&&t.locale!=="ko"?null:t.data;default:return null}}var jm={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 Io(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!jm[e.type]:t==="textarea"}function Po(e,t,l,a){o?v?v.push(a):v=[a]:o=a,t=cs(t,"onChange"),0<t.length&&(l=new pc("onChange","change",null,l,a),e.push({event:l,listeners:t}))}var hi=null,pi=null;function Nm(e){Rf(e,0)}function yc(e){var t=Za(e);if(oc(t))return e}function eu(e,t){if(e==="change")return t}var tu=!1;if(w){var Ms;if(w){var ks="oninput"in document;if(!ks){var lu=document.createElement("div");lu.setAttribute("oninput","return;"),ks=typeof lu.oninput=="function"}Ms=ks}else Ms=!1;tu=Ms&&(!document.documentMode||9<document.documentMode)}function au(){hi&&(hi.detachEvent("onpropertychange",nu),pi=hi=null)}function nu(e){if(e.propertyName==="value"&&yc(pi)){var t=[];Po(t,pi,e,An(e)),Z(Nm,t)}}function Tm(e,t,l){e==="focusin"?(au(),hi=t,pi=l,hi.attachEvent("onpropertychange",nu)):e==="focusout"&&au()}function Am(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return yc(pi)}function Em(e,t){if(e==="click")return yc(t)}function Cm(e,t){if(e==="input"||e==="change")return yc(t)}function Dm(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var il=typeof Object.is=="function"?Object.is:Dm;function vi(e,t){if(il(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var l=Object.keys(e),a=Object.keys(t);if(l.length!==a.length)return!1;for(a=0;a<l.length;a++){var n=l[a];if(!rt.call(t,n)||!il(e[n],t[n]))return!1}return!0}function iu(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function cu(e,t){var l=iu(e);e=0;for(var a;l;){if(l.nodeType===3){if(a=e+l.textContent.length,e<=t&&a>=t)return{node:l,offset:t-e};e=a}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=iu(l)}}function su(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?su(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ru(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=xn(e.document);t instanceof e.HTMLIFrameElement;){try{var l=typeof t.contentWindow.location.href=="string"}catch{l=!1}if(l)e=t.contentWindow;else break;t=xn(e.document)}return t}function Gs(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var Om=w&&"documentMode"in document&&11>=document.documentMode,Cn=null,_s=null,yi=null,ws=!1;function ou(e,t,l){var a=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;ws||Cn==null||Cn!==xn(a)||(a=Cn,"selectionStart"in a&&Gs(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),yi&&vi(yi,a)||(yi=a,a=cs(_s,"onSelect"),0<a.length&&(t=new pc("onSelect","select",null,t,l),e.push({event:t,listeners:a}),t.target=Cn)))}function $a(e,t){var l={};return l[e.toLowerCase()]=t.toLowerCase(),l["Webkit"+e]="webkit"+t,l["Moz"+e]="moz"+t,l}var Dn={animationend:$a("Animation","AnimationEnd"),animationiteration:$a("Animation","AnimationIteration"),animationstart:$a("Animation","AnimationStart"),transitionrun:$a("Transition","TransitionRun"),transitionstart:$a("Transition","TransitionStart"),transitioncancel:$a("Transition","TransitionCancel"),transitionend:$a("Transition","TransitionEnd")},Rs={},uu={};w&&(uu=document.createElement("div").style,"AnimationEvent"in window||(delete Dn.animationend.animation,delete Dn.animationiteration.animation,delete Dn.animationstart.animation),"TransitionEvent"in window||delete Dn.transitionend.transition);function Wa(e){if(Rs[e])return Rs[e];if(!Dn[e])return e;var t=Dn[e],l;for(l in t)if(t.hasOwnProperty(l)&&l in uu)return Rs[e]=t[l];return e}var du=Wa("animationend"),fu=Wa("animationiteration"),gu=Wa("animationstart"),zm=Wa("transitionrun"),Mm=Wa("transitionstart"),km=Wa("transitioncancel"),mu=Wa("transitionend"),hu=new Map,Bs="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(" ");Bs.push("scrollEnd");function Ol(e,t){hu.set(e,t),gl(t,[e])}var bc=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},pl=[],On=0,Us=0;function xc(){for(var e=On,t=Us=On=0;t<e;){var l=pl[t];pl[t++]=null;var a=pl[t];pl[t++]=null;var n=pl[t];pl[t++]=null;var c=pl[t];if(pl[t++]=null,a!==null&&n!==null){var r=a.pending;r===null?n.next=n:(n.next=r.next,r.next=n),a.pending=n}c!==0&&pu(l,n,c)}}function Sc(e,t,l,a){pl[On++]=e,pl[On++]=t,pl[On++]=l,pl[On++]=a,Us|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function Hs(e,t,l,a){return Sc(e,t,l,a),jc(e)}function Ia(e,t){return Sc(e,null,null,t),jc(e)}function pu(e,t,l){e.lanes|=l;var a=e.alternate;a!==null&&(a.lanes|=l);for(var n=!1,c=e.return;c!==null;)c.childLanes|=l,a=c.alternate,a!==null&&(a.childLanes|=l),c.tag===22&&(e=c.stateNode,e===null||e._visibility&1||(n=!0)),e=c,c=c.return;return e.tag===3?(c=e.stateNode,n&&t!==null&&(n=31-At(l),e=c.hiddenUpdates,a=e[n],a===null?e[n]=[t]:a.push(t),t.lane=l|536870912),c):null}function jc(e){if(50<Li)throw Li=0,Kr=null,Error(d(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var zn={};function Gm(e,t,l,a){this.tag=e,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=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function cl(e,t,l,a){return new Gm(e,t,l,a)}function Ls(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Il(e,t){var l=e.alternate;return l===null?(l=cl(e.tag,t,e.key,e.mode),l.elementType=e.elementType,l.type=e.type,l.stateNode=e.stateNode,l.alternate=e,e.alternate=l):(l.pendingProps=t,l.type=e.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=e.flags&65011712,l.childLanes=e.childLanes,l.lanes=e.lanes,l.child=e.child,l.memoizedProps=e.memoizedProps,l.memoizedState=e.memoizedState,l.updateQueue=e.updateQueue,t=e.dependencies,l.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},l.sibling=e.sibling,l.index=e.index,l.ref=e.ref,l.refCleanup=e.refCleanup,l}function vu(e,t){e.flags&=65011714;var l=e.alternate;return l===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=l.childLanes,e.lanes=l.lanes,e.child=l.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=l.memoizedProps,e.memoizedState=l.memoizedState,e.updateQueue=l.updateQueue,e.type=l.type,t=l.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Nc(e,t,l,a,n,c){var r=0;if(a=e,typeof e=="function")Ls(e)&&(r=1);else if(typeof e=="string")r=Uh(e,l,K.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case me:return e=cl(31,l,t,n),e.elementType=me,e.lanes=c,e;case De:return Pa(l.children,n,c,t);case Oe:r=8,n|=24;break;case je:return e=cl(12,l,t,n|2),e.elementType=je,e.lanes=c,e;case Ze:return e=cl(13,l,t,n),e.elementType=Ze,e.lanes=c,e;case ge:return e=cl(19,l,t,n),e.elementType=ge,e.lanes=c,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case fe:r=10;break e;case ce:r=9;break e;case Ce:r=11;break e;case V:r=14;break e;case Ue:r=16,a=null;break e}r=29,l=Error(d(130,e===null?"null":typeof e,"")),a=null}return t=cl(r,l,t,n),t.elementType=e,t.type=a,t.lanes=c,t}function Pa(e,t,l,a){return e=cl(7,e,a,t),e.lanes=l,e}function Fs(e,t,l){return e=cl(6,e,null,t),e.lanes=l,e}function yu(e){var t=cl(18,null,null,0);return t.stateNode=e,t}function qs(e,t,l){return t=cl(4,e.children!==null?e.children:[],e.key,t),t.lanes=l,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var bu=new WeakMap;function vl(e,t){if(typeof e=="object"&&e!==null){var l=bu.get(e);return l!==void 0?l:(t={value:e,source:t,stack:ht(t)},bu.set(e,t),t)}return{value:e,source:t,stack:ht(t)}}var Mn=[],kn=0,Tc=null,bi=0,yl=[],bl=0,va=null,Ul=1,Hl="";function Pl(e,t){Mn[kn++]=bi,Mn[kn++]=Tc,Tc=e,bi=t}function xu(e,t,l){yl[bl++]=Ul,yl[bl++]=Hl,yl[bl++]=va,va=e;var a=Ul;e=Hl;var n=32-At(a)-1;a&=~(1<<n),l+=1;var c=32-At(t)+n;if(30<c){var r=n-n%5;c=(a&(1<<r)-1).toString(32),a>>=r,n-=r,Ul=1<<32-At(t)+n|l<<n|a,Hl=c+e}else Ul=1<<c|l<<n|a,Hl=e}function Ys(e){e.return!==null&&(Pl(e,1),xu(e,1,0))}function Xs(e){for(;e===Tc;)Tc=Mn[--kn],Mn[kn]=null,bi=Mn[--kn],Mn[kn]=null;for(;e===va;)va=yl[--bl],yl[bl]=null,Hl=yl[--bl],yl[bl]=null,Ul=yl[--bl],yl[bl]=null}function Su(e,t){yl[bl++]=Ul,yl[bl++]=Hl,yl[bl++]=va,Ul=t.id,Hl=t.overflow,va=e}var kt=null,et=null,Se=!1,ya=null,xl=!1,Qs=Error(d(519));function ba(e){var t=Error(d(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw xi(vl(t,e)),Qs}function ju(e){var t=e.stateNode,l=e.type,a=e.memoizedProps;switch(t[$e]=e,t[Pe]=a,l){case"dialog":ve("cancel",t),ve("close",t);break;case"iframe":case"object":case"embed":ve("load",t);break;case"video":case"audio":for(l=0;l<qi.length;l++)ve(qi[l],t);break;case"source":ve("error",t);break;case"img":case"image":case"link":ve("error",t),ve("load",t);break;case"details":ve("toggle",t);break;case"input":ve("invalid",t),uc(t,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":ve("invalid",t);break;case"textarea":ve("invalid",t),ui(t,a.value,a.defaultValue,a.children)}l=a.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||t.textContent===""+l||a.suppressHydrationWarning===!0||Lf(t.textContent,l)?(a.popover!=null&&(ve("beforetoggle",t),ve("toggle",t)),a.onScroll!=null&&ve("scroll",t),a.onScrollEnd!=null&&ve("scrollend",t),a.onClick!=null&&(t.onclick=hl),t=!0):t=!1,t||ba(e,!0)}function Nu(e){for(kt=e.return;kt;)switch(kt.tag){case 5:case 31:case 13:xl=!1;return;case 27:case 3:xl=!0;return;default:kt=kt.return}}function Gn(e){if(e!==kt)return!1;if(!Se)return Nu(e),Se=!0,!1;var t=e.tag,l;if((l=t!==3&&t!==27)&&((l=t===5)&&(l=e.type,l=!(l!=="form"&&l!=="button")||oo(e.type,e.memoizedProps)),l=!l),l&&et&&ba(e),Nu(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(d(317));et=Jf(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(d(317));et=Jf(e)}else t===27?(t=et,Ga(e.type)?(e=ho,ho=null,et=e):et=t):et=kt?jl(e.stateNode.nextSibling):null;return!0}function en(){et=kt=null,Se=!1}function Vs(){var e=ya;return e!==null&&(Wt===null?Wt=e:Wt.push.apply(Wt,e),ya=null),e}function xi(e){ya===null?ya=[e]:ya.push(e)}var Zs=h(null),tn=null,ea=null;function xa(e,t,l){q(Zs,t._currentValue),t._currentValue=l}function ta(e){e._currentValue=Zs.current,z(Zs)}function Ks(e,t,l){for(;e!==null;){var a=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,a!==null&&(a.childLanes|=t)):a!==null&&(a.childLanes&t)!==t&&(a.childLanes|=t),e===l)break;e=e.return}}function Js(e,t,l,a){var n=e.child;for(n!==null&&(n.return=e);n!==null;){var c=n.dependencies;if(c!==null){var r=n.child;c=c.firstContext;e:for(;c!==null;){var u=c;c=n;for(var g=0;g<t.length;g++)if(u.context===t[g]){c.lanes|=l,u=c.alternate,u!==null&&(u.lanes|=l),Ks(c.return,l,e),a||(r=null);break e}c=u.next}}else if(n.tag===18){if(r=n.return,r===null)throw Error(d(341));r.lanes|=l,c=r.alternate,c!==null&&(c.lanes|=l),Ks(r,l,e),r=null}else r=n.child;if(r!==null)r.return=n;else for(r=n;r!==null;){if(r===e){r=null;break}if(n=r.sibling,n!==null){n.return=r.return,r=n;break}r=r.return}n=r}}function _n(e,t,l,a){e=null;for(var n=t,c=!1;n!==null;){if(!c){if((n.flags&524288)!==0)c=!0;else if((n.flags&262144)!==0)break}if(n.tag===10){var r=n.alternate;if(r===null)throw Error(d(387));if(r=r.memoizedProps,r!==null){var u=n.type;il(n.pendingProps.value,r.value)||(e!==null?e.push(u):e=[u])}}else if(n===he.current){if(r=n.alternate,r===null)throw Error(d(387));r.memoizedState.memoizedState!==n.memoizedState.memoizedState&&(e!==null?e.push(Zi):e=[Zi])}n=n.return}e!==null&&Js(t,e,l,a),t.flags|=262144}function Ac(e){for(e=e.firstContext;e!==null;){if(!il(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ln(e){tn=e,ea=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Gt(e){return Tu(tn,e)}function Ec(e,t){return tn===null&&ln(e),Tu(e,t)}function Tu(e,t){var l=t._currentValue;if(t={context:t,memoizedValue:l,next:null},ea===null){if(e===null)throw Error(d(308));ea=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ea=ea.next=t;return l}var _m=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(l,a){e.push(a)}};this.abort=function(){t.aborted=!0,e.forEach(function(l){return l()})}},wm=s.unstable_scheduleCallback,Rm=s.unstable_NormalPriority,St={$$typeof:fe,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function $s(){return{controller:new _m,data:new Map,refCount:0}}function Si(e){e.refCount--,e.refCount===0&&wm(Rm,function(){e.controller.abort()})}var ji=null,Ws=0,wn=0,Rn=null;function Bm(e,t){if(ji===null){var l=ji=[];Ws=0,wn=eo(),Rn={status:"pending",value:void 0,then:function(a){l.push(a)}}}return Ws++,t.then(Au,Au),t}function Au(){if(--Ws===0&&ji!==null){Rn!==null&&(Rn.status="fulfilled");var e=ji;ji=null,wn=0,Rn=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Um(e,t){var l=[],a={status:"pending",value:null,reason:null,then:function(n){l.push(n)}};return e.then(function(){a.status="fulfilled",a.value=t;for(var n=0;n<l.length;n++)(0,l[n])(t)},function(n){for(a.status="rejected",a.reason=n,n=0;n<l.length;n++)(0,l[n])(void 0)}),a}var Eu=C.S;C.S=function(e,t){uf=bt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Bm(e,t),Eu!==null&&Eu(e,t)};var an=h(null);function Is(){var e=an.current;return e!==null?e:Qe.pooledCache}function Cc(e,t){t===null?q(an,an.current):q(an,t.pool)}function Cu(){var e=Is();return e===null?null:{parent:St._currentValue,pool:e}}var Bn=Error(d(460)),Ps=Error(d(474)),Dc=Error(d(542)),Oc={then:function(){}};function Du(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Ou(e,t,l){switch(l=e[l],l===void 0?e.push(t):l!==t&&(t.then(hl,hl),t=l),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Mu(e),e;default:if(typeof t.status=="string")t.then(hl,hl);else{if(e=Qe,e!==null&&100<e.shellSuspendCounter)throw Error(d(482));e=t,e.status="pending",e.then(function(a){if(t.status==="pending"){var n=t;n.status="fulfilled",n.value=a}},function(a){if(t.status==="pending"){var n=t;n.status="rejected",n.reason=a}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Mu(e),e}throw cn=t,Bn}}function nn(e){try{var t=e._init;return t(e._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(cn=l,Bn):l}}var cn=null;function zu(){if(cn===null)throw Error(d(459));var e=cn;return cn=null,e}function Mu(e){if(e===Bn||e===Dc)throw Error(d(483))}var Un=null,Ni=0;function zc(e){var t=Ni;return Ni+=1,Un===null&&(Un=[]),Ou(Un,e,t)}function Ti(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Mc(e,t){throw t.$$typeof===ae?Error(d(525)):(e=Object.prototype.toString.call(t),Error(d(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function ku(e){function t(y,p){if(e){var S=y.deletions;S===null?(y.deletions=[p],y.flags|=16):S.push(p)}}function l(y,p){if(!e)return null;for(;p!==null;)t(y,p),p=p.sibling;return null}function a(y){for(var p=new Map;y!==null;)y.key!==null?p.set(y.key,y):p.set(y.index,y),y=y.sibling;return p}function n(y,p){return y=Il(y,p),y.index=0,y.sibling=null,y}function c(y,p,S){return y.index=S,e?(S=y.alternate,S!==null?(S=S.index,S<p?(y.flags|=67108866,p):S):(y.flags|=67108866,p)):(y.flags|=1048576,p)}function r(y){return e&&y.alternate===null&&(y.flags|=67108866),y}function u(y,p,S,M){return p===null||p.tag!==6?(p=Fs(S,y.mode,M),p.return=y,p):(p=n(p,S),p.return=y,p)}function g(y,p,S,M){var ee=S.type;return ee===De?O(y,p,S.props.children,M,S.key):p!==null&&(p.elementType===ee||typeof ee=="object"&&ee!==null&&ee.$$typeof===Ue&&nn(ee)===p.type)?(p=n(p,S.props),Ti(p,S),p.return=y,p):(p=Nc(S.type,S.key,S.props,null,y.mode,M),Ti(p,S),p.return=y,p)}function j(y,p,S,M){return p===null||p.tag!==4||p.stateNode.containerInfo!==S.containerInfo||p.stateNode.implementation!==S.implementation?(p=qs(S,y.mode,M),p.return=y,p):(p=n(p,S.children||[]),p.return=y,p)}function O(y,p,S,M,ee){return p===null||p.tag!==7?(p=Pa(S,y.mode,M,ee),p.return=y,p):(p=n(p,S),p.return=y,p)}function G(y,p,S){if(typeof p=="string"&&p!==""||typeof p=="number"||typeof p=="bigint")return p=Fs(""+p,y.mode,S),p.return=y,p;if(typeof p=="object"&&p!==null){switch(p.$$typeof){case de:return S=Nc(p.type,p.key,p.props,null,y.mode,S),Ti(S,p),S.return=y,S;case Ee:return p=qs(p,y.mode,S),p.return=y,p;case Ue:return p=nn(p),G(y,p,S)}if(gt(p)||ut(p))return p=Pa(p,y.mode,S,null),p.return=y,p;if(typeof p.then=="function")return G(y,zc(p),S);if(p.$$typeof===fe)return G(y,Ec(y,p),S);Mc(y,p)}return null}function A(y,p,S,M){var ee=p!==null?p.key:null;if(typeof S=="string"&&S!==""||typeof S=="number"||typeof S=="bigint")return ee!==null?null:u(y,p,""+S,M);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case de:return S.key===ee?g(y,p,S,M):null;case Ee:return S.key===ee?j(y,p,S,M):null;case Ue:return S=nn(S),A(y,p,S,M)}if(gt(S)||ut(S))return ee!==null?null:O(y,p,S,M,null);if(typeof S.then=="function")return A(y,p,zc(S),M);if(S.$$typeof===fe)return A(y,p,Ec(y,S),M);Mc(y,S)}return null}function E(y,p,S,M,ee){if(typeof M=="string"&&M!==""||typeof M=="number"||typeof M=="bigint")return y=y.get(S)||null,u(p,y,""+M,ee);if(typeof M=="object"&&M!==null){switch(M.$$typeof){case de:return y=y.get(M.key===null?S:M.key)||null,g(p,y,M,ee);case Ee:return y=y.get(M.key===null?S:M.key)||null,j(p,y,M,ee);case Ue:return M=nn(M),E(y,p,S,M,ee)}if(gt(M)||ut(M))return y=y.get(S)||null,O(p,y,M,ee,null);if(typeof M.then=="function")return E(y,p,S,zc(M),ee);if(M.$$typeof===fe)return E(y,p,S,Ec(p,M),ee);Mc(p,M)}return null}function $(y,p,S,M){for(var ee=null,Me=null,P=p,ue=p=0,xe=null;P!==null&&ue<S.length;ue++){P.index>ue?(xe=P,P=null):xe=P.sibling;var ke=A(y,P,S[ue],M);if(ke===null){P===null&&(P=xe);break}e&&P&&ke.alternate===null&&t(y,P),p=c(ke,p,ue),Me===null?ee=ke:Me.sibling=ke,Me=ke,P=xe}if(ue===S.length)return l(y,P),Se&&Pl(y,ue),ee;if(P===null){for(;ue<S.length;ue++)P=G(y,S[ue],M),P!==null&&(p=c(P,p,ue),Me===null?ee=P:Me.sibling=P,Me=P);return Se&&Pl(y,ue),ee}for(P=a(P);ue<S.length;ue++)xe=E(P,y,ue,S[ue],M),xe!==null&&(e&&xe.alternate!==null&&P.delete(xe.key===null?ue:xe.key),p=c(xe,p,ue),Me===null?ee=xe:Me.sibling=xe,Me=xe);return e&&P.forEach(function(Ua){return t(y,Ua)}),Se&&Pl(y,ue),ee}function te(y,p,S,M){if(S==null)throw Error(d(151));for(var ee=null,Me=null,P=p,ue=p=0,xe=null,ke=S.next();P!==null&&!ke.done;ue++,ke=S.next()){P.index>ue?(xe=P,P=null):xe=P.sibling;var Ua=A(y,P,ke.value,M);if(Ua===null){P===null&&(P=xe);break}e&&P&&Ua.alternate===null&&t(y,P),p=c(Ua,p,ue),Me===null?ee=Ua:Me.sibling=Ua,Me=Ua,P=xe}if(ke.done)return l(y,P),Se&&Pl(y,ue),ee;if(P===null){for(;!ke.done;ue++,ke=S.next())ke=G(y,ke.value,M),ke!==null&&(p=c(ke,p,ue),Me===null?ee=ke:Me.sibling=ke,Me=ke);return Se&&Pl(y,ue),ee}for(P=a(P);!ke.done;ue++,ke=S.next())ke=E(P,y,ue,ke.value,M),ke!==null&&(e&&ke.alternate!==null&&P.delete(ke.key===null?ue:ke.key),p=c(ke,p,ue),Me===null?ee=ke:Me.sibling=ke,Me=ke);return e&&P.forEach(function(Jh){return t(y,Jh)}),Se&&Pl(y,ue),ee}function qe(y,p,S,M){if(typeof S=="object"&&S!==null&&S.type===De&&S.key===null&&(S=S.props.children),typeof S=="object"&&S!==null){switch(S.$$typeof){case de:e:{for(var ee=S.key;p!==null;){if(p.key===ee){if(ee=S.type,ee===De){if(p.tag===7){l(y,p.sibling),M=n(p,S.props.children),M.return=y,y=M;break e}}else if(p.elementType===ee||typeof ee=="object"&&ee!==null&&ee.$$typeof===Ue&&nn(ee)===p.type){l(y,p.sibling),M=n(p,S.props),Ti(M,S),M.return=y,y=M;break e}l(y,p);break}else t(y,p);p=p.sibling}S.type===De?(M=Pa(S.props.children,y.mode,M,S.key),M.return=y,y=M):(M=Nc(S.type,S.key,S.props,null,y.mode,M),Ti(M,S),M.return=y,y=M)}return r(y);case Ee:e:{for(ee=S.key;p!==null;){if(p.key===ee)if(p.tag===4&&p.stateNode.containerInfo===S.containerInfo&&p.stateNode.implementation===S.implementation){l(y,p.sibling),M=n(p,S.children||[]),M.return=y,y=M;break e}else{l(y,p);break}else t(y,p);p=p.sibling}M=qs(S,y.mode,M),M.return=y,y=M}return r(y);case Ue:return S=nn(S),qe(y,p,S,M)}if(gt(S))return $(y,p,S,M);if(ut(S)){if(ee=ut(S),typeof ee!="function")throw Error(d(150));return S=ee.call(S),te(y,p,S,M)}if(typeof S.then=="function")return qe(y,p,zc(S),M);if(S.$$typeof===fe)return qe(y,p,Ec(y,S),M);Mc(y,S)}return typeof S=="string"&&S!==""||typeof S=="number"||typeof S=="bigint"?(S=""+S,p!==null&&p.tag===6?(l(y,p.sibling),M=n(p,S),M.return=y,y=M):(l(y,p),M=Fs(S,y.mode,M),M.return=y,y=M),r(y)):l(y,p)}return function(y,p,S,M){try{Ni=0;var ee=qe(y,p,S,M);return Un=null,ee}catch(P){if(P===Bn||P===Dc)throw P;var Me=cl(29,P,null,y.mode);return Me.lanes=M,Me.return=y,Me}finally{}}}var sn=ku(!0),Gu=ku(!1),Sa=!1;function er(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function tr(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function ja(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Na(e,t,l){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(_e&2)!==0){var n=a.pending;return n===null?t.next=t:(t.next=n.next,n.next=t),a.pending=t,t=jc(e),pu(e,null,l),t}return Sc(e,a,t,l),jc(e)}function Ai(e,t,l){if(t=t.updateQueue,t!==null&&(t=t.shared,(l&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,l|=a,t.lanes=l,Mt(e,l)}}function lr(e,t){var l=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,l===a)){var n=null,c=null;if(l=l.firstBaseUpdate,l!==null){do{var r={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};c===null?n=c=r:c=c.next=r,l=l.next}while(l!==null);c===null?n=c=t:c=c.next=t}else n=c=t;l={baseState:a.baseState,firstBaseUpdate:n,lastBaseUpdate:c,shared:a.shared,callbacks:a.callbacks},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=t:e.next=t,l.lastBaseUpdate=t}var ar=!1;function Ei(){if(ar){var e=Rn;if(e!==null)throw e}}function Ci(e,t,l,a){ar=!1;var n=e.updateQueue;Sa=!1;var c=n.firstBaseUpdate,r=n.lastBaseUpdate,u=n.shared.pending;if(u!==null){n.shared.pending=null;var g=u,j=g.next;g.next=null,r===null?c=j:r.next=j,r=g;var O=e.alternate;O!==null&&(O=O.updateQueue,u=O.lastBaseUpdate,u!==r&&(u===null?O.firstBaseUpdate=j:u.next=j,O.lastBaseUpdate=g))}if(c!==null){var G=n.baseState;r=0,O=j=g=null,u=c;do{var A=u.lane&-536870913,E=A!==u.lane;if(E?(be&A)===A:(a&A)===A){A!==0&&A===wn&&(ar=!0),O!==null&&(O=O.next={lane:0,tag:u.tag,payload:u.payload,callback:null,next:null});e:{var $=e,te=u;A=t;var qe=l;switch(te.tag){case 1:if($=te.payload,typeof $=="function"){G=$.call(qe,G,A);break e}G=$;break e;case 3:$.flags=$.flags&-65537|128;case 0:if($=te.payload,A=typeof $=="function"?$.call(qe,G,A):$,A==null)break e;G=X({},G,A);break e;case 2:Sa=!0}}A=u.callback,A!==null&&(e.flags|=64,E&&(e.flags|=8192),E=n.callbacks,E===null?n.callbacks=[A]:E.push(A))}else E={lane:A,tag:u.tag,payload:u.payload,callback:u.callback,next:null},O===null?(j=O=E,g=G):O=O.next=E,r|=A;if(u=u.next,u===null){if(u=n.shared.pending,u===null)break;E=u,u=E.next,E.next=null,n.lastBaseUpdate=E,n.shared.pending=null}}while(!0);O===null&&(g=G),n.baseState=g,n.firstBaseUpdate=j,n.lastBaseUpdate=O,c===null&&(n.shared.lanes=0),Da|=r,e.lanes=r,e.memoizedState=G}}function _u(e,t){if(typeof e!="function")throw Error(d(191,e));e.call(t)}function wu(e,t){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;e<l.length;e++)_u(l[e],t)}var Hn=h(null),kc=h(0);function Ru(e,t){e=ua,q(kc,e),q(Hn,t),ua=e|t.baseLanes}function nr(){q(kc,ua),q(Hn,Hn.current)}function ir(){ua=kc.current,z(Hn),z(kc)}var sl=h(null),Sl=null;function Ta(e){var t=e.alternate;q(pt,pt.current&1),q(sl,e),Sl===null&&(t===null||Hn.current!==null||t.memoizedState!==null)&&(Sl=e)}function cr(e){q(pt,pt.current),q(sl,e),Sl===null&&(Sl=e)}function Bu(e){e.tag===22?(q(pt,pt.current),q(sl,e),Sl===null&&(Sl=e)):Aa()}function Aa(){q(pt,pt.current),q(sl,sl.current)}function rl(e){z(sl),Sl===e&&(Sl=null),z(pt)}var pt=h(0);function Gc(e){for(var t=e;t!==null;){if(t.tag===13){var l=t.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||go(l)||mo(l)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var la=0,oe=null,Le=null,jt=null,_c=!1,Ln=!1,rn=!1,wc=0,Di=0,Fn=null,Hm=0;function dt(){throw Error(d(321))}function sr(e,t){if(t===null)return!1;for(var l=0;l<t.length&&l<e.length;l++)if(!il(e[l],t[l]))return!1;return!0}function rr(e,t,l,a,n,c){return la=c,oe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,C.H=e===null||e.memoizedState===null?xd:Nr,rn=!1,c=l(a,n),rn=!1,Ln&&(c=Hu(t,l,a,n)),Uu(e),c}function Uu(e){C.H=Mi;var t=Le!==null&&Le.next!==null;if(la=0,jt=Le=oe=null,_c=!1,Di=0,Fn=null,t)throw Error(d(300));e===null||Nt||(e=e.dependencies,e!==null&&Ac(e)&&(Nt=!0))}function Hu(e,t,l,a){oe=e;var n=0;do{if(Ln&&(Fn=null),Di=0,Ln=!1,25<=n)throw Error(d(301));if(n+=1,jt=Le=null,e.updateQueue!=null){var c=e.updateQueue;c.lastEffect=null,c.events=null,c.stores=null,c.memoCache!=null&&(c.memoCache.index=0)}C.H=Sd,c=t(l,a)}while(Ln);return c}function Lm(){var e=C.H,t=e.useState()[0];return t=typeof t.then=="function"?Oi(t):t,e=e.useState()[0],(Le!==null?Le.memoizedState:null)!==e&&(oe.flags|=1024),t}function or(){var e=wc!==0;return wc=0,e}function ur(e,t,l){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l}function dr(e){if(_c){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}_c=!1}la=0,jt=Le=oe=null,Ln=!1,Di=wc=0,Fn=null}function qt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return jt===null?oe.memoizedState=jt=e:jt=jt.next=e,jt}function vt(){if(Le===null){var e=oe.alternate;e=e!==null?e.memoizedState:null}else e=Le.next;var t=jt===null?oe.memoizedState:jt.next;if(t!==null)jt=t,Le=e;else{if(e===null)throw oe.alternate===null?Error(d(467)):Error(d(310));Le=e,e={memoizedState:Le.memoizedState,baseState:Le.baseState,baseQueue:Le.baseQueue,queue:Le.queue,next:null},jt===null?oe.memoizedState=jt=e:jt=jt.next=e}return jt}function Rc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Oi(e){var t=Di;return Di+=1,Fn===null&&(Fn=[]),e=Ou(Fn,e,t),t=oe,(jt===null?t.memoizedState:jt.next)===null&&(t=t.alternate,C.H=t===null||t.memoizedState===null?xd:Nr),e}function Bc(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Oi(e);if(e.$$typeof===fe)return Gt(e)}throw Error(d(438,String(e)))}function fr(e){var t=null,l=oe.updateQueue;if(l!==null&&(t=l.memoCache),t==null){var a=oe.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(t={data:a.data.map(function(n){return n.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),l===null&&(l=Rc(),oe.updateQueue=l),l.memoCache=t,l=t.data[t.index],l===void 0)for(l=t.data[t.index]=Array(e),a=0;a<e;a++)l[a]=ct;return t.index++,l}function aa(e,t){return typeof t=="function"?t(e):t}function Uc(e){var t=vt();return gr(t,Le,e)}function gr(e,t,l){var a=e.queue;if(a===null)throw Error(d(311));a.lastRenderedReducer=l;var n=e.baseQueue,c=a.pending;if(c!==null){if(n!==null){var r=n.next;n.next=c.next,c.next=r}t.baseQueue=n=c,a.pending=null}if(c=e.baseState,n===null)e.memoizedState=c;else{t=n.next;var u=r=null,g=null,j=t,O=!1;do{var G=j.lane&-536870913;if(G!==j.lane?(be&G)===G:(la&G)===G){var A=j.revertLane;if(A===0)g!==null&&(g=g.next={lane:0,revertLane:0,gesture:null,action:j.action,hasEagerState:j.hasEagerState,eagerState:j.eagerState,next:null}),G===wn&&(O=!0);else if((la&A)===A){j=j.next,A===wn&&(O=!0);continue}else G={lane:0,revertLane:j.revertLane,gesture:null,action:j.action,hasEagerState:j.hasEagerState,eagerState:j.eagerState,next:null},g===null?(u=g=G,r=c):g=g.next=G,oe.lanes|=A,Da|=A;G=j.action,rn&&l(c,G),c=j.hasEagerState?j.eagerState:l(c,G)}else A={lane:G,revertLane:j.revertLane,gesture:j.gesture,action:j.action,hasEagerState:j.hasEagerState,eagerState:j.eagerState,next:null},g===null?(u=g=A,r=c):g=g.next=A,oe.lanes|=G,Da|=G;j=j.next}while(j!==null&&j!==t);if(g===null?r=c:g.next=u,!il(c,e.memoizedState)&&(Nt=!0,O&&(l=Rn,l!==null)))throw l;e.memoizedState=c,e.baseState=r,e.baseQueue=g,a.lastRenderedState=c}return n===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function mr(e){var t=vt(),l=t.queue;if(l===null)throw Error(d(311));l.lastRenderedReducer=e;var a=l.dispatch,n=l.pending,c=t.memoizedState;if(n!==null){l.pending=null;var r=n=n.next;do c=e(c,r.action),r=r.next;while(r!==n);il(c,t.memoizedState)||(Nt=!0),t.memoizedState=c,t.baseQueue===null&&(t.baseState=c),l.lastRenderedState=c}return[c,a]}function Lu(e,t,l){var a=oe,n=vt(),c=Se;if(c){if(l===void 0)throw Error(d(407));l=l()}else l=t();var r=!il((Le||n).memoizedState,l);if(r&&(n.memoizedState=l,Nt=!0),n=n.queue,vr(Yu.bind(null,a,n,e),[e]),n.getSnapshot!==t||r||jt!==null&&jt.memoizedState.tag&1){if(a.flags|=2048,qn(9,{destroy:void 0},qu.bind(null,a,n,l,t),null),Qe===null)throw Error(d(349));c||(la&127)!==0||Fu(a,t,l)}return l}function Fu(e,t,l){e.flags|=16384,e={getSnapshot:t,value:l},t=oe.updateQueue,t===null?(t=Rc(),oe.updateQueue=t,t.stores=[e]):(l=t.stores,l===null?t.stores=[e]:l.push(e))}function qu(e,t,l,a){t.value=l,t.getSnapshot=a,Xu(t)&&Qu(e)}function Yu(e,t,l){return l(function(){Xu(t)&&Qu(e)})}function Xu(e){var t=e.getSnapshot;e=e.value;try{var l=t();return!il(e,l)}catch{return!0}}function Qu(e){var t=Ia(e,2);t!==null&&It(t,e,2)}function hr(e){var t=qt();if(typeof e=="function"){var l=e;if(e=l(),rn){Bt(!0);try{l()}finally{Bt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:aa,lastRenderedState:e},t}function Vu(e,t,l,a){return e.baseState=l,gr(e,Le,typeof a=="function"?a:aa)}function Fm(e,t,l,a,n){if(Fc(e))throw Error(d(485));if(e=t.action,e!==null){var c={payload:n,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(r){c.listeners.push(r)}};C.T!==null?l(!0):c.isTransition=!1,a(c),l=t.pending,l===null?(c.next=t.pending=c,Zu(t,c)):(c.next=l.next,t.pending=l.next=c)}}function Zu(e,t){var l=t.action,a=t.payload,n=e.state;if(t.isTransition){var c=C.T,r={};C.T=r;try{var u=l(n,a),g=C.S;g!==null&&g(r,u),Ku(e,t,u)}catch(j){pr(e,t,j)}finally{c!==null&&r.types!==null&&(c.types=r.types),C.T=c}}else try{c=l(n,a),Ku(e,t,c)}catch(j){pr(e,t,j)}}function Ku(e,t,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(a){Ju(e,t,a)},function(a){return pr(e,t,a)}):Ju(e,t,l)}function Ju(e,t,l){t.status="fulfilled",t.value=l,$u(t),e.state=l,t=e.pending,t!==null&&(l=t.next,l===t?e.pending=null:(l=l.next,t.next=l,Zu(e,l)))}function pr(e,t,l){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=l,$u(t),t=t.next;while(t!==a)}e.action=null}function $u(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Wu(e,t){return t}function Iu(e,t){if(Se){var l=Qe.formState;if(l!==null){e:{var a=oe;if(Se){if(et){t:{for(var n=et,c=xl;n.nodeType!==8;){if(!c){n=null;break t}if(n=jl(n.nextSibling),n===null){n=null;break t}}c=n.data,n=c==="F!"||c==="F"?n:null}if(n){et=jl(n.nextSibling),a=n.data==="F!";break e}}ba(a)}a=!1}a&&(t=l[0])}}return l=qt(),l.memoizedState=l.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wu,lastRenderedState:t},l.queue=a,l=vd.bind(null,oe,a),a.dispatch=l,a=hr(!1),c=jr.bind(null,oe,!1,a.queue),a=qt(),n={state:t,dispatch:null,action:e,pending:null},a.queue=n,l=Fm.bind(null,oe,n,c,l),n.dispatch=l,a.memoizedState=e,[t,l,!1]}function Pu(e){var t=vt();return ed(t,Le,e)}function ed(e,t,l){if(t=gr(e,t,Wu)[0],e=Uc(aa)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=Oi(t)}catch(r){throw r===Bn?Dc:r}else a=t;t=vt();var n=t.queue,c=n.dispatch;return l!==t.memoizedState&&(oe.flags|=2048,qn(9,{destroy:void 0},qm.bind(null,n,l),null)),[a,c,e]}function qm(e,t){e.action=t}function td(e){var t=vt(),l=Le;if(l!==null)return ed(t,l,e);vt(),t=t.memoizedState,l=vt();var a=l.queue.dispatch;return l.memoizedState=e,[t,a,!1]}function qn(e,t,l,a){return e={tag:e,create:l,deps:a,inst:t,next:null},t=oe.updateQueue,t===null&&(t=Rc(),oe.updateQueue=t),l=t.lastEffect,l===null?t.lastEffect=e.next=e:(a=l.next,l.next=e,e.next=a,t.lastEffect=e),e}function ld(){return vt().memoizedState}function Hc(e,t,l,a){var n=qt();oe.flags|=e,n.memoizedState=qn(1|t,{destroy:void 0},l,a===void 0?null:a)}function Lc(e,t,l,a){var n=vt();a=a===void 0?null:a;var c=n.memoizedState.inst;Le!==null&&a!==null&&sr(a,Le.memoizedState.deps)?n.memoizedState=qn(t,c,l,a):(oe.flags|=e,n.memoizedState=qn(1|t,c,l,a))}function ad(e,t){Hc(8390656,8,e,t)}function vr(e,t){Lc(2048,8,e,t)}function Ym(e){oe.flags|=4;var t=oe.updateQueue;if(t===null)t=Rc(),oe.updateQueue=t,t.events=[e];else{var l=t.events;l===null?t.events=[e]:l.push(e)}}function nd(e){var t=vt().memoizedState;return Ym({ref:t,nextImpl:e}),function(){if((_e&2)!==0)throw Error(d(440));return t.impl.apply(void 0,arguments)}}function id(e,t){return Lc(4,2,e,t)}function cd(e,t){return Lc(4,4,e,t)}function sd(e,t){if(typeof t=="function"){e=e();var l=t(e);return function(){typeof l=="function"?l():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function rd(e,t,l){l=l!=null?l.concat([e]):null,Lc(4,4,sd.bind(null,t,e),l)}function yr(){}function od(e,t){var l=vt();t=t===void 0?null:t;var a=l.memoizedState;return t!==null&&sr(t,a[1])?a[0]:(l.memoizedState=[e,t],e)}function ud(e,t){var l=vt();t=t===void 0?null:t;var a=l.memoizedState;if(t!==null&&sr(t,a[1]))return a[0];if(a=e(),rn){Bt(!0);try{e()}finally{Bt(!1)}}return l.memoizedState=[a,t],a}function br(e,t,l){return l===void 0||(la&1073741824)!==0&&(be&261930)===0?e.memoizedState=t:(e.memoizedState=l,e=ff(),oe.lanes|=e,Da|=e,l)}function dd(e,t,l,a){return il(l,t)?l:Hn.current!==null?(e=br(e,l,a),il(e,t)||(Nt=!0),e):(la&42)===0||(la&1073741824)!==0&&(be&261930)===0?(Nt=!0,e.memoizedState=l):(e=ff(),oe.lanes|=e,Da|=e,t)}function fd(e,t,l,a,n){var c=L.p;L.p=c!==0&&8>c?c:8;var r=C.T,u={};C.T=u,jr(e,!1,t,l);try{var g=n(),j=C.S;if(j!==null&&j(u,g),g!==null&&typeof g=="object"&&typeof g.then=="function"){var O=Um(g,a);zi(e,t,O,dl(e))}else zi(e,t,a,dl(e))}catch(G){zi(e,t,{then:function(){},status:"rejected",reason:G},dl())}finally{L.p=c,r!==null&&u.types!==null&&(r.types=u.types),C.T=r}}function Xm(){}function xr(e,t,l,a){if(e.tag!==5)throw Error(d(476));var n=gd(e).queue;fd(e,n,t,W,l===null?Xm:function(){return md(e),l(a)})}function gd(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:W,baseState:W,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:aa,lastRenderedState:W},next:null};var l={};return t.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:aa,lastRenderedState:l},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function md(e){var t=gd(e);t.next===null&&(t=e.alternate.memoizedState),zi(e,t.next.queue,{},dl())}function Sr(){return Gt(Zi)}function hd(){return vt().memoizedState}function pd(){return vt().memoizedState}function Qm(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var l=dl();e=ja(l);var a=Na(t,e,l);a!==null&&(It(a,t,l),Ai(a,t,l)),t={cache:$s()},e.payload=t;return}t=t.return}}function Vm(e,t,l){var a=dl();l={lane:a,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Fc(e)?yd(t,l):(l=Hs(e,t,l,a),l!==null&&(It(l,e,a),bd(l,t,a)))}function vd(e,t,l){var a=dl();zi(e,t,l,a)}function zi(e,t,l,a){var n={lane:a,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(Fc(e))yd(t,n);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=t.lastRenderedReducer,c!==null))try{var r=t.lastRenderedState,u=c(r,l);if(n.hasEagerState=!0,n.eagerState=u,il(u,r))return Sc(e,t,n,0),Qe===null&&xc(),!1}catch{}finally{}if(l=Hs(e,t,n,a),l!==null)return It(l,e,a),bd(l,t,a),!0}return!1}function jr(e,t,l,a){if(a={lane:2,revertLane:eo(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Fc(e)){if(t)throw Error(d(479))}else t=Hs(e,l,a,2),t!==null&&It(t,e,2)}function Fc(e){var t=e.alternate;return e===oe||t!==null&&t===oe}function yd(e,t){Ln=_c=!0;var l=e.pending;l===null?t.next=t:(t.next=l.next,l.next=t),e.pending=t}function bd(e,t,l){if((l&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,l|=a,t.lanes=l,Mt(e,l)}}var Mi={readContext:Gt,use:Bc,useCallback:dt,useContext:dt,useEffect:dt,useImperativeHandle:dt,useLayoutEffect:dt,useInsertionEffect:dt,useMemo:dt,useReducer:dt,useRef:dt,useState:dt,useDebugValue:dt,useDeferredValue:dt,useTransition:dt,useSyncExternalStore:dt,useId:dt,useHostTransitionStatus:dt,useFormState:dt,useActionState:dt,useOptimistic:dt,useMemoCache:dt,useCacheRefresh:dt};Mi.useEffectEvent=dt;var xd={readContext:Gt,use:Bc,useCallback:function(e,t){return qt().memoizedState=[e,t===void 0?null:t],e},useContext:Gt,useEffect:ad,useImperativeHandle:function(e,t,l){l=l!=null?l.concat([e]):null,Hc(4194308,4,sd.bind(null,t,e),l)},useLayoutEffect:function(e,t){return Hc(4194308,4,e,t)},useInsertionEffect:function(e,t){Hc(4,2,e,t)},useMemo:function(e,t){var l=qt();t=t===void 0?null:t;var a=e();if(rn){Bt(!0);try{e()}finally{Bt(!1)}}return l.memoizedState=[a,t],a},useReducer:function(e,t,l){var a=qt();if(l!==void 0){var n=l(t);if(rn){Bt(!0);try{l(t)}finally{Bt(!1)}}}else n=t;return a.memoizedState=a.baseState=n,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},a.queue=e,e=e.dispatch=Vm.bind(null,oe,e),[a.memoizedState,e]},useRef:function(e){var t=qt();return e={current:e},t.memoizedState=e},useState:function(e){e=hr(e);var t=e.queue,l=vd.bind(null,oe,t);return t.dispatch=l,[e.memoizedState,l]},useDebugValue:yr,useDeferredValue:function(e,t){var l=qt();return br(l,e,t)},useTransition:function(){var e=hr(!1);return e=fd.bind(null,oe,e.queue,!0,!1),qt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,l){var a=oe,n=qt();if(Se){if(l===void 0)throw Error(d(407));l=l()}else{if(l=t(),Qe===null)throw Error(d(349));(be&127)!==0||Fu(a,t,l)}n.memoizedState=l;var c={value:l,getSnapshot:t};return n.queue=c,ad(Yu.bind(null,a,c,e),[e]),a.flags|=2048,qn(9,{destroy:void 0},qu.bind(null,a,c,l,t),null),l},useId:function(){var e=qt(),t=Qe.identifierPrefix;if(Se){var l=Hl,a=Ul;l=(a&~(1<<32-At(a)-1)).toString(32)+l,t="_"+t+"R_"+l,l=wc++,0<l&&(t+="H"+l.toString(32)),t+="_"}else l=Hm++,t="_"+t+"r_"+l.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Sr,useFormState:Iu,useActionState:Iu,useOptimistic:function(e){var t=qt();t.memoizedState=t.baseState=e;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=l,t=jr.bind(null,oe,!0,l),l.dispatch=t,[e,t]},useMemoCache:fr,useCacheRefresh:function(){return qt().memoizedState=Qm.bind(null,oe)},useEffectEvent:function(e){var t=qt(),l={impl:e};return t.memoizedState=l,function(){if((_e&2)!==0)throw Error(d(440));return l.impl.apply(void 0,arguments)}}},Nr={readContext:Gt,use:Bc,useCallback:od,useContext:Gt,useEffect:vr,useImperativeHandle:rd,useInsertionEffect:id,useLayoutEffect:cd,useMemo:ud,useReducer:Uc,useRef:ld,useState:function(){return Uc(aa)},useDebugValue:yr,useDeferredValue:function(e,t){var l=vt();return dd(l,Le.memoizedState,e,t)},useTransition:function(){var e=Uc(aa)[0],t=vt().memoizedState;return[typeof e=="boolean"?e:Oi(e),t]},useSyncExternalStore:Lu,useId:hd,useHostTransitionStatus:Sr,useFormState:Pu,useActionState:Pu,useOptimistic:function(e,t){var l=vt();return Vu(l,Le,e,t)},useMemoCache:fr,useCacheRefresh:pd};Nr.useEffectEvent=nd;var Sd={readContext:Gt,use:Bc,useCallback:od,useContext:Gt,useEffect:vr,useImperativeHandle:rd,useInsertionEffect:id,useLayoutEffect:cd,useMemo:ud,useReducer:mr,useRef:ld,useState:function(){return mr(aa)},useDebugValue:yr,useDeferredValue:function(e,t){var l=vt();return Le===null?br(l,e,t):dd(l,Le.memoizedState,e,t)},useTransition:function(){var e=mr(aa)[0],t=vt().memoizedState;return[typeof e=="boolean"?e:Oi(e),t]},useSyncExternalStore:Lu,useId:hd,useHostTransitionStatus:Sr,useFormState:td,useActionState:td,useOptimistic:function(e,t){var l=vt();return Le!==null?Vu(l,Le,e,t):(l.baseState=e,[e,l.queue.dispatch])},useMemoCache:fr,useCacheRefresh:pd};Sd.useEffectEvent=nd;function Tr(e,t,l,a){t=e.memoizedState,l=l(a,t),l=l==null?t:X({},t,l),e.memoizedState=l,e.lanes===0&&(e.updateQueue.baseState=l)}var Ar={enqueueSetState:function(e,t,l){e=e._reactInternals;var a=dl(),n=ja(a);n.payload=t,l!=null&&(n.callback=l),t=Na(e,n,a),t!==null&&(It(t,e,a),Ai(t,e,a))},enqueueReplaceState:function(e,t,l){e=e._reactInternals;var a=dl(),n=ja(a);n.tag=1,n.payload=t,l!=null&&(n.callback=l),t=Na(e,n,a),t!==null&&(It(t,e,a),Ai(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var l=dl(),a=ja(l);a.tag=2,t!=null&&(a.callback=t),t=Na(e,a,l),t!==null&&(It(t,e,l),Ai(t,e,l))}};function jd(e,t,l,a,n,c,r){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,c,r):t.prototype&&t.prototype.isPureReactComponent?!vi(l,a)||!vi(n,c):!0}function Nd(e,t,l,a){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(l,a),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(l,a),t.state!==e&&Ar.enqueueReplaceState(t,t.state,null)}function on(e,t){var l=t;if("ref"in t){l={};for(var a in t)a!=="ref"&&(l[a]=t[a])}if(e=e.defaultProps){l===t&&(l=X({},l));for(var n in e)l[n]===void 0&&(l[n]=e[n])}return l}function Td(e){bc(e)}function Ad(e){console.error(e)}function Ed(e){bc(e)}function qc(e,t){try{var l=e.onUncaughtError;l(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function Cd(e,t,l){try{var a=e.onCaughtError;a(l.value,{componentStack:l.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(n){setTimeout(function(){throw n})}}function Er(e,t,l){return l=ja(l),l.tag=3,l.payload={element:null},l.callback=function(){qc(e,t)},l}function Dd(e){return e=ja(e),e.tag=3,e}function Od(e,t,l,a){var n=l.type.getDerivedStateFromError;if(typeof n=="function"){var c=a.value;e.payload=function(){return n(c)},e.callback=function(){Cd(t,l,a)}}var r=l.stateNode;r!==null&&typeof r.componentDidCatch=="function"&&(e.callback=function(){Cd(t,l,a),typeof n!="function"&&(Oa===null?Oa=new Set([this]):Oa.add(this));var u=a.stack;this.componentDidCatch(a.value,{componentStack:u!==null?u:""})})}function Zm(e,t,l,a,n){if(l.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=l.alternate,t!==null&&_n(t,l,n,!0),l=sl.current,l!==null){switch(l.tag){case 31:case 13:return Sl===null?es():l.alternate===null&&ft===0&&(ft=3),l.flags&=-257,l.flags|=65536,l.lanes=n,a===Oc?l.flags|=16384:(t=l.updateQueue,t===null?l.updateQueue=new Set([a]):t.add(a),Wr(e,a,n)),!1;case 22:return l.flags|=65536,a===Oc?l.flags|=16384:(t=l.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([a])},l.updateQueue=t):(l=t.retryQueue,l===null?t.retryQueue=new Set([a]):l.add(a)),Wr(e,a,n)),!1}throw Error(d(435,l.tag))}return Wr(e,a,n),es(),!1}if(Se)return t=sl.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=n,a!==Qs&&(e=Error(d(422),{cause:a}),xi(vl(e,l)))):(a!==Qs&&(t=Error(d(423),{cause:a}),xi(vl(t,l))),e=e.current.alternate,e.flags|=65536,n&=-n,e.lanes|=n,a=vl(a,l),n=Er(e.stateNode,a,n),lr(e,n),ft!==4&&(ft=2)),!1;var c=Error(d(520),{cause:a});if(c=vl(c,l),Hi===null?Hi=[c]:Hi.push(c),ft!==4&&(ft=2),t===null)return!0;a=vl(a,l),l=t;do{switch(l.tag){case 3:return l.flags|=65536,e=n&-n,l.lanes|=e,e=Er(l.stateNode,a,e),lr(l,e),!1;case 1:if(t=l.type,c=l.stateNode,(l.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||c!==null&&typeof c.componentDidCatch=="function"&&(Oa===null||!Oa.has(c))))return l.flags|=65536,n&=-n,l.lanes|=n,n=Dd(n),Od(n,e,l,a),lr(l,n),!1}l=l.return}while(l!==null);return!1}var Cr=Error(d(461)),Nt=!1;function _t(e,t,l,a){t.child=e===null?Gu(t,null,l,a):sn(t,e.child,l,a)}function zd(e,t,l,a,n){l=l.render;var c=t.ref;if("ref"in a){var r={};for(var u in a)u!=="ref"&&(r[u]=a[u])}else r=a;return ln(t),a=rr(e,t,l,r,c,n),u=or(),e!==null&&!Nt?(ur(e,t,n),na(e,t,n)):(Se&&u&&Ys(t),t.flags|=1,_t(e,t,a,n),t.child)}function Md(e,t,l,a,n){if(e===null){var c=l.type;return typeof c=="function"&&!Ls(c)&&c.defaultProps===void 0&&l.compare===null?(t.tag=15,t.type=c,kd(e,t,c,a,n)):(e=Nc(l.type,null,a,t,t.mode,n),e.ref=t.ref,e.return=t,t.child=e)}if(c=e.child,!wr(e,n)){var r=c.memoizedProps;if(l=l.compare,l=l!==null?l:vi,l(r,a)&&e.ref===t.ref)return na(e,t,n)}return t.flags|=1,e=Il(c,a),e.ref=t.ref,e.return=t,t.child=e}function kd(e,t,l,a,n){if(e!==null){var c=e.memoizedProps;if(vi(c,a)&&e.ref===t.ref)if(Nt=!1,t.pendingProps=a=c,wr(e,n))(e.flags&131072)!==0&&(Nt=!0);else return t.lanes=e.lanes,na(e,t,n)}return Dr(e,t,l,a,n)}function Gd(e,t,l,a){var n=a.children,c=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.mode==="hidden"){if((t.flags&128)!==0){if(c=c!==null?c.baseLanes|l:l,e!==null){for(a=t.child=e.child,n=0;a!==null;)n=n|a.lanes|a.childLanes,a=a.sibling;a=n&~c}else a=0,t.child=null;return _d(e,t,c,l,a)}if((l&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Cc(t,c!==null?c.cachePool:null),c!==null?Ru(t,c):nr(),Bu(t);else return a=t.lanes=536870912,_d(e,t,c!==null?c.baseLanes|l:l,l,a)}else c!==null?(Cc(t,c.cachePool),Ru(t,c),Aa(),t.memoizedState=null):(e!==null&&Cc(t,null),nr(),Aa());return _t(e,t,n,l),t.child}function ki(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function _d(e,t,l,a,n){var c=Is();return c=c===null?null:{parent:St._currentValue,pool:c},t.memoizedState={baseLanes:l,cachePool:c},e!==null&&Cc(t,null),nr(),Bu(t),e!==null&&_n(e,t,a,!0),t.childLanes=n,null}function Yc(e,t){return t=Qc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function wd(e,t,l){return sn(t,e.child,null,l),e=Yc(t,t.pendingProps),e.flags|=2,rl(t),t.memoizedState=null,e}function Km(e,t,l){var a=t.pendingProps,n=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Se){if(a.mode==="hidden")return e=Yc(t,a),t.lanes=536870912,ki(null,e);if(cr(t),(e=et)?(e=Kf(e,xl),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:va!==null?{id:Ul,overflow:Hl}:null,retryLane:536870912,hydrationErrors:null},l=yu(e),l.return=t,t.child=l,kt=t,et=null)):e=null,e===null)throw ba(t);return t.lanes=536870912,null}return Yc(t,a)}var c=e.memoizedState;if(c!==null){var r=c.dehydrated;if(cr(t),n)if(t.flags&256)t.flags&=-257,t=wd(e,t,l);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(d(558));else if(Nt||_n(e,t,l,!1),n=(l&e.childLanes)!==0,Nt||n){if(a=Qe,a!==null&&(r=ci(a,l),r!==0&&r!==c.retryLane))throw c.retryLane=r,Ia(e,r),It(a,e,r),Cr;es(),t=wd(e,t,l)}else e=c.treeContext,et=jl(r.nextSibling),kt=t,Se=!0,ya=null,xl=!1,e!==null&&Su(t,e),t=Yc(t,a),t.flags|=4096;return t}return e=Il(e.child,{mode:a.mode,children:a.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Xc(e,t){var l=t.ref;if(l===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(d(284));(e===null||e.ref!==l)&&(t.flags|=4194816)}}function Dr(e,t,l,a,n){return ln(t),l=rr(e,t,l,a,void 0,n),a=or(),e!==null&&!Nt?(ur(e,t,n),na(e,t,n)):(Se&&a&&Ys(t),t.flags|=1,_t(e,t,l,n),t.child)}function Rd(e,t,l,a,n,c){return ln(t),t.updateQueue=null,l=Hu(t,a,l,n),Uu(e),a=or(),e!==null&&!Nt?(ur(e,t,c),na(e,t,c)):(Se&&a&&Ys(t),t.flags|=1,_t(e,t,l,c),t.child)}function Bd(e,t,l,a,n){if(ln(t),t.stateNode===null){var c=zn,r=l.contextType;typeof r=="object"&&r!==null&&(c=Gt(r)),c=new l(a,c),t.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=Ar,t.stateNode=c,c._reactInternals=t,c=t.stateNode,c.props=a,c.state=t.memoizedState,c.refs={},er(t),r=l.contextType,c.context=typeof r=="object"&&r!==null?Gt(r):zn,c.state=t.memoizedState,r=l.getDerivedStateFromProps,typeof r=="function"&&(Tr(t,l,r,a),c.state=t.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof c.getSnapshotBeforeUpdate=="function"||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(r=c.state,typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount(),r!==c.state&&Ar.enqueueReplaceState(c,c.state,null),Ci(t,a,c,n),Ei(),c.state=t.memoizedState),typeof c.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){c=t.stateNode;var u=t.memoizedProps,g=on(l,u);c.props=g;var j=c.context,O=l.contextType;r=zn,typeof O=="object"&&O!==null&&(r=Gt(O));var G=l.getDerivedStateFromProps;O=typeof G=="function"||typeof c.getSnapshotBeforeUpdate=="function",u=t.pendingProps!==u,O||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(u||j!==r)&&Nd(t,c,a,r),Sa=!1;var A=t.memoizedState;c.state=A,Ci(t,a,c,n),Ei(),j=t.memoizedState,u||A!==j||Sa?(typeof G=="function"&&(Tr(t,l,G,a),j=t.memoizedState),(g=Sa||jd(t,l,g,a,A,j,r))?(O||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount()),typeof c.componentDidMount=="function"&&(t.flags|=4194308)):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=j),c.props=a,c.state=j,c.context=r,a=g):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{c=t.stateNode,tr(e,t),r=t.memoizedProps,O=on(l,r),c.props=O,G=t.pendingProps,A=c.context,j=l.contextType,g=zn,typeof j=="object"&&j!==null&&(g=Gt(j)),u=l.getDerivedStateFromProps,(j=typeof u=="function"||typeof c.getSnapshotBeforeUpdate=="function")||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(r!==G||A!==g)&&Nd(t,c,a,g),Sa=!1,A=t.memoizedState,c.state=A,Ci(t,a,c,n),Ei();var E=t.memoizedState;r!==G||A!==E||Sa||e!==null&&e.dependencies!==null&&Ac(e.dependencies)?(typeof u=="function"&&(Tr(t,l,u,a),E=t.memoizedState),(O=Sa||jd(t,l,O,a,A,E,g)||e!==null&&e.dependencies!==null&&Ac(e.dependencies))?(j||typeof c.UNSAFE_componentWillUpdate!="function"&&typeof c.componentWillUpdate!="function"||(typeof c.componentWillUpdate=="function"&&c.componentWillUpdate(a,E,g),typeof c.UNSAFE_componentWillUpdate=="function"&&c.UNSAFE_componentWillUpdate(a,E,g)),typeof c.componentDidUpdate=="function"&&(t.flags|=4),typeof c.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof c.componentDidUpdate!="function"||r===e.memoizedProps&&A===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||r===e.memoizedProps&&A===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=E),c.props=a,c.state=E,c.context=g,a=O):(typeof c.componentDidUpdate!="function"||r===e.memoizedProps&&A===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||r===e.memoizedProps&&A===e.memoizedState||(t.flags|=1024),a=!1)}return c=a,Xc(e,t),a=(t.flags&128)!==0,c||a?(c=t.stateNode,l=a&&typeof l.getDerivedStateFromError!="function"?null:c.render(),t.flags|=1,e!==null&&a?(t.child=sn(t,e.child,null,n),t.child=sn(t,null,l,n)):_t(e,t,l,n),t.memoizedState=c.state,e=t.child):e=na(e,t,n),e}function Ud(e,t,l,a){return en(),t.flags|=256,_t(e,t,l,a),t.child}var Or={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function zr(e){return{baseLanes:e,cachePool:Cu()}}function Mr(e,t,l){return e=e!==null?e.childLanes&~l:0,t&&(e|=ul),e}function Hd(e,t,l){var a=t.pendingProps,n=!1,c=(t.flags&128)!==0,r;if((r=c)||(r=e!==null&&e.memoizedState===null?!1:(pt.current&2)!==0),r&&(n=!0,t.flags&=-129),r=(t.flags&32)!==0,t.flags&=-33,e===null){if(Se){if(n?Ta(t):Aa(),(e=et)?(e=Kf(e,xl),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:va!==null?{id:Ul,overflow:Hl}:null,retryLane:536870912,hydrationErrors:null},l=yu(e),l.return=t,t.child=l,kt=t,et=null)):e=null,e===null)throw ba(t);return mo(e)?t.lanes=32:t.lanes=536870912,null}var u=a.children;return a=a.fallback,n?(Aa(),n=t.mode,u=Qc({mode:"hidden",children:u},n),a=Pa(a,n,l,null),u.return=t,a.return=t,u.sibling=a,t.child=u,a=t.child,a.memoizedState=zr(l),a.childLanes=Mr(e,r,l),t.memoizedState=Or,ki(null,a)):(Ta(t),kr(t,u))}var g=e.memoizedState;if(g!==null&&(u=g.dehydrated,u!==null)){if(c)t.flags&256?(Ta(t),t.flags&=-257,t=Gr(e,t,l)):t.memoizedState!==null?(Aa(),t.child=e.child,t.flags|=128,t=null):(Aa(),u=a.fallback,n=t.mode,a=Qc({mode:"visible",children:a.children},n),u=Pa(u,n,l,null),u.flags|=2,a.return=t,u.return=t,a.sibling=u,t.child=a,sn(t,e.child,null,l),a=t.child,a.memoizedState=zr(l),a.childLanes=Mr(e,r,l),t.memoizedState=Or,t=ki(null,a));else if(Ta(t),mo(u)){if(r=u.nextSibling&&u.nextSibling.dataset,r)var j=r.dgst;r=j,a=Error(d(419)),a.stack="",a.digest=r,xi({value:a,source:null,stack:null}),t=Gr(e,t,l)}else if(Nt||_n(e,t,l,!1),r=(l&e.childLanes)!==0,Nt||r){if(r=Qe,r!==null&&(a=ci(r,l),a!==0&&a!==g.retryLane))throw g.retryLane=a,Ia(e,a),It(r,e,a),Cr;go(u)||es(),t=Gr(e,t,l)}else go(u)?(t.flags|=192,t.child=e.child,t=null):(e=g.treeContext,et=jl(u.nextSibling),kt=t,Se=!0,ya=null,xl=!1,e!==null&&Su(t,e),t=kr(t,a.children),t.flags|=4096);return t}return n?(Aa(),u=a.fallback,n=t.mode,g=e.child,j=g.sibling,a=Il(g,{mode:"hidden",children:a.children}),a.subtreeFlags=g.subtreeFlags&65011712,j!==null?u=Il(j,u):(u=Pa(u,n,l,null),u.flags|=2),u.return=t,a.return=t,a.sibling=u,t.child=a,ki(null,a),a=t.child,u=e.child.memoizedState,u===null?u=zr(l):(n=u.cachePool,n!==null?(g=St._currentValue,n=n.parent!==g?{parent:g,pool:g}:n):n=Cu(),u={baseLanes:u.baseLanes|l,cachePool:n}),a.memoizedState=u,a.childLanes=Mr(e,r,l),t.memoizedState=Or,ki(e.child,a)):(Ta(t),l=e.child,e=l.sibling,l=Il(l,{mode:"visible",children:a.children}),l.return=t,l.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=l,t.memoizedState=null,l)}function kr(e,t){return t=Qc({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Qc(e,t){return e=cl(22,e,null,t),e.lanes=0,e}function Gr(e,t,l){return sn(t,e.child,null,l),e=kr(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Ld(e,t,l){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),Ks(e.return,t,l)}function _r(e,t,l,a,n,c){var r=e.memoizedState;r===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:l,tailMode:n,treeForkCount:c}:(r.isBackwards=t,r.rendering=null,r.renderingStartTime=0,r.last=a,r.tail=l,r.tailMode=n,r.treeForkCount=c)}function Fd(e,t,l){var a=t.pendingProps,n=a.revealOrder,c=a.tail;a=a.children;var r=pt.current,u=(r&2)!==0;if(u?(r=r&1|2,t.flags|=128):r&=1,q(pt,r),_t(e,t,a,l),a=Se?bi:0,!u&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Ld(e,l,t);else if(e.tag===19)Ld(e,l,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(n){case"forwards":for(l=t.child,n=null;l!==null;)e=l.alternate,e!==null&&Gc(e)===null&&(n=l),l=l.sibling;l=n,l===null?(n=t.child,t.child=null):(n=l.sibling,l.sibling=null),_r(t,!1,n,l,c,a);break;case"backwards":case"unstable_legacy-backwards":for(l=null,n=t.child,t.child=null;n!==null;){if(e=n.alternate,e!==null&&Gc(e)===null){t.child=n;break}e=n.sibling,n.sibling=l,l=n,n=e}_r(t,!0,l,null,c,a);break;case"together":_r(t,!1,null,null,void 0,a);break;default:t.memoizedState=null}return t.child}function na(e,t,l){if(e!==null&&(t.dependencies=e.dependencies),Da|=t.lanes,(l&t.childLanes)===0)if(e!==null){if(_n(e,t,l,!1),(l&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(d(153));if(t.child!==null){for(e=t.child,l=Il(e,e.pendingProps),t.child=l,l.return=t;e.sibling!==null;)e=e.sibling,l=l.sibling=Il(e,e.pendingProps),l.return=t;l.sibling=null}return t.child}function wr(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Ac(e)))}function Jm(e,t,l){switch(t.tag){case 3:mt(t,t.stateNode.containerInfo),xa(t,St,e.memoizedState.cache),en();break;case 27:case 5:He(t);break;case 4:mt(t,t.stateNode.containerInfo);break;case 10:xa(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,cr(t),null;break;case 13:var a=t.memoizedState;if(a!==null)return a.dehydrated!==null?(Ta(t),t.flags|=128,null):(l&t.child.childLanes)!==0?Hd(e,t,l):(Ta(t),e=na(e,t,l),e!==null?e.sibling:null);Ta(t);break;case 19:var n=(e.flags&128)!==0;if(a=(l&t.childLanes)!==0,a||(_n(e,t,l,!1),a=(l&t.childLanes)!==0),n){if(a)return Fd(e,t,l);t.flags|=128}if(n=t.memoizedState,n!==null&&(n.rendering=null,n.tail=null,n.lastEffect=null),q(pt,pt.current),a)break;return null;case 22:return t.lanes=0,Gd(e,t,l,t.pendingProps);case 24:xa(t,St,e.memoizedState.cache)}return na(e,t,l)}function qd(e,t,l){if(e!==null)if(e.memoizedProps!==t.pendingProps)Nt=!0;else{if(!wr(e,l)&&(t.flags&128)===0)return Nt=!1,Jm(e,t,l);Nt=(e.flags&131072)!==0}else Nt=!1,Se&&(t.flags&1048576)!==0&&xu(t,bi,t.index);switch(t.lanes=0,t.tag){case 16:e:{var a=t.pendingProps;if(e=nn(t.elementType),t.type=e,typeof e=="function")Ls(e)?(a=on(e,a),t.tag=1,t=Bd(null,t,e,a,l)):(t.tag=0,t=Dr(null,t,e,a,l));else{if(e!=null){var n=e.$$typeof;if(n===Ce){t.tag=11,t=zd(null,t,e,a,l);break e}else if(n===V){t.tag=14,t=Md(null,t,e,a,l);break e}}throw t=yt(e)||e,Error(d(306,t,""))}}return t;case 0:return Dr(e,t,t.type,t.pendingProps,l);case 1:return a=t.type,n=on(a,t.pendingProps),Bd(e,t,a,n,l);case 3:e:{if(mt(t,t.stateNode.containerInfo),e===null)throw Error(d(387));a=t.pendingProps;var c=t.memoizedState;n=c.element,tr(e,t),Ci(t,a,null,l);var r=t.memoizedState;if(a=r.cache,xa(t,St,a),a!==c.cache&&Js(t,[St],l,!0),Ei(),a=r.element,c.isDehydrated)if(c={element:a,isDehydrated:!1,cache:r.cache},t.updateQueue.baseState=c,t.memoizedState=c,t.flags&256){t=Ud(e,t,a,l);break e}else if(a!==n){n=vl(Error(d(424)),t),xi(n),t=Ud(e,t,a,l);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(et=jl(e.firstChild),kt=t,Se=!0,ya=null,xl=!0,l=Gu(t,null,a,l),t.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(en(),a===n){t=na(e,t,l);break e}_t(e,t,a,l)}t=t.child}return t;case 26:return Xc(e,t),e===null?(l=eg(t.type,null,t.pendingProps,null))?t.memoizedState=l:Se||(l=t.type,e=t.pendingProps,a=ss(se.current).createElement(l),a[$e]=t,a[Pe]=e,wt(a,l,e),xt(a),t.stateNode=a):t.memoizedState=eg(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return He(t),e===null&&Se&&(a=t.stateNode=Wf(t.type,t.pendingProps,se.current),kt=t,xl=!0,n=et,Ga(t.type)?(ho=n,et=jl(a.firstChild)):et=n),_t(e,t,t.pendingProps.children,l),Xc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Se&&((n=a=et)&&(a=Ah(a,t.type,t.pendingProps,xl),a!==null?(t.stateNode=a,kt=t,et=jl(a.firstChild),xl=!1,n=!0):n=!1),n||ba(t)),He(t),n=t.type,c=t.pendingProps,r=e!==null?e.memoizedProps:null,a=c.children,oo(n,c)?a=null:r!==null&&oo(n,r)&&(t.flags|=32),t.memoizedState!==null&&(n=rr(e,t,Lm,null,null,l),Zi._currentValue=n),Xc(e,t),_t(e,t,a,l),t.child;case 6:return e===null&&Se&&((e=l=et)&&(l=Eh(l,t.pendingProps,xl),l!==null?(t.stateNode=l,kt=t,et=null,e=!0):e=!1),e||ba(t)),null;case 13:return Hd(e,t,l);case 4:return mt(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=sn(t,null,a,l):_t(e,t,a,l),t.child;case 11:return zd(e,t,t.type,t.pendingProps,l);case 7:return _t(e,t,t.pendingProps,l),t.child;case 8:return _t(e,t,t.pendingProps.children,l),t.child;case 12:return _t(e,t,t.pendingProps.children,l),t.child;case 10:return a=t.pendingProps,xa(t,t.type,a.value),_t(e,t,a.children,l),t.child;case 9:return n=t.type._context,a=t.pendingProps.children,ln(t),n=Gt(n),a=a(n),t.flags|=1,_t(e,t,a,l),t.child;case 14:return Md(e,t,t.type,t.pendingProps,l);case 15:return kd(e,t,t.type,t.pendingProps,l);case 19:return Fd(e,t,l);case 31:return Km(e,t,l);case 22:return Gd(e,t,l,t.pendingProps);case 24:return ln(t),a=Gt(St),e===null?(n=Is(),n===null&&(n=Qe,c=$s(),n.pooledCache=c,c.refCount++,c!==null&&(n.pooledCacheLanes|=l),n=c),t.memoizedState={parent:a,cache:n},er(t),xa(t,St,n)):((e.lanes&l)!==0&&(tr(e,t),Ci(t,null,null,l),Ei()),n=e.memoizedState,c=t.memoizedState,n.parent!==a?(n={parent:a,cache:a},t.memoizedState=n,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=n),xa(t,St,a)):(a=c.cache,xa(t,St,a),a!==n.cache&&Js(t,[St],l,!0))),_t(e,t,t.pendingProps.children,l),t.child;case 29:throw t.pendingProps}throw Error(d(156,t.tag))}function ia(e){e.flags|=4}function Rr(e,t,l,a,n){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(n&335544128)===n)if(e.stateNode.complete)e.flags|=8192;else if(pf())e.flags|=8192;else throw cn=Oc,Ps}else e.flags&=-16777217}function Yd(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!ig(t))if(pf())e.flags|=8192;else throw cn=Oc,Ps}function Vc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?we():536870912,e.lanes|=t,Vn|=t)}function Gi(e,t){if(!Se)switch(e.tailMode){case"hidden":t=e.tail;for(var l=null;t!==null;)t.alternate!==null&&(l=t),t=t.sibling;l===null?e.tail=null:l.sibling=null;break;case"collapsed":l=e.tail;for(var a=null;l!==null;)l.alternate!==null&&(a=l),l=l.sibling;a===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null}}function tt(e){var t=e.alternate!==null&&e.alternate.child===e.child,l=0,a=0;if(t)for(var n=e.child;n!==null;)l|=n.lanes|n.childLanes,a|=n.subtreeFlags&65011712,a|=n.flags&65011712,n.return=e,n=n.sibling;else for(n=e.child;n!==null;)l|=n.lanes|n.childLanes,a|=n.subtreeFlags,a|=n.flags,n.return=e,n=n.sibling;return e.subtreeFlags|=a,e.childLanes=l,t}function $m(e,t,l){var a=t.pendingProps;switch(Xs(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return tt(t),null;case 1:return tt(t),null;case 3:return l=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),ta(St),Ke(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(Gn(t)?ia(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Vs())),tt(t),null;case 26:var n=t.type,c=t.memoizedState;return e===null?(ia(t),c!==null?(tt(t),Yd(t,c)):(tt(t),Rr(t,n,null,a,l))):c?c!==e.memoizedState?(ia(t),tt(t),Yd(t,c)):(tt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&ia(t),tt(t),Rr(t,n,e,a,l)),null;case 27:if(el(t),l=se.current,n=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&ia(t);else{if(!a){if(t.stateNode===null)throw Error(d(166));return tt(t),null}e=K.current,Gn(t)?ju(t):(e=Wf(n,a,l),t.stateNode=e,ia(t))}return tt(t),null;case 5:if(el(t),n=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&ia(t);else{if(!a){if(t.stateNode===null)throw Error(d(166));return tt(t),null}if(c=K.current,Gn(t))ju(t);else{var r=ss(se.current);switch(c){case 1:c=r.createElementNS("http://www.w3.org/2000/svg",n);break;case 2:c=r.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;default:switch(n){case"svg":c=r.createElementNS("http://www.w3.org/2000/svg",n);break;case"math":c=r.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;case"script":c=r.createElement("div"),c.innerHTML="<script><\/script>",c=c.removeChild(c.firstChild);break;case"select":c=typeof a.is=="string"?r.createElement("select",{is:a.is}):r.createElement("select"),a.multiple?c.multiple=!0:a.size&&(c.size=a.size);break;default:c=typeof a.is=="string"?r.createElement(n,{is:a.is}):r.createElement(n)}}c[$e]=t,c[Pe]=a;e:for(r=t.child;r!==null;){if(r.tag===5||r.tag===6)c.appendChild(r.stateNode);else if(r.tag!==4&&r.tag!==27&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break e;for(;r.sibling===null;){if(r.return===null||r.return===t)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}t.stateNode=c;e:switch(wt(c,n,a),n){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&ia(t)}}return tt(t),Rr(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,l),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&ia(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(d(166));if(e=se.current,Gn(t)){if(e=t.stateNode,l=t.memoizedProps,a=null,n=kt,n!==null)switch(n.tag){case 27:case 5:a=n.memoizedProps}e[$e]=t,e=!!(e.nodeValue===l||a!==null&&a.suppressHydrationWarning===!0||Lf(e.nodeValue,l)),e||ba(t,!0)}else e=ss(e).createTextNode(a),e[$e]=t,t.stateNode=e}return tt(t),null;case 31:if(l=t.memoizedState,e===null||e.memoizedState!==null){if(a=Gn(t),l!==null){if(e===null){if(!a)throw Error(d(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(d(557));e[$e]=t}else en(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;tt(t),e=!1}else l=Vs(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return t.flags&256?(rl(t),t):(rl(t),null);if((t.flags&128)!==0)throw Error(d(558))}return tt(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(n=Gn(t),a!==null&&a.dehydrated!==null){if(e===null){if(!n)throw Error(d(318));if(n=t.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(d(317));n[$e]=t}else en(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;tt(t),n=!1}else n=Vs(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),n=!0;if(!n)return t.flags&256?(rl(t),t):(rl(t),null)}return rl(t),(t.flags&128)!==0?(t.lanes=l,t):(l=a!==null,e=e!==null&&e.memoizedState!==null,l&&(a=t.child,n=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(n=a.alternate.memoizedState.cachePool.pool),c=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(c=a.memoizedState.cachePool.pool),c!==n&&(a.flags|=2048)),l!==e&&l&&(t.child.flags|=8192),Vc(t,t.updateQueue),tt(t),null);case 4:return Ke(),e===null&&no(t.stateNode.containerInfo),tt(t),null;case 10:return ta(t.type),tt(t),null;case 19:if(z(pt),a=t.memoizedState,a===null)return tt(t),null;if(n=(t.flags&128)!==0,c=a.rendering,c===null)if(n)Gi(a,!1);else{if(ft!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(c=Gc(e),c!==null){for(t.flags|=128,Gi(a,!1),e=c.updateQueue,t.updateQueue=e,Vc(t,e),t.subtreeFlags=0,e=l,l=t.child;l!==null;)vu(l,e),l=l.sibling;return q(pt,pt.current&1|2),Se&&Pl(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&bt()>Wc&&(t.flags|=128,n=!0,Gi(a,!1),t.lanes=4194304)}else{if(!n)if(e=Gc(c),e!==null){if(t.flags|=128,n=!0,e=e.updateQueue,t.updateQueue=e,Vc(t,e),Gi(a,!0),a.tail===null&&a.tailMode==="hidden"&&!c.alternate&&!Se)return tt(t),null}else 2*bt()-a.renderingStartTime>Wc&&l!==536870912&&(t.flags|=128,n=!0,Gi(a,!1),t.lanes=4194304);a.isBackwards?(c.sibling=t.child,t.child=c):(e=a.last,e!==null?e.sibling=c:t.child=c,a.last=c)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=bt(),e.sibling=null,l=pt.current,q(pt,n?l&1|2:l&1),Se&&Pl(t,a.treeForkCount),e):(tt(t),null);case 22:case 23:return rl(t),ir(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(l&536870912)!==0&&(t.flags&128)===0&&(tt(t),t.subtreeFlags&6&&(t.flags|=8192)):tt(t),l=t.updateQueue,l!==null&&Vc(t,l.retryQueue),l=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==l&&(t.flags|=2048),e!==null&&z(an),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),ta(St),tt(t),null;case 25:return null;case 30:return null}throw Error(d(156,t.tag))}function Wm(e,t){switch(Xs(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ta(St),Ke(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return el(t),null;case 31:if(t.memoizedState!==null){if(rl(t),t.alternate===null)throw Error(d(340));en()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(rl(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(d(340));en()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return z(pt),null;case 4:return Ke(),null;case 10:return ta(t.type),null;case 22:case 23:return rl(t),ir(),e!==null&&z(an),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ta(St),null;case 25:return null;default:return null}}function Xd(e,t){switch(Xs(t),t.tag){case 3:ta(St),Ke();break;case 26:case 27:case 5:el(t);break;case 4:Ke();break;case 31:t.memoizedState!==null&&rl(t);break;case 13:rl(t);break;case 19:z(pt);break;case 10:ta(t.type);break;case 22:case 23:rl(t),ir(),e!==null&&z(an);break;case 24:ta(St)}}function _i(e,t){try{var l=t.updateQueue,a=l!==null?l.lastEffect:null;if(a!==null){var n=a.next;l=n;do{if((l.tag&e)===e){a=void 0;var c=l.create,r=l.inst;a=c(),r.destroy=a}l=l.next}while(l!==n)}}catch(u){Be(t,t.return,u)}}function Ea(e,t,l){try{var a=t.updateQueue,n=a!==null?a.lastEffect:null;if(n!==null){var c=n.next;a=c;do{if((a.tag&e)===e){var r=a.inst,u=r.destroy;if(u!==void 0){r.destroy=void 0,n=t;var g=l,j=u;try{j()}catch(O){Be(n,g,O)}}}a=a.next}while(a!==c)}}catch(O){Be(t,t.return,O)}}function Qd(e){var t=e.updateQueue;if(t!==null){var l=e.stateNode;try{wu(t,l)}catch(a){Be(e,e.return,a)}}}function Vd(e,t,l){l.props=on(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(a){Be(e,t,a)}}function wi(e,t){try{var l=e.ref;if(l!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:a=e.stateNode;break;default:a=e.stateNode}typeof l=="function"?e.refCleanup=l(a):l.current=a}}catch(n){Be(e,t,n)}}function Ll(e,t){var l=e.ref,a=e.refCleanup;if(l!==null)if(typeof a=="function")try{a()}catch(n){Be(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(n){Be(e,t,n)}else l.current=null}function Zd(e){var t=e.type,l=e.memoizedProps,a=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":l.autoFocus&&a.focus();break e;case"img":l.src?a.src=l.src:l.srcSet&&(a.srcset=l.srcSet)}}catch(n){Be(e,e.return,n)}}function Br(e,t,l){try{var a=e.stateNode;bh(a,e.type,l,t),a[Pe]=t}catch(n){Be(e,e.return,n)}}function Kd(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ga(e.type)||e.tag===4}function Ur(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Kd(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Ga(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Hr(e,t,l){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(e,t):(t=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,t.appendChild(e),l=l._reactRootContainer,l!=null||t.onclick!==null||(t.onclick=hl));else if(a!==4&&(a===27&&Ga(e.type)&&(l=e.stateNode,t=null),e=e.child,e!==null))for(Hr(e,t,l),e=e.sibling;e!==null;)Hr(e,t,l),e=e.sibling}function Zc(e,t,l){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?l.insertBefore(e,t):l.appendChild(e);else if(a!==4&&(a===27&&Ga(e.type)&&(l=e.stateNode),e=e.child,e!==null))for(Zc(e,t,l),e=e.sibling;e!==null;)Zc(e,t,l),e=e.sibling}function Jd(e){var t=e.stateNode,l=e.memoizedProps;try{for(var a=e.type,n=t.attributes;n.length;)t.removeAttributeNode(n[0]);wt(t,a,l),t[$e]=e,t[Pe]=l}catch(c){Be(e,e.return,c)}}var ca=!1,Tt=!1,Lr=!1,$d=typeof WeakSet=="function"?WeakSet:Set,Ot=null;function Im(e,t){if(e=e.containerInfo,so=ms,e=ru(e),Gs(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var a=l.getSelection&&l.getSelection();if(a&&a.rangeCount!==0){l=a.anchorNode;var n=a.anchorOffset,c=a.focusNode;a=a.focusOffset;try{l.nodeType,c.nodeType}catch{l=null;break e}var r=0,u=-1,g=-1,j=0,O=0,G=e,A=null;t:for(;;){for(var E;G!==l||n!==0&&G.nodeType!==3||(u=r+n),G!==c||a!==0&&G.nodeType!==3||(g=r+a),G.nodeType===3&&(r+=G.nodeValue.length),(E=G.firstChild)!==null;)A=G,G=E;for(;;){if(G===e)break t;if(A===l&&++j===n&&(u=r),A===c&&++O===a&&(g=r),(E=G.nextSibling)!==null)break;G=A,A=G.parentNode}G=E}l=u===-1||g===-1?null:{start:u,end:g}}else l=null}l=l||{start:0,end:0}}else l=null;for(ro={focusedElem:e,selectionRange:l},ms=!1,Ot=t;Ot!==null;)if(t=Ot,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ot=e;else for(;Ot!==null;){switch(t=Ot,c=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(l=0;l<e.length;l++)n=e[l],n.ref.impl=n.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&c!==null){e=void 0,l=t,n=c.memoizedProps,c=c.memoizedState,a=l.stateNode;try{var $=on(l.type,n);e=a.getSnapshotBeforeUpdate($,c),a.__reactInternalSnapshotBeforeUpdate=e}catch(te){Be(l,l.return,te)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,l=e.nodeType,l===9)fo(e);else if(l===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":fo(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(d(163))}if(e=t.sibling,e!==null){e.return=t.return,Ot=e;break}Ot=t.return}}function Wd(e,t,l){var a=l.flags;switch(l.tag){case 0:case 11:case 15:ra(e,l),a&4&&_i(5,l);break;case 1:if(ra(e,l),a&4)if(e=l.stateNode,t===null)try{e.componentDidMount()}catch(r){Be(l,l.return,r)}else{var n=on(l.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(n,t,e.__reactInternalSnapshotBeforeUpdate)}catch(r){Be(l,l.return,r)}}a&64&&Qd(l),a&512&&wi(l,l.return);break;case 3:if(ra(e,l),a&64&&(e=l.updateQueue,e!==null)){if(t=null,l.child!==null)switch(l.child.tag){case 27:case 5:t=l.child.stateNode;break;case 1:t=l.child.stateNode}try{wu(e,t)}catch(r){Be(l,l.return,r)}}break;case 27:t===null&&a&4&&Jd(l);case 26:case 5:ra(e,l),t===null&&a&4&&Zd(l),a&512&&wi(l,l.return);break;case 12:ra(e,l);break;case 31:ra(e,l),a&4&&ef(e,l);break;case 13:ra(e,l),a&4&&tf(e,l),a&64&&(e=l.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(l=sh.bind(null,l),Ch(e,l))));break;case 22:if(a=l.memoizedState!==null||ca,!a){t=t!==null&&t.memoizedState!==null||Tt,n=ca;var c=Tt;ca=a,(Tt=t)&&!c?oa(e,l,(l.subtreeFlags&8772)!==0):ra(e,l),ca=n,Tt=c}break;case 30:break;default:ra(e,l)}}function Id(e){var t=e.alternate;t!==null&&(e.alternate=null,Id(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&vn(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var nt=null,Kt=!1;function sa(e,t,l){for(l=l.child;l!==null;)Pd(e,t,l),l=l.sibling}function Pd(e,t,l){if(at&&typeof at.onCommitFiberUnmount=="function")try{at.onCommitFiberUnmount(al,l)}catch{}switch(l.tag){case 26:Tt||Ll(l,t),sa(e,t,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:Tt||Ll(l,t);var a=nt,n=Kt;Ga(l.type)&&(nt=l.stateNode,Kt=!1),sa(e,t,l),Xi(l.stateNode),nt=a,Kt=n;break;case 5:Tt||Ll(l,t);case 6:if(a=nt,n=Kt,nt=null,sa(e,t,l),nt=a,Kt=n,nt!==null)if(Kt)try{(nt.nodeType===9?nt.body:nt.nodeName==="HTML"?nt.ownerDocument.body:nt).removeChild(l.stateNode)}catch(c){Be(l,t,c)}else try{nt.removeChild(l.stateNode)}catch(c){Be(l,t,c)}break;case 18:nt!==null&&(Kt?(e=nt,Vf(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.stateNode),ei(e)):Vf(nt,l.stateNode));break;case 4:a=nt,n=Kt,nt=l.stateNode.containerInfo,Kt=!0,sa(e,t,l),nt=a,Kt=n;break;case 0:case 11:case 14:case 15:Ea(2,l,t),Tt||Ea(4,l,t),sa(e,t,l);break;case 1:Tt||(Ll(l,t),a=l.stateNode,typeof a.componentWillUnmount=="function"&&Vd(l,t,a)),sa(e,t,l);break;case 21:sa(e,t,l);break;case 22:Tt=(a=Tt)||l.memoizedState!==null,sa(e,t,l),Tt=a;break;default:sa(e,t,l)}}function ef(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{ei(e)}catch(l){Be(t,t.return,l)}}}function tf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{ei(e)}catch(l){Be(t,t.return,l)}}function Pm(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new $d),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new $d),t;default:throw Error(d(435,e.tag))}}function Kc(e,t){var l=Pm(e);t.forEach(function(a){if(!l.has(a)){l.add(a);var n=rh.bind(null,e,a);a.then(n,n)}})}function Jt(e,t){var l=t.deletions;if(l!==null)for(var a=0;a<l.length;a++){var n=l[a],c=e,r=t,u=r;e:for(;u!==null;){switch(u.tag){case 27:if(Ga(u.type)){nt=u.stateNode,Kt=!1;break e}break;case 5:nt=u.stateNode,Kt=!1;break e;case 3:case 4:nt=u.stateNode.containerInfo,Kt=!0;break e}u=u.return}if(nt===null)throw Error(d(160));Pd(c,r,n),nt=null,Kt=!1,c=n.alternate,c!==null&&(c.return=null),n.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)lf(t,e),t=t.sibling}var zl=null;function lf(e,t){var l=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Jt(t,e),$t(e),a&4&&(Ea(3,e,e.return),_i(3,e),Ea(5,e,e.return));break;case 1:Jt(t,e),$t(e),a&512&&(Tt||l===null||Ll(l,l.return)),a&64&&ca&&(e=e.updateQueue,e!==null&&(a=e.callbacks,a!==null&&(l=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=l===null?a:l.concat(a))));break;case 26:var n=zl;if(Jt(t,e),$t(e),a&512&&(Tt||l===null||Ll(l,l.return)),a&4){var c=l!==null?l.memoizedState:null;if(a=e.memoizedState,l===null)if(a===null)if(e.stateNode===null){e:{a=e.type,l=e.memoizedProps,n=n.ownerDocument||n;t:switch(a){case"title":c=n.getElementsByTagName("title")[0],(!c||c[Va]||c[$e]||c.namespaceURI==="http://www.w3.org/2000/svg"||c.hasAttribute("itemprop"))&&(c=n.createElement(a),n.head.insertBefore(c,n.querySelector("head > title"))),wt(c,a,l),c[$e]=e,xt(c),a=c;break e;case"link":var r=ag("link","href",n).get(a+(l.href||""));if(r){for(var u=0;u<r.length;u++)if(c=r[u],c.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&c.getAttribute("rel")===(l.rel==null?null:l.rel)&&c.getAttribute("title")===(l.title==null?null:l.title)&&c.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){r.splice(u,1);break t}}c=n.createElement(a),wt(c,a,l),n.head.appendChild(c);break;case"meta":if(r=ag("meta","content",n).get(a+(l.content||""))){for(u=0;u<r.length;u++)if(c=r[u],c.getAttribute("content")===(l.content==null?null:""+l.content)&&c.getAttribute("name")===(l.name==null?null:l.name)&&c.getAttribute("property")===(l.property==null?null:l.property)&&c.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&c.getAttribute("charset")===(l.charSet==null?null:l.charSet)){r.splice(u,1);break t}}c=n.createElement(a),wt(c,a,l),n.head.appendChild(c);break;default:throw Error(d(468,a))}c[$e]=e,xt(c),a=c}e.stateNode=a}else ng(n,e.type,e.stateNode);else e.stateNode=lg(n,a,e.memoizedProps);else c!==a?(c===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):c.count--,a===null?ng(n,e.type,e.stateNode):lg(n,a,e.memoizedProps)):a===null&&e.stateNode!==null&&Br(e,e.memoizedProps,l.memoizedProps)}break;case 27:Jt(t,e),$t(e),a&512&&(Tt||l===null||Ll(l,l.return)),l!==null&&a&4&&Br(e,e.memoizedProps,l.memoizedProps);break;case 5:if(Jt(t,e),$t(e),a&512&&(Tt||l===null||Ll(l,l.return)),e.flags&32){n=e.stateNode;try{Wl(n,"")}catch($){Be(e,e.return,$)}}a&4&&e.stateNode!=null&&(n=e.memoizedProps,Br(e,n,l!==null?l.memoizedProps:n)),a&1024&&(Lr=!0);break;case 6:if(Jt(t,e),$t(e),a&4){if(e.stateNode===null)throw Error(d(162));a=e.memoizedProps,l=e.stateNode;try{l.nodeValue=a}catch($){Be(e,e.return,$)}}break;case 3:if(us=null,n=zl,zl=rs(t.containerInfo),Jt(t,e),zl=n,$t(e),a&4&&l!==null&&l.memoizedState.isDehydrated)try{ei(t.containerInfo)}catch($){Be(e,e.return,$)}Lr&&(Lr=!1,af(e));break;case 4:a=zl,zl=rs(e.stateNode.containerInfo),Jt(t,e),$t(e),zl=a;break;case 12:Jt(t,e),$t(e);break;case 31:Jt(t,e),$t(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Kc(e,a)));break;case 13:Jt(t,e),$t(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&($c=bt()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Kc(e,a)));break;case 22:n=e.memoizedState!==null;var g=l!==null&&l.memoizedState!==null,j=ca,O=Tt;if(ca=j||n,Tt=O||g,Jt(t,e),Tt=O,ca=j,$t(e),a&8192)e:for(t=e.stateNode,t._visibility=n?t._visibility&-2:t._visibility|1,n&&(l===null||g||ca||Tt||un(e)),l=null,t=e;;){if(t.tag===5||t.tag===26){if(l===null){g=l=t;try{if(c=g.stateNode,n)r=c.style,typeof r.setProperty=="function"?r.setProperty("display","none","important"):r.display="none";else{u=g.stateNode;var G=g.memoizedProps.style,A=G!=null&&G.hasOwnProperty("display")?G.display:null;u.style.display=A==null||typeof A=="boolean"?"":(""+A).trim()}}catch($){Be(g,g.return,$)}}}else if(t.tag===6){if(l===null){g=t;try{g.stateNode.nodeValue=n?"":g.memoizedProps}catch($){Be(g,g.return,$)}}}else if(t.tag===18){if(l===null){g=t;try{var E=g.stateNode;n?Zf(E,!0):Zf(g.stateNode,!1)}catch($){Be(g,g.return,$)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;l===t&&(l=null),t=t.return}l===t&&(l=null),t.sibling.return=t.return,t=t.sibling}a&4&&(a=e.updateQueue,a!==null&&(l=a.retryQueue,l!==null&&(a.retryQueue=null,Kc(e,l))));break;case 19:Jt(t,e),$t(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Kc(e,a)));break;case 30:break;case 21:break;default:Jt(t,e),$t(e)}}function $t(e){var t=e.flags;if(t&2){try{for(var l,a=e.return;a!==null;){if(Kd(a)){l=a;break}a=a.return}if(l==null)throw Error(d(160));switch(l.tag){case 27:var n=l.stateNode,c=Ur(e);Zc(e,c,n);break;case 5:var r=l.stateNode;l.flags&32&&(Wl(r,""),l.flags&=-33);var u=Ur(e);Zc(e,u,r);break;case 3:case 4:var g=l.stateNode.containerInfo,j=Ur(e);Hr(e,j,g);break;default:throw Error(d(161))}}catch(O){Be(e,e.return,O)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function af(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;af(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function ra(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Wd(e,t.alternate,t),t=t.sibling}function un(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ea(4,t,t.return),un(t);break;case 1:Ll(t,t.return);var l=t.stateNode;typeof l.componentWillUnmount=="function"&&Vd(t,t.return,l),un(t);break;case 27:Xi(t.stateNode);case 26:case 5:Ll(t,t.return),un(t);break;case 22:t.memoizedState===null&&un(t);break;case 30:un(t);break;default:un(t)}e=e.sibling}}function oa(e,t,l){for(l=l&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var a=t.alternate,n=e,c=t,r=c.flags;switch(c.tag){case 0:case 11:case 15:oa(n,c,l),_i(4,c);break;case 1:if(oa(n,c,l),a=c,n=a.stateNode,typeof n.componentDidMount=="function")try{n.componentDidMount()}catch(j){Be(a,a.return,j)}if(a=c,n=a.updateQueue,n!==null){var u=a.stateNode;try{var g=n.shared.hiddenCallbacks;if(g!==null)for(n.shared.hiddenCallbacks=null,n=0;n<g.length;n++)_u(g[n],u)}catch(j){Be(a,a.return,j)}}l&&r&64&&Qd(c),wi(c,c.return);break;case 27:Jd(c);case 26:case 5:oa(n,c,l),l&&a===null&&r&4&&Zd(c),wi(c,c.return);break;case 12:oa(n,c,l);break;case 31:oa(n,c,l),l&&r&4&&ef(n,c);break;case 13:oa(n,c,l),l&&r&4&&tf(n,c);break;case 22:c.memoizedState===null&&oa(n,c,l),wi(c,c.return);break;case 30:break;default:oa(n,c,l)}t=t.sibling}}function Fr(e,t){var l=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==l&&(e!=null&&e.refCount++,l!=null&&Si(l))}function qr(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Si(e))}function Ml(e,t,l,a){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)nf(e,t,l,a),t=t.sibling}function nf(e,t,l,a){var n=t.flags;switch(t.tag){case 0:case 11:case 15:Ml(e,t,l,a),n&2048&&_i(9,t);break;case 1:Ml(e,t,l,a);break;case 3:Ml(e,t,l,a),n&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Si(e)));break;case 12:if(n&2048){Ml(e,t,l,a),e=t.stateNode;try{var c=t.memoizedProps,r=c.id,u=c.onPostCommit;typeof u=="function"&&u(r,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(g){Be(t,t.return,g)}}else Ml(e,t,l,a);break;case 31:Ml(e,t,l,a);break;case 13:Ml(e,t,l,a);break;case 23:break;case 22:c=t.stateNode,r=t.alternate,t.memoizedState!==null?c._visibility&2?Ml(e,t,l,a):Ri(e,t):c._visibility&2?Ml(e,t,l,a):(c._visibility|=2,Yn(e,t,l,a,(t.subtreeFlags&10256)!==0||!1)),n&2048&&Fr(r,t);break;case 24:Ml(e,t,l,a),n&2048&&qr(t.alternate,t);break;default:Ml(e,t,l,a)}}function Yn(e,t,l,a,n){for(n=n&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var c=e,r=t,u=l,g=a,j=r.flags;switch(r.tag){case 0:case 11:case 15:Yn(c,r,u,g,n),_i(8,r);break;case 23:break;case 22:var O=r.stateNode;r.memoizedState!==null?O._visibility&2?Yn(c,r,u,g,n):Ri(c,r):(O._visibility|=2,Yn(c,r,u,g,n)),n&&j&2048&&Fr(r.alternate,r);break;case 24:Yn(c,r,u,g,n),n&&j&2048&&qr(r.alternate,r);break;default:Yn(c,r,u,g,n)}t=t.sibling}}function Ri(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var l=e,a=t,n=a.flags;switch(a.tag){case 22:Ri(l,a),n&2048&&Fr(a.alternate,a);break;case 24:Ri(l,a),n&2048&&qr(a.alternate,a);break;default:Ri(l,a)}t=t.sibling}}var Bi=8192;function Xn(e,t,l){if(e.subtreeFlags&Bi)for(e=e.child;e!==null;)cf(e,t,l),e=e.sibling}function cf(e,t,l){switch(e.tag){case 26:Xn(e,t,l),e.flags&Bi&&e.memoizedState!==null&&Hh(l,zl,e.memoizedState,e.memoizedProps);break;case 5:Xn(e,t,l);break;case 3:case 4:var a=zl;zl=rs(e.stateNode.containerInfo),Xn(e,t,l),zl=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=Bi,Bi=16777216,Xn(e,t,l),Bi=a):Xn(e,t,l));break;default:Xn(e,t,l)}}function sf(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Ui(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var l=0;l<t.length;l++){var a=t[l];Ot=a,of(a,e)}sf(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)rf(e),e=e.sibling}function rf(e){switch(e.tag){case 0:case 11:case 15:Ui(e),e.flags&2048&&Ea(9,e,e.return);break;case 3:Ui(e);break;case 12:Ui(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Jc(e)):Ui(e);break;default:Ui(e)}}function Jc(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var l=0;l<t.length;l++){var a=t[l];Ot=a,of(a,e)}sf(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ea(8,t,t.return),Jc(t);break;case 22:l=t.stateNode,l._visibility&2&&(l._visibility&=-3,Jc(t));break;default:Jc(t)}e=e.sibling}}function of(e,t){for(;Ot!==null;){var l=Ot;switch(l.tag){case 0:case 11:case 15:Ea(8,l,t);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var a=l.memoizedState.cachePool.pool;a!=null&&a.refCount++}break;case 24:Si(l.memoizedState.cache)}if(a=l.child,a!==null)a.return=l,Ot=a;else e:for(l=e;Ot!==null;){a=Ot;var n=a.sibling,c=a.return;if(Id(a),a===l){Ot=null;break e}if(n!==null){n.return=c,Ot=n;break e}Ot=c}}}var eh={getCacheForType:function(e){var t=Gt(St),l=t.data.get(e);return l===void 0&&(l=e(),t.data.set(e,l)),l},cacheSignal:function(){return Gt(St).controller.signal}},th=typeof WeakMap=="function"?WeakMap:Map,_e=0,Qe=null,pe=null,be=0,Re=0,ol=null,Ca=!1,Qn=!1,Yr=!1,ua=0,ft=0,Da=0,dn=0,Xr=0,ul=0,Vn=0,Hi=null,Wt=null,Qr=!1,$c=0,uf=0,Wc=1/0,Ic=null,Oa=null,Ct=0,za=null,Zn=null,da=0,Vr=0,Zr=null,df=null,Li=0,Kr=null;function dl(){return(_e&2)!==0&&be!==0?be&-be:C.T!==null?eo():ac()}function ff(){if(ul===0)if((be&536870912)===0||Se){var e=m;m<<=1,(m&3932160)===0&&(m=262144),ul=e}else ul=536870912;return e=sl.current,e!==null&&(e.flags|=32),ul}function It(e,t,l){(e===Qe&&(Re===2||Re===9)||e.cancelPendingCommit!==null)&&(Kn(e,0),Ma(e,be,ul,!1)),Je(e,l),((_e&2)===0||e!==Qe)&&(e===Qe&&((_e&2)===0&&(dn|=l),ft===4&&Ma(e,be,ul,!1)),Fl(e))}function gf(e,t,l){if((_e&6)!==0)throw Error(d(327));var a=!l&&(t&127)===0&&(t&e.expiredLanes)===0||ie(e,t),n=a?nh(e,t):$r(e,t,!0),c=a;do{if(n===0){Qn&&!a&&Ma(e,t,0,!1);break}else{if(l=e.current.alternate,c&&!lh(l)){n=$r(e,t,!1),c=!1;continue}if(n===2){if(c=t,e.errorRecoveryDisabledLanes&c)var r=0;else r=e.pendingLanes&-536870913,r=r!==0?r:r&536870912?536870912:0;if(r!==0){t=r;e:{var u=e;n=Hi;var g=u.current.memoizedState.isDehydrated;if(g&&(Kn(u,r).flags|=256),r=$r(u,r,!1),r!==2){if(Yr&&!g){u.errorRecoveryDisabledLanes|=c,dn|=c,n=4;break e}c=Wt,Wt=n,c!==null&&(Wt===null?Wt=c:Wt.push.apply(Wt,c))}n=r}if(c=!1,n!==2)continue}}if(n===1){Kn(e,0),Ma(e,t,0,!0);break}e:{switch(a=e,c=n,c){case 0:case 1:throw Error(d(345));case 4:if((t&4194048)!==t)break;case 6:Ma(a,t,ul,!Ca);break e;case 2:Wt=null;break;case 3:case 5:break;default:throw Error(d(329))}if((t&62914560)===t&&(n=$c+300-bt(),10<n)){if(Ma(a,t,ul,!Ca),I(a,0,!0)!==0)break e;da=t,a.timeoutHandle=Xf(mf.bind(null,a,l,Wt,Ic,Qr,t,ul,dn,Vn,Ca,c,"Throttled",-0,0),n);break e}mf(a,l,Wt,Ic,Qr,t,ul,dn,Vn,Ca,c,null,-0,0)}}break}while(!0);Fl(e)}function mf(e,t,l,a,n,c,r,u,g,j,O,G,A,E){if(e.timeoutHandle=-1,G=t.subtreeFlags,G&8192||(G&16785408)===16785408){G={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:hl},cf(t,c,G);var $=(c&62914560)===c?$c-bt():(c&4194048)===c?uf-bt():0;if($=Lh(G,$),$!==null){da=c,e.cancelPendingCommit=$(jf.bind(null,e,t,c,l,a,n,r,u,g,O,G,null,A,E)),Ma(e,c,r,!j);return}}jf(e,t,c,l,a,n,r,u,g)}function lh(e){for(var t=e;;){var l=t.tag;if((l===0||l===11||l===15)&&t.flags&16384&&(l=t.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var a=0;a<l.length;a++){var n=l[a],c=n.getSnapshot;n=n.value;try{if(!il(c(),n))return!1}catch{return!1}}if(l=t.child,t.subtreeFlags&16384&&l!==null)l.return=t,t=l;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Ma(e,t,l,a){t&=~Xr,t&=~dn,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var n=t;0<n;){var c=31-At(n),r=1<<c;a[c]=-1,n&=~r}l!==0&&wl(e,l,t)}function Pc(){return(_e&6)===0?(Fi(0),!1):!0}function Jr(){if(pe!==null){if(Re===0)var e=pe.return;else e=pe,ea=tn=null,dr(e),Un=null,Ni=0,e=pe;for(;e!==null;)Xd(e.alternate,e),e=e.return;pe=null}}function Kn(e,t){var l=e.timeoutHandle;l!==-1&&(e.timeoutHandle=-1,jh(l)),l=e.cancelPendingCommit,l!==null&&(e.cancelPendingCommit=null,l()),da=0,Jr(),Qe=e,pe=l=Il(e.current,null),be=t,Re=0,ol=null,Ca=!1,Qn=ie(e,t),Yr=!1,Vn=ul=Xr=dn=Da=ft=0,Wt=Hi=null,Qr=!1,(t&8)!==0&&(t|=t&32);var a=e.entangledLanes;if(a!==0)for(e=e.entanglements,a&=t;0<a;){var n=31-At(a),c=1<<n;t|=e[n],a&=~c}return ua=t,xc(),l}function hf(e,t){oe=null,C.H=Mi,t===Bn||t===Dc?(t=zu(),Re=3):t===Ps?(t=zu(),Re=4):Re=t===Cr?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,ol=t,pe===null&&(ft=1,qc(e,vl(t,e.current)))}function pf(){var e=sl.current;return e===null?!0:(be&4194048)===be?Sl===null:(be&62914560)===be||(be&536870912)!==0?e===Sl:!1}function vf(){var e=C.H;return C.H=Mi,e===null?Mi:e}function yf(){var e=C.A;return C.A=eh,e}function es(){ft=4,Ca||(be&4194048)!==be&&sl.current!==null||(Qn=!0),(Da&134217727)===0&&(dn&134217727)===0||Qe===null||Ma(Qe,be,ul,!1)}function $r(e,t,l){var a=_e;_e|=2;var n=vf(),c=yf();(Qe!==e||be!==t)&&(Ic=null,Kn(e,t)),t=!1;var r=ft;e:do try{if(Re!==0&&pe!==null){var u=pe,g=ol;switch(Re){case 8:Jr(),r=6;break e;case 3:case 2:case 9:case 6:sl.current===null&&(t=!0);var j=Re;if(Re=0,ol=null,Jn(e,u,g,j),l&&Qn){r=0;break e}break;default:j=Re,Re=0,ol=null,Jn(e,u,g,j)}}ah(),r=ft;break}catch(O){hf(e,O)}while(!0);return t&&e.shellSuspendCounter++,ea=tn=null,_e=a,C.H=n,C.A=c,pe===null&&(Qe=null,be=0,xc()),r}function ah(){for(;pe!==null;)bf(pe)}function nh(e,t){var l=_e;_e|=2;var a=vf(),n=yf();Qe!==e||be!==t?(Ic=null,Wc=bt()+500,Kn(e,t)):Qn=ie(e,t);e:do try{if(Re!==0&&pe!==null){t=pe;var c=ol;t:switch(Re){case 1:Re=0,ol=null,Jn(e,t,c,1);break;case 2:case 9:if(Du(c)){Re=0,ol=null,xf(t);break}t=function(){Re!==2&&Re!==9||Qe!==e||(Re=7),Fl(e)},c.then(t,t);break e;case 3:Re=7;break e;case 4:Re=5;break e;case 7:Du(c)?(Re=0,ol=null,xf(t)):(Re=0,ol=null,Jn(e,t,c,7));break;case 5:var r=null;switch(pe.tag){case 26:r=pe.memoizedState;case 5:case 27:var u=pe;if(r?ig(r):u.stateNode.complete){Re=0,ol=null;var g=u.sibling;if(g!==null)pe=g;else{var j=u.return;j!==null?(pe=j,ts(j)):pe=null}break t}}Re=0,ol=null,Jn(e,t,c,5);break;case 6:Re=0,ol=null,Jn(e,t,c,6);break;case 8:Jr(),ft=6;break e;default:throw Error(d(462))}}ih();break}catch(O){hf(e,O)}while(!0);return ea=tn=null,C.H=a,C.A=n,_e=l,pe!==null?0:(Qe=null,be=0,xc(),ft)}function ih(){for(;pe!==null&&!Xt();)bf(pe)}function bf(e){var t=qd(e.alternate,e,ua);e.memoizedProps=e.pendingProps,t===null?ts(e):pe=t}function xf(e){var t=e,l=t.alternate;switch(t.tag){case 15:case 0:t=Rd(l,t,t.pendingProps,t.type,void 0,be);break;case 11:t=Rd(l,t,t.pendingProps,t.type.render,t.ref,be);break;case 5:dr(t);default:Xd(l,t),t=pe=vu(t,ua),t=qd(l,t,ua)}e.memoizedProps=e.pendingProps,t===null?ts(e):pe=t}function Jn(e,t,l,a){ea=tn=null,dr(t),Un=null,Ni=0;var n=t.return;try{if(Zm(e,n,t,l,be)){ft=1,qc(e,vl(l,e.current)),pe=null;return}}catch(c){if(n!==null)throw pe=n,c;ft=1,qc(e,vl(l,e.current)),pe=null;return}t.flags&32768?(Se||a===1?e=!0:Qn||(be&536870912)!==0?e=!1:(Ca=e=!0,(a===2||a===9||a===3||a===6)&&(a=sl.current,a!==null&&a.tag===13&&(a.flags|=16384))),Sf(t,e)):ts(t)}function ts(e){var t=e;do{if((t.flags&32768)!==0){Sf(t,Ca);return}e=t.return;var l=$m(t.alternate,t,ua);if(l!==null){pe=l;return}if(t=t.sibling,t!==null){pe=t;return}pe=t=e}while(t!==null);ft===0&&(ft=5)}function Sf(e,t){do{var l=Wm(e.alternate,e);if(l!==null){l.flags&=32767,pe=l;return}if(l=e.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!t&&(e=e.sibling,e!==null)){pe=e;return}pe=e=l}while(e!==null);ft=6,pe=null}function jf(e,t,l,a,n,c,r,u,g){e.cancelPendingCommit=null;do ls();while(Ct!==0);if((_e&6)!==0)throw Error(d(327));if(t!==null){if(t===e.current)throw Error(d(177));if(c=t.lanes|t.childLanes,c|=Us,Zl(e,l,c,r,u,g),e===Qe&&(pe=Qe=null,be=0),Zn=t,za=e,da=l,Vr=c,Zr=n,df=a,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,oh(Ql,function(){return Cf(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||a){a=C.T,C.T=null,n=L.p,L.p=2,r=_e,_e|=4;try{Im(e,t,l)}finally{_e=r,L.p=n,C.T=a}}Ct=1,Nf(),Tf(),Af()}}function Nf(){if(Ct===1){Ct=0;var e=za,t=Zn,l=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||l){l=C.T,C.T=null;var a=L.p;L.p=2;var n=_e;_e|=4;try{lf(t,e);var c=ro,r=ru(e.containerInfo),u=c.focusedElem,g=c.selectionRange;if(r!==u&&u&&u.ownerDocument&&su(u.ownerDocument.documentElement,u)){if(g!==null&&Gs(u)){var j=g.start,O=g.end;if(O===void 0&&(O=j),"selectionStart"in u)u.selectionStart=j,u.selectionEnd=Math.min(O,u.value.length);else{var G=u.ownerDocument||document,A=G&&G.defaultView||window;if(A.getSelection){var E=A.getSelection(),$=u.textContent.length,te=Math.min(g.start,$),qe=g.end===void 0?te:Math.min(g.end,$);!E.extend&&te>qe&&(r=qe,qe=te,te=r);var y=cu(u,te),p=cu(u,qe);if(y&&p&&(E.rangeCount!==1||E.anchorNode!==y.node||E.anchorOffset!==y.offset||E.focusNode!==p.node||E.focusOffset!==p.offset)){var S=G.createRange();S.setStart(y.node,y.offset),E.removeAllRanges(),te>qe?(E.addRange(S),E.extend(p.node,p.offset)):(S.setEnd(p.node,p.offset),E.addRange(S))}}}}for(G=[],E=u;E=E.parentNode;)E.nodeType===1&&G.push({element:E,left:E.scrollLeft,top:E.scrollTop});for(typeof u.focus=="function"&&u.focus(),u=0;u<G.length;u++){var M=G[u];M.element.scrollLeft=M.left,M.element.scrollTop=M.top}}ms=!!so,ro=so=null}finally{_e=n,L.p=a,C.T=l}}e.current=t,Ct=2}}function Tf(){if(Ct===2){Ct=0;var e=za,t=Zn,l=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||l){l=C.T,C.T=null;var a=L.p;L.p=2;var n=_e;_e|=4;try{Wd(e,t.alternate,t)}finally{_e=n,L.p=a,C.T=l}}Ct=3}}function Af(){if(Ct===4||Ct===3){Ct=0,Xl();var e=za,t=Zn,l=da,a=df;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Ct=5:(Ct=0,Zn=za=null,Ef(e,e.pendingLanes));var n=e.pendingLanes;if(n===0&&(Oa=null),Xa(l),t=t.stateNode,at&&typeof at.onCommitFiberRoot=="function")try{at.onCommitFiberRoot(al,t,void 0,(t.current.flags&128)===128)}catch{}if(a!==null){t=C.T,n=L.p,L.p=2,C.T=null;try{for(var c=e.onRecoverableError,r=0;r<a.length;r++){var u=a[r];c(u.value,{componentStack:u.stack})}}finally{C.T=t,L.p=n}}(da&3)!==0&&ls(),Fl(e),n=e.pendingLanes,(l&261930)!==0&&(n&42)!==0?e===Kr?Li++:(Li=0,Kr=e):Li=0,Fi(0)}}function Ef(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Si(t)))}function ls(){return Nf(),Tf(),Af(),Cf()}function Cf(){if(Ct!==5)return!1;var e=za,t=Vr;Vr=0;var l=Xa(da),a=C.T,n=L.p;try{L.p=32>l?32:l,C.T=null,l=Zr,Zr=null;var c=za,r=da;if(Ct=0,Zn=za=null,da=0,(_e&6)!==0)throw Error(d(331));var u=_e;if(_e|=4,rf(c.current),nf(c,c.current,r,l),_e=u,Fi(0,!1),at&&typeof at.onPostCommitFiberRoot=="function")try{at.onPostCommitFiberRoot(al,c)}catch{}return!0}finally{L.p=n,C.T=a,Ef(e,t)}}function Df(e,t,l){t=vl(l,t),t=Er(e.stateNode,t,2),e=Na(e,t,2),e!==null&&(Je(e,2),Fl(e))}function Be(e,t,l){if(e.tag===3)Df(e,e,l);else for(;t!==null;){if(t.tag===3){Df(t,e,l);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(Oa===null||!Oa.has(a))){e=vl(l,e),l=Dd(2),a=Na(t,l,2),a!==null&&(Od(l,a,t,e),Je(a,2),Fl(a));break}}t=t.return}}function Wr(e,t,l){var a=e.pingCache;if(a===null){a=e.pingCache=new th;var n=new Set;a.set(t,n)}else n=a.get(t),n===void 0&&(n=new Set,a.set(t,n));n.has(l)||(Yr=!0,n.add(l),e=ch.bind(null,e,t,l),t.then(e,e))}function ch(e,t,l){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,Qe===e&&(be&l)===l&&(ft===4||ft===3&&(be&62914560)===be&&300>bt()-$c?(_e&2)===0&&Kn(e,0):Xr|=l,Vn===be&&(Vn=0)),Fl(e)}function Of(e,t){t===0&&(t=we()),e=Ia(e,t),e!==null&&(Je(e,t),Fl(e))}function sh(e){var t=e.memoizedState,l=0;t!==null&&(l=t.retryLane),Of(e,l)}function rh(e,t){var l=0;switch(e.tag){case 31:case 13:var a=e.stateNode,n=e.memoizedState;n!==null&&(l=n.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(d(314))}a!==null&&a.delete(t),Of(e,l)}function oh(e,t){return Tl(e,t)}var as=null,$n=null,Ir=!1,ns=!1,Pr=!1,ka=0;function Fl(e){e!==$n&&e.next===null&&($n===null?as=$n=e:$n=$n.next=e),ns=!0,Ir||(Ir=!0,dh())}function Fi(e,t){if(!Pr&&ns){Pr=!0;do for(var l=!1,a=as;a!==null;){if(e!==0){var n=a.pendingLanes;if(n===0)var c=0;else{var r=a.suspendedLanes,u=a.pingedLanes;c=(1<<31-At(42|e)+1)-1,c&=n&~(r&~u),c=c&201326741?c&201326741|1:c?c|2:0}c!==0&&(l=!0,Gf(a,c))}else c=be,c=I(a,a===Qe?c:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(c&3)===0||ie(a,c)||(l=!0,Gf(a,c));a=a.next}while(l);Pr=!1}}function uh(){zf()}function zf(){ns=Ir=!1;var e=0;ka!==0&&Sh()&&(e=ka);for(var t=bt(),l=null,a=as;a!==null;){var n=a.next,c=Mf(a,t);c===0?(a.next=null,l===null?as=n:l.next=n,n===null&&($n=l)):(l=a,(e!==0||(c&3)!==0)&&(ns=!0)),a=n}Ct!==0&&Ct!==5||Fi(e),ka!==0&&(ka=0)}function Mf(e,t){for(var l=e.suspendedLanes,a=e.pingedLanes,n=e.expirationTimes,c=e.pendingLanes&-62914561;0<c;){var r=31-At(c),u=1<<r,g=n[r];g===-1?((u&l)===0||(u&a)!==0)&&(n[r]=b(u,t)):g<=t&&(e.expiredLanes|=u),c&=~u}if(t=Qe,l=be,l=I(e,e===t?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,l===0||e===t&&(Re===2||Re===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&Yl(a),e.callbackNode=null,e.callbackPriority=0;if((l&3)===0||ie(e,l)){if(t=l&-l,t===e.callbackPriority)return t;switch(a!==null&&Yl(a),Xa(l)){case 2:case 8:l=ll;break;case 32:l=Ql;break;case 268435456:l=ma;break;default:l=Ql}return a=kf.bind(null,e),l=Tl(l,a),e.callbackPriority=t,e.callbackNode=l,t}return a!==null&&a!==null&&Yl(a),e.callbackPriority=2,e.callbackNode=null,2}function kf(e,t){if(Ct!==0&&Ct!==5)return e.callbackNode=null,e.callbackPriority=0,null;var l=e.callbackNode;if(ls()&&e.callbackNode!==l)return null;var a=be;return a=I(e,e===Qe?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(gf(e,a,t),Mf(e,bt()),e.callbackNode!=null&&e.callbackNode===l?kf.bind(null,e):null)}function Gf(e,t){if(ls())return null;gf(e,t,!0)}function dh(){Nh(function(){(_e&6)!==0?Tl(fl,uh):zf()})}function eo(){if(ka===0){var e=wn;e===0&&(e=_l,_l<<=1,(_l&261888)===0&&(_l=256)),ka=e}return ka}function _f(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Ka(""+e)}function wf(e,t){var l=t.ownerDocument.createElement("input");return l.name=t.name,l.value=t.value,e.id&&l.setAttribute("form",e.id),t.parentNode.insertBefore(l,t),e=new FormData(e),l.parentNode.removeChild(l),e}function fh(e,t,l,a,n){if(t==="submit"&&l&&l.stateNode===n){var c=_f((n[Pe]||null).action),r=a.submitter;r&&(t=(t=r[Pe]||null)?_f(t.formAction):r.getAttribute("formAction"),t!==null&&(c=t,r=null));var u=new pc("action","action",null,a,n);e.push({event:u,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(ka!==0){var g=r?wf(n,r):new FormData(n);xr(l,{pending:!0,data:g,method:n.method,action:c},null,g)}}else typeof c=="function"&&(u.preventDefault(),g=r?wf(n,r):new FormData(n),xr(l,{pending:!0,data:g,method:n.method,action:c},c,g))},currentTarget:n}]})}}for(var to=0;to<Bs.length;to++){var lo=Bs[to],gh=lo.toLowerCase(),mh=lo[0].toUpperCase()+lo.slice(1);Ol(gh,"on"+mh)}Ol(du,"onAnimationEnd"),Ol(fu,"onAnimationIteration"),Ol(gu,"onAnimationStart"),Ol("dblclick","onDoubleClick"),Ol("focusin","onFocus"),Ol("focusout","onBlur"),Ol(zm,"onTransitionRun"),Ol(Mm,"onTransitionStart"),Ol(km,"onTransitionCancel"),Ol(mu,"onTransitionEnd"),Cl("onMouseEnter",["mouseout","mouseover"]),Cl("onMouseLeave",["mouseout","mouseover"]),Cl("onPointerEnter",["pointerout","pointerover"]),Cl("onPointerLeave",["pointerout","pointerover"]),gl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),gl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),gl("onBeforeInput",["compositionend","keypress","textInput","paste"]),gl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),gl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),gl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var qi="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(" "),hh=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(qi));function Rf(e,t){t=(t&4)!==0;for(var l=0;l<e.length;l++){var a=e[l],n=a.event;a=a.listeners;e:{var c=void 0;if(t)for(var r=a.length-1;0<=r;r--){var u=a[r],g=u.instance,j=u.currentTarget;if(u=u.listener,g!==c&&n.isPropagationStopped())break e;c=u,n.currentTarget=j;try{c(n)}catch(O){bc(O)}n.currentTarget=null,c=g}else for(r=0;r<a.length;r++){if(u=a[r],g=u.instance,j=u.currentTarget,u=u.listener,g!==c&&n.isPropagationStopped())break e;c=u,n.currentTarget=j;try{c(n)}catch(O){bc(O)}n.currentTarget=null,c=g}}}}function ve(e,t){var l=t[Qa];l===void 0&&(l=t[Qa]=new Set);var a=e+"__bubble";l.has(a)||(Bf(t,e,2,!1),l.add(a))}function ao(e,t,l){var a=0;t&&(a|=4),Bf(l,e,a,t)}var is="_reactListening"+Math.random().toString(36).slice(2);function no(e){if(!e[is]){e[is]=!0,nc.forEach(function(l){l!=="selectionchange"&&(hh.has(l)||ao(l,!1,e),ao(l,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[is]||(t[is]=!0,ao("selectionchange",!1,t))}}function Bf(e,t,l,a){switch(fg(t)){case 2:var n=Yh;break;case 8:n=Xh;break;default:n=xo}l=n.bind(null,t,l,e),n=void 0,!Ne||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(n=!0),a?n!==void 0?e.addEventListener(t,l,{capture:!0,passive:n}):e.addEventListener(t,l,!0):n!==void 0?e.addEventListener(t,l,{passive:n}):e.addEventListener(t,l,!1)}function io(e,t,l,a,n){var c=a;if((t&1)===0&&(t&2)===0&&a!==null)e:for(;;){if(a===null)return;var r=a.tag;if(r===3||r===4){var u=a.stateNode.containerInfo;if(u===n)break;if(r===4)for(r=a.return;r!==null;){var g=r.tag;if((g===3||g===4)&&r.stateNode.containerInfo===n)return;r=r.return}for(;u!==null;){if(r=Jl(u),r===null)return;if(g=r.tag,g===5||g===6||g===26||g===27){a=c=r;continue e}u=u.parentNode}}a=a.return}Z(function(){var j=c,O=An(l),G=[];e:{var A=hu.get(e);if(A!==void 0){var E=pc,$=e;switch(e){case"keypress":if(mc(l)===0)break e;case"keydown":case"keyup":E=rm;break;case"focusin":$="focus",E=Ds;break;case"focusout":$="blur",E=Ds;break;case"beforeblur":case"afterblur":E=Ds;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":E=Xo;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":E=$g;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":E=dm;break;case du:case fu:case gu:E=Pg;break;case mu:E=gm;break;case"scroll":case"scrollend":E=Kg;break;case"wheel":E=hm;break;case"copy":case"cut":case"paste":E=tm;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":E=Vo;break;case"toggle":case"beforetoggle":E=vm}var te=(t&4)!==0,qe=!te&&(e==="scroll"||e==="scrollend"),y=te?A!==null?A+"Capture":null:A;te=[];for(var p=j,S;p!==null;){var M=p;if(S=M.stateNode,M=M.tag,M!==5&&M!==26&&M!==27||S===null||y===null||(M=Y(p,y),M!=null&&te.push(Yi(p,M,S))),qe)break;p=p.return}0<te.length&&(A=new E(A,$,null,l,O),G.push({event:A,listeners:te}))}}if((t&7)===0){e:{if(A=e==="mouseover"||e==="pointerover",E=e==="mouseout"||e==="pointerout",A&&l!==Tn&&($=l.relatedTarget||l.fromElement)&&(Jl($)||$[Rl]))break e;if((E||A)&&(A=O.window===O?O:(A=O.ownerDocument)?A.defaultView||A.parentWindow:window,E?($=l.relatedTarget||l.toElement,E=j,$=$?Jl($):null,$!==null&&(qe=H($),te=$.tag,$!==qe||te!==5&&te!==27&&te!==6)&&($=null)):(E=null,$=j),E!==$)){if(te=Xo,M="onMouseLeave",y="onMouseEnter",p="mouse",(e==="pointerout"||e==="pointerover")&&(te=Vo,M="onPointerLeave",y="onPointerEnter",p="pointer"),qe=E==null?A:Za(E),S=$==null?A:Za($),A=new te(M,p+"leave",E,l,O),A.target=qe,A.relatedTarget=S,M=null,Jl(O)===j&&(te=new te(y,p+"enter",$,l,O),te.target=S,te.relatedTarget=qe,M=te),qe=M,E&&$)t:{for(te=ph,y=E,p=$,S=0,M=y;M;M=te(M))S++;M=0;for(var ee=p;ee;ee=te(ee))M++;for(;0<S-M;)y=te(y),S--;for(;0<M-S;)p=te(p),M--;for(;S--;){if(y===p||p!==null&&y===p.alternate){te=y;break t}y=te(y),p=te(p)}te=null}else te=null;E!==null&&Uf(G,A,E,te,!1),$!==null&&qe!==null&&Uf(G,qe,$,te,!0)}}e:{if(A=j?Za(j):window,E=A.nodeName&&A.nodeName.toLowerCase(),E==="select"||E==="input"&&A.type==="file")var Me=eu;else if(Io(A))if(tu)Me=Cm;else{Me=Am;var P=Tm}else E=A.nodeName,!E||E.toLowerCase()!=="input"||A.type!=="checkbox"&&A.type!=="radio"?j&&Nn(j.elementType)&&(Me=eu):Me=Em;if(Me&&(Me=Me(e,j))){Po(G,Me,l,O);break e}P&&P(e,A,j),e==="focusout"&&j&&A.type==="number"&&j.memoizedProps.value!=null&&Sn(A,"number",A.value)}switch(P=j?Za(j):window,e){case"focusin":(Io(P)||P.contentEditable==="true")&&(Cn=P,_s=j,yi=null);break;case"focusout":yi=_s=Cn=null;break;case"mousedown":ws=!0;break;case"contextmenu":case"mouseup":case"dragend":ws=!1,ou(G,l,O);break;case"selectionchange":if(Om)break;case"keydown":case"keyup":ou(G,l,O)}var ue;if(zs)e:{switch(e){case"compositionstart":var xe="onCompositionStart";break e;case"compositionend":xe="onCompositionEnd";break e;case"compositionupdate":xe="onCompositionUpdate";break e}xe=void 0}else En?$o(e,l)&&(xe="onCompositionEnd"):e==="keydown"&&l.keyCode===229&&(xe="onCompositionStart");xe&&(Zo&&l.locale!=="ko"&&(En||xe!=="onCompositionStart"?xe==="onCompositionEnd"&&En&&(ue=qo()):(Et=O,Xe="value"in Et?Et.value:Et.textContent,En=!0)),P=cs(j,xe),0<P.length&&(xe=new Qo(xe,e,null,l,O),G.push({event:xe,listeners:P}),ue?xe.data=ue:(ue=Wo(l),ue!==null&&(xe.data=ue)))),(ue=bm?xm(e,l):Sm(e,l))&&(xe=cs(j,"onBeforeInput"),0<xe.length&&(P=new Qo("onBeforeInput","beforeinput",null,l,O),G.push({event:P,listeners:xe}),P.data=ue)),fh(G,e,j,l,O)}Rf(G,t)})}function Yi(e,t,l){return{instance:e,listener:t,currentTarget:l}}function cs(e,t){for(var l=t+"Capture",a=[];e!==null;){var n=e,c=n.stateNode;if(n=n.tag,n!==5&&n!==26&&n!==27||c===null||(n=Y(e,l),n!=null&&a.unshift(Yi(e,n,c)),n=Y(e,t),n!=null&&a.push(Yi(e,n,c))),e.tag===3)return a;e=e.return}return[]}function ph(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Uf(e,t,l,a,n){for(var c=t._reactName,r=[];l!==null&&l!==a;){var u=l,g=u.alternate,j=u.stateNode;if(u=u.tag,g!==null&&g===a)break;u!==5&&u!==26&&u!==27||j===null||(g=j,n?(j=Y(l,c),j!=null&&r.unshift(Yi(l,j,g))):n||(j=Y(l,c),j!=null&&r.push(Yi(l,j,g)))),l=l.return}r.length!==0&&e.push({event:t,listeners:r})}var vh=/\r\n?/g,yh=/\u0000|\uFFFD/g;function Hf(e){return(typeof e=="string"?e:""+e).replace(vh,`
49
+ `).replace(yh,"")}function Lf(e,t){return t=Hf(t),Hf(e)===t}function Fe(e,t,l,a,n,c){switch(l){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||Wl(e,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&Wl(e,""+a);break;case"className":yn(e,"class",a);break;case"tabIndex":yn(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":yn(e,l,a);break;case"style":di(e,a,c);break;case"data":if(t!=="object"){yn(e,"data",a);break}case"src":case"href":if(a===""&&(t!=="a"||l!=="href")){e.removeAttribute(l);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(l);break}a=Ka(""+a),e.setAttribute(l,a);break;case"action":case"formAction":if(typeof a=="function"){e.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 c=="function"&&(l==="formAction"?(t!=="input"&&Fe(e,t,"name",n.name,n,null),Fe(e,t,"formEncType",n.formEncType,n,null),Fe(e,t,"formMethod",n.formMethod,n,null),Fe(e,t,"formTarget",n.formTarget,n,null)):(Fe(e,t,"encType",n.encType,n,null),Fe(e,t,"method",n.method,n,null),Fe(e,t,"target",n.target,n,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(l);break}a=Ka(""+a),e.setAttribute(l,a);break;case"onClick":a!=null&&(e.onclick=hl);break;case"onScroll":a!=null&&ve("scroll",e);break;case"onScrollEnd":a!=null&&ve("scrollend",e);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(d(61));if(l=a.__html,l!=null){if(n.children!=null)throw Error(d(60));e.innerHTML=l}}break;case"multiple":e.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":e.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){e.removeAttribute("xlink:href");break}l=Ka(""+a),e.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":a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(l,""+a):e.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":a&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(l,""):e.removeAttribute(l);break;case"capture":case"download":a===!0?e.setAttribute(l,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(l,a):e.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?e.setAttribute(l,a):e.removeAttribute(l);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?e.removeAttribute(l):e.setAttribute(l,a);break;case"popover":ve("beforetoggle",e),ve("toggle",e),ml(e,"popover",a);break;case"xlinkActuate":Dl(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":Dl(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":Dl(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":Dl(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":Dl(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":Dl(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":Dl(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":Dl(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":Dl(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":ml(e,"is",a);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=fc.get(l)||l,ml(e,l,a))}}function co(e,t,l,a,n,c){switch(l){case"style":di(e,a,c);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(d(61));if(l=a.__html,l!=null){if(n.children!=null)throw Error(d(60));e.innerHTML=l}}break;case"children":typeof a=="string"?Wl(e,a):(typeof a=="number"||typeof a=="bigint")&&Wl(e,""+a);break;case"onScroll":a!=null&&ve("scroll",e);break;case"onScrollEnd":a!=null&&ve("scrollend",e);break;case"onClick":a!=null&&(e.onclick=hl);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!si.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(n=l.endsWith("Capture"),t=l.slice(2,n?l.length-7:void 0),c=e[Pe]||null,c=c!=null?c[l]:null,typeof c=="function"&&e.removeEventListener(t,c,n),typeof a=="function")){typeof c!="function"&&c!==null&&(l in e?e[l]=null:e.hasAttribute(l)&&e.removeAttribute(l)),e.addEventListener(t,a,n);break e}l in e?e[l]=a:a===!0?e.setAttribute(l,""):ml(e,l,a)}}}function wt(e,t,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ve("error",e),ve("load",e);var a=!1,n=!1,c;for(c in l)if(l.hasOwnProperty(c)){var r=l[c];if(r!=null)switch(c){case"src":a=!0;break;case"srcSet":n=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(d(137,t));default:Fe(e,t,c,r,l,null)}}n&&Fe(e,t,"srcSet",l.srcSet,l,null),a&&Fe(e,t,"src",l.src,l,null);return;case"input":ve("invalid",e);var u=c=r=n=null,g=null,j=null;for(a in l)if(l.hasOwnProperty(a)){var O=l[a];if(O!=null)switch(a){case"name":n=O;break;case"type":r=O;break;case"checked":g=O;break;case"defaultChecked":j=O;break;case"value":c=O;break;case"defaultValue":u=O;break;case"children":case"dangerouslySetInnerHTML":if(O!=null)throw Error(d(137,t));break;default:Fe(e,t,a,O,l,null)}}uc(e,c,u,g,j,r,n,!1);return;case"select":ve("invalid",e),a=r=c=null;for(n in l)if(l.hasOwnProperty(n)&&(u=l[n],u!=null))switch(n){case"value":c=u;break;case"defaultValue":r=u;break;case"multiple":a=u;default:Fe(e,t,n,u,l,null)}t=c,l=r,e.multiple=!!a,t!=null?$l(e,!!a,t,!1):l!=null&&$l(e,!!a,l,!0);return;case"textarea":ve("invalid",e),c=n=a=null;for(r in l)if(l.hasOwnProperty(r)&&(u=l[r],u!=null))switch(r){case"value":a=u;break;case"defaultValue":n=u;break;case"children":c=u;break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(d(91));break;default:Fe(e,t,r,u,l,null)}ui(e,a,n,c);return;case"option":for(g in l)if(l.hasOwnProperty(g)&&(a=l[g],a!=null))switch(g){case"selected":e.selected=a&&typeof a!="function"&&typeof a!="symbol";break;default:Fe(e,t,g,a,l,null)}return;case"dialog":ve("beforetoggle",e),ve("toggle",e),ve("cancel",e),ve("close",e);break;case"iframe":case"object":ve("load",e);break;case"video":case"audio":for(a=0;a<qi.length;a++)ve(qi[a],e);break;case"image":ve("error",e),ve("load",e);break;case"details":ve("toggle",e);break;case"embed":case"source":case"link":ve("error",e),ve("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(j in l)if(l.hasOwnProperty(j)&&(a=l[j],a!=null))switch(j){case"children":case"dangerouslySetInnerHTML":throw Error(d(137,t));default:Fe(e,t,j,a,l,null)}return;default:if(Nn(t)){for(O in l)l.hasOwnProperty(O)&&(a=l[O],a!==void 0&&co(e,t,O,a,l,void 0));return}}for(u in l)l.hasOwnProperty(u)&&(a=l[u],a!=null&&Fe(e,t,u,a,l,null))}function bh(e,t,l,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var n=null,c=null,r=null,u=null,g=null,j=null,O=null;for(E in l){var G=l[E];if(l.hasOwnProperty(E)&&G!=null)switch(E){case"checked":break;case"value":break;case"defaultValue":g=G;default:a.hasOwnProperty(E)||Fe(e,t,E,null,a,G)}}for(var A in a){var E=a[A];if(G=l[A],a.hasOwnProperty(A)&&(E!=null||G!=null))switch(A){case"type":c=E;break;case"name":n=E;break;case"checked":j=E;break;case"defaultChecked":O=E;break;case"value":r=E;break;case"defaultValue":u=E;break;case"children":case"dangerouslySetInnerHTML":if(E!=null)throw Error(d(137,t));break;default:E!==G&&Fe(e,t,A,E,a,G)}}ri(e,r,u,g,j,O,c,n);return;case"select":E=r=u=A=null;for(c in l)if(g=l[c],l.hasOwnProperty(c)&&g!=null)switch(c){case"value":break;case"multiple":E=g;default:a.hasOwnProperty(c)||Fe(e,t,c,null,a,g)}for(n in a)if(c=a[n],g=l[n],a.hasOwnProperty(n)&&(c!=null||g!=null))switch(n){case"value":A=c;break;case"defaultValue":u=c;break;case"multiple":r=c;default:c!==g&&Fe(e,t,n,c,a,g)}t=u,l=r,a=E,A!=null?$l(e,!!l,A,!1):!!a!=!!l&&(t!=null?$l(e,!!l,t,!0):$l(e,!!l,l?[]:"",!1));return;case"textarea":E=A=null;for(u in l)if(n=l[u],l.hasOwnProperty(u)&&n!=null&&!a.hasOwnProperty(u))switch(u){case"value":break;case"children":break;default:Fe(e,t,u,null,a,n)}for(r in a)if(n=a[r],c=l[r],a.hasOwnProperty(r)&&(n!=null||c!=null))switch(r){case"value":A=n;break;case"defaultValue":E=n;break;case"children":break;case"dangerouslySetInnerHTML":if(n!=null)throw Error(d(91));break;default:n!==c&&Fe(e,t,r,n,a,c)}oi(e,A,E);return;case"option":for(var $ in l)if(A=l[$],l.hasOwnProperty($)&&A!=null&&!a.hasOwnProperty($))switch($){case"selected":e.selected=!1;break;default:Fe(e,t,$,null,a,A)}for(g in a)if(A=a[g],E=l[g],a.hasOwnProperty(g)&&A!==E&&(A!=null||E!=null))switch(g){case"selected":e.selected=A&&typeof A!="function"&&typeof A!="symbol";break;default:Fe(e,t,g,A,a,E)}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 te in l)A=l[te],l.hasOwnProperty(te)&&A!=null&&!a.hasOwnProperty(te)&&Fe(e,t,te,null,a,A);for(j in a)if(A=a[j],E=l[j],a.hasOwnProperty(j)&&A!==E&&(A!=null||E!=null))switch(j){case"children":case"dangerouslySetInnerHTML":if(A!=null)throw Error(d(137,t));break;default:Fe(e,t,j,A,a,E)}return;default:if(Nn(t)){for(var qe in l)A=l[qe],l.hasOwnProperty(qe)&&A!==void 0&&!a.hasOwnProperty(qe)&&co(e,t,qe,void 0,a,A);for(O in a)A=a[O],E=l[O],!a.hasOwnProperty(O)||A===E||A===void 0&&E===void 0||co(e,t,O,A,a,E);return}}for(var y in l)A=l[y],l.hasOwnProperty(y)&&A!=null&&!a.hasOwnProperty(y)&&Fe(e,t,y,null,a,A);for(G in a)A=a[G],E=l[G],!a.hasOwnProperty(G)||A===E||A==null&&E==null||Fe(e,t,G,A,a,E)}function Ff(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function xh(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,l=performance.getEntriesByType("resource"),a=0;a<l.length;a++){var n=l[a],c=n.transferSize,r=n.initiatorType,u=n.duration;if(c&&u&&Ff(r)){for(r=0,u=n.responseEnd,a+=1;a<l.length;a++){var g=l[a],j=g.startTime;if(j>u)break;var O=g.transferSize,G=g.initiatorType;O&&Ff(G)&&(g=g.responseEnd,r+=O*(g<u?1:(u-j)/(g-j)))}if(--a,t+=8*(c+r)/(n.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var so=null,ro=null;function ss(e){return e.nodeType===9?e:e.ownerDocument}function qf(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Yf(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function oo(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var uo=null;function Sh(){var e=window.event;return e&&e.type==="popstate"?e===uo?!1:(uo=e,!0):(uo=null,!1)}var Xf=typeof setTimeout=="function"?setTimeout:void 0,jh=typeof clearTimeout=="function"?clearTimeout:void 0,Qf=typeof Promise=="function"?Promise:void 0,Nh=typeof queueMicrotask=="function"?queueMicrotask:typeof Qf<"u"?function(e){return Qf.resolve(null).then(e).catch(Th)}:Xf;function Th(e){setTimeout(function(){throw e})}function Ga(e){return e==="head"}function Vf(e,t){var l=t,a=0;do{var n=l.nextSibling;if(e.removeChild(l),n&&n.nodeType===8)if(l=n.data,l==="/$"||l==="/&"){if(a===0){e.removeChild(n),ei(t);return}a--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")a++;else if(l==="html")Xi(e.ownerDocument.documentElement);else if(l==="head"){l=e.ownerDocument.head,Xi(l);for(var c=l.firstChild;c;){var r=c.nextSibling,u=c.nodeName;c[Va]||u==="SCRIPT"||u==="STYLE"||u==="LINK"&&c.rel.toLowerCase()==="stylesheet"||l.removeChild(c),c=r}}else l==="body"&&Xi(e.ownerDocument.body);l=n}while(l);ei(t)}function Zf(e,t){var l=e;e=0;do{var a=l.nextSibling;if(l.nodeType===1?t?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(t?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),a&&a.nodeType===8)if(l=a.data,l==="/$"){if(e===0)break;e--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||e++;l=a}while(l)}function fo(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var l=t;switch(t=t.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":fo(l),vn(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}e.removeChild(l)}}function Ah(e,t,l,a){for(;e.nodeType===1;){var n=l;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!a&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(a){if(!e[Va])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(c=e.getAttribute("rel"),c==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(c!==n.rel||e.getAttribute("href")!==(n.href==null||n.href===""?null:n.href)||e.getAttribute("crossorigin")!==(n.crossOrigin==null?null:n.crossOrigin)||e.getAttribute("title")!==(n.title==null?null:n.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(c=e.getAttribute("src"),(c!==(n.src==null?null:n.src)||e.getAttribute("type")!==(n.type==null?null:n.type)||e.getAttribute("crossorigin")!==(n.crossOrigin==null?null:n.crossOrigin))&&c&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var c=n.name==null?null:""+n.name;if(n.type==="hidden"&&e.getAttribute("name")===c)return e}else return e;if(e=jl(e.nextSibling),e===null)break}return null}function Eh(e,t,l){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!l||(e=jl(e.nextSibling),e===null))return null;return e}function Kf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=jl(e.nextSibling),e===null))return null;return e}function go(e){return e.data==="$?"||e.data==="$~"}function mo(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Ch(e,t){var l=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||l.readyState!=="loading")t();else{var a=function(){t(),l.removeEventListener("DOMContentLoaded",a)};l.addEventListener("DOMContentLoaded",a),e._reactRetry=a}}function jl(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var ho=null;function Jf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="/$"||l==="/&"){if(t===0)return jl(e.nextSibling);t--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||t++}e=e.nextSibling}return null}function $f(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(t===0)return e;t--}else l!=="/$"&&l!=="/&"||t++}e=e.previousSibling}return null}function Wf(e,t,l){switch(t=ss(l),e){case"html":if(e=t.documentElement,!e)throw Error(d(452));return e;case"head":if(e=t.head,!e)throw Error(d(453));return e;case"body":if(e=t.body,!e)throw Error(d(454));return e;default:throw Error(d(451))}}function Xi(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);vn(e)}var Nl=new Map,If=new Set;function rs(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var fa=L.d;L.d={f:Dh,r:Oh,D:zh,C:Mh,L:kh,m:Gh,X:wh,S:_h,M:Rh};function Dh(){var e=fa.f(),t=Pc();return e||t}function Oh(e){var t=ha(e);t!==null&&t.tag===5&&t.type==="form"?md(t):fa.r(e)}var Wn=typeof document>"u"?null:document;function Pf(e,t,l){var a=Wn;if(a&&typeof t=="string"&&t){var n=Ft(t);n='link[rel="'+e+'"][href="'+n+'"]',typeof l=="string"&&(n+='[crossorigin="'+l+'"]'),If.has(n)||(If.add(n),e={rel:e,crossOrigin:l,href:t},a.querySelector(n)===null&&(t=a.createElement("link"),wt(t,"link",e),xt(t),a.head.appendChild(t)))}}function zh(e){fa.D(e),Pf("dns-prefetch",e,null)}function Mh(e,t){fa.C(e,t),Pf("preconnect",e,t)}function kh(e,t,l){fa.L(e,t,l);var a=Wn;if(a&&e&&t){var n='link[rel="preload"][as="'+Ft(t)+'"]';t==="image"&&l&&l.imageSrcSet?(n+='[imagesrcset="'+Ft(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(n+='[imagesizes="'+Ft(l.imageSizes)+'"]')):n+='[href="'+Ft(e)+'"]';var c=n;switch(t){case"style":c=In(e);break;case"script":c=Pn(e)}Nl.has(c)||(e=X({rel:"preload",href:t==="image"&&l&&l.imageSrcSet?void 0:e,as:t},l),Nl.set(c,e),a.querySelector(n)!==null||t==="style"&&a.querySelector(Qi(c))||t==="script"&&a.querySelector(Vi(c))||(t=a.createElement("link"),wt(t,"link",e),xt(t),a.head.appendChild(t)))}}function Gh(e,t){fa.m(e,t);var l=Wn;if(l&&e){var a=t&&typeof t.as=="string"?t.as:"script",n='link[rel="modulepreload"][as="'+Ft(a)+'"][href="'+Ft(e)+'"]',c=n;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":c=Pn(e)}if(!Nl.has(c)&&(e=X({rel:"modulepreload",href:e},t),Nl.set(c,e),l.querySelector(n)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Vi(c)))return}a=l.createElement("link"),wt(a,"link",e),xt(a),l.head.appendChild(a)}}}function _h(e,t,l){fa.S(e,t,l);var a=Wn;if(a&&e){var n=pa(a).hoistableStyles,c=In(e);t=t||"default";var r=n.get(c);if(!r){var u={loading:0,preload:null};if(r=a.querySelector(Qi(c)))u.loading=5;else{e=X({rel:"stylesheet",href:e,"data-precedence":t},l),(l=Nl.get(c))&&po(e,l);var g=r=a.createElement("link");xt(g),wt(g,"link",e),g._p=new Promise(function(j,O){g.onload=j,g.onerror=O}),g.addEventListener("load",function(){u.loading|=1}),g.addEventListener("error",function(){u.loading|=2}),u.loading|=4,os(r,t,a)}r={type:"stylesheet",instance:r,count:1,state:u},n.set(c,r)}}}function wh(e,t){fa.X(e,t);var l=Wn;if(l&&e){var a=pa(l).hoistableScripts,n=Pn(e),c=a.get(n);c||(c=l.querySelector(Vi(n)),c||(e=X({src:e,async:!0},t),(t=Nl.get(n))&&vo(e,t),c=l.createElement("script"),xt(c),wt(c,"link",e),l.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},a.set(n,c))}}function Rh(e,t){fa.M(e,t);var l=Wn;if(l&&e){var a=pa(l).hoistableScripts,n=Pn(e),c=a.get(n);c||(c=l.querySelector(Vi(n)),c||(e=X({src:e,async:!0,type:"module"},t),(t=Nl.get(n))&&vo(e,t),c=l.createElement("script"),xt(c),wt(c,"link",e),l.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},a.set(n,c))}}function eg(e,t,l,a){var n=(n=se.current)?rs(n):null;if(!n)throw Error(d(446));switch(e){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(t=In(l.href),l=pa(n).hoistableStyles,a=l.get(t),a||(a={type:"style",instance:null,count:0,state:null},l.set(t,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){e=In(l.href);var c=pa(n).hoistableStyles,r=c.get(e);if(r||(n=n.ownerDocument||n,r={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},c.set(e,r),(c=n.querySelector(Qi(e)))&&!c._p&&(r.instance=c,r.state.loading=5),Nl.has(e)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Nl.set(e,l),c||Bh(n,e,l,r.state))),t&&a===null)throw Error(d(528,""));return r}if(t&&a!==null)throw Error(d(529,""));return null;case"script":return t=l.async,l=l.src,typeof l=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Pn(l),l=pa(n).hoistableScripts,a=l.get(t),a||(a={type:"script",instance:null,count:0,state:null},l.set(t,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(d(444,e))}}function In(e){return'href="'+Ft(e)+'"'}function Qi(e){return'link[rel="stylesheet"]['+e+"]"}function tg(e){return X({},e,{"data-precedence":e.precedence,precedence:null})}function Bh(e,t,l,a){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?a.loading=1:(t=e.createElement("link"),a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2}),wt(t,"link",l),xt(t),e.head.appendChild(t))}function Pn(e){return'[src="'+Ft(e)+'"]'}function Vi(e){return"script[async]"+e}function lg(e,t,l){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+Ft(l.href)+'"]');if(a)return t.instance=a,xt(a),a;var n=X({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),xt(a),wt(a,"style",n),os(a,l.precedence,e),t.instance=a;case"stylesheet":n=In(l.href);var c=e.querySelector(Qi(n));if(c)return t.state.loading|=4,t.instance=c,xt(c),c;a=tg(l),(n=Nl.get(n))&&po(a,n),c=(e.ownerDocument||e).createElement("link"),xt(c);var r=c;return r._p=new Promise(function(u,g){r.onload=u,r.onerror=g}),wt(c,"link",a),t.state.loading|=4,os(c,l.precedence,e),t.instance=c;case"script":return c=Pn(l.src),(n=e.querySelector(Vi(c)))?(t.instance=n,xt(n),n):(a=l,(n=Nl.get(c))&&(a=X({},l),vo(a,n)),e=e.ownerDocument||e,n=e.createElement("script"),xt(n),wt(n,"link",a),e.head.appendChild(n),t.instance=n);case"void":return null;default:throw Error(d(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,os(a,l.precedence,e));return t.instance}function os(e,t,l){for(var a=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),n=a.length?a[a.length-1]:null,c=n,r=0;r<a.length;r++){var u=a[r];if(u.dataset.precedence===t)c=u;else if(c!==n)break}c?c.parentNode.insertBefore(e,c.nextSibling):(t=l.nodeType===9?l.head:l,t.insertBefore(e,t.firstChild))}function po(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function vo(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var us=null;function ag(e,t,l){if(us===null){var a=new Map,n=us=new Map;n.set(l,a)}else n=us,a=n.get(l),a||(a=new Map,n.set(l,a));if(a.has(e))return a;for(a.set(e,null),l=l.getElementsByTagName(e),n=0;n<l.length;n++){var c=l[n];if(!(c[Va]||c[$e]||e==="link"&&c.getAttribute("rel")==="stylesheet")&&c.namespaceURI!=="http://www.w3.org/2000/svg"){var r=c.getAttribute(t)||"";r=e+r;var u=a.get(r);u?u.push(c):a.set(r,[c])}}return a}function ng(e,t,l){e=e.ownerDocument||e,e.head.insertBefore(l,t==="title"?e.querySelector("head > title"):null)}function Uh(e,t,l){if(l===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function ig(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Hh(e,t,l,a){if(l.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var n=In(a.href),c=t.querySelector(Qi(n));if(c){t=c._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=ds.bind(e),t.then(e,e)),l.state.loading|=4,l.instance=c,xt(c);return}c=t.ownerDocument||t,a=tg(a),(n=Nl.get(n))&&po(a,n),c=c.createElement("link"),xt(c);var r=c;r._p=new Promise(function(u,g){r.onload=u,r.onerror=g}),wt(c,"link",a),l.instance=c}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(l,t),(t=l.state.preload)&&(l.state.loading&3)===0&&(e.count++,l=ds.bind(e),t.addEventListener("load",l),t.addEventListener("error",l))}}var yo=0;function Lh(e,t){return e.stylesheets&&e.count===0&&gs(e,e.stylesheets),0<e.count||0<e.imgCount?function(l){var a=setTimeout(function(){if(e.stylesheets&&gs(e,e.stylesheets),e.unsuspend){var c=e.unsuspend;e.unsuspend=null,c()}},6e4+t);0<e.imgBytes&&yo===0&&(yo=62500*xh());var n=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&gs(e,e.stylesheets),e.unsuspend)){var c=e.unsuspend;e.unsuspend=null,c()}},(e.imgBytes>yo?50:800)+t);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(n)}}:null}function ds(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)gs(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var fs=null;function gs(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,fs=new Map,t.forEach(Fh,e),fs=null,ds.call(e))}function Fh(e,t){if(!(t.state.loading&4)){var l=fs.get(e);if(l)var a=l.get(null);else{l=new Map,fs.set(e,l);for(var n=e.querySelectorAll("link[data-precedence],style[data-precedence]"),c=0;c<n.length;c++){var r=n[c];(r.nodeName==="LINK"||r.getAttribute("media")!=="not all")&&(l.set(r.dataset.precedence,r),a=r)}a&&l.set(null,a)}n=t.instance,r=n.getAttribute("data-precedence"),c=l.get(r)||a,c===a&&l.set(null,n),l.set(r,n),this.count++,a=ds.bind(this),n.addEventListener("load",a),n.addEventListener("error",a),c?c.parentNode.insertBefore(n,c.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(n,e.firstChild)),t.state.loading|=4}}var Zi={$$typeof:fe,Provider:null,Consumer:null,_currentValue:W,_currentValue2:W,_threadCount:0};function qh(e,t,l,a,n,c,r,u,g){this.tag=1,this.containerInfo=e,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=Vl(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Vl(0),this.hiddenUpdates=Vl(null),this.identifierPrefix=a,this.onUncaughtError=n,this.onCaughtError=c,this.onRecoverableError=r,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=g,this.incompleteTransitions=new Map}function cg(e,t,l,a,n,c,r,u,g,j,O,G){return e=new qh(e,t,l,r,g,j,O,G,u),t=1,c===!0&&(t|=24),c=cl(3,null,null,t),e.current=c,c.stateNode=e,t=$s(),t.refCount++,e.pooledCache=t,t.refCount++,c.memoizedState={element:a,isDehydrated:l,cache:t},er(c),e}function sg(e){return e?(e=zn,e):zn}function rg(e,t,l,a,n,c){n=sg(n),a.context===null?a.context=n:a.pendingContext=n,a=ja(t),a.payload={element:l},c=c===void 0?null:c,c!==null&&(a.callback=c),l=Na(e,a,t),l!==null&&(It(l,e,t),Ai(l,e,t))}function og(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var l=e.retryLane;e.retryLane=l!==0&&l<t?l:t}}function bo(e,t){og(e,t),(e=e.alternate)&&og(e,t)}function ug(e){if(e.tag===13||e.tag===31){var t=Ia(e,67108864);t!==null&&It(t,e,67108864),bo(e,67108864)}}function dg(e){if(e.tag===13||e.tag===31){var t=dl();t=lc(t);var l=Ia(e,t);l!==null&&It(l,e,t),bo(e,t)}}var ms=!0;function Yh(e,t,l,a){var n=C.T;C.T=null;var c=L.p;try{L.p=2,xo(e,t,l,a)}finally{L.p=c,C.T=n}}function Xh(e,t,l,a){var n=C.T;C.T=null;var c=L.p;try{L.p=8,xo(e,t,l,a)}finally{L.p=c,C.T=n}}function xo(e,t,l,a){if(ms){var n=So(a);if(n===null)io(e,t,a,hs,l),gg(e,a);else if(Vh(n,e,t,l,a))a.stopPropagation();else if(gg(e,a),t&4&&-1<Qh.indexOf(e)){for(;n!==null;){var c=ha(n);if(c!==null)switch(c.tag){case 3:if(c=c.stateNode,c.current.memoizedState.isDehydrated){var r=_(c.pendingLanes);if(r!==0){var u=c;for(u.pendingLanes|=2,u.entangledLanes|=2;r;){var g=1<<31-At(r);u.entanglements[1]|=g,r&=~g}Fl(c),(_e&6)===0&&(Wc=bt()+500,Fi(0))}}break;case 31:case 13:u=Ia(c,2),u!==null&&It(u,c,2),Pc(),bo(c,2)}if(c=So(a),c===null&&io(e,t,a,hs,l),c===n)break;n=c}n!==null&&a.stopPropagation()}else io(e,t,a,null,l)}}function So(e){return e=An(e),jo(e)}var hs=null;function jo(e){if(hs=null,e=Jl(e),e!==null){var t=H(e);if(t===null)e=null;else{var l=t.tag;if(l===13){if(e=F(t),e!==null)return e;e=null}else if(l===31){if(e=Q(t),e!==null)return e;e=null}else if(l===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return hs=e,null}function fg(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(pn()){case fl:return 2;case ll:return 8;case Ql:case Fa:return 32;case ma:return 268435456;default:return 32}default:return 32}}var No=!1,_a=null,wa=null,Ra=null,Ki=new Map,Ji=new Map,Ba=[],Qh="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 gg(e,t){switch(e){case"focusin":case"focusout":_a=null;break;case"dragenter":case"dragleave":wa=null;break;case"mouseover":case"mouseout":Ra=null;break;case"pointerover":case"pointerout":Ki.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ji.delete(t.pointerId)}}function $i(e,t,l,a,n,c){return e===null||e.nativeEvent!==c?(e={blockedOn:t,domEventName:l,eventSystemFlags:a,nativeEvent:c,targetContainers:[n]},t!==null&&(t=ha(t),t!==null&&ug(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,n!==null&&t.indexOf(n)===-1&&t.push(n),e)}function Vh(e,t,l,a,n){switch(t){case"focusin":return _a=$i(_a,e,t,l,a,n),!0;case"dragenter":return wa=$i(wa,e,t,l,a,n),!0;case"mouseover":return Ra=$i(Ra,e,t,l,a,n),!0;case"pointerover":var c=n.pointerId;return Ki.set(c,$i(Ki.get(c)||null,e,t,l,a,n)),!0;case"gotpointercapture":return c=n.pointerId,Ji.set(c,$i(Ji.get(c)||null,e,t,l,a,n)),!0}return!1}function mg(e){var t=Jl(e.target);if(t!==null){var l=H(t);if(l!==null){if(t=l.tag,t===13){if(t=F(l),t!==null){e.blockedOn=t,Kl(e.priority,function(){dg(l)});return}}else if(t===31){if(t=Q(l),t!==null){e.blockedOn=t,Kl(e.priority,function(){dg(l)});return}}else if(t===3&&l.stateNode.current.memoizedState.isDehydrated){e.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ps(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var l=So(e.nativeEvent);if(l===null){l=e.nativeEvent;var a=new l.constructor(l.type,l);Tn=a,l.target.dispatchEvent(a),Tn=null}else return t=ha(l),t!==null&&ug(t),e.blockedOn=l,!1;t.shift()}return!0}function hg(e,t,l){ps(e)&&l.delete(t)}function Zh(){No=!1,_a!==null&&ps(_a)&&(_a=null),wa!==null&&ps(wa)&&(wa=null),Ra!==null&&ps(Ra)&&(Ra=null),Ki.forEach(hg),Ji.forEach(hg)}function vs(e,t){e.blockedOn===t&&(e.blockedOn=null,No||(No=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,Zh)))}var ys=null;function pg(e){ys!==e&&(ys=e,s.unstable_scheduleCallback(s.unstable_NormalPriority,function(){ys===e&&(ys=null);for(var t=0;t<e.length;t+=3){var l=e[t],a=e[t+1],n=e[t+2];if(typeof a!="function"){if(jo(a||l)===null)continue;break}var c=ha(l);c!==null&&(e.splice(t,3),t-=3,xr(c,{pending:!0,data:n,method:l.method,action:a},a,n))}}))}function ei(e){function t(g){return vs(g,e)}_a!==null&&vs(_a,e),wa!==null&&vs(wa,e),Ra!==null&&vs(Ra,e),Ki.forEach(t),Ji.forEach(t);for(var l=0;l<Ba.length;l++){var a=Ba[l];a.blockedOn===e&&(a.blockedOn=null)}for(;0<Ba.length&&(l=Ba[0],l.blockedOn===null);)mg(l),l.blockedOn===null&&Ba.shift();if(l=(e.ownerDocument||e).$$reactFormReplay,l!=null)for(a=0;a<l.length;a+=3){var n=l[a],c=l[a+1],r=n[Pe]||null;if(typeof c=="function")r||pg(l);else if(r){var u=null;if(c&&c.hasAttribute("formAction")){if(n=c,r=c[Pe]||null)u=r.formAction;else if(jo(n)!==null)continue}else u=r.action;typeof u=="function"?l[a+1]=u:(l.splice(a,3),a-=3),pg(l)}}}function vg(){function e(c){c.canIntercept&&c.info==="react-transition"&&c.intercept({handler:function(){return new Promise(function(r){return n=r})},focusReset:"manual",scroll:"manual"})}function t(){n!==null&&(n(),n=null),a||setTimeout(l,20)}function l(){if(!a&&!navigation.transition){var c=navigation.currentEntry;c&&c.url!=null&&navigation.navigate(c.url,{state:c.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var a=!1,n=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(l,100),function(){a=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),n!==null&&(n(),n=null)}}}function To(e){this._internalRoot=e}bs.prototype.render=To.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(d(409));var l=t.current,a=dl();rg(l,a,e,t,null,null)},bs.prototype.unmount=To.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;rg(e.current,2,null,e,null,null),Pc(),t[Rl]=null}};function bs(e){this._internalRoot=e}bs.prototype.unstable_scheduleHydration=function(e){if(e){var t=ac();e={blockedOn:null,target:e,priority:t};for(var l=0;l<Ba.length&&t!==0&&t<Ba[l].priority;l++);Ba.splice(l,0,e),l===0&&mg(e)}};var yg=f.version;if(yg!=="19.2.4")throw Error(d(527,yg,"19.2.4"));L.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(d(188)):(e=Object.keys(e).join(","),Error(d(268,e)));return e=T(t),e=e!==null?J(e):null,e=e===null?null:e.stateNode,e};var Kh={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:C,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var xs=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!xs.isDisabled&&xs.supportsFiber)try{al=xs.inject(Kh),at=xs}catch{}}return Ii.createRoot=function(e,t){if(!N(e))throw Error(d(299));var l=!1,a="",n=Td,c=Ad,r=Ed;return t!=null&&(t.unstable_strictMode===!0&&(l=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onUncaughtError!==void 0&&(n=t.onUncaughtError),t.onCaughtError!==void 0&&(c=t.onCaughtError),t.onRecoverableError!==void 0&&(r=t.onRecoverableError)),t=cg(e,1,!1,null,null,l,a,null,n,c,r,vg),e[Rl]=t.current,no(e),new To(t)},Ii.hydrateRoot=function(e,t,l){if(!N(e))throw Error(d(299));var a=!1,n="",c=Td,r=Ad,u=Ed,g=null;return l!=null&&(l.unstable_strictMode===!0&&(a=!0),l.identifierPrefix!==void 0&&(n=l.identifierPrefix),l.onUncaughtError!==void 0&&(c=l.onUncaughtError),l.onCaughtError!==void 0&&(r=l.onCaughtError),l.onRecoverableError!==void 0&&(u=l.onRecoverableError),l.formState!==void 0&&(g=l.formState)),t=cg(e,1,!0,t,l??null,a,n,g,c,r,u,vg),t.context=sg(null),l=t.current,a=dl(),a=lc(a),n=ja(a),n.callback=null,Na(l,n,a),l=a,t.current.lanes=l,Je(t,l),Fl(t),e[Rl]=t.current,no(e),new bs(t)},Ii.version="19.2.4",Ii}var Dg;function np(){if(Dg)return Co.exports;Dg=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(f){console.error(f)}}return s(),Co.exports=ap(),Co.exports}var ip=np();const cp=Yg(ip),sp=[{accentClass:"ghost-red",color:"#FF1744",title:"Thread Overload",problem:"Tired of replying to the same questions across dozens of Slack threads, emails, and docs? Context is scattered everywhere and you're the bottleneck.",solutionTitle:"Auto-reply in Slack with the right project context",solutionDetail:"Replies land in-thread with the docs, notes, and decisions Pac-Man has already saved for that project."},{accentClass:"ghost-pink",color:"#FF80AB",animationDelay:"0.5s",title:"Knowledge Loss",problem:"When you're on PTO or leave the company, your team struggles with the institutional knowledge you've built. Tedious handover docs go stale on day one.",solutionTitle:"Keep institutional knowledge available when people are out",solutionDetail:"Pac-Man keeps context structured, current, and ready for the next teammate instead of trapped in someone else’s head."},{accentClass:"ghost-cyan",color:"#00E5FF",animationDelay:"1s",title:"Context Confusion",problem:"Is Claude or Codex mixing project-level context against each other? Giving answers about Project A when you're asking about Project B?",solutionTitle:"Isolate context by project so answers stay grounded",solutionDetail:"Each workspace gets its own context boundary, so project memory does not leak across teams or threads."},{accentClass:"ghost-orange",color:"#FFAB40",animationDelay:"1.5s",title:"Decision Archaeology",problem:"Can't remember why a decision was made? The rationale is buried across Slack threads, PR comments, commit messages, and meeting notes that nobody can find.",solutionTitle:"Surface the why behind past decisions on demand",solutionDetail:"Pac-Man connects discussions, commits, and notes so the reasoning behind old calls is searchable when it matters."}],rp=[{title:"Thread Overload",userInitials:"A",userName:"Ava",prompt:"can someone share the exact staging deploy checklist for checkout",beforeReply:`I can't answer confidently from the current context.
50
+
51
+ Missing context: I do not have the latest rollout runbook, deployment notes, or the owning project's docs.
52
+
53
+ Best escalation path: Mukul.`,afterReply:"For the checkout staging deploy, run `pnpm deploy:staging`, verify the payment webhook healthcheck, then confirm the cart tax job in the rollout checklist. This comes from the latest runbook, release notes, and the March 18 deploy thread."},{title:"Knowledge Loss",userInitials:"S",userName:"Sara",prompt:"how do billing retries work while Priya is out this week",beforeReply:`I can't answer confidently from the current context.
54
+
55
+ Missing context: The handoff notes and prior billing incident decisions are not connected here.
56
+
57
+ Best escalation path: Priya after PTO or Mukul.`,afterReply:"Billing retries run at 15 minutes, 6 hours, and 24 hours before the account is marked delinquent. That comes from Priya’s PTO handoff, the billing incident postmortem, and the current retry policy doc."},{title:"Context Confusion",userInitials:"N",userName:"Nick",prompt:"who is our biggest competitor based on our study",beforeReply:`I can't answer confidently from the current context.
58
+
59
+ Missing context: Could not determine which project the Slack thread is asking about.
60
+
61
+ Best escalation path: Mukul.`,afterReply:"Based on our competitive landscape research, CrowdRiff is identified as our biggest competitor. They have raised $11.1M and are the closest pure-play for travel UGC. Other notable players include Emplifi, Flowbox, Social Native, and Taggbox."},{title:"Decision Archaeology",userInitials:"L",userName:"Leah",prompt:"why did we replace Redis queues last quarter",beforeReply:`I found references to Redis queues, but I can't determine the approved decision rationale from the current context.
62
+
63
+ Missing context: PR discussion, incident thread, and architecture note are not linked.`,afterReply:"We replaced Redis queues after the February incident because dead-letter visibility and retry controls were too limited for ops. The final decision was captured across the migration PR, the incident Slack thread, and the async-jobs design note."}];function op({color:s,style:f}){return i.jsx("div",{className:"ghost-icon",style:f,children:i.jsxs("svg",{viewBox:"0 0 64 72",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"ghost-svg",children:[i.jsx("path",{d:"M32 4C17.088 4 5 16.088 5 31v29l6-8 7 8 7-8 7 8 7-8 7 8 7-8 6 8V31C59 16.088 46.912 4 32 4z",fill:s,opacity:"0.9"}),i.jsx("ellipse",{cx:"23",cy:"28",rx:"6",ry:"7",fill:"white"}),i.jsx("ellipse",{cx:"41",cy:"28",rx:"6",ry:"7",fill:"white"}),i.jsx("ellipse",{cx:"25",cy:"29",rx:"3",ry:"3.5",fill:"#111"}),i.jsx("ellipse",{cx:"43",cy:"29",rx:"3",ry:"3.5",fill:"#111"})]})})}function up(){return i.jsx("span",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",background:"var(--pac-yellow)",boxShadow:"0 0 6px var(--pac-yellow-glow)",verticalAlign:"middle",flexShrink:0}})}function dp({onStart:s}){return i.jsxs("div",{className:"landing",children:[i.jsxs("div",{className:"landing-hero",children:[i.jsxs("div",{className:"pac-scene",children:[i.jsx("span",{className:"pac-trail-dot eaten"}),i.jsx("span",{className:"pac-trail-dot eaten"}),i.jsx("span",{className:"pac-trail-dot eaten"}),i.jsx("div",{className:"pacman-char"}),i.jsx("span",{className:"pac-trail-dot"}),i.jsx("span",{className:"pac-trail-dot"}),i.jsx("span",{className:"pac-trail-dot power"})]}),i.jsx("h1",{className:"landing-brand",children:"PACMAN"}),i.jsx("p",{className:"landing-subtitle",children:"Personal Assistant Context Manager"}),i.jsxs("div",{className:"landing-privacy-callout",children:[i.jsx("p",{className:"landing-privacy-kicker",children:"Privacy-First Personal Memory"}),i.jsx("h2",{className:"landing-privacy-headline",children:"The first privacy-aware personal assistant with your own memory."}),i.jsx("p",{className:"landing-privacy-tagline",children:"Local-first by design. Your context stays on your machine, under your control."}),i.jsxs("div",{className:"landing-privacy-strip",children:[i.jsx("span",{children:"Your memory."}),i.jsx("span",{children:"Your storage."}),i.jsx("span",{children:"Everything local."})]})]}),i.jsx("p",{className:"landing-tagline",children:"Feed your AI the context it craves. Chomp through scattered knowledge, swallow integrations whole, and power up your workflow."})]}),i.jsxs("div",{className:"ghost-section",children:[i.jsx("h2",{className:"section-heading",children:"These ghosts haunting your workflow?"}),i.jsx("div",{className:"ghost-grid",children:sp.map(f=>i.jsxs("div",{className:`ghost-card ${f.accentClass}`,children:[i.jsxs("div",{className:"ghost-card-top",children:[i.jsx(op,{color:f.color,style:{animationDelay:f.animationDelay}}),i.jsxs("div",{className:"ghost-card-copy",children:[i.jsx("h3",{children:f.title}),i.jsx("p",{className:"ghost-problem",children:f.problem})]})]}),i.jsxs("div",{className:"ghost-solution",children:[i.jsxs("div",{className:"ghost-solution-kicker",children:[i.jsx(up,{}),i.jsx("span",{children:"Pac-Man fix"})]}),i.jsx("p",{className:"ghost-solution-title",children:f.solutionTitle}),i.jsx("p",{className:"ghost-solution-detail",children:f.solutionDetail})]})]},f.title))})]}),i.jsxs("div",{className:"comparison-section",children:[i.jsx("h2",{className:"section-heading",children:"Pac-Man eats the confusion"}),i.jsx("div",{className:"comparison-stack",children:rp.map(f=>i.jsxs("div",{className:"comparison-example",children:[i.jsx("div",{className:"comparison-example-title",children:f.title}),i.jsxs("div",{className:"comparison-grid",children:[i.jsxs("div",{className:"comparison-card before",children:[i.jsx("span",{className:"comparison-label",children:"BEFORE"}),i.jsxs("div",{className:"mock-chat",children:[i.jsxs("div",{className:"mock-msg",children:[i.jsx("div",{className:"mock-avatar user",children:f.userInitials}),i.jsxs("div",{className:"mock-msg-body",children:[i.jsx("div",{className:"mock-msg-name",style:{color:"var(--text-primary)"},children:f.userName}),i.jsxs("div",{className:"mock-msg-text",children:[i.jsx("span",{style:{color:"var(--ghost-cyan)"},children:"@Personal Assistant"})," ",f.prompt]})]})]}),i.jsxs("div",{className:"mock-msg",children:[i.jsx("div",{className:"mock-avatar bot",children:"PA"}),i.jsxs("div",{className:"mock-msg-body",children:[i.jsxs("div",{className:"mock-msg-name",style:{color:"var(--text-secondary)"},children:["Personal Assistant ",i.jsx("span",{className:"badge",children:"APP"})]}),i.jsx("div",{className:"mock-msg-text dim",style:{whiteSpace:"pre-line"},children:f.beforeReply})]})]})]})]}),i.jsx("div",{className:"comparison-arrow",children:i.jsxs("div",{className:"comparison-arrow-inner",children:[i.jsx("div",{className:"pacman-char pacman-char-small"}),i.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"var(--pac-yellow)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:i.jsx("polyline",{points:"9 18 15 12 9 6"})})]})}),i.jsxs("div",{className:"comparison-card after",children:[i.jsx("span",{className:"comparison-label",children:"AFTER"}),i.jsxs("div",{className:"mock-chat",children:[i.jsxs("div",{className:"mock-msg",children:[i.jsx("div",{className:"mock-avatar user",children:f.userInitials}),i.jsxs("div",{className:"mock-msg-body",children:[i.jsx("div",{className:"mock-msg-name",style:{color:"var(--text-primary)"},children:f.userName}),i.jsxs("div",{className:"mock-msg-text",children:[i.jsx("span",{style:{color:"var(--ghost-cyan)"},children:"@Personal Assistant"})," ",f.prompt]})]})]}),i.jsxs("div",{className:"mock-msg",children:[i.jsx("div",{className:"mock-avatar bot",children:"PA"}),i.jsxs("div",{className:"mock-msg-body",children:[i.jsxs("div",{className:"mock-msg-name",style:{color:"var(--text-secondary)"},children:["Personal Assistant ",i.jsx("span",{className:"badge",children:"APP"})]}),i.jsx("div",{className:"mock-msg-text bright",children:f.afterReply})]})]})]})]})]})]},f.title))})]}),i.jsxs("div",{className:"landing-cta",children:[i.jsxs("button",{className:"btn-start",onClick:s,children:[i.jsx("div",{className:"pacman-char pacman-char-small"}),"Start Setup"]}),i.jsx("p",{style:{marginTop:"1rem",fontSize:"0.75rem",color:"var(--text-dim)",fontFamily:"var(--font-mono)"},children:"5 steps · ~3 minutes · fully reversible"})]})]})}const Og="3847";function hn(s){if(!s.startsWith("/")||typeof window>"u")return s;const{origin:f,hostname:x,port:d,protocol:N}=window.location;return d===Og?new URL(s,fp(f)).toString():`${N==="https:"?"https:":"http:"}//${x||"localhost"}:${Og}${s}`}function fp(s){return s.endsWith("/")?s:`${s}/`}async function zt(s,f){const x=typeof s=="string"?hn(s):s instanceof URL?new URL(hn(s.pathname+s.search+s.hash)):s,d=new Headers(f==null?void 0:f.headers);d.has("Accept")||d.set("Accept","application/json");const N=await fetch(x,{...f,headers:d}),H=await N.text(),F=N.headers.get("content-type")??"";if(!H){if(!N.ok)throw new Error(`Pac-Man backend returned HTTP ${N.status} with no body. Make sure the onboarding backend is running on http://localhost:3847.`);return{res:N,data:null}}const Q=/<!doctype html/i.test(H)||/<html[\s>]/i.test(H);if(!F.includes("application/json"))throw Q?new Error("Pac-Man returned an HTML page instead of an API response. Make sure the onboarding backend is running on http://localhost:3847."):new Error(`Pac-Man returned an unexpected ${F||"non-JSON"} response from ${typeof x=="string"?x:x.toString()}.`);try{return{res:N,data:JSON.parse(H)}}catch{throw new Error("Pac-Man returned invalid JSON. Make sure the onboarding backend is running and up to date.")}}const gp="https://optimus.mem2ai.com/v1/events/counters";function li(s,f){s&&fetch(gp,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email_id:s,event_name:f})}).then(x=>x.json()).then(x=>console.log(`[track] ${f}:`,x)).catch(x=>console.warn(`[track] ${f} failed:`,x))}const mp=[{value:"software-engineer",label:"Software Engineer",desc:"Code reviews, architecture, debugging",color:"#6366f1"},{value:"product-manager",label:"Product Manager",desc:"Roadmaps, specs, stakeholder alignment",color:"#a855f7"},{value:"engineering-manager",label:"Engineering Manager",desc:"Team health, delivery, hiring",color:"#14b8a6"},{value:"devops",label:"DevOps Engineer",desc:"Infrastructure, CI/CD, monitoring",color:"#f97316"}],hp=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function pp({state:s,update:f,onNext:x}){const d=s.email.trim(),N=s.name.trim(),H=hp.test(d);return R.useEffect(()=>{zt(`/api/responsibilities/${s.profileType}`).then(({data:F})=>{const Q=F;Q.responsibilities&&f({responsibilities:Q.responsibilities})}).catch(()=>{})},[s.profileType]),i.jsxs("div",{className:"step-content",children:[i.jsx("h1",{children:"Meet your assistant"}),i.jsx("h2",{children:"A few details so Pac-Man knows what to chomp"}),i.jsxs("div",{className:"form-card",children:[i.jsxs("div",{className:"form-row",style:{marginBottom:"1rem"},children:[i.jsxs("div",{className:"form-field",children:[i.jsx("label",{className:"field-label",children:"Your name"}),i.jsx("input",{type:"text",value:s.name,onChange:F=>f({name:F.target.value}),placeholder:"Jane Smith"})]}),i.jsxs("div",{className:"form-field",children:[i.jsx("label",{className:"field-label",children:"Email"}),i.jsx("input",{type:"email",value:s.email,onChange:F=>f({email:F.target.value}),placeholder:"jane@company.com",required:!0,"aria-invalid":!!d&&!H}),d&&!H&&i.jsx("span",{className:"field-error",children:"Enter a valid work email to continue."})]})]}),i.jsxs("div",{className:"form-field",children:[i.jsx("label",{className:"field-label",children:"Assistant name"}),i.jsx("input",{type:"text",value:s.assistantName,onChange:F=>f({assistantName:F.target.value}),placeholder:"Atlas"})]})]}),i.jsxs("div",{className:"form-section",children:[i.jsx("label",{className:"field-label",children:"Your role"}),i.jsx("div",{className:"profile-grid",children:mp.map(F=>i.jsxs("div",{className:`profile-card ${s.profileType===F.value?"selected":""}`,onClick:()=>f({profileType:F.value}),children:[i.jsx("div",{className:"profile-indicator",style:{background:F.color}}),i.jsxs("div",{className:"profile-info",children:[i.jsx("span",{className:"profile-name",children:F.label}),i.jsx("span",{className:"profile-desc",children:F.desc})]})]},F.value))})]}),i.jsx("div",{className:"btn-group",children:i.jsx("button",{className:"btn-primary",onClick:()=>{li(s.email,"onboarding_started"),x()},disabled:!N||!H,children:"Continue"})})]})}const vp={storage:["https://www.googleapis.com/auth/drive.file","https://www.googleapis.com/auth/drive.readonly"],gmail:["https://www.googleapis.com/auth/gmail.readonly"],gdrive:["https://www.googleapis.com/auth/drive.readonly"]},zg={storage:"Google Drive storage",gmail:"Gmail",gdrive:"Google Docs and Drive content"},Pi={"https://www.googleapis.com/auth/drive.file":"Create and manage the Pac-Man Drive folder","https://www.googleapis.com/auth/drive.readonly":"Browse Google Drive folders and read Google Docs / Drive files","https://www.googleapis.com/auth/gmail.readonly":"Read Gmail threads and metadata"};function Qg(s){const f=new Set;return(s.storageMode==="gdrive"||s.integrations.includes("google-drive-storage"))&&f.add("storage"),s.integrations.includes("gmail")&&f.add("gmail"),s.integrations.includes("gdrive")&&f.add("gdrive"),[...f]}function yp(s){const f=new Set;for(const x of s)for(const d of vp[x])f.add(d);return[...f]}function ai(s,f){const x=new Set(s);return yp(f).filter(d=>!x.has(d))}function Gl(s,f){return ai(s,f).length===0}function Mg(s){return{clientId:s.googleClientId,clientSecret:s.googleClientSecret,refreshToken:s.googleRefreshToken}}const bp=["channels:history","channels:read","groups:history","groups:read","im:history","app_mentions:read","chat:write"],xp=["message.channels","message.groups","app_mention"],Sp="Pac-Man connects Slack threads to your local project context so every reply can reference saved notes, project summaries, folder-derived evidence, and prior decisions. It helps teams answer questions faster without losing the audit trail back to the workspace that produced the draft.";function jp(s){const f=Np(s),x=Tp(`Pac-Man ${f}`),d=Ap(f),H=JSON.stringify({_metadata:{major_version:2,minor_version:1},display_information:{name:x,description:"Project-aware Slack replies grounded in your Pac-Man workspace.",long_description:Sp,background_color:"#0B1220"},features:{bot_user:{display_name:d,always_online:!1}},oauth_config:{scopes:{bot:bp}},settings:{event_subscriptions:{bot_events:xp},org_deploy_enabled:!1,socket_mode_enabled:!0,is_hosted:!1,token_rotation_enabled:!1}},null,2);return{appName:x,botDisplayName:d,manifestJson:H,createUrl:`https://api.slack.com/apps?new_app=1&manifest_json=${encodeURIComponent(H)}`}}function Np(s){return((s==null?void 0:s.trim().replace(/\s+/g," "))??"")||"Atlas"}function Tp(s){return s.replace(/\s+/g," ").trim().slice(0,35).trimEnd()||"Pac-Man Atlas"}function Ap(s){return s.toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9._-]/g,"").replace(/[-_.]{2,}/g,"-").replace(/^[-_.]+|[-_.]+$/g,"").slice(0,80)||"atlas"}const kg={"software-engineer":{ids:["slack","github"],message:"Slack and GitHub are recommended for Software Engineers — stay on top of PRs, code reviews, and team discussions."},"product-manager":{ids:["gdrive","slack"],message:"Google Drive and Slack are recommended for Product Managers — sync roadmaps, specs, and stakeholder threads."},"engineering-manager":{ids:["slack","github"],message:"Slack and GitHub are recommended for Engineering Managers — track team activity, delivery, and discussions."},devops:{ids:["github","gitlab"],message:"GitHub and GitLab are recommended for DevOps Engineers — monitor pipelines, infra changes, and incidents."}},We=s=>i.jsx("code",{style:{display:"inline-block",background:"var(--bg-inset)",color:"var(--pac-yellow)",borderRadius:4,padding:"1px 7px",fontSize:"0.76rem",fontFamily:"var(--font-mono)",margin:"0 3px 3px 0",border:"1px solid rgba(255, 215, 0, 0.12)"},children:s},s),Ae=s=>i.jsx("strong",{style:{color:"var(--text-primary)"},children:s}),Ye=s=>i.jsx("li",{style:{marginBottom:"0.5rem"},children:s}),tc=s=>i.jsx("ol",{style:{paddingLeft:"1.1rem",margin:0,lineHeight:1.7,color:"var(--text-secondary)",fontSize:"0.83rem"},children:s}),Ep=[{id:"slack",name:"Slack",desc:"Connect a shared Slack channel for instant project-aware replies",color:"#4A154B",initials:"Sl",fields:[{key:"botToken",label:"Bot Token",placeholder:"xoxb-...",type:"password"}],steps:tc(i.jsxs(i.Fragment,{children:[Ye(i.jsxs(i.Fragment,{children:["Go to ",Ae("api.slack.com/apps")," → Create New App → From scratch"]})),Ye(i.jsxs(i.Fragment,{children:["Under ",Ae("Socket Mode")," enable Socket Mode, create an app token with scope ",We("connections:write"),", and copy the ",Ae("App-Level Token")," (starts with ",We("xapp-"),")"]})),Ye(i.jsxs(i.Fragment,{children:["Under ",Ae("OAuth & Permissions")," add bot scopes: ",We("channels:history")," ",We("channels:read")," ",We("groups:history")," ",We("groups:read")," ",We("im:history")," ",We("app_mentions:read")," ",We("chat:write")]})),Ye(i.jsxs(i.Fragment,{children:["Under ",Ae("Event Subscriptions")," enable bot events: ",We("message.channels")," and/or ",We("message.groups")," plus ",We("app_mention")]})),Ye(i.jsxs(i.Fragment,{children:["Click ",Ae("Install to Workspace")," and copy the ",Ae("Bot User OAuth Token")," (starts with ",We("xoxb-"),")"]})),Ye(i.jsxs(i.Fragment,{children:["Invite the bot to any channel: ",We("/invite @YourAppName")]}))]}))},{id:"github",name:"GitHub",desc:"Track your commits, PRs, issues, and all comments",color:"#24292F",initials:"GH",fields:[{key:"token",label:"Personal Access Token",placeholder:"ghp_...",type:"password"}],steps:tc(i.jsxs(i.Fragment,{children:[Ye(i.jsxs(i.Fragment,{children:["Go to ",Ae("github.com → Settings → Developer settings → Personal access tokens → Tokens (classic)")]})),Ye(i.jsxs(i.Fragment,{children:["Click ",Ae("Generate new token (classic)")]})),Ye(i.jsxs(i.Fragment,{children:["Select scopes — ",We("repo")," ",We("read:user")," ",We("user:email")," ",We("notifications")]})),Ye(i.jsxs(i.Fragment,{children:["Click ",Ae("Generate token")," and copy it"]}))]}))},{id:"gitlab",name:"GitLab",desc:"Sync MRs, issues, and activity events",color:"#FC6D26",initials:"GL",fields:[{key:"token",label:"Personal Access Token",placeholder:"glpat-...",type:"password"},{key:"baseUrl",label:"Base URL",placeholder:"https://gitlab.com/api/v4",optional:!0}],steps:tc(i.jsxs(i.Fragment,{children:[Ye(i.jsxs(i.Fragment,{children:["Go to ",Ae("gitlab.com → User Settings → Access Tokens")]})),Ye(i.jsxs(i.Fragment,{children:["Create a token with scopes: ",We("read_api")," ",We("read_repository")]})),Ye(i.jsx(i.Fragment,{children:"Copy the token (shown only once)"})),Ye(i.jsx(i.Fragment,{children:"If self-hosted, enter your API base URL"}))]}))},{id:"gchat",name:"Google Chat",desc:"Sync space messages into your context",color:"#00AC47",initials:"GC",fields:[],comingSoon:!0,steps:null}],ot="google",Gg="llm-providers",_g=["gmail","storage","gdrive"],Mo={gmail:"Gmail",storage:"GDrive Storage",gdrive:"GDocs Sync"},Cp={gmail:"Pull Gmail threads and summaries into context",storage:"Browse Drive folders for project context and let Pac-Man create and use its own Drive folder",gdrive:"Read Google Docs and Drive files for document sync"},fn={openai:"OpenAI",anthropic:"Claude / Anthropic"};function gn(s){return s==="gmail"||s==="gdrive"}function ko(s){return{gmail:s.integrations.includes("gmail"),storage:s.integrations.includes("google-drive-storage")||s.storageMode==="gdrive"||!!s.gdriveFolderId.trim()||Gl(s.googleGrantedScopes,["storage"]),gdrive:s.integrations.includes("gdrive")}}function wg(s){const f=s.trim().replace(/[\\/]+$/,"");if(!f)return"";const d=(f.split(/[\\/]/).filter(Boolean).pop()??"").replace(/\.[^.]+$/,"").replace(/[-_]+/g," ").replace(/\s+/g," ").trim();return d?d.replace(/\b\w/g,N=>N.toUpperCase()):""}function Dp({state:s,update:f,onNext:x,onPrev:d}){const[N,H]=R.useState(null),[F,Q]=R.useState({}),[U,T]=R.useState({}),[J,X]=R.useState(null),[ae,de]=R.useState(""),[Ee,De]=R.useState(""),[Oe,je]=R.useState("idle"),[ce,fe]=R.useState(""),[Ce,Ze]=R.useState(()=>ko(s)),[ge,V]=R.useState({openai:"idle",anthropic:"idle"}),[Ue,me]=R.useState({openai:"",anthropic:""}),ct=R.useRef(null),st=kg[s.profileType]||kg["software-engineer"],ut=m=>st.ids.includes(m),Ie=m=>s.integrations.includes(m),yt=m=>s.integrationCredentials[m]??{},gt=R.useMemo(()=>jp(s.assistantName),[s.assistantName]),C=R.useMemo(()=>Qg(s),[s]),L=()=>{ct.current&&(window.clearInterval(ct.current),ct.current=null)},W=m=>{const k=new Set(C);return k.add(m),[...k]},ne=m=>{f({googleClientId:m.clientId??s.googleClientId,googleClientSecret:m.clientSecret??s.googleClientSecret,googleRefreshToken:m.refreshToken??s.googleRefreshToken,googleGrantedScopes:m.grantedScopes??s.googleGrantedScopes,googleAccountEmail:m.accountEmail??s.googleAccountEmail})},ye=async()=>{try{const{data:m}=await zt("/api/google/auth-status"),k=m;return k.status==="authenticated"||k.status==="complete"?(ne({refreshToken:k.refreshToken??s.googleRefreshToken,grantedScopes:Array.isArray(k.grantedScopes)?k.grantedScopes:s.googleGrantedScopes,accountEmail:k.accountEmail??s.googleAccountEmail}),je("authenticated"),fe(k.accountEmail?`Connected as ${k.accountEmail}. Google credentials will be reused for Gmail, Drive storage, and Docs.`:"Google connected. Google credentials will be reused for Gmail, Drive storage, and Docs."),L(),k.status):k.status==="pending"?(je("pending"),fe("Complete the Google authorization in the browser window that just opened."),"pending"):k.status==="error"?(je("error"),fe(k.error??"Google authentication failed."),L(),"error"):(je(s.googleRefreshToken?"authenticated":"idle"),s.googleRefreshToken||fe(""),"idle")}catch{return s.googleRefreshToken?"authenticated":"idle"}},h=()=>{L(),ct.current=window.setInterval(()=>{ye()},2e3)};R.useEffect(()=>()=>L(),[]),R.useEffect(()=>{if(!N||N!==ot&&!gn(N)){L();return}ye().then(m=>{m==="pending"&&h()})},[N]),R.useEffect(()=>{N!==ot&&Ze(ko(s))},[N,s.integrations,s.storageMode,s.gdriveFolderId,s.googleGrantedScopes]);const z=m=>{Q(k=>({...k,[m]:"idle"})),T(k=>({...k,[m]:""})),m===ot&&(Ze(ko(s)),je(s.googleRefreshToken?"authenticated":"idle"),fe("")),gn(m)&&(je(s.googleRefreshToken?"authenticated":"idle"),fe("")),H(m)},q=m=>{const k={integrations:s.integrations.filter(_=>_!==m),integrationCredentials:{...s.integrationCredentials,[m]:{}}};m==="slack"&&(Object.assign(k,{slackSetupMode:"guided",slackAppToken:"",slackChannelId:"",slackChannelName:"",slackReviewerUserId:"",slackReviewerDisplayName:s.name,slackReviewMode:"auto_send",slackGenerationEnabled:!0}),De("")),f(k),Q(_=>({..._,[m]:"idle"})),T(_=>({..._,[m]:""})),H(null)},K=(m,k,_)=>{Q(I=>({...I,[m]:"idle"})),f({integrationCredentials:{...s.integrationCredentials,[m]:{...yt(m),[k]:_}}})},le=(m,k)=>{k!=null&&k.invalidateValidation&&Q(_=>({..._,slack:"idle"})),f(m)},se=(m,k)=>{V(_=>({..._,[m]:"idle"})),me(_=>({..._,[m]:""})),Q(_=>({..._,slack:"idle"})),f(k)},he=m=>{De(""),le({slackSetupMode:m})},mt=()=>{window.open(gt.createUrl,"_blank","noopener,noreferrer"),De("Slack app creation opened in a new tab. Install the app, then paste xoxb and xapp below.")},Ke=async m=>{const k=m==="openai"?s.openAIApiKey.trim():s.anthropicApiKey.trim(),_=m==="openai"?s.openAIModel.trim():s.anthropicModel.trim();if(!k){V(I=>({...I,[m]:"invalid"})),me(I=>({...I,[m]:`${fn[m]} API key is required.`}));return}V(I=>({...I,[m]:"validating"})),me(I=>({...I,[m]:`Validating ${fn[m]} credentials...`}));try{const{res:I,data:ie}=await zt("/api/validate-provider",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:m,apiKey:k,model:_})}),b=ie;if(!I.ok||!b.valid)throw new Error(b.error??`Failed to validate ${fn[m]}.`);V(we=>({...we,[m]:"valid"})),me(we=>({...we,[m]:b.info??`${fn[m]} configured.`}))}catch(I){V(ie=>({...ie,[m]:"invalid"})),me(ie=>({...ie,[m]:I instanceof Error?I.message:`Failed to validate ${fn[m]}.`}))}},He=_g.filter(m=>Ce[m]),el=ai(s.googleGrantedScopes,He),ga=He.length>0&&!!s.googleRefreshToken.trim()&&Gl(s.googleGrantedScopes,He),tl=!!s.googleRefreshToken.trim()||s.integrations.includes("google-drive-storage")||s.integrations.includes("gmail")||s.integrations.includes("gdrive")||Gl(s.googleGrantedScopes,["storage"]),lt=N===ot,Dt=st.ids.some(m=>m==="gmail"||m==="gdrive"),ze=F[ot]??"idle",Yt=U[ot]??"",ht=N===Gg,rt=[s.openAIApiKey.trim(),s.anthropicApiKey.trim()].filter(Boolean).length,Tl=rt>0,Yl=fn[s.slackDefaultProvider],Xt=s.slackDefaultProvider==="openai"?s.openAIModel.trim():s.anthropicModel.trim(),Xl=(m,k)=>{Ze(_=>({..._,[m]:k})),Q(_=>({..._,[ot]:"idle"})),T(_=>({..._,[ot]:""}))},bt=async m=>{if(m.length===0){je("error"),fe("Select at least one Google surface before connecting.");return}if(!s.googleClientId.trim()||!s.googleClientSecret.trim()){je("error"),fe("Google Client ID and Client Secret are required.");return}je("pending"),fe("Starting Google sign-in...");try{const{res:k,data:_}=await zt("/api/google/auth-start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({clientId:s.googleClientId,clientSecret:s.googleClientSecret,features:m})}),I=_;if(!k.ok||!I.authUrl)throw new Error(I.error??`Google auth start failed with HTTP ${k.status}.`);window.open(I.authUrl,"_blank","noopener,noreferrer"),fe("Google sign-in started. Complete the browser authorization to continue."),h()}catch(k){je("error"),fe(k instanceof Error?k.message:String(k)),L()}},pn=async()=>{if(Q(_=>({..._,[ot]:"validating"})),T(_=>({..._,[ot]:"Checking selected Google surfaces..."})),He.length===0){Q(_=>({..._,[ot]:"invalid"})),T(_=>({..._,[ot]:"Select at least one Google checkbox first."}));return}if(!s.googleClientId.trim()||!s.googleClientSecret.trim()){Q(_=>({..._,[ot]:"invalid"})),T(_=>({..._,[ot]:"Google Client ID and Client Secret are required before validation."}));return}if(!s.googleRefreshToken.trim()){Q(_=>({..._,[ot]:"invalid"})),T(_=>({..._,[ot]:"Connect Google first so Pac-Man can validate the selected Google surfaces."}));return}const m=await Promise.all(He.map(async _=>{const I=Mo[_],ie=ai(s.googleGrantedScopes,[_]);if(ie.length>0)return{valid:!1,message:`${I}: missing Google access for ${ie.map(b=>Pi[b]??b).join(", ")}.`};if(_==="storage")return{valid:!0,message:`${I}: access granted. Create the Drive folder in the Storage step.`};try{const{data:b}=await zt("/api/validate-integration",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:_,credentials:Mg(s)})}),we=b;return{valid:!!we.valid,message:`${I}: ${we.valid?we.info??"Validated.":we.error??"Validation failed."}`}}catch(b){return{valid:!1,message:`${I}: ${b instanceof Error?b.message:String(b)}`}}})),k=m.some(_=>!_.valid);Q(_=>({..._,[ot]:k?"invalid":"valid"})),T(_=>({..._,[ot]:m.map(I=>I.message).join(`
64
+ `)}))},fl=m=>{var _;if(m.id==="slack")return!!((_=yt("slack").botToken)!=null&&_.trim()&&s.slackAppToken.trim());if(gn(m.id))return!!(s.googleClientId.trim()&&s.googleClientSecret.trim()&&s.googleRefreshToken.trim()&&Gl(s.googleGrantedScopes,W(m.id)));const k=yt(m.id);return m.fields.filter(I=>!I.optional).every(I=>(k[I.key]??"").trim()!=="")},ll=m=>m==="slack"?"Connecting to Slack API, verifying socket mode & provider keys":m==="github"?"Authenticating with GitHub and checking token scopes":m==="gitlab"?"Authenticating with GitLab and verifying access":m==="gmail"?"Verifying Gmail API credentials and refresh token":m==="gdrive"?"Checking Google Drive API access":"Verifying credentials",Ql=async m=>{Q(k=>({...k,[m.id]:"validating"})),T(k=>({...k,[m.id]:ll(m.id)}));try{if(m.id==="slack"){const ie=await(await fetch(hn("/api/validate-slack-runtime"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({botToken:yt("slack").botToken,appToken:s.slackAppToken,generationEnabled:s.slackGenerationEnabled,providers:{openai:{apiKey:s.openAIApiKey,model:s.openAIModel},anthropic:{apiKey:s.anthropicApiKey,model:s.anthropicModel}}})})).json();if(!ie.valid){Q(b=>({...b,slack:"invalid"})),T(b=>({...b,slack:ie.error??"Slack validation failed"}));return}le({slackReviewerDisplayName:s.name}),Q(b=>({...b,slack:"valid"})),T(b=>({...b,slack:ie.info??"Slack connected"}));return}if(gn(m.id)){const ie=await(await fetch(hn("/api/validate-integration"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:m.id,credentials:Mg(s)})})).json();ie.valid?(Q(b=>({...b,[m.id]:"valid"})),T(b=>({...b,[m.id]:ie.info??""}))):(Q(b=>({...b,[m.id]:"invalid"})),T(b=>({...b,[m.id]:ie.error??"Validation failed"})));return}const _=await(await fetch(hn("/api/validate-integration"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:m.id,credentials:yt(m.id)})})).json();_.valid?(Q(I=>({...I,[m.id]:"valid"})),T(I=>({...I,[m.id]:_.info??""}))):(Q(I=>({...I,[m.id]:"invalid"})),T(I=>({...I,[m.id]:_.error??"Validation failed"})))}catch(k){Q(_=>({..._,[m.id]:"invalid"})),T(_=>({..._,[m.id]:String(k)}))}},Fa=m=>{const k=F[m.id]??"idle";if(m.id!=="slack")return k==="valid";const _=!s.slackGenerationEnabled||(s.slackDefaultProvider==="openai"?!!s.openAIApiKey.trim()&&!!s.openAIModel.trim():!!s.anthropicApiKey.trim()&&!!s.anthropicModel.trim());return k==="valid"&&_},ma=()=>(F.slack??"idle")!=="valid"?"Validate Slack first":s.slackGenerationEnabled&&s.slackDefaultProvider==="openai"&&!s.openAIApiKey.trim()?"Add an OpenAI API key or disable draft generation":s.slackGenerationEnabled&&s.slackDefaultProvider==="anthropic"&&!s.anthropicApiKey.trim()?"Add a Claude API key or disable draft generation":"",qa=m=>{Ie(m)||(f({integrations:[...s.integrations,m]}),li(s.email,`integration_${m}_connected`)),H(null)},Rt=()=>{const m=[...s.integrations.filter(k=>k!=="gmail"&&k!=="gdrive"&&k!=="google-drive-storage"),...Ce.storage?["google-drive-storage"]:[],...Ce.gmail?["gmail"]:[],...Ce.gdrive?["gdrive"]:[]];Ce.gmail&&!s.integrations.includes("gmail")&&li(s.email,"integration_gmail_connected"),Ce.gdrive&&!s.integrations.includes("gdrive")&&li(s.email,"integration_gdrive_connected"),f({integrations:m}),H(null)},al=()=>{f({localFolders:[...s.localFolders,{path:"",project:""}]})},at=(m,k)=>{const _=[...s.localFolders];_[m]={..._[m],...k},f({localFolders:_})},Bt=m=>{f({localFolders:s.localFolders.filter((k,_)=>_!==m)})},At=async m=>{var _,I;X(m),de("");const k=performance.now();try{const ie=await fetch(hn("/api/pick-folder"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({defaultPath:((_=s.localFolders[m])==null?void 0:_.path)||s.localPath,purpose:"local-source"})});if(!ie.ok)throw new Error(`Server returned ${ie.status}`);const b=await ie.json();if(b.error)throw new Error(b.error);if(console.info(`[onboarding] local source picker resolved in ${Math.round(performance.now()-k)}ms`),!b.cancelled&&b.path){const we=((I=s.localFolders[m])==null?void 0:I.project.trim())??"";at(m,{path:b.path,...we?{}:{project:wg(b.path)}})}}catch(ie){const b=ie instanceof Error?ie.message:String(ie);de(b||"Could not open folder picker. Make sure the backend is running (pacman init)."),setTimeout(()=>de(""),5e3)}finally{X(null)}},Al=[...new Set(s.localFolders.map(m=>m.project).filter(Boolean))],Ya=s.integrations.length,ii=i.jsxs("div",{style:{borderRadius:"var(--radius)",border:`1px solid ${tl?"rgba(66, 133, 244, 0.24)":lt?"rgba(66, 133, 244, 0.34)":"var(--border)"}`,background:tl?"linear-gradient(180deg, rgba(66, 133, 244, 0.07), rgba(66, 133, 244, 0.02))":lt?"var(--bg-surface)":"var(--bg-input)",overflow:"hidden",transition:"border-color 0.2s"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"1rem",padding:"0.875rem 1.25rem"},children:[i.jsx("div",{style:{width:40,height:40,borderRadius:"var(--radius-sm)",background:"#4285F4",display:"flex",alignItems:"center",justifyContent:"center",fontWeight:700,fontSize:"0.75rem",fontFamily:"var(--font-mono)",color:"#fff",flexShrink:0},children:"Go"}),i.jsxs("div",{style:{flex:1},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem",flexWrap:"wrap"},children:[i.jsx("span",{style:{color:"var(--text-primary)",fontWeight:600,fontSize:"0.9rem"},children:"Google"}),tl&&i.jsx("span",{style:{fontSize:"0.7rem",background:"rgba(66, 133, 244, 0.16)",color:"#9ec3ff",padding:"1px 8px",borderRadius:99,fontWeight:600},children:"Connected"}),Dt&&!tl&&i.jsx("span",{className:"recommended-badge",children:"RECOMMENDED"})]}),i.jsx("div",{style:{color:"var(--text-dim)",fontSize:"0.78rem",marginTop:"2px"},children:"Create one Google app here, then validate Gmail, GDrive storage, and GDocs sync from one place."})]}),i.jsx("div",{style:{display:"flex",gap:"0.5rem",flexShrink:0},children:i.jsx("button",{onClick:()=>z(ot),style:{...Go,background:lt?"rgba(66, 133, 244, 0.16)":"var(--bg-elevated)",borderColor:lt?"rgba(66, 133, 244, 0.32)":"var(--border)",color:lt?"#9ec3ff":"var(--text-secondary)"},children:lt?"Setting up...":tl?"Edit":"+ Connect"})})]}),lt&&i.jsxs("div",{style:{borderTop:"1px solid rgba(66, 133, 244, 0.14)",padding:"1.25rem"},children:[i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1.2fr 1fr",gap:"1rem",marginBottom:"1rem"},children:[i.jsxs("div",{style:{background:"var(--bg-inset)",border:"1px solid var(--border)",borderRadius:"var(--radius-sm)",padding:"1rem"},children:[i.jsx("p",{style:{color:"var(--text-muted)",fontSize:"0.7rem",fontWeight:700,letterSpacing:"0.08em",textTransform:"uppercase",marginBottom:"0.625rem"},children:"Google app setup"}),tc(i.jsxs(i.Fragment,{children:[Ye(i.jsxs(i.Fragment,{children:["Open ",Ae("console.cloud.google.com")," and create one project for Pac-Man"]})),Ye(i.jsxs(i.Fragment,{children:["Go to ",Ae("APIs & Services → Library")," and enable ",Ae("Google Drive API"),"; also enable ",Ae("Gmail API")," if you want Gmail sync"]})),Ye(i.jsxs(i.Fragment,{children:["Go to ",Ae("OAuth consent screen")," and configure an ",Ae("External")," app with app name and support email"]})),Ye(i.jsxs(i.Fragment,{children:["Under ",Ae("Scopes"),", let Google request Drive and Gmail permissions during connect. Pac-Man only asks for the scopes required by the checked sub-integrations below."]})),Ye(i.jsxs(i.Fragment,{children:["Under ",Ae("Test users"),", add your own Google account email. Without this, Google will block the login with ",Ae("app not verified")]})),Ye(i.jsxs(i.Fragment,{children:["Go to ",Ae("Credentials → Create Credentials → OAuth client ID")," and choose ",Ae("Web application")]})),Ye(i.jsxs(i.Fragment,{children:["Add the redirect URI ",We("http://localhost:3847/api/google/callback"),". If you still use older Pac-Man builds, also keep ",We("http://localhost:3847/api/gdrive/callback")]})),Ye(i.jsxs(i.Fragment,{children:["Paste the Google ",Ae("Client ID")," and ",Ae("Client Secret")," into the fields here. Pac-Man reuses them for Gmail, GDrive storage, and GDocs sync."]})),Ye(i.jsxs(i.Fragment,{children:["Check the Google surfaces you want below, click ",Ae("Connect Google")," to grant access, then click ",Ae("Validate")," to verify each checked surface."]}))]}))]}),i.jsxs("div",{style:{background:"var(--bg-inset)",border:"1px solid var(--border)",borderRadius:"var(--radius-sm)",padding:"1rem"},children:[i.jsxs("div",{style:{marginBottom:"0.75rem"},children:[i.jsx("label",{style:kl,children:"Google Client ID"}),i.jsx("input",{type:"text",value:s.googleClientId,onChange:m=>{je("idle"),Q(k=>({...k,[ot]:"idle"})),T(k=>({...k,[ot]:""})),f({googleClientId:m.target.value})},placeholder:"your-client-id.apps.googleusercontent.com",style:ti})]}),i.jsxs("div",{style:{marginBottom:"0.75rem"},children:[i.jsx("label",{style:kl,children:"Google Client Secret"}),i.jsx("input",{type:"password",value:s.googleClientSecret,onChange:m=>{je("idle"),Q(k=>({...k,[ot]:"idle"})),T(k=>({...k,[ot]:""})),f({googleClientSecret:m.target.value})},placeholder:"your-client-secret",style:ti})]}),i.jsxs("div",{style:{display:"flex",gap:"0.75rem",flexWrap:"wrap",marginBottom:s.googleGrantedScopes.length>0?"0.75rem":0},children:[i.jsxs("div",{style:Ha,children:[i.jsx("span",{style:La,children:"Google account"}),i.jsx("strong",{children:s.googleAccountEmail||"Not connected yet"})]}),i.jsxs("div",{style:Ha,children:[i.jsx("span",{style:La,children:"Granted scopes"}),i.jsx("strong",{children:s.googleGrantedScopes.length>0?s.googleGrantedScopes.length:"None yet"})]})]}),s.googleGrantedScopes.length>0&&i.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"0.4rem"},children:s.googleGrantedScopes.map(m=>i.jsx("span",{style:Ug,children:Pi[m]??m},m))})]})]}),i.jsxs("div",{style:{background:"var(--bg-inset)",border:"1px solid var(--border)",borderRadius:"var(--radius-sm)",padding:"1rem",marginBottom:"1rem"},children:[i.jsx("p",{style:{color:"var(--text-muted)",fontSize:"0.7rem",fontWeight:700,letterSpacing:"0.08em",textTransform:"uppercase",marginBottom:"0.35rem"},children:"Google surfaces"}),i.jsx("p",{style:{color:"var(--text-secondary)",fontSize:"0.82rem",lineHeight:1.7,marginBottom:"0.85rem"},children:"Check the Google surfaces you want Pac-Man to use. Validate checks only the boxes selected here."}),i.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(220px, 1fr))",gap:"0.75rem",marginBottom:"0.9rem"},children:_g.map(m=>{const k=Ce[m],_=!!s.googleRefreshToken.trim()&&Gl(s.googleGrantedScopes,[m]);return i.jsxs("label",{style:{display:"flex",alignItems:"flex-start",gap:"0.7rem",padding:"0.85rem",borderRadius:"var(--radius-sm)",border:`1px solid ${k?"rgba(66, 133, 244, 0.3)":"var(--border)"}`,background:k?"rgba(66, 133, 244, 0.08)":"var(--bg-surface)",cursor:"pointer"},children:[i.jsx("input",{type:"checkbox",checked:k,onChange:I=>Xl(m,I.target.checked),style:{marginTop:"0.2rem"}}),i.jsxs("div",{children:[i.jsx("div",{style:{color:"var(--text-primary)",fontSize:"0.84rem",fontWeight:600,marginBottom:"0.2rem"},children:Mo[m]}),i.jsx("div",{style:{color:"var(--text-dim)",fontSize:"0.78rem",lineHeight:1.55,marginBottom:"0.4rem"},children:Cp[m]}),i.jsx("span",{style:{display:"inline-block",fontSize:"0.7rem",background:_?"var(--success-subtle)":"var(--bg-elevated)",color:_?"var(--success)":"var(--text-dim)",padding:"1px 8px",borderRadius:99,fontWeight:600},children:_?"Access granted":"Access not granted"})]})]},m)})}),i.jsx("div",{style:{display:"flex",gap:"0.4rem",flexWrap:"wrap",marginBottom:"0.85rem"},children:He.length>0?He.map(m=>i.jsx("span",{style:Bg,children:Mo[m]},m)):i.jsx("span",{style:{color:"var(--text-dim)",fontSize:"0.8rem"},children:"No Google surface selected yet."})}),i.jsx("div",{style:{display:"flex",gap:"0.5rem",flexWrap:"wrap",marginBottom:"0.9rem"},children:i.jsx("button",{type:"button",onClick:()=>void bt(He),disabled:He.length===0||Oe==="pending",style:{...ql,background:He.length>0&&Oe!=="pending"?"rgba(66, 133, 244, 0.16)":"var(--bg-inset)",color:He.length>0&&Oe!=="pending"?"#9ec3ff":"var(--text-dim)",borderColor:He.length>0&&Oe!=="pending"?"rgba(66, 133, 244, 0.32)":"var(--border)",cursor:He.length>0&&Oe!=="pending"?"pointer":"not-allowed"},children:ga?"Reconnect Google":s.googleRefreshToken?"Expand Google access":"Connect Google"})}),el.length>0&&s.googleRefreshToken&&i.jsxs("p",{style:{color:"var(--warning)",fontSize:"0.82rem",marginBottom:"0.9rem"},children:["Additional Google consent is still needed for the selected surfaces: ",el.map(m=>Pi[m]??m).join(", "),"."]}),ce&&i.jsx("p",{style:{color:Oe==="error"?"var(--error)":Oe==="authenticated"?"var(--success)":"var(--text-secondary)",fontSize:"0.82rem",marginBottom:0},children:ce})]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"1rem"},children:[i.jsxs("div",{style:{fontSize:"0.82rem",flex:1,whiteSpace:"pre-line"},children:[ze==="idle"&&i.jsx("span",{style:{color:"var(--text-dim)"},children:"Select the Google surfaces you want, connect access, then validate the checked ones."}),ze==="validating"&&i.jsxs("span",{style:{color:"#9ec3ff",display:"flex",alignItems:"center",gap:"0.5rem"},children:[i.jsxs("span",{className:"validation-dots",children:[i.jsx("span",{className:"pac-trail-dot",style:{width:5,height:5}}),i.jsx("span",{className:"pac-trail-dot",style:{width:5,height:5}}),i.jsx("span",{className:"pac-trail-dot",style:{width:5,height:5}})]}),Yt||"Validating selected Google surfaces..."]}),ze==="valid"&&i.jsx("span",{style:{color:"var(--success)"},children:Yt}),ze==="invalid"&&i.jsx("span",{style:{color:"var(--error)"},children:Yt})]}),i.jsxs("div",{style:{display:"flex",gap:"0.5rem",flexShrink:0},children:[i.jsx("button",{type:"button",onClick:()=>void pn(),disabled:He.length===0||ze==="validating",style:{...ql,background:He.length>0&&ze!=="validating"?"rgba(66, 133, 244, 0.16)":"var(--bg-inset)",color:He.length>0&&ze!=="validating"?"#9ec3ff":"var(--text-dim)",borderColor:He.length>0&&ze!=="validating"?"rgba(66, 133, 244, 0.32)":"var(--border)",cursor:He.length>0&&ze!=="validating"?"pointer":"not-allowed"},children:ze==="validating"?"Validating...":"Validate"}),i.jsx("button",{type:"button",onClick:Rt,disabled:ze!=="valid",style:{...ql,background:ze==="valid"?"var(--success-dim)":"var(--bg-inset)",color:ze==="valid"?"var(--success)":"var(--text-dim)",borderColor:ze==="valid"?"rgba(0, 255, 136, 0.25)":"var(--border)",cursor:ze==="valid"?"pointer":"not-allowed",fontWeight:700},children:"Save"})]})]})]})]}),_l=i.jsxs("div",{style:{borderRadius:"var(--radius)",border:`1px solid ${Tl?"rgba(255, 215, 0, 0.22)":ht?"rgba(255, 215, 0, 0.3)":"var(--border)"}`,background:Tl?"linear-gradient(180deg, rgba(255, 215, 0, 0.06), rgba(255, 215, 0, 0.02))":ht?"var(--bg-surface)":"var(--bg-input)",overflow:"hidden",transition:"border-color 0.2s"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"1rem",padding:"0.875rem 1.25rem"},children:[i.jsx("div",{style:{width:40,height:40,borderRadius:"var(--radius-sm)",background:"var(--pac-yellow)",display:"flex",alignItems:"center",justifyContent:"center",fontWeight:700,fontSize:"0.75rem",fontFamily:"var(--font-mono)",color:"#111",flexShrink:0},children:"AI"}),i.jsxs("div",{style:{flex:1},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem",flexWrap:"wrap"},children:[i.jsx("span",{style:{color:"var(--text-primary)",fontWeight:600,fontSize:"0.9rem"},children:"LLM Providers"}),Tl&&i.jsxs("span",{style:{fontSize:"0.7rem",background:"var(--pac-yellow-dim)",color:"var(--pac-yellow)",padding:"1px 8px",borderRadius:99,fontWeight:600},children:[rt," configured"]})]}),i.jsx("div",{style:{color:"var(--text-dim)",fontSize:"0.78rem",marginTop:"2px"},children:"Shared OpenAI and Anthropic credentials used by project knowledge generation and Slack draft generation."})]}),i.jsx("div",{style:{display:"flex",gap:"0.5rem",flexShrink:0},children:i.jsx("button",{onClick:()=>z(Gg),style:{...Go,background:ht?"var(--pac-yellow-dim)":"var(--bg-elevated)",borderColor:ht?"var(--pac-yellow)":"var(--border)",color:ht?"var(--pac-yellow)":"var(--text-secondary)"},children:ht?"Editing...":Tl?"Edit":"+ Configure"})})]}),ht&&i.jsxs("div",{style:{borderTop:"1px solid rgba(255, 215, 0, 0.14)",padding:"1.25rem"},children:[i.jsxs("div",{style:{background:"var(--bg-inset)",border:"1px solid var(--border)",borderRadius:"var(--radius-sm)",padding:"1rem",marginBottom:"1rem"},children:[i.jsx("p",{style:{color:"var(--text-muted)",fontSize:"0.7rem",fontWeight:700,letterSpacing:"0.08em",textTransform:"uppercase",marginBottom:"0.35rem"},children:"Shared provider settings"}),i.jsx("p",{style:{color:"var(--text-secondary)",fontSize:"0.82rem",lineHeight:1.7,marginBottom:"0.9rem"},children:"Configure provider credentials here once. Pac-Man reuses them for project knowledge graph generation and, if enabled, Slack draft generation."}),i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"0.75rem",marginBottom:"0.9rem"},children:[i.jsxs("div",{children:[i.jsx("label",{style:kl,children:"Preferred Provider"}),i.jsxs("select",{value:s.slackDefaultProvider,onChange:m=>{const k=m.target.value;Q(_=>({..._,slack:"idle"})),f({slackDefaultProvider:k,slackDefaultModel:k==="openai"?s.openAIModel:s.anthropicModel})},style:Op,children:[i.jsx("option",{value:"openai",children:"OpenAI"}),i.jsx("option",{value:"anthropic",children:"Claude / Anthropic"})]})]}),i.jsxs("div",{children:[i.jsx("label",{style:kl,children:"Preferred Model"}),i.jsx("input",{value:Xt,onChange:m=>{const k=m.target.value;if(Q(_=>({..._,slack:"idle"})),s.slackDefaultProvider==="openai"){se("openai",{openAIModel:k,slackDefaultModel:k});return}se("anthropic",{anthropicModel:k,slackDefaultModel:k})},placeholder:s.slackDefaultProvider==="openai"?"gpt-4.1-mini":"claude-3-7-sonnet-latest",style:ti})]})]}),i.jsxs("div",{style:{display:"flex",gap:"0.75rem",flexWrap:"wrap"},children:[i.jsxs("div",{style:Ha,children:[i.jsx("span",{style:La,children:"Configured providers"}),i.jsx("strong",{children:rt>0?rt:"None yet"})]}),i.jsxs("div",{style:Ha,children:[i.jsx("span",{style:La,children:"Slack dependency"}),i.jsx("strong",{children:s.slackGenerationEnabled?`${Yl}${Xt?` · ${Xt}`:""}`:"Slack draft generation disabled"})]})]})]}),i.jsx("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"1rem"},children:["openai","anthropic"].map(m=>{const k=m==="openai",_=k?s.openAIApiKey:s.anthropicApiKey,I=k?s.openAIModel:s.anthropicModel,ie=ge[m]??"idle",b=Ue[m]??"";return i.jsxs("div",{style:{background:"var(--bg-inset)",border:"1px solid var(--border)",borderRadius:"var(--radius-sm)",padding:"1rem"},children:[i.jsx("div",{style:{color:"var(--text-primary)",fontSize:"0.85rem",fontWeight:600,marginBottom:"0.25rem"},children:fn[m]}),i.jsx("div",{style:{color:"var(--text-dim)",fontSize:"0.78rem",lineHeight:1.6,marginBottom:"0.85rem"},children:k?"Use OpenAI for project knowledge generation and optional Slack drafts.":"Use Anthropic for project knowledge generation and optional Slack drafts."}),i.jsxs("div",{style:{marginBottom:"0.75rem"},children:[i.jsx("label",{style:kl,children:k?"OpenAI API Key":"Claude API Key"}),i.jsx("input",{type:"password",value:_,onChange:we=>se(m,k?{openAIApiKey:we.target.value}:{anthropicApiKey:we.target.value}),placeholder:k?"sk-...":"sk-ant-...",style:ti})]}),i.jsxs("div",{style:{marginBottom:"0.9rem"},children:[i.jsx("label",{style:kl,children:k?"OpenAI Model":"Claude Model"}),i.jsx("input",{value:I,onChange:we=>se(m,k?{openAIModel:we.target.value,...s.slackDefaultProvider==="openai"?{slackDefaultModel:we.target.value}:{}}:{anthropicModel:we.target.value,...s.slackDefaultProvider==="anthropic"?{slackDefaultModel:we.target.value}:{}}),placeholder:k?"gpt-4.1-mini":"claude-3-7-sonnet-latest",style:ti})]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"0.75rem"},children:[i.jsxs("div",{style:{fontSize:"0.8rem",flex:1},children:[ie==="idle"&&i.jsx("span",{style:{color:"var(--text-dim)"},children:"Add credentials, then validate."}),ie==="validating"&&i.jsx("span",{style:{color:"var(--pac-yellow)"},children:b}),ie==="valid"&&i.jsx("span",{style:{color:"var(--success)"},children:b}),ie==="invalid"&&i.jsx("span",{style:{color:"var(--error)"},children:b})]}),i.jsx("button",{type:"button",onClick:()=>void Ke(m),disabled:!_.trim()||ie==="validating",style:{...ql,background:_.trim()&&ie!=="validating"?"var(--pac-yellow-dim)":"var(--bg-inset)",color:_.trim()&&ie!=="validating"?"var(--pac-yellow)":"var(--text-dim)",borderColor:_.trim()&&ie!=="validating"?"rgba(255, 215, 0, 0.25)":"var(--border)",cursor:_.trim()&&ie!=="validating"?"pointer":"not-allowed"},children:ie==="validating"?"Validating...":"Validate"})]})]},m)})})]})]});return i.jsxs("div",{className:"step-content",children:[i.jsxs("div",{className:"integration-section-header",children:[i.jsxs("div",{children:[i.jsx("h1",{style:{marginBottom:"0.25rem"},children:"Integrations"}),i.jsx("h2",{style:{margin:0},children:"Feed Pac-Man your tools and documents"})]}),Ya>0&&i.jsxs("span",{className:"integration-count",children:[Ya," connected"]})]}),i.jsxs("div",{className:"recommendation-banner",children:[i.jsx("div",{className:"pacman-char pacman-char-small"}),i.jsx("span",{children:st.message})]}),i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"0.625rem",marginBottom:"0.5rem"},children:Ep.map(m=>{const k=Ie(m.id),_=N===m.id,I=F[m.id]??"idle",ie=U[m.id]??"",b=fl(m)&&I!=="validating",we=Fa(m),Vl=ut(m.id);return i.jsxs(Xg.Fragment,{children:[i.jsxs("div",{style:{borderRadius:"var(--radius)",border:`1px solid ${k?"rgba(0, 255, 136, 0.15)":_?"var(--border-hover)":"var(--border)"}`,background:k?"linear-gradient(to right, rgba(0, 255, 136, 0.03), var(--bg-surface))":_?"var(--bg-surface)":"var(--bg-input)",overflow:"hidden",transition:"border-color 0.2s"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"1rem",padding:"0.875rem 1.25rem"},children:[i.jsx("div",{style:{width:40,height:40,borderRadius:"var(--radius-sm)",background:m.color,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:700,fontSize:"0.75rem",fontFamily:"var(--font-mono)",color:"#fff",flexShrink:0,opacity:m.comingSoon?.35:1},children:m.initials}),i.jsxs("div",{style:{flex:1},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem",flexWrap:"wrap"},children:[i.jsx("span",{style:{color:"var(--text-primary)",fontWeight:600,fontSize:"0.9rem"},children:m.name}),k&&i.jsx("span",{style:{fontSize:"0.7rem",background:"var(--success-subtle)",color:"var(--success)",padding:"1px 8px",borderRadius:99,fontWeight:600},children:"Connected"}),Vl&&!k&&i.jsx("span",{className:"recommended-badge",children:"RECOMMENDED"}),m.comingSoon&&i.jsx("span",{style:{fontSize:"0.7rem",background:"var(--bg-elevated)",color:"var(--text-dim)",padding:"1px 8px",borderRadius:99},children:"Coming soon"})]}),i.jsx("div",{style:{color:"var(--text-dim)",fontSize:"0.78rem",marginTop:"2px"},children:m.desc})]}),!m.comingSoon&&i.jsx("div",{style:{display:"flex",gap:"0.5rem",flexShrink:0},children:k?i.jsxs(i.Fragment,{children:[i.jsx("button",{onClick:()=>z(m.id),style:Rg,children:"Edit"}),i.jsx("button",{onClick:()=>q(m.id),style:{...Rg,color:"var(--error)",borderColor:"rgba(255, 68, 102, 0.2)"},children:"Disconnect"})]}):i.jsx("button",{onClick:()=>z(m.id),style:{...Go,background:_?"var(--pac-yellow-dim)":"var(--bg-elevated)",borderColor:_?"var(--pac-yellow)":"var(--border)",color:_?"var(--pac-yellow)":"var(--text-secondary)"},children:_?"Setting up...":"+ Connect"})})]}),_&&i.jsxs("div",{style:{borderTop:"1px solid var(--border)",padding:"1.25rem"},children:[m.id==="slack"&&i.jsxs("div",{style:{marginBottom:"1rem"},children:[i.jsxs("div",{style:{display:"flex",gap:"0.5rem",marginBottom:"0.75rem",flexWrap:"wrap"},children:[i.jsx("button",{type:"button",onClick:()=>he("guided"),style:{...ql,background:s.slackSetupMode==="guided"?"var(--pac-yellow-dim)":"var(--bg-inset)",color:s.slackSetupMode==="guided"?"var(--pac-yellow)":"var(--text-secondary)",borderColor:s.slackSetupMode==="guided"?"rgba(255, 215, 0, 0.25)":"var(--border)"},children:"Guided setup"}),i.jsx("button",{type:"button",onClick:()=>he("manual"),style:{...ql,background:s.slackSetupMode==="manual"?"rgba(74, 21, 75, 0.18)":"var(--bg-inset)",color:s.slackSetupMode==="manual"?"#d4b3d8":"var(--text-secondary)",borderColor:s.slackSetupMode==="manual"?"rgba(74, 21, 75, 0.45)":"var(--border)"},children:"Manual setup"})]}),i.jsxs("div",{style:{background:"var(--bg-inset)",border:"1px solid var(--border)",borderRadius:"var(--radius-sm)",padding:"1rem",marginBottom:"1rem"},children:[i.jsx("p",{style:{color:"var(--text-muted)",fontSize:"0.7rem",fontWeight:700,letterSpacing:"0.08em",textTransform:"uppercase",marginBottom:"0.35rem"},children:s.slackSetupMode==="guided"?"Guided setup":"Manual setup"}),i.jsx("p",{style:{color:"var(--text-secondary)",fontSize:"0.82rem",lineHeight:1.7,marginBottom:"0.85rem"},children:s.slackSetupMode==="guided"?"Pac-Man prepares the Slack app manifest for you. You still install the app in Slack and paste the xoxb and xapp tokens below.":"Use the existing Slack setup path if you prefer to configure every setting by hand."}),s.slackSetupMode==="guided"?i.jsxs(i.Fragment,{children:[i.jsx("div",{style:{display:"flex",gap:"0.5rem",flexWrap:"wrap",marginBottom:"0.9rem"},children:i.jsx("button",{type:"button",onClick:mt,style:{...ql,background:"var(--pac-yellow-dim)",color:"var(--pac-yellow)",borderColor:"rgba(255, 215, 0, 0.25)"},children:"Open Slack app flow"})}),Ee&&i.jsx("p",{style:{color:"var(--success)",fontSize:"0.82rem",marginBottom:"0.9rem"},children:Ee}),i.jsxs("div",{style:{display:"flex",gap:"0.75rem",flexWrap:"wrap",marginBottom:"0.9rem"},children:[i.jsxs("div",{style:Ha,children:[i.jsx("span",{style:La,children:"Slack app name"}),i.jsx("strong",{children:gt.appName})]}),i.jsxs("div",{style:Ha,children:[i.jsx("span",{style:La,children:"Bot display name"}),i.jsx("strong",{children:gt.botDisplayName})]})]}),tc(i.jsxs(i.Fragment,{children:[Ye(i.jsxs(i.Fragment,{children:["Click ",Ae("Open Slack app flow")," to jump straight into Slack’s ",Ae("create from manifest")," screen"]})),Ye(i.jsxs(i.Fragment,{children:["Review the app config, click ",Ae("Create"),", then ",Ae("Install to Workspace")]})),Ye(i.jsxs(i.Fragment,{children:["In Slack, go to ",Ae("Basic Information")," and generate an app-level token with ",We("connections:write")]})),Ye(i.jsxs(i.Fragment,{children:["Paste the ",Ae("Bot User OAuth Token")," (",We("xoxb-"),") and the ",Ae("App-Level Token")," (",We("xapp-"),") into the fields below"]})),Ye(i.jsxs(i.Fragment,{children:["Validate, save, then later start replies manually with ",We("pacman slack listen")]}))]})),i.jsxs("div",{style:zp,children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"0.75rem",marginBottom:"0.5rem"},children:[i.jsx("span",{style:{color:"var(--text-primary)",fontSize:"0.8rem",fontWeight:600},children:"Generated manifest"}),i.jsx("span",{style:{color:"var(--text-dim)",fontSize:"0.72rem"},children:"Socket Mode + events + scopes"})]}),i.jsx("pre",{style:Mp,children:gt.manifestJson})]})]}):m.steps]})]}),gn(m.id)&&i.jsx("div",{style:{background:"var(--bg-inset)",border:"1px solid var(--border)",borderRadius:"var(--radius-sm)",padding:"1rem",marginBottom:"1rem"},children:(()=>{const Je=W(m.id),Zl=ai(s.googleGrantedScopes,Je),wl=!!s.googleRefreshToken.trim()&&Gl(s.googleGrantedScopes,Je);return i.jsxs(i.Fragment,{children:[i.jsx("p",{style:{color:"var(--text-muted)",fontSize:"0.7rem",fontWeight:700,letterSpacing:"0.08em",textTransform:"uppercase",marginBottom:"0.35rem"},children:"Shared Google connect"}),i.jsx("p",{style:{color:"var(--text-secondary)",fontSize:"0.82rem",lineHeight:1.7,marginBottom:"0.85rem"},children:"This sub-integration reuses the shared Google app configured above. Connect here only to grant or expand the scopes needed for this specific Google surface."}),i.jsxs("div",{style:{display:"flex",gap:"0.75rem",flexWrap:"wrap",marginBottom:"0.9rem"},children:[i.jsxs("div",{style:Ha,children:[i.jsx("span",{style:La,children:"Google account"}),i.jsx("strong",{children:s.googleAccountEmail||"Not connected yet"})]}),i.jsxs("div",{style:Ha,children:[i.jsx("span",{style:La,children:"Needed for this step"}),i.jsx("strong",{children:Je.map(Mt=>zg[Mt]).join(" + ")})]})]}),i.jsxs("div",{style:{marginBottom:"0.9rem"},children:[i.jsx("div",{style:{color:"var(--text-muted)",fontSize:"0.78rem",marginBottom:"0.4rem"},children:"Requested access"}),i.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"0.4rem"},children:Je.map(Mt=>i.jsx("span",{style:Bg,children:zg[Mt]},Mt))})]}),i.jsxs("div",{style:{marginBottom:"0.9rem"},children:[i.jsx("div",{style:{color:"var(--text-muted)",fontSize:"0.78rem",marginBottom:"0.4rem"},children:"Granted scopes"}),i.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"0.4rem"},children:s.googleGrantedScopes.length>0?s.googleGrantedScopes.map(Mt=>i.jsx("span",{style:Ug,children:Pi[Mt]??Mt},Mt)):i.jsx("span",{style:{color:"var(--text-dim)",fontSize:"0.8rem"},children:"None yet"})})]}),i.jsx("div",{style:{display:"flex",gap:"0.5rem",flexWrap:"wrap",marginBottom:"0.9rem"},children:i.jsx("button",{type:"button",onClick:()=>void bt(Je),style:{...ql,background:"rgba(66, 133, 244, 0.16)",color:"#9ec3ff",borderColor:"rgba(66, 133, 244, 0.32)"},children:wl?"Reconnect Google":s.googleRefreshToken?"Expand Google access":"Connect Google"})}),Zl.length>0&&s.googleRefreshToken&&i.jsxs("p",{style:{color:"var(--warning)",fontSize:"0.82rem",marginBottom:"0.9rem"},children:["Additional Google consent is still needed for this card: ",Zl.map(Mt=>Pi[Mt]??Mt).join(", "),"."]}),ce&&i.jsx("p",{style:{color:Oe==="error"?"var(--error)":Oe==="authenticated"?"var(--success)":"var(--text-secondary)",fontSize:"0.82rem",marginBottom:"0.9rem"},children:ce}),m.steps]})})()}),m.id!=="slack"&&!gn(m.id)&&i.jsxs("div",{style:{background:"var(--bg-inset)",border:"1px solid var(--border)",borderRadius:"var(--radius-sm)",padding:"1rem",marginBottom:"1.25rem"},children:[i.jsx("p",{style:{color:"var(--text-muted)",fontSize:"0.7rem",fontWeight:700,letterSpacing:"0.08em",textTransform:"uppercase",marginBottom:"0.625rem"},children:"Setup steps"}),m.steps]}),!gn(m.id)&&i.jsx("div",{style:{display:"grid",gridTemplateColumns:m.fields.length>1?"1fr 1fr":"1fr",gap:"0.75rem",marginBottom:m.id==="slack"?"0.75rem":"1rem"},children:m.fields.map(Je=>i.jsxs("div",{children:[i.jsxs("label",{style:{display:"block",fontSize:"0.78rem",color:"var(--text-muted)",marginBottom:"0.3rem",fontWeight:500},children:[Je.label,Je.optional&&i.jsx("span",{style:{color:"var(--text-dim)"},children:" — optional"})]}),i.jsx("input",{type:Je.type??"text",value:yt(m.id)[Je.key]??"",onChange:Zl=>K(m.id,Je.key,Zl.target.value),placeholder:Je.placeholder,style:{marginBottom:0,fontSize:"0.83rem",padding:"0.6rem 0.75rem",background:"var(--bg-inset)",borderColor:"var(--border)"}})]},Je.key))}),m.id==="slack"&&i.jsxs(i.Fragment,{children:[i.jsx("p",{style:{color:"var(--text-dim)",fontSize:"0.8rem",marginBottom:"0.75rem",lineHeight:1.6},children:s.slackSetupMode==="guided"?"These are the only Slack values you still need to paste after the app is created from the manifest.":"Paste the Slack tokens from your manual Slack app setup, then validate and save."}),i.jsxs("div",{style:{marginBottom:"0.75rem"},children:[i.jsx("label",{style:kl,children:"Socket Mode App Token"}),i.jsx("input",{type:"password",value:s.slackAppToken,onChange:Je=>le({slackAppToken:Je.target.value},{invalidateValidation:!0}),placeholder:"xapp-...",style:ti})]}),i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"0.75rem",marginBottom:"0.75rem"},children:[i.jsxs("div",{children:[i.jsx("label",{style:kl,children:"Monitored Channels"}),i.jsx("div",{style:Ss,children:"Any channel where the bot is added"})]}),i.jsxs("div",{children:[i.jsx("label",{style:kl,children:"Escalation Owner"}),i.jsx("div",{style:Ss,children:s.name||"Configured user"})]})]}),i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"0.75rem",marginBottom:"0.75rem"},children:[i.jsxs("div",{children:[i.jsx("label",{style:kl,children:"Reply Mode"}),i.jsx("div",{style:Ss,children:"Auto reply"})]}),i.jsxs("div",{children:[i.jsx("label",{style:kl,children:"Shared LLM Provider"}),i.jsxs("div",{style:Ss,children:[Yl,Xt?` · ${Xt}`:""]})]})]}),i.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"0.55rem",marginBottom:"0.9rem",fontSize:"0.82rem",color:"var(--text-secondary)"},children:[i.jsx("input",{type:"checkbox",checked:s.slackGenerationEnabled,onChange:Je=>le({slackGenerationEnabled:Je.target.checked},{invalidateValidation:!0})}),"Enable real-time draft generation"]}),i.jsxs("div",{style:{background:"var(--bg-inset)",border:"1px solid var(--border)",borderRadius:"var(--radius-sm)",padding:"0.9rem",marginBottom:"0.9rem"},children:[i.jsx("div",{style:{color:"var(--text-primary)",fontSize:"0.82rem",fontWeight:600,marginBottom:"0.35rem"},children:"LLM dependency"}),i.jsxs("div",{style:{color:"var(--text-secondary)",fontSize:"0.8rem",lineHeight:1.7},children:["Slack draft generation reuses the shared provider settings from the standalone ",Ae("LLM Providers")," card above. Configure the preferred provider and API keys there before validating Slack."]})]})]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"1rem"},children:[i.jsxs("div",{style:{fontSize:"0.82rem",flex:1},children:[I==="idle"&&i.jsx("span",{style:{color:"var(--text-dim)"},children:"Enter credentials and validate to connect"}),I==="validating"&&i.jsxs("span",{style:{color:"var(--pac-yellow)",display:"flex",alignItems:"center",gap:"0.5rem"},children:[i.jsxs("span",{className:"validation-dots",children:[i.jsx("span",{className:"pac-trail-dot",style:{width:5,height:5}}),i.jsx("span",{className:"pac-trail-dot",style:{width:5,height:5}}),i.jsx("span",{className:"pac-trail-dot",style:{width:5,height:5}})]}),ie||"Validating credentials..."]}),I==="valid"&&i.jsxs("span",{style:{color:"var(--success)"},children:[ie,m.id==="slack"&&ma()?` · ${ma()}`:""]}),I==="invalid"&&i.jsx("span",{style:{color:"var(--error)"},children:ie})]}),i.jsxs("div",{style:{display:"flex",gap:"0.5rem",flexShrink:0},children:[i.jsx("button",{onClick:()=>Ql(m),disabled:!b,style:{...ql,background:b?"var(--pac-yellow-dim)":"var(--bg-inset)",color:b?"var(--pac-yellow)":"var(--text-dim)",borderColor:b?"rgba(255, 215, 0, 0.25)":"var(--border)",cursor:b?"pointer":"not-allowed"},children:I==="validating"?"Validating...":"Validate"}),i.jsx("button",{onClick:()=>qa(m.id),disabled:!we,style:{...ql,background:we?"var(--success-dim)":"var(--bg-inset)",color:we?"var(--success)":"var(--text-dim)",borderColor:we?"rgba(0, 255, 136, 0.25)":"var(--border)",cursor:we?"pointer":"not-allowed",fontWeight:700},children:"Save"})]})]})]})]}),m.id==="github"&&ii,m.id==="github"&&_l]},m.id)})}),i.jsxs("div",{className:"folder-section",children:[i.jsxs("div",{className:"folder-section-title",children:[i.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"var(--pac-yellow)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:i.jsx("path",{d:"M22 19a2 2 0 01-2 2H4a2 2 0 01-2-2V5a2 2 0 012-2h5l2 3h9a2 2 0 012 2z"})}),"Local Context Sources"]}),i.jsx("p",{className:"folder-section-desc",children:"Point Pac-Man at local folders to chomp for context. Tag each folder with a project name — multiple folders can share the same project."}),s.localFolders.length>0&&i.jsx("div",{className:"folder-list",children:s.localFolders.map((m,k)=>i.jsxs("div",{className:"folder-row",children:[i.jsx("input",{type:"text",value:m.path,onChange:_=>at(k,{path:_.target.value}),onBlur:()=>{!m.project.trim()&&m.path.trim()&&at(k,{project:wg(m.path)})},placeholder:"/path/to/folder",style:{background:"var(--bg-inset)"}}),i.jsx("button",{type:"button",className:"btn-browse",onClick:()=>At(k),disabled:J===k,children:J===k?"Opening...":"Browse"}),i.jsx("input",{type:"text",value:m.project,onChange:_=>at(k,{project:_.target.value}),placeholder:"Project tag",list:"project-suggestions",style:{background:"var(--bg-inset)"}}),i.jsx("button",{type:"button",className:"btn-remove",onClick:()=>Bt(k),title:"Remove",children:"×"})]},k))}),Al.length>0&&i.jsx("datalist",{id:"project-suggestions",children:Al.map(m=>i.jsx("option",{value:m},m))}),i.jsx("button",{type:"button",className:"btn-add-folder",onClick:al,children:"+ Add Folder"}),J!==null&&!ae&&i.jsx("span",{className:"field-hint",style:{marginTop:"0.75rem"},children:"Opening your file manager. The native folder picker can take a moment to appear the first time."}),ae&&i.jsx("p",{style:{color:"var(--error)",fontSize:"0.78rem",marginTop:"0.75rem"},children:ae})]}),i.jsxs("div",{className:"btn-group",children:[i.jsx("button",{className:"btn-secondary",onClick:d,children:"Back"}),i.jsx("button",{className:"btn-primary",onClick:x,children:"Continue"})]})]})}const Rg={background:"none",border:"1px solid var(--border)",borderRadius:6,padding:"5px 12px",color:"var(--text-dim)",fontSize:"0.78rem",cursor:"pointer",fontWeight:500},Go={border:"1px solid",borderRadius:6,padding:"5px 14px",fontSize:"0.8rem",fontWeight:600,cursor:"pointer",transition:"all 0.15s"},ql={border:"1px solid",borderRadius:6,padding:"6px 16px",fontSize:"0.8rem",fontWeight:600,transition:"all 0.15s"},kl={display:"block",fontSize:"0.78rem",color:"var(--text-muted)",marginBottom:"0.3rem",fontWeight:500},ti={marginBottom:0,fontSize:"0.83rem",padding:"0.6rem 0.75rem",background:"var(--bg-inset)",borderColor:"var(--border)"},Op={width:"100%",fontSize:"0.83rem",padding:"0.6rem 0.75rem",background:"var(--bg-inset)",color:"var(--text-primary)",border:"1px solid var(--border)",borderRadius:8},Ss={width:"100%",fontSize:"0.83rem",padding:"0.6rem 0.75rem",background:"var(--bg-inset)",color:"var(--text-primary)",border:"1px solid var(--border)",borderRadius:8,minHeight:40,display:"flex",alignItems:"center"},Ha={minWidth:180,flex:"1 1 180px",background:"var(--bg-surface)",border:"1px solid var(--border)",borderRadius:8,padding:"0.7rem 0.85rem",display:"flex",flexDirection:"column",gap:"0.2rem"},La={color:"var(--text-dim)",fontSize:"0.72rem",textTransform:"uppercase",letterSpacing:"0.06em"},Bg={display:"inline-flex",alignItems:"center",padding:"0.2rem 0.55rem",borderRadius:999,background:"rgba(66, 133, 244, 0.12)",border:"1px solid rgba(66, 133, 244, 0.2)",color:"#9ec3ff",fontSize:"0.74rem"},Ug={display:"inline-flex",alignItems:"center",padding:"0.2rem 0.55rem",borderRadius:999,background:"var(--bg-elevated)",border:"1px solid var(--border)",color:"var(--text-secondary)",fontSize:"0.74rem"},zp={marginTop:"1rem",background:"var(--bg-surface)",border:"1px solid var(--border)",borderRadius:"var(--radius-sm)",padding:"0.85rem"},Mp={margin:0,whiteSpace:"pre-wrap",wordBreak:"break-word",maxHeight:280,overflow:"auto",fontSize:"0.74rem",lineHeight:1.6,fontFamily:"var(--font-mono)",color:"var(--text-secondary)"};let Vg=!1,mn=null;function kp(){Zg()}function Zg(){return Vg?Promise.resolve(!0):mn||(mn=new Promise(s=>{if(document.querySelector('script[src*="apis.google.com/js/api.js"]')){Hg(s);return}const f=document.createElement("script");f.src="https://apis.google.com/js/api.js",f.async=!0,f.defer=!0,f.onload=()=>Hg(s),f.onerror=()=>{mn=null,s(!1)},document.head.appendChild(f)}),mn)}function Hg(s){const f=window;if(!f.gapi){mn=null,s(!1);return}f.gapi.load("picker",{callback:()=>{Vg=!0,s(!0)},onerror:()=>{mn=null,s(!1)}})}async function Gp(s){if(!await Zg())return null;const d=window.google;return d!=null&&d.picker?new Promise(N=>{try{const H=new d.picker.DocsView(d.picker.ViewId.DOCS).setSelectFolderEnabled(!0).setIncludeFolders(!0);new d.picker.PickerBuilder().addView(H).setOAuthToken(s).enableFeature(d.picker.Feature.MULTISELECT_ENABLED).setTitle("Select Google Drive folders").setCallback(Q=>{if(Q.action===d.picker.Action.PICKED){const U=(Q.docs??[]).map(T=>({id:T.id,name:T.name??T.id}));N(U)}else Q.action===d.picker.Action.CANCEL&&N([])}).build().setVisible(!0)}catch{N(null)}}):null}const Ns="projects",_o="root",wo="My Drive",ni={gmail:"Gmail",gdrive:"GDocs",storage:"GDrive"},Lt={github:"GitHub",gitlab:"GitLab",slack:"Slack","google-drive-storage":"GDrive",gdrive:"GDocs",gmail:"Gmail"},_p=["github","gitlab","slack","google-drive-storage","gdrive","gmail"];function wp(s){const f=s.trim();return f?f==="Github"||f==="github"?Lt.github:f==="Gitlab"||f==="gitlab"?Lt.gitlab:f==="slack"?Lt.slack:f==="gmail"?Lt.gmail:f==="gdrive"||f==="Google Docs"||f==="GDocs"?Lt.gdrive:f==="google-drive-storage"||f===ni.storage||f==="Google Drive Storage"||f==="Google Drive / Docs"?Lt["google-drive-storage"]:f:""}function Rp(s){return s==="google-drive-storage"?ni.storage:s==="gdrive"?ni.gdrive:s in Lt?Lt[s]:Lo(s)}function Ho(s){return s.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function Lo(s){return s.replace(/[-_]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,f=>f.toUpperCase())}function it(s){return[...new Set(s.map(f=>f.trim()).filter(Boolean))]}function Ve(s){return`${Ns}/${s.slug}/project.md`}function Pt(s){return`${Ns}/${s.slug}`}function Lg(s){return[`# ${s.name}`,"","## Summary","",s.summary||"<!-- Add a short summary for this project -->","","## Primary Focus","",s.primaryFocus||"<!-- Capture the main problem area, domain, or ownership -->","","## Sources","",[...s.sourceFolders,...s.gdriveFolders,...s.gdocDocuments].length>0?[...s.sourceFolders,...s.gdriveFolders,...s.gdocDocuments].map(f=>`- \`${f}\``).join(`
65
+ `):"- No source folders linked to this project yet.","","## Connected Integrations","",s.connectedIntegrations.length>0?s.connectedIntegrations.map(f=>`- ${f}`).join(`
66
+ `):"- No integrations connected during onboarding.","","## Source Monitoring","","### GitHub Branches","",s.githubBranches.length>0?s.githubBranches.map(f=>`- ${f}`).join(`
67
+ `):"- No GitHub branches scoped yet.","","### GitLab Branches","",s.gitlabBranches.length>0?s.gitlabBranches.map(f=>`- ${f}`).join(`
68
+ `):"- No GitLab branches scoped yet.","","### Slack Channels","",s.slackChannels.length>0?s.slackChannels.map(f=>`- ${f}`).join(`
69
+ `):"- No Slack channels scoped yet.","","### Google Drive Folders","",s.gdriveFolders.length>0?s.gdriveFolders.map(f=>`- \`${f}\``).join(`
70
+ `):"- No Google Drive folders scoped yet.","","### Google Docs","",s.gdocDocuments.length>0?s.gdocDocuments.map(f=>`- \`${f}\``).join(`
71
+ `):"- No Google Docs scoped yet.","","## Grouping Signals","",s.keySignals.length>0?s.keySignals.map(f=>`- ${f}`).join(`
72
+ `):"- Add more details after the first sync.","","## Project Context Files","",s.templateFiles.length>0?s.templateFiles.map(f=>`- \`${f}\``).join(`
73
+ `):"- No project context files linked yet.","","## Instructions For LLM","",s.llmInstructions||"<!-- Add project-specific instructions that the LLM should follow -->","","## Notes To Confirm","","- Owners:","- Key repos/docs:","- Important decisions:",""].join(`
74
+ `)}function js(s){const f=new Set;return s.map((x,d)=>{var Q;const N=Ho(x.slug||x.name)||`project-${d+1}`;let H=N,F=2;for(;f.has(H);)H=`${N}-${F}`,F+=1;return f.add(H),{slug:H,name:((Q=x.name)==null?void 0:Q.trim())||Lo(H),summary:x.summary??"",primaryFocus:x.primaryFocus??"",sourceFolders:it(x.sourceFolders??[]),connectedIntegrations:it((x.connectedIntegrations??[]).map(U=>wp(U)).filter(Boolean)),githubBranches:it(x.githubBranches??[]),gitlabBranches:it(x.gitlabBranches??[]),slackChannels:it(x.slackChannels??[]),gdriveFolders:it(x.gdriveFolders??[]),gdocDocuments:it(x.gdocDocuments??[]),keySignals:it(x.keySignals??[]),llmInstructions:x.llmInstructions??"",templateFiles:it(x.templateFiles??[]).filter(U=>U!==Ve({slug:H}))}})}function Bp(s,f){const x=new Map(f.map(d=>[d.slug,d]));return s.map(d=>{const N=x.get(d.slug);return N?{...d,name:N.name||d.name,summary:N.summary||d.summary,primaryFocus:N.primaryFocus||d.primaryFocus,sourceFolders:it([...d.sourceFolders,...N.sourceFolders]),connectedIntegrations:it(N.connectedIntegrations),githubBranches:it(N.githubBranches),gitlabBranches:it(N.gitlabBranches),slackChannels:it(N.slackChannels),gdriveFolders:it([...d.gdriveFolders,...N.gdriveFolders]),gdocDocuments:it(N.gdocDocuments),keySignals:it([...d.keySignals,...N.keySignals]),llmInstructions:N.llmInstructions||d.llmInstructions,templateFiles:it(N.templateFiles)}:d})}function Up(s){const f=`New Project ${s}`;return{slug:Ho(f),name:f,summary:"",primaryFocus:"",sourceFolders:[],connectedIntegrations:[],githubBranches:[],gitlabBranches:[],slackChannels:[],gdriveFolders:[],gdocDocuments:[],keySignals:["Created manually during onboarding"],llmInstructions:"",templateFiles:[]}}function Hp(s,f){var N;const x=((N=f.split("/").pop())==null?void 0:N.replace(/\.[^.]+$/,""))??"notes";return`# ${`${s.name} - ${Lo(x.replace(`${s.slug}-`,""))}`}
75
+
76
+ `}function Fg(s){return s.endsWith(".md")?"M":s.endsWith(".json")?"J":s.endsWith(".yaml")||s.endsWith(".yml")?"Y":"F"}function Lp({projectName:s}){const[f,x]=R.useState(0),[d,N]=R.useState(new Set),H=R.useMemo(()=>[{id:"project",label:s.length>12?s.slice(0,10)+"..":s,x:140,y:30},{id:"sources",label:"Sources",x:50,y:80},{id:"integrations",label:"Integrations",x:230,y:80},{id:"signals",label:"Signals",x:80,y:140},{id:"schema",label:"Schema",x:200,y:140},{id:"knowledge",label:"Knowledge",x:140,y:180}],[s]),F=R.useMemo(()=>[{from:"project",to:"sources"},{from:"project",to:"integrations"},{from:"sources",to:"signals"},{from:"integrations",to:"schema"},{from:"signals",to:"knowledge"},{from:"schema",to:"knowledge"}],[]);R.useEffect(()=>{const T=setInterval(()=>{x(J=>{const X=(J+1)%H.length;return N(ae=>{const de=new Set(ae);return de.add(J),de}),X})},800);return()=>clearInterval(T)},[H.length]);const Q=new Map(H.map((T,J)=>[T.id,{...T,index:J}])),U=["Analyzing project structure...","Scanning source folders...","Mapping integrations...","Extracting signals...","Building context files...","Generating knowledge graph..."];return i.jsxs("div",{className:"kg-loader",children:[i.jsx("div",{className:"kg-loader-graph",children:i.jsxs("svg",{viewBox:"0 0 280 200",children:[F.map((T,J)=>{const X=Q.get(T.from),ae=Q.get(T.to),de=f===ae.index||f===X.index;return i.jsx("line",{className:`kg-edge ${de?"active":""}`,x1:X.x,y1:X.y,x2:ae.x,y2:ae.y,style:{animationDelay:`${J*.2}s`}},J)}),H.map((T,J)=>{const X=f===J,ae=d.has(J);return i.jsxs("g",{className:`kg-node ${X?"active":ae?"built":""}`,style:{animationDelay:`${J*.15}s`},children:[i.jsx("circle",{cx:T.x,cy:T.y,r:J===0?18:15}),i.jsx("text",{x:T.x,y:T.y,children:T.label})]},T.id)})]})}),i.jsxs("div",{className:"kg-loader-status",children:[i.jsx("div",{className:"kg-loader-title kg-pulse",children:"Building Knowledge Graph"}),i.jsx("div",{className:"kg-loader-detail",children:U[f%U.length]})]})]})}function Fp(s){const f=s.split("/");return f[f.length-1]}function qp({state:s,update:f,onNext:x,onPrev:d}){var di,Nn,fc,gc,Ka,hl,Tn,An;const N=R.useMemo(()=>js(s.inferredProjects??[]),[s.inferredProjects]),H=R.useMemo(()=>s.templateFiles??{},[s.templateFiles]),[F,Q]=R.useState(H),[U,T]=R.useState(N),[J,X]=R.useState(()=>Object.keys(H)[0]??(N[0]?Ve(N[0]):"")),[ae,de]=R.useState(()=>{var o;return((o=N[0])==null?void 0:o.slug)??""}),[Ee,De]=R.useState(!0),[Oe,je]=R.useState(""),[ce,fe]=R.useState(null),[Ce,Ze]=R.useState(""),[ge,V]=R.useState(new Set),[Ue,me]=R.useState(new Set),[ct,st]=R.useState("idle"),[ut,Ie]=R.useState(""),[yt,gt]=R.useState("local"),[C,L]=R.useState([]),[W,ne]=R.useState([]),[ye,h]=R.useState([]),[z,q]=R.useState([]),[K,le]=R.useState(!1),[se,he]=R.useState([]),[mt,Ke]=R.useState({}),[He,el]=R.useState(!1),[ga,tl]=R.useState(""),[lt,Dt]=R.useState({slack:!1,github:!1,gitlab:!1,gdocs:!1}),[ze,Yt]=R.useState({slack:!1,github:!1,gitlab:!1,gdocs:!1}),[ht,rt]=R.useState({slack:"",github:"",gitlab:"",gdocs:"",local:""}),[Tl,Yl]=R.useState(!1),[Xt,Xl]=R.useState({}),bt=R.useRef(null),pn=R.useRef(s.deletedProjectSlugs),[fl,ll]=R.useState(()=>Object.keys(H)[0]??(N[0]?Ve(N[0]):"")),Ql=R.useMemo(()=>{const o=new Map,v=s.integrations.includes("google-drive-storage")||!!s.gdriveFolderId.trim()||s.googleDriveFolders.length>0,D=s.integrations.includes("gmail"),B=s.integrations.includes("gdrive");for(const Z of s.integrations)o.set(Z,{id:Z,label:Rp(Z)});return v&&o.set("google-drive-storage",{id:"google-drive-storage",label:ni.storage}),B&&o.set("gdrive",{id:"gdrive",label:ni.gdrive}),D&&o.set("gmail",{id:"gmail",label:ni.gmail}),[...o.values()]},[s.gdriveFolderId,s.googleDriveFolders.length,s.integrations]),Fa=R.useMemo(()=>s.localFolders.filter(o=>o.path.trim()).map(o=>{var v;return{path:o.path,label:(v=o.project)!=null&&v.trim()?`${o.project.trim()} — ${o.path}`:o.path}}),[s.localFolders]),ma=R.useMemo(()=>Ql,[Ql]),qa=R.useMemo(()=>{const o=new Map(_p.map((v,D)=>[v,D]));return[...ma].sort((v,D)=>(o.get(v.id)??999)-(o.get(D.id)??999))},[ma]),Rt=R.useMemo(()=>new Map(qa.map(o=>[o.id,o])),[qa]),al=((Nn=(di=s.integrationCredentials.slack)==null?void 0:di.botToken)==null?void 0:Nn.trim())??"",at=((gc=(fc=s.integrationCredentials.github)==null?void 0:fc.token)==null?void 0:gc.trim())??"",Bt=((hl=(Ka=s.integrationCredentials.gitlab)==null?void 0:Ka.token)==null?void 0:hl.trim())??"",At=((An=(Tn=s.integrationCredentials.gitlab)==null?void 0:Tn.baseUrl)==null?void 0:An.trim())??"",Al=se[se.length-1]??null,Ya=(Al==null?void 0:Al.id)??_o,ii=(Al==null?void 0:Al.path)??wo,_l=!!s.googleRefreshToken.trim()&&Gl(s.googleGrantedScopes,["storage"]),m=s.slackDefaultProvider==="openai"&&s.openAIApiKey.trim()?{type:"openai",apiKey:s.openAIApiKey.trim(),model:s.openAIModel.trim()||"gpt-4.1-mini"}:s.slackDefaultProvider==="anthropic"&&s.anthropicApiKey.trim()?{type:"anthropic",apiKey:s.anthropicApiKey.trim(),model:s.anthropicModel.trim()||"claude-3-7-sonnet-latest"}:s.openAIApiKey.trim()?{type:"openai",apiKey:s.openAIApiKey.trim(),model:s.openAIModel.trim()||"gpt-4.1-mini"}:s.anthropicApiKey.trim()?{type:"anthropic",apiKey:s.anthropicApiKey.trim(),model:s.anthropicModel.trim()||"claude-3-7-sonnet-latest"}:null,k=(m==null?void 0:m.type)==="openai"?`OpenAI ${m.model}`:(m==null?void 0:m.type)==="anthropic"?`Claude / Anthropic ${m.model}`:"",_=o=>o.split(`
77
+ `).length,I=(o,v,D)=>{const B={...o},Z=new Set(v.map(w=>Ve(w))),Y=new Set(D.map(w=>Ve(w)));for(const w of Z)Y.has(w)||delete B[w];for(const w of D)B[Ve(w)]=Lg(w);return B},ie=(o,v)=>{var Y;const D=js(o),B=((v==null?void 0:v.deletedProjectSlugs)??s.deletedProjectSlugs).filter(w=>!D.some(Ne=>Ne.slug===w)),Z=I((v==null?void 0:v.baseFiles)??F,(v==null?void 0:v.previousProjects)??U,D);if(T(D),Q(Z),f({inferredProjects:D,templateFiles:Z,deletedProjectSlugs:B}),(v==null?void 0:v.nextActiveProjectSlug)!==void 0?de(v.nextActiveProjectSlug):D.some(w=>w.slug===ae)||de(((Y=D[0])==null?void 0:Y.slug)??""),(v==null?void 0:v.nextActiveFile)!==void 0)X(v.nextActiveFile);else if(J&&Z[J]===void 0){const w=D.find(Ne=>Ne.slug===ae);X(w?Ve(w):Object.keys(Z)[0]??"")}if((v==null?void 0:v.nextWorkspaceActiveFile)!==void 0)ll(v.nextWorkspaceActiveFile);else if(fl&&Z[fl]===void 0){const w=D.find(Ne=>Ne.slug===ae);ll(w?Ve(w):Object.keys(Z)[0]??"")}};R.useEffect(()=>{let o=!1;return De(!0),je(""),(async()=>{try{const{res:v,data:D}=await zt("/api/project-structure-preview",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({profileType:s.profileType,name:s.name,assistantName:s.assistantName,responsibilities:s.responsibilities,localFolders:s.localFolders,driveFolders:s.googleDriveFolders,integrations:s.integrations})}),B=D;if(!v.ok)throw new Error(B.error??"Failed to load project structure preview");if(o)return;const Z=js(B.projects??[]).filter(Xe=>!pn.current.includes(Xe.slug)),Y=js(Bp(Z,U.length>0?U:N)),w=I(B.files??{},[],Y),Ne=Object.keys(w),Te=Y[0];T(Y),Q(w),f({templateFiles:w,inferredProjects:Y,projectInference:B.inference??null}),me(new Set),de((Te==null?void 0:Te.slug)??""),X(Xe=>Xe&&w[Xe]!==void 0?Xe:Te?Ve(Te):Ne[0]??""),ll(Xe=>Xe&&w[Xe]!==void 0?Xe:Te?Ve(Te):Ne[0]??"");const Et=new Set;for(const Xe of Ne){const nl=Xe.indexOf("/");nl!==-1&&Et.add(Xe.substring(0,nl))}V(Et)}catch(v){o||je(v instanceof Error?v.message:"Failed to load project structure preview")}finally{o||De(!1)}})(),()=>{o=!0}},[s.profileType,s.name,s.assistantName,s.responsibilities,s.localFolders,s.googleDriveFolders,s.integrations]),R.useEffect(()=>{ce&&bt.current&&bt.current.focus()},[ce]);const b=U.find(o=>o.slug===ae)??U[0]??null;R.useEffect(()=>{L([]),Dt(o=>({...o,slack:!1})),rt(o=>({...o,slack:""}))},[al]),R.useEffect(()=>{ne([]),Dt(o=>({...o,github:!1})),rt(o=>({...o,github:""}))},[at]),R.useEffect(()=>{h([]),Dt(o=>({...o,gitlab:!1})),rt(o=>({...o,gitlab:""}))},[Bt,At]),R.useEffect(()=>{q([]),Dt(o=>({...o,gdocs:!1})),rt(o=>({...o,gdocs:""}))},[s.googleDriveFolders,s.googleGrantedScopes,s.googleRefreshToken]),R.useEffect(()=>{b!=null&&b.connectedIntegrations.includes(Lt.slack)&&al&&!lt.slack&&!ze.slack&&yn()},[b,al,lt.slack,ze.slack]),R.useEffect(()=>{b!=null&&b.connectedIntegrations.includes(Lt.github)&&at&&!lt.github&&!ze.github&&Dl()},[b,at,lt.github,ze.github]),R.useEffect(()=>{b!=null&&b.connectedIntegrations.includes(Lt.gitlab)&&Bt&&!lt.gitlab&&!ze.gitlab&&Vt()},[b,Bt,At,lt.gitlab,ze.gitlab]),R.useEffect(()=>{b!=null&&b.connectedIntegrations.includes(Lt.gdrive)&&s.googleRefreshToken.trim()&&Gl(s.googleGrantedScopes,["gdrive"])&&!lt.gdocs&&!ze.gdocs&&sc()},[b,s.googleGrantedScopes,s.googleRefreshToken,lt.gdocs,ze.gdocs]),R.useEffect(()=>{pn.current=s.deletedProjectSlugs},[s.deletedProjectSlugs]),R.useEffect(()=>{_l&&kp()},[_l]),R.useEffect(()=>{gt("local")},[ae]),R.useEffect(()=>{b&&V(o=>new Set(o).add(Pt(b)))},[b==null?void 0:b.slug]),R.useEffect(()=>{le(!1),he([]),Ke({}),tl("")},[ae]);const we=b?Ve(b):"",Vl=o=>U.some(v=>Ve(v)===o),Je=(o,v)=>o===Ve(v)||o.startsWith(`${Pt(v)}/`),Zl=o=>U.find(v=>Je(o,v)),wl=o=>{X(o),ll(o);const v=Zl(o);v&&de(v.slug)},Mt=o=>{ll(o);const v=Zl(o);v&&de(v.slug)},ci=(o,v)=>{if(Vl(o))return;const D={...F,[o]:v};Q(D),f({templateFiles:D})},Xa=(()=>{const o={subfolders:new Map,files:[]},v=D=>{const B=D.split("/");let Z=o;for(const Y of B)Z.subfolders.has(Y)||Z.subfolders.set(Y,{subfolders:new Map,files:[]}),Z=Z.subfolders.get(Y);return Z};for(const D of Object.keys(F).sort()){const B=D.lastIndexOf("/");if(B===-1)o.files.push(D);else{const Z=D.substring(0,B);v(Z).files.push(D)}}for(const D of Ue)v(D);return o})(),ac=(o,v)=>{if(!v)return o;let D=o;for(const B of v.split("/"))if(D=D==null?void 0:D.subfolders.get(B),!D)return null;return D},Kl=b?Pt(b):"",El=b?ac(Xa,Kl):null,$e=b&&J&&Je(J,b)?J:we,Pe=fl&&F[fl]!==void 0?fl:we||Object.keys(F)[0]||"",Rl=$e?Vl($e):!1,Qa=Pe?Vl(Pe):!1,Ts=o=>{V(v=>{const D=new Set(v);return D.has(o)?D.delete(o):D.add(o),D})},Ut=(o,v)=>{if(!b)return;st("idle"),Ie("");const D={[o]:v};if(o==="name"&&typeof v=="string"){const Y=Ho(v);Y&&(D.slug=Y)}const B=U.map(Y=>Y.slug===b.slug?{...Y,...D}:Y),Z=D.slug??b.slug;ie(B,{nextActiveProjectSlug:Z,nextActiveFile:Ve({slug:Z}),nextWorkspaceActiveFile:Ve({slug:Z})})},Bl=(o,v,D)=>{if(!b)return;const B=b[o],Z=D?it([...B,v]):B.filter(Y=>Y!==v);Ut(o,Z)},Va=()=>{const o=Up(U.length+1),v=[...U,o];ie(v,{nextActiveProjectSlug:o.slug,nextActiveFile:Ve(o),nextWorkspaceActiveFile:Ve(o)}),V(D=>new Set(D).add(Pt(o)).add(Ns)),st("idle"),Ie("")},vn=o=>{const v=U.find(w=>w.slug===o);if(!v)return;const D=U.filter(w=>w.slug!==o),B={...F};delete B[Ve(v)];for(const w of Object.keys(B))w.startsWith(`${Pt(v)}/`)&&delete B[w];me(w=>{const Ne=new Set(w);return Ne.delete(Pt(v)),Ne});const Z=it([...s.deletedProjectSlugs,o]),Y=D[0]??null;ie(D,{baseFiles:B,nextActiveProjectSlug:(Y==null?void 0:Y.slug)??"",nextActiveFile:Y?Ve(Y):Object.keys(B)[0]??"",nextWorkspaceActiveFile:Y?Ve(Y):Object.keys(B)[0]??"",deletedProjectSlugs:Z}),st("idle"),Ie(""),zt("/api/delete-project",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({slug:o,allProjects:D})})},Jl=()=>{const o=Ce.trim();if(!o||!ce){fe(null),Ze("");return}if(ce.type==="folder"){const v=o.replace(/[/\\]/g,"");if(!v)return;const D=ce.parent?`${ce.parent}/${v}`:v;me(B=>new Set(B).add(D)),V(B=>new Set(B).add(D)),ce.parent&&V(B=>new Set(B).add(ce.parent))}else{const v=o.includes(".")?o:`${o}.md`,D=ce.parent?`${ce.parent}/${v}`:v;if(F[D]!==void 0)wl(D);else{const B=v.replace(/\.\w+$/,"").replace(/[-_]/g," "),Z=B.charAt(0).toUpperCase()+B.slice(1),Y={...F,[D]:`# ${Z}
78
+
79
+ `};Q(Y),f({templateFiles:Y}),wl(D),ce.parent&&(me(w=>{const Ne=new Set(w);return Ne.delete(ce.parent),Ne}),V(w=>new Set(w).add(ce.parent)))}}fe(null),Ze("")},ha=(o,v)=>{v.stopPropagation();const D=U.find(Y=>Ve(Y)===o);if(D){vn(D.slug);return}const B={...F};delete B[o];const Z=U.map(Y=>({...Y,templateFiles:Y.templateFiles.filter(w=>w!==o)}));if(Q(B),T(Z),f({templateFiles:B,inferredProjects:Z}),J===o){const Y=Object.keys(B);X(Y.length>0?Y[0]:"")}if(fl===o){const Y=Object.keys(B);ll(Y.length>0?Y[0]:"")}},Za=(o,v)=>{var Y;v.stopPropagation();const D={...F},B=Object.keys(D).filter(w=>w.startsWith(`${o}/`));for(const w of B)delete D[w];const Z=U.filter(w=>!B.includes(Ve(w))).map(w=>({...w,templateFiles:w.templateFiles.filter(Ne=>!B.includes(Ne))}));if(Q(D),T(Z),f({templateFiles:D,inferredProjects:Z}),me(w=>{const Ne=new Set(w);return Ne.delete(o),Ne}),J.startsWith(`${o}/`)){const w=Object.keys(D);X(w.length>0?w[0]:"")}if(fl.startsWith(`${o}/`)){const w=Object.keys(D);ll(w.length>0?w[0]:"")}Z.some(w=>w.slug===ae)||de(((Y=Z[0])==null?void 0:Y.slug)??"")},pa=async()=>{if(b){st("building"),Ie("");try{const o={},v=Ve(b);o[v]=F[v]??Lg(b);for(const Te of b.templateFiles)o[Te]=F[Te]??Hp(b,Te);for(const[Te,Et]of Object.entries(F))Te.startsWith(`${Pt(b)}/`)&&!o[Te]&&(o[Te]=Et);const{res:D,data:B}=await zt("/api/build-project-knowledge",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project:b,files:o,localFolders:s.localFolders,driveFolders:s.googleDriveFolders,provider:m??void 0,userProfile:{name:s.name,email:s.email,assistantName:s.assistantName,profileType:s.profileType,responsibilities:s.responsibilities},integrations:s.integrations})}),Z=B;if(!D.ok||!Z.files)throw new Error(Z.error??"Failed to build the project knowledge graph.");const Y={...F,...Z.files},w=Object.keys(Z.files).filter(Te=>Te.startsWith(`${Pt(b)}/`)&&Te!==v&&!b.templateFiles.includes(Te)),Ne=U.map(Te=>Te.slug===b.slug?{...Te,templateFiles:it([...Te.templateFiles,...w])}:Te);T(Ne),Q(Y),f({inferredProjects:Ne,templateFiles:Y}),st("built"),Ie(Z.message??`Knowledge graph built for ${b.name}. ${Object.keys(Z.files).length} files generated under ${b.slug}/.`),V(Te=>{const Et=new Set(Te);return Et.add(Ns),Et.add(Pt(b)),Et})}catch(o){st("error"),Ie(o instanceof Error?o.message:"Failed to build the project knowledge graph.")}}},xt=async o=>{Xl(v=>({...v,[o.slug]:"saving"}));try{const v={};for(const[B,Z]of Object.entries(F))(B===Ve(o)||B.startsWith(`${Pt(o)}/`))&&(v[B]=Z);const{res:D}=await zt("/api/save-project",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project:o,templateFiles:v,allProjects:U})});if(!D.ok)throw new Error("Save failed");Xl(B=>({...B,[o.slug]:"saved"})),setTimeout(()=>{Xl(B=>({...B,[o.slug]:"idle"}))},2e3)}catch{Xl(v=>({...v,[o.slug]:"error"})),setTimeout(()=>{Xl(v=>({...v,[o.slug]:"idle"}))},3e3)}},nc=o=>{o.key==="Enter"?(o.preventDefault(),Jl()):o.key==="Escape"&&(fe(null),Ze(""))},si=()=>i.jsxs("div",{className:"template-create-input",children:[(ce==null?void 0:ce.parent)&&i.jsxs("span",{className:"template-create-prefix",children:[ce.parent,"/"]}),i.jsx("input",{ref:bt,type:"text",className:"template-create-field",value:Ce,onChange:o=>Ze(o.target.value),onKeyDown:nc,onBlur:Jl,placeholder:(ce==null?void 0:ce.type)==="folder"?"folder name":"filename.md"})]}),gl=o=>Array.from(o.target.selectedOptions).map(v=>v.value),Cl=(o,v)=>{const D=new Map(o.map(B=>[B.value,B]));for(const B of v)D.has(B)||D.set(B,{value:B,label:B});return[...D.values()]},Qt=(o,v,D=`${v}s`)=>`${o} ${o===1?v:D}`,ic=o=>yt===o,cc=o=>{gt(v=>v===o?null:o)},Ge=o=>(b==null?void 0:b.connectedIntegrations.includes(Lt[o]))??!1,ml=({id:o,title:v,summary:D,badge:B,active:Z=!1,children:Y})=>{const w=ic(o);return i.jsxs("div",{className:`project-source-accordion-item ${w?"open":""}`,children:[i.jsxs("button",{type:"button",className:"project-source-accordion-trigger",onClick:()=>cc(o),"aria-expanded":w,children:[i.jsxs("div",{className:"project-source-accordion-copy",children:[i.jsx("span",{className:"project-source-accordion-title",children:v}),i.jsx("span",{className:"project-source-accordion-summary",children:D})]}),i.jsxs("div",{className:"project-source-accordion-meta",children:[i.jsx("span",{className:`project-source-accordion-badge ${Z?"active":""}`,children:B}),i.jsx("span",{className:"project-source-accordion-chevron",children:w?"▾":"▸"})]})]}),w&&i.jsx("div",{className:"project-source-accordion-panel",children:Y})]})},yn=async()=>{if(al){Yt(o=>({...o,slack:!0})),rt(o=>({...o,slack:""}));try{const{res:o,data:v}=await zt("/api/slack/channels",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({botToken:al})}),D=v;if(!o.ok)throw new Error(D.error??"Failed to load Slack channels.");L(D.options??[]),Dt(B=>({...B,slack:!0}))}catch(o){rt(v=>({...v,slack:o instanceof Error?o.message:"Failed to load Slack channels."})),Dt(v=>({...v,slack:!0}))}finally{Yt(o=>({...o,slack:!1}))}}},Dl=async()=>{if(at){Yt(o=>({...o,github:!0})),rt(o=>({...o,github:""}));try{const{res:o,data:v}=await zt("/api/github/branches",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:at})}),D=v;if(!o.ok)throw new Error(D.error??"Failed to load GitHub branches.");ne(D.options??[]),Dt(B=>({...B,github:!0}))}catch(o){rt(v=>({...v,github:o instanceof Error?o.message:"Failed to load GitHub branches."})),Dt(v=>({...v,github:!0}))}finally{Yt(o=>({...o,github:!1}))}}},Vt=async()=>{if(Bt){Yt(o=>({...o,gitlab:!0})),rt(o=>({...o,gitlab:""}));try{const{res:o,data:v}=await zt("/api/gitlab/branches",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:Bt,baseUrl:At})}),D=v;if(!o.ok)throw new Error(D.error??"Failed to load GitLab branches.");h(D.options??[]),Dt(B=>({...B,gitlab:!0}))}catch(o){rt(v=>({...v,gitlab:o instanceof Error?o.message:"Failed to load GitLab branches."})),Dt(v=>({...v,gitlab:!0}))}finally{Yt(o=>({...o,gitlab:!1}))}}},sc=async()=>{Yt(o=>({...o,gdocs:!0})),rt(o=>({...o,gdocs:""}));try{const{res:o,data:v}=await zt("/api/google/documents",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({clientId:s.googleClientId.trim(),clientSecret:s.googleClientSecret.trim(),refreshToken:s.googleRefreshToken.trim(),grantedScopes:s.googleGrantedScopes,folders:s.googleDriveFolders.map(B=>({id:B.id,path:B.path}))})}),D=v;if(!o.ok)throw new Error(D.error??"Failed to load Google Docs.");q(D.options??[]),Dt(B=>({...B,gdocs:!0}))}catch(o){rt(v=>({...v,gdocs:o instanceof Error?o.message:"Failed to load Google Docs."})),Dt(v=>({...v,gdocs:!0}))}finally{Yt(o=>({...o,gdocs:!1}))}},rc=async(o,v)=>{if(!mt[o]){el(!0),tl("");try{const{res:D,data:B}=await zt("/api/google/drive-folders",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({parentId:o,clientId:s.googleClientId.trim(),clientSecret:s.googleClientSecret.trim(),refreshToken:s.googleRefreshToken.trim(),grantedScopes:s.googleGrantedScopes})}),Z=B;if(!D.ok)throw new Error(Z.error??"Failed to load Google Drive folders.");const Y=(Z.folders??[]).filter(w=>!!(w.id&&w.name)).map(w=>({id:w.id,name:w.name,path:o===_o?`${wo} / ${w.name}`:`${v} / ${w.name}`}));Ke(w=>({...w,[o]:Y}))}catch(D){tl(D instanceof Error?D.message:"Failed to load Google Drive folders.")}finally{el(!1)}}},bn=async()=>{le(!0),he([]),await rc(_o,wo)},oc=async()=>{try{const{res:o,data:v}=await zt("/api/google/access-token",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({clientId:s.googleClientId.trim(),clientSecret:s.googleClientSecret.trim(),refreshToken:s.googleRefreshToken.trim()})}),D=v;return!o.ok||!D.accessToken?null:D.accessToken}catch{return null}},xn=async()=>{if(!b)return;el(!0),tl("");const o=await oc();if(!o){el(!1),await bn();return}const v=await Gp(o);if(el(!1),v===null){await bn();return}if(v.length===0)return;const D=v.map(w=>w.name),B=it([...b.gdriveFolders,...D]),Z=v.filter(w=>!s.googleDriveFolders.some(Ne=>Ne.id===w.id)).map(w=>({id:w.id,name:w.name,path:w.name})),Y=[...s.googleDriveFolders,...Z].sort((w,Ne)=>w.path.localeCompare(Ne.path));f({googleDriveFolders:Y,...s.integrations.includes("google-drive-storage")?{}:{integrations:[...s.integrations,"google-drive-storage"]}}),Ut("gdriveFolders",B)},As=async o=>{he(v=>[...v,o]),await rc(o.id,o.path)},Ft=o=>{if(o<0){he([]);return}he(v=>v.slice(0,o+1))},ri=(o,v)=>{if(!b)return;const D=v?it([...b.gdriveFolders,o.path]):b.gdriveFolders.filter(Y=>Y!==o.path),B=U.some(Y=>Y.slug!==b.slug&&Y.gdriveFolders.includes(o.path)),Z=v?[...s.googleDriveFolders.filter(Y=>Y.id!==o.id),o].sort((Y,w)=>Y.path.localeCompare(w.path)):s.googleDriveFolders.filter(Y=>Y.id!==o.id||B);f({googleDriveFolders:Z,...v&&!s.integrations.includes("google-drive-storage")?{integrations:[...s.integrations,"google-drive-storage"]}:{}}),Ut("gdriveFolders",D)},uc=async()=>{if(b){Yl(!0),rt(o=>({...o,local:""}));try{const{res:o,data:v}=await zt("/api/pick-folder",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({defaultPath:s.localPath,purpose:"local-source"})}),D=v;if(!o.ok)throw new Error(D.error??"Failed to open the local folder picker.");if(D.cancelled||!D.path)return;const B=s.localFolders.some(Z=>Z.path===D.path)?s.localFolders.map(Z=>Z.path===D.path?{...Z,project:Z.project||b.name}:Z):[...s.localFolders,{path:D.path,project:b.name}];f({localFolders:B}),Ut("sourceFolders",it([...b.sourceFolders,D.path]))}catch(o){rt(v=>({...v,local:o instanceof Error?o.message:"Failed to add a local folder."}))}finally{Yl(!1)}}},Sn=b?Cl(W,b.githubBranches):W,$l=b?Cl(ye,b.gitlabBranches):ye,oi=b?Cl(C,b.slackChannels):C,ui=b?Cl(z,b.gdocDocuments):z,Wl=(o,v)=>{const{indented:D=!1,activePath:B=J,onOpen:Z=wl}=v??{},Y=U.find(w=>Ve(w)===o);return i.jsxs("button",{className:`template-file-tab ${B===o?"active":""} ${D?"indented":""}`,onClick:()=>Z(o),title:o,children:[i.jsx("span",{className:`template-file-icon icon-${Fg(o).toLowerCase()}`,children:Fg(o)}),i.jsx("span",{className:"template-file-name",children:Fp(o)}),i.jsxs("span",{className:"template-file-lines",children:[_(F[o]),"L"]}),Y&&i.jsx("span",{className:"template-managed-badge",children:"project"}),i.jsx("span",{className:"template-item-delete",onClick:w=>ha(o,w),title:"Delete file",children:"×"})]},o)},dc=o=>{let v=o.files.length;for(const D of o.subfolders.values())v+=dc(D);return v},jn=(o,v,D,B=0,Z)=>{const{activePath:Y=J,onOpen:w=wl}=Z??{},Ne=ge.has(v),Te=dc(D),Et=D.subfolders.size===0&&D.files.length===0;return i.jsxs("div",{className:"template-folder-group",children:[i.jsxs("div",{className:"template-folder-row",style:B>0?{paddingLeft:`${B*16}px`}:void 0,children:[i.jsxs("button",{className:"template-folder-tab",onClick:()=>Ts(v),children:[i.jsx("span",{className:"template-folder-arrow",children:Ne?"▾":"▸"}),i.jsx("span",{className:"template-file-icon icon-folder",children:i.jsx("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"currentColor",children:i.jsx("path",{d:"M1.75 1A1.75 1.75 0 000 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0016 13.25V4.75A1.75 1.75 0 0014.25 3H7.5a.25.25 0 01-.2-.1l-.9-1.2A1.75 1.75 0 004.98 1H1.75z"})})}),i.jsx("span",{className:"template-file-name",children:o}),i.jsx("span",{className:"template-file-lines",children:Te})]}),i.jsx("span",{className:"template-folder-action template-folder-add",onClick:Xe=>{Xe.stopPropagation(),fe({type:"file",parent:v}),Ze(""),V(nl=>new Set(nl).add(v))},title:`New file in ${v}/`,children:"+"}),i.jsx("span",{className:"template-folder-action template-item-delete",onClick:Xe=>Za(v,Xe),title:"Delete folder",children:"×"})]}),Ne&&i.jsxs("div",{className:"template-folder-children",children:[[...D.subfolders.entries()].sort(([Xe],[nl])=>Xe.localeCompare(nl)).map(([Xe,nl])=>jn(Xe,`${v}/${Xe}`,nl,B+1,{activePath:Y,onOpen:w})),D.files.map(Xe=>Wl(Xe,{indented:!0,activePath:Y,onOpen:w})),(ce==null?void 0:ce.type)==="file"&&ce.parent===v&&si(),Et&&!((ce==null?void 0:ce.type)==="file"&&ce.parent===v)&&i.jsx("div",{className:"template-folder-empty",children:"Empty folder"})]})]},v)};return i.jsxs("div",{className:"step-content",children:[i.jsx("h1",{children:"Project Setup"}),i.jsx("h2",{children:"Define each project’s basics, choose the sources Pac-Man should monitor, keep your LLM instructions, and shape the project folder structure before you finish onboarding."}),s.projectInference&&i.jsxs("div",{className:"project-structure-banner",children:[i.jsx("strong",{children:s.projectInference.strategy==="ollama"?`Local LLM: ${s.projectInference.model??"Ollama"}`:"Local inference"}),i.jsx("span",{children:s.projectInference.note})]}),i.jsxs("div",{className:"project-structure-manager",children:[i.jsxs("div",{className:"project-structure-manager-top",children:[i.jsxs("div",{children:[i.jsx("div",{className:"project-structure-manager-title",children:"Projects"}),i.jsx("div",{className:"project-structure-manager-copy",children:"Create, delete, or refine projects before Pac-Man writes the final workspace templates."})]}),i.jsx("button",{type:"button",className:"btn-secondary project-structure-add-btn",onClick:Va,children:"+ New Project"})]}),U.length>0?i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"project-structure-grid",children:U.map(o=>{const v=Ve(o),D=(b==null?void 0:b.slug)===o.slug,B=o.sourceFolders.length+o.gdriveFolders.length+o.gdocDocuments.length;return i.jsxs("div",{className:`project-structure-card-shell ${D?"active":""}`,children:[i.jsxs("button",{type:"button",className:`project-structure-card ${J===v?"active":""}`,onClick:()=>{de(o.slug),X(v),ll(v)},children:[i.jsxs("div",{className:"project-structure-card-top",children:[i.jsx("strong",{children:o.name}),i.jsxs("span",{children:[B," source",B===1?"":"s"]})]}),i.jsx("p",{children:o.summary||"Add a tighter project summary before finishing onboarding."}),i.jsxs("div",{className:"project-structure-meta",children:[i.jsxs("span",{className:"project-structure-chip",children:[o.connectedIntegrations.length," integration",o.connectedIntegrations.length===1?"":"s"]}),i.jsxs("span",{className:"project-structure-chip muted",children:[o.templateFiles.length," context file",o.templateFiles.length===1?"":"s"]}),o.llmInstructions.trim()&&i.jsx("span",{className:"project-structure-chip muted",children:"LLM instructions"})]})]}),i.jsx("button",{type:"button",className:"project-structure-card-delete",onClick:()=>vn(o.slug),title:`Delete ${o.name}`,children:"×"})]},o.slug)})}),i.jsxs("details",{className:"file-tree-collapsible",children:[i.jsx("summary",{children:"Advanced Workspace Files"}),i.jsx("div",{className:"project-structure-help",style:{marginTop:"0.75rem"},children:"Browse the full workspace template tree here, including every project folder and shared template file."}),i.jsxs("div",{className:"template-preview",style:{marginTop:"0.85rem"},children:[Ee&&i.jsxs("div",{className:"template-loading",children:[i.jsx("div",{className:"template-spinner"}),i.jsx("span",{children:"Generating project structure..."})]}),Oe&&i.jsx("div",{className:"template-error",children:Oe}),!Ee&&!Oe&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"template-sidebar",children:[i.jsxs("div",{className:"template-sidebar-header",children:[i.jsx("span",{children:"All Workspace Files"}),i.jsxs("div",{className:"template-sidebar-actions",children:[i.jsx("button",{className:"template-action-btn",onClick:()=>fe({type:"file",parent:null}),title:"Add context file",children:i.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z"}),i.jsx("polyline",{points:"14 2 14 8 20 8"}),i.jsx("line",{x1:"12",y1:"18",x2:"12",y2:"12"}),i.jsx("line",{x1:"9",y1:"15",x2:"15",y2:"15"})]})}),i.jsx("button",{className:"template-action-btn",onClick:()=>fe({type:"folder",parent:null}),title:"Add folder",children:i.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("path",{d:"M22 19a2 2 0 01-2 2H4a2 2 0 01-2-2V5a2 2 0 012-2h5l2 3h9a2 2 0 012 2z"}),i.jsx("line",{x1:"12",y1:"11",x2:"12",y2:"17"}),i.jsx("line",{x1:"9",y1:"14",x2:"15",y2:"14"})]})})]})]}),[...Xa.subfolders.entries()].sort(([o],[v])=>o.localeCompare(v)).map(([o,v])=>jn(o,o,v,0,{activePath:Pe,onOpen:Mt})),Xa.files.map(o=>Wl(o,{activePath:Pe,onOpen:Mt})),ce&&ce.parent===null&&si()]}),i.jsx("div",{className:"template-editor",children:Pe&&F[Pe]!==void 0?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"template-editor-header",children:[i.jsx("span",{className:"template-editor-path",children:Pe}),i.jsx("span",{className:`template-editor-badge ${Qa?"generated":""}`,children:Qa?"generated":"editable"})]}),i.jsxs("div",{className:"template-editor-body",children:[i.jsx("div",{className:"template-line-numbers",children:F[Pe].split(`
80
+ `).map((o,v)=>i.jsx("span",{children:v+1},v))}),i.jsx("textarea",{className:"template-textarea",value:F[Pe],onChange:o=>ci(Pe,o.target.value),spellCheck:!1,readOnly:Qa})]})]}):i.jsx("div",{className:"template-empty-editor",children:"Select a file to edit"})})]})]})]}),b&&i.jsxs("div",{className:"project-structure-editor-panel",children:[i.jsxs("div",{className:"project-structure-editor-header",children:[i.jsxs("div",{children:[i.jsx("strong",{children:b.name}),i.jsx("span",{children:Ve(b)})]}),i.jsx("button",{type:"button",className:`btn-secondary project-save-btn ${Xt[b.slug]==="saved"?"saved":Xt[b.slug]==="error"?"error":""}`,onClick:()=>void xt(b),disabled:Xt[b.slug]==="saving",children:Xt[b.slug]==="saving"?"Saving...":Xt[b.slug]==="saved"?"Saved":Xt[b.slug]==="error"?"Save Failed":"Save Project"})]}),i.jsxs("div",{className:"project-structure-field",children:[i.jsx("label",{children:"1. Project Basics"}),i.jsx("div",{className:"project-structure-help",children:"Start with the core identity and summary for this project."})]}),i.jsxs("div",{className:"project-structure-form-grid",children:[i.jsxs("div",{className:"project-structure-field",children:[i.jsx("label",{children:"Project Name"}),i.jsx("input",{type:"text",value:b.name,onChange:o=>Ut("name",o.target.value),placeholder:"Project name"})]}),i.jsxs("div",{className:"project-structure-field",children:[i.jsx("label",{children:"Project Slug"}),i.jsx("div",{className:"project-structure-path",children:b.slug})]})]}),i.jsxs("div",{className:"project-structure-form-grid",children:[i.jsxs("div",{className:"project-structure-field",children:[i.jsx("label",{children:"Summary"}),i.jsx("textarea",{value:b.summary,onChange:o=>Ut("summary",o.target.value),rows:4,placeholder:"Describe what this project is about."})]}),i.jsxs("div",{className:"project-structure-field",children:[i.jsx("label",{children:"Primary Focus"}),i.jsx("textarea",{value:b.primaryFocus,onChange:o=>Ut("primaryFocus",o.target.value),rows:4,placeholder:"Describe the main problem area or ownership."})]})]}),i.jsxs("div",{className:"project-structure-field",children:[i.jsx("label",{children:"2. Sources Of Information"}),i.jsx("div",{className:"project-structure-help",children:"Open each source to decide whether this project should use it, then add the details Pac-Man should monitor."})]}),i.jsx("div",{className:"project-structure-field",children:i.jsxs("div",{className:"project-source-accordion",children:[ml({id:"local",title:"Local Folders",summary:b.sourceFolders.length>0?`${Qt(b.sourceFolders.length,"folder")} currently linked to this project.`:Fa.length>0?"Choose which local folders Pac-Man should watch for this project.":"No local folders have been added yet.",badge:b.sourceFolders.length>0?Qt(b.sourceFolders.length,"folder"):"Local",active:b.sourceFolders.length>0,children:i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"project-source-panel-head",children:[i.jsx("div",{className:"project-structure-help",children:"Add local folders from this machine and mark the ones this project should monitor."}),i.jsx("button",{type:"button",className:"btn-secondary project-source-inline-btn",onClick:()=>void uc(),disabled:Tl,children:Tl?"Opening...":"Add Local Folder"})]}),Fa.length>0?i.jsx("div",{className:"project-structure-check-grid",children:Fa.map(o=>i.jsxs("label",{className:"project-structure-check-item",children:[i.jsx("input",{type:"checkbox",checked:b.sourceFolders.includes(o.path),onChange:v=>Bl("sourceFolders",o.path,v.target.checked)}),i.jsx("span",{children:o.label})]},o.path))}):i.jsx("div",{className:"project-source-empty",children:"No local folders added yet. Use the button above to add one for this project."}),ht.local&&i.jsx("div",{className:"project-structure-help",style:{color:"var(--error)"},children:ht.local})]})}),Rt.has("github")&&ml({id:"github",title:"GitHub",summary:Ge("github")?b.githubBranches.length>0?`${Qt(b.githubBranches.length,"branch","branches")} selected from your recent push activity.`:"GitHub is enabled for this project. Choose which branches Pac-Man should monitor.":"Enable GitHub for this project, then choose the branches to monitor.",badge:Ge("github")?b.githubBranches.length>0?Qt(b.githubBranches.length,"branch","branches"):"On":"Off",active:Ge("github"),children:i.jsxs(i.Fragment,{children:[i.jsxs("label",{className:"project-structure-check-item",children:[i.jsx("input",{type:"checkbox",checked:Ge("github"),onChange:o=>Bl("connectedIntegrations",Rt.get("github").label,o.target.checked)}),i.jsx("span",{children:"Use GitHub as a monitored source for this project."})]}),Ge("github")?i.jsx(i.Fragment,{children:ze.github?i.jsx("div",{className:"project-source-empty",children:"Loading GitHub branches..."}):Sn.length>0?i.jsxs(i.Fragment,{children:[i.jsx("select",{multiple:!0,className:"project-source-multi-select",value:b.githubBranches,onChange:o=>Ut("githubBranches",gl(o)),children:Sn.map(o=>i.jsx("option",{value:o.value,children:o.label},o.value))}),i.jsx("div",{className:"project-structure-help",children:"Use Cmd/Ctrl-click to select multiple branches."})]}):i.jsx("div",{className:"project-source-empty",children:"No recent GitHub branches were found from your push activity yet."})}):i.jsx("div",{className:"project-source-empty",children:"Turn this on to scope the project to specific GitHub branches."}),ht.github&&i.jsx("div",{className:"project-structure-help",style:{color:"var(--error)"},children:ht.github})]})}),Rt.has("gitlab")&&ml({id:"gitlab",title:"GitLab",summary:Ge("gitlab")?b.gitlabBranches.length>0?`${Qt(b.gitlabBranches.length,"branch","branches")} selected from your recent push activity.`:"GitLab is enabled for this project. Choose which branches Pac-Man should monitor.":"Enable GitLab for this project, then choose the branches to monitor.",badge:Ge("gitlab")?b.gitlabBranches.length>0?Qt(b.gitlabBranches.length,"branch","branches"):"On":"Off",active:Ge("gitlab"),children:i.jsxs(i.Fragment,{children:[i.jsxs("label",{className:"project-structure-check-item",children:[i.jsx("input",{type:"checkbox",checked:Ge("gitlab"),onChange:o=>Bl("connectedIntegrations",Rt.get("gitlab").label,o.target.checked)}),i.jsx("span",{children:"Use GitLab as a monitored source for this project."})]}),Ge("gitlab")?i.jsx(i.Fragment,{children:ze.gitlab?i.jsx("div",{className:"project-source-empty",children:"Loading GitLab branches..."}):$l.length>0?i.jsxs(i.Fragment,{children:[i.jsx("select",{multiple:!0,className:"project-source-multi-select",value:b.gitlabBranches,onChange:o=>Ut("gitlabBranches",gl(o)),children:$l.map(o=>i.jsx("option",{value:o.value,children:o.label},o.value))}),i.jsx("div",{className:"project-structure-help",children:"Use Cmd/Ctrl-click to select multiple branches."})]}):i.jsx("div",{className:"project-source-empty",children:"No recent GitLab branches were found from your push activity yet."})}):i.jsx("div",{className:"project-source-empty",children:"Turn this on to scope the project to specific GitLab branches."}),ht.gitlab&&i.jsx("div",{className:"project-structure-help",style:{color:"var(--error)"},children:ht.gitlab})]})}),Rt.has("slack")&&ml({id:"slack",title:"Slack",summary:Ge("slack")?b.slackChannels.length>0?`${Qt(b.slackChannels.length,"channel")} selected for monitoring.`:"Slack is enabled for this project. Choose the channels the app should monitor.":"Enable Slack for this project, then choose the channels to monitor.",badge:Ge("slack")?b.slackChannels.length>0?Qt(b.slackChannels.length,"channel"):"On":"Off",active:Ge("slack"),children:i.jsxs(i.Fragment,{children:[i.jsxs("label",{className:"project-structure-check-item",children:[i.jsx("input",{type:"checkbox",checked:Ge("slack"),onChange:o=>Bl("connectedIntegrations",Rt.get("slack").label,o.target.checked)}),i.jsx("span",{children:"Use Slack as a monitored source for this project."})]}),Ge("slack")?i.jsx(i.Fragment,{children:ze.slack?i.jsx("div",{className:"project-source-empty",children:"Loading Slack channels..."}):oi.length>0?i.jsxs(i.Fragment,{children:[i.jsx("select",{multiple:!0,className:"project-source-multi-select",value:b.slackChannels,onChange:o=>Ut("slackChannels",gl(o)),children:oi.map(o=>i.jsx("option",{value:o.value,children:o.label},o.value))}),i.jsx("div",{className:"project-structure-help",children:"Use Cmd/Ctrl-click to select multiple channels. Add your Slack app to each selected channel to use it."})]}):i.jsx("div",{className:"project-source-empty",children:"No Slack channels were found where the bot is already added. Save Slack first, then invite the app to the channels you want to monitor."})}):i.jsx("div",{className:"project-source-empty",children:"Turn this on to scope the project to specific Slack channels."}),ht.slack&&i.jsx("div",{className:"project-structure-help",style:{color:"var(--error)"},children:ht.slack})]})}),Rt.has("google-drive-storage")&&ml({id:"google-drive-storage",title:"GDrive",summary:Ge("google-drive-storage")?b.gdriveFolders.length>0?`${Qt(b.gdriveFolders.length,"folder")} selected for this project context.`:"GDrive is enabled for this project. Choose which folders should be added into context.":"Enable GDrive if this project should pull context from selected Drive folders.",badge:Ge("google-drive-storage")?b.gdriveFolders.length>0?Qt(b.gdriveFolders.length,"folder"):"On":"Off",active:Ge("google-drive-storage"),children:i.jsxs(i.Fragment,{children:[i.jsxs("label",{className:"project-structure-check-item",children:[i.jsx("input",{type:"checkbox",checked:Ge("google-drive-storage"),onChange:o=>Bl("connectedIntegrations",Rt.get("google-drive-storage").label,o.target.checked)}),i.jsx("span",{children:"Use GDrive folders as a monitored source for this project."})]}),Ge("google-drive-storage")?i.jsx(i.Fragment,{children:_l?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"project-source-panel-head",children:[i.jsx("div",{className:"project-structure-help",children:"Open Google Drive here and choose multiple folders for this project."}),i.jsxs("div",{style:{display:"flex",gap:"0.5rem",flexWrap:"wrap"},children:[i.jsx("button",{type:"button",className:"btn-secondary project-source-inline-btn",onClick:()=>void xn(),disabled:He,children:He?"Opening GDrive...":K?"Refresh GDrive Browser":"Choose GDrive Folders"}),b.gdriveFolders.length>0&&i.jsx("button",{type:"button",className:"btn-secondary project-source-inline-btn",onClick:()=>Ut("gdriveFolders",[]),children:"Clear Project Folders"})]})]}),b.gdriveFolders.length>0?i.jsx("div",{style:{display:"grid",gap:"0.5rem"},children:b.gdriveFolders.map(o=>i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"0.75rem",padding:"0.7rem 0.85rem",background:"var(--bg-surface)",border:"1px solid var(--border)",borderRadius:"var(--radius-sm)"},children:[i.jsx("span",{style:{color:"var(--text-secondary)",fontSize:"0.8rem"},children:o}),i.jsx("button",{type:"button",className:"btn-secondary",style:{fontSize:"0.78rem",padding:"0.35rem 0.6rem"},onClick:()=>Ut("gdriveFolders",b.gdriveFolders.filter(v=>v!==o)),children:"Remove"})]},o))}):i.jsx("div",{className:"project-source-empty",children:"No GDrive folders selected for this project yet."}),K&&i.jsxs("div",{style:{padding:"0.9rem",border:"1px solid var(--border)",borderRadius:"var(--radius-sm)",background:"var(--bg-surface)"},children:[i.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:"0.4rem",marginBottom:"0.85rem"},children:[i.jsx("button",{type:"button",className:"btn-secondary",style:{fontSize:"0.78rem",padding:"0.35rem 0.6rem"},onClick:()=>Ft(-1),children:"My Drive"}),se.map((o,v)=>i.jsx("button",{type:"button",className:"btn-secondary",style:{fontSize:"0.78rem",padding:"0.35rem 0.6rem"},onClick:()=>Ft(v),children:o.name},o.id))]}),ga&&i.jsx("div",{style:{color:"var(--error)",fontSize:"0.82rem",marginBottom:"0.75rem"},children:ga}),i.jsxs("div",{style:{color:"var(--text-dim)",fontSize:"0.75rem",marginBottom:"0.65rem"},children:["Browsing: ",ii]}),i.jsx("div",{style:{display:"grid",gap:"0.45rem"},children:(mt[Ya]??[]).map(o=>i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem",justifyContent:"space-between",padding:"0.6rem 0.75rem",background:"var(--bg-inset)",border:"1px solid var(--border)",borderRadius:"var(--radius-sm)"},children:[i.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"0.55rem",flex:1,minWidth:0},children:[i.jsx("input",{type:"checkbox",checked:b.gdriveFolders.includes(o.path),onChange:v=>ri(o,v.target.checked)}),i.jsx("span",{style:{color:"var(--text-primary)",minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},children:o.name})]}),i.jsx("button",{type:"button",className:"btn-secondary",style:{fontSize:"0.78rem",padding:"0.35rem 0.6rem"},onClick:()=>void As(o),children:"Open"})]},o.id))}),!He&&(mt[Ya]??[]).length===0&&i.jsx("div",{style:{color:"var(--text-dim)",fontSize:"0.8rem",marginTop:"0.75rem"},children:"No subfolders found in this location."})]})]}):i.jsx("div",{className:"project-source-empty",children:"Folder browsing here needs full Google Drive read access. If you connected Google earlier and only see the Pac-Man folder, reconnect Google in Integrations once so Pac-Man can browse all of your Drive folders."})}):i.jsx("div",{className:"project-source-empty",children:"Turn this on to scope the project to specific Google Drive folders."})]})}),Rt.has("gdrive")&&ml({id:"gdrive",title:"GDocs",summary:Ge("gdrive")?b.gdocDocuments.length>0?`${Qt(b.gdocDocuments.length,"document")} selected for this project.`:"GDocs is enabled for this project. Choose which documents Pac-Man should read.":"Enable GDocs for this project, then choose the documents to monitor.",badge:Ge("gdrive")?b.gdocDocuments.length>0?Qt(b.gdocDocuments.length,"document"):"On":"Off",active:Ge("gdrive"),children:i.jsxs(i.Fragment,{children:[i.jsxs("label",{className:"project-structure-check-item",children:[i.jsx("input",{type:"checkbox",checked:Ge("gdrive"),onChange:o=>Bl("connectedIntegrations",Rt.get("gdrive").label,o.target.checked)}),i.jsx("span",{children:"Use Google Docs as a monitored source for this project."})]}),Ge("gdrive")?ze.gdocs?i.jsx("div",{className:"project-source-empty",children:"Loading Google Docs..."}):ui.length>0?i.jsxs(i.Fragment,{children:[i.jsx("select",{multiple:!0,className:"project-source-multi-select",value:b.gdocDocuments,onChange:o=>Ut("gdocDocuments",gl(o)),children:ui.map(o=>i.jsx("option",{value:o.value,children:o.label},o.value))}),i.jsx("div",{className:"project-structure-help",children:s.googleDriveFolders.length>0?"Use Cmd/Ctrl-click to select multiple Google Docs from your selected GDrive folders.":"Use Cmd/Ctrl-click to select multiple Google Docs."})]}):i.jsx("div",{className:"project-source-empty",children:"No Google Docs are available yet. Connect Google Docs and make sure Drive read access is granted."}):i.jsx("div",{className:"project-source-empty",children:"Turn this on to scope the project to specific Google Docs."}),ht.gdocs&&i.jsx("div",{className:"project-structure-help",style:{color:"var(--error)"},children:ht.gdocs})]})}),Rt.has("gmail")&&ml({id:"gmail",title:"Gmail",summary:Ge("gmail")?"Gmail is enabled for this project and will monitor all of your email with read-only access.":"Enable Gmail if this project should monitor your email with read-only access.",badge:Ge("gmail")?"On":"Off",active:Ge("gmail"),children:i.jsxs(i.Fragment,{children:[i.jsxs("label",{className:"project-structure-check-item",children:[i.jsx("input",{type:"checkbox",checked:Ge("gmail"),onChange:o=>Bl("connectedIntegrations",Rt.get("gmail").label,o.target.checked)}),i.jsx("span",{children:"Use Gmail as a monitored source for this project."})]}),i.jsx("div",{className:"project-source-empty",children:"Gmail uses read-only access and will monitor all of your email. Project-specific Gmail filters are not configured in onboarding yet."})]})}),qa.length===0&&i.jsx("div",{className:"project-source-empty",children:"No connected integrations are available yet. Finish the Integrations step first if you want to scope GitHub, Slack, Google, or GitLab sources here."})]})}),F[`${Pt(b)}/context-details.md`]&&i.jsxs("div",{className:"project-structure-field",children:[i.jsx("label",{children:"3. Context Details"}),i.jsx("div",{className:"project-structure-help",children:"Generated context details for this project. Open in the file tree editor to make changes."}),i.jsx("pre",{className:"context-details-preview",children:F[`${Pt(b)}/context-details.md`]}),i.jsx("button",{type:"button",className:"btn-secondary",style:{marginTop:"0.5rem"},onClick:()=>wl(`${Pt(b)}/context-details.md`),children:"Edit in File Tree"})]}),i.jsxs("div",{className:"project-structure-field",children:[i.jsx("label",{children:"4. LLM Instructions"}),i.jsx("div",{className:"project-structure-help",children:"Add project-specific guidance Pac-Man should follow when building and updating this project context."}),i.jsx("textarea",{value:b.llmInstructions,onChange:o=>Ut("llmInstructions",o.target.value),rows:4,placeholder:"Example: Prefer rollout docs over Slack speculation. Ask for confirmation before suggesting production changes."})]}),i.jsxs("div",{className:"project-structure-field",children:[i.jsx("label",{children:"5. Knowledge Graph"}),ct==="building"?i.jsx(Lp,{projectName:b.name}):i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"project-structure-help",children:"Build the initial project knowledge now with your configured provider, or skip it and refine the files manually later."}),i.jsx("div",{className:"project-structure-help",style:{color:m?"var(--text-secondary)":"var(--warning)",marginTop:"0.45rem"},children:m?`This build will use ${k}. Update it in Integrations → LLM Providers if you want to switch models or providers.`:"No OpenAI or Anthropic provider is configured yet. Pac-Man will try local Ollama for this build."}),i.jsxs("div",{className:"btn-group",style:{justifyContent:"flex-start"},children:[i.jsx("button",{type:"button",className:"btn-primary",onClick:()=>void pa(),children:ct==="built"?"Rebuild Knowledge Graph":"Build Knowledge Graph Now"}),i.jsx("button",{type:"button",className:"btn-secondary",onClick:()=>{st("idle"),Ie("")},children:"Skip For Now"})]}),ut&&i.jsx("div",{className:"project-structure-help",style:{color:ct==="error"?"var(--error)":ct==="built"?"var(--success)":"var(--text-secondary)",marginTop:"0.75rem"},children:ut})]})]}),i.jsxs("div",{className:"project-structure-field",children:[i.jsx("label",{children:"6. Project File Tree & Structure"}),i.jsxs("div",{className:"project-structure-help",children:["Review only the files that belong to ",i.jsxs("code",{children:[Pt(b),"/"]}),". Create new files and folders directly inside this project tree."]}),i.jsxs("div",{className:"template-preview",children:[Ee&&i.jsxs("div",{className:"template-loading",children:[i.jsx("div",{className:"template-spinner"}),i.jsx("span",{children:"Generating project structure..."})]}),Oe&&i.jsx("div",{className:"template-error",children:Oe}),!Ee&&!Oe&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"template-sidebar",children:[i.jsxs("div",{className:"template-sidebar-header",children:[i.jsx("span",{children:"Project Files"}),i.jsxs("div",{className:"template-sidebar-actions",children:[i.jsx("button",{className:"template-action-btn",onClick:()=>{fe({type:"file",parent:Kl}),Ze(""),V(o=>new Set(o).add(Kl))},title:"Add context file",children:i.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z"}),i.jsx("polyline",{points:"14 2 14 8 20 8"}),i.jsx("line",{x1:"12",y1:"18",x2:"12",y2:"12"}),i.jsx("line",{x1:"9",y1:"15",x2:"15",y2:"15"})]})}),i.jsx("button",{className:"template-action-btn",onClick:()=>{fe({type:"folder",parent:Kl}),Ze(""),V(o=>new Set(o).add(Kl))},title:"Add folder",children:i.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("path",{d:"M22 19a2 2 0 01-2 2H4a2 2 0 01-2-2V5a2 2 0 012-2h5l2 3h9a2 2 0 012 2z"}),i.jsx("line",{x1:"12",y1:"11",x2:"12",y2:"17"}),i.jsx("line",{x1:"9",y1:"14",x2:"15",y2:"14"})]})})]})]}),El?jn(b.slug,Kl,El):i.jsx("div",{className:"project-source-empty",children:"No files exist for this project yet. Use the add buttons above to create the first one."})]}),i.jsx("div",{className:"template-editor",children:$e&&F[$e]!==void 0?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"template-editor-header",children:[i.jsx("span",{className:"template-editor-path",children:$e}),i.jsx("span",{className:`template-editor-badge ${Rl?"generated":""}`,children:Rl?"generated":"editable"})]}),i.jsxs("div",{className:"template-editor-body",children:[i.jsx("div",{className:"template-line-numbers",children:F[$e].split(`
81
+ `).map((o,v)=>i.jsx("span",{children:v+1},v))}),i.jsx("textarea",{className:"template-textarea",value:F[$e],onChange:o=>ci($e,o.target.value),spellCheck:!1,readOnly:Rl})]})]}):i.jsx("div",{className:"template-empty-editor",children:"Select a file to edit"})})]})]})]})]})]}):i.jsx("div",{className:"project-structure-empty-state",children:"No projects yet. Create one manually or go back and add source folders first."})]}),i.jsxs("div",{className:"btn-group",children:[i.jsx("button",{className:"btn-secondary",onClick:d,children:"Back"}),i.jsx("button",{className:"btn-primary",onClick:x,children:"Continue"})]})]})}const Yp="root",Xp="My Drive";function Qp({state:s,update:f,onNext:x,onPrev:d}){const N=Qg(s);ai(s.googleGrantedScopes,N),ai(s.googleGrantedScopes,["storage"]),s.googleRefreshToken.trim()||s.googleAccountEmail.trim();const H=!!s.googleRefreshToken.trim()&&Gl(s.googleGrantedScopes,["storage"]);s.googleRefreshToken.trim()&&Gl(s.googleGrantedScopes,["gdrive"]);const[F,Q]=R.useState(s.gdriveFolderId?"complete":H?"authenticated":"idle"),[U,T]=R.useState(""),[J,X]=R.useState(!1),[ae,de]=R.useState(!1),[Ee,De]=R.useState(!1),[Oe,je]=R.useState(""),[ce,fe]=R.useState(!1),[Ce,Ze]=R.useState([]),[ge,V]=R.useState({}),[Ue,me]=R.useState(!1),[ct,st]=R.useState(""),ut=R.useRef(null);R.useMemo(()=>new Set(s.googleDriveFolders.map(C=>C.id)),[s.googleDriveFolders]);const Ie=Ce[Ce.length-1]??null;Ie==null||Ie.id,Ie==null||Ie.path,R.useEffect(()=>()=>{ut.current&&clearInterval(ut.current)},[]),R.useEffect(()=>{if(s.gdriveFolderId){Q("complete");return}if(H){Q("authenticated");return}Q("idle")},[s.gdriveFolderId,H]),R.useEffect(()=>{s.storageMode!=="local"&&f({storageMode:"local"})},[s.storageMode]),R.useEffect(()=>{if(s.storageMode!=="gdrive")return;let C=!0;return(async()=>{try{const{data:W}=await zt("/api/google/auth-status"),ne=W;if(!C)return;if(ne.status==="authenticated"||ne.status==="complete"){const ye=Array.isArray(ne.grantedScopes)?ne.grantedScopes:s.googleGrantedScopes,h=!!(ne.refreshToken??s.googleRefreshToken)&&Gl(ye,["storage"]);f({googleRefreshToken:ne.refreshToken??s.googleRefreshToken,googleGrantedScopes:ye,googleAccountEmail:ne.accountEmail??s.googleAccountEmail,...ne.folderId?{gdriveFolderId:ne.folderId,gdriveFolderName:ne.folderName??s.gdriveFolderName,gdriveFolderPath:ne.folderPath??s.gdriveFolderPath}:{}}),Q(ne.folderId?"complete":h?"authenticated":"idle"),X(!1);return}ne.status==="pending"&&(Q("pending"),X(!0)),ne.status==="error"&&(Q("error"),T(ne.error??"Authentication failed"),X(!1))}catch{}})(),()=>{C=!1}},[s.storageMode]);const yt=async()=>{De(!0),je("");const C=performance.now();try{const L=await fetch(hn("/api/pick-folder"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({defaultPath:s.localPath,purpose:"storage"})});if(!L.ok)throw new Error(`Server returned ${L.status}`);const W=await L.json();if(W.error)throw new Error(W.error);console.info(`[onboarding] storage picker resolved in ${Math.round(performance.now()-C)}ms`),!W.cancelled&&W.path&&f({localPath:W.path})}catch(L){const W=L instanceof Error?L.message:String(L);je(W||"Could not open the file manager right now.")}finally{De(!1)}},gt=s.localPath.trim().length>0;return i.jsxs("div",{className:"step-content",children:[i.jsx("h1",{children:"Storage"}),i.jsx("h2",{children:"Where should your context be stored?"}),i.jsxs("div",{className:"radio-group",children:[i.jsxs("div",{className:"radio-item selected",children:[i.jsx("strong",{children:"Local Workspace"}),i.jsx("br",{}),i.jsx("small",{children:"Files stored on this machine"})]}),i.jsxs("div",{className:"radio-item",style:{opacity:.5,cursor:"default"},children:[i.jsx("strong",{children:"Google Drive"}),i.jsx("br",{}),i.jsx("small",{children:"We can add Drive-backed storage later"})]})]}),i.jsxs("div",{style:{marginBottom:"1.25rem"},children:[i.jsx("label",{className:"field-label",children:"Storage path"}),i.jsxs("div",{style:{display:"flex",gap:"0.5rem",alignItems:"center"},children:[i.jsx("input",{type:"text",value:s.localPath,onChange:C=>f({localPath:C.target.value}),placeholder:".personal-assistant",style:{flex:1,marginBottom:0}}),i.jsx("button",{className:"btn-secondary",onClick:yt,disabled:Ee,style:{whiteSpace:"nowrap",flexShrink:0},children:Ee?"Opening...":"Browse"})]}),i.jsx("span",{className:"field-hint",children:Ee?"Opening your file manager. The first launch can take a moment while the OS starts the native picker.":"Click Browse to open a folder picker, or type a path directly (relative or absolute)."}),Oe&&i.jsx("span",{className:"field-error",children:Oe})]}),i.jsxs("div",{style:{background:"var(--bg-surface)",border:"1px solid var(--border)",borderRadius:"var(--radius-sm)",padding:"1rem",marginBottom:"1.25rem",color:"var(--text-secondary)",fontSize:"0.84rem",lineHeight:1.7},children:[i.jsx("p",{style:{color:"var(--text-primary)",fontWeight:600,marginBottom:"0.45rem"},children:"Google Drive-backed storage is deferred"}),i.jsx("p",{style:{marginBottom:0},children:"Pac-Man will store its memory locally for now. You can still connect Google in the Integrations step and use GDrive or GDocs as project sources, but the storage backend itself stays local in this onboarding flow."})]}),i.jsx("div",{className:"banner-warning",style:{marginBottom:"1.5rem"},children:"Do not delete, move, or rename the folder structure created by this setup. Claude and the sync daemon rely on the exact file and folder layout to load and update your context. Deleting files will result in lost context that cannot be automatically recovered."}),i.jsxs("div",{className:"btn-group",children:[i.jsx("button",{className:"btn-secondary",onClick:d,children:"Back"}),i.jsx("button",{className:"btn-primary",onClick:()=>{li(s.email,`storage_${s.storageMode}_configured`),x()},disabled:!gt,children:"Continue"})]})]})}function Vp({state:s,alreadySaved:f,onPrev:x,onSaved:d,onHardReset:N}){const[H,F]=R.useState(()=>f?"saved":"saving"),[Q,U]=R.useState(""),[T,J]=R.useState(0);R.useEffect(()=>{if(f||H!=="saving")return;const de=Zp(s);zt("/api/save",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(de)}).then(({data:Ee})=>{const De=Ee;De.success?(li(s.email,"onboarding_completed"),d(),F("saved")):(F("error"),U(De.error||"Failed to save configuration"))}).catch(Ee=>{F("error"),U(String(Ee))})},[f,d,T,s,H]);const X=()=>{window.confirm("Clear the saved onboarding draft stored in this browser and restart onboarding?")&&N()},ae=()=>{F("saving"),U(""),J(de=>de+1)};return H==="saving"?i.jsx("div",{className:"step-content",children:i.jsxs("div",{className:"saving-overlay",children:[i.jsx("div",{className:"pacman-char"}),i.jsxs("div",{className:"saving-dots",children:[i.jsx("span",{className:"pac-trail-dot"}),i.jsx("span",{className:"pac-trail-dot"}),i.jsx("span",{className:"pac-trail-dot"}),i.jsx("span",{className:"pac-trail-dot"}),i.jsx("span",{className:"pac-trail-dot"})]}),i.jsx("p",{className:"saving-text",children:"Pac-Man is saving your configuration..."})]})}):H==="error"?i.jsx("div",{className:"step-content",children:i.jsxs("div",{style:{textAlign:"center",padding:"3rem 0"},children:[i.jsx("div",{style:{width:72,height:72,borderRadius:"50%",background:"var(--error-subtle)",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 1.5rem",fontSize:"2rem"},children:"!"}),i.jsx("h1",{children:"Save Failed"}),i.jsx("p",{style:{color:"var(--error)",marginTop:"0.75rem",fontSize:"0.9rem"},children:Q}),i.jsxs("p",{style:{color:"var(--text-muted)",marginTop:"1rem",fontSize:"0.85rem"},children:["Try running ",i.jsx("code",{style:{background:"var(--bg-surface)",padding:"2px 6px",borderRadius:4,border:"1px solid var(--border)"},children:"pacman init"})," from the command line instead."]}),i.jsxs("div",{className:"btn-group",style:{justifyContent:"center",marginTop:"1.5rem"},children:[i.jsx("button",{className:"btn-secondary",onClick:x,children:"Go Back"}),i.jsx("button",{className:"btn-primary",onClick:ae,children:"Retry"})]})]})}):i.jsxs("div",{className:"success step-content",children:[i.jsx("div",{className:"success-icon",children:i.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:i.jsx("polyline",{points:"20 6 9 17 4 12"})})}),i.jsx("h1",{children:"Setup Complete"}),i.jsxs("div",{className:"pac-celebration",children:[i.jsx("span",{className:"pac-trail-dot"}),i.jsx("span",{className:"pac-trail-dot"}),i.jsx("span",{className:"pac-trail-dot"}),i.jsx("div",{className:"pacman-char pacman-char-small"}),i.jsx("span",{className:"pac-trail-dot"}),i.jsx("span",{className:"pac-trail-dot"}),i.jsx("span",{className:"pac-trail-dot"})]}),i.jsxs("p",{style:{color:"var(--text-secondary)",fontSize:"1rem",lineHeight:1.6,marginBottom:"0.5rem"},children:["Your personal assistant context has been initialized.",i.jsx("br",{}),"Here's how to start using Pac-Man:"]}),i.jsxs("div",{className:"instructions-grid",children:[i.jsxs("div",{className:"instruction-card",children:[i.jsx("div",{className:"instruction-card-icon",style:{background:"var(--maze-wall)"},children:"CC"}),i.jsx("h4",{children:"Claude Code"}),i.jsx("p",{children:"Install the MCP server for Claude Code"}),i.jsx("code",{className:"cmd",children:`pacman claude install
82
+ pacman mcp claude install`})]}),i.jsxs("div",{className:"instruction-card",children:[i.jsx("div",{className:"instruction-card-icon",style:{background:"#24292F"},children:"CX"}),i.jsx("h4",{children:"Codex"}),i.jsx("p",{children:"Install the MCP server for Codex"}),i.jsx("code",{className:"cmd",children:`pacman codex install
83
+ pacman mcp codex install`})]}),i.jsxs("div",{className:"instruction-card",children:[i.jsx("div",{className:"instruction-card-icon",style:{background:"#4A154B"},children:"Sl"}),i.jsx("h4",{children:"Slack Listener"}),i.jsx("p",{children:"Start real-time Slack replies"}),i.jsx("code",{className:"cmd",children:"pacman slack listen"})]}),i.jsxs("div",{className:"instruction-card",children:[i.jsx("div",{className:"instruction-card-icon",style:{background:"var(--ghost-orange)"},children:"DM"}),i.jsx("h4",{children:"Sync Daemon"}),i.jsx("p",{children:"Start the context sync daemon"}),i.jsx("code",{className:"cmd",children:"pacman daemon"})]})]}),i.jsxs("div",{style:{background:"var(--bg-surface)",border:"1px solid var(--border)",borderRadius:"var(--radius)",padding:"1.25rem",textAlign:"left",marginTop:"1rem"},children:[i.jsx("h4",{style:{fontFamily:"var(--font-display)",fontSize:"0.78rem",fontWeight:600,color:"var(--pac-yellow)",marginBottom:"0.75rem",letterSpacing:"0.03em"},children:"Example Usage"}),i.jsx("div",{className:"code-block",style:{marginTop:0,background:"var(--bg-inset)"},children:`# Start assistant for a project in Claude Code
84
+ /pacman start my-project
85
+
86
+ # Ask Codex to load your context
87
+ "Load my Pac-Man context for my-project"
88
+
89
+ # Manually sync context now
90
+ pacman sync now
91
+
92
+ # Check sync status
93
+ pacman sync status
94
+
95
+ # List all configured projects
96
+ pacman project list
97
+
98
+ # Search your context
99
+ pacman context search "deployment process"`})]}),i.jsx("div",{style:{marginTop:"1.5rem",padding:"1rem",background:"var(--pac-yellow-dim)",border:"1px solid rgba(255, 215, 0, 0.15)",borderRadius:"var(--radius-sm)",textAlign:"left"},children:i.jsxs("p",{style:{color:"var(--text-secondary)",fontSize:"0.82rem",lineHeight:1.7},children:[i.jsx("strong",{style:{color:"var(--pac-yellow)"},children:"Pro tips:"})," ","Restart Claude Code or Codex after installing the MCP server. Make sure"," ",i.jsx("code",{style:{background:"var(--bg-surface)",padding:"0 5px",borderRadius:4,border:"1px solid var(--border)"},children:"pacman"})," ","is available globally. For local repo testing, run:"," ",i.jsx("code",{style:{background:"var(--bg-surface)",padding:"2px 6px",borderRadius:4,display:"inline-block",marginTop:"0.3rem",border:"1px solid var(--border)"},children:"pnpm setup && source ~/.zshrc && cd packages/cli && pnpm link --global"})]})}),i.jsxs("div",{style:{marginTop:"1rem",padding:"1rem",background:"var(--bg-surface)",border:"1px solid var(--border)",borderRadius:"var(--radius-sm)",textAlign:"left"},children:[i.jsx("h4",{style:{fontFamily:"var(--font-display)",fontSize:"0.78rem",fontWeight:600,color:"var(--pac-yellow)",marginBottom:"0.5rem",letterSpacing:"0.03em"},children:"Browser Checkpoint"}),i.jsx("p",{style:{color:"var(--text-secondary)",fontSize:"0.82rem",lineHeight:1.7},children:"Pac-Man keeps this onboarding draft in browser local storage so a refresh or reopened tab resumes your setup. Use a hard reset only when you want to wipe the local onboarding checkpoint and start from scratch."}),i.jsxs("p",{style:{color:"var(--text-muted)",fontSize:"0.78rem",lineHeight:1.7,marginTop:"0.5rem"},children:["Stored key:"," ",i.jsx("code",{style:{background:"var(--bg-inset)",padding:"2px 6px",borderRadius:4,border:"1px solid var(--border)"},children:"pacman.onboarding.v1"})]}),i.jsx("div",{className:"btn-group",style:{marginTop:"1rem"},children:i.jsx("button",{className:"btn-secondary",onClick:X,children:"Hard Reset Onboarding Draft"})})]})]})}function Zp(s){var N;const f=s.googleClientId&&s.googleClientSecret&&s.googleRefreshToken?{clientId:s.googleClientId,clientSecret:s.googleClientSecret,refreshToken:s.googleRefreshToken}:null,x=s.googleDriveFolders.map(H=>H.id),d=[...new Set([...s.integrations.filter(H=>H!=="google-drive-storage"),...x.length>0?["gdrive"]:[]])];return{user:{name:s.name,email:s.email,assistantName:s.assistantName,profileType:s.profileType,responsibilities:s.responsibilities},storage:s.storageMode==="local"?{mode:"local",workspacePath:s.localPath}:{mode:"gdrive",folderId:s.gdriveFolderId,folderName:s.gdriveFolderName,cachePath:`${s.localPath||".personal-assistant"}/cache`,credentials:f??{clientId:"",clientSecret:"",refreshToken:""}},templateFiles:s.templateFiles,integrations:d.map(H=>({type:H,enabled:!0,credentials:(H==="gmail"||H==="gdrive")&&f?f:s.integrationCredentials[H]??{},...H==="gdrive"&&x.length>0?{folders:x}:{}})),activeProject:(N=s.inferredProjects[0])==null?void 0:N.slug,localFolders:s.localFolders.filter(H=>H.path.trim()),inferredProjects:s.inferredProjects,sync:{dailySyncTime:s.syncTime,timezone:s.timezone,manualSyncEnabled:s.manualSync,asyncUpdateEnabled:s.asyncUpdate},slackRuntime:s.integrations.includes("slack")?{enabled:!0,transport:"socket_mode",appToken:s.slackAppToken,reviewMode:s.slackReviewMode,generationEnabled:s.slackGenerationEnabled,defaultProvider:s.slackGenerationEnabled?s.slackDefaultProvider:void 0,defaultModel:s.slackGenerationEnabled?s.slackDefaultModel:void 0,channelMappings:[]}:void 0,providers:s.openAIApiKey||s.anthropicApiKey?{...s.openAIApiKey?{openai:{apiKey:s.openAIApiKey,model:s.openAIModel}}:{},...s.anthropicApiKey?{anthropic:{apiKey:s.anthropicApiKey,model:s.anthropicModel}}:{}}:void 0}}const Ro={name:"",email:"",assistantName:"Atlas",profileType:"software-engineer",responsibilities:[],templateFiles:{},storageMode:"local",localPath:".personal-assistant",googleClientId:"",googleClientSecret:"",googleRefreshToken:"",googleGrantedScopes:[],googleAccountEmail:"",gdriveFolderId:"",gdriveFolderName:"Personal Assistant",gdriveFolderParent:"",gdriveFolderPath:"",integrations:[],integrationCredentials:{},localFolders:[],googleDriveFolders:[],inferredProjects:[],deletedProjectSlugs:[],projectInference:null,slackSetupMode:"guided",slackAppToken:"",slackChannelId:"",slackChannelName:"",slackReviewerUserId:"",slackReviewerDisplayName:"",slackReviewMode:"auto_send",slackGenerationEnabled:!0,slackDefaultProvider:"openai",slackDefaultModel:"gpt-4.1-mini",openAIApiKey:"",openAIModel:"gpt-4.1-mini",anthropicApiKey:"",anthropicModel:"claude-3-7-sonnet-latest",syncTime:"08:00",timezone:"America/New_York",manualSync:!0,asyncUpdate:!0},Bo=["Identity","Integrations","Project Structure","Storage","Complete"],ec=Bo.length,Fo="pacman.onboarding.v1",Kp={"software-engineer":"Software Engineer","product-manager":"Product Manager","engineering-manager":"Engineering Manager",devops:"DevOps Engineer"},Jp={slack:"Slack",gmail:"Gmail",github:"GitHub",gitlab:"GitLab","google-drive-storage":"GDrive",gdrive:"GDocs",gchat:"Google Chat"};function $p(s){return Math.max(0,Math.min(s,ec))}function Wp(s,f){const x=Array.isArray(s)?s.filter(N=>typeof N=="string"):[],d=new Set;for(const N of x){if(N==="Github"){d.add("github");continue}if(N==="Gitlab"){d.add("gitlab");continue}if(N==="Google Drive Storage"||N==="gdrive-storage"){d.add("google-drive-storage");continue}d.add(N)}return f!=null&&f.includeGoogleDriveStorage&&d.add("google-drive-storage"),[...d]}function Ip(s){const f=Array.isArray(s)?s.filter(d=>typeof d=="string"):[],x=new Set;for(const d of f){const N=d.trim();if(N){if(N==="github"||N==="Github"||N==="GitHub"){x.add("GitHub");continue}if(N==="gitlab"||N==="Gitlab"||N==="GitLab"){x.add("GitLab");continue}if(N==="google-drive-storage"||N==="gdrive-storage"||N==="Google Drive Storage"||N==="GDrive"){x.add("GDrive");continue}if(N==="gdrive"||N==="Google Docs"||N==="GDocs"){x.add("GDocs");continue}if(N==="gmail"||N==="Gmail"){x.add("Gmail");continue}if(N==="slack"||N==="Slack"){x.add("Slack");continue}x.add(N)}}return[...x]}function Pp(s){const f={};for(const[x,d]of Object.entries(s)){const N=x.match(/^projects\/([^/]+)\.md$/);if(N){f[`projects/${N[1]}/project.md`]=d;continue}if(x.startsWith("projects/")){f[x]=d;continue}if(x.match(/^([^/]+)\/.+$/)){f[`projects/${x}`]=d;continue}f[x]=d}return f}function ev(){if(typeof window>"u")return null;try{const s=window.localStorage.getItem(Fo);if(!s)return null;const f=JSON.parse(s);return!f||typeof f!="object"||typeof f.step!="number"||!f.state?null:{step:$p(f.step),state:{...Ro,...f.state,googleClientId:typeof f.state.googleClientId=="string"?f.state.googleClientId:typeof f.state.gdriveClientId=="string"?f.state.gdriveClientId??"":"",googleClientSecret:typeof f.state.googleClientSecret=="string"?f.state.googleClientSecret:typeof f.state.gdriveClientSecret=="string"?f.state.gdriveClientSecret??"":"",googleRefreshToken:typeof f.state.googleRefreshToken=="string"?f.state.googleRefreshToken:typeof f.state.gdriveRefreshToken=="string"?f.state.gdriveRefreshToken??"":"",googleGrantedScopes:Array.isArray(f.state.googleGrantedScopes)?f.state.googleGrantedScopes.filter(x=>typeof x=="string"):[],integrations:Wp(f.state.integrations,{includeGoogleDriveStorage:f.state.storageMode==="gdrive"||typeof f.state.gdriveFolderId=="string"&&f.state.gdriveFolderId.trim().length>0||Array.isArray(f.state.googleDriveFolders)&&f.state.googleDriveFolders.length>0}),inferredProjects:Array.isArray(f.state.inferredProjects)?f.state.inferredProjects.filter(x=>!!x&&typeof x=="object").map((x,d)=>({slug:typeof x.slug=="string"?x.slug:`project-${d+1}`,name:typeof x.name=="string"?x.name:`Project ${d+1}`,summary:typeof x.summary=="string"?x.summary:"",primaryFocus:typeof x.primaryFocus=="string"?x.primaryFocus:"",sourceFolders:Array.isArray(x.sourceFolders)?x.sourceFolders.filter(N=>typeof N=="string"):[],connectedIntegrations:Ip(x.connectedIntegrations),githubBranches:Array.isArray(x.githubBranches)?x.githubBranches.filter(N=>typeof N=="string"):[],gitlabBranches:Array.isArray(x.gitlabBranches)?x.gitlabBranches.filter(N=>typeof N=="string"):[],slackChannels:Array.isArray(x.slackChannels)?x.slackChannels.filter(N=>typeof N=="string"):[],gdriveFolders:Array.isArray(x.gdriveFolders)?x.gdriveFolders.filter(N=>typeof N=="string"):[],gdocDocuments:Array.isArray(x.gdocDocuments)?x.gdocDocuments.filter(N=>typeof N=="string"):[],keySignals:Array.isArray(x.keySignals)?x.keySignals.filter(N=>typeof N=="string"):[],llmInstructions:typeof x.llmInstructions=="string"?x.llmInstructions:"",templateFiles:Array.isArray(x.templateFiles)?x.templateFiles.filter(N=>typeof N=="string"):[]})):[],deletedProjectSlugs:Array.isArray(f.state.deletedProjectSlugs)?(f.state.deletedProjectSlugs??[]).filter(x=>typeof x=="string"):[],googleAccountEmail:typeof f.state.googleAccountEmail=="string"?f.state.googleAccountEmail:"",googleDriveFolders:Array.isArray(f.state.googleDriveFolders)?f.state.googleDriveFolders.filter(x=>!!x&&typeof x=="object"&&typeof x.id=="string"&&typeof x.name=="string"&&typeof x.path=="string"):[]},completed:f.completed===!0}}catch{return null}}function tv(s,f,x){typeof window>"u"||window.localStorage.setItem(Fo,JSON.stringify({step:s,state:f,completed:x}))}function lv(){typeof window>"u"||window.localStorage.removeItem(Fo)}function av(s){return Jp[s]??s}function nv(s){return Kp[s]??s}function qg(s){const f=s.trim();if(!f)return"Not set";const x=f.split(/[\\/]/).filter(Boolean);return x.length<=2?f:`.../${x.slice(-2).join("/")}`}function iv(){const s=R.useMemo(()=>ev(),[]),[f,x]=R.useState(()=>(s==null?void 0:s.step)??0),[d,N]=R.useState(()=>(s==null?void 0:s.state)??Ro),[H,F]=R.useState(()=>(s==null?void 0:s.completed)??!1),[Q,U]=R.useState(!1),T=ge=>{N(V=>({...V,...ge})),F(!1)},J=()=>x(ge=>Math.min(ge+1,ec)),X=()=>x(ge=>Math.max(ge-1,1)),ae=()=>x(1),de=f>=1&&f<=4,Ee=f===5?4:Math.max(1,Math.min(f,4)),De=ge=>ge<=Ee,Oe=ge=>{De(ge)&&x(ge)},je=()=>{lv(),N(Ro),x(0),F(!1),U(!1)};R.useEffect(()=>{tv(f,d,H)},[H,d,f]);const ce=R.useMemo(()=>{const ge=d.localFolders.length>0?d.localFolders.slice(0,3).map(me=>`${me.project||"Unassigned"}: ${qg(me.path)}`):["No local folders tagged yet"],V=d.googleDriveFolders.length>0?d.googleDriveFolders.slice(0,3).map(me=>qg(me.path)):["No Google Drive folders selected yet"],Ue=d.inferredProjects.length>0?d.inferredProjects.slice(0,3).map(me=>{const ct=me.sourceFolders.length+me.gdriveFolders.length+me.gdocDocuments.length;return`${me.name} (${ct} source${ct===1?"":"s"})`}):["Projects will appear after source analysis"];return[{step:0,label:"Homepage",lines:["Overview: Pac-Man onboarding landing page","Use this to revisit the product framing and onboarding promise","Edit path: jump back here from any later step"]},{step:1,label:"Identity",lines:[`Name: ${d.name.trim()||"Not set"}`,`Email: ${d.email.trim()||"Required"}`,`Role: ${nv(d.profileType)}`,`Assistant: ${d.assistantName.trim()||"Atlas"}`]},{step:2,label:"Integrations",lines:[`Connected: ${d.integrations.length>0?d.integrations.map(av).join(", "):"None yet"}`,`Local folders: ${d.localFolders.length}`,`Drive folders: ${d.googleDriveFolders.length}`,...ge]},{step:3,label:"Project Structure",lines:[`Projects: ${d.inferredProjects.length||0}`,...d.projectInference?[`Inference: ${d.projectInference.strategy==="ollama"?d.projectInference.model??"Ollama":"Local heuristic"}`]:["Inference: Waiting for preview"],`Files ready: ${Object.keys(d.templateFiles).length}`,...Ue]},{step:4,label:"Storage",lines:d.storageMode==="local"?["Mode: Local workspace",`Path: ${d.localPath.trim()||"Not set"}`]:["Mode: Google Drive",`Folder: ${d.gdriveFolderName.trim()||"Not set"}`,`Location: ${d.gdriveFolderPath.trim()||"Pending"}`,`Watched folders: ${d.googleDriveFolders.length}`,...V]}]},[d]),fe=f>=1&&f<=4,Ce=f-1,Ze=(ge=!1)=>i.jsxs("div",{className:`onboarding-summary-panel ${ge?"mobile":"desktop"}`,children:[i.jsxs("div",{className:"onboarding-summary-header",children:[i.jsxs("div",{children:[i.jsx("span",{className:"onboarding-summary-kicker",children:"Saved Choices"}),i.jsx("h3",{children:"Review and edit your setup"})]}),i.jsxs("span",{className:"onboarding-summary-count",children:[Ee," of 4 ready"]})]}),i.jsx("div",{className:"onboarding-summary-list",children:ce.map(V=>{const Ue=V.step===0?!0:De(V.step),me=f===V.step;return i.jsxs("button",{type:"button",className:`onboarding-summary-card ${me?"current":""}`,onClick:()=>Oe(V.step),disabled:!Ue,children:[i.jsxs("div",{className:"onboarding-summary-card-top",children:[i.jsxs("div",{className:"onboarding-summary-card-title",children:[i.jsx("span",{className:"onboarding-summary-step",children:V.step}),i.jsxs("div",{children:[i.jsx("strong",{children:V.label}),i.jsx("span",{children:me?"Current step":Ue?"Edit step":"Locked until earlier steps are complete"})]})]}),i.jsx("span",{className:"onboarding-summary-action",children:Ue?"Edit":"Locked"})]}),i.jsx("div",{className:"onboarding-summary-lines",children:V.lines.slice(0,ge?3:4).map(ct=>i.jsx("span",{children:ct},ct))})]},V.label)})})]});return i.jsx("div",{className:`container ${de?"container-with-sidebar":""}`,children:i.jsxs("div",{className:`onboarding-shell ${de?"with-summary":""}`,children:[i.jsxs("div",{className:"onboarding-main",children:[fe&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"step-header",children:[i.jsxs("div",{className:"step-meta",children:[i.jsxs("span",{className:"step-counter",children:[f," / ",ec-1]}),i.jsx("span",{className:"step-name",children:Bo[Ce]})]}),i.jsx("div",{className:"progress-track",children:i.jsx("div",{className:"progress-fill",style:{width:`${Ce/(ec-2)*100}%`}})})]}),i.jsx("div",{className:"pac-progress",style:{"--eaten-width":`${Ce/(ec-2)*100}%`},children:Bo.slice(0,-1).map((ge,V)=>{const Ue=V+1,me=De(Ue);return i.jsxs("button",{type:"button",className:`pac-progress-step ${V<Ce?"eaten":V===Ce?"current":""} ${me?"clickable":"locked"}`,onClick:()=>Oe(Ue),disabled:!me,children:[V===Ce?i.jsx("div",{className:"pacman-char pacman-char-small"}):i.jsx("div",{className:"pac-dot"}),i.jsx("span",{className:"pac-step-label",children:ge})]},ge)})})]}),de&&i.jsxs("div",{className:"onboarding-summary-mobile-wrap",children:[i.jsxs("button",{type:"button",className:"onboarding-summary-toggle",onClick:()=>U(ge=>!ge),children:[i.jsx("span",{children:Q?"Hide your selections":"Review your selections"}),i.jsx("span",{children:Q?"−":"+"})]}),Q&&Ze(!0)]}),f===0&&i.jsx(dp,{onStart:ae}),f===1&&i.jsx(pp,{state:d,update:T,onNext:J}),f===2&&i.jsx(Dp,{state:d,update:T,onNext:J,onPrev:X}),f===3&&i.jsx(qp,{state:d,update:T,onNext:J,onPrev:X}),f===4&&i.jsx(Qp,{state:d,update:T,onNext:J,onPrev:X}),f===5&&i.jsx(Vp,{state:d,alreadySaved:H,onPrev:()=>x(4),onSaved:()=>F(!0),onHardReset:je})]}),de&&i.jsx("aside",{className:"onboarding-summary-sidebar",children:Ze(!1)})]})})}cp.createRoot(document.getElementById("root")).render(i.jsx(Xg.StrictMode,{children:i.jsx(iv,{})}));