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.
- package/dist/args.d.ts +5 -0
- package/dist/bin-start.d.ts +5 -0
- package/dist/bin.js +1834 -372
- package/dist/index.js +1482 -162
- package/dist/run-explore-build.d.ts +27 -0
- package/dist/run-watch.d.ts +1 -0
- package/dist/shell/assets/index-C59b2VHc.css +1 -0
- package/dist/shell/assets/index-CcHf_UOb.js +14 -0
- package/dist/shell/index.html +2 -2
- package/package.json +3 -3
- package/dist/shell/assets/index-DfiRUTCS.css +0 -1
- package/dist/shell/assets/index-lVZbvEvf.js +0 -14
|
@@ -1,14 +0,0 @@
|
|
|
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 h of f)if(h.type==="childList")for(const g of h.addedNodes)g.tagName==="LINK"&&g.rel==="modulepreload"&&r(g)}).observe(document,{childList:!0,subtree:!0});function c(f){const h={};return f.integrity&&(h.integrity=f.integrity),f.referrerPolicy&&(h.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?h.credentials="include":f.crossOrigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function r(f){if(f.ep)return;f.ep=!0;const h=c(f);fetch(f.href,h)}})();var Zc={exports:{}},Js={};var B0;function Vp(){if(B0)return Js;B0=1;var a=Symbol.for("react.transitional.element"),s=Symbol.for("react.fragment");function c(r,f,h){var g=null;if(h!==void 0&&(g=""+h),f.key!==void 0&&(g=""+f.key),"key"in f){h={};for(var x in f)x!=="key"&&(h[x]=f[x])}else h=f;return f=h.ref,{$$typeof:a,type:r,key:g,ref:f!==void 0?f:null,props:h}}return Js.Fragment=s,Js.jsx=c,Js.jsxs=c,Js}var U0;function Zp(){return U0||(U0=1,Zc.exports=Vp()),Zc.exports}var o=Zp(),Kc={exports:{}},Ae={};var H0;function Kp(){if(H0)return Ae;H0=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"),h=Symbol.for("react.consumer"),g=Symbol.for("react.context"),x=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),C=Symbol.for("react.activity"),T=Symbol.iterator;function k(j){return j===null||typeof j!="object"?null:(j=T&&j[T]||j["@@iterator"],typeof j=="function"?j:null)}var M={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Y=Object.assign,q={};function z(j,U,ae){this.props=j,this.context=U,this.refs=q,this.updater=ae||M}z.prototype.isReactComponent={},z.prototype.setState=function(j,U){if(typeof j!="object"&&typeof j!="function"&&j!=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,j,U,"setState")},z.prototype.forceUpdate=function(j){this.updater.enqueueForceUpdate(this,j,"forceUpdate")};function V(){}V.prototype=z.prototype;function H(j,U,ae){this.props=j,this.context=U,this.refs=q,this.updater=ae||M}var W=H.prototype=new V;W.constructor=H,Y(W,z.prototype),W.isPureReactComponent=!0;var ee=Array.isArray;function ne(){}var b={H:null,A:null,T:null,S:null},te=Object.prototype.hasOwnProperty;function ue(j,U,ae){var oe=ae.ref;return{$$typeof:a,type:j,key:U,ref:oe!==void 0?oe:null,props:ae}}function P(j,U){return ue(j.type,U,j.props)}function he(j){return typeof j=="object"&&j!==null&&j.$$typeof===a}function re(j){var U={"=":"=0",":":"=2"};return"$"+j.replace(/[=:]/g,function(ae){return U[ae]})}var Ee=/\/+/g;function we(j,U){return typeof j=="object"&&j!==null&&j.key!=null?re(""+j.key):U.toString(36)}function Te(j){switch(j.status){case"fulfilled":return j.value;case"rejected":throw j.reason;default:switch(typeof j.status=="string"?j.then(ne,ne):(j.status="pending",j.then(function(U){j.status==="pending"&&(j.status="fulfilled",j.value=U)},function(U){j.status==="pending"&&(j.status="rejected",j.reason=U)})),j.status){case"fulfilled":return j.value;case"rejected":throw j.reason}}throw j}function L(j,U,ae,oe,pe){var Ce=typeof j;(Ce==="undefined"||Ce==="boolean")&&(j=null);var R=!1;if(j===null)R=!0;else switch(Ce){case"bigint":case"string":case"number":R=!0;break;case"object":switch(j.$$typeof){case a:case s:R=!0;break;case w:return R=j._init,L(R(j._payload),U,ae,oe,pe)}}if(R)return pe=pe(j),R=oe===""?"."+we(j,0):oe,ee(pe)?(ae="",R!=null&&(ae=R.replace(Ee,"$&/")+"/"),L(pe,U,ae,"",function(xe){return xe})):pe!=null&&(he(pe)&&(pe=P(pe,ae+(pe.key==null||j&&j.key===pe.key?"":(""+pe.key).replace(Ee,"$&/")+"/")+R)),U.push(pe)),1;R=0;var Z=oe===""?".":oe+":";if(ee(j))for(var ie=0;ie<j.length;ie++)oe=j[ie],Ce=Z+we(oe,ie),R+=L(oe,U,ae,Ce,pe);else if(ie=k(j),typeof ie=="function")for(j=ie.call(j),ie=0;!(oe=j.next()).done;)oe=oe.value,Ce=Z+we(oe,ie++),R+=L(oe,U,ae,Ce,pe);else if(Ce==="object"){if(typeof j.then=="function")return L(Te(j),U,ae,oe,pe);throw U=String(j),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(j).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.")}return R}function I(j,U,ae){if(j==null)return j;var oe=[],pe=0;return L(j,oe,"","",function(Ce){return U.call(ae,Ce,pe++)}),oe}function se(j){if(j._status===-1){var U=j._result;U=U(),U.then(function(ae){(j._status===0||j._status===-1)&&(j._status=1,j._result=ae)},function(ae){(j._status===0||j._status===-1)&&(j._status=2,j._result=ae)}),j._status===-1&&(j._status=0,j._result=U)}if(j._status===1)return j._result.default;throw j._result}var Se=typeof reportError=="function"?reportError:function(j){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var U=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof j=="object"&&j!==null&&typeof j.message=="string"?String(j.message):String(j),error:j});if(!window.dispatchEvent(U))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",j);return}console.error(j)},ye={map:I,forEach:function(j,U,ae){I(j,function(){U.apply(this,arguments)},ae)},count:function(j){var U=0;return I(j,function(){U++}),U},toArray:function(j){return I(j,function(U){return U})||[]},only:function(j){if(!he(j))throw Error("React.Children.only expected to receive a single React element child.");return j}};return Ae.Activity=C,Ae.Children=ye,Ae.Component=z,Ae.Fragment=c,Ae.Profiler=f,Ae.PureComponent=H,Ae.StrictMode=r,Ae.Suspense=v,Ae.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=b,Ae.__COMPILER_RUNTIME={__proto__:null,c:function(j){return b.H.useMemoCache(j)}},Ae.cache=function(j){return function(){return j.apply(null,arguments)}},Ae.cacheSignal=function(){return null},Ae.cloneElement=function(j,U,ae){if(j==null)throw Error("The argument must be a React element, but you passed "+j+".");var oe=Y({},j.props),pe=j.key;if(U!=null)for(Ce in U.key!==void 0&&(pe=""+U.key),U)!te.call(U,Ce)||Ce==="key"||Ce==="__self"||Ce==="__source"||Ce==="ref"&&U.ref===void 0||(oe[Ce]=U[Ce]);var Ce=arguments.length-2;if(Ce===1)oe.children=ae;else if(1<Ce){for(var R=Array(Ce),Z=0;Z<Ce;Z++)R[Z]=arguments[Z+2];oe.children=R}return ue(j.type,pe,oe)},Ae.createContext=function(j){return j={$$typeof:g,_currentValue:j,_currentValue2:j,_threadCount:0,Provider:null,Consumer:null},j.Provider=j,j.Consumer={$$typeof:h,_context:j},j},Ae.createElement=function(j,U,ae){var oe,pe={},Ce=null;if(U!=null)for(oe in U.key!==void 0&&(Ce=""+U.key),U)te.call(U,oe)&&oe!=="key"&&oe!=="__self"&&oe!=="__source"&&(pe[oe]=U[oe]);var R=arguments.length-2;if(R===1)pe.children=ae;else if(1<R){for(var Z=Array(R),ie=0;ie<R;ie++)Z[ie]=arguments[ie+2];pe.children=Z}if(j&&j.defaultProps)for(oe in R=j.defaultProps,R)pe[oe]===void 0&&(pe[oe]=R[oe]);return ue(j,Ce,pe)},Ae.createRef=function(){return{current:null}},Ae.forwardRef=function(j){return{$$typeof:x,render:j}},Ae.isValidElement=he,Ae.lazy=function(j){return{$$typeof:w,_payload:{_status:-1,_result:j},_init:se}},Ae.memo=function(j,U){return{$$typeof:y,type:j,compare:U===void 0?null:U}},Ae.startTransition=function(j){var U=b.T,ae={};b.T=ae;try{var oe=j(),pe=b.S;pe!==null&&pe(ae,oe),typeof oe=="object"&&oe!==null&&typeof oe.then=="function"&&oe.then(ne,Se)}catch(Ce){Se(Ce)}finally{U!==null&&ae.types!==null&&(U.types=ae.types),b.T=U}},Ae.unstable_useCacheRefresh=function(){return b.H.useCacheRefresh()},Ae.use=function(j){return b.H.use(j)},Ae.useActionState=function(j,U,ae){return b.H.useActionState(j,U,ae)},Ae.useCallback=function(j,U){return b.H.useCallback(j,U)},Ae.useContext=function(j){return b.H.useContext(j)},Ae.useDebugValue=function(){},Ae.useDeferredValue=function(j,U){return b.H.useDeferredValue(j,U)},Ae.useEffect=function(j,U){return b.H.useEffect(j,U)},Ae.useEffectEvent=function(j){return b.H.useEffectEvent(j)},Ae.useId=function(){return b.H.useId()},Ae.useImperativeHandle=function(j,U,ae){return b.H.useImperativeHandle(j,U,ae)},Ae.useInsertionEffect=function(j,U){return b.H.useInsertionEffect(j,U)},Ae.useLayoutEffect=function(j,U){return b.H.useLayoutEffect(j,U)},Ae.useMemo=function(j,U){return b.H.useMemo(j,U)},Ae.useOptimistic=function(j,U){return b.H.useOptimistic(j,U)},Ae.useReducer=function(j,U,ae){return b.H.useReducer(j,U,ae)},Ae.useRef=function(j){return b.H.useRef(j)},Ae.useState=function(j){return b.H.useState(j)},Ae.useSyncExternalStore=function(j,U,ae){return b.H.useSyncExternalStore(j,U,ae)},Ae.useTransition=function(){return b.H.useTransition()},Ae.version="19.2.8",Ae}var q0;function wf(){return q0||(q0=1,Kc.exports=Kp()),Kc.exports}var S=wf(),Fc={exports:{}},Ws={},Jc={exports:{}},Wc={};var $0;function Fp(){return $0||($0=1,(function(a){function s(L,I){var se=L.length;L.push(I);e:for(;0<se;){var Se=se-1>>>1,ye=L[Se];if(0<f(ye,I))L[Se]=I,L[se]=ye,se=Se;else break e}}function c(L){return L.length===0?null:L[0]}function r(L){if(L.length===0)return null;var I=L[0],se=L.pop();if(se!==I){L[0]=se;e:for(var Se=0,ye=L.length,j=ye>>>1;Se<j;){var U=2*(Se+1)-1,ae=L[U],oe=U+1,pe=L[oe];if(0>f(ae,se))oe<ye&&0>f(pe,ae)?(L[Se]=pe,L[oe]=se,Se=oe):(L[Se]=ae,L[U]=se,Se=U);else if(oe<ye&&0>f(pe,se))L[Se]=pe,L[oe]=se,Se=oe;else break e}}return I}function f(L,I){var se=L.sortIndex-I.sortIndex;return se!==0?se:L.id-I.id}if(a.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var h=performance;a.unstable_now=function(){return h.now()}}else{var g=Date,x=g.now();a.unstable_now=function(){return g.now()-x}}var v=[],y=[],w=1,C=null,T=3,k=!1,M=!1,Y=!1,q=!1,z=typeof setTimeout=="function"?setTimeout:null,V=typeof clearTimeout=="function"?clearTimeout:null,H=typeof setImmediate<"u"?setImmediate:null;function W(L){for(var I=c(y);I!==null;){if(I.callback===null)r(y);else if(I.startTime<=L)r(y),I.sortIndex=I.expirationTime,s(v,I);else break;I=c(y)}}function ee(L){if(Y=!1,W(L),!M)if(c(v)!==null)M=!0,ne||(ne=!0,re());else{var I=c(y);I!==null&&Te(ee,I.startTime-L)}}var ne=!1,b=-1,te=5,ue=-1;function P(){return q?!0:!(a.unstable_now()-ue<te)}function he(){if(q=!1,ne){var L=a.unstable_now();ue=L;var I=!0;try{e:{M=!1,Y&&(Y=!1,V(b),b=-1),k=!0;var se=T;try{t:{for(W(L),C=c(v);C!==null&&!(C.expirationTime>L&&P());){var Se=C.callback;if(typeof Se=="function"){C.callback=null,T=C.priorityLevel;var ye=Se(C.expirationTime<=L);if(L=a.unstable_now(),typeof ye=="function"){C.callback=ye,W(L),I=!0;break t}C===c(v)&&r(v),W(L)}else r(v);C=c(v)}if(C!==null)I=!0;else{var j=c(y);j!==null&&Te(ee,j.startTime-L),I=!1}}break e}finally{C=null,T=se,k=!1}I=void 0}}finally{I?re():ne=!1}}}var re;if(typeof H=="function")re=function(){H(he)};else if(typeof MessageChannel<"u"){var Ee=new MessageChannel,we=Ee.port2;Ee.port1.onmessage=he,re=function(){we.postMessage(null)}}else re=function(){z(he,0)};function Te(L,I){b=z(function(){L(a.unstable_now())},I)}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(L){L.callback=null},a.unstable_forceFrameRate=function(L){0>L||125<L?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):te=0<L?Math.floor(1e3/L):5},a.unstable_getCurrentPriorityLevel=function(){return T},a.unstable_next=function(L){switch(T){case 1:case 2:case 3:var I=3;break;default:I=T}var se=T;T=I;try{return L()}finally{T=se}},a.unstable_requestPaint=function(){q=!0},a.unstable_runWithPriority=function(L,I){switch(L){case 1:case 2:case 3:case 4:case 5:break;default:L=3}var se=T;T=L;try{return I()}finally{T=se}},a.unstable_scheduleCallback=function(L,I,se){var Se=a.unstable_now();switch(typeof se=="object"&&se!==null?(se=se.delay,se=typeof se=="number"&&0<se?Se+se:Se):se=Se,L){case 1:var ye=-1;break;case 2:ye=250;break;case 5:ye=1073741823;break;case 4:ye=1e4;break;default:ye=5e3}return ye=se+ye,L={id:w++,callback:I,priorityLevel:L,startTime:se,expirationTime:ye,sortIndex:-1},se>Se?(L.sortIndex=se,s(y,L),c(v)===null&&L===c(y)&&(Y?(V(b),b=-1):Y=!0,Te(ee,se-Se))):(L.sortIndex=ye,s(v,L),M||k||(M=!0,ne||(ne=!0,re()))),L},a.unstable_shouldYield=P,a.unstable_wrapCallback=function(L){var I=T;return function(){var se=T;T=I;try{return L.apply(this,arguments)}finally{T=se}}}})(Wc)),Wc}var Y0;function Jp(){return Y0||(Y0=1,Jc.exports=Fp()),Jc.exports}var Ic={exports:{}},Ht={};var G0;function Wp(){if(G0)return Ht;G0=1;var a=wf();function s(v){var y="https://react.dev/errors/"+v;if(1<arguments.length){y+="?args[]="+encodeURIComponent(arguments[1]);for(var w=2;w<arguments.length;w++)y+="&args[]="+encodeURIComponent(arguments[w])}return"Minified React error #"+v+"; visit "+y+" 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 h(v,y,w){var C=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:f,key:C==null?null:""+C,children:v,containerInfo:y,implementation:w}}var g=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function x(v,y){if(v==="font")return"";if(typeof y=="string")return y==="use-credentials"?y:""}return Ht.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Ht.createPortal=function(v,y){var w=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!y||y.nodeType!==1&&y.nodeType!==9&&y.nodeType!==11)throw Error(s(299));return h(v,y,null,w)},Ht.flushSync=function(v){var y=g.T,w=r.p;try{if(g.T=null,r.p=2,v)return v()}finally{g.T=y,r.p=w,r.d.f()}},Ht.preconnect=function(v,y){typeof v=="string"&&(y?(y=y.crossOrigin,y=typeof y=="string"?y==="use-credentials"?y:"":void 0):y=null,r.d.C(v,y))},Ht.prefetchDNS=function(v){typeof v=="string"&&r.d.D(v)},Ht.preinit=function(v,y){if(typeof v=="string"&&y&&typeof y.as=="string"){var w=y.as,C=x(w,y.crossOrigin),T=typeof y.integrity=="string"?y.integrity:void 0,k=typeof y.fetchPriority=="string"?y.fetchPriority:void 0;w==="style"?r.d.S(v,typeof y.precedence=="string"?y.precedence:void 0,{crossOrigin:C,integrity:T,fetchPriority:k}):w==="script"&&r.d.X(v,{crossOrigin:C,integrity:T,fetchPriority:k,nonce:typeof y.nonce=="string"?y.nonce:void 0})}},Ht.preinitModule=function(v,y){if(typeof v=="string")if(typeof y=="object"&&y!==null){if(y.as==null||y.as==="script"){var w=x(y.as,y.crossOrigin);r.d.M(v,{crossOrigin:w,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0})}}else y==null&&r.d.M(v)},Ht.preload=function(v,y){if(typeof v=="string"&&typeof y=="object"&&y!==null&&typeof y.as=="string"){var w=y.as,C=x(w,y.crossOrigin);r.d.L(v,w,{crossOrigin:C,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0,type:typeof y.type=="string"?y.type:void 0,fetchPriority:typeof y.fetchPriority=="string"?y.fetchPriority:void 0,referrerPolicy:typeof y.referrerPolicy=="string"?y.referrerPolicy:void 0,imageSrcSet:typeof y.imageSrcSet=="string"?y.imageSrcSet:void 0,imageSizes:typeof y.imageSizes=="string"?y.imageSizes:void 0,media:typeof y.media=="string"?y.media:void 0})}},Ht.preloadModule=function(v,y){if(typeof v=="string")if(y){var w=x(y.as,y.crossOrigin);r.d.m(v,{as:typeof y.as=="string"&&y.as!=="script"?y.as:void 0,crossOrigin:w,integrity:typeof y.integrity=="string"?y.integrity:void 0})}else r.d.m(v)},Ht.requestFormReset=function(v){r.d.r(v)},Ht.unstable_batchedUpdates=function(v,y){return v(y)},Ht.useFormState=function(v,y,w){return g.H.useFormState(v,y,w)},Ht.useFormStatus=function(){return g.H.useHostTransitionStatus()},Ht.version="19.2.8",Ht}var X0;function $1(){if(X0)return Ic.exports;X0=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(),Ic.exports=Wp(),Ic.exports}var Q0;function Ip(){if(Q0)return Ws;Q0=1;var a=Jp(),s=wf(),c=$1();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 h(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 g(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 x(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 v(e){if(h(e)!==e)throw Error(r(188))}function y(e){var t=e.alternate;if(!t){if(t=h(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 u=i.alternate;if(u===null){if(l=i.return,l!==null){n=l;continue}break}if(i.child===u.child){for(u=i.child;u;){if(u===n)return v(i),e;if(u===l)return v(i),t;u=u.sibling}throw Error(r(188))}if(n.return!==l.return)n=i,l=u;else{for(var d=!1,p=i.child;p;){if(p===n){d=!0,n=i,l=u;break}if(p===l){d=!0,l=i,n=u;break}p=p.sibling}if(!d){for(p=u.child;p;){if(p===n){d=!0,n=u,l=i;break}if(p===l){d=!0,l=u,n=i;break}p=p.sibling}if(!d)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 w(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=w(e),t!==null)return t;e=e.sibling}return null}var C=Object.assign,T=Symbol.for("react.element"),k=Symbol.for("react.transitional.element"),M=Symbol.for("react.portal"),Y=Symbol.for("react.fragment"),q=Symbol.for("react.strict_mode"),z=Symbol.for("react.profiler"),V=Symbol.for("react.consumer"),H=Symbol.for("react.context"),W=Symbol.for("react.forward_ref"),ee=Symbol.for("react.suspense"),ne=Symbol.for("react.suspense_list"),b=Symbol.for("react.memo"),te=Symbol.for("react.lazy"),ue=Symbol.for("react.activity"),P=Symbol.for("react.memo_cache_sentinel"),he=Symbol.iterator;function re(e){return e===null||typeof e!="object"?null:(e=he&&e[he]||e["@@iterator"],typeof e=="function"?e:null)}var Ee=Symbol.for("react.client.reference");function we(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 Y:return"Fragment";case z:return"Profiler";case q:return"StrictMode";case ee:return"Suspense";case ne:return"SuspenseList";case ue:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case M:return"Portal";case H:return e.displayName||"Context";case V:return(e._context.displayName||"Context")+".Consumer";case W:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case b:return t=e.displayName||null,t!==null?t:we(e.type)||"Memo";case te:t=e._payload,e=e._init;try{return we(e(t))}catch{}}return null}var Te=Array.isArray,L=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=c.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,se={pending:!1,data:null,method:null,action:null},Se=[],ye=-1;function j(e){return{current:e}}function U(e){0>ye||(e.current=Se[ye],Se[ye]=null,ye--)}function ae(e,t){ye++,Se[ye]=e.current,e.current=t}var oe=j(null),pe=j(null),Ce=j(null),R=j(null);function Z(e,t){switch(ae(Ce,t),ae(pe,e),ae(oe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?s0(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=s0(t),e=u0(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}U(oe),ae(oe,e)}function ie(){U(oe),U(pe),U(Ce)}function xe(e){e.memoizedState!==null&&ae(R,e);var t=oe.current,n=u0(t,e.type);t!==n&&(ae(pe,e),ae(oe,n))}function Ne(e){pe.current===e&&(U(oe),U(pe)),R.current===e&&(U(R),Vs._currentValue=se)}var Ge,lt;function at(e){if(Ge===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Ge=t&&t[1]||"",lt=-1<n.stack.indexOf(`
|
|
2
|
-
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
-
`+Ge+e+lt}var ze=!1;function Je(e,t){if(!e||ze)return"";ze=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(t){var J=function(){throw Error()};if(Object.defineProperty(J.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(J,[])}catch(G){var B=G}Reflect.construct(e,[],J)}else{try{J.call()}catch(G){B=G}e.call(J.prototype)}}else{try{throw Error()}catch(G){B=G}(J=e())&&typeof J.catch=="function"&&J.catch(function(){})}}catch(G){if(G&&B&&typeof G.stack=="string")return[G.stack,B.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 u=l.DetermineComponentFrameRoot(),d=u[0],p=u[1];if(d&&p){var E=d.split(`
|
|
4
|
-
`),_=p.split(`
|
|
5
|
-
`);for(i=l=0;l<E.length&&!E[l].includes("DetermineComponentFrameRoot");)l++;for(;i<_.length&&!_[i].includes("DetermineComponentFrameRoot");)i++;if(l===E.length||i===_.length)for(l=E.length-1,i=_.length-1;1<=l&&0<=i&&E[l]!==_[i];)i--;for(;1<=l&&0<=i;l--,i--)if(E[l]!==_[i]){if(l!==1||i!==1)do if(l--,i--,0>i||E[l]!==_[i]){var K=`
|
|
6
|
-
`+E[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{ze=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?at(n):""}function Et(e,t){switch(e.tag){case 26:case 27:case 5:return at(e.type);case 16:return at("Lazy");case 13:return e.child!==t&&t!==null?at("Suspense Fallback"):at("Suspense");case 19:return at("SuspenseList");case 0:case 15:return Je(e.type,!1);case 11:return Je(e.type.render,!1);case 1:return Je(e.type,!0);case 31:return at("Activity");default:return""}}function Nt(e){try{var t="",n=null;do t+=Et(e,n),n=e,e=e.return;while(e);return t}catch(l){return`
|
|
7
|
-
Error generating stack: `+l.message+`
|
|
8
|
-
`+l.stack}}var qt=Object.prototype.hasOwnProperty,$n=a.unstable_scheduleCallback,yn=a.unstable_cancelCallback,Fa=a.unstable_shouldYield,Dn=a.unstable_requestPaint,dt=a.unstable_now,$t=a.unstable_getCurrentPriorityLevel,sn=a.unstable_ImmediatePriority,Yn=a.unstable_UserBlockingPriority,Ml=a.unstable_NormalPriority,Ja=a.unstable_LowPriority,Nl=a.unstable_IdlePriority,tl=a.log,Wa=a.unstable_setDisableYieldValue,kn=null,At=null;function un(e){if(typeof tl=="function"&&Wa(e),At&&typeof At.setStrictMode=="function")try{At.setStrictMode(kn,e)}catch{}}var Tt=Math.clz32?Math.clz32:Al,ma=Math.log,Ia=Math.LN2;function Al(e){return e>>>=0,e===0?32:31-(ma(e)/Ia|0)|0}var nl=256,Gn=262144,Yt=4194304;function _t(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 on(e,t,n){var l=e.pendingLanes;if(l===0)return 0;var i=0,u=e.suspendedLanes,d=e.pingedLanes;e=e.warmLanes;var p=l&134217727;return p!==0?(l=p&~u,l!==0?i=_t(l):(d&=p,d!==0?i=_t(d):n||(n=p&~e,n!==0&&(i=_t(n))))):(p=l&~u,p!==0?i=_t(p):d!==0?i=_t(d):n||(n=l&~e,n!==0&&(i=_t(n)))),i===0?0:t!==0&&t!==i&&(t&u)===0&&(u=i&-i,n=t&-t,u>=n||u===32&&(n&4194048)!==0)?t:i}function xn(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function pa(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 Tl(){var e=Yt;return Yt<<=1,(Yt&62914560)===0&&(Yt=4194304),e}function Xn(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Qn(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Pa(e,t,n,l,i,u){var d=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 p=e.entanglements,E=e.expirationTimes,_=e.hiddenUpdates;for(n=d&~n;0<n;){var K=31-Tt(n),J=1<<K;p[K]=0,E[K]=-1;var B=_[K];if(B!==null)for(_[K]=null,K=0;K<B.length;K++){var G=B[K];G!==null&&(G.lane&=-536870913)}n&=~J}l!==0&&ei(e,l,0),u!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=u&~(d&~t))}function ei(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-Tt(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|n&261930}function ti(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var l=31-Tt(n),i=1<<l;i&t|e[l]&t&&(e[l]|=t),n&=~i}}function X(e,t){var n=t&-t;return n=(n&42)!==0?1:de(n),(n&(e.suspendedLanes|t))!==0?0:n}function de(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 De(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function _e(){var e=I.p;return e!==0?e:(e=window.event,e===void 0?32:D0(e.type))}function ce(e,t){var n=I.p;try{return I.p=e,t()}finally{I.p=n}}var $e=Math.random().toString(36).slice(2),Ze="__reactFiber$"+$e,Oe="__reactProps$"+$e,ot="__reactContainer$"+$e,ll="__reactEvents$"+$e,Go="__reactListeners$"+$e,Xo="__reactHandles$"+$e,al="__reactResources$"+$e,il="__reactMarker$"+$e;function Vn(e){delete e[Ze],delete e[Oe],delete e[ll],delete e[Go],delete e[Xo]}function Dl(e){var t=e[Ze];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ot]||n[Ze]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=m0(e);e!==null;){if(n=e[Ze])return n;e=m0(e)}return t}e=n,n=e.parentNode}return null}function kl(e){if(e=e[Ze]||e[ot]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function zl(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(r(33))}function Zn(e){var t=e[al];return t||(t=e[al]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function yt(e){e[il]=!0}var ni=new Set,Vi={};function vn(e,t){Kt(e,t),Kt(e+"Capture",t)}function Kt(e,t){for(Vi[e]=t,e=0;e<t.length;e++)ni.add(t[e])}var au=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]*$"),li={},Zi={};function Qo(e){return qt.call(Zi,e)?!0:qt.call(li,e)?!1:au.test(e)?Zi[e]=!0:(li[e]=!0,!1)}function ga(e,t,n){if(Qo(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 Rl(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 Gt(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 Ft(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ya(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Ki(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,u=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(d){n=""+d,u.call(this,d)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return n},setValue:function(d){n=""+d},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Fi(e){if(!e._valueTracker){var t=ya(e)?"checked":"value";e._valueTracker=Ki(e,t,""+e[t])}}function iu(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),l="";return e&&(l=ya(e)?e.checked?"true":"false":e.value),e=l,e!==n?(t.setValue(e),!0):!1}function xa(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 rn=/[\n"\\]/g;function Dt(e){return e.replace(rn,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function ai(e,t,n,l,i,u,d,p){e.name="",d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"?e.type=d:e.removeAttribute("type"),t!=null?d==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Ft(t)):e.value!==""+Ft(t)&&(e.value=""+Ft(t)):d!=="submit"&&d!=="reset"||e.removeAttribute("value"),t!=null?sl(e,d,Ft(t)):n!=null?sl(e,d,Ft(n)):l!=null&&e.removeAttribute("value"),i==null&&u!=null&&(e.defaultChecked=!!u),i!=null&&(e.checked=i&&typeof i!="function"&&typeof i!="symbol"),p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"?e.name=""+Ft(p):e.removeAttribute("name")}function zn(e,t,n,l,i,u,d,p){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(e.type=u),t!=null||n!=null){if(!(u!=="submit"&&u!=="reset"||t!=null)){Fi(e);return}n=n!=null?""+Ft(n):"",t=t!=null?""+Ft(t):n,p||t===e.value||(e.value=t),e.defaultValue=t}l=l??i,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=p?e.checked:!!l,e.defaultChecked=!!l,d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.name=d),Fi(e)}function sl(e,t,n){t==="number"&&xa(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Kn(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=""+Ft(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 Ol(e,t,n){if(t!=null&&(t=""+Ft(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+Ft(n):""}function ii(e,t,n,l){if(t==null){if(l!=null){if(n!=null)throw Error(r(92));if(Te(l)){if(1<l.length)throw Error(r(93));l=l[0]}n=l}n==null&&(n=""),t=n}n=Ft(t),e.defaultValue=n,l=e.textContent,l===n&&l!==""&&l!==null&&(e.value=l),Fi(e)}function ul(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var _l=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 Ji(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||_l.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function si(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&&Ji(e,i,l)}else for(var u in t)t.hasOwnProperty(u)&&Ji(e,u,t[u])}function ui(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 su=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"]]),va=/^[\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 ba(e){return va.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Rn(){}var Wi=null;function Ii(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ll=null,Bl=null;function Pi(e){var t=kl(e);if(t&&(e=t.stateNode)){var n=e[Oe]||null;e:switch(e=t.stateNode,t.type){case"input":if(ai(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="'+Dt(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var l=n[t];if(l!==e&&l.form===e.form){var i=l[Oe]||null;if(!i)throw Error(r(90));ai(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&&iu(l)}break e;case"textarea":Ol(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Kn(e,!!n.multiple,t,!1)}}}var wa=!1;function es(e,t,n){if(wa)return e(t,n);wa=!0;try{var l=e(t);return l}finally{if(wa=!1,(Ll!==null||Bl!==null)&&(to(),Ll&&(t=Ll,e=Bl,Bl=Ll=null,Pi(t),e)))for(t=0;t<e.length;t++)Pi(e[t])}}function Sa(e,t){var n=e.stateNode;if(n===null)return null;var l=n[Oe]||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 On=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),cn=!1;if(On)try{var Ul={};Object.defineProperty(Ul,"passive",{get:function(){cn=!0}}),window.addEventListener("test",Ul,Ul),window.removeEventListener("test",Ul,Ul)}catch{cn=!1}var Jt=null,ts=null,Wt=null;function uu(){if(Wt)return Wt;var e,t=ts,n=t.length,l,i="value"in Jt?Jt.value:Jt.textContent,u=i.length;for(e=0;e<n&&t[e]===i[e];e++);var d=n-e;for(l=1;l<=d&&t[n-l]===i[u-l];l++);return Wt=i.slice(e,1<l?1-l:void 0)}function oi(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 ri(){return!0}function ci(){return!1}function Ct(e){function t(n,l,i,u,d){this._reactName=n,this._targetInst=i,this.type=l,this.nativeEvent=u,this.target=d,this.currentTarget=null;for(var p in e)e.hasOwnProperty(p)&&(n=e[p],this[p]=n?n(u):u[p]);return this.isDefaultPrevented=(u.defaultPrevented!=null?u.defaultPrevented:u.returnValue===!1)?ri:ci,this.isPropagationStopped=ci,this}return C(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=ri)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=ri)},persist:function(){},isPersistent:ri}),t}var St={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ol=Ct(St),Hl=C({},St,{view:0,detail:0}),ns=Ct(Hl),ls,_n,Lt,ja=C({},Hl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ss,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!==Lt&&(Lt&&e.type==="mousemove"?(ls=e.screenX-Lt.screenX,_n=e.screenY-Lt.screenY):_n=ls=0,Lt=e),ls)},movementY:function(e){return"movementY"in e?e.movementY:_n}}),fi=Ct(ja),di=C({},ja,{dataTransfer:0}),Vo=Ct(di),Fn=C({},Hl,{relatedTarget:0}),Ea=Ct(Fn),ou=C({},St,{animationName:0,elapsedTime:0,pseudoElement:0}),Zo=Ct(ou),as=C({},St,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Ko=Ct(as),Fo=C({},St,{data:0}),ru=Ct(Fo),Jo={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Wo={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"},cu={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function is(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=cu[e])?!!t[e]:!1}function ss(){return is}var Io=C({},Hl,{key:function(e){if(e.key){var t=Jo[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=oi(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Wo[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ss,charCode:function(e){return e.type==="keypress"?oi(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?oi(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),us=Ct(Io),Po=C({},ja,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),os=Ct(Po),Ca=C({},Hl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ss}),er=Ct(Ca),tr=C({},St,{propertyName:0,elapsedTime:0,pseudoElement:0}),fu=Ct(tr),hi=C({},ja,{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}),du=Ct(hi),hu=C({},St,{newState:0,oldState:0}),nr=Ct(hu),ql=[9,13,27,32],rs=On&&"CompositionEvent"in window,Ma=null;On&&"documentMode"in document&&(Ma=document.documentMode);var lr=On&&"TextEvent"in window&&!Ma,mu=On&&(!rs||Ma&&8<Ma&&11>=Ma),pu=" ",cs=!1;function gu(e,t){switch(e){case"keyup":return ql.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function yu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Bt=!1;function ar(e,t){switch(e){case"compositionend":return yu(t);case"keypress":return t.which!==32?null:(cs=!0,pu);case"textInput":return e=t.data,e===pu&&cs?null:e;default:return null}}function mi(e,t){if(Bt)return e==="compositionend"||!rs&&gu(e,t)?(e=uu(),Wt=ts=Jt=null,Bt=!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 mu&&t.locale!=="ko"?null:t.data;default:return null}}var fs={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 pi(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!fs[e.type]:t==="textarea"}function ds(e,t,n,l){Ll?Bl?Bl.push(l):Bl=[l]:Ll=l,t=oo(t,"onChange"),0<t.length&&(n=new ol("onChange","change",null,n,l),e.push({event:n,listeners:t}))}var $l=null,Na=null;function ir(e){e0(e,0)}function gi(e){var t=zl(e);if(iu(t))return e}function xu(e,t){if(e==="change")return t}var hs=!1;if(On){var ms;if(On){var ps="oninput"in document;if(!ps){var vu=document.createElement("div");vu.setAttribute("oninput","return;"),ps=typeof vu.oninput=="function"}ms=ps}else ms=!1;hs=ms&&(!document.documentMode||9<document.documentMode)}function bu(){$l&&($l.detachEvent("onpropertychange",m),Na=$l=null)}function m(e){if(e.propertyName==="value"&&gi(Na)){var t=[];ds(t,Na,e,Ii(e)),es(ir,t)}}function A(e,t,n){e==="focusin"?(bu(),$l=t,Na=n,$l.attachEvent("onpropertychange",m)):e==="focusout"&&bu()}function $(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return gi(Na)}function Q(e,t){if(e==="click")return gi(t)}function le(e,t){if(e==="input"||e==="change")return gi(t)}function me(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var fe=typeof Object.is=="function"?Object.is:me;function ge(e,t){if(fe(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(!qt.call(t,i)||!fe(e[i],t[i]))return!1}return!0}function We(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Fe(e,t){var n=We(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=We(n)}}function it(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?it(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Xt(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=xa(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=xa(e.document)}return t}function Ye(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 bn=On&&"documentMode"in document&&11>=document.documentMode,Qt=null,rl=null,cl=null,gs=!1;function ys(e,t,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;gs||Qt==null||Qt!==xa(l)||(l=Qt,"selectionStart"in l&&Ye(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}),cl&&ge(cl,l)||(cl=l,l=oo(rl,"onSelect"),0<l.length&&(t=new ol("onSelect","select",null,t,n),e.push({event:t,listeners:l}),t.target=Qt)))}function Jn(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ut={animationend:Jn("Animation","AnimationEnd"),animationiteration:Jn("Animation","AnimationIteration"),animationstart:Jn("Animation","AnimationStart"),transitionrun:Jn("Transition","TransitionRun"),transitionstart:Jn("Transition","TransitionStart"),transitioncancel:Jn("Transition","TransitionCancel"),transitionend:Jn("Transition","TransitionEnd")},Ln={},Tf={};On&&(Tf=document.createElement("div").style,"AnimationEvent"in window||(delete Ut.animationend.animation,delete Ut.animationiteration.animation,delete Ut.animationstart.animation),"TransitionEvent"in window||delete Ut.transitionend.transition);function Aa(e){if(Ln[e])return Ln[e];if(!Ut[e])return e;var t=Ut[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Tf)return Ln[e]=t[n];return e}var Df=Aa("animationend"),kf=Aa("animationiteration"),zf=Aa("animationstart"),Mm=Aa("transitionrun"),Nm=Aa("transitionstart"),Am=Aa("transitioncancel"),Rf=Aa("transitionend"),Of=new Map,sr="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(" ");sr.push("scrollEnd");function Bn(e,t){Of.set(e,t),vn(t,[e])}var wu=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)},wn=[],yi=0,ur=0;function Su(){for(var e=yi,t=ur=yi=0;t<e;){var n=wn[t];wn[t++]=null;var l=wn[t];wn[t++]=null;var i=wn[t];wn[t++]=null;var u=wn[t];if(wn[t++]=null,l!==null&&i!==null){var d=l.pending;d===null?i.next=i:(i.next=d.next,d.next=i),l.pending=i}u!==0&&_f(n,i,u)}}function ju(e,t,n,l){wn[yi++]=e,wn[yi++]=t,wn[yi++]=n,wn[yi++]=l,ur|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function or(e,t,n,l){return ju(e,t,n,l),Eu(e)}function Ta(e,t){return ju(e,null,null,t),Eu(e)}function _f(e,t,n){e.lanes|=n;var l=e.alternate;l!==null&&(l.lanes|=n);for(var i=!1,u=e.return;u!==null;)u.childLanes|=n,l=u.alternate,l!==null&&(l.childLanes|=n),u.tag===22&&(e=u.stateNode,e===null||e._visibility&1||(i=!0)),e=u,u=u.return;return e.tag===3?(u=e.stateNode,i&&t!==null&&(i=31-Tt(n),e=u.hiddenUpdates,l=e[i],l===null?e[i]=[t]:l.push(t),t.lane=n|536870912),u):null}function Eu(e){if(50<Hs)throw Hs=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 xi={};function Tm(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 fn(e,t,n,l){return new Tm(e,t,n,l)}function rr(e){return e=e.prototype,!(!e||!e.isReactComponent)}function fl(e,t){var n=e.alternate;return n===null?(n=fn(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 Lf(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 Cu(e,t,n,l,i,u){var d=0;if(l=e,typeof e=="function")rr(e)&&(d=1);else if(typeof e=="string")d=Op(e,n,oe.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case ue:return e=fn(31,n,t,i),e.elementType=ue,e.lanes=u,e;case Y:return Da(n.children,i,u,t);case q:d=8,i|=24;break;case z:return e=fn(12,n,t,i|2),e.elementType=z,e.lanes=u,e;case ee:return e=fn(13,n,t,i),e.elementType=ee,e.lanes=u,e;case ne:return e=fn(19,n,t,i),e.elementType=ne,e.lanes=u,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case H:d=10;break e;case V:d=9;break e;case W:d=11;break e;case b:d=14;break e;case te:d=16,l=null;break e}d=29,n=Error(r(130,e===null?"null":typeof e,"")),l=null}return t=fn(d,n,t,i),t.elementType=e,t.type=l,t.lanes=u,t}function Da(e,t,n,l){return e=fn(7,e,l,t),e.lanes=n,e}function cr(e,t,n){return e=fn(6,e,null,t),e.lanes=n,e}function Bf(e){var t=fn(18,null,null,0);return t.stateNode=e,t}function fr(e,t,n){return t=fn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Uf=new WeakMap;function Sn(e,t){if(typeof e=="object"&&e!==null){var n=Uf.get(e);return n!==void 0?n:(t={value:e,source:t,stack:Nt(t)},Uf.set(e,t),t)}return{value:e,source:t,stack:Nt(t)}}var vi=[],bi=0,Mu=null,xs=0,jn=[],En=0,Yl=null,Wn=1,In="";function dl(e,t){vi[bi++]=xs,vi[bi++]=Mu,Mu=e,xs=t}function Hf(e,t,n){jn[En++]=Wn,jn[En++]=In,jn[En++]=Yl,Yl=e;var l=Wn;e=In;var i=32-Tt(l)-1;l&=~(1<<i),n+=1;var u=32-Tt(t)+i;if(30<u){var d=i-i%5;u=(l&(1<<d)-1).toString(32),l>>=d,i-=d,Wn=1<<32-Tt(t)+i|n<<i|l,In=u+e}else Wn=1<<u|n<<i|l,In=e}function dr(e){e.return!==null&&(dl(e,1),Hf(e,1,0))}function hr(e){for(;e===Mu;)Mu=vi[--bi],vi[bi]=null,xs=vi[--bi],vi[bi]=null;for(;e===Yl;)Yl=jn[--En],jn[En]=null,In=jn[--En],jn[En]=null,Wn=jn[--En],jn[En]=null}function qf(e,t){jn[En++]=Wn,jn[En++]=In,jn[En++]=Yl,Wn=t.id,In=t.overflow,Yl=e}var kt=null,rt=null,qe=!1,Gl=null,Cn=!1,mr=Error(r(519));function Xl(e){var t=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw vs(Sn(t,e)),mr}function $f(e){var t=e.stateNode,n=e.type,l=e.memoizedProps;switch(t[Ze]=e,t[Oe]=l,n){case"dialog":Be("cancel",t),Be("close",t);break;case"iframe":case"object":case"embed":Be("load",t);break;case"video":case"audio":for(n=0;n<$s.length;n++)Be($s[n],t);break;case"source":Be("error",t);break;case"img":case"image":case"link":Be("error",t),Be("load",t);break;case"details":Be("toggle",t);break;case"input":Be("invalid",t),zn(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":Be("invalid",t);break;case"textarea":Be("invalid",t),ii(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||a0(t.textContent,n)?(l.popover!=null&&(Be("beforetoggle",t),Be("toggle",t)),l.onScroll!=null&&Be("scroll",t),l.onScrollEnd!=null&&Be("scrollend",t),l.onClick!=null&&(t.onclick=Rn),t=!0):t=!1,t||Xl(e,!0)}function Yf(e){for(kt=e.return;kt;)switch(kt.tag){case 5:case 31:case 13:Cn=!1;return;case 27:case 3:Cn=!0;return;default:kt=kt.return}}function wi(e){if(e!==kt)return!1;if(!qe)return Yf(e),qe=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||zc(e.type,e.memoizedProps)),n=!n),n&&rt&&Xl(e),Yf(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));rt=h0(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));rt=h0(e)}else t===27?(t=rt,aa(e.type)?(e=Bc,Bc=null,rt=e):rt=t):rt=kt?Nn(e.stateNode.nextSibling):null;return!0}function ka(){rt=kt=null,qe=!1}function pr(){var e=Gl;return e!==null&&(tn===null?tn=e:tn.push.apply(tn,e),Gl=null),e}function vs(e){Gl===null?Gl=[e]:Gl.push(e)}var gr=j(null),za=null,hl=null;function Ql(e,t,n){ae(gr,t._currentValue),t._currentValue=n}function ml(e){e._currentValue=gr.current,U(gr)}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 xr(e,t,n,l){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var u=i.dependencies;if(u!==null){var d=i.child;u=u.firstContext;e:for(;u!==null;){var p=u;u=i;for(var E=0;E<t.length;E++)if(p.context===t[E]){u.lanes|=n,p=u.alternate,p!==null&&(p.lanes|=n),yr(u.return,n,e),l||(d=null);break e}u=p.next}}else if(i.tag===18){if(d=i.return,d===null)throw Error(r(341));d.lanes|=n,u=d.alternate,u!==null&&(u.lanes|=n),yr(d,n,e),d=null}else d=i.child;if(d!==null)d.return=i;else for(d=i;d!==null;){if(d===e){d=null;break}if(i=d.sibling,i!==null){i.return=d.return,d=i;break}d=d.return}i=d}}function Si(e,t,n,l){e=null;for(var i=t,u=!1;i!==null;){if(!u){if((i.flags&524288)!==0)u=!0;else if((i.flags&262144)!==0)break}if(i.tag===10){var d=i.alternate;if(d===null)throw Error(r(387));if(d=d.memoizedProps,d!==null){var p=i.type;fe(i.pendingProps.value,d.value)||(e!==null?e.push(p):e=[p])}}else if(i===R.current){if(d=i.alternate,d===null)throw Error(r(387));d.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e!==null?e.push(Vs):e=[Vs])}i=i.return}e!==null&&xr(t,e,n,l),t.flags|=262144}function Nu(e){for(e=e.firstContext;e!==null;){if(!fe(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ra(e){za=e,hl=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function zt(e){return Gf(za,e)}function Au(e,t){return za===null&&Ra(e),Gf(e,t)}function Gf(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},hl===null){if(e===null)throw Error(r(308));hl=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else hl=hl.next=t;return n}var Dm=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()})}},km=a.unstable_scheduleCallback,zm=a.unstable_NormalPriority,xt={$$typeof:H,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function vr(){return{controller:new Dm,data:new Map,refCount:0}}function bs(e){e.refCount--,e.refCount===0&&km(zm,function(){e.controller.abort()})}var ws=null,br=0,ji=0,Ei=null;function Rm(e,t){if(ws===null){var n=ws=[];br=0,ji=jc(),Ei={status:"pending",value:void 0,then:function(l){n.push(l)}}}return br++,t.then(Xf,Xf),t}function Xf(){if(--br===0&&ws!==null){Ei!==null&&(Ei.status="fulfilled");var e=ws;ws=null,ji=0,Ei=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Om(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 Qf=L.S;L.S=function(e,t){Ah=dt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Rm(e,t),Qf!==null&&Qf(e,t)};var Oa=j(null);function wr(){var e=Oa.current;return e!==null?e:st.pooledCache}function Tu(e,t){t===null?ae(Oa,Oa.current):ae(Oa,t.pool)}function Vf(){var e=wr();return e===null?null:{parent:xt._currentValue,pool:e}}var Ci=Error(r(460)),Sr=Error(r(474)),Du=Error(r(542)),ku={then:function(){}};function Zf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Kf(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Rn,Rn),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Jf(e),e;default:if(typeof t.status=="string")t.then(Rn,Rn);else{if(e=st,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,Jf(e),e}throw La=t,Ci}}function _a(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(La=n,Ci):n}}var La=null;function Ff(){if(La===null)throw Error(r(459));var e=La;return La=null,e}function Jf(e){if(e===Ci||e===Du)throw Error(r(483))}var Mi=null,Ss=0;function zu(e){var t=Ss;return Ss+=1,Mi===null&&(Mi=[]),Kf(Mi,e,t)}function js(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Ru(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 Wf(e){function t(D,N){if(e){var O=D.deletions;O===null?(D.deletions=[N],D.flags|=16):O.push(N)}}function n(D,N){if(!e)return null;for(;N!==null;)t(D,N),N=N.sibling;return null}function l(D){for(var N=new Map;D!==null;)D.key!==null?N.set(D.key,D):N.set(D.index,D),D=D.sibling;return N}function i(D,N){return D=fl(D,N),D.index=0,D.sibling=null,D}function u(D,N,O){return D.index=O,e?(O=D.alternate,O!==null?(O=O.index,O<N?(D.flags|=67108866,N):O):(D.flags|=67108866,N)):(D.flags|=1048576,N)}function d(D){return e&&D.alternate===null&&(D.flags|=67108866),D}function p(D,N,O,F){return N===null||N.tag!==6?(N=cr(O,D.mode,F),N.return=D,N):(N=i(N,O),N.return=D,N)}function E(D,N,O,F){var je=O.type;return je===Y?K(D,N,O.props.children,F,O.key):N!==null&&(N.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===te&&_a(je)===N.type)?(N=i(N,O.props),js(N,O),N.return=D,N):(N=Cu(O.type,O.key,O.props,null,D.mode,F),js(N,O),N.return=D,N)}function _(D,N,O,F){return N===null||N.tag!==4||N.stateNode.containerInfo!==O.containerInfo||N.stateNode.implementation!==O.implementation?(N=fr(O,D.mode,F),N.return=D,N):(N=i(N,O.children||[]),N.return=D,N)}function K(D,N,O,F,je){return N===null||N.tag!==7?(N=Da(O,D.mode,F,je),N.return=D,N):(N=i(N,O),N.return=D,N)}function J(D,N,O){if(typeof N=="string"&&N!==""||typeof N=="number"||typeof N=="bigint")return N=cr(""+N,D.mode,O),N.return=D,N;if(typeof N=="object"&&N!==null){switch(N.$$typeof){case k:return O=Cu(N.type,N.key,N.props,null,D.mode,O),js(O,N),O.return=D,O;case M:return N=fr(N,D.mode,O),N.return=D,N;case te:return N=_a(N),J(D,N,O)}if(Te(N)||re(N))return N=Da(N,D.mode,O,null),N.return=D,N;if(typeof N.then=="function")return J(D,zu(N),O);if(N.$$typeof===H)return J(D,Au(D,N),O);Ru(D,N)}return null}function B(D,N,O,F){var je=N!==null?N.key:null;if(typeof O=="string"&&O!==""||typeof O=="number"||typeof O=="bigint")return je!==null?null:p(D,N,""+O,F);if(typeof O=="object"&&O!==null){switch(O.$$typeof){case k:return O.key===je?E(D,N,O,F):null;case M:return O.key===je?_(D,N,O,F):null;case te:return O=_a(O),B(D,N,O,F)}if(Te(O)||re(O))return je!==null?null:K(D,N,O,F,null);if(typeof O.then=="function")return B(D,N,zu(O),F);if(O.$$typeof===H)return B(D,N,Au(D,O),F);Ru(D,O)}return null}function G(D,N,O,F,je){if(typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint")return D=D.get(O)||null,p(N,D,""+F,je);if(typeof F=="object"&&F!==null){switch(F.$$typeof){case k:return D=D.get(F.key===null?O:F.key)||null,E(N,D,F,je);case M:return D=D.get(F.key===null?O:F.key)||null,_(N,D,F,je);case te:return F=_a(F),G(D,N,O,F,je)}if(Te(F)||re(F))return D=D.get(O)||null,K(N,D,F,je,null);if(typeof F.then=="function")return G(D,N,O,zu(F),je);if(F.$$typeof===H)return G(D,N,O,Au(N,F),je);Ru(N,F)}return null}function ve(D,N,O,F){for(var je=null,Xe=null,be=N,Re=N=0,He=null;be!==null&&Re<O.length;Re++){be.index>Re?(He=be,be=null):He=be.sibling;var Qe=B(D,be,O[Re],F);if(Qe===null){be===null&&(be=He);break}e&&be&&Qe.alternate===null&&t(D,be),N=u(Qe,N,Re),Xe===null?je=Qe:Xe.sibling=Qe,Xe=Qe,be=He}if(Re===O.length)return n(D,be),qe&&dl(D,Re),je;if(be===null){for(;Re<O.length;Re++)be=J(D,O[Re],F),be!==null&&(N=u(be,N,Re),Xe===null?je=be:Xe.sibling=be,Xe=be);return qe&&dl(D,Re),je}for(be=l(be);Re<O.length;Re++)He=G(be,D,Re,O[Re],F),He!==null&&(e&&He.alternate!==null&&be.delete(He.key===null?Re:He.key),N=u(He,N,Re),Xe===null?je=He:Xe.sibling=He,Xe=He);return e&&be.forEach(function(ra){return t(D,ra)}),qe&&dl(D,Re),je}function Me(D,N,O,F){if(O==null)throw Error(r(151));for(var je=null,Xe=null,be=N,Re=N=0,He=null,Qe=O.next();be!==null&&!Qe.done;Re++,Qe=O.next()){be.index>Re?(He=be,be=null):He=be.sibling;var ra=B(D,be,Qe.value,F);if(ra===null){be===null&&(be=He);break}e&&be&&ra.alternate===null&&t(D,be),N=u(ra,N,Re),Xe===null?je=ra:Xe.sibling=ra,Xe=ra,be=He}if(Qe.done)return n(D,be),qe&&dl(D,Re),je;if(be===null){for(;!Qe.done;Re++,Qe=O.next())Qe=J(D,Qe.value,F),Qe!==null&&(N=u(Qe,N,Re),Xe===null?je=Qe:Xe.sibling=Qe,Xe=Qe);return qe&&dl(D,Re),je}for(be=l(be);!Qe.done;Re++,Qe=O.next())Qe=G(be,D,Re,Qe.value,F),Qe!==null&&(e&&Qe.alternate!==null&&be.delete(Qe.key===null?Re:Qe.key),N=u(Qe,N,Re),Xe===null?je=Qe:Xe.sibling=Qe,Xe=Qe);return e&&be.forEach(function(Qp){return t(D,Qp)}),qe&&dl(D,Re),je}function nt(D,N,O,F){if(typeof O=="object"&&O!==null&&O.type===Y&&O.key===null&&(O=O.props.children),typeof O=="object"&&O!==null){switch(O.$$typeof){case k:e:{for(var je=O.key;N!==null;){if(N.key===je){if(je=O.type,je===Y){if(N.tag===7){n(D,N.sibling),F=i(N,O.props.children),F.return=D,D=F;break e}}else if(N.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===te&&_a(je)===N.type){n(D,N.sibling),F=i(N,O.props),js(F,O),F.return=D,D=F;break e}n(D,N);break}else t(D,N);N=N.sibling}O.type===Y?(F=Da(O.props.children,D.mode,F,O.key),F.return=D,D=F):(F=Cu(O.type,O.key,O.props,null,D.mode,F),js(F,O),F.return=D,D=F)}return d(D);case M:e:{for(je=O.key;N!==null;){if(N.key===je)if(N.tag===4&&N.stateNode.containerInfo===O.containerInfo&&N.stateNode.implementation===O.implementation){n(D,N.sibling),F=i(N,O.children||[]),F.return=D,D=F;break e}else{n(D,N);break}else t(D,N);N=N.sibling}F=fr(O,D.mode,F),F.return=D,D=F}return d(D);case te:return O=_a(O),nt(D,N,O,F)}if(Te(O))return ve(D,N,O,F);if(re(O)){if(je=re(O),typeof je!="function")throw Error(r(150));return O=je.call(O),Me(D,N,O,F)}if(typeof O.then=="function")return nt(D,N,zu(O),F);if(O.$$typeof===H)return nt(D,N,Au(D,O),F);Ru(D,O)}return typeof O=="string"&&O!==""||typeof O=="number"||typeof O=="bigint"?(O=""+O,N!==null&&N.tag===6?(n(D,N.sibling),F=i(N,O),F.return=D,D=F):(n(D,N),F=cr(O,D.mode,F),F.return=D,D=F),d(D)):n(D,N)}return function(D,N,O,F){try{Ss=0;var je=nt(D,N,O,F);return Mi=null,je}catch(be){if(be===Ci||be===Du)throw be;var Xe=fn(29,be,null,D.mode);return Xe.lanes=F,Xe.return=D,Xe}}}var Ba=Wf(!0),If=Wf(!1),Vl=!1;function jr(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Er(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 Zl(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Kl(e,t,n){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(Ke&2)!==0){var i=l.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),l.pending=t,t=Eu(e),_f(e,null,n),t}return ju(e,l,t,n),Eu(e)}function Es(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,ti(e,n)}}function Cr(e,t){var n=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,n===l)){var i=null,u=null;if(n=n.firstBaseUpdate,n!==null){do{var d={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};u===null?i=u=d:u=u.next=d,n=n.next}while(n!==null);u===null?i=u=t:u=u.next=t}else i=u=t;n={baseState:l.baseState,firstBaseUpdate:i,lastBaseUpdate:u,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 Mr=!1;function Cs(){if(Mr){var e=Ei;if(e!==null)throw e}}function Ms(e,t,n,l){Mr=!1;var i=e.updateQueue;Vl=!1;var u=i.firstBaseUpdate,d=i.lastBaseUpdate,p=i.shared.pending;if(p!==null){i.shared.pending=null;var E=p,_=E.next;E.next=null,d===null?u=_:d.next=_,d=E;var K=e.alternate;K!==null&&(K=K.updateQueue,p=K.lastBaseUpdate,p!==d&&(p===null?K.firstBaseUpdate=_:p.next=_,K.lastBaseUpdate=E))}if(u!==null){var J=i.baseState;d=0,K=_=E=null,p=u;do{var B=p.lane&-536870913,G=B!==p.lane;if(G?(Ue&B)===B:(l&B)===B){B!==0&&B===ji&&(Mr=!0),K!==null&&(K=K.next={lane:0,tag:p.tag,payload:p.payload,callback:null,next:null});e:{var ve=e,Me=p;B=t;var nt=n;switch(Me.tag){case 1:if(ve=Me.payload,typeof ve=="function"){J=ve.call(nt,J,B);break e}J=ve;break e;case 3:ve.flags=ve.flags&-65537|128;case 0:if(ve=Me.payload,B=typeof ve=="function"?ve.call(nt,J,B):ve,B==null)break e;J=C({},J,B);break e;case 2:Vl=!0}}B=p.callback,B!==null&&(e.flags|=64,G&&(e.flags|=8192),G=i.callbacks,G===null?i.callbacks=[B]:G.push(B))}else G={lane:B,tag:p.tag,payload:p.payload,callback:p.callback,next:null},K===null?(_=K=G,E=J):K=K.next=G,d|=B;if(p=p.next,p===null){if(p=i.shared.pending,p===null)break;G=p,p=G.next,G.next=null,i.lastBaseUpdate=G,i.shared.pending=null}}while(!0);K===null&&(E=J),i.baseState=E,i.firstBaseUpdate=_,i.lastBaseUpdate=K,u===null&&(i.shared.lanes=0),Pl|=d,e.lanes=d,e.memoizedState=J}}function Pf(e,t){if(typeof e!="function")throw Error(r(191,e));e.call(t)}function ed(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Pf(n[e],t)}var Ni=j(null),Ou=j(0);function td(e,t){e=jl,ae(Ou,e),ae(Ni,t),jl=e|t.baseLanes}function Nr(){ae(Ou,jl),ae(Ni,Ni.current)}function Ar(){jl=Ou.current,U(Ni),U(Ou)}var dn=j(null),Mn=null;function Fl(e){var t=e.alternate;ae(pt,pt.current&1),ae(dn,e),Mn===null&&(t===null||Ni.current!==null||t.memoizedState!==null)&&(Mn=e)}function Tr(e){ae(pt,pt.current),ae(dn,e),Mn===null&&(Mn=e)}function nd(e){e.tag===22?(ae(pt,pt.current),ae(dn,e),Mn===null&&(Mn=e)):Jl()}function Jl(){ae(pt,pt.current),ae(dn,dn.current)}function hn(e){U(dn),Mn===e&&(Mn=null),U(pt)}var pt=j(0);function _u(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||_c(n)||Lc(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 pl=0,ke=null,et=null,vt=null,Lu=!1,Ai=!1,Ua=!1,Bu=0,Ns=0,Ti=null,_m=0;function ht(){throw Error(r(321))}function Dr(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!fe(e[n],t[n]))return!1;return!0}function kr(e,t,n,l,i,u){return pl=u,ke=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,L.H=e===null||e.memoizedState===null?Hd:Vr,Ua=!1,u=n(l,i),Ua=!1,Ai&&(u=ad(t,n,l,i)),ld(e),u}function ld(e){L.H=Ds;var t=et!==null&&et.next!==null;if(pl=0,vt=et=ke=null,Lu=!1,Ns=0,Ti=null,t)throw Error(r(300));e===null||bt||(e=e.dependencies,e!==null&&Nu(e)&&(bt=!0))}function ad(e,t,n,l){ke=e;var i=0;do{if(Ai&&(Ti=null),Ns=0,Ai=!1,25<=i)throw Error(r(301));if(i+=1,vt=et=null,e.updateQueue!=null){var u=e.updateQueue;u.lastEffect=null,u.events=null,u.stores=null,u.memoCache!=null&&(u.memoCache.index=0)}L.H=qd,u=t(n,l)}while(Ai);return u}function Lm(){var e=L.H,t=e.useState()[0];return t=typeof t.then=="function"?As(t):t,e=e.useState()[0],(et!==null?et.memoizedState:null)!==e&&(ke.flags|=1024),t}function zr(){var e=Bu!==0;return Bu=0,e}function Rr(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Or(e){if(Lu){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Lu=!1}pl=0,vt=et=ke=null,Ai=!1,Ns=Bu=0,Ti=null}function Vt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return vt===null?ke.memoizedState=vt=e:vt=vt.next=e,vt}function gt(){if(et===null){var e=ke.alternate;e=e!==null?e.memoizedState:null}else e=et.next;var t=vt===null?ke.memoizedState:vt.next;if(t!==null)vt=t,et=e;else{if(e===null)throw ke.alternate===null?Error(r(467)):Error(r(310));et=e,e={memoizedState:et.memoizedState,baseState:et.baseState,baseQueue:et.baseQueue,queue:et.queue,next:null},vt===null?ke.memoizedState=vt=e:vt=vt.next=e}return vt}function Uu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function As(e){var t=Ns;return Ns+=1,Ti===null&&(Ti=[]),e=Kf(Ti,e,t),t=ke,(vt===null?t.memoizedState:vt.next)===null&&(t=t.alternate,L.H=t===null||t.memoizedState===null?Hd:Vr),e}function Hu(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return As(e);if(e.$$typeof===H)return zt(e)}throw Error(r(438,String(e)))}function _r(e){var t=null,n=ke.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var l=ke.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=Uu(),ke.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]=P;return t.index++,n}function gl(e,t){return typeof t=="function"?t(e):t}function qu(e){var t=gt();return Lr(t,et,e)}function Lr(e,t,n){var l=e.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=n;var i=e.baseQueue,u=l.pending;if(u!==null){if(i!==null){var d=i.next;i.next=u.next,u.next=d}t.baseQueue=i=u,l.pending=null}if(u=e.baseState,i===null)e.memoizedState=u;else{t=i.next;var p=d=null,E=null,_=t,K=!1;do{var J=_.lane&-536870913;if(J!==_.lane?(Ue&J)===J:(pl&J)===J){var B=_.revertLane;if(B===0)E!==null&&(E=E.next={lane:0,revertLane:0,gesture:null,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null}),J===ji&&(K=!0);else if((pl&B)===B){_=_.next,B===ji&&(K=!0);continue}else J={lane:0,revertLane:_.revertLane,gesture:null,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null},E===null?(p=E=J,d=u):E=E.next=J,ke.lanes|=B,Pl|=B;J=_.action,Ua&&n(u,J),u=_.hasEagerState?_.eagerState:n(u,J)}else B={lane:J,revertLane:_.revertLane,gesture:_.gesture,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null},E===null?(p=E=B,d=u):E=E.next=B,ke.lanes|=J,Pl|=J;_=_.next}while(_!==null&&_!==t);if(E===null?d=u:E.next=p,!fe(u,e.memoizedState)&&(bt=!0,K&&(n=Ei,n!==null)))throw n;e.memoizedState=u,e.baseState=d,e.baseQueue=E,l.lastRenderedState=u}return i===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function Br(e){var t=gt(),n=t.queue;if(n===null)throw Error(r(311));n.lastRenderedReducer=e;var l=n.dispatch,i=n.pending,u=t.memoizedState;if(i!==null){n.pending=null;var d=i=i.next;do u=e(u,d.action),d=d.next;while(d!==i);fe(u,t.memoizedState)||(bt=!0),t.memoizedState=u,t.baseQueue===null&&(t.baseState=u),n.lastRenderedState=u}return[u,l]}function id(e,t,n){var l=ke,i=gt(),u=qe;if(u){if(n===void 0)throw Error(r(407));n=n()}else n=t();var d=!fe((et||i).memoizedState,n);if(d&&(i.memoizedState=n,bt=!0),i=i.queue,qr(od.bind(null,l,i,e),[e]),i.getSnapshot!==t||d||vt!==null&&vt.memoizedState.tag&1){if(l.flags|=2048,Di(9,{destroy:void 0},ud.bind(null,l,i,n,t),null),st===null)throw Error(r(349));u||(pl&127)!==0||sd(l,t,n)}return n}function sd(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=ke.updateQueue,t===null?(t=Uu(),ke.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function ud(e,t,n,l){t.value=n,t.getSnapshot=l,rd(t)&&cd(e)}function od(e,t,n){return n(function(){rd(t)&&cd(e)})}function rd(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!fe(e,n)}catch{return!0}}function cd(e){var t=Ta(e,2);t!==null&&nn(t,e,2)}function Ur(e){var t=Vt();if(typeof e=="function"){var n=e;if(e=n(),Ua){un(!0);try{n()}finally{un(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:gl,lastRenderedState:e},t}function fd(e,t,n,l){return e.baseState=n,Lr(e,et,typeof l=="function"?l:gl)}function Bm(e,t,n,l,i){if(Gu(e))throw Error(r(485));if(e=t.action,e!==null){var u={payload:i,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(d){u.listeners.push(d)}};L.T!==null?n(!0):u.isTransition=!1,l(u),n=t.pending,n===null?(u.next=t.pending=u,dd(t,u)):(u.next=n.next,t.pending=n.next=u)}}function dd(e,t){var n=t.action,l=t.payload,i=e.state;if(t.isTransition){var u=L.T,d={};L.T=d;try{var p=n(i,l),E=L.S;E!==null&&E(d,p),hd(e,t,p)}catch(_){Hr(e,t,_)}finally{u!==null&&d.types!==null&&(u.types=d.types),L.T=u}}else try{u=n(i,l),hd(e,t,u)}catch(_){Hr(e,t,_)}}function hd(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(l){md(e,t,l)},function(l){return Hr(e,t,l)}):md(e,t,n)}function md(e,t,n){t.status="fulfilled",t.value=n,pd(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,dd(e,n)))}function Hr(e,t,n){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=n,pd(t),t=t.next;while(t!==l)}e.action=null}function pd(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function gd(e,t){return t}function yd(e,t){if(qe){var n=st.formState;if(n!==null){e:{var l=ke;if(qe){if(rt){t:{for(var i=rt,u=Cn;i.nodeType!==8;){if(!u){i=null;break t}if(i=Nn(i.nextSibling),i===null){i=null;break t}}u=i.data,i=u==="F!"||u==="F"?i:null}if(i){rt=Nn(i.nextSibling),l=i.data==="F!";break e}}Xl(l)}l=!1}l&&(t=n[0])}}return n=Vt(),n.memoizedState=n.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:gd,lastRenderedState:t},n.queue=l,n=Ld.bind(null,ke,l),l.dispatch=n,l=Ur(!1),u=Qr.bind(null,ke,!1,l.queue),l=Vt(),i={state:t,dispatch:null,action:e,pending:null},l.queue=i,n=Bm.bind(null,ke,i,u,n),i.dispatch=n,l.memoizedState=e,[t,n,!1]}function xd(e){var t=gt();return vd(t,et,e)}function vd(e,t,n){if(t=Lr(e,t,gd)[0],e=qu(gl)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=As(t)}catch(d){throw d===Ci?Du:d}else l=t;t=gt();var i=t.queue,u=i.dispatch;return n!==t.memoizedState&&(ke.flags|=2048,Di(9,{destroy:void 0},Um.bind(null,i,n),null)),[l,u,e]}function Um(e,t){e.action=t}function bd(e){var t=gt(),n=et;if(n!==null)return vd(t,n,e);gt(),t=t.memoizedState,n=gt();var l=n.queue.dispatch;return n.memoizedState=e,[t,l,!1]}function Di(e,t,n,l){return e={tag:e,create:n,deps:l,inst:t,next:null},t=ke.updateQueue,t===null&&(t=Uu(),ke.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 wd(){return gt().memoizedState}function $u(e,t,n,l){var i=Vt();ke.flags|=e,i.memoizedState=Di(1|t,{destroy:void 0},n,l===void 0?null:l)}function Yu(e,t,n,l){var i=gt();l=l===void 0?null:l;var u=i.memoizedState.inst;et!==null&&l!==null&&Dr(l,et.memoizedState.deps)?i.memoizedState=Di(t,u,n,l):(ke.flags|=e,i.memoizedState=Di(1|t,u,n,l))}function Sd(e,t){$u(8390656,8,e,t)}function qr(e,t){Yu(2048,8,e,t)}function Hm(e){ke.flags|=4;var t=ke.updateQueue;if(t===null)t=Uu(),ke.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function jd(e){var t=gt().memoizedState;return Hm({ref:t,nextImpl:e}),function(){if((Ke&2)!==0)throw Error(r(440));return t.impl.apply(void 0,arguments)}}function Ed(e,t){return Yu(4,2,e,t)}function Cd(e,t){return Yu(4,4,e,t)}function Md(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 Nd(e,t,n){n=n!=null?n.concat([e]):null,Yu(4,4,Md.bind(null,t,e),n)}function $r(){}function Ad(e,t){var n=gt();t=t===void 0?null:t;var l=n.memoizedState;return t!==null&&Dr(t,l[1])?l[0]:(n.memoizedState=[e,t],e)}function Td(e,t){var n=gt();t=t===void 0?null:t;var l=n.memoizedState;if(t!==null&&Dr(t,l[1]))return l[0];if(l=e(),Ua){un(!0);try{e()}finally{un(!1)}}return n.memoizedState=[l,t],l}function Yr(e,t,n){return n===void 0||(pl&1073741824)!==0&&(Ue&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=Dh(),ke.lanes|=e,Pl|=e,n)}function Dd(e,t,n,l){return fe(n,t)?n:Ni.current!==null?(e=Yr(e,n,l),fe(e,t)||(bt=!0),e):(pl&42)===0||(pl&1073741824)!==0&&(Ue&261930)===0?(bt=!0,e.memoizedState=n):(e=Dh(),ke.lanes|=e,Pl|=e,t)}function kd(e,t,n,l,i){var u=I.p;I.p=u!==0&&8>u?u:8;var d=L.T,p={};L.T=p,Qr(e,!1,t,n);try{var E=i(),_=L.S;if(_!==null&&_(p,E),E!==null&&typeof E=="object"&&typeof E.then=="function"){var K=Om(E,l);Ts(e,t,K,gn(e))}else Ts(e,t,l,gn(e))}catch(J){Ts(e,t,{then:function(){},status:"rejected",reason:J},gn())}finally{I.p=u,d!==null&&p.types!==null&&(d.types=p.types),L.T=d}}function qm(){}function Gr(e,t,n,l){if(e.tag!==5)throw Error(r(476));var i=zd(e).queue;kd(e,i,t,se,n===null?qm:function(){return Rd(e),n(l)})}function zd(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:se,baseState:se,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:gl,lastRenderedState:se},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:gl,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Rd(e){var t=zd(e);t.next===null&&(t=e.alternate.memoizedState),Ts(e,t.next.queue,{},gn())}function Xr(){return zt(Vs)}function Od(){return gt().memoizedState}function _d(){return gt().memoizedState}function $m(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=gn();e=Zl(n);var l=Kl(t,e,n);l!==null&&(nn(l,t,n),Es(l,t,n)),t={cache:vr()},e.payload=t;return}t=t.return}}function Ym(e,t,n){var l=gn();n={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Gu(e)?Bd(t,n):(n=or(e,t,n,l),n!==null&&(nn(n,e,l),Ud(n,t,l)))}function Ld(e,t,n){var l=gn();Ts(e,t,n,l)}function Ts(e,t,n,l){var i={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Gu(e))Bd(t,i);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var d=t.lastRenderedState,p=u(d,n);if(i.hasEagerState=!0,i.eagerState=p,fe(p,d))return ju(e,t,i,0),st===null&&Su(),!1}catch{}if(n=or(e,t,i,l),n!==null)return nn(n,e,l),Ud(n,t,l),!0}return!1}function Qr(e,t,n,l){if(l={lane:2,revertLane:jc(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Gu(e)){if(t)throw Error(r(479))}else t=or(e,n,l,2),t!==null&&nn(t,e,2)}function Gu(e){var t=e.alternate;return e===ke||t!==null&&t===ke}function Bd(e,t){Ai=Lu=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ud(e,t,n){if((n&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,ti(e,n)}}var Ds={readContext:zt,use:Hu,useCallback:ht,useContext:ht,useEffect:ht,useImperativeHandle:ht,useLayoutEffect:ht,useInsertionEffect:ht,useMemo:ht,useReducer:ht,useRef:ht,useState:ht,useDebugValue:ht,useDeferredValue:ht,useTransition:ht,useSyncExternalStore:ht,useId:ht,useHostTransitionStatus:ht,useFormState:ht,useActionState:ht,useOptimistic:ht,useMemoCache:ht,useCacheRefresh:ht};Ds.useEffectEvent=ht;var Hd={readContext:zt,use:Hu,useCallback:function(e,t){return Vt().memoizedState=[e,t===void 0?null:t],e},useContext:zt,useEffect:Sd,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,$u(4194308,4,Md.bind(null,t,e),n)},useLayoutEffect:function(e,t){return $u(4194308,4,e,t)},useInsertionEffect:function(e,t){$u(4,2,e,t)},useMemo:function(e,t){var n=Vt();t=t===void 0?null:t;var l=e();if(Ua){un(!0);try{e()}finally{un(!1)}}return n.memoizedState=[l,t],l},useReducer:function(e,t,n){var l=Vt();if(n!==void 0){var i=n(t);if(Ua){un(!0);try{n(t)}finally{un(!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=Ym.bind(null,ke,e),[l.memoizedState,e]},useRef:function(e){var t=Vt();return e={current:e},t.memoizedState=e},useState:function(e){e=Ur(e);var t=e.queue,n=Ld.bind(null,ke,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:$r,useDeferredValue:function(e,t){var n=Vt();return Yr(n,e,t)},useTransition:function(){var e=Ur(!1);return e=kd.bind(null,ke,e.queue,!0,!1),Vt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var l=ke,i=Vt();if(qe){if(n===void 0)throw Error(r(407));n=n()}else{if(n=t(),st===null)throw Error(r(349));(Ue&127)!==0||sd(l,t,n)}i.memoizedState=n;var u={value:n,getSnapshot:t};return i.queue=u,Sd(od.bind(null,l,u,e),[e]),l.flags|=2048,Di(9,{destroy:void 0},ud.bind(null,l,u,n,t),null),n},useId:function(){var e=Vt(),t=st.identifierPrefix;if(qe){var n=In,l=Wn;n=(l&~(1<<32-Tt(l)-1)).toString(32)+n,t="_"+t+"R_"+n,n=Bu++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=_m++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Xr,useFormState:yd,useActionState:yd,useOptimistic:function(e){var t=Vt();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Qr.bind(null,ke,!0,n),n.dispatch=t,[e,t]},useMemoCache:_r,useCacheRefresh:function(){return Vt().memoizedState=$m.bind(null,ke)},useEffectEvent:function(e){var t=Vt(),n={impl:e};return t.memoizedState=n,function(){if((Ke&2)!==0)throw Error(r(440));return n.impl.apply(void 0,arguments)}}},Vr={readContext:zt,use:Hu,useCallback:Ad,useContext:zt,useEffect:qr,useImperativeHandle:Nd,useInsertionEffect:Ed,useLayoutEffect:Cd,useMemo:Td,useReducer:qu,useRef:wd,useState:function(){return qu(gl)},useDebugValue:$r,useDeferredValue:function(e,t){var n=gt();return Dd(n,et.memoizedState,e,t)},useTransition:function(){var e=qu(gl)[0],t=gt().memoizedState;return[typeof e=="boolean"?e:As(e),t]},useSyncExternalStore:id,useId:Od,useHostTransitionStatus:Xr,useFormState:xd,useActionState:xd,useOptimistic:function(e,t){var n=gt();return fd(n,et,e,t)},useMemoCache:_r,useCacheRefresh:_d};Vr.useEffectEvent=jd;var qd={readContext:zt,use:Hu,useCallback:Ad,useContext:zt,useEffect:qr,useImperativeHandle:Nd,useInsertionEffect:Ed,useLayoutEffect:Cd,useMemo:Td,useReducer:Br,useRef:wd,useState:function(){return Br(gl)},useDebugValue:$r,useDeferredValue:function(e,t){var n=gt();return et===null?Yr(n,e,t):Dd(n,et.memoizedState,e,t)},useTransition:function(){var e=Br(gl)[0],t=gt().memoizedState;return[typeof e=="boolean"?e:As(e),t]},useSyncExternalStore:id,useId:Od,useHostTransitionStatus:Xr,useFormState:bd,useActionState:bd,useOptimistic:function(e,t){var n=gt();return et!==null?fd(n,et,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:_r,useCacheRefresh:_d};qd.useEffectEvent=jd;function Zr(e,t,n,l){t=e.memoizedState,n=n(l,t),n=n==null?t:C({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Kr={enqueueSetState:function(e,t,n){e=e._reactInternals;var l=gn(),i=Zl(l);i.payload=t,n!=null&&(i.callback=n),t=Kl(e,i,l),t!==null&&(nn(t,e,l),Es(t,e,l))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var l=gn(),i=Zl(l);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Kl(e,i,l),t!==null&&(nn(t,e,l),Es(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=gn(),l=Zl(n);l.tag=2,t!=null&&(l.callback=t),t=Kl(e,l,n),t!==null&&(nn(t,e,n),Es(t,e,n))}};function $d(e,t,n,l,i,u,d){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,u,d):t.prototype&&t.prototype.isPureReactComponent?!ge(n,l)||!ge(i,u):!0}function Yd(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&&Kr.enqueueReplaceState(t,t.state,null)}function Ha(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=C({},n));for(var i in e)n[i]===void 0&&(n[i]=e[i])}return n}function Gd(e){wu(e)}function Xd(e){console.error(e)}function Qd(e){wu(e)}function Xu(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function Vd(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 Fr(e,t,n){return n=Zl(n),n.tag=3,n.payload={element:null},n.callback=function(){Xu(e,t)},n}function Zd(e){return e=Zl(e),e.tag=3,e}function Kd(e,t,n,l){var i=n.type.getDerivedStateFromError;if(typeof i=="function"){var u=l.value;e.payload=function(){return i(u)},e.callback=function(){Vd(t,n,l)}}var d=n.stateNode;d!==null&&typeof d.componentDidCatch=="function"&&(e.callback=function(){Vd(t,n,l),typeof i!="function"&&(ea===null?ea=new Set([this]):ea.add(this));var p=l.stack;this.componentDidCatch(l.value,{componentStack:p!==null?p:""})})}function Gm(e,t,n,l,i){if(n.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=n.alternate,t!==null&&Si(t,n,i,!0),n=dn.current,n!==null){switch(n.tag){case 31:case 13:return Mn===null?no():n.alternate===null&&mt===0&&(mt=3),n.flags&=-257,n.flags|=65536,n.lanes=i,l===ku?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([l]):t.add(l),bc(e,l,i)),!1;case 22:return n.flags|=65536,l===ku?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)),bc(e,l,i)),!1}throw Error(r(435,n.tag))}return bc(e,l,i),no(),!1}if(qe)return t=dn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=i,l!==mr&&(e=Error(r(422),{cause:l}),vs(Sn(e,n)))):(l!==mr&&(t=Error(r(423),{cause:l}),vs(Sn(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,l=Sn(l,n),i=Fr(e.stateNode,l,i),Cr(e,i),mt!==4&&(mt=2)),!1;var u=Error(r(520),{cause:l});if(u=Sn(u,n),Us===null?Us=[u]:Us.push(u),mt!==4&&(mt=2),t===null)return!0;l=Sn(l,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=Fr(n.stateNode,l,e),Cr(n,e),!1;case 1:if(t=n.type,u=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||u!==null&&typeof u.componentDidCatch=="function"&&(ea===null||!ea.has(u))))return n.flags|=65536,i&=-i,n.lanes|=i,i=Zd(i),Kd(i,e,n,l),Cr(n,i),!1}n=n.return}while(n!==null);return!1}var Jr=Error(r(461)),bt=!1;function Rt(e,t,n,l){t.child=e===null?If(t,null,n,l):Ba(t,e.child,n,l)}function Fd(e,t,n,l,i){n=n.render;var u=t.ref;if("ref"in l){var d={};for(var p in l)p!=="ref"&&(d[p]=l[p])}else d=l;return Ra(t),l=kr(e,t,n,d,u,i),p=zr(),e!==null&&!bt?(Rr(e,t,i),yl(e,t,i)):(qe&&p&&dr(t),t.flags|=1,Rt(e,t,l,i),t.child)}function Jd(e,t,n,l,i){if(e===null){var u=n.type;return typeof u=="function"&&!rr(u)&&u.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=u,Wd(e,t,u,l,i)):(e=Cu(n.type,null,l,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(u=e.child,!ac(e,i)){var d=u.memoizedProps;if(n=n.compare,n=n!==null?n:ge,n(d,l)&&e.ref===t.ref)return yl(e,t,i)}return t.flags|=1,e=fl(u,l),e.ref=t.ref,e.return=t,t.child=e}function Wd(e,t,n,l,i){if(e!==null){var u=e.memoizedProps;if(ge(u,l)&&e.ref===t.ref)if(bt=!1,t.pendingProps=l=u,ac(e,i))(e.flags&131072)!==0&&(bt=!0);else return t.lanes=e.lanes,yl(e,t,i)}return Wr(e,t,n,l,i)}function Id(e,t,n,l){var i=l.children,u=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(u=u!==null?u.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&~u}else l=0,t.child=null;return Pd(e,t,u,n,l)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Tu(t,u!==null?u.cachePool:null),u!==null?td(t,u):Nr(),nd(t);else return l=t.lanes=536870912,Pd(e,t,u!==null?u.baseLanes|n:n,n,l)}else u!==null?(Tu(t,u.cachePool),td(t,u),Jl(),t.memoizedState=null):(e!==null&&Tu(t,null),Nr(),Jl());return Rt(e,t,i,n),t.child}function ks(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Pd(e,t,n,l,i){var u=wr();return u=u===null?null:{parent:xt._currentValue,pool:u},t.memoizedState={baseLanes:n,cachePool:u},e!==null&&Tu(t,null),Nr(),nd(t),e!==null&&Si(e,t,l,!0),t.childLanes=i,null}function Qu(e,t){return t=Zu({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function eh(e,t,n){return Ba(t,e.child,null,n),e=Qu(t,t.pendingProps),e.flags|=2,hn(t),t.memoizedState=null,e}function Xm(e,t,n){var l=t.pendingProps,i=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(qe){if(l.mode==="hidden")return e=Qu(t,l),t.lanes=536870912,ks(null,e);if(Tr(t),(e=rt)?(e=d0(e,Cn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Yl!==null?{id:Wn,overflow:In}:null,retryLane:536870912,hydrationErrors:null},n=Bf(e),n.return=t,t.child=n,kt=t,rt=null)):e=null,e===null)throw Xl(t);return t.lanes=536870912,null}return Qu(t,l)}var u=e.memoizedState;if(u!==null){var d=u.dehydrated;if(Tr(t),i)if(t.flags&256)t.flags&=-257,t=eh(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(r(558));else if(bt||Si(e,t,n,!1),i=(n&e.childLanes)!==0,bt||i){if(l=st,l!==null&&(d=X(l,n),d!==0&&d!==u.retryLane))throw u.retryLane=d,Ta(e,d),nn(l,e,d),Jr;no(),t=eh(e,t,n)}else e=u.treeContext,rt=Nn(d.nextSibling),kt=t,qe=!0,Gl=null,Cn=!1,e!==null&&qf(t,e),t=Qu(t,l),t.flags|=4096;return t}return e=fl(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Vu(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 Wr(e,t,n,l,i){return Ra(t),n=kr(e,t,n,l,void 0,i),l=zr(),e!==null&&!bt?(Rr(e,t,i),yl(e,t,i)):(qe&&l&&dr(t),t.flags|=1,Rt(e,t,n,i),t.child)}function th(e,t,n,l,i,u){return Ra(t),t.updateQueue=null,n=ad(t,l,n,i),ld(e),l=zr(),e!==null&&!bt?(Rr(e,t,u),yl(e,t,u)):(qe&&l&&dr(t),t.flags|=1,Rt(e,t,n,u),t.child)}function nh(e,t,n,l,i){if(Ra(t),t.stateNode===null){var u=xi,d=n.contextType;typeof d=="object"&&d!==null&&(u=zt(d)),u=new n(l,u),t.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=Kr,t.stateNode=u,u._reactInternals=t,u=t.stateNode,u.props=l,u.state=t.memoizedState,u.refs={},jr(t),d=n.contextType,u.context=typeof d=="object"&&d!==null?zt(d):xi,u.state=t.memoizedState,d=n.getDerivedStateFromProps,typeof d=="function"&&(Zr(t,n,d,l),u.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof u.getSnapshotBeforeUpdate=="function"||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(d=u.state,typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount(),d!==u.state&&Kr.enqueueReplaceState(u,u.state,null),Ms(t,l,u,i),Cs(),u.state=t.memoizedState),typeof u.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){u=t.stateNode;var p=t.memoizedProps,E=Ha(n,p);u.props=E;var _=u.context,K=n.contextType;d=xi,typeof K=="object"&&K!==null&&(d=zt(K));var J=n.getDerivedStateFromProps;K=typeof J=="function"||typeof u.getSnapshotBeforeUpdate=="function",p=t.pendingProps!==p,K||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(p||_!==d)&&Yd(t,u,l,d),Vl=!1;var B=t.memoizedState;u.state=B,Ms(t,l,u,i),Cs(),_=t.memoizedState,p||B!==_||Vl?(typeof J=="function"&&(Zr(t,n,J,l),_=t.memoizedState),(E=Vl||$d(t,n,E,l,B,_,d))?(K||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount()),typeof u.componentDidMount=="function"&&(t.flags|=4194308)):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=_),u.props=l,u.state=_,u.context=d,l=E):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{u=t.stateNode,Er(e,t),d=t.memoizedProps,K=Ha(n,d),u.props=K,J=t.pendingProps,B=u.context,_=n.contextType,E=xi,typeof _=="object"&&_!==null&&(E=zt(_)),p=n.getDerivedStateFromProps,(_=typeof p=="function"||typeof u.getSnapshotBeforeUpdate=="function")||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(d!==J||B!==E)&&Yd(t,u,l,E),Vl=!1,B=t.memoizedState,u.state=B,Ms(t,l,u,i),Cs();var G=t.memoizedState;d!==J||B!==G||Vl||e!==null&&e.dependencies!==null&&Nu(e.dependencies)?(typeof p=="function"&&(Zr(t,n,p,l),G=t.memoizedState),(K=Vl||$d(t,n,K,l,B,G,E)||e!==null&&e.dependencies!==null&&Nu(e.dependencies))?(_||typeof u.UNSAFE_componentWillUpdate!="function"&&typeof u.componentWillUpdate!="function"||(typeof u.componentWillUpdate=="function"&&u.componentWillUpdate(l,G,E),typeof u.UNSAFE_componentWillUpdate=="function"&&u.UNSAFE_componentWillUpdate(l,G,E)),typeof u.componentDidUpdate=="function"&&(t.flags|=4),typeof u.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof u.componentDidUpdate!="function"||d===e.memoizedProps&&B===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&B===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=G),u.props=l,u.state=G,u.context=E,l=K):(typeof u.componentDidUpdate!="function"||d===e.memoizedProps&&B===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&B===e.memoizedState||(t.flags|=1024),l=!1)}return u=l,Vu(e,t),l=(t.flags&128)!==0,u||l?(u=t.stateNode,n=l&&typeof n.getDerivedStateFromError!="function"?null:u.render(),t.flags|=1,e!==null&&l?(t.child=Ba(t,e.child,null,i),t.child=Ba(t,null,n,i)):Rt(e,t,n,i),t.memoizedState=u.state,e=t.child):e=yl(e,t,i),e}function lh(e,t,n,l){return ka(),t.flags|=256,Rt(e,t,n,l),t.child}var Ir={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Pr(e){return{baseLanes:e,cachePool:Vf()}}function ec(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=pn),e}function ah(e,t,n){var l=t.pendingProps,i=!1,u=(t.flags&128)!==0,d;if((d=u)||(d=e!==null&&e.memoizedState===null?!1:(pt.current&2)!==0),d&&(i=!0,t.flags&=-129),d=(t.flags&32)!==0,t.flags&=-33,e===null){if(qe){if(i?Fl(t):Jl(),(e=rt)?(e=d0(e,Cn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Yl!==null?{id:Wn,overflow:In}:null,retryLane:536870912,hydrationErrors:null},n=Bf(e),n.return=t,t.child=n,kt=t,rt=null)):e=null,e===null)throw Xl(t);return Lc(e)?t.lanes=32:t.lanes=536870912,null}var p=l.children;return l=l.fallback,i?(Jl(),i=t.mode,p=Zu({mode:"hidden",children:p},i),l=Da(l,i,n,null),p.return=t,l.return=t,p.sibling=l,t.child=p,l=t.child,l.memoizedState=Pr(n),l.childLanes=ec(e,d,n),t.memoizedState=Ir,ks(null,l)):(Fl(t),tc(t,p))}var E=e.memoizedState;if(E!==null&&(p=E.dehydrated,p!==null)){if(u)t.flags&256?(Fl(t),t.flags&=-257,t=nc(e,t,n)):t.memoizedState!==null?(Jl(),t.child=e.child,t.flags|=128,t=null):(Jl(),p=l.fallback,i=t.mode,l=Zu({mode:"visible",children:l.children},i),p=Da(p,i,n,null),p.flags|=2,l.return=t,p.return=t,l.sibling=p,t.child=l,Ba(t,e.child,null,n),l=t.child,l.memoizedState=Pr(n),l.childLanes=ec(e,d,n),t.memoizedState=Ir,t=ks(null,l));else if(Fl(t),Lc(p)){if(d=p.nextSibling&&p.nextSibling.dataset,d)var _=d.dgst;d=_,l=Error(r(419)),l.stack="",l.digest=d,vs({value:l,source:null,stack:null}),t=nc(e,t,n)}else if(bt||Si(e,t,n,!1),d=(n&e.childLanes)!==0,bt||d){if(d=st,d!==null&&(l=X(d,n),l!==0&&l!==E.retryLane))throw E.retryLane=l,Ta(e,l),nn(d,e,l),Jr;_c(p)||no(),t=nc(e,t,n)}else _c(p)?(t.flags|=192,t.child=e.child,t=null):(e=E.treeContext,rt=Nn(p.nextSibling),kt=t,qe=!0,Gl=null,Cn=!1,e!==null&&qf(t,e),t=tc(t,l.children),t.flags|=4096);return t}return i?(Jl(),p=l.fallback,i=t.mode,E=e.child,_=E.sibling,l=fl(E,{mode:"hidden",children:l.children}),l.subtreeFlags=E.subtreeFlags&65011712,_!==null?p=fl(_,p):(p=Da(p,i,n,null),p.flags|=2),p.return=t,l.return=t,l.sibling=p,t.child=l,ks(null,l),l=t.child,p=e.child.memoizedState,p===null?p=Pr(n):(i=p.cachePool,i!==null?(E=xt._currentValue,i=i.parent!==E?{parent:E,pool:E}:i):i=Vf(),p={baseLanes:p.baseLanes|n,cachePool:i}),l.memoizedState=p,l.childLanes=ec(e,d,n),t.memoizedState=Ir,ks(e.child,l)):(Fl(t),n=e.child,e=n.sibling,n=fl(n,{mode:"visible",children:l.children}),n.return=t,n.sibling=null,e!==null&&(d=t.deletions,d===null?(t.deletions=[e],t.flags|=16):d.push(e)),t.child=n,t.memoizedState=null,n)}function tc(e,t){return t=Zu({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Zu(e,t){return e=fn(22,e,null,t),e.lanes=0,e}function nc(e,t,n){return Ba(t,e.child,null,n),e=tc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function ih(e,t,n){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),yr(e.return,t,n)}function lc(e,t,n,l,i,u){var d=e.memoizedState;d===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:n,tailMode:i,treeForkCount:u}:(d.isBackwards=t,d.rendering=null,d.renderingStartTime=0,d.last=l,d.tail=n,d.tailMode=i,d.treeForkCount=u)}function sh(e,t,n){var l=t.pendingProps,i=l.revealOrder,u=l.tail;l=l.children;var d=pt.current,p=(d&2)!==0;if(p?(d=d&1|2,t.flags|=128):d&=1,ae(pt,d),Rt(e,t,l,n),l=qe?xs:0,!p&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&ih(e,n,t);else if(e.tag===19)ih(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&&_u(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),lc(t,!1,i,n,u,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&&_u(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}lc(t,!0,n,null,u,l);break;case"together":lc(t,!1,null,null,void 0,l);break;default:t.memoizedState=null}return t.child}function yl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Pl|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Si(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=fl(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=fl(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function ac(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Nu(e)))}function Qm(e,t,n){switch(t.tag){case 3:Z(t,t.stateNode.containerInfo),Ql(t,xt,e.memoizedState.cache),ka();break;case 27:case 5:xe(t);break;case 4:Z(t,t.stateNode.containerInfo);break;case 10:Ql(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Tr(t),null;break;case 13:var l=t.memoizedState;if(l!==null)return l.dehydrated!==null?(Fl(t),t.flags|=128,null):(n&t.child.childLanes)!==0?ah(e,t,n):(Fl(t),e=yl(e,t,n),e!==null?e.sibling:null);Fl(t);break;case 19:var i=(e.flags&128)!==0;if(l=(n&t.childLanes)!==0,l||(Si(e,t,n,!1),l=(n&t.childLanes)!==0),i){if(l)return sh(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),ae(pt,pt.current),l)break;return null;case 22:return t.lanes=0,Id(e,t,n,t.pendingProps);case 24:Ql(t,xt,e.memoizedState.cache)}return yl(e,t,n)}function uh(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)bt=!0;else{if(!ac(e,n)&&(t.flags&128)===0)return bt=!1,Qm(e,t,n);bt=(e.flags&131072)!==0}else bt=!1,qe&&(t.flags&1048576)!==0&&Hf(t,xs,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=_a(t.elementType),t.type=e,typeof e=="function")rr(e)?(l=Ha(e,l),t.tag=1,t=nh(null,t,e,l,n)):(t.tag=0,t=Wr(null,t,e,l,n));else{if(e!=null){var i=e.$$typeof;if(i===W){t.tag=11,t=Fd(null,t,e,l,n);break e}else if(i===b){t.tag=14,t=Jd(null,t,e,l,n);break e}}throw t=we(e)||e,Error(r(306,t,""))}}return t;case 0:return Wr(e,t,t.type,t.pendingProps,n);case 1:return l=t.type,i=Ha(l,t.pendingProps),nh(e,t,l,i,n);case 3:e:{if(Z(t,t.stateNode.containerInfo),e===null)throw Error(r(387));l=t.pendingProps;var u=t.memoizedState;i=u.element,Er(e,t),Ms(t,l,null,n);var d=t.memoizedState;if(l=d.cache,Ql(t,xt,l),l!==u.cache&&xr(t,[xt],n,!0),Cs(),l=d.element,u.isDehydrated)if(u={element:l,isDehydrated:!1,cache:d.cache},t.updateQueue.baseState=u,t.memoizedState=u,t.flags&256){t=lh(e,t,l,n);break e}else if(l!==i){i=Sn(Error(r(424)),t),vs(i),t=lh(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=Nn(e.firstChild),kt=t,qe=!0,Gl=null,Cn=!0,n=If(t,null,l,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ka(),l===i){t=yl(e,t,n);break e}Rt(e,t,l,n)}t=t.child}return t;case 26:return Vu(e,t),e===null?(n=x0(t.type,null,t.pendingProps,null))?t.memoizedState=n:qe||(n=t.type,e=t.pendingProps,l=ro(Ce.current).createElement(n),l[Ze]=t,l[Oe]=e,Ot(l,n,e),yt(l),t.stateNode=l):t.memoizedState=x0(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return xe(t),e===null&&qe&&(l=t.stateNode=p0(t.type,t.pendingProps,Ce.current),kt=t,Cn=!0,i=rt,aa(t.type)?(Bc=i,rt=Nn(l.firstChild)):rt=i),Rt(e,t,t.pendingProps.children,n),Vu(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&qe&&((i=l=rt)&&(l=wp(l,t.type,t.pendingProps,Cn),l!==null?(t.stateNode=l,kt=t,rt=Nn(l.firstChild),Cn=!1,i=!0):i=!1),i||Xl(t)),xe(t),i=t.type,u=t.pendingProps,d=e!==null?e.memoizedProps:null,l=u.children,zc(i,u)?l=null:d!==null&&zc(i,d)&&(t.flags|=32),t.memoizedState!==null&&(i=kr(e,t,Lm,null,null,n),Vs._currentValue=i),Vu(e,t),Rt(e,t,l,n),t.child;case 6:return e===null&&qe&&((e=n=rt)&&(n=Sp(n,t.pendingProps,Cn),n!==null?(t.stateNode=n,kt=t,rt=null,e=!0):e=!1),e||Xl(t)),null;case 13:return ah(e,t,n);case 4:return Z(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=Ba(t,null,l,n):Rt(e,t,l,n),t.child;case 11:return Fd(e,t,t.type,t.pendingProps,n);case 7:return Rt(e,t,t.pendingProps,n),t.child;case 8:return Rt(e,t,t.pendingProps.children,n),t.child;case 12:return Rt(e,t,t.pendingProps.children,n),t.child;case 10:return l=t.pendingProps,Ql(t,t.type,l.value),Rt(e,t,l.children,n),t.child;case 9:return i=t.type._context,l=t.pendingProps.children,Ra(t),i=zt(i),l=l(i),t.flags|=1,Rt(e,t,l,n),t.child;case 14:return Jd(e,t,t.type,t.pendingProps,n);case 15:return Wd(e,t,t.type,t.pendingProps,n);case 19:return sh(e,t,n);case 31:return Xm(e,t,n);case 22:return Id(e,t,n,t.pendingProps);case 24:return Ra(t),l=zt(xt),e===null?(i=wr(),i===null&&(i=st,u=vr(),i.pooledCache=u,u.refCount++,u!==null&&(i.pooledCacheLanes|=n),i=u),t.memoizedState={parent:l,cache:i},jr(t),Ql(t,xt,i)):((e.lanes&n)!==0&&(Er(e,t),Ms(t,null,null,n),Cs()),i=e.memoizedState,u=t.memoizedState,i.parent!==l?(i={parent:l,cache:l},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),Ql(t,xt,l)):(l=u.cache,Ql(t,xt,l),l!==i.cache&&xr(t,[xt],n,!0))),Rt(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(r(156,t.tag))}function xl(e){e.flags|=4}function ic(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(Oh())e.flags|=8192;else throw La=ku,Sr}else e.flags&=-16777217}function oh(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!j0(t))if(Oh())e.flags|=8192;else throw La=ku,Sr}function Ku(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Tl():536870912,e.lanes|=t,Oi|=t)}function zs(e,t){if(!qe)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 ct(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 Vm(e,t,n){var l=t.pendingProps;switch(hr(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ct(t),null;case 1:return ct(t),null;case 3:return n=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),ml(xt),ie(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(wi(t)?xl(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,pr())),ct(t),null;case 26:var i=t.type,u=t.memoizedState;return e===null?(xl(t),u!==null?(ct(t),oh(t,u)):(ct(t),ic(t,i,null,l,n))):u?u!==e.memoizedState?(xl(t),ct(t),oh(t,u)):(ct(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&xl(t),ct(t),ic(t,i,e,l,n)),null;case 27:if(Ne(t),n=Ce.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&xl(t);else{if(!l){if(t.stateNode===null)throw Error(r(166));return ct(t),null}e=oe.current,wi(t)?$f(t):(e=p0(i,l,n),t.stateNode=e,xl(t))}return ct(t),null;case 5:if(Ne(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&xl(t);else{if(!l){if(t.stateNode===null)throw Error(r(166));return ct(t),null}if(u=oe.current,wi(t))$f(t);else{var d=ro(Ce.current);switch(u){case 1:u=d.createElementNS("http://www.w3.org/2000/svg",i);break;case 2:u=d.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;default:switch(i){case"svg":u=d.createElementNS("http://www.w3.org/2000/svg",i);break;case"math":u=d.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;case"script":u=d.createElement("div"),u.innerHTML="<script><\/script>",u=u.removeChild(u.firstChild);break;case"select":u=typeof l.is=="string"?d.createElement("select",{is:l.is}):d.createElement("select"),l.multiple?u.multiple=!0:l.size&&(u.size=l.size);break;default:u=typeof l.is=="string"?d.createElement(i,{is:l.is}):d.createElement(i)}}u[Ze]=t,u[Oe]=l;e:for(d=t.child;d!==null;){if(d.tag===5||d.tag===6)u.appendChild(d.stateNode);else if(d.tag!==4&&d.tag!==27&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===t)break e;for(;d.sibling===null;){if(d.return===null||d.return===t)break e;d=d.return}d.sibling.return=d.return,d=d.sibling}t.stateNode=u;e:switch(Ot(u,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&&xl(t)}}return ct(t),ic(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&xl(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(r(166));if(e=Ce.current,wi(t)){if(e=t.stateNode,n=t.memoizedProps,l=null,i=kt,i!==null)switch(i.tag){case 27:case 5:l=i.memoizedProps}e[Ze]=t,e=!!(e.nodeValue===n||l!==null&&l.suppressHydrationWarning===!0||a0(e.nodeValue,n)),e||Xl(t,!0)}else e=ro(e).createTextNode(l),e[Ze]=t,t.stateNode=e}return ct(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(l=wi(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[Ze]=t}else ka(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ct(t),e=!1}else n=pr(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(hn(t),t):(hn(t),null);if((t.flags&128)!==0)throw Error(r(558))}return ct(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=wi(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[Ze]=t}else ka(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ct(t),i=!1}else i=pr(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(hn(t),t):(hn(t),null)}return hn(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),u=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(u=l.memoizedState.cachePool.pool),u!==i&&(l.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Ku(t,t.updateQueue),ct(t),null);case 4:return ie(),e===null&&Nc(t.stateNode.containerInfo),ct(t),null;case 10:return ml(t.type),ct(t),null;case 19:if(U(pt),l=t.memoizedState,l===null)return ct(t),null;if(i=(t.flags&128)!==0,u=l.rendering,u===null)if(i)zs(l,!1);else{if(mt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(u=_u(e),u!==null){for(t.flags|=128,zs(l,!1),e=u.updateQueue,t.updateQueue=e,Ku(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Lf(n,e),n=n.sibling;return ae(pt,pt.current&1|2),qe&&dl(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&dt()>Pu&&(t.flags|=128,i=!0,zs(l,!1),t.lanes=4194304)}else{if(!i)if(e=_u(u),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,Ku(t,e),zs(l,!0),l.tail===null&&l.tailMode==="hidden"&&!u.alternate&&!qe)return ct(t),null}else 2*dt()-l.renderingStartTime>Pu&&n!==536870912&&(t.flags|=128,i=!0,zs(l,!1),t.lanes=4194304);l.isBackwards?(u.sibling=t.child,t.child=u):(e=l.last,e!==null?e.sibling=u:t.child=u,l.last=u)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=dt(),e.sibling=null,n=pt.current,ae(pt,i?n&1|2:n&1),qe&&dl(t,l.treeForkCount),e):(ct(t),null);case 22:case 23:return hn(t),Ar(),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&&(ct(t),t.subtreeFlags&6&&(t.flags|=8192)):ct(t),n=t.updateQueue,n!==null&&Ku(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&&U(Oa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ml(xt),ct(t),null;case 25:return null;case 30:return null}throw Error(r(156,t.tag))}function Zm(e,t){switch(hr(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ml(xt),ie(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ne(t),null;case 31:if(t.memoizedState!==null){if(hn(t),t.alternate===null)throw Error(r(340));ka()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(hn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));ka()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return U(pt),null;case 4:return ie(),null;case 10:return ml(t.type),null;case 22:case 23:return hn(t),Ar(),e!==null&&U(Oa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ml(xt),null;case 25:return null;default:return null}}function rh(e,t){switch(hr(t),t.tag){case 3:ml(xt),ie();break;case 26:case 27:case 5:Ne(t);break;case 4:ie();break;case 31:t.memoizedState!==null&&hn(t);break;case 13:hn(t);break;case 19:U(pt);break;case 10:ml(t.type);break;case 22:case 23:hn(t),Ar(),e!==null&&U(Oa);break;case 24:ml(xt)}}function Rs(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 u=n.create,d=n.inst;l=u(),d.destroy=l}n=n.next}while(n!==i)}}catch(p){Pe(t,t.return,p)}}function Wl(e,t,n){try{var l=t.updateQueue,i=l!==null?l.lastEffect:null;if(i!==null){var u=i.next;l=u;do{if((l.tag&e)===e){var d=l.inst,p=d.destroy;if(p!==void 0){d.destroy=void 0,i=t;var E=n,_=p;try{_()}catch(K){Pe(i,E,K)}}}l=l.next}while(l!==u)}}catch(K){Pe(t,t.return,K)}}function ch(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{ed(t,n)}catch(l){Pe(e,e.return,l)}}}function fh(e,t,n){n.props=Ha(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(l){Pe(e,t,l)}}function Os(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){Pe(e,t,i)}}function Pn(e,t){var n=e.ref,l=e.refCleanup;if(n!==null)if(typeof l=="function")try{l()}catch(i){Pe(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){Pe(e,t,i)}else n.current=null}function dh(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){Pe(e,e.return,i)}}function sc(e,t,n){try{var l=e.stateNode;pp(l,e.type,n,t),l[Oe]=t}catch(i){Pe(e,e.return,i)}}function hh(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&aa(e.type)||e.tag===4}function uc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||hh(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&&aa(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 oc(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=Rn));else if(l!==4&&(l===27&&aa(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(oc(e,t,n),e=e.sibling;e!==null;)oc(e,t,n),e=e.sibling}function Fu(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&&aa(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Fu(e,t,n),e=e.sibling;e!==null;)Fu(e,t,n),e=e.sibling}function mh(e){var t=e.stateNode,n=e.memoizedProps;try{for(var l=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Ot(t,l,n),t[Ze]=e,t[Oe]=n}catch(u){Pe(e,e.return,u)}}var vl=!1,wt=!1,rc=!1,ph=typeof WeakSet=="function"?WeakSet:Set,Mt=null;function Km(e,t){if(e=e.containerInfo,Dc=yo,e=Xt(e),Ye(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,u=l.focusNode;l=l.focusOffset;try{n.nodeType,u.nodeType}catch{n=null;break e}var d=0,p=-1,E=-1,_=0,K=0,J=e,B=null;t:for(;;){for(var G;J!==n||i!==0&&J.nodeType!==3||(p=d+i),J!==u||l!==0&&J.nodeType!==3||(E=d+l),J.nodeType===3&&(d+=J.nodeValue.length),(G=J.firstChild)!==null;)B=J,J=G;for(;;){if(J===e)break t;if(B===n&&++_===i&&(p=d),B===u&&++K===l&&(E=d),(G=J.nextSibling)!==null)break;J=B,B=J.parentNode}J=G}n=p===-1||E===-1?null:{start:p,end:E}}else n=null}n=n||{start:0,end:0}}else n=null;for(kc={focusedElem:e,selectionRange:n},yo=!1,Mt=t;Mt!==null;)if(t=Mt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Mt=e;else for(;Mt!==null;){switch(t=Mt,u=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&&u!==null){e=void 0,n=t,i=u.memoizedProps,u=u.memoizedState,l=n.stateNode;try{var ve=Ha(n.type,i);e=l.getSnapshotBeforeUpdate(ve,u),l.__reactInternalSnapshotBeforeUpdate=e}catch(Me){Pe(n,n.return,Me)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)Oc(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Oc(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,Mt=e;break}Mt=t.return}}function gh(e,t,n){var l=n.flags;switch(n.tag){case 0:case 11:case 15:wl(e,n),l&4&&Rs(5,n);break;case 1:if(wl(e,n),l&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(d){Pe(n,n.return,d)}else{var i=Ha(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(d){Pe(n,n.return,d)}}l&64&&ch(n),l&512&&Os(n,n.return);break;case 3:if(wl(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{ed(e,t)}catch(d){Pe(n,n.return,d)}}break;case 27:t===null&&l&4&&mh(n);case 26:case 5:wl(e,n),t===null&&l&4&&dh(n),l&512&&Os(n,n.return);break;case 12:wl(e,n);break;case 31:wl(e,n),l&4&&vh(e,n);break;case 13:wl(e,n),l&4&&bh(e,n),l&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=lp.bind(null,n),jp(e,n))));break;case 22:if(l=n.memoizedState!==null||vl,!l){t=t!==null&&t.memoizedState!==null||wt,i=vl;var u=wt;vl=l,(wt=t)&&!u?Sl(e,n,(n.subtreeFlags&8772)!==0):wl(e,n),vl=i,wt=u}break;case 30:break;default:wl(e,n)}}function yh(e){var t=e.alternate;t!==null&&(e.alternate=null,yh(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Vn(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var ft=null,It=!1;function bl(e,t,n){for(n=n.child;n!==null;)xh(e,t,n),n=n.sibling}function xh(e,t,n){if(At&&typeof At.onCommitFiberUnmount=="function")try{At.onCommitFiberUnmount(kn,n)}catch{}switch(n.tag){case 26:wt||Pn(n,t),bl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:wt||Pn(n,t);var l=ft,i=It;aa(n.type)&&(ft=n.stateNode,It=!1),bl(e,t,n),Gs(n.stateNode),ft=l,It=i;break;case 5:wt||Pn(n,t);case 6:if(l=ft,i=It,ft=null,bl(e,t,n),ft=l,It=i,ft!==null)if(It)try{(ft.nodeType===9?ft.body:ft.nodeName==="HTML"?ft.ownerDocument.body:ft).removeChild(n.stateNode)}catch(u){Pe(n,t,u)}else try{ft.removeChild(n.stateNode)}catch(u){Pe(n,t,u)}break;case 18:ft!==null&&(It?(e=ft,c0(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),Yi(e)):c0(ft,n.stateNode));break;case 4:l=ft,i=It,ft=n.stateNode.containerInfo,It=!0,bl(e,t,n),ft=l,It=i;break;case 0:case 11:case 14:case 15:Wl(2,n,t),wt||Wl(4,n,t),bl(e,t,n);break;case 1:wt||(Pn(n,t),l=n.stateNode,typeof l.componentWillUnmount=="function"&&fh(n,t,l)),bl(e,t,n);break;case 21:bl(e,t,n);break;case 22:wt=(l=wt)||n.memoizedState!==null,bl(e,t,n),wt=l;break;default:bl(e,t,n)}}function vh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Yi(e)}catch(n){Pe(t,t.return,n)}}}function bh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Yi(e)}catch(n){Pe(t,t.return,n)}}function Fm(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new ph),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new ph),t;default:throw Error(r(435,e.tag))}}function Ju(e,t){var n=Fm(e);t.forEach(function(l){if(!n.has(l)){n.add(l);var i=ap.bind(null,e,l);l.then(i,i)}})}function Pt(e,t){var n=t.deletions;if(n!==null)for(var l=0;l<n.length;l++){var i=n[l],u=e,d=t,p=d;e:for(;p!==null;){switch(p.tag){case 27:if(aa(p.type)){ft=p.stateNode,It=!1;break e}break;case 5:ft=p.stateNode,It=!1;break e;case 3:case 4:ft=p.stateNode.containerInfo,It=!0;break e}p=p.return}if(ft===null)throw Error(r(160));xh(u,d,i),ft=null,It=!1,u=i.alternate,u!==null&&(u.return=null),i.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)wh(t,e),t=t.sibling}var Un=null;function wh(e,t){var n=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Pt(t,e),en(e),l&4&&(Wl(3,e,e.return),Rs(3,e),Wl(5,e,e.return));break;case 1:Pt(t,e),en(e),l&512&&(wt||n===null||Pn(n,n.return)),l&64&&vl&&(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=Un;if(Pt(t,e),en(e),l&512&&(wt||n===null||Pn(n,n.return)),l&4){var u=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":u=i.getElementsByTagName("title")[0],(!u||u[il]||u[Ze]||u.namespaceURI==="http://www.w3.org/2000/svg"||u.hasAttribute("itemprop"))&&(u=i.createElement(l),i.head.insertBefore(u,i.querySelector("head > title"))),Ot(u,l,n),u[Ze]=e,yt(u),l=u;break e;case"link":var d=w0("link","href",i).get(l+(n.href||""));if(d){for(var p=0;p<d.length;p++)if(u=d[p],u.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&u.getAttribute("rel")===(n.rel==null?null:n.rel)&&u.getAttribute("title")===(n.title==null?null:n.title)&&u.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){d.splice(p,1);break t}}u=i.createElement(l),Ot(u,l,n),i.head.appendChild(u);break;case"meta":if(d=w0("meta","content",i).get(l+(n.content||""))){for(p=0;p<d.length;p++)if(u=d[p],u.getAttribute("content")===(n.content==null?null:""+n.content)&&u.getAttribute("name")===(n.name==null?null:n.name)&&u.getAttribute("property")===(n.property==null?null:n.property)&&u.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&u.getAttribute("charset")===(n.charSet==null?null:n.charSet)){d.splice(p,1);break t}}u=i.createElement(l),Ot(u,l,n),i.head.appendChild(u);break;default:throw Error(r(468,l))}u[Ze]=e,yt(u),l=u}e.stateNode=l}else S0(i,e.type,e.stateNode);else e.stateNode=b0(i,l,e.memoizedProps);else u!==l?(u===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):u.count--,l===null?S0(i,e.type,e.stateNode):b0(i,l,e.memoizedProps)):l===null&&e.stateNode!==null&&sc(e,e.memoizedProps,n.memoizedProps)}break;case 27:Pt(t,e),en(e),l&512&&(wt||n===null||Pn(n,n.return)),n!==null&&l&4&&sc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Pt(t,e),en(e),l&512&&(wt||n===null||Pn(n,n.return)),e.flags&32){i=e.stateNode;try{ul(i,"")}catch(ve){Pe(e,e.return,ve)}}l&4&&e.stateNode!=null&&(i=e.memoizedProps,sc(e,i,n!==null?n.memoizedProps:i)),l&1024&&(rc=!0);break;case 6:if(Pt(t,e),en(e),l&4){if(e.stateNode===null)throw Error(r(162));l=e.memoizedProps,n=e.stateNode;try{n.nodeValue=l}catch(ve){Pe(e,e.return,ve)}}break;case 3:if(ho=null,i=Un,Un=co(t.containerInfo),Pt(t,e),Un=i,en(e),l&4&&n!==null&&n.memoizedState.isDehydrated)try{Yi(t.containerInfo)}catch(ve){Pe(e,e.return,ve)}rc&&(rc=!1,Sh(e));break;case 4:l=Un,Un=co(e.stateNode.containerInfo),Pt(t,e),en(e),Un=l;break;case 12:Pt(t,e),en(e);break;case 31:Pt(t,e),en(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Ju(e,l)));break;case 13:Pt(t,e),en(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Iu=dt()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Ju(e,l)));break;case 22:i=e.memoizedState!==null;var E=n!==null&&n.memoizedState!==null,_=vl,K=wt;if(vl=_||i,wt=K||E,Pt(t,e),wt=K,vl=_,en(e),l&8192)e:for(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,i&&(n===null||E||vl||wt||qa(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){E=n=t;try{if(u=E.stateNode,i)d=u.style,typeof d.setProperty=="function"?d.setProperty("display","none","important"):d.display="none";else{p=E.stateNode;var J=E.memoizedProps.style,B=J!=null&&J.hasOwnProperty("display")?J.display:null;p.style.display=B==null||typeof B=="boolean"?"":(""+B).trim()}}catch(ve){Pe(E,E.return,ve)}}}else if(t.tag===6){if(n===null){E=t;try{E.stateNode.nodeValue=i?"":E.memoizedProps}catch(ve){Pe(E,E.return,ve)}}}else if(t.tag===18){if(n===null){E=t;try{var G=E.stateNode;i?f0(G,!0):f0(E.stateNode,!1)}catch(ve){Pe(E,E.return,ve)}}}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,Ju(e,n))));break;case 19:Pt(t,e),en(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Ju(e,l)));break;case 30:break;case 21:break;default:Pt(t,e),en(e)}}function en(e){var t=e.flags;if(t&2){try{for(var n,l=e.return;l!==null;){if(hh(l)){n=l;break}l=l.return}if(n==null)throw Error(r(160));switch(n.tag){case 27:var i=n.stateNode,u=uc(e);Fu(e,u,i);break;case 5:var d=n.stateNode;n.flags&32&&(ul(d,""),n.flags&=-33);var p=uc(e);Fu(e,p,d);break;case 3:case 4:var E=n.stateNode.containerInfo,_=uc(e);oc(e,_,E);break;default:throw Error(r(161))}}catch(K){Pe(e,e.return,K)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Sh(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Sh(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function wl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)gh(e,t.alternate,t),t=t.sibling}function qa(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Wl(4,t,t.return),qa(t);break;case 1:Pn(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&fh(t,t.return,n),qa(t);break;case 27:Gs(t.stateNode);case 26:case 5:Pn(t,t.return),qa(t);break;case 22:t.memoizedState===null&&qa(t);break;case 30:qa(t);break;default:qa(t)}e=e.sibling}}function Sl(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var l=t.alternate,i=e,u=t,d=u.flags;switch(u.tag){case 0:case 11:case 15:Sl(i,u,n),Rs(4,u);break;case 1:if(Sl(i,u,n),l=u,i=l.stateNode,typeof i.componentDidMount=="function")try{i.componentDidMount()}catch(_){Pe(l,l.return,_)}if(l=u,i=l.updateQueue,i!==null){var p=l.stateNode;try{var E=i.shared.hiddenCallbacks;if(E!==null)for(i.shared.hiddenCallbacks=null,i=0;i<E.length;i++)Pf(E[i],p)}catch(_){Pe(l,l.return,_)}}n&&d&64&&ch(u),Os(u,u.return);break;case 27:mh(u);case 26:case 5:Sl(i,u,n),n&&l===null&&d&4&&dh(u),Os(u,u.return);break;case 12:Sl(i,u,n);break;case 31:Sl(i,u,n),n&&d&4&&vh(i,u);break;case 13:Sl(i,u,n),n&&d&4&&bh(i,u);break;case 22:u.memoizedState===null&&Sl(i,u,n),Os(u,u.return);break;case 30:break;default:Sl(i,u,n)}t=t.sibling}}function cc(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&&bs(n))}function fc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&bs(e))}function Hn(e,t,n,l){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)jh(e,t,n,l),t=t.sibling}function jh(e,t,n,l){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Hn(e,t,n,l),i&2048&&Rs(9,t);break;case 1:Hn(e,t,n,l);break;case 3:Hn(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&&bs(e)));break;case 12:if(i&2048){Hn(e,t,n,l),e=t.stateNode;try{var u=t.memoizedProps,d=u.id,p=u.onPostCommit;typeof p=="function"&&p(d,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(E){Pe(t,t.return,E)}}else Hn(e,t,n,l);break;case 31:Hn(e,t,n,l);break;case 13:Hn(e,t,n,l);break;case 23:break;case 22:u=t.stateNode,d=t.alternate,t.memoizedState!==null?u._visibility&2?Hn(e,t,n,l):_s(e,t):u._visibility&2?Hn(e,t,n,l):(u._visibility|=2,ki(e,t,n,l,(t.subtreeFlags&10256)!==0||!1)),i&2048&&cc(d,t);break;case 24:Hn(e,t,n,l),i&2048&&fc(t.alternate,t);break;default:Hn(e,t,n,l)}}function ki(e,t,n,l,i){for(i=i&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var u=e,d=t,p=n,E=l,_=d.flags;switch(d.tag){case 0:case 11:case 15:ki(u,d,p,E,i),Rs(8,d);break;case 23:break;case 22:var K=d.stateNode;d.memoizedState!==null?K._visibility&2?ki(u,d,p,E,i):_s(u,d):(K._visibility|=2,ki(u,d,p,E,i)),i&&_&2048&&cc(d.alternate,d);break;case 24:ki(u,d,p,E,i),i&&_&2048&&fc(d.alternate,d);break;default:ki(u,d,p,E,i)}t=t.sibling}}function _s(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:_s(n,l),i&2048&&cc(l.alternate,l);break;case 24:_s(n,l),i&2048&&fc(l.alternate,l);break;default:_s(n,l)}t=t.sibling}}var Ls=8192;function zi(e,t,n){if(e.subtreeFlags&Ls)for(e=e.child;e!==null;)Eh(e,t,n),e=e.sibling}function Eh(e,t,n){switch(e.tag){case 26:zi(e,t,n),e.flags&Ls&&e.memoizedState!==null&&_p(n,Un,e.memoizedState,e.memoizedProps);break;case 5:zi(e,t,n);break;case 3:case 4:var l=Un;Un=co(e.stateNode.containerInfo),zi(e,t,n),Un=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=Ls,Ls=16777216,zi(e,t,n),Ls=l):zi(e,t,n));break;default:zi(e,t,n)}}function Ch(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 Bs(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];Mt=l,Nh(l,e)}Ch(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Mh(e),e=e.sibling}function Mh(e){switch(e.tag){case 0:case 11:case 15:Bs(e),e.flags&2048&&Wl(9,e,e.return);break;case 3:Bs(e);break;case 12:Bs(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Wu(e)):Bs(e);break;default:Bs(e)}}function Wu(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];Mt=l,Nh(l,e)}Ch(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Wl(8,t,t.return),Wu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Wu(t));break;default:Wu(t)}e=e.sibling}}function Nh(e,t){for(;Mt!==null;){var n=Mt;switch(n.tag){case 0:case 11:case 15:Wl(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:bs(n.memoizedState.cache)}if(l=n.child,l!==null)l.return=n,Mt=l;else e:for(n=e;Mt!==null;){l=Mt;var i=l.sibling,u=l.return;if(yh(l),l===n){Mt=null;break e}if(i!==null){i.return=u,Mt=i;break e}Mt=u}}}var Jm={getCacheForType:function(e){var t=zt(xt),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return zt(xt).controller.signal}},Wm=typeof WeakMap=="function"?WeakMap:Map,Ke=0,st=null,Le=null,Ue=0,Ie=0,mn=null,Il=!1,Ri=!1,dc=!1,jl=0,mt=0,Pl=0,$a=0,hc=0,pn=0,Oi=0,Us=null,tn=null,mc=!1,Iu=0,Ah=0,Pu=1/0,eo=null,ea=null,jt=0,ta=null,_i=null,El=0,pc=0,gc=null,Th=null,Hs=0,yc=null;function gn(){return(Ke&2)!==0&&Ue!==0?Ue&-Ue:L.T!==null?jc():_e()}function Dh(){if(pn===0)if((Ue&536870912)===0||qe){var e=Gn;Gn<<=1,(Gn&3932160)===0&&(Gn=262144),pn=e}else pn=536870912;return e=dn.current,e!==null&&(e.flags|=32),pn}function nn(e,t,n){(e===st&&(Ie===2||Ie===9)||e.cancelPendingCommit!==null)&&(Li(e,0),na(e,Ue,pn,!1)),Qn(e,n),((Ke&2)===0||e!==st)&&(e===st&&((Ke&2)===0&&($a|=n),mt===4&&na(e,Ue,pn,!1)),el(e))}function kh(e,t,n){if((Ke&6)!==0)throw Error(r(327));var l=!n&&(t&127)===0&&(t&e.expiredLanes)===0||xn(e,t),i=l?ep(e,t):vc(e,t,!0),u=l;do{if(i===0){Ri&&!l&&na(e,t,0,!1);break}else{if(n=e.current.alternate,u&&!Im(n)){i=vc(e,t,!1),u=!1;continue}if(i===2){if(u=t,e.errorRecoveryDisabledLanes&u)var d=0;else d=e.pendingLanes&-536870913,d=d!==0?d:d&536870912?536870912:0;if(d!==0){t=d;e:{var p=e;i=Us;var E=p.current.memoizedState.isDehydrated;if(E&&(Li(p,d).flags|=256),d=vc(p,d,!1),d!==2){if(dc&&!E){p.errorRecoveryDisabledLanes|=u,$a|=u,i=4;break e}u=tn,tn=i,u!==null&&(tn===null?tn=u:tn.push.apply(tn,u))}i=d}if(u=!1,i!==2)continue}}if(i===1){Li(e,0),na(e,t,0,!0);break}e:{switch(l=e,u=i,u){case 0:case 1:throw Error(r(345));case 4:if((t&4194048)!==t)break;case 6:na(l,t,pn,!Il);break e;case 2:tn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((t&62914560)===t&&(i=Iu+300-dt(),10<i)){if(na(l,t,pn,!Il),on(l,0,!0)!==0)break e;El=t,l.timeoutHandle=o0(zh.bind(null,l,n,tn,eo,mc,t,pn,$a,Oi,Il,u,"Throttled",-0,0),i);break e}zh(l,n,tn,eo,mc,t,pn,$a,Oi,Il,u,null,-0,0)}}break}while(!0);el(e)}function zh(e,t,n,l,i,u,d,p,E,_,K,J,B,G){if(e.timeoutHandle=-1,J=t.subtreeFlags,J&8192||(J&16785408)===16785408){J={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Rn},Eh(t,u,J);var ve=(u&62914560)===u?Iu-dt():(u&4194048)===u?Ah-dt():0;if(ve=Lp(J,ve),ve!==null){El=u,e.cancelPendingCommit=ve(qh.bind(null,e,t,u,n,l,i,d,p,E,K,J,null,B,G)),na(e,u,d,!_);return}}qh(e,t,u,n,l,i,d,p,E)}function Im(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],u=i.getSnapshot;i=i.value;try{if(!fe(u(),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 na(e,t,n,l){t&=~hc,t&=~$a,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var i=t;0<i;){var u=31-Tt(i),d=1<<u;l[u]=-1,i&=~d}n!==0&&ei(e,n,t)}function to(){return(Ke&6)===0?(qs(0),!1):!0}function xc(){if(Le!==null){if(Ie===0)var e=Le.return;else e=Le,hl=za=null,Or(e),Mi=null,Ss=0,e=Le;for(;e!==null;)rh(e.alternate,e),e=e.return;Le=null}}function Li(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,xp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),El=0,xc(),st=e,Le=n=fl(e.current,null),Ue=t,Ie=0,mn=null,Il=!1,Ri=xn(e,t),dc=!1,Oi=pn=hc=$a=Pl=mt=0,tn=Us=null,mc=!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-Tt(l),u=1<<i;t|=e[i],l&=~u}return jl=t,Su(),n}function Rh(e,t){ke=null,L.H=Ds,t===Ci||t===Du?(t=Ff(),Ie=3):t===Sr?(t=Ff(),Ie=4):Ie=t===Jr?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,mn=t,Le===null&&(mt=1,Xu(e,Sn(t,e.current)))}function Oh(){var e=dn.current;return e===null?!0:(Ue&4194048)===Ue?Mn===null:(Ue&62914560)===Ue||(Ue&536870912)!==0?e===Mn:!1}function _h(){var e=L.H;return L.H=Ds,e===null?Ds:e}function Lh(){var e=L.A;return L.A=Jm,e}function no(){mt=4,Il||(Ue&4194048)!==Ue&&dn.current!==null||(Ri=!0),(Pl&134217727)===0&&($a&134217727)===0||st===null||na(st,Ue,pn,!1)}function vc(e,t,n){var l=Ke;Ke|=2;var i=_h(),u=Lh();(st!==e||Ue!==t)&&(eo=null,Li(e,t)),t=!1;var d=mt;e:do try{if(Ie!==0&&Le!==null){var p=Le,E=mn;switch(Ie){case 8:xc(),d=6;break e;case 3:case 2:case 9:case 6:dn.current===null&&(t=!0);var _=Ie;if(Ie=0,mn=null,Bi(e,p,E,_),n&&Ri){d=0;break e}break;default:_=Ie,Ie=0,mn=null,Bi(e,p,E,_)}}Pm(),d=mt;break}catch(K){Rh(e,K)}while(!0);return t&&e.shellSuspendCounter++,hl=za=null,Ke=l,L.H=i,L.A=u,Le===null&&(st=null,Ue=0,Su()),d}function Pm(){for(;Le!==null;)Bh(Le)}function ep(e,t){var n=Ke;Ke|=2;var l=_h(),i=Lh();st!==e||Ue!==t?(eo=null,Pu=dt()+500,Li(e,t)):Ri=xn(e,t);e:do try{if(Ie!==0&&Le!==null){t=Le;var u=mn;t:switch(Ie){case 1:Ie=0,mn=null,Bi(e,t,u,1);break;case 2:case 9:if(Zf(u)){Ie=0,mn=null,Uh(t);break}t=function(){Ie!==2&&Ie!==9||st!==e||(Ie=7),el(e)},u.then(t,t);break e;case 3:Ie=7;break e;case 4:Ie=5;break e;case 7:Zf(u)?(Ie=0,mn=null,Uh(t)):(Ie=0,mn=null,Bi(e,t,u,7));break;case 5:var d=null;switch(Le.tag){case 26:d=Le.memoizedState;case 5:case 27:var p=Le;if(d?j0(d):p.stateNode.complete){Ie=0,mn=null;var E=p.sibling;if(E!==null)Le=E;else{var _=p.return;_!==null?(Le=_,lo(_)):Le=null}break t}}Ie=0,mn=null,Bi(e,t,u,5);break;case 6:Ie=0,mn=null,Bi(e,t,u,6);break;case 8:xc(),mt=6;break e;default:throw Error(r(462))}}tp();break}catch(K){Rh(e,K)}while(!0);return hl=za=null,L.H=l,L.A=i,Ke=n,Le!==null?0:(st=null,Ue=0,Su(),mt)}function tp(){for(;Le!==null&&!Fa();)Bh(Le)}function Bh(e){var t=uh(e.alternate,e,jl);e.memoizedProps=e.pendingProps,t===null?lo(e):Le=t}function Uh(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=th(n,t,t.pendingProps,t.type,void 0,Ue);break;case 11:t=th(n,t,t.pendingProps,t.type.render,t.ref,Ue);break;case 5:Or(t);default:rh(n,t),t=Le=Lf(t,jl),t=uh(n,t,jl)}e.memoizedProps=e.pendingProps,t===null?lo(e):Le=t}function Bi(e,t,n,l){hl=za=null,Or(t),Mi=null,Ss=0;var i=t.return;try{if(Gm(e,i,t,n,Ue)){mt=1,Xu(e,Sn(n,e.current)),Le=null;return}}catch(u){if(i!==null)throw Le=i,u;mt=1,Xu(e,Sn(n,e.current)),Le=null;return}t.flags&32768?(qe||l===1?e=!0:Ri||(Ue&536870912)!==0?e=!1:(Il=e=!0,(l===2||l===9||l===3||l===6)&&(l=dn.current,l!==null&&l.tag===13&&(l.flags|=16384))),Hh(t,e)):lo(t)}function lo(e){var t=e;do{if((t.flags&32768)!==0){Hh(t,Il);return}e=t.return;var n=Vm(t.alternate,t,jl);if(n!==null){Le=n;return}if(t=t.sibling,t!==null){Le=t;return}Le=t=e}while(t!==null);mt===0&&(mt=5)}function Hh(e,t){do{var n=Zm(e.alternate,e);if(n!==null){n.flags&=32767,Le=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Le=e;return}Le=e=n}while(e!==null);mt=6,Le=null}function qh(e,t,n,l,i,u,d,p,E){e.cancelPendingCommit=null;do ao();while(jt!==0);if((Ke&6)!==0)throw Error(r(327));if(t!==null){if(t===e.current)throw Error(r(177));if(u=t.lanes|t.childLanes,u|=ur,Pa(e,n,u,d,p,E),e===st&&(Le=st=null,Ue=0),_i=t,ta=e,El=n,pc=u,gc=i,Th=l,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,ip(Ml,function(){return Qh(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=L.T,L.T=null,i=I.p,I.p=2,d=Ke,Ke|=4;try{Km(e,t,n)}finally{Ke=d,I.p=i,L.T=l}}jt=1,$h(),Yh(),Gh()}}function $h(){if(jt===1){jt=0;var e=ta,t=_i,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=L.T,L.T=null;var l=I.p;I.p=2;var i=Ke;Ke|=4;try{wh(t,e);var u=kc,d=Xt(e.containerInfo),p=u.focusedElem,E=u.selectionRange;if(d!==p&&p&&p.ownerDocument&&it(p.ownerDocument.documentElement,p)){if(E!==null&&Ye(p)){var _=E.start,K=E.end;if(K===void 0&&(K=_),"selectionStart"in p)p.selectionStart=_,p.selectionEnd=Math.min(K,p.value.length);else{var J=p.ownerDocument||document,B=J&&J.defaultView||window;if(B.getSelection){var G=B.getSelection(),ve=p.textContent.length,Me=Math.min(E.start,ve),nt=E.end===void 0?Me:Math.min(E.end,ve);!G.extend&&Me>nt&&(d=nt,nt=Me,Me=d);var D=Fe(p,Me),N=Fe(p,nt);if(D&&N&&(G.rangeCount!==1||G.anchorNode!==D.node||G.anchorOffset!==D.offset||G.focusNode!==N.node||G.focusOffset!==N.offset)){var O=J.createRange();O.setStart(D.node,D.offset),G.removeAllRanges(),Me>nt?(G.addRange(O),G.extend(N.node,N.offset)):(O.setEnd(N.node,N.offset),G.addRange(O))}}}}for(J=[],G=p;G=G.parentNode;)G.nodeType===1&&J.push({element:G,left:G.scrollLeft,top:G.scrollTop});for(typeof p.focus=="function"&&p.focus(),p=0;p<J.length;p++){var F=J[p];F.element.scrollLeft=F.left,F.element.scrollTop=F.top}}yo=!!Dc,kc=Dc=null}finally{Ke=i,I.p=l,L.T=n}}e.current=t,jt=2}}function Yh(){if(jt===2){jt=0;var e=ta,t=_i,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=L.T,L.T=null;var l=I.p;I.p=2;var i=Ke;Ke|=4;try{gh(e,t.alternate,t)}finally{Ke=i,I.p=l,L.T=n}}jt=3}}function Gh(){if(jt===4||jt===3){jt=0,Dn();var e=ta,t=_i,n=El,l=Th;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?jt=5:(jt=0,_i=ta=null,Xh(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(ea=null),De(n),t=t.stateNode,At&&typeof At.onCommitFiberRoot=="function")try{At.onCommitFiberRoot(kn,t,void 0,(t.current.flags&128)===128)}catch{}if(l!==null){t=L.T,i=I.p,I.p=2,L.T=null;try{for(var u=e.onRecoverableError,d=0;d<l.length;d++){var p=l[d];u(p.value,{componentStack:p.stack})}}finally{L.T=t,I.p=i}}(El&3)!==0&&ao(),el(e),i=e.pendingLanes,(n&261930)!==0&&(i&42)!==0?e===yc?Hs++:(Hs=0,yc=e):Hs=0,qs(0)}}function Xh(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,bs(t)))}function ao(){return $h(),Yh(),Gh(),Qh()}function Qh(){if(jt!==5)return!1;var e=ta,t=pc;pc=0;var n=De(El),l=L.T,i=I.p;try{I.p=32>n?32:n,L.T=null,n=gc,gc=null;var u=ta,d=El;if(jt=0,_i=ta=null,El=0,(Ke&6)!==0)throw Error(r(331));var p=Ke;if(Ke|=4,Mh(u.current),jh(u,u.current,d,n),Ke=p,qs(0,!1),At&&typeof At.onPostCommitFiberRoot=="function")try{At.onPostCommitFiberRoot(kn,u)}catch{}return!0}finally{I.p=i,L.T=l,Xh(e,t)}}function Vh(e,t,n){t=Sn(n,t),t=Fr(e.stateNode,t,2),e=Kl(e,t,2),e!==null&&(Qn(e,2),el(e))}function Pe(e,t,n){if(e.tag===3)Vh(e,e,n);else for(;t!==null;){if(t.tag===3){Vh(t,e,n);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(ea===null||!ea.has(l))){e=Sn(n,e),n=Zd(2),l=Kl(t,n,2),l!==null&&(Kd(n,l,t,e),Qn(l,2),el(l));break}}t=t.return}}function bc(e,t,n){var l=e.pingCache;if(l===null){l=e.pingCache=new Wm;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)||(dc=!0,i.add(n),e=np.bind(null,e,t,n),t.then(e,e))}function np(e,t,n){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,st===e&&(Ue&n)===n&&(mt===4||mt===3&&(Ue&62914560)===Ue&&300>dt()-Iu?(Ke&2)===0&&Li(e,0):hc|=n,Oi===Ue&&(Oi=0)),el(e)}function Zh(e,t){t===0&&(t=Tl()),e=Ta(e,t),e!==null&&(Qn(e,t),el(e))}function lp(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Zh(e,n)}function ap(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),Zh(e,n)}function ip(e,t){return $n(e,t)}var io=null,Ui=null,wc=!1,so=!1,Sc=!1,la=0;function el(e){e!==Ui&&e.next===null&&(Ui===null?io=Ui=e:Ui=Ui.next=e),so=!0,wc||(wc=!0,up())}function qs(e,t){if(!Sc&&so){Sc=!0;do for(var n=!1,l=io;l!==null;){if(e!==0){var i=l.pendingLanes;if(i===0)var u=0;else{var d=l.suspendedLanes,p=l.pingedLanes;u=(1<<31-Tt(42|e)+1)-1,u&=i&~(d&~p),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(n=!0,Wh(l,u))}else u=Ue,u=on(l,l===st?u:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(u&3)===0||xn(l,u)||(n=!0,Wh(l,u));l=l.next}while(n);Sc=!1}}function sp(){Kh()}function Kh(){so=wc=!1;var e=0;la!==0&&yp()&&(e=la);for(var t=dt(),n=null,l=io;l!==null;){var i=l.next,u=Fh(l,t);u===0?(l.next=null,n===null?io=i:n.next=i,i===null&&(Ui=n)):(n=l,(e!==0||(u&3)!==0)&&(so=!0)),l=i}jt!==0&&jt!==5||qs(e),la!==0&&(la=0)}function Fh(e,t){for(var n=e.suspendedLanes,l=e.pingedLanes,i=e.expirationTimes,u=e.pendingLanes&-62914561;0<u;){var d=31-Tt(u),p=1<<d,E=i[d];E===-1?((p&n)===0||(p&l)!==0)&&(i[d]=pa(p,t)):E<=t&&(e.expiredLanes|=p),u&=~p}if(t=st,n=Ue,n=on(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,n===0||e===t&&(Ie===2||Ie===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&yn(l),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||xn(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(l!==null&&yn(l),De(n)){case 2:case 8:n=Yn;break;case 32:n=Ml;break;case 268435456:n=Nl;break;default:n=Ml}return l=Jh.bind(null,e),n=$n(n,l),e.callbackPriority=t,e.callbackNode=n,t}return l!==null&&l!==null&&yn(l),e.callbackPriority=2,e.callbackNode=null,2}function Jh(e,t){if(jt!==0&&jt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(ao()&&e.callbackNode!==n)return null;var l=Ue;return l=on(e,e===st?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(kh(e,l,t),Fh(e,dt()),e.callbackNode!=null&&e.callbackNode===n?Jh.bind(null,e):null)}function Wh(e,t){if(ao())return null;kh(e,t,!0)}function up(){vp(function(){(Ke&6)!==0?$n(sn,sp):Kh()})}function jc(){if(la===0){var e=ji;e===0&&(e=nl,nl<<=1,(nl&261888)===0&&(nl=256)),la=e}return la}function Ih(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:ba(""+e)}function Ph(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 op(e,t,n,l,i){if(t==="submit"&&n&&n.stateNode===i){var u=Ih((i[Oe]||null).action),d=l.submitter;d&&(t=(t=d[Oe]||null)?Ih(t.formAction):d.getAttribute("formAction"),t!==null&&(u=t,d=null));var p=new ol("action","action",null,l,i);e.push({event:p,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(la!==0){var E=d?Ph(i,d):new FormData(i);Gr(n,{pending:!0,data:E,method:i.method,action:u},null,E)}}else typeof u=="function"&&(p.preventDefault(),E=d?Ph(i,d):new FormData(i),Gr(n,{pending:!0,data:E,method:i.method,action:u},u,E))},currentTarget:i}]})}}for(var Ec=0;Ec<sr.length;Ec++){var Cc=sr[Ec],rp=Cc.toLowerCase(),cp=Cc[0].toUpperCase()+Cc.slice(1);Bn(rp,"on"+cp)}Bn(Df,"onAnimationEnd"),Bn(kf,"onAnimationIteration"),Bn(zf,"onAnimationStart"),Bn("dblclick","onDoubleClick"),Bn("focusin","onFocus"),Bn("focusout","onBlur"),Bn(Mm,"onTransitionRun"),Bn(Nm,"onTransitionStart"),Bn(Am,"onTransitionCancel"),Bn(Rf,"onTransitionEnd"),Kt("onMouseEnter",["mouseout","mouseover"]),Kt("onMouseLeave",["mouseout","mouseover"]),Kt("onPointerEnter",["pointerout","pointerover"]),Kt("onPointerLeave",["pointerout","pointerover"]),vn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),vn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),vn("onBeforeInput",["compositionend","keypress","textInput","paste"]),vn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),vn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),vn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var $s="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(" "),fp=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat($s));function e0(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 u=void 0;if(t)for(var d=l.length-1;0<=d;d--){var p=l[d],E=p.instance,_=p.currentTarget;if(p=p.listener,E!==u&&i.isPropagationStopped())break e;u=p,i.currentTarget=_;try{u(i)}catch(K){wu(K)}i.currentTarget=null,u=E}else for(d=0;d<l.length;d++){if(p=l[d],E=p.instance,_=p.currentTarget,p=p.listener,E!==u&&i.isPropagationStopped())break e;u=p,i.currentTarget=_;try{u(i)}catch(K){wu(K)}i.currentTarget=null,u=E}}}}function Be(e,t){var n=t[ll];n===void 0&&(n=t[ll]=new Set);var l=e+"__bubble";n.has(l)||(t0(t,e,2,!1),n.add(l))}function Mc(e,t,n){var l=0;t&&(l|=4),t0(n,e,l,t)}var uo="_reactListening"+Math.random().toString(36).slice(2);function Nc(e){if(!e[uo]){e[uo]=!0,ni.forEach(function(n){n!=="selectionchange"&&(fp.has(n)||Mc(n,!1,e),Mc(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[uo]||(t[uo]=!0,Mc("selectionchange",!1,t))}}function t0(e,t,n,l){switch(D0(t)){case 2:var i=Hp;break;case 8:i=qp;break;default:i=Yc}n=i.bind(null,t,n,e),i=void 0,!cn||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 Ac(e,t,n,l,i){var u=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var d=l.tag;if(d===3||d===4){var p=l.stateNode.containerInfo;if(p===i)break;if(d===4)for(d=l.return;d!==null;){var E=d.tag;if((E===3||E===4)&&d.stateNode.containerInfo===i)return;d=d.return}for(;p!==null;){if(d=Dl(p),d===null)return;if(E=d.tag,E===5||E===6||E===26||E===27){l=u=d;continue e}p=p.parentNode}}l=l.return}es(function(){var _=u,K=Ii(n),J=[];e:{var B=Of.get(e);if(B!==void 0){var G=ol,ve=e;switch(e){case"keypress":if(oi(n)===0)break e;case"keydown":case"keyup":G=us;break;case"focusin":ve="focus",G=Ea;break;case"focusout":ve="blur",G=Ea;break;case"beforeblur":case"afterblur":G=Ea;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":G=fi;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":G=Vo;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":G=er;break;case Df:case kf:case zf:G=Zo;break;case Rf:G=fu;break;case"scroll":case"scrollend":G=ns;break;case"wheel":G=du;break;case"copy":case"cut":case"paste":G=Ko;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":G=os;break;case"toggle":case"beforetoggle":G=nr}var Me=(t&4)!==0,nt=!Me&&(e==="scroll"||e==="scrollend"),D=Me?B!==null?B+"Capture":null:B;Me=[];for(var N=_,O;N!==null;){var F=N;if(O=F.stateNode,F=F.tag,F!==5&&F!==26&&F!==27||O===null||D===null||(F=Sa(N,D),F!=null&&Me.push(Ys(N,F,O))),nt)break;N=N.return}0<Me.length&&(B=new G(B,ve,null,n,K),J.push({event:B,listeners:Me}))}}if((t&7)===0){e:{if(B=e==="mouseover"||e==="pointerover",G=e==="mouseout"||e==="pointerout",B&&n!==Wi&&(ve=n.relatedTarget||n.fromElement)&&(Dl(ve)||ve[ot]))break e;if((G||B)&&(B=K.window===K?K:(B=K.ownerDocument)?B.defaultView||B.parentWindow:window,G?(ve=n.relatedTarget||n.toElement,G=_,ve=ve?Dl(ve):null,ve!==null&&(nt=h(ve),Me=ve.tag,ve!==nt||Me!==5&&Me!==27&&Me!==6)&&(ve=null)):(G=null,ve=_),G!==ve)){if(Me=fi,F="onMouseLeave",D="onMouseEnter",N="mouse",(e==="pointerout"||e==="pointerover")&&(Me=os,F="onPointerLeave",D="onPointerEnter",N="pointer"),nt=G==null?B:zl(G),O=ve==null?B:zl(ve),B=new Me(F,N+"leave",G,n,K),B.target=nt,B.relatedTarget=O,F=null,Dl(K)===_&&(Me=new Me(D,N+"enter",ve,n,K),Me.target=O,Me.relatedTarget=nt,F=Me),nt=F,G&&ve)t:{for(Me=dp,D=G,N=ve,O=0,F=D;F;F=Me(F))O++;F=0;for(var je=N;je;je=Me(je))F++;for(;0<O-F;)D=Me(D),O--;for(;0<F-O;)N=Me(N),F--;for(;O--;){if(D===N||N!==null&&D===N.alternate){Me=D;break t}D=Me(D),N=Me(N)}Me=null}else Me=null;G!==null&&n0(J,B,G,Me,!1),ve!==null&&nt!==null&&n0(J,nt,ve,Me,!0)}}e:{if(B=_?zl(_):window,G=B.nodeName&&B.nodeName.toLowerCase(),G==="select"||G==="input"&&B.type==="file")var Xe=xu;else if(pi(B))if(hs)Xe=le;else{Xe=$;var be=A}else G=B.nodeName,!G||G.toLowerCase()!=="input"||B.type!=="checkbox"&&B.type!=="radio"?_&&ui(_.elementType)&&(Xe=xu):Xe=Q;if(Xe&&(Xe=Xe(e,_))){ds(J,Xe,n,K);break e}be&&be(e,B,_),e==="focusout"&&_&&B.type==="number"&&_.memoizedProps.value!=null&&sl(B,"number",B.value)}switch(be=_?zl(_):window,e){case"focusin":(pi(be)||be.contentEditable==="true")&&(Qt=be,rl=_,cl=null);break;case"focusout":cl=rl=Qt=null;break;case"mousedown":gs=!0;break;case"contextmenu":case"mouseup":case"dragend":gs=!1,ys(J,n,K);break;case"selectionchange":if(bn)break;case"keydown":case"keyup":ys(J,n,K)}var Re;if(rs)e:{switch(e){case"compositionstart":var He="onCompositionStart";break e;case"compositionend":He="onCompositionEnd";break e;case"compositionupdate":He="onCompositionUpdate";break e}He=void 0}else Bt?gu(e,n)&&(He="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(He="onCompositionStart");He&&(mu&&n.locale!=="ko"&&(Bt||He!=="onCompositionStart"?He==="onCompositionEnd"&&Bt&&(Re=uu()):(Jt=K,ts="value"in Jt?Jt.value:Jt.textContent,Bt=!0)),be=oo(_,He),0<be.length&&(He=new ru(He,e,null,n,K),J.push({event:He,listeners:be}),Re?He.data=Re:(Re=yu(n),Re!==null&&(He.data=Re)))),(Re=lr?ar(e,n):mi(e,n))&&(He=oo(_,"onBeforeInput"),0<He.length&&(be=new ru("onBeforeInput","beforeinput",null,n,K),J.push({event:be,listeners:He}),be.data=Re)),op(J,e,_,n,K)}e0(J,t)})}function Ys(e,t,n){return{instance:e,listener:t,currentTarget:n}}function oo(e,t){for(var n=t+"Capture",l=[];e!==null;){var i=e,u=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||u===null||(i=Sa(e,n),i!=null&&l.unshift(Ys(e,i,u)),i=Sa(e,t),i!=null&&l.push(Ys(e,i,u))),e.tag===3)return l;e=e.return}return[]}function dp(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function n0(e,t,n,l,i){for(var u=t._reactName,d=[];n!==null&&n!==l;){var p=n,E=p.alternate,_=p.stateNode;if(p=p.tag,E!==null&&E===l)break;p!==5&&p!==26&&p!==27||_===null||(E=_,i?(_=Sa(n,u),_!=null&&d.unshift(Ys(n,_,E))):i||(_=Sa(n,u),_!=null&&d.push(Ys(n,_,E)))),n=n.return}d.length!==0&&e.push({event:t,listeners:d})}var hp=/\r\n?/g,mp=/\u0000|\uFFFD/g;function l0(e){return(typeof e=="string"?e:""+e).replace(hp,`
|
|
9
|
-
`).replace(mp,"")}function a0(e,t){return t=l0(t),l0(e)===t}function tt(e,t,n,l,i,u){switch(n){case"children":typeof l=="string"?t==="body"||t==="textarea"&&l===""||ul(e,l):(typeof l=="number"||typeof l=="bigint")&&t!=="body"&&ul(e,""+l);break;case"className":Rl(e,"class",l);break;case"tabIndex":Rl(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":Rl(e,n,l);break;case"style":si(e,l,u);break;case"data":if(t!=="object"){Rl(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=ba(""+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 u=="function"&&(n==="formAction"?(t!=="input"&&tt(e,t,"name",i.name,i,null),tt(e,t,"formEncType",i.formEncType,i,null),tt(e,t,"formMethod",i.formMethod,i,null),tt(e,t,"formTarget",i.formTarget,i,null)):(tt(e,t,"encType",i.encType,i,null),tt(e,t,"method",i.method,i,null),tt(e,t,"target",i.target,i,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(n);break}l=ba(""+l),e.setAttribute(n,l);break;case"onClick":l!=null&&(e.onclick=Rn);break;case"onScroll":l!=null&&Be("scroll",e);break;case"onScrollEnd":l!=null&&Be("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=ba(""+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":Be("beforetoggle",e),Be("toggle",e),ga(e,"popover",l);break;case"xlinkActuate":Gt(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Gt(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Gt(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Gt(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Gt(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Gt(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Gt(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Gt(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Gt(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":ga(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=su.get(n)||n,ga(e,n,l))}}function Tc(e,t,n,l,i,u){switch(n){case"style":si(e,l,u);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"?ul(e,l):(typeof l=="number"||typeof l=="bigint")&&ul(e,""+l);break;case"onScroll":l!=null&&Be("scroll",e);break;case"onScrollEnd":l!=null&&Be("scrollend",e);break;case"onClick":l!=null&&(e.onclick=Rn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Vi.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(i=n.endsWith("Capture"),t=n.slice(2,i?n.length-7:void 0),u=e[Oe]||null,u=u!=null?u[n]:null,typeof u=="function"&&e.removeEventListener(t,u,i),typeof l=="function")){typeof u!="function"&&u!==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,""):ga(e,n,l)}}}function Ot(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Be("error",e),Be("load",e);var l=!1,i=!1,u;for(u in n)if(n.hasOwnProperty(u)){var d=n[u];if(d!=null)switch(u){case"src":l=!0;break;case"srcSet":i=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,t));default:tt(e,t,u,d,n,null)}}i&&tt(e,t,"srcSet",n.srcSet,n,null),l&&tt(e,t,"src",n.src,n,null);return;case"input":Be("invalid",e);var p=u=d=i=null,E=null,_=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":d=K;break;case"checked":E=K;break;case"defaultChecked":_=K;break;case"value":u=K;break;case"defaultValue":p=K;break;case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(r(137,t));break;default:tt(e,t,l,K,n,null)}}zn(e,u,p,E,_,d,i,!1);return;case"select":Be("invalid",e),l=d=u=null;for(i in n)if(n.hasOwnProperty(i)&&(p=n[i],p!=null))switch(i){case"value":u=p;break;case"defaultValue":d=p;break;case"multiple":l=p;default:tt(e,t,i,p,n,null)}t=u,n=d,e.multiple=!!l,t!=null?Kn(e,!!l,t,!1):n!=null&&Kn(e,!!l,n,!0);return;case"textarea":Be("invalid",e),u=i=l=null;for(d in n)if(n.hasOwnProperty(d)&&(p=n[d],p!=null))switch(d){case"value":l=p;break;case"defaultValue":i=p;break;case"children":u=p;break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(r(91));break;default:tt(e,t,d,p,n,null)}ii(e,l,i,u);return;case"option":for(E in n)n.hasOwnProperty(E)&&(l=n[E],l!=null)&&(E==="selected"?e.selected=l&&typeof l!="function"&&typeof l!="symbol":tt(e,t,E,l,n,null));return;case"dialog":Be("beforetoggle",e),Be("toggle",e),Be("cancel",e),Be("close",e);break;case"iframe":case"object":Be("load",e);break;case"video":case"audio":for(l=0;l<$s.length;l++)Be($s[l],e);break;case"image":Be("error",e),Be("load",e);break;case"details":Be("toggle",e);break;case"embed":case"source":case"link":Be("error",e),Be("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(_ in n)if(n.hasOwnProperty(_)&&(l=n[_],l!=null))switch(_){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,t));default:tt(e,t,_,l,n,null)}return;default:if(ui(t)){for(K in n)n.hasOwnProperty(K)&&(l=n[K],l!==void 0&&Tc(e,t,K,l,n,void 0));return}}for(p in n)n.hasOwnProperty(p)&&(l=n[p],l!=null&&tt(e,t,p,l,n,null))}function pp(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,u=null,d=null,p=null,E=null,_=null,K=null;for(G in n){var J=n[G];if(n.hasOwnProperty(G)&&J!=null)switch(G){case"checked":break;case"value":break;case"defaultValue":E=J;default:l.hasOwnProperty(G)||tt(e,t,G,null,l,J)}}for(var B in l){var G=l[B];if(J=n[B],l.hasOwnProperty(B)&&(G!=null||J!=null))switch(B){case"type":u=G;break;case"name":i=G;break;case"checked":_=G;break;case"defaultChecked":K=G;break;case"value":d=G;break;case"defaultValue":p=G;break;case"children":case"dangerouslySetInnerHTML":if(G!=null)throw Error(r(137,t));break;default:G!==J&&tt(e,t,B,G,l,J)}}ai(e,d,p,E,_,K,u,i);return;case"select":G=d=p=B=null;for(u in n)if(E=n[u],n.hasOwnProperty(u)&&E!=null)switch(u){case"value":break;case"multiple":G=E;default:l.hasOwnProperty(u)||tt(e,t,u,null,l,E)}for(i in l)if(u=l[i],E=n[i],l.hasOwnProperty(i)&&(u!=null||E!=null))switch(i){case"value":B=u;break;case"defaultValue":p=u;break;case"multiple":d=u;default:u!==E&&tt(e,t,i,u,l,E)}t=p,n=d,l=G,B!=null?Kn(e,!!n,B,!1):!!l!=!!n&&(t!=null?Kn(e,!!n,t,!0):Kn(e,!!n,n?[]:"",!1));return;case"textarea":G=B=null;for(p in n)if(i=n[p],n.hasOwnProperty(p)&&i!=null&&!l.hasOwnProperty(p))switch(p){case"value":break;case"children":break;default:tt(e,t,p,null,l,i)}for(d in l)if(i=l[d],u=n[d],l.hasOwnProperty(d)&&(i!=null||u!=null))switch(d){case"value":B=i;break;case"defaultValue":G=i;break;case"children":break;case"dangerouslySetInnerHTML":if(i!=null)throw Error(r(91));break;default:i!==u&&tt(e,t,d,i,l,u)}Ol(e,B,G);return;case"option":for(var ve in n)B=n[ve],n.hasOwnProperty(ve)&&B!=null&&!l.hasOwnProperty(ve)&&(ve==="selected"?e.selected=!1:tt(e,t,ve,null,l,B));for(E in l)B=l[E],G=n[E],l.hasOwnProperty(E)&&B!==G&&(B!=null||G!=null)&&(E==="selected"?e.selected=B&&typeof B!="function"&&typeof B!="symbol":tt(e,t,E,B,l,G));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 Me in n)B=n[Me],n.hasOwnProperty(Me)&&B!=null&&!l.hasOwnProperty(Me)&&tt(e,t,Me,null,l,B);for(_ in l)if(B=l[_],G=n[_],l.hasOwnProperty(_)&&B!==G&&(B!=null||G!=null))switch(_){case"children":case"dangerouslySetInnerHTML":if(B!=null)throw Error(r(137,t));break;default:tt(e,t,_,B,l,G)}return;default:if(ui(t)){for(var nt in n)B=n[nt],n.hasOwnProperty(nt)&&B!==void 0&&!l.hasOwnProperty(nt)&&Tc(e,t,nt,void 0,l,B);for(K in l)B=l[K],G=n[K],!l.hasOwnProperty(K)||B===G||B===void 0&&G===void 0||Tc(e,t,K,B,l,G);return}}for(var D in n)B=n[D],n.hasOwnProperty(D)&&B!=null&&!l.hasOwnProperty(D)&&tt(e,t,D,null,l,B);for(J in l)B=l[J],G=n[J],!l.hasOwnProperty(J)||B===G||B==null&&G==null||tt(e,t,J,B,l,G)}function i0(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function gp(){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],u=i.transferSize,d=i.initiatorType,p=i.duration;if(u&&p&&i0(d)){for(d=0,p=i.responseEnd,l+=1;l<n.length;l++){var E=n[l],_=E.startTime;if(_>p)break;var K=E.transferSize,J=E.initiatorType;K&&i0(J)&&(E=E.responseEnd,d+=K*(E<p?1:(p-_)/(E-_)))}if(--l,t+=8*(u+d)/(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 Dc=null,kc=null;function ro(e){return e.nodeType===9?e:e.ownerDocument}function s0(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 u0(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 zc(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 Rc=null;function yp(){var e=window.event;return e&&e.type==="popstate"?e===Rc?!1:(Rc=e,!0):(Rc=null,!1)}var o0=typeof setTimeout=="function"?setTimeout:void 0,xp=typeof clearTimeout=="function"?clearTimeout:void 0,r0=typeof Promise=="function"?Promise:void 0,vp=typeof queueMicrotask=="function"?queueMicrotask:typeof r0<"u"?function(e){return r0.resolve(null).then(e).catch(bp)}:o0;function bp(e){setTimeout(function(){throw e})}function aa(e){return e==="head"}function c0(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),Yi(t);return}l--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")l++;else if(n==="html")Gs(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,Gs(n);for(var u=n.firstChild;u;){var d=u.nextSibling,p=u.nodeName;u[il]||p==="SCRIPT"||p==="STYLE"||p==="LINK"&&u.rel.toLowerCase()==="stylesheet"||n.removeChild(u),u=d}}else n==="body"&&Gs(e.ownerDocument.body);n=i}while(n);Yi(t)}function f0(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 Oc(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":Oc(n),Vn(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function wp(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[il])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(u=e.getAttribute("rel"),u==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(u!==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(u=e.getAttribute("src"),(u!==(i.src==null?null:i.src)||e.getAttribute("type")!==(i.type==null?null:i.type)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin))&&u&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var u=i.name==null?null:""+i.name;if(i.type==="hidden"&&e.getAttribute("name")===u)return e}else return e;if(e=Nn(e.nextSibling),e===null)break}return null}function Sp(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Nn(e.nextSibling),e===null))return null;return e}function d0(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Nn(e.nextSibling),e===null))return null;return e}function _c(e){return e.data==="$?"||e.data==="$~"}function Lc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function jp(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 Nn(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 Bc=null;function h0(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return Nn(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function m0(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 p0(e,t,n){switch(t=ro(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 Gs(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Vn(e)}var An=new Map,g0=new Set;function co(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Cl=I.d;I.d={f:Ep,r:Cp,D:Mp,C:Np,L:Ap,m:Tp,X:kp,S:Dp,M:zp};function Ep(){var e=Cl.f(),t=to();return e||t}function Cp(e){var t=kl(e);t!==null&&t.tag===5&&t.type==="form"?Rd(t):Cl.r(e)}var Hi=typeof document>"u"?null:document;function y0(e,t,n){var l=Hi;if(l&&typeof t=="string"&&t){var i=Dt(t);i='link[rel="'+e+'"][href="'+i+'"]',typeof n=="string"&&(i+='[crossorigin="'+n+'"]'),g0.has(i)||(g0.add(i),e={rel:e,crossOrigin:n,href:t},l.querySelector(i)===null&&(t=l.createElement("link"),Ot(t,"link",e),yt(t),l.head.appendChild(t)))}}function Mp(e){Cl.D(e),y0("dns-prefetch",e,null)}function Np(e,t){Cl.C(e,t),y0("preconnect",e,t)}function Ap(e,t,n){Cl.L(e,t,n);var l=Hi;if(l&&e&&t){var i='link[rel="preload"][as="'+Dt(t)+'"]';t==="image"&&n&&n.imageSrcSet?(i+='[imagesrcset="'+Dt(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(i+='[imagesizes="'+Dt(n.imageSizes)+'"]')):i+='[href="'+Dt(e)+'"]';var u=i;switch(t){case"style":u=qi(e);break;case"script":u=$i(e)}An.has(u)||(e=C({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),An.set(u,e),l.querySelector(i)!==null||t==="style"&&l.querySelector(Xs(u))||t==="script"&&l.querySelector(Qs(u))||(t=l.createElement("link"),Ot(t,"link",e),yt(t),l.head.appendChild(t)))}}function Tp(e,t){Cl.m(e,t);var n=Hi;if(n&&e){var l=t&&typeof t.as=="string"?t.as:"script",i='link[rel="modulepreload"][as="'+Dt(l)+'"][href="'+Dt(e)+'"]',u=i;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=$i(e)}if(!An.has(u)&&(e=C({rel:"modulepreload",href:e},t),An.set(u,e),n.querySelector(i)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Qs(u)))return}l=n.createElement("link"),Ot(l,"link",e),yt(l),n.head.appendChild(l)}}}function Dp(e,t,n){Cl.S(e,t,n);var l=Hi;if(l&&e){var i=Zn(l).hoistableStyles,u=qi(e);t=t||"default";var d=i.get(u);if(!d){var p={loading:0,preload:null};if(d=l.querySelector(Xs(u)))p.loading=5;else{e=C({rel:"stylesheet",href:e,"data-precedence":t},n),(n=An.get(u))&&Uc(e,n);var E=d=l.createElement("link");yt(E),Ot(E,"link",e),E._p=new Promise(function(_,K){E.onload=_,E.onerror=K}),E.addEventListener("load",function(){p.loading|=1}),E.addEventListener("error",function(){p.loading|=2}),p.loading|=4,fo(d,t,l)}d={type:"stylesheet",instance:d,count:1,state:p},i.set(u,d)}}}function kp(e,t){Cl.X(e,t);var n=Hi;if(n&&e){var l=Zn(n).hoistableScripts,i=$i(e),u=l.get(i);u||(u=n.querySelector(Qs(i)),u||(e=C({src:e,async:!0},t),(t=An.get(i))&&Hc(e,t),u=n.createElement("script"),yt(u),Ot(u,"link",e),n.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},l.set(i,u))}}function zp(e,t){Cl.M(e,t);var n=Hi;if(n&&e){var l=Zn(n).hoistableScripts,i=$i(e),u=l.get(i);u||(u=n.querySelector(Qs(i)),u||(e=C({src:e,async:!0,type:"module"},t),(t=An.get(i))&&Hc(e,t),u=n.createElement("script"),yt(u),Ot(u,"link",e),n.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},l.set(i,u))}}function x0(e,t,n,l){var i=(i=Ce.current)?co(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=qi(n.href),n=Zn(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=qi(n.href);var u=Zn(i).hoistableStyles,d=u.get(e);if(d||(i=i.ownerDocument||i,d={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,d),(u=i.querySelector(Xs(e)))&&!u._p&&(d.instance=u,d.state.loading=5),An.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},An.set(e,n),u||Rp(i,e,n,d.state))),t&&l===null)throw Error(r(528,""));return d}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=$i(n),n=Zn(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 qi(e){return'href="'+Dt(e)+'"'}function Xs(e){return'link[rel="stylesheet"]['+e+"]"}function v0(e){return C({},e,{"data-precedence":e.precedence,precedence:null})}function Rp(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}),Ot(t,"link",n),yt(t),e.head.appendChild(t))}function $i(e){return'[src="'+Dt(e)+'"]'}function Qs(e){return"script[async]"+e}function b0(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+Dt(n.href)+'"]');if(l)return t.instance=l,yt(l),l;var i=C({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),yt(l),Ot(l,"style",i),fo(l,n.precedence,e),t.instance=l;case"stylesheet":i=qi(n.href);var u=e.querySelector(Xs(i));if(u)return t.state.loading|=4,t.instance=u,yt(u),u;l=v0(n),(i=An.get(i))&&Uc(l,i),u=(e.ownerDocument||e).createElement("link"),yt(u);var d=u;return d._p=new Promise(function(p,E){d.onload=p,d.onerror=E}),Ot(u,"link",l),t.state.loading|=4,fo(u,n.precedence,e),t.instance=u;case"script":return u=$i(n.src),(i=e.querySelector(Qs(u)))?(t.instance=i,yt(i),i):(l=n,(i=An.get(u))&&(l=C({},n),Hc(l,i)),e=e.ownerDocument||e,i=e.createElement("script"),yt(i),Ot(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,fo(l,n.precedence,e));return t.instance}function fo(e,t,n){for(var l=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=l.length?l[l.length-1]:null,u=i,d=0;d<l.length;d++){var p=l[d];if(p.dataset.precedence===t)u=p;else if(u!==i)break}u?u.parentNode.insertBefore(e,u.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Uc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Hc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var ho=null;function w0(e,t,n){if(ho===null){var l=new Map,i=ho=new Map;i.set(n,l)}else i=ho,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 u=n[i];if(!(u[il]||u[Ze]||e==="link"&&u.getAttribute("rel")==="stylesheet")&&u.namespaceURI!=="http://www.w3.org/2000/svg"){var d=u.getAttribute(t)||"";d=e+d;var p=l.get(d);p?p.push(u):l.set(d,[u])}}return l}function S0(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function Op(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 j0(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function _p(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=qi(l.href),u=t.querySelector(Xs(i));if(u){t=u._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=mo.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=u,yt(u);return}u=t.ownerDocument||t,l=v0(l),(i=An.get(i))&&Uc(l,i),u=u.createElement("link"),yt(u);var d=u;d._p=new Promise(function(p,E){d.onload=p,d.onerror=E}),Ot(u,"link",l),n.instance=u}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=mo.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var qc=0;function Lp(e,t){return e.stylesheets&&e.count===0&&go(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var l=setTimeout(function(){if(e.stylesheets&&go(e,e.stylesheets),e.unsuspend){var u=e.unsuspend;e.unsuspend=null,u()}},6e4+t);0<e.imgBytes&&qc===0&&(qc=62500*gp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&go(e,e.stylesheets),e.unsuspend)){var u=e.unsuspend;e.unsuspend=null,u()}},(e.imgBytes>qc?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(i)}}:null}function mo(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)go(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var po=null;function go(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,po=new Map,t.forEach(Bp,e),po=null,mo.call(e))}function Bp(e,t){if(!(t.state.loading&4)){var n=po.get(e);if(n)var l=n.get(null);else{n=new Map,po.set(e,n);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u<i.length;u++){var d=i[u];(d.nodeName==="LINK"||d.getAttribute("media")!=="not all")&&(n.set(d.dataset.precedence,d),l=d)}l&&n.set(null,l)}i=t.instance,d=i.getAttribute("data-precedence"),u=n.get(d)||l,u===l&&n.set(null,i),n.set(d,i),this.count++,l=mo.bind(this),i.addEventListener("load",l),i.addEventListener("error",l),u?u.parentNode.insertBefore(i,u.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Vs={$$typeof:H,Provider:null,Consumer:null,_currentValue:se,_currentValue2:se,_threadCount:0};function Up(e,t,n,l,i,u,d,p,E){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=Xn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Xn(0),this.hiddenUpdates=Xn(null),this.identifierPrefix=l,this.onUncaughtError=i,this.onCaughtError=u,this.onRecoverableError=d,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=E,this.incompleteTransitions=new Map}function E0(e,t,n,l,i,u,d,p,E,_,K,J){return e=new Up(e,t,n,d,E,_,K,J,p),t=1,u===!0&&(t|=24),u=fn(3,null,null,t),e.current=u,u.stateNode=e,t=vr(),t.refCount++,e.pooledCache=t,t.refCount++,u.memoizedState={element:l,isDehydrated:n,cache:t},jr(u),e}function C0(e){return e?(e=xi,e):xi}function M0(e,t,n,l,i,u){i=C0(i),l.context===null?l.context=i:l.pendingContext=i,l=Zl(t),l.payload={element:n},u=u===void 0?null:u,u!==null&&(l.callback=u),n=Kl(e,l,t),n!==null&&(nn(n,e,t),Es(n,e,t))}function N0(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function $c(e,t){N0(e,t),(e=e.alternate)&&N0(e,t)}function A0(e){if(e.tag===13||e.tag===31){var t=Ta(e,67108864);t!==null&&nn(t,e,67108864),$c(e,67108864)}}function T0(e){if(e.tag===13||e.tag===31){var t=gn();t=de(t);var n=Ta(e,t);n!==null&&nn(n,e,t),$c(e,t)}}var yo=!0;function Hp(e,t,n,l){var i=L.T;L.T=null;var u=I.p;try{I.p=2,Yc(e,t,n,l)}finally{I.p=u,L.T=i}}function qp(e,t,n,l){var i=L.T;L.T=null;var u=I.p;try{I.p=8,Yc(e,t,n,l)}finally{I.p=u,L.T=i}}function Yc(e,t,n,l){if(yo){var i=Gc(l);if(i===null)Ac(e,t,l,xo,n),k0(e,l);else if(Yp(i,e,t,n,l))l.stopPropagation();else if(k0(e,l),t&4&&-1<$p.indexOf(e)){for(;i!==null;){var u=kl(i);if(u!==null)switch(u.tag){case 3:if(u=u.stateNode,u.current.memoizedState.isDehydrated){var d=_t(u.pendingLanes);if(d!==0){var p=u;for(p.pendingLanes|=2,p.entangledLanes|=2;d;){var E=1<<31-Tt(d);p.entanglements[1]|=E,d&=~E}el(u),(Ke&6)===0&&(Pu=dt()+500,qs(0))}}break;case 31:case 13:p=Ta(u,2),p!==null&&nn(p,u,2),to(),$c(u,2)}if(u=Gc(l),u===null&&Ac(e,t,l,xo,n),u===i)break;i=u}i!==null&&l.stopPropagation()}else Ac(e,t,l,null,n)}}function Gc(e){return e=Ii(e),Xc(e)}var xo=null;function Xc(e){if(xo=null,e=Dl(e),e!==null){var t=h(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=g(t),e!==null)return e;e=null}else if(n===31){if(e=x(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 xo=e,null}function D0(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($t()){case sn:return 2;case Yn:return 8;case Ml:case Ja:return 32;case Nl:return 268435456;default:return 32}default:return 32}}var Qc=!1,ia=null,sa=null,ua=null,Zs=new Map,Ks=new Map,oa=[],$p="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 k0(e,t){switch(e){case"focusin":case"focusout":ia=null;break;case"dragenter":case"dragleave":sa=null;break;case"mouseover":case"mouseout":ua=null;break;case"pointerover":case"pointerout":Zs.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ks.delete(t.pointerId)}}function Fs(e,t,n,l,i,u){return e===null||e.nativeEvent!==u?(e={blockedOn:t,domEventName:n,eventSystemFlags:l,nativeEvent:u,targetContainers:[i]},t!==null&&(t=kl(t),t!==null&&A0(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Yp(e,t,n,l,i){switch(t){case"focusin":return ia=Fs(ia,e,t,n,l,i),!0;case"dragenter":return sa=Fs(sa,e,t,n,l,i),!0;case"mouseover":return ua=Fs(ua,e,t,n,l,i),!0;case"pointerover":var u=i.pointerId;return Zs.set(u,Fs(Zs.get(u)||null,e,t,n,l,i)),!0;case"gotpointercapture":return u=i.pointerId,Ks.set(u,Fs(Ks.get(u)||null,e,t,n,l,i)),!0}return!1}function z0(e){var t=Dl(e.target);if(t!==null){var n=h(t);if(n!==null){if(t=n.tag,t===13){if(t=g(n),t!==null){e.blockedOn=t,ce(e.priority,function(){T0(n)});return}}else if(t===31){if(t=x(n),t!==null){e.blockedOn=t,ce(e.priority,function(){T0(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 vo(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Gc(e.nativeEvent);if(n===null){n=e.nativeEvent;var l=new n.constructor(n.type,n);Wi=l,n.target.dispatchEvent(l),Wi=null}else return t=kl(n),t!==null&&A0(t),e.blockedOn=n,!1;t.shift()}return!0}function R0(e,t,n){vo(e)&&n.delete(t)}function Gp(){Qc=!1,ia!==null&&vo(ia)&&(ia=null),sa!==null&&vo(sa)&&(sa=null),ua!==null&&vo(ua)&&(ua=null),Zs.forEach(R0),Ks.forEach(R0)}function bo(e,t){e.blockedOn===t&&(e.blockedOn=null,Qc||(Qc=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,Gp)))}var wo=null;function O0(e){wo!==e&&(wo=e,a.unstable_scheduleCallback(a.unstable_NormalPriority,function(){wo===e&&(wo=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(Xc(l||n)===null)continue;break}var u=kl(n);u!==null&&(e.splice(t,3),t-=3,Gr(u,{pending:!0,data:i,method:n.method,action:l},l,i))}}))}function Yi(e){function t(E){return bo(E,e)}ia!==null&&bo(ia,e),sa!==null&&bo(sa,e),ua!==null&&bo(ua,e),Zs.forEach(t),Ks.forEach(t);for(var n=0;n<oa.length;n++){var l=oa[n];l.blockedOn===e&&(l.blockedOn=null)}for(;0<oa.length&&(n=oa[0],n.blockedOn===null);)z0(n),n.blockedOn===null&&oa.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(l=0;l<n.length;l+=3){var i=n[l],u=n[l+1],d=i[Oe]||null;if(typeof u=="function")d||O0(n);else if(d){var p=null;if(u&&u.hasAttribute("formAction")){if(i=u,d=u[Oe]||null)p=d.formAction;else if(Xc(i)!==null)continue}else p=d.action;typeof p=="function"?n[l+1]=p:(n.splice(l,3),l-=3),O0(n)}}}function _0(){function e(u){u.canIntercept&&u.info==="react-transition"&&u.intercept({handler:function(){return new Promise(function(d){return i=d})},focusReset:"manual",scroll:"manual"})}function t(){i!==null&&(i(),i=null),l||setTimeout(n,20)}function n(){if(!l&&!navigation.transition){var u=navigation.currentEntry;u&&u.url!=null&&navigation.navigate(u.url,{state:u.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 Vc(e){this._internalRoot=e}So.prototype.render=Vc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(r(409));var n=t.current,l=gn();M0(n,l,e,t,null,null)},So.prototype.unmount=Vc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;M0(e.current,2,null,e,null,null),to(),t[ot]=null}};function So(e){this._internalRoot=e}So.prototype.unstable_scheduleHydration=function(e){if(e){var t=_e();e={blockedOn:null,target:e,priority:t};for(var n=0;n<oa.length&&t!==0&&t<oa[n].priority;n++);oa.splice(n,0,e),n===0&&z0(e)}};var L0=s.version;if(L0!=="19.2.8")throw Error(r(527,L0,"19.2.8"));I.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=y(t),e=e!==null?w(e):null,e=e===null?null:e.stateNode,e};var Xp={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:L,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var jo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!jo.isDisabled&&jo.supportsFiber)try{kn=jo.inject(Xp),At=jo}catch{}}return Ws.createRoot=function(e,t){if(!f(e))throw Error(r(299));var n=!1,l="",i=Gd,u=Xd,d=Qd;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&&(u=t.onCaughtError),t.onRecoverableError!==void 0&&(d=t.onRecoverableError)),t=E0(e,1,!1,null,null,n,l,null,i,u,d,_0),e[ot]=t.current,Nc(e),new Vc(t)},Ws.hydrateRoot=function(e,t,n){if(!f(e))throw Error(r(299));var l=!1,i="",u=Gd,d=Xd,p=Qd,E=null;return n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onUncaughtError!==void 0&&(u=n.onUncaughtError),n.onCaughtError!==void 0&&(d=n.onCaughtError),n.onRecoverableError!==void 0&&(p=n.onRecoverableError),n.formState!==void 0&&(E=n.formState)),t=E0(e,1,!0,t,n??null,l,i,E,u,d,p,_0),t.context=C0(null),n=t.current,l=gn(),l=de(l),i=Zl(l),i.callback=null,Kl(n,i,l),n=l,t.current.lanes=n,Qn(t,n),el(t),e[ot]=t.current,Nc(e),new So(t)},Ws.version="19.2.8",Ws}var V0;function Pp(){if(V0)return Fc.exports;V0=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(),Fc.exports=Ip(),Fc.exports}var eg=Pp(),Y1=$1();function Pc(a,s,c){return a+(s-a)*c}function G1(a){return a-Math.floor(a)}function ef(a,s){const c=Math.floor(a),r=Math.floor(s);let f=a-c,h=s-r;f=f*f*(3-2*f),h=h*h*(3-2*h);const g=Tn(c,r),x=Tn(c+1,r),v=Tn(c,r+1),y=Tn(c+1,r+1);return g+(x-g)*f+(v-g)*h+(g-x-v+y)*f*h}function Tn(a,s){const c=Math.sin(a*12.9898+s*78.233)*43758.5453;return c-Math.floor(c)}function Sf(a,s){const c=Math.PI*(3-Math.sqrt(5)),r=1-2*(a+.5)/s,f=Math.sqrt(1-r*r),h=a*c;return[f*Math.cos(h),r,f*Math.sin(h)]}function tg(a,s){return Math.atan2(Math.sin(a-s),Math.cos(a-s))}function Qa(a,s,c,r,f){const h=Math.sin(s),g=Math.cos(s),x=Math.sin(a),v=Math.cos(a);return(y,w,C)=>{const T=y*v+C*x,k=-y*x+C*v,M=w*g-k*h,Y=w*h+k*g;return[c+T*f,r-M*f,Y]}}function ha(a,s,c,r=.3){s.sort((f,h)=>f.z-h.z);for(const f of s){const h=f.a??1;if(h<.02)continue;const g=Math.min(1,Math.max(0,f.white)),x=Math.round((c?1-g:g)*255);a.fillStyle=`rgba(${x},${x},${x},${h})`,a.beginPath(),a.arc(f.x,f.y,Math.max(r,f.r),0,Math.PI*2),a.fill()}}function ng(a,s,c){for(const r of s){const f=r.a??1;if(f<.02)continue;const h=Math.min(1,Math.max(0,r.white)),g=Math.round((c?1-h:h)*255);a.strokeStyle=`rgba(${g},${g},${g},${f})`,a.lineWidth=r.w,a.beginPath(),a.moveTo(r.x1,r.y1),a.lineTo(r.x2,r.y2),a.stroke()}}function Va(a,s){return(a/300)**s}const lg=(a,s,c,r,f)=>{const h=s/2,g=s/2,x=s/2*.76,v=Qa(c*.4,.3,h,g,1),y=Va(s,f.rsPow??.6),w=[],C=f.ghostN??150;for(let M=0;M<C;M++){const Y=Sf(M,C),[q,z,V]=v(Y[0]*x,Y[1]*x,Y[2]*x),H=(V/x+1)/2;w.push({x:q,y:z,z:V,r:.8*y,white:.78,a:.1+.22*H})}const T=f.strandN??52,k=f.turns??3;for(let M=0;M<3;M++){const Y=M/3*2*Math.PI;for(let q=0;q<T;q++){const z=(G1(q/T+c*.045)*2-1)*.96,V=Math.sqrt(Math.max(0,1-z*z)),H=Math.min(1,(1-Math.abs(z))/.1),W=z*Math.PI*k+Y,ee=1+.075*Math.sin(z*Math.PI*k*2+Y*2+c*.8),ne=V*x*ee,[b,te,ue]=v(Math.cos(W)*ne,z*x*ee,Math.sin(W)*ne),P=(ue/x+1)/2;w.push({x:b,y:te,z:ue,r:((f.rBase??1.2)+(f.rDepth??1.8)*P)*y,white:.55-.45*P,a:H*(.45+.55*P)})}}ha(a,w,r,f.rMin)};function ag(a,s,c,r){const f=2*s*c+r,h=a%f,g=new Array(s).fill(0);let x=-1;if(h<2*s*c){const v=Math.floor(h/c),y=(h-v*c)/c,w=1-(1-Math.min(1,y/.7))**3;if(v<s){for(let C=0;C<v;C++)g[C]=1;g[v]=w,x=v}else{const C=2*s-1-v;for(let T=0;T<C;T++)g[T]=1;g[C]=1-w,x=C}}return{amount:g,active:x}}function ig(a,s,c){let[r,f,h]=a,g=!1;for(let x=0;x<s.length;x++){if(c.amount[x]<=0)continue;const v=s[x],y=v.axis===0?r:v.axis===1?f:h;if(y<v.lo||y>=v.hi)continue;x===c.active&&(g=!0);const w=v.ang*c.amount[x],C=Math.cos(w),T=Math.sin(w);if(v.axis===0){const k=f*C-h*T;h=f*T+h*C,f=k}else if(v.axis===1){const k=r*C+h*T;h=-r*T+h*C,r=k}else{const k=r*C-f*T;f=r*T+f*C,r=k}}return[r,f,h,g]}function sg(a){const s=[];for(let c=0;c<a;c++){const r=Math.min(2,Math.floor(Tn(c,2.3)*3)),f=-1+.5*Math.min(3,Math.floor(Tn(c,5.9)*4)),h=Tn(c,7.7)<.5?1:-1;s.push({axis:r,lo:f,hi:f+.5,ang:h*Math.PI/2})}return s}const ug=(a,s,c,r,f)=>{const h=s/2,g=s/2,x=s/2*.82,v=.4+.06*Math.sin(c*.35),y=Qa(c*.5,v,h,g,x),w=c*(.5+(1.7-.5)*(f.scanMul??1)),C=Va(s,f.rsPow??.6),T=f.dimBase??1,k=[],M=f.latRings??17,Y=f.lonDensity??44;for(let q=0;q<=M;q++){const z=-Math.PI/2+q/M*Math.PI,V=Math.cos(z),H=Math.sin(z),W=Math.max(1,Math.round(Math.abs(V)*Y));for(let ee=0;ee<W;ee++){const ne=ee/W*2*Math.PI,[b,te,ue]=y(V*Math.cos(ne),H,V*Math.sin(ne)),P=(ue+1)/2,he=tg(ne+c*.5,w),re=Math.exp(-(he*he)/.18)*Math.max(0,ue);k.push({x:b,y:te,z:ue,r:((f.rBase??.6)+(f.rDepth??1.7)*P+(f.rBoost??1)*re)*C,white:(f.inkFar??.62)-(f.inkSpan??.54)*P,a:T+(1-T)*Math.min(1,re)})}}ha(a,k,r,f.rMin)},og=(a,s,c,r,f)=>{const h=s/2,g=s/2,x=s/2*.82,v=Qa(c*.55,.35+.1*Math.sin(c*.9),h,g,x),y=Va(s,f.rsPow??.6),w=f.moveCount??14,C=sg(w),T=ag(c,w,.42,1.2),k=[],M=f.latRings??15,Y=f.lonDensity??40;for(let q=0;q<=M;q++){const z=-Math.PI/2+q/M*Math.PI,V=Math.cos(z),H=Math.sin(z),W=Math.max(1,Math.round(Math.abs(V)*Y));for(let ee=0;ee<W;ee++){const ne=ee/W*2*Math.PI,[b,te,ue,P]=ig([V*Math.cos(ne),H,V*Math.sin(ne)],C,T),[he,re,Ee]=v(b,te,ue),we=(Ee+1)/2;k.push({x:he,y:re,z:Ee,r:((f.rBase??.6)+(f.rDepth??1.7)*we+(P?f.rActive??.3:0))*y,white:(f.inkFar??.62)-(f.inkSpan??.54)*we-(P?.14:0)})}}ha(a,k,r,f.rMin)},rg=(a,s,c,r,f)=>{const h=s/2,g=s/2,x=s/2*.874,v=Qa(c*.18,.38,h,g,1),y=Va(s,f.rsPow??.6),w=[],C=f.rings??15,T=f.lonDensity??40;for(let k=0;k<=C;k++){const M=-Math.PI/2+k/C*Math.PI,Y=Math.cos(M),q=Math.sin(M),z=.62*Math.sin(c*2.1-k*.52)+.38*Math.sin(c*1.27+k*.83),V=x*(.88+.105*z),H=Math.max(1,Math.round(Math.abs(Y)*T));for(let W=0;W<H;W++){const ee=W/H*2*Math.PI,[ne,b,te]=v(Y*Math.cos(ee)*V,q*V,Y*Math.sin(ee)*V),ue=(te/x+1)/2,P=Math.max(0,z);w.push({x:ne,y:b,z:te,r:((f.rBase??.6)+(f.rDepth??1.7)*ue)*(1+.4*P)*y,white:.66-.56*ue-.1*P})}}ha(a,w,r,f.rMin)};function cg(a){return a*a*(3-2*a)}function X1(a){const s=a.length,c=[];let r=0;for(let f=0;f<s;f++){const h=a[f],g=a[(f+1)%s],x=Math.hypot(g[0]-h[0],g[1]-h[1]);c.push(x),r+=x}return f=>{let h=f*r,g=0;for(;h>c[g]&&g<s-1;)h-=c[g],g++;const x=a[g],v=a[(g+1)%s],y=c[g]?Math.min(1,h/c[g]):0;return[x[0]+(v[0]-x[0])*y,x[1]+(v[1]-x[1])*y]}}const fg=a=>{const s=-Math.PI/2+a*2*Math.PI;return[Math.cos(s)*.24,Math.sin(s)*.24]},dg=X1([[0,-.26],[.24,.16],[-.24,.16]]),hg=X1([[0,-.2],[.2,-.2],[.2,.2],[-.2,.2],[-.2,-.2]]),tf=[fg,dg,hg];function mg(a){return Math.max(6,Math.round(34*a))}const hf=1.4,Q1=.9,nf=hf+Q1,pg=(a,s,c,r,f)=>{const h=tf.length,g=c%(nf*h),x=Math.floor(g/nf),v=g-x*nf,y=v>hf?cg((v-hf)/Q1):0,w=f.spread??1,C=tf[x],T=tf[(x+1)%h],k=160,M=[];for(let te=0;te<k;te++){const ue=te/k,P=C(ue),he=T(ue);M.push([(P[0]+(he[0]-P[0])*y)*w,(P[1]+(he[1]-P[1])*y)*w])}const Y=[];let q=0;for(let te=0;te<k;te++){const ue=M[te],P=M[(te+1)%k],he=Math.hypot(P[0]-ue[0],P[1]-ue[1]);Y.push(he),q+=he}const z=mg(f.iconD??1),V=(f.rDot??.021)*1.35*w,H=1+.02*Math.sin(v*3.1),W=[],ee=s/2;let ne=0,b=0;for(let te=0;te<z;te++){const ue=te/z*q;for(;b+Y[ne]<ue&&ne<k-1;)b+=Y[ne],ne++;const P=M[ne],he=M[(ne+1)%k],re=Y[ne]?Math.min(1,(ue-b)/Y[ne]):0,Ee=(P[0]+(he[0]-P[0])*re)*H,we=(P[1]+(he[1]-P[1])*re)*H;W.push({x:ee+Ee*s,y:ee+we*s,z:0,r:Math.max(.35,V*s),white:.1})}ha(a,W,r,f.rMin)},gg=(a,s,c,r,f)=>{const h=s/2,g=s/2,x=s/2*.82,v=Qa(c*.12,.3,h,g,1),y=Va(s,f.rsPow??.6),w=[],C=f.orbitN??12,T=f.ghostN??40,k=f.particles??3;for(let M=0;M<C;M++){const Y=Tn(M,1.7),q=Tn(M,5.2),z=Tn(M,8.9),V=x*(.45+.52*Y),H=Y*2*Math.PI,W=Math.acos(2*q-1),ee=Math.sin(W)*Math.cos(H),ne=Math.cos(W),b=Math.sin(W)*Math.sin(H);let te=-ne,ue=ee;const P=0,he=Math.max(1e-6,Math.sqrt(te*te+ue*ue));te/=he,ue/=he;const re=ne*P-b*ue,Ee=b*te-ee*P,we=ee*ue-ne*te,Te=(.25+.55*z)*(z>.5?1:-1);for(let L=0;L<T;L++){const I=L/T*2*Math.PI,[se,Se,ye]=v((te*Math.cos(I)+re*Math.sin(I))*V,(ue*Math.cos(I)+Ee*Math.sin(I))*V,(P*Math.cos(I)+we*Math.sin(I))*V),j=(ye/V+1)/2;w.push({x:se,y:Se,z:ye,r:(f.ghostR??.9)*y,white:.72,a:(f.ghostA??.5)*(.4+.6*j)})}for(let L=0;L<k;L++){const I=c*Te+L/k*2*Math.PI+q*6,[se,Se,ye]=v((te*Math.cos(I)+re*Math.sin(I))*V,(ue*Math.cos(I)+Ee*Math.sin(I))*V,(P*Math.cos(I)+we*Math.sin(I))*V),j=(ye/V+1)/2;w.push({x:se,y:Se,z:ye,r:((f.partR??1.2)+(f.partRDepth??1.6)*j)*y,white:.3-.22*j})}}ha(a,w,r,f.rMin)},Z0=(a,s,c,r,f)=>{const h=s/2,g=s/2,x=s/2*.78,v=f.spin??1,y=.3,w=Qa(c*.1*v,y,h,g,1),C=Va(s,f.rsPow??.6),T=[],k=f.ghostN??150;for(let we=0;we<k;we++){const Te=Sf(we,k),[L,I,se]=w(Te[0]*x,Te[1]*x,Te[2]*x),Se=(se/x+1)/2;T.push({x:L,y:I,z:se,r:.8*C,white:.78,a:.1+.22*Se})}const M=c*.24*v,Y=f.faceOn?-y:.55+.3*Math.sin(c*.18)*v,q=Math.cos(M),z=0,V=Math.sin(M),H=-V*Math.sin(Y),W=Math.cos(Y),ee=q*Math.sin(Y),ne=z*ee-V*W,b=V*H-q*ee,te=q*W-z*H,ue=.23*(f.wobMul??1),P=f.faceOn?x/(1+.85*ue):x,he=f.lanes??5,re=f.segs??88,Ee=Math.max(1,Math.round(he*(f.bandMul??1)));for(let we=0;we<Ee;we++){const Te=(we-(Ee-1)/2)*.075,L=Math.abs(we-(Ee-1)/2)/Math.max(1,(Ee-1)/2);for(let I=0;I<re;I++){const se=I/re*2*Math.PI,Se=(.16*Math.sin(se*3-c*1.7+we*.22)+.07*Math.sin(se*5+c*1.1))*(f.wobMul??1),ye=f.faceOn?1+Se:1,j=f.faceOn?Te:Te+Se,U=q*Math.cos(se)+H*Math.sin(se)+ne*j,ae=z*Math.cos(se)+W*Math.sin(se)+b*j,oe=V*Math.cos(se)+ee*Math.sin(se)+te*j,pe=Math.sqrt(U*U+ae*ae+oe*oe),Ce=P*ye,[R,Z,ie]=w(U/pe*Ce,ae/pe*Ce,oe/pe*Ce),xe=(ie/x+1)/2;T.push({x:R,y:Z,z:ie,r:((f.rBase??1.1)+(f.rDepth??1.7)*xe)*(1-.25*L)*C,white:.52-.44*xe+.18*L,a:.4+.6*xe})}}ha(a,T,r,f.rMin)},yg=(a,s,c,r,f)=>{const h=s/2,g=s/2,x=s/2*.8*(f.spread??1),v=Qa(c*.12,.32,h,g,x),y=Va(s,f.rsPow??.6),w=f.nodeN??30,C=f.thr??.72,T=f.nodeR??1.4,k=f.nodeRDepth??1.8,M=[];for(let V=0;V<w;V++){const H=Sf(V,w),W=H[0]+.3*(ef(V*.31+9,c*.24)-.5)*2,ee=H[1]+.3*(ef(V*.53+27,c*.21)-.5)*2,ne=H[2]+.3*(ef(V*.77+55,c*.27)-.5)*2,b=Math.sqrt(W*W+ee*ee+ne*ne);M.push([W/b,ee/b,ne/b])}const Y=[],q=[];for(let V=0;V<w;V++)for(let H=V+1;H<w;H++){const W=M[V][0]-M[H][0],ee=M[V][1]-M[H][1],ne=M[V][2]-M[H][2],b=Math.sqrt(W*W+ee*ee+ne*ne);if(b>=C)continue;const[te,ue,P]=v(M[V][0],M[V][1],M[V][2]),[he,re,Ee]=v(M[H][0],M[H][1],M[H][2]),we=((P+Ee)/2+1)/2;Y.push({x1:te,y1:ue,x2:he,y2:re,white:.42,a:(1-b/C)*(.3+.55*we),w:Math.max(.6,(f.lineW??.8)*y)})}for(let V=0;V<w;V++){const[H,W,ee]=v(M[V][0],M[V][1],M[V][2]),ne=(ee+1)/2,b=1+.25*Math.sin(c*1.4+V*2.7);q.push({x:H,y:W,z:ee,r:(T+k*ne)*b*y,white:.55-.45*ne})}const z=f.signals??5;for(let V=0;V<z;V++){const H=Math.floor(c*.55+V*7.31),W=Math.floor(Tn(H,V*3.1+1.7)*w),ee=Math.floor(Tn(H,V*5.7+4.2)*w);if(W===ee)continue;const ne=G1(c*.55+V*7.31),b=Pc(M[W][0],M[ee][0],ne),te=Pc(M[W][1],M[ee][1],ne),ue=Pc(M[W][2],M[ee][2],ne),P=Math.max(1e-6,Math.sqrt(b*b+te*te+ue*ue)),[he,re,Ee]=v(b/P,te/P,ue/P),we=(Ee+1)/2;q.push({x:he,y:re,z:Ee,r:(T*1.5+k*we)*y,white:.05,a:.5+.5*we})}ng(a,Y,r),ha(a,q,r,f.rMin)},xg={orbits:gg,globe:ug,rubik:og,wave:rg,web:yg,braid:lg,ribbon:Z0,ring:Z0,morph:pg},vg=[["latRings","lonDensity"],["rings","lonDensity"],["lanes","segs"]],bg=["orbitN","ghostN","nodeN","strandN","signals"],wg=["iconD"],Sg=["rBase","rDepth","rActive","rDot","ghostR","partR","partRDepth","nodeR","nodeRDepth"];function jg(a,s){const c={...a},r=new Set,f=Math.sqrt(s);for(const[h,g]of vg){const x=c[h],v=c[g];x!=null&&v!=null&&!r.has(h)&&!r.has(g)&&(c[h]=Math.max(2,Math.round(x*f)),c[g]=Math.max(2,Math.round(v*f)),r.add(h),r.add(g))}for(const h of bg){const g=c[h];g!=null&&g!==0&&!r.has(h)&&(c[h]=Math.max(1,Math.round(g*s)))}for(const h of wg){const g=c[h];g!=null&&(c[h]=Math.max(.02,g*s))}return c}function Eg(a,s){const c={...a};for(const r of Sg){const f=c[r];f!=null&&(c[r]=f*s)}return c.rSizeMul=(c.rSizeMul??1)*s,c}const Cg={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}},Mg={working:"orbits",searching:"globe",solving:"rubik",listening:"wave",connecting:"web",weaving:"braid",composing:"ribbon",breathing:"ring",shaping:"morph"},Ng={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}}}},K0=new Map;function Ag(a,s){const c=`${a}-${s}`,r=K0.get(c);if(r)return r;const f=Mg[a],h=Ng[f][s];let g={...Cg[f]};h.count!==1&&(g=jg(g,h.count)),h.size!==1&&(g=Eg(g,h.size)),h.extra&&(g={...g,...h.extra});const x={mode:f,speed:h.speed,opts:g};return K0.set(c,x),x}function Tg(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 Dg(){return typeof matchMedia>"u"||matchMedia("(prefers-color-scheme: dark)").matches}function kg(a,s){const[c,r]=S.useState(!0);return S.useEffect(()=>{if(a==="dark"){r(!0);return}if(a==="light"){r(!1);return}const f=()=>{const v=Tg(s.current);r(v??Dg())};f();const h=typeof matchMedia<"u"?matchMedia("(prefers-color-scheme: dark)"):null,g=()=>f();h?.addEventListener("change",g);let x=null;return typeof MutationObserver<"u"&&s.current&&(x=new MutationObserver(f),x.observe(document.documentElement,{attributes:!0,attributeFilter:["class","data-theme"],subtree:!0})),()=>{h?.removeEventListener("change",g),x?.disconnect()}},[a,s]),c}function zg(){const[a,s]=S.useState(!1);return S.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 Rg={working:"Working…",searching:"Searching…",solving:"Solving…",listening:"Listening…",connecting:"Connecting…",weaving:"Weaving…",composing:"Composing…",breathing:"Thinking…",shaping:"Shaping…"};function mf({state:a="working",size:s=64,theme:c="auto",speed:r=1,paused:f=!1,style:h,"aria-label":g,...x}){const v=S.useRef(null),y=kg(c,v),w=zg();return S.useEffect(()=>{const C=v.current;if(!C)return;const T=Math.min(2,typeof devicePixelRatio<"u"&&devicePixelRatio||1);C.width=Math.round(s*T),C.height=Math.round(s*T);const k=C.getContext("2d");if(!k)return;const{mode:M,speed:Y,opts:q}=Ag(a,s),z=xg[M],V=Y*r,H=re=>{k.setTransform(T,0,0,T,0,0),k.clearRect(0,0,s,s),z(k,s,re,y,q)};if(w){H(.6);return}let W=0,ee=!1;const ne=()=>{H(performance.now()/1e3*V),ee&&(W=requestAnimationFrame(ne))},b=()=>{ee||f||(ee=!0,W=requestAnimationFrame(ne))},te=()=>{ee=!1,cancelAnimationFrame(W)};H(performance.now()/1e3*V);let ue=!0;const P=typeof IntersectionObserver<"u"?new IntersectionObserver(([re])=>{ue=re.isIntersecting,ue&&document.visibilityState!=="hidden"?b():te()}):null;P?.observe(C);const he=()=>{document.visibilityState==="hidden"?te():ue&&b()};return document.addEventListener("visibilitychange",he),P||b(),()=>{te(),P?.disconnect(),document.removeEventListener("visibilitychange",he)}},[a,s,y,r,f,w]),o.jsx("canvas",{ref:v,role:"img","aria-label":g??Rg[a],style:{width:s,height:s,display:"block",...h},...x})}const Eo=["searching","solving","composing","breathing","shaping"];function Og(a){const s=Math.floor(a*Eo.length);return Eo[Math.min(Eo.length-1,Math.max(0,s))]??Eo[0]}const pf=Og(Math.random());function V1(a){return JSON.parse(a)}function Ga(a){return typeof a=="object"&&a!==null&&!Array.isArray(a)}function qn(a){return typeof a=="string"}function lf(a){return typeof a=="boolean"}function _g(a){return typeof a=="number"}const Xa="ease-[cubic-bezier(0.32,0.72,0,1)]",Z1=274,K1=395,F1=368,J1=[{label:"Full",width:null},{label:"1440",width:1440},{label:"834",width:834},{label:"390",width:390}],ca={collapsed:!1,collapsedFamilies:[],deleted:[],corner:"bottom-right",font:"satoshi",hidden:[],order:[],renames:{},scaleSplit:!0,showDevOverlays:!0,showWidget:!0,viewport:null,width:F1};function Lg(a){return`leglas:${a}`}function W1(a,s){const c=s.map(r=>r.title);try{if(!a)return{...ca,order:c};const r=V1(a);if(!Ga(r))return{...ca,order:c};const f=(w,C)=>Array.isArray(w)?w.filter(qn).filter(T=>C.includes(T)):[],h=f(r.deleted,c),g=c.filter(w=>!h.includes(w)),x=f(r.order,g),v=["bottom-left","bottom-right","top-left","top-right"],y={};if(Ga(r.renames))for(const[w,C]of Object.entries(r.renames))g.includes(w)&&qn(C)&&(y[w]=C);return{collapsed:!!r.collapsed,collapsedFamilies:f(r.collapsedFamilies,g),corner:v.find(w=>w===r.corner)??ca.corner,deleted:h,font:qn(r.font)?r.font:ca.font,hidden:f(r.hidden,g),order:[...x,...g.filter(w=>!x.includes(w))],renames:y,scaleSplit:lf(r.scaleSplit)?r.scaleSplit:ca.scaleSplit,showDevOverlays:lf(r.showDevOverlays)?r.showDevOverlays:ca.showDevOverlays,showWidget:lf(r.showWidget)?r.showWidget:ca.showWidget,viewport:J1.map(w=>w.width).find(w=>w===r.viewport)??null,width:_g(r.width)&&Number.isFinite(r.width)?Math.round(Math.min(K1,Math.max(Z1,r.width))):F1}}catch{return{...ca,order:c}}}function Bg(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 I1(a,s){if(a.length===0)return[...s];const c=new Set(s),r=a.filter(h=>c.has(h)),f=new Set(r);return[...r,...s.filter(h=>!f.has(h))]}const P1=8,Ug=8;function Hg(a,s,c=P1){return a.left<c?c-a.left:a.right>s-c?Math.max(c-a.left,s-c-a.right):0}function qg(a,s,c,r=P1){if(a.top>=r)return!1;const f=a.bottom-a.top;return s.bottom+r+f<=c-r}function $g(a,s,c,r){const f=a.at==="right"?a.x:a.x-s.width/2,h=a.at==="top"?a.y-s.height:a.at==="bottom"?a.y:a.y-s.height/2,g={bottom:h+s.height,left:f,right:f+s.width,top:h};if(a.at==="top"&&qg(g,c,r.height))return{at:"bottom",shift:a.shift,y:c.bottom+Ug};const x=Hg(g,r.width);return x===a.shift?null:{at:a.at,shift:x,y:a.y}}function eu({size:a=18}){return o.jsxs("svg",{"aria-hidden":!0,height:a,strokeLinejoin:"round",strokeWidth:22,viewBox:"160 370 1050 1320",width:Math.round(a*(1050/1320)),children:[o.jsxs("defs",{children:[o.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"lm-up",x1:"791.957",x2:"210",y1:"723.095",y2:"1010",children:[o.jsx("stop",{offset:"0",stopColor:"#7C38E8"}),o.jsx("stop",{offset:"0.68",stopColor:"#CDB6F1"}),o.jsx("stop",{offset:"1",stopColor:"#E9E0FA"})]}),o.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"lm-down",x1:"789.954",x2:"210",y1:"1330.46",y2:"1035",children:[o.jsx("stop",{offset:"0",stopColor:"#3EC2A8"}),o.jsx("stop",{offset:"0.68",stopColor:"#9EDAE8"}),o.jsx("stop",{offset:"1",stopColor:"#E1F2F6"})]}),o.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"lm-shaft",x1:"884.016",x2:"182",y1:"1023.26",y2:"1023.26",children:[o.jsx("stop",{offset:"0",stopColor:"#7E97DD"}),o.jsx("stop",{offset:"0.48",stopColor:"#5F7FD8"}),o.jsx("stop",{offset:"0.71",stopColor:"#9AABE2"}),o.jsx("stop",{offset:"1",stopColor:"#E2E8F6"})]}),o.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"lm-head",x1:"1192",x2:"874.81",y1:"1021.57",y2:"1024.91",children:[o.jsx("stop",{offset:"0",stopColor:"#E8ECF7"}),o.jsx("stop",{offset:"1",stopColor:"#92A7E0"})]})]}),o.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"}),o.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)"}),o.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)"}),o.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)"}),o.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 em({height:a=16}){return o.jsxs("svg",{"aria-label":"Leglas",fill:"#E8ECF7",height:a,role:"img",viewBox:"1256 928 642 222",width:Math.round(a*(642/222)),children:[o.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"}),o.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"}),o.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"}),o.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"}),o.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"}),o.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 ln={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",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"},da="flex h-6 w-6 items-center justify-center rounded text-[#D1D5DB] hover:bg-[#2E2E2E] hover:text-white",Gi="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",tm="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 af({on:a}){return o.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:o.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 _o({className:a=""}){return o.jsx("span",{"aria-hidden":!0,className:`leglas-live-dot block size-1.5 rounded-full ${a}`})}function Yg({size:a=14}){return o.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:[o.jsx("path",{d:"M8 9.75V2.75"}),o.jsx("path",{d:"m5.25 5.5 2.75-2.75 2.75 2.75"}),o.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 Ya({size:a=3}){return o.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 jf({size:a=12}){return o.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:[o.jsx("path",{d:"M8 2.6 14.6 13.4H1.4Z"}),o.jsx("path",{d:"M8 6.8v2.7"}),o.jsx("path",{d:"M8 11.6h.01"})]})}function an({d:a,size:s=13}){return o.jsx("svg",{"aria-hidden":!0,fill:"currentColor",height:s,viewBox:"0 0 256 256",width:s,children:o.jsx("path",{d:a})})}let F0=0;function ut({children:a,label:s,side:c="top",wide:r=!1}){const f=S.useRef(null),h=S.useRef(null),g=S.useRef(null),x=S.useRef(null),v=S.useRef(null),[y,w]=S.useState(null);S.useLayoutEffect(()=>{const M=h.current,Y=f.current?.firstElementChild;if(!y||y.out||!M||!Y)return;const q=$g(y,{height:M.offsetHeight,width:M.offsetWidth},Y.getBoundingClientRect(),{height:window.innerHeight,width:window.innerWidth});q&&w(z=>z&&{...z,...q})},[s,y?.at,y?.out,y?.shift,y?.x,y?.y]),S.useEffect(()=>()=>{x.current&&clearTimeout(x.current),v.current&&clearTimeout(v.current)},[]);const C=()=>{const M=f.current?.firstElementChild;if(!M)return;const Y=M.getBoundingClientRect();v.current&&clearTimeout(v.current),g.current=M.closest("dialog, [data-leglas-shell]")??document.body,w(c==="top"?{at:"top",out:!1,shift:0,x:Y.left+Y.width/2,y:Y.top-8}:{at:"right",out:!1,shift:0,x:Y.right+8,y:Y.top+Y.height/2})},T=()=>{x.current&&clearTimeout(x.current),x.current=setTimeout(C,Date.now()<F0?0:300)},k=()=>{x.current&&clearTimeout(x.current),F0=Date.now()+300,w(M=>M&&!M.out?{...M,out:!0}:M),v.current&&clearTimeout(v.current),v.current=setTimeout(()=>w(null),120)};return o.jsxs("span",{className:"contents",onBlur:k,onFocus:M=>{M.target instanceof Element&&M.target.matches(":focus-visible")&&C()},onPointerDown:k,onPointerEnter:T,onPointerLeave:k,ref:f,children:[a,y&&Y1.createPortal(o.jsx("span",{"aria-hidden":!0,className:"pointer-events-none fixed z-[60]",style:{left:y.x+y.shift,top:y.y},children:o.jsx("span",{className:`block ${{bottom:"-translate-x-1/2",right:"-translate-y-1/2",top:"-translate-x-1/2 -translate-y-full"}[y.at]}`,children:o.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"} ${y.out?`leglas-tip-out-${y.at}`:`leglas-tip-in-${y.at}`}`,ref:h,children:s})})}),g.current??document.body)]})}function Gg({error:a,initial:s,label:c,onCancel:r,onCommit:f}){const h=S.useRef(!1);return S.useEffect(()=>{a&&(h.current=!1)}),o.jsx("form",{className:"leglas-rename min-w-0 flex-1",onSubmit:g=>{g.preventDefault();const x=new FormData(g.currentTarget).get("name");h.current=!0,f(qn(x)?x.trim():"","submit")},children:o.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:g=>{h.current||f(g.currentTarget.value.trim(),"blur")},onKeyDown:g=>{g.key==="Escape"&&(h.current=!0,r())},type:"text"})})}const Xg={danger:"bg-amber-300",info:"bg-[#9CA3AF]",success:"bg-emerald-300"},Qg=140;function Vg({onDismiss:a,toast:s}){const[c,r]=S.useState(!1),[f,h]=S.useState(!1),[g,x]=S.useState(!1),v=S.useRef(s.ttl),y=S.useRef(null),w=()=>{y.current||(r(!0),y.current=setTimeout(a,Qg))},C=f||g;return S.useEffect(()=>{if(c||C||v.current===null)return;const T=Date.now(),k=setTimeout(w,v.current);return()=>{clearTimeout(k),v.current!==null&&(v.current=Math.max(0,v.current-(Date.now()-T)))}},[c,C]),S.useEffect(()=>()=>{y.current&&clearTimeout(y.current)},[]),o.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:()=>x(!1),onFocus:()=>x(!0),onPointerEnter:()=>h(!0),onPointerLeave:()=>h(!1),children:[o.jsx("span",{"aria-hidden":!0,className:`mt-[5px] size-1.5 shrink-0 rounded-full ${Xg[s.tone]}`}),o.jsxs("span",{className:"min-w-0 flex-1",children:[o.jsx("span",{className:"block text-xs leading-snug text-[#E8E8EA]",children:s.message}),s.detail?o.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?o.jsx("span",{className:"mt-1 block text-[11px] leading-snug text-[#9CA3AF]",children:s.note}):null]}),s.action?o.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(),w()},type:"button",children:s.action.label}):null,o.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:w,type:"button",children:o.jsx("svg",{className:"size-2.5",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 10 10",children:o.jsx("path",{d:"M2.5 2.5 7.5 7.5M7.5 2.5 2.5 7.5",strokeLinecap:"round"})})})]})}function Zg({bottom:a,left:s,onDismiss:c,toasts:r,width:f}){return o.jsx("ol",{"aria-live":"polite",className:`pointer-events-none fixed z-40 flex flex-col gap-2 transition-[bottom,left,width] duration-200 ${Xa} motion-reduce:transition-none`,style:{bottom:a,left:s,width:f},children:r.map(h=>o.jsx(Vg,{onDismiss:()=>c(h.id),toast:h},h.id))})}function Kg({loaded:a}){return o.jsxs("div",{"aria-hidden":!0,className:`absolute inset-0 overflow-hidden bg-white transition-opacity duration-700 ${Xa} ${a?"pointer-events-none opacity-0":"opacity-100"}`,children:[o.jsxs("div",{children:[o.jsx("div",{className:"mx-auto mt-6 h-12 w-[400px] max-w-[80%] rounded-full bg-neutral-200/80"}),o.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:[o.jsxs("div",{children:[o.jsx("div",{className:"h-14 w-4/5 rounded-lg bg-neutral-200"}),o.jsx("div",{className:"mt-3 h-14 w-3/5 rounded-lg bg-neutral-200"}),o.jsx("div",{className:"mt-8 h-4 w-full max-w-[420px] rounded bg-neutral-200/80"}),o.jsx("div",{className:"mt-2 h-4 w-4/5 max-w-[360px] rounded bg-neutral-200/80"}),o.jsx("div",{className:"mt-10 h-12 w-44 rounded-full bg-neutral-200"})]}),o.jsx("div",{className:"h-[420px] w-60 justify-self-center rounded-[2.5rem] bg-neutral-200 max-[900px]:hidden"})]})]}),o.jsx("div",{className:"pointer-events-none absolute inset-0 overflow-hidden motion-reduce:hidden",children:o.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%)"}})}),o.jsxs("span",{className:"absolute bottom-4 right-5 flex items-center gap-2",children:[o.jsx(mf,{"aria-label":"",size:20,state:pf,theme:"light"}),o.jsx("span",{className:"leglas-shimmer-text text-xs font-medium",children:"Loading preview…"})]})]})}function Fg({branch:a,onStart:s,state:c}){if(c.status==="failed")return o.jsx(nm,{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 o.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:[o.jsx("span",{className:"size-4 animate-spin rounded-full border-2 border-neutral-300 border-t-neutral-800 motion-reduce:animate-none"}),o.jsxs("div",{className:"max-w-xs",children:[o.jsx("p",{className:"text-sm font-medium text-neutral-800",children:r}),o.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 nm({onReload:a,reason:s}){return o.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-3 bg-white p-6 text-center",role:"alert",children:[o.jsxs("div",{className:"max-w-xs",children:[o.jsx("p",{className:"text-sm font-medium text-neutral-800",children:"Preview didn’t load"}),o.jsx("p",{className:"mt-1 text-xs leading-snug text-neutral-500",children:s})]}),o.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 Jg({text:a}){const s=[];let c=0;for(const r of a.split(" "))s.push({word:r,at:c}),c+=r.length+1;return o.jsx("code",{className:"font-mono text-[0.92em] text-neutral-700",children:s.map(({word:r,at:f})=>o.jsxs(S.Fragment,{children:[f>0&&" ",o.jsx("span",{className:"whitespace-nowrap",children:r})]},f))})}function J0({className:a,words:s}){return o.jsxs("p",{className:a,children:[s.lead,o.jsx(Jg,{text:s.quote}),s.tail]})}function Wg({headline:a,hint:s,href:c,onShowAnyway:r,reason:f}){return o.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-3 bg-white p-6 text-center",role:"alert",children:[o.jsxs("div",{className:"max-w-sm",children:[o.jsx("p",{className:"text-balance text-sm font-medium text-neutral-800",children:a}),o.jsx(J0,{className:"mt-1 text-pretty text-xs leading-snug text-neutral-500",words:f})]}),o.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"}),o.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"}),o.jsx(J0,{className:"max-w-sm text-balance text-[11px] leading-snug text-neutral-400",words:s})]})}function Xi({id:a,size:s=14}){const c=S.useId();return a==="claude"?o.jsx("svg",{"aria-hidden":"true",fill:"#D97757",height:s,viewBox:"0 0 24 24",width:s,children:o.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"?o.jsx("svg",{"aria-hidden":"true",fill:"currentColor",height:s,viewBox:"0 0 24 24",width:s,children:o.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"?o.jsxs("svg",{"aria-hidden":"true",height:s,viewBox:"0 0 24 24",width:s,children:[o.jsx("defs",{children:o.jsxs("linearGradient",{id:c,x1:"0",x2:"0",y1:"0",y2:"1",children:[o.jsx("stop",{offset:"0",stopColor:"#9B96F2"}),o.jsx("stop",{offset:"0.55",stopColor:"#5E6CF6"}),o.jsx("stop",{offset:"1",stopColor:"#3B32EF"})]})}),o.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})`}),o.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"?o.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:o.jsx("path",{d:"m5 6 6 6-6 6M13 18h6"})}):null}const Lo=15e3,Ig=["config","requests","health","share"];function Pg(a){return Ig.some(s=>s===a)}function e2(a){try{const s=V1(a);if(!Ga(s))return null;const c=s.changed;return Pg(c)?c:null}catch{return null}}const W0=250,t2=3e4;function n2(a){return a<=0?W0:Math.min(t2,W0*2**a)}function l2(){const{host:a,protocol:s}=window.location;return`${s==="https:"?"wss":"ws"}://${a}/leglas/api/live`}function a2(a){const s=new WebSocket(a);return{addEventListener:(c,r)=>s.addEventListener(c,f=>{r("data"in f&&qn(f.data)?{data:f.data}:{})}),close:()=>s.close()}}let I0=null;function tu(){return I0??=i2(),I0}function i2(a={}){const s=a.connect??a2,c=a.setTimeout??((T,k)=>globalThis.setTimeout(T,k)),r=a.clearTimeout??(T=>globalThis.clearTimeout(T)),f=new Map;let h=null,g=!1,x=0,v=null,y=!1;const w=()=>{if(y)return;let T;try{T=s(a.url??l2())}catch{return C()}h=T,T.addEventListener("open",()=>{y||(g=!0,x=0)}),T.addEventListener("message",M=>{if(M.data===void 0)return;const Y=e2(M.data);if(Y!==null)for(const q of f.get(Y)??[])q()});const k=()=>{h===T&&(g=!1,h=null,C())};T.addEventListener("close",k),T.addEventListener("error",k)},C=()=>{if(y||v!==null)return;const T=n2(x);x+=1,v=c(()=>{v=null,w()},T)};return w(),{on(T,k){const M=f.get(T)??new Set;return M.add(k),f.set(T,M),()=>{M.delete(k),M.size===0&&f.delete(T)}},get connected(){return g},stop(){y=!0,g=!1,v!==null&&r(v),v=null,f.clear();const T=h;h=null;try{T?.close()}catch{}}}}function sf(a){return a instanceof Error&&a.name==="AbortError"}const s2=1e4,u2={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 nu(a,s){const{everyMs:c,timeoutMs:r=s2,timers:f=u2}=s;let h=!1,g=null;const x=()=>{if(h||g!==null)return;const w=new AbortController,C=f.setTimeout(()=>{w.abort(),g?.controller===w&&(g=null)},r),T={controller:w,deadline:C};g=T;const k=()=>{g===T&&(f.clearTimeout(C),g=null)};a(w.signal).then(k,k)};x();const v=f.setInterval(x,c),y=s.subscribe?.(x);return()=>{h=!0,y?.(),f.clearInterval(v),g!==null&&(f.clearTimeout(g.deadline),g.controller.abort(),g=null)}}function o2(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 r2(){return{clipboard:typeof navigator>"u"?void 0:navigator.clipboard,legacy:typeof document>"u"?void 0:o2}}async function $o(a,s=r2()){if(s.clipboard)try{return await s.clipboard.writeText(a),"copied"}catch{}try{if(s.legacy?.(a))return"copied"}catch{}return"blocked"}const c2=9;function f2(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(c2)?{kind:"jump",index:Number(s)-1}:null}function lm(a){return a?"⌘Cmd+K":"Ctrl+K"}function d2(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:[lm(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,...h}of c)s&&f||r.push(h);return r}function h2(a,s,c){return`${a}\0${s}\0${c}`}function m2(a,s,c){return a[s]===c}function p2(a,s,c){return a[s]===c?a:{...a,[s]:c}}function g2(a,s){if(!(s in a))return a;const c={...a};return delete c[s],c}function Ef(a){try{const s=a.contentDocument;return s!==null&&s.location.href!=="about:blank"&&s.readyState!=="loading"}catch{return!1}}function y2({frame:a,onFailure:s,onReady:c,sameOrigin:r,timeoutMs:f}){let h=!1,g=null;const x=()=>{a.removeEventListener("load",w),a.removeEventListener("error",C),g!==null&&(globalThis.clearTimeout(g),g=null)},v=T=>h||(r?!Ef(a):!T)?!1:(h=!0,x(),c(),!0),y=T=>{h||T&&r&&v(!1)||(h=!0,x(),s())};function w(){v(!r)}function C(){y(!1)}return a.addEventListener("load",w),a.addEventListener("error",C),g=globalThis.setTimeout(()=>y(!0),f),r&&v(!1),()=>{h||(h=!0,x())}}function x2(a){return Ga(a)&&(a.header==="x-frame-options"||a.header==="content-security-policy")&&qn(a.value)}async function v2(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 Ga(r)&&r.framable===!1&&x2(r.refusal)?{header:r.refusal.header,value:r.refusal.value}:null}catch{return null}}function b2(a){try{return new URL(a).host}catch{return a}}function w2(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 S2(a,s,c){return{headline:`${b2(s)} won’t open inside another page`,reason:w2(a),hint:{lead:"If the site is yours, a Content-Security-Policy of ",quote:`frame-ancestors ${c}`,tail:" lets it show here."}}}function j2(a){if(!Ga(a))return null;const s=a.type;return s==="leglas:preview-ready"?"ready":s==="leglas:preview-error"?"error":null}function E2(a,s){if(s===null)return null;for(const c of a)if(c.contentWindow===s)return c;return null}function P0(a){return a.file===void 0&&a.branch===void 0&&a.url.startsWith("/")}const C2={reachable:!0,wasDown:!1};function M2(a,s){return s?a.reachable?a:{reachable:!0,wasDown:a.wasDown}:!a.reachable&&a.wasDown?a:{reachable:!1,wasDown:!0}}function N2(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 A2(a){return!a.split||a.compare===null||a.compare===a.active?[a.active]:[a.active,a.compare]}const T2=.999,D2=.05;function k2(a){const{gutter:s,panes:c,scaleSplit:r,stageHeight:f,stageWidth:h,viewport:g}=a,x=c>1?(h-(c-1))/c:h,v=g??h,y=x-(g!==null?s:0),w=f-(g!==null?s:0),T=r&&c>1&&h>0&&v>0?Math.max(D2,Math.min(1,y/v)):1,k=T<T2;return{boxHeight:w*T,boxWidth:v*T,designWidth:v,frameHeight:w,scale:T,scaling:k}}const z2="#__next-build-watcher,#nuxt-devtools-anchor,astro-dev-toolbar{display:none!important}",R2="#devtools-indicator{display:none!important}",O2=12;function _2(a,s,c=[],r=[]){const f=a.replace(/\s+/g," ").trim().toLowerCase();return f.length<O2?null:im(`${s.join(">")} ${f} ${c.join("|")} ${r.join("|")}`.trimEnd())}const am=new Set(["LINK","META","NOSCRIPT","SCRIPT","STYLE","TEMPLATE"]),Co=720,e1=180,L2=["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"],B2=new Set(["bottom","filter","height","left","opacity","right","top","transform","width"]),U2=["content","display","position","inset","width","height","opacity","transform","color","background-color","background-image","border-radius","box-shadow","filter","clip-path"],H2=["viewBox","d","points","x","y","x1","y1","x2","y2","cx","cy","r","rx","ry","width","height","fill","stroke","stroke-width"],t1=["nextjs-portal","vite-error-overlay","#webpack-dev-server-client-overlay","#leglas-hide-dev-overlays"].join(",");function Mo(a){if(!Number.isFinite(a))return"?";const s=Math.round(a*2)/2;return Object.is(s,-0)?"0":String(s)}function im(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 Bo(a,s=480){const c=a.replace(/\s+/g," ").trim();return c.length<=s?c:`${c.slice(0,180)}…${c.slice(-80)}#${c.length}:${im(c)}`}function q2(a){return am.has(a.tagName)||a.matches(t1)||a.closest(t1)!==null}function $2(a){if(a.length<=Co)return a.map((f,h)=>h);const s=new Set,c=f=>{f>=0&&f<a.length&&s.size<Co&&s.add(f)};for(let f=0;f<e1;f+=1)c(f);for(let f=Math.max(0,a.length-e1);f<a.length;f+=1)c(f);for(let f=0;f<a.length&&s.size<Co;f+=1){const h=a[f];if(!h.matches("a,button,input,select,textarea,summary,[role],svg,svg *,canvas,img,picture,video,audio,iframe"))continue;c(f);let g=h.parentElement;for(let x=0;g!==null&&x<3;x+=1)c(a.indexOf(g)),g=g.parentElement}const r=Co-s.size;if(r>0){const f=(a.length-1)/Math.max(1,r-1);for(let h=0;h<r;h+=1)c(Math.round(h*f))}return[...s].sort((f,h)=>f-h)}function Y2(a,s){if(s.getPropertyValue("animation-name").trim()!=="none")return!0;try{return(a.getAnimations?.()??[]).some(c=>c.playState==="running")}catch{return!1}}function G2(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,h=f==="fixed"?0:r?.scrollX??0,g=f==="fixed"?0:r?.scrollY??0;return`rect:${Mo(c.left+h)},${Mo(c.top+g)},${Mo(c.width)},${Mo(c.height)}`}function X2(a){const s=[];for(const r of H2){const f=a.getAttribute(r);f!==null&&s.push(`${r}:${Bo(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}:${Bo(f)}`)}if(c==="CANVAS"){const r=a;s.push(`bitmap:${r.width}x${r.height}`)}return s.join(",")}function n1(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}{${U2.map(h=>`${h}:${Bo(r.getPropertyValue(h))}`).join(";")}}`}function Q2(a,s){if(!a)return[];const c=[a,...Array.from(a.querySelectorAll("*"))].filter(r=>!q2(r));return $2(c).map(r=>{const f=c[r],h=s(f),g=Y2(f,h),x=L2.map(k=>{const M=g&&B2.has(k)?"<animated>":Bo(h.getPropertyValue(k));return`${k}:${M}`}).join(";"),v=f.getAttribute("role"),y=f.getAttribute("type"),w=[v&&`role:${v}`,y&&`type:${y}`].filter(Boolean).join(","),C=n1(f,"::before",s),T=n1(f,"::after",s);return`${f.tagName}${w?`[${w}]`:""}{${G2(f,g)};${x};${X2(f)};${C};${T}}`})}function V2(a,s){if(!a)return[];const c=[];let r=a;for(let f=0;f<4;f+=1){const h=s(r);c.push(`${h.backgroundColor};${h.backgroundImage};${h.color}`);const g=Array.from(r.children).filter(v=>!am.has(v.tagName??"")),x=g.length===1?g[0]:void 0;if(x===void 0)break;r=x}return c}function Z2(a){const s=new Map;for(const[r,f]of Object.entries(a)){if(f===null)continue;const h=s.get(f);h?h.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(h=>h!==f);return c}function sm(a,s){const c=s[a.title];return c?.url===a.url?c:null}function uf(a,s){let c=null;for(const r of s)r in a&&(c??={...a},delete c[r]);return c??a}function K2(a,s){const c=[];for(const[r,f]of s){const h=a.get(r);h!==void 0&&h!==f&&c.push(r)}return c}function F2(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],h=f?.status==="failed"&&r.status==="failed"||f?.status==="complete"&&r.status==="complete"&&f.signature===r.signature;return f?.url===r.url&&h?a:{...a,[s.title]:r}}function J2(a,s){const c={};for(const r of a){const f=sm(r,s);f?.status==="complete"&&(c[r.title]=f.signature)}return c}function W2(a,s){return a.filter(c=>c.url?.startsWith("/")?sm(c,s)===null:!1)}const l1=24,I2=10,a1=44;function P2(a,s){const c=(r,f)=>{const h=Math.min(l1,f/2),g=Math.max(h,f-l1);return Math.max(h,Math.min(g,r))};return{x:c(a.x,s.width),y:c(a.y,s.height)}}function ey(a){return{x:a.x-a1/2,y:a.y-a1/2}}function ty(a,s,c=I2){return Math.abs(s.x-a.x)>c||Math.abs(s.y-a.y)>c}function ny(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 ly(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 ay(a,s){const c=new Set(a),r=new Map,f=new Map,h=[];for(const v of a){const y=ly(v,s,c);if(y===null){h.push(v);continue}r.set(v,y);const w=f.get(y);w?w.push(v):f.set(y,[v])}const g=new Set,x=v=>{if(!g.has(v)){g.add(v);for(const y of f.get(v)??[])x(y)}};for(const v of h)x(v);for(const v of a){if(g.has(v))continue;const y=r.get(v);y!==void 0&&(f.set(y,(f.get(y)??[]).filter(w=>w!==v)),r.delete(v)),h.push(v),x(v)}return{children:f,parentOf:r,roots:h}}function i1(a,s,c){const r=ay(a,s),f=w=>(r.children.get(w)??[]).reduce((C,T)=>C+f(T),1),h=[],g=[],x=()=>{const w=g.indexOf(null);return w!==-1?w:(g.push(null),g.length-1)},v=(w,C,T,k)=>{const M=c.has(w)?[]:r.children.get(w)??[],Y=g.flatMap((H,W)=>H!==null&&W!==T?[W]:[]),[q,...z]=M,V=z.map(H=>{const W=x();return g[W]=H,{kid:H,lane:W}});if(h.push({title:w,depth:C,lane:T,fromAbove:k,toBelow:q!==void 0,forks:V.map(H=>H.lane),through:Y}),q===void 0){g[T]=null;return}v(q,C+1,T,!0);for(const H of V)v(H.kid,C+1,H.lane,!0)};for(const w of r.roots){const C=x();g[C]=w,v(w,0,C,!1)}const y=new Map(h.map(w=>[w.title,{depth:w.depth,variants:w.depth===0?f(w.title)-1:0,descendants:f(w.title)-1,folded:c.has(w.title),graph:w}]));return{rows:h.map(w=>w.title),meta:y,parents:r.parentOf,children:r.children,roots:r.roots}}function iy(a,s,c,r,f){const h=(a.length?a:s).filter(x=>x!==c),g=r!==null&&h.includes(r)?h.indexOf(r):Math.max(-1,...f.flatMap(x=>x===c?[]:[h.indexOf(x)]))+1;return h.splice(g,0,c),h}function of(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 sy(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 uy(a,s,c){const r=sy(a,c),f=[...r],h=[];if(r.forEach((v,y)=>{const w=r[y+1];w!==void 0&&h.push([v,w])}),r.length>1)return{nodes:f,edges:h};const g=new Set(f),x=v=>{for(const y of s.get(v)??[])g.has(y)||(g.add(y),f.push(y),h.push([v,y]),x(y))};return x(c),{nodes:f,edges:h}}function oy(a,s,c){const r=new Map,f=(h,g)=>{const x=r.get(h);x?x.add(g):r.set(h,new Set([g]))};for(const h of c.nodes)s.has(h)&&f(h,"mark");for(const[h,g]of c.edges){if(!s.has(h)||!s.has(g))continue;const x=s.get(g)?.graph?.lane??0;f(h,s.get(h)?.graph?.lane===x?"below":`fork:${x}`);for(const v of a.slice(a.indexOf(h)+1,a.indexOf(g)))f(v,`through:${x}`);f(g,"above")}return r}function ry(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 cy(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 fy(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 s1=a=>Math.round(a*100)/100,Uo=.5523,rf=4,dy=([a,s],c,r)=>[[a,s],[a,s+Uo*c],[a+r*(c-Uo*c),s+c],[a+r*c,s+c]],hy=([a,s],c,r)=>[[a,s],[a+r*Uo*c,s],[a+r*c,s+c-Uo*c],[a+r*c,s+c]],my=(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 um(a,s,c){const r=Math.abs(c-a),f=c>a?1:-1,h=r/2,g=[a,s+rf],x=[a+f*h,s+rf+h];return{knee:s+rf+r,segments:[my([a,s],g),dy(g,h,f),hy(x,h,f)]}}function om(a,s,c){return um(a,s,c).knee}const py=([a,s,c,r],f)=>{const h=1-f;return[h*h*h*a[0]+3*h*h*f*s[0]+3*h*f*f*c[0]+f*f*f*r[0],h*h*h*a[1]+3*h*h*f*s[1]+3*h*f*f*c[1]+f*f*f*r[1]]};function gy([a,s,c,r],f){const h=(C,T)=>[C[0]+(T[0]-C[0])*f,C[1]+(T[1]-C[1])*f],g=h(a,s),x=h(s,c),v=h(c,r),y=h(g,x),w=h(x,v);return[h(y,w),w,v,r]}function rm(a,s,c,r=0){const{segments:f}=um(a,s,c);let h=r;const g=[];for(const y of f){if(h<=0){g.push(y);continue}const w=48;let C=0,T=y[0],k=null;for(let M=1;M<=w;M+=1){const Y=py(y,M/w),q=Math.hypot(Y[0]-T[0],Y[1]-T[1]);if(C+q>=h){k=(M-1+(h-C)/q)/w;break}C+=q,T=Y}if(k===null){h-=C;continue}h=0,g.push(gy(y,k))}const x=g[0];if(x===void 0)return"";const v=y=>`${s1(y[0])} ${s1(y[1])}`;return`M ${v(x[0])} ${g.map(y=>`C ${v(y[1])}, ${v(y[2])}, ${v(y[3])}`).join(" ")}`}function yy(a){let s="";for(let c=1;c<a.length;c+=1){const[r,f]=[a[c-1],a[c]],h=r.clear??0,g=r.y+h,x=f.y-(f.clear??0);if(x<=g)continue;if(f.x===r.x){s+=`${s?" ":""}M ${r.x} ${g} L ${f.x} ${x}`;continue}const v=om(r.x,r.y,f.x);if(v>x){s+=`${s?" ":""}M ${r.x} ${g} L ${f.x} ${x}`;continue}const y=rm(r.x,r.y,f.x,h);s+=`${s?" ":""}${y===""?`M ${f.x} ${v}`:y} L ${f.x} ${x}`}return s}const Ho=10,qo=4,cm=44,xy=8,vy=10,u1=4,by="#4A4A54",wy="#41414A",Sy="#8E8E98",o1="#7C7C85",jy="#D1D5DB",r1="#E8E8EA",No="160ms cubic-bezier(0.2, 0.7, 0.2, 1)";function Ey(a){return a<0?0:Math.max(cm,qo+a*Ho+10)}const c1=16,Cy=cm-12,My=2,Ny=8;function Ay(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,c1,qo+Math.max(0,...f.forks)*Ho+My);else{const h=Math.max(f.lane,...f.forks,...f.through);c=Math.max(c,Cy,qo+h*Ho+Ny)}return c>0&&(s=Math.max(s,c1)),{root:s,variant:c}}function Ty({active:a,arriving:s=!1,bloom:c=0,delay:r=0,family:f=!1,folded:h=!1,fresh:g,lit:x,row:v,tint:y="#FB7185",width:w,working:C=!1}){const T=P=>qo+P*Ho,k=T(v.lane),M=u1+xy+vy,Y=u1,q=P=>x?.has(P)??!1,z=q("mark"),V=v.fromAbove||v.toBelow||v.forks.length>0||f,W=a||v.forks.length>0||!v.fromAbove||!v.toBelow?v.depth===0?3.5:3:C?3:1.5,ee=a?W+5:0,ne=[];for(const P of v.through)ne.push({key:`t${P}`,lane:P,segment:`through:${P}`,kind:"line",x:T(P),y1:0,y2:"100%"});v.fromAbove&&ne.push({key:"a",lane:v.lane,segment:"above",kind:"line",x:k,y1:0,y2:M-ee}),v.toBelow&&ne.push({key:"b",lane:v.lane,segment:"below",kind:"line",x:k,y1:M+ee,y2:"100%"});for(const P of v.forks){const he=om(k,M,T(P)),re=rm(k,M,T(P),ee);re!==""&&ne.push({key:`fc${P}`,lane:P,segment:`fork:${P}`,kind:"path",d:re}),ne.push({key:`ft${P}`,lane:P,segment:`fork:${P}`,kind:"line",x:T(P),y1:he,y2:"100%"})}const b=(P,he)=>P.kind==="line"?o.jsx("line",{pathLength:1,x1:P.x,x2:P.x,y1:P.y1,y2:P.y2,...he},P.key):o.jsx("path",{d:P.d,pathLength:1,...he},P.key),te=P=>({className:g?.has(P.segment)?"leglas-draw":void 0,style:{animationDelay:`${r}ms`,stroke:q(P.segment)?Sy:P.lane>0?wy:by,transition:`stroke ${No}`}}),ue=s;return o.jsx("span",{"aria-hidden":!0,className:"pointer-events-none absolute inset-y-0 left-0",style:{width:w},children:o.jsxs("svg",{className:"absolute left-0 overflow-visible [shape-rendering:geometricPrecision]",fill:"none",strokeWidth:1.25,style:{height:`calc(100% + ${Y*2}px)`,top:-Y,width:w},children:[ne.map(P=>b(P,te(P))),V&&o.jsxs(o.Fragment,{children:[a&&o.jsx("circle",{cx:k,cy:M,fill:"none",r:W+2.5,stroke:r1,strokeWidth:1.25,style:{transition:`r ${No}`}}),o.jsx("circle",{className:C?"leglas-breathe":g?.has("mark")?"leglas-pop":void 0,cx:k,cy:M,"data-mark":"",fill:C?y:a?r1:z?jy:o1,r:a?Math.max(2,W-1):W,stroke:"none",style:{animationDelay:`${r+120}ms`,transition:`fill ${No}, r ${No}`}}),h&&[8,14,20].map((P,he)=>o.jsx("circle",{cx:k,cy:M+P,fill:o1,opacity:.6-he*.18,r:1,stroke:"none"},P)),(ue||c>0)&&o.jsx("circle",{className:"leglas-bloom",cx:k,cy:M,fill:y,r:W,stroke:"none"},`bloom-${c}-${ue?"landed":""}`)]})]})})}const f1=200;function Dy({askedFor:a,chain:s,displayName:c,onCompare:r,onGo:f,onRail:h,onTrace:g,openAsk:x=!1,self:v,tint:y,traced:w=null}){const[C,T]=S.useState(!1),[k,M]=S.useState(!1),[Y,q]=S.useState(!0),z=S.useRef(null);S.useEffect(()=>()=>{z.current&&clearTimeout(z.current)},[]);const V=()=>{const b=window.matchMedia("(prefers-reduced-motion: reduce)").matches;q(b),M(te=>!te),z.current&&clearTimeout(z.current),z.current=setTimeout(()=>q(!0),b?0:f1+20)},H=C?{head:[...s],hidden:[],tail:[]}:fy(s),W=o.jsx("span",{"aria-hidden":!0,className:"select-none text-[#84848C]/50",children:"›"}),ee=b=>{const te=c(b);return h(b)?o.jsx(ut,{label:o.jsxs(o.Fragment,{children:[o.jsxs("span",{className:"block",children:["Go to ",te]}),o.jsx("span",{className:"block text-[#9CA3AF]",children:"Shift-click to compare"})]}),children:o.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 ${w===b?"text-[#E8E8EA]":""}`,onClick:ue=>ue.shiftKey?r(b):f(b),onPointerEnter:()=>g?.(b),onPointerLeave:()=>g?.(null),type:"button",children:te})}):o.jsx("span",{className:"max-w-36 truncate text-[#84848C]/70",title:`${te} is not on the rail`,children:te})},ne=a===null?null:`You asked for “${a}”`;return o.jsxs("div",{className:"px-3 pb-2",children:[o.jsxs("nav",{"aria-label":`Where ${c(v)} came from`,className:"flex flex-wrap items-center gap-x-1 gap-y-0.5 text-[10px] leading-snug text-[#84848C]",children:[H.head.map(b=>o.jsxs(S.Fragment,{children:[ee(b),W]},b)),H.hidden.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(ut,{label:o.jsx(o.Fragment,{children:H.hidden.map(b=>o.jsx("span",{className:"block",children:c(b)},b))}),wide:!0,children:o.jsx("button",{"aria-label":`Show the ${H.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:"…"})}),W]}),H.tail.map(b=>o.jsxs(S.Fragment,{children:[ee(b),W]},b)),o.jsxs("span",{className:`inline-flex max-w-36 items-center gap-1 truncate transition-colors duration-150 ${w===v?"text-[#E8E8EA]":"text-[#D1D5DB]"}`,children:[y!==void 0&&o.jsx("span",{"aria-hidden":!0,className:"inline-block size-[5px] shrink-0 rounded-full",style:{background:y}}),c(v)]})]}),ne===null?null:x?o.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:`${f1}ms`},type:"button",children:o.jsx("span",{className:!k&&Y?"line-clamp-1":"block",children:ne})}):o.jsx("p",{className:"mt-0.5 min-w-0 truncate text-[10px] leading-snug text-[#84848C]",title:a??"",children:ne})]})}const Ao=320,ky=22,Is=240,zy=150,Ry=2600,Oy=5200,_y=2200,d1=900,h1=420,Ro={current:["#FB7185","#FB923C","#F9A8D4","#E879F9","#FB7185"],bloom:"#FECDD3"},Ly=typeof performance<"u"?performance.now():0;function By(a){const s=(f,h,g)=>3*f*g*(1-g)**2+3*h*g**2*(1-g)+g**3;let c=0,r=1;for(let f=0;f<24;f+=1){const h=(c+r)/2;s(.5,.2,h)<a?c=h:r=h}return s(0,1,(c+r)/2)}function m1({d:a,height:s,leaving:c=!1,marks:r,still:f=!1,width:h}){const g=S.useId().replace(/\W/g,""),x=`current-${g}`,v=`surge-${g}`,y=S.useRef(null),w=S.useRef(null),C=S.useRef(null),T=S.useRef([]),k=S.useRef(r);return k.current=r,S.useEffect(()=>{if(f)return;const M=y.current,Y=w.current,q=C.current;if(!M||!Y||!q)return;const z=k.current,V=Math.min(...z.map(he=>he.y)),H=Math.max(...z.map(he=>he.y)),W=V-Is,ee=H+Is,ne=Math.min(Oy,Math.max(Ry,(ee-W)/zy*1e3)),b=ne+_y,te=z.map(()=>-1/0);let ue=0;const P=he=>{const re=Math.max(0,he-Ly),Ee=re/1e3*ky;M.setAttribute("y1",`${Ee%Ao}`),M.setAttribute("y2",`${Ee%Ao+Ao}`);const we=re%b,Te=we<ne,L=W+(ee-W)*(Te?By(we/ne):1);Y.setAttribute("y1",`${L-Is/2}`),Y.setAttribute("y2",`${L+Is/2}`);const I=Math.min(1,we/500),se=Math.min(1,Math.max(0,(ne-we)/700));q.setAttribute("opacity",`${Te?Math.min(I,se).toFixed(3):"0"}`);const Se=re-we;z.forEach((ye,j)=>{const U=T.current[j];if(!U)return;Te&&L>=ye.y&&(te[j]??-1/0)<Se&&(te[j]=re);const ae=re-(te[j]??-1/0),oe=ae<d1?1-ae/d1:0,pe=oe*oe*(3-2*oe);U.setAttribute("opacity",`${(pe*.75).toFixed(3)}`),U.setAttribute("r",`${(2.5+(1-pe)*6).toFixed(2)}`)}),ue=requestAnimationFrame(P)};return ue=requestAnimationFrame(P),()=>cancelAnimationFrame(ue)},[a,f]),o.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 ${h1}ms ease-out both`,opacity:c?0:void 0,transition:f?void 0:`opacity ${h1}ms ease-in`},width:h,children:[o.jsxs("defs",{children:[o.jsx("linearGradient",{gradientUnits:"userSpaceOnUse",id:x,ref:y,spreadMethod:"repeat",x1:0,x2:0,y1:0,y2:Ao,children:Ro.current.map((M,Y)=>o.jsx("stop",{offset:Y/(Ro.current.length-1),stopColor:M},Y))}),o.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:v,ref:w,x1:0,x2:0,y1:-Is,y2:0,children:[o.jsx("stop",{offset:"0",stopColor:"#FFFFFF",stopOpacity:0}),o.jsx("stop",{offset:"0.3",stopColor:"#F0F4FF",stopOpacity:.35}),o.jsx("stop",{offset:"0.5",stopColor:"#FFFFFF",stopOpacity:.95}),o.jsx("stop",{offset:"0.7",stopColor:"#F0F4FF",stopOpacity:.35}),o.jsx("stop",{offset:"1",stopColor:"#FFFFFF",stopOpacity:0})]})]}),o.jsxs("g",{stroke:`url(#${x})`,strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:a,opacity:.1,strokeWidth:7}),o.jsx("path",{d:a,opacity:.24,strokeWidth:3.5}),o.jsx("path",{d:a,opacity:.85,strokeWidth:1.75})]}),o.jsxs("g",{opacity:0,ref:C,stroke:`url(#${v})`,strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:a,opacity:.16,strokeWidth:9}),o.jsx("path",{d:a,opacity:.4,strokeWidth:4}),o.jsx("path",{d:a,opacity:.9,strokeWidth:1.75})]}),r.map((M,Y)=>o.jsx("circle",{cx:M.x,cy:M.y,fill:Ro.bloom,opacity:0,r:2.5,ref:q=>{T.current[Y]=q}},`${M.x},${M.y}`))]})}const Uy=3,Ve={action:6e3,plain:2600};function Hy(a,s,c=Uy){return[...a.filter(f=>f.kind!==s.kind),s].slice(-c)}function qy(a,s){return a.filter(c=>c.id!==s)}const p1=a=>a.trim().replace(/\s+/g," ").toLowerCase();function $y(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[h,g]of c)if(h!==s&&p1(g)===p1(r))return{kind:"taken",by:g};return{kind:"set",value:r}}function Yy(a,s){try{return new URL(a,s).toString()}catch{return a}}function Gy({displayName:a,preview:s,previewUrl:c,title:r}){const f=a===r?"":` (shown as ${JSON.stringify(a)})`,h=s?.note?` — ${s.note}`:"",g=s?.tags.length?` [${s.tags.join(", ")}]`:"",x=[`Leglas direction ${JSON.stringify(r)}${f}${h}${g}`];return s?.file?x.push(`Source: ${s.file}`):s?.branch?x.push(`Branch: ${s.branch}`):s&&x.push(`Route: ${s.url}`),x.push(`Preview: ${c}`),s?.basedOn&&x.push(`A variant of: ${s.basedOn}`),x.push("","Inspect this direction in full:",` npx leglas show ${JSON.stringify(r)} --json`),x.join(`
|
|
10
|
-
`)}function fm(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 dm(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 g1(a,s,c="open",r=[]){const f=new Map(s.map(y=>[y.title,y])),h=new Set([...a.deleted,...a.hidden]),g=I1(a.order,s.map(y=>y.title)).filter(y=>!h.has(y)),x=[],v=[];for(const y of g)(fm(f.get(y))===null?v:x).push(y);return{request:{scope:"rail",titles:v,layout:dm(a,v,null),reach:c,routes:[...r]},leftOut:x}}function Xy(a,s,c,r,f="open",h=[]){const g=new Map(s.map(w=>[w.title,w])),x=r===null||r===c?null:r,v=x===null?[c]:[c,x];if(c==="")return{request:null,reason:"Nothing is on stage yet"};for(const w of v){const C=fm(g.get(w));if(C!==null)return{request:null,reason:`${a.renames[w]??w} ${C}`}}return{request:{scope:x===null?"direction":"compare",titles:v,layout:dm(a,v,x),reach:f,routes:[...h]},reason:null}}function cf(a,s){return a.length===s.length&&a.every((c,r)=>c===s[r])}function Qy(a,s){if(a.scope!==s.scope||!cf(a.titles,s.titles)||a.reach!==s.reach)return!1;const c=a.layout,r=s.layout,f=Object.entries(c.renames).toSorted(),h=Object.entries(r.renames).toSorted();return cf(c.order,r.order)&&cf([...c.collapsedFamilies].toSorted(),[...r.collapsedFamilies].toSorted())&&c.compare===r.compare&&c.viewport===r.viewport&&f.length===h.length&&f.every(([g,x],v)=>g===h[v]?.[0]&&x===h[v]?.[1])}function gf(a){return JSON.stringify({collapsedFamilies:a.collapsedFamilies,order:a.order,renames:a.renames,viewport:a.viewport})}function Vy(a,s,c){const r=W1(gf(s),c);return{...a,collapsedFamilies:r.collapsedFamilies,order:r.order,renames:r.renames,viewport:r.viewport}}function hm(a,s,c){return a==="rail"?`The whole rail · ${s.length} direction${s.length===1?"":"s"}`:s.map(c).join(" + ")}function mm(a){return a===0?"nobody on it yet":a===1?"1 watching":`${a} watching`}function Zy(a,s,c){const r=new Set(s),f=new Set;for(const h of a){const g=h.dataset.preview;if(g===void 0||!r.has(g))continue;let x=[];try{x=h.contentWindow?.performance.getEntriesByType("resource")??[]}catch{continue}for(const v of x)try{const{origin:y,pathname:w}=new URL(v.name);if(y!==c)continue;f.add(w)}catch{}}return[...f].toSorted()}function Ky(a){const s=a.lastIndexOf("/");return s<=0?null:a.slice(0,s+1)}function Fy(a){return a.reduce((s,c)=>s+c.viewers,0)}function Jy(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 Wy(a,s){return a.trim()===""?`Link ${s+1}`:a}async function Za(a,s){const c=await a.json().catch(()=>null),r=Ga(c)?c.error:null;return new Error(qn(r)?r:s)}function Zt(a){return a.json()}async function Cf(a,s,c){const r=await fetch(a,{body:JSON.stringify(s),headers:{"content-type":"application/json"},method:"POST"});if(!r.ok)throw await Za(r,c);return Zt(r)}function Iy({previews:a,project:s,onToggleSplit:c,onToggleHelp:r,onToggleTools:f,onToggleNote:h,suspended:g=!1,viewer:x}){const v=Lg(s),y=()=>W1(x!==void 0?gf(x.layout):typeof window>"u"?null:window.localStorage.getItem(v),a),[w,C]=S.useState(y),T=new Map(a.map(X=>[X.title,X])),k=()=>{const X=y();return X.order.find(de=>!X.hidden.includes(de))??X.order[0]??""},[M,Y]=S.useState(k),q=typeof window<"u"&&window.self!==window.top,[z,V]=S.useState(()=>[k()]),[H,W]=S.useState(""),[ee,ne]=S.useState([]),b=X=>{ne(de=>de.length?[]:de),W(X)},[te,ue]=S.useState(!1),[P,he]=S.useState(()=>new Set),[re,Ee]=S.useState(null),[we,Te]=S.useState(null),[L,I]=S.useState(null),[se,Se]=S.useState(!1),[ye,j]=S.useState({}),[U,ae]=S.useState([]),[oe,pe]=S.useState(null),Ce=S.useRef(1),R=S.useRef(null),Z=S.useRef(0),ie=X=>{Z.current+=1,ae(de=>Hy(de,{...X,id:Z.current}))},xe=X=>ae(de=>qy(de,X)),Ne=X=>{Y(X),V(de=>de.includes(X)?de:[...de,X])};S.useEffect(()=>{x===void 0&&window.localStorage.setItem(v,JSON.stringify(w))},[w,v,x]);const Ge=x===void 0?null:gf(x.layout),[lt,at]=S.useState(Ge);Ge!==lt&&(at(Ge),x!==void 0&&C(X=>Vy(X,x.layout,a))),S.useEffect(()=>()=>{R.current&&clearTimeout(R.current)},[]);const ze=X=>w.renames[X]??X,Je=X=>T.get(X)?.url??"/",Et=X=>{const de=T.get(X);return de?.branch===void 0?null:de.state??{status:"idle"}},Nt=X=>{x===void 0&&fetch("/leglas/api/previews/start",{body:JSON.stringify({title:X}),headers:{"content-type":"application/json"},method:"POST"}).catch(()=>{})},qt=X=>{if(!H.trim())return!0;const de=H.toLowerCase(),De=T.get(X);return ze(X).toLowerCase().includes(de)||X.toLowerCase().includes(de)||(De?.note??"").toLowerCase().includes(de)||(De?.tags??[]).some(_e=>_e.toLowerCase().includes(de))},$n=a.map(X=>X.title).filter(X=>!w.deleted.includes(X)),yn=I1(w.order,$n),Fa=H.trim()!=="",Dn=Fa?ee:w.collapsedFamilies,dt=new Map(a.flatMap(X=>X.basedOn===void 0?[]:[[X.title,X.basedOn]])),$t=yn.filter(X=>!w.hidden.includes(X)&&qt(X)),{rows:sn,meta:Yn,parents:Ml,children:Ja,roots:Nl}=i1($t,dt,new Set([...Dn,...P])),tl=Ay(i1($t,dt,new Set).meta),Wa=(X,de,De)=>C(_e=>({..._e,order:iy(_e.order,a.map(ce=>ce.title),X,de,De)})),kn=X=>cy(X,dt),At=ry(Yn),un=(X,de)=>X.includes(de)?X.filter(De=>De!==de):[...X,de],Tt=X=>Fa?ne(de=>un(de,X)):C(de=>({...de,collapsedFamilies:un(de.collapsedFamilies,X)})),ma=X=>T.get(X)?.basedOn??null,Ia=yn.filter(X=>!w.hidden.includes(X)).length,Al=(X,de=!1)=>{C(De=>({...De,hidden:De.hidden.filter(_e=>_e!==X)})),de&&Ne(X)},nl=X=>{const de=ze(X),De=M===X;if(C(_e=>({..._e,hidden:[..._e.hidden,X]})),De){const _e=yn.find(ce=>ce!==X&&!w.hidden.includes(ce));_e&&Ne(_e)}ie({action:{label:"Undo",run:()=>Al(X,De)},kind:`remove:${X}`,message:`${de} removed from the list`,tone:"info",ttl:Ve.action})},Gn=async X=>{const de=[...new Set(X)].filter(ce=>w.hidden.includes(ce)),De=de.filter(ce=>T.get(ce)?.local===!0);if(De.length>0){const ce=await fetch("/leglas/api/previews/delete",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({titles:De})});if(!ce.ok)throw await Za(ce,"The directions could not be deleted from Leglas.")}const _e=new Set(de);if(C(ce=>Bg(ce,de)),V(ce=>ce.filter($e=>!_e.has($e))),de.includes(M)){const ce=yn.find($e=>!_e.has($e)&&!w.hidden.includes($e));Y(ce??"")}w.hidden.every(ce=>_e.has(ce))&&ue(!1)},Yt=(X,de)=>C(De=>{const _e={...De.renames};return de===void 0?delete _e[X]:_e[X]=de,x!==void 0?{...De,renames:_e}:(fetch("/leglas/api/renames",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({renames:_e})}).catch(()=>{}),{...De,renames:_e})}),_t=X=>{Ee(X),Te(null)},on=(X,de,De="submit")=>{const _e=new Map($n.map(Ze=>[Ze,ze(Ze)])),ce=$y(de,X,_e);if(ce.kind==="taken"){if(De==="submit"){Te(`${ce.by} already goes by that name.`);return}_t(null),ie({kind:`rename:${X}`,message:`Still called ${ze(X)}. ${ce.by} already goes by that name.`,tone:"info",ttl:Ve.plain});return}if(_t(null),ce.kind==="same")return;const $e=w.renames[X];Yt(X,ce.kind==="reset"?void 0:ce.value),ie({action:{label:"Undo",run:()=>Yt(X,$e)},kind:`rename:${X}`,message:ce.kind==="reset"?`Name reset to ${ce.value}`:`Renamed to ${ce.value}`,tone:"success",ttl:Ve.action})};S.useEffect(()=>{const X=sn,de=ce=>{const $e=ce.target,Ze=$e?.tagName?.toLowerCase(),Oe=f2({key:ce.key,altKey:ce.altKey,ctrlKey:ce.ctrlKey,metaKey:ce.metaKey,shiftKey:ce.shiftKey,typing:Ze==="input"||Ze==="textarea"||Ze==="select"||($e?.isContentEditable??!1)});if(Oe&&!(g&&Oe.kind!=="help")&&!(x!==void 0&&(Oe.kind==="request"||Oe.kind==="note"))){if(Oe.kind==="search"||Oe.kind==="request")ce.preventDefault(),C(ot=>ot.collapsed?{...ot,collapsed:!1}:ot),pe({target:Oe.kind,nonce:Ce.current++});else if(Oe.kind==="split")ce.preventDefault(),c?.();else if(Oe.kind==="help")ce.preventDefault(),r?.();else if(Oe.kind==="tools")ce.preventDefault(),f?.();else if(Oe.kind==="note")ce.preventDefault(),h?.();else if(Oe.kind==="rail")C(ot=>({...ot,collapsed:!ot.collapsed}));else if(Oe.kind==="jump"){const ot=X[Oe.index];ot&&(ce.preventDefault(),Ne(ot))}else if(Oe.kind==="move"){ce.preventDefault();const ot=X.indexOf(M),ll=Oe.delta===1?X[Math.min(X.length-1,ot+1)]:X[Math.max(0,ot-1)];ll&&Ne(ll)}}},De=[window];for(const ce of Array.from(document.querySelectorAll("iframe")))try{const $e=ce.contentDocument;$e&&De.push($e)}catch{}const _e=de;for(const ce of De)ce.addEventListener("keydown",_e);return()=>{for(const ce of De)ce.removeEventListener("keydown",_e)}},[M,sn.join("|"),c,r,f,h,g,z.join("|"),Object.entries(ye).filter(([,X])=>X).map(([X])=>X).join("|")]);const xn=(X,de)=>{const De=Yy(Je(X),window.location.origin),_e=de==="link"?De:Gy({displayName:ze(X),preview:T.get(X),previewUrl:De,title:X});$o(_e).then(ce=>{if(ce==="blocked"){I(null),ie({detail:De,kind:"copy",message:"Your browser blocked the clipboard. The direction is at:",tone:"danger",ttl:null});return}I({kind:de,title:X}),R.current&&clearTimeout(R.current),R.current=setTimeout(()=>I(null),1200),ie({kind:"copy",message:de==="link"?`Link to ${ze(X)} copied`:`Reference to ${ze(X)} copied`,tone:"success",ttl:Ve.plain})})},pa=X=>xn(X,"link"),Tl=X=>xn(X,"reference"),Xn=X=>{X.preventDefault();const de=X.currentTarget;de.setPointerCapture(X.pointerId);const De=X.clientX,_e=w.width;Se(!0);const ce=Ze=>{const Oe=Math.min(K1,Math.max(Z1,_e+Ze.clientX-De));C(ot=>ot.width===Oe?ot:{...ot,width:Oe})},$e=Ze=>{de.releasePointerCapture(Ze.pointerId),de.removeEventListener("pointermove",ce),de.removeEventListener("pointerup",$e),de.removeEventListener("pointercancel",$e),Se(!1)};de.addEventListener("pointermove",ce),de.addEventListener("pointerup",$e),de.addEventListener("pointercancel",$e)},Qn=(X,de)=>j(De=>p2(De,X,de)),Pa=(X,de)=>m2(ye,X,de),ei=X=>j(de=>g2(de,X)),ti=q?[M]:$n.filter(X=>z.includes(X));return{active:M,ancestryOf:kn,copied:L,copyLink:pa,copyReference:Tl,deleteRemoved:Gn,displayName:ze,dismissToast:xe,dragFolded:P,focusing:oe,hiddenCount:w.hidden.length,hide:nl,isLoaded:Pa,lanes:At,insets:tl,loaded:ye,markLoaded:Qn,matches:qt,nested:q,notify:ie,onHandlePointerDown:Xn,panes:ti,prefs:w,railChildren:Ja,railParents:Ml,railRoots:Nl,reorderAmong:Wa,previewFor:X=>T.get(X),query:H,rename:on,renameError:we,renaming:re,parentOf:ma,resetLoaded:ei,resizing:se,restore:Al,rowMeta:Yn,rows:sn,toggleFamily:Tt,setActive:Ne,setDragFolded:he,setPrefs:C,setQuery:b,setShowHidden:ue,showHidden:te,startRename:_t,toasts:U,urlFor:Je,branchState:Et,startBranch:Nt,visibleCount:Ia,viewports:J1,viewing:x!==void 0}}function y1(a){const s=a?.trim()??"";return s===""?null:s}function yf(a){const s=y1(a?.basedOn),c=y1(a?.askedFor);return s===null&&c===null?null:{basedOn:s,askedFor:c}}function Py(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 x1=80,ex=6,tx=8;function nx(a){if(a==null)return null;const s=a.trim();return/^[A-Za-z][\w-]*$/.test(s)?s:null}function lx(a){return qn(a)?a.trim().split(/\s+/).filter(Boolean).slice(0,ex):[]}function Oo(a){const s=(a??"").replace(/\s+/g," ").trim();return s.length>x1?`${s.slice(0,x1-1)}…`:s}function ax(a){const s=[];let c=a;for(;c!==null&&s.length<tx;){const r=c.tagName.toLowerCase();if(r==="body"||r==="html")break;const f=nx(c.id);if(f!==null)return s.unshift(`#${f}`),s.join(" > ");const h=c.parentElement;if(h===null){s.unshift(r);break}let g=1;for(let x=0;x<h.children.length;x+=1){const v=h.children[x];if(v===c)break;v?.tagName===c.tagName&&(g+=1)}s.unshift(`${r}:nth-of-type(${g})`),c=h}return s.join(" > ")}function v1(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 b1(a,s,c,r){return{classes:lx(a.className),rect:{height:Math.round(s.height),width:Math.round(s.width),x:Math.round(s.x),y:Math.round(s.y)},selector:ax(a),spot:{x:r===void 0?.5:v1(r.x-s.x,s.width),y:r===void 0?.5:v1(r.y-s.y,s.height)},tag:a.tagName.toLowerCase(),text:Oo(a.textContent),viewport:Math.round(c)}}const w1=6;function S1(a,s){return Math.abs(s.x-a.x)>=w1||Math.abs(s.y-a.y)>=w1}function j1(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 ix(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 E1(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 sx(a,s){const c=a.width>0?a.width:1,r=a.height>0?a.height:1,f=h=>Math.round(Math.min(1,Math.max(0,h))*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 ux(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 ox(a){const s=a.gap??8,{anchor:c,bounds:r,card:f}=a,h=c.y+c.height+s,g=c.y-s-f.height,x=h+f.height>r.height&&g>=0,v=x?g:h;let y=c.x;return y+f.width>r.width&&(y=r.width-f.width),{flipped:x,left:Math.max(0,y),top:Math.max(0,Math.min(v,Math.max(0,r.height-f.height)))}}function rx(a){return!Number.isFinite(a)||a<=0?256:Math.round(Math.min(256,Math.max(180,a-48)))}function cx(a){if(a.length===0)return null;const s=Math.min(...a.map(h=>h.x)),c=Math.min(...a.map(h=>h.y)),r=Math.max(...a.map(h=>h.x+h.width));return{height:Math.max(...a.map(h=>h.y+h.height))-c,width:r-s,x:s,y:c}}const fx=8;function dx(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===fx))break}return c}const To=2,hx=4e3,C1=600,M1=80;function mx(a){const s=a.note.length>M1?`${a.note.slice(0,M1-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 px(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 fa(a){return"left"in a?{height:a.height,width:a.width,x:a.left,y:a.top}:a}function gx(a,s){return s.x>=a.x&&s.y>=a.y&&s.x<=a.x+a.width&&s.y<=a.y+a.height}function yx({notes:a,onExit:s,onForget:c,onKeep:r,onRevise:f,paneScale:h,scaling:g,sent:x,title:v}){const y=S.useRef(null),w=S.useRef(null),C=S.useRef(null),T=S.useRef(null),[k,M]=S.useState(null),[Y,q]=S.useState(null),[z,V]=S.useState(null),H=S.useRef(0),[W,ee]=S.useState(null),[ne,b]=S.useState(null),[te,ue]=S.useState([]),[P,he]=S.useState({height:92,width:256}),re=S.useCallback(()=>{const R=document.querySelector(`iframe[data-preview="${CSS.escape(v)}"]`);if(R===null)return null;let Z=null;try{Z=R.contentDocument}catch{return null}const ie=Z?.defaultView??null;if(Z===null||ie===null)return null;const xe=R.getBoundingClientRect();return{doc:Z,rect:xe,scale:ie.innerWidth>0?xe.width/ie.innerWidth:1,view:ie}},[v]),Ee=S.useCallback((R,Z)=>{const ie=re();return ie===null?null:{x:(R-ie.rect.left)/ie.scale,y:(Z-ie.rect.top)/ie.scale}},[re]),we=S.useCallback((R,Z)=>{const ie=R.doc.elementFromPoint(Z.x,Z.y);if(ie===null)return null;const xe=new Set;let Ne=ie,Ge=0;for(let ze=0;Ne!==null&&ze<3&&Ge<C1;ze+=1){xe.add(Ne);const Je=R.doc.createTreeWalker(Ne,NodeFilter.SHOW_ELEMENT);let Et=Je.nextNode();for(;Et!==null&&Ge<C1;){const Nt=Et;xe.has(Nt)||(xe.add(Nt),Ge+=1),Et=Je.nextNode()}Ne=Ne.parentElement}const lt=ze=>{const Je=ze.tagName.toLowerCase();return(Oo(ze.textContent)===""?0:4)+(Je==="a"||Je==="button"||Je==="img"?3:0)+(/^h[1-6]$/.test(Je)||Je==="p"||Je==="li"?2:0)},at=[...xe].flatMap(ze=>{const Je=ze.tagName.toLowerCase();if(ze===R.doc.body||ze===R.doc.documentElement||Je==="head"||Je==="script"||Je==="style")return[];const Et=fa(ze.getBoundingClientRect());if(Et.width<=0||Et.height<=0||!gx(Et,Z))return[];const Nt=R.view.getComputedStyle(ze);return Nt.display==="none"||Nt.visibility==="hidden"?[]:[{box:Et,element:ze,weight:lt(ze)}]});return at.length===0?null:(at.sort((ze,Je)=>{const Et=ze.element.contains(Je.element),Nt=Je.element.contains(ze.element);if(Et!==Nt)return Et?1:-1;const qt=Je.weight-ze.weight;return qt!==0?qt:ze.box.width*ze.box.height-Je.box.width*Je.box.height}),at[0]??null)},[]),Te=S.useCallback((R,Z)=>{let ie=null;try{ie=R.doc.querySelector(Z.selector)}catch{}const xe=fa(ie===null?Z.rect:ie.getBoundingClientRect()),Ne=Z.spot??{x:.5,y:.5},Ge=Z.region?ux(xe,Z.region):null;return{about:Ge??xe,box:Ge??{height:0,width:0,x:xe.x+Ne.x*xe.width,y:xe.y+Ne.y*xe.height},stale:ie===null}},[]),L=S.useCallback(()=>{const R=re();return R===null?[]:a.map((Z,ie)=>{const xe=Te(R,Z.anchor);return{anchor:Z.anchor,box:xe.box,id:Z.id,note:Z.note,number:ie+1,region:Z.anchor.region?xe.about:null,sent:x.has(Z.id),stale:xe.stale}})},[Te,re,a,x]),I=S.useCallback(()=>ue(L()),[L]),se=S.useCallback(()=>{const R=C.current,Z=re();R===null||Z===null||z!==null||M(we(Z,R)?.box??null)},[we,re,z]);S.useEffect(()=>{I();const R=re(),Z=()=>{I(),se()};return R?.view.addEventListener("scroll",Z,{passive:!0}),R?.view.addEventListener("resize",Z),window.addEventListener("resize",Z),()=>{R?.view.removeEventListener("scroll",Z),R?.view.removeEventListener("resize",Z),window.removeEventListener("resize",Z)}},[re,I,se]),S.useEffect(()=>{const R=y.current;if(R===null)return;const Z=ie=>{const xe=re();xe!==null&&(ie.preventDefault(),xe.view.scrollBy({behavior:"auto",left:ie.deltaX,top:ie.deltaY}))};return R.addEventListener("wheel",Z,{passive:!1}),()=>R.removeEventListener("wheel",Z)},[re]),S.useEffect(()=>{const R=Ne=>{if(Ne.key==="Escape"){if(z!==null){V(null);return}s()}},Z=[window],ie=re();ie!==null&&Z.push(ie.doc);const xe=R;for(const Ne of Z)Ne.addEventListener("keydown",xe);return()=>{for(const Ne of Z)Ne.removeEventListener("keydown",xe)}},[re,s,z]),S.useEffect(()=>{z===null||z.kind!=="kept"||a.some(R=>R.id===z.id)||V({anchor:z.anchor,answered:!0,field:z.field,kind:"new",note:z.note})},[a,z]),S.useEffect(()=>{const R=w.current;if(z===null||R===null)return;const Z=R.offsetHeight,ie=R.offsetWidth;he(xe=>xe.height===Z&&xe.width===ie?xe:{height:Z,width:ie})},[z]);const Se=(R,Z)=>{const ie=[...R.doc.body.querySelectorAll("*")].slice(0,hx),xe=ie.filter(lt=>{const at=fa(lt.getBoundingClientRect());return at.width>0&&at.height>0&&ix(Z,at)}),Ne=xe.filter(lt=>!xe.some(at=>at!==lt&<.contains(at))&&!E1(fa(lt.getBoundingClientRect()),Z)&&(Oo(lt.textContent)!==""||["a","button","canvas","img","input","svg","video"].includes(lt.tagName.toLowerCase())));let Ge=R.doc.body;for(const lt of ie){const at=fa(lt.getBoundingClientRect());E1(at,Z)&&Ge.contains(lt)&&(Ge=lt)}return{bounds:cx(Ne.map(lt=>fa(lt.getBoundingClientRect())))??Z,covers:dx(Ne.map(lt=>({tag:lt.tagName.toLowerCase(),text:Oo(lt.textContent)}))),holder:Ge}},ye=(R,Z)=>{const ie=re();if(ie===null)return;if(Z!==null&&S1(Z,R)){const Ne=j1(Z,R),{bounds:Ge,covers:lt,holder:at}=Se(ie,Ne),ze=fa(at.getBoundingClientRect());V({anchor:{...b1(at,ze,ie.view.innerWidth,{x:Ge.x+Ge.width/2,y:Ge.y+Ge.height/2}),covers:lt,region:sx(ze,Ge)},field:String(H.current+=1),kind:"new",note:""}),b(null);return}const xe=we(ie,R);xe!==null&&(V({anchor:b1(xe.element,xe.box,ie.view.innerWidth,R),field:String(H.current+=1),kind:"new",note:""}),b(null))},j=g&&h>0?1/h:1,U=re(),ae={height:U?.view.innerHeight??0,width:U?.view.innerWidth??0},oe=rx(ae.width),pe=z===null||U===null?null:Te(U,z.anchor),Ce=pe===null?null:ox({anchor:pe.about,bounds:ae,card:{height:P.height*j,width:oe*j}});return o.jsxs("div",{className:`absolute inset-0 z-20 ${z===null?"cursor-crosshair":"cursor-default"}`,onPointerDown:R=>{if(z!==null)return;const Z=Ee(R.clientX,R.clientY),ie=re();if(!(Z===null||ie===null)){try{R.currentTarget.setPointerCapture(R.pointerId)}catch{}T.current={from:Z,scroll:{x:ie.view.scrollX,y:ie.view.scrollY}}}},onPointerLeave:()=>{C.current=null,T.current===null&&M(null)},onPointerMove:R=>{if(z!==null)return;const Z=Ee(R.clientX,R.clientY),ie=re();if(Z===null||ie===null)return;C.current=Z;const xe=T.current;if(xe!==null){const Ne={x:xe.from.x+xe.scroll.x-ie.view.scrollX,y:xe.from.y+xe.scroll.y-ie.view.scrollY};q(S1(Ne,Z)?j1(Ne,Z):null),M(null);return}M(we(ie,Z)?.box??null)},onPointerUp:R=>{const Z=T.current;if(T.current=null,q(null),z!==null)return;const ie=Ee(R.clientX,R.clientY),xe=re();if(ie===null||xe===null)return;const Ne=Z===null?null:{x:Z.from.x+Z.scroll.x-xe.view.scrollX,y:Z.from.y+Z.scroll.y-xe.view.scrollY};M(null),ye(ie,Ne)},ref:y,children:[k!==null&&z===null&&Y===null?o.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,Y!==null?o.jsx("div",{className:"pointer-events-none absolute rounded-sm border-2 border-dashed border-[#7C9CFF] bg-[#7C9CFF]/10",style:{height:Y.height,left:Y.x,top:Y.y,width:Y.width}}):null,te.map(R=>o.jsxs("div",{children:[R.region===null?null:o.jsx("div",{className:`pointer-events-none absolute rounded-sm border-2 border-dashed ${R.stale?"border-amber-500/70 bg-amber-500/5":"border-[#7C9CFF]/70 bg-[#7C9CFF]/5"}`,style:{height:R.region.height+To*2,left:R.region.x-To,top:R.region.y-To,width:R.region.width+To*2}}),o.jsxs("button",{"aria-label":mx(R),className:"group/pin absolute size-5 cursor-pointer",onClick:Z=>{Z.stopPropagation(),V({anchor:R.anchor,field:String(H.current+=1),id:R.id,kind:"kept",note:R.note}),b(null)},onPointerDown:Z=>Z.stopPropagation(),onPointerMove:Z=>Z.stopPropagation(),onPointerUp:Z=>Z.stopPropagation(),style:{left:R.box.x,top:R.box.y,transform:`translate(-50%, -50%) scale(${j})`,transformOrigin:"center"},type:"button",children:[o.jsx("span",{"aria-hidden":!0,className:"absolute -inset-1.5"}),o.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 ${R.stale?"bg-amber-500":"bg-[#7C9CFF]"} ${R.sent?"ring-2 ring-white/80":""}`,title:px(R),children:R.number}),o.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:R.note||"No words"})]})]},R.id)),z!==null&&pe!==null&&Ce!==null?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"pointer-events-none absolute bg-[#7C9CFF]/10 outline outline-2 outline-[#7C9CFF]",style:{height:pe.about.height,left:pe.about.x,top:pe.about.y,width:pe.about.width}}),o.jsxs("form",{className:"absolute z-30 rounded-lg border border-[#232328] bg-[#1E1E22] p-1.5 shadow-2xl",onClick:R=>R.stopPropagation(),onPointerDown:R=>R.stopPropagation(),onSubmit:R=>{R.preventDefault();const Z=z.field;if(W===Z)return;const ie=R.currentTarget.elements.namedItem("note"),xe=ie instanceof HTMLInputElement?ie.value.trim():"";ee(Z),b(Ne=>Ne===Z?null:Ne),(z.kind==="new"?r(z.anchor,xe):f(z.id,xe)).then(Ne=>{ee(Ge=>Ge===Z?null:Ge),Ne?V(Ge=>Ge?.field===Z?null:Ge):b(Z)}).catch(()=>{ee(Ne=>Ne===Z?null:Ne),b(Z)})},ref:w,style:{left:Ce.left,top:Ce.top,transform:`scale(${j})`,transformOrigin:Ce.flipped?"bottom left":"top left",width:oe},children:[o.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:z.note,onInput:ne===z.field?()=>b(null):void 0,name:"note",placeholder:z.kind==="kept"?"What is wrong with it?":z.anchor.region?"What is wrong with this area?":`What is wrong with this ${z.anchor.tag}?`},z.field),z.kind==="kept"?o.jsxs(o.Fragment,{children:[x.has(z.id)?o.jsx("p",{className:"px-1 pt-1 text-[10px] leading-snug text-[#B7A57A]",children:"Already sent. New words go with the next change."}):null,pe.stale?o.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,ne===z.field?o.jsx("p",{className:"px-1 pt-1 text-[10px] leading-snug text-[#F87171]",children:"Those words were not saved. Enter tries again."}):null,o.jsxs("div",{className:"flex items-center justify-between gap-3 px-1 pt-1 text-[10px] leading-snug text-[#84848C]",children:[o.jsx("button",{className:"rounded transition-colors hover:text-[#F87171]",onClick:()=>{c(z.id),V(null)},type:"button",children:"Forget it"}),o.jsx("span",{children:"Enter saves · Esc drops"})]})]}):o.jsxs(o.Fragment,{children:[z.answered?o.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,ne===z.field?o.jsx("p",{className:"px-1 pt-1 text-[10px] leading-snug text-[#F87171]",children:"Those words were not saved. Enter tries again."}):null,o.jsx("p",{className:"px-1 pt-1 text-[10px] leading-snug text-[#84848C]",children:z.anchor.covers&&z.anchor.covers.length>0?`${z.anchor.covers.length} ${z.anchor.covers.length===1?"element":"elements"} · Enter keeps it · Esc drops it`:"Enter keeps it · Esc drops it"})]})]})]}):null]})}const pm=["image/png","image/jpeg","image/webp","image/gif"],Mf=4,xx=1e7;function vx(a){return pm.includes(a.type)}function bx(a,s){const c=[],r=[];let f=Math.max(0,Mf-a.length);for(const h of s){if(!vx(h)){r.push({file:h,why:"not-an-image"});continue}if(h.size>xx){r.push({file:h,why:"too-big"});continue}if(f===0){r.push({file:h,why:"too-many"});continue}f-=1,c.push(h)}return{accepted:c,refused:r}}function wx(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 ${Mf} 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.":`${Nf(s.file.name)} is not an image Leglas can attach. PNG, JPEG, WebP or GIF.`}}function Nf(a){const s=a.replace(/\s+/g," ").trim();return s===""?"image":s}function Sx(a){const s=Nf(a).replace(/[^\x20-\x7E]/g,"").trim();return(s===""?"image":s).slice(0,80)}function jx(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 Ex(a){return a.flatMap(s=>s.status==="ready"&&s.id!==null?[s.id]:[])}function Cx(a){return a.some(s=>s.status==="failed")?"failed":a.some(s=>s.status==="uploading")?"uploading":null}function Do(a){return a===void 0?!1:Array.from(a).includes("Files")}function Mx({drafts:a,onRemove:s,onRetry:c}){return a.length===0?null:o.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 o.jsxs("li",{className:"leglas-reference group/reference relative",children:[o.jsx(ut,{label:f?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"block",children:"Did not upload"}),o.jsx("span",{className:"block text-[#9CA3AF]",children:"Click to try again"})]}):`${r.name} · ${jx(r.bytes)}`,children:f?o.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:o.jsx(N1,{draft:r,failed:!0})}):o.jsx(N1,{draft:r,failed:!1})}),r.status==="uploading"?o.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?o.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,o.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:o.jsx("svg",{"aria-hidden":!0,fill:"none",height:"8",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.75",viewBox:"0 0 16 16",width:"8",children:o.jsx("path",{d:"m4 4 8 8M12 4l-8 8"})})})]},r.key)})})}function N1({draft:a,failed:s}){return o.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 Nx=(a,s)=>fetch(a,s);async function Ax(a,s=Nx){const c=await s("/leglas/api/references",{body:a,headers:{"content-type":a.type,"x-leglas-filename":Sx(a.name??"")},method:"POST"});if(!c.ok)throw new Error("Leglas refused the image.");const r=await Zt(c),f=r.reference?.id,h=r.reference?.file;if(r.ok!==!0||!qn(f)||!qn(h))throw new Error("Leglas refused the image.");return{id:f,file:h}}const Yo=(a,s)=>fetch(a,s);async function Tx(a=Yo){const s=await a("/leglas/api/annotations");if(!s.ok)throw new Error("Leglas refused the notes.");return(await Zt(s)).annotations??[]}async function Af(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 Zt(r);if(f.ok!==!0)throw new Error("Leglas refused the note.");return f}function Dx(a,s,c,r=Yo){return Af("/leglas/api/annotations",{anchor:c,note:s,title:a},r)}function kx(a,s,c=Yo){return Af("/leglas/api/annotations/update",{id:a,note:s},c)}function zx(a,s=Yo){return Af("/leglas/api/annotations/delete",{ids:a},s)}function Rx(a){return[...new Set(a.flatMap(s=>s.mode!=="variant"&&(s.status==="queued"||s.status==="picked-up"||s.status==="running")?[s.title]:[]))]}function Ox(a){return new Set(a.filter(s=>s.status==="queued"||s.status==="picked-up"||s.status==="running").flatMap(s=>s.notes??[]))}function _x(a){return new Set(a.flatMap(s=>s.status==="picked-up"||s.status==="running"?[s.title]:[]))}function Lx(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 Bx(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 Ux(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 Hx(a,s=null){return a.kind==="running"?a.stopping?"waiting for it to exit":a.waiting!==null?Bx(a.waiting):a.quietSince!==null&&s!==null?`no output for ${gm(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 gm(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 qx(a,s,c){const r=a.find(g=>g.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(g=>g.status==="queued").length;if(f>0)return{kind:"queued",count:f,attended:c};if(a.some(g=>g.status==="picked-up"))return{kind:"picked-up"};const h=a.findLast(g=>g.status==="failed"||g.status==="cancelled");return h===void 0?null:h.status==="cancelled"?{kind:"stopped",id:h.id,title:h.title}:{kind:"failed",id:h.id,title:h.title,reason:h.failure?.message??null}}const Ka=(a,s)=>fetch(a,s),$x=5e3,Yx=1e4;async function ym(a,s,c,r){const f=new AbortController,h=setTimeout(()=>f.abort(),c);try{return await r(a,{...s,signal:f.signal})}finally{clearTimeout(h)}}async function A1(a=!1,s=Ka){const c=await ym(`/leglas/api/agents${a?"?refresh=1":""}`,void 0,$x,s);if(!c.ok)throw new Error("Leglas refused the agent request.");return Zt(c)}async function Qi(a,s,c){const r={method:"POST"};s!==null&&(r.headers={"content-type":"application/json"},r.body=JSON.stringify(s));const f=await ym(a,r,Yx,c);if(!f.ok)throw new Error("Leglas refused the agent request.");if((await Zt(f)).ok!==!0)throw new Error("Leglas refused the agent request.")}function Gx(a,s,c=Ka){return Qi("/leglas/api/agent",{agent:a},c)}function Xx(a,s,c=Ka){return Qi("/leglas/api/agent",{agent:a,effort:s},c)}function Qx(a=Ka){return Qi("/leglas/api/agents/warm",null,a)}function Vx(a,s=Ka){return Qi("/leglas/api/requests/cancel",a==null?null:{id:a},s)}function Zx(a,s=Ka){return Qi("/leglas/api/requests/retry",{id:a},s)}function Kx(a,s=Ka){return Qi("/leglas/api/requests/dismiss",{id:a},s)}const xf={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 Fx(a,s){return s==="copying"?"Copying…":s==="copied"?"Copied":a.copyLabel}function Jx(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 Wx=Object.keys(xf);function Ix({client:a}){return o.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"?o.jsx(Xi,{id:"claude",size:17}):o.jsxs("span",{className:"flex -space-x-1.5",children:[o.jsx("span",{className:"flex size-5 items-center justify-center rounded-full bg-[#25252B] ring-1 ring-[#3A3A42]",children:o.jsx(Xi,{id:"codex",size:14})}),o.jsx("span",{className:"flex size-5 items-center justify-center rounded-full bg-[#25252B] ring-1 ring-[#3A3A42]",children:o.jsx(Xi,{id:"cursor",size:13})})]})})}function Px({connected:a,fallbackFocusRef:s,onClose:c}){const[r,f]=S.useState("claude"),[h,g]=S.useState("idle"),x=S.useRef(null),v=S.useRef(null),y=S.useRef(c);y.current=c,S.useEffect(()=>{const M=x.current;if(M===null)return;const Y=document.activeElement instanceof HTMLElement?document.activeElement:null,q=V=>{V.preventDefault(),y.current()},z=V=>{if(V.key!=="Tab")return;const H=Array.from(M.querySelectorAll("button:not(:disabled), input:not(:disabled), [href], [tabindex]:not([tabindex='-1'])")),W=H[0],ee=H.at(-1);W===void 0||ee===void 0?(V.preventDefault(),M.focus()):V.shiftKey&&document.activeElement===W?(V.preventDefault(),ee.focus()):!V.shiftKey&&document.activeElement===ee&&(V.preventDefault(),W.focus())};return M.addEventListener("cancel",q),M.addEventListener("keydown",z),M.open||M.showModal(),v.current?.focus(),()=>{M.removeEventListener("cancel",q),M.removeEventListener("keydown",z),M.open&&M.close();const V=s.current;(V?.isConnected?V:Y)?.focus()}},[s]);const w=xf[r],C=Jx(a),T=M=>{f(M),g("idle")},k=async()=>{if(h==="copying")return;g("copying");const M=await $o(w.snippet);g(M==="copied"?"copied":"blocked")};return o.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:M=>{M.target===M.currentTarget&&c()},ref:x,tabIndex:-1,children:o.jsxs("div",{className:"w-[calc(100vw-2rem)] max-w-lg overscroll-contain rounded-xl border border-[#2A2A30] bg-[#1E1E22] p-5 shadow-2xl",children:[o.jsxs("div",{className:"flex items-start gap-3",children:[o.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:o.jsx(eu,{size:24})}),o.jsxs("div",{className:"min-w-0 pt-0.5",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(em,{height:11}),o.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"})]}),o.jsx("h2",{className:"mt-2 text-base font-medium text-white",id:"mcp-connect-title",children:"Connect agent via MCP"}),o.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."})]})]}),o.jsxs("fieldset",{className:"mt-5",children:[o.jsx("legend",{className:"text-[10px] font-medium uppercase tracking-[0.08em] text-[#84848C]",children:"MCP client"}),o.jsx("div",{className:"mt-2 grid grid-cols-1 gap-2 sm:grid-cols-2",children:Wx.map((M,Y)=>{const q=xf[M],z=r===M;return o.jsxs("label",{className:`flex cursor-pointer items-start gap-2.5 rounded-lg border p-3 transition-[background-color,border-color,color] duration-150 ${z?"border-[#6678B8] bg-[#7C9CFF]/10 text-white":"border-[#2A2A30] bg-[#19191D] text-[#D1D5DB] hover:border-[#3A3A42] hover:bg-[#24242A]"}`,children:[o.jsx("input",{checked:z,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(M),ref:Y===0?v:void 0,type:"radio",value:M}),o.jsx(Ix,{client:M}),o.jsxs("span",{className:"min-w-0",children:[o.jsx("span",{className:"block text-xs font-medium",children:q.label}),o.jsx("span",{className:"mt-0.5 block text-[10px] leading-relaxed text-[#84848C]",children:q.description})]})]},M)})})]}),o.jsxs("div",{className:"mt-5 overflow-hidden rounded-lg border border-[#2A2A30] bg-[#151519]",children:[o.jsxs("div",{className:"flex min-h-9 items-center justify-between gap-3 border-b border-[#2A2A30] px-3",children:[o.jsx("span",{className:"text-[10px] font-medium text-[#84848C]",children:w.codeLabel}),o.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:h==="copying",onClick:()=>{k()},type:"button",children:[o.jsx(an,{d:ln.copy,size:12}),Fx(w,h)]})]}),o.jsx("pre",{"aria-label":w.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:o.jsx("code",{children:w.snippet})})]}),o.jsx("p",{className:"mt-2 min-h-4 text-[10px] leading-relaxed",role:"status",children:h==="blocked"?o.jsx("span",{className:"text-red-300",children:"Clipboard access is blocked. Select and copy the text above."}):h==="copied"?o.jsx("span",{className:"text-emerald-300",children:"Copied to the clipboard."}):null}),o.jsxs("div",{className:"mt-4 space-y-4",children:[o.jsx("p",{className:"text-xs leading-relaxed text-[#9CA3AF]",children:w.nextStep}),o.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:[o.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?o.jsx("svg",{fill:"none",height:"10",viewBox:"0 0 12 12",width:"10",children:o.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}),o.jsxs("span",{className:"min-w-0",children:[o.jsx("span",{className:`block text-xs font-medium ${a?"text-emerald-200":"text-[#D1D5DB]"}`,children:C.title}),o.jsx("span",{className:"mt-0.5 block text-[10px] leading-relaxed text-[#84848C]",children:C.detail})]})]})]}),o.jsx("div",{className:"mt-5 flex justify-end",children:o.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 xm={low:"Low",medium:"Medium",high:"High",xhigh:"Extra high",max:"Maximum"};function ev({agents:a,chip:s,connectRef:c,menuRef:r,onConnect:f,onPick:h,onPickEffort:g,open:x,pickingAgent:v,savingEffort:y,selectedAgent:w,selectedEffort:C,setOpen:T}){return o.jsxs("div",{"aria-hidden":!x,"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 ${x?"translate-y-0 scale-100 opacity-100":"pointer-events-none translate-y-1 scale-95 opacity-0"}`,inert:!x,ref:r,role:"dialog",tabIndex:-1,children:[a.filter(k=>k.available).map(k=>{const M=s.kind==="chosen"&&k.id===s.id;return o.jsxs("button",{className:Gi,disabled:v!==null||y,onClick:()=>M?T(!1):h(k.id),type:"button",children:[o.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[o.jsx(Xi,{id:k.id}),o.jsx("span",{className:"truncate",children:k.name})]}),v===k.id?o.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"?o.jsx("span",{className:"text-[10px] text-amber-400/80",children:"signed out"}):M&&o.jsx("span",{"aria-label":"current choice",children:"✓"})]},k.id)}),s.kind==="chosen"&&s.id==="custom"?o.jsxs("button",{className:Gi,onClick:()=>T(!1),type:"button",children:[o.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[o.jsx(Xi,{id:"custom"}),o.jsx("span",{className:"truncate",children:s.name})]}),o.jsx("span",{"aria-label":"current choice",children:"✓"})]}):null,w!==void 0&&w.efforts.length>0?o.jsx("div",{className:"mt-1 border-t border-[#232328] px-1 pb-0.5 pt-1.5",children:o.jsxs("label",{className:"flex min-h-7 items-center justify-between gap-3",children:[o.jsx("span",{className:"text-[10px] font-medium text-[#84848C]",children:"Effort"}),o.jsxs("select",{"aria-busy":y,"aria-label":`${w.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:y||v!==null,onChange:k=>{const M=k.currentTarget.value;g(w.efforts.find(Y=>Y===M)??null)},value:C??"",children:[o.jsx("option",{value:"",children:"Agent default"}),w.efforts.map(k=>o.jsx("option",{value:k,children:xm[k]},k))]})]})}):null,o.jsx("div",{className:"mt-1 border-t border-[#232328] pt-1",children:o.jsx("button",{className:`${Gi} text-[#84848C]`,onClick:()=>{T(!1),f()},ref:c,type:"button",children:o.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[o.jsx(an,{d:ln.link,size:14}),o.jsx("span",{className:"truncate",children:"Connect agent via MCP…"})]})})})]})}function tv({agents:a,chip:s,chosenSignedOut:c,connectRef:r,menuRef:f,onConnect:h,onPick:g,onPickEffort:x,onRefresh:v,open:y,pickingAgent:w,savingEffort:C,selectedAgent:T,selectedEffort:k,setOpen:M,triggerRef:Y}){return s.kind==="none"?o.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:h,ref:r,type:"button",children:[o.jsx(an,{d:ln.link,size:12}),o.jsx("span",{className:"truncate",children:"Connect agent via MCP…"})]}):o.jsxs("div",{className:"relative flex min-w-0 items-center",children:[o.jsx(ev,{agents:a,chip:s,connectRef:r,menuRef:f,onConnect:h,onPick:g,onPickEffort:x,open:y,pickingAgent:w,savingEffort:C,selectedAgent:T,selectedEffort:k,setOpen:M}),o.jsxs("button",{"aria-expanded":y,"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:()=>{y||v(),M(q=>!q)},ref:Y,type:"button",children:[s.kind==="chosen"&&o.jsx(Xi,{id:s.id,size:12}),o.jsx("span",{className:"truncate",children:s.kind==="chosen"?`${s.name}${k===null?"":` · ${xm[k]}`}`:"Choose an agent"}),c&&o.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:o.jsx("span",{className:"sr-only",children:"signed out"})}),o.jsx("svg",{"aria-hidden":"true",className:`shrink-0 transition-transform duration-150 motion-reduce:transition-none ${y?"rotate-180":""}`,fill:"none",height:"12",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.75",viewBox:"0 0 16 16",width:"12",children:o.jsx("path",{d:"M4 6.5 8 10.5l4-4"})})]})]})}const nv="size-3 animate-spin rounded-full border-[1.5px] border-current border-t-transparent motion-reduce:animate-none";function lv({kind:a}){return a==="stopped"?o.jsx("span",{"aria-hidden":"true",className:"flex size-3.5 shrink-0 items-center justify-center text-[#84848C]",children:o.jsx("span",{className:"block size-2 rounded-[2px] bg-current"})}):a==="failed"?o.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:[o.jsx("path",{d:"M8 2.6 14.6 13.4H1.4Z"}),o.jsx("path",{d:"M8 6.8v2.7"}),o.jsx("path",{d:"M8 11.6h.01"})]}):a==="queued"?o.jsx("span",{"aria-hidden":"true",className:"flex size-3.5 shrink-0 items-center justify-center",children:o.jsx("span",{className:"size-1.5 animate-pulse rounded-full bg-[#84848C] motion-reduce:animate-none"})}):o.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 ff({busy:a,children:s,disabled:c,label:r,onClick:f,standalone:h=!1,tip:g}){return o.jsx(ut,{label:g,children:o.jsx("button",{"aria-label":r,className:`flex h-6 w-6 ${h?"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?o.jsx("span",{className:nv}):s})})}function T1({children:a}){return o.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 av({action:a,card:s,onCancel:c,onDismiss:r,onRetry:f}){const h=s.kind==="running"?s.startedAt:null,[g,x]=S.useState(()=>Date.now());S.useEffect(()=>{if(h===null)return;x(Date.now());const y=window.setInterval(()=>x(Date.now()),1e3);return()=>window.clearInterval(y)},[h]);const v=Hx(s,h===null?null:g);return o.jsx("div",{className:"mx-3 mt-2 rounded-lg border border-[#232328] bg-[#1E1E22] px-2.5 py-2 shadow-lg",role:"status",children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(lv,{kind:s.kind}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsx("p",{className:"truncate text-[11px] font-medium leading-tight text-[#D1D5DB]",children:Ux(s)}),v!==null&&o.jsx("p",{className:"mt-0.5 text-[10px] leading-tight text-[#84848C]",children:v})]}),h!==null&&o.jsx("span",{className:"shrink-0 text-[10px] tabular-nums text-[#84848C]",children:gm(g-h)}),s.kind==="running"&&o.jsx(ff,{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:o.jsx("span",{className:"block size-2 rounded-[2px] bg-current"})}),(s.kind==="failed"||s.kind==="stopped")&&o.jsxs("span",{className:"flex shrink-0 items-center",children:[o.jsx(ff,{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:o.jsxs(T1,{children:[o.jsx("path",{d:"M13.5 8a5.5 5.5 0 1 1-1.6-3.9"}),o.jsx("path",{d:"M13.7 1.8v2.7H11"})]})}),o.jsx(ff,{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:o.jsx(T1,{children:o.jsx("path",{d:"m4 4 8 8M12 4l-8 8"})})})]})]})})}function iv({annotating:a,count:s,onToggle:c}){return o.jsx(ut,{label:o.jsxs(o.Fragment,{children:[o.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"}),o.jsx("span",{className:"block text-[#9CA3AF]",children:a?"Click a detail · drag an area · Esc to stop":o.jsx("kbd",{className:"font-sans",children:"A"})})]}),children:o.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:[o.jsxs("svg",{"aria-hidden":!0,fill:"none",height:"11",stroke:"currentColor",strokeWidth:"1.7",viewBox:"0 0 16 16",width:"11",children:[o.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"}),o.jsx("circle",{cx:"8",cy:"6",r:"1.4"})]}),"Annotate",s>0?o.jsx("span",{className:"rounded-full bg-white/15 px-1 text-[9px] leading-[1.5] text-white",children:s}):null]})})}function sv({count:a,disabled:s,inputRef:c,onFiles:r}){return o.jsxs(o.Fragment,{children:[o.jsx("input",{accept:pm.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"}),o.jsx(ut,{label:o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"block",children:"Attach a reference image"}),o.jsx("span",{className:"block text-[#9CA3AF]",children:"Paste or drop one, too"})]}),children:o.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:o.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:[o.jsx("rect",{height:"10.5",rx:"1.8",width:"12.5",x:"1.75",y:"2.75"}),o.jsx("circle",{cx:"5.6",cy:"6.3",r:"1.1"}),o.jsx("path",{d:"m14.25 10.4-3.1-3.1a1 1 0 0 0-1.4 0L4.5 12.5"})]})})})]})}function uv({mode:a,onToggle:s}){return o.jsx(ut,{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:o.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"?o.jsxs("svg",{"aria-hidden":!0,fill:"none",height:"11",stroke:"currentColor",strokeWidth:"1.7",viewBox:"0 0 16 16",width:"11",children:[o.jsx("circle",{cx:"4.5",cy:"3.6",r:"1.9"}),o.jsx("circle",{cx:"11.5",cy:"12.4",r:"1.9"}),o.jsx("path",{d:"M4.5 5.5v2.6a4.3 4.3 0 0 0 4.3 4.3h0.8",strokeLinecap:"round"})]}):o.jsx("svg",{"aria-hidden":!0,fill:"none",height:"11",stroke:"currentColor",strokeWidth:"1.7",viewBox:"0 0 16 16",width:"11",children:o.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 ov({ready:a,sending:s,target:c}){return o.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?o.jsx("span",{className:"size-3 animate-spin rounded-full border-[1.5px] border-current border-t-transparent motion-reduce:animate-none"}):o.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:o.jsx("path",{d:"M8 13V3M3.5 7.5 8 3l4.5 4.5"})})})}function rv({errored:a,fromApp:s,loaded:c,onReload:r,onShowAnyway:f,refusal:h,serverUp:g,src:x}){return a?o.jsx(nm,{onReload:r,reason:g||!s?`${x} didn’t respond.`:"Your dev server stopped. This returns on its own once it is back."}):h!==null?o.jsx(Wg,{href:x,onShowAnyway:f,...S2(h,x,window.location.origin)}):o.jsx(Kg,{loaded:c})}function cv({annotate:a,boxHeight:s,boxWidth:c,branch:r,branchName:f,busy:h,designWidth:g,errored:x,frameHeight:v,framed:y,fromApp:w,identity:C,loaded:T,name:k,onError:M,onReady:Y,onReload:q,onShowAnyway:z,onStartBranch:V,order:H,paneScale:W,refusal:ee,scaling:ne,second:b,serverUp:te,shown:ue,splitting:P,src:he,title:re,viewport:Ee}){return o.jsxs("div",{className:ue?P?`relative min-w-0 flex-1 overflow-auto ${b?"border-l border-[#232328]":""} ${ne?"flex flex-col items-center justify-center gap-2.5":y?"flex min-h-full justify-center p-6":""}`:y?"flex min-h-full justify-center p-6":"absolute inset-0":"hidden",style:P?{order:H}:void 0,children:[P&&o.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:o.jsxs("span",{className:"rounded-full bg-[#1C1C20]/85 px-2.5 py-1 text-[11px] font-medium text-[#E8E8EA] shadow-lg backdrop-blur",children:[k,ne&&o.jsxs("span",{className:"ml-1.5 font-normal text-[#8E8E96]",children:[Math.round(g),"px · ",Math.round(W*100),"%"]})]})}),o.jsxs("div",{className:ne?"relative shrink-0 overflow-hidden rounded-[10px] shadow-[0_0_0_1px_rgba(255,255,255,0.12)]":y?`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 ${Xa} motion-reduce:transition-none`:"relative size-full",style:ne?{height:s,width:c}:y?{width:Ee??void 0}:void 0,children:[o.jsxs("div",{className:ne?"relative origin-top-left":"relative size-full",style:ne?{height:v,transform:`scale(${W})`,width:g}:void 0,children:[r!==null&&r.status!=="ready"?o.jsx(Fg,{branch:f,onStart:V,state:r}):o.jsx("iframe",{className:`size-full border-0 bg-white ${h?"pointer-events-none":""}`,onError:M,onLoad:we=>{const Te=we.currentTarget.dataset.previewIdentity;Te!==void 0&&(!he.startsWith("/")||Ef(we.currentTarget))&&Y(Te,we.currentTarget)},"data-preview":re,"data-preview-identity":C,src:he,title:`Preview: ${k}`},C),a]}),r!==null&&r.status!=="ready"?null:o.jsx(rv,{errored:x,fromApp:w,loaded:T,onReload:q,onShowAnyway:z,refusal:ee,serverUp:te,src:he}),!te&&T&&w&&o.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 flex justify-center p-3",children:o.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 vf=[{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 fv({applyOverlayPref:a,copied:s,fontKey:c,href:r,notify:f,onCopyReference:h,onShortcuts:g,open:x,parked:v,popoverRef:y,prefs:w,setPrefs:C,splitting:T,viewing:k,viewports:M}){return o.jsxs("div",{"aria-hidden":!x,"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 ${v?"hidden ":""}${x?"translate-y-0 scale-100 opacity-100":"pointer-events-none translate-y-1 scale-95 opacity-0"}`,inert:!x,ref:y,role:"dialog",tabIndex:-1,children:[o.jsx("span",{className:"block px-1 pb-1 pt-0.5 text-[10px] uppercase tracking-[0.08em] text-[#84848C]",children:"Typeface"}),o.jsx("div",{"aria-label":"Interface typeface",className:"flex items-center gap-0.5 rounded-md bg-[#2E2E2E]/40 p-0.5",role:"group",children:vf.map(Y=>o.jsx("button",{"aria-pressed":c===Y.key,className:`flex-1 rounded px-2 py-1 text-xs transition-colors ${c===Y.key?"bg-[#2E2E2E] font-medium text-white":"text-[#9CA3AF] hover:text-[#D1D5DB]"}`,onClick:()=>C(q=>({...q,font:Y.key})),style:{fontFamily:Y.stack},type:"button",children:Y.label},Y.key))}),o.jsx("span",{className:"block px-1 pb-1 pt-2 text-[10px] uppercase tracking-[0.08em] text-[#84848C]",children:"Viewport"}),o.jsx("div",{"aria-label":"Viewport width",className:"flex items-center gap-0.5 rounded-md bg-[#2E2E2E]/40 p-0.5",role:"group",children:M.map(({label:Y,width:q})=>o.jsx("button",{className:`flex-1 rounded px-2 py-1 text-xs transition-colors ${w.viewport===q?"bg-[#2E2E2E] font-medium text-white":"text-[#9CA3AF] hover:text-[#D1D5DB]"}`,onClick:()=>C(z=>({...z,viewport:q})),type:"button",children:Y},Y))}),T&&o.jsxs("button",{"aria-checked":w.scaleSplit,className:`${Gi} mt-1 ${w.scaleSplit?"text-white":"text-[#9CA3AF]"}`,onClick:()=>C(Y=>({...Y,scaleSplit:!Y.scaleSplit})),role:"switch",type:"button",children:[o.jsx("span",{children:"Scale each side to fit"}),o.jsx(af,{on:w.scaleSplit})]}),o.jsx("span",{className:"block px-1 pb-1 pt-2 text-[10px] uppercase tracking-[0.08em] text-[#84848C]",children:"Dev overlays"}),o.jsxs("button",{"aria-checked":w.showDevOverlays,className:`${Gi} ${w.showDevOverlays?"text-white":"text-[#9CA3AF]"}`,onClick:()=>{const Y=!w.showDevOverlays;C(q=>({...q,showDevOverlays:Y}));for(const q of document.querySelectorAll("iframe"))a(q,!Y)},role:"switch",type:"button",children:[o.jsx("span",{children:"Show dev tool overlay"}),o.jsx(af,{on:w.showDevOverlays})]}),o.jsxs("button",{"aria-checked":w.showWidget,className:`${Gi} ${w.showWidget?"text-white":"text-[#9CA3AF]"}`,onClick:()=>{const Y=!w.showWidget;C(q=>({...q,showWidget:Y})),Y||f({kind:"widget",message:"Press T to reopen the tools",tone:"info",ttl:Ve.plain+3e3})},role:"switch",type:"button",children:[o.jsx("span",{children:"Show Leglas overlay"}),o.jsx(af,{on:w.showWidget})]}),!k&&o.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:h,type:"button",children:[o.jsx(an,{d:ln.copy,size:12}),s?"Copied":"Copy reference"]}),o.jsx(ut,{label:"Or double-click any direction in the rail",children:o.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:[o.jsx("span",{className:"inline-block size-3 rounded-sm border border-current"}),"Open in new tab"]})}),o.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:g,type:"button",children:[o.jsx("span",{children:"Keyboard shortcuts"}),o.jsx("kbd",{className:"rounded border border-[#232328] bg-[#2E2E2E]/60 px-1 py-0.5 font-sans text-[10px] text-[#84848C]",children:"?"})]})]})}function dv({mac:a,onClose:s,viewer:c}){const r=S.useRef(null),f=d2(a,c);return S.useEffect(()=>{const h=document.activeElement instanceof HTMLElement?document.activeElement:null;r.current?.focus();const g=x=>{x.key==="Escape"&&(x.preventDefault(),s())};return window.addEventListener("keydown",g),()=>{window.removeEventListener("keydown",g),h?.focus?.()}},[s]),o.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-6 backdrop-blur-sm",onPointerDown:h=>{h.target===h.currentTarget&&s()},children:o.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:[o.jsx("span",{className:"block pb-3 text-[10px] uppercase tracking-[0.08em] text-[#84848C]",children:"Keyboard"}),o.jsx("dl",{className:"flex flex-col gap-2.5",children:f.map(h=>o.jsxs("div",{className:"flex items-baseline justify-between gap-4",children:[o.jsx("dt",{className:"flex shrink-0 items-baseline gap-1",children:h.keys.map((g,x)=>o.jsxs("span",{className:"flex items-baseline gap-1",children:[x>0&&h.join?o.jsx("span",{className:"text-[10px] text-[#84848C]",children:h.join}):null,o.jsx("kbd",{className:"rounded border border-[#232328] bg-[#2E2E2E]/60 px-1.5 py-0.5 font-sans text-[11px] text-[#E8E8EA]",children:g})]},g))}),o.jsx("dd",{className:"text-right text-xs leading-snug text-[#9CA3AF]",children:h.label})]},h.label))})]})})}function hv({busy:a,count:s,error:c,fallbackFocusRef:r,name:f,onCancel:h,onConfirm:g}){const x=S.useRef(null),v=S.useRef(null),y=S.useRef(h);y.current=h,S.useEffect(()=>{const k=v.current;if(k===null)return;const M=document.activeElement instanceof HTMLElement?document.activeElement:null,Y=z=>{z.preventDefault(),y.current()},q=z=>{if(z.key!=="Tab")return;const V=Array.from(k.querySelectorAll("button:not(:disabled)")),H=V[0],W=V.at(-1);H===void 0||W===void 0?(z.preventDefault(),k.focus()):z.shiftKey&&document.activeElement===H?(z.preventDefault(),W.focus()):!z.shiftKey&&document.activeElement===W&&(z.preventDefault(),H.focus())};return k.addEventListener("cancel",Y),k.addEventListener("keydown",q),k.open||k.showModal(),x.current?.focus(),()=>{k.removeEventListener("cancel",Y),k.removeEventListener("keydown",q),k.open&&k.close(),(M?.isConnected?M:r.current)?.focus()}},[]);const w=s===1,C=w?"Delete removed direction?":"Clear removed directions?",T=w?`This permanently removes “${f??"this direction"}” from Leglas.`:`This permanently removes all ${s} directions from Leglas.`;return o.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&&h()},ref:v,role:"alertdialog",tabIndex:-1,children:o.jsxs("div",{className:"w-[calc(100vw-3rem)] max-w-sm overscroll-contain rounded-lg border border-[#232328] bg-[#1E1E22] p-4 shadow-2xl",children:[o.jsx("h2",{className:"text-sm font-medium text-white",id:"delete-removed-title",children:C}),o.jsxs("div",{className:"mt-2 space-y-1 text-xs leading-relaxed text-[#9CA3AF]",id:"delete-removed-description",children:[o.jsx("p",{children:T}),o.jsx("p",{children:"Source files and shared project config stay untouched."})]}),c!==null?o.jsx("p",{className:"mt-3 text-xs leading-relaxed text-red-300",role:"alert",children:c}):null,o.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[o.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:h,ref:x,type:"button",children:"Cancel"}),o.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:g,type:"button",children:a?"Deleting…":w?"Delete":"Delete all"})]})]})})}function vm(a,s,c,r){const f=S.useRef(r);S.useLayoutEffect(()=>{f.current=r},[r]),S.useEffect(()=>{if(!a)return;s.current?.focus();const h=c.current,g=y=>{y.key==="Escape"&&(f.current(),h?.focus())},x=y=>{const w=y.target instanceof Node?y.target:null;!s.current?.contains(w)&&!h?.contains(w)&&f.current()},v=()=>f.current();return window.addEventListener("keydown",g),window.addEventListener("pointerdown",x),window.addEventListener("blur",v),()=>{window.removeEventListener("keydown",g),window.removeEventListener("pointerdown",x),window.removeEventListener("blur",v)}},[a,s,c])}async function mv(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 Zt(s)}async function D1(a){const s=await fetch("/leglas/api/share",{body:JSON.stringify(a),headers:{"content-type":"application/json"},method:"POST"});if(!s.ok)throw await Za(s,"Leglas could not start sharing.");return(await Zt(s)).share}async function pv(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 Za(s,"Leglas could not update the share.");return(await Zt(s)).share}async function lu(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 Za(r,c);return(await Zt(r)).share}function gv(a,s=!1){return lu("/allow",{path:a,subtree:s},"Leglas could not allow that path.")}function yv(a){return lu("/grants",{name:a},"Leglas could not make another link.")}function xv(a){return lu("/grants/revoke",{id:a},"Leglas could not turn that link off.")}function vv(a){return lu("/grants/extend",{id:a},"Leglas could not extend that link.")}function bv(){return lu("/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 Za(a,"Leglas could not stop sharing.")}const bm={cloudflared:"cloudflared",ngrok:"ngrok"},wv=1400;function Sv(){return o.jsx("svg",{"aria-hidden":!0,fill:"none",height:"11",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.8",viewBox:"0 0 16 16",width:"11",children:o.jsx("path",{d:"M8 3.5v9M3.5 8h9"})})}function ko({checked:a,detail:s,disabled:c=!1,onPick:r,title:f}){return o.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:[o.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:o.jsx("span",{className:`size-1.5 rounded-full bg-[#E8E8EA] transition-transform duration-150 motion-reduce:transition-none ${a?"scale-100":"scale-0"}`})}),o.jsxs("span",{className:"min-w-0 flex-1",children:[o.jsx("span",{className:`block text-xs ${a?"text-white":"text-[#D1D5DB]"}`,children:f}),o.jsx("span",{className:"mt-0.5 block truncate text-[10px] leading-snug text-[#84848C]",children:s})]})]})}function jv({busy:a,choice:s,displayName:c,onPick:r,onReach:f,onStart:h,provider:g,rail:x,reach:v,seeded:y,stage:w,stageOfPair:C}){const T=s==="rail"?x.request:w.request,k=x.request.titles.length;return o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"block px-1 pb-1 pt-0.5 text-[10px] uppercase tracking-[0.08em] text-[#84848C]",children:"Share"}),o.jsxs("div",{"aria-label":"What to share",className:"flex flex-col gap-0.5",role:"radiogroup",children:[o.jsx(ko,{checked:s==="rail",detail:k===0?"Nothing on the rail can be shared yet":`${k} direction${k===1?"":"s"}${x.leftOut.length===0?", as you see them":` · ${x.leftOut.length} on ${x.leftOut.length===1?"a branch":"branches"} left out`}`,disabled:k===0,onPick:()=>r("rail"),title:"The whole rail"}),o.jsx(ko,{checked:s==="stage",detail:w.request===null?w.reason??"":hm(w.request.scope,w.request.titles,c),disabled:w.request===null,onPick:()=>r("stage"),title:C?"The comparison on stage":"The direction on stage"})]}),o.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"}),o.jsxs("div",{"aria-label":"How far a viewer can go",className:"flex flex-col gap-0.5",role:"radiogroup",children:[o.jsx(ko,{checked:v==="open",detail:"Your whole dev server, over GET",onPick:()=>f("open"),title:"Anywhere in the app"}),o.jsx(ko,{checked:v==="listed",detail:y===0?"Open a direction first, so Leglas knows what it loads":`These pages and the ${y} files they loaded`,disabled:y===0,onPick:()=>f("listed"),title:"Only what you shared"})]}),o.jsx("div",{className:"mt-1.5 border-t border-[#232328] px-1 pb-1 pt-2",children:g==="none"?o.jsxs(o.Fragment,{children:[o.jsxs("p",{className:"flex items-center gap-1.5 text-[11px] text-amber-300/90",children:[o.jsx(jf,{}),"No tunnel program found"]}),o.jsxs("p",{className:"mt-1 text-[10px] leading-snug text-[#84848C]",children:["Install ",o.jsx("span",{className:"text-[#9CA3AF]",children:"cloudflared"})," or"," ",o.jsx("span",{className:"text-[#9CA3AF]",children:"ngrok"})," and Leglas will use it. Without one the link only works on this machine."]})]}):o.jsxs("p",{className:"text-[10px] leading-snug text-[#84848C]",children:["Out through ",o.jsx("span",{className:"text-[#9CA3AF]",children:bm[g]})," on this machine. The link lives as long as Leglas does."]})}),o.jsx("button",{className:`mt-1 ${tm}`,disabled:a!==null||T===null||T.titles.length===0,onClick:h,type:"button",children:a==="start"?o.jsx(Ya,{}):g==="none"?"Start on this machine":"Start sharing"}),o.jsx("p",{className:"px-1 pb-0.5 pt-2 text-[10px] leading-snug text-[#84848C]",children:v==="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 Ev({busy:a,copied:s,grant:c,index:r,now:f,onCopy:h,onExtend:g,onRevoke:x,only:v}){const y=Jy(c.expiresAt,f),w=c.expiresAt-f<3600*1e3,C=Wy(c.name,r);return o.jsxs("li",{className:"group relative flex h-8 items-center gap-2 rounded-md px-2 transition-colors hover:bg-white/[0.04]",children:[o.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-[#D1D5DB]",children:C}),o.jsx("span",{className:`shrink-0 text-[10px] group-hover:hidden group-has-[button:focus-visible]:hidden ${w?"text-amber-300/80":c.viewers>0?"text-[#D1D5DB]":"text-[#84848C]"}`,children:c.viewers>0?`${mm(c.viewers)} · ${y}`:y}),o.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:[o.jsx(ut,{label:s?"Copied":"Copy this link",children:o.jsx("button",{"aria-label":`Copy the ${C} link`,className:da,onClick:h,type:"button",children:s?o.jsx("span",{className:"text-[10px] text-emerald-300",children:"✓"}):o.jsx(an,{d:ln.link})})}),o.jsx(ut,{label:"Another 24 hours",children:o.jsx("button",{"aria-label":`Extend the ${C} link`,className:da,disabled:a!==null,onClick:g,type:"button",children:o.jsx(Sv,{})})}),o.jsx(ut,{label:v?"Turn off · the last link":"Turn off",children:o.jsx("button",{"aria-label":`Turn the ${C} link off`,className:`${da} hover:text-red-300`,disabled:a!==null,onClick:x,type:"button",children:o.jsx(an,{d:ln.trash,size:12})})})]})]})}function Cv({busy:a,onCreate:s}){const[c,r]=S.useState(""),[f,h]=S.useState(!1);return f?o.jsxs("form",{className:"mt-0.5 flex items-center gap-1 px-2 py-1",onSubmit:g=>{g.preventDefault(),s(c.trim()),r(""),h(!1)},children:[o.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:g=>r(g.target.value),onKeyDown:g=>{g.key==="Escape"&&(r(""),h(!1))},placeholder:"Who is it for?",value:c}),o.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"?o.jsx(Ya,{}):"Make"})]}):o.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:()=>h(!0),type:"button",children:"+ Another link"})}function Mv({busy:a,changed:s,copiedId:c,displayName:r,now:f,onAllow:h,onCopy:g,onCreate:x,onExtend:v,onRetry:y,onRevoke:w,onRotate:C,onStop:T,onUpdate:k,share:M}){const Y=M.tunnel;return o.jsxs(o.Fragment,{children:[o.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:[Y.status==="ready"?o.jsx(_o,{}):null,"Sharing"]}),o.jsx("div",{"aria-live":"polite",className:"px-1 pb-1.5 text-[11px] leading-snug",children:Y.status==="ready"?o.jsxs("p",{className:"flex items-center gap-1.5",children:[o.jsx(_o,{}),o.jsx("span",{className:"min-w-0 flex-1 truncate select-text font-mono text-[10px] text-[#D1D5DB]","data-selectable":!0,children:new URL(M.grants[0]?.url??"http://x").host})]}):Y.status==="starting"?o.jsxs("div",{className:"flex items-start gap-1.5 text-[#9CA3AF]",children:[o.jsx("span",{className:"mt-[3px]",children:o.jsx(Ya,{})}),Y.url===void 0?o.jsxs("span",{children:["Opening a tunnel through ",bm[Y.provider],"…"]}):Y.slow?o.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."}):o.jsx("span",{children:"Waiting for the link to answer…"})]}):Y.status==="failed"?o.jsxs("div",{children:[o.jsxs("p",{className:"flex items-start gap-1.5 text-amber-300/90",children:[o.jsx("span",{className:"mt-0.5",children:o.jsx(jf,{})}),o.jsx("span",{children:Y.reason})]}),o.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:y,type:"button",children:"Try again"})]}):o.jsxs("p",{className:"text-[#9CA3AF]",children:["Reachable from this machine only. Point a tunnel of your own at"," ",o.jsxs("span",{className:"select-text font-mono text-[#D1D5DB]","data-selectable":!0,children:["127.0.0.1:",M.sharePort]})," ","and send that host with the same path."]})}),o.jsxs("ul",{"aria-label":"Links into this share",className:"max-h-64 overflow-y-auto",children:[M.grants.map((q,z)=>o.jsx(Ev,{busy:a,copied:c===q.id,grant:q,index:z,now:f,onCopy:()=>g(q),onExtend:()=>v(q),onRevoke:()=>w(q),only:M.grants.length===1},q.id)),M.grants.length===0?o.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]}),o.jsx(Cv,{busy:a,onCreate:x}),M.reach==="listed"&&M.refused.length>0?o.jsxs("div",{className:"mt-1.5 border-t border-[#232328] pt-1.5",children:[o.jsxs("span",{className:"flex items-baseline gap-1.5 px-1 pb-1",children:[o.jsx("span",{className:"text-[10px] uppercase tracking-[0.08em] text-amber-300/90",children:"Turned away"}),o.jsxs("span",{className:"text-[10px] text-[#84848C]",children:[M.refused.length," ",M.refused.length===1?"path":"paths"," your app asked for"]})]}),o.jsx("ul",{"aria-label":"Paths this share turned away",className:"max-h-32 overflow-y-auto",children:M.refused.map(q=>{const z=Ky(q);return o.jsxs("li",{className:"group flex h-7 items-center gap-2 rounded-md px-2 transition-colors hover:bg-white/[0.04]",children:[o.jsx("span",{className:"min-w-0 flex-1 select-text truncate font-mono text-[10px] text-[#D1D5DB]","data-selectable":!0,title:q,children:q}),o.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:[o.jsx("button",{"aria-label":`Let ${q} 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:()=>h(q,!1),type:"button",children:"Allow"}),z===null?null:o.jsx("button",{"aria-label":`Let everything in ${z} 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:()=>h(z,!0),type:"button",children:"+ folder"})]})]},q)})})]}):null,o.jsxs("p",{className:"truncate px-1 pt-1.5 text-[10px] text-[#84848C]",children:[hm(M.scope,M.titles,r),M.reach==="listed"?" · only what you shared":""]}),o.jsxs("div",{className:"mt-2 flex items-center gap-1 border-t border-[#232328] pt-1.5",children:[s?o.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"?o.jsx(Ya,{}):"Update what they see"}):o.jsx("span",{className:"min-w-0 flex-1 truncate px-2 text-[10px] text-[#84848C]",children:M.scope==="rail"?"They see the rail as you do":"They see what you shared"}),o.jsx(ut,{label:o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"block",children:"Replace every link."}),o.jsx("span",{className:"block text-[#9CA3AF]",children:"For when one got somewhere you did not mean to send it."})]}),wide:!0,children:o.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:C,type:"button",children:a==="rotate"?o.jsx(Ya,{}):"Replace all"})}),o.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"?o.jsx(Ya,{}):"Stop"})]})]})}function Nv({active:a,compare:s,displayName:c,notify:r,onClose:f,open:h,prefs:g,previews:x,share:v,triggerRef:y,tunnels:w}){const C=S.useRef(null),[T,k]=S.useState("rail"),[M,Y]=S.useState("open"),[q,z]=S.useState(null),[V,H]=S.useState(null),[W,ee]=S.useState(()=>Date.now());S.useEffect(()=>{if(!h)return;ee(Date.now());const R=window.setInterval(()=>ee(Date.now()),6e4);return()=>window.clearInterval(R)},[h]);const ne=S.useRef(null),b=S.useRef(null),te=S.useRef(null);vm(h,C,y,f);const[ue,P]=S.useState([]),he=S.useMemo(()=>g1(g,x).request.titles,[g,x]);S.useEffect(()=>{h&&P(Zy(document.querySelectorAll("iframe[data-preview]"),he,window.location.origin))},[h,he]);const re=S.useMemo(()=>g1(g,x,M,ue),[g,x,M,ue]),Ee=S.useMemo(()=>Xy(g,x,a,s,M,ue),[g,x,a,s,M,ue]),we=w[0]??"none",Te=v===null?null:v.scope==="rail"?re.request:Ee.request,L=v!==null&&Te!==null&&!Qy(Te,{scope:v.scope,titles:v.titles,layout:v.layout,reach:v.reach,routes:v.routes}),I=v?.grants[0]??null,se=I===null?null:I.url!==null?I.url:v?.tunnel.status==="none"?I.localUrl:null;S.useEffect(()=>()=>{ne.current&&clearTimeout(ne.current)},[]);const Se=(R,Z=!1,ie=null)=>$o(R).then(xe=>{if(xe==="blocked"){if(H(null),Z)return;r({detail:R,kind:"share",message:"Your browser blocked the clipboard. The link is:",tone:"danger",ttl:null});return}H(ie),ne.current&&clearTimeout(ne.current),ne.current=setTimeout(()=>H(null),wv),Z||r({kind:"share",message:"Share link copied",tone:"success",ttl:Ve.plain})}),ye=v?.tunnel.status??null;S.useEffect(()=>{if(!(v===null||se===null||b.current!==v.id)){if(te.current!==v.id){te.current=v.id,Se(se,!0).then(()=>r({kind:"share",message:ye==="ready"||ye==="none"?"Your share is live. Link copied.":"Share link copied. Waiting for it to answer…",tone:"success",ttl:Ve.action}));return}ye==="ready"&&r({kind:"share",message:"Your share is live.",tone:"success",ttl:Ve.plain})}},[v?.id,se,ye]);const j=(R,Z)=>r({kind:"share",message:R instanceof Error?R.message:Z,tone:"danger",ttl:Ve.action}),U=R=>{q===null&&(z("start"),D1({...R,tunnel:we}).then(Z=>{b.current=Z.id}).catch(Z=>j(Z,"Leglas could not start sharing.")).finally(()=>z(null)))},ae=()=>{q===null&&(z("stop"),k1().then(()=>{r({kind:"share",message:"Stopped sharing",tone:"info",ttl:Ve.plain})}).catch(R=>j(R,"Leglas could not stop sharing.")).finally(()=>z(null)))},oe=()=>{q!==null||Te===null||(z("update"),pv(Te).then(()=>{r({kind:"share",message:"Viewers now see the rail as you do",tone:"success",ttl:Ve.plain})}).catch(R=>j(R,"Leglas could not update the share.")).finally(()=>z(null)))},pe=(R,Z,ie)=>{q===null&&(z(R),Z().then(()=>{r({kind:"share",message:ie,tone:"success",ttl:Ve.plain})}).catch(xe=>j(xe,"That did not work.")).finally(()=>z(null)))},Ce=()=>{if(q!==null||v===null)return;const R={scope:v.scope,titles:v.titles,layout:v.layout,reach:v.reach,routes:v.routes};z("start"),k1().then(()=>D1({...R,tunnel:we})).then(Z=>{b.current=Z.id}).catch(Z=>j(Z,"Leglas could not start sharing.")).finally(()=>z(null))};return o.jsx("div",{"aria-hidden":!h,"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 ${h?"translate-y-0 scale-100 opacity-100":"pointer-events-none -translate-y-1 scale-95 opacity-0"}`,inert:!h,ref:C,role:"dialog",tabIndex:-1,children:v===null?o.jsx(jv,{busy:q,choice:T,onReach:Y,reach:M,seeded:ue.length,displayName:c,onPick:k,onStart:()=>{const R=T==="rail"?re.request:Ee.request;R!==null&&U(R)},provider:we,rail:re,stage:Ee,stageOfPair:s!==null&&s!==a}):o.jsx(Mv,{busy:q,changed:L,copiedId:V,displayName:c,now:W,onAllow:(R,Z)=>pe("allow",()=>gv(R,Z),`${R} is in`),onCopy:R=>{const Z=R.url??R.localUrl;Se(Z,!1,R.id)},onCreate:R=>pe("grant",()=>yv(R),R===""?"Link made":`Link for ${R}`),onExtend:R=>pe("extend",()=>vv(R.id),"Another 24 hours on that link"),onRetry:Ce,onRevoke:R=>pe("revoke",()=>xv(R.id),"That link is off"),onRotate:()=>pe("rotate",()=>bv(),"Every link replaced, and the address with them"),onStop:ae,onUpdate:oe,share:v})})}const Av=6e4,Tv={share:null,tunnels:[]};function Dv(a){const[s,c]=S.useState(Tv),r=s.share!==null;return S.useEffect(()=>{if(!a)return;let f=!1;const h=nu(g=>mv(g).then(x=>{f||c(v=>JSON.stringify(v)===JSON.stringify(x)?v:x)}).catch(()=>{}),{everyMs:r?Lo:Av,subscribe:g=>tu().on("share",g)});return()=>{f=!0,h()}},[a,r]),s}const kv=9e4,zv=6*6e4,zo="https://leglas.vercel.app/changelog/",bf="leglas:updated";function wm(a){return a!==null&&a.available&&a.latest!==null&&a.latest.version!==a.skipped}function z1(a){return a===null?"Leglas":wm(a)&&a.latest!==null?`${a.latest.version} is out`:`Leglas ${a.version}`}function Rv(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 h=Math.floor(f/24);return h===1?"yesterday":`${h} days ago`}function Sm(a,s){return a.replace("@latest",`@${s}`)}function jm(a){switch(a){case"pnpm":return"pnpm dlx";case"bun":return"bunx";case"yarn":return"yarn dlx";default:return"npx"}}function R1(a){if(a===null)return"npx leglas";switch(a.install.kind){case"npx":return`${jm(a.install.manager)} leglas`;case"project":return`${a.install.manager==="npm"?"npx":`${a.install.manager} exec`} leglas`;default:return"leglas"}}function O1(a){return{heading:"Restarting Leglas",detail:`This page reloads once ${a} answers.`,spinner:!0}}function Ov(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 ${jm(c.manager)}. Your rail stays as it is.`;if(c.command===null)return null;const r=c.kind==="project"?" in this project":"";return`Runs ${Sm(c.command,s)}${r}, then restarts Leglas. Your rail stays as it is.`}function _v(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,...O1(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: ${R1(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 ${R1(a)}.`,warning:!0};if(a===null)return{...f,detail:"Reading…",spinner:!0};const{phase:h}=a;if(h.status==="installing")return{...f,heading:`Updating to ${h.version}`,detail:`Installing with ${a.install.manager}…`,spinner:!0};if(h.status==="waiting")return{...f,heading:`Updating to ${h.version}`,detail:"Installed. Waiting for the running change to finish, then restarting.",spinner:!0};if(h.status==="restarting")return{...f,...O1(h.version)};if(h.status==="failed")return{...f,heading:`Could not update to ${h.version}`,detail:h.reason,note:a.install.command===null?null:`Or run ${Sm(a.install.command,h.version)} yourself.`,warning:!0,primary:{label:"Try again",action:"install",disabled:a.busy}};const g=c||h.status==="checking";if(a.available&&a.latest!==null){const{latest:y}=a,w=y.version===a.skipped,C=a.install.kind!=="source";return{...f,heading:`${y.version} is out`,title:y.title,detail:w?"Skipped. Nothing will nag until the next release.":null,meta:`You have ${a.version}`,note:Ov(a,y.version),link:{label:"What's new",url:y.url},primary:C?{label:w?"Update anyway":"Update",action:"install",disabled:a.busy}:null,skip:!w}}const x=a.checkedAt===null?null:Rv(a.checkedAt,r),v=x===null?null:`Checked ${x}`;return g?{...f,heading:a.version,detail:"Asking npm…",meta:v,link:{label:"Changelog",url:zo},spinner:!0,primary:{label:"Check again",action:"check",disabled:!0}}:a.checkError!==null?{...f,heading:a.version,detail:a.checkError,meta:x===null?null:`Last answer ${x}`,link:{label:"Changelog",url:zo},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:zo},primary:{label:"Check for updates",action:"check",disabled:!1}}:{...f,heading:a.version,detail:"This is the latest version.",meta:v,link:{label:"Changelog",url:zo},primary:{label:"Check again",action:"check",disabled:!1}}}const Lv="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",Bv="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 Uv({onClose:a,open:s,triggerRef:c,updates:r}){const f=S.useRef(null);vm(s,f,c,a);const[h,g]=S.useState(()=>Date.now());S.useEffect(()=>{if(!s)return;g(Date.now());const y=window.setInterval(()=>g(Date.now()),6e4);return()=>window.clearInterval(y)},[s]);const x=_v(r.status,r.wait,r.checking,h),v=()=>{x.primary!==null&&(x.primary.action==="check"?r.check():r.install())};return o.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:[o.jsxs("div",{className:"flex items-center justify-between px-1 pb-1.5 pt-0.5",children:[o.jsx("span",{className:"text-[10px] uppercase tracking-[0.08em] text-[#84848C]",children:"Leglas"}),x.link!==null&&o.jsx("a",{className:"text-[10px] text-[#84848C] transition-colors hover:text-[#D1D5DB]",href:x.link.url,rel:"noreferrer",target:"_blank",children:x.link.label})]}),o.jsxs("div",{className:"px-1",children:[o.jsx("p",{className:"text-xs leading-snug text-white",children:x.heading}),x.title!==null&&o.jsx("p",{className:"mt-0.5 text-[11px] leading-snug text-[#D1D5DB]",children:x.title}),x.detail!==null&&o.jsxs("p",{"aria-live":"polite",className:`mt-1 flex items-start gap-1.5 text-[10px] leading-snug ${x.warning?"text-amber-300/90":"text-[#9CA3AF]"}`,children:[x.spinner&&o.jsx("span",{className:"mt-px",children:o.jsx(Ya,{})}),x.warning&&o.jsx("span",{className:"mt-px",children:o.jsx(jf,{})}),o.jsx("span",{children:x.detail})]}),x.meta!==null&&o.jsx("p",{className:"mt-0.5 text-[10px] leading-snug text-[#84848C]",children:x.meta})]}),(x.primary!==null||x.skip)&&o.jsxs("div",{className:"mt-2.5 flex items-center gap-1 px-1",children:[x.primary!==null&&o.jsx("button",{className:tm,disabled:x.primary.disabled,onClick:v,type:"button",children:x.primary.label}),x.skip&&o.jsx("button",{className:x.primary===null?Bv:Lv,onClick:r.skip,type:"button",children:x.primary===null?"Skip this version":"Skip"})]}),x.note!==null&&o.jsx("p",{className:"px-1 pb-0.5 pt-2 text-[10px] leading-snug text-[#84848C]",children:x.note})]})}async function Hv(a){const s=await fetch("/leglas/api/update",a===void 0?{}:{signal:a});if(!s.ok)throw await Za(s,`the server answered ${s.status}`);return Zt(s)}function qv(){return Cf("/leglas/api/update/check",{},"Leglas could not check for updates.")}function $v(a){return Cf("/leglas/api/update/skip",{version:a},"Leglas could not skip that version.")}function Yv(){return Cf("/leglas/api/update/install",{},"Leglas could not start the update.")}const Gv=15*6e4,Xv=15e3,Qv=1e3;function _1(a){if(a===null)return null;const{phase:s}=a;return s.status==="installing"||s.status==="waiting"?{version:s.version,allowance:zv}:s.status==="restarting"?{version:s.version,allowance:kv}:null}function Vv(a){try{window.sessionStorage.setItem(bf,a)}catch{}window.location.reload()}function Zv(a,s,c){const[r,f]=S.useState(null),[h,g]=S.useState({status:"none"}),[x,v]=S.useState(!1),y=S.useRef({status:r,wait:h,notify:c});S.useEffect(()=>{y.current={status:r,wait:h,notify:c}});const w=h.status==="waiting";S.useEffect(()=>{if(!a)return;let q=!1;const z=nu(V=>Hv(V).then(H=>{if(q)return;const W=y.current;if(W.status!==null&&H.version!==W.status.version){const ee=W.wait.status!=="none"?W.wait.version:_1(W.status)?.version??null;if(ee===null||H.version===ee){Vv(H.version);return}(W.wait.status!=="wrong"||W.wait.got!==H.version)&&g({status:"wrong",version:ee,got:H.version})}else W.wait.status!=="none"&&g({status:"none"});f(ee=>JSON.stringify(ee)===JSON.stringify(H)?ee:H)}).catch(()=>{if(q||y.current.wait.status!=="none")return;const H=_1(y.current.status);if(H===null)return;const W=Date.now();g({status:"waiting",version:H.version,since:W,until:W+H.allowance})}),{everyMs:w?Qv:s?Xv:Gv,subscribe:V=>tu().on("update",V)});return()=>{q=!0,z()}},[a,s,w]),S.useEffect(()=>{if(h.status!=="waiting")return;const{version:q,until:z}=h,V=window.setTimeout(()=>g(H=>H.status==="waiting"?{status:"lost",version:q}:H),Math.max(0,z-Date.now()));return()=>window.clearTimeout(V)},[h]);const C=r!==null;S.useEffect(()=>{if(!C)return;let q=null;try{q=window.sessionStorage.getItem(bf),q!==null&&window.sessionStorage.removeItem(bf)}catch{return}q!==null&&y.current.notify({kind:"update",message:`Leglas is now ${y.current.status?.version??q}`,tone:"success",ttl:Ve.action})},[C]);const T=q=>z=>y.current.notify({kind:"update",message:z instanceof Error?z.message:q,tone:"danger",ttl:Ve.action});return{status:r,wait:h,checking:x,check:()=>{x||(v(!0),qv().then(q=>f(q)).catch(T("Leglas could not check for updates.")).finally(()=>v(!1)))},skip:()=>{const q=y.current.status?.latest?.version;q!==void 0&&$v(q).then(z=>{f(z),y.current.notify({kind:"update",message:`${q} skipped`,note:"Nothing will nag until the next release.",tone:"info",ttl:Ve.plain})}).catch(T("Leglas could not skip that version."))},install:()=>{Yv().then(q=>f(q)).catch(T("Leglas could not start the update."))}}}function Kv({buttonRef:a,news:s,onToggle:c,open:r,status:f}){return o.jsx(ut,{label:z1(f),children:o.jsxs("button",{"aria-expanded":r,"aria-haspopup":"dialog","aria-label":s?`Leglas ${f.version}. ${z1(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&&o.jsx("span",{"aria-hidden":!0,className:"absolute -right-px top-0 size-1.5 rounded-full bg-[#7C9CFF]"})]})})}function Fv({active:a,compare:s,displayName:c,notify:r,onCollapse:f,prefs:h,previews:g,viewing:x}){const[v,y]=S.useState(!1),w=S.useCallback(()=>y(!1),[]),C=S.useRef(null),T=Dv(!x),[k,M]=S.useState(!1),Y=S.useCallback(()=>M(!1),[]),q=S.useRef(null),z=Zv(!x,k,r),V=wm(z.status);return o.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:[o.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[o.jsx(eu,{size:28}),o.jsx(em,{height:18}),!x&&z.status!==null&&o.jsx(Kv,{buttonRef:q,news:V,onToggle:()=>{y(!1),M(H=>!H)},open:k,status:z.status})]}),o.jsxs("span",{className:"flex shrink-0 items-center gap-0.5",children:[!x&&o.jsx(ut,{label:T.share===null?"Share this rail":T.share.tunnel.status==="ready"?`Sharing · ${mm(Fy(T.share.grants))}`:"Sharing",children:o.jsxs("button",{"aria-expanded":v,"aria-haspopup":"dialog","aria-label":T.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 ${v||T.share!==null?"text-white":"text-[#9CA3AF]"}`,onClick:()=>{M(!1),y(H=>!H)},ref:C,type:"button",children:[o.jsx(Yg,{}),T.share!==null&&o.jsx(_o,{className:"absolute right-0 top-0"})]})}),o.jsx(ut,{label:o.jsxs(o.Fragment,{children:["Collapse panel ",o.jsx("kbd",{className:"ml-1 text-[#9CA3AF]",children:"["})]}),side:"right",children:o.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:f,type:"button",children:o.jsx(an,{d:ln.sidebar,size:16})})})]}),!x&&o.jsx(Uv,{onClose:Y,open:k,triggerRef:q,updates:z}),!x&&o.jsx(Nv,{active:a,compare:s,displayName:c,notify:r,onClose:w,open:v,prefs:h,previews:g,share:T.share,triggerRef:C,tunnels:T.tunnels})]})}function Jv({children:a,displayName:s,name:c,preview:r,quiet:f}){const h=f?null:yf(r);return h===null?o.jsx(o.Fragment,{children:a}):o.jsx(ut,{label:o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"block text-white",children:c}),r?.note?o.jsx("span",{className:"mt-0.5 block font-normal text-[#D1D5DB]",children:r.note}):null,o.jsxs("span",{className:"mt-1.5 block border-t border-white/10 pt-1.5 font-normal text-[#84848C]",children:[h.basedOn===null?null:o.jsxs("span",{className:"block",children:["Variant of ",s(h.basedOn)]}),h.askedFor===null?null:o.jsxs("span",{className:"mt-0.5 block",children:["You asked for “",h.askedFor,"”"]})]})]}),side:"right",wide:!0,children:a})}const df=["#34D399","#38BDF8","#818CF8","#C084FC","#FB7185","#FB923C"];function Wv(a){let s=0;for(const r of a)s=s*31+r.charCodeAt(0)|0;const c=df[Math.abs(s)%df.length]??df[0];return{backgroundColor:`${c}22`,color:c}}function Iv(a){let s=0;for(const c of a)s=s*31+c.charCodeAt(0)|0;return Math.abs(s).toString(36)}function Pv({aside:a,carrying:s,comparing:c,same:r,scanning:f,tag:h,working:g}){return s>0?o.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] ${a}`,children:["+",s]}):c?o.jsx("span",{className:`shrink-0 rounded bg-white/[0.08] px-1.5 py-0.5 text-[10px] font-medium leading-normal text-[#E8E8EA] ${a}`,children:"Comparing"}):g?o.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 ${a}`,children:[o.jsx(mf,{"aria-label":"Working on direction",size:20,state:pf,theme:"dark"}),"Cooking"]}):r?o.jsx(ut,{label:`Rendered structure, layout, visual styles, media and vector geometry match ${r?.join(", ")} in a 1280 × 800 comparison.`,children:o.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 ${a}`,children:["Same as ",r?.length===1?r?.[0]:`${r?.length} others`]})}):f?o.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 ${a}`,children:[o.jsx(mf,{"aria-label":"Checking for duplicates",size:20,state:pf,theme:"dark"}),"Cooking"]}):h!==void 0&&o.jsx("span",{className:`shrink-0 rounded px-1.5 py-0.5 text-[10px] font-medium leading-normal ${a}`,style:Wv(h),children:h})}function eb({comparing:a,dragging:s,onToggleCompare:c,renaming:r,st:f,title:h,viewing:g}){return o.jsxs("div",{className:`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"}`,children:[h!==f.active&&o.jsx(ut,{label:a?"Stop comparing":`Compare with ${f.displayName(f.active)}`,children:o.jsx("button",{"aria-label":a?`Stop comparing ${f.displayName(h)}`:`Compare ${f.displayName(h)} with ${f.displayName(f.active)}`,"aria-pressed":a,className:`${da} ${a?"text-white":""}`,onClick:x=>{x.stopPropagation(),c()},type:"button",children:o.jsx(an,{d:ln.split})})}),!g&&o.jsxs(o.Fragment,{children:[o.jsx(ut,{label:f.copied?.kind==="link"&&f.copied.title===h?"Copied":"Copy preview link",children:o.jsx("button",{"aria-label":`Copy the preview link to the ${f.displayName(h)} direction`,className:da,onClick:()=>f.copyLink(h),type:"button",children:f.copied?.kind==="link"&&f.copied.title===h?o.jsx("span",{className:"text-[10px] text-emerald-300",children:"✓"}):o.jsx(an,{d:ln.link})})}),o.jsx(ut,{label:f.copied?.kind==="reference"&&f.copied.title===h?"Copied":o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"block",children:"Copy a detailed reference."}),o.jsx("span",{className:"block",children:"For a teammate or an agent."})]}),children:o.jsx("button",{"aria-label":`Copy a detailed reference to the ${f.displayName(h)} direction`,className:da,onClick:()=>f.copyReference(h),type:"button",children:f.copied?.kind==="reference"&&f.copied.title===h?o.jsx("span",{className:"text-[10px] text-emerald-300",children:"✓"}):o.jsx(an,{d:ln.copy,size:12})})}),o.jsx(ut,{label:"Rename",children:o.jsx("button",{"aria-label":`Rename the ${f.displayName(h)} direction`,className:da,onClick:()=>f.startRename(h),type:"button",children:o.jsx(an,{d:ln.pencil,size:12})})}),o.jsx(ut,{label:"Remove from list",children:o.jsx("button",{"aria-label":`Remove the ${f.displayName(h)} direction from the list`,className:da,onClick:()=>f.hide(h),type:"button",children:o.jsx(an,{d:ln.trash,size:12})})})]})]})}function tb({arriving:a,comparing:s,crumbBloom:c,drag:r,dragMeta:f,dragging:h,freshFor:g,gutter:x,index:v,insets:y,lit:w,onEnter:C,onFold:T,onOpenAlone:k,onPointerDown:M,onToggleCompare:Y,same:q,scanning:z,shiftFor:V,st:H,tint:W,title:ee,viewing:ne,working:b}){const te=ee===H.active,ue=b,P=H.previewFor(ee),he=h&&r?.title===ee,re=h&&!he?V(v):0,Ee=H.rowMeta.get(ee),Te=(Ee?.depth??0)>0,L=h&&H.dragFolded.has(ee)&&(Ee?.variants??0)===0?Ee?.descendants??0:0,I=Te?y.variant:y.root,se=Ee?.variants??0,Se=Ee?.folded??!1,ye=H.renaming===ee,j=he&&r?.blocked?"opacity-0 transition-opacity duration-150":h||ye?"transition-opacity duration-150":"group-hover:hidden group-has-[button:focus-visible]:hidden";return o.jsxs("li",{className:`group relative ${he?`z-30 ${r?.settling?`transition-transform duration-200 ${Xa} motion-reduce:transition-none`:""}`:"z-10"} ${h&&!he?`transition-transform duration-200 ${Xa} motion-reduce:transition-none`:""}`,"data-title":ee,onPointerEnter:U=>C(U.currentTarget),style:{...he?{transform:`translateY(${r?.dy??0}px)`}:re?{transform:`translateY(${re}px)`}:{},paddingLeft:I,viewTransitionName:`row-${Iv(ee)}`},children:[he&&r?.reason!=null?o.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,x>0&&Ee?.graph?o.jsx(Ty,{active:te,arriving:a(ee),bloom:c.title===ee?c.nonce:0,delay:Math.min(v,12)*28,family:(Ee?.descendants??0)>0,folded:Ee?.folded??!1,fresh:g(ee),lit:w,row:Ee.graph,tint:W,width:x,working:ue}):null,o.jsx(Jv,{displayName:H.displayName,name:H.displayName(ee),preview:P,quiet:ye,children:o.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":he?"bg-white/[0.06]":""} ${he?"shadow-2xl":""}`,onClick:()=>{if(!ye){if(f.current?.suppressed){f.current.suppressed=!1;return}H.setActive(ee)}},onDoubleClick:U=>{ye||U.target instanceof Element&&U.target.closest("button")||(window.getSelection()?.removeAllRanges(),k())},onKeyDown:U=>{U.target===U.currentTarget&&(U.key==="Enter"||U.key===" ")&&(U.preventDefault(),H.setActive(ee))},onPointerDown:M,role:"button",tabIndex:0,children:o.jsxs("span",{className:"min-w-0 flex-1",children:[o.jsxs("span",{className:`flex items-center gap-2 ${h||ye?"":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:[se>0&&o.jsx(ut,{label:Se?`Show ${se} variant${se===1?"":"s"}`:"Fold the variants away",children:o.jsxs("button",{"aria-expanded":!Se,"aria-label":`${Se?"Show":"Hide"} the variants of ${H.displayName(ee)}`,className:"flex shrink-0 items-center gap-1 rounded px-0.5 py-1 text-[#84848C] transition-colors hover:text-[#E8EAED]",onClick:U=>{U.stopPropagation(),T()},onPointerDown:U=>U.stopPropagation(),type:"button",children:[o.jsx("svg",{className:`size-2.5 transition-transform duration-150 motion-reduce:transition-none ${Se?"-rotate-90":""}`,fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 10 10",children:o.jsx("path",{d:"M2 3.5 5 6.5 8 3.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Se?o.jsx("span",{className:"text-[10px] leading-none tabular-nums",children:se}):null]})}),ye?o.jsx(Gg,{error:H.renameError,initial:H.displayName(ee),label:`Rename the ${H.displayName(ee)} direction`,onCancel:()=>H.startRename(null),onCommit:(U,ae)=>H.rename(ee,U,ae)}):o.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:o.jsx("span",{className:`block w-fit min-w-[70%] max-w-full truncate -my-1 py-1 pr-2 ${ne?"":"cursor-text"} ${se>0?"":"-ml-3 pl-3"}`,onDoubleClick:ne?void 0:U=>{U.stopPropagation(),window.getSelection()?.removeAllRanges(),H.startRename(ee)},children:H.displayName(ee)})}),o.jsx(Pv,{aside:j,carrying:L,comparing:s,same:q,scanning:z,tag:P?.tags[0],working:ue})]}),o.jsx("span",{className:`mt-0.5 line-clamp-2 block cursor-text text-xs leading-snug transition-colors ${ye&&H.renameError?"text-amber-300/90":te?"text-[#D1D5DB]":"text-[#84848C]"}`,id:ye&&H.renameError?"leglas-rename-error":void 0,children:ye&&H.renameError?H.renameError:P?.note??(P?.branch===void 0?P?.url:P.branch)})]})})}),o.jsx(eb,{comparing:s,dragging:h,onToggleCompare:Y,renaming:ye,st:H,title:ee,viewing:ne})]})}function nb({cap:a,inputRef:s,onQuery:c,query:r}){const[f,h]=S.useState(!1);return o.jsx("div",{className:"px-3 pb-1 pt-2",children:o.jsxs("div",{className:"relative",children:[o.jsx("span",{className:"pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 text-[#D1D5DB]",children:o.jsx(an,{d:ln.search})}),o.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}),o.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:()=>h(!1),onFocus:()=>h(!0),onChange:g=>c(g.target.value),onKeyDown:g=>{g.key==="Escape"&&(r?c(""):g.currentTarget.blur())},placeholder:"Search directions…",ref:s,type:"text",value:r})]})})}function lb({scope:a}){return o.jsx(ut,{label:o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"block",children:"Someone is sharing their Leglas with you, live."}),o.jsx("span",{className:"block text-[#9CA3AF]",children:"Flip, compare and change the width. Nothing you do reaches their machine."})]}),side:"right",wide:!0,children:o.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-[#232328] bg-[#1E1E22] px-3 py-1.5",children:[o.jsx(_o,{}),o.jsx("span",{className:"text-[11px] text-[#D1D5DB]",children:"Shared with you"}),o.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 L1=15e3,ab=3e4,B1={height:800,width:1280},ib=96,U1={attached:!1,running:!1,name:null,activity:null,startedAt:null,stopping:!1,waiting:null,quietSince:null},sb={agents:[],choice:null,customRun:null,effort:null},Em=typeof navigator<"u"&&/Mac|iPhone|iPad|iPod/.test(navigator.userAgent),ub=lm(Em),H1="linear-gradient(to bottom, transparent, black 12px, black calc(100% - 12px), transparent)";function ob({previews:a,project:s,scanPreviews:c=!0,viewer:r,warnings:f=[]}){const h=S.useRef(null),g=S.useRef(null),x=S.useRef(null),[v,y]=S.useState(!1),[w,C]=S.useState(null),[T,k]=S.useState(!1),[M,Y]=S.useState(!1),q=S.useCallback(()=>x.current?.(),[]),z=S.useCallback(()=>y(m=>!m),[]),V=S.useCallback(()=>y(!1),[]),[H,W]=S.useState(!1),ee=S.useCallback(()=>W(m=>!m),[]),ne=S.useCallback(()=>Ct(m=>!m),[]),b=Iy({previews:a,project:s,onToggleSplit:q,onToggleHelp:z,onToggleTools:ee,onToggleNote:r===void 0?ne:void 0,suspended:v||w!==null||T,viewer:r===void 0?void 0:{layout:r.layout}}),te=b.viewing,ue=Ey(b.lanes),P=b.insets,he=Ro.current[0],re=S.useRef(null),Ee=S.useRef(new Map),we=m=>{if(re.current===null)return!1;!re.current.has(m)&&!Ee.current.has(m)&&Ee.current.set(m,performance.now());const A=Ee.current.get(m);return A!==void 0&&performance.now()-A<1e3},Te=m=>we(m)||(b.railChildren.get(m)??[]).some(A=>we(A));S.useEffect(()=>{const m=re.current??new Set;for(const A of b.rows)m.add(A);re.current=m});const[L,I]=S.useState({nonce:0,title:""});S.useEffect(()=>{if(L.title==="")return;const m=setTimeout(()=>I(A=>({...A,title:""})),950);return()=>clearTimeout(m)},[L]);const[se,Se]=S.useState(null),ye=S.useRef(null),j=S.useCallback(m=>{if(ye.current&&clearTimeout(ye.current),ye.current=null,m===null){Se(null);return}ye.current=setTimeout(()=>{ye.current=null,Se(m)},120)},[]);S.useEffect(()=>()=>{ye.current&&clearTimeout(ye.current)},[]);const U=m=>m===""?{nodes:[],edges:[]}:uy(b.railParents,b.railChildren,m),ae=se!==null?U(se):{nodes:[],edges:[]},oe=ae.edges.length>0?ae:U(b.active),pe=oy(b.rows,b.rowMeta,oe),Ce=S.useRef(new Map),R=S.useRef(!1);R.current=!1;const[,Z]=S.useReducer(m=>m+1,0),ie=m=>{const A=b.rowMeta.get(m)?.graph;if(!A)return;const $=Ce.current.get(m),Q=new Set(of(A).filter(le=>!$?.has(le)));return Q.size>0&&(R.current=!0),Q},xe=b.rows.map(m=>{const A=b.rowMeta.get(m)?.graph;return A?`${m}=${of(A).join(",")}`:m}).join("|");S.useEffect(()=>{const m=b.rows.map(Q=>[Q,b.rowMeta.get(Q)?.graph]),A=R.current,$=setTimeout(()=>{Ce.current=new Map(m.flatMap(([Q,le])=>le?[[Q,new Set(of(le))]]:[])),A&&Z()},700);return()=>clearTimeout($)},[xe]);const Ne=m=>{if(!il&&"startViewTransition"in document){document.startViewTransition(()=>Y1.flushSync(()=>b.toggleFamily(m)));return}b.toggleFamily(m)},Ge=m=>{if(j(m),m===null){De($=>({...$,on:!1}));return}I($=>({nonce:$.nonce+1,title:m}));const A=[...X.current?.querySelectorAll("li[data-title]")??[]].find($=>$.dataset.title===m);A&&De(_e(A))},lt=()=>{M||C(null)},at=async()=>{if(w===null||M)return;const m=w;Y(!0),C({...m,error:null});try{await b.deleteRemoved(m.titles),C(null),b.notify({kind:`delete:${m.titles.join("|")}`,message:m.titles.length===1?`${b.displayName(m.titles[0]??"")} permanently deleted`:`${m.titles.length} removed directions permanently deleted`,tone:"info",ttl:Ve.plain})}catch(A){C({...m,error:A instanceof Error?A.message:"The directions could not be deleted."})}finally{Y(!1)}},[ze,Je]=S.useState(null),Et=ze!==null,Nt=S.useRef(!1),[qt,$n]=S.useState(""),[yn,Fa]=S.useState("variant");S.useEffect(()=>{const m=g.current;m!==null&&(m.style.height="0px",m.style.height=`${Math.min(m.scrollHeight,96)}px`)},[qt,b.prefs.width]);const[Dn,dt]=S.useState(!1),[$t,sn]=S.useState([]),Yn=S.useRef(new Map),Ml=S.useRef(null),[Ja,Nl]=S.useState(!1),tl=S.useRef(0),Wa=S.useCallback((m,A)=>{Yn.current.set(m,A),sn($=>$.map(Q=>Q.key===m?{...Q,status:"uploading",id:null}:Q)),Ax(A).then(({id:$})=>sn(Q=>Q.map(le=>le.key===m?{...le,status:"ready",id:$}:le))).catch(()=>sn($=>$.map(Q=>Q.key===m?{...Q,status:"failed",id:null}:Q)))},[]),kn=m=>{if(b.active===null||Dn)return;const{accepted:A,refused:$}=bx($t,m),Q=wx($);if(Q!==null&&b.notify({kind:"reference",message:Q,tone:"info",ttl:Ve.action}),A.length===0)return;const le=A.map(me=>({key:crypto.randomUUID(),name:Nf(me.name),type:me.type,bytes:me.size,url:URL.createObjectURL(me),status:"uploading",id:null}));sn(me=>[...me,...le]),le.forEach((me,fe)=>{const ge=A[fe];ge!==void 0&&Wa(me.key,ge)})},At=m=>{Yn.current.delete(m);const A=$t.find($=>$.key===m);A!==void 0&&URL.revokeObjectURL(A.url),sn($=>$.filter(Q=>Q.key!==m))},un=m=>{const A=Yn.current.get(m);A!==void 0&&Wa(m,A)},Tt=()=>{Yn.current.clear();for(const m of $t)URL.revokeObjectURL(m.url);sn([])},[ma,Ia]=S.useState(null),[Al,nl]=S.useState(!1),[Gn,Yt]=S.useState(!1),[_t,on]=S.useState(null),xn=S.useRef(null),pa=S.useRef(null),Tl=S.useRef(null),Xn=S.useRef(null),Qn=S.useRef(null),Pa=S.useRef(null),[ei,ti]=S.useState(ib);S.useEffect(()=>{const m=Pa.current;if(m===null||typeof ResizeObserver>"u")return;const A=()=>ti(m.offsetHeight);A();const $=new ResizeObserver(A);return $.observe(m),()=>$.disconnect()},[]);const X=S.useRef(null),[de,De]=S.useState({height:0,left:0,on:!1,top:0}),_e=m=>({height:m.offsetHeight,left:m.querySelector('[role="button"]')?.offsetLeft??0,on:!0,top:m.offsetTop});S.useEffect(()=>{De(m=>m.on?{...m,on:!1}:m)},[b.rows.join("|")]);const[ce,$e]=S.useState(null),Ze=S.useRef(null),Oe=S.useRef(null);S.useEffect(()=>{Ze.current=ce},[ce]),S.useEffect(()=>{if(!b.focusing)return;const m=b.focusing.target==="search"?h.current:g.current;m?.focus(),m?.select()},[b.focusing]),S.useEffect(()=>{if(!ce)return;const m=Oe.current;if(!m)return;const A=Q=>{const le=Q.clientY-m.startY,me=Q.clientX-m.startX;$e(fe=>{if(!fe||fe.settling)return fe;if(!fe.started)return Math.abs(le)<=4&&Math.abs(me)<=4?{...fe,dy:le}:Math.abs(me)>Math.abs(le)?null:(window.getSelection()?.removeAllRanges(),b.setDragFolded(new Set(m.siblings.filter(Ut=>(b.rowMeta.get(Ut)?.descendants??0)>0))),{...fe,dy:0,measured:!1,started:!0});if(!fe.measured)return fe;const ge=m.rows[fe.from];if(!ge)return fe;const[We,Fe]=fe.span??[0,m.rows.length-1],it=Ut=>{const Ln=m.rows[Ut];return Ln?Ut<=fe.from?Ln.top:Ln.top+Ln.height-ge.height:ge.top},Xt=it(We)-ge.top,Ye=it(Fe)-ge.top,bn=ge.height,Qt=bn/3;let rl=le,cl=!1;le<Xt?(rl=Xt+Math.max(-Qt,(le-Xt)*.3),cl=le<Xt-bn):le>Ye&&(rl=Ye+Math.min(Qt,(le-Ye)*.3),cl=le>Ye+bn),rl=Math.max(m.minDy,Math.min(m.maxDy,rl));const gs=ge.top+Math.max(Xt,Math.min(Ye,le));let ys=fe.from,Jn=1/0;for(let Ut=We;Ut<=Fe;Ut+=1){const Ln=Math.abs(it(Ut)-gs);Ln<Jn&&(Jn=Ln,ys=Ut)}return{...fe,blocked:cl,dy:rl,started:!0,to:ys}})},$=()=>{const Q=Ze.current;if(!Q?.started){$e(null);return}m.suppressed=!0;const le=Q.blocked&&Q.reason!==null,me=le?Q.from:Q.to,fe=m.rows[Q.from],ge=m.rows[me];let We=0;fe&&ge&&(We=(me<=Q.from?ge.top:ge.top+ge.height-fe.height)-fe.top),$e({...Q,dy:We,settling:!0,to:me}),window.setTimeout(()=>{if(le)b.notify(ot(Q.title,m.parent,m.siblings));else if(me!==Q.from){const[,Fe]=Q.span??[0,m.rows.length-1],it=me>Q.from?me+1<=Fe?m.rows[me+1]?.title??null:null:m.rows[me]?.title??null;b.reorderAmong(Q.title,it,m.siblings)}b.setDragFolded(new Set),$e(null),window.setTimeout(()=>{m.suppressed=!1},0)},190)};return window.addEventListener("pointermove",A),window.addEventListener("pointerup",$),window.addEventListener("pointercancel",$),()=>{window.removeEventListener("pointermove",A),window.removeEventListener("pointerup",$),window.removeEventListener("pointercancel",$)}},[ce!==null]),S.useLayoutEffect(()=>{if(!ce?.started||ce.measured)return;const m=Oe.current,A=X.current,$=A?.parentElement;if(!m||!A||!$)return;const Q=[...A.querySelectorAll("li[data-title]")],le=Q.map(Ye=>({height:Ye.offsetHeight,mid:Ye.offsetTop+Ye.offsetHeight/2,title:Ye.dataset.title??"",top:Ye.offsetTop})),me=le.findIndex(Ye=>Ye.title===ce.title),fe=le[me],ge=Q[me];if(!fe||!ge)return;m.startY-=m.oldTop-fe.top,m.rows=le;const We=$.getBoundingClientRect(),Fe=ge.getBoundingClientRect();m.minDy=We.top-Fe.top,m.maxDy=We.bottom-Fe.bottom;const it=m.siblings.map(Ye=>le.findIndex(bn=>bn.title===Ye)).filter(Ye=>Ye!==-1),Xt=it.length?[Math.min(...it),Math.max(...it)]:null;$e(Ye=>Ye&&!Ye.measured?{...Ye,from:me,height:fe.height,measured:!0,span:Xt,to:me}:Ye)},[ce?.started,ce?.measured,ce?.title]);const ot=(m,A,$)=>{const Q=b.displayName(m),le=A===null?null:b.displayName(A),me=$.length<2;return{note:le===null?`${Q} is the only direction at the top level; its variants travel with it.`:me?`Nothing to reorder it among. Drag ${le} to move the whole family.`:`Where a direction sits comes from what it was based on. Drag ${le} to move the whole family.`,kind:"reorder",message:le===null?"Nothing to reorder":me?`${Q} is ${le}'s only variant`:`${Q} stays under ${le}`,tone:"info",ttl:Ve.action}};S.useEffect(()=>{if(!H)return;pa.current?.focus();const m=Q=>{Q.key==="Escape"&&(W(!1),xn.current?.focus())},A=Q=>{const le=Q.target instanceof Node?Q.target:null;!pa.current?.contains(le)&&!xn.current?.contains(le)&&W(!1)},$=()=>W(!1);return window.addEventListener("keydown",m),window.addEventListener("pointerdown",A),window.addEventListener("blur",$),()=>{window.removeEventListener("keydown",m),window.removeEventListener("pointerdown",A),window.removeEventListener("blur",$)}},[H]);const ll=vf.find(m=>m.key===b.prefs.font)??vf[0],Go=b.prefs.viewport!==null,Xo=48,al=ce?.started??!1,[il]=S.useState(()=>typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches),[Vn,Dl]=S.useState(null),[kl,zl]=S.useState([]),Zn=oe.edges,yt=`${Zn.map(m=>m.join(">")).join(",")}|${al}|${b.prefs.width}|${ue}`,ni=m=>Dl(A=>{if(A?.d===m?.d)return A;if(A!==null){const $=A;zl(Q=>[...Q.filter(le=>le.d!==$.d),$]),setTimeout(()=>zl(Q=>Q.filter(le=>le!==$)),460)}return m});S.useLayoutEffect(()=>{const m=X.current;if(al||m===null||Zn.length===0){ni(null);return}const A=()=>{const Q=m.getBoundingClientRect(),le=new Map,me=[...m.querySelectorAll("li[data-title]")];for(const ge of oe.nodes){const We=me.find(bn=>bn.dataset.title===ge),Fe=We?.querySelector("[data-mark]");if(!We||!Fe)return ni(null);const it=Fe.getBoundingClientRect(),Xt=Number(Fe.getAttribute("r")??0),Ye=ge===b.active?3.75:0;le.set(ge,{clear:Ye>0||Xt>1.5?Xt+2+Ye:0,x:it.left+it.width/2-Q.left,y:it.top+it.height/2-We.getBoundingClientRect().top+We.offsetTop})}const fe=Zn.flatMap(([ge,We])=>{const Fe=le.get(ge),it=le.get(We);return Fe&&it?[yy([Fe,it])]:[]}).join(" ");ni({d:fe,height:m.scrollHeight,marks:[...le.values()]})};A();const $=new ResizeObserver(A);return $.observe(m),()=>$.disconnect()},[al,yt]);const Vi=b.resizing||al||Et,[vn,Kt]=S.useState({}),[au,li]=S.useState({}),Zi=S.useRef(new Set),[Qo,ga]=S.useState({}),[Rl,Gt]=S.useState(r?.scope==="compare"),[Ft,ya]=S.useState(r?.layout.compare??null),Ki=r===void 0?null:`${r.scope}${r.layout.compare??""}`,[Fi,iu]=S.useState(Ki);Ki!==Fi&&(iu(Ki),r!==void 0&&(Gt(r.scope==="compare"),ya(r.layout.compare)));const xa=S.useRef(null);S.useEffect(()=>()=>{xa.current=b.active},[b.active]),x.current=()=>{!Rl&&rn!==null&&ya(rn),(rn!==null||Rl)&&Gt(m=>!m)};const rn=N2({active:b.active,previous:xa.current,pinned:Ft,parent:b.parentOf(b.active),rows:b.rows}),Dt=A2({active:b.active,compare:rn,split:Rl}),ai=new Map(Dt.map((m,A)=>[m,A])),zn=Dt.length>1,sl=Dt,Kn=S.useRef(new Map),Ol=m=>h2(m,b.urlFor(m),Qo[m]??0),ii=m=>{const A=Ol(m);return Kn.current.get(m)===A&&b.isLoaded(m,A)},ul=sl.filter(m=>b.branchState(m)?.status==="idle").join("");S.useEffect(()=>{for(const m of ul.split("").filter(Boolean))b.startBranch(m)},[ul]);const _l=new Map(sl.map(m=>[m,Ol(m)])),Ji=[..._l.values()].join(""),si=S.useRef(_l);si.current=_l,S.useLayoutEffect(()=>{const m=Kn.current,A=[..._l].filter(([$,Q])=>m.get($)!==Q);for(const[$]of A)b.resetLoaded($);if(A.some(([$])=>vn[$])&&Kt($=>{const Q={...$};for(const[le]of A)Q[le]=!1;return Q}),A.some(([$])=>au[$]!==void 0)){const $=new Set(A.map(([Q])=>Q));li(Q=>Object.fromEntries(Object.entries(Q).filter(([le])=>!$.has(le))))}Kn.current=new Map(_l)},[Ji]);const ui=S.useRef(null),su=S.useRef(null),[va,ba]=S.useState({height:0,width:0}),Rn=S.useCallback(m=>{if(ui.current=m,su.current?.disconnect(),m===null)return;const A=m.getBoundingClientRect();ba({height:A.height,width:A.width});const $=new ResizeObserver(([Q])=>{const le=Q?.contentRect;le&&ba({height:le.height,width:le.width})});$.observe(m),su.current=$},[]),{boxHeight:Wi,boxWidth:Ii,designWidth:Ll,frameHeight:Bl,scale:Pi,scaling:wa}=k2({gutter:Xo,panes:Dt.length,scaleSplit:b.prefs.scaleSplit,stageHeight:va.height,stageWidth:va.width,viewport:b.prefs.viewport}),es=b.prefs.viewport!==null?Math.round(b.prefs.viewport):va.width<=0?null:Math.round(zn&&!wa?(va.width-1)/2:va.width),Sa=ze?(()=>{const{x:m,y:A}=ey(ze);return{bottom:"auto",left:m,right:"auto",top:A}})():void 0,On=m=>{if(m.button!==0)return;const A=ui.current?.getBoundingClientRect();if(!A)return;const $=m.currentTarget;$.setPointerCapture(m.pointerId),Nt.current=!1;const Q={x:m.clientX,y:m.clientY};let le=!1;const me=ge=>{!le&&!ty(Q,{x:ge.clientX,y:ge.clientY})||(le=!0,Je(P2({x:ge.clientX-A.left,y:ge.clientY-A.top},{width:A.width,height:A.height})))},fe=ge=>{if($.hasPointerCapture(ge.pointerId)&&$.releasePointerCapture(ge.pointerId),$.removeEventListener("pointermove",me),$.removeEventListener("pointerup",fe),$.removeEventListener("pointercancel",fe),Je(null),!le)return;Nt.current=!0;const{corner:We}=ny({x:ge.clientX-A.left,y:ge.clientY-A.top},{width:A.width,height:A.height});b.setPrefs(Fe=>({...Fe,corner:We})),W(!1)};$.addEventListener("pointermove",me),$.addEventListener("pointerup",fe),$.addEventListener("pointercancel",fe)},[cn,Ul]=S.useState(C2),Jt=new Set(a.filter(P0).map(m=>m.title)),ts=Jt.size>0,[Wt,uu]=S.useState({requests:[],agent:U1}),[oi,ri]=S.useState([]),[ci,Ct]=S.useState(!1),[St,ol]=S.useState(sb),[Hl,ns]=S.useReducer(m=>m+1,0);S.useEffect(()=>{if(te)return;let m=!1;return A1(Hl>0).then(A=>{m||ol($=>JSON.stringify($)===JSON.stringify(A)?$:A)}).catch(()=>{}),()=>{m=!0}},[Hl,te]);const[ls,_n]=S.useReducer(m=>m+1,0);S.useEffect(()=>{if(te)return;let m=!1;const $=nu(async Q=>{const le=(me,fe)=>fetch(me,{...fe,signal:Q});await fetch("/leglas/api/requests",{signal:Q}).then(me=>Zt(me)).then(me=>{if(m)return;const fe={requests:me.requests,agent:me.agent??U1};uu(ge=>JSON.stringify(ge)===JSON.stringify(fe)?ge:fe)}).catch(()=>{}),await Tx(le).then(me=>{m||ri(fe=>JSON.stringify(fe)===JSON.stringify(me)?fe:me)}).catch(()=>{})},{everyMs:Lo,subscribe:Q=>tu().on("requests",Q)});return()=>{m=!0,$()}},[ls,te]);const Lt=Lx(St.choice,St.agents,St.customRun),ja=S.useRef(0),fi=()=>{if(Lt.kind!=="chosen")return;const m=Date.now();m-ja.current<ab||(ja.current=m,Qx().catch(()=>{}))},di=Lt.kind==="chosen"?St.agents.find(m=>m.id===Lt.id&&m.available):void 0,Vo=St.effort!==null&&di?.efforts.includes(St.effort)?St.effort:null,Fn=b.active===null?[]:oi.filter(m=>m.title===b.active),Ea=(()=>{const m=yf(b.active===null?void 0:b.previewFor(b.active));return m===null?null:Py(m.basedOn===null?null:b.displayName(m.basedOn),m.askedFor)})(),ou=b.active===""?[]:b.ancestryOf(b.active),Zo=Lt.kind==="chosen"&&St.agents.some(m=>m.id===Lt.id&&m.auth==="signed-out"),as=qx(Wt.requests,Wt.agent,Lt.kind==="chosen"||Wt.agent.attached);S.useEffect(()=>{Lt.kind==="none"&&Yt(!1)},[Lt.kind]),S.useEffect(()=>{if(!Gn)return;Tl.current?.focus();const m=Q=>{Q.key==="Escape"&&(Yt(!1),Xn.current?.focus())},A=Q=>{const le=Q.target instanceof Node?Q.target:null;!Tl.current?.contains(le)&&!Xn.current?.contains(le)&&Yt(!1)},$=()=>Yt(!1);return window.addEventListener("keydown",m),window.addEventListener("pointerdown",A),window.addEventListener("blur",$),()=>{window.removeEventListener("keydown",m),window.removeEventListener("pointerdown",A),window.removeEventListener("blur",$)}},[Gn]);const Ko=m=>{if(ma!==null||Al)return;const A=St.agents.find($=>$.id===m)?.name??"Agent";Ia(m),Gx(m).then(()=>{ns(),Yt(!1)}).catch(async()=>{try{const $=await A1(!0);if(ol($),$.choice===m){Yt(!1);return}}catch{}b.notify({kind:"agent-choice",message:`${A} wasn’t selected. Try again.`,tone:"danger",ttl:Ve.action})}).finally(()=>Ia(null))},Fo=m=>{if(di===void 0||Al||ma!==null)return;const A=St.effort;nl(!0),ol($=>({...$,effort:m})),Xx(di.id,m).then(()=>ns()).catch(()=>{ol($=>({...$,effort:A})),b.notify({kind:"agent-choice",message:"Effort could not be saved. Agent settings did not change.",tone:"danger",ttl:Ve.action})}).finally(()=>nl(!1))},ru=m=>{_t===null&&(on("cancel"),Vx(m).then(()=>_n()).catch(()=>{b.notify({kind:"agent-cancel",message:"Leglas could not stop that run.",tone:"danger",ttl:Ve.action})}).finally(()=>on(null)))},Jo=m=>{_t===null&&(on("retry"),Zx(m).then(()=>_n()).catch(()=>{b.notify({kind:"agent-retry",message:"That change could not be retried.",tone:"danger",ttl:Ve.action})}).finally(()=>on(null)))},Wo=m=>{_t===null&&(on("dismiss"),Kx(m).then(()=>_n()).catch(()=>{b.notify({kind:"agent-dismiss",message:"That change could not be dismissed.",tone:"danger",ttl:Ve.action})}).finally(()=>on(null)))};S.useEffect(()=>{let m=!1;const $=nu(Q=>fetch("/leglas/api/health",{signal:Q}).then(le=>Zt(le)).then(({reachable:le})=>{m||Ul(me=>M2(me,le))}).catch(()=>{}),{everyMs:Lo,subscribe:Q=>tu().on("health",Q)});return()=>{m=!0,$()}},[]),S.useEffect(()=>{!cn.reachable||!cn.wasDown||(Kt(m=>{const A={...m};for(const $ of Object.keys(A))Jt.has($)&&(A[$]=!1);return A}),ga(m=>{const A={...m};for(const $ of Jt)A[$]=(A[$]??0)+1;return A}),Ul(m=>({...m,wasDown:!1})))},[cn.reachable,cn.wasDown]);const[cu,is]=S.useState({}),[ss,Io]=S.useState(()=>!document.hidden);S.useEffect(()=>{const m=()=>Io(!document.hidden);return document.addEventListener("visibilitychange",m),()=>document.removeEventListener("visibilitychange",m)},[]);const us=new Map(a.map(m=>[m.title,Ol(m.title)])),Po=[...us].map(([m,A])=>`${m}${A}`).join(""),os=S.useRef(new Map);S.useLayoutEffect(()=>{const m=K2(os.current,us);m.length>0&&is(A=>uf(A,m)),os.current=new Map(us)},[Po]);const Ca=(m,A)=>{let $=null;try{$=m.contentDocument}catch{return}if(!$?.head)return;const Q=$,le="leglas-hide-dev-overlays",me=(fe,ge,We)=>{const Fe=fe.getElementById(le);if(!A){Fe?.remove();return}if(Fe)return;const it=Q.createElement("style");it.id=le,it.textContent=We,ge.appendChild(it)};me($,$.head,z2);for(const fe of $.querySelectorAll("nextjs-portal")){const ge=fe.shadowRoot;ge&&me(ge,ge,R2)}};S.useEffect(()=>{for(const m of document.querySelectorAll("iframe"))Ca(m,!b.prefs.showDevOverlays)});const er=m=>{let A=null;try{A=m.contentDocument}catch{return}if(!A?.body)return;const $=[...A.body.querySelectorAll("*")].slice(0,400).map(fe=>fe.tagName),Q=A.defaultView,le=Q?V2(A.body,fe=>{const ge=Q.getComputedStyle(fe);return{backgroundColor:ge.backgroundColor,backgroundImage:ge.backgroundImage,color:ge.color}}):[],me=Q?Q2(A.body,(fe,ge)=>Q.getComputedStyle(fe,ge)):[];return _2(A.body.innerText??"",$,le,me)},tr=(m,A)=>{let $;try{$=m.contentDocument?.fonts}catch{}const Q=new Promise(me=>window.setTimeout(me,900));($?.status==="loading"?Promise.race([$.ready.then(()=>{}),Q]):Promise.resolve()).then(()=>{const me=()=>{Ca(m,!b.prefs.showDevOverlays),A(er(m))};typeof window.requestIdleCallback<"u"?window.requestIdleCallback(me,{timeout:1200}):window.setTimeout(me,0)})},fu=S.useRef(new WeakSet),hi=(m,A,$)=>{if(si.current.get(m)!==A)return;const Q=b.urlFor(m);if(!Q.startsWith("/")&&!Zi.current.has(Q)){v2(m).then(le=>{si.current.get(m)===A&&(le!==null&&li(me=>({...me,[m]:le})),du(m,A,$))});return}du(m,A,$)},du=(m,A,$)=>{b.markLoaded(m,A),Kt(le=>le[m]?{...le,[m]:!1}:le),Ca($,!b.prefs.showDevOverlays);let Q=null;try{Q=$.contentDocument}catch{}Q===null||fu.current.has(Q)||fu.current.add(Q)},hu=S.useRef(hi);hu.current=hi,S.useEffect(()=>{const m=A=>{if(A.origin!==window.location.origin)return;const $=j2(A.data);if($===null)return;const Q=E2(document.querySelectorAll("iframe[data-preview]"),A.source),le=Q?.dataset.preview,me=Q?.dataset.previewIdentity;Q===null||le===void 0||me===void 0||($==="ready"?hu.current(le,me,Q):Kt(fe=>({...fe,[le]:!0})))};return window.addEventListener("message",m),()=>window.removeEventListener("message",m)},[]);const nr=c&&!te?cn.reachable?a:a.filter(m=>!P0(m)):[],ql=Rx(Wt.requests),rs=ql.toSorted().join("\0"),Ma=Wt.agent.running||ql.length>0,lr=_x(Wt.requests),mu=Ox(Wt.requests);S.useEffect(()=>{ql.length!==0&&is(m=>uf(m,ql))},[rs]);const pu=sl.every(m=>ii(m)),cs=ql.length>0?uf(cu,ql):cu,gu=J2(a,cs),yu=Z2(gu),Bt=!Ma&&pu&&ss?W2(nr,cs)[0]??null:null,ar=Bt?.title??null,mi=Bt===null?null:`${Bt.title}\0${Bt.url}`,fs=S.useRef(mi);fs.current=mi;const pi=S.useRef(null),ds=S.useRef(new Map(a.map(m=>[m.title,m.url])));ds.current=new Map(a.map(m=>[m.title,m.url]));const $l=(m,A,$)=>{const Q=`${m.title}\0${m.url}`;fs.current===Q&&pi.current===$&&ds.current.get(m.title)===m.url&&is(le=>F2(le,m,A))};S.useEffect(()=>{if(Bt===null)return;const m=pi.current;if(m===null)return;const A=window.setTimeout(()=>{$l(Bt,{status:"failed"},m)},L1);return()=>clearTimeout(A)},[mi]);const Na=(m,A)=>{Ef(A)&&(Ca(A,!b.prefs.showDevOverlays),window.setTimeout(()=>{const $=`${m.title}\0${m.url}`;fs.current===$&&tr(A,Q=>{$l(m,Q===void 0?{status:"failed"}:{status:"complete",signature:Q},A)})},600))};S.useEffect(()=>{const m=[];for(const A of sl){const $=_l.get(A)??Ol(A);if(b.isLoaded(A,$)||vn[A])continue;const Q=document.querySelector(`iframe[data-preview="${CSS.escape(A)}"]`);if(Q===null)continue;const le=cn.reachable||!Jt.has(A)?L1:0;m.push(y2({frame:Q,onFailure:()=>Kt(me=>({...me,[A]:!0})),onReady:()=>hi(A,$,Q),sameOrigin:b.urlFor(A).startsWith("/"),timeoutMs:le}))}return()=>{for(const A of m)A()}},[Ji,b.loaded,vn,cn.reachable]);const ir=m=>{Kt(A=>({...A,[m]:!1})),b.resetLoaded(m),ga(A=>({...A,[m]:(A[m]??0)+1}))},gi=(m,A)=>$=>{if($.button!==0||te||b.renaming||b.query.trim()||b.rows.length<2||$.target instanceof Element&&$.target.closest("button, [data-selectable]"))return;const Q=X.current,le=Q?.parentElement;if(!Q||!le)return;const me=[...Q.querySelectorAll("li[data-title]")],fe=me.map(Qt=>({height:Qt.offsetHeight,mid:Qt.offsetTop+Qt.offsetHeight/2,title:Qt.dataset.title??"",top:Qt.offsetTop})),ge=le.getBoundingClientRect(),We=me[A]?.getBoundingClientRect(),Fe=b.railParents.get(m)??null,it=Fe===null?b.railRoots:b.railChildren.get(Fe)??[m],Xt=it.length<2?Fe===null?"Nothing to reorder":`${b.displayName(Fe)}'s only variant`:Fe===null?null:`Stays under ${b.displayName(Fe)}`;Oe.current={maxDy:We?ge.bottom-We.bottom:0,minDy:We?ge.top-We.top:0,oldTop:fe[A]?.top??0,parent:Fe,rows:fe,siblings:it,startX:$.clientX,startY:$.clientY,suppressed:!1};const Ye=fe[0],bn=fe[1];$e({blocked:!1,dy:0,from:A,gap:Ye&&bn?bn.top-Ye.top-Ye.height:0,height:fe[A]?.height??0,measured:!0,reason:Xt,span:null,title:m,settling:!1,started:!1,to:A})},xu=m=>{if(!ce?.started)return 0;const A=ce.height+ce.gap;return m<ce.from&&m>=ce.to?A:m>ce.from&&m<=ce.to?-A:0},hs=S.useCallback(()=>Ct(!1),[]),ms=(m,A,$)=>(fi(),Dx(m,$,A).then(()=>(_n(),!0)).catch(()=>(b.notify({kind:"request",message:"That annotation could not be kept.",tone:"danger",ttl:Ve.action}),!1))),ps=(m,A)=>kx(m,A).then(()=>(_n(),!0)).catch(()=>(b.notify({kind:"request",message:"That annotation could not be changed.",tone:"danger",ttl:Ve.action}),!1)),vu=m=>{zx([m]).then(()=>_n()).catch(()=>{})},bu=m=>{window.open(b.urlFor(m),"_blank","noopener,noreferrer")};return o.jsxs("main",{className:`flex h-dvh bg-[#1C1C20] text-white antialiased selection:bg-[#E6E8EC] selection:text-[#17181B] ${b.resizing?"cursor-col-resize":""} ${Vi?"select-none":""}`,"data-leglas-shell":"",style:{fontFamily:ll.stack},children:[o.jsxs("aside",{className:`relative shrink-0 overflow-hidden border-r border-[#232328] ${b.prefs.collapsed?"":"shadow-2xl"} ${b.resizing?"":`transition-[width] duration-200 ${Xa} motion-reduce:transition-none`}`,style:{width:b.prefs.collapsed?48:b.prefs.width},children:[o.jsxs("div",{className:`flex h-full flex-col transition-opacity duration-150 ${b.prefs.collapsed?"pointer-events-none opacity-0":"opacity-100"}`,inert:b.prefs.collapsed,style:{width:b.prefs.width},children:[o.jsx(Fv,{active:b.active,compare:zn?rn:null,displayName:b.displayName,notify:b.notify,onCollapse:()=>b.setPrefs(m=>({...m,collapsed:!0})),prefs:b.prefs,previews:a,viewing:te}),r!==void 0&&o.jsx(lb,{scope:r.scope}),o.jsx(nb,{cap:ub,inputRef:h,onQuery:b.setQuery,query:b.query}),f.length>0&&o.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:[o.jsx("p",{className:"text-xs font-medium text-amber-300/90",children:"Preview may be from another project"}),f.map(m=>o.jsx("p",{className:"mt-0.5 text-[11px] leading-snug text-[#9CA3AF]",children:m},m))]}),ts&&!cn.reachable&&o.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:[o.jsx("p",{className:"text-xs font-medium text-amber-300/90",children:"Dev server not responding"}),o.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."})]}),o.jsxs("div",{className:"flex-1 overflow-y-auto px-3 py-2 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",style:{WebkitMaskImage:H1,maskImage:H1},children:[o.jsxs("ul",{className:"relative flex flex-col gap-1","data-traced":se??"",onPointerLeave:()=>{j(null),De(m=>({...m,on:!1}))},ref:X,children:[o.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 ${Xa} motion-reduce:transition-none`,style:{height:de.height,left:de.left,opacity:de.on&&!al?1:0,transform:`translateY(${de.top}px)`}}),b.rows.map((m,A)=>o.jsx(tb,{arriving:Te,comparing:zn&&m===rn,crumbBloom:L,drag:ce,dragMeta:Oe,dragging:al,freshFor:ie,gutter:ue,index:A,insets:P,lit:pe?.get(m),onEnter:$=>{j(m),De(_e($))},onFold:()=>Ne(m),onOpenAlone:()=>bu(m),onPointerDown:gi(m,A),onToggleCompare:()=>{if(zn&&m===rn){Gt(!1);return}ya(m),Gt(!0)},same:yu[m],scanning:ar===m,shiftFor:xu,st:b,tint:he,title:m,viewing:te,working:lr.has(m)},m)),kl.filter(m=>m.d!==Vn?.d).map(m=>o.jsx(m1,{d:m.d,height:m.height,leaving:!0,marks:m.marks,still:il,width:ue},`leaving:${m.d}`)),Vn!==null&&o.jsx(m1,{d:Vn.d,height:Vn.height,marks:Vn.marks,still:il,width:ue},Vn.d)]}),b.rows.length===0&&o.jsx("div",{className:"px-3 py-2",children:b.query.trim()?o.jsxs(o.Fragment,{children:[o.jsxs("p",{className:"text-xs text-[#9CA3AF]",children:["Nothing matches “",b.query,"”."]}),o.jsx("button",{className:"mt-1 rounded text-xs text-[#84848C] underline underline-offset-2 transition-colors hover:text-[#D1D5DB]",onClick:()=>b.setQuery(""),type:"button",children:"Clear search"})]}):o.jsx("p",{className:"text-xs leading-snug text-[#9CA3AF]",children:te?"Nothing here was shared.":b.visibleCount===0&&b.hiddenCount>0?"Every direction is removed. Restore one below.":"No directions yet. Add them to leglas.config.ts."})}),!te&&b.hiddenCount>0&&o.jsxs("div",{className:"mt-1 flex items-center justify-between gap-2",children:[o.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:()=>b.setShowHidden(m=>!m),type:"button",children:[b.showHidden?"Hide":"Show"," removed (",b.hiddenCount,")"]}),b.showHidden?o.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:()=>C({error:null,titles:[...b.prefs.hidden]}),type:"button",children:"Clear all"}):null]}),!te&&b.showHidden&&o.jsx("ul",{className:"relative",children:b.prefs.hidden.filter(b.matches).map(m=>o.jsx("li",{className:"group relative",children:o.jsxs("div",{className:"flex items-center justify-between rounded-md px-3 py-2 transition-colors group-hover:bg-white/[0.04]",children:[o.jsx("span",{className:"truncate text-sm font-medium text-[#9CA3AF]",children:b.displayName(m)}),o.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[o.jsx("button",{className:"rounded text-[11px] text-[#9CA3AF] transition-colors hover:text-white",onClick:()=>{b.restore(m),b.notify({kind:`remove:${m}`,message:`${b.displayName(m)} is back in the list`,tone:"success",ttl:Ve.plain})},type:"button",children:"Restore"}),o.jsx("button",{className:"rounded text-[11px] text-[#84848C] transition-[color,scale] hover:text-red-300 active:scale-[0.96]",onClick:()=>C({error:null,titles:[m]}),type:"button",children:"Delete"})]})]})},m))})]}),o.jsxs("div",{ref:Pa,children:[!te&&as!==null&&o.jsx(av,{action:_t,card:as,onCancel:ru,onDismiss:Wo,onRetry:Jo}),!te&&o.jsx("form",{className:"relative px-3 pb-2.5 pt-2",onSubmit:m=>{m.preventDefault();const A=qt.trim(),$=b.active;if(!A&&Fn.length===0||!$||Dn)return;const Q=b.displayName($),le=Cx($t);if(le!==null){b.notify({kind:"request",message:le==="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:Ve.action});return}const me=Ex($t),fe={title:$,intent:A,mode:yn};es!==null&&(fe.width=es),zn&&rn!==null&&rn!==$&&(fe.compare=rn),me.length>0&&(fe.references=me),dt(!0),fetch("/leglas/api/request",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(fe)}).then(ge=>Zt(ge)).then(ge=>{if(ge.duplicate===!0){dt(!1),b.notify({kind:"request",message:`That exact change to ${Q} is already queued.`,tone:"info",ttl:Ve.action});return}if(!ge.ok&&qn(ge.error)){dt(!1),b.notify({kind:"request",message:ge.error,tone:"danger",ttl:Ve.action});return}if(!ge.ok||!ge.prompt)throw new Error("refused");$n(""),Tt(),dt(!1),_n(),b.notify({kind:"request",message:`Asked for a change to ${Q}.`,tone:"success",ttl:Ve.plain}),$o(ge.prompt).then(We=>{b.notify({kind:"request",message:We==="copied"?`Asked for a change to ${Q}. Prompt copied.`:`Asked for a change to ${Q}. Your browser blocked the clipboard, so read it with npx leglas requests.`,tone:"success",ttl:Ve.plain})})}).catch(()=>{dt(!1),b.notify({kind:"request",message:`That request never reached Leglas. ${Q} is unchanged.`,tone:"danger",ttl:Ve.action})})},children:o.jsxs("div",{className:`rounded-md border bg-[#2E2E2E]/40 transition-colors ${Ja?"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=>{Do(m.dataTransfer.types)&&(m.preventDefault(),tl.current+=1,Nl(!0))},onDragLeave:m=>{Do(m.dataTransfer.types)&&(tl.current=Math.max(0,tl.current-1),tl.current===0&&Nl(!1))},onDragOver:m=>{Do(m.dataTransfer.types)&&(m.preventDefault(),m.dataTransfer.dropEffect="copy")},onDrop:m=>{Do(m.dataTransfer.types)&&(m.preventDefault(),tl.current=0,Nl(!1),kn(Array.from(m.dataTransfer.files)))},children:[o.jsx(Mx,{drafts:$t,onRemove:At,onRetry:un}),o.jsx("textarea",{"aria-label":b.active?`Ask your agent to change the ${b.displayName(b.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:Dn||!b.active,onChange:m=>{qt===""&&m.target.value!==""&&fi(),$n(m.target.value)},onFocus:fi,onKeyDown:m=>{m.key==="Enter"&&!m.shiftKey&&(m.preventDefault(),m.currentTarget.form?.requestSubmit())},onPaste:m=>{const A=Array.from(m.clipboardData.files);A.length!==0&&(m.preventDefault(),kn(A))},placeholder:b.active===null?"No direction to change yet":Ja?"Drop the image here":$t.length>0&&Fn.length===0?`Say what to take from the ${$t.length===1?"image":"images"}…`:Fn.length>0?`Send ${Fn.length===1?"the annotation":`${Fn.length} annotations`}, or add words…`:`Change ${b.displayName(b.active)}…`,ref:g,rows:1,value:qt}),o.jsxs("div",{className:"flex items-center justify-end gap-1.5 p-1",children:[o.jsx(uv,{mode:yn,onToggle:()=>Fa(yn==="variant"?"replace":"variant")}),o.jsx(sv,{count:$t.length,disabled:!b.active||Dn||$t.length>=Mf,inputRef:Ml,onFiles:kn}),o.jsx(iv,{annotating:ci,count:Fn.length,onToggle:()=>ci?hs():Ct(!0)}),o.jsx(tv,{agents:St.agents,chip:Lt,chosenSignedOut:Zo,connectRef:Qn,menuRef:Tl,onConnect:()=>k(!0),onPick:Ko,onPickEffort:Fo,onRefresh:ns,open:Gn,pickingAgent:ma,savingEffort:Al,selectedAgent:di,selectedEffort:Vo,setOpen:Yt,triggerRef:Xn}),o.jsx(ov,{ready:(qt.trim()!==""||Fn.length>0)&&!!b.active&&!Dn,sending:Dn,target:b.active?b.displayName(b.active):null})]})]})}),Dn?o.jsx("div",{className:"px-3 pb-2",children:o.jsx("p",{"aria-live":"polite",className:"min-w-0 truncate text-[10px] leading-snug text-[#84848C]",children:"Capturing the design for your agent…"})}):ou.length>0?o.jsx(Dy,{askedFor:yf(b.previewFor(b.active))?.askedFor??null,chain:ou,displayName:b.displayName,onCompare:m=>{ya(m),Gt(!0)},onGo:b.setActive,onRail:m=>b.rows.includes(m),onTrace:Ge,openAsk:!0,self:b.active,tint:he,traced:se}):Ea===null?null:o.jsx("div",{className:"px-3 pb-2",children:o.jsx("p",{className:"min-w-0 truncate text-[10px] leading-snug text-[#84848C]",title:Ea,children:Ea})}),b.prefs.showWidget?!te&&Wt.agent.attached&&as===null?o.jsx("div",{className:"px-3 pb-2",children:o.jsx("p",{className:"min-w-0 truncate text-[10px] leading-snug text-[#84848C]",children:"Your agent is listening"})}):null:o.jsx("div",{className:"px-3 pb-2",children:o.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:()=>W(!0),type:"button",children:["Bring the tools back ",o.jsx("kbd",{className:"font-sans text-[#9CA3AF]",children:"T"})]})})]})]}),o.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 ${b.prefs.collapsed?"opacity-100":"pointer-events-none opacity-0"}`,inert:!b.prefs.collapsed,children:[o.jsx(eu,{size:24}),o.jsx(ut,{label:o.jsxs(o.Fragment,{children:["Open directions ",o.jsx("kbd",{className:"ml-1 text-[#9CA3AF]",children:"["})]}),side:"right",children:o.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:()=>b.setPrefs(m=>({...m,collapsed:!1})),type:"button",children:o.jsx(an,{d:ln.sidebar,size:16})})})]}),!b.prefs.collapsed&&o.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:b.onHandlePointerDown,children:o.jsx("span",{className:`h-full transition-all duration-150 ${b.resizing?"w-0.5 bg-[#9CA3AF]":"w-px bg-[#232328] group-hover/resize:w-0.5 group-hover/resize:bg-[#9CA3AF]"}`})})]}),o.jsx("span",{"aria-live":"polite",className:"sr-only",role:"status",children:b.copied===null?"":b.copied.kind==="link"?"Link copied":"Reference copied"}),o.jsxs("div",{className:`relative min-w-0 flex-1 ${zn?"flex":"overflow-auto"}`,ref:Rn,children:[sl.map(m=>o.jsx(cv,{annotate:!te&&ci&&m===b.active?o.jsx(yx,{notes:Fn,onExit:hs,onForget:vu,onKeep:(A,$)=>ms(m,A,$),onRevise:ps,paneScale:Pi,scaling:wa,sent:mu,title:m}):null,boxHeight:Wi,boxWidth:Ii,branch:b.branchState(m),branchName:b.previewFor(m)?.branch??m,busy:Vi,designWidth:Ll,errored:vn[m]===!0,frameHeight:Bl,framed:Go,fromApp:Jt.has(m),identity:Ol(m),loaded:ii(m),name:b.displayName(m),onError:()=>Kt(A=>({...A,[m]:!0})),onReady:(A,$)=>hi(m,A,$),onReload:()=>ir(m),onShowAnyway:()=>{Zi.current.add(b.urlFor(m)),li(A=>Object.fromEntries(Object.entries(A).filter(([$])=>$!==m)))},onStartBranch:()=>b.startBranch(m),order:ai.get(m)??-1,paneScale:Pi,refusal:au[m]??null,scaling:wa,second:m===rn,serverUp:cn.reachable,shown:ai.has(m),splitting:zn,src:b.urlFor(m),title:m,viewport:b.prefs.viewport},m)),o.jsxs("div",{className:`absolute z-50 flex gap-2 ${ze?"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"}[b.prefs.corner]}`,style:Sa,children:[o.jsx(fv,{applyOverlayPref:Ca,copied:b.copied?.kind==="reference"&&b.copied.title===b.active,fontKey:ll.key,href:b.urlFor(b.active),notify:b.notify,onCopyReference:()=>b.copyReference(b.active),onShortcuts:()=>{W(!1),y(!0)},open:H,parked:ze!==null,popoverRef:pa,prefs:b.prefs,setPrefs:b.setPrefs,splitting:zn,viewing:te,viewports:b.viewports}),(b.prefs.showWidget||H)&&o.jsx(ut,{label:"Leglas tools",children:o.jsxs("button",{"aria-expanded":H,"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(Nt.current){Nt.current=!1;return}W(m=>!m)},onPointerDown:On,ref:xn,type:"button",children:[o.jsx(eu,{size:30}),!ii(b.active)&&o.jsx("span",{className:"absolute -right-0.5 -top-0.5 size-2 animate-pulse rounded-full bg-amber-400 motion-reduce:animate-none"})]})})]})]}),o.jsx(Zg,{bottom:b.prefs.collapsed?12:ei+8,left:b.prefs.collapsed?60:12,onDismiss:b.dismissToast,toasts:b.toasts,width:(b.prefs.collapsed?320:b.prefs.width)-24}),Bt!==null&&o.jsx("iframe",{"aria-hidden":!0,className:"pointer-events-none fixed border-0",onLoad:m=>Na(Bt,m.currentTarget),ref:pi,src:Bt.url,style:{height:B1.height,left:-2400,top:0,width:B1.width},tabIndex:-1,title:"Off-stage duplicate scan"},mi??void 0),v?o.jsx(dv,{mac:Em,onClose:V,viewer:te}):null,T?o.jsx(Px,{connected:Wt.agent.attached,fallbackFocusRef:Lt.kind==="none"?Qn:Xn,onClose:()=>k(!1)}):null,w!==null?o.jsx(hv,{busy:M,count:w.titles.length,error:w.error,fallbackFocusRef:h,name:w.titles.length===1?b.displayName(w.titles[0]??""):null,onCancel:lt,onConfirm:()=>{at()}}):null]})}function Ps({children:a,title:s}){return o.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:[o.jsx(eu,{size:22}),o.jsx("p",{className:"text-sm font-medium text-white",children:s}),o.jsx("div",{className:"max-w-md text-xs leading-relaxed text-[#84848C]",children:a})]})}class q1 extends Error{constructor(s){super(`the server answered ${s}`),this.status=s}status}function rb(){const[a,s]=S.useState({status:"loading"}),[c,r]=S.useReducer(h=>h+1,0),f=S.useRef(0);return S.useEffect(()=>{let h=!1;const g=v=>fetch("/leglas/api/config",{signal:v}).then(y=>{if(!y.ok)throw new q1(y.status);return Zt(y)}),x=nu(v=>g(v).then(y=>{h||(f.current=0,s(w=>w.status==="ready"&&JSON.stringify(w.config)===JSON.stringify(y)?w:{status:"ready",config:y}))}).catch(y=>{if(h)return;sf(y)||(f.current+=1);const w=y instanceof q1&&y.status===403;s(C=>(C.status==="ready"||C.status==="ended")&&C.config.viewer!==void 0?sf(y)||!w&&f.current<2?C:{status:"ended",config:C.config,final:w}:C.status==="ready"?C:{status:"failed",message:sf(y)?"it did not answer in time":y instanceof Error?y.message:String(y)})}),{everyMs:Lo,subscribe:v=>tu().on("config",v)});return()=>{h=!0,x()}},[c]),a.status==="loading"?o.jsx(Ps,{title:"Starting Leglas…",children:null}):a.status==="ended"?a.final?o.jsx(Ps,{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."}):o.jsxs(Ps,{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.",o.jsx("p",{className:"mt-4",children:o.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"?o.jsxs(Ps,{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?o.jsxs(Ps,{title:"Your config needs fixing",children:[o.jsx("ul",{className:"space-y-1 text-left",children:a.config.errors.map(h=>o.jsx("li",{children:h},h))}),o.jsx("p",{className:"mt-3",children:"Fix it and restart Leglas."})]}):o.jsx(ob,{previews:a.config.previews,project:a.config.project,scanPreviews:a.config.scanPreviews??!0,viewer:a.config.viewer,warnings:a.config.warnings??[]})}const Cm=document.getElementById("root");if(!Cm)throw new Error("Leglas: #root is missing from the document.");eg.createRoot(Cm).render(o.jsx(S.StrictMode,{children:o.jsx(rb,{})}));
|