leglas 1.2.1 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,14 @@
1
+ (function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))r(f);new MutationObserver(f=>{for(const d of f)if(d.type==="childList")for(const p of d.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&r(p)}).observe(document,{childList:!0,subtree:!0});function c(f){const d={};return f.integrity&&(d.integrity=f.integrity),f.referrerPolicy&&(d.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?d.credentials="include":f.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function r(f){if(f.ep)return;f.ep=!0;const d=c(f);fetch(f.href,d)}})();var vf={exports:{}},bo={};var F0;function og(){if(F0)return bo;F0=1;var a=Symbol.for("react.transitional.element"),s=Symbol.for("react.fragment");function c(r,f,d){var p=null;if(d!==void 0&&(p=""+d),f.key!==void 0&&(p=""+f.key),"key"in f){d={};for(var y in f)y!=="key"&&(d[y]=f[y])}else d=f;return f=d.ref,{$$typeof:a,type:r,key:p,ref:f!==void 0?f:null,props:d}}return bo.Fragment=s,bo.jsx=c,bo.jsxs=c,bo}var J0;function ug(){return J0||(J0=1,vf.exports=og()),vf.exports}var u=ug(),bf={exports:{}},Ae={};var W0;function rg(){if(W0)return Ae;W0=1;var a=Symbol.for("react.transitional.element"),s=Symbol.for("react.portal"),c=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),p=Symbol.for("react.context"),y=Symbol.for("react.forward_ref"),b=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),M=Symbol.for("react.activity"),T=Symbol.iterator;function k(E){return E===null||typeof E!="object"?null:(E=T&&E[T]||E["@@iterator"],typeof E=="function"?E:null)}var N={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},U=Object.assign,$={};function O(E,G,le){this.props=E,this.context=G,this.refs=$,this.updater=le||N}O.prototype.isReactComponent={},O.prototype.setState=function(E,G){if(typeof E!="object"&&typeof E!="function"&&E!=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,E,G,"setState")},O.prototype.forceUpdate=function(E){this.updater.enqueueForceUpdate(this,E,"forceUpdate")};function V(){}V.prototype=O.prototype;function Q(E,G,le){this.props=E,this.context=G,this.refs=$,this.updater=le||N}var X=Q.prototype=new V;X.constructor=Q,U(X,O.prototype),X.isPureReactComponent=!0;var ae=Array.isArray;function P(){}var v={H:null,A:null,T:null,S:null},ne=Object.prototype.hasOwnProperty;function ce(E,G,le){var ue=le.ref;return{$$typeof:a,type:E,key:G,ref:ue!==void 0?ue:null,props:le}}function te(E,G){return ce(E.type,G,E.props)}function xe(E){return typeof E=="object"&&E!==null&&E.$$typeof===a}function re(E){var G={"=":"=0",":":"=2"};return"$"+E.replace(/[=:]/g,function(le){return G[le]})}var Ee=/\/+/g;function ye(E,G){return typeof E=="object"&&E!==null&&E.key!=null?re(""+E.key):G.toString(36)}function De(E){switch(E.status){case"fulfilled":return E.value;case"rejected":throw E.reason;default:switch(typeof E.status=="string"?E.then(P,P):(E.status="pending",E.then(function(G){E.status==="pending"&&(E.status="fulfilled",E.value=G)},function(G){E.status==="pending"&&(E.status="rejected",E.reason=G)})),E.status){case"fulfilled":return E.value;case"rejected":throw E.reason}}throw E}function R(E,G,le,ue,se){var Se=typeof E;(Se==="undefined"||Se==="boolean")&&(E=null);var L=!1;if(E===null)L=!0;else switch(Se){case"bigint":case"string":case"number":L=!0;break;case"object":switch(E.$$typeof){case a:case s:L=!0;break;case S:return L=E._init,R(L(E._payload),G,le,ue,se)}}if(L)return se=se(E),L=ue===""?"."+ye(E,0):ue,ae(se)?(le="",L!=null&&(le=L.replace(Ee,"$&/")+"/"),R(se,G,le,"",function(pe){return pe})):se!=null&&(xe(se)&&(se=te(se,le+(se.key==null||E&&E.key===se.key?"":(""+se.key).replace(Ee,"$&/")+"/")+L)),G.push(se)),1;L=0;var Z=ue===""?".":ue+":";if(ae(E))for(var ie=0;ie<E.length;ie++)ue=E[ie],Se=Z+ye(ue,ie),L+=R(ue,G,le,Se,se);else if(ie=k(E),typeof ie=="function")for(E=ie.call(E),ie=0;!(ue=E.next()).done;)ue=ue.value,Se=Z+ye(ue,ie++),L+=R(ue,G,le,Se,se);else if(Se==="object"){if(typeof E.then=="function")return R(De(E),G,le,ue,se);throw G=String(E),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(E).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return L}function W(E,G,le){if(E==null)return E;var ue=[],se=0;return R(E,ue,"","",function(Se){return G.call(le,Se,se++)}),ue}function oe(E){if(E._status===-1){var G=E._result;G=G(),G.then(function(le){(E._status===0||E._status===-1)&&(E._status=1,E._result=le)},function(le){(E._status===0||E._status===-1)&&(E._status=2,E._result=le)}),E._status===-1&&(E._status=0,E._result=G)}if(E._status===1)return E._result.default;throw E._result}var Ce=typeof reportError=="function"?reportError:function(E){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var G=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(G))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",E);return}console.error(E)},we={map:W,forEach:function(E,G,le){W(E,function(){G.apply(this,arguments)},le)},count:function(E){var G=0;return W(E,function(){G++}),G},toArray:function(E){return W(E,function(G){return G})||[]},only:function(E){if(!xe(E))throw Error("React.Children.only expected to receive a single React element child.");return E}};return Ae.Activity=M,Ae.Children=we,Ae.Component=O,Ae.Fragment=c,Ae.Profiler=f,Ae.PureComponent=Q,Ae.StrictMode=r,Ae.Suspense=b,Ae.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=v,Ae.__COMPILER_RUNTIME={__proto__:null,c:function(E){return v.H.useMemoCache(E)}},Ae.cache=function(E){return function(){return E.apply(null,arguments)}},Ae.cacheSignal=function(){return null},Ae.cloneElement=function(E,G,le){if(E==null)throw Error("The argument must be a React element, but you passed "+E+".");var ue=U({},E.props),se=E.key;if(G!=null)for(Se in G.key!==void 0&&(se=""+G.key),G)!ne.call(G,Se)||Se==="key"||Se==="__self"||Se==="__source"||Se==="ref"&&G.ref===void 0||(ue[Se]=G[Se]);var Se=arguments.length-2;if(Se===1)ue.children=le;else if(1<Se){for(var L=Array(Se),Z=0;Z<Se;Z++)L[Z]=arguments[Z+2];ue.children=L}return ce(E.type,se,ue)},Ae.createContext=function(E){return E={$$typeof:p,_currentValue:E,_currentValue2:E,_threadCount:0,Provider:null,Consumer:null},E.Provider=E,E.Consumer={$$typeof:d,_context:E},E},Ae.createElement=function(E,G,le){var ue,se={},Se=null;if(G!=null)for(ue in G.key!==void 0&&(Se=""+G.key),G)ne.call(G,ue)&&ue!=="key"&&ue!=="__self"&&ue!=="__source"&&(se[ue]=G[ue]);var L=arguments.length-2;if(L===1)se.children=le;else if(1<L){for(var Z=Array(L),ie=0;ie<L;ie++)Z[ie]=arguments[ie+2];se.children=Z}if(E&&E.defaultProps)for(ue in L=E.defaultProps,L)se[ue]===void 0&&(se[ue]=L[ue]);return ce(E,Se,se)},Ae.createRef=function(){return{current:null}},Ae.forwardRef=function(E){return{$$typeof:y,render:E}},Ae.isValidElement=xe,Ae.lazy=function(E){return{$$typeof:S,_payload:{_status:-1,_result:E},_init:oe}},Ae.memo=function(E,G){return{$$typeof:x,type:E,compare:G===void 0?null:G}},Ae.startTransition=function(E){var G=v.T,le={};v.T=le;try{var ue=E(),se=v.S;se!==null&&se(le,ue),typeof ue=="object"&&ue!==null&&typeof ue.then=="function"&&ue.then(P,Ce)}catch(Se){Ce(Se)}finally{G!==null&&le.types!==null&&(G.types=le.types),v.T=G}},Ae.unstable_useCacheRefresh=function(){return v.H.useCacheRefresh()},Ae.use=function(E){return v.H.use(E)},Ae.useActionState=function(E,G,le){return v.H.useActionState(E,G,le)},Ae.useCallback=function(E,G){return v.H.useCallback(E,G)},Ae.useContext=function(E){return v.H.useContext(E)},Ae.useDebugValue=function(){},Ae.useDeferredValue=function(E,G){return v.H.useDeferredValue(E,G)},Ae.useEffect=function(E,G){return v.H.useEffect(E,G)},Ae.useEffectEvent=function(E){return v.H.useEffectEvent(E)},Ae.useId=function(){return v.H.useId()},Ae.useImperativeHandle=function(E,G,le){return v.H.useImperativeHandle(E,G,le)},Ae.useInsertionEffect=function(E,G){return v.H.useInsertionEffect(E,G)},Ae.useLayoutEffect=function(E,G){return v.H.useLayoutEffect(E,G)},Ae.useMemo=function(E,G){return v.H.useMemo(E,G)},Ae.useOptimistic=function(E,G){return v.H.useOptimistic(E,G)},Ae.useReducer=function(E,G,le){return v.H.useReducer(E,G,le)},Ae.useRef=function(E){return v.H.useRef(E)},Ae.useState=function(E){return v.H.useState(E)},Ae.useSyncExternalStore=function(E,G,le){return v.H.useSyncExternalStore(E,G,le)},Ae.useTransition=function(){return v.H.useTransition()},Ae.version="19.2.8",Ae}var I0;function Xf(){return I0||(I0=1,bf.exports=rg()),bf.exports}var w=Xf(),wf={exports:{}},wo={},Sf={exports:{}},jf={};var P0;function cg(){return P0||(P0=1,(function(a){function s(R,W){var oe=R.length;R.push(W);e:for(;0<oe;){var Ce=oe-1>>>1,we=R[Ce];if(0<f(we,W))R[Ce]=W,R[oe]=we,oe=Ce;else break e}}function c(R){return R.length===0?null:R[0]}function r(R){if(R.length===0)return null;var W=R[0],oe=R.pop();if(oe!==W){R[0]=oe;e:for(var Ce=0,we=R.length,E=we>>>1;Ce<E;){var G=2*(Ce+1)-1,le=R[G],ue=G+1,se=R[ue];if(0>f(le,oe))ue<we&&0>f(se,le)?(R[Ce]=se,R[ue]=oe,Ce=ue):(R[Ce]=le,R[G]=oe,Ce=G);else if(ue<we&&0>f(se,oe))R[Ce]=se,R[ue]=oe,Ce=ue;else break e}}return W}function f(R,W){var oe=R.sortIndex-W.sortIndex;return oe!==0?oe:R.id-W.id}if(a.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;a.unstable_now=function(){return d.now()}}else{var p=Date,y=p.now();a.unstable_now=function(){return p.now()-y}}var b=[],x=[],S=1,M=null,T=3,k=!1,N=!1,U=!1,$=!1,O=typeof setTimeout=="function"?setTimeout:null,V=typeof clearTimeout=="function"?clearTimeout:null,Q=typeof setImmediate<"u"?setImmediate:null;function X(R){for(var W=c(x);W!==null;){if(W.callback===null)r(x);else if(W.startTime<=R)r(x),W.sortIndex=W.expirationTime,s(b,W);else break;W=c(x)}}function ae(R){if(U=!1,X(R),!N)if(c(b)!==null)N=!0,P||(P=!0,re());else{var W=c(x);W!==null&&De(ae,W.startTime-R)}}var P=!1,v=-1,ne=5,ce=-1;function te(){return $?!0:!(a.unstable_now()-ce<ne)}function xe(){if($=!1,P){var R=a.unstable_now();ce=R;var W=!0;try{e:{N=!1,U&&(U=!1,V(v),v=-1),k=!0;var oe=T;try{t:{for(X(R),M=c(b);M!==null&&!(M.expirationTime>R&&te());){var Ce=M.callback;if(typeof Ce=="function"){M.callback=null,T=M.priorityLevel;var we=Ce(M.expirationTime<=R);if(R=a.unstable_now(),typeof we=="function"){M.callback=we,X(R),W=!0;break t}M===c(b)&&r(b),X(R)}else r(b);M=c(b)}if(M!==null)W=!0;else{var E=c(x);E!==null&&De(ae,E.startTime-R),W=!1}}break e}finally{M=null,T=oe,k=!1}W=void 0}}finally{W?re():P=!1}}}var re;if(typeof Q=="function")re=function(){Q(xe)};else if(typeof MessageChannel<"u"){var Ee=new MessageChannel,ye=Ee.port2;Ee.port1.onmessage=xe,re=function(){ye.postMessage(null)}}else re=function(){O(xe,0)};function De(R,W){v=O(function(){R(a.unstable_now())},W)}a.unstable_IdlePriority=5,a.unstable_ImmediatePriority=1,a.unstable_LowPriority=4,a.unstable_NormalPriority=3,a.unstable_Profiling=null,a.unstable_UserBlockingPriority=2,a.unstable_cancelCallback=function(R){R.callback=null},a.unstable_forceFrameRate=function(R){0>R||125<R?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ne=0<R?Math.floor(1e3/R):5},a.unstable_getCurrentPriorityLevel=function(){return T},a.unstable_next=function(R){switch(T){case 1:case 2:case 3:var W=3;break;default:W=T}var oe=T;T=W;try{return R()}finally{T=oe}},a.unstable_requestPaint=function(){$=!0},a.unstable_runWithPriority=function(R,W){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var oe=T;T=R;try{return W()}finally{T=oe}},a.unstable_scheduleCallback=function(R,W,oe){var Ce=a.unstable_now();switch(typeof oe=="object"&&oe!==null?(oe=oe.delay,oe=typeof oe=="number"&&0<oe?Ce+oe:Ce):oe=Ce,R){case 1:var we=-1;break;case 2:we=250;break;case 5:we=1073741823;break;case 4:we=1e4;break;default:we=5e3}return we=oe+we,R={id:S++,callback:W,priorityLevel:R,startTime:oe,expirationTime:we,sortIndex:-1},oe>Ce?(R.sortIndex=oe,s(x,R),c(b)===null&&R===c(x)&&(U?(V(v),v=-1):U=!0,De(ae,oe-Ce))):(R.sortIndex=we,s(b,R),N||k||(N=!0,P||(P=!0,re()))),R},a.unstable_shouldYield=te,a.unstable_wrapCallback=function(R){var W=T;return function(){var oe=T;T=W;try{return R.apply(this,arguments)}finally{T=oe}}}})(jf)),jf}var e1;function fg(){return e1||(e1=1,Sf.exports=cg()),Sf.exports}var Ef={exports:{}},Wt={};var t1;function dg(){if(t1)return Wt;t1=1;var a=Xf();function s(b){var x="https://react.dev/errors/"+b;if(1<arguments.length){x+="?args[]="+encodeURIComponent(arguments[1]);for(var S=2;S<arguments.length;S++)x+="&args[]="+encodeURIComponent(arguments[S])}return"Minified React error #"+b+"; visit "+x+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(){}var r={d:{f:c,r:function(){throw Error(s(522))},D:c,C:c,L:c,m:c,X:c,S:c,M:c},p:0,findDOMNode:null},f=Symbol.for("react.portal");function d(b,x,S){var M=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:f,key:M==null?null:""+M,children:b,containerInfo:x,implementation:S}}var p=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function y(b,x){if(b==="font")return"";if(typeof x=="string")return x==="use-credentials"?x:""}return Wt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Wt.createPortal=function(b,x){var S=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!x||x.nodeType!==1&&x.nodeType!==9&&x.nodeType!==11)throw Error(s(299));return d(b,x,null,S)},Wt.flushSync=function(b){var x=p.T,S=r.p;try{if(p.T=null,r.p=2,b)return b()}finally{p.T=x,r.p=S,r.d.f()}},Wt.preconnect=function(b,x){typeof b=="string"&&(x?(x=x.crossOrigin,x=typeof x=="string"?x==="use-credentials"?x:"":void 0):x=null,r.d.C(b,x))},Wt.prefetchDNS=function(b){typeof b=="string"&&r.d.D(b)},Wt.preinit=function(b,x){if(typeof b=="string"&&x&&typeof x.as=="string"){var S=x.as,M=y(S,x.crossOrigin),T=typeof x.integrity=="string"?x.integrity:void 0,k=typeof x.fetchPriority=="string"?x.fetchPriority:void 0;S==="style"?r.d.S(b,typeof x.precedence=="string"?x.precedence:void 0,{crossOrigin:M,integrity:T,fetchPriority:k}):S==="script"&&r.d.X(b,{crossOrigin:M,integrity:T,fetchPriority:k,nonce:typeof x.nonce=="string"?x.nonce:void 0})}},Wt.preinitModule=function(b,x){if(typeof b=="string")if(typeof x=="object"&&x!==null){if(x.as==null||x.as==="script"){var S=y(x.as,x.crossOrigin);r.d.M(b,{crossOrigin:S,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0})}}else x==null&&r.d.M(b)},Wt.preload=function(b,x){if(typeof b=="string"&&typeof x=="object"&&x!==null&&typeof x.as=="string"){var S=x.as,M=y(S,x.crossOrigin);r.d.L(b,S,{crossOrigin:M,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0,type:typeof x.type=="string"?x.type:void 0,fetchPriority:typeof x.fetchPriority=="string"?x.fetchPriority:void 0,referrerPolicy:typeof x.referrerPolicy=="string"?x.referrerPolicy:void 0,imageSrcSet:typeof x.imageSrcSet=="string"?x.imageSrcSet:void 0,imageSizes:typeof x.imageSizes=="string"?x.imageSizes:void 0,media:typeof x.media=="string"?x.media:void 0})}},Wt.preloadModule=function(b,x){if(typeof b=="string")if(x){var S=y(x.as,x.crossOrigin);r.d.m(b,{as:typeof x.as=="string"&&x.as!=="script"?x.as:void 0,crossOrigin:S,integrity:typeof x.integrity=="string"?x.integrity:void 0})}else r.d.m(b)},Wt.requestFormReset=function(b){r.d.r(b)},Wt.unstable_batchedUpdates=function(b,x){return b(x)},Wt.useFormState=function(b,x,S){return p.H.useFormState(b,x,S)},Wt.useFormStatus=function(){return p.H.useHostTransitionStatus()},Wt.version="19.2.8",Wt}var n1;function im(){if(n1)return Ef.exports;n1=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(s){console.error(s)}}return a(),Ef.exports=dg(),Ef.exports}var l1;function hg(){if(l1)return wo;l1=1;var a=fg(),s=Xf(),c=im();function r(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}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 f(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function d(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function p(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 y(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 b(e){if(d(e)!==e)throw Error(r(188))}function x(e){var t=e.alternate;if(!t){if(t=d(e),t===null)throw Error(r(188));return t!==e?null:e}for(var n=e,l=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(l=i.return,l!==null){n=l;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return b(i),e;if(o===l)return b(i),t;o=o.sibling}throw Error(r(188))}if(n.return!==l.return)n=i,l=o;else{for(var h=!1,g=i.child;g;){if(g===n){h=!0,n=i,l=o;break}if(g===l){h=!0,l=i,n=o;break}g=g.sibling}if(!h){for(g=o.child;g;){if(g===n){h=!0,n=o,l=i;break}if(g===l){h=!0,l=o,n=i;break}g=g.sibling}if(!h)throw Error(r(189))}}if(n.alternate!==l)throw Error(r(190))}if(n.tag!==3)throw Error(r(188));return n.stateNode.current===n?e:t}function S(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=S(e),t!==null)return t;e=e.sibling}return null}var M=Object.assign,T=Symbol.for("react.element"),k=Symbol.for("react.transitional.element"),N=Symbol.for("react.portal"),U=Symbol.for("react.fragment"),$=Symbol.for("react.strict_mode"),O=Symbol.for("react.profiler"),V=Symbol.for("react.consumer"),Q=Symbol.for("react.context"),X=Symbol.for("react.forward_ref"),ae=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),v=Symbol.for("react.memo"),ne=Symbol.for("react.lazy"),ce=Symbol.for("react.activity"),te=Symbol.for("react.memo_cache_sentinel"),xe=Symbol.iterator;function re(e){return e===null||typeof e!="object"?null:(e=xe&&e[xe]||e["@@iterator"],typeof e=="function"?e:null)}var Ee=Symbol.for("react.client.reference");function ye(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Ee?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case U:return"Fragment";case O:return"Profiler";case $:return"StrictMode";case ae:return"Suspense";case P:return"SuspenseList";case ce:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case N:return"Portal";case Q:return e.displayName||"Context";case V:return(e._context.displayName||"Context")+".Consumer";case X: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:ye(e.type)||"Memo";case ne:t=e._payload,e=e._init;try{return ye(e(t))}catch{}}return null}var De=Array.isArray,R=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W=c.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe={pending:!1,data:null,method:null,action:null},Ce=[],we=-1;function E(e){return{current:e}}function G(e){0>we||(e.current=Ce[we],Ce[we]=null,we--)}function le(e,t){we++,Ce[we]=e.current,e.current=t}var ue=E(null),se=E(null),Se=E(null),L=E(null);function Z(e,t){switch(le(Se,t),le(se,e),le(ue,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?y0(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=y0(t),e=v0(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}G(ue),le(ue,e)}function ie(){G(ue),G(se),G(Se)}function pe(e){e.memoizedState!==null&&le(L,e);var t=ue.current,n=v0(t,e.type);t!==n&&(le(se,e),le(ue,n))}function Me(e){se.current===e&&(G(ue),G(se)),L.current===e&&(G(L),go._currentValue=oe)}var Ve,st;function ot(e){if(Ve===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Ve=t&&t[1]||"",st=-1<n.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+Ve+e+st}var ke=!1;function Pe(e,t){if(!e||ke)return"";ke=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(t){var I=function(){throw Error()};if(Object.defineProperty(I.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(I,[])}catch(Y){var q=Y}Reflect.construct(e,[],I)}else{try{I.call()}catch(Y){q=Y}e.call(I.prototype)}}else{try{throw Error()}catch(Y){q=Y}(I=e())&&typeof I.catch=="function"&&I.catch(function(){})}}catch(Y){if(Y&&q&&typeof Y.stack=="string")return[Y.stack,q.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var i=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");i&&i.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var o=l.DetermineComponentFrameRoot(),h=o[0],g=o[1];if(h&&g){var C=h.split(`
4
+ `),B=g.split(`
5
+ `);for(i=l=0;l<C.length&&!C[l].includes("DetermineComponentFrameRoot");)l++;for(;i<B.length&&!B[i].includes("DetermineComponentFrameRoot");)i++;if(l===C.length||i===B.length)for(l=C.length-1,i=B.length-1;1<=l&&0<=i&&C[l]!==B[i];)i--;for(;1<=l&&0<=i;l--,i--)if(C[l]!==B[i]){if(l!==1||i!==1)do if(l--,i--,0>i||C[l]!==B[i]){var K=`
6
+ `+C[l].replace(" at new "," at ");return e.displayName&&K.includes("<anonymous>")&&(K=K.replace("<anonymous>",e.displayName)),K}while(1<=l&&0<=i);break}}}finally{ke=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?ot(n):""}function kt(e,t){switch(e.tag){case 26:case 27:case 5:return ot(e.type);case 16:return ot("Lazy");case 13:return e.child!==t&&t!==null?ot("Suspense Fallback"):ot("Suspense");case 19:return ot("SuspenseList");case 0:case 15:return Pe(e.type,!1);case 11:return Pe(e.type.render,!1);case 1:return Pe(e.type,!0);case 31:return ot("Activity");default:return""}}function _t(e){try{var t="",n=null;do t+=kt(e,n),n=e,e=e.return;while(e);return t}catch(l){return`
7
+ Error generating stack: `+l.message+`
8
+ `+l.stack}}var en=Object.prototype.hasOwnProperty,Jn=a.unstable_scheduleCallback,Cn=a.unstable_cancelCallback,mi=a.unstable_shouldYield,Ln=a.unstable_requestPaint,mt=a.unstable_now,_n=a.unstable_getCurrentPriorityLevel,Gl=a.unstable_ImmediatePriority,Wn=a.unstable_UserBlockingPriority,ft=a.unstable_NormalPriority,Xl=a.unstable_LowPriority,Aa=a.unstable_IdlePriority,pi=a.log,fs=a.unstable_setDisableYieldValue,dl=null,Bt=null;function Qt(e){if(typeof pi=="function"&&fs(e),Bt&&typeof Bt.setStrictMode=="function")try{Bt.setStrictMode(dl,e)}catch{}}var zt=Math.clz32?Math.clz32:Da,gi=Math.log,xi=Math.LN2;function Da(e){return e>>>=0,e===0?32:31-(gi(e)/xi|0)|0}var hl=256,Ql=262144,Bn=4194304;function Ut(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 pn(e,t,n){var l=e.pendingLanes;if(l===0)return 0;var i=0,o=e.suspendedLanes,h=e.pingedLanes;e=e.warmLanes;var g=l&134217727;return g!==0?(l=g&~o,l!==0?i=Ut(l):(h&=g,h!==0?i=Ut(h):n||(n=g&~e,n!==0&&(i=Ut(n))))):(g=l&~o,g!==0?i=Ut(g):h!==0?i=Ut(h):n||(n=l&~e,n!==0&&(i=Ut(n)))),i===0?0:t!==0&&t!==i&&(t&o)===0&&(o=i&-i,n=t&-t,o>=n||o===32&&(n&4194048)!==0)?t:i}function Vt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ds(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 ml(){var e=Bn;return Bn<<=1,(Bn&62914560)===0&&(Bn=4194304),e}function sn(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ie(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Vl(e,t,n,l,i,o){var h=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var g=e.entanglements,C=e.expirationTimes,B=e.hiddenUpdates;for(n=h&~n;0<n;){var K=31-zt(n),I=1<<K;g[K]=0,C[K]=-1;var q=B[K];if(q!==null)for(B[K]=null,K=0;K<q.length;K++){var Y=q[K];Y!==null&&(Y.lane&=-536870913)}n&=~I}l!==0&&In(e,l,0),o!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=o&~(h&~t))}function In(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-zt(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|n&261930}function Zl(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var l=31-zt(n),i=1<<l;i&t|e[l]&t&&(e[l]|=t),n&=~i}}function F(e,t){var n=t&-t;return n=(n&42)!==0?1:fe(n),(n&(e.suspendedLanes|t))!==0?0:n}function fe(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 Re(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function _e(){var e=W.p;return e!==0?e:(e=window.event,e===void 0?32:Y0(e.type))}function ve(e,t){var n=W.p;try{return W.p=e,t()}finally{W.p=n}}var et=Math.random().toString(36).slice(2),Qe="__reactFiber$"+et,Be="__reactProps$"+et,ut="__reactContainer$"+et,pl="__reactEvents$"+et,To="__reactListeners$"+et,gt="__reactHandles$"+et,hs="__reactResources$"+et,gl="__reactMarker$"+et;function Ht(e){delete e[Qe],delete e[Be],delete e[pl],delete e[To],delete e[gt]}function Un(e){var t=e[Qe];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ut]||n[Qe]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=N0(e);e!==null;){if(n=e[Qe])return n;e=N0(e)}return t}e=n,n=e.parentNode}return null}function xl(e){if(e=e[Qe]||e[ut]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ta(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(r(33))}function yl(e){var t=e[hs];return t||(t=e[hs]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function wt(e){e[gl]=!0}var ka=new Set,ko={};function Rt(e,t){gn(e,t),gn(e+"Capture",t)}function gn(e,t){for(ko[e]=t,e=0;e<t.length;e++)ka.add(t[e])}var yi=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]*$"),zo={},ms={};function ps(e){return en.call(ms,e)?!0:en.call(zo,e)?!1:yi.test(e)?ms[e]=!0:(zo[e]=!0,!1)}function Pn(e,t,n){if(ps(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var l=t.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function za(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function xn(e,t,n,l){if(l===null)e.removeAttribute(n);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+l)}}function on(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ro(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Cr(e,t,n){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var i=l.get,o=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(h){n=""+h,o.call(this,h)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return n},setValue:function(h){n=""+h},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ra(e){if(!e._valueTracker){var t=Ro(e)?"checked":"value";e._valueTracker=Cr(e,t,""+e[t])}}function gs(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),l="";return e&&(l=Ro(e)?e.checked?"true":"false":e.value),e=l,e!==n?(t.setValue(e),!0):!1}function Kl(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 Oo=/[\n"\\]/g;function Zt(e){return e.replace(Oo,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Hn(e,t,n,l,i,o,h,g){e.name="",h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"?e.type=h:e.removeAttribute("type"),t!=null?h==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+on(t)):e.value!==""+on(t)&&(e.value=""+on(t)):h!=="submit"&&h!=="reset"||e.removeAttribute("value"),t!=null?el(e,h,on(t)):n!=null?el(e,h,on(n)):l!=null&&e.removeAttribute("value"),i==null&&o!=null&&(e.defaultChecked=!!o),i!=null&&(e.checked=i&&typeof i!="function"&&typeof i!="symbol"),g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"?e.name=""+on(g):e.removeAttribute("name")}function Oa(e,t,n,l,i,o,h,g){if(o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.type=o),t!=null||n!=null){if(!(o!=="submit"&&o!=="reset"||t!=null)){Ra(e);return}n=n!=null?""+on(n):"",t=t!=null?""+on(t):n,g||t===e.value||(e.value=t),e.defaultValue=t}l=l??i,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=g?e.checked:!!l,e.defaultChecked=!!l,h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.name=h),Ra(e)}function el(e,t,n){t==="number"&&Kl(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function tl(e,t,n,l){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&l&&(e[n].defaultSelected=!0)}else{for(n=""+on(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,l&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function vi(e,t,n){if(t!=null&&(t=""+on(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+on(n):""}function bi(e,t,n,l){if(t==null){if(l!=null){if(n!=null)throw Error(r(92));if(De(l)){if(1<l.length)throw Error(r(93));l=l[0]}n=l}n==null&&(n=""),t=n}n=on(t),e.defaultValue=n,l=e.textContent,l===n&&l!==""&&l!==null&&(e.value=l),Ra(e)}function $n(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Lo=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 xs(e,t,n){var l=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?l?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":l?e.setProperty(t,n):typeof n!="number"||n===0||Lo.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function _o(e,t,n){if(t!=null&&typeof t!="object")throw Error(r(62));if(e=e.style,n!=null){for(var l in n)!n.hasOwnProperty(l)||t!=null&&t.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="");for(var i in t)l=t[i],t.hasOwnProperty(i)&&n[i]!==l&&xs(e,i,l)}else for(var o in t)t.hasOwnProperty(o)&&xs(e,o,t[o])}function ys(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 La=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),wi=/^[\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 nl(e){return wi.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Nn(){}var pt=null;function ll(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var vl=null,qn=null;function Bo(e){var t=xl(e);if(t&&(e=t.stateNode)){var n=e[Be]||null;e:switch(e=t.stateNode,t.type){case"input":if(Hn(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+Zt(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var l=n[t];if(l!==e&&l.form===e.form){var i=l[Be]||null;if(!i)throw Error(r(90));Hn(l,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)l=n[t],l.form===e.form&&gs(l)}break e;case"textarea":vi(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&tl(e,!!n.multiple,t,!1)}}}var Si=!1;function Uo(e,t,n){if(Si)return e(t,n);Si=!0;try{var l=e(t);return l}finally{if(Si=!1,(vl!==null||qn!==null)&&(Ru(),vl&&(t=vl,e=qn,qn=vl=null,Bo(t),e)))for(t=0;t<e.length;t++)Bo(e[t])}}function _a(e,t){var n=e.stateNode;if(n===null)return null;var l=n[Be]||null;if(l===null)return null;n=l[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":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(r(231,t,typeof n));return n}var Kt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ba=!1;if(Kt)try{var Mn={};Object.defineProperty(Mn,"passive",{get:function(){Ba=!0}}),window.addEventListener("test",Mn,Mn),window.removeEventListener("test",Mn,Mn)}catch{Ba=!1}var al=null,vs=null,Ua=null;function ji(){if(Ua)return Ua;var e,t=vs,n=t.length,l,i="value"in al?al.value:al.textContent,o=i.length;for(e=0;e<n&&t[e]===i[e];e++);var h=n-e;for(l=1;l<=h&&t[n-l]===i[o-l];l++);return Ua=i.slice(e,1<l?1-l:void 0)}function Ei(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 Fl(){return!0}function bs(){return!1}function Dt(e){function t(n,l,i,o,h){this._reactName=n,this._targetInst=i,this.type=l,this.nativeEvent=o,this.target=h,this.currentTarget=null;for(var g in e)e.hasOwnProperty(g)&&(n=e[g],this[g]=n?n(o):o[g]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?Fl:bs,this.isPropagationStopped=bs,this}return M(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Fl)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Fl)},persist:function(){},isPersistent:Fl}),t}var tn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ha=Dt(tn),bl=M({},tn,{view:0,detail:0}),Ho=Dt(bl),ws,Ci,wl,il=M({},bl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ai,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!==wl&&(wl&&e.type==="mousemove"?(ws=e.screenX-wl.screenX,Ci=e.screenY-wl.screenY):Ci=ws=0,wl=e),ws)},movementY:function(e){return"movementY"in e?e.movementY:Ci}}),$o=Dt(il),Ni=M({},il,{dataTransfer:0}),Ss=Dt(Ni),Nr=M({},bl,{relatedTarget:0}),js=Dt(Nr),qo=M({},tn,{animationName:0,elapsedTime:0,pseudoElement:0}),yn=Dt(qo),$a=M({},tn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Mi=Dt($a),Yo=M({},tn,{data:0}),Yn=Dt(Yo),qa={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Es={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"},Ya={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Cs(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Ya[e])?!!t[e]:!1}function Ai(){return Cs}var Jl=M({},bl,{key:function(e){if(e.key){var t=qa[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ei(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Es[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ai,charCode:function(e){return e.type==="keypress"?Ei(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ei(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Go=Dt(Jl),Ns=M({},il,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ms=Dt(Ns),Xo=M({},bl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ai}),Ga=Dt(Xo),Qo=M({},tn,{propertyName:0,elapsedTime:0,pseudoElement:0}),Mr=Dt(Qo),Ar=M({},il,{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}),Dr=Dt(Ar),Tr=M({},tn,{newState:0,oldState:0}),kr=Dt(Tr),Vo=[9,13,27,32],Xa=Kt&&"CompositionEvent"in window,Wl=null;Kt&&"documentMode"in document&&(Wl=document.documentMode);var zr=Kt&&"TextEvent"in window&&!Wl,Zo=Kt&&(!Xa||Wl&&8<Wl&&11>=Wl),An=" ",As=!1;function Il(e,t){switch(e){case"keyup":return Vo.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ko(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ft=!1;function Rr(e,t){switch(e){case"compositionend":return Ko(t);case"keypress":return t.which!==32?null:(As=!0,An);case"textInput":return e=t.data,e===An&&As?null:e;default:return null}}function Or(e,t){if(Ft)return e==="compositionend"||!Xa&&Il(e,t)?(e=ji(),Ua=vs=al=null,Ft=!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 Lr={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 Di(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Lr[e.type]:t==="textarea"}function Ti(e,t,n,l){vl?qn?qn.push(l):qn=[l]:vl=l,t=$u(t,"onChange"),0<t.length&&(n=new Ha("onChange","change",null,n,l),e.push({event:n,listeners:t}))}var $t=null,sl=null;function Fo(e){d0(e,0)}function Pl(e){var t=Ta(e);if(gs(t))return e}function Jo(e,t){if(e==="change")return t}var ol=!1;if(Kt){var Ot;if(Kt){var ul="oninput"in document;if(!ul){var ea=document.createElement("div");ea.setAttribute("oninput","return;"),ul=typeof ea.oninput=="function"}Ot=ul}else Ot=!1;ol=Ot&&(!document.documentMode||9<document.documentMode)}function Ds(){$t&&($t.detachEvent("onpropertychange",Ts),sl=$t=null)}function Ts(e){if(e.propertyName==="value"&&Pl(sl)){var t=[];Ti(t,sl,e,ll(e)),Uo(Fo,t)}}function ks(e,t,n){e==="focusin"?(Ds(),$t=t,sl=n,$t.attachEvent("onpropertychange",Ts)):e==="focusout"&&Ds()}function ki(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Pl(sl)}function _r(e,t){if(e==="click")return Pl(t)}function rl(e,t){if(e==="input"||e==="change")return Pl(t)}function zs(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Jt=typeof Object.is=="function"?Object.is:zs;function Qa(e,t){if(Jt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),l=Object.keys(t);if(n.length!==l.length)return!1;for(l=0;l<n.length;l++){var i=n[l];if(!en.call(t,i)||!Jt(e[i],t[i]))return!1}return!0}function zi(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Wo(e,t){var n=zi(e);e=0;for(var l;n;){if(n.nodeType===3){if(l=e+n.textContent.length,e<=t&&l>=t)return{node:n,offset:t-e};e=l}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=zi(n)}}function Io(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Io(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Po(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Kl(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Kl(e.document)}return t}function Rs(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 Br=Kt&&"documentMode"in document&&11>=document.documentMode,Sl=null,Va=null,Za=null,Os=!1;function Ri(e,t,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Os||Sl==null||Sl!==Kl(l)||(l=Sl,"selectionStart"in l&&Rs(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Za&&Qa(Za,l)||(Za=l,l=$u(Va,"onSelect"),0<l.length&&(t=new Ha("onSelect","select",null,t,n),e.push({event:t,listeners:l}),t.target=Sl)))}function jl(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var El={animationend:jl("Animation","AnimationEnd"),animationiteration:jl("Animation","AnimationIteration"),animationstart:jl("Animation","AnimationStart"),transitionrun:jl("Transition","TransitionRun"),transitionstart:jl("Transition","TransitionStart"),transitioncancel:jl("Transition","TransitionCancel"),transitionend:jl("Transition","TransitionEnd")},Cl={},eu={};Kt&&(eu=document.createElement("div").style,"AnimationEvent"in window||(delete El.animationend.animation,delete El.animationiteration.animation,delete El.animationstart.animation),"TransitionEvent"in window||delete El.transitionend.transition);function Nl(e){if(Cl[e])return Cl[e];if(!El[e])return e;var t=El[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in eu)return Cl[e]=t[n];return e}var Ls=Nl("animationend"),Ka=Nl("animationiteration"),_s=Nl("animationstart"),tu=Nl("transitionrun"),Ur=Nl("transitionstart"),ta=Nl("transitioncancel"),nu=Nl("transitionend"),lu=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 vn(e,t){lu.set(e,t),Rt(t,[e])}var Oi=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)},nn=[],na=0,Us=0;function un(){for(var e=na,t=Us=na=0;t<e;){var n=nn[t];nn[t++]=null;var l=nn[t];nn[t++]=null;var i=nn[t];nn[t++]=null;var o=nn[t];if(nn[t++]=null,l!==null&&i!==null){var h=l.pending;h===null?i.next=i:(i.next=h.next,h.next=i),l.pending=i}o!==0&&_i(n,i,o)}}function Li(e,t,n,l){nn[na++]=e,nn[na++]=t,nn[na++]=n,nn[na++]=l,Us|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function la(e,t,n,l){return Li(e,t,n,l),Fa(e)}function Gn(e,t){return Li(e,null,null,t),Fa(e)}function _i(e,t,n){e.lanes|=n;var l=e.alternate;l!==null&&(l.lanes|=n);for(var i=!1,o=e.return;o!==null;)o.childLanes|=n,l=o.alternate,l!==null&&(l.childLanes|=n),o.tag===22&&(e=o.stateNode,e===null||e._visibility&1||(i=!0)),e=o,o=o.return;return e.tag===3?(o=e.stateNode,i&&t!==null&&(i=31-zt(n),e=o.hiddenUpdates,l=e[i],l===null?e[i]=[t]:l.push(t),t.lane=n|536870912),o):null}function Fa(e){if(50<uo)throw uo=0,Yc=null,Error(r(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ml={};function Hr(e,t,n,l){this.tag=e,this.key=n,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=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ln(e,t,n,l){return new Hr(e,t,n,l)}function Hs(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Xn(e,t){var n=e.alternate;return n===null?(n=ln(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function $s(e,t){e.flags&=65011714;var n=e.alternate;return n===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=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Bi(e,t,n,l,i,o){var h=0;if(l=e,typeof e=="function")Hs(e)&&(h=1);else if(typeof e=="string")h=Fp(e,n,ue.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case ce:return e=ln(31,n,t,i),e.elementType=ce,e.lanes=o,e;case U:return Al(n.children,i,o,t);case $:h=8,i|=24;break;case O:return e=ln(12,n,t,i|2),e.elementType=O,e.lanes=o,e;case ae:return e=ln(13,n,t,i),e.elementType=ae,e.lanes=o,e;case P:return e=ln(19,n,t,i),e.elementType=P,e.lanes=o,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Q:h=10;break e;case V:h=9;break e;case X:h=11;break e;case v:h=14;break e;case ne:h=16,l=null;break e}h=29,n=Error(r(130,e===null?"null":typeof e,"")),l=null}return t=ln(h,n,t,i),t.elementType=e,t.type=l,t.lanes=o,t}function Al(e,t,n,l){return e=ln(7,e,l,t),e.lanes=n,e}function qs(e,t,n){return e=ln(6,e,null,t),e.lanes=n,e}function au(e){var t=ln(18,null,null,0);return t.stateNode=e,t}function Ui(e,t,n){return t=ln(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var m=new WeakMap;function j(e,t){if(typeof e=="object"&&e!==null){var n=m.get(e);return n!==void 0?n:(t={value:e,source:t,stack:_t(t)},m.set(e,t),t)}return{value:e,source:t,stack:_t(t)}}var z=[],H=0,ee=null,de=0,he=[],me=0,Ye=null,Oe=1,Ge="";function xt(e,t){z[H++]=de,z[H++]=ee,ee=e,de=t}function Ze(e,t,n){he[me++]=Oe,he[me++]=Ge,he[me++]=Ye,Ye=e;var l=Oe;e=Ge;var i=32-zt(l)-1;l&=~(1<<i),n+=1;var o=32-zt(t)+i;if(30<o){var h=i-i%5;o=(l&(1<<h)-1).toString(32),l>>=h,i-=h,Oe=1<<32-zt(t)+i|n<<i|l,Ge=o+e}else Oe=1<<o|n<<i|l,Ge=e}function rn(e){e.return!==null&&(xt(e,1),Ze(e,1,0))}function Dn(e){for(;e===ee;)ee=z[--H],z[H]=null,de=z[--H],z[H]=null;for(;e===Ye;)Ye=he[--me],he[me]=null,Ge=he[--me],he[me]=null,Oe=he[--me],he[me]=null}function aa(e,t){he[me++]=Oe,he[me++]=Ge,he[me++]=Ye,Oe=t.id,Ge=t.overflow,Ye=e}var St=null,rt=null,Le=!1,Qn=null,yt=!1,Vn=Error(r(519));function ia(e){var t=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ys(j(t,e)),Vn}function Pf(e){var t=e.stateNode,n=e.type,l=e.memoizedProps;switch(t[Qe]=e,t[Be]=l,n){case"dialog":He("cancel",t),He("close",t);break;case"iframe":case"object":case"embed":He("load",t);break;case"video":case"audio":for(n=0;n<co.length;n++)He(co[n],t);break;case"source":He("error",t);break;case"img":case"image":case"link":He("error",t),He("load",t);break;case"details":He("toggle",t);break;case"input":He("invalid",t),Oa(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":He("invalid",t);break;case"textarea":He("invalid",t),bi(t,l.value,l.defaultValue,l.children)}n=l.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||l.suppressHydrationWarning===!0||g0(t.textContent,n)?(l.popover!=null&&(He("beforetoggle",t),He("toggle",t)),l.onScroll!=null&&He("scroll",t),l.onScrollEnd!=null&&He("scrollend",t),l.onClick!=null&&(t.onclick=Nn),t=!0):t=!1,t||ia(e,!0)}function ed(e){for(St=e.return;St;)switch(St.tag){case 5:case 31:case 13:yt=!1;return;case 27:case 3:yt=!0;return;default:St=St.return}}function Hi(e){if(e!==St)return!1;if(!Le)return ed(e),Le=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||lf(e.type,e.memoizedProps)),n=!n),n&&rt&&ia(e),ed(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));rt=C0(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));rt=C0(e)}else t===27?(t=rt,va(e.type)?(e=rf,rf=null,rt=e):rt=t):rt=St?kn(e.stateNode.nextSibling):null;return!0}function Ja(){rt=St=null,Le=!1}function $r(){var e=Qn;return e!==null&&(hn===null?hn=e:hn.push.apply(hn,e),Qn=null),e}function Ys(e){Qn===null?Qn=[e]:Qn.push(e)}var qr=E(null),Wa=null,Dl=null;function sa(e,t,n){le(qr,t._currentValue),t._currentValue=n}function Tl(e){e._currentValue=qr.current,G(qr)}function Yr(e,t,n){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===n)break;e=e.return}}function Gr(e,t,n,l){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var o=i.dependencies;if(o!==null){var h=i.child;o=o.firstContext;e:for(;o!==null;){var g=o;o=i;for(var C=0;C<t.length;C++)if(g.context===t[C]){o.lanes|=n,g=o.alternate,g!==null&&(g.lanes|=n),Yr(o.return,n,e),l||(h=null);break e}o=g.next}}else if(i.tag===18){if(h=i.return,h===null)throw Error(r(341));h.lanes|=n,o=h.alternate,o!==null&&(o.lanes|=n),Yr(h,n,e),h=null}else h=i.child;if(h!==null)h.return=i;else for(h=i;h!==null;){if(h===e){h=null;break}if(i=h.sibling,i!==null){i.return=h.return,h=i;break}h=h.return}i=h}}function $i(e,t,n,l){e=null;for(var i=t,o=!1;i!==null;){if(!o){if((i.flags&524288)!==0)o=!0;else if((i.flags&262144)!==0)break}if(i.tag===10){var h=i.alternate;if(h===null)throw Error(r(387));if(h=h.memoizedProps,h!==null){var g=i.type;Jt(i.pendingProps.value,h.value)||(e!==null?e.push(g):e=[g])}}else if(i===L.current){if(h=i.alternate,h===null)throw Error(r(387));h.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e!==null?e.push(go):e=[go])}i=i.return}e!==null&&Gr(t,e,n,l),t.flags|=262144}function iu(e){for(e=e.firstContext;e!==null;){if(!Jt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ia(e){Wa=e,Dl=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function qt(e){return td(Wa,e)}function su(e,t){return Wa===null&&Ia(e),td(e,t)}function td(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Dl===null){if(e===null)throw Error(r(308));Dl=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Dl=Dl.next=t;return n}var Qm=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,l){e.push(l)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},Vm=a.unstable_scheduleCallback,Zm=a.unstable_NormalPriority,Ct={$$typeof:Q,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Xr(){return{controller:new Qm,data:new Map,refCount:0}}function Gs(e){e.refCount--,e.refCount===0&&Vm(Zm,function(){e.controller.abort()})}var Xs=null,Qr=0,qi=0,Yi=null;function Km(e,t){if(Xs===null){var n=Xs=[];Qr=0,qi=Kc(),Yi={status:"pending",value:void 0,then:function(l){n.push(l)}}}return Qr++,t.then(nd,nd),t}function nd(){if(--Qr===0&&Xs!==null){Yi!==null&&(Yi.status="fulfilled");var e=Xs;Xs=null,qi=0,Yi=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Fm(e,t){var n=[],l={status:"pending",value:null,reason:null,then:function(i){n.push(i)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var i=0;i<n.length;i++)(0,n[i])(t)},function(i){for(l.status="rejected",l.reason=i,i=0;i<n.length;i++)(0,n[i])(void 0)}),l}var ld=R.S;R.S=function(e,t){$h=mt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Km(e,t),ld!==null&&ld(e,t)};var Pa=E(null);function Vr(){var e=Pa.current;return e!==null?e:ct.pooledCache}function ou(e,t){t===null?le(Pa,Pa.current):le(Pa,t.pool)}function ad(){var e=Vr();return e===null?null:{parent:Ct._currentValue,pool:e}}var Gi=Error(r(460)),Zr=Error(r(474)),uu=Error(r(542)),ru={then:function(){}};function id(e){return e=e.status,e==="fulfilled"||e==="rejected"}function sd(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Nn,Nn),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,ud(e),e;default:if(typeof t.status=="string")t.then(Nn,Nn);else{if(e=ct,e!==null&&100<e.shellSuspendCounter)throw Error(r(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var i=t;i.status="fulfilled",i.value=l}},function(l){if(t.status==="pending"){var i=t;i.status="rejected",i.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,ud(e),e}throw ti=t,Gi}}function ei(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(ti=n,Gi):n}}var ti=null;function od(){if(ti===null)throw Error(r(459));var e=ti;return ti=null,e}function ud(e){if(e===Gi||e===uu)throw Error(r(483))}var Xi=null,Qs=0;function cu(e){var t=Qs;return Qs+=1,Xi===null&&(Xi=[]),sd(Xi,e,t)}function Vs(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function fu(e,t){throw t.$$typeof===T?Error(r(525)):(e=Object.prototype.toString.call(t),Error(r(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function rd(e){function t(D,A){if(e){var _=D.deletions;_===null?(D.deletions=[A],D.flags|=16):_.push(A)}}function n(D,A){if(!e)return null;for(;A!==null;)t(D,A),A=A.sibling;return null}function l(D){for(var A=new Map;D!==null;)D.key!==null?A.set(D.key,D):A.set(D.index,D),D=D.sibling;return A}function i(D,A){return D=Xn(D,A),D.index=0,D.sibling=null,D}function o(D,A,_){return D.index=_,e?(_=D.alternate,_!==null?(_=_.index,_<A?(D.flags|=67108866,A):_):(D.flags|=67108866,A)):(D.flags|=1048576,A)}function h(D){return e&&D.alternate===null&&(D.flags|=67108866),D}function g(D,A,_,J){return A===null||A.tag!==6?(A=qs(_,D.mode,J),A.return=D,A):(A=i(A,_),A.return=D,A)}function C(D,A,_,J){var je=_.type;return je===U?K(D,A,_.props.children,J,_.key):A!==null&&(A.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===ne&&ei(je)===A.type)?(A=i(A,_.props),Vs(A,_),A.return=D,A):(A=Bi(_.type,_.key,_.props,null,D.mode,J),Vs(A,_),A.return=D,A)}function B(D,A,_,J){return A===null||A.tag!==4||A.stateNode.containerInfo!==_.containerInfo||A.stateNode.implementation!==_.implementation?(A=Ui(_,D.mode,J),A.return=D,A):(A=i(A,_.children||[]),A.return=D,A)}function K(D,A,_,J,je){return A===null||A.tag!==7?(A=Al(_,D.mode,J,je),A.return=D,A):(A=i(A,_),A.return=D,A)}function I(D,A,_){if(typeof A=="string"&&A!==""||typeof A=="number"||typeof A=="bigint")return A=qs(""+A,D.mode,_),A.return=D,A;if(typeof A=="object"&&A!==null){switch(A.$$typeof){case k:return _=Bi(A.type,A.key,A.props,null,D.mode,_),Vs(_,A),_.return=D,_;case N:return A=Ui(A,D.mode,_),A.return=D,A;case ne:return A=ei(A),I(D,A,_)}if(De(A)||re(A))return A=Al(A,D.mode,_,null),A.return=D,A;if(typeof A.then=="function")return I(D,cu(A),_);if(A.$$typeof===Q)return I(D,su(D,A),_);fu(D,A)}return null}function q(D,A,_,J){var je=A!==null?A.key:null;if(typeof _=="string"&&_!==""||typeof _=="number"||typeof _=="bigint")return je!==null?null:g(D,A,""+_,J);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case k:return _.key===je?C(D,A,_,J):null;case N:return _.key===je?B(D,A,_,J):null;case ne:return _=ei(_),q(D,A,_,J)}if(De(_)||re(_))return je!==null?null:K(D,A,_,J,null);if(typeof _.then=="function")return q(D,A,cu(_),J);if(_.$$typeof===Q)return q(D,A,su(D,_),J);fu(D,_)}return null}function Y(D,A,_,J,je){if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return D=D.get(_)||null,g(A,D,""+J,je);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case k:return D=D.get(J.key===null?_:J.key)||null,C(A,D,J,je);case N:return D=D.get(J.key===null?_:J.key)||null,B(A,D,J,je);case ne:return J=ei(J),Y(D,A,_,J,je)}if(De(J)||re(J))return D=D.get(_)||null,K(A,D,J,je,null);if(typeof J.then=="function")return Y(D,A,_,cu(J),je);if(J.$$typeof===Q)return Y(D,A,_,su(A,J),je);fu(A,J)}return null}function ge(D,A,_,J){for(var je=null,Ke=null,be=A,ze=A=0,qe=null;be!==null&&ze<_.length;ze++){be.index>ze?(qe=be,be=null):qe=be.sibling;var Fe=q(D,be,_[ze],J);if(Fe===null){be===null&&(be=qe);break}e&&be&&Fe.alternate===null&&t(D,be),A=o(Fe,A,ze),Ke===null?je=Fe:Ke.sibling=Fe,Ke=Fe,be=qe}if(ze===_.length)return n(D,be),Le&&xt(D,ze),je;if(be===null){for(;ze<_.length;ze++)be=I(D,_[ze],J),be!==null&&(A=o(be,A,ze),Ke===null?je=be:Ke.sibling=be,Ke=be);return Le&&xt(D,ze),je}for(be=l(be);ze<_.length;ze++)qe=Y(be,D,ze,_[ze],J),qe!==null&&(e&&qe.alternate!==null&&be.delete(qe.key===null?ze:qe.key),A=o(qe,A,ze),Ke===null?je=qe:Ke.sibling=qe,Ke=qe);return e&&be.forEach(function(Ea){return t(D,Ea)}),Le&&xt(D,ze),je}function Ne(D,A,_,J){if(_==null)throw Error(r(151));for(var je=null,Ke=null,be=A,ze=A=0,qe=null,Fe=_.next();be!==null&&!Fe.done;ze++,Fe=_.next()){be.index>ze?(qe=be,be=null):qe=be.sibling;var Ea=q(D,be,Fe.value,J);if(Ea===null){be===null&&(be=qe);break}e&&be&&Ea.alternate===null&&t(D,be),A=o(Ea,A,ze),Ke===null?je=Ea:Ke.sibling=Ea,Ke=Ea,be=qe}if(Fe.done)return n(D,be),Le&&xt(D,ze),je;if(be===null){for(;!Fe.done;ze++,Fe=_.next())Fe=I(D,Fe.value,J),Fe!==null&&(A=o(Fe,A,ze),Ke===null?je=Fe:Ke.sibling=Fe,Ke=Fe);return Le&&xt(D,ze),je}for(be=l(be);!Fe.done;ze++,Fe=_.next())Fe=Y(be,D,ze,Fe.value,J),Fe!==null&&(e&&Fe.alternate!==null&&be.delete(Fe.key===null?ze:Fe.key),A=o(Fe,A,ze),Ke===null?je=Fe:Ke.sibling=Fe,Ke=Fe);return e&&be.forEach(function(sg){return t(D,sg)}),Le&&xt(D,ze),je}function it(D,A,_,J){if(typeof _=="object"&&_!==null&&_.type===U&&_.key===null&&(_=_.props.children),typeof _=="object"&&_!==null){switch(_.$$typeof){case k:e:{for(var je=_.key;A!==null;){if(A.key===je){if(je=_.type,je===U){if(A.tag===7){n(D,A.sibling),J=i(A,_.props.children),J.return=D,D=J;break e}}else if(A.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===ne&&ei(je)===A.type){n(D,A.sibling),J=i(A,_.props),Vs(J,_),J.return=D,D=J;break e}n(D,A);break}else t(D,A);A=A.sibling}_.type===U?(J=Al(_.props.children,D.mode,J,_.key),J.return=D,D=J):(J=Bi(_.type,_.key,_.props,null,D.mode,J),Vs(J,_),J.return=D,D=J)}return h(D);case N:e:{for(je=_.key;A!==null;){if(A.key===je)if(A.tag===4&&A.stateNode.containerInfo===_.containerInfo&&A.stateNode.implementation===_.implementation){n(D,A.sibling),J=i(A,_.children||[]),J.return=D,D=J;break e}else{n(D,A);break}else t(D,A);A=A.sibling}J=Ui(_,D.mode,J),J.return=D,D=J}return h(D);case ne:return _=ei(_),it(D,A,_,J)}if(De(_))return ge(D,A,_,J);if(re(_)){if(je=re(_),typeof je!="function")throw Error(r(150));return _=je.call(_),Ne(D,A,_,J)}if(typeof _.then=="function")return it(D,A,cu(_),J);if(_.$$typeof===Q)return it(D,A,su(D,_),J);fu(D,_)}return typeof _=="string"&&_!==""||typeof _=="number"||typeof _=="bigint"?(_=""+_,A!==null&&A.tag===6?(n(D,A.sibling),J=i(A,_),J.return=D,D=J):(n(D,A),J=qs(_,D.mode,J),J.return=D,D=J),h(D)):n(D,A)}return function(D,A,_,J){try{Qs=0;var je=it(D,A,_,J);return Xi=null,je}catch(be){if(be===Gi||be===uu)throw be;var Ke=ln(29,be,null,D.mode);return Ke.lanes=J,Ke.return=D,Ke}}}var ni=rd(!0),cd=rd(!1),oa=!1;function Kr(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Fr(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 ua(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ra(e,t,n){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(We&2)!==0){var i=l.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),l.pending=t,t=Fa(e),_i(e,null,n),t}return Li(e,l,t,n),Fa(e)}function Zs(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,Zl(e,n)}}function Jr(e,t){var n=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,n===l)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var h={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};o===null?i=o=h:o=o.next=h,n=n.next}while(n!==null);o===null?i=o=t:o=o.next=t}else i=o=t;n={baseState:l.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:l.shared,callbacks:l.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Wr=!1;function Ks(){if(Wr){var e=Yi;if(e!==null)throw e}}function Fs(e,t,n,l){Wr=!1;var i=e.updateQueue;oa=!1;var o=i.firstBaseUpdate,h=i.lastBaseUpdate,g=i.shared.pending;if(g!==null){i.shared.pending=null;var C=g,B=C.next;C.next=null,h===null?o=B:h.next=B,h=C;var K=e.alternate;K!==null&&(K=K.updateQueue,g=K.lastBaseUpdate,g!==h&&(g===null?K.firstBaseUpdate=B:g.next=B,K.lastBaseUpdate=C))}if(o!==null){var I=i.baseState;h=0,K=B=C=null,g=o;do{var q=g.lane&-536870913,Y=q!==g.lane;if(Y?($e&q)===q:(l&q)===q){q!==0&&q===qi&&(Wr=!0),K!==null&&(K=K.next={lane:0,tag:g.tag,payload:g.payload,callback:null,next:null});e:{var ge=e,Ne=g;q=t;var it=n;switch(Ne.tag){case 1:if(ge=Ne.payload,typeof ge=="function"){I=ge.call(it,I,q);break e}I=ge;break e;case 3:ge.flags=ge.flags&-65537|128;case 0:if(ge=Ne.payload,q=typeof ge=="function"?ge.call(it,I,q):ge,q==null)break e;I=M({},I,q);break e;case 2:oa=!0}}q=g.callback,q!==null&&(e.flags|=64,Y&&(e.flags|=8192),Y=i.callbacks,Y===null?i.callbacks=[q]:Y.push(q))}else Y={lane:q,tag:g.tag,payload:g.payload,callback:g.callback,next:null},K===null?(B=K=Y,C=I):K=K.next=Y,h|=q;if(g=g.next,g===null){if(g=i.shared.pending,g===null)break;Y=g,g=Y.next,Y.next=null,i.lastBaseUpdate=Y,i.shared.pending=null}}while(!0);K===null&&(C=I),i.baseState=C,i.firstBaseUpdate=B,i.lastBaseUpdate=K,o===null&&(i.shared.lanes=0),ma|=h,e.lanes=h,e.memoizedState=I}}function fd(e,t){if(typeof e!="function")throw Error(r(191,e));e.call(t)}function dd(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)fd(n[e],t)}var Qi=E(null),du=E(0);function hd(e,t){e=Hl,le(du,e),le(Qi,t),Hl=e|t.baseLanes}function Ir(){le(du,Hl),le(Qi,Qi.current)}function Pr(){Hl=du.current,G(Qi),G(du)}var bn=E(null),Tn=null;function ca(e){var t=e.alternate;le(jt,jt.current&1),le(bn,e),Tn===null&&(t===null||Qi.current!==null||t.memoizedState!==null)&&(Tn=e)}function ec(e){le(jt,jt.current),le(bn,e),Tn===null&&(Tn=e)}function md(e){e.tag===22?(le(jt,jt.current),le(bn,e),Tn===null&&(Tn=e)):fa()}function fa(){le(jt,jt.current),le(bn,bn.current)}function wn(e){G(bn),Tn===e&&(Tn=null),G(jt)}var jt=E(0);function hu(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||of(n)||uf(n)))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 kl=0,Te=null,lt=null,Nt=null,mu=!1,Vi=!1,li=!1,pu=0,Js=0,Zi=null,Jm=0;function vt(){throw Error(r(321))}function tc(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Jt(e[n],t[n]))return!1;return!0}function nc(e,t,n,l,i,o){return kl=o,Te=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,R.H=e===null||e.memoizedState===null?Wd:xc,li=!1,o=n(l,i),li=!1,Vi&&(o=gd(t,n,l,i)),pd(e),o}function pd(e){R.H=Ps;var t=lt!==null&&lt.next!==null;if(kl=0,Nt=lt=Te=null,mu=!1,Js=0,Zi=null,t)throw Error(r(300));e===null||Mt||(e=e.dependencies,e!==null&&iu(e)&&(Mt=!0))}function gd(e,t,n,l){Te=e;var i=0;do{if(Vi&&(Zi=null),Js=0,Vi=!1,25<=i)throw Error(r(301));if(i+=1,Nt=lt=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}R.H=Id,o=t(n,l)}while(Vi);return o}function Wm(){var e=R.H,t=e.useState()[0];return t=typeof t.then=="function"?Ws(t):t,e=e.useState()[0],(lt!==null?lt.memoizedState:null)!==e&&(Te.flags|=1024),t}function lc(){var e=pu!==0;return pu=0,e}function ac(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function ic(e){if(mu){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}mu=!1}kl=0,Nt=lt=Te=null,Vi=!1,Js=pu=0,Zi=null}function an(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Nt===null?Te.memoizedState=Nt=e:Nt=Nt.next=e,Nt}function Et(){if(lt===null){var e=Te.alternate;e=e!==null?e.memoizedState:null}else e=lt.next;var t=Nt===null?Te.memoizedState:Nt.next;if(t!==null)Nt=t,lt=e;else{if(e===null)throw Te.alternate===null?Error(r(467)):Error(r(310));lt=e,e={memoizedState:lt.memoizedState,baseState:lt.baseState,baseQueue:lt.baseQueue,queue:lt.queue,next:null},Nt===null?Te.memoizedState=Nt=e:Nt=Nt.next=e}return Nt}function gu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ws(e){var t=Js;return Js+=1,Zi===null&&(Zi=[]),e=sd(Zi,e,t),t=Te,(Nt===null?t.memoizedState:Nt.next)===null&&(t=t.alternate,R.H=t===null||t.memoizedState===null?Wd:xc),e}function xu(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Ws(e);if(e.$$typeof===Q)return qt(e)}throw Error(r(438,String(e)))}function sc(e){var t=null,n=Te.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var l=Te.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(i){return i.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=gu(),Te.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),l=0;l<e;l++)n[l]=te;return t.index++,n}function zl(e,t){return typeof t=="function"?t(e):t}function yu(e){var t=Et();return oc(t,lt,e)}function oc(e,t,n){var l=e.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=n;var i=e.baseQueue,o=l.pending;if(o!==null){if(i!==null){var h=i.next;i.next=o.next,o.next=h}t.baseQueue=i=o,l.pending=null}if(o=e.baseState,i===null)e.memoizedState=o;else{t=i.next;var g=h=null,C=null,B=t,K=!1;do{var I=B.lane&-536870913;if(I!==B.lane?($e&I)===I:(kl&I)===I){var q=B.revertLane;if(q===0)C!==null&&(C=C.next={lane:0,revertLane:0,gesture:null,action:B.action,hasEagerState:B.hasEagerState,eagerState:B.eagerState,next:null}),I===qi&&(K=!0);else if((kl&q)===q){B=B.next,q===qi&&(K=!0);continue}else I={lane:0,revertLane:B.revertLane,gesture:null,action:B.action,hasEagerState:B.hasEagerState,eagerState:B.eagerState,next:null},C===null?(g=C=I,h=o):C=C.next=I,Te.lanes|=q,ma|=q;I=B.action,li&&n(o,I),o=B.hasEagerState?B.eagerState:n(o,I)}else q={lane:I,revertLane:B.revertLane,gesture:B.gesture,action:B.action,hasEagerState:B.hasEagerState,eagerState:B.eagerState,next:null},C===null?(g=C=q,h=o):C=C.next=q,Te.lanes|=I,ma|=I;B=B.next}while(B!==null&&B!==t);if(C===null?h=o:C.next=g,!Jt(o,e.memoizedState)&&(Mt=!0,K&&(n=Yi,n!==null)))throw n;e.memoizedState=o,e.baseState=h,e.baseQueue=C,l.lastRenderedState=o}return i===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function uc(e){var t=Et(),n=t.queue;if(n===null)throw Error(r(311));n.lastRenderedReducer=e;var l=n.dispatch,i=n.pending,o=t.memoizedState;if(i!==null){n.pending=null;var h=i=i.next;do o=e(o,h.action),h=h.next;while(h!==i);Jt(o,t.memoizedState)||(Mt=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,l]}function xd(e,t,n){var l=Te,i=Et(),o=Le;if(o){if(n===void 0)throw Error(r(407));n=n()}else n=t();var h=!Jt((lt||i).memoizedState,n);if(h&&(i.memoizedState=n,Mt=!0),i=i.queue,fc(bd.bind(null,l,i,e),[e]),i.getSnapshot!==t||h||Nt!==null&&Nt.memoizedState.tag&1){if(l.flags|=2048,Ki(9,{destroy:void 0},vd.bind(null,l,i,n,t),null),ct===null)throw Error(r(349));o||(kl&127)!==0||yd(l,t,n)}return n}function yd(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Te.updateQueue,t===null?(t=gu(),Te.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function vd(e,t,n,l){t.value=n,t.getSnapshot=l,wd(t)&&Sd(e)}function bd(e,t,n){return n(function(){wd(t)&&Sd(e)})}function wd(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Jt(e,n)}catch{return!0}}function Sd(e){var t=Gn(e,2);t!==null&&mn(t,e,2)}function rc(e){var t=an();if(typeof e=="function"){var n=e;if(e=n(),li){Qt(!0);try{n()}finally{Qt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:zl,lastRenderedState:e},t}function jd(e,t,n,l){return e.baseState=n,oc(e,lt,typeof l=="function"?l:zl)}function Im(e,t,n,l,i){if(wu(e))throw Error(r(485));if(e=t.action,e!==null){var o={payload:i,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(h){o.listeners.push(h)}};R.T!==null?n(!0):o.isTransition=!1,l(o),n=t.pending,n===null?(o.next=t.pending=o,Ed(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Ed(e,t){var n=t.action,l=t.payload,i=e.state;if(t.isTransition){var o=R.T,h={};R.T=h;try{var g=n(i,l),C=R.S;C!==null&&C(h,g),Cd(e,t,g)}catch(B){cc(e,t,B)}finally{o!==null&&h.types!==null&&(o.types=h.types),R.T=o}}else try{o=n(i,l),Cd(e,t,o)}catch(B){cc(e,t,B)}}function Cd(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(l){Nd(e,t,l)},function(l){return cc(e,t,l)}):Nd(e,t,n)}function Nd(e,t,n){t.status="fulfilled",t.value=n,Md(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Ed(e,n)))}function cc(e,t,n){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=n,Md(t),t=t.next;while(t!==l)}e.action=null}function Md(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ad(e,t){return t}function Dd(e,t){if(Le){var n=ct.formState;if(n!==null){e:{var l=Te;if(Le){if(rt){t:{for(var i=rt,o=yt;i.nodeType!==8;){if(!o){i=null;break t}if(i=kn(i.nextSibling),i===null){i=null;break t}}o=i.data,i=o==="F!"||o==="F"?i:null}if(i){rt=kn(i.nextSibling),l=i.data==="F!";break e}}ia(l)}l=!1}l&&(t=n[0])}}return n=an(),n.memoizedState=n.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ad,lastRenderedState:t},n.queue=l,n=Kd.bind(null,Te,l),l.dispatch=n,l=rc(!1),o=gc.bind(null,Te,!1,l.queue),l=an(),i={state:t,dispatch:null,action:e,pending:null},l.queue=i,n=Im.bind(null,Te,i,o,n),i.dispatch=n,l.memoizedState=e,[t,n,!1]}function Td(e){var t=Et();return kd(t,lt,e)}function kd(e,t,n){if(t=oc(e,t,Ad)[0],e=yu(zl)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=Ws(t)}catch(h){throw h===Gi?uu:h}else l=t;t=Et();var i=t.queue,o=i.dispatch;return n!==t.memoizedState&&(Te.flags|=2048,Ki(9,{destroy:void 0},Pm.bind(null,i,n),null)),[l,o,e]}function Pm(e,t){e.action=t}function zd(e){var t=Et(),n=lt;if(n!==null)return kd(t,n,e);Et(),t=t.memoizedState,n=Et();var l=n.queue.dispatch;return n.memoizedState=e,[t,l,!1]}function Ki(e,t,n,l){return e={tag:e,create:n,deps:l,inst:t,next:null},t=Te.updateQueue,t===null&&(t=gu(),Te.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(l=n.next,n.next=e,e.next=l,t.lastEffect=e),e}function Rd(){return Et().memoizedState}function vu(e,t,n,l){var i=an();Te.flags|=e,i.memoizedState=Ki(1|t,{destroy:void 0},n,l===void 0?null:l)}function bu(e,t,n,l){var i=Et();l=l===void 0?null:l;var o=i.memoizedState.inst;lt!==null&&l!==null&&tc(l,lt.memoizedState.deps)?i.memoizedState=Ki(t,o,n,l):(Te.flags|=e,i.memoizedState=Ki(1|t,o,n,l))}function Od(e,t){vu(8390656,8,e,t)}function fc(e,t){bu(2048,8,e,t)}function ep(e){Te.flags|=4;var t=Te.updateQueue;if(t===null)t=gu(),Te.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Ld(e){var t=Et().memoizedState;return ep({ref:t,nextImpl:e}),function(){if((We&2)!==0)throw Error(r(440));return t.impl.apply(void 0,arguments)}}function _d(e,t){return bu(4,2,e,t)}function Bd(e,t){return bu(4,4,e,t)}function Ud(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Hd(e,t,n){n=n!=null?n.concat([e]):null,bu(4,4,Ud.bind(null,t,e),n)}function dc(){}function $d(e,t){var n=Et();t=t===void 0?null:t;var l=n.memoizedState;return t!==null&&tc(t,l[1])?l[0]:(n.memoizedState=[e,t],e)}function qd(e,t){var n=Et();t=t===void 0?null:t;var l=n.memoizedState;if(t!==null&&tc(t,l[1]))return l[0];if(l=e(),li){Qt(!0);try{e()}finally{Qt(!1)}}return n.memoizedState=[l,t],l}function hc(e,t,n){return n===void 0||(kl&1073741824)!==0&&($e&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=Yh(),Te.lanes|=e,ma|=e,n)}function Yd(e,t,n,l){return Jt(n,t)?n:Qi.current!==null?(e=hc(e,n,l),Jt(e,t)||(Mt=!0),e):(kl&42)===0||(kl&1073741824)!==0&&($e&261930)===0?(Mt=!0,e.memoizedState=n):(e=Yh(),Te.lanes|=e,ma|=e,t)}function Gd(e,t,n,l,i){var o=W.p;W.p=o!==0&&8>o?o:8;var h=R.T,g={};R.T=g,gc(e,!1,t,n);try{var C=i(),B=R.S;if(B!==null&&B(g,C),C!==null&&typeof C=="object"&&typeof C.then=="function"){var K=Fm(C,l);Is(e,t,K,En(e))}else Is(e,t,l,En(e))}catch(I){Is(e,t,{then:function(){},status:"rejected",reason:I},En())}finally{W.p=o,h!==null&&g.types!==null&&(h.types=g.types),R.T=h}}function tp(){}function mc(e,t,n,l){if(e.tag!==5)throw Error(r(476));var i=Xd(e).queue;Gd(e,i,t,oe,n===null?tp:function(){return Qd(e),n(l)})}function Xd(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:oe,baseState:oe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:zl,lastRenderedState:oe},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:zl,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Qd(e){var t=Xd(e);t.next===null&&(t=e.alternate.memoizedState),Is(e,t.next.queue,{},En())}function pc(){return qt(go)}function Vd(){return Et().memoizedState}function Zd(){return Et().memoizedState}function np(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=En();e=ua(n);var l=ra(t,e,n);l!==null&&(mn(l,t,n),Zs(l,t,n)),t={cache:Xr()},e.payload=t;return}t=t.return}}function lp(e,t,n){var l=En();n={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},wu(e)?Fd(t,n):(n=la(e,t,n,l),n!==null&&(mn(n,e,l),Jd(n,t,l)))}function Kd(e,t,n){var l=En();Is(e,t,n,l)}function Is(e,t,n,l){var i={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(wu(e))Fd(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var h=t.lastRenderedState,g=o(h,n);if(i.hasEagerState=!0,i.eagerState=g,Jt(g,h))return Li(e,t,i,0),ct===null&&un(),!1}catch{}if(n=la(e,t,i,l),n!==null)return mn(n,e,l),Jd(n,t,l),!0}return!1}function gc(e,t,n,l){if(l={lane:2,revertLane:Kc(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},wu(e)){if(t)throw Error(r(479))}else t=la(e,n,l,2),t!==null&&mn(t,e,2)}function wu(e){var t=e.alternate;return e===Te||t!==null&&t===Te}function Fd(e,t){Vi=mu=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Jd(e,t,n){if((n&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,Zl(e,n)}}var Ps={readContext:qt,use:xu,useCallback:vt,useContext:vt,useEffect:vt,useImperativeHandle:vt,useLayoutEffect:vt,useInsertionEffect:vt,useMemo:vt,useReducer:vt,useRef:vt,useState:vt,useDebugValue:vt,useDeferredValue:vt,useTransition:vt,useSyncExternalStore:vt,useId:vt,useHostTransitionStatus:vt,useFormState:vt,useActionState:vt,useOptimistic:vt,useMemoCache:vt,useCacheRefresh:vt};Ps.useEffectEvent=vt;var Wd={readContext:qt,use:xu,useCallback:function(e,t){return an().memoizedState=[e,t===void 0?null:t],e},useContext:qt,useEffect:Od,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,vu(4194308,4,Ud.bind(null,t,e),n)},useLayoutEffect:function(e,t){return vu(4194308,4,e,t)},useInsertionEffect:function(e,t){vu(4,2,e,t)},useMemo:function(e,t){var n=an();t=t===void 0?null:t;var l=e();if(li){Qt(!0);try{e()}finally{Qt(!1)}}return n.memoizedState=[l,t],l},useReducer:function(e,t,n){var l=an();if(n!==void 0){var i=n(t);if(li){Qt(!0);try{n(t)}finally{Qt(!1)}}}else i=t;return l.memoizedState=l.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},l.queue=e,e=e.dispatch=lp.bind(null,Te,e),[l.memoizedState,e]},useRef:function(e){var t=an();return e={current:e},t.memoizedState=e},useState:function(e){e=rc(e);var t=e.queue,n=Kd.bind(null,Te,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:dc,useDeferredValue:function(e,t){var n=an();return hc(n,e,t)},useTransition:function(){var e=rc(!1);return e=Gd.bind(null,Te,e.queue,!0,!1),an().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var l=Te,i=an();if(Le){if(n===void 0)throw Error(r(407));n=n()}else{if(n=t(),ct===null)throw Error(r(349));($e&127)!==0||yd(l,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,Od(bd.bind(null,l,o,e),[e]),l.flags|=2048,Ki(9,{destroy:void 0},vd.bind(null,l,o,n,t),null),n},useId:function(){var e=an(),t=ct.identifierPrefix;if(Le){var n=Ge,l=Oe;n=(l&~(1<<32-zt(l)-1)).toString(32)+n,t="_"+t+"R_"+n,n=pu++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=Jm++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:pc,useFormState:Dd,useActionState:Dd,useOptimistic:function(e){var t=an();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=gc.bind(null,Te,!0,n),n.dispatch=t,[e,t]},useMemoCache:sc,useCacheRefresh:function(){return an().memoizedState=np.bind(null,Te)},useEffectEvent:function(e){var t=an(),n={impl:e};return t.memoizedState=n,function(){if((We&2)!==0)throw Error(r(440));return n.impl.apply(void 0,arguments)}}},xc={readContext:qt,use:xu,useCallback:$d,useContext:qt,useEffect:fc,useImperativeHandle:Hd,useInsertionEffect:_d,useLayoutEffect:Bd,useMemo:qd,useReducer:yu,useRef:Rd,useState:function(){return yu(zl)},useDebugValue:dc,useDeferredValue:function(e,t){var n=Et();return Yd(n,lt.memoizedState,e,t)},useTransition:function(){var e=yu(zl)[0],t=Et().memoizedState;return[typeof e=="boolean"?e:Ws(e),t]},useSyncExternalStore:xd,useId:Vd,useHostTransitionStatus:pc,useFormState:Td,useActionState:Td,useOptimistic:function(e,t){var n=Et();return jd(n,lt,e,t)},useMemoCache:sc,useCacheRefresh:Zd};xc.useEffectEvent=Ld;var Id={readContext:qt,use:xu,useCallback:$d,useContext:qt,useEffect:fc,useImperativeHandle:Hd,useInsertionEffect:_d,useLayoutEffect:Bd,useMemo:qd,useReducer:uc,useRef:Rd,useState:function(){return uc(zl)},useDebugValue:dc,useDeferredValue:function(e,t){var n=Et();return lt===null?hc(n,e,t):Yd(n,lt.memoizedState,e,t)},useTransition:function(){var e=uc(zl)[0],t=Et().memoizedState;return[typeof e=="boolean"?e:Ws(e),t]},useSyncExternalStore:xd,useId:Vd,useHostTransitionStatus:pc,useFormState:zd,useActionState:zd,useOptimistic:function(e,t){var n=Et();return lt!==null?jd(n,lt,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:sc,useCacheRefresh:Zd};Id.useEffectEvent=Ld;function yc(e,t,n,l){t=e.memoizedState,n=n(l,t),n=n==null?t:M({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var vc={enqueueSetState:function(e,t,n){e=e._reactInternals;var l=En(),i=ua(l);i.payload=t,n!=null&&(i.callback=n),t=ra(e,i,l),t!==null&&(mn(t,e,l),Zs(t,e,l))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var l=En(),i=ua(l);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=ra(e,i,l),t!==null&&(mn(t,e,l),Zs(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=En(),l=ua(n);l.tag=2,t!=null&&(l.callback=t),t=ra(e,l,n),t!==null&&(mn(t,e,n),Zs(t,e,n))}};function Pd(e,t,n,l,i,o,h){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,o,h):t.prototype&&t.prototype.isPureReactComponent?!Qa(n,l)||!Qa(i,o):!0}function eh(e,t,n,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,l),t.state!==e&&vc.enqueueReplaceState(t,t.state,null)}function ai(e,t){var n=t;if("ref"in t){n={};for(var l in t)l!=="ref"&&(n[l]=t[l])}if(e=e.defaultProps){n===t&&(n=M({},n));for(var i in e)n[i]===void 0&&(n[i]=e[i])}return n}function th(e){Oi(e)}function nh(e){console.error(e)}function lh(e){Oi(e)}function Su(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function ah(e,t,n){try{var l=e.onCaughtError;l(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(i){setTimeout(function(){throw i})}}function bc(e,t,n){return n=ua(n),n.tag=3,n.payload={element:null},n.callback=function(){Su(e,t)},n}function ih(e){return e=ua(e),e.tag=3,e}function sh(e,t,n,l){var i=n.type.getDerivedStateFromError;if(typeof i=="function"){var o=l.value;e.payload=function(){return i(o)},e.callback=function(){ah(t,n,l)}}var h=n.stateNode;h!==null&&typeof h.componentDidCatch=="function"&&(e.callback=function(){ah(t,n,l),typeof i!="function"&&(pa===null?pa=new Set([this]):pa.add(this));var g=l.stack;this.componentDidCatch(l.value,{componentStack:g!==null?g:""})})}function ap(e,t,n,l,i){if(n.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=n.alternate,t!==null&&$i(t,n,i,!0),n=bn.current,n!==null){switch(n.tag){case 31:case 13:return Tn===null?Ou():n.alternate===null&&bt===0&&(bt=3),n.flags&=-257,n.flags|=65536,n.lanes=i,l===ru?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([l]):t.add(l),Qc(e,l,i)),!1;case 22:return n.flags|=65536,l===ru?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([l])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([l]):n.add(l)),Qc(e,l,i)),!1}throw Error(r(435,n.tag))}return Qc(e,l,i),Ou(),!1}if(Le)return t=bn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=i,l!==Vn&&(e=Error(r(422),{cause:l}),Ys(j(e,n)))):(l!==Vn&&(t=Error(r(423),{cause:l}),Ys(j(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,l=j(l,n),i=bc(e.stateNode,l,i),Jr(e,i),bt!==4&&(bt=2)),!1;var o=Error(r(520),{cause:l});if(o=j(o,n),oo===null?oo=[o]:oo.push(o),bt!==4&&(bt=2),t===null)return!0;l=j(l,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=bc(n.stateNode,l,e),Jr(n,e),!1;case 1:if(t=n.type,o=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||o!==null&&typeof o.componentDidCatch=="function"&&(pa===null||!pa.has(o))))return n.flags|=65536,i&=-i,n.lanes|=i,i=ih(i),sh(i,e,n,l),Jr(n,i),!1}n=n.return}while(n!==null);return!1}var wc=Error(r(461)),Mt=!1;function Yt(e,t,n,l){t.child=e===null?cd(t,null,n,l):ni(t,e.child,n,l)}function oh(e,t,n,l,i){n=n.render;var o=t.ref;if("ref"in l){var h={};for(var g in l)g!=="ref"&&(h[g]=l[g])}else h=l;return Ia(t),l=nc(e,t,n,h,o,i),g=lc(),e!==null&&!Mt?(ac(e,t,i),Rl(e,t,i)):(Le&&g&&rn(t),t.flags|=1,Yt(e,t,l,i),t.child)}function uh(e,t,n,l,i){if(e===null){var o=n.type;return typeof o=="function"&&!Hs(o)&&o.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=o,rh(e,t,o,l,i)):(e=Bi(n.type,null,l,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!Dc(e,i)){var h=o.memoizedProps;if(n=n.compare,n=n!==null?n:Qa,n(h,l)&&e.ref===t.ref)return Rl(e,t,i)}return t.flags|=1,e=Xn(o,l),e.ref=t.ref,e.return=t,t.child=e}function rh(e,t,n,l,i){if(e!==null){var o=e.memoizedProps;if(Qa(o,l)&&e.ref===t.ref)if(Mt=!1,t.pendingProps=l=o,Dc(e,i))(e.flags&131072)!==0&&(Mt=!0);else return t.lanes=e.lanes,Rl(e,t,i)}return Sc(e,t,n,l,i)}function ch(e,t,n,l){var i=l.children,o=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((t.flags&128)!==0){if(o=o!==null?o.baseLanes|n:n,e!==null){for(l=t.child=e.child,i=0;l!==null;)i=i|l.lanes|l.childLanes,l=l.sibling;l=i&~o}else l=0,t.child=null;return fh(e,t,o,n,l)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ou(t,o!==null?o.cachePool:null),o!==null?hd(t,o):Ir(),md(t);else return l=t.lanes=536870912,fh(e,t,o!==null?o.baseLanes|n:n,n,l)}else o!==null?(ou(t,o.cachePool),hd(t,o),fa(),t.memoizedState=null):(e!==null&&ou(t,null),Ir(),fa());return Yt(e,t,i,n),t.child}function eo(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function fh(e,t,n,l,i){var o=Vr();return o=o===null?null:{parent:Ct._currentValue,pool:o},t.memoizedState={baseLanes:n,cachePool:o},e!==null&&ou(t,null),Ir(),md(t),e!==null&&$i(e,t,l,!0),t.childLanes=i,null}function ju(e,t){return t=Cu({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function dh(e,t,n){return ni(t,e.child,null,n),e=ju(t,t.pendingProps),e.flags|=2,wn(t),t.memoizedState=null,e}function ip(e,t,n){var l=t.pendingProps,i=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Le){if(l.mode==="hidden")return e=ju(t,l),t.lanes=536870912,eo(null,e);if(ec(t),(e=rt)?(e=E0(e,yt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ye!==null?{id:Oe,overflow:Ge}:null,retryLane:536870912,hydrationErrors:null},n=au(e),n.return=t,t.child=n,St=t,rt=null)):e=null,e===null)throw ia(t);return t.lanes=536870912,null}return ju(t,l)}var o=e.memoizedState;if(o!==null){var h=o.dehydrated;if(ec(t),i)if(t.flags&256)t.flags&=-257,t=dh(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(r(558));else if(Mt||$i(e,t,n,!1),i=(n&e.childLanes)!==0,Mt||i){if(l=ct,l!==null&&(h=F(l,n),h!==0&&h!==o.retryLane))throw o.retryLane=h,Gn(e,h),mn(l,e,h),wc;Ou(),t=dh(e,t,n)}else e=o.treeContext,rt=kn(h.nextSibling),St=t,Le=!0,Qn=null,yt=!1,e!==null&&aa(t,e),t=ju(t,l),t.flags|=4096;return t}return e=Xn(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Eu(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(r(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Sc(e,t,n,l,i){return Ia(t),n=nc(e,t,n,l,void 0,i),l=lc(),e!==null&&!Mt?(ac(e,t,i),Rl(e,t,i)):(Le&&l&&rn(t),t.flags|=1,Yt(e,t,n,i),t.child)}function hh(e,t,n,l,i,o){return Ia(t),t.updateQueue=null,n=gd(t,l,n,i),pd(e),l=lc(),e!==null&&!Mt?(ac(e,t,o),Rl(e,t,o)):(Le&&l&&rn(t),t.flags|=1,Yt(e,t,n,o),t.child)}function mh(e,t,n,l,i){if(Ia(t),t.stateNode===null){var o=Ml,h=n.contextType;typeof h=="object"&&h!==null&&(o=qt(h)),o=new n(l,o),t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=vc,t.stateNode=o,o._reactInternals=t,o=t.stateNode,o.props=l,o.state=t.memoizedState,o.refs={},Kr(t),h=n.contextType,o.context=typeof h=="object"&&h!==null?qt(h):Ml,o.state=t.memoizedState,h=n.getDerivedStateFromProps,typeof h=="function"&&(yc(t,n,h,l),o.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(h=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),h!==o.state&&vc.enqueueReplaceState(o,o.state,null),Fs(t,l,o,i),Ks(),o.state=t.memoizedState),typeof o.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){o=t.stateNode;var g=t.memoizedProps,C=ai(n,g);o.props=C;var B=o.context,K=n.contextType;h=Ml,typeof K=="object"&&K!==null&&(h=qt(K));var I=n.getDerivedStateFromProps;K=typeof I=="function"||typeof o.getSnapshotBeforeUpdate=="function",g=t.pendingProps!==g,K||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(g||B!==h)&&eh(t,o,l,h),oa=!1;var q=t.memoizedState;o.state=q,Fs(t,l,o,i),Ks(),B=t.memoizedState,g||q!==B||oa?(typeof I=="function"&&(yc(t,n,I,l),B=t.memoizedState),(C=oa||Pd(t,n,C,l,q,B,h))?(K||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=B),o.props=l,o.state=B,o.context=h,l=C):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{o=t.stateNode,Fr(e,t),h=t.memoizedProps,K=ai(n,h),o.props=K,I=t.pendingProps,q=o.context,B=n.contextType,C=Ml,typeof B=="object"&&B!==null&&(C=qt(B)),g=n.getDerivedStateFromProps,(B=typeof g=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(h!==I||q!==C)&&eh(t,o,l,C),oa=!1,q=t.memoizedState,o.state=q,Fs(t,l,o,i),Ks();var Y=t.memoizedState;h!==I||q!==Y||oa||e!==null&&e.dependencies!==null&&iu(e.dependencies)?(typeof g=="function"&&(yc(t,n,g,l),Y=t.memoizedState),(K=oa||Pd(t,n,K,l,q,Y,C)||e!==null&&e.dependencies!==null&&iu(e.dependencies))?(B||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(l,Y,C),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(l,Y,C)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||h===e.memoizedProps&&q===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||h===e.memoizedProps&&q===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=Y),o.props=l,o.state=Y,o.context=C,l=K):(typeof o.componentDidUpdate!="function"||h===e.memoizedProps&&q===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||h===e.memoizedProps&&q===e.memoizedState||(t.flags|=1024),l=!1)}return o=l,Eu(e,t),l=(t.flags&128)!==0,o||l?(o=t.stateNode,n=l&&typeof n.getDerivedStateFromError!="function"?null:o.render(),t.flags|=1,e!==null&&l?(t.child=ni(t,e.child,null,i),t.child=ni(t,null,n,i)):Yt(e,t,n,i),t.memoizedState=o.state,e=t.child):e=Rl(e,t,i),e}function ph(e,t,n,l){return Ja(),t.flags|=256,Yt(e,t,n,l),t.child}var jc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ec(e){return{baseLanes:e,cachePool:ad()}}function Cc(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=jn),e}function gh(e,t,n){var l=t.pendingProps,i=!1,o=(t.flags&128)!==0,h;if((h=o)||(h=e!==null&&e.memoizedState===null?!1:(jt.current&2)!==0),h&&(i=!0,t.flags&=-129),h=(t.flags&32)!==0,t.flags&=-33,e===null){if(Le){if(i?ca(t):fa(),(e=rt)?(e=E0(e,yt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ye!==null?{id:Oe,overflow:Ge}:null,retryLane:536870912,hydrationErrors:null},n=au(e),n.return=t,t.child=n,St=t,rt=null)):e=null,e===null)throw ia(t);return uf(e)?t.lanes=32:t.lanes=536870912,null}var g=l.children;return l=l.fallback,i?(fa(),i=t.mode,g=Cu({mode:"hidden",children:g},i),l=Al(l,i,n,null),g.return=t,l.return=t,g.sibling=l,t.child=g,l=t.child,l.memoizedState=Ec(n),l.childLanes=Cc(e,h,n),t.memoizedState=jc,eo(null,l)):(ca(t),Nc(t,g))}var C=e.memoizedState;if(C!==null&&(g=C.dehydrated,g!==null)){if(o)t.flags&256?(ca(t),t.flags&=-257,t=Mc(e,t,n)):t.memoizedState!==null?(fa(),t.child=e.child,t.flags|=128,t=null):(fa(),g=l.fallback,i=t.mode,l=Cu({mode:"visible",children:l.children},i),g=Al(g,i,n,null),g.flags|=2,l.return=t,g.return=t,l.sibling=g,t.child=l,ni(t,e.child,null,n),l=t.child,l.memoizedState=Ec(n),l.childLanes=Cc(e,h,n),t.memoizedState=jc,t=eo(null,l));else if(ca(t),uf(g)){if(h=g.nextSibling&&g.nextSibling.dataset,h)var B=h.dgst;h=B,l=Error(r(419)),l.stack="",l.digest=h,Ys({value:l,source:null,stack:null}),t=Mc(e,t,n)}else if(Mt||$i(e,t,n,!1),h=(n&e.childLanes)!==0,Mt||h){if(h=ct,h!==null&&(l=F(h,n),l!==0&&l!==C.retryLane))throw C.retryLane=l,Gn(e,l),mn(h,e,l),wc;of(g)||Ou(),t=Mc(e,t,n)}else of(g)?(t.flags|=192,t.child=e.child,t=null):(e=C.treeContext,rt=kn(g.nextSibling),St=t,Le=!0,Qn=null,yt=!1,e!==null&&aa(t,e),t=Nc(t,l.children),t.flags|=4096);return t}return i?(fa(),g=l.fallback,i=t.mode,C=e.child,B=C.sibling,l=Xn(C,{mode:"hidden",children:l.children}),l.subtreeFlags=C.subtreeFlags&65011712,B!==null?g=Xn(B,g):(g=Al(g,i,n,null),g.flags|=2),g.return=t,l.return=t,l.sibling=g,t.child=l,eo(null,l),l=t.child,g=e.child.memoizedState,g===null?g=Ec(n):(i=g.cachePool,i!==null?(C=Ct._currentValue,i=i.parent!==C?{parent:C,pool:C}:i):i=ad(),g={baseLanes:g.baseLanes|n,cachePool:i}),l.memoizedState=g,l.childLanes=Cc(e,h,n),t.memoizedState=jc,eo(e.child,l)):(ca(t),n=e.child,e=n.sibling,n=Xn(n,{mode:"visible",children:l.children}),n.return=t,n.sibling=null,e!==null&&(h=t.deletions,h===null?(t.deletions=[e],t.flags|=16):h.push(e)),t.child=n,t.memoizedState=null,n)}function Nc(e,t){return t=Cu({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Cu(e,t){return e=ln(22,e,null,t),e.lanes=0,e}function Mc(e,t,n){return ni(t,e.child,null,n),e=Nc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function xh(e,t,n){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),Yr(e.return,t,n)}function Ac(e,t,n,l,i,o){var h=e.memoizedState;h===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:n,tailMode:i,treeForkCount:o}:(h.isBackwards=t,h.rendering=null,h.renderingStartTime=0,h.last=l,h.tail=n,h.tailMode=i,h.treeForkCount=o)}function yh(e,t,n){var l=t.pendingProps,i=l.revealOrder,o=l.tail;l=l.children;var h=jt.current,g=(h&2)!==0;if(g?(h=h&1|2,t.flags|=128):h&=1,le(jt,h),Yt(e,t,l,n),l=Le?de:0,!g&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&xh(e,n,t);else if(e.tag===19)xh(e,n,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(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&hu(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Ac(t,!1,i,n,o,l);break;case"backwards":case"unstable_legacy-backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&hu(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Ac(t,!0,n,null,o,l);break;case"together":Ac(t,!1,null,null,void 0,l);break;default:t.memoizedState=null}return t.child}function Rl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ma|=t.lanes,(n&t.childLanes)===0)if(e!==null){if($i(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(r(153));if(t.child!==null){for(e=t.child,n=Xn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Xn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Dc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&iu(e)))}function sp(e,t,n){switch(t.tag){case 3:Z(t,t.stateNode.containerInfo),sa(t,Ct,e.memoizedState.cache),Ja();break;case 27:case 5:pe(t);break;case 4:Z(t,t.stateNode.containerInfo);break;case 10:sa(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,ec(t),null;break;case 13:var l=t.memoizedState;if(l!==null)return l.dehydrated!==null?(ca(t),t.flags|=128,null):(n&t.child.childLanes)!==0?gh(e,t,n):(ca(t),e=Rl(e,t,n),e!==null?e.sibling:null);ca(t);break;case 19:var i=(e.flags&128)!==0;if(l=(n&t.childLanes)!==0,l||($i(e,t,n,!1),l=(n&t.childLanes)!==0),i){if(l)return yh(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),le(jt,jt.current),l)break;return null;case 22:return t.lanes=0,ch(e,t,n,t.pendingProps);case 24:sa(t,Ct,e.memoizedState.cache)}return Rl(e,t,n)}function vh(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Mt=!0;else{if(!Dc(e,n)&&(t.flags&128)===0)return Mt=!1,sp(e,t,n);Mt=(e.flags&131072)!==0}else Mt=!1,Le&&(t.flags&1048576)!==0&&Ze(t,de,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=ei(t.elementType),t.type=e,typeof e=="function")Hs(e)?(l=ai(e,l),t.tag=1,t=mh(null,t,e,l,n)):(t.tag=0,t=Sc(null,t,e,l,n));else{if(e!=null){var i=e.$$typeof;if(i===X){t.tag=11,t=oh(null,t,e,l,n);break e}else if(i===v){t.tag=14,t=uh(null,t,e,l,n);break e}}throw t=ye(e)||e,Error(r(306,t,""))}}return t;case 0:return Sc(e,t,t.type,t.pendingProps,n);case 1:return l=t.type,i=ai(l,t.pendingProps),mh(e,t,l,i,n);case 3:e:{if(Z(t,t.stateNode.containerInfo),e===null)throw Error(r(387));l=t.pendingProps;var o=t.memoizedState;i=o.element,Fr(e,t),Fs(t,l,null,n);var h=t.memoizedState;if(l=h.cache,sa(t,Ct,l),l!==o.cache&&Gr(t,[Ct],n,!0),Ks(),l=h.element,o.isDehydrated)if(o={element:l,isDehydrated:!1,cache:h.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=ph(e,t,l,n);break e}else if(l!==i){i=j(Error(r(424)),t),Ys(i),t=ph(e,t,l,n);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,rt=kn(e.firstChild),St=t,Le=!0,Qn=null,yt=!0,n=cd(t,null,l,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ja(),l===i){t=Rl(e,t,n);break e}Yt(e,t,l,n)}t=t.child}return t;case 26:return Eu(e,t),e===null?(n=T0(t.type,null,t.pendingProps,null))?t.memoizedState=n:Le||(n=t.type,e=t.pendingProps,l=qu(Se.current).createElement(n),l[Qe]=t,l[Be]=e,Gt(l,n,e),wt(l),t.stateNode=l):t.memoizedState=T0(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return pe(t),e===null&&Le&&(l=t.stateNode=M0(t.type,t.pendingProps,Se.current),St=t,yt=!0,i=rt,va(t.type)?(rf=i,rt=kn(l.firstChild)):rt=i),Yt(e,t,t.pendingProps.children,n),Eu(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Le&&((i=l=rt)&&(l=_p(l,t.type,t.pendingProps,yt),l!==null?(t.stateNode=l,St=t,rt=kn(l.firstChild),yt=!1,i=!0):i=!1),i||ia(t)),pe(t),i=t.type,o=t.pendingProps,h=e!==null?e.memoizedProps:null,l=o.children,lf(i,o)?l=null:h!==null&&lf(i,h)&&(t.flags|=32),t.memoizedState!==null&&(i=nc(e,t,Wm,null,null,n),go._currentValue=i),Eu(e,t),Yt(e,t,l,n),t.child;case 6:return e===null&&Le&&((e=n=rt)&&(n=Bp(n,t.pendingProps,yt),n!==null?(t.stateNode=n,St=t,rt=null,e=!0):e=!1),e||ia(t)),null;case 13:return gh(e,t,n);case 4:return Z(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=ni(t,null,l,n):Yt(e,t,l,n),t.child;case 11:return oh(e,t,t.type,t.pendingProps,n);case 7:return Yt(e,t,t.pendingProps,n),t.child;case 8:return Yt(e,t,t.pendingProps.children,n),t.child;case 12:return Yt(e,t,t.pendingProps.children,n),t.child;case 10:return l=t.pendingProps,sa(t,t.type,l.value),Yt(e,t,l.children,n),t.child;case 9:return i=t.type._context,l=t.pendingProps.children,Ia(t),i=qt(i),l=l(i),t.flags|=1,Yt(e,t,l,n),t.child;case 14:return uh(e,t,t.type,t.pendingProps,n);case 15:return rh(e,t,t.type,t.pendingProps,n);case 19:return yh(e,t,n);case 31:return ip(e,t,n);case 22:return ch(e,t,n,t.pendingProps);case 24:return Ia(t),l=qt(Ct),e===null?(i=Vr(),i===null&&(i=ct,o=Xr(),i.pooledCache=o,o.refCount++,o!==null&&(i.pooledCacheLanes|=n),i=o),t.memoizedState={parent:l,cache:i},Kr(t),sa(t,Ct,i)):((e.lanes&n)!==0&&(Fr(e,t),Fs(t,null,null,n),Ks()),i=e.memoizedState,o=t.memoizedState,i.parent!==l?(i={parent:l,cache:l},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),sa(t,Ct,l)):(l=o.cache,sa(t,Ct,l),l!==i.cache&&Gr(t,[Ct],n,!0))),Yt(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(r(156,t.tag))}function Ol(e){e.flags|=4}function Tc(e,t,n,l,i){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Vh())e.flags|=8192;else throw ti=ru,Zr}else e.flags&=-16777217}function bh(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!L0(t))if(Vh())e.flags|=8192;else throw ti=ru,Zr}function Nu(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?ml():536870912,e.lanes|=t,Ii|=t)}function to(e,t){if(!Le)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var l=null;n!==null;)n.alternate!==null&&(l=n),n=n.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function dt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,l=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,l|=i.subtreeFlags&65011712,l|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,l|=i.subtreeFlags,l|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=l,e.childLanes=n,t}function op(e,t,n){var l=t.pendingProps;switch(Dn(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return dt(t),null;case 1:return dt(t),null;case 3:return n=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),Tl(Ct),ie(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Hi(t)?Ol(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,$r())),dt(t),null;case 26:var i=t.type,o=t.memoizedState;return e===null?(Ol(t),o!==null?(dt(t),bh(t,o)):(dt(t),Tc(t,i,null,l,n))):o?o!==e.memoizedState?(Ol(t),dt(t),bh(t,o)):(dt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&Ol(t),dt(t),Tc(t,i,e,l,n)),null;case 27:if(Me(t),n=Se.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&Ol(t);else{if(!l){if(t.stateNode===null)throw Error(r(166));return dt(t),null}e=ue.current,Hi(t)?Pf(t):(e=M0(i,l,n),t.stateNode=e,Ol(t))}return dt(t),null;case 5:if(Me(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&Ol(t);else{if(!l){if(t.stateNode===null)throw Error(r(166));return dt(t),null}if(o=ue.current,Hi(t))Pf(t);else{var h=qu(Se.current);switch(o){case 1:o=h.createElementNS("http://www.w3.org/2000/svg",i);break;case 2:o=h.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;default:switch(i){case"svg":o=h.createElementNS("http://www.w3.org/2000/svg",i);break;case"math":o=h.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;case"script":o=h.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild);break;case"select":o=typeof l.is=="string"?h.createElement("select",{is:l.is}):h.createElement("select"),l.multiple?o.multiple=!0:l.size&&(o.size=l.size);break;default:o=typeof l.is=="string"?h.createElement(i,{is:l.is}):h.createElement(i)}}o[Qe]=t,o[Be]=l;e:for(h=t.child;h!==null;){if(h.tag===5||h.tag===6)o.appendChild(h.stateNode);else if(h.tag!==4&&h.tag!==27&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===t)break e;for(;h.sibling===null;){if(h.return===null||h.return===t)break e;h=h.return}h.sibling.return=h.return,h=h.sibling}t.stateNode=o;e:switch(Gt(o,i,l),i){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&Ol(t)}}return dt(t),Tc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&Ol(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(r(166));if(e=Se.current,Hi(t)){if(e=t.stateNode,n=t.memoizedProps,l=null,i=St,i!==null)switch(i.tag){case 27:case 5:l=i.memoizedProps}e[Qe]=t,e=!!(e.nodeValue===n||l!==null&&l.suppressHydrationWarning===!0||g0(e.nodeValue,n)),e||ia(t,!0)}else e=qu(e).createTextNode(l),e[Qe]=t,t.stateNode=e}return dt(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(l=Hi(t),n!==null){if(e===null){if(!l)throw Error(r(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(557));e[Qe]=t}else Ja(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;dt(t),e=!1}else n=$r(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(wn(t),t):(wn(t),null);if((t.flags&128)!==0)throw Error(r(558))}return dt(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=Hi(t),l!==null&&l.dehydrated!==null){if(e===null){if(!i)throw Error(r(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));i[Qe]=t}else Ja(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;dt(t),i=!1}else i=$r(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(wn(t),t):(wn(t),null)}return wn(t),(t.flags&128)!==0?(t.lanes=n,t):(n=l!==null,e=e!==null&&e.memoizedState!==null,n&&(l=t.child,i=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(i=l.alternate.memoizedState.cachePool.pool),o=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(o=l.memoizedState.cachePool.pool),o!==i&&(l.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Nu(t,t.updateQueue),dt(t),null);case 4:return ie(),e===null&&Ic(t.stateNode.containerInfo),dt(t),null;case 10:return Tl(t.type),dt(t),null;case 19:if(G(jt),l=t.memoizedState,l===null)return dt(t),null;if(i=(t.flags&128)!==0,o=l.rendering,o===null)if(i)to(l,!1);else{if(bt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(o=hu(e),o!==null){for(t.flags|=128,to(l,!1),e=o.updateQueue,t.updateQueue=e,Nu(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)$s(n,e),n=n.sibling;return le(jt,jt.current&1|2),Le&&xt(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&mt()>ku&&(t.flags|=128,i=!0,to(l,!1),t.lanes=4194304)}else{if(!i)if(e=hu(o),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,Nu(t,e),to(l,!0),l.tail===null&&l.tailMode==="hidden"&&!o.alternate&&!Le)return dt(t),null}else 2*mt()-l.renderingStartTime>ku&&n!==536870912&&(t.flags|=128,i=!0,to(l,!1),t.lanes=4194304);l.isBackwards?(o.sibling=t.child,t.child=o):(e=l.last,e!==null?e.sibling=o:t.child=o,l.last=o)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=mt(),e.sibling=null,n=jt.current,le(jt,i?n&1|2:n&1),Le&&xt(t,l.treeForkCount),e):(dt(t),null);case 22:case 23:return wn(t),Pr(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(n&536870912)!==0&&(t.flags&128)===0&&(dt(t),t.subtreeFlags&6&&(t.flags|=8192)):dt(t),n=t.updateQueue,n!==null&&Nu(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==n&&(t.flags|=2048),e!==null&&G(Pa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Tl(Ct),dt(t),null;case 25:return null;case 30:return null}throw Error(r(156,t.tag))}function up(e,t){switch(Dn(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Tl(Ct),ie(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Me(t),null;case 31:if(t.memoizedState!==null){if(wn(t),t.alternate===null)throw Error(r(340));Ja()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(wn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));Ja()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return G(jt),null;case 4:return ie(),null;case 10:return Tl(t.type),null;case 22:case 23:return wn(t),Pr(),e!==null&&G(Pa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Tl(Ct),null;case 25:return null;default:return null}}function wh(e,t){switch(Dn(t),t.tag){case 3:Tl(Ct),ie();break;case 26:case 27:case 5:Me(t);break;case 4:ie();break;case 31:t.memoizedState!==null&&wn(t);break;case 13:wn(t);break;case 19:G(jt);break;case 10:Tl(t.type);break;case 22:case 23:wn(t),Pr(),e!==null&&G(Pa);break;case 24:Tl(Ct)}}function no(e,t){try{var n=t.updateQueue,l=n!==null?n.lastEffect:null;if(l!==null){var i=l.next;n=i;do{if((n.tag&e)===e){l=void 0;var o=n.create,h=n.inst;l=o(),h.destroy=l}n=n.next}while(n!==i)}}catch(g){nt(t,t.return,g)}}function da(e,t,n){try{var l=t.updateQueue,i=l!==null?l.lastEffect:null;if(i!==null){var o=i.next;l=o;do{if((l.tag&e)===e){var h=l.inst,g=h.destroy;if(g!==void 0){h.destroy=void 0,i=t;var C=n,B=g;try{B()}catch(K){nt(i,C,K)}}}l=l.next}while(l!==o)}}catch(K){nt(t,t.return,K)}}function Sh(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{dd(t,n)}catch(l){nt(e,e.return,l)}}}function jh(e,t,n){n.props=ai(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(l){nt(e,t,l)}}function lo(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:l=e.stateNode;break;default:l=e.stateNode}typeof n=="function"?e.refCleanup=n(l):n.current=l}}catch(i){nt(e,t,i)}}function cl(e,t){var n=e.ref,l=e.refCleanup;if(n!==null)if(typeof l=="function")try{l()}catch(i){nt(e,t,i)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(i){nt(e,t,i)}else n.current=null}function Eh(e){var t=e.type,n=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&l.focus();break e;case"img":n.src?l.src=n.src:n.srcSet&&(l.srcset=n.srcSet)}}catch(i){nt(e,e.return,i)}}function kc(e,t,n){try{var l=e.stateNode;Tp(l,e.type,n,t),l[Be]=t}catch(i){nt(e,e.return,i)}}function Ch(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&va(e.type)||e.tag===4}function zc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Ch(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&&va(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 Rc(e,t,n){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Nn));else if(l!==4&&(l===27&&va(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Rc(e,t,n),e=e.sibling;e!==null;)Rc(e,t,n),e=e.sibling}function Mu(e,t,n){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(l!==4&&(l===27&&va(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Mu(e,t,n),e=e.sibling;e!==null;)Mu(e,t,n),e=e.sibling}function Nh(e){var t=e.stateNode,n=e.memoizedProps;try{for(var l=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Gt(t,l,n),t[Qe]=e,t[Be]=n}catch(o){nt(e,e.return,o)}}var Ll=!1,At=!1,Oc=!1,Mh=typeof WeakSet=="function"?WeakSet:Set,Lt=null;function rp(e,t){if(e=e.containerInfo,tf=Ku,e=Po(e),Rs(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var l=n.getSelection&&n.getSelection();if(l&&l.rangeCount!==0){n=l.anchorNode;var i=l.anchorOffset,o=l.focusNode;l=l.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var h=0,g=-1,C=-1,B=0,K=0,I=e,q=null;t:for(;;){for(var Y;I!==n||i!==0&&I.nodeType!==3||(g=h+i),I!==o||l!==0&&I.nodeType!==3||(C=h+l),I.nodeType===3&&(h+=I.nodeValue.length),(Y=I.firstChild)!==null;)q=I,I=Y;for(;;){if(I===e)break t;if(q===n&&++B===i&&(g=h),q===o&&++K===l&&(C=h),(Y=I.nextSibling)!==null)break;I=q,q=I.parentNode}I=Y}n=g===-1||C===-1?null:{start:g,end:C}}else n=null}n=n||{start:0,end:0}}else n=null;for(nf={focusedElem:e,selectionRange:n},Ku=!1,Lt=t;Lt!==null;)if(t=Lt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Lt=e;else for(;Lt!==null;){switch(t=Lt,o=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(n=0;n<e.length;n++)i=e[n],i.ref.impl=i.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&o!==null){e=void 0,n=t,i=o.memoizedProps,o=o.memoizedState,l=n.stateNode;try{var ge=ai(n.type,i);e=l.getSnapshotBeforeUpdate(ge,o),l.__reactInternalSnapshotBeforeUpdate=e}catch(Ne){nt(n,n.return,Ne)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)sf(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":sf(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(r(163))}if(e=t.sibling,e!==null){e.return=t.return,Lt=e;break}Lt=t.return}}function Ah(e,t,n){var l=n.flags;switch(n.tag){case 0:case 11:case 15:Bl(e,n),l&4&&no(5,n);break;case 1:if(Bl(e,n),l&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(h){nt(n,n.return,h)}else{var i=ai(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(h){nt(n,n.return,h)}}l&64&&Sh(n),l&512&&lo(n,n.return);break;case 3:if(Bl(e,n),l&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{dd(e,t)}catch(h){nt(n,n.return,h)}}break;case 27:t===null&&l&4&&Nh(n);case 26:case 5:Bl(e,n),t===null&&l&4&&Eh(n),l&512&&lo(n,n.return);break;case 12:Bl(e,n);break;case 31:Bl(e,n),l&4&&kh(e,n);break;case 13:Bl(e,n),l&4&&zh(e,n),l&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=yp.bind(null,n),Up(e,n))));break;case 22:if(l=n.memoizedState!==null||Ll,!l){t=t!==null&&t.memoizedState!==null||At,i=Ll;var o=At;Ll=l,(At=t)&&!o?Ul(e,n,(n.subtreeFlags&8772)!==0):Bl(e,n),Ll=i,At=o}break;case 30:break;default:Bl(e,n)}}function Dh(e){var t=e.alternate;t!==null&&(e.alternate=null,Dh(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Ht(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 ht=null,cn=!1;function _l(e,t,n){for(n=n.child;n!==null;)Th(e,t,n),n=n.sibling}function Th(e,t,n){if(Bt&&typeof Bt.onCommitFiberUnmount=="function")try{Bt.onCommitFiberUnmount(dl,n)}catch{}switch(n.tag){case 26:At||cl(n,t),_l(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:At||cl(n,t);var l=ht,i=cn;va(n.type)&&(ht=n.stateNode,cn=!1),_l(e,t,n),ho(n.stateNode),ht=l,cn=i;break;case 5:At||cl(n,t);case 6:if(l=ht,i=cn,ht=null,_l(e,t,n),ht=l,cn=i,ht!==null)if(cn)try{(ht.nodeType===9?ht.body:ht.nodeName==="HTML"?ht.ownerDocument.body:ht).removeChild(n.stateNode)}catch(o){nt(n,t,o)}else try{ht.removeChild(n.stateNode)}catch(o){nt(n,t,o)}break;case 18:ht!==null&&(cn?(e=ht,S0(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),ss(e)):S0(ht,n.stateNode));break;case 4:l=ht,i=cn,ht=n.stateNode.containerInfo,cn=!0,_l(e,t,n),ht=l,cn=i;break;case 0:case 11:case 14:case 15:da(2,n,t),At||da(4,n,t),_l(e,t,n);break;case 1:At||(cl(n,t),l=n.stateNode,typeof l.componentWillUnmount=="function"&&jh(n,t,l)),_l(e,t,n);break;case 21:_l(e,t,n);break;case 22:At=(l=At)||n.memoizedState!==null,_l(e,t,n),At=l;break;default:_l(e,t,n)}}function kh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{ss(e)}catch(n){nt(t,t.return,n)}}}function zh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{ss(e)}catch(n){nt(t,t.return,n)}}function cp(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Mh),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Mh),t;default:throw Error(r(435,e.tag))}}function Au(e,t){var n=cp(e);t.forEach(function(l){if(!n.has(l)){n.add(l);var i=vp.bind(null,e,l);l.then(i,i)}})}function fn(e,t){var n=t.deletions;if(n!==null)for(var l=0;l<n.length;l++){var i=n[l],o=e,h=t,g=h;e:for(;g!==null;){switch(g.tag){case 27:if(va(g.type)){ht=g.stateNode,cn=!1;break e}break;case 5:ht=g.stateNode,cn=!1;break e;case 3:case 4:ht=g.stateNode.containerInfo,cn=!0;break e}g=g.return}if(ht===null)throw Error(r(160));Th(o,h,i),ht=null,cn=!1,o=i.alternate,o!==null&&(o.return=null),i.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Rh(t,e),t=t.sibling}var Zn=null;function Rh(e,t){var n=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:fn(t,e),dn(e),l&4&&(da(3,e,e.return),no(3,e),da(5,e,e.return));break;case 1:fn(t,e),dn(e),l&512&&(At||n===null||cl(n,n.return)),l&64&&Ll&&(e=e.updateQueue,e!==null&&(l=e.callbacks,l!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?l:n.concat(l))));break;case 26:var i=Zn;if(fn(t,e),dn(e),l&512&&(At||n===null||cl(n,n.return)),l&4){var o=n!==null?n.memoizedState:null;if(l=e.memoizedState,n===null)if(l===null)if(e.stateNode===null){e:{l=e.type,n=e.memoizedProps,i=i.ownerDocument||i;t:switch(l){case"title":o=i.getElementsByTagName("title")[0],(!o||o[gl]||o[Qe]||o.namespaceURI==="http://www.w3.org/2000/svg"||o.hasAttribute("itemprop"))&&(o=i.createElement(l),i.head.insertBefore(o,i.querySelector("head > title"))),Gt(o,l,n),o[Qe]=e,wt(o),l=o;break e;case"link":var h=R0("link","href",i).get(l+(n.href||""));if(h){for(var g=0;g<h.length;g++)if(o=h[g],o.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&o.getAttribute("rel")===(n.rel==null?null:n.rel)&&o.getAttribute("title")===(n.title==null?null:n.title)&&o.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){h.splice(g,1);break t}}o=i.createElement(l),Gt(o,l,n),i.head.appendChild(o);break;case"meta":if(h=R0("meta","content",i).get(l+(n.content||""))){for(g=0;g<h.length;g++)if(o=h[g],o.getAttribute("content")===(n.content==null?null:""+n.content)&&o.getAttribute("name")===(n.name==null?null:n.name)&&o.getAttribute("property")===(n.property==null?null:n.property)&&o.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute("charset")===(n.charSet==null?null:n.charSet)){h.splice(g,1);break t}}o=i.createElement(l),Gt(o,l,n),i.head.appendChild(o);break;default:throw Error(r(468,l))}o[Qe]=e,wt(o),l=o}e.stateNode=l}else O0(i,e.type,e.stateNode);else e.stateNode=z0(i,l,e.memoizedProps);else o!==l?(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,l===null?O0(i,e.type,e.stateNode):z0(i,l,e.memoizedProps)):l===null&&e.stateNode!==null&&kc(e,e.memoizedProps,n.memoizedProps)}break;case 27:fn(t,e),dn(e),l&512&&(At||n===null||cl(n,n.return)),n!==null&&l&4&&kc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(fn(t,e),dn(e),l&512&&(At||n===null||cl(n,n.return)),e.flags&32){i=e.stateNode;try{$n(i,"")}catch(ge){nt(e,e.return,ge)}}l&4&&e.stateNode!=null&&(i=e.memoizedProps,kc(e,i,n!==null?n.memoizedProps:i)),l&1024&&(Oc=!0);break;case 6:if(fn(t,e),dn(e),l&4){if(e.stateNode===null)throw Error(r(162));l=e.memoizedProps,n=e.stateNode;try{n.nodeValue=l}catch(ge){nt(e,e.return,ge)}}break;case 3:if(Xu=null,i=Zn,Zn=Yu(t.containerInfo),fn(t,e),Zn=i,dn(e),l&4&&n!==null&&n.memoizedState.isDehydrated)try{ss(t.containerInfo)}catch(ge){nt(e,e.return,ge)}Oc&&(Oc=!1,Oh(e));break;case 4:l=Zn,Zn=Yu(e.stateNode.containerInfo),fn(t,e),dn(e),Zn=l;break;case 12:fn(t,e),dn(e);break;case 31:fn(t,e),dn(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Au(e,l)));break;case 13:fn(t,e),dn(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Tu=mt()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Au(e,l)));break;case 22:i=e.memoizedState!==null;var C=n!==null&&n.memoizedState!==null,B=Ll,K=At;if(Ll=B||i,At=K||C,fn(t,e),At=K,Ll=B,dn(e),l&8192)e:for(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,i&&(n===null||C||Ll||At||ii(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){C=n=t;try{if(o=C.stateNode,i)h=o.style,typeof h.setProperty=="function"?h.setProperty("display","none","important"):h.display="none";else{g=C.stateNode;var I=C.memoizedProps.style,q=I!=null&&I.hasOwnProperty("display")?I.display:null;g.style.display=q==null||typeof q=="boolean"?"":(""+q).trim()}}catch(ge){nt(C,C.return,ge)}}}else if(t.tag===6){if(n===null){C=t;try{C.stateNode.nodeValue=i?"":C.memoizedProps}catch(ge){nt(C,C.return,ge)}}}else if(t.tag===18){if(n===null){C=t;try{var Y=C.stateNode;i?j0(Y,!0):j0(C.stateNode,!1)}catch(ge){nt(C,C.return,ge)}}}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;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}l&4&&(l=e.updateQueue,l!==null&&(n=l.retryQueue,n!==null&&(l.retryQueue=null,Au(e,n))));break;case 19:fn(t,e),dn(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Au(e,l)));break;case 30:break;case 21:break;default:fn(t,e),dn(e)}}function dn(e){var t=e.flags;if(t&2){try{for(var n,l=e.return;l!==null;){if(Ch(l)){n=l;break}l=l.return}if(n==null)throw Error(r(160));switch(n.tag){case 27:var i=n.stateNode,o=zc(e);Mu(e,o,i);break;case 5:var h=n.stateNode;n.flags&32&&($n(h,""),n.flags&=-33);var g=zc(e);Mu(e,g,h);break;case 3:case 4:var C=n.stateNode.containerInfo,B=zc(e);Rc(e,B,C);break;default:throw Error(r(161))}}catch(K){nt(e,e.return,K)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Oh(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Oh(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Bl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Ah(e,t.alternate,t),t=t.sibling}function ii(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:da(4,t,t.return),ii(t);break;case 1:cl(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&jh(t,t.return,n),ii(t);break;case 27:ho(t.stateNode);case 26:case 5:cl(t,t.return),ii(t);break;case 22:t.memoizedState===null&&ii(t);break;case 30:ii(t);break;default:ii(t)}e=e.sibling}}function Ul(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var l=t.alternate,i=e,o=t,h=o.flags;switch(o.tag){case 0:case 11:case 15:Ul(i,o,n),no(4,o);break;case 1:if(Ul(i,o,n),l=o,i=l.stateNode,typeof i.componentDidMount=="function")try{i.componentDidMount()}catch(B){nt(l,l.return,B)}if(l=o,i=l.updateQueue,i!==null){var g=l.stateNode;try{var C=i.shared.hiddenCallbacks;if(C!==null)for(i.shared.hiddenCallbacks=null,i=0;i<C.length;i++)fd(C[i],g)}catch(B){nt(l,l.return,B)}}n&&h&64&&Sh(o),lo(o,o.return);break;case 27:Nh(o);case 26:case 5:Ul(i,o,n),n&&l===null&&h&4&&Eh(o),lo(o,o.return);break;case 12:Ul(i,o,n);break;case 31:Ul(i,o,n),n&&h&4&&kh(i,o);break;case 13:Ul(i,o,n),n&&h&4&&zh(i,o);break;case 22:o.memoizedState===null&&Ul(i,o,n),lo(o,o.return);break;case 30:break;default:Ul(i,o,n)}t=t.sibling}}function Lc(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Gs(n))}function _c(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Gs(e))}function Kn(e,t,n,l){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Lh(e,t,n,l),t=t.sibling}function Lh(e,t,n,l){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Kn(e,t,n,l),i&2048&&no(9,t);break;case 1:Kn(e,t,n,l);break;case 3:Kn(e,t,n,l),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Gs(e)));break;case 12:if(i&2048){Kn(e,t,n,l),e=t.stateNode;try{var o=t.memoizedProps,h=o.id,g=o.onPostCommit;typeof g=="function"&&g(h,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(C){nt(t,t.return,C)}}else Kn(e,t,n,l);break;case 31:Kn(e,t,n,l);break;case 13:Kn(e,t,n,l);break;case 23:break;case 22:o=t.stateNode,h=t.alternate,t.memoizedState!==null?o._visibility&2?Kn(e,t,n,l):ao(e,t):o._visibility&2?Kn(e,t,n,l):(o._visibility|=2,Fi(e,t,n,l,(t.subtreeFlags&10256)!==0||!1)),i&2048&&Lc(h,t);break;case 24:Kn(e,t,n,l),i&2048&&_c(t.alternate,t);break;default:Kn(e,t,n,l)}}function Fi(e,t,n,l,i){for(i=i&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var o=e,h=t,g=n,C=l,B=h.flags;switch(h.tag){case 0:case 11:case 15:Fi(o,h,g,C,i),no(8,h);break;case 23:break;case 22:var K=h.stateNode;h.memoizedState!==null?K._visibility&2?Fi(o,h,g,C,i):ao(o,h):(K._visibility|=2,Fi(o,h,g,C,i)),i&&B&2048&&Lc(h.alternate,h);break;case 24:Fi(o,h,g,C,i),i&&B&2048&&_c(h.alternate,h);break;default:Fi(o,h,g,C,i)}t=t.sibling}}function ao(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,l=t,i=l.flags;switch(l.tag){case 22:ao(n,l),i&2048&&Lc(l.alternate,l);break;case 24:ao(n,l),i&2048&&_c(l.alternate,l);break;default:ao(n,l)}t=t.sibling}}var io=8192;function Ji(e,t,n){if(e.subtreeFlags&io)for(e=e.child;e!==null;)_h(e,t,n),e=e.sibling}function _h(e,t,n){switch(e.tag){case 26:Ji(e,t,n),e.flags&io&&e.memoizedState!==null&&Jp(n,Zn,e.memoizedState,e.memoizedProps);break;case 5:Ji(e,t,n);break;case 3:case 4:var l=Zn;Zn=Yu(e.stateNode.containerInfo),Ji(e,t,n),Zn=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=io,io=16777216,Ji(e,t,n),io=l):Ji(e,t,n));break;default:Ji(e,t,n)}}function Bh(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 so(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var l=t[n];Lt=l,Hh(l,e)}Bh(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Uh(e),e=e.sibling}function Uh(e){switch(e.tag){case 0:case 11:case 15:so(e),e.flags&2048&&da(9,e,e.return);break;case 3:so(e);break;case 12:so(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Du(e)):so(e);break;default:so(e)}}function Du(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var l=t[n];Lt=l,Hh(l,e)}Bh(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:da(8,t,t.return),Du(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Du(t));break;default:Du(t)}e=e.sibling}}function Hh(e,t){for(;Lt!==null;){var n=Lt;switch(n.tag){case 0:case 11:case 15:da(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var l=n.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:Gs(n.memoizedState.cache)}if(l=n.child,l!==null)l.return=n,Lt=l;else e:for(n=e;Lt!==null;){l=Lt;var i=l.sibling,o=l.return;if(Dh(l),l===n){Lt=null;break e}if(i!==null){i.return=o,Lt=i;break e}Lt=o}}}var fp={getCacheForType:function(e){var t=qt(Ct),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return qt(Ct).controller.signal}},dp=typeof WeakMap=="function"?WeakMap:Map,We=0,ct=null,Ue=null,$e=0,tt=0,Sn=null,ha=!1,Wi=!1,Bc=!1,Hl=0,bt=0,ma=0,si=0,Uc=0,jn=0,Ii=0,oo=null,hn=null,Hc=!1,Tu=0,$h=0,ku=1/0,zu=null,pa=null,Tt=0,ga=null,Pi=null,$l=0,$c=0,qc=null,qh=null,uo=0,Yc=null;function En(){return(We&2)!==0&&$e!==0?$e&-$e:R.T!==null?Kc():_e()}function Yh(){if(jn===0)if(($e&536870912)===0||Le){var e=Ql;Ql<<=1,(Ql&3932160)===0&&(Ql=262144),jn=e}else jn=536870912;return e=bn.current,e!==null&&(e.flags|=32),jn}function mn(e,t,n){(e===ct&&(tt===2||tt===9)||e.cancelPendingCommit!==null)&&(es(e,0),xa(e,$e,jn,!1)),Ie(e,n),((We&2)===0||e!==ct)&&(e===ct&&((We&2)===0&&(si|=n),bt===4&&xa(e,$e,jn,!1)),fl(e))}function Gh(e,t,n){if((We&6)!==0)throw Error(r(327));var l=!n&&(t&127)===0&&(t&e.expiredLanes)===0||Vt(e,t),i=l?pp(e,t):Xc(e,t,!0),o=l;do{if(i===0){Wi&&!l&&xa(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!hp(n)){i=Xc(e,t,!1),o=!1;continue}if(i===2){if(o=t,e.errorRecoveryDisabledLanes&o)var h=0;else h=e.pendingLanes&-536870913,h=h!==0?h:h&536870912?536870912:0;if(h!==0){t=h;e:{var g=e;i=oo;var C=g.current.memoizedState.isDehydrated;if(C&&(es(g,h).flags|=256),h=Xc(g,h,!1),h!==2){if(Bc&&!C){g.errorRecoveryDisabledLanes|=o,si|=o,i=4;break e}o=hn,hn=i,o!==null&&(hn===null?hn=o:hn.push.apply(hn,o))}i=h}if(o=!1,i!==2)continue}}if(i===1){es(e,0),xa(e,t,0,!0);break}e:{switch(l=e,o=i,o){case 0:case 1:throw Error(r(345));case 4:if((t&4194048)!==t)break;case 6:xa(l,t,jn,!ha);break e;case 2:hn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((t&62914560)===t&&(i=Tu+300-mt(),10<i)){if(xa(l,t,jn,!ha),pn(l,0,!0)!==0)break e;$l=t,l.timeoutHandle=b0(Xh.bind(null,l,n,hn,zu,Hc,t,jn,si,Ii,ha,o,"Throttled",-0,0),i);break e}Xh(l,n,hn,zu,Hc,t,jn,si,Ii,ha,o,null,-0,0)}}break}while(!0);fl(e)}function Xh(e,t,n,l,i,o,h,g,C,B,K,I,q,Y){if(e.timeoutHandle=-1,I=t.subtreeFlags,I&8192||(I&16785408)===16785408){I={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Nn},_h(t,o,I);var ge=(o&62914560)===o?Tu-mt():(o&4194048)===o?$h-mt():0;if(ge=Wp(I,ge),ge!==null){$l=o,e.cancelPendingCommit=ge(Ih.bind(null,e,t,o,n,l,i,h,g,C,K,I,null,q,Y)),xa(e,o,h,!B);return}}Ih(e,t,o,n,l,i,h,g,C)}function hp(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var l=0;l<n.length;l++){var i=n[l],o=i.getSnapshot;i=i.value;try{if(!Jt(o(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;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 xa(e,t,n,l){t&=~Uc,t&=~si,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var i=t;0<i;){var o=31-zt(i),h=1<<o;l[o]=-1,i&=~h}n!==0&&In(e,n,t)}function Ru(){return(We&6)===0?(ro(0),!1):!0}function Gc(){if(Ue!==null){if(tt===0)var e=Ue.return;else e=Ue,Dl=Wa=null,ic(e),Xi=null,Qs=0,e=Ue;for(;e!==null;)wh(e.alternate,e),e=e.return;Ue=null}}function es(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Rp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),$l=0,Gc(),ct=e,Ue=n=Xn(e.current,null),$e=t,tt=0,Sn=null,ha=!1,Wi=Vt(e,t),Bc=!1,Ii=jn=Uc=si=ma=bt=0,hn=oo=null,Hc=!1,(t&8)!==0&&(t|=t&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=t;0<l;){var i=31-zt(l),o=1<<i;t|=e[i],l&=~o}return Hl=t,un(),n}function Qh(e,t){Te=null,R.H=Ps,t===Gi||t===uu?(t=od(),tt=3):t===Zr?(t=od(),tt=4):tt=t===wc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Sn=t,Ue===null&&(bt=1,Su(e,j(t,e.current)))}function Vh(){var e=bn.current;return e===null?!0:($e&4194048)===$e?Tn===null:($e&62914560)===$e||($e&536870912)!==0?e===Tn:!1}function Zh(){var e=R.H;return R.H=Ps,e===null?Ps:e}function Kh(){var e=R.A;return R.A=fp,e}function Ou(){bt=4,ha||($e&4194048)!==$e&&bn.current!==null||(Wi=!0),(ma&134217727)===0&&(si&134217727)===0||ct===null||xa(ct,$e,jn,!1)}function Xc(e,t,n){var l=We;We|=2;var i=Zh(),o=Kh();(ct!==e||$e!==t)&&(zu=null,es(e,t)),t=!1;var h=bt;e:do try{if(tt!==0&&Ue!==null){var g=Ue,C=Sn;switch(tt){case 8:Gc(),h=6;break e;case 3:case 2:case 9:case 6:bn.current===null&&(t=!0);var B=tt;if(tt=0,Sn=null,ts(e,g,C,B),n&&Wi){h=0;break e}break;default:B=tt,tt=0,Sn=null,ts(e,g,C,B)}}mp(),h=bt;break}catch(K){Qh(e,K)}while(!0);return t&&e.shellSuspendCounter++,Dl=Wa=null,We=l,R.H=i,R.A=o,Ue===null&&(ct=null,$e=0,un()),h}function mp(){for(;Ue!==null;)Fh(Ue)}function pp(e,t){var n=We;We|=2;var l=Zh(),i=Kh();ct!==e||$e!==t?(zu=null,ku=mt()+500,es(e,t)):Wi=Vt(e,t);e:do try{if(tt!==0&&Ue!==null){t=Ue;var o=Sn;t:switch(tt){case 1:tt=0,Sn=null,ts(e,t,o,1);break;case 2:case 9:if(id(o)){tt=0,Sn=null,Jh(t);break}t=function(){tt!==2&&tt!==9||ct!==e||(tt=7),fl(e)},o.then(t,t);break e;case 3:tt=7;break e;case 4:tt=5;break e;case 7:id(o)?(tt=0,Sn=null,Jh(t)):(tt=0,Sn=null,ts(e,t,o,7));break;case 5:var h=null;switch(Ue.tag){case 26:h=Ue.memoizedState;case 5:case 27:var g=Ue;if(h?L0(h):g.stateNode.complete){tt=0,Sn=null;var C=g.sibling;if(C!==null)Ue=C;else{var B=g.return;B!==null?(Ue=B,Lu(B)):Ue=null}break t}}tt=0,Sn=null,ts(e,t,o,5);break;case 6:tt=0,Sn=null,ts(e,t,o,6);break;case 8:Gc(),bt=6;break e;default:throw Error(r(462))}}gp();break}catch(K){Qh(e,K)}while(!0);return Dl=Wa=null,R.H=l,R.A=i,We=n,Ue!==null?0:(ct=null,$e=0,un(),bt)}function gp(){for(;Ue!==null&&!mi();)Fh(Ue)}function Fh(e){var t=vh(e.alternate,e,Hl);e.memoizedProps=e.pendingProps,t===null?Lu(e):Ue=t}function Jh(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=hh(n,t,t.pendingProps,t.type,void 0,$e);break;case 11:t=hh(n,t,t.pendingProps,t.type.render,t.ref,$e);break;case 5:ic(t);default:wh(n,t),t=Ue=$s(t,Hl),t=vh(n,t,Hl)}e.memoizedProps=e.pendingProps,t===null?Lu(e):Ue=t}function ts(e,t,n,l){Dl=Wa=null,ic(t),Xi=null,Qs=0;var i=t.return;try{if(ap(e,i,t,n,$e)){bt=1,Su(e,j(n,e.current)),Ue=null;return}}catch(o){if(i!==null)throw Ue=i,o;bt=1,Su(e,j(n,e.current)),Ue=null;return}t.flags&32768?(Le||l===1?e=!0:Wi||($e&536870912)!==0?e=!1:(ha=e=!0,(l===2||l===9||l===3||l===6)&&(l=bn.current,l!==null&&l.tag===13&&(l.flags|=16384))),Wh(t,e)):Lu(t)}function Lu(e){var t=e;do{if((t.flags&32768)!==0){Wh(t,ha);return}e=t.return;var n=op(t.alternate,t,Hl);if(n!==null){Ue=n;return}if(t=t.sibling,t!==null){Ue=t;return}Ue=t=e}while(t!==null);bt===0&&(bt=5)}function Wh(e,t){do{var n=up(e.alternate,e);if(n!==null){n.flags&=32767,Ue=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Ue=e;return}Ue=e=n}while(e!==null);bt=6,Ue=null}function Ih(e,t,n,l,i,o,h,g,C){e.cancelPendingCommit=null;do _u();while(Tt!==0);if((We&6)!==0)throw Error(r(327));if(t!==null){if(t===e.current)throw Error(r(177));if(o=t.lanes|t.childLanes,o|=Us,Vl(e,n,o,h,g,C),e===ct&&(Ue=ct=null,$e=0),Pi=t,ga=e,$l=n,$c=o,qc=i,qh=l,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,bp(ft,function(){return l0(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=R.T,R.T=null,i=W.p,W.p=2,h=We,We|=4;try{rp(e,t,n)}finally{We=h,W.p=i,R.T=l}}Tt=1,Ph(),e0(),t0()}}function Ph(){if(Tt===1){Tt=0;var e=ga,t=Pi,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=R.T,R.T=null;var l=W.p;W.p=2;var i=We;We|=4;try{Rh(t,e);var o=nf,h=Po(e.containerInfo),g=o.focusedElem,C=o.selectionRange;if(h!==g&&g&&g.ownerDocument&&Io(g.ownerDocument.documentElement,g)){if(C!==null&&Rs(g)){var B=C.start,K=C.end;if(K===void 0&&(K=B),"selectionStart"in g)g.selectionStart=B,g.selectionEnd=Math.min(K,g.value.length);else{var I=g.ownerDocument||document,q=I&&I.defaultView||window;if(q.getSelection){var Y=q.getSelection(),ge=g.textContent.length,Ne=Math.min(C.start,ge),it=C.end===void 0?Ne:Math.min(C.end,ge);!Y.extend&&Ne>it&&(h=it,it=Ne,Ne=h);var D=Wo(g,Ne),A=Wo(g,it);if(D&&A&&(Y.rangeCount!==1||Y.anchorNode!==D.node||Y.anchorOffset!==D.offset||Y.focusNode!==A.node||Y.focusOffset!==A.offset)){var _=I.createRange();_.setStart(D.node,D.offset),Y.removeAllRanges(),Ne>it?(Y.addRange(_),Y.extend(A.node,A.offset)):(_.setEnd(A.node,A.offset),Y.addRange(_))}}}}for(I=[],Y=g;Y=Y.parentNode;)Y.nodeType===1&&I.push({element:Y,left:Y.scrollLeft,top:Y.scrollTop});for(typeof g.focus=="function"&&g.focus(),g=0;g<I.length;g++){var J=I[g];J.element.scrollLeft=J.left,J.element.scrollTop=J.top}}Ku=!!tf,nf=tf=null}finally{We=i,W.p=l,R.T=n}}e.current=t,Tt=2}}function e0(){if(Tt===2){Tt=0;var e=ga,t=Pi,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=R.T,R.T=null;var l=W.p;W.p=2;var i=We;We|=4;try{Ah(e,t.alternate,t)}finally{We=i,W.p=l,R.T=n}}Tt=3}}function t0(){if(Tt===4||Tt===3){Tt=0,Ln();var e=ga,t=Pi,n=$l,l=qh;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Tt=5:(Tt=0,Pi=ga=null,n0(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(pa=null),Re(n),t=t.stateNode,Bt&&typeof Bt.onCommitFiberRoot=="function")try{Bt.onCommitFiberRoot(dl,t,void 0,(t.current.flags&128)===128)}catch{}if(l!==null){t=R.T,i=W.p,W.p=2,R.T=null;try{for(var o=e.onRecoverableError,h=0;h<l.length;h++){var g=l[h];o(g.value,{componentStack:g.stack})}}finally{R.T=t,W.p=i}}($l&3)!==0&&_u(),fl(e),i=e.pendingLanes,(n&261930)!==0&&(i&42)!==0?e===Yc?uo++:(uo=0,Yc=e):uo=0,ro(0)}}function n0(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Gs(t)))}function _u(){return Ph(),e0(),t0(),l0()}function l0(){if(Tt!==5)return!1;var e=ga,t=$c;$c=0;var n=Re($l),l=R.T,i=W.p;try{W.p=32>n?32:n,R.T=null,n=qc,qc=null;var o=ga,h=$l;if(Tt=0,Pi=ga=null,$l=0,(We&6)!==0)throw Error(r(331));var g=We;if(We|=4,Uh(o.current),Lh(o,o.current,h,n),We=g,ro(0,!1),Bt&&typeof Bt.onPostCommitFiberRoot=="function")try{Bt.onPostCommitFiberRoot(dl,o)}catch{}return!0}finally{W.p=i,R.T=l,n0(e,t)}}function a0(e,t,n){t=j(n,t),t=bc(e.stateNode,t,2),e=ra(e,t,2),e!==null&&(Ie(e,2),fl(e))}function nt(e,t,n){if(e.tag===3)a0(e,e,n);else for(;t!==null;){if(t.tag===3){a0(t,e,n);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(pa===null||!pa.has(l))){e=j(n,e),n=ih(2),l=ra(t,n,2),l!==null&&(sh(n,l,t,e),Ie(l,2),fl(l));break}}t=t.return}}function Qc(e,t,n){var l=e.pingCache;if(l===null){l=e.pingCache=new dp;var i=new Set;l.set(t,i)}else i=l.get(t),i===void 0&&(i=new Set,l.set(t,i));i.has(n)||(Bc=!0,i.add(n),e=xp.bind(null,e,t,n),t.then(e,e))}function xp(e,t,n){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,ct===e&&($e&n)===n&&(bt===4||bt===3&&($e&62914560)===$e&&300>mt()-Tu?(We&2)===0&&es(e,0):Uc|=n,Ii===$e&&(Ii=0)),fl(e)}function i0(e,t){t===0&&(t=ml()),e=Gn(e,t),e!==null&&(Ie(e,t),fl(e))}function yp(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),i0(e,n)}function vp(e,t){var n=0;switch(e.tag){case 31:case 13:var l=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(r(314))}l!==null&&l.delete(t),i0(e,n)}function bp(e,t){return Jn(e,t)}var Bu=null,ns=null,Vc=!1,Uu=!1,Zc=!1,ya=0;function fl(e){e!==ns&&e.next===null&&(ns===null?Bu=ns=e:ns=ns.next=e),Uu=!0,Vc||(Vc=!0,Sp())}function ro(e,t){if(!Zc&&Uu){Zc=!0;do for(var n=!1,l=Bu;l!==null;){if(e!==0){var i=l.pendingLanes;if(i===0)var o=0;else{var h=l.suspendedLanes,g=l.pingedLanes;o=(1<<31-zt(42|e)+1)-1,o&=i&~(h&~g),o=o&201326741?o&201326741|1:o?o|2:0}o!==0&&(n=!0,r0(l,o))}else o=$e,o=pn(l,l===ct?o:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(o&3)===0||Vt(l,o)||(n=!0,r0(l,o));l=l.next}while(n);Zc=!1}}function wp(){s0()}function s0(){Uu=Vc=!1;var e=0;ya!==0&&zp()&&(e=ya);for(var t=mt(),n=null,l=Bu;l!==null;){var i=l.next,o=o0(l,t);o===0?(l.next=null,n===null?Bu=i:n.next=i,i===null&&(ns=n)):(n=l,(e!==0||(o&3)!==0)&&(Uu=!0)),l=i}Tt!==0&&Tt!==5||ro(e),ya!==0&&(ya=0)}function o0(e,t){for(var n=e.suspendedLanes,l=e.pingedLanes,i=e.expirationTimes,o=e.pendingLanes&-62914561;0<o;){var h=31-zt(o),g=1<<h,C=i[h];C===-1?((g&n)===0||(g&l)!==0)&&(i[h]=ds(g,t)):C<=t&&(e.expiredLanes|=g),o&=~g}if(t=ct,n=$e,n=pn(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,n===0||e===t&&(tt===2||tt===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&Cn(l),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||Vt(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(l!==null&&Cn(l),Re(n)){case 2:case 8:n=Wn;break;case 32:n=ft;break;case 268435456:n=Aa;break;default:n=ft}return l=u0.bind(null,e),n=Jn(n,l),e.callbackPriority=t,e.callbackNode=n,t}return l!==null&&l!==null&&Cn(l),e.callbackPriority=2,e.callbackNode=null,2}function u0(e,t){if(Tt!==0&&Tt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(_u()&&e.callbackNode!==n)return null;var l=$e;return l=pn(e,e===ct?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(Gh(e,l,t),o0(e,mt()),e.callbackNode!=null&&e.callbackNode===n?u0.bind(null,e):null)}function r0(e,t){if(_u())return null;Gh(e,t,!0)}function Sp(){Op(function(){(We&6)!==0?Jn(Gl,wp):s0()})}function Kc(){if(ya===0){var e=qi;e===0&&(e=hl,hl<<=1,(hl&261888)===0&&(hl=256)),ya=e}return ya}function c0(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:nl(""+e)}function f0(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function jp(e,t,n,l,i){if(t==="submit"&&n&&n.stateNode===i){var o=c0((i[Be]||null).action),h=l.submitter;h&&(t=(t=h[Be]||null)?c0(t.formAction):h.getAttribute("formAction"),t!==null&&(o=t,h=null));var g=new Ha("action","action",null,l,i);e.push({event:g,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(ya!==0){var C=h?f0(i,h):new FormData(i);mc(n,{pending:!0,data:C,method:i.method,action:o},null,C)}}else typeof o=="function"&&(g.preventDefault(),C=h?f0(i,h):new FormData(i),mc(n,{pending:!0,data:C,method:i.method,action:o},o,C))},currentTarget:i}]})}}for(var Fc=0;Fc<Bs.length;Fc++){var Jc=Bs[Fc],Ep=Jc.toLowerCase(),Cp=Jc[0].toUpperCase()+Jc.slice(1);vn(Ep,"on"+Cp)}vn(Ls,"onAnimationEnd"),vn(Ka,"onAnimationIteration"),vn(_s,"onAnimationStart"),vn("dblclick","onDoubleClick"),vn("focusin","onFocus"),vn("focusout","onBlur"),vn(tu,"onTransitionRun"),vn(Ur,"onTransitionStart"),vn(ta,"onTransitionCancel"),vn(nu,"onTransitionEnd"),gn("onMouseEnter",["mouseout","mouseover"]),gn("onMouseLeave",["mouseout","mouseover"]),gn("onPointerEnter",["pointerout","pointerover"]),gn("onPointerLeave",["pointerout","pointerover"]),Rt("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Rt("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Rt("onBeforeInput",["compositionend","keypress","textInput","paste"]),Rt("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Rt("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Rt("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var co="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(" "),Np=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(co));function d0(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var l=e[n],i=l.event;l=l.listeners;e:{var o=void 0;if(t)for(var h=l.length-1;0<=h;h--){var g=l[h],C=g.instance,B=g.currentTarget;if(g=g.listener,C!==o&&i.isPropagationStopped())break e;o=g,i.currentTarget=B;try{o(i)}catch(K){Oi(K)}i.currentTarget=null,o=C}else for(h=0;h<l.length;h++){if(g=l[h],C=g.instance,B=g.currentTarget,g=g.listener,C!==o&&i.isPropagationStopped())break e;o=g,i.currentTarget=B;try{o(i)}catch(K){Oi(K)}i.currentTarget=null,o=C}}}}function He(e,t){var n=t[pl];n===void 0&&(n=t[pl]=new Set);var l=e+"__bubble";n.has(l)||(h0(t,e,2,!1),n.add(l))}function Wc(e,t,n){var l=0;t&&(l|=4),h0(n,e,l,t)}var Hu="_reactListening"+Math.random().toString(36).slice(2);function Ic(e){if(!e[Hu]){e[Hu]=!0,ka.forEach(function(n){n!=="selectionchange"&&(Np.has(n)||Wc(n,!1,e),Wc(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Hu]||(t[Hu]=!0,Wc("selectionchange",!1,t))}}function h0(e,t,n,l){switch(Y0(t)){case 2:var i=eg;break;case 8:i=tg;break;default:i=mf}n=i.bind(null,t,n,e),i=void 0,!Ba||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),l?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function Pc(e,t,n,l,i){var o=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var h=l.tag;if(h===3||h===4){var g=l.stateNode.containerInfo;if(g===i)break;if(h===4)for(h=l.return;h!==null;){var C=h.tag;if((C===3||C===4)&&h.stateNode.containerInfo===i)return;h=h.return}for(;g!==null;){if(h=Un(g),h===null)return;if(C=h.tag,C===5||C===6||C===26||C===27){l=o=h;continue e}g=g.parentNode}}l=l.return}Uo(function(){var B=o,K=ll(n),I=[];e:{var q=lu.get(e);if(q!==void 0){var Y=Ha,ge=e;switch(e){case"keypress":if(Ei(n)===0)break e;case"keydown":case"keyup":Y=Go;break;case"focusin":ge="focus",Y=js;break;case"focusout":ge="blur",Y=js;break;case"beforeblur":case"afterblur":Y=js;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Y=$o;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Y=Ss;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Y=Ga;break;case Ls:case Ka:case _s:Y=yn;break;case nu:Y=Mr;break;case"scroll":case"scrollend":Y=Ho;break;case"wheel":Y=Dr;break;case"copy":case"cut":case"paste":Y=Mi;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Y=Ms;break;case"toggle":case"beforetoggle":Y=kr}var Ne=(t&4)!==0,it=!Ne&&(e==="scroll"||e==="scrollend"),D=Ne?q!==null?q+"Capture":null:q;Ne=[];for(var A=B,_;A!==null;){var J=A;if(_=J.stateNode,J=J.tag,J!==5&&J!==26&&J!==27||_===null||D===null||(J=_a(A,D),J!=null&&Ne.push(fo(A,J,_))),it)break;A=A.return}0<Ne.length&&(q=new Y(q,ge,null,n,K),I.push({event:q,listeners:Ne}))}}if((t&7)===0){e:{if(q=e==="mouseover"||e==="pointerover",Y=e==="mouseout"||e==="pointerout",q&&n!==pt&&(ge=n.relatedTarget||n.fromElement)&&(Un(ge)||ge[ut]))break e;if((Y||q)&&(q=K.window===K?K:(q=K.ownerDocument)?q.defaultView||q.parentWindow:window,Y?(ge=n.relatedTarget||n.toElement,Y=B,ge=ge?Un(ge):null,ge!==null&&(it=d(ge),Ne=ge.tag,ge!==it||Ne!==5&&Ne!==27&&Ne!==6)&&(ge=null)):(Y=null,ge=B),Y!==ge)){if(Ne=$o,J="onMouseLeave",D="onMouseEnter",A="mouse",(e==="pointerout"||e==="pointerover")&&(Ne=Ms,J="onPointerLeave",D="onPointerEnter",A="pointer"),it=Y==null?q:Ta(Y),_=ge==null?q:Ta(ge),q=new Ne(J,A+"leave",Y,n,K),q.target=it,q.relatedTarget=_,J=null,Un(K)===B&&(Ne=new Ne(D,A+"enter",ge,n,K),Ne.target=_,Ne.relatedTarget=it,J=Ne),it=J,Y&&ge)t:{for(Ne=Mp,D=Y,A=ge,_=0,J=D;J;J=Ne(J))_++;J=0;for(var je=A;je;je=Ne(je))J++;for(;0<_-J;)D=Ne(D),_--;for(;0<J-_;)A=Ne(A),J--;for(;_--;){if(D===A||A!==null&&D===A.alternate){Ne=D;break t}D=Ne(D),A=Ne(A)}Ne=null}else Ne=null;Y!==null&&m0(I,q,Y,Ne,!1),ge!==null&&it!==null&&m0(I,it,ge,Ne,!0)}}e:{if(q=B?Ta(B):window,Y=q.nodeName&&q.nodeName.toLowerCase(),Y==="select"||Y==="input"&&q.type==="file")var Ke=Jo;else if(Di(q))if(ol)Ke=rl;else{Ke=ki;var be=ks}else Y=q.nodeName,!Y||Y.toLowerCase()!=="input"||q.type!=="checkbox"&&q.type!=="radio"?B&&ys(B.elementType)&&(Ke=Jo):Ke=_r;if(Ke&&(Ke=Ke(e,B))){Ti(I,Ke,n,K);break e}be&&be(e,q,B),e==="focusout"&&B&&q.type==="number"&&B.memoizedProps.value!=null&&el(q,"number",q.value)}switch(be=B?Ta(B):window,e){case"focusin":(Di(be)||be.contentEditable==="true")&&(Sl=be,Va=B,Za=null);break;case"focusout":Za=Va=Sl=null;break;case"mousedown":Os=!0;break;case"contextmenu":case"mouseup":case"dragend":Os=!1,Ri(I,n,K);break;case"selectionchange":if(Br)break;case"keydown":case"keyup":Ri(I,n,K)}var ze;if(Xa)e:{switch(e){case"compositionstart":var qe="onCompositionStart";break e;case"compositionend":qe="onCompositionEnd";break e;case"compositionupdate":qe="onCompositionUpdate";break e}qe=void 0}else Ft?Il(e,n)&&(qe="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(qe="onCompositionStart");qe&&(Zo&&n.locale!=="ko"&&(Ft||qe!=="onCompositionStart"?qe==="onCompositionEnd"&&Ft&&(ze=ji()):(al=K,vs="value"in al?al.value:al.textContent,Ft=!0)),be=$u(B,qe),0<be.length&&(qe=new Yn(qe,e,null,n,K),I.push({event:qe,listeners:be}),ze?qe.data=ze:(ze=Ko(n),ze!==null&&(qe.data=ze)))),(ze=zr?Rr(e,n):Or(e,n))&&(qe=$u(B,"onBeforeInput"),0<qe.length&&(be=new Yn("onBeforeInput","beforeinput",null,n,K),I.push({event:be,listeners:qe}),be.data=ze)),jp(I,e,B,n,K)}d0(I,t)})}function fo(e,t,n){return{instance:e,listener:t,currentTarget:n}}function $u(e,t){for(var n=t+"Capture",l=[];e!==null;){var i=e,o=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||o===null||(i=_a(e,n),i!=null&&l.unshift(fo(e,i,o)),i=_a(e,t),i!=null&&l.push(fo(e,i,o))),e.tag===3)return l;e=e.return}return[]}function Mp(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function m0(e,t,n,l,i){for(var o=t._reactName,h=[];n!==null&&n!==l;){var g=n,C=g.alternate,B=g.stateNode;if(g=g.tag,C!==null&&C===l)break;g!==5&&g!==26&&g!==27||B===null||(C=B,i?(B=_a(n,o),B!=null&&h.unshift(fo(n,B,C))):i||(B=_a(n,o),B!=null&&h.push(fo(n,B,C)))),n=n.return}h.length!==0&&e.push({event:t,listeners:h})}var Ap=/\r\n?/g,Dp=/\u0000|\uFFFD/g;function p0(e){return(typeof e=="string"?e:""+e).replace(Ap,`
9
+ `).replace(Dp,"")}function g0(e,t){return t=p0(t),p0(e)===t}function at(e,t,n,l,i,o){switch(n){case"children":typeof l=="string"?t==="body"||t==="textarea"&&l===""||$n(e,l):(typeof l=="number"||typeof l=="bigint")&&t!=="body"&&$n(e,""+l);break;case"className":za(e,"class",l);break;case"tabIndex":za(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":za(e,n,l);break;case"style":_o(e,l,o);break;case"data":if(t!=="object"){za(e,"data",l);break}case"src":case"href":if(l===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(n);break}l=nl(""+l),e.setAttribute(n,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(n,"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 o=="function"&&(n==="formAction"?(t!=="input"&&at(e,t,"name",i.name,i,null),at(e,t,"formEncType",i.formEncType,i,null),at(e,t,"formMethod",i.formMethod,i,null),at(e,t,"formTarget",i.formTarget,i,null)):(at(e,t,"encType",i.encType,i,null),at(e,t,"method",i.method,i,null),at(e,t,"target",i.target,i,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(n);break}l=nl(""+l),e.setAttribute(n,l);break;case"onClick":l!=null&&(e.onclick=Nn);break;case"onScroll":l!=null&&He("scroll",e);break;case"onScrollEnd":l!=null&&He("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(r(61));if(n=l.__html,n!=null){if(i.children!=null)throw Error(r(60));e.innerHTML=n}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}n=nl(""+l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,""+l):e.removeAttribute(n);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":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":l===!0?e.setAttribute(n,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,l):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(n,l):e.removeAttribute(n);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(n):e.setAttribute(n,l);break;case"popover":He("beforetoggle",e),He("toggle",e),Pn(e,"popover",l);break;case"xlinkActuate":xn(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":xn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":xn(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":xn(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":xn(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":xn(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":xn(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":xn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":xn(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Pn(e,"is",l);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=La.get(n)||n,Pn(e,n,l))}}function ef(e,t,n,l,i,o){switch(n){case"style":_o(e,l,o);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(r(61));if(n=l.__html,n!=null){if(i.children!=null)throw Error(r(60));e.innerHTML=n}}break;case"children":typeof l=="string"?$n(e,l):(typeof l=="number"||typeof l=="bigint")&&$n(e,""+l);break;case"onScroll":l!=null&&He("scroll",e);break;case"onScrollEnd":l!=null&&He("scrollend",e);break;case"onClick":l!=null&&(e.onclick=Nn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ko.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(i=n.endsWith("Capture"),t=n.slice(2,i?n.length-7:void 0),o=e[Be]||null,o=o!=null?o[n]:null,typeof o=="function"&&e.removeEventListener(t,o,i),typeof l=="function")){typeof o!="function"&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,l,i);break e}n in e?e[n]=l:l===!0?e.setAttribute(n,""):Pn(e,n,l)}}}function Gt(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":He("error",e),He("load",e);var l=!1,i=!1,o;for(o in n)if(n.hasOwnProperty(o)){var h=n[o];if(h!=null)switch(o){case"src":l=!0;break;case"srcSet":i=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,t));default:at(e,t,o,h,n,null)}}i&&at(e,t,"srcSet",n.srcSet,n,null),l&&at(e,t,"src",n.src,n,null);return;case"input":He("invalid",e);var g=o=h=i=null,C=null,B=null;for(l in n)if(n.hasOwnProperty(l)){var K=n[l];if(K!=null)switch(l){case"name":i=K;break;case"type":h=K;break;case"checked":C=K;break;case"defaultChecked":B=K;break;case"value":o=K;break;case"defaultValue":g=K;break;case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(r(137,t));break;default:at(e,t,l,K,n,null)}}Oa(e,o,g,C,B,h,i,!1);return;case"select":He("invalid",e),l=h=o=null;for(i in n)if(n.hasOwnProperty(i)&&(g=n[i],g!=null))switch(i){case"value":o=g;break;case"defaultValue":h=g;break;case"multiple":l=g;default:at(e,t,i,g,n,null)}t=o,n=h,e.multiple=!!l,t!=null?tl(e,!!l,t,!1):n!=null&&tl(e,!!l,n,!0);return;case"textarea":He("invalid",e),o=i=l=null;for(h in n)if(n.hasOwnProperty(h)&&(g=n[h],g!=null))switch(h){case"value":l=g;break;case"defaultValue":i=g;break;case"children":o=g;break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(r(91));break;default:at(e,t,h,g,n,null)}bi(e,l,i,o);return;case"option":for(C in n)n.hasOwnProperty(C)&&(l=n[C],l!=null)&&(C==="selected"?e.selected=l&&typeof l!="function"&&typeof l!="symbol":at(e,t,C,l,n,null));return;case"dialog":He("beforetoggle",e),He("toggle",e),He("cancel",e),He("close",e);break;case"iframe":case"object":He("load",e);break;case"video":case"audio":for(l=0;l<co.length;l++)He(co[l],e);break;case"image":He("error",e),He("load",e);break;case"details":He("toggle",e);break;case"embed":case"source":case"link":He("error",e),He("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(B in n)if(n.hasOwnProperty(B)&&(l=n[B],l!=null))switch(B){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,t));default:at(e,t,B,l,n,null)}return;default:if(ys(t)){for(K in n)n.hasOwnProperty(K)&&(l=n[K],l!==void 0&&ef(e,t,K,l,n,void 0));return}}for(g in n)n.hasOwnProperty(g)&&(l=n[g],l!=null&&at(e,t,g,l,n,null))}function Tp(e,t,n,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var i=null,o=null,h=null,g=null,C=null,B=null,K=null;for(Y in n){var I=n[Y];if(n.hasOwnProperty(Y)&&I!=null)switch(Y){case"checked":break;case"value":break;case"defaultValue":C=I;default:l.hasOwnProperty(Y)||at(e,t,Y,null,l,I)}}for(var q in l){var Y=l[q];if(I=n[q],l.hasOwnProperty(q)&&(Y!=null||I!=null))switch(q){case"type":o=Y;break;case"name":i=Y;break;case"checked":B=Y;break;case"defaultChecked":K=Y;break;case"value":h=Y;break;case"defaultValue":g=Y;break;case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(r(137,t));break;default:Y!==I&&at(e,t,q,Y,l,I)}}Hn(e,h,g,C,B,K,o,i);return;case"select":Y=h=g=q=null;for(o in n)if(C=n[o],n.hasOwnProperty(o)&&C!=null)switch(o){case"value":break;case"multiple":Y=C;default:l.hasOwnProperty(o)||at(e,t,o,null,l,C)}for(i in l)if(o=l[i],C=n[i],l.hasOwnProperty(i)&&(o!=null||C!=null))switch(i){case"value":q=o;break;case"defaultValue":g=o;break;case"multiple":h=o;default:o!==C&&at(e,t,i,o,l,C)}t=g,n=h,l=Y,q!=null?tl(e,!!n,q,!1):!!l!=!!n&&(t!=null?tl(e,!!n,t,!0):tl(e,!!n,n?[]:"",!1));return;case"textarea":Y=q=null;for(g in n)if(i=n[g],n.hasOwnProperty(g)&&i!=null&&!l.hasOwnProperty(g))switch(g){case"value":break;case"children":break;default:at(e,t,g,null,l,i)}for(h in l)if(i=l[h],o=n[h],l.hasOwnProperty(h)&&(i!=null||o!=null))switch(h){case"value":q=i;break;case"defaultValue":Y=i;break;case"children":break;case"dangerouslySetInnerHTML":if(i!=null)throw Error(r(91));break;default:i!==o&&at(e,t,h,i,l,o)}vi(e,q,Y);return;case"option":for(var ge in n)q=n[ge],n.hasOwnProperty(ge)&&q!=null&&!l.hasOwnProperty(ge)&&(ge==="selected"?e.selected=!1:at(e,t,ge,null,l,q));for(C in l)q=l[C],Y=n[C],l.hasOwnProperty(C)&&q!==Y&&(q!=null||Y!=null)&&(C==="selected"?e.selected=q&&typeof q!="function"&&typeof q!="symbol":at(e,t,C,q,l,Y));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 Ne in n)q=n[Ne],n.hasOwnProperty(Ne)&&q!=null&&!l.hasOwnProperty(Ne)&&at(e,t,Ne,null,l,q);for(B in l)if(q=l[B],Y=n[B],l.hasOwnProperty(B)&&q!==Y&&(q!=null||Y!=null))switch(B){case"children":case"dangerouslySetInnerHTML":if(q!=null)throw Error(r(137,t));break;default:at(e,t,B,q,l,Y)}return;default:if(ys(t)){for(var it in n)q=n[it],n.hasOwnProperty(it)&&q!==void 0&&!l.hasOwnProperty(it)&&ef(e,t,it,void 0,l,q);for(K in l)q=l[K],Y=n[K],!l.hasOwnProperty(K)||q===Y||q===void 0&&Y===void 0||ef(e,t,K,q,l,Y);return}}for(var D in n)q=n[D],n.hasOwnProperty(D)&&q!=null&&!l.hasOwnProperty(D)&&at(e,t,D,null,l,q);for(I in l)q=l[I],Y=n[I],!l.hasOwnProperty(I)||q===Y||q==null&&Y==null||at(e,t,I,q,l,Y)}function x0(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function kp(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),l=0;l<n.length;l++){var i=n[l],o=i.transferSize,h=i.initiatorType,g=i.duration;if(o&&g&&x0(h)){for(h=0,g=i.responseEnd,l+=1;l<n.length;l++){var C=n[l],B=C.startTime;if(B>g)break;var K=C.transferSize,I=C.initiatorType;K&&x0(I)&&(C=C.responseEnd,h+=K*(C<g?1:(g-B)/(C-B)))}if(--l,t+=8*(o+h)/(i.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 tf=null,nf=null;function qu(e){return e.nodeType===9?e:e.ownerDocument}function y0(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 v0(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 lf(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 af=null;function zp(){var e=window.event;return e&&e.type==="popstate"?e===af?!1:(af=e,!0):(af=null,!1)}var b0=typeof setTimeout=="function"?setTimeout:void 0,Rp=typeof clearTimeout=="function"?clearTimeout:void 0,w0=typeof Promise=="function"?Promise:void 0,Op=typeof queueMicrotask=="function"?queueMicrotask:typeof w0<"u"?function(e){return w0.resolve(null).then(e).catch(Lp)}:b0;function Lp(e){setTimeout(function(){throw e})}function va(e){return e==="head"}function S0(e,t){var n=t,l=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"||n==="/&"){if(l===0){e.removeChild(i),ss(t);return}l--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")l++;else if(n==="html")ho(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,ho(n);for(var o=n.firstChild;o;){var h=o.nextSibling,g=o.nodeName;o[gl]||g==="SCRIPT"||g==="STYLE"||g==="LINK"&&o.rel.toLowerCase()==="stylesheet"||n.removeChild(o),o=h}}else n==="body"&&ho(e.ownerDocument.body);n=i}while(n);ss(t)}function j0(e,t){var n=e;e=0;do{var l=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),l&&l.nodeType===8)if(n=l.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=l}while(n)}function sf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":sf(n),Ht(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function _p(e,t,n,l){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[gl])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(o=e.getAttribute("rel"),o==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(o!==i.rel||e.getAttribute("href")!==(i.href==null||i.href===""?null:i.href)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute("title")!==(i.title==null?null:i.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(o=e.getAttribute("src"),(o!==(i.src==null?null:i.src)||e.getAttribute("type")!==(i.type==null?null:i.type)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin))&&o&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var o=i.name==null?null:""+i.name;if(i.type==="hidden"&&e.getAttribute("name")===o)return e}else return e;if(e=kn(e.nextSibling),e===null)break}return null}function Bp(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=kn(e.nextSibling),e===null))return null;return e}function E0(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=kn(e.nextSibling),e===null))return null;return e}function of(e){return e.data==="$?"||e.data==="$~"}function uf(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Up(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var l=function(){t(),n.removeEventListener("DOMContentLoaded",l)};n.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function kn(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 rf=null;function C0(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return kn(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function N0(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function M0(e,t,n){switch(t=qu(n),e){case"html":if(e=t.documentElement,!e)throw Error(r(452));return e;case"head":if(e=t.head,!e)throw Error(r(453));return e;case"body":if(e=t.body,!e)throw Error(r(454));return e;default:throw Error(r(451))}}function ho(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Ht(e)}var zn=new Map,A0=new Set;function Yu(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ql=W.d;W.d={f:Hp,r:$p,D:qp,C:Yp,L:Gp,m:Xp,X:Vp,S:Qp,M:Zp};function Hp(){var e=ql.f(),t=Ru();return e||t}function $p(e){var t=xl(e);t!==null&&t.tag===5&&t.type==="form"?Qd(t):ql.r(e)}var ls=typeof document>"u"?null:document;function D0(e,t,n){var l=ls;if(l&&typeof t=="string"&&t){var i=Zt(t);i='link[rel="'+e+'"][href="'+i+'"]',typeof n=="string"&&(i+='[crossorigin="'+n+'"]'),A0.has(i)||(A0.add(i),e={rel:e,crossOrigin:n,href:t},l.querySelector(i)===null&&(t=l.createElement("link"),Gt(t,"link",e),wt(t),l.head.appendChild(t)))}}function qp(e){ql.D(e),D0("dns-prefetch",e,null)}function Yp(e,t){ql.C(e,t),D0("preconnect",e,t)}function Gp(e,t,n){ql.L(e,t,n);var l=ls;if(l&&e&&t){var i='link[rel="preload"][as="'+Zt(t)+'"]';t==="image"&&n&&n.imageSrcSet?(i+='[imagesrcset="'+Zt(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(i+='[imagesizes="'+Zt(n.imageSizes)+'"]')):i+='[href="'+Zt(e)+'"]';var o=i;switch(t){case"style":o=as(e);break;case"script":o=is(e)}zn.has(o)||(e=M({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),zn.set(o,e),l.querySelector(i)!==null||t==="style"&&l.querySelector(mo(o))||t==="script"&&l.querySelector(po(o))||(t=l.createElement("link"),Gt(t,"link",e),wt(t),l.head.appendChild(t)))}}function Xp(e,t){ql.m(e,t);var n=ls;if(n&&e){var l=t&&typeof t.as=="string"?t.as:"script",i='link[rel="modulepreload"][as="'+Zt(l)+'"][href="'+Zt(e)+'"]',o=i;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=is(e)}if(!zn.has(o)&&(e=M({rel:"modulepreload",href:e},t),zn.set(o,e),n.querySelector(i)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(po(o)))return}l=n.createElement("link"),Gt(l,"link",e),wt(l),n.head.appendChild(l)}}}function Qp(e,t,n){ql.S(e,t,n);var l=ls;if(l&&e){var i=yl(l).hoistableStyles,o=as(e);t=t||"default";var h=i.get(o);if(!h){var g={loading:0,preload:null};if(h=l.querySelector(mo(o)))g.loading=5;else{e=M({rel:"stylesheet",href:e,"data-precedence":t},n),(n=zn.get(o))&&cf(e,n);var C=h=l.createElement("link");wt(C),Gt(C,"link",e),C._p=new Promise(function(B,K){C.onload=B,C.onerror=K}),C.addEventListener("load",function(){g.loading|=1}),C.addEventListener("error",function(){g.loading|=2}),g.loading|=4,Gu(h,t,l)}h={type:"stylesheet",instance:h,count:1,state:g},i.set(o,h)}}}function Vp(e,t){ql.X(e,t);var n=ls;if(n&&e){var l=yl(n).hoistableScripts,i=is(e),o=l.get(i);o||(o=n.querySelector(po(i)),o||(e=M({src:e,async:!0},t),(t=zn.get(i))&&ff(e,t),o=n.createElement("script"),wt(o),Gt(o,"link",e),n.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},l.set(i,o))}}function Zp(e,t){ql.M(e,t);var n=ls;if(n&&e){var l=yl(n).hoistableScripts,i=is(e),o=l.get(i);o||(o=n.querySelector(po(i)),o||(e=M({src:e,async:!0,type:"module"},t),(t=zn.get(i))&&ff(e,t),o=n.createElement("script"),wt(o),Gt(o,"link",e),n.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},l.set(i,o))}}function T0(e,t,n,l){var i=(i=Se.current)?Yu(i):null;if(!i)throw Error(r(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=as(n.href),n=yl(i).hoistableStyles,l=n.get(t),l||(l={type:"style",instance:null,count:0,state:null},n.set(t,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=as(n.href);var o=yl(i).hoistableStyles,h=o.get(e);if(h||(i=i.ownerDocument||i,h={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},o.set(e,h),(o=i.querySelector(mo(e)))&&!o._p&&(h.instance=o,h.state.loading=5),zn.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},zn.set(e,n),o||Kp(i,e,n,h.state))),t&&l===null)throw Error(r(528,""));return h}if(t&&l!==null)throw Error(r(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=is(n),n=yl(i).hoistableScripts,l=n.get(t),l||(l={type:"script",instance:null,count:0,state:null},n.set(t,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,e))}}function as(e){return'href="'+Zt(e)+'"'}function mo(e){return'link[rel="stylesheet"]['+e+"]"}function k0(e){return M({},e,{"data-precedence":e.precedence,precedence:null})}function Kp(e,t,n,l){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?l.loading=1:(t=e.createElement("link"),l.preload=t,t.addEventListener("load",function(){return l.loading|=1}),t.addEventListener("error",function(){return l.loading|=2}),Gt(t,"link",n),wt(t),e.head.appendChild(t))}function is(e){return'[src="'+Zt(e)+'"]'}function po(e){return"script[async]"+e}function z0(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+Zt(n.href)+'"]');if(l)return t.instance=l,wt(l),l;var i=M({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),wt(l),Gt(l,"style",i),Gu(l,n.precedence,e),t.instance=l;case"stylesheet":i=as(n.href);var o=e.querySelector(mo(i));if(o)return t.state.loading|=4,t.instance=o,wt(o),o;l=k0(n),(i=zn.get(i))&&cf(l,i),o=(e.ownerDocument||e).createElement("link"),wt(o);var h=o;return h._p=new Promise(function(g,C){h.onload=g,h.onerror=C}),Gt(o,"link",l),t.state.loading|=4,Gu(o,n.precedence,e),t.instance=o;case"script":return o=is(n.src),(i=e.querySelector(po(o)))?(t.instance=i,wt(i),i):(l=n,(i=zn.get(o))&&(l=M({},n),ff(l,i)),e=e.ownerDocument||e,i=e.createElement("script"),wt(i),Gt(i,"link",l),e.head.appendChild(i),t.instance=i);case"void":return null;default:throw Error(r(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,Gu(l,n.precedence,e));return t.instance}function Gu(e,t,n){for(var l=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=l.length?l[l.length-1]:null,o=i,h=0;h<l.length;h++){var g=l[h];if(g.dataset.precedence===t)o=g;else if(o!==i)break}o?o.parentNode.insertBefore(e,o.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function cf(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function ff(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Xu=null;function R0(e,t,n){if(Xu===null){var l=new Map,i=Xu=new Map;i.set(n,l)}else i=Xu,l=i.get(n),l||(l=new Map,i.set(n,l));if(l.has(e))return l;for(l.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var o=n[i];if(!(o[gl]||o[Qe]||e==="link"&&o.getAttribute("rel")==="stylesheet")&&o.namespaceURI!=="http://www.w3.org/2000/svg"){var h=o.getAttribute(t)||"";h=e+h;var g=l.get(h);g?g.push(o):l.set(h,[o])}}return l}function O0(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function Fp(e,t,n){if(n===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;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!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 L0(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Jp(e,t,n,l){if(n.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var i=as(l.href),o=t.querySelector(mo(i));if(o){t=o._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Qu.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=o,wt(o);return}o=t.ownerDocument||t,l=k0(l),(i=zn.get(i))&&cf(l,i),o=o.createElement("link"),wt(o);var h=o;h._p=new Promise(function(g,C){h.onload=g,h.onerror=C}),Gt(o,"link",l),n.instance=o}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=Qu.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var df=0;function Wp(e,t){return e.stylesheets&&e.count===0&&Zu(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var l=setTimeout(function(){if(e.stylesheets&&Zu(e,e.stylesheets),e.unsuspend){var o=e.unsuspend;e.unsuspend=null,o()}},6e4+t);0<e.imgBytes&&df===0&&(df=62500*kp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Zu(e,e.stylesheets),e.unsuspend)){var o=e.unsuspend;e.unsuspend=null,o()}},(e.imgBytes>df?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(i)}}:null}function Qu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Zu(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Vu=null;function Zu(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Vu=new Map,t.forEach(Ip,e),Vu=null,Qu.call(e))}function Ip(e,t){if(!(t.state.loading&4)){var n=Vu.get(e);if(n)var l=n.get(null);else{n=new Map,Vu.set(e,n);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),o=0;o<i.length;o++){var h=i[o];(h.nodeName==="LINK"||h.getAttribute("media")!=="not all")&&(n.set(h.dataset.precedence,h),l=h)}l&&n.set(null,l)}i=t.instance,h=i.getAttribute("data-precedence"),o=n.get(h)||l,o===l&&n.set(null,i),n.set(h,i),this.count++,l=Qu.bind(this),i.addEventListener("load",l),i.addEventListener("error",l),o?o.parentNode.insertBefore(i,o.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var go={$$typeof:Q,Provider:null,Consumer:null,_currentValue:oe,_currentValue2:oe,_threadCount:0};function Pp(e,t,n,l,i,o,h,g,C){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=sn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=sn(0),this.hiddenUpdates=sn(null),this.identifierPrefix=l,this.onUncaughtError=i,this.onCaughtError=o,this.onRecoverableError=h,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=C,this.incompleteTransitions=new Map}function _0(e,t,n,l,i,o,h,g,C,B,K,I){return e=new Pp(e,t,n,h,C,B,K,I,g),t=1,o===!0&&(t|=24),o=ln(3,null,null,t),e.current=o,o.stateNode=e,t=Xr(),t.refCount++,e.pooledCache=t,t.refCount++,o.memoizedState={element:l,isDehydrated:n,cache:t},Kr(o),e}function B0(e){return e?(e=Ml,e):Ml}function U0(e,t,n,l,i,o){i=B0(i),l.context===null?l.context=i:l.pendingContext=i,l=ua(t),l.payload={element:n},o=o===void 0?null:o,o!==null&&(l.callback=o),n=ra(e,l,t),n!==null&&(mn(n,e,t),Zs(n,e,t))}function H0(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function hf(e,t){H0(e,t),(e=e.alternate)&&H0(e,t)}function $0(e){if(e.tag===13||e.tag===31){var t=Gn(e,67108864);t!==null&&mn(t,e,67108864),hf(e,67108864)}}function q0(e){if(e.tag===13||e.tag===31){var t=En();t=fe(t);var n=Gn(e,t);n!==null&&mn(n,e,t),hf(e,t)}}var Ku=!0;function eg(e,t,n,l){var i=R.T;R.T=null;var o=W.p;try{W.p=2,mf(e,t,n,l)}finally{W.p=o,R.T=i}}function tg(e,t,n,l){var i=R.T;R.T=null;var o=W.p;try{W.p=8,mf(e,t,n,l)}finally{W.p=o,R.T=i}}function mf(e,t,n,l){if(Ku){var i=pf(l);if(i===null)Pc(e,t,l,Fu,n),G0(e,l);else if(lg(i,e,t,n,l))l.stopPropagation();else if(G0(e,l),t&4&&-1<ng.indexOf(e)){for(;i!==null;){var o=xl(i);if(o!==null)switch(o.tag){case 3:if(o=o.stateNode,o.current.memoizedState.isDehydrated){var h=Ut(o.pendingLanes);if(h!==0){var g=o;for(g.pendingLanes|=2,g.entangledLanes|=2;h;){var C=1<<31-zt(h);g.entanglements[1]|=C,h&=~C}fl(o),(We&6)===0&&(ku=mt()+500,ro(0))}}break;case 31:case 13:g=Gn(o,2),g!==null&&mn(g,o,2),Ru(),hf(o,2)}if(o=pf(l),o===null&&Pc(e,t,l,Fu,n),o===i)break;i=o}i!==null&&l.stopPropagation()}else Pc(e,t,l,null,n)}}function pf(e){return e=ll(e),gf(e)}var Fu=null;function gf(e){if(Fu=null,e=Un(e),e!==null){var t=d(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=p(t),e!==null)return e;e=null}else if(n===31){if(e=y(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Fu=e,null}function Y0(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(_n()){case Gl:return 2;case Wn:return 8;case ft:case Xl:return 32;case Aa:return 268435456;default:return 32}default:return 32}}var xf=!1,ba=null,wa=null,Sa=null,xo=new Map,yo=new Map,ja=[],ng="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 G0(e,t){switch(e){case"focusin":case"focusout":ba=null;break;case"dragenter":case"dragleave":wa=null;break;case"mouseover":case"mouseout":Sa=null;break;case"pointerover":case"pointerout":xo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":yo.delete(t.pointerId)}}function vo(e,t,n,l,i,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:l,nativeEvent:o,targetContainers:[i]},t!==null&&(t=xl(t),t!==null&&$0(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function lg(e,t,n,l,i){switch(t){case"focusin":return ba=vo(ba,e,t,n,l,i),!0;case"dragenter":return wa=vo(wa,e,t,n,l,i),!0;case"mouseover":return Sa=vo(Sa,e,t,n,l,i),!0;case"pointerover":var o=i.pointerId;return xo.set(o,vo(xo.get(o)||null,e,t,n,l,i)),!0;case"gotpointercapture":return o=i.pointerId,yo.set(o,vo(yo.get(o)||null,e,t,n,l,i)),!0}return!1}function X0(e){var t=Un(e.target);if(t!==null){var n=d(t);if(n!==null){if(t=n.tag,t===13){if(t=p(n),t!==null){e.blockedOn=t,ve(e.priority,function(){q0(n)});return}}else if(t===31){if(t=y(n),t!==null){e.blockedOn=t,ve(e.priority,function(){q0(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ju(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=pf(e.nativeEvent);if(n===null){n=e.nativeEvent;var l=new n.constructor(n.type,n);pt=l,n.target.dispatchEvent(l),pt=null}else return t=xl(n),t!==null&&$0(t),e.blockedOn=n,!1;t.shift()}return!0}function Q0(e,t,n){Ju(e)&&n.delete(t)}function ag(){xf=!1,ba!==null&&Ju(ba)&&(ba=null),wa!==null&&Ju(wa)&&(wa=null),Sa!==null&&Ju(Sa)&&(Sa=null),xo.forEach(Q0),yo.forEach(Q0)}function Wu(e,t){e.blockedOn===t&&(e.blockedOn=null,xf||(xf=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,ag)))}var Iu=null;function V0(e){Iu!==e&&(Iu=e,a.unstable_scheduleCallback(a.unstable_NormalPriority,function(){Iu===e&&(Iu=null);for(var t=0;t<e.length;t+=3){var n=e[t],l=e[t+1],i=e[t+2];if(typeof l!="function"){if(gf(l||n)===null)continue;break}var o=xl(n);o!==null&&(e.splice(t,3),t-=3,mc(o,{pending:!0,data:i,method:n.method,action:l},l,i))}}))}function ss(e){function t(C){return Wu(C,e)}ba!==null&&Wu(ba,e),wa!==null&&Wu(wa,e),Sa!==null&&Wu(Sa,e),xo.forEach(t),yo.forEach(t);for(var n=0;n<ja.length;n++){var l=ja[n];l.blockedOn===e&&(l.blockedOn=null)}for(;0<ja.length&&(n=ja[0],n.blockedOn===null);)X0(n),n.blockedOn===null&&ja.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(l=0;l<n.length;l+=3){var i=n[l],o=n[l+1],h=i[Be]||null;if(typeof o=="function")h||V0(n);else if(h){var g=null;if(o&&o.hasAttribute("formAction")){if(i=o,h=o[Be]||null)g=h.formAction;else if(gf(i)!==null)continue}else g=h.action;typeof g=="function"?n[l+1]=g:(n.splice(l,3),l-=3),V0(n)}}}function Z0(){function e(o){o.canIntercept&&o.info==="react-transition"&&o.intercept({handler:function(){return new Promise(function(h){return i=h})},focusReset:"manual",scroll:"manual"})}function t(){i!==null&&(i(),i=null),l||setTimeout(n,20)}function n(){if(!l&&!navigation.transition){var o=navigation.currentEntry;o&&o.url!=null&&navigation.navigate(o.url,{state:o.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,i=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),i!==null&&(i(),i=null)}}}function yf(e){this._internalRoot=e}Pu.prototype.render=yf.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(r(409));var n=t.current,l=En();U0(n,l,e,t,null,null)},Pu.prototype.unmount=yf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;U0(e.current,2,null,e,null,null),Ru(),t[ut]=null}};function Pu(e){this._internalRoot=e}Pu.prototype.unstable_scheduleHydration=function(e){if(e){var t=_e();e={blockedOn:null,target:e,priority:t};for(var n=0;n<ja.length&&t!==0&&t<ja[n].priority;n++);ja.splice(n,0,e),n===0&&X0(e)}};var K0=s.version;if(K0!=="19.2.8")throw Error(r(527,K0,"19.2.8"));W.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(r(188)):(e=Object.keys(e).join(","),Error(r(268,e)));return e=x(t),e=e!==null?S(e):null,e=e===null?null:e.stateNode,e};var ig={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:R,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var er=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!er.isDisabled&&er.supportsFiber)try{dl=er.inject(ig),Bt=er}catch{}}return wo.createRoot=function(e,t){if(!f(e))throw Error(r(299));var n=!1,l="",i=th,o=nh,h=lh;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(o=t.onCaughtError),t.onRecoverableError!==void 0&&(h=t.onRecoverableError)),t=_0(e,1,!1,null,null,n,l,null,i,o,h,Z0),e[ut]=t.current,Ic(e),new yf(t)},wo.hydrateRoot=function(e,t,n){if(!f(e))throw Error(r(299));var l=!1,i="",o=th,h=nh,g=lh,C=null;return n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onUncaughtError!==void 0&&(o=n.onUncaughtError),n.onCaughtError!==void 0&&(h=n.onCaughtError),n.onRecoverableError!==void 0&&(g=n.onRecoverableError),n.formState!==void 0&&(C=n.formState)),t=_0(e,1,!0,t,n??null,l,i,C,o,h,g,Z0),t.context=B0(null),n=t.current,l=En(),l=fe(l),i=ua(l),i.callback=null,ra(n,i,l),n=l,t.current.lanes=n,Ie(t,n),fl(t),e[ut]=t.current,Ic(e),new Pu(t)},wo.version="19.2.8",wo}var a1;function mg(){if(a1)return wf.exports;a1=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(s){console.error(s)}}return a(),wf.exports=hg(),wf.exports}var pg=mg(),sm=im();function Cf(a,s,c){return a+(s-a)*c}function om(a){return a-Math.floor(a)}function Nf(a,s){const c=Math.floor(a),r=Math.floor(s);let f=a-c,d=s-r;f=f*f*(3-2*f),d=d*d*(3-2*d);const p=On(c,r),y=On(c+1,r),b=On(c,r+1),x=On(c+1,r+1);return p+(y-p)*f+(b-p)*d+(p-y-b+x)*f*d}function On(a,s){const c=Math.sin(a*12.9898+s*78.233)*43758.5453;return c-Math.floor(c)}function Qf(a,s){const c=Math.PI*(3-Math.sqrt(5)),r=1-2*(a+.5)/s,f=Math.sqrt(1-r*r),d=a*c;return[f*Math.cos(d),r,f*Math.sin(d)]}function gg(a,s){return Math.atan2(Math.sin(a-s),Math.cos(a-s))}function fi(a,s,c,r,f){const d=Math.sin(s),p=Math.cos(s),y=Math.sin(a),b=Math.cos(a);return(x,S,M)=>{const T=x*b+M*y,k=-x*y+M*b,N=S*p-k*d,U=S*d+k*p;return[c+T*f,r-N*f,U]}}function Na(a,s,c,r=.3){s.sort((f,d)=>f.z-d.z);for(const f of s){const d=f.a??1;if(d<.02)continue;const p=Math.min(1,Math.max(0,f.white)),y=Math.round((c?1-p:p)*255);a.fillStyle=`rgba(${y},${y},${y},${d})`,a.beginPath(),a.arc(f.x,f.y,Math.max(r,f.r),0,Math.PI*2),a.fill()}}function xg(a,s,c){for(const r of s){const f=r.a??1;if(f<.02)continue;const d=Math.min(1,Math.max(0,r.white)),p=Math.round((c?1-d:d)*255);a.strokeStyle=`rgba(${p},${p},${p},${f})`,a.lineWidth=r.w,a.beginPath(),a.moveTo(r.x1,r.y1),a.lineTo(r.x2,r.y2),a.stroke()}}function di(a,s){return(a/300)**s}const yg=(a,s,c,r,f)=>{const d=s/2,p=s/2,y=s/2*.76,b=fi(c*.4,.3,d,p,1),x=di(s,f.rsPow??.6),S=[],M=f.ghostN??150;for(let N=0;N<M;N++){const U=Qf(N,M),[$,O,V]=b(U[0]*y,U[1]*y,U[2]*y),Q=(V/y+1)/2;S.push({x:$,y:O,z:V,r:.8*x,white:.78,a:.1+.22*Q})}const T=f.strandN??52,k=f.turns??3;for(let N=0;N<3;N++){const U=N/3*2*Math.PI;for(let $=0;$<T;$++){const O=(om($/T+c*.045)*2-1)*.96,V=Math.sqrt(Math.max(0,1-O*O)),Q=Math.min(1,(1-Math.abs(O))/.1),X=O*Math.PI*k+U,ae=1+.075*Math.sin(O*Math.PI*k*2+U*2+c*.8),P=V*y*ae,[v,ne,ce]=b(Math.cos(X)*P,O*y*ae,Math.sin(X)*P),te=(ce/y+1)/2;S.push({x:v,y:ne,z:ce,r:((f.rBase??1.2)+(f.rDepth??1.8)*te)*x,white:.55-.45*te,a:Q*(.45+.55*te)})}}Na(a,S,r,f.rMin)};function vg(a,s,c,r){const f=2*s*c+r,d=a%f,p=new Array(s).fill(0);let y=-1;if(d<2*s*c){const b=Math.floor(d/c),x=(d-b*c)/c,S=1-(1-Math.min(1,x/.7))**3;if(b<s){for(let M=0;M<b;M++)p[M]=1;p[b]=S,y=b}else{const M=2*s-1-b;for(let T=0;T<M;T++)p[T]=1;p[M]=1-S,y=M}}return{amount:p,active:y}}function bg(a,s,c){let[r,f,d]=a,p=!1;for(let y=0;y<s.length;y++){if(c.amount[y]<=0)continue;const b=s[y],x=b.axis===0?r:b.axis===1?f:d;if(x<b.lo||x>=b.hi)continue;y===c.active&&(p=!0);const S=b.ang*c.amount[y],M=Math.cos(S),T=Math.sin(S);if(b.axis===0){const k=f*M-d*T;d=f*T+d*M,f=k}else if(b.axis===1){const k=r*M+d*T;d=-r*T+d*M,r=k}else{const k=r*M-f*T;f=r*T+f*M,r=k}}return[r,f,d,p]}function wg(a){const s=[];for(let c=0;c<a;c++){const r=Math.min(2,Math.floor(On(c,2.3)*3)),f=-1+.5*Math.min(3,Math.floor(On(c,5.9)*4)),d=On(c,7.7)<.5?1:-1;s.push({axis:r,lo:f,hi:f+.5,ang:d*Math.PI/2})}return s}const Sg=(a,s,c,r,f)=>{const d=s/2,p=s/2,y=s/2*.82,b=.4+.06*Math.sin(c*.35),x=fi(c*.5,b,d,p,y),S=c*(.5+(1.7-.5)*(f.scanMul??1)),M=di(s,f.rsPow??.6),T=f.dimBase??1,k=[],N=f.latRings??17,U=f.lonDensity??44;for(let $=0;$<=N;$++){const O=-Math.PI/2+$/N*Math.PI,V=Math.cos(O),Q=Math.sin(O),X=Math.max(1,Math.round(Math.abs(V)*U));for(let ae=0;ae<X;ae++){const P=ae/X*2*Math.PI,[v,ne,ce]=x(V*Math.cos(P),Q,V*Math.sin(P)),te=(ce+1)/2,xe=gg(P+c*.5,S),re=Math.exp(-(xe*xe)/.18)*Math.max(0,ce);k.push({x:v,y:ne,z:ce,r:((f.rBase??.6)+(f.rDepth??1.7)*te+(f.rBoost??1)*re)*M,white:(f.inkFar??.62)-(f.inkSpan??.54)*te,a:T+(1-T)*Math.min(1,re)})}}Na(a,k,r,f.rMin)},jg=(a,s,c,r,f)=>{const d=s/2,p=s/2,y=s/2*.82,b=fi(c*.55,.35+.1*Math.sin(c*.9),d,p,y),x=di(s,f.rsPow??.6),S=f.moveCount??14,M=wg(S),T=vg(c,S,.42,1.2),k=[],N=f.latRings??15,U=f.lonDensity??40;for(let $=0;$<=N;$++){const O=-Math.PI/2+$/N*Math.PI,V=Math.cos(O),Q=Math.sin(O),X=Math.max(1,Math.round(Math.abs(V)*U));for(let ae=0;ae<X;ae++){const P=ae/X*2*Math.PI,[v,ne,ce,te]=bg([V*Math.cos(P),Q,V*Math.sin(P)],M,T),[xe,re,Ee]=b(v,ne,ce),ye=(Ee+1)/2;k.push({x:xe,y:re,z:Ee,r:((f.rBase??.6)+(f.rDepth??1.7)*ye+(te?f.rActive??.3:0))*x,white:(f.inkFar??.62)-(f.inkSpan??.54)*ye-(te?.14:0)})}}Na(a,k,r,f.rMin)},Eg=(a,s,c,r,f)=>{const d=s/2,p=s/2,y=s/2*.874,b=fi(c*.18,.38,d,p,1),x=di(s,f.rsPow??.6),S=[],M=f.rings??15,T=f.lonDensity??40;for(let k=0;k<=M;k++){const N=-Math.PI/2+k/M*Math.PI,U=Math.cos(N),$=Math.sin(N),O=.62*Math.sin(c*2.1-k*.52)+.38*Math.sin(c*1.27+k*.83),V=y*(.88+.105*O),Q=Math.max(1,Math.round(Math.abs(U)*T));for(let X=0;X<Q;X++){const ae=X/Q*2*Math.PI,[P,v,ne]=b(U*Math.cos(ae)*V,$*V,U*Math.sin(ae)*V),ce=(ne/y+1)/2,te=Math.max(0,O);S.push({x:P,y:v,z:ne,r:((f.rBase??.6)+(f.rDepth??1.7)*ce)*(1+.4*te)*x,white:.66-.56*ce-.1*te})}}Na(a,S,r,f.rMin)};function Cg(a){return a*a*(3-2*a)}function um(a){const s=a.length,c=[];let r=0;for(let f=0;f<s;f++){const d=a[f],p=a[(f+1)%s],y=Math.hypot(p[0]-d[0],p[1]-d[1]);c.push(y),r+=y}return f=>{let d=f*r,p=0;for(;d>c[p]&&p<s-1;)d-=c[p],p++;const y=a[p],b=a[(p+1)%s],x=c[p]?Math.min(1,d/c[p]):0;return[y[0]+(b[0]-y[0])*x,y[1]+(b[1]-y[1])*x]}}const Ng=a=>{const s=-Math.PI/2+a*2*Math.PI;return[Math.cos(s)*.24,Math.sin(s)*.24]},Mg=um([[0,-.26],[.24,.16],[-.24,.16]]),Ag=um([[0,-.2],[.2,-.2],[.2,.2],[-.2,.2],[-.2,-.2]]),Mf=[Ng,Mg,Ag];function Dg(a){return Math.max(6,Math.round(34*a))}const Uf=1.4,rm=.9,Af=Uf+rm,Tg=(a,s,c,r,f)=>{const d=Mf.length,p=c%(Af*d),y=Math.floor(p/Af),b=p-y*Af,x=b>Uf?Cg((b-Uf)/rm):0,S=f.spread??1,M=Mf[y],T=Mf[(y+1)%d],k=160,N=[];for(let ne=0;ne<k;ne++){const ce=ne/k,te=M(ce),xe=T(ce);N.push([(te[0]+(xe[0]-te[0])*x)*S,(te[1]+(xe[1]-te[1])*x)*S])}const U=[];let $=0;for(let ne=0;ne<k;ne++){const ce=N[ne],te=N[(ne+1)%k],xe=Math.hypot(te[0]-ce[0],te[1]-ce[1]);U.push(xe),$+=xe}const O=Dg(f.iconD??1),V=(f.rDot??.021)*1.35*S,Q=1+.02*Math.sin(b*3.1),X=[],ae=s/2;let P=0,v=0;for(let ne=0;ne<O;ne++){const ce=ne/O*$;for(;v+U[P]<ce&&P<k-1;)v+=U[P],P++;const te=N[P],xe=N[(P+1)%k],re=U[P]?Math.min(1,(ce-v)/U[P]):0,Ee=(te[0]+(xe[0]-te[0])*re)*Q,ye=(te[1]+(xe[1]-te[1])*re)*Q;X.push({x:ae+Ee*s,y:ae+ye*s,z:0,r:Math.max(.35,V*s),white:.1})}Na(a,X,r,f.rMin)},kg=(a,s,c,r,f)=>{const d=s/2,p=s/2,y=s/2*.82,b=fi(c*.12,.3,d,p,1),x=di(s,f.rsPow??.6),S=[],M=f.orbitN??12,T=f.ghostN??40,k=f.particles??3;for(let N=0;N<M;N++){const U=On(N,1.7),$=On(N,5.2),O=On(N,8.9),V=y*(.45+.52*U),Q=U*2*Math.PI,X=Math.acos(2*$-1),ae=Math.sin(X)*Math.cos(Q),P=Math.cos(X),v=Math.sin(X)*Math.sin(Q);let ne=-P,ce=ae;const te=0,xe=Math.max(1e-6,Math.sqrt(ne*ne+ce*ce));ne/=xe,ce/=xe;const re=P*te-v*ce,Ee=v*ne-ae*te,ye=ae*ce-P*ne,De=(.25+.55*O)*(O>.5?1:-1);for(let R=0;R<T;R++){const W=R/T*2*Math.PI,[oe,Ce,we]=b((ne*Math.cos(W)+re*Math.sin(W))*V,(ce*Math.cos(W)+Ee*Math.sin(W))*V,(te*Math.cos(W)+ye*Math.sin(W))*V),E=(we/V+1)/2;S.push({x:oe,y:Ce,z:we,r:(f.ghostR??.9)*x,white:.72,a:(f.ghostA??.5)*(.4+.6*E)})}for(let R=0;R<k;R++){const W=c*De+R/k*2*Math.PI+$*6,[oe,Ce,we]=b((ne*Math.cos(W)+re*Math.sin(W))*V,(ce*Math.cos(W)+Ee*Math.sin(W))*V,(te*Math.cos(W)+ye*Math.sin(W))*V),E=(we/V+1)/2;S.push({x:oe,y:Ce,z:we,r:((f.partR??1.2)+(f.partRDepth??1.6)*E)*x,white:.3-.22*E})}}Na(a,S,r,f.rMin)},i1=(a,s,c,r,f)=>{const d=s/2,p=s/2,y=s/2*.78,b=f.spin??1,x=.3,S=fi(c*.1*b,x,d,p,1),M=di(s,f.rsPow??.6),T=[],k=f.ghostN??150;for(let ye=0;ye<k;ye++){const De=Qf(ye,k),[R,W,oe]=S(De[0]*y,De[1]*y,De[2]*y),Ce=(oe/y+1)/2;T.push({x:R,y:W,z:oe,r:.8*M,white:.78,a:.1+.22*Ce})}const N=c*.24*b,U=f.faceOn?-x:.55+.3*Math.sin(c*.18)*b,$=Math.cos(N),O=0,V=Math.sin(N),Q=-V*Math.sin(U),X=Math.cos(U),ae=$*Math.sin(U),P=O*ae-V*X,v=V*Q-$*ae,ne=$*X-O*Q,ce=.23*(f.wobMul??1),te=f.faceOn?y/(1+.85*ce):y,xe=f.lanes??5,re=f.segs??88,Ee=Math.max(1,Math.round(xe*(f.bandMul??1)));for(let ye=0;ye<Ee;ye++){const De=(ye-(Ee-1)/2)*.075,R=Math.abs(ye-(Ee-1)/2)/Math.max(1,(Ee-1)/2);for(let W=0;W<re;W++){const oe=W/re*2*Math.PI,Ce=(.16*Math.sin(oe*3-c*1.7+ye*.22)+.07*Math.sin(oe*5+c*1.1))*(f.wobMul??1),we=f.faceOn?1+Ce:1,E=f.faceOn?De:De+Ce,G=$*Math.cos(oe)+Q*Math.sin(oe)+P*E,le=O*Math.cos(oe)+X*Math.sin(oe)+v*E,ue=V*Math.cos(oe)+ae*Math.sin(oe)+ne*E,se=Math.sqrt(G*G+le*le+ue*ue),Se=te*we,[L,Z,ie]=S(G/se*Se,le/se*Se,ue/se*Se),pe=(ie/y+1)/2;T.push({x:L,y:Z,z:ie,r:((f.rBase??1.1)+(f.rDepth??1.7)*pe)*(1-.25*R)*M,white:.52-.44*pe+.18*R,a:.4+.6*pe})}}Na(a,T,r,f.rMin)},zg=(a,s,c,r,f)=>{const d=s/2,p=s/2,y=s/2*.8*(f.spread??1),b=fi(c*.12,.32,d,p,y),x=di(s,f.rsPow??.6),S=f.nodeN??30,M=f.thr??.72,T=f.nodeR??1.4,k=f.nodeRDepth??1.8,N=[];for(let V=0;V<S;V++){const Q=Qf(V,S),X=Q[0]+.3*(Nf(V*.31+9,c*.24)-.5)*2,ae=Q[1]+.3*(Nf(V*.53+27,c*.21)-.5)*2,P=Q[2]+.3*(Nf(V*.77+55,c*.27)-.5)*2,v=Math.sqrt(X*X+ae*ae+P*P);N.push([X/v,ae/v,P/v])}const U=[],$=[];for(let V=0;V<S;V++)for(let Q=V+1;Q<S;Q++){const X=N[V][0]-N[Q][0],ae=N[V][1]-N[Q][1],P=N[V][2]-N[Q][2],v=Math.sqrt(X*X+ae*ae+P*P);if(v>=M)continue;const[ne,ce,te]=b(N[V][0],N[V][1],N[V][2]),[xe,re,Ee]=b(N[Q][0],N[Q][1],N[Q][2]),ye=((te+Ee)/2+1)/2;U.push({x1:ne,y1:ce,x2:xe,y2:re,white:.42,a:(1-v/M)*(.3+.55*ye),w:Math.max(.6,(f.lineW??.8)*x)})}for(let V=0;V<S;V++){const[Q,X,ae]=b(N[V][0],N[V][1],N[V][2]),P=(ae+1)/2,v=1+.25*Math.sin(c*1.4+V*2.7);$.push({x:Q,y:X,z:ae,r:(T+k*P)*v*x,white:.55-.45*P})}const O=f.signals??5;for(let V=0;V<O;V++){const Q=Math.floor(c*.55+V*7.31),X=Math.floor(On(Q,V*3.1+1.7)*S),ae=Math.floor(On(Q,V*5.7+4.2)*S);if(X===ae)continue;const P=om(c*.55+V*7.31),v=Cf(N[X][0],N[ae][0],P),ne=Cf(N[X][1],N[ae][1],P),ce=Cf(N[X][2],N[ae][2],P),te=Math.max(1e-6,Math.sqrt(v*v+ne*ne+ce*ce)),[xe,re,Ee]=b(v/te,ne/te,ce/te),ye=(Ee+1)/2;$.push({x:xe,y:re,z:Ee,r:(T*1.5+k*ye)*x,white:.05,a:.5+.5*ye})}xg(a,U,r),Na(a,$,r,f.rMin)},Rg={orbits:kg,globe:Sg,rubik:jg,wave:Eg,web:zg,braid:yg,ribbon:i1,ring:i1,morph:Tg},Og=[["latRings","lonDensity"],["rings","lonDensity"],["lanes","segs"]],Lg=["orbitN","ghostN","nodeN","strandN","signals"],_g=["iconD"],Bg=["rBase","rDepth","rActive","rDot","ghostR","partR","partRDepth","nodeR","nodeRDepth"];function Ug(a,s){const c={...a},r=new Set,f=Math.sqrt(s);for(const[d,p]of Og){const y=c[d],b=c[p];y!=null&&b!=null&&!r.has(d)&&!r.has(p)&&(c[d]=Math.max(2,Math.round(y*f)),c[p]=Math.max(2,Math.round(b*f)),r.add(d),r.add(p))}for(const d of Lg){const p=c[d];p!=null&&p!==0&&!r.has(d)&&(c[d]=Math.max(1,Math.round(p*s)))}for(const d of _g){const p=c[d];p!=null&&(c[d]=Math.max(.02,p*s))}return c}function Hg(a,s){const c={...a};for(const r of Bg){const f=c[r];f!=null&&(c[r]=f*s)}return c.rSizeMul=(c.rSizeMul??1)*s,c}const $g={globe:{latRings:17,lonDensity:44,rBase:.6,rDepth:1.7,rBoost:1,inkFar:.62,inkSpan:.54,rsPow:.6,rMin:.3},orbits:{orbitN:12,ghostN:40,ghostR:.9,ghostA:.5,particles:3,partR:1.2,partRDepth:1.6,rsPow:.6,rMin:.3},rubik:{latRings:15,lonDensity:40,moveCount:14,rBase:.6,rDepth:1.7,rActive:.3,inkFar:.62,inkSpan:.54,rsPow:.6,rMin:.3},wave:{rings:15,lonDensity:40,rBase:.6,rDepth:1.7,rsPow:.6,rMin:.3},web:{nodeN:30,thr:.72,signals:5,nodeR:1.4,nodeRDepth:1.8,lineW:.8,rsPow:.6,rMin:.3},braid:{strandN:52,turns:3,ghostN:150,rBase:1.2,rDepth:1.8,rsPow:.6,rMin:.3},ribbon:{lanes:5,segs:88,ghostN:150,rBase:1.1,rDepth:1.7,rsPow:.6,rMin:.3},ring:{lanes:5,segs:88,ghostN:0,faceOn:1,rBase:1.1,rDepth:1.7,rsPow:.6,rMin:.3},morph:{rDot:.021,iconD:1,rMin:.25}},qg={working:"orbits",searching:"globe",solving:"rubik",listening:"wave",connecting:"web",weaving:"braid",composing:"ribbon",breathing:"ring",shaping:"morph"},Yg={orbits:{64:{speed:1.885,count:1,size:1},20:{speed:3.9,count:.238,size:2.4}},globe:{64:{speed:2.015,count:.42,size:1.15,extra:{scanMul:4.08,dimBase:.45}},20:{speed:2.665,count:.105,size:1.75,extra:{scanMul:4.335,dimBase:.45}}},rubik:{64:{speed:1.82,count:.35,size:1.05},20:{speed:1.95,count:.088,size:1.9}},wave:{64:{speed:4.388,count:.341,size:1},20:{speed:3.998,count:.105,size:1.6}},web:{64:{speed:3.315,count:1.35,size:.95},20:{speed:6.63,count:.25,size:1.52}},braid:{64:{speed:1.625,count:.5,size:1},20:{speed:2.75,count:.1125,size:1.36}},ribbon:{64:{speed:2.34,count:.25,size:.85,extra:{spin:0,bandMul:3.9,wobMul:1}},20:{speed:3.12,count:.051,size:1.073,extra:{spin:0,bandMul:4.94,wobMul:1}}},ring:{64:{speed:3.24,count:.25,size:.956,extra:{spin:0,bandMul:3.627,wobMul:.368}},20:{speed:3.78,count:.028,size:1.622,extra:{spin:0,bandMul:3.968,wobMul:.565}}},morph:{64:{speed:2.405,count:.702,size:.395,extra:{spread:1.45}},20:{speed:2.08,count:.53,size:1.011,extra:{spread:1.45}}}},s1=new Map;function Gg(a,s){const c=`${a}-${s}`,r=s1.get(c);if(r)return r;const f=qg[a],d=Yg[f][s];let p={...$g[f]};d.count!==1&&(p=Ug(p,d.count)),d.size!==1&&(p=Hg(p,d.size)),d.extra&&(p={...p,...d.extra});const y={mode:f,speed:d.speed,opts:p};return s1.set(c,y),y}function Xg(a){let s=a;for(;s;){const c=s.getAttribute("data-theme");if(c==="dark")return!0;if(c==="light")return!1;if(s.classList.contains("dark"))return!0;if(s.classList.contains("light"))return!1;s=s.parentElement}return null}function Qg(){return typeof matchMedia>"u"||matchMedia("(prefers-color-scheme: dark)").matches}function Vg(a,s){const[c,r]=w.useState(!0);return w.useEffect(()=>{if(a==="dark"){r(!0);return}if(a==="light"){r(!1);return}const f=()=>{const b=Xg(s.current);r(b??Qg())};f();const d=typeof matchMedia<"u"?matchMedia("(prefers-color-scheme: dark)"):null,p=()=>f();d?.addEventListener("change",p);let y=null;return typeof MutationObserver<"u"&&s.current&&(y=new MutationObserver(f),y.observe(document.documentElement,{attributes:!0,attributeFilter:["class","data-theme"],subtree:!0})),()=>{d?.removeEventListener("change",p),y?.disconnect()}},[a,s]),c}function Zg(){const[a,s]=w.useState(!1);return w.useEffect(()=>{if(typeof matchMedia>"u")return;const c=matchMedia("(prefers-reduced-motion: reduce)");s(c.matches);const r=f=>s(f.matches);return c.addEventListener("change",r),()=>c.removeEventListener("change",r)},[]),a}const Kg={working:"Working…",searching:"Searching…",solving:"Solving…",listening:"Listening…",connecting:"Connecting…",weaving:"Weaving…",composing:"Composing…",breathing:"Thinking…",shaping:"Shaping…"};function mr({state:a="working",size:s=64,theme:c="auto",speed:r=1,paused:f=!1,style:d,"aria-label":p,...y}){const b=w.useRef(null),x=Vg(c,b),S=Zg();return w.useEffect(()=>{const M=b.current;if(!M)return;const T=Math.min(2,typeof devicePixelRatio<"u"&&devicePixelRatio||1);M.width=Math.round(s*T),M.height=Math.round(s*T);const k=M.getContext("2d");if(!k)return;const{mode:N,speed:U,opts:$}=Gg(a,s),O=Rg[N],V=U*r,Q=re=>{k.setTransform(T,0,0,T,0,0),k.clearRect(0,0,s,s),O(k,s,re,x,$)};if(S){Q(.6);return}let X=0,ae=!1;const P=()=>{Q(performance.now()/1e3*V),ae&&(X=requestAnimationFrame(P))},v=()=>{ae||f||(ae=!0,X=requestAnimationFrame(P))},ne=()=>{ae=!1,cancelAnimationFrame(X)};Q(performance.now()/1e3*V);let ce=!0;const te=typeof IntersectionObserver<"u"?new IntersectionObserver(([re])=>{ce=re.isIntersecting,ce&&document.visibilityState!=="hidden"?v():ne()}):null;te?.observe(M);const xe=()=>{document.visibilityState==="hidden"?ne():ce&&v()};return document.addEventListener("visibilitychange",xe),te||v(),()=>{ne(),te?.disconnect(),document.removeEventListener("visibilitychange",xe)}},[a,s,x,r,f,S]),u.jsx("canvas",{ref:b,role:"img","aria-label":p??Kg[a],style:{width:s,height:s,display:"block",...d},...y})}const tr=["searching","solving","composing","breathing","shaping"];function Fg(a){const s=Math.floor(a*tr.length);return tr[Math.min(tr.length-1,Math.max(0,s))]??tr[0]}const pr=Fg(Math.random());function cm(a){return JSON.parse(a)}function ri(a){return typeof a=="object"&&a!==null&&!Array.isArray(a)}function Fn(a){return typeof a=="string"}function nr(a){return typeof a=="boolean"}function Jg(a){return typeof a=="number"}const ci="ease-[cubic-bezier(0.32,0.72,0,1)]",fm=274,dm=395,hm=368,mm=[{label:"Full",width:null},{label:"1440",width:1440},{label:"834",width:834},{label:"390",width:390}],Yl={buildDirections:!1,collapsed:!1,collapsedFamilies:[],deleted:[],corner:"bottom-right",font:"satoshi",hidden:[],order:[],renames:{},scaleSplit:!0,showDevOverlays:!0,showWidget:!0,viewport:null,width:hm};function Wg(a){return`leglas:${a}`}function pm(a,s){const c=s.map(r=>r.title);try{if(!a)return{...Yl,order:c};const r=cm(a);if(!ri(r))return{...Yl,order:c};const f=(S,M)=>Array.isArray(S)?S.filter(Fn).filter(T=>M.includes(T)):[],d=f(r.deleted,c),p=c.filter(S=>!d.includes(S)),y=f(r.order,p),b=["bottom-left","bottom-right","top-left","top-right"],x={};if(ri(r.renames))for(const[S,M]of Object.entries(r.renames))p.includes(S)&&Fn(M)&&(x[S]=M);return{collapsed:!!r.collapsed,collapsedFamilies:f(r.collapsedFamilies,p),corner:b.find(S=>S===r.corner)??Yl.corner,deleted:d,font:Fn(r.font)?r.font:Yl.font,hidden:f(r.hidden,p),order:[...y,...p.filter(S=>!y.includes(S))],renames:x,scaleSplit:nr(r.scaleSplit)?r.scaleSplit:Yl.scaleSplit,showDevOverlays:nr(r.showDevOverlays)?r.showDevOverlays:Yl.showDevOverlays,showWidget:nr(r.showWidget)?r.showWidget:Yl.showWidget,buildDirections:nr(r.buildDirections)?r.buildDirections:Yl.buildDirections,viewport:mm.map(S=>S.width).find(S=>S===r.viewport)??null,width:Jg(r.width)&&Number.isFinite(r.width)?Math.round(Math.min(dm,Math.max(fm,r.width))):hm}}catch{return{...Yl,order:c}}}function Ig(a,s){const c=new Set(s),r=Object.fromEntries(Object.entries(a.renames).filter(([f])=>!c.has(f)));return{...a,collapsedFamilies:a.collapsedFamilies.filter(f=>!c.has(f)),deleted:[...new Set([...a.deleted,...s])],hidden:a.hidden.filter(f=>!c.has(f)),order:a.order.filter(f=>!c.has(f)),renames:r}}function gm(a,s){if(a.length===0)return[...s];const c=new Set(s),r=a.filter(d=>c.has(d)),f=new Set(r);return[...r,...s.filter(d=>!f.has(d))]}const xm=8,Pg=8;function ex(a,s,c=xm){return a.left<c?c-a.left:a.right>s-c?Math.max(c-a.left,s-c-a.right):0}function tx(a,s,c,r=xm){if(a.top>=r)return!1;const f=a.bottom-a.top;return s.bottom+r+f<=c-r}function nx(a,s,c,r){const f=a.at==="right"?a.x:a.x-s.width/2,d=a.at==="top"?a.y-s.height:a.at==="bottom"?a.y:a.y-s.height/2,p={bottom:d+s.height,left:f,right:f+s.width,top:d};if(a.at==="top"&&tx(p,c,r.height))return{at:"bottom",shift:a.shift,y:c.bottom+Pg};const y=ex(p,r.width);return y===a.shift?null:{at:a.at,shift:y,y:a.y}}function No({size:a=18}){return u.jsxs("svg",{"aria-hidden":!0,height:a,strokeLinejoin:"round",strokeWidth:22,viewBox:"160 370 1050 1320",width:Math.round(a*(1050/1320)),children:[u.jsxs("defs",{children:[u.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"lm-up",x1:"791.957",x2:"210",y1:"723.095",y2:"1010",children:[u.jsx("stop",{offset:"0",stopColor:"#7C38E8"}),u.jsx("stop",{offset:"0.68",stopColor:"#CDB6F1"}),u.jsx("stop",{offset:"1",stopColor:"#E9E0FA"})]}),u.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"lm-down",x1:"789.954",x2:"210",y1:"1330.46",y2:"1035",children:[u.jsx("stop",{offset:"0",stopColor:"#3EC2A8"}),u.jsx("stop",{offset:"0.68",stopColor:"#9EDAE8"}),u.jsx("stop",{offset:"1",stopColor:"#E1F2F6"})]}),u.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"lm-shaft",x1:"884.016",x2:"182",y1:"1023.26",y2:"1023.26",children:[u.jsx("stop",{offset:"0",stopColor:"#7E97DD"}),u.jsx("stop",{offset:"0.48",stopColor:"#5F7FD8"}),u.jsx("stop",{offset:"0.71",stopColor:"#9AABE2"}),u.jsx("stop",{offset:"1",stopColor:"#E2E8F6"})]}),u.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"lm-head",x1:"1192",x2:"874.81",y1:"1021.57",y2:"1024.91",children:[u.jsx("stop",{offset:"0",stopColor:"#E8ECF7"}),u.jsx("stop",{offset:"1",stopColor:"#92A7E0"})]})]}),u.jsx("path",{d:"M 671.122 381.199 C 708.12 378.001 733.579 414.981 702.643 437.984 C 705.64 430.245 708.163 423.315 705.553 415.028 C 700.981 400.516 684.107 396.94 671.252 401.81 C 662.713 405.098 655.849 411.671 652.193 420.059 C 645.933 434.059 649.404 447.111 654.599 460.446 C 665.665 467.718 660.114 472.463 666.664 480.695 C 694.852 516.12 737.817 543.026 774.246 568.848 C 841.225 616.324 905.267 670.31 939.022 747.101 C 953.651 782.815 964.144 815.411 953.49 854.107 C 944.702 886.028 889.413 910.644 901.624 945.63 C 905.247 956.01 926.305 965.294 936.684 957.439 C 947.74 949.072 949.919 942.473 953.06 929.336 C 967.974 962.891 939.504 987.655 907.14 982.376 C 893.109 980.134 880.552 972.384 872.258 960.847 C 839.018 914.253 888.968 876.15 898.307 834.712 C 902.782 814.853 894.952 783.534 888.142 764.672 C 860.48 688.068 798.139 632.327 735.838 583.312 C 700.284 555.045 669.551 529.466 642.632 492.392 C 627.896 510.927 608.893 531.804 593.068 550.006 L 506.523 649.582 L 278.039 912.109 C 245.455 949.199 213.059 986.454 180.851 1023.87 C 231.765 1079.46 283.65 1142.04 333.374 1199.45 L 642.829 1555.74 C 666.446 1520.75 700.163 1494.07 732.424 1467.5 C 795.117 1417.7 858.256 1363.37 887.261 1286.25 C 898.113 1256.93 906.911 1217.89 889.705 1189.06 C 873.478 1161.87 852.143 1132.56 865.539 1099.12 C 871.003 1085.24 881.904 1074.2 895.712 1068.56 C 930.406 1054.52 970.704 1079.86 953.232 1118.88 C 950.548 1106.58 948.459 1099.64 937.837 1091.37 C 926.133 1082.27 907.942 1089.57 901.99 1101.66 C 890.169 1127.27 924.549 1151.85 939.219 1169.81 C 966.471 1203.18 959.658 1245.71 945.71 1284.44 C 914.285 1371.69 840.069 1433.7 765.809 1484.61 C 733.647 1506.66 698.091 1531.58 672.306 1561.08 C 665.933 1568.59 659.014 1581.87 653.634 1590.29 C 648.506 1598.32 647.787 1615.38 650.833 1624.56 C 653.881 1633.77 660.579 1641.32 669.359 1645.45 C 681.85 1651.27 699.281 1649.12 705.041 1634.65 C 708.705 1625.45 705.419 1617.29 701.581 1608.8 L 702.848 1609.85 C 737.88 1638.68 697.51 1681.47 657.106 1662.8 C 643.389 1656.45 632.826 1644.83 627.824 1630.56 C 619.064 1605.85 626.824 1585.32 637.489 1563.26 C 610.659 1534.07 581.755 1498.91 555.456 1468.66 L 383.745 1271.03 L 242.504 1108.25 C 219.223 1081.36 191.596 1051.06 169.707 1023.52 C 181.894 1007.58 201.352 986.522 215.082 970.737 L 301.342 871.646 L 539.659 597.67 C 572.041 560.265 605.914 522.417 637.6 484.482 C 616.356 444.192 617.849 392.637 671.122 381.199 z",fill:"#E8ECF7",stroke:"#E8ECF7"}),u.jsx("path",{d:"M 791.002 712.436 C 791.99 712.378 791.355 712.338 792.831 712.983 C 791.837 718.407 719.488 841.546 710.03 858.509 C 707.23 840.677 702.304 817.013 698.274 799.446 C 555 895 360 995 182 1023 C 355 963 525 870 674.863 761.103 C 659.702 748.905 644.649 736.575 629.704 724.113 C 681.16 722.084 738.984 715.793 791.002 712.436 z",fill:"url(#lm-up)",stroke:"url(#lm-up)"}),u.jsx("path",{d:"M 182 1023 C 360 1051 555 1151 698.326 1248.65 C 702.16 1232.41 707.425 1206.32 709.871 1189.79 C 737.246 1238.39 766.184 1286.55 793.713 1335.16 C 739.167 1331.05 684.598 1327.24 630.009 1323.75 C 644.462 1311.53 659.652 1298.21 674.331 1286.42 C 525 1176 355 1083 182 1023 z",fill:"url(#lm-down)",stroke:"url(#lm-down)"}),u.jsx("path",{d:"M 182 1023.5 L 884.044 1002.33 L 881.311 1004.34 C 882.15 1018.85 886.981 1021.89 881.356 1038.74 C 878.766 1040.79 876.225 1042.9 873.734 1045.08 z",fill:"url(#lm-shaft)",stroke:"url(#lm-shaft)"}),u.jsx("path",{d:"M 1005.63 925.199 L 1121.78 984.34 C 1142.45 994.767 1179.5 1012.52 1198.4 1023.72 L 1070.98 1089.03 C 1051.67 1098.95 1023.69 1114.54 1004.93 1122.53 C 1013.61 1097.65 1022.5 1072.85 1031.59 1048.12 L 873.734 1045.08 C 876.225 1042.9 878.766 1040.79 881.356 1038.74 C 886.981 1021.89 882.15 1018.85 881.311 1004.34 L 884.044 1002.33 L 1030.81 999.036 C 1023.04 976.689 1012.03 947.529 1005.63 925.199 z",fill:"url(#lm-head)",stroke:"url(#lm-head)"})]})}function ym({height:a=16}){return u.jsxs("svg",{"aria-label":"Leglas",fill:"#E8ECF7",height:a,role:"img",viewBox:"1256 928 642 222",width:Math.round(a*(642/222)),children:[u.jsx("path",{d:"M 1532.93 979.19 C 1552.43 978.051 1561.54 979.865 1574.88 995.12 L 1575.07 981.036 L 1598.92 981.151 L 1598.96 1052.38 C 1598.98 1086.98 1603.87 1127.82 1557.89 1134.37 C 1533.59 1137.83 1517.6 1134.59 1498.35 1119.87 L 1504.96 1108.54 L 1508.69 1102.35 C 1525.04 1114.93 1548.42 1124.68 1566.62 1107.48 C 1575.66 1098.94 1575.05 1084.76 1574.99 1073.16 C 1568.8 1080.06 1562.18 1085.4 1553.24 1088.34 C 1542.19 1091.88 1530.17 1090.79 1519.94 1085.31 C 1486.94 1067.75 1484.12 1009.92 1513.66 987.847 C 1520.32 982.873 1525.18 981.186 1532.93 979.19 z M 1541.52 1000.13 C 1555.85 998.918 1566.45 1003.26 1574.9 1015.05 C 1575.09 1027.93 1574.91 1041.22 1574.89 1054.14 C 1567.52 1063.25 1562.65 1066.25 1551.25 1068.92 C 1511.01 1069.99 1505.34 1012.62 1541.52 1000.13 z",fillRule:"evenodd"}),u.jsx("path",{d:"M 1416.95 979.231 C 1461.09 974.139 1477.7 1004.91 1478.08 1043.29 L 1395.13 1043.56 C 1404.31 1072.49 1429.03 1082.58 1454.48 1064.74 C 1457.34 1062.33 1456.68 1062.04 1459.58 1062.05 C 1464.01 1065.22 1467.95 1071.97 1471.41 1076.59 C 1414.1 1122.22 1344.57 1064.4 1381 1001.64 C 1388.32 989.03 1403.12 982.109 1416.95 979.231 z M 1419.64 998.169 C 1442.21 996.072 1449.85 1006.61 1455.14 1026.51 C 1448.55 1026.96 1438.16 1026.58 1431.31 1026.54 C 1419.15 1026.65 1406.99 1026.63 1394.83 1026.48 C 1398.74 1009.86 1403.7 1003.36 1419.64 998.169 z",fillRule:"evenodd"}),u.jsx("path",{d:"M 1713.27 979.252 C 1728.04 977.573 1745.26 979.123 1756.3 989.97 C 1768.26 1001.72 1767.44 1017.49 1767.31 1032.81 C 1767.15 1051.82 1767.12 1070.77 1767.06 1089.74 L 1757.36 1089.93 C 1733.55 1090.35 1748.04 1086.51 1742.3 1080.97 C 1727.07 1089.66 1714.5 1096.6 1695.79 1090.38 C 1685.07 1086.81 1679.16 1079.18 1674.51 1069.31 C 1663.26 1025.76 1710.42 1008.22 1743.06 1033.45 C 1743.17 1029.64 1743.75 1021.08 1742.89 1017.76 C 1734.81 986.781 1704.35 998.377 1687.37 1012 C 1684.28 1006.47 1681.22 1000.93 1678.2 995.358 C 1689.81 985.727 1698.69 981.852 1713.27 979.252 z M 1714.53 1038.21 C 1726.37 1037.77 1733.38 1039.57 1742.94 1046.21 C 1743.21 1052.09 1743.05 1058.97 1743.05 1064.94 C 1736.15 1071.44 1733.92 1072.52 1724.6 1074.96 C 1709.1 1075.75 1690.77 1070.07 1698.16 1048.49 C 1700.08 1042.9 1708.94 1039.56 1714.53 1038.21 z",fillRule:"evenodd"}),u.jsx("path",{d:"M 1823.29 979.174 C 1843.68 977.649 1857.91 980.343 1873.82 993.561 L 1864.19 1010.31 C 1854.9 1002.37 1842.52 996.264 1830.29 997.499 C 1810.54 999.496 1804.87 1016.41 1827.99 1021.78 C 1853.42 1027.68 1886.98 1035.62 1875.05 1070.07 C 1869.31 1086.64 1852.8 1091.05 1837.21 1092.35 C 1816.02 1092.18 1803.14 1089.58 1786.76 1075.52 L 1797.03 1058.98 C 1810.81 1068.5 1823.36 1075.69 1840.97 1072.95 C 1848.65 1071.76 1856.31 1065.31 1853.69 1057.02 C 1850.58 1049.89 1837.32 1046.22 1830.02 1044.91 C 1802.77 1040.01 1777.57 1024.93 1796.42 994.719 C 1802.7 984.652 1812.04 981.686 1823.29 979.174 z"}),u.jsx("path",{d:"M 1266.98 939.821 L 1293.02 939.95 L 1293.03 1066.58 L 1358.72 1066.65 L 1358.8 1089.73 L 1266.88 1089.69 L 1266.98 939.821 z"}),u.jsx("path",{d:"M 1627.11 939.241 L 1650.97 939.358 L 1650.98 1089.81 L 1627.17 1089.88 C 1626.5 1040.3 1626.89 988.911 1627.11 939.241 z"})]})}const It={copy:"M216,28H88A12,12,0,0,0,76,40V76H40A12,12,0,0,0,28,88V216a12,12,0,0,0,12,12H168a12,12,0,0,0,12-12V180h36a12,12,0,0,0,12-12V40A12,12,0,0,0,216,28ZM156,204H52V100H156Zm48-48H180V88a12,12,0,0,0-12-12H100V52H204Z",plus:"M228,128a12,12,0,0,1-12,12H140v76a12,12,0,0,1-24,0V140H40a12,12,0,0,1,0-24h76V40a12,12,0,0,1,24,0v76h76A12,12,0,0,1,228,128Z",pencil:"M230.14,70.54,185.46,25.85a20,20,0,0,0-28.29,0L33.86,149.17A19.85,19.85,0,0,0,28,163.31V208a20,20,0,0,0,20,20H92.69a19.86,19.86,0,0,0,14.14-5.86L230.14,98.82a20,20,0,0,0,0-28.28ZM91,204H52V165l84-84,39,39ZM192,103,153,64l18.34-18.34,39,39Z",link:"M87.5,151.52l64-64a12,12,0,0,1,17,17l-64,64a12,12,0,0,1-17-17Zm131-114a60.08,60.08,0,0,0-84.87,0L103.51,67.61a12,12,0,0,0,17,17l30.07-30.06a36,36,0,0,1,50.93,50.92L171.4,135.52a12,12,0,1,0,17,17l30.08-30.06A60.09,60.09,0,0,0,218.45,37.55ZM135.52,171.4l-30.07,30.08a36,36,0,0,1-50.92-50.93l30.06-30.07a12,12,0,0,0-17-17L37.55,133.58a60,60,0,0,0,84.88,84.87l30.06-30.07a12,12,0,0,0-17-17Z",search:"M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z",split:"M216,36H40A20,20,0,0,0,20,56V200a20,20,0,0,0,20,20H216a20,20,0,0,0,20-20V56A20,20,0,0,0,216,36ZM44,60h72V196H44ZM212,196H140V60h72Z",sidebar:"M216,36H40A20,20,0,0,0,20,56V200a20,20,0,0,0,20,20H216a20,20,0,0,0,20-20V56A20,20,0,0,0,216,36ZM44,60H76V196H44ZM212,196H100V60H212Z",trash:"M216,48H40a12,12,0,0,0,0,24h4V208a20,20,0,0,0,20,20H192a20,20,0,0,0,20-20V72h4a12,12,0,0,0,0-24ZM188,204H68V72H188ZM76,20A12,12,0,0,1,88,8h80a12,12,0,0,1,0,24H88A12,12,0,0,1,76,20Z"},Rn="flex h-6 w-6 items-center justify-center rounded text-[#D1D5DB] hover:bg-[#2E2E2E] hover:text-white",oi="flex h-7 w-full items-center justify-between gap-2 whitespace-nowrap rounded px-2 text-xs hover:bg-[#2E2E2E] hover:text-white disabled:cursor-not-allowed disabled:opacity-40",vm="flex h-7 w-full items-center justify-center rounded-md bg-[#E8E8EA] text-xs font-medium text-[#1C1C20] transition-[background-color,transform] duration-150 hover:bg-white active:scale-[0.98] disabled:cursor-not-allowed disabled:opacity-50 motion-reduce:transition-none";function lr({on:a}){return u.jsx("span",{"aria-hidden":"true",className:`relative h-3.5 w-6 shrink-0 rounded-full transition-colors duration-150 motion-reduce:transition-none ${a?"bg-[#E6E8EC]":"bg-[#17181B]"}`,children:u.jsx("span",{className:`absolute left-0.5 top-0.5 size-2.5 rounded-full transition-transform duration-150 motion-reduce:transition-none ${a?"translate-x-2.5 bg-[#17181B]":"bg-[#84848C]"}`})})}function gr({className:a=""}){return u.jsx("span",{"aria-hidden":!0,className:`leglas-live-dot block size-1.5 rounded-full ${a}`})}function lx({size:a=14}){return u.jsxs("svg",{"aria-hidden":!0,fill:"none",height:a,stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.6",viewBox:"0 0 16 16",width:a,children:[u.jsx("path",{d:"M8 9.75V2.75"}),u.jsx("path",{d:"m5.25 5.5 2.75-2.75 2.75 2.75"}),u.jsx("path",{d:"M3.25 8.75v3.5a1.5 1.5 0 0 0 1.5 1.5h6.5a1.5 1.5 0 0 0 1.5-1.5v-3.5"})]})}function ui({size:a=3}){return u.jsx("span",{"aria-hidden":!0,className:`block ${a===3?"size-3":"size-3.5"} shrink-0 animate-spin rounded-full border-[1.5px] border-white/15 border-t-white/70 motion-reduce:animate-none`})}function Vf({size:a=12}){return u.jsxs("svg",{"aria-hidden":"true",className:"shrink-0 text-amber-400/90",fill:"none",height:a,stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",viewBox:"0 0 16 16",width:a,children:[u.jsx("path",{d:"M8 2.6 14.6 13.4H1.4Z"}),u.jsx("path",{d:"M8 6.8v2.7"}),u.jsx("path",{d:"M8 11.6h.01"})]})}function Pt({d:a,size:s=13}){return u.jsx("svg",{"aria-hidden":!0,fill:"currentColor",height:s,viewBox:"0 0 256 256",width:s,children:u.jsx("path",{d:a})})}let o1=0;function Je({children:a,label:s,side:c="top",wide:r=!1}){const f=w.useRef(null),d=w.useRef(null),p=w.useRef(null),y=w.useRef(null),b=w.useRef(null),[x,S]=w.useState(null);w.useLayoutEffect(()=>{const N=d.current,U=f.current?.firstElementChild;if(!x||x.out||!N||!U)return;const $=nx(x,{height:N.offsetHeight,width:N.offsetWidth},U.getBoundingClientRect(),{height:window.innerHeight,width:window.innerWidth});$&&S(O=>O&&{...O,...$})},[s,x?.at,x?.out,x?.shift,x?.x,x?.y]),w.useEffect(()=>()=>{y.current&&clearTimeout(y.current),b.current&&clearTimeout(b.current)},[]);const M=()=>{const N=f.current?.firstElementChild;if(!N)return;const U=N.getBoundingClientRect();b.current&&clearTimeout(b.current),p.current=N.closest("dialog, [data-leglas-shell]")??document.body,S(c==="top"?{at:"top",out:!1,shift:0,x:U.left+U.width/2,y:U.top-8}:{at:"right",out:!1,shift:0,x:U.right+8,y:U.top+U.height/2})},T=()=>{y.current&&clearTimeout(y.current),y.current=setTimeout(M,Date.now()<o1?0:300)},k=()=>{y.current&&clearTimeout(y.current),o1=Date.now()+300,S(N=>N&&!N.out?{...N,out:!0}:N),b.current&&clearTimeout(b.current),b.current=setTimeout(()=>S(null),120)};return u.jsxs("span",{className:"contents",onBlur:k,onFocus:N=>{N.target instanceof Element&&N.target.matches(":focus-visible")&&M()},onPointerDown:k,onPointerEnter:T,onPointerLeave:k,ref:f,children:[a,x&&sm.createPortal(u.jsx("span",{"aria-hidden":!0,className:"pointer-events-none fixed z-[60]",style:{left:x.x+x.shift,top:x.y},children:u.jsx("span",{className:`block ${{bottom:"-translate-x-1/2",right:"-translate-y-1/2",top:"-translate-x-1/2 -translate-y-full"}[x.at]}`,children:u.jsx("span",{className:`leglas-tip block rounded-lg border border-white/10 bg-[#171717] px-2 py-1 text-xs font-medium text-white shadow-lg ${r?"w-64 whitespace-normal":"whitespace-nowrap"} ${x.out?`leglas-tip-out-${x.at}`:`leglas-tip-in-${x.at}`}`,ref:d,children:s})})}),p.current??document.body)]})}function ax({error:a,initial:s,label:c,onCancel:r,onCommit:f}){const d=w.useRef(!1);return w.useEffect(()=>{a&&(d.current=!1)}),u.jsx("form",{className:"leglas-rename min-w-0 flex-1",onSubmit:p=>{p.preventDefault();const y=new FormData(p.currentTarget).get("name");d.current=!0,f(Fn(y)?y.trim():"","submit")},children:u.jsx("input",{"aria-describedby":a?"leglas-rename-error":void 0,"aria-invalid":a?!0:void 0,"aria-label":c,autoFocus:!0,className:`-mx-1 block w-[calc(100%+0.5rem)] rounded-[4px] bg-transparent px-1 py-0 text-sm font-medium leading-5 text-white outline-none ring-1 ${a?"ring-amber-400/60":"ring-[#D1D5DB]/45 focus:ring-[#D1D5DB]/70"}`,defaultValue:s,name:"name",onBlur:p=>{d.current||f(p.currentTarget.value.trim(),"blur")},onKeyDown:p=>{p.key==="Escape"&&(d.current=!0,r())},type:"text"})})}const ix={danger:"bg-amber-300",info:"bg-[#9CA3AF]",success:"bg-emerald-300"},sx=140;function ox({onDismiss:a,toast:s}){const[c,r]=w.useState(!1),[f,d]=w.useState(!1),[p,y]=w.useState(!1),b=w.useRef(s.ttl),x=w.useRef(null),S=()=>{x.current||(r(!0),x.current=setTimeout(a,sx))},M=f||p;return w.useEffect(()=>{if(c||M||b.current===null)return;const T=Date.now(),k=setTimeout(S,b.current);return()=>{clearTimeout(k),b.current!==null&&(b.current=Math.max(0,b.current-(Date.now()-T)))}},[c,M]),w.useEffect(()=>()=>{x.current&&clearTimeout(x.current)},[]),u.jsxs("li",{className:`pointer-events-auto flex items-start gap-2.5 rounded-lg border border-white/10 bg-[#2E2E2E] px-3 py-2.5 shadow-xl shadow-black/40 ${c?"leglas-toast-out":"leglas-toast-in"}`,onBlur:()=>y(!1),onFocus:()=>y(!0),onPointerEnter:()=>d(!0),onPointerLeave:()=>d(!1),children:[u.jsx("span",{"aria-hidden":!0,className:`mt-[5px] size-1.5 shrink-0 rounded-full ${ix[s.tone]}`}),u.jsxs("span",{className:"min-w-0 flex-1",children:[u.jsx("span",{className:"block text-xs leading-snug text-[#E8E8EA]",children:s.message}),s.detail?u.jsx("span",{className:"mt-1 block cursor-text select-text break-all text-[10px] leading-snug text-[#9CA3AF]","data-selectable":"",style:{fontFamily:"var(--font-mono)"},children:s.detail}):null,s.note?u.jsx("span",{className:"mt-1 block text-[11px] leading-snug text-[#9CA3AF]",children:s.note}):null]}),s.action?u.jsx("button",{className:"shrink-0 rounded px-1 py-0.5 text-[11px] font-medium text-white underline decoration-white/30 underline-offset-2 transition-colors hover:decoration-white focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[#D1D5DB]/60",onClick:()=>{s.action?.run(),S()},type:"button",children:s.action.label}):null,u.jsx("button",{"aria-label":"Dismiss",className:"-mr-1 flex size-5 shrink-0 items-center justify-center rounded text-[#84848C] transition-colors hover:bg-white/[0.06] hover:text-white focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[#D1D5DB]/60",onClick:S,type:"button",children:u.jsx("svg",{className:"size-2.5",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 10 10",children:u.jsx("path",{d:"M2.5 2.5 7.5 7.5M7.5 2.5 2.5 7.5",strokeLinecap:"round"})})})]})}function ux({bottom:a,left:s,onDismiss:c,toasts:r,width:f}){return u.jsx("ol",{"aria-live":"polite",className:`pointer-events-none fixed z-40 flex flex-col gap-2 transition-[bottom,left,width] duration-200 ${ci} motion-reduce:transition-none`,style:{bottom:a,left:s,width:f},children:r.map(d=>u.jsx(ox,{onDismiss:()=>c(d.id),toast:d},d.id))})}function rx({loaded:a}){return u.jsxs("div",{"aria-hidden":!0,className:`absolute inset-0 overflow-hidden bg-white transition-opacity duration-700 ${ci} ${a?"pointer-events-none opacity-0":"opacity-100"}`,children:[u.jsxs("div",{children:[u.jsx("div",{className:"mx-auto mt-6 h-12 w-[400px] max-w-[80%] rounded-full bg-neutral-200/80"}),u.jsxs("div",{className:"mx-auto mt-24 grid w-full max-w-5xl grid-cols-[1.05fr_0.95fr] items-start gap-16 px-12 max-[900px]:grid-cols-1",children:[u.jsxs("div",{children:[u.jsx("div",{className:"h-14 w-4/5 rounded-lg bg-neutral-200"}),u.jsx("div",{className:"mt-3 h-14 w-3/5 rounded-lg bg-neutral-200"}),u.jsx("div",{className:"mt-8 h-4 w-full max-w-[420px] rounded bg-neutral-200/80"}),u.jsx("div",{className:"mt-2 h-4 w-4/5 max-w-[360px] rounded bg-neutral-200/80"}),u.jsx("div",{className:"mt-10 h-12 w-44 rounded-full bg-neutral-200"})]}),u.jsx("div",{className:"h-[420px] w-60 justify-self-center rounded-[2.5rem] bg-neutral-200 max-[900px]:hidden"})]})]}),u.jsx("div",{className:"pointer-events-none absolute inset-0 overflow-hidden motion-reduce:hidden",children:u.jsx("div",{className:"absolute inset-0 -translate-x-full animate-[leglas-skeleton-sweep_1.6s_ease-in-out_infinite]",style:{background:"linear-gradient(100deg, transparent 32%, rgba(255,255,255,0.55) 50%, transparent 68%)"}})}),u.jsxs("span",{className:"absolute bottom-4 right-5 flex items-center gap-2",children:[u.jsx(mr,{"aria-label":"",size:20,state:pr,theme:"light"}),u.jsx("span",{className:"leglas-shimmer-text text-xs font-medium",children:"Loading preview…"})]})]})}function cx({branch:a,onStart:s,state:c}){if(c.status==="failed")return u.jsx(bm,{onReload:s,reason:c.reason});const r=c.status==="starting"?{"checking out":`Checking out ${a}`,installing:"Installing what it needs",starting:"Starting its dev server"}[c.phase]:`Opening ${a}`;return u.jsxs("div",{"aria-live":"polite",className:"absolute inset-0 flex flex-col items-center justify-center gap-3 bg-white p-6 text-center",children:[u.jsx("span",{className:"size-4 animate-spin rounded-full border-2 border-neutral-300 border-t-neutral-800 motion-reduce:animate-none"}),u.jsxs("div",{className:"max-w-xs",children:[u.jsx("p",{className:"text-sm font-medium text-neutral-800",children:r}),u.jsx("p",{className:"mt-1 text-xs leading-snug text-neutral-500",children:"A branch runs in its own checkout, built the first time you open it this session."})]})]})}function bm({onReload:a,reason:s}){return u.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-3 bg-white p-6 text-center",role:"alert",children:[u.jsxs("div",{className:"max-w-xs",children:[u.jsx("p",{className:"text-sm font-medium text-neutral-800",children:"Preview didn’t load"}),u.jsx("p",{className:"mt-1 text-xs leading-snug text-neutral-500",children:s})]}),u.jsx("button",{className:"rounded-md bg-neutral-900 px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-neutral-700",onClick:a,type:"button",children:"Reload"})]})}function fx({text:a}){const s=[];let c=0;for(const r of a.split(" "))s.push({word:r,at:c}),c+=r.length+1;return u.jsx("code",{className:"font-mono text-[0.92em] text-neutral-700",children:s.map(({word:r,at:f})=>u.jsxs(w.Fragment,{children:[f>0&&" ",u.jsx("span",{className:"whitespace-nowrap",children:r})]},f))})}function u1({className:a,words:s}){return u.jsxs("p",{className:a,children:[s.lead,u.jsx(fx,{text:s.quote}),s.tail]})}function dx({headline:a,hint:s,href:c,onShowAnyway:r,reason:f}){return u.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-3 bg-white p-6 text-center",role:"alert",children:[u.jsxs("div",{className:"max-w-sm",children:[u.jsx("p",{className:"text-balance text-sm font-medium text-neutral-800",children:a}),u.jsx(u1,{className:"mt-1 text-pretty text-xs leading-snug text-neutral-500",words:f})]}),u.jsx("a",{className:"rounded-md bg-neutral-900 px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-neutral-700",href:c,rel:"noopener noreferrer",target:"_blank",children:"Open in a new tab"}),u.jsx("button",{className:"text-xs text-neutral-500 underline-offset-2 transition-colors hover:text-neutral-800 hover:underline",onClick:r,type:"button",children:"Show the frame anyway"}),u.jsx(u1,{className:"max-w-sm text-balance text-[11px] leading-snug text-neutral-400",words:s})]})}function os({id:a,size:s=14}){const c=w.useId();return a==="claude"?u.jsx("svg",{"aria-hidden":"true",fill:"#D97757",height:s,viewBox:"0 0 24 24",width:s,children:u.jsx("path",{d:"m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z"})}):a==="cursor"?u.jsx("svg",{"aria-hidden":"true",fill:"currentColor",height:s,viewBox:"0 0 24 24",width:s,children:u.jsx("path",{d:"M11.503.131 1.891 5.678a.84.84 0 0 0-.42.726v11.188c0 .3.162.575.42.724l9.609 5.55a1 1 0 0 0 .998 0l9.61-5.55a.84.84 0 0 0 .42-.724V6.404a.84.84 0 0 0-.42-.726L12.497.131a1.01 1.01 0 0 0-.996 0M2.657 6.338h18.55c.263 0 .43.287.297.515L12.23 22.918c-.062.107-.229.064-.229-.06V12.335a.59.59 0 0 0-.295-.51l-9.11-5.257c-.109-.063-.064-.23.061-.23"})}):a==="codex"?u.jsxs("svg",{"aria-hidden":"true",height:s,viewBox:"0 0 24 24",width:s,children:[u.jsx("defs",{children:u.jsxs("linearGradient",{id:c,x1:"0",x2:"0",y1:"0",y2:"1",children:[u.jsx("stop",{offset:"0",stopColor:"#9B96F2"}),u.jsx("stop",{offset:"0.55",stopColor:"#5E6CF6"}),u.jsx("stop",{offset:"1",stopColor:"#3B32EF"})]})}),u.jsx("path",{d:"M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457z",fill:`url(#${c})`}),u.jsx("path",{d:"M7.282 8.307a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zM12.728 14.547a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z",fill:"#F4F4FE"})]}):a==="custom"?u.jsx("svg",{"aria-hidden":"true",fill:"none",height:s,stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",width:s,children:u.jsx("path",{d:"m5 6 6 6-6 6M13 18h6"})}):null}const Mo=15e3,hx=["config","requests","health","share","update","generation"];function mx(a){return hx.some(s=>s===a)}function px(a){try{const s=cm(a);if(!ri(s))return null;const c=s.changed;return mx(c)?c:null}catch{return null}}const r1=250,gx=3e4;function xx(a){return a<=0?r1:Math.min(gx,r1*2**a)}function yx(){const{host:a,protocol:s}=window.location;return`${s==="https:"?"wss":"ws"}://${a}/leglas/api/live`}function vx(a){const s=new WebSocket(a);return{addEventListener:(c,r)=>s.addEventListener(c,f=>{r("data"in f&&Fn(f.data)?{data:f.data}:{})}),close:()=>s.close()}}let c1=null;function us(){return c1??=bx(),c1}function bx(a={}){const s=a.connect??vx,c=a.setTimeout??((T,k)=>globalThis.setTimeout(T,k)),r=a.clearTimeout??(T=>globalThis.clearTimeout(T)),f=new Map;let d=null,p=!1,y=0,b=null,x=!1;const S=()=>{if(x)return;let T;try{T=s(a.url??yx())}catch{return M()}d=T,T.addEventListener("open",()=>{x||(p=!0,y=0)}),T.addEventListener("message",N=>{if(N.data===void 0)return;const U=px(N.data);if(U!==null)for(const $ of f.get(U)??[])$()});const k=()=>{d===T&&(p=!1,d=null,M())};T.addEventListener("close",k),T.addEventListener("error",k)},M=()=>{if(x||b!==null)return;const T=xx(y);y+=1,b=c(()=>{b=null,S()},T)};return S(),{on(T,k){const N=f.get(T)??new Set;return N.add(k),f.set(T,N),()=>{N.delete(k),N.size===0&&f.delete(T)}},get connected(){return p},stop(){x=!0,p=!1,b!==null&&r(b),b=null,f.clear();const T=d;d=null;try{T?.close()}catch{}}}}function Df(a){return a instanceof Error&&a.name==="AbortError"}const wx=1e4,Sx={setInterval:(a,s)=>globalThis.setInterval(a,s),clearInterval:a=>globalThis.clearInterval(a),setTimeout:(a,s)=>globalThis.setTimeout(a,s),clearTimeout:a=>globalThis.clearTimeout(a)};function rs(a,s){const{everyMs:c,timeoutMs:r=wx,timers:f=Sx}=s;let d=!1,p=null;const y=()=>{if(d||p!==null)return;const S=new AbortController,M=f.setTimeout(()=>{S.abort(),p?.controller===S&&(p=null)},r),T={controller:S,deadline:M};p=T;const k=()=>{p===T&&(f.clearTimeout(M),p=null)};a(S.signal).then(k,k)};y();const b=f.setInterval(y,c),x=s.subscribe?.(y);return()=>{d=!0,x?.(),f.clearInterval(b),p!==null&&(f.clearTimeout(p.deadline),p.controller.abort(),p=null)}}function jx(a){const s=document.createElement("textarea");s.value=a,s.setAttribute("readonly",""),s.style.cssText="position:fixed;top:-1000px;opacity:0",document.body.append(s),s.select();try{return document.execCommand("copy")}finally{s.remove()}}function Ex(){return{clipboard:typeof navigator>"u"?void 0:navigator.clipboard,legacy:typeof document>"u"?void 0:jx}}async function wr(a,s=Ex()){if(s.clipboard)try{return await s.clipboard.writeText(a),"copied"}catch{}try{if(s.legacy?.(a))return"copied"}catch{}return"blocked"}const Cx=9;function Nx(a){if((a.metaKey||a.ctrlKey)&&!a.altKey&&!a.shiftKey&&a.key.toLowerCase()==="k")return{kind:"search"};if(a.typing||a.metaKey||a.ctrlKey||a.altKey)return null;const{key:s}=a;if(s==="?")return{kind:"help"};if(s==="ArrowDown")return{kind:"move",delta:1};if(s==="ArrowUp")return{kind:"move",delta:-1};const c=s.length===1?s.toLowerCase():"";return c==="a"?{kind:"note"}:c==="c"?{kind:"split"}:c==="b"?{kind:"rail"}:c==="r"?{kind:"request"}:c==="t"?{kind:"tools"}:s.length===1&&s>="1"&&s<=String(Cx)?{kind:"jump",index:Number(s)-1}:null}function wm(a){return a?"⌘Cmd+K":"Ctrl+K"}function Mx(a,s=!1){const c=[{keys:["↑","↓"],label:"Move between directions"},{keys:["1","9"],join:"to",label:"Jump straight to a direction"},{keys:["C"],label:"Compare against the direction you were last on"},{keys:["R"],label:"Ask for a change to this direction",changes:!0},{keys:["A"],label:"Annotate the design: point at what is wrong",changes:!0},{keys:[wm(a)],label:"Search"},{keys:["B"],label:"Collapse or open the rail"},{keys:["T"],label:"Open or close the Leglas dev tool menu"},{keys:["?"],label:"This list"},{keys:["Esc"],label:"Clear the search, or close what is open"}],r=[];for(const{changes:f,...d}of c)s&&f||r.push(d);return r}function Ax(a,s,c){return`${a}\0${s}\0${c}`}function Dx(a,s,c){return a[s]===c}function Tx(a,s,c){return a[s]===c?a:{...a,[s]:c}}function kx(a,s){if(!(s in a))return a;const c={...a};return delete c[s],c}function Zf(a){try{const s=a.contentDocument;return s!==null&&s.location.href!=="about:blank"&&s.readyState!=="loading"}catch{return!1}}function zx({frame:a,onFailure:s,onReady:c,sameOrigin:r,timeoutMs:f}){let d=!1,p=null;const y=()=>{a.removeEventListener("load",S),a.removeEventListener("error",M),p!==null&&(globalThis.clearTimeout(p),p=null)},b=T=>d||(r?!Zf(a):!T)?!1:(d=!0,y(),c(),!0),x=T=>{d||T&&r&&b(!1)||(d=!0,y(),s())};function S(){b(!r)}function M(){x(!1)}return a.addEventListener("load",S),a.addEventListener("error",M),p=globalThis.setTimeout(()=>x(!0),f),r&&b(!1),()=>{d||(d=!0,y())}}function Rx(a){return ri(a)&&(a.header==="x-frame-options"||a.header==="content-security-policy")&&Fn(a.value)}async function Ox(a,s=fetch){try{const c=await s(`/leglas/api/previews/framing?title=${encodeURIComponent(a)}`);if(!c.ok)return null;const r=await c.json();return ri(r)&&r.framable===!1&&Rx(r.refusal)?{header:r.refusal.header,value:r.refusal.value}:null}catch{return null}}function Lx(a){try{return new URL(a).host}catch{return a}}function _x(a){if(a.header==="content-security-policy")return{lead:"Its Content-Security-Policy says ",quote:a.value,tail:", and Leglas is not on that list."};const s=a.value.trim(),c=`X-Frame-Options: ${s}`;switch(s.toLowerCase()){case"deny":return{lead:"It sends ",quote:c,tail:", which tells every browser not to show it in a frame."};case"sameorigin":return{lead:"It sends ",quote:c,tail:", which lets only its own pages frame it."};default:return{lead:"It sends ",quote:c,tail:", which browsers read as a refusal."}}}function Bx(a,s,c){return{headline:`${Lx(s)} won’t open inside another page`,reason:_x(a),hint:{lead:"If the site is yours, a Content-Security-Policy of ",quote:`frame-ancestors ${c}`,tail:" lets it show here."}}}function Ux(a){if(!ri(a))return null;const s=a.type;return s==="leglas:preview-ready"?"ready":s==="leglas:preview-error"?"error":null}function Hx(a,s){if(s===null)return null;for(const c of a)if(c.contentWindow===s)return c;return null}function f1(a){return a.file===void 0&&a.branch===void 0&&a.url.startsWith("/")}const $x={reachable:!0,wasDown:!1};function qx(a,s){return s?a.reachable?a:{reachable:!0,wasDown:a.wasDown}:!a.reachable&&a.wasDown?a:{reachable:!1,wasDown:!0}}function Yx(a){const s=a.rows,c=r=>r!=null&&r!==a.active&&(s===void 0||s.includes(r));return c(a.pinned)?a.pinned:c(a.parent)?a.parent:c(a.previous)?a.previous:s?.find(r=>r!==a.active)??null}function Gx(a){return!a.split||a.compare===null||a.compare===a.active?[a.active]:[a.active,a.compare]}const Xx=.999,Qx=.05,Vx=40;function Zx(a){return a<=3?{columns:Math.max(1,a),rows:1}:a===4?{columns:2,rows:2}:{columns:3,rows:Math.ceil(a/3)}}function Kx(a){const{gutter:s,panes:c,scaleSplit:r,stageHeight:f,stageWidth:d,viewport:p}=a,y=a.rows??1,b=a.inset??0,x=c>1?(d-(c-1))/c:d,S=p??d,M=x-(p!==null?s:0)-b,T=f-(p!==null?s:0),k=r&&(c>1||y>1)&&d>0&&S>0,N=(f-(y-1))/y,U=y>1?(N-Vx-b)/T:1,$=k?Math.max(Qx,Math.min(1,M/S,U)):1,O=$<Xx;return{boxHeight:T*$,boxWidth:S*$,designWidth:S,frameHeight:T,scale:$,scaling:O}}const Fx="#__next-build-watcher,#nuxt-devtools-anchor,astro-dev-toolbar{display:none!important}",Jx="#devtools-indicator{display:none!important}",Wx=12;function Ix(a,s,c=[],r=[]){const f=a.replace(/\s+/g," ").trim().toLowerCase();return f.length<Wx?null:jm(`${s.join(">")} ${f} ${c.join("|")} ${r.join("|")}`.trimEnd())}const Sm=new Set(["LINK","META","NOSCRIPT","SCRIPT","STYLE","TEMPLATE"]),ar=720,d1=180,Px=["display","visibility","position","top","right","bottom","left","inset","box-sizing","width","height","min-width","min-height","max-width","max-height","margin-top","margin-right","margin-bottom","margin-left","padding-top","padding-right","padding-bottom","padding-left","overflow-x","overflow-y","opacity","transform","transform-origin","perspective","z-index","color","background-color","background-image","background-position","background-size","border-top-width","border-right-width","border-bottom-width","border-left-width","border-top-color","border-right-color","border-bottom-color","border-left-color","border-top-left-radius","border-top-right-radius","border-bottom-right-radius","border-bottom-left-radius","box-shadow","outline","filter","backdrop-filter","-webkit-backdrop-filter","clip-path","mask-image","mix-blend-mode","isolation","object-fit","object-position","font-family","font-size","font-style","font-weight","line-height","letter-spacing","text-align","text-transform","white-space","flex-direction","flex-wrap","flex-grow","flex-shrink","flex-basis","align-items","align-self","justify-content","justify-self","gap","row-gap","column-gap","grid-template-columns","grid-template-rows","grid-column","grid-row","aspect-ratio","pointer-events","animation-name","animation-duration","animation-delay","animation-iteration-count","animation-direction","animation-timing-function"],e2=new Set(["bottom","filter","height","left","opacity","right","top","transform","width"]),t2=["content","display","position","inset","width","height","opacity","transform","color","background-color","background-image","border-radius","box-shadow","filter","clip-path"],n2=["viewBox","d","points","x","y","x1","y1","x2","y2","cx","cy","r","rx","ry","width","height","fill","stroke","stroke-width"],h1=["nextjs-portal","vite-error-overlay","#webpack-dev-server-client-overlay","#leglas-hide-dev-overlays"].join(",");function ir(a){if(!Number.isFinite(a))return"?";const s=Math.round(a*2)/2;return Object.is(s,-0)?"0":String(s)}function jm(a){let s=2166136261,c=2654435769;for(let r=0;r<a.length;r+=1){const f=a.charCodeAt(r);s=Math.imul(s^f,16777619),c=Math.imul(c^f,2246822507)}return`${(s>>>0).toString(16)}${(c>>>0).toString(16)}`}function xr(a,s=480){const c=a.replace(/\s+/g," ").trim();return c.length<=s?c:`${c.slice(0,180)}…${c.slice(-80)}#${c.length}:${jm(c)}`}function l2(a){return Sm.has(a.tagName)||a.matches(h1)||a.closest(h1)!==null}function a2(a){if(a.length<=ar)return a.map((f,d)=>d);const s=new Set,c=f=>{f>=0&&f<a.length&&s.size<ar&&s.add(f)};for(let f=0;f<d1;f+=1)c(f);for(let f=Math.max(0,a.length-d1);f<a.length;f+=1)c(f);for(let f=0;f<a.length&&s.size<ar;f+=1){const d=a[f];if(!d.matches("a,button,input,select,textarea,summary,[role],svg,svg *,canvas,img,picture,video,audio,iframe"))continue;c(f);let p=d.parentElement;for(let y=0;p!==null&&y<3;y+=1)c(a.indexOf(p)),p=p.parentElement}const r=ar-s.size;if(r>0){const f=(a.length-1)/Math.max(1,r-1);for(let d=0;d<r;d+=1)c(Math.round(d*f))}return[...s].sort((f,d)=>f-d)}function i2(a,s){if(s.getPropertyValue("animation-name").trim()!=="none")return!0;try{return(a.getAnimations?.()??[]).some(c=>c.playState==="running")}catch{return!1}}function s2(a,s){if(s)return"rect:animated";let c;try{c=a.getBoundingClientRect()}catch{return"rect:?"}const r=a.ownerDocument.defaultView,f=r?.getComputedStyle(a).position,d=f==="fixed"?0:r?.scrollX??0,p=f==="fixed"?0:r?.scrollY??0;return`rect:${ir(c.left+d)},${ir(c.top+p)},${ir(c.width)},${ir(c.height)}`}function o2(a){const s=[];for(const r of n2){const f=a.getAttribute(r);f!==null&&s.push(`${r}:${xr(f)}`)}const c=a.tagName;if(["A","AUDIO","IFRAME","IMG","SOURCE","VIDEO"].includes(c))for(const r of["href","src","srcset","poster"]){const f=a.getAttribute(r);f!==null&&s.push(`${r}:${xr(f)}`)}if(c==="CANVAS"){const r=a;s.push(`bitmap:${r.width}x${r.height}`)}return s.join(",")}function m1(a,s,c){let r;try{r=c(a,s)}catch{return""}const f=r.getPropertyValue("content").trim();return f===""||f==="none"||f==="normal"?"":`${s}{${t2.map(d=>`${d}:${xr(r.getPropertyValue(d))}`).join(";")}}`}function u2(a,s){if(!a)return[];const c=[a,...Array.from(a.querySelectorAll("*"))].filter(r=>!l2(r));return a2(c).map(r=>{const f=c[r],d=s(f),p=i2(f,d),y=Px.map(k=>{const N=p&&e2.has(k)?"<animated>":xr(d.getPropertyValue(k));return`${k}:${N}`}).join(";"),b=f.getAttribute("role"),x=f.getAttribute("type"),S=[b&&`role:${b}`,x&&`type:${x}`].filter(Boolean).join(","),M=m1(f,"::before",s),T=m1(f,"::after",s);return`${f.tagName}${S?`[${S}]`:""}{${s2(f,p)};${y};${o2(f)};${M};${T}}`})}function r2(a,s){if(!a)return[];const c=[];let r=a;for(let f=0;f<4;f+=1){const d=s(r);c.push(`${d.backgroundColor};${d.backgroundImage};${d.color}`);const p=Array.from(r.children).filter(b=>!Sm.has(b.tagName??"")),y=p.length===1?p[0]:void 0;if(y===void 0)break;r=y}return c}function c2(a){const s=new Map;for(const[r,f]of Object.entries(a)){if(f===null)continue;const d=s.get(f);d?d.push(r):s.set(f,[r])}const c={};for(const r of s.values())if(!(r.length<2))for(const f of r)c[f]=r.filter(d=>d!==f);return c}function Em(a,s){const c=s[a.title];return c?.url===a.url?c:null}function Tf(a,s){let c=null;for(const r of s)r in a&&(c??={...a},delete c[r]);return c??a}function f2(a,s){const c=[];for(const[r,f]of s){const d=a.get(r);d!==void 0&&d!==f&&c.push(r)}return c}function d2(a,s,c){const r=c.status==="complete"?{url:s.url,status:"complete",signature:c.signature}:{url:s.url,status:"failed"},f=a[s.title],d=f?.status==="failed"&&r.status==="failed"||f?.status==="complete"&&r.status==="complete"&&f.signature===r.signature;return f?.url===r.url&&d?a:{...a,[s.title]:r}}function h2(a,s){const c={};for(const r of a){const f=Em(r,s);f?.status==="complete"&&(c[r.title]=f.signature)}return c}function m2(a,s){return a.filter(c=>c.url?.startsWith("/")?Em(c,s)===null:!1)}const p1=24,p2=10,g1=44;function g2(a,s){const c=(r,f)=>{const d=Math.min(p1,f/2),p=Math.max(d,f-p1);return Math.max(d,Math.min(p,r))};return{x:c(a.x,s.width),y:c(a.y,s.height)}}function x2(a){return{x:a.x-g1/2,y:a.y-g1/2}}function y2(a,s,c=p2){return Math.abs(s.x-a.x)>c||Math.abs(s.y-a.y)>c}function v2(a,s){const c=a.x<s.width/2,r=a.y<s.height/2;return r&&c?{corner:"top-left"}:r?{corner:"top-right"}:c?{corner:"bottom-left"}:{corner:"bottom-right"}}function b2(a,s,c){const r=new Set([a]);let f=s.get(a);for(;f!==void 0&&!r.has(f);){if(c.has(f))return f;r.add(f),f=s.get(f)}return null}function w2(a,s){const c=new Set(a),r=new Map,f=new Map,d=[];for(const b of a){const x=b2(b,s,c);if(x===null){d.push(b);continue}r.set(b,x);const S=f.get(x);S?S.push(b):f.set(x,[b])}const p=new Set,y=b=>{if(!p.has(b)){p.add(b);for(const x of f.get(b)??[])y(x)}};for(const b of d)y(b);for(const b of a){if(p.has(b))continue;const x=r.get(b);x!==void 0&&(f.set(x,(f.get(x)??[]).filter(S=>S!==b)),r.delete(b)),d.push(b),y(b)}return{children:f,parentOf:r,roots:d}}function x1(a,s,c){const r=w2(a,s),f=S=>(r.children.get(S)??[]).reduce((M,T)=>M+f(T),1),d=[],p=[],y=()=>{const S=p.indexOf(null);return S!==-1?S:(p.push(null),p.length-1)},b=(S,M,T,k)=>{const N=c.has(S)?[]:r.children.get(S)??[],U=p.flatMap((Q,X)=>Q!==null&&X!==T?[X]:[]),[$,...O]=N,V=O.map(Q=>{const X=y();return p[X]=Q,{kid:Q,lane:X}});if(d.push({title:S,depth:M,lane:T,fromAbove:k,toBelow:$!==void 0,forks:V.map(Q=>Q.lane),through:U}),$===void 0){p[T]=null;return}b($,M+1,T,!0);for(const Q of V)b(Q.kid,M+1,Q.lane,!0)};for(const S of r.roots){const M=y();p[M]=S,b(S,0,M,!1)}const x=new Map(d.map(S=>[S.title,{depth:S.depth,variants:S.depth===0?f(S.title)-1:0,descendants:f(S.title)-1,folded:c.has(S.title),graph:S}]));return{rows:d.map(S=>S.title),meta:x,parents:r.parentOf,children:r.children,roots:r.roots}}function S2(a,s,c,r,f){const d=(a.length?a:s).filter(y=>y!==c),p=r!==null&&d.includes(r)?d.indexOf(r):Math.max(-1,...f.flatMap(y=>y===c?[]:[d.indexOf(y)]))+1;return d.splice(p,0,c),d}function kf(a){const s=["mark"];a.fromAbove&&s.push("above"),a.toBelow&&s.push("below");for(const c of a.forks)s.push(`fork:${c}`);for(const c of a.through)s.push(`through:${c}`);return s}function j2(a,s){const c=[s];for(let r=a.get(s);r!==void 0&&!c.includes(r);r=a.get(r))c.unshift(r);return c}function E2(a,s,c){const r=j2(a,c),f=[...r],d=[];if(r.forEach((b,x)=>{const S=r[x+1];S!==void 0&&d.push([b,S])}),r.length>1)return{nodes:f,edges:d};const p=new Set(f),y=b=>{for(const x of s.get(b)??[])p.has(x)||(p.add(x),f.push(x),d.push([b,x]),y(x))};return y(c),{nodes:f,edges:d}}function C2(a,s,c){const r=new Map,f=(d,p)=>{const y=r.get(d);y?y.add(p):r.set(d,new Set([p]))};for(const d of c.nodes)s.has(d)&&f(d,"mark");for(const[d,p]of c.edges){if(!s.has(d)||!s.has(p))continue;const y=s.get(p)?.graph?.lane??0;f(d,s.get(d)?.graph?.lane===y?"below":`fork:${y}`);for(const b of a.slice(a.indexOf(d)+1,a.indexOf(p)))f(b,`through:${y}`);f(p,"above")}return r}function N2(a){let s=-1;for(const{graph:c}of a.values())c!==null&&(s=Math.max(s,c.lane,...c.forks,...c.through));return s}function M2(a,s){const c=[],r=new Set([a]);let f=s.get(a);for(;f!==void 0&&!r.has(f);)c.unshift(f),r.add(f),f=s.get(f);return c}function A2(a,s=3){return a.length<=s?{head:[...a],hidden:[],tail:[]}:{head:[a[0]],hidden:a.slice(1,-1),tail:[a[a.length-1]]}}const y1=a=>Math.round(a*100)/100,yr=.5523,zf=4,D2=([a,s],c,r)=>[[a,s],[a,s+yr*c],[a+r*(c-yr*c),s+c],[a+r*c,s+c]],T2=([a,s],c,r)=>[[a,s],[a+r*yr*c,s],[a+r*c,s+c-yr*c],[a+r*c,s+c]],k2=(a,s)=>[a,[a[0]+(s[0]-a[0])/3,a[1]+(s[1]-a[1])/3],[a[0]+(s[0]-a[0])*2/3,a[1]+(s[1]-a[1])*2/3],s];function Cm(a,s,c){const r=Math.abs(c-a),f=c>a?1:-1,d=r/2,p=[a,s+zf],y=[a+f*d,s+zf+d];return{knee:s+zf+r,segments:[k2([a,s],p),D2(p,d,f),T2(y,d,f)]}}function Nm(a,s,c){return Cm(a,s,c).knee}const z2=([a,s,c,r],f)=>{const d=1-f;return[d*d*d*a[0]+3*d*d*f*s[0]+3*d*f*f*c[0]+f*f*f*r[0],d*d*d*a[1]+3*d*d*f*s[1]+3*d*f*f*c[1]+f*f*f*r[1]]};function R2([a,s,c,r],f){const d=(M,T)=>[M[0]+(T[0]-M[0])*f,M[1]+(T[1]-M[1])*f],p=d(a,s),y=d(s,c),b=d(c,r),x=d(p,y),S=d(y,b);return[d(x,S),S,b,r]}function Mm(a,s,c,r=0){const{segments:f}=Cm(a,s,c);let d=r;const p=[];for(const x of f){if(d<=0){p.push(x);continue}const S=48;let M=0,T=x[0],k=null;for(let N=1;N<=S;N+=1){const U=z2(x,N/S),$=Math.hypot(U[0]-T[0],U[1]-T[1]);if(M+$>=d){k=(N-1+(d-M)/$)/S;break}M+=$,T=U}if(k===null){d-=M;continue}d=0,p.push(R2(x,k))}const y=p[0];if(y===void 0)return"";const b=x=>`${y1(x[0])} ${y1(x[1])}`;return`M ${b(y[0])} ${p.map(x=>`C ${b(x[1])}, ${b(x[2])}, ${b(x[3])}`).join(" ")}`}function O2(a){let s="";for(let c=1;c<a.length;c+=1){const[r,f]=[a[c-1],a[c]],d=r.clear??0,p=r.y+d,y=f.y-(f.clear??0);if(y<=p)continue;if(f.x===r.x){s+=`${s?" ":""}M ${r.x} ${p} L ${f.x} ${y}`;continue}const b=Nm(r.x,r.y,f.x);if(b>y){s+=`${s?" ":""}M ${r.x} ${p} L ${f.x} ${y}`;continue}const x=Mm(r.x,r.y,f.x,d);s+=`${s?" ":""}${x===""?`M ${f.x} ${b}`:x} L ${f.x} ${y}`}return s}const vr=10,br=4,Am=44,L2=8,_2=10,v1=4,B2="#4A4A54",U2="#41414A",H2="#8E8E98",b1="#7C7C85",$2="#D1D5DB",w1="#E8E8EA",sr="160ms cubic-bezier(0.2, 0.7, 0.2, 1)";function q2(a){return a<0?0:Math.max(Am,br+a*vr+10)}const S1=16,Y2=Am-12,G2=2,X2=8;function Q2(a){let s=0,c=0;for(const{descendants:r,graph:f}of a.values())if(f!==null&&(f.fromAbove||f.toBelow||f.forks.length>0||r>0))if(f.depth===0)s=Math.max(s,S1,br+Math.max(0,...f.forks)*vr+G2);else{const d=Math.max(f.lane,...f.forks,...f.through);c=Math.max(c,Y2,br+d*vr+X2)}return c>0&&(s=Math.max(s,S1)),{root:s,variant:c}}function V2({active:a,arriving:s=!1,bloom:c=0,delay:r=0,family:f=!1,folded:d=!1,fresh:p,lit:y,row:b,tint:x="#FB7185",width:S,working:M=!1}){const T=te=>br+te*vr,k=T(b.lane),N=v1+L2+_2,U=v1,$=te=>y?.has(te)??!1,O=$("mark"),V=b.fromAbove||b.toBelow||b.forks.length>0||f,X=a||b.forks.length>0||!b.fromAbove||!b.toBelow?b.depth===0?3.5:3:M?3:1.5,ae=a?X+5:0,P=[];for(const te of b.through)P.push({key:`t${te}`,lane:te,segment:`through:${te}`,kind:"line",x:T(te),y1:0,y2:"100%"});b.fromAbove&&P.push({key:"a",lane:b.lane,segment:"above",kind:"line",x:k,y1:0,y2:N-ae}),b.toBelow&&P.push({key:"b",lane:b.lane,segment:"below",kind:"line",x:k,y1:N+ae,y2:"100%"});for(const te of b.forks){const xe=Nm(k,N,T(te)),re=Mm(k,N,T(te),ae);re!==""&&P.push({key:`fc${te}`,lane:te,segment:`fork:${te}`,kind:"path",d:re}),P.push({key:`ft${te}`,lane:te,segment:`fork:${te}`,kind:"line",x:T(te),y1:xe,y2:"100%"})}const v=(te,xe)=>te.kind==="line"?u.jsx("line",{pathLength:1,x1:te.x,x2:te.x,y1:te.y1,y2:te.y2,...xe},te.key):u.jsx("path",{d:te.d,pathLength:1,...xe},te.key),ne=te=>({className:p?.has(te.segment)?"leglas-draw":void 0,style:{animationDelay:`${r}ms`,stroke:$(te.segment)?H2:te.lane>0?U2:B2,transition:`stroke ${sr}`}}),ce=s;return u.jsx("span",{"aria-hidden":!0,className:"pointer-events-none absolute inset-y-0 left-0",style:{width:S},children:u.jsxs("svg",{className:"absolute left-0 overflow-visible [shape-rendering:geometricPrecision]",fill:"none",strokeWidth:1.25,style:{height:`calc(100% + ${U*2}px)`,top:-U,width:S},children:[P.map(te=>v(te,ne(te))),V&&u.jsxs(u.Fragment,{children:[a&&u.jsx("circle",{cx:k,cy:N,fill:"none",r:X+2.5,stroke:w1,strokeWidth:1.25,style:{transition:`r ${sr}`}}),u.jsx("circle",{className:M?"leglas-breathe":p?.has("mark")?"leglas-pop":void 0,cx:k,cy:N,"data-mark":"",fill:M?x:a?w1:O?$2:b1,r:a?Math.max(2,X-1):X,stroke:"none",style:{animationDelay:`${r+120}ms`,transition:`fill ${sr}, r ${sr}`}}),d&&[8,14,20].map((te,xe)=>u.jsx("circle",{cx:k,cy:N+te,fill:b1,opacity:.6-xe*.18,r:1,stroke:"none"},te)),(ce||c>0)&&u.jsx("circle",{className:"leglas-bloom",cx:k,cy:N,fill:x,r:X,stroke:"none"},`bloom-${c}-${ce?"landed":""}`)]})]})})}const j1=200;function Z2({askedFor:a,chain:s,displayName:c,onCompare:r,onGo:f,onRail:d,onTrace:p,openAsk:y=!1,self:b,tint:x,traced:S=null}){const[M,T]=w.useState(!1),[k,N]=w.useState(!1),[U,$]=w.useState(!0),O=w.useRef(null);w.useEffect(()=>()=>{O.current&&clearTimeout(O.current)},[]);const V=()=>{const v=window.matchMedia("(prefers-reduced-motion: reduce)").matches;$(v),N(ne=>!ne),O.current&&clearTimeout(O.current),O.current=setTimeout(()=>$(!0),v?0:j1+20)},Q=M?{head:[...s],hidden:[],tail:[]}:A2(s),X=u.jsx("span",{"aria-hidden":!0,className:"select-none text-[#84848C]/50",children:"›"}),ae=v=>{const ne=c(v);return d(v)?u.jsx(Je,{label:u.jsxs(u.Fragment,{children:[u.jsxs("span",{className:"block",children:["Go to ",ne]}),u.jsx("span",{className:"block text-[#9CA3AF]",children:"Shift-click to compare"})]}),children:u.jsx("button",{className:`max-w-36 truncate rounded text-left transition-colors duration-150 hover:text-[#E8E8EA] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[#D1D5DB]/60 ${S===v?"text-[#E8E8EA]":""}`,onClick:ce=>ce.shiftKey?r(v):f(v),onPointerEnter:()=>p?.(v),onPointerLeave:()=>p?.(null),type:"button",children:ne})}):u.jsx("span",{className:"max-w-36 truncate text-[#84848C]/70",title:`${ne} is not on the rail`,children:ne})},P=a===null?null:`You asked for “${a}”`;return u.jsxs("div",{className:"px-3 pb-2",children:[u.jsxs("nav",{"aria-label":`Where ${c(b)} came from`,className:"flex flex-wrap items-center gap-x-1 gap-y-0.5 text-[10px] leading-snug text-[#84848C]",children:[Q.head.map(v=>u.jsxs(w.Fragment,{children:[ae(v),X]},v)),Q.hidden.length>0&&u.jsxs(u.Fragment,{children:[u.jsx(Je,{label:u.jsx(u.Fragment,{children:Q.hidden.map(v=>u.jsx("span",{className:"block",children:c(v)},v))}),wide:!0,children:u.jsx("button",{"aria-label":`Show the ${Q.hidden.length} directions between`,className:"rounded px-0.5 tracking-widest transition-colors hover:text-[#D1D5DB] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[#D1D5DB]/60",onClick:()=>T(!0),type:"button",children:"…"})}),X]}),Q.tail.map(v=>u.jsxs(w.Fragment,{children:[ae(v),X]},v)),u.jsxs("span",{className:`inline-flex max-w-36 items-center gap-1 truncate transition-colors duration-150 ${S===b?"text-[#E8E8EA]":"text-[#D1D5DB]"}`,children:[x!==void 0&&u.jsx("span",{"aria-hidden":!0,className:"inline-block size-[5px] shrink-0 rounded-full",style:{background:x}}),c(b)]})]}),P===null?null:y?u.jsx("button",{"aria-expanded":k,"aria-label":k?"Show less of the request":"Show the whole request",className:"mt-0.5 block w-full cursor-pointer overflow-hidden text-left text-[10px] leading-snug text-[#84848C] transition-[max-height,color] ease-out hover:text-[#A1A1AA] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[#D1D5DB]/60 motion-reduce:transition-none",onClick:V,style:{maxHeight:k?96:14,transitionDuration:`${j1}ms`},type:"button",children:u.jsx("span",{className:!k&&U?"line-clamp-1":"block",children:P})}):u.jsx("p",{className:"mt-0.5 min-w-0 truncate text-[10px] leading-snug text-[#84848C]",title:a??"",children:P})]})}const or=320,K2=22,So=240,F2=150,J2=2600,W2=5200,I2=2200,E1=900,C1=420,dr={current:["#FB7185","#FB923C","#F9A8D4","#E879F9","#FB7185"],bloom:"#FECDD3"},P2=typeof performance<"u"?performance.now():0;function ey(a){const s=(f,d,p)=>3*f*p*(1-p)**2+3*d*p**2*(1-p)+p**3;let c=0,r=1;for(let f=0;f<24;f+=1){const d=(c+r)/2;s(.5,.2,d)<a?c=d:r=d}return s(0,1,(c+r)/2)}function N1({d:a,height:s,leaving:c=!1,marks:r,still:f=!1,width:d}){const p=w.useId().replace(/\W/g,""),y=`current-${p}`,b=`surge-${p}`,x=w.useRef(null),S=w.useRef(null),M=w.useRef(null),T=w.useRef([]),k=w.useRef(r);return k.current=r,w.useEffect(()=>{if(f)return;const N=x.current,U=S.current,$=M.current;if(!N||!U||!$)return;const O=k.current,V=Math.min(...O.map(xe=>xe.y)),Q=Math.max(...O.map(xe=>xe.y)),X=V-So,ae=Q+So,P=Math.min(W2,Math.max(J2,(ae-X)/F2*1e3)),v=P+I2,ne=O.map(()=>-1/0);let ce=0;const te=xe=>{const re=Math.max(0,xe-P2),Ee=re/1e3*K2;N.setAttribute("y1",`${Ee%or}`),N.setAttribute("y2",`${Ee%or+or}`);const ye=re%v,De=ye<P,R=X+(ae-X)*(De?ey(ye/P):1);U.setAttribute("y1",`${R-So/2}`),U.setAttribute("y2",`${R+So/2}`);const W=Math.min(1,ye/500),oe=Math.min(1,Math.max(0,(P-ye)/700));$.setAttribute("opacity",`${De?Math.min(W,oe).toFixed(3):"0"}`);const Ce=re-ye;O.forEach((we,E)=>{const G=T.current[E];if(!G)return;De&&R>=we.y&&(ne[E]??-1/0)<Ce&&(ne[E]=re);const le=re-(ne[E]??-1/0),ue=le<E1?1-le/E1:0,se=ue*ue*(3-2*ue);G.setAttribute("opacity",`${(se*.75).toFixed(3)}`),G.setAttribute("r",`${(2.5+(1-se)*6).toFixed(2)}`)}),ce=requestAnimationFrame(te)};return ce=requestAnimationFrame(te),()=>cancelAnimationFrame(ce)},[a,f]),u.jsxs("svg",{"aria-hidden":!0,className:"pointer-events-none absolute left-0 top-0 z-20",fill:"none",height:s,style:{animation:c||f?void 0:`leglas-arrive ${C1}ms ease-out both`,opacity:c?0:void 0,transition:f?void 0:`opacity ${C1}ms ease-in`},width:d,children:[u.jsxs("defs",{children:[u.jsx("linearGradient",{gradientUnits:"userSpaceOnUse",id:y,ref:x,spreadMethod:"repeat",x1:0,x2:0,y1:0,y2:or,children:dr.current.map((N,U)=>u.jsx("stop",{offset:U/(dr.current.length-1),stopColor:N},U))}),u.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:b,ref:S,x1:0,x2:0,y1:-So,y2:0,children:[u.jsx("stop",{offset:"0",stopColor:"#FFFFFF",stopOpacity:0}),u.jsx("stop",{offset:"0.3",stopColor:"#F0F4FF",stopOpacity:.35}),u.jsx("stop",{offset:"0.5",stopColor:"#FFFFFF",stopOpacity:.95}),u.jsx("stop",{offset:"0.7",stopColor:"#F0F4FF",stopOpacity:.35}),u.jsx("stop",{offset:"1",stopColor:"#FFFFFF",stopOpacity:0})]})]}),u.jsxs("g",{stroke:`url(#${y})`,strokeLinecap:"round",strokeLinejoin:"round",children:[u.jsx("path",{d:a,opacity:.1,strokeWidth:7}),u.jsx("path",{d:a,opacity:.24,strokeWidth:3.5}),u.jsx("path",{d:a,opacity:.85,strokeWidth:1.75})]}),u.jsxs("g",{opacity:0,ref:M,stroke:`url(#${b})`,strokeLinecap:"round",strokeLinejoin:"round",children:[u.jsx("path",{d:a,opacity:.16,strokeWidth:9}),u.jsx("path",{d:a,opacity:.4,strokeWidth:4}),u.jsx("path",{d:a,opacity:.9,strokeWidth:1.75})]}),r.map((N,U)=>u.jsx("circle",{cx:N.x,cy:N.y,fill:dr.bloom,opacity:0,r:2.5,ref:$=>{T.current[U]=$}},`${N.x},${N.y}`))]})}const ty=3,Xe={action:6e3,plain:2600};function ny(a,s,c=ty){return[...a.filter(f=>f.kind!==s.kind),s].slice(-c)}function ly(a,s){return a.filter(c=>c.id!==s)}const M1=a=>a.trim().replace(/\s+/g," ").toLowerCase();function ay(a,s,c){const r=a.trim().replace(/\s+/g," "),f=c.get(s)??s;if(r===""||r===s)return f===s?{kind:"same"}:{kind:"reset",value:s};if(r===f)return{kind:"same"};for(const[d,p]of c)if(d!==s&&M1(p)===M1(r))return{kind:"taken",by:p};return{kind:"set",value:r}}function iy(a,s){try{return new URL(a,s).toString()}catch{return a}}function sy({displayName:a,preview:s,previewUrl:c,title:r}){const f=a===r?"":` (shown as ${JSON.stringify(a)})`,d=s?.note?` — ${s.note}`:"",p=s?.tags.length?` [${s.tags.join(", ")}]`:"",y=[`Leglas direction ${JSON.stringify(r)}${f}${d}${p}`];return s?.file?y.push(`Source: ${s.file}`):s?.branch?y.push(`Branch: ${s.branch}`):s&&y.push(`Route: ${s.url}`),y.push(`Preview: ${c}`),s?.basedOn&&y.push(`A variant of: ${s.basedOn}`),y.push("","Inspect this direction in full:",` npx leglas show ${JSON.stringify(r)} --json`),y.join(`
10
+ `)}function Dm(a){return a===void 0?"is not on the rail":a.branch!==void 0?"runs on its own port and can't be shared yet":null}function Tm(a,s,c){const r=new Set(s);return{order:[...s],renames:Object.fromEntries(Object.entries(a.renames).filter(([f])=>r.has(f))),collapsedFamilies:a.collapsedFamilies.filter(f=>r.has(f)),compare:c,viewport:a.viewport}}function A1(a,s,c="open",r=[]){const f=new Map(s.map(x=>[x.title,x])),d=new Set([...a.deleted,...a.hidden]),p=gm(a.order,s.map(x=>x.title)).filter(x=>!d.has(x)),y=[],b=[];for(const x of p)(Dm(f.get(x))===null?b:y).push(x);return{request:{scope:"rail",titles:b,layout:Tm(a,b,null),reach:c,routes:[...r]},leftOut:y}}function oy(a,s,c,r,f="open",d=[]){const p=new Map(s.map(S=>[S.title,S])),y=r===null||r===c?null:r,b=y===null?[c]:[c,y];if(c==="")return{request:null,reason:"Nothing is on stage yet"};for(const S of b){const M=Dm(p.get(S));if(M!==null)return{request:null,reason:`${a.renames[S]??S} ${M}`}}return{request:{scope:y===null?"direction":"compare",titles:b,layout:Tm(a,b,y),reach:f,routes:[...d]},reason:null}}function Rf(a,s){return a.length===s.length&&a.every((c,r)=>c===s[r])}function uy(a,s){if(a.scope!==s.scope||!Rf(a.titles,s.titles)||a.reach!==s.reach)return!1;const c=a.layout,r=s.layout,f=Object.entries(c.renames).toSorted(),d=Object.entries(r.renames).toSorted();return Rf(c.order,r.order)&&Rf([...c.collapsedFamilies].toSorted(),[...r.collapsedFamilies].toSorted())&&c.compare===r.compare&&c.viewport===r.viewport&&f.length===d.length&&f.every(([p,y],b)=>p===d[b]?.[0]&&y===d[b]?.[1])}function Hf(a){return JSON.stringify({collapsedFamilies:a.collapsedFamilies,order:a.order,renames:a.renames,viewport:a.viewport})}function ry(a,s,c){const r=pm(Hf(s),c);return{...a,collapsedFamilies:r.collapsedFamilies,order:r.order,renames:r.renames,viewport:r.viewport}}function km(a,s,c){return a==="rail"?`The whole rail · ${s.length} direction${s.length===1?"":"s"}`:s.map(c).join(" + ")}function zm(a){return a===0?"nobody on it yet":a===1?"1 watching":`${a} watching`}function cy(a,s,c){const r=new Set(s),f=new Set;for(const d of a){const p=d.dataset.preview;if(p===void 0||!r.has(p))continue;let y=[];try{y=d.contentWindow?.performance.getEntriesByType("resource")??[]}catch{continue}for(const b of y)try{const{origin:x,pathname:S}=new URL(b.name);if(x!==c)continue;f.add(S)}catch{}}return[...f].toSorted()}function fy(a){const s=a.lastIndexOf("/");return s<=0?null:a.slice(0,s+1)}function dy(a){return a.reduce((s,c)=>s+c.viewers,0)}function hy(a,s){const c=a-s;if(c<=0)return"expired";const r=Math.round(c/6e4);return r<60?`${Math.max(1,r)}m left`:`${Math.round(c/36e5)}h left`}function my(a,s){return a.trim()===""?`Link ${s+1}`:a}async function Ma(a,s){const c=await a.json().catch(()=>null),r=ri(c)?c.error:null;return new Error(Fn(r)?r:s)}function Xt(a){return a.json()}async function Kf(a,s,c){const r=await fetch(a,{body:JSON.stringify(s),headers:{"content-type":"application/json"},method:"POST"});if(!r.ok)throw await Ma(r,c);return Xt(r)}function py({previews:a,project:s,onToggleSplit:c,onToggleHelp:r,onToggleTools:f,onToggleNote:d,suspended:p=!1,viewer:y}){const b=Wg(s),x=()=>pm(y!==void 0?Hf(y.layout):typeof window>"u"?null:window.localStorage.getItem(b),a),[S,M]=w.useState(x),T=new Map(a.map(F=>[F.title,F])),k=()=>{const F=x();return F.order.find(fe=>!F.hidden.includes(fe))??F.order[0]??""},[N,U]=w.useState(k),$=typeof window<"u"&&window.self!==window.top,[O,V]=w.useState(()=>[k()]),[Q,X]=w.useState(""),[ae,P]=w.useState([]),v=F=>{P(fe=>fe.length?[]:fe),X(F)},[ne,ce]=w.useState(!1),[te,xe]=w.useState(()=>new Set),[re,Ee]=w.useState(null),[ye,De]=w.useState(null),[R,W]=w.useState(null),[oe,Ce]=w.useState(!1),[we,E]=w.useState({}),[G,le]=w.useState([]),[ue,se]=w.useState(null),Se=w.useRef(1),L=w.useRef(null),Z=w.useRef(0),ie=F=>{Z.current+=1,le(fe=>ny(fe,{...F,id:Z.current}))},pe=F=>le(fe=>ly(fe,F)),Me=F=>{U(F),V(fe=>fe.includes(F)?fe:[...fe,F])};w.useEffect(()=>{y===void 0&&window.localStorage.setItem(b,JSON.stringify(S))},[S,b,y]);const Ve=y===void 0?null:Hf(y.layout),[st,ot]=w.useState(Ve);Ve!==st&&(ot(Ve),y!==void 0&&M(F=>ry(F,y.layout,a))),w.useEffect(()=>()=>{L.current&&clearTimeout(L.current)},[]);const ke=F=>S.renames[F]??F,Pe=F=>T.get(F)?.url??"/",kt=F=>{const fe=T.get(F);return fe?.branch===void 0?null:fe.state??{status:"idle"}},_t=F=>{y===void 0&&fetch("/leglas/api/previews/start",{body:JSON.stringify({title:F}),headers:{"content-type":"application/json"},method:"POST"}).catch(()=>{})},en=F=>{if(!Q.trim())return!0;const fe=Q.toLowerCase(),Re=T.get(F);return ke(F).toLowerCase().includes(fe)||F.toLowerCase().includes(fe)||(Re?.note??"").toLowerCase().includes(fe)||(Re?.tags??[]).some(_e=>_e.toLowerCase().includes(fe))},Jn=a.map(F=>F.title).filter(F=>!S.deleted.includes(F)),Cn=gm(S.order,Jn),mi=Q.trim()!=="",Ln=mi?ae:S.collapsedFamilies,mt=new Map(a.flatMap(F=>F.basedOn===void 0?[]:[[F.title,F.basedOn]])),_n=Cn.filter(F=>!S.hidden.includes(F)&&en(F)),{rows:Gl,meta:Wn,parents:ft,children:Xl,roots:Aa}=x1(_n,mt,new Set([...Ln,...te])),pi=Q2(x1(_n,mt,new Set).meta),fs=(F,fe,Re)=>M(_e=>({..._e,order:S2(_e.order,a.map(ve=>ve.title),F,fe,Re)})),dl=F=>M2(F,mt),Bt=N2(Wn),Qt=(F,fe)=>F.includes(fe)?F.filter(Re=>Re!==fe):[...F,fe],zt=F=>mi?P(fe=>Qt(fe,F)):M(fe=>({...fe,collapsedFamilies:Qt(fe.collapsedFamilies,F)})),gi=F=>T.get(F)?.basedOn??null,xi=Cn.filter(F=>!S.hidden.includes(F)).length,Da=(F,fe=!1)=>{M(Re=>({...Re,hidden:Re.hidden.filter(_e=>_e!==F)})),fe&&Me(F)},hl=F=>{const fe=ke(F),Re=N===F;if(M(_e=>({..._e,hidden:[..._e.hidden,F]})),Re){const _e=Cn.find(ve=>ve!==F&&!S.hidden.includes(ve));_e&&Me(_e)}ie({action:{label:"Undo",run:()=>Da(F,Re)},kind:`remove:${F}`,message:`${fe} removed from the list`,tone:"info",ttl:Xe.action})},Ql=async F=>{const fe=[...new Set(F)].filter(ve=>S.hidden.includes(ve)),Re=fe.filter(ve=>T.get(ve)?.local===!0);if(Re.length>0){const ve=await fetch("/leglas/api/previews/delete",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({titles:Re})});if(!ve.ok)throw await Ma(ve,"The directions could not be deleted from Leglas.")}const _e=new Set(fe);if(M(ve=>Ig(ve,fe)),V(ve=>ve.filter(et=>!_e.has(et))),fe.includes(N)){const ve=Cn.find(et=>!_e.has(et)&&!S.hidden.includes(et));U(ve??"")}S.hidden.every(ve=>_e.has(ve))&&ce(!1)},Bn=(F,fe)=>M(Re=>{const _e={...Re.renames};return fe===void 0?delete _e[F]:_e[F]=fe,y!==void 0?{...Re,renames:_e}:(fetch("/leglas/api/renames",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({renames:_e})}).catch(()=>{}),{...Re,renames:_e})}),Ut=F=>{Ee(F),De(null)},pn=(F,fe,Re="submit")=>{const _e=new Map(Jn.map(Qe=>[Qe,ke(Qe)])),ve=ay(fe,F,_e);if(ve.kind==="taken"){if(Re==="submit"){De(`${ve.by} already goes by that name.`);return}Ut(null),ie({kind:`rename:${F}`,message:`Still called ${ke(F)}. ${ve.by} already goes by that name.`,tone:"info",ttl:Xe.plain});return}if(Ut(null),ve.kind==="same")return;const et=S.renames[F];Bn(F,ve.kind==="reset"?void 0:ve.value),ie({action:{label:"Undo",run:()=>Bn(F,et)},kind:`rename:${F}`,message:ve.kind==="reset"?`Name reset to ${ve.value}`:`Renamed to ${ve.value}`,tone:"success",ttl:Xe.action})};w.useEffect(()=>{const F=Gl,fe=ve=>{const et=ve.target,Qe=et?.tagName?.toLowerCase(),Be=Nx({key:ve.key,altKey:ve.altKey,ctrlKey:ve.ctrlKey,metaKey:ve.metaKey,shiftKey:ve.shiftKey,typing:Qe==="input"||Qe==="textarea"||Qe==="select"||(et?.isContentEditable??!1)});if(Be&&!(p&&Be.kind!=="help")&&!(y!==void 0&&(Be.kind==="request"||Be.kind==="note"))){if(Be.kind==="search"||Be.kind==="request")ve.preventDefault(),M(ut=>ut.collapsed?{...ut,collapsed:!1}:ut),se({target:Be.kind,nonce:Se.current++});else if(Be.kind==="split")ve.preventDefault(),c?.();else if(Be.kind==="help")ve.preventDefault(),r?.();else if(Be.kind==="tools")ve.preventDefault(),f?.();else if(Be.kind==="note")ve.preventDefault(),d?.();else if(Be.kind==="rail")M(ut=>({...ut,collapsed:!ut.collapsed}));else if(Be.kind==="jump"){const ut=F[Be.index];ut&&(ve.preventDefault(),Me(ut))}else if(Be.kind==="move"){ve.preventDefault();const ut=F.indexOf(N),pl=Be.delta===1?F[Math.min(F.length-1,ut+1)]:F[Math.max(0,ut-1)];pl&&Me(pl)}}},Re=[window];for(const ve of Array.from(document.querySelectorAll("iframe")))try{const et=ve.contentDocument;et&&Re.push(et)}catch{}const _e=fe;for(const ve of Re)ve.addEventListener("keydown",_e);return()=>{for(const ve of Re)ve.removeEventListener("keydown",_e)}},[N,Gl.join("|"),c,r,f,d,p,O.join("|"),Object.entries(we).filter(([,F])=>F).map(([F])=>F).join("|")]);const Vt=(F,fe)=>{const Re=iy(Pe(F),window.location.origin),_e=fe==="link"?Re:sy({displayName:ke(F),preview:T.get(F),previewUrl:Re,title:F});wr(_e).then(ve=>{if(ve==="blocked"){W(null),ie({detail:Re,kind:"copy",message:"Your browser blocked the clipboard. The direction is at:",tone:"danger",ttl:null});return}W({kind:fe,title:F}),L.current&&clearTimeout(L.current),L.current=setTimeout(()=>W(null),1200),ie({kind:"copy",message:fe==="link"?`Link to ${ke(F)} copied`:`Reference to ${ke(F)} copied`,tone:"success",ttl:Xe.plain})})},ds=F=>Vt(F,"link"),ml=F=>Vt(F,"reference"),sn=F=>{F.preventDefault();const fe=F.currentTarget;fe.setPointerCapture(F.pointerId);const Re=F.clientX,_e=S.width;Ce(!0);const ve=Qe=>{const Be=Math.min(dm,Math.max(fm,_e+Qe.clientX-Re));M(ut=>ut.width===Be?ut:{...ut,width:Be})},et=Qe=>{fe.releasePointerCapture(Qe.pointerId),fe.removeEventListener("pointermove",ve),fe.removeEventListener("pointerup",et),fe.removeEventListener("pointercancel",et),Ce(!1)};fe.addEventListener("pointermove",ve),fe.addEventListener("pointerup",et),fe.addEventListener("pointercancel",et)},Ie=(F,fe)=>E(Re=>Tx(Re,F,fe)),Vl=(F,fe)=>Dx(we,F,fe),In=F=>E(fe=>kx(fe,F)),Zl=$?[N]:Jn.filter(F=>O.includes(F));return{active:N,ancestryOf:dl,copied:R,copyLink:ds,copyReference:ml,deleteRemoved:Ql,displayName:ke,dismissToast:pe,dragFolded:te,focusing:ue,hiddenCount:S.hidden.length,hide:hl,isLoaded:Vl,lanes:Bt,insets:pi,loaded:we,markLoaded:Ie,matches:en,nested:$,notify:ie,onHandlePointerDown:sn,panes:Zl,prefs:S,railChildren:Xl,railParents:ft,railRoots:Aa,reorderAmong:fs,previewFor:F=>T.get(F),query:Q,rename:pn,renameError:ye,renaming:re,parentOf:gi,resetLoaded:In,resizing:oe,restore:Da,rowMeta:Wn,rows:Gl,toggleFamily:zt,setActive:Me,setDragFolded:xe,setPrefs:M,setQuery:v,setShowHidden:ce,showHidden:ne,startRename:Ut,toasts:G,urlFor:Pe,branchState:kt,startBranch:_t,visibleCount:xi,viewports:mm,viewing:y!==void 0}}function D1(a){const s=a?.trim()??"";return s===""?null:s}function $f(a){const s=D1(a?.basedOn),c=D1(a?.askedFor);return s===null&&c===null?null:{basedOn:s,askedFor:c}}function gy(a,s){const c=a===null?null:`Variant of ${a}`,r=s===null?null:`asked for “${s}”`;return c===null?r===null?null:`You ${r}`:r===null?c:`${c} · you ${r}`}const T1=80,xy=6,yy=8;function vy(a){if(a==null)return null;const s=a.trim();return/^[A-Za-z][\w-]*$/.test(s)?s:null}function by(a){return Fn(a)?a.trim().split(/\s+/).filter(Boolean).slice(0,xy):[]}function hr(a){const s=(a??"").replace(/\s+/g," ").trim();return s.length>T1?`${s.slice(0,T1-1)}…`:s}function wy(a){const s=[];let c=a;for(;c!==null&&s.length<yy;){const r=c.tagName.toLowerCase();if(r==="body"||r==="html")break;const f=vy(c.id);if(f!==null)return s.unshift(`#${f}`),s.join(" > ");const d=c.parentElement;if(d===null){s.unshift(r);break}let p=1;for(let y=0;y<d.children.length;y+=1){const b=d.children[y];if(b===c)break;b?.tagName===c.tagName&&(p+=1)}s.unshift(`${r}:nth-of-type(${p})`),c=d}return s.join(" > ")}function k1(a,s){return!Number.isFinite(a)||!Number.isFinite(s)||s<=0?.5:Math.round(Math.min(1,Math.max(0,a/s))*1e3)/1e3}function z1(a,s,c,r){return{classes:by(a.className),rect:{height:Math.round(s.height),width:Math.round(s.width),x:Math.round(s.x),y:Math.round(s.y)},selector:wy(a),spot:{x:r===void 0?.5:k1(r.x-s.x,s.width),y:r===void 0?.5:k1(r.y-s.y,s.height)},tag:a.tagName.toLowerCase(),text:hr(a.textContent),viewport:Math.round(c)}}const R1=6;function O1(a,s){return Math.abs(s.x-a.x)>=R1||Math.abs(s.y-a.y)>=R1}function L1(a,s){return{height:Math.abs(s.y-a.y),width:Math.abs(s.x-a.x),x:Math.min(a.x,s.x),y:Math.min(a.y,s.y)}}function Sy(a,s){return a.x<s.x+s.width&&a.x+a.width>s.x&&a.y<s.y+s.height&&a.y+a.height>s.y}function _1(a,s){return s.x>=a.x&&s.y>=a.y&&s.x+s.width<=a.x+a.width&&s.y+s.height<=a.y+a.height}function jy(a,s){const c=a.width>0?a.width:1,r=a.height>0?a.height:1,f=d=>Math.round(Math.min(1,Math.max(0,d))*1e3)/1e3;return{height:f(s.height/r),width:f(s.width/c),x:f((s.x-a.x)/c),y:f((s.y-a.y)/r)}}function Ey(a,s){return{height:s.height*a.height,width:s.width*a.width,x:a.x+s.x*a.width,y:a.y+s.y*a.height}}function Cy(a){const s=a.gap??8,{anchor:c,bounds:r,card:f}=a,d=c.y+c.height+s,p=c.y-s-f.height,y=d+f.height>r.height&&p>=0,b=y?p:d;let x=c.x;return x+f.width>r.width&&(x=r.width-f.width),{flipped:y,left:Math.max(0,x),top:Math.max(0,Math.min(b,Math.max(0,r.height-f.height)))}}function Ny(a){return!Number.isFinite(a)||a<=0?256:Math.round(Math.min(256,Math.max(180,a-48)))}function My(a){if(a.length===0)return null;const s=Math.min(...a.map(d=>d.x)),c=Math.min(...a.map(d=>d.y)),r=Math.max(...a.map(d=>d.x+d.width));return{height:Math.max(...a.map(d=>d.y+d.height))-c,width:r-s,x:s,y:c}}const Ay=8;function Dy(a){const s=new Set,c=[];for(const r of a){const f=`${r.tag}:${r.text}`;if(!s.has(f)&&(s.add(f),c.push(r),c.length===Ay))break}return c}const ur=2,Ty=4e3,B1=600,U1=80;function ky(a){const s=a.note.length>U1?`${a.note.slice(0,U1-1)}…`:a.note;return[`Annotation ${a.number}`,s===""?null:`: ${s}`,a.sent?". Sent with a change.":null,a.stale?". Its element has gone.":null].filter(c=>c!==null).join("")}function zy(a){const s=[a.stale?"This element has moved or gone since the annotation was left.":null,a.sent?"Already sent with a change that has not landed yet.":null].filter(c=>c!==null);return s.length===0?void 0:s.join(" ")}function Ca(a){return"left"in a?{height:a.height,width:a.width,x:a.left,y:a.top}:a}function Ry(a,s){return s.x>=a.x&&s.y>=a.y&&s.x<=a.x+a.width&&s.y<=a.y+a.height}function Oy({notes:a,onExit:s,onForget:c,onKeep:r,onRevise:f,paneScale:d,scaling:p,sent:y,title:b}){const x=w.useRef(null),S=w.useRef(null),M=w.useRef(null),T=w.useRef(null),[k,N]=w.useState(null),[U,$]=w.useState(null),[O,V]=w.useState(null),Q=w.useRef(0),[X,ae]=w.useState(null),[P,v]=w.useState(null),[ne,ce]=w.useState([]),[te,xe]=w.useState({height:92,width:256}),re=w.useCallback(()=>{const L=document.querySelector(`iframe[data-preview="${CSS.escape(b)}"]`);if(L===null)return null;let Z=null;try{Z=L.contentDocument}catch{return null}const ie=Z?.defaultView??null;if(Z===null||ie===null)return null;const pe=L.getBoundingClientRect();return{doc:Z,rect:pe,scale:ie.innerWidth>0?pe.width/ie.innerWidth:1,view:ie}},[b]),Ee=w.useCallback((L,Z)=>{const ie=re();return ie===null?null:{x:(L-ie.rect.left)/ie.scale,y:(Z-ie.rect.top)/ie.scale}},[re]),ye=w.useCallback((L,Z)=>{const ie=L.doc.elementFromPoint(Z.x,Z.y);if(ie===null)return null;const pe=new Set;let Me=ie,Ve=0;for(let ke=0;Me!==null&&ke<3&&Ve<B1;ke+=1){pe.add(Me);const Pe=L.doc.createTreeWalker(Me,NodeFilter.SHOW_ELEMENT);let kt=Pe.nextNode();for(;kt!==null&&Ve<B1;){const _t=kt;pe.has(_t)||(pe.add(_t),Ve+=1),kt=Pe.nextNode()}Me=Me.parentElement}const st=ke=>{const Pe=ke.tagName.toLowerCase();return(hr(ke.textContent)===""?0:4)+(Pe==="a"||Pe==="button"||Pe==="img"?3:0)+(/^h[1-6]$/.test(Pe)||Pe==="p"||Pe==="li"?2:0)},ot=[...pe].flatMap(ke=>{const Pe=ke.tagName.toLowerCase();if(ke===L.doc.body||ke===L.doc.documentElement||Pe==="head"||Pe==="script"||Pe==="style")return[];const kt=Ca(ke.getBoundingClientRect());if(kt.width<=0||kt.height<=0||!Ry(kt,Z))return[];const _t=L.view.getComputedStyle(ke);return _t.display==="none"||_t.visibility==="hidden"?[]:[{box:kt,element:ke,weight:st(ke)}]});return ot.length===0?null:(ot.sort((ke,Pe)=>{const kt=ke.element.contains(Pe.element),_t=Pe.element.contains(ke.element);if(kt!==_t)return kt?1:-1;const en=Pe.weight-ke.weight;return en!==0?en:ke.box.width*ke.box.height-Pe.box.width*Pe.box.height}),ot[0]??null)},[]),De=w.useCallback((L,Z)=>{let ie=null;try{ie=L.doc.querySelector(Z.selector)}catch{}const pe=Ca(ie===null?Z.rect:ie.getBoundingClientRect()),Me=Z.spot??{x:.5,y:.5},Ve=Z.region?Ey(pe,Z.region):null;return{about:Ve??pe,box:Ve??{height:0,width:0,x:pe.x+Me.x*pe.width,y:pe.y+Me.y*pe.height},stale:ie===null}},[]),R=w.useCallback(()=>{const L=re();return L===null?[]:a.map((Z,ie)=>{const pe=De(L,Z.anchor);return{anchor:Z.anchor,box:pe.box,id:Z.id,note:Z.note,number:ie+1,region:Z.anchor.region?pe.about:null,sent:y.has(Z.id),stale:pe.stale}})},[De,re,a,y]),W=w.useCallback(()=>ce(R()),[R]),oe=w.useCallback(()=>{const L=M.current,Z=re();L===null||Z===null||O!==null||N(ye(Z,L)?.box??null)},[ye,re,O]);w.useEffect(()=>{W();const L=re(),Z=()=>{W(),oe()};return L?.view.addEventListener("scroll",Z,{passive:!0}),L?.view.addEventListener("resize",Z),window.addEventListener("resize",Z),()=>{L?.view.removeEventListener("scroll",Z),L?.view.removeEventListener("resize",Z),window.removeEventListener("resize",Z)}},[re,W,oe]),w.useEffect(()=>{const L=x.current;if(L===null)return;const Z=ie=>{const pe=re();pe!==null&&(ie.preventDefault(),pe.view.scrollBy({behavior:"auto",left:ie.deltaX,top:ie.deltaY}))};return L.addEventListener("wheel",Z,{passive:!1}),()=>L.removeEventListener("wheel",Z)},[re]),w.useEffect(()=>{const L=Me=>{if(Me.key==="Escape"){if(O!==null){V(null);return}s()}},Z=[window],ie=re();ie!==null&&Z.push(ie.doc);const pe=L;for(const Me of Z)Me.addEventListener("keydown",pe);return()=>{for(const Me of Z)Me.removeEventListener("keydown",pe)}},[re,s,O]),w.useEffect(()=>{O===null||O.kind!=="kept"||a.some(L=>L.id===O.id)||V({anchor:O.anchor,answered:!0,field:O.field,kind:"new",note:O.note})},[a,O]),w.useEffect(()=>{const L=S.current;if(O===null||L===null)return;const Z=L.offsetHeight,ie=L.offsetWidth;xe(pe=>pe.height===Z&&pe.width===ie?pe:{height:Z,width:ie})},[O]);const Ce=(L,Z)=>{const ie=[...L.doc.body.querySelectorAll("*")].slice(0,Ty),pe=ie.filter(st=>{const ot=Ca(st.getBoundingClientRect());return ot.width>0&&ot.height>0&&Sy(Z,ot)}),Me=pe.filter(st=>!pe.some(ot=>ot!==st&&st.contains(ot))&&!_1(Ca(st.getBoundingClientRect()),Z)&&(hr(st.textContent)!==""||["a","button","canvas","img","input","svg","video"].includes(st.tagName.toLowerCase())));let Ve=L.doc.body;for(const st of ie){const ot=Ca(st.getBoundingClientRect());_1(ot,Z)&&Ve.contains(st)&&(Ve=st)}return{bounds:My(Me.map(st=>Ca(st.getBoundingClientRect())))??Z,covers:Dy(Me.map(st=>({tag:st.tagName.toLowerCase(),text:hr(st.textContent)}))),holder:Ve}},we=(L,Z)=>{const ie=re();if(ie===null)return;if(Z!==null&&O1(Z,L)){const Me=L1(Z,L),{bounds:Ve,covers:st,holder:ot}=Ce(ie,Me),ke=Ca(ot.getBoundingClientRect());V({anchor:{...z1(ot,ke,ie.view.innerWidth,{x:Ve.x+Ve.width/2,y:Ve.y+Ve.height/2}),covers:st,region:jy(ke,Ve)},field:String(Q.current+=1),kind:"new",note:""}),v(null);return}const pe=ye(ie,L);pe!==null&&(V({anchor:z1(pe.element,pe.box,ie.view.innerWidth,L),field:String(Q.current+=1),kind:"new",note:""}),v(null))},E=p&&d>0?1/d:1,G=re(),le={height:G?.view.innerHeight??0,width:G?.view.innerWidth??0},ue=Ny(le.width),se=O===null||G===null?null:De(G,O.anchor),Se=se===null?null:Cy({anchor:se.about,bounds:le,card:{height:te.height*E,width:ue*E}});return u.jsxs("div",{className:`absolute inset-0 z-20 ${O===null?"cursor-crosshair":"cursor-default"}`,onPointerDown:L=>{if(O!==null)return;const Z=Ee(L.clientX,L.clientY),ie=re();if(!(Z===null||ie===null)){try{L.currentTarget.setPointerCapture(L.pointerId)}catch{}T.current={from:Z,scroll:{x:ie.view.scrollX,y:ie.view.scrollY}}}},onPointerLeave:()=>{M.current=null,T.current===null&&N(null)},onPointerMove:L=>{if(O!==null)return;const Z=Ee(L.clientX,L.clientY),ie=re();if(Z===null||ie===null)return;M.current=Z;const pe=T.current;if(pe!==null){const Me={x:pe.from.x+pe.scroll.x-ie.view.scrollX,y:pe.from.y+pe.scroll.y-ie.view.scrollY};$(O1(Me,Z)?L1(Me,Z):null),N(null);return}N(ye(ie,Z)?.box??null)},onPointerUp:L=>{const Z=T.current;if(T.current=null,$(null),O!==null)return;const ie=Ee(L.clientX,L.clientY),pe=re();if(ie===null||pe===null)return;const Me=Z===null?null:{x:Z.from.x+Z.scroll.x-pe.view.scrollX,y:Z.from.y+Z.scroll.y-pe.view.scrollY};N(null),we(ie,Me)},ref:x,children:[k!==null&&O===null&&U===null?u.jsx("div",{className:"pointer-events-none absolute bg-[#7C9CFF]/10 outline outline-2 outline-[#7C9CFF]",style:{height:k.height,left:k.x,top:k.y,width:k.width}}):null,U!==null?u.jsx("div",{className:"pointer-events-none absolute rounded-sm border-2 border-dashed border-[#7C9CFF] bg-[#7C9CFF]/10",style:{height:U.height,left:U.x,top:U.y,width:U.width}}):null,ne.map(L=>u.jsxs("div",{children:[L.region===null?null:u.jsx("div",{className:`pointer-events-none absolute rounded-sm border-2 border-dashed ${L.stale?"border-amber-500/70 bg-amber-500/5":"border-[#7C9CFF]/70 bg-[#7C9CFF]/5"}`,style:{height:L.region.height+ur*2,left:L.region.x-ur,top:L.region.y-ur,width:L.region.width+ur*2}}),u.jsxs("button",{"aria-label":ky(L),className:"group/pin absolute size-5 cursor-pointer",onClick:Z=>{Z.stopPropagation(),V({anchor:L.anchor,field:String(Q.current+=1),id:L.id,kind:"kept",note:L.note}),v(null)},onPointerDown:Z=>Z.stopPropagation(),onPointerMove:Z=>Z.stopPropagation(),onPointerUp:Z=>Z.stopPropagation(),style:{left:L.box.x,top:L.box.y,transform:`translate(-50%, -50%) scale(${E})`,transformOrigin:"center"},type:"button",children:[u.jsx("span",{"aria-hidden":!0,className:"absolute -inset-1.5"}),u.jsx("span",{className:`flex size-5 shrink-0 items-center justify-center rounded-full text-[10px] font-semibold text-white shadow-lg outline-offset-2 group-focus-visible/pin:outline group-focus-visible/pin:outline-2 group-focus-visible/pin:outline-white ${L.stale?"bg-amber-500":"bg-[#7C9CFF]"} ${L.sent?"ring-2 ring-white/80":""}`,title:zy(L),children:L.number}),u.jsx("span",{className:"pointer-events-none absolute left-full top-1/2 ml-1 w-max max-w-56 -translate-y-1/2 truncate rounded-md border border-white/10 bg-[#171717] px-1.5 py-1 text-left text-[11px] leading-snug text-white opacity-0 shadow-lg transition-opacity group-focus-visible/pin:opacity-100 group-hover/pin:opacity-100",children:L.note||"No words"})]})]},L.id)),O!==null&&se!==null&&Se!==null?u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"pointer-events-none absolute bg-[#7C9CFF]/10 outline outline-2 outline-[#7C9CFF]",style:{height:se.about.height,left:se.about.x,top:se.about.y,width:se.about.width}}),u.jsxs("form",{className:"absolute z-30 rounded-lg border border-[#232328] bg-[#1E1E22] p-1.5 shadow-2xl",onClick:L=>L.stopPropagation(),onPointerDown:L=>L.stopPropagation(),onSubmit:L=>{L.preventDefault();const Z=O.field;if(X===Z)return;const ie=L.currentTarget.elements.namedItem("note"),pe=ie instanceof HTMLInputElement?ie.value.trim():"";ae(Z),v(Me=>Me===Z?null:Me),(O.kind==="new"?r(O.anchor,pe):f(O.id,pe)).then(Me=>{ae(Ve=>Ve===Z?null:Ve),Me?V(Ve=>Ve?.field===Z?null:Ve):v(Z)}).catch(()=>{ae(Me=>Me===Z?null:Me),v(Z)})},ref:S,style:{left:Se.left,top:Se.top,transform:`scale(${E})`,transformOrigin:Se.flipped?"bottom left":"top left",width:ue},children:[u.jsx("input",{autoFocus:!0,className:"w-full rounded border border-[#232328] bg-[#2E2E2E]/40 px-2 py-1 text-xs text-white placeholder:text-[#84848C] focus:border-[#D1D5DB]/40 focus:outline-none",defaultValue:O.note,onInput:P===O.field?()=>v(null):void 0,name:"note",placeholder:O.kind==="kept"?"What is wrong with it?":O.anchor.region?"What is wrong with this area?":`What is wrong with this ${O.anchor.tag}?`},O.field),O.kind==="kept"?u.jsxs(u.Fragment,{children:[y.has(O.id)?u.jsx("p",{className:"px-1 pt-1 text-[10px] leading-snug text-[#B7A57A]",children:"Already sent. New words go with the next change."}):null,se.stale?u.jsx("p",{className:"px-1 pt-1 text-[10px] leading-snug text-amber-500/90",children:"Its element has gone. The outline is where it was."}):null,P===O.field?u.jsx("p",{className:"px-1 pt-1 text-[10px] leading-snug text-[#F87171]",children:"Those words were not saved. Enter tries again."}):null,u.jsxs("div",{className:"flex items-center justify-between gap-3 px-1 pt-1 text-[10px] leading-snug text-[#84848C]",children:[u.jsx("button",{className:"rounded transition-colors hover:text-[#F87171]",onClick:()=>{c(O.id),V(null)},type:"button",children:"Forget it"}),u.jsx("span",{children:"Enter saves · Esc drops"})]})]}):u.jsxs(u.Fragment,{children:[O.answered?u.jsx("p",{className:"px-1 pt-1 text-[10px] leading-snug text-[#B7A57A]",children:"That change has landed. Enter leaves these words as a new note."}):null,P===O.field?u.jsx("p",{className:"px-1 pt-1 text-[10px] leading-snug text-[#F87171]",children:"Those words were not saved. Enter tries again."}):null,u.jsx("p",{className:"px-1 pt-1 text-[10px] leading-snug text-[#84848C]",children:O.anchor.covers&&O.anchor.covers.length>0?`${O.anchor.covers.length} ${O.anchor.covers.length===1?"element":"elements"} · Enter keeps it · Esc drops it`:"Enter keeps it · Esc drops it"})]})]})]}):null]})}const Rm=["image/png","image/jpeg","image/webp","image/gif"],Ff=4,Ly=1e7;function _y(a){return Rm.includes(a.type)}function By(a,s){const c=[],r=[];let f=Math.max(0,Ff-a.length);for(const d of s){if(!_y(d)){r.push({file:d,why:"not-an-image"});continue}if(d.size>Ly){r.push({file:d,why:"too-big"});continue}if(f===0){r.push({file:d,why:"too-many"});continue}f-=1,c.push(d)}return{accepted:c,refused:r}}function Uy(a){const s=a[0];if(s===void 0)return null;const c=a.length>1;switch(s.why){case"too-many":return`Up to ${Ff} images can ride with a change. ${c?`${a.length} were`:"One was"} left off.`;case"too-big":return`${c?"Some images are":"That image is"} over 10MB, which is more than an agent needs. Left off.`;case"not-an-image":return c?"Only PNG, JPEG, WebP and GIF images can be attached.":`${Jf(s.file.name)} is not an image Leglas can attach. PNG, JPEG, WebP or GIF.`}}function Jf(a){const s=a.replace(/\s+/g," ").trim();return s===""?"image":s}function Hy(a){const s=Jf(a).replace(/[^\x20-\x7E]/g,"").trim();return(s===""?"image":s).slice(0,80)}function $y(a){if(a<1024)return`${a} B`;const s=a/1024;if(s<1024)return`${Math.round(s)} KB`;const c=s/1024;return`${c<10?c.toFixed(1):Math.round(c)} MB`}function qy(a){return a.flatMap(s=>s.status==="ready"&&s.id!==null?[s.id]:[])}function Yy(a){return a.some(s=>s.status==="failed")?"failed":a.some(s=>s.status==="uploading")?"uploading":null}function rr(a){return a===void 0?!1:Array.from(a).includes("Files")}function Gy({drafts:a,onRemove:s,onRetry:c}){return a.length===0?null:u.jsx("ul",{"aria-label":"Images attached to this change",className:"flex flex-wrap gap-1.5 px-2 pt-2",children:a.map(r=>{const f=r.status==="failed";return u.jsxs("li",{className:"leglas-reference group/reference relative",children:[u.jsx(Je,{label:f?u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"block",children:"Did not upload"}),u.jsx("span",{className:"block text-[#9CA3AF]",children:"Click to try again"})]}):`${r.name} · ${$y(r.bytes)}`,children:f?u.jsx("button",{"aria-label":`${r.name} did not upload. Try again`,className:"block rounded transition-transform duration-150 focus-visible:outline-2 focus-visible:outline-offset-2 active:scale-[0.96] motion-reduce:transition-none",onClick:()=>c(r.key),type:"button",children:u.jsx(H1,{draft:r,failed:!0})}):u.jsx(H1,{draft:r,failed:!1})}),r.status==="uploading"?u.jsx("span",{"aria-label":"Uploading",className:"absolute bottom-1 right-1 size-3 animate-spin rounded-full border-[1.5px] border-white/30 border-t-white motion-reduce:animate-none",role:"status"}):f?u.jsx("span",{"aria-hidden":"true",className:"absolute bottom-1 right-1 flex size-3 items-center justify-center rounded-full bg-amber-400 text-[9px] font-semibold leading-none text-[#1C1C20]",children:"!"}):null,u.jsx("button",{"aria-label":`Remove ${r.name}`,className:"absolute -right-1.5 -top-1.5 flex size-4 items-center justify-center rounded-full bg-[#1E1E22] text-[#D1D5DB] opacity-0 shadow-[0_0_0_1px_rgba(255,255,255,0.12)] transition-[opacity,color,transform] duration-150 hover:text-white focus-visible:opacity-100 active:scale-[0.96] group-hover/reference:opacity-100 motion-reduce:transition-none",onClick:()=>s(r.key),type:"button",children:u.jsx("svg",{"aria-hidden":!0,fill:"none",height:"8",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.75",viewBox:"0 0 16 16",width:"8",children:u.jsx("path",{d:"m4 4 8 8M12 4l-8 8"})})})]},r.key)})})}function H1({draft:a,failed:s}){return u.jsx("img",{alt:a.name,className:`block h-10 w-auto min-w-10 max-w-28 rounded object-cover ${s?"opacity-70 shadow-[0_0_0_1px_rgba(251,191,36,0.8)]":"shadow-[0_0_0_1px_rgba(255,255,255,0.1)]"}`,draggable:!1,src:a.url})}const Xy=(a,s)=>fetch(a,s);async function Qy(a,s=Xy){const c=await s("/leglas/api/references",{body:a,headers:{"content-type":a.type,"x-leglas-filename":Hy(a.name??"")},method:"POST"});if(!c.ok)throw new Error("Leglas refused the image.");const r=await Xt(c),f=r.reference?.id,d=r.reference?.file;if(r.ok!==!0||!Fn(f)||!Fn(d))throw new Error("Leglas refused the image.");return{id:f,file:d}}const Sr=(a,s)=>fetch(a,s);async function Vy(a=Sr){const s=await a("/leglas/api/annotations");if(!s.ok)throw new Error("Leglas refused the notes.");return(await Xt(s)).annotations??[]}async function Wf(a,s,c){const r=await c(a,{body:JSON.stringify(s),headers:{"content-type":"application/json"},method:"POST"});if(!r.ok)throw new Error("Leglas refused the note.");const f=await Xt(r);if(f.ok!==!0)throw new Error("Leglas refused the note.");return f}function Zy(a,s,c,r=Sr){return Wf("/leglas/api/annotations",{anchor:c,note:s,title:a},r)}function Ky(a,s,c=Sr){return Wf("/leglas/api/annotations/update",{id:a,note:s},c)}function Fy(a,s=Sr){return Wf("/leglas/api/annotations/delete",{ids:a},s)}function Jy(a){return[...new Set(a.flatMap(s=>s.mode!=="variant"&&(s.status==="queued"||s.status==="picked-up"||s.status==="running")?[s.title]:[]))]}function Wy(a){return new Set(a.filter(s=>s.status==="queued"||s.status==="picked-up"||s.status==="running").flatMap(s=>s.notes??[]))}function Iy(a){return new Set(a.flatMap(s=>s.status==="picked-up"||s.status==="running"?[s.title]:[]))}function Py(a,s,c=null){if(a==="custom"){const f=c?.trim().split(/\s+/)[0]??"";return{kind:"chosen",id:"custom",name:f===""?"Custom":f.split("/").pop()??"Custom"}}const r=a===null?void 0:s.find(f=>f.id===a);return r?.available?{kind:"chosen",id:r.id,name:r.name}:s.some(f=>f.available)?{kind:"choose"}:{kind:"none"}}function ev(a){const s=a.max===null?`retry ${a.attempt}`:`retry ${a.attempt} of ${a.max}`,c=a.status,r=a.reason??"";return c===429||r.includes("rate")?`provider is rate limiting · ${s}`:c===401||c===403||r.includes("auth")?`provider refused the login · ${s}`:c===529||c===503||r.includes("overload")?`provider is overloaded · ${s}`:`provider returned an error · ${s}`}function tv(a){return a.kind==="running"?a.stopping?`Stopping ${a.name}`:`${a.name} is on it`:a.kind==="queued"?a.count===1?"Change queued":`${a.count} changes queued`:a.kind==="picked-up"?"Your agent is on it":a.kind==="stopped"?"You stopped that change":"That change failed"}function nv(a,s=null){return a.kind==="running"?a.stopping?"waiting for it to exit":a.waiting!==null?ev(a.waiting):a.quietSince!==null&&s!==null?`no output for ${jr(s-a.quietSince)}`:a.activity??a.title:a.kind==="queued"?a.attended?"your agent picks it up next":"pick who runs your changes":a.kind==="failed"?a.reason??a.title:a.kind==="stopped"?a.title:null}function jr(a){const s=Math.max(0,Math.floor(a/1e3));return s<60?`${s}s`:`${Math.floor(s/60)}m ${String(s%60).padStart(2,"0")}s`}function lv(a,s,c){const r=a.find(p=>p.status==="running");if(s.running||r!==void 0)return{kind:"running",id:r?.id??null,name:s.name??"Your agent",activity:s.activity,startedAt:s.startedAt,title:r?.title??null,stopping:s.stopping===!0,waiting:s.stopping===!0?null:s.waiting??null,quietSince:s.stopping===!0?null:s.quietSince??null};const f=a.filter(p=>p.status==="queued").length;if(f>0)return{kind:"queued",count:f,attended:c};if(a.some(p=>p.status==="picked-up"))return{kind:"picked-up"};const d=a.findLast(p=>p.status==="failed"||p.status==="cancelled");return d===void 0?null:d.status==="cancelled"?{kind:"stopped",id:d.id,title:d.title}:{kind:"failed",id:d.id,title:d.title,reason:d.failure?.message??null}}const hi=(a,s)=>fetch(a,s),av=5e3,iv=1e4;async function Om(a,s,c,r){const f=new AbortController,d=setTimeout(()=>f.abort(),c);try{return await r(a,{...s,signal:f.signal})}finally{clearTimeout(d)}}async function $1(a=!1,s=hi){const c=await Om(`/leglas/api/agents${a?"?refresh=1":""}`,void 0,av,s);if(!c.ok)throw new Error("Leglas refused the agent request.");return Xt(c)}async function cs(a,s,c){const r={method:"POST"};s!==null&&(r.headers={"content-type":"application/json"},r.body=JSON.stringify(s));const f=await Om(a,r,iv,c);if(!f.ok)throw new Error("Leglas refused the agent request.");if((await Xt(f)).ok!==!0)throw new Error("Leglas refused the agent request.")}function sv(a,s,c=hi){return cs("/leglas/api/agent",{agent:a},c)}function ov(a,s,c=hi){return cs("/leglas/api/agent",{agent:a,effort:s},c)}function uv(a=hi){return cs("/leglas/api/agents/warm",null,a)}function rv(a,s=hi){return cs("/leglas/api/requests/cancel",a==null?null:{id:a},s)}function cv(a,s=hi){return cs("/leglas/api/requests/retry",{id:a},s)}function fv(a,s=hi){return cs("/leglas/api/requests/dismiss",{id:a},s)}const qf={claude:{codeLabel:"Terminal command",copyLabel:"Copy Claude Code command",description:"Add Leglas with one terminal command.",label:"Claude Code",nextStep:"Run this command from your project, then ask Claude to list your Leglas directions.",snippet:"claude mcp add leglas -- npx -y leglas-mcp"},other:{codeLabel:"MCP configuration",copyLabel:"Copy MCP configuration",description:"Use standard MCP JSON with another coding agent.",label:"Codex, Cursor & others",nextStep:"Add this configuration in your client's MCP settings, restart the client, then ask it to list your Leglas directions.",snippet:`{
11
+ "mcpServers": {
12
+ "leglas": { "command": "npx", "args": ["-y", "leglas-mcp"] }
13
+ }
14
+ }`}};function dv(a,s){return s==="copying"?"Copying…":s==="copied"?"Copied":a.copyLabel}function hv(a){return a?{title:"Agent connected",detail:"Leglas received activity from an MCP agent in this project."}:{title:"Waiting for agent activity",detail:"This updates after the agent uses a Leglas tool."}}const mv=Object.keys(qf);function pv({client:a}){return u.jsx("span",{"aria-hidden":"true",className:"mt-0.5 flex h-5 w-7 shrink-0 items-center justify-center text-[#D1D5DB]",children:a==="claude"?u.jsx(os,{id:"claude",size:17}):u.jsxs("span",{className:"flex -space-x-1.5",children:[u.jsx("span",{className:"flex size-5 items-center justify-center rounded-full bg-[#25252B] ring-1 ring-[#3A3A42]",children:u.jsx(os,{id:"codex",size:14})}),u.jsx("span",{className:"flex size-5 items-center justify-center rounded-full bg-[#25252B] ring-1 ring-[#3A3A42]",children:u.jsx(os,{id:"cursor",size:13})})]})})}function gv({connected:a,fallbackFocusRef:s,onClose:c}){const[r,f]=w.useState("claude"),[d,p]=w.useState("idle"),y=w.useRef(null),b=w.useRef(null),x=w.useRef(c);x.current=c,w.useEffect(()=>{const N=y.current;if(N===null)return;const U=document.activeElement instanceof HTMLElement?document.activeElement:null,$=V=>{V.preventDefault(),x.current()},O=V=>{if(V.key!=="Tab")return;const Q=Array.from(N.querySelectorAll("button:not(:disabled), input:not(:disabled), [href], [tabindex]:not([tabindex='-1'])")),X=Q[0],ae=Q.at(-1);X===void 0||ae===void 0?(V.preventDefault(),N.focus()):V.shiftKey&&document.activeElement===X?(V.preventDefault(),ae.focus()):!V.shiftKey&&document.activeElement===ae&&(V.preventDefault(),X.focus())};return N.addEventListener("cancel",$),N.addEventListener("keydown",O),N.open||N.showModal(),b.current?.focus(),()=>{N.removeEventListener("cancel",$),N.removeEventListener("keydown",O),N.open&&N.close();const V=s.current;(V?.isConnected?V:U)?.focus()}},[s]);const S=qf[r],M=hv(a),T=N=>{f(N),p("idle")},k=async()=>{if(d==="copying")return;p("copying");const N=await wr(S.snippet);p(N==="copied"?"copied":"blocked")};return u.jsx("dialog",{"aria-describedby":"mcp-connect-description","aria-labelledby":"mcp-connect-title","aria-modal":"true",className:"m-auto max-h-[calc(100dvh-2rem)] max-w-none overflow-visible border-0 bg-transparent p-0 text-start text-inherit backdrop:bg-black/55 backdrop:backdrop-blur-sm",onPointerDown:N=>{N.target===N.currentTarget&&c()},ref:y,tabIndex:-1,children:u.jsxs("div",{className:"w-[calc(100vw-2rem)] max-w-lg overscroll-contain rounded-xl border border-[#2A2A30] bg-[#1E1E22] p-5 shadow-2xl",children:[u.jsxs("div",{className:"flex items-start gap-3",children:[u.jsx("span",{"aria-hidden":"true",className:"flex size-10 shrink-0 items-center justify-center rounded-lg border border-[#34343B] bg-[#25252A] shadow-inner",children:u.jsx(No,{size:24})}),u.jsxs("div",{className:"min-w-0 pt-0.5",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(ym,{height:11}),u.jsx("span",{className:"rounded-full bg-[#7C9CFF]/10 px-1.5 py-0.5 text-[9px] font-medium uppercase tracking-[0.08em] text-[#AFC2FF]",children:"MCP setup"})]}),u.jsx("h2",{className:"mt-2 text-base font-medium text-white",id:"mcp-connect-title",children:"Connect agent via MCP"}),u.jsx("p",{className:"mt-1.5 max-w-md text-xs leading-relaxed text-[#9CA3AF]",id:"mcp-connect-description",children:"Connect an MCP-compatible agent so it can handle requests in this project."})]})]}),u.jsxs("fieldset",{className:"mt-5",children:[u.jsx("legend",{className:"text-[10px] font-medium uppercase tracking-[0.08em] text-[#84848C]",children:"MCP client"}),u.jsx("div",{className:"mt-2 grid grid-cols-1 gap-2 sm:grid-cols-2",children:mv.map((N,U)=>{const $=qf[N],O=r===N;return u.jsxs("label",{className:`flex cursor-pointer items-start gap-2.5 rounded-lg border p-3 transition-[background-color,border-color,color] duration-150 ${O?"border-[#6678B8] bg-[#7C9CFF]/10 text-white":"border-[#2A2A30] bg-[#19191D] text-[#D1D5DB] hover:border-[#3A3A42] hover:bg-[#24242A]"}`,children:[u.jsx("input",{checked:O,className:"mt-0.5 size-3.5 shrink-0 accent-[#AFC2FF] focus-visible:outline-2 focus-visible:outline-offset-2",name:"mcp-client",onChange:()=>T(N),ref:U===0?b:void 0,type:"radio",value:N}),u.jsx(pv,{client:N}),u.jsxs("span",{className:"min-w-0",children:[u.jsx("span",{className:"block text-xs font-medium",children:$.label}),u.jsx("span",{className:"mt-0.5 block text-[10px] leading-relaxed text-[#84848C]",children:$.description})]})]},N)})})]}),u.jsxs("div",{className:"mt-5 overflow-hidden rounded-lg border border-[#2A2A30] bg-[#151519]",children:[u.jsxs("div",{className:"flex min-h-9 items-center justify-between gap-3 border-b border-[#2A2A30] px-3",children:[u.jsx("span",{className:"text-[10px] font-medium text-[#84848C]",children:S.codeLabel}),u.jsxs("button",{className:"flex min-h-7 shrink-0 items-center gap-1.5 rounded-md px-2 text-[10px] font-medium text-[#D1D5DB] transition-[background-color,color,scale] duration-150 hover:bg-white/[0.06] hover:text-white active:scale-[0.96] disabled:opacity-60",disabled:d==="copying",onClick:()=>{k()},type:"button",children:[u.jsx(Pt,{d:It.copy,size:12}),dv(S,d)]})]}),u.jsx("pre",{"aria-label":S.codeLabel,className:"max-h-44 overflow-auto whitespace-pre-wrap break-words p-3 font-mono text-[11px] leading-relaxed text-[#D1D5DB]",tabIndex:0,children:u.jsx("code",{children:S.snippet})})]}),u.jsx("p",{className:"mt-2 min-h-4 text-[10px] leading-relaxed",role:"status",children:d==="blocked"?u.jsx("span",{className:"text-red-300",children:"Clipboard access is blocked. Select and copy the text above."}):d==="copied"?u.jsx("span",{className:"text-emerald-300",children:"Copied to the clipboard."}):null}),u.jsxs("div",{className:"mt-4 space-y-4",children:[u.jsx("p",{className:"text-xs leading-relaxed text-[#9CA3AF]",children:S.nextStep}),u.jsxs("div",{className:`flex items-start gap-2.5 rounded-lg px-3 py-2.5 ${a?"bg-emerald-400/10":"bg-white/[0.04]"}`,role:"status",children:[u.jsx("span",{"aria-hidden":"true",className:`mt-0.5 flex size-4 shrink-0 items-center justify-center rounded-full ${a?"bg-emerald-400 text-[#123326]":"border border-[#5B5B66]"}`,children:a?u.jsx("svg",{fill:"none",height:"10",viewBox:"0 0 12 12",width:"10",children:u.jsx("path",{d:"m2.2 6.1 2.2 2.2 5.4-5.2",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8"})}):null}),u.jsxs("span",{className:"min-w-0",children:[u.jsx("span",{className:`block text-xs font-medium ${a?"text-emerald-200":"text-[#D1D5DB]"}`,children:M.title}),u.jsx("span",{className:"mt-0.5 block text-[10px] leading-relaxed text-[#84848C]",children:M.detail})]})]})]}),u.jsx("div",{className:"mt-5 flex justify-end",children:u.jsx("button",{className:"rounded-md bg-[#E8E8EA] px-3 py-1.5 text-xs font-medium text-[#1C1C20] transition-[background-color,scale] duration-150 hover:bg-white active:scale-[0.96]",onClick:c,type:"button",children:"Done"})})]})})}const Lm={low:"Low",medium:"Medium",high:"High",xhigh:"Extra high",max:"Maximum"};function xv({agents:a,chip:s,connectRef:c,menuRef:r,onConnect:f,onPick:d,onPickEffort:p,open:y,pickingAgent:b,savingEffort:x,selectedAgent:S,selectedEffort:M,setOpen:T}){return u.jsxs("div",{"aria-hidden":!y,"aria-label":"Who runs your changes",className:`absolute bottom-full right-0 z-10 mb-1.5 w-max min-w-48 origin-bottom-right rounded-lg border border-[#232328] bg-[#1E1E22] p-1 text-[#D1D5DB] shadow-2xl transition-[opacity,transform] duration-150 ease-[cubic-bezier(0.165,0.84,0.44,1)] focus:outline-none motion-reduce:transition-none ${y?"translate-y-0 scale-100 opacity-100":"pointer-events-none translate-y-1 scale-95 opacity-0"}`,inert:!y,ref:r,role:"dialog",tabIndex:-1,children:[a.filter(k=>k.available).map(k=>{const N=s.kind==="chosen"&&k.id===s.id;return u.jsxs("button",{className:oi,disabled:b!==null||x,onClick:()=>N?T(!1):d(k.id),type:"button",children:[u.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[u.jsx(os,{id:k.id}),u.jsx("span",{className:"truncate",children:k.name})]}),b===k.id?u.jsx("span",{"aria-label":"selecting",className:"size-3 animate-spin rounded-full border-[1.5px] border-current border-t-transparent motion-reduce:animate-none"}):k.auth==="signed-out"?u.jsx("span",{className:"text-[10px] text-amber-400/80",children:"signed out"}):N&&u.jsx("span",{"aria-label":"current choice",children:"✓"})]},k.id)}),s.kind==="chosen"&&s.id==="custom"?u.jsxs("button",{className:oi,onClick:()=>T(!1),type:"button",children:[u.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[u.jsx(os,{id:"custom"}),u.jsx("span",{className:"truncate",children:s.name})]}),u.jsx("span",{"aria-label":"current choice",children:"✓"})]}):null,S!==void 0&&S.efforts.length>0?u.jsx("div",{className:"mt-1 border-t border-[#232328] px-1 pb-0.5 pt-1.5",children:u.jsxs("label",{className:"flex min-h-7 items-center justify-between gap-3",children:[u.jsx("span",{className:"text-[10px] font-medium text-[#84848C]",children:"Effort"}),u.jsxs("select",{"aria-busy":x,"aria-label":`${S.name} effort`,className:"min-h-7 rounded-md border border-[#303038] bg-[#17171B] px-2 text-[10px] text-[#D1D5DB] focus-visible:outline-2 focus-visible:outline-offset-2 disabled:opacity-60",disabled:x||b!==null,onChange:k=>{const N=k.currentTarget.value;p(S.efforts.find(U=>U===N)??null)},value:M??"",children:[u.jsx("option",{value:"",children:"Agent default"}),S.efforts.map(k=>u.jsx("option",{value:k,children:Lm[k]},k))]})]})}):null,u.jsx("div",{className:"mt-1 border-t border-[#232328] pt-1",children:u.jsx("button",{className:`${oi} text-[#84848C]`,onClick:()=>{T(!1),f()},ref:c,type:"button",children:u.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[u.jsx(Pt,{d:It.link,size:14}),u.jsx("span",{className:"truncate",children:"Connect agent via MCP…"})]})})})]})}function yv({agents:a,chip:s,chosenSignedOut:c,connectRef:r,menuRef:f,onConnect:d,onPick:p,onPickEffort:y,onRefresh:b,open:x,pickingAgent:S,savingEffort:M,selectedAgent:T,selectedEffort:k,setOpen:N,triggerRef:U}){return s.kind==="none"?u.jsxs("button",{className:"flex min-w-0 items-center gap-1.5 rounded px-1.5 py-1 text-[10px] leading-none text-[#84848C] transition-colors duration-150 hover:bg-white/[0.04] hover:text-[#D1D5DB]",onClick:d,ref:r,type:"button",children:[u.jsx(Pt,{d:It.link,size:12}),u.jsx("span",{className:"truncate",children:"Connect agent via MCP…"})]}):u.jsxs("div",{className:"relative flex min-w-0 items-center",children:[u.jsx(xv,{agents:a,chip:s,connectRef:r,menuRef:f,onConnect:d,onPick:p,onPickEffort:y,open:x,pickingAgent:S,savingEffort:M,selectedAgent:T,selectedEffort:k,setOpen:N}),u.jsxs("button",{"aria-expanded":x,"aria-haspopup":"dialog",className:"flex min-w-0 items-center gap-1.5 rounded px-1.5 py-1 text-[11px] leading-none text-[#84848C] transition-colors hover:bg-white/[0.04] hover:text-[#D1D5DB]",onClick:()=>{x||b(),N($=>!$)},ref:U,type:"button",children:[s.kind==="chosen"&&u.jsx(os,{id:s.id,size:12}),u.jsx("span",{className:"truncate",children:s.kind==="chosen"?`${s.name}${k===null?"":` · ${Lm[k]}`}`:"Choose an agent"}),c&&u.jsx("span",{className:"size-1.5 shrink-0 rounded-full bg-amber-400",title:"This CLI is signed out. Sign in in your terminal.",children:u.jsx("span",{className:"sr-only",children:"signed out"})}),u.jsx("svg",{"aria-hidden":"true",className:`shrink-0 transition-transform duration-150 motion-reduce:transition-none ${x?"rotate-180":""}`,fill:"none",height:"12",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.75",viewBox:"0 0 16 16",width:"12",children:u.jsx("path",{d:"M4 6.5 8 10.5l4-4"})})]})]})}const vv="size-3 animate-spin rounded-full border-[1.5px] border-current border-t-transparent motion-reduce:animate-none";function _m({kind:a}){return a==="stopped"?u.jsx("span",{"aria-hidden":"true",className:"flex size-3.5 shrink-0 items-center justify-center text-[#84848C]",children:u.jsx("span",{className:"block size-2 rounded-[2px] bg-current"})}):a==="failed"?u.jsxs("svg",{"aria-hidden":"true",className:"shrink-0 text-amber-400/90",fill:"none",height:"14",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",viewBox:"0 0 16 16",width:"14",children:[u.jsx("path",{d:"M8 2.6 14.6 13.4H1.4Z"}),u.jsx("path",{d:"M8 6.8v2.7"}),u.jsx("path",{d:"M8 11.6h.01"})]}):a==="queued"?u.jsx("span",{"aria-hidden":"true",className:"flex size-3.5 shrink-0 items-center justify-center",children:u.jsx("span",{className:"size-1.5 animate-pulse rounded-full bg-[#84848C] motion-reduce:animate-none"})}):u.jsx("span",{"aria-hidden":"true",className:"size-3.5 shrink-0 animate-spin rounded-full border-[1.5px] border-white/15 border-t-white/70 motion-reduce:animate-none"})}function Eo({busy:a,children:s,disabled:c,label:r,onClick:f,standalone:d=!1,tip:p}){return u.jsx(Je,{label:p,children:u.jsx("button",{"aria-label":r,className:`flex h-6 w-6 ${d?"shrink-0 ":""}items-center justify-center rounded-md text-[#84848C] transition-[background-color,color,transform] duration-150 hover:bg-white/[0.06] hover:text-white active:scale-[0.96] disabled:cursor-wait disabled:opacity-40 motion-reduce:transition-none`,disabled:c,onClick:f,type:"button",children:a?u.jsx("span",{className:vv}):s})})}function Ao({children:a}){return u.jsx("svg",{"aria-hidden":"true",fill:"none",height:"13",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.75",viewBox:"0 0 16 16",width:"13",children:a})}function bv({action:a,card:s,onCancel:c,onDismiss:r,onRetry:f}){const d=s.kind==="running"?s.startedAt:null,[p,y]=w.useState(()=>Date.now());w.useEffect(()=>{if(d===null)return;y(Date.now());const x=window.setInterval(()=>y(Date.now()),1e3);return()=>window.clearInterval(x)},[d]);const b=nv(s,d===null?null:p);return u.jsx("div",{className:"mx-3 mt-2 rounded-lg border border-[#232328] bg-[#1E1E22] px-2.5 py-2 shadow-lg",role:"status",children:u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(_m,{kind:s.kind}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsx("p",{className:"truncate text-[11px] font-medium leading-tight text-[#D1D5DB]",children:tv(s)}),b!==null&&u.jsx("p",{className:"mt-0.5 text-[10px] leading-tight text-[#84848C]",children:b})]}),d!==null&&u.jsx("span",{className:"shrink-0 text-[10px] tabular-nums text-[#84848C]",children:jr(p-d)}),s.kind==="running"&&u.jsx(Eo,{busy:a==="cancel"||s.stopping,disabled:a!==null||s.stopping,label:"Stop this run",onClick:()=>c(s.id),standalone:!0,tip:"Stop this run",children:u.jsx("span",{className:"block size-2 rounded-[2px] bg-current"})}),(s.kind==="failed"||s.kind==="stopped")&&u.jsxs("span",{className:"flex shrink-0 items-center",children:[u.jsx(Eo,{busy:a==="retry",disabled:a!==null,label:s.kind==="stopped"?"Run this change after all":"Retry this change",onClick:()=>f(s.id),tip:s.kind==="stopped"?"Run it after all":"Try it again",children:u.jsxs(Ao,{children:[u.jsx("path",{d:"M13.5 8a5.5 5.5 0 1 1-1.6-3.9"}),u.jsx("path",{d:"M13.7 1.8v2.7H11"})]})}),u.jsx(Eo,{busy:a==="dismiss",disabled:a!==null,label:s.kind==="stopped"?"Dismiss this stopped change":"Dismiss this failed change",onClick:()=>r(s.id),tip:"Let it go",children:u.jsx(Ao,{children:u.jsx("path",{d:"m4 4 8 8M12 4l-8 8"})})})]})]})})}function Of(a){return a==="codex"?"Codex":"Claude"}const wv=6;function Bm(a){let s;try{s=new URL(a,"http://leglas.invalid").searchParams}catch{return null}for(const c of s.keys())if(c.startsWith("v-")&&c.length>2)return c.slice(2);return null}function Sv(a){const s=new Map;for(const c of a)for(const r of c.slots)s.set(r.title,{job:c,slot:r});return s}function q1(a,s){try{return new URL(a,"http://leglas.invalid").searchParams.get(`v-${s.job.surface}`)===s.slot.key}catch{return!1}}const jv=2e3;function If(a){let s=a.startedAt;for(const c of a.slots)c.startedAt!==null&&(a.plannedAt===null||c.startedAt-a.plannedAt>jv)&&(s=Math.max(s,c.startedAt));return s}function Ev(a){let s=null;for(const c of a)c.endedAt!==null&&(s===null||c.endedAt>(s.endedAt??0))&&(s=c);return s}function Lf(a){return`${a.id}@${a.endedAt??""}`}function Cv(a){const s=new Set;for(const c of a){const r=Bm(c);r!==null&&s.add(r)}return[...s]}function Co(a){return a.state==="planning"||a.state==="building"}function _f(a,s){return s.basedOn===null?`${a} ${s.surface} ${a===1?"direction":"directions"}`:`${a} ${a===1?"variation":"variations"} of ${s.basedOn}`}function Y1(a){const s=a.map(c=>c.title);return s.length<=1?s.join(""):`${s.slice(0,-1).join(", ")} and ${s.at(-1)}`}function Nv(a){const s=a.slots.filter(d=>d.state==="ready"),c=a.slots.filter(d=>d.state==="failed"),r=a.slots.filter(d=>d.state==="stopped");if(a.state==="planning")return{tone:"working",text:`Planning ${_f(a.count,a)}…`};if(a.state==="building"){const d=s.length>0?`, ${s.length} ready`:"";return{tone:"working",text:`Building ${_f(a.slots.length,a)}${d}`}}if(a.state==="failed")return{tone:"failed",text:a.error??"Leglas could not plan the directions."};if(a.slots.length===0||r.length===a.slots.length)return{tone:"stopped",text:a.basedOn===null?`Stopped the ${a.surface} directions`:`Stopped the variations of ${a.basedOn}`};if(s.length===a.slots.length){const d=a.endedAt===null||If(a)!==a.startedAt?null:Math.max(1,Math.round((a.endedAt-a.startedAt)/1e3));return{tone:"done",text:`${_f(s.length,a)} ready${d===null?"":` in ${d} s`}`}}const f=s.length>0?[`${s.length} of ${a.slots.length} ready`]:a.slots.length>1?[`None of the ${a.slots.length} were built`]:[];return c.length>0&&f.push(`${Y1(c)} failed`),r.length>0&&f.push(`${Y1(r)} stopped`),{tone:c.length>0?"failed":"stopped",text:f.join(". ")}}function Mv(a,s){return`Build ${a} with ${s}`}const G1="flex size-6 items-center justify-center rounded text-[#9CA3AF] transition-[background-color,color,transform] duration-150 hover:bg-white/[0.06] hover:text-white active:scale-[0.96] disabled:pointer-events-none disabled:opacity-30 motion-reduce:transition-none";function Av({agent:a,count:s,onCount:c,picker:r,reason:f,ready:d,starting:p}){return u.jsxs("div",{className:"flex items-center justify-between gap-1.5 p-1",children:[u.jsxs("div",{"aria-label":"How many directions",className:"flex items-center",role:"group",children:[u.jsx("button",{"aria-label":"One direction fewer",className:G1,disabled:s<=1||p,onClick:()=>c(s-1),type:"button",children:u.jsx("svg",{"aria-hidden":"true",height:"12",viewBox:"0 0 16 16",width:"12",children:u.jsx("path",{d:"M3.5 8h9",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.75"})})}),u.jsx("span",{"aria-live":"polite",className:"w-5 text-center text-[11px] font-medium tabular-nums text-[#D1D5DB]",children:s}),u.jsx("button",{"aria-label":"One direction more",className:G1,disabled:s>=wv||p,onClick:()=>c(s+1),type:"button",children:u.jsx("svg",{"aria-hidden":"true",height:"12",viewBox:"0 0 16 16",width:"12",children:u.jsx("path",{d:"M3.5 8h9M8 3.5v9",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.75"})})})]}),f===null?u.jsxs("button",{className:"flex h-6 shrink-0 items-center gap-1.5 rounded-md bg-[#E8E8EA] px-2.5 text-[11px] font-medium text-[#1C1C20] transition-[background-color,transform,opacity] duration-150 hover:bg-white active:scale-[0.96] disabled:cursor-not-allowed disabled:opacity-40 motion-reduce:transition-none",disabled:!d||p,type:"submit",children:[p&&u.jsx("span",{"aria-hidden":"true",className:"size-3 animate-spin rounded-full border-[1.5px] border-current border-t-transparent motion-reduce:animate-none"}),Mv(s,a)]}):u.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[u.jsx("p",{className:"min-w-0 truncate text-right text-[10px] leading-snug text-[#84848C]",children:f}),r]})]})}function Dv(){return u.jsx("svg",{"aria-hidden":"true",className:"shrink-0 text-emerald-300/90",fill:"none",height:"14",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.75",viewBox:"0 0 16 16",width:"14",children:u.jsx("path",{d:"m3.5 8.5 3 3 6-7"})})}function Tv({compare:a,comparing:s,job:c,onDismiss:r,onStop:f,stopping:d}){const p=Nv(c),y=Co(c),[b,x]=w.useState(()=>Date.now());return w.useEffect(()=>{if(!y)return;x(Date.now());const S=window.setInterval(()=>x(Date.now()),1e3);return()=>window.clearInterval(S)},[y]),u.jsx("div",{className:"mx-3 mt-2 rounded-lg border border-[#232328] bg-[#1E1E22] px-2.5 py-2 shadow-lg",role:"status",children:u.jsxs("div",{className:"flex items-center gap-2",children:[p.tone==="done"?u.jsx(Dv,{}):u.jsx(_m,{kind:p.tone==="working"?"running":p.tone}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsx("p",{className:"truncate text-[11px] font-medium leading-tight text-[#D1D5DB]",children:p.text}),c.brief!==""&&u.jsxs("p",{className:"mt-0.5 truncate text-[10px] leading-tight text-[#84848C]",children:["“",c.brief,"”"]})]}),y&&u.jsx("span",{className:"shrink-0 text-[10px] tabular-nums text-[#84848C]",children:jr(b-If(c))}),a!==null&&u.jsx("button",{"aria-pressed":s,className:"h-6 shrink-0 rounded-md bg-white/[0.06] px-2 text-[10px] font-medium text-[#D1D5DB] transition-[background-color,color,transform] duration-150 hover:bg-white/[0.1] hover:text-white active:scale-[0.96] motion-reduce:transition-none",onClick:a.toggle,type:"button",children:s?"Show one":`Compare all ${a.count}`}),y?u.jsx(Eo,{busy:d,disabled:d,label:"Stop building these directions",onClick:f,standalone:!0,tip:"Stop them all",children:u.jsx("span",{className:"block size-2 rounded-[2px] bg-current"})}):u.jsx(Eo,{busy:!1,disabled:!1,label:"Dismiss this set's summary",onClick:r,standalone:!0,tip:"Let it go",children:u.jsx(Ao,{children:u.jsx("path",{d:"m4 4 8 8M12 4l-8 8"})})})]})})}const kv="rounded-md bg-neutral-900 px-3 py-1.5 text-xs font-medium text-white transition-[background-color,transform] duration-150 hover:bg-neutral-700 active:scale-[0.96] disabled:cursor-wait disabled:opacity-50 motion-reduce:transition-none",X1="rounded-md bg-neutral-100 px-3 py-1.5 text-xs font-medium text-neutral-800 transition-[background-color,transform] duration-150 hover:bg-neutral-200 active:scale-[0.96] disabled:cursor-wait disabled:opacity-50 motion-reduce:transition-none";function zv({slot:a}){const[s,c]=w.useState(()=>Date.now());w.useEffect(()=>{const f=window.setInterval(()=>c(Date.now()),1e3);return()=>window.clearInterval(f)},[]);const r=a.activity??(a.state==="checking"?"opening the page":"starting");return u.jsxs("p",{className:"mt-3 text-[11px] leading-snug text-neutral-400",children:[u.jsx("span",{className:"block truncate",children:r}),u.jsxs("span",{className:"tabular-nums",children:[a.startedAt===null?"":`${jr(s-a.startedAt)} · `,"usually a minute or two"]})]})}function Rv({acting:a,agent:s,name:c,onReplace:r,onRetry:f,onStop:d,slot:p}){return p.state==="building"||p.state==="checking"?u.jsxs("div",{"aria-live":"polite",className:"absolute inset-0 flex flex-col items-center justify-center gap-3 bg-white p-6 text-center",children:[u.jsx("span",{className:"size-4 animate-spin rounded-full border-2 border-neutral-300 border-t-neutral-800 motion-reduce:animate-none"}),u.jsxs("div",{className:"max-w-xs",children:[u.jsx("p",{className:"text-sm font-medium text-neutral-800",children:p.state==="building"?`${s} is building ${c}`:`Checking ${c} renders`}),u.jsx("p",{className:"mt-1 text-xs leading-snug text-neutral-500",children:p.idea}),u.jsx(zv,{slot:p})]}),u.jsx("button",{className:X1,disabled:a,onClick:d,type:"button",children:"Stop"})]}):u.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-3 bg-white p-6 text-center",role:"alert",children:[u.jsxs("div",{className:"max-w-xs",children:[u.jsx("p",{className:"text-sm font-medium text-neutral-800",children:p.state==="failed"?`${c} didn’t build`:`${c} was stopped`}),u.jsx("p",{className:"mt-1 text-xs leading-snug text-neutral-500",children:p.state==="failed"?p.failure?.message??"It did not build.":p.idea})]}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx("button",{className:kv,disabled:a,onClick:f,type:"button",children:p.state==="failed"?"Try again":"Build it"}),u.jsx("button",{className:X1,disabled:a,onClick:r,type:"button",children:"Try a new idea"})]})]})}async function Ov(a){const s=await fetch("/leglas/api/generate",a===void 0?{}:{signal:a});if(!s.ok)throw new Error(`the server answered ${s.status}`);return(await Xt(s)).jobs}async function Er(a,s,c){const r=await fetch(`/leglas/api/generate${a}`,{body:JSON.stringify(s),headers:{"content-type":"application/json"},method:"POST"});if(!r.ok)throw await Ma(r,c);return r}async function Lv({basedOn:a,...s}){const c=await Er("",a===null?s:{...s,basedOn:a},"Leglas could not start building the directions.");return(await Xt(c)).job}async function Q1(a,s){await Er("/stop",s===void 0?{id:a}:{id:a,slot:s},"Leglas could not stop it.")}async function _v(a,s){await Er("/retry",{id:a,slot:s},"Leglas could not build it again.")}async function Bv(a,s){await Er("/replace",{id:a,slot:s},"Leglas could not ask for a new idea.")}const Uv=6e4,Hv=[];function $v(a){const[s,c]=w.useState([]),r=s.some(Co);w.useEffect(()=>{if(!a)return;let d=!1;const p=rs(y=>Ov(y).then(b=>{d||c(x=>JSON.stringify(x)===JSON.stringify(b)?x:b)}).catch(()=>{}),{everyMs:r?Mo:Uv,subscribe:y=>us().on("generation",y)});return()=>{d=!0,p()}},[a,r]);const f=w.useCallback(d=>{c(p=>p.some(y=>y.id===d.id)?p.map(y=>y.id===d.id?d:y):[...p,d])},[]);return{jobs:a?s:Hv,noteJob:f}}function qv({annotating:a,count:s,onToggle:c}){return u.jsx(Je,{label:u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"block",children:a?"Stop annotating":s>0?"Show what you marked up":"Point at what is wrong, instead of describing where it is"}),u.jsx("span",{className:"block text-[#9CA3AF]",children:a?"Click a detail · drag an area · Esc to stop":u.jsx("kbd",{className:"font-sans",children:"A"})})]}),children:u.jsxs("button",{"aria-keyshortcuts":"a","aria-label":a?"Stop annotating the design":`Annotate the design${s>0?`, ${s} annotation${s===1?"":"s"} so far`:""}`,"aria-pressed":a,className:`flex h-6 shrink-0 items-center gap-1 rounded-md px-1.5 text-[10px] font-medium leading-none transition-colors ${a?"bg-[#7C9CFF]/20 text-[#AFC2FF]":"text-[#84848C] hover:bg-white/[0.06] hover:text-[#D1D5DB]"}`,onClick:c,type:"button",children:[u.jsxs("svg",{"aria-hidden":!0,fill:"none",height:"11",stroke:"currentColor",strokeWidth:"1.7",viewBox:"0 0 16 16",width:"11",children:[u.jsx("path",{d:"M8 1.8a4.2 4.2 0 0 1 4.2 4.2c0 3-4.2 8-4.2 8S3.8 9 3.8 6A4.2 4.2 0 0 1 8 1.8Z",strokeLinejoin:"round"}),u.jsx("circle",{cx:"8",cy:"6",r:"1.4"})]}),"Annotate",s>0?u.jsx("span",{className:"rounded-full bg-white/15 px-1 text-[9px] leading-[1.5] text-white",children:s}):null]})})}function Yv({count:a,disabled:s,inputRef:c,onFiles:r}){return u.jsxs(u.Fragment,{children:[u.jsx("input",{accept:Rm.join(","),"aria-hidden":"true",className:"sr-only",multiple:!0,onChange:f=>{r(Array.from(f.currentTarget.files??[])),f.currentTarget.value=""},ref:c,tabIndex:-1,type:"file"}),u.jsx(Je,{label:u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"block",children:"Attach a reference image"}),u.jsx("span",{className:"block text-[#9CA3AF]",children:"Paste or drop one, too"})]}),children:u.jsx("button",{"aria-label":a>0?`Attach another image, ${a} attached`:"Attach a reference image",className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-md text-[#84848C] transition-[background-color,color,transform] duration-150 hover:bg-white/[0.06] hover:text-[#D1D5DB] active:scale-[0.96] disabled:cursor-not-allowed disabled:opacity-40 motion-reduce:transition-none",disabled:s,onClick:()=>c.current?.click(),type:"button",children:u.jsxs("svg",{"aria-hidden":!0,fill:"none",height:"11",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.7",viewBox:"0 0 16 16",width:"11",children:[u.jsx("rect",{height:"10.5",rx:"1.8",width:"12.5",x:"1.75",y:"2.75"}),u.jsx("circle",{cx:"5.6",cy:"6.3",r:"1.1"}),u.jsx("path",{d:"m14.25 10.4-3.1-3.1a1 1 0 0 0-1.4 0L4.5 12.5"})]})})})]})}function Gv({mode:a,onToggle:s}){return u.jsx(Je,{label:a==="variant"?"Builds a new direction beside this one and leaves this one alone.":"Changes this direction itself. Nothing is kept of what it was.",children:u.jsxs("button",{"aria-label":a==="variant"?"This change makes a new variant. Switch to changing the direction itself.":"This change edits the direction itself. Switch to making a new variant.",className:"mr-auto flex h-6 shrink-0 items-center gap-1 rounded-md px-1.5 text-[10px] font-medium leading-none text-[#84848C] transition-colors hover:bg-white/[0.06] hover:text-[#D1D5DB]",onClick:s,type:"button",children:[a==="variant"?u.jsxs("svg",{"aria-hidden":!0,fill:"none",height:"11",stroke:"currentColor",strokeWidth:"1.7",viewBox:"0 0 16 16",width:"11",children:[u.jsx("circle",{cx:"4.5",cy:"3.6",r:"1.9"}),u.jsx("circle",{cx:"11.5",cy:"12.4",r:"1.9"}),u.jsx("path",{d:"M4.5 5.5v2.6a4.3 4.3 0 0 0 4.3 4.3h0.8",strokeLinecap:"round"})]}):u.jsx("svg",{"aria-hidden":!0,fill:"none",height:"11",stroke:"currentColor",strokeWidth:"1.7",viewBox:"0 0 16 16",width:"11",children:u.jsx("path",{d:"M10.8 2.9 13.1 5.2 5.6 12.7H3.3v-2.3z",strokeLinejoin:"round"})}),a==="variant"?"as a variant":"in place"]})})}function Xv({ready:a,sending:s,target:c}){return u.jsx("button",{"aria-label":c===null?"Send the change":`Send the change to ${c}`,className:`flex h-6 w-6 shrink-0 items-center justify-center rounded-md transition-[background-color,color,transform] duration-150 active:scale-[0.96] motion-reduce:transition-none ${a?"bg-[#E8E8EA] text-[#1C1C20] hover:bg-white":"pointer-events-none text-[#84848C]/60"}`,disabled:!a,type:"submit",children:s?u.jsx("span",{className:"size-3 animate-spin rounded-full border-[1.5px] border-current border-t-transparent motion-reduce:animate-none"}):u.jsx("svg",{"aria-hidden":"true",fill:"none",height:"13",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.75",viewBox:"0 0 16 16",width:"13",children:u.jsx("path",{d:"M8 13V3M3.5 7.5 8 3l4.5 4.5"})})})}const V1="rounded-full bg-[#1C1C20]/85 px-2.5 py-1 text-[11px] font-medium text-[#E8E8EA] shadow-lg backdrop-blur";function Qv({errored:a,fromApp:s,loaded:c,onReload:r,onShowAnyway:f,refusal:d,serverUp:p,src:y}){return a?u.jsx(bm,{onReload:r,reason:p||!s?`${y} didn’t respond.`:"Your dev server stopped. This returns on its own once it is back."}):d!==null?u.jsx(dx,{href:y,onShowAnyway:f,...Bx(d,y,window.location.origin)}):u.jsx(rx,{loaded:c})}function Vv({annotate:a,cover:s=null,onOpen:c=null,boxHeight:r,boxWidth:f,branch:d,branchName:p,busy:y,designWidth:b,errored:x,frameHeight:S,framed:M,fromApp:T,identity:k,loaded:N,name:U,onError:$,onReady:O,onReload:V,onShowAnyway:Q,onStartBranch:X,order:ae,paneScale:P,refusal:v,scaling:ne,second:ce,serverUp:te,shown:xe,splitting:re,src:Ee,title:ye,viewport:De}){const R=u.jsxs(u.Fragment,{children:[U,ne&&u.jsxs("span",{className:"ml-1.5 font-normal text-[#8E8E96]",children:[Math.round(b),"px · ",Math.round(P*100),"%"]})]});return u.jsxs("div",{className:xe?re?`relative min-w-0 flex-1 overflow-auto ${ce?"border-l border-[#232328]":""} ${ne?"flex flex-col items-center justify-center gap-2.5":M?"flex min-h-full justify-center p-6":""}`:M?"flex min-h-full justify-center p-6":"absolute inset-0":"hidden",style:re?{order:ae}:void 0,children:[re&&u.jsx("div",{className:ne?"pointer-events-none z-10 flex justify-center":"pointer-events-none absolute inset-x-0 top-0 z-10 flex justify-center p-3",children:c===null?u.jsx("span",{className:V1,children:R}):u.jsx("button",{"aria-label":`Open ${U} on its own`,className:`${V1} pointer-events-auto transition-colors hover:bg-[#2E2E2E] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[#D1D5DB]/60`,onClick:c,type:"button",children:R})}),u.jsxs("div",{className:ne?"relative shrink-0 overflow-hidden rounded-[10px] shadow-[0_0_0_1px_rgba(255,255,255,0.12)]":M?`relative h-[calc(100dvh-48px)] shrink-0 overflow-hidden rounded-[10px] shadow-[0_0_0_1px_rgba(255,255,255,0.10)] transition-[width] duration-200 ${ci} motion-reduce:transition-none`:"relative size-full",style:ne?{height:r,width:f}:M?{width:De??void 0}:void 0,children:[u.jsxs("div",{className:ne?"relative origin-top-left":"relative size-full",style:ne?{height:S,transform:`scale(${P})`,width:b}:void 0,children:[d!==null&&d.status!=="ready"?u.jsx(cx,{branch:p,onStart:X,state:d}):u.jsx("iframe",{className:`size-full border-0 bg-white ${y?"pointer-events-none":""}`,onError:$,onLoad:W=>{const oe=W.currentTarget.dataset.previewIdentity;oe!==void 0&&(!Ee.startsWith("/")||Zf(W.currentTarget))&&O(oe,W.currentTarget)},"data-preview":ye,"data-preview-identity":k,src:Ee,title:`Preview: ${U}`},k),a]}),d!==null&&d.status!=="ready"?null:u.jsx(Qv,{errored:x,fromApp:T,loaded:N,onReload:V,onShowAnyway:Q,refusal:v,serverUp:te,src:Ee}),s,!te&&N&&T&&u.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 flex justify-center p-3",children:u.jsx("span",{className:"rounded-full bg-[#1C1C20]/90 px-2.5 py-1 text-[11px] font-medium text-amber-300/90 shadow-lg",children:"Stale — dev server stopped"})})]})]})}const Yf=[{key:"satoshi",label:"Satoshi",stack:"var(--font-satoshi)"},{key:"outfit",label:"Outfit",stack:"var(--font-outfit)"},{key:"geist",label:"Geist",stack:"var(--font-geist)"}];function Zv({applyOverlayPref:a,copied:s,fontKey:c,href:r,notify:f,onCopyReference:d,onShortcuts:p,open:y,parked:b,popoverRef:x,prefs:S,setPrefs:M,splitting:T,viewing:k,viewports:N}){return u.jsxs("div",{"aria-hidden":!y,"aria-label":"Leglas tools",className:`w-56 rounded-lg border border-[#232328] bg-[#1E1E22] p-1.5 shadow-2xl transition-[opacity,transform] duration-150 ease-[cubic-bezier(0.165,0.84,0.44,1)] focus:outline-none motion-reduce:transition-none ${b?"hidden ":""}${y?"translate-y-0 scale-100 opacity-100":"pointer-events-none translate-y-1 scale-95 opacity-0"}`,inert:!y,ref:x,role:"dialog",tabIndex:-1,children:[u.jsx("span",{className:"block px-1 pb-1 pt-0.5 text-[10px] uppercase tracking-[0.08em] text-[#84848C]",children:"Typeface"}),u.jsx("div",{"aria-label":"Interface typeface",className:"flex items-center gap-0.5 rounded-md bg-[#2E2E2E]/40 p-0.5",role:"group",children:Yf.map(U=>u.jsx("button",{"aria-pressed":c===U.key,className:`flex-1 rounded px-2 py-1 text-xs transition-colors ${c===U.key?"bg-[#2E2E2E] font-medium text-white":"text-[#9CA3AF] hover:text-[#D1D5DB]"}`,onClick:()=>M($=>({...$,font:U.key})),style:{fontFamily:U.stack},type:"button",children:U.label},U.key))}),u.jsx("span",{className:"block px-1 pb-1 pt-2 text-[10px] uppercase tracking-[0.08em] text-[#84848C]",children:"Viewport"}),u.jsx("div",{"aria-label":"Viewport width",className:"flex items-center gap-0.5 rounded-md bg-[#2E2E2E]/40 p-0.5",role:"group",children:N.map(({label:U,width:$})=>u.jsx("button",{className:`flex-1 rounded px-2 py-1 text-xs transition-colors ${S.viewport===$?"bg-[#2E2E2E] font-medium text-white":"text-[#9CA3AF] hover:text-[#D1D5DB]"}`,onClick:()=>M(O=>({...O,viewport:$})),type:"button",children:U},U))}),T&&u.jsxs("button",{"aria-checked":S.scaleSplit,className:`${oi} mt-1 ${S.scaleSplit?"text-white":"text-[#9CA3AF]"}`,onClick:()=>M(U=>({...U,scaleSplit:!U.scaleSplit})),role:"switch",type:"button",children:[u.jsx("span",{children:"Scale each side to fit"}),u.jsx(lr,{on:S.scaleSplit})]}),u.jsx("span",{className:"block px-1 pb-1 pt-2 text-[10px] uppercase tracking-[0.08em] text-[#84848C]",children:"Dev overlays"}),u.jsxs("button",{"aria-checked":S.showDevOverlays,className:`${oi} ${S.showDevOverlays?"text-white":"text-[#9CA3AF]"}`,onClick:()=>{const U=!S.showDevOverlays;M($=>({...$,showDevOverlays:U}));for(const $ of document.querySelectorAll("iframe"))a($,!U)},role:"switch",type:"button",children:[u.jsx("span",{children:"Show dev tool overlay"}),u.jsx(lr,{on:S.showDevOverlays})]}),u.jsxs("button",{"aria-checked":S.showWidget,className:`${oi} ${S.showWidget?"text-white":"text-[#9CA3AF]"}`,onClick:()=>{const U=!S.showWidget;M($=>({...$,showWidget:U})),U||f({kind:"widget",message:"Press T to reopen the tools",tone:"info",ttl:Xe.plain+3e3})},role:"switch",type:"button",children:[u.jsx("span",{children:"Show Leglas overlay"}),u.jsx(lr,{on:S.showWidget})]}),!k&&u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"block px-1 pb-1 pt-2 text-[10px] uppercase tracking-[0.08em] text-[#84848C]",children:"Labs"}),u.jsxs("button",{"aria-checked":S.buildDirections,className:`${oi} ${S.buildDirections?"text-white":"text-[#9CA3AF]"}`,onClick:()=>M(U=>({...U,buildDirections:!U.buildDirections})),role:"switch",type:"button",children:[u.jsx("span",{children:"Build directions with Claude or Codex"}),u.jsx(lr,{on:S.buildDirections})]})]}),!k&&u.jsxs("button",{className:"mt-1 flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs text-[#D1D5DB] transition-colors hover:bg-[#2E2E2E]/60 hover:text-white",onClick:d,type:"button",children:[u.jsx(Pt,{d:It.copy,size:12}),s?"Copied":"Copy reference"]}),u.jsx(Je,{label:"Or double-click any direction in the rail",children:u.jsxs("a",{className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs text-[#D1D5DB] transition-colors hover:bg-[#2E2E2E]/60 hover:text-white",href:r,rel:"noreferrer",target:"_blank",children:[u.jsx("span",{className:"inline-block size-3 rounded-sm border border-current"}),"Open in new tab"]})}),u.jsxs("button",{className:"flex w-full items-center justify-between gap-2 rounded-md px-2 py-1.5 text-left text-xs text-[#D1D5DB] transition-colors hover:bg-[#2E2E2E]/60 hover:text-white",onClick:p,type:"button",children:[u.jsx("span",{children:"Keyboard shortcuts"}),u.jsx("kbd",{className:"rounded border border-[#232328] bg-[#2E2E2E]/60 px-1 py-0.5 font-sans text-[10px] text-[#84848C]",children:"?"})]})]})}function Kv({mac:a,onClose:s,viewer:c}){const r=w.useRef(null),f=Mx(a,c);return w.useEffect(()=>{const d=document.activeElement instanceof HTMLElement?document.activeElement:null;r.current?.focus();const p=y=>{y.key==="Escape"&&(y.preventDefault(),s())};return window.addEventListener("keydown",p),()=>{window.removeEventListener("keydown",p),d?.focus?.()}},[s]),u.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-6 backdrop-blur-sm",onPointerDown:d=>{d.target===d.currentTarget&&s()},children:u.jsxs("div",{"aria-label":"Keyboard shortcuts","aria-modal":"true",className:"w-full max-w-sm rounded-lg border border-[#232328] bg-[#1E1E22] p-4 shadow-2xl focus:outline-none",ref:r,role:"dialog",tabIndex:-1,children:[u.jsx("span",{className:"block pb-3 text-[10px] uppercase tracking-[0.08em] text-[#84848C]",children:"Keyboard"}),u.jsx("dl",{className:"flex flex-col gap-2.5",children:f.map(d=>u.jsxs("div",{className:"flex items-baseline justify-between gap-4",children:[u.jsx("dt",{className:"flex shrink-0 items-baseline gap-1",children:d.keys.map((p,y)=>u.jsxs("span",{className:"flex items-baseline gap-1",children:[y>0&&d.join?u.jsx("span",{className:"text-[10px] text-[#84848C]",children:d.join}):null,u.jsx("kbd",{className:"rounded border border-[#232328] bg-[#2E2E2E]/60 px-1.5 py-0.5 font-sans text-[11px] text-[#E8E8EA]",children:p})]},p))}),u.jsx("dd",{className:"text-right text-xs leading-snug text-[#9CA3AF]",children:d.label})]},d.label))})]})})}function Fv({busy:a,count:s,error:c,fallbackFocusRef:r,name:f,onCancel:d,onConfirm:p}){const y=w.useRef(null),b=w.useRef(null),x=w.useRef(d);x.current=d,w.useEffect(()=>{const k=b.current;if(k===null)return;const N=document.activeElement instanceof HTMLElement?document.activeElement:null,U=O=>{O.preventDefault(),x.current()},$=O=>{if(O.key!=="Tab")return;const V=Array.from(k.querySelectorAll("button:not(:disabled)")),Q=V[0],X=V.at(-1);Q===void 0||X===void 0?(O.preventDefault(),k.focus()):O.shiftKey&&document.activeElement===Q?(O.preventDefault(),X.focus()):!O.shiftKey&&document.activeElement===X&&(O.preventDefault(),Q.focus())};return k.addEventListener("cancel",U),k.addEventListener("keydown",$),k.open||k.showModal(),y.current?.focus(),()=>{k.removeEventListener("cancel",U),k.removeEventListener("keydown",$),k.open&&k.close(),(N?.isConnected?N:r.current)?.focus()}},[]);const S=s===1,M=S?"Delete removed direction?":"Clear removed directions?",T=S?`This permanently removes “${f??"this direction"}” from Leglas.`:`This permanently removes all ${s} directions from Leglas.`;return u.jsx("dialog",{"aria-describedby":"delete-removed-description","aria-labelledby":"delete-removed-title","aria-modal":"true",className:"m-auto max-h-[calc(100dvh-3rem)] max-w-none overflow-visible border-0 bg-transparent p-0 text-left text-inherit backdrop:bg-black/50 backdrop:backdrop-blur-sm",onPointerDown:k=>{k.target===k.currentTarget&&!a&&d()},ref:b,role:"alertdialog",tabIndex:-1,children:u.jsxs("div",{className:"w-[calc(100vw-3rem)] max-w-sm overscroll-contain rounded-lg border border-[#232328] bg-[#1E1E22] p-4 shadow-2xl",children:[u.jsx("h2",{className:"text-sm font-medium text-white",id:"delete-removed-title",children:M}),u.jsxs("div",{className:"mt-2 space-y-1 text-xs leading-relaxed text-[#9CA3AF]",id:"delete-removed-description",children:[u.jsx("p",{children:T}),u.jsx("p",{children:"Source files and shared project config stay untouched."})]}),c!==null?u.jsx("p",{className:"mt-3 text-xs leading-relaxed text-red-300",role:"alert",children:c}):null,u.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[u.jsx("button",{className:"rounded-md px-3 py-1.5 text-xs text-[#D1D5DB] transition-[background-color,color,scale] hover:bg-white/[0.06] hover:text-white active:scale-[0.96] disabled:opacity-50",disabled:a,onClick:d,ref:y,type:"button",children:"Cancel"}),u.jsx("button",{className:"rounded-md bg-red-500/90 px-3 py-1.5 text-xs font-medium text-white transition-[background-color,scale] hover:bg-red-500 active:scale-[0.96] disabled:opacity-60",disabled:a,onClick:p,type:"button",children:a?"Deleting…":S?"Delete":"Delete all"})]})]})})}function Um(a,s,c,r){const f=w.useRef(r);w.useLayoutEffect(()=>{f.current=r},[r]),w.useEffect(()=>{if(!a)return;s.current?.focus();const d=c.current,p=x=>{x.key==="Escape"&&(f.current(),d?.focus())},y=x=>{const S=x.target instanceof Node?x.target:null;!s.current?.contains(S)&&!d?.contains(S)&&f.current()},b=()=>f.current();return window.addEventListener("keydown",p),window.addEventListener("pointerdown",y),window.addEventListener("blur",b),()=>{window.removeEventListener("keydown",p),window.removeEventListener("pointerdown",y),window.removeEventListener("blur",b)}},[a,s,c])}async function Jv(a){const s=await fetch("/leglas/api/share",a===void 0?{}:{signal:a});if(!s.ok)throw new Error(`the server answered ${s.status}`);return Xt(s)}async function Z1(a){const s=await fetch("/leglas/api/share",{body:JSON.stringify(a),headers:{"content-type":"application/json"},method:"POST"});if(!s.ok)throw await Ma(s,"Leglas could not start sharing.");return(await Xt(s)).share}async function Wv(a){const s=await fetch("/leglas/api/share/update",{body:JSON.stringify(a),headers:{"content-type":"application/json"},method:"POST"});if(!s.ok)throw await Ma(s,"Leglas could not update the share.");return(await Xt(s)).share}async function Do(a,s,c){const r=await fetch(`/leglas/api/share${a}`,{body:JSON.stringify(s),headers:{"content-type":"application/json"},method:"POST"});if(!r.ok)throw await Ma(r,c);return(await Xt(r)).share}function Iv(a,s=!1){return Do("/allow",{path:a,subtree:s},"Leglas could not allow that path.")}function Pv(a){return Do("/grants",{name:a},"Leglas could not make another link.")}function eb(a){return Do("/grants/revoke",{id:a},"Leglas could not turn that link off.")}function tb(a){return Do("/grants/extend",{id:a},"Leglas could not extend that link.")}function nb(){return Do("/rotate",{},"Leglas could not replace the links.")}async function K1(){const a=await fetch("/leglas/api/share/stop",{body:"{}",headers:{"content-type":"application/json"},method:"POST"});if(!a.ok)throw await Ma(a,"Leglas could not stop sharing.")}const Hm={cloudflared:"cloudflared",ngrok:"ngrok"},lb=1400;function ab(){return u.jsx("svg",{"aria-hidden":!0,fill:"none",height:"11",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.8",viewBox:"0 0 16 16",width:"11",children:u.jsx("path",{d:"M8 3.5v9M3.5 8h9"})})}function cr({checked:a,detail:s,disabled:c=!1,onPick:r,title:f}){return u.jsxs("button",{"aria-checked":a,className:`flex w-full items-start gap-2.5 rounded-md px-2 py-1.5 text-left transition-colors ${c?"cursor-not-allowed opacity-50":a?"bg-[#2E2E2E]/70":"hover:bg-white/[0.04]"}`,disabled:c,onClick:r,role:"radio",type:"button",children:[u.jsx("span",{"aria-hidden":!0,className:`mt-[3px] flex size-3 shrink-0 items-center justify-center rounded-full border transition-colors ${a?"border-[#E8E8EA]":"border-[#84848C]"}`,children:u.jsx("span",{className:`size-1.5 rounded-full bg-[#E8E8EA] transition-transform duration-150 motion-reduce:transition-none ${a?"scale-100":"scale-0"}`})}),u.jsxs("span",{className:"min-w-0 flex-1",children:[u.jsx("span",{className:`block text-xs ${a?"text-white":"text-[#D1D5DB]"}`,children:f}),u.jsx("span",{className:"mt-0.5 block truncate text-[10px] leading-snug text-[#84848C]",children:s})]})]})}function ib({busy:a,choice:s,displayName:c,onPick:r,onReach:f,onStart:d,provider:p,rail:y,reach:b,seeded:x,stage:S,stageOfPair:M}){const T=s==="rail"?y.request:S.request,k=y.request.titles.length;return u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"block px-1 pb-1 pt-0.5 text-[10px] uppercase tracking-[0.08em] text-[#84848C]",children:"Share"}),u.jsxs("div",{"aria-label":"What to share",className:"flex flex-col gap-0.5",role:"radiogroup",children:[u.jsx(cr,{checked:s==="rail",detail:k===0?"Nothing on the rail can be shared yet":`${k} direction${k===1?"":"s"}${y.leftOut.length===0?", as you see them":` · ${y.leftOut.length} on ${y.leftOut.length===1?"a branch":"branches"} left out`}`,disabled:k===0,onPick:()=>r("rail"),title:"The whole rail"}),u.jsx(cr,{checked:s==="stage",detail:S.request===null?S.reason??"":km(S.request.scope,S.request.titles,c),disabled:S.request===null,onPick:()=>r("stage"),title:M?"The comparison on stage":"The direction on stage"})]}),u.jsx("span",{className:"block px-1 pb-1 pt-2.5 text-[10px] uppercase tracking-[0.08em] text-[#84848C]",children:"How far they can go"}),u.jsxs("div",{"aria-label":"How far a viewer can go",className:"flex flex-col gap-0.5",role:"radiogroup",children:[u.jsx(cr,{checked:b==="open",detail:"Your whole dev server, over GET",onPick:()=>f("open"),title:"Anywhere in the app"}),u.jsx(cr,{checked:b==="listed",detail:x===0?"Open a direction first, so Leglas knows what it loads":`These pages and the ${x} files they loaded`,disabled:x===0,onPick:()=>f("listed"),title:"Only what you shared"})]}),u.jsx("div",{className:"mt-1.5 border-t border-[#232328] px-1 pb-1 pt-2",children:p==="none"?u.jsxs(u.Fragment,{children:[u.jsxs("p",{className:"flex items-center gap-1.5 text-[11px] text-amber-300/90",children:[u.jsx(Vf,{}),"No tunnel program found"]}),u.jsxs("p",{className:"mt-1 text-[10px] leading-snug text-[#84848C]",children:["Install ",u.jsx("span",{className:"text-[#9CA3AF]",children:"cloudflared"})," or"," ",u.jsx("span",{className:"text-[#9CA3AF]",children:"ngrok"})," and Leglas will use it. Without one the link only works on this machine."]})]}):u.jsxs("p",{className:"text-[10px] leading-snug text-[#84848C]",children:["Out through ",u.jsx("span",{className:"text-[#9CA3AF]",children:Hm[p]})," on this machine. The link lives as long as Leglas does."]})}),u.jsx("button",{className:`mt-1 ${vm}`,disabled:a!==null||T===null||T.titles.length===0,onClick:d,type:"button",children:a==="start"?u.jsx(ui,{}):p==="none"?"Start on this machine":"Start sharing"}),u.jsx("p",{className:"px-1 pb-0.5 pt-2 text-[10px] leading-snug text-[#84848C]",children:b==="open"?"They see the real app and can flip, compare and change the width. They cannot change anything, and they read whatever your dev server serves.":"They see the real app and can flip, compare and change the width. Anything outside what you shared is refused, and Leglas tells you what it turned away so you can let it in."})]})}function sb({busy:a,copied:s,grant:c,index:r,now:f,onCopy:d,onExtend:p,onRevoke:y,only:b}){const x=hy(c.expiresAt,f),S=c.expiresAt-f<3600*1e3,M=my(c.name,r);return u.jsxs("li",{className:"group relative flex h-8 items-center gap-2 rounded-md px-2 transition-colors hover:bg-white/[0.04]",children:[u.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-[#D1D5DB]",children:M}),u.jsx("span",{className:`shrink-0 text-[10px] group-hover:hidden group-has-[button:focus-visible]:hidden ${S?"text-amber-300/80":c.viewers>0?"text-[#D1D5DB]":"text-[#84848C]"}`,children:c.viewers>0?`${zm(c.viewers)} · ${x}`:x}),u.jsxs("span",{className:"pointer-events-none absolute right-2 flex shrink-0 items-center gap-0.5 opacity-0 transition-opacity duration-150 group-hover:pointer-events-auto group-hover:opacity-100 group-has-[button:focus-visible]:pointer-events-auto group-has-[button:focus-visible]:opacity-100 motion-reduce:transition-none",children:[u.jsx(Je,{label:s?"Copied":"Copy this link",children:u.jsx("button",{"aria-label":`Copy the ${M} link`,className:Rn,onClick:d,type:"button",children:s?u.jsx("span",{className:"text-[10px] text-emerald-300",children:"✓"}):u.jsx(Pt,{d:It.link})})}),u.jsx(Je,{label:"Another 24 hours",children:u.jsx("button",{"aria-label":`Extend the ${M} link`,className:Rn,disabled:a!==null,onClick:p,type:"button",children:u.jsx(ab,{})})}),u.jsx(Je,{label:b?"Turn off · the last link":"Turn off",children:u.jsx("button",{"aria-label":`Turn the ${M} link off`,className:`${Rn} hover:text-red-300`,disabled:a!==null,onClick:y,type:"button",children:u.jsx(Pt,{d:It.trash,size:12})})})]})]})}function ob({busy:a,onCreate:s}){const[c,r]=w.useState(""),[f,d]=w.useState(!1);return f?u.jsxs("form",{className:"mt-0.5 flex items-center gap-1 px-2 py-1",onSubmit:p=>{p.preventDefault(),s(c.trim()),r(""),d(!1)},children:[u.jsx("input",{"aria-label":"Who this link is for",autoFocus:!0,className:"min-w-0 flex-1 rounded border border-[#232328] bg-[#2E2E2E]/40 px-1.5 py-1 text-[11px] text-white placeholder:text-[#84848C] focus:outline-none focus:ring-1 focus:ring-[#D1D5DB]/40",maxLength:60,onChange:p=>r(p.target.value),onKeyDown:p=>{p.key==="Escape"&&(r(""),d(!1))},placeholder:"Who is it for?",value:c}),u.jsx("button",{className:"shrink-0 rounded px-2 py-1 text-[11px] font-medium text-[#D1D5DB] transition-colors hover:bg-white/[0.06] hover:text-white disabled:opacity-50",disabled:a!==null,type:"submit",children:a==="grant"?u.jsx(ui,{}):"Make"})]}):u.jsx("button",{className:"mt-0.5 w-full rounded-md px-2 py-1.5 text-left text-[11px] text-[#84848C] transition-colors hover:bg-white/[0.04] hover:text-[#D1D5DB] disabled:opacity-50",disabled:a!==null,onClick:()=>d(!0),type:"button",children:"+ Another link"})}function ub({busy:a,changed:s,copiedId:c,displayName:r,now:f,onAllow:d,onCopy:p,onCreate:y,onExtend:b,onRetry:x,onRevoke:S,onRotate:M,onStop:T,onUpdate:k,share:N}){const U=N.tunnel;return u.jsxs(u.Fragment,{children:[u.jsxs("span",{className:"flex items-center gap-1.5 px-1 pb-1 pt-0.5 text-[10px] uppercase tracking-[0.08em] text-[#84848C]",children:[U.status==="ready"?u.jsx(gr,{}):null,"Sharing"]}),u.jsx("div",{"aria-live":"polite",className:"px-1 pb-1.5 text-[11px] leading-snug",children:U.status==="ready"?u.jsxs("p",{className:"flex items-center gap-1.5",children:[u.jsx(gr,{}),u.jsx("span",{className:"min-w-0 flex-1 truncate select-text font-mono text-[10px] text-[#D1D5DB]","data-selectable":!0,children:new URL(N.grants[0]?.url??"http://x").host})]}):U.status==="starting"?u.jsxs("div",{className:"flex items-start gap-1.5 text-[#9CA3AF]",children:[u.jsx("span",{className:"mt-[3px]",children:u.jsx(ui,{})}),U.url===void 0?u.jsxs("span",{children:["Opening a tunnel through ",Hm[U.provider],"…"]}):U.slow?u.jsx("span",{children:"Still waiting for the link to answer from here. New tunnel names take a minute to spread, so it may already work for whoever you send it to."}):u.jsx("span",{children:"Waiting for the link to answer…"})]}):U.status==="failed"?u.jsxs("div",{children:[u.jsxs("p",{className:"flex items-start gap-1.5 text-amber-300/90",children:[u.jsx("span",{className:"mt-0.5",children:u.jsx(Vf,{})}),u.jsx("span",{children:U.reason})]}),u.jsx("button",{className:"mt-1 rounded text-[10px] text-[#9CA3AF] underline underline-offset-2 transition-colors hover:text-white disabled:opacity-50",disabled:a!==null,onClick:x,type:"button",children:"Try again"})]}):u.jsxs("p",{className:"text-[#9CA3AF]",children:["Reachable from this machine only. Point a tunnel of your own at"," ",u.jsxs("span",{className:"select-text font-mono text-[#D1D5DB]","data-selectable":!0,children:["127.0.0.1:",N.sharePort]})," ","and send that host with the same path."]})}),u.jsxs("ul",{"aria-label":"Links into this share",className:"max-h-64 overflow-y-auto",children:[N.grants.map(($,O)=>u.jsx(sb,{busy:a,copied:c===$.id,grant:$,index:O,now:f,onCopy:()=>p($),onExtend:()=>b($),onRevoke:()=>S($),only:N.grants.length===1},$.id)),N.grants.length===0?u.jsx("li",{className:"px-2 py-1.5 text-[11px] text-[#84848C]",children:"No links. Nobody can open this share until you make one."}):null]}),u.jsx(ob,{busy:a,onCreate:y}),N.reach==="listed"&&N.refused.length>0?u.jsxs("div",{className:"mt-1.5 border-t border-[#232328] pt-1.5",children:[u.jsxs("span",{className:"flex items-baseline gap-1.5 px-1 pb-1",children:[u.jsx("span",{className:"text-[10px] uppercase tracking-[0.08em] text-amber-300/90",children:"Turned away"}),u.jsxs("span",{className:"text-[10px] text-[#84848C]",children:[N.refused.length," ",N.refused.length===1?"path":"paths"," your app asked for"]})]}),u.jsx("ul",{"aria-label":"Paths this share turned away",className:"max-h-32 overflow-y-auto",children:N.refused.map($=>{const O=fy($);return u.jsxs("li",{className:"group flex h-7 items-center gap-2 rounded-md px-2 transition-colors hover:bg-white/[0.04]",children:[u.jsx("span",{className:"min-w-0 flex-1 select-text truncate font-mono text-[10px] text-[#D1D5DB]","data-selectable":!0,title:$,children:$}),u.jsxs("span",{className:"flex shrink-0 items-center gap-1 opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-has-[button:focus-visible]:opacity-100 motion-reduce:transition-none",children:[u.jsx("button",{"aria-label":`Let ${$} through`,className:"rounded px-1.5 py-0.5 text-[10px] text-[#9CA3AF] transition-colors hover:bg-white/[0.06] hover:text-white disabled:opacity-50",disabled:a!==null,onClick:()=>d($,!1),type:"button",children:"Allow"}),O===null?null:u.jsx("button",{"aria-label":`Let everything in ${O} through`,className:"rounded px-1.5 py-0.5 text-[10px] text-[#9CA3AF] transition-colors hover:bg-white/[0.06] hover:text-white disabled:opacity-50",disabled:a!==null,onClick:()=>d(O,!0),type:"button",children:"+ folder"})]})]},$)})})]}):null,u.jsxs("p",{className:"truncate px-1 pt-1.5 text-[10px] text-[#84848C]",children:[km(N.scope,N.titles,r),N.reach==="listed"?" · only what you shared":""]}),u.jsxs("div",{className:"mt-2 flex items-center gap-1 border-t border-[#232328] pt-1.5",children:[s?u.jsx("button",{className:"flex h-7 min-w-0 flex-1 items-center justify-center rounded-md bg-[#2E2E2E] px-2 text-xs font-medium text-white transition-[background-color,transform] duration-150 hover:bg-[#3A3A40] active:scale-[0.98] disabled:opacity-50 motion-reduce:transition-none",disabled:a!==null,onClick:k,type:"button",children:a==="update"?u.jsx(ui,{}):"Update what they see"}):u.jsx("span",{className:"min-w-0 flex-1 truncate px-2 text-[10px] text-[#84848C]",children:N.scope==="rail"?"They see the rail as you do":"They see what you shared"}),u.jsx(Je,{label:u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"block",children:"Replace every link."}),u.jsx("span",{className:"block text-[#9CA3AF]",children:"For when one got somewhere you did not mean to send it."})]}),wide:!0,children:u.jsx("button",{"aria-label":"Replace every link and the address with them",className:"flex h-7 shrink-0 items-center justify-center rounded-md px-2 text-xs text-[#9CA3AF] transition-[color,background-color,transform] duration-150 hover:bg-white/[0.06] hover:text-white active:scale-[0.98] disabled:opacity-50 motion-reduce:transition-none",disabled:a!==null,onClick:M,type:"button",children:a==="rotate"?u.jsx(ui,{}):"Replace all"})}),u.jsx("button",{className:"flex h-7 shrink-0 items-center justify-center rounded-md px-2.5 text-xs text-[#9CA3AF] transition-[color,background-color,transform] duration-150 hover:bg-white/[0.06] hover:text-red-300 active:scale-[0.98] disabled:opacity-50 motion-reduce:transition-none",disabled:a!==null,onClick:T,type:"button",children:a==="stop"?u.jsx(ui,{}):"Stop"})]})]})}function rb({active:a,compare:s,displayName:c,notify:r,onClose:f,open:d,prefs:p,previews:y,share:b,triggerRef:x,tunnels:S}){const M=w.useRef(null),[T,k]=w.useState("rail"),[N,U]=w.useState("open"),[$,O]=w.useState(null),[V,Q]=w.useState(null),[X,ae]=w.useState(()=>Date.now());w.useEffect(()=>{if(!d)return;ae(Date.now());const L=window.setInterval(()=>ae(Date.now()),6e4);return()=>window.clearInterval(L)},[d]);const P=w.useRef(null),v=w.useRef(null),ne=w.useRef(null);Um(d,M,x,f);const[ce,te]=w.useState([]),xe=w.useMemo(()=>A1(p,y).request.titles,[p,y]);w.useEffect(()=>{d&&te(cy(document.querySelectorAll("iframe[data-preview]"),xe,window.location.origin))},[d,xe]);const re=w.useMemo(()=>A1(p,y,N,ce),[p,y,N,ce]),Ee=w.useMemo(()=>oy(p,y,a,s,N,ce),[p,y,a,s,N,ce]),ye=S[0]??"none",De=b===null?null:b.scope==="rail"?re.request:Ee.request,R=b!==null&&De!==null&&!uy(De,{scope:b.scope,titles:b.titles,layout:b.layout,reach:b.reach,routes:b.routes}),W=b?.grants[0]??null,oe=W===null?null:W.url!==null?W.url:b?.tunnel.status==="none"?W.localUrl:null;w.useEffect(()=>()=>{P.current&&clearTimeout(P.current)},[]);const Ce=(L,Z=!1,ie=null)=>wr(L).then(pe=>{if(pe==="blocked"){if(Q(null),Z)return;r({detail:L,kind:"share",message:"Your browser blocked the clipboard. The link is:",tone:"danger",ttl:null});return}Q(ie),P.current&&clearTimeout(P.current),P.current=setTimeout(()=>Q(null),lb),Z||r({kind:"share",message:"Share link copied",tone:"success",ttl:Xe.plain})}),we=b?.tunnel.status??null;w.useEffect(()=>{if(!(b===null||oe===null||v.current!==b.id)){if(ne.current!==b.id){ne.current=b.id,Ce(oe,!0).then(()=>r({kind:"share",message:we==="ready"||we==="none"?"Your share is live. Link copied.":"Share link copied. Waiting for it to answer…",tone:"success",ttl:Xe.action}));return}we==="ready"&&r({kind:"share",message:"Your share is live.",tone:"success",ttl:Xe.plain})}},[b?.id,oe,we]);const E=(L,Z)=>r({kind:"share",message:L instanceof Error?L.message:Z,tone:"danger",ttl:Xe.action}),G=L=>{$===null&&(O("start"),Z1({...L,tunnel:ye}).then(Z=>{v.current=Z.id}).catch(Z=>E(Z,"Leglas could not start sharing.")).finally(()=>O(null)))},le=()=>{$===null&&(O("stop"),K1().then(()=>{r({kind:"share",message:"Stopped sharing",tone:"info",ttl:Xe.plain})}).catch(L=>E(L,"Leglas could not stop sharing.")).finally(()=>O(null)))},ue=()=>{$!==null||De===null||(O("update"),Wv(De).then(()=>{r({kind:"share",message:"Viewers now see the rail as you do",tone:"success",ttl:Xe.plain})}).catch(L=>E(L,"Leglas could not update the share.")).finally(()=>O(null)))},se=(L,Z,ie)=>{$===null&&(O(L),Z().then(()=>{r({kind:"share",message:ie,tone:"success",ttl:Xe.plain})}).catch(pe=>E(pe,"That did not work.")).finally(()=>O(null)))},Se=()=>{if($!==null||b===null)return;const L={scope:b.scope,titles:b.titles,layout:b.layout,reach:b.reach,routes:b.routes};O("start"),K1().then(()=>Z1({...L,tunnel:ye})).then(Z=>{v.current=Z.id}).catch(Z=>E(Z,"Leglas could not start sharing.")).finally(()=>O(null))};return u.jsx("div",{"aria-hidden":!d,"aria-label":"Share",className:`absolute inset-x-3 top-full z-30 mt-1.5 origin-top-right rounded-lg border border-[#232328] bg-[#1E1E22] p-1.5 text-[#D1D5DB] shadow-2xl transition-[opacity,transform] duration-150 ease-[cubic-bezier(0.165,0.84,0.44,1)] focus:outline-none motion-reduce:transition-none ${d?"translate-y-0 scale-100 opacity-100":"pointer-events-none -translate-y-1 scale-95 opacity-0"}`,inert:!d,ref:M,role:"dialog",tabIndex:-1,children:b===null?u.jsx(ib,{busy:$,choice:T,onReach:U,reach:N,seeded:ce.length,displayName:c,onPick:k,onStart:()=>{const L=T==="rail"?re.request:Ee.request;L!==null&&G(L)},provider:ye,rail:re,stage:Ee,stageOfPair:s!==null&&s!==a}):u.jsx(ub,{busy:$,changed:R,copiedId:V,displayName:c,now:X,onAllow:(L,Z)=>se("allow",()=>Iv(L,Z),`${L} is in`),onCopy:L=>{const Z=L.url??L.localUrl;Ce(Z,!1,L.id)},onCreate:L=>se("grant",()=>Pv(L),L===""?"Link made":`Link for ${L}`),onExtend:L=>se("extend",()=>tb(L.id),"Another 24 hours on that link"),onRetry:Se,onRevoke:L=>se("revoke",()=>eb(L.id),"That link is off"),onRotate:()=>se("rotate",()=>nb(),"Every link replaced, and the address with them"),onStop:le,onUpdate:ue,share:b})})}const cb=6e4,fb={share:null,tunnels:[]};function db(a){const[s,c]=w.useState(fb),r=s.share!==null;return w.useEffect(()=>{if(!a)return;let f=!1;const d=rs(p=>Jv(p).then(y=>{f||c(b=>JSON.stringify(b)===JSON.stringify(y)?b:y)}).catch(()=>{}),{everyMs:r?Mo:cb,subscribe:p=>us().on("share",p)});return()=>{f=!0,d()}},[a,r]),s}const hb=9e4,mb=6*6e4,fr="https://leglas.vercel.app/changelog/",Gf="leglas:updated";function $m(a){return a!==null&&a.available&&a.latest!==null&&a.latest.version!==a.skipped}function F1(a){return a===null?"Leglas":$m(a)&&a.latest!==null?`${a.latest.version} is out`:`Leglas ${a.version}`}function pb(a,s){const c=s-Date.parse(a);if(!Number.isFinite(c)||c<6e4)return"just now";const r=Math.floor(c/6e4);if(r<60)return`${r} minute${r===1?"":"s"} ago`;const f=Math.floor(r/60);if(f<24)return`${f} hour${f===1?"":"s"} ago`;const d=Math.floor(f/24);return d===1?"yesterday":`${d} days ago`}function qm(a,s){return a.replace("@latest",`@${s}`)}function Ym(a){switch(a){case"pnpm":return"pnpm dlx";case"bun":return"bunx";case"yarn":return"yarn dlx";default:return"npx"}}function J1(a){if(a===null)return"npx leglas";switch(a.install.kind){case"npx":return`${Ym(a.install.manager)} leglas`;case"project":return`${a.install.manager==="npm"?"npx":`${a.install.manager} exec`} leglas`;default:return"leglas"}}function W1(a){return{heading:"Restarting Leglas",detail:`This page reloads once ${a} answers.`,spinner:!0}}function gb(a,s){const{install:c}=a;if(c.kind==="source")return"You run Leglas from a checkout, so pull to update.";if(a.busy)return"Wait for the running change to finish, then update.";if(c.kind==="npx")return`Restarts Leglas with ${s} through ${Ym(c.manager)}. Your rail stays as it is.`;if(c.command===null)return null;const r=c.kind==="project"?" in this project":"";return`Runs ${qm(c.command,s)}${r}, then restarts Leglas. Your rail stays as it is.`}function xb(a,s,c,r){const f={heading:"Leglas",title:null,detail:null,meta:null,note:null,link:null,spinner:!1,warning:!1,primary:null,skip:!1};if(s.status==="waiting")return{...f,...W1(s.version)};if(s.status==="wrong")return{...f,heading:"Something else answered",detail:`Leglas ${s.got} is on this port now, not the ${s.version} that was installed.`,note:`Start it again from your terminal: ${J1(a)}`,warning:!0};if(s.status==="lost")return{...f,heading:"Leglas did not come back",detail:`${s.version} was installed, but nothing answered here.`,note:`Look in the terminal: it may have started on another port. Otherwise start it again there with ${J1(a)}.`,warning:!0};if(a===null)return{...f,detail:"Reading…",spinner:!0};const{phase:d}=a;if(d.status==="installing")return{...f,heading:`Updating to ${d.version}`,detail:`Installing with ${a.install.manager}…`,spinner:!0};if(d.status==="waiting")return{...f,heading:`Updating to ${d.version}`,detail:"Installed. Waiting for the running change to finish, then restarting.",spinner:!0};if(d.status==="restarting")return{...f,...W1(d.version)};if(d.status==="failed")return{...f,heading:`Could not update to ${d.version}`,detail:d.reason,note:a.install.command===null?null:`Or run ${qm(a.install.command,d.version)} yourself.`,warning:!0,primary:{label:"Try again",action:"install",disabled:a.busy}};const p=c||d.status==="checking";if(a.available&&a.latest!==null){const{latest:x}=a,S=x.version===a.skipped,M=a.install.kind!=="source";return{...f,heading:`${x.version} is out`,title:x.title,detail:S?"Skipped. Nothing will nag until the next release.":null,meta:`You have ${a.version}`,note:gb(a,x.version),link:{label:"What's new",url:x.url},primary:M?{label:S?"Update anyway":"Update",action:"install",disabled:a.busy}:null,skip:!S}}const y=a.checkedAt===null?null:pb(a.checkedAt,r),b=y===null?null:`Checked ${y}`;return p?{...f,heading:a.version,detail:"Asking npm…",meta:b,link:{label:"Changelog",url:fr},spinner:!0,primary:{label:"Check again",action:"check",disabled:!0}}:a.checkError!==null?{...f,heading:a.version,detail:a.checkError,meta:y===null?null:`Last answer ${y}`,link:{label:"Changelog",url:fr},warning:!0,primary:{label:"Try again",action:"check",disabled:!1}}:a.latest===null?{...f,heading:a.version,detail:"Not checked yet.",link:{label:"Changelog",url:fr},primary:{label:"Check for updates",action:"check",disabled:!1}}:{...f,heading:a.version,detail:"This is the latest version.",meta:b,link:{label:"Changelog",url:fr},primary:{label:"Check again",action:"check",disabled:!1}}}const yb="flex h-7 shrink-0 items-center justify-center rounded-md px-2.5 text-xs text-[#9CA3AF] transition-colors duration-150 hover:bg-white/[0.06] hover:text-[#D1D5DB] disabled:cursor-not-allowed disabled:opacity-50 motion-reduce:transition-none",vb="flex h-7 flex-1 items-center justify-center rounded-md border border-[#2E2E33] px-3 text-xs text-[#D1D5DB] transition-colors duration-150 hover:bg-white/[0.04] hover:text-white motion-reduce:transition-none";function bb({onClose:a,open:s,triggerRef:c,updates:r}){const f=w.useRef(null);Um(s,f,c,a);const[d,p]=w.useState(()=>Date.now());w.useEffect(()=>{if(!s)return;p(Date.now());const x=window.setInterval(()=>p(Date.now()),6e4);return()=>window.clearInterval(x)},[s]);const y=xb(r.status,r.wait,r.checking,d),b=()=>{y.primary!==null&&(y.primary.action==="check"?r.check():r.install())};return u.jsxs("div",{"aria-hidden":!s,"aria-label":"Updates",className:`absolute inset-x-3 top-full z-30 mt-1.5 origin-top-left rounded-lg border border-[#232328] bg-[#1E1E22] p-1.5 text-[#D1D5DB] shadow-2xl transition-[opacity,transform] duration-150 ease-[cubic-bezier(0.165,0.84,0.44,1)] focus:outline-none motion-reduce:transition-none ${s?"translate-y-0 scale-100 opacity-100":"pointer-events-none -translate-y-1 scale-95 opacity-0"}`,inert:!s,ref:f,role:"dialog",tabIndex:-1,children:[u.jsxs("div",{className:"flex items-center justify-between px-1 pb-1.5 pt-0.5",children:[u.jsx("span",{className:"text-[10px] uppercase tracking-[0.08em] text-[#84848C]",children:"Leglas"}),y.link!==null&&u.jsx("a",{className:"text-[10px] text-[#84848C] transition-colors hover:text-[#D1D5DB]",href:y.link.url,rel:"noreferrer",target:"_blank",children:y.link.label})]}),u.jsxs("div",{className:"px-1",children:[u.jsx("p",{className:"text-xs leading-snug text-white",children:y.heading}),y.title!==null&&u.jsx("p",{className:"mt-0.5 text-[11px] leading-snug text-[#D1D5DB]",children:y.title}),y.detail!==null&&u.jsxs("p",{"aria-live":"polite",className:`mt-1 flex items-start gap-1.5 text-[10px] leading-snug ${y.warning?"text-amber-300/90":"text-[#9CA3AF]"}`,children:[y.spinner&&u.jsx("span",{className:"mt-px",children:u.jsx(ui,{})}),y.warning&&u.jsx("span",{className:"mt-px",children:u.jsx(Vf,{})}),u.jsx("span",{children:y.detail})]}),y.meta!==null&&u.jsx("p",{className:"mt-0.5 text-[10px] leading-snug text-[#84848C]",children:y.meta})]}),(y.primary!==null||y.skip)&&u.jsxs("div",{className:"mt-2.5 flex items-center gap-1 px-1",children:[y.primary!==null&&u.jsx("button",{className:vm,disabled:y.primary.disabled,onClick:b,type:"button",children:y.primary.label}),y.skip&&u.jsx("button",{className:y.primary===null?vb:yb,onClick:r.skip,type:"button",children:y.primary===null?"Skip this version":"Skip"})]}),y.note!==null&&u.jsx("p",{className:"px-1 pb-0.5 pt-2 text-[10px] leading-snug text-[#84848C]",children:y.note})]})}async function wb(a){const s=await fetch("/leglas/api/update",a===void 0?{}:{signal:a});if(!s.ok)throw await Ma(s,`the server answered ${s.status}`);return Xt(s)}function Sb(){return Kf("/leglas/api/update/check",{},"Leglas could not check for updates.")}function jb(a){return Kf("/leglas/api/update/skip",{version:a},"Leglas could not skip that version.")}function Eb(){return Kf("/leglas/api/update/install",{},"Leglas could not start the update.")}const Cb=15*6e4,Nb=15e3,Mb=1e3;function I1(a){if(a===null)return null;const{phase:s}=a;return s.status==="installing"||s.status==="waiting"?{version:s.version,allowance:mb}:s.status==="restarting"?{version:s.version,allowance:hb}:null}function Ab(a){try{window.sessionStorage.setItem(Gf,a)}catch{}window.location.reload()}function Db(a,s,c){const[r,f]=w.useState(null),[d,p]=w.useState({status:"none"}),[y,b]=w.useState(!1),x=w.useRef({status:r,wait:d,notify:c});w.useEffect(()=>{x.current={status:r,wait:d,notify:c}});const S=d.status==="waiting";w.useEffect(()=>{if(!a)return;let $=!1;const O=rs(V=>wb(V).then(Q=>{if($)return;const X=x.current;if(X.status!==null&&Q.version!==X.status.version){const ae=X.wait.status!=="none"?X.wait.version:I1(X.status)?.version??null;if(ae===null||Q.version===ae){Ab(Q.version);return}(X.wait.status!=="wrong"||X.wait.got!==Q.version)&&p({status:"wrong",version:ae,got:Q.version})}else X.wait.status!=="none"&&p({status:"none"});f(ae=>JSON.stringify(ae)===JSON.stringify(Q)?ae:Q)}).catch(()=>{if($||x.current.wait.status!=="none")return;const Q=I1(x.current.status);if(Q===null)return;const X=Date.now();p({status:"waiting",version:Q.version,since:X,until:X+Q.allowance})}),{everyMs:S?Mb:s?Nb:Cb,subscribe:V=>us().on("update",V)});return()=>{$=!0,O()}},[a,s,S]),w.useEffect(()=>{if(d.status!=="waiting")return;const{version:$,until:O}=d,V=window.setTimeout(()=>p(Q=>Q.status==="waiting"?{status:"lost",version:$}:Q),Math.max(0,O-Date.now()));return()=>window.clearTimeout(V)},[d]);const M=r!==null;w.useEffect(()=>{if(!M)return;let $=null;try{$=window.sessionStorage.getItem(Gf),$!==null&&window.sessionStorage.removeItem(Gf)}catch{return}$!==null&&x.current.notify({kind:"update",message:`Leglas is now ${x.current.status?.version??$}`,tone:"success",ttl:Xe.action})},[M]);const T=$=>O=>x.current.notify({kind:"update",message:O instanceof Error?O.message:$,tone:"danger",ttl:Xe.action});return{status:r,wait:d,checking:y,check:()=>{y||(b(!0),Sb().then($=>f($)).catch(T("Leglas could not check for updates.")).finally(()=>b(!1)))},skip:()=>{const $=x.current.status?.latest?.version;$!==void 0&&jb($).then(O=>{f(O),x.current.notify({kind:"update",message:`${$} skipped`,note:"Nothing will nag until the next release.",tone:"info",ttl:Xe.plain})}).catch(T("Leglas could not skip that version."))},install:()=>{Eb().then($=>f($)).catch(T("Leglas could not start the update."))}}}function Tb({buttonRef:a,news:s,onToggle:c,open:r,status:f}){return u.jsx(Je,{label:F1(f),children:u.jsxs("button",{"aria-expanded":r,"aria-haspopup":"dialog","aria-label":s?`Leglas ${f.version}. ${F1(f)}. Open updates`:`Leglas ${f.version}. Open updates`,className:`relative mt-px flex h-5 shrink-0 items-center rounded px-1 text-[10px] font-medium leading-none tabular-nums transition-colors duration-150 hover:bg-white/[0.06] ${s||r?"text-[#D1D5DB] hover:text-white":"text-[#84848C] hover:text-[#D1D5DB]"}`,onClick:c,ref:a,type:"button",children:[f.version,s&&u.jsx("span",{"aria-hidden":!0,className:"absolute -right-px top-0 size-1.5 rounded-full bg-[#7C9CFF]"})]})})}function kb({active:a,briefing:s,compare:c,displayName:r,notify:f,onBuild:d,onCollapse:p,prefs:y,previews:b,viewing:x}){const[S,M]=w.useState(!1),T=w.useCallback(()=>M(!1),[]),k=w.useRef(null),N=db(!x),[U,$]=w.useState(!1),O=w.useCallback(()=>$(!1),[]),V=w.useRef(null),Q=Db(!x,U,f),X=$m(Q.status);return u.jsxs("div",{className:"relative z-10 flex shrink-0 items-center justify-between gap-2 border-b border-[#232328] bg-[#1E1E22] px-2.5 py-2.5",children:[u.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[u.jsx(No,{size:28}),u.jsx(ym,{height:18}),!x&&Q.status!==null&&u.jsx(Tb,{buttonRef:V,news:X,onToggle:()=>{M(!1),$(ae=>!ae)},open:U,status:Q.status})]}),u.jsxs("span",{className:"flex shrink-0 items-center gap-0.5",children:[d!==null&&u.jsx(Je,{label:"Build new directions",children:u.jsx("button",{"aria-label":"Build a set of new directions","aria-pressed":s,className:`flex h-6 w-6 shrink-0 items-center justify-center rounded p-1 transition-colors hover:bg-[#2E2E2E] hover:text-white ${s?"text-white":"text-[#9CA3AF]"}`,onClick:d,type:"button",children:u.jsx(Pt,{d:It.plus,size:13})})}),!x&&u.jsx(Je,{label:N.share===null?"Share this rail":N.share.tunnel.status==="ready"?`Sharing · ${zm(dy(N.share.grants))}`:"Sharing",children:u.jsxs("button",{"aria-expanded":S,"aria-haspopup":"dialog","aria-label":N.share===null?"Share":"Sharing. Open the share panel",className:`relative flex h-6 w-6 shrink-0 items-center justify-center rounded p-1 transition-colors hover:bg-[#2E2E2E] hover:text-white ${S||N.share!==null?"text-white":"text-[#9CA3AF]"}`,onClick:()=>{$(!1),M(ae=>!ae)},ref:k,type:"button",children:[u.jsx(lx,{}),N.share!==null&&u.jsx(gr,{className:"absolute right-0 top-0"})]})}),u.jsx(Je,{label:u.jsxs(u.Fragment,{children:["Collapse panel ",u.jsx("kbd",{className:"ml-1 text-[#9CA3AF]",children:"["})]}),side:"right",children:u.jsx("button",{"aria-label":"Collapse the directions panel",className:"flex h-6 w-6 shrink-0 items-center justify-center rounded p-1 text-[#9CA3AF] transition-colors hover:bg-[#2E2E2E] hover:text-white",onClick:p,type:"button",children:u.jsx(Pt,{d:It.sidebar,size:16})})})]}),!x&&u.jsx(bb,{onClose:O,open:U,triggerRef:V,updates:Q}),!x&&u.jsx(rb,{active:a,compare:c,displayName:r,notify:f,onClose:T,open:S,prefs:y,previews:b,share:N.share,triggerRef:k,tunnels:N.tunnels})]})}function zb({children:a,displayName:s,name:c,preview:r,quiet:f}){const d=f?null:$f(r);return d===null?u.jsx(u.Fragment,{children:a}):u.jsx(Je,{label:u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"block text-white",children:c}),r?.note?u.jsx("span",{className:"mt-0.5 block font-normal text-[#D1D5DB]",children:r.note}):null,u.jsxs("span",{className:"mt-1.5 block border-t border-white/10 pt-1.5 font-normal text-[#84848C]",children:[d.basedOn===null?null:u.jsxs("span",{className:"block",children:["Variant of ",s(d.basedOn)]}),d.askedFor===null?null:u.jsxs("span",{className:"mt-0.5 block",children:["You asked for “",d.askedFor,"”"]})]})]}),side:"right",wide:!0,children:a})}const Bf=["#34D399","#38BDF8","#818CF8","#C084FC","#FB7185","#FB923C"];function Rb(a){let s=0;for(const r of a)s=s*31+r.charCodeAt(0)|0;const c=Bf[Math.abs(s)%Bf.length]??Bf[0];return{backgroundColor:`${c}22`,color:c}}function Ob(a){let s=0;for(const c of a)s=s*31+c.charCodeAt(0)|0;return Math.abs(s).toString(36)}function Lb({agent:a,aside:s,slot:c}){return c.state==="building"||c.state==="checking"?u.jsxs("span",{className:`flex h-5 shrink-0 items-center gap-1 rounded bg-white/[0.04] pl-0.5 pr-1.5 text-[10px] font-medium leading-none text-[#84848C]/80 ${s}`,children:[u.jsx(mr,{"aria-label":c.state==="building"?`${a} is building this direction`:"Checking this direction renders",size:20,state:pr,theme:"dark"}),c.state==="building"?"Building":"Checking"]}):c.state==="failed"?u.jsx(Je,{label:c.failure?.message??"It did not build.",children:u.jsx("span",{className:`shrink-0 rounded bg-amber-400/10 px-1.5 py-0.5 text-[10px] font-medium leading-normal text-amber-300/90 ${s}`,children:"Failed"})}):u.jsx("span",{className:`shrink-0 rounded bg-white/[0.04] px-1.5 py-0.5 text-[10px] font-medium leading-normal text-[#84848C] ${s}`,children:"Stopped"})}function _b({agent:a,aside:s,carrying:c,comparing:r,same:f,scanning:d,slot:p,tag:y,working:b}){return c>0?u.jsxs("span",{className:`shrink-0 rounded bg-white/[0.08] px-1.5 py-0.5 text-[10px] font-medium leading-normal tabular-nums text-[#E8E8EA] ${s}`,children:["+",c]}):r?u.jsx("span",{className:`shrink-0 rounded bg-white/[0.08] px-1.5 py-0.5 text-[10px] font-medium leading-normal text-[#E8E8EA] ${s}`,children:"Comparing"}):p!==null&&p.state!=="ready"?u.jsx(Lb,{agent:a,aside:s,slot:p}):b?u.jsxs("span",{className:`flex h-5 shrink-0 items-center gap-1 rounded bg-white/[0.04] pl-0.5 pr-1.5 text-[10px] font-medium leading-none text-[#84848C]/80 ${s}`,children:[u.jsx(mr,{"aria-label":"Working on direction",size:20,state:pr,theme:"dark"}),"Cooking"]}):f?u.jsx(Je,{label:`Rendered structure, layout, visual styles, media and vector geometry match ${f?.join(", ")} in a 1280 × 800 comparison.`,children:u.jsxs("span",{className:`shrink-0 rounded bg-amber-400/10 px-1.5 py-0.5 text-[10px] font-medium leading-normal text-amber-300/90 ${s}`,children:["Same as ",f?.length===1?f?.[0]:`${f?.length} others`]})}):d?u.jsxs("span",{className:`flex h-5 shrink-0 items-center gap-1 rounded bg-white/[0.04] pl-0.5 pr-1.5 text-[10px] font-medium leading-none text-[#84848C]/80 ${s}`,children:[u.jsx(mr,{"aria-label":"Checking for duplicates",size:20,state:pr,theme:"dark"}),"Cooking"]}):y!==void 0&&u.jsx("span",{className:`shrink-0 rounded px-1.5 py-0.5 text-[10px] font-medium leading-normal ${s}`,style:Rb(y),children:y})}function Bb({className:a,name:s,onRemove:c,slot:r}){const f=r.slot.state==="building"||r.slot.state==="checking";return u.jsx("div",{className:a,children:f?u.jsx(Je,{label:"Stop building",children:u.jsx("button",{"aria-label":`Stop building the ${s} direction`,className:`${Rn} disabled:cursor-wait disabled:opacity-40`,disabled:r.acting,onClick:d=>{d.stopPropagation(),r.onStop()},type:"button",children:u.jsx("span",{className:"block size-2 rounded-[2px] bg-current"})})}):u.jsxs(u.Fragment,{children:[u.jsx(Je,{label:r.slot.state==="failed"?"Try again":"Build it",children:u.jsx("button",{"aria-label":`Build the ${s} direction again`,className:`${Rn} disabled:cursor-wait disabled:opacity-40`,disabled:r.acting,onClick:d=>{d.stopPropagation(),r.onRetry()},type:"button",children:u.jsxs(Ao,{children:[u.jsx("path",{d:"M13.5 8a5.5 5.5 0 1 1-1.6-3.9"}),u.jsx("path",{d:"M13.7 1.8v2.7H11"})]})})}),u.jsx(Je,{label:"Try a new idea",children:u.jsx("button",{"aria-label":`Replace the ${s} direction with a new idea`,className:`${Rn} disabled:cursor-wait disabled:opacity-40`,disabled:r.acting,onClick:d=>{d.stopPropagation(),r.onReplace()},type:"button",children:u.jsx(Ao,{children:u.jsx("path",{d:"M8 2.5 9.3 6.7 13.5 8 9.3 9.3 8 13.5 6.7 9.3 2.5 8 6.7 6.7Z"})})})}),u.jsx(Je,{label:"Remove from list",children:u.jsx("button",{"aria-label":`Remove the ${s} direction from the list`,className:Rn,onClick:c,type:"button",children:u.jsx(Pt,{d:It.trash,size:12})})})]})})}function Ub({comparing:a,dragging:s,onToggleCompare:c,renaming:r,slot:f,st:d,title:p,viewing:y}){const b=`pointer-events-none absolute right-2 top-1.5 flex items-center gap-0.5 opacity-0 transition-opacity duration-150 ${r?"invisible":""} ${s?"":"group-hover:pointer-events-auto group-hover:opacity-100 group-has-[button:focus-visible]:pointer-events-auto group-has-[button:focus-visible]:opacity-100"}`;return f!==null&&f.slot.state!=="ready"&&!y?u.jsx(Bb,{className:b,name:d.displayName(p),onRemove:()=>d.hide(p),slot:f}):u.jsxs("div",{className:b,children:[p!==d.active&&u.jsx(Je,{label:a?"Stop comparing":`Compare with ${d.displayName(d.active)}`,children:u.jsx("button",{"aria-label":a?`Stop comparing ${d.displayName(p)}`:`Compare ${d.displayName(p)} with ${d.displayName(d.active)}`,"aria-pressed":a,className:`${Rn} ${a?"text-white":""}`,onClick:x=>{x.stopPropagation(),c()},type:"button",children:u.jsx(Pt,{d:It.split})})}),!y&&u.jsxs(u.Fragment,{children:[u.jsx(Je,{label:d.copied?.kind==="link"&&d.copied.title===p?"Copied":"Copy preview link",children:u.jsx("button",{"aria-label":`Copy the preview link to the ${d.displayName(p)} direction`,className:Rn,onClick:()=>d.copyLink(p),type:"button",children:d.copied?.kind==="link"&&d.copied.title===p?u.jsx("span",{className:"text-[10px] text-emerald-300",children:"✓"}):u.jsx(Pt,{d:It.link})})}),u.jsx(Je,{label:d.copied?.kind==="reference"&&d.copied.title===p?"Copied":u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"block",children:"Copy a detailed reference."}),u.jsx("span",{className:"block",children:"For a teammate or an agent."})]}),children:u.jsx("button",{"aria-label":`Copy a detailed reference to the ${d.displayName(p)} direction`,className:Rn,onClick:()=>d.copyReference(p),type:"button",children:d.copied?.kind==="reference"&&d.copied.title===p?u.jsx("span",{className:"text-[10px] text-emerald-300",children:"✓"}):u.jsx(Pt,{d:It.copy,size:12})})}),u.jsx(Je,{label:"Rename",children:u.jsx("button",{"aria-label":`Rename the ${d.displayName(p)} direction`,className:Rn,onClick:()=>d.startRename(p),type:"button",children:u.jsx(Pt,{d:It.pencil,size:12})})}),u.jsx(Je,{label:"Remove from list",children:u.jsx("button",{"aria-label":`Remove the ${d.displayName(p)} direction from the list`,className:Rn,onClick:()=>d.hide(p),type:"button",children:u.jsx(Pt,{d:It.trash,size:12})})})]})]})}function Hb({arriving:a,comparing:s,crumbBloom:c,drag:r,dragMeta:f,dragging:d,freshFor:p,gutter:y,index:b,insets:x,lit:S,onEnter:M,onFold:T,onOpenAlone:k,onPick:N,onPointerDown:U,onToggleCompare:$,same:O,scanning:V,shiftFor:Q,st:X,tint:ae,title:P,slot:v,viewing:ne,working:ce}){const te=P===X.active,xe=v?.slot.state==="building"||v?.slot.state==="checking",re=ce||xe,Ee=X.previewFor(P),ye=d&&r?.title===P,De=d&&!ye?Q(b):0,R=X.rowMeta.get(P),oe=(R?.depth??0)>0,Ce=d&&X.dragFolded.has(P)&&(R?.variants??0)===0?R?.descendants??0:0,we=oe?x.variant:x.root,E=R?.variants??0,G=R?.folded??!1,le=X.renaming===P,ue=ye&&r?.blocked?"opacity-0 transition-opacity duration-150":d||le?"transition-opacity duration-150":"group-hover:hidden group-has-[button:focus-visible]:hidden";return u.jsxs("li",{className:`group relative ${ye?`z-30 ${r?.settling?`transition-transform duration-200 ${ci} motion-reduce:transition-none`:""}`:"z-10"} ${d&&!ye?`transition-transform duration-200 ${ci} motion-reduce:transition-none`:""}`,"data-title":P,onPointerEnter:se=>M(se.currentTarget),style:{...ye?{transform:`translateY(${r?.dy??0}px)`}:De?{transform:`translateY(${De}px)`}:{},paddingLeft:we,viewTransitionName:`row-${Ob(P)}`},children:[ye&&r?.reason!=null?u.jsx("span",{"aria-live":"polite",className:`pointer-events-none absolute right-2 top-1.5 z-40 rounded bg-white/[0.1] px-1.5 py-0.5 text-[10px] font-medium leading-normal text-[#E8E8EA] shadow-md transition-opacity duration-150 motion-reduce:transition-none ${r.blocked?"opacity-100":"opacity-0"}`,children:r.reason}):null,y>0&&R?.graph?u.jsx(V2,{active:te,arriving:a(P),bloom:c.title===P?c.nonce:0,delay:Math.min(b,12)*28,family:(R?.descendants??0)>0,folded:R?.folded??!1,fresh:p(P),lit:S,row:R.graph,tint:ae,width:y,working:re}):null,u.jsx(zb,{displayName:X.displayName,name:X.displayName(P),preview:Ee,quiet:le,children:u.jsx("div",{"aria-pressed":te,className:`relative flex w-full items-start gap-2 rounded-md py-2 pl-3 pr-3 text-left transition-colors ${ne?"cursor-pointer":"cursor-grab active:cursor-grabbing"} ${te?"bg-[#2E2E2E] ring-1 ring-inset ring-[#D1D5DB]/40":ye?"bg-white/[0.06]":""} ${ye?"shadow-2xl":""}`,onClick:()=>{if(!le){if(f.current?.suppressed){f.current.suppressed=!1;return}N(),X.setActive(P)}},onDoubleClick:se=>{le||se.target instanceof Element&&se.target.closest("button")||(window.getSelection()?.removeAllRanges(),k())},onKeyDown:se=>{se.target===se.currentTarget&&(se.key==="Enter"||se.key===" ")&&(se.preventDefault(),N(),X.setActive(P))},onPointerDown:U,role:"button",tabIndex:0,children:u.jsxs("span",{className:"min-w-0 flex-1",children:[u.jsxs("span",{className:`flex items-center gap-2 ${d||le?"":ne?te?"":"group-hover:pr-[20px] group-has-[button:focus-visible]:pr-[20px]":te?"group-hover:pr-[72px] group-has-[button:focus-visible]:pr-[72px]":"group-hover:pr-[98px] group-has-[button:focus-visible]:pr-[98px]"}`,children:[E>0&&u.jsx(Je,{label:G?`Show ${E} variant${E===1?"":"s"}`:"Fold the variants away",children:u.jsxs("button",{"aria-expanded":!G,"aria-label":`${G?"Show":"Hide"} the variants of ${X.displayName(P)}`,className:"flex shrink-0 items-center gap-1 rounded px-0.5 py-1 text-[#84848C] transition-colors hover:text-[#E8EAED]",onClick:se=>{se.stopPropagation(),T()},onPointerDown:se=>se.stopPropagation(),type:"button",children:[u.jsx("svg",{className:`size-2.5 transition-transform duration-150 motion-reduce:transition-none ${G?"-rotate-90":""}`,fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 10 10",children:u.jsx("path",{d:"M2 3.5 5 6.5 8 3.5",strokeLinecap:"round",strokeLinejoin:"round"})}),G?u.jsx("span",{className:"text-[10px] leading-none tabular-nums",children:E}):null]})}),le?u.jsx(ax,{error:X.renameError,initial:X.displayName(P),label:`Rename the ${X.displayName(P)} direction`,onCancel:()=>X.startRename(null),onCommit:(se,Se)=>X.rename(P,se,Se)}):u.jsx("span",{className:`min-w-0 flex-1 text-sm font-medium leading-5 transition-colors duration-150 ${te?"text-white":"text-[#D1D5DB] group-hover:text-[#E8EAED]"}`,children:u.jsx("span",{className:`block w-fit min-w-[70%] max-w-full truncate -my-1 py-1 pr-2 ${ne?"":"cursor-text"} ${E>0?"":"-ml-3 pl-3"}`,onDoubleClick:ne?void 0:se=>{se.stopPropagation(),window.getSelection()?.removeAllRanges(),X.startRename(P)},children:X.displayName(P)})}),u.jsx(_b,{agent:v?.agent??"",aside:ue,carrying:Ce,comparing:s,same:O,scanning:V,slot:v?.slot??null,tag:Ee?.tags[0],working:re})]}),u.jsx("span",{className:`mt-0.5 line-clamp-2 block cursor-text text-xs leading-snug transition-colors ${le&&X.renameError?"text-amber-300/90":te?"text-[#D1D5DB]":"text-[#84848C]"}`,id:le&&X.renameError?"leglas-rename-error":void 0,children:le&&X.renameError?X.renameError:Ee?.note??(Ee?.branch===void 0?Ee?.url:Ee.branch)})]})})}),u.jsx(Ub,{comparing:s,dragging:d,onToggleCompare:$,renaming:le,slot:v,st:X,title:P,viewing:ne})]})}function $b({cap:a,inputRef:s,onQuery:c,query:r}){const[f,d]=w.useState(!1);return u.jsx("div",{className:"px-3 pb-1 pt-2",children:u.jsxs("div",{className:"relative",children:[u.jsx("span",{className:"pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 text-[#D1D5DB]",children:u.jsx(Pt,{d:It.search})}),u.jsx("kbd",{className:`pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 rounded border border-[#232328] bg-[#2E2E2E]/60 px-1.5 py-0.5 font-sans text-[10px] leading-none tracking-wide text-[#84848C] transition-opacity duration-150 motion-reduce:transition-none ${r||f?"opacity-0":"opacity-100"}`,children:a}),u.jsx("input",{"aria-label":"Search directions",className:"w-full rounded-md border border-[#232328] bg-[#2E2E2E]/40 py-1.5 pl-7 pr-16 text-xs text-white placeholder:text-[#E8EAED] focus:outline-none focus:ring-1 focus:ring-[#D1D5DB]/60",onBlur:()=>d(!1),onFocus:()=>d(!0),onChange:p=>c(p.target.value),onKeyDown:p=>{p.key==="Escape"&&(r?c(""):p.currentTarget.blur())},placeholder:"Search directions…",ref:s,type:"text",value:r})]})})}function qb({scope:a}){return u.jsx(Je,{label:u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"block",children:"Someone is sharing their Leglas with you, live."}),u.jsx("span",{className:"block text-[#9CA3AF]",children:"Flip, compare and change the width. Nothing you do reaches their machine."})]}),side:"right",wide:!0,children:u.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-[#232328] bg-[#1E1E22] px-3 py-1.5",children:[u.jsx(gr,{}),u.jsx("span",{className:"text-[11px] text-[#D1D5DB]",children:"Shared with you"}),u.jsx("span",{className:"ml-auto min-w-0 truncate text-[10px] text-[#84848C]",children:a==="rail"?"the whole rail":a==="compare"?"a comparison":"one direction"})]})})}const P1=15e3,Yb=3e4,em={height:800,width:1280},Gb=96,Xb=32,tm=10*6e4,nm={attached:!1,running:!1,name:null,activity:null,startedAt:null,stopping:!1,waiting:null,quietSince:null},Qb={agents:[],choice:null,customRun:null,effort:null},Gm=typeof navigator<"u"&&/Mac|iPhone|iPad|iPod/.test(navigator.userAgent),Vb=wm(Gm),lm="linear-gradient(to bottom, transparent, black 12px, black calc(100% - 12px), transparent)";function Zb({previews:a,project:s,scanPreviews:c=!0,viewer:r,warnings:f=[]}){const d=w.useRef(null),p=w.useRef(null),y=w.useRef(null),[b,x]=w.useState(!1),[S,M]=w.useState(null),[T,k]=w.useState(!1),[N,U]=w.useState(!1),$=w.useCallback(()=>y.current?.(),[]),O=w.useCallback(()=>x(m=>!m),[]),V=w.useCallback(()=>x(!1),[]),[Q,X]=w.useState(!1),ae=w.useCallback(()=>X(m=>!m),[]),P=w.useCallback(()=>Ti(m=>!m),[]),v=py({previews:a,project:s,onToggleSplit:$,onToggleHelp:O,onToggleTools:ae,onToggleNote:r===void 0?P:void 0,suspended:b||S!==null||T,viewer:r===void 0?void 0:{layout:r.layout}}),ne=v.viewing,ce=q2(v.lanes),te=v.insets,xe=dr.current[0],re=w.useRef(null),Ee=w.useRef(new Map),ye=m=>{if(re.current===null)return!1;!re.current.has(m)&&!Ee.current.has(m)&&Ee.current.set(m,performance.now());const j=Ee.current.get(m);return j!==void 0&&performance.now()-j<1e3},De=m=>ye(m)||(v.railChildren.get(m)??[]).some(j=>ye(j));w.useEffect(()=>{const m=re.current??new Set;for(const j of v.rows)m.add(j);re.current=m});const[R,W]=w.useState({nonce:0,title:""});w.useEffect(()=>{if(R.title==="")return;const m=setTimeout(()=>W(j=>({...j,title:""})),950);return()=>clearTimeout(m)},[R]);const[oe,Ce]=w.useState(null),we=w.useRef(null),E=w.useCallback(m=>{if(we.current&&clearTimeout(we.current),we.current=null,m===null){Ce(null);return}we.current=setTimeout(()=>{we.current=null,Ce(m)},120)},[]);w.useEffect(()=>()=>{we.current&&clearTimeout(we.current)},[]);const G=m=>m===""?{nodes:[],edges:[]}:E2(v.railParents,v.railChildren,m),le=oe!==null?G(oe):{nodes:[],edges:[]},ue=le.edges.length>0?le:G(v.active),se=C2(v.rows,v.rowMeta,ue),Se=w.useRef(new Map),L=w.useRef(!1);L.current=!1;const[,Z]=w.useReducer(m=>m+1,0),ie=m=>{const j=v.rowMeta.get(m)?.graph;if(!j)return;const z=Se.current.get(m),H=new Set(kf(j).filter(ee=>!z?.has(ee)));return H.size>0&&(L.current=!0),H},pe=v.rows.map(m=>{const j=v.rowMeta.get(m)?.graph;return j?`${m}=${kf(j).join(",")}`:m}).join("|");w.useEffect(()=>{const m=v.rows.map(H=>[H,v.rowMeta.get(H)?.graph]),j=L.current,z=setTimeout(()=>{Se.current=new Map(m.flatMap(([H,ee])=>ee?[[H,new Set(kf(ee))]]:[])),j&&Z()},700);return()=>clearTimeout(z)},[pe]);const Me=m=>{if(!Ba&&"startViewTransition"in document){document.startViewTransition(()=>sm.flushSync(()=>v.toggleFamily(m)));return}v.toggleFamily(m)},Ve=m=>{if(E(m),m===null){nl(z=>({...z,on:!1}));return}W(z=>({nonce:z.nonce+1,title:m}));const j=[...La.current?.querySelectorAll("li[data-title]")??[]].find(z=>z.dataset.title===m);j&&nl(Nn(j))},st=()=>{N||M(null)},ot=async()=>{if(S===null||N)return;const m=S;U(!0),M({...m,error:null});try{await v.deleteRemoved(m.titles),M(null),v.notify({kind:`delete:${m.titles.join("|")}`,message:m.titles.length===1?`${v.displayName(m.titles[0]??"")} permanently deleted`:`${m.titles.length} removed directions permanently deleted`,tone:"info",ttl:Xe.plain})}catch(j){M({...m,error:j instanceof Error?j.message:"The directions could not be deleted."})}finally{U(!1)}},[ke,Pe]=w.useState(null),kt=ke!==null,_t=w.useRef(!1),[en,Jn]=w.useState(""),[Cn,mi]=w.useState("variant"),[Ln,mt]=w.useState(!1),_n=v.prefs.buildDirections&&!ne,[Gl,Wn]=w.useState(!1),ft=Gl&&_n,[Xl,Aa]=w.useState(""),[pi,fs]=w.useState(3),[dl,Bt]=w.useState(!1),[Qt,zt]=w.useState(!1),[gi,xi]=w.useState(()=>new Map),[Da,hl]=w.useState(()=>new Set),[Ql,Bn]=w.useState(null),[Ut,pn]=w.useState(null),{jobs:Vt,noteJob:ds}=$v(_n),ml=w.useMemo(()=>Sv(Vt),[Vt]),sn=Vt.find(Co)??null,Ie=sn??Ev(Vt),Vl=v.active===null?null:Bm(v.urlFor(v.active)),In=w.useMemo(()=>Cv(a.map(m=>m.url)),[a]),[Zl,F]=w.useState(null),fe=Zl!==null&&In.includes(Zl)?Zl:Vl??(In.length===1?In[0]??null:null);w.useEffect(()=>{const m=p.current;m!==null&&(m.style.height="0px",m.style.height=`${Math.min(m.scrollHeight,96)}px`)},[en,Xl,ft,v.prefs.width]);const Re=m=>`${m.slot.state}@${m.slot.startedAt??""}`,_e=m=>`${m.state}@${If(m)}`,ve=(m,j,z)=>{Da.has(m)||gi.get(m)===j||(xi(H=>new Map(H).set(m,j)),hl(H=>new Set(H).add(m)),z().catch(H=>{xi(ee=>new Map([...ee].filter(([de])=>de!==m))),v.notify({kind:"generation",message:H instanceof Error?H.message:String(H),tone:"danger",ttl:Xe.action})}).finally(()=>hl(H=>new Set([...H].filter(ee=>ee!==m)))))},et=(m,j)=>Da.has(m)||gi.get(m)===j,Qe=m=>{const j=ml.get(m);return j!==void 0&&q1(v.urlFor(m),j)?j:void 0};Ut!==null&&Ut.from!==v.active&&pn(null);const Be=m=>m===void 0?[]:m.slots.flatMap(j=>j.state==="ready"&&Qe(j.title)!==void 0?[j.title]:[]),ut=Ut!==null&&Ut.from===v.active?Vt.find(m=>m.id===Ut.job):void 0,pl=Be(ut),To=Be(Ie??void 0),gt=pl.length>=2,hs=v.active===null?void 0:Qe(v.active),gl=!gt&&v.active!==null&&Vl!==null&&(hs===void 0||hs.slot.state==="ready")?v.active:null,Ht=dl?gl:null,Un=Ht===null?fe:Vl,xl=m=>{const j=`${m.job.id}:${m.slot.key}`,z=Re(m),{job:H,slot:ee}=m;return{acting:et(j,z),onReplace:()=>ve(j,z,()=>Bv(H.id,ee.key)),onRetry:()=>ve(j,z,()=>_v(H.id,ee.key)),onStop:()=>ve(j,z,()=>Q1(H.id,ee.key))}},Ta=m=>{const j=Qe(m);return j===void 0?null:{slot:j.slot,agent:Of(j.job.agent),...xl(j)}};w.useEffect(()=>{if(Ie===null||Co(Ie)||Ie.endedAt===null)return;const m=Ie.endedAt+tm-Date.now();if(m<=0)return;const j=window.setTimeout(()=>Bn(Lf(Ie)),m);return()=>window.clearTimeout(j)},[Ie]);const yl=w.useRef(null),wt=w.useRef(new Set);w.useEffect(()=>{for(const m of Vt)m.state==="planning"&&wt.current.add(m.id)},[Vt]),w.useEffect(()=>{const m=sn?.slots[0];if(sn===null||m===void 0||yl.current===sn.id||!wt.current.has(sn.id))return;const j=document.querySelector(`li[data-title="${CSS.escape(m.title)}"]`);if(j===null)return;yl.current=sn.id;const z=window.matchMedia("(prefers-reduced-motion: reduce)").matches;j.scrollIntoView({behavior:z?"auto":"smooth",block:"nearest"})},[sn,v.rows]);const ka=w.useRef(null);w.useEffect(()=>{const m=v.active===null?void 0:ml.get(v.active),j=m!==void 0&&v.active!==null&&q1(v.urlFor(v.active),m)?m:void 0;if(j!==void 0){ka.current={job:j.job.id,key:j.slot.key,title:j.slot.title};return}const z=ka.current;if(z===null||v.active!==z.title){ka.current=null;return}const H=[...ml.values()].find(ee=>ee.job.id===z.job&&ee.slot.key===z.key);H===void 0||H.slot.title===z.title||v.previewFor(H.slot.title)!==void 0&&(ka.current={job:z.job,key:H.slot.key,title:H.slot.title},v.setActive(H.slot.title))},[ml,v,a]);const ko=()=>{const m=Xl.trim();m===""&&Ht===null||Un===null||Qt||(zt(!0),Lv({surface:Un,brief:m,count:pi,basedOn:Ht}).then(j=>{ds(j),Aa(""),Wn(!1),Bn(null)}).catch(j=>v.notify({kind:"generation",message:j instanceof Error?j.message:String(j),tone:"danger",ttl:Xe.action})).finally(()=>zt(!1)))},[Rt,gn]=w.useState([]),yi=w.useRef(new Map),zo=w.useRef(null),[ms,ps]=w.useState(!1),Pn=w.useRef(0),za=w.useCallback((m,j)=>{yi.current.set(m,j),gn(z=>z.map(H=>H.key===m?{...H,status:"uploading",id:null}:H)),Qy(j).then(({id:z})=>gn(H=>H.map(ee=>ee.key===m?{...ee,status:"ready",id:z}:ee))).catch(()=>gn(z=>z.map(H=>H.key===m?{...H,status:"failed",id:null}:H)))},[]),xn=m=>{if(v.active===null||Ln)return;const{accepted:j,refused:z}=By(Rt,m),H=Uy(z);if(H!==null&&v.notify({kind:"reference",message:H,tone:"info",ttl:Xe.action}),j.length===0)return;const ee=j.map(de=>({key:crypto.randomUUID(),name:Jf(de.name),type:de.type,bytes:de.size,url:URL.createObjectURL(de),status:"uploading",id:null}));gn(de=>[...de,...ee]),ee.forEach((de,he)=>{const me=j[he];me!==void 0&&za(de.key,me)})},on=m=>{yi.current.delete(m);const j=Rt.find(z=>z.key===m);j!==void 0&&URL.revokeObjectURL(j.url),gn(z=>z.filter(H=>H.key!==m))},Ro=m=>{const j=yi.current.get(m);j!==void 0&&za(m,j)},Cr=()=>{yi.current.clear();for(const m of Rt)URL.revokeObjectURL(m.url);gn([])},[Ra,gs]=w.useState(null),[Kl,Oo]=w.useState(!1),[Zt,Hn]=w.useState(!1),[Oa,el]=w.useState(null),tl=w.useRef(null),vi=w.useRef(null),bi=w.useRef(null),$n=w.useRef(null),Lo=w.useRef(null),xs=w.useRef(null),[_o,ys]=w.useState(Gb);w.useEffect(()=>{const m=xs.current;if(m===null||typeof ResizeObserver>"u")return;const j=()=>ys(m.offsetHeight);j();const z=new ResizeObserver(j);return z.observe(m),()=>z.disconnect()},[]);const La=w.useRef(null),[wi,nl]=w.useState({height:0,left:0,on:!1,top:0}),Nn=m=>({height:m.offsetHeight,left:m.querySelector('[role="button"]')?.offsetLeft??0,on:!0,top:m.offsetTop});w.useEffect(()=>{nl(m=>m.on?{...m,on:!1}:m)},[v.rows.join("|")]);const[pt,ll]=w.useState(null),vl=w.useRef(null),qn=w.useRef(null);w.useEffect(()=>{vl.current=pt},[pt]),w.useEffect(()=>{if(!v.focusing)return;const m=v.focusing.target==="search"?d.current:p.current;m?.focus(),m?.select()},[v.focusing]),w.useEffect(()=>{if(!pt)return;const m=qn.current;if(!m)return;const j=H=>{const ee=H.clientY-m.startY,de=H.clientX-m.startX;ll(he=>{if(!he||he.settling)return he;if(!he.started)return Math.abs(ee)<=4&&Math.abs(de)<=4?{...he,dy:ee}:Math.abs(de)>Math.abs(ee)?null:(window.getSelection()?.removeAllRanges(),v.setDragFolded(new Set(m.siblings.filter(yt=>(v.rowMeta.get(yt)?.descendants??0)>0))),{...he,dy:0,measured:!1,started:!0});if(!he.measured)return he;const me=m.rows[he.from];if(!me)return he;const[Ye,Oe]=he.span??[0,m.rows.length-1],Ge=yt=>{const Vn=m.rows[yt];return Vn?yt<=he.from?Vn.top:Vn.top+Vn.height-me.height:me.top},xt=Ge(Ye)-me.top,Ze=Ge(Oe)-me.top,rn=me.height,Dn=rn/3;let aa=ee,St=!1;ee<xt?(aa=xt+Math.max(-Dn,(ee-xt)*.3),St=ee<xt-rn):ee>Ze&&(aa=Ze+Math.min(Dn,(ee-Ze)*.3),St=ee>Ze+rn),aa=Math.max(m.minDy,Math.min(m.maxDy,aa));const rt=me.top+Math.max(xt,Math.min(Ze,ee));let Le=he.from,Qn=1/0;for(let yt=Ye;yt<=Oe;yt+=1){const Vn=Math.abs(Ge(yt)-rt);Vn<Qn&&(Qn=Vn,Le=yt)}return{...he,blocked:St,dy:aa,started:!0,to:Le}})},z=()=>{const H=vl.current;if(!H?.started){ll(null);return}m.suppressed=!0;const ee=H.blocked&&H.reason!==null,de=ee?H.from:H.to,he=m.rows[H.from],me=m.rows[de];let Ye=0;he&&me&&(Ye=(de<=H.from?me.top:me.top+me.height-he.height)-he.top),ll({...H,dy:Ye,settling:!0,to:de}),window.setTimeout(()=>{if(ee)v.notify(Bo(H.title,m.parent,m.siblings));else if(de!==H.from){const[,Oe]=H.span??[0,m.rows.length-1],Ge=de>H.from?de+1<=Oe?m.rows[de+1]?.title??null:null:m.rows[de]?.title??null;v.reorderAmong(H.title,Ge,m.siblings)}v.setDragFolded(new Set),ll(null),window.setTimeout(()=>{m.suppressed=!1},0)},190)};return window.addEventListener("pointermove",j),window.addEventListener("pointerup",z),window.addEventListener("pointercancel",z),()=>{window.removeEventListener("pointermove",j),window.removeEventListener("pointerup",z),window.removeEventListener("pointercancel",z)}},[pt!==null]),w.useLayoutEffect(()=>{if(!pt?.started||pt.measured)return;const m=qn.current,j=La.current,z=j?.parentElement;if(!m||!j||!z)return;const H=[...j.querySelectorAll("li[data-title]")],ee=H.map(Ze=>({height:Ze.offsetHeight,mid:Ze.offsetTop+Ze.offsetHeight/2,title:Ze.dataset.title??"",top:Ze.offsetTop})),de=ee.findIndex(Ze=>Ze.title===pt.title),he=ee[de],me=H[de];if(!he||!me)return;m.startY-=m.oldTop-he.top,m.rows=ee;const Ye=z.getBoundingClientRect(),Oe=me.getBoundingClientRect();m.minDy=Ye.top-Oe.top,m.maxDy=Ye.bottom-Oe.bottom;const Ge=m.siblings.map(Ze=>ee.findIndex(rn=>rn.title===Ze)).filter(Ze=>Ze!==-1),xt=Ge.length?[Math.min(...Ge),Math.max(...Ge)]:null;ll(Ze=>Ze&&!Ze.measured?{...Ze,from:de,height:he.height,measured:!0,span:xt,to:de}:Ze)},[pt?.started,pt?.measured,pt?.title]);const Bo=(m,j,z)=>{const H=v.displayName(m),ee=j===null?null:v.displayName(j),de=z.length<2;return{note:ee===null?`${H} is the only direction at the top level; its variants travel with it.`:de?`Nothing to reorder it among. Drag ${ee} to move the whole family.`:`Where a direction sits comes from what it was based on. Drag ${ee} to move the whole family.`,kind:"reorder",message:ee===null?"Nothing to reorder":de?`${H} is ${ee}'s only variant`:`${H} stays under ${ee}`,tone:"info",ttl:Xe.action}};w.useEffect(()=>{if(!Q)return;vi.current?.focus();const m=H=>{H.key==="Escape"&&(X(!1),tl.current?.focus())},j=H=>{const ee=H.target instanceof Node?H.target:null;!vi.current?.contains(ee)&&!tl.current?.contains(ee)&&X(!1)},z=()=>X(!1);return window.addEventListener("keydown",m),window.addEventListener("pointerdown",j),window.addEventListener("blur",z),()=>{window.removeEventListener("keydown",m),window.removeEventListener("pointerdown",j),window.removeEventListener("blur",z)}},[Q]);const Si=Yf.find(m=>m.key===v.prefs.font)??Yf[0],Uo=v.prefs.viewport!==null,_a=48,Kt=pt?.started??!1,[Ba]=w.useState(()=>typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches),[Mn,al]=w.useState(null),[vs,Ua]=w.useState([]),ji=ue.edges,Ei=`${ji.map(m=>m.join(">")).join(",")}|${Kt}|${v.prefs.width}|${ce}`,Fl=m=>al(j=>{if(j?.d===m?.d)return j;if(j!==null){const z=j;Ua(H=>[...H.filter(ee=>ee.d!==z.d),z]),setTimeout(()=>Ua(H=>H.filter(ee=>ee!==z)),460)}return m});w.useLayoutEffect(()=>{const m=La.current;if(Kt||m===null||ji.length===0){Fl(null);return}const j=()=>{const H=m.getBoundingClientRect(),ee=new Map,de=[...m.querySelectorAll("li[data-title]")];for(const me of ue.nodes){const Ye=de.find(rn=>rn.dataset.title===me),Oe=Ye?.querySelector("[data-mark]");if(!Ye||!Oe)return Fl(null);const Ge=Oe.getBoundingClientRect(),xt=Number(Oe.getAttribute("r")??0),Ze=me===v.active?3.75:0;ee.set(me,{clear:Ze>0||xt>1.5?xt+2+Ze:0,x:Ge.left+Ge.width/2-H.left,y:Ge.top+Ge.height/2-Ye.getBoundingClientRect().top+Ye.offsetTop})}const he=ji.flatMap(([me,Ye])=>{const Oe=ee.get(me),Ge=ee.get(Ye);return Oe&&Ge?[O2([Oe,Ge])]:[]}).join(" ");Fl({d:he,height:m.scrollHeight,marks:[...ee.values()]})};j();const z=new ResizeObserver(j);return z.observe(m),()=>z.disconnect()},[Kt,Ei]);const bs=v.resizing||Kt||kt,[Dt,tn]=w.useState({}),[Ha,bl]=w.useState({}),Ho=w.useRef(new Set),[ws,Ci]=w.useState({}),[wl,il]=w.useState(r?.scope==="compare"),[$o,Ni]=w.useState(r?.layout.compare??null),Ss=r===void 0?null:`${r.scope}${r.layout.compare??""}`,[Nr,js]=w.useState(Ss);Ss!==Nr&&(js(Ss),r!==void 0&&(il(r.scope==="compare"),Ni(r.layout.compare)));const qo=w.useRef(null);w.useEffect(()=>()=>{qo.current=v.active},[v.active]),y.current=()=>{!wl&&yn!==null&&Ni(yn),(yn!==null||wl)&&il(m=>!m)};const yn=Yx({active:v.active,previous:qo.current,pinned:$o,parent:v.parentOf(v.active),rows:v.rows}),$a=gt?pl:Gx({active:v.active,compare:yn,split:wl}),Mi=gt?Zx($a.length):{columns:$a.length,rows:1};w.useEffect(()=>{if(!gt)return;const m=j=>{const z=document.activeElement instanceof Element&&document.activeElement.closest('dialog[open], [role="dialog"], [role="alertdialog"], input, textarea')!==null;j.key==="Escape"&&!j.defaultPrevented&&!z&&pn(null)};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[gt]);const Yo=new Map($a.map((m,j)=>[m,j])),Yn=$a.length>1,qa=$a,Es=w.useRef(new Map),Ya=m=>Ax(m,v.urlFor(m),ws[m]??0),Cs=m=>{const j=Ya(m);return Es.current.get(m)===j&&v.isLoaded(m,j)},Ai=qa.filter(m=>v.branchState(m)?.status==="idle").join("");w.useEffect(()=>{for(const m of Ai.split("").filter(Boolean))v.startBranch(m)},[Ai]);const Jl=new Map(qa.map(m=>[m,Ya(m)])),Go=[...Jl.values()].join(""),Ns=w.useRef(Jl);Ns.current=Jl,w.useLayoutEffect(()=>{const m=Es.current,j=[...Jl].filter(([z,H])=>m.get(z)!==H);for(const[z]of j)v.resetLoaded(z);if(j.some(([z])=>Dt[z])&&tn(z=>{const H={...z};for(const[ee]of j)H[ee]=!1;return H}),j.some(([z])=>Ha[z]!==void 0)){const z=new Set(j.map(([H])=>H));bl(H=>Object.fromEntries(Object.entries(H).filter(([ee])=>!z.has(ee))))}Es.current=new Map(Jl)},[Go]);const Ms=w.useRef(null),Xo=w.useRef(null),[Ga,Qo]=w.useState({height:0,width:0}),Mr=w.useCallback(m=>{if(Ms.current=m,Xo.current?.disconnect(),m===null)return;const j=m.getBoundingClientRect();Qo({height:j.height,width:j.width});const z=new ResizeObserver(([H])=>{const ee=H?.contentRect;ee&&Qo({height:ee.height,width:ee.width})});z.observe(m),Xo.current=z},[]),{boxHeight:Ar,boxWidth:Dr,designWidth:Tr,frameHeight:kr,scale:Vo,scaling:Xa}=Kx({gutter:_a,panes:Mi.columns,rows:Mi.rows,inset:gt?Xb:0,scaleSplit:gt||v.prefs.scaleSplit,stageHeight:Ga.height,stageWidth:Ga.width,viewport:v.prefs.viewport}),Wl=v.prefs.viewport!==null?Math.round(v.prefs.viewport):Ga.width<=0?null:Math.round(Yn&&!Xa?(Ga.width-1)/2:Ga.width),zr=ke?(()=>{const{x:m,y:j}=x2(ke);return{bottom:"auto",left:m,right:"auto",top:j}})():void 0,Zo=m=>{if(m.button!==0)return;const j=Ms.current?.getBoundingClientRect();if(!j)return;const z=m.currentTarget;z.setPointerCapture(m.pointerId),_t.current=!1;const H={x:m.clientX,y:m.clientY};let ee=!1;const de=me=>{!ee&&!y2(H,{x:me.clientX,y:me.clientY})||(ee=!0,Pe(g2({x:me.clientX-j.left,y:me.clientY-j.top},{width:j.width,height:j.height})))},he=me=>{if(z.hasPointerCapture(me.pointerId)&&z.releasePointerCapture(me.pointerId),z.removeEventListener("pointermove",de),z.removeEventListener("pointerup",he),z.removeEventListener("pointercancel",he),Pe(null),!ee)return;_t.current=!0;const{corner:Ye}=v2({x:me.clientX-j.left,y:me.clientY-j.top},{width:j.width,height:j.height});v.setPrefs(Oe=>({...Oe,corner:Ye})),X(!1)};z.addEventListener("pointermove",de),z.addEventListener("pointerup",he),z.addEventListener("pointercancel",he)},[An,As]=w.useState($x),Il=new Set(a.filter(f1).map(m=>m.title)),Ko=Il.size>0,[Ft,Rr]=w.useState({requests:[],agent:nm}),[Or,Lr]=w.useState([]),[Di,Ti]=w.useState(!1),[$t,sl]=w.useState(Qb),[Fo,Pl]=w.useReducer(m=>m+1,0);w.useEffect(()=>{if(ne)return;let m=!1;return $1(Fo>0).then(j=>{m||sl(z=>JSON.stringify(z)===JSON.stringify(j)?z:j)}).catch(()=>{}),()=>{m=!0}},[Fo,ne]);const[Jo,ol]=w.useReducer(m=>m+1,0);w.useEffect(()=>{if(ne)return;let m=!1;const z=rs(async H=>{const ee=(de,he)=>fetch(de,{...he,signal:H});await fetch("/leglas/api/requests",{signal:H}).then(de=>Xt(de)).then(de=>{if(m)return;const he={requests:de.requests,agent:de.agent??nm};Rr(me=>JSON.stringify(me)===JSON.stringify(he)?me:he)}).catch(()=>{}),await Vy(ee).then(de=>{m||Lr(he=>JSON.stringify(he)===JSON.stringify(de)?he:de)}).catch(()=>{})},{everyMs:Mo,subscribe:H=>us().on("requests",H)});return()=>{m=!0,z()}},[Jo,ne]);const Ot=Py($t.choice,$t.agents,$t.customRun),ul=Ot.kind==="chosen"&&(Ot.id==="claude"||Ot.id==="codex")?Ot.id:null,ea=ul===null?"Claude or Codex":Of(ul),Ds=ul===null?"Building directions runs on Claude or Codex.":sn!==null?"A set is being built. Wait for it, or stop it.":Un===null?"Pick a direction on the surface first.":null,Ts=w.useRef(0),ks=()=>{if(Ot.kind!=="chosen")return;const m=Date.now();m-Ts.current<Yb||(Ts.current=m,uv().catch(()=>{}))},ki=Ot.kind==="chosen"?$t.agents.find(m=>m.id===Ot.id&&m.available):void 0,_r=$t.effort!==null&&ki?.efforts.includes($t.effort)?$t.effort:null,rl=v.active===null?[]:Or.filter(m=>m.title===v.active),zs=(()=>{const m=$f(v.active===null?void 0:v.previewFor(v.active));return m===null?null:gy(m.basedOn===null?null:v.displayName(m.basedOn),m.askedFor)})(),Jt=v.active===""?[]:v.ancestryOf(v.active),Qa=Ot.kind==="chosen"&&$t.agents.some(m=>m.id===Ot.id&&m.auth==="signed-out"),zi=lv(Ft.requests,Ft.agent,Ot.kind==="chosen"||Ft.agent.attached);w.useEffect(()=>{Ot.kind==="none"&&Hn(!1)},[Ot.kind]),w.useEffect(()=>{if(!Zt)return;bi.current?.focus();const m=H=>{H.key==="Escape"&&(Hn(!1),$n.current?.focus())},j=H=>{const ee=H.target instanceof Node?H.target:null;!bi.current?.contains(ee)&&!$n.current?.contains(ee)&&Hn(!1)},z=()=>Hn(!1);return window.addEventListener("keydown",m),window.addEventListener("pointerdown",j),window.addEventListener("blur",z),()=>{window.removeEventListener("keydown",m),window.removeEventListener("pointerdown",j),window.removeEventListener("blur",z)}},[Zt]);const Wo=m=>{if(Ra!==null||Kl)return;const j=$t.agents.find(z=>z.id===m)?.name??"Agent";gs(m),sv(m).then(()=>{Pl(),Hn(!1)}).catch(async()=>{try{const z=await $1(!0);if(sl(z),z.choice===m){Hn(!1);return}}catch{}v.notify({kind:"agent-choice",message:`${j} wasn’t selected. Try again.`,tone:"danger",ttl:Xe.action})}).finally(()=>gs(null))},Io=m=>{if(ki===void 0||Kl||Ra!==null)return;const j=$t.effort;Oo(!0),sl(z=>({...z,effort:m})),ov(ki.id,m).then(()=>Pl()).catch(()=>{sl(z=>({...z,effort:j})),v.notify({kind:"agent-choice",message:"Effort could not be saved. Agent settings did not change.",tone:"danger",ttl:Xe.action})}).finally(()=>Oo(!1))},Po=m=>{Oa===null&&(el("cancel"),rv(m).then(()=>ol()).catch(()=>{v.notify({kind:"agent-cancel",message:"Leglas could not stop that run.",tone:"danger",ttl:Xe.action})}).finally(()=>el(null)))},Rs=m=>{Oa===null&&(el("retry"),cv(m).then(()=>ol()).catch(()=>{v.notify({kind:"agent-retry",message:"That change could not be retried.",tone:"danger",ttl:Xe.action})}).finally(()=>el(null)))},Br=m=>{Oa===null&&(el("dismiss"),fv(m).then(()=>ol()).catch(()=>{v.notify({kind:"agent-dismiss",message:"That change could not be dismissed.",tone:"danger",ttl:Xe.action})}).finally(()=>el(null)))};w.useEffect(()=>{let m=!1;const z=rs(H=>fetch("/leglas/api/health",{signal:H}).then(ee=>Xt(ee)).then(({reachable:ee})=>{m||As(de=>qx(de,ee))}).catch(()=>{}),{everyMs:Mo,subscribe:H=>us().on("health",H)});return()=>{m=!0,z()}},[]),w.useEffect(()=>{!An.reachable||!An.wasDown||(tn(m=>{const j={...m};for(const z of Object.keys(j))Il.has(z)&&(j[z]=!1);return j}),Ci(m=>{const j={...m};for(const z of Il)j[z]=(j[z]??0)+1;return j}),As(m=>({...m,wasDown:!1})))},[An.reachable,An.wasDown]);const[Sl,Va]=w.useState({}),[Za,Os]=w.useState(()=>!document.hidden);w.useEffect(()=>{const m=()=>Os(!document.hidden);return document.addEventListener("visibilitychange",m),()=>document.removeEventListener("visibilitychange",m)},[]);const Ri=new Map(a.map(m=>[m.title,Ya(m.title)])),jl=[...Ri].map(([m,j])=>`${m}${j}`).join(""),El=w.useRef(new Map);w.useLayoutEffect(()=>{const m=f2(El.current,Ri);m.length>0&&Va(j=>Tf(j,m)),El.current=new Map(Ri)},[jl]);const Cl=(m,j)=>{let z=null;try{z=m.contentDocument}catch{return}if(!z?.head)return;const H=z,ee="leglas-hide-dev-overlays",de=(he,me,Ye)=>{const Oe=he.getElementById(ee);if(!j){Oe?.remove();return}if(Oe)return;const Ge=H.createElement("style");Ge.id=ee,Ge.textContent=Ye,me.appendChild(Ge)};de(z,z.head,Fx);for(const he of z.querySelectorAll("nextjs-portal")){const me=he.shadowRoot;me&&de(me,me,Jx)}};w.useEffect(()=>{for(const m of document.querySelectorAll("iframe"))Cl(m,!v.prefs.showDevOverlays)});const eu=m=>{let j=null;try{j=m.contentDocument}catch{return}if(!j?.body)return;const z=[...j.body.querySelectorAll("*")].slice(0,400).map(he=>he.tagName),H=j.defaultView,ee=H?r2(j.body,he=>{const me=H.getComputedStyle(he);return{backgroundColor:me.backgroundColor,backgroundImage:me.backgroundImage,color:me.color}}):[],de=H?u2(j.body,(he,me)=>H.getComputedStyle(he,me)):[];return Ix(j.body.innerText??"",z,ee,de)},Nl=(m,j)=>{let z;try{z=m.contentDocument?.fonts}catch{}const H=new Promise(de=>window.setTimeout(de,900));(z?.status==="loading"?Promise.race([z.ready.then(()=>{}),H]):Promise.resolve()).then(()=>{const de=()=>{Cl(m,!v.prefs.showDevOverlays),j(eu(m))};typeof window.requestIdleCallback<"u"?window.requestIdleCallback(de,{timeout:1200}):window.setTimeout(de,0)})},Ls=w.useRef(new WeakSet),Ka=(m,j,z)=>{if(Ns.current.get(m)!==j)return;const H=v.urlFor(m);if(!H.startsWith("/")&&!Ho.current.has(H)){Ox(m).then(ee=>{Ns.current.get(m)===j&&(ee!==null&&bl(de=>({...de,[m]:ee})),_s(m,j,z))});return}_s(m,j,z)},_s=(m,j,z)=>{v.markLoaded(m,j),tn(ee=>ee[m]?{...ee,[m]:!1}:ee),Cl(z,!v.prefs.showDevOverlays);let H=null;try{H=z.contentDocument}catch{}H===null||Ls.current.has(H)||Ls.current.add(H)},tu=w.useRef(Ka);tu.current=Ka,w.useEffect(()=>{const m=j=>{if(j.origin!==window.location.origin)return;const z=Ux(j.data);if(z===null)return;const H=Hx(document.querySelectorAll("iframe[data-preview]"),j.source),ee=H?.dataset.preview,de=H?.dataset.previewIdentity;H===null||ee===void 0||de===void 0||(z==="ready"?tu.current(ee,de,H):tn(he=>({...he,[ee]:!0})))};return window.addEventListener("message",m),()=>window.removeEventListener("message",m)},[]);const Ur=c&&!ne?An.reachable?a:a.filter(m=>!f1(m)):[],ta=Jy(Ft.requests),nu=ta.toSorted().join("\0"),lu=Ft.agent.running||ta.length>0,Bs=Iy(Ft.requests),vn=Wy(Ft.requests);w.useEffect(()=>{ta.length!==0&&Va(m=>Tf(m,ta))},[nu]);const Oi=qa.every(m=>Cs(m)),nn=ta.length>0?Tf(Sl,ta):Sl,na=h2(a,nn),Us=c2(na),un=!lu&&Oi&&Za?m2(Ur,nn)[0]??null:null,Li=un?.title??null,la=un===null?null:`${un.title}\0${un.url}`,Gn=w.useRef(la);Gn.current=la;const _i=w.useRef(null),Fa=w.useRef(new Map(a.map(m=>[m.title,m.url])));Fa.current=new Map(a.map(m=>[m.title,m.url]));const Ml=(m,j,z)=>{const H=`${m.title}\0${m.url}`;Gn.current===H&&_i.current===z&&Fa.current.get(m.title)===m.url&&Va(ee=>d2(ee,m,j))};w.useEffect(()=>{if(un===null)return;const m=_i.current;if(m===null)return;const j=window.setTimeout(()=>{Ml(un,{status:"failed"},m)},P1);return()=>clearTimeout(j)},[la]);const Hr=(m,j)=>{Zf(j)&&(Cl(j,!v.prefs.showDevOverlays),window.setTimeout(()=>{const z=`${m.title}\0${m.url}`;Gn.current===z&&Nl(j,H=>{Ml(m,H===void 0?{status:"failed"}:{status:"complete",signature:H},j)})},600))};w.useEffect(()=>{const m=[];for(const j of qa){const z=Jl.get(j)??Ya(j);if(v.isLoaded(j,z)||Dt[j])continue;const H=document.querySelector(`iframe[data-preview="${CSS.escape(j)}"]`);if(H===null)continue;const ee=An.reachable||!Il.has(j)?P1:0;m.push(zx({frame:H,onFailure:()=>tn(de=>({...de,[j]:!0})),onReady:()=>Ka(j,z,H),sameOrigin:v.urlFor(j).startsWith("/"),timeoutMs:ee}))}return()=>{for(const j of m)j()}},[Go,v.loaded,Dt,An.reachable]);const ln=m=>{tn(j=>({...j,[m]:!1})),v.resetLoaded(m),Ci(j=>({...j,[m]:(j[m]??0)+1}))},Hs=(m,j)=>z=>{if(z.button!==0||ne||v.renaming||v.query.trim()||v.rows.length<2||z.target instanceof Element&&z.target.closest("button, [data-selectable]"))return;const H=La.current,ee=H?.parentElement;if(!H||!ee)return;const de=[...H.querySelectorAll("li[data-title]")],he=de.map(Dn=>({height:Dn.offsetHeight,mid:Dn.offsetTop+Dn.offsetHeight/2,title:Dn.dataset.title??"",top:Dn.offsetTop})),me=ee.getBoundingClientRect(),Ye=de[j]?.getBoundingClientRect(),Oe=v.railParents.get(m)??null,Ge=Oe===null?v.railRoots:v.railChildren.get(Oe)??[m],xt=Ge.length<2?Oe===null?"Nothing to reorder":`${v.displayName(Oe)}'s only variant`:Oe===null?null:`Stays under ${v.displayName(Oe)}`;qn.current={maxDy:Ye?me.bottom-Ye.bottom:0,minDy:Ye?me.top-Ye.top:0,oldTop:he[j]?.top??0,parent:Oe,rows:he,siblings:Ge,startX:z.clientX,startY:z.clientY,suppressed:!1};const Ze=he[0],rn=he[1];ll({blocked:!1,dy:0,from:j,gap:Ze&&rn?rn.top-Ze.top-Ze.height:0,height:he[j]?.height??0,measured:!0,reason:xt,span:null,title:m,settling:!1,started:!1,to:j})},Xn=m=>{if(!pt?.started)return 0;const j=pt.height+pt.gap;return m<pt.from&&m>=pt.to?j:m>pt.from&&m<=pt.to?-j:0},$s=w.useCallback(()=>Ti(!1),[]),Bi=(m,j,z)=>(ks(),Zy(m,z,j).then(()=>(ol(),!0)).catch(()=>(v.notify({kind:"request",message:"That annotation could not be kept.",tone:"danger",ttl:Xe.action}),!1))),Al=(m,j)=>Ky(m,j).then(()=>(ol(),!0)).catch(()=>(v.notify({kind:"request",message:"That annotation could not be changed.",tone:"danger",ttl:Xe.action}),!1)),qs=m=>{Fy([m]).then(()=>ol()).catch(()=>{})},au=m=>{window.open(v.urlFor(m),"_blank","noopener,noreferrer")},Ui=u.jsx(yv,{agents:$t.agents,chip:Ot,chosenSignedOut:Qa,connectRef:Lo,menuRef:bi,onConnect:()=>k(!0),onPick:Wo,onPickEffort:Io,onRefresh:Pl,open:Zt,pickingAgent:Ra,savingEffort:Kl,selectedAgent:ki,selectedEffort:_r,setOpen:Hn,triggerRef:$n});return u.jsxs("main",{className:`flex h-dvh bg-[#1C1C20] text-white antialiased selection:bg-[#E6E8EC] selection:text-[#17181B] ${v.resizing?"cursor-col-resize":""} ${bs?"select-none":""}`,"data-leglas-shell":"",style:{fontFamily:Si.stack},children:[u.jsxs("aside",{className:`relative shrink-0 overflow-hidden border-r border-[#232328] ${v.prefs.collapsed?"":"shadow-2xl"} ${v.resizing?"":`transition-[width] duration-200 ${ci} motion-reduce:transition-none`}`,style:{width:v.prefs.collapsed?48:v.prefs.width},children:[u.jsxs("div",{className:`flex h-full flex-col transition-opacity duration-150 ${v.prefs.collapsed?"pointer-events-none opacity-0":"opacity-100"}`,inert:v.prefs.collapsed,style:{width:v.prefs.width},children:[u.jsx(kb,{active:v.active,briefing:ft,compare:Yn&&!gt?yn:null,displayName:v.displayName,notify:v.notify,onBuild:_n?()=>{Wn(!ft),ft||window.requestAnimationFrame(()=>p.current?.focus())}:null,onCollapse:()=>v.setPrefs(m=>({...m,collapsed:!0})),prefs:v.prefs,previews:a,viewing:ne}),r!==void 0&&u.jsx(qb,{scope:r.scope}),u.jsx($b,{cap:Vb,inputRef:d,onQuery:v.setQuery,query:v.query}),f.length>0&&u.jsxs("section",{"aria-label":"Preview warning",className:"mx-3 mb-1 mt-1 rounded-md border border-amber-400/20 bg-amber-400/[0.07] px-2.5 py-2",children:[u.jsx("p",{className:"text-xs font-medium text-amber-300/90",children:"Preview may be from another project"}),f.map(m=>u.jsx("p",{className:"mt-0.5 text-[11px] leading-snug text-[#9CA3AF]",children:m},m))]}),Ko&&!An.reachable&&u.jsxs("div",{className:"mx-3 mb-1 mt-1 rounded-md border border-amber-400/20 bg-amber-400/[0.07] px-2.5 py-2",children:[u.jsx("p",{className:"text-xs font-medium text-amber-300/90",children:"Dev server not responding"}),u.jsx("p",{className:"mt-0.5 text-[11px] leading-snug text-[#9CA3AF]",children:"Anything on screen is from before it stopped. Previews return on their own once it is back."})]}),u.jsxs("div",{className:"flex-1 overflow-y-auto px-3 py-2 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",style:{WebkitMaskImage:lm,maskImage:lm},children:[u.jsxs("ul",{className:"relative flex flex-col gap-1","data-traced":oe??"",onPointerLeave:()=>{E(null),nl(m=>({...m,on:!1}))},ref:La,children:[u.jsx("div",{"aria-hidden":!0,className:`pointer-events-none absolute right-0 z-0 rounded-md bg-white/[0.06] transition-[transform,height,opacity,left] duration-150 ${ci} motion-reduce:transition-none`,style:{height:wi.height,left:wi.left,opacity:wi.on&&!Kt?1:0,transform:`translateY(${wi.top}px)`}}),v.rows.map((m,j)=>u.jsx(Hb,{arriving:De,comparing:Yn&&!gt&&m===yn,crumbBloom:R,drag:pt,dragMeta:qn,dragging:Kt,freshFor:ie,gutter:ce,index:j,insets:te,lit:se?.get(m),onEnter:z=>{E(m),nl(Nn(z))},onFold:()=>Me(m),onOpenAlone:()=>au(m),onPick:()=>pn(null),onPointerDown:Hs(m,j),onToggleCompare:()=>{if(pn(null),Yn&&!gt&&m===yn){il(!1);return}Ni(m),il(!0)},same:Us[m],scanning:Li===m,shiftFor:Xn,st:v,tint:xe,title:m,viewing:ne,slot:_n?Ta(m):null,working:Bs.has(m)},m)),vs.filter(m=>m.d!==Mn?.d).map(m=>u.jsx(N1,{d:m.d,height:m.height,leaving:!0,marks:m.marks,still:Ba,width:ce},`leaving:${m.d}`)),Mn!==null&&u.jsx(N1,{d:Mn.d,height:Mn.height,marks:Mn.marks,still:Ba,width:ce},Mn.d)]}),v.rows.length===0&&u.jsx("div",{className:"px-3 py-2",children:v.query.trim()?u.jsxs(u.Fragment,{children:[u.jsxs("p",{className:"text-xs text-[#9CA3AF]",children:["Nothing matches “",v.query,"”."]}),u.jsx("button",{className:"mt-1 rounded text-xs text-[#84848C] underline underline-offset-2 transition-colors hover:text-[#D1D5DB]",onClick:()=>v.setQuery(""),type:"button",children:"Clear search"})]}):u.jsx("p",{className:"text-xs leading-snug text-[#9CA3AF]",children:ne?"Nothing here was shared.":v.visibleCount===0&&v.hiddenCount>0?"Every direction is removed. Restore one below.":"No directions yet. Add them to leglas.config.ts."})}),!ne&&v.hiddenCount>0&&u.jsxs("div",{className:"mt-1 flex items-center justify-between gap-2",children:[u.jsxs("button",{className:"min-w-0 flex-1 rounded px-3 py-1.5 text-left text-[11px] text-[#84848C] transition-colors hover:text-[#D1D5DB]",onClick:()=>v.setShowHidden(m=>!m),type:"button",children:[v.showHidden?"Hide":"Show"," removed (",v.hiddenCount,")"]}),v.showHidden?u.jsx("button",{className:"rounded px-3 py-1.5 text-[11px] text-[#9CA3AF] transition-[color,scale] hover:text-red-300 active:scale-[0.96]",onClick:()=>M({error:null,titles:[...v.prefs.hidden]}),type:"button",children:"Clear all"}):null]}),!ne&&v.showHidden&&u.jsx("ul",{className:"relative",children:v.prefs.hidden.filter(v.matches).map(m=>u.jsx("li",{className:"group relative",children:u.jsxs("div",{className:"flex items-center justify-between rounded-md px-3 py-2 transition-colors group-hover:bg-white/[0.04]",children:[u.jsx("span",{className:"truncate text-sm font-medium text-[#9CA3AF]",children:v.displayName(m)}),u.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[u.jsx("button",{className:"rounded text-[11px] text-[#9CA3AF] transition-colors hover:text-white",onClick:()=>{v.restore(m),v.notify({kind:`remove:${m}`,message:`${v.displayName(m)} is back in the list`,tone:"success",ttl:Xe.plain})},type:"button",children:"Restore"}),u.jsx("button",{className:"rounded text-[11px] text-[#84848C] transition-[color,scale] hover:text-red-300 active:scale-[0.96]",onClick:()=>M({error:null,titles:[m]}),type:"button",children:"Delete"})]})]})},m))})]}),u.jsxs("div",{ref:xs,children:[_n&&Ie!==null&&(Co(Ie)||Lf(Ie)!==Ql&&Ie.endedAt!==null&&Date.now()-Ie.endedAt<tm)&&u.jsx(Tv,{compare:To.length>=2?{count:To.length,toggle:()=>pn(gt&&ut?.id===Ie.id?null:{from:v.active,job:Ie.id})}:null,comparing:gt&&ut?.id===Ie.id,job:Ie,onDismiss:()=>Bn(Lf(Ie)),onStop:()=>ve(`${Ie.id}:set`,_e(Ie),()=>Q1(Ie.id)),stopping:et(`${Ie.id}:set`,_e(Ie))}),!ne&&zi!==null&&u.jsx(bv,{action:Oa,card:zi,onCancel:Po,onDismiss:Br,onRetry:Rs}),!ne&&u.jsx("form",{className:"relative px-3 pb-2.5 pt-2",onSubmit:m=>{if(m.preventDefault(),ft){Ds===null&&ko();return}const j=en.trim(),z=v.active;if(!j&&rl.length===0||!z||Ln||gt)return;const H=v.displayName(z),ee=Yy(Rt);if(ee!==null){v.notify({kind:"request",message:ee==="uploading"?"Still uploading an image. Try again in a moment.":"One image did not upload. Retry it or remove it, then send.",tone:"info",ttl:Xe.action});return}const de=qy(Rt),he={title:z,intent:j,mode:Cn};Wl!==null&&(he.width=Wl),Yn&&yn!==null&&yn!==z&&(he.compare=yn),de.length>0&&(he.references=de),mt(!0),fetch("/leglas/api/request",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(he)}).then(me=>Xt(me)).then(me=>{if(me.duplicate===!0){mt(!1),v.notify({kind:"request",message:`That exact change to ${H} is already queued.`,tone:"info",ttl:Xe.action});return}if(!me.ok&&Fn(me.error)){mt(!1),v.notify({kind:"request",message:me.error,tone:"danger",ttl:Xe.action});return}if(!me.ok||!me.prompt)throw new Error("refused");Jn(""),Cr(),mt(!1),ol(),v.notify({kind:"request",message:`Asked for a change to ${H}.`,tone:"success",ttl:Xe.plain}),wr(me.prompt).then(Ye=>{v.notify({kind:"request",message:Ye==="copied"?`Asked for a change to ${H}. Prompt copied.`:`Asked for a change to ${H}. Your browser blocked the clipboard, so read it with npx leglas requests.`,tone:"success",ttl:Xe.plain})})}).catch(()=>{mt(!1),v.notify({kind:"request",message:`That request never reached Leglas. ${H} is unchanged.`,tone:"danger",ttl:Xe.action})})},children:u.jsxs("div",{className:`rounded-md border bg-[#2E2E2E]/40 transition-colors ${ms?"border-[#7C9CFF]/70 ring-1 ring-[#7C9CFF]/40":"border-[#232328] focus-within:border-[#D1D5DB]/40 focus-within:ring-1 focus-within:ring-[#D1D5DB]/40"}`,onDragEnter:m=>{ft||!rr(m.dataTransfer.types)||(m.preventDefault(),Pn.current+=1,ps(!0))},onDragLeave:m=>{rr(m.dataTransfer.types)&&(Pn.current=Math.max(0,Pn.current-1),Pn.current===0&&ps(!1))},onDragOver:m=>{ft||!rr(m.dataTransfer.types)||(m.preventDefault(),m.dataTransfer.dropEffect="copy")},onDrop:m=>{ft||!rr(m.dataTransfer.types)||(m.preventDefault(),Pn.current=0,ps(!1),xn(Array.from(m.dataTransfer.files)))},children:[ft?u.jsxs("div",{className:"flex items-center justify-between gap-2 pl-2.5 pr-1 pt-1",children:[Ht!==null?u.jsxs("span",{className:"min-w-0 truncate text-[10px] font-medium leading-5 text-[#84848C]",children:["Variations of ",v.displayName(Ht)]}):In.length>1&&fe!==null?u.jsxs("label",{className:"flex items-center gap-1 text-[10px] font-medium leading-5 text-[#84848C]",children:["New",u.jsx("select",{"aria-label":"The surface to build directions for",className:"rounded bg-white/[0.06] px-1 text-[10px] font-medium text-[#D1D5DB] focus:outline-none focus-visible:ring-1 focus-visible:ring-[#D1D5DB]/60",onChange:m=>F(m.target.value),value:fe,children:In.map(m=>u.jsx("option",{value:m,children:m},m))}),"directions"]}):u.jsx("span",{className:"text-[10px] font-medium leading-5 text-[#84848C]",children:fe===null?"New directions":`New ${fe} directions`}),u.jsxs("span",{className:"flex min-w-0 shrink-0 items-center gap-0.5",children:[gl!==null&&(Ht!==null||fe===Vl)&&u.jsxs("button",{"aria-pressed":Ht!==null,className:`h-5 max-w-36 truncate rounded px-1.5 text-[10px] font-medium leading-5 transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[#D1D5DB]/60 ${Ht===null?"text-[#84848C] hover:bg-white/[0.06] hover:text-[#D1D5DB]":"bg-white/[0.08] text-[#E8E8EA] hover:bg-white/[0.12]"}`,disabled:Qt,onClick:()=>Bt(Ht===null),type:"button",children:["More like ",v.displayName(gl)]}),u.jsx("button",{"aria-label":"Close the brief",className:"flex size-5 items-center justify-center rounded text-[#84848C] transition-colors hover:bg-white/[0.06] hover:text-white",onClick:()=>Wn(!1),type:"button",children:u.jsx("svg",{"aria-hidden":"true",height:"10",viewBox:"0 0 16 16",width:"10",children:u.jsx("path",{d:"m4 4 8 8M12 4l-8 8",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.75"})})})]})]}):u.jsx(Gy,{drafts:Rt,onRemove:on,onRetry:Ro}),u.jsx("textarea",{"aria-label":ft?Ht!==null?`Say what the variations of ${v.displayName(Ht)} should vary, or leave it to ${ea}`:fe===null?`Describe the new directions for ${ea} to build`:`Describe the new ${fe} directions for ${ea} to build`:gt?"Open one of the directions to ask for a change":v.active?`Ask your agent to change the ${v.displayName(v.active)} direction`:"Ask your agent to change a direction",className:"block w-full resize-none overflow-y-auto bg-transparent px-2.5 pb-1 pt-2 text-xs leading-4 text-white placeholder:text-[#84848C] focus:outline-none disabled:cursor-not-allowed disabled:opacity-60",disabled:ft?Qt:Ln||!v.active||gt,onChange:m=>{if(ft){Aa(m.target.value);return}en===""&&m.target.value!==""&&ks(),Jn(m.target.value)},onFocus:ft?void 0:ks,onKeyDown:m=>{if(ft&&m.key==="Escape"){m.preventDefault(),Wn(!1);return}m.key==="Enter"&&!m.shiftKey&&(m.preventDefault(),m.currentTarget.form?.requestSubmit())},onPaste:m=>{if(ft)return;const j=Array.from(m.clipboardData.files);j.length!==0&&(m.preventDefault(),xn(j))},placeholder:ft?Ht!==null?"What should they vary? Optional":fe===null?"Pick a direction on the surface first":"What should they explore?":gt?"Open one of them to ask for a change":v.active===null?"No direction to change yet":ms?"Drop the image here":Rt.length>0&&rl.length===0?`Say what to take from the ${Rt.length===1?"image":"images"}…`:rl.length>0?`Send ${rl.length===1?"the annotation":`${rl.length} annotations`}, or add words…`:`Change ${v.displayName(v.active)}…`,ref:p,rows:1,value:ft?Xl:en}),ft&&ul!==null&&u.jsxs("p",{className:"px-2.5 text-[10px] leading-4 text-[#84848C]",children:["Runs on your ",ea," plan. Usually"," ",ul==="codex"?"two or three minutes":"a minute or two","."]}),ft?u.jsx(Av,{count:pi,onCount:fs,agent:ea,picker:ul===null?Ui:null,reason:Ds,ready:(Xl.trim()!==""||Ht!==null)&&Un!==null,starting:Qt}):u.jsxs("div",{className:"flex items-center justify-end gap-1.5 p-1",children:[u.jsx(Gv,{mode:Cn,onToggle:()=>mi(Cn==="variant"?"replace":"variant")}),u.jsx(Yv,{count:Rt.length,disabled:!v.active||Ln||Rt.length>=Ff,inputRef:zo,onFiles:xn}),u.jsx(qv,{annotating:Di,count:rl.length,onToggle:()=>Di?$s():Ti(!0)}),Ui,u.jsx(Xv,{ready:(en.trim()!==""||rl.length>0)&&!!v.active&&!Ln,sending:Ln,target:v.active?v.displayName(v.active):null})]})]})}),Ln?u.jsx("div",{className:"px-3 pb-2",children:u.jsx("p",{"aria-live":"polite",className:"min-w-0 truncate text-[10px] leading-snug text-[#84848C]",children:"Capturing the design for your agent…"})}):Jt.length>0?u.jsx(Z2,{askedFor:$f(v.previewFor(v.active))?.askedFor??null,chain:Jt,displayName:v.displayName,onCompare:m=>{Ni(m),il(!0)},onGo:v.setActive,onRail:m=>v.rows.includes(m),onTrace:Ve,openAsk:!0,self:v.active,tint:xe,traced:oe}):zs===null?null:u.jsx("div",{className:"px-3 pb-2",children:u.jsx("p",{className:"min-w-0 truncate text-[10px] leading-snug text-[#84848C]",title:zs,children:zs})}),v.prefs.showWidget?!ne&&Ft.agent.attached&&zi===null?u.jsx("div",{className:"px-3 pb-2",children:u.jsx("p",{className:"min-w-0 truncate text-[10px] leading-snug text-[#84848C]",children:"Your agent is listening"})}):null:u.jsx("div",{className:"px-3 pb-2",children:u.jsxs("button",{className:"min-w-0 max-w-full truncate rounded text-left text-[10px] leading-snug text-[#84848C] transition-colors hover:text-[#D1D5DB]",onClick:()=>X(!0),type:"button",children:["Bring the tools back ",u.jsx("kbd",{className:"font-sans text-[#9CA3AF]",children:"T"})]})})]})]}),u.jsxs("div",{className:`absolute inset-y-0 left-0 z-30 flex w-12 flex-col items-center bg-[#1C1C20] py-3 transition-opacity duration-150 ${v.prefs.collapsed?"opacity-100":"pointer-events-none opacity-0"}`,inert:!v.prefs.collapsed,children:[u.jsx(No,{size:24}),u.jsx(Je,{label:u.jsxs(u.Fragment,{children:["Open directions ",u.jsx("kbd",{className:"ml-1 text-[#9CA3AF]",children:"["})]}),side:"right",children:u.jsx("button",{"aria-label":"Open the directions panel",className:"mt-3 flex h-6 w-6 items-center justify-center rounded p-1 text-[#9CA3AF] transition-colors hover:bg-[#2E2E2E] hover:text-white",onClick:()=>v.setPrefs(m=>({...m,collapsed:!1})),type:"button",children:u.jsx(Pt,{d:It.sidebar,size:16})})})]}),!v.prefs.collapsed&&u.jsx("div",{"aria-hidden":!0,className:"group/resize absolute inset-y-0 right-0 z-20 flex w-3 cursor-col-resize touch-none justify-end",onPointerDown:v.onHandlePointerDown,children:u.jsx("span",{className:`h-full transition-all duration-150 ${v.resizing?"w-0.5 bg-[#9CA3AF]":"w-px bg-[#232328] group-hover/resize:w-0.5 group-hover/resize:bg-[#9CA3AF]"}`})})]}),u.jsx("span",{"aria-live":"polite",className:"sr-only",role:"status",children:v.copied===null?"":v.copied.kind==="link"?"Link copied":"Reference copied"}),u.jsxs("div",{className:`relative min-w-0 flex-1 ${gt?"grid gap-px bg-[#232328]":Yn?"flex":"overflow-auto"}`,ref:Mr,style:gt?{gridTemplateColumns:`repeat(${Mi.columns}, minmax(0, 1fr))`,gridTemplateRows:`repeat(${Mi.rows}, minmax(0, 1fr))`}:void 0,children:[qa.map(m=>u.jsx(Vv,{annotate:!ne&&Di&&m===v.active?u.jsx(Oy,{notes:rl,onExit:$s,onForget:qs,onKeep:(j,z)=>Bi(m,j,z),onRevise:Al,paneScale:Vo,scaling:Xa,sent:vn,title:m}):null,boxHeight:Ar,boxWidth:Dr,cover:(()=>{const j=_n?Qe(m):void 0;if(j===void 0||j.slot.state==="ready")return null;const z=xl(j);return u.jsx(Rv,{acting:z.acting,agent:Of(j.job.agent),name:v.displayName(m),onReplace:z.onReplace,onRetry:z.onRetry,onStop:z.onStop,slot:j.slot})})(),branch:v.branchState(m),branchName:v.previewFor(m)?.branch??m,busy:bs,designWidth:Tr,errored:Dt[m]===!0,frameHeight:kr,framed:Uo,fromApp:Il.has(m),identity:Ya(m),loaded:Cs(m),name:v.displayName(m),onError:()=>tn(j=>({...j,[m]:!0})),onReady:(j,z)=>Ka(m,j,z),onReload:()=>ln(m),onShowAnyway:()=>{Ho.current.add(v.urlFor(m)),bl(j=>Object.fromEntries(Object.entries(j).filter(([z])=>z!==m)))},onStartBranch:()=>v.startBranch(m),onOpen:gt?()=>{pn(null),v.setActive(m)}:null,order:Yo.get(m)??-1,paneScale:Vo,refusal:Ha[m]??null,scaling:Xa,second:!gt&&m===yn,serverUp:An.reachable,shown:Yo.has(m),splitting:Yn,src:v.urlFor(m),title:m,viewport:v.prefs.viewport},m)),u.jsxs("div",{className:`absolute z-50 flex gap-2 ${ke?"flex-col items-start":{"bottom-right":"bottom-4 right-4 flex-col items-end","bottom-left":"bottom-4 left-4 flex-col items-start","top-right":"right-4 top-4 flex-col-reverse items-end","top-left":"left-4 top-4 flex-col-reverse items-start"}[v.prefs.corner]}`,style:zr,children:[u.jsx(Zv,{applyOverlayPref:Cl,copied:v.copied?.kind==="reference"&&v.copied.title===v.active,fontKey:Si.key,href:v.urlFor(v.active),notify:v.notify,onCopyReference:()=>v.copyReference(v.active),onShortcuts:()=>{X(!1),x(!0)},open:Q,parked:ke!==null,popoverRef:vi,prefs:v.prefs,setPrefs:v.setPrefs,splitting:Yn,viewing:ne,viewports:v.viewports}),(v.prefs.showWidget||Q)&&u.jsx(Je,{label:"Leglas tools",children:u.jsxs("button",{"aria-expanded":Q,"aria-haspopup":"dialog","aria-label":"Leglas tools",className:"relative flex h-11 w-11 items-center justify-center rounded-full border border-white/10 bg-[#1C1C20] shadow-lg transition-[border-color,transform] duration-150 hover:scale-[1.04] hover:border-white/20 active:scale-[0.95] motion-reduce:transform-none motion-reduce:hover:scale-100 motion-reduce:active:scale-100",onClick:()=>{if(_t.current){_t.current=!1;return}X(m=>!m)},onPointerDown:Zo,ref:tl,type:"button",children:[u.jsx(No,{size:30}),!Cs(v.active)&&u.jsx("span",{className:"absolute -right-0.5 -top-0.5 size-2 animate-pulse rounded-full bg-amber-400 motion-reduce:animate-none"})]})})]})]}),u.jsx(ux,{bottom:v.prefs.collapsed?12:_o+8,left:v.prefs.collapsed?60:12,onDismiss:v.dismissToast,toasts:v.toasts,width:(v.prefs.collapsed?320:v.prefs.width)-24}),un!==null&&u.jsx("iframe",{"aria-hidden":!0,className:"pointer-events-none fixed border-0",onLoad:m=>Hr(un,m.currentTarget),ref:_i,src:un.url,style:{height:em.height,left:-2400,top:0,width:em.width},tabIndex:-1,title:"Off-stage duplicate scan"},la??void 0),b?u.jsx(Kv,{mac:Gm,onClose:V,viewer:ne}):null,T?u.jsx(gv,{connected:Ft.agent.attached,fallbackFocusRef:Ot.kind==="none"?Lo:$n,onClose:()=>k(!1)}):null,S!==null?u.jsx(Fv,{busy:N,count:S.titles.length,error:S.error,fallbackFocusRef:d,name:S.titles.length===1?v.displayName(S.titles[0]??""):null,onCancel:st,onConfirm:()=>{ot()}}):null]})}function jo({children:a,title:s}){return u.jsxs("div",{className:"flex h-dvh flex-col items-center justify-center gap-3 bg-[#1C1C20] px-6 text-center antialiased",style:{fontFamily:"var(--font-satoshi)"},children:[u.jsx(No,{size:22}),u.jsx("p",{className:"text-sm font-medium text-white",children:s}),u.jsx("div",{className:"max-w-md text-xs leading-relaxed text-[#84848C]",children:a})]})}class am extends Error{constructor(s){super(`the server answered ${s}`),this.status=s}status}function Kb(){const[a,s]=w.useState({status:"loading"}),[c,r]=w.useReducer(d=>d+1,0),f=w.useRef(0);return w.useEffect(()=>{let d=!1;const p=b=>fetch("/leglas/api/config",{signal:b}).then(x=>{if(!x.ok)throw new am(x.status);return Xt(x)}),y=rs(b=>p(b).then(x=>{d||(f.current=0,s(S=>S.status==="ready"&&JSON.stringify(S.config)===JSON.stringify(x)?S:{status:"ready",config:x}))}).catch(x=>{if(d)return;Df(x)||(f.current+=1);const S=x instanceof am&&x.status===403;s(M=>(M.status==="ready"||M.status==="ended")&&M.config.viewer!==void 0?Df(x)||!S&&f.current<2?M:{status:"ended",config:M.config,final:S}:M.status==="ready"?M:{status:"failed",message:Df(x)?"it did not answer in time":x instanceof Error?x.message:String(x)})}),{everyMs:Mo,subscribe:b=>us().on("config",b)});return()=>{d=!0,y()}},[c]),a.status==="loading"?u.jsx(jo,{title:"Starting Leglas…",children:null}):a.status==="ended"?a.final?u.jsx(jo,{title:"This share has ended",children:"The person sharing it stopped. A share they start later comes with a new link, so ask them for that one."}):u.jsxs(jo,{title:"This share isn’t answering",children:["The link is not reaching their Leglas right now: their machine may be asleep, or the tunnel between you is resetting. It comes back on its own when it can.",u.jsx("p",{className:"mt-4",children:u.jsx("button",{className:"rounded-md bg-[#2E2E2E] px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-[#3A3A40]",onClick:r,type:"button",children:"Try again"})})]}):a.status==="failed"?u.jsxs(jo,{title:"Couldn’t reach the Leglas server",children:[a.message,". The interface is served by the same process that proxies your app, so this usually means it stopped."]}):a.config.errors.length>0?u.jsxs(jo,{title:"Your config needs fixing",children:[u.jsx("ul",{className:"space-y-1 text-left",children:a.config.errors.map(d=>u.jsx("li",{children:d},d))}),u.jsx("p",{className:"mt-3",children:"Fix it and restart Leglas."})]}):u.jsx(Zb,{previews:a.config.previews,project:a.config.project,scanPreviews:a.config.scanPreviews??!0,viewer:a.config.viewer,warnings:a.config.warnings??[]})}const Xm=document.getElementById("root");if(!Xm)throw new Error("Leglas: #root is missing from the document.");pg.createRoot(Xm).render(u.jsx(w.StrictMode,{children:u.jsx(Kb,{})}));