@gbasin/agentboard-darwin-x64 0.2.17 → 0.2.18

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.
@@ -34,10 +34,10 @@ var SS=Object.defineProperty;var xS=(e,t,r)=>t in e?SS(e,t,{enumerable:!0,config
34
34
  `+Tc+e}var Rc=!1;function Dc(e,t){if(!e||Rc)return"";Rc=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var n=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){n=c}e.call(t.prototype)}else{try{throw Error()}catch(c){n=c}e()}}catch(c){if(c&&n&&typeof c.stack=="string"){for(var i=c.stack.split(`
35
35
  `),a=n.stack.split(`
36
36
  `),l=i.length-1,s=a.length-1;1<=l&&0<=s&&i[l]!==a[s];)s--;for(;1<=l&&0<=s;l--,s--)if(i[l]!==a[s]){if(l!==1||s!==1)do if(l--,s--,0>s||i[l]!==a[s]){var o=`
37
- `+i[l].replace(" at new "," at ");return e.displayName&&o.includes("<anonymous>")&&(o=o.replace("<anonymous>",e.displayName)),o}while(1<=l&&0<=s);break}}}finally{Rc=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Vi(e):""}function QS(e){switch(e.tag){case 5:return Vi(e.type);case 16:return Vi("Lazy");case 13:return Vi("Suspense");case 19:return Vi("SuspenseList");case 0:case 2:case 15:return e=Dc(e.type,!1),e;case 11:return e=Dc(e.type.render,!1),e;case 1:return e=Dc(e.type,!0),e;default:return""}}function Nu(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Os:return"Fragment";case Bs:return"Portal";case Iu:return"Profiler";case xd:return"StrictMode";case Bu:return"Suspense";case Ou:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case n_:return(e.displayName||"Context")+".Consumer";case r_:return(e._context.displayName||"Context")+".Provider";case bd:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Cd:return t=e.displayName||null,t!==null?t:Nu(e.type)||"Memo";case Ln:t=e._payload,e=e._init;try{return Nu(e(t))}catch{}}return null}function ZS(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Nu(t);case 8:return t===xd?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Un(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function i_(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function ex(e){var t=i_(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(l){n=""+l,a.call(this,l)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(l){n=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ha(e){e._valueTracker||(e._valueTracker=ex(e))}function o_(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=i_(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function ul(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}}function ju(e,t){var r=t.checked;return ut({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function Mp(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=Un(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function a_(e,t){t=t.checked,t!=null&&Sd(e,"checked",t,!1)}function Fu(e,t){a_(e,t);var r=Un(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?$u(e,t.type,r):t.hasOwnProperty("defaultValue")&&$u(e,t.type,Un(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Ap(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function $u(e,t,r){(t!=="number"||ul(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Ki=Array.isArray;function Qs(e,t,r,n){if(e=e.options,t){t={};for(var i=0;i<r.length;i++)t["$"+r[i]]=!0;for(r=0;r<e.length;r++)i=t.hasOwnProperty("$"+e[r].value),e[r].selected!==i&&(e[r].selected=i),i&&n&&(e[r].defaultSelected=!0)}else{for(r=""+Un(r),t=null,i=0;i<e.length;i++){if(e[i].value===r){e[i].selected=!0,n&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Hu(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(ce(91));return ut({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Pp(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(ce(92));if(Ki(r)){if(1<r.length)throw Error(ce(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:Un(r)}}function l_(e,t){var r=Un(t.value),n=Un(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),n!=null&&(e.defaultValue=""+n)}function Ip(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function c_(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function zu(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?c_(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var da,u_=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,n,i){MSApp.execUnsafeLocalFunction(function(){return e(t,r,n,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(da=da||document.createElement("div"),da.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=da.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function yo(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Zi={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},tx=["Webkit","ms","Moz","O"];Object.keys(Zi).forEach(function(e){tx.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Zi[t]=Zi[e]})});function h_(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Zi.hasOwnProperty(e)&&Zi[e]?(""+t).trim():t+"px"}function d_(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=h_(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}var rx=ut({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Uu(e,t){if(t){if(rx[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ce(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ce(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ce(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ce(62))}}function Wu(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";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 Vu=null;function Ed(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ku=null,Zs=null,ei=null;function Bp(e){if(e=Yo(e)){if(typeof Ku!="function")throw Error(ce(280));var t=e.stateNode;t&&(t=sc(t),Ku(e.stateNode,e.type,t))}}function f_(e){Zs?ei?ei.push(e):ei=[e]:Zs=e}function p_(){if(Zs){var e=Zs,t=ei;if(ei=Zs=null,Bp(e),t)for(e=0;e<t.length;e++)Bp(t[e])}}function m_(e,t){return e(t)}function g_(){}var Mc=!1;function v_(e,t,r){if(Mc)return e(t,r);Mc=!0;try{return m_(e,t,r)}finally{Mc=!1,(Zs!==null||ei!==null)&&(g_(),p_())}}function wo(e,t){var r=e.stateNode;if(r===null)return null;var n=sc(r);if(n===null)return null;r=n[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":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(ce(231,t,typeof r));return r}var Gu=!1;if(pn)try{var Pi={};Object.defineProperty(Pi,"passive",{get:function(){Gu=!0}}),window.addEventListener("test",Pi,Pi),window.removeEventListener("test",Pi,Pi)}catch{Gu=!1}function nx(e,t,r,n,i,a,l,s,o){var c=Array.prototype.slice.call(arguments,3);try{t.apply(r,c)}catch(p){this.onError(p)}}var eo=!1,hl=null,dl=!1,qu=null,sx={onError:function(e){eo=!0,hl=e}};function ix(e,t,r,n,i,a,l,s,o){eo=!1,hl=null,nx.apply(sx,arguments)}function ox(e,t,r,n,i,a,l,s,o){if(ix.apply(this,arguments),eo){if(eo){var c=hl;eo=!1,hl=null}else throw Error(ce(198));dl||(dl=!0,qu=c)}}function Es(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function __(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 Op(e){if(Es(e)!==e)throw Error(ce(188))}function ax(e){var t=e.alternate;if(!t){if(t=Es(e),t===null)throw Error(ce(188));return t!==e?null:e}for(var r=e,n=t;;){var i=r.return;if(i===null)break;var a=i.alternate;if(a===null){if(n=i.return,n!==null){r=n;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===r)return Op(i),e;if(a===n)return Op(i),t;a=a.sibling}throw Error(ce(188))}if(r.return!==n.return)r=i,n=a;else{for(var l=!1,s=i.child;s;){if(s===r){l=!0,r=i,n=a;break}if(s===n){l=!0,n=i,r=a;break}s=s.sibling}if(!l){for(s=a.child;s;){if(s===r){l=!0,r=a,n=i;break}if(s===n){l=!0,n=a,r=i;break}s=s.sibling}if(!l)throw Error(ce(189))}}if(r.alternate!==n)throw Error(ce(190))}if(r.tag!==3)throw Error(ce(188));return r.stateNode.current===r?e:t}function y_(e){return e=ax(e),e!==null?w_(e):null}function w_(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=w_(e);if(t!==null)return t;e=e.sibling}return null}var S_=fr.unstable_scheduleCallback,Np=fr.unstable_cancelCallback,lx=fr.unstable_shouldYield,cx=fr.unstable_requestPaint,pt=fr.unstable_now,ux=fr.unstable_getCurrentPriorityLevel,kd=fr.unstable_ImmediatePriority,x_=fr.unstable_UserBlockingPriority,fl=fr.unstable_NormalPriority,hx=fr.unstable_LowPriority,b_=fr.unstable_IdlePriority,ec=null,Ur=null;function dx(e){if(Ur&&typeof Ur.onCommitFiberRoot=="function")try{Ur.onCommitFiberRoot(ec,e,void 0,(e.current.flags&128)===128)}catch{}}var Br=Math.clz32?Math.clz32:mx,fx=Math.log,px=Math.LN2;function mx(e){return e>>>=0,e===0?32:31-(fx(e)/px|0)|0}var fa=64,pa=4194304;function Gi(e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function pl(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,i=e.suspendedLanes,a=e.pingedLanes,l=r&268435455;if(l!==0){var s=l&~i;s!==0?n=Gi(s):(a&=l,a!==0&&(n=Gi(a)))}else l=r&~i,l!==0?n=Gi(l):a!==0&&(n=Gi(a));if(n===0)return 0;if(t!==0&&t!==n&&!(t&i)&&(i=n&-n,a=t&-t,i>=a||i===16&&(a&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0<t;)r=31-Br(t),i=1<<r,n|=e[r],t&=~i;return n}function gx(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64: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:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function vx(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var l=31-Br(a),s=1<<l,o=i[l];o===-1?(!(s&r)||s&n)&&(i[l]=gx(s,t)):o<=t&&(e.expiredLanes|=s),a&=~s}}function Xu(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function C_(){var e=fa;return fa<<=1,!(fa&4194240)&&(fa=64),e}function Ac(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function qo(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Br(t),e[t]=r}function _x(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0<r;){var i=31-Br(r),a=1<<i;t[i]=0,n[i]=-1,e[i]=-1,r&=~a}}function Ld(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-Br(r),i=1<<n;i&t|e[n]&t&&(e[n]|=t),r&=~i}}var Je=0;function E_(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var k_,Td,L_,T_,R_,Yu=!1,ma=[],Bn=null,On=null,Nn=null,So=new Map,xo=new Map,Dn=[],yx="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 submit".split(" ");function jp(e,t){switch(e){case"focusin":case"focusout":Bn=null;break;case"dragenter":case"dragleave":On=null;break;case"mouseover":case"mouseout":Nn=null;break;case"pointerover":case"pointerout":So.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":xo.delete(t.pointerId)}}function Ii(e,t,r,n,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:r,eventSystemFlags:n,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Yo(t),t!==null&&Td(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function wx(e,t,r,n,i){switch(t){case"focusin":return Bn=Ii(Bn,e,t,r,n,i),!0;case"dragenter":return On=Ii(On,e,t,r,n,i),!0;case"mouseover":return Nn=Ii(Nn,e,t,r,n,i),!0;case"pointerover":var a=i.pointerId;return So.set(a,Ii(So.get(a)||null,e,t,r,n,i)),!0;case"gotpointercapture":return a=i.pointerId,xo.set(a,Ii(xo.get(a)||null,e,t,r,n,i)),!0}return!1}function D_(e){var t=ls(e.target);if(t!==null){var r=Es(t);if(r!==null){if(t=r.tag,t===13){if(t=__(r),t!==null){e.blockedOn=t,R_(e.priority,function(){L_(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Va(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=Ju(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var n=new r.constructor(r.type,r);Vu=n,r.target.dispatchEvent(n),Vu=null}else return t=Yo(r),t!==null&&Td(t),e.blockedOn=r,!1;t.shift()}return!0}function Fp(e,t,r){Va(e)&&r.delete(t)}function Sx(){Yu=!1,Bn!==null&&Va(Bn)&&(Bn=null),On!==null&&Va(On)&&(On=null),Nn!==null&&Va(Nn)&&(Nn=null),So.forEach(Fp),xo.forEach(Fp)}function Bi(e,t){e.blockedOn===t&&(e.blockedOn=null,Yu||(Yu=!0,fr.unstable_scheduleCallback(fr.unstable_NormalPriority,Sx)))}function bo(e){function t(i){return Bi(i,e)}if(0<ma.length){Bi(ma[0],e);for(var r=1;r<ma.length;r++){var n=ma[r];n.blockedOn===e&&(n.blockedOn=null)}}for(Bn!==null&&Bi(Bn,e),On!==null&&Bi(On,e),Nn!==null&&Bi(Nn,e),So.forEach(t),xo.forEach(t),r=0;r<Dn.length;r++)n=Dn[r],n.blockedOn===e&&(n.blockedOn=null);for(;0<Dn.length&&(r=Dn[0],r.blockedOn===null);)D_(r),r.blockedOn===null&&Dn.shift()}var ti=yn.ReactCurrentBatchConfig,ml=!0;function xx(e,t,r,n){var i=Je,a=ti.transition;ti.transition=null;try{Je=1,Rd(e,t,r,n)}finally{Je=i,ti.transition=a}}function bx(e,t,r,n){var i=Je,a=ti.transition;ti.transition=null;try{Je=4,Rd(e,t,r,n)}finally{Je=i,ti.transition=a}}function Rd(e,t,r,n){if(ml){var i=Ju(e,t,r,n);if(i===null)zc(e,t,n,gl,r),jp(e,n);else if(wx(i,e,t,r,n))n.stopPropagation();else if(jp(e,n),t&4&&-1<yx.indexOf(e)){for(;i!==null;){var a=Yo(i);if(a!==null&&k_(a),a=Ju(e,t,r,n),a===null&&zc(e,t,n,gl,r),a===i)break;i=a}i!==null&&n.stopPropagation()}else zc(e,t,n,null,r)}}var gl=null;function Ju(e,t,r,n){if(gl=null,e=Ed(n),e=ls(e),e!==null)if(t=Es(e),t===null)e=null;else if(r=t.tag,r===13){if(e=__(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return gl=e,null}function M_(e){switch(e){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(ux()){case kd:return 1;case x_:return 4;case fl:case hx:return 16;case b_:return 536870912;default:return 16}default:return 16}}var An=null,Dd=null,Ka=null;function A_(){if(Ka)return Ka;var e,t=Dd,r=t.length,n,i="value"in An?An.value:An.textContent,a=i.length;for(e=0;e<r&&t[e]===i[e];e++);var l=r-e;for(n=1;n<=l&&t[r-n]===i[a-n];n++);return Ka=i.slice(e,1<n?1-n:void 0)}function Ga(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 ga(){return!0}function $p(){return!1}function mr(e){function t(r,n,i,a,l){this._reactName=r,this._targetInst=i,this.type=n,this.nativeEvent=a,this.target=l,this.currentTarget=null;for(var s in e)e.hasOwnProperty(s)&&(r=e[s],this[s]=r?r(a):a[s]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?ga:$p,this.isPropagationStopped=$p,this}return ut(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=ga)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=ga)},persist:function(){},isPersistent:ga}),t}var Si={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Md=mr(Si),Xo=ut({},Si,{view:0,detail:0}),Cx=mr(Xo),Pc,Ic,Oi,tc=ut({},Xo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ad,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!==Oi&&(Oi&&e.type==="mousemove"?(Pc=e.screenX-Oi.screenX,Ic=e.screenY-Oi.screenY):Ic=Pc=0,Oi=e),Pc)},movementY:function(e){return"movementY"in e?e.movementY:Ic}}),Hp=mr(tc),Ex=ut({},tc,{dataTransfer:0}),kx=mr(Ex),Lx=ut({},Xo,{relatedTarget:0}),Bc=mr(Lx),Tx=ut({},Si,{animationName:0,elapsedTime:0,pseudoElement:0}),Rx=mr(Tx),Dx=ut({},Si,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Mx=mr(Dx),Ax=ut({},Si,{data:0}),zp=mr(Ax),Px={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ix={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"},Bx={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ox(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Bx[e])?!!t[e]:!1}function Ad(){return Ox}var Nx=ut({},Xo,{key:function(e){if(e.key){var t=Px[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ga(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Ix[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ad,charCode:function(e){return e.type==="keypress"?Ga(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ga(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),jx=mr(Nx),Fx=ut({},tc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Up=mr(Fx),$x=ut({},Xo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ad}),Hx=mr($x),zx=ut({},Si,{propertyName:0,elapsedTime:0,pseudoElement:0}),Ux=mr(zx),Wx=ut({},tc,{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}),Vx=mr(Wx),Kx=[9,13,27,32],Pd=pn&&"CompositionEvent"in window,to=null;pn&&"documentMode"in document&&(to=document.documentMode);var Gx=pn&&"TextEvent"in window&&!to,P_=pn&&(!Pd||to&&8<to&&11>=to),Wp=" ",Vp=!1;function I_(e,t){switch(e){case"keyup":return Kx.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function B_(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ns=!1;function qx(e,t){switch(e){case"compositionend":return B_(t);case"keypress":return t.which!==32?null:(Vp=!0,Wp);case"textInput":return e=t.data,e===Wp&&Vp?null:e;default:return null}}function Xx(e,t){if(Ns)return e==="compositionend"||!Pd&&I_(e,t)?(e=A_(),Ka=Dd=An=null,Ns=!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 P_&&t.locale!=="ko"?null:t.data;default:return null}}var Yx={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 Kp(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Yx[e.type]:t==="textarea"}function O_(e,t,r,n){f_(n),t=vl(t,"onChange"),0<t.length&&(r=new Md("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var ro=null,Co=null;function Jx(e){G_(e,0)}function rc(e){var t=$s(e);if(o_(t))return e}function Qx(e,t){if(e==="change")return t}var N_=!1;if(pn){var Oc;if(pn){var Nc="oninput"in document;if(!Nc){var Gp=document.createElement("div");Gp.setAttribute("oninput","return;"),Nc=typeof Gp.oninput=="function"}Oc=Nc}else Oc=!1;N_=Oc&&(!document.documentMode||9<document.documentMode)}function qp(){ro&&(ro.detachEvent("onpropertychange",j_),Co=ro=null)}function j_(e){if(e.propertyName==="value"&&rc(Co)){var t=[];O_(t,Co,e,Ed(e)),v_(Jx,t)}}function Zx(e,t,r){e==="focusin"?(qp(),ro=t,Co=r,ro.attachEvent("onpropertychange",j_)):e==="focusout"&&qp()}function eb(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return rc(Co)}function tb(e,t){if(e==="click")return rc(t)}function rb(e,t){if(e==="input"||e==="change")return rc(t)}function nb(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Nr=typeof Object.is=="function"?Object.is:nb;function Eo(e,t){if(Nr(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var i=r[n];if(!Pu.call(t,i)||!Nr(e[i],t[i]))return!1}return!0}function Xp(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Yp(e,t){var r=Xp(e);e=0;for(var n;r;){if(r.nodeType===3){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Xp(r)}}function F_(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?F_(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function $_(){for(var e=window,t=ul();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=ul(e.document)}return t}function Id(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")}function sb(e){var t=$_(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&F_(r.ownerDocument.documentElement,r)){if(n!==null&&Id(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=r.textContent.length,a=Math.min(n.start,i);n=n.end===void 0?a:Math.min(n.end,i),!e.extend&&a>n&&(i=n,n=a,a=i),i=Yp(r,a);var l=Yp(r,n);i&&l&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==l.node||e.focusOffset!==l.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>n?(e.addRange(t),e.extend(l.node,l.offset)):(t.setEnd(l.node,l.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var ib=pn&&"documentMode"in document&&11>=document.documentMode,js=null,Qu=null,no=null,Zu=!1;function Jp(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Zu||js==null||js!==ul(n)||(n=js,"selectionStart"in n&&Id(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),no&&Eo(no,n)||(no=n,n=vl(Qu,"onSelect"),0<n.length&&(t=new Md("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=js)))}function va(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var Fs={animationend:va("Animation","AnimationEnd"),animationiteration:va("Animation","AnimationIteration"),animationstart:va("Animation","AnimationStart"),transitionend:va("Transition","TransitionEnd")},jc={},H_={};pn&&(H_=document.createElement("div").style,"AnimationEvent"in window||(delete Fs.animationend.animation,delete Fs.animationiteration.animation,delete Fs.animationstart.animation),"TransitionEvent"in window||delete Fs.transitionend.transition);function nc(e){if(jc[e])return jc[e];if(!Fs[e])return e;var t=Fs[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in H_)return jc[e]=t[r];return e}var z_=nc("animationend"),U_=nc("animationiteration"),W_=nc("animationstart"),V_=nc("transitionend"),K_=new Map,Qp="abort auxClick 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(" ");function Gn(e,t){K_.set(e,t),Cs(t,[e])}for(var Fc=0;Fc<Qp.length;Fc++){var $c=Qp[Fc],ob=$c.toLowerCase(),ab=$c[0].toUpperCase()+$c.slice(1);Gn(ob,"on"+ab)}Gn(z_,"onAnimationEnd");Gn(U_,"onAnimationIteration");Gn(W_,"onAnimationStart");Gn("dblclick","onDoubleClick");Gn("focusin","onFocus");Gn("focusout","onBlur");Gn(V_,"onTransitionEnd");ci("onMouseEnter",["mouseout","mouseover"]);ci("onMouseLeave",["mouseout","mouseover"]);ci("onPointerEnter",["pointerout","pointerover"]);ci("onPointerLeave",["pointerout","pointerover"]);Cs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Cs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Cs("onBeforeInput",["compositionend","keypress","textInput","paste"]);Cs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Cs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Cs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var qi="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),lb=new Set("cancel close invalid load scroll toggle".split(" ").concat(qi));function Zp(e,t,r){var n=e.type||"unknown-event";e.currentTarget=r,ox(n,t,void 0,e),e.currentTarget=null}function G_(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var n=e[r],i=n.event;n=n.listeners;e:{var a=void 0;if(t)for(var l=n.length-1;0<=l;l--){var s=n[l],o=s.instance,c=s.currentTarget;if(s=s.listener,o!==a&&i.isPropagationStopped())break e;Zp(i,s,c),a=o}else for(l=0;l<n.length;l++){if(s=n[l],o=s.instance,c=s.currentTarget,s=s.listener,o!==a&&i.isPropagationStopped())break e;Zp(i,s,c),a=o}}}if(dl)throw e=qu,dl=!1,qu=null,e}function rt(e,t){var r=t[sh];r===void 0&&(r=t[sh]=new Set);var n=e+"__bubble";r.has(n)||(q_(t,e,2,!1),r.add(n))}function Hc(e,t,r){var n=0;t&&(n|=4),q_(r,e,n,t)}var _a="_reactListening"+Math.random().toString(36).slice(2);function ko(e){if(!e[_a]){e[_a]=!0,t_.forEach(function(r){r!=="selectionchange"&&(lb.has(r)||Hc(r,!1,e),Hc(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[_a]||(t[_a]=!0,Hc("selectionchange",!1,t))}}function q_(e,t,r,n){switch(M_(t)){case 1:var i=xx;break;case 4:i=bx;break;default:i=Rd}r=i.bind(null,t,r,e),i=void 0,!Gu||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),n?i!==void 0?e.addEventListener(t,r,{capture:!0,passive:i}):e.addEventListener(t,r,!0):i!==void 0?e.addEventListener(t,r,{passive:i}):e.addEventListener(t,r,!1)}function zc(e,t,r,n,i){var a=n;if(!(t&1)&&!(t&2)&&n!==null)e:for(;;){if(n===null)return;var l=n.tag;if(l===3||l===4){var s=n.stateNode.containerInfo;if(s===i||s.nodeType===8&&s.parentNode===i)break;if(l===4)for(l=n.return;l!==null;){var o=l.tag;if((o===3||o===4)&&(o=l.stateNode.containerInfo,o===i||o.nodeType===8&&o.parentNode===i))return;l=l.return}for(;s!==null;){if(l=ls(s),l===null)return;if(o=l.tag,o===5||o===6){n=a=l;continue e}s=s.parentNode}}n=n.return}v_(function(){var c=a,p=Ed(r),u=[];e:{var f=K_.get(e);if(f!==void 0){var _=Md,y=e;switch(e){case"keypress":if(Ga(r)===0)break e;case"keydown":case"keyup":_=jx;break;case"focusin":y="focus",_=Bc;break;case"focusout":y="blur",_=Bc;break;case"beforeblur":case"afterblur":_=Bc;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":_=Hp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":_=kx;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":_=Hx;break;case z_:case U_:case W_:_=Rx;break;case V_:_=Ux;break;case"scroll":_=Cx;break;case"wheel":_=Vx;break;case"copy":case"cut":case"paste":_=Mx;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":_=Up}var v=(t&4)!==0,h=!v&&e==="scroll",m=v?f!==null?f+"Capture":null:f;v=[];for(var d=c,g;d!==null;){g=d;var w=g.stateNode;if(g.tag===5&&w!==null&&(g=w,m!==null&&(w=wo(d,m),w!=null&&v.push(Lo(d,w,g)))),h)break;d=d.return}0<v.length&&(f=new _(f,y,null,r,p),u.push({event:f,listeners:v}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",_=e==="mouseout"||e==="pointerout",f&&r!==Vu&&(y=r.relatedTarget||r.fromElement)&&(ls(y)||y[mn]))break e;if((_||f)&&(f=p.window===p?p:(f=p.ownerDocument)?f.defaultView||f.parentWindow:window,_?(y=r.relatedTarget||r.toElement,_=c,y=y?ls(y):null,y!==null&&(h=Es(y),y!==h||y.tag!==5&&y.tag!==6)&&(y=null)):(_=null,y=c),_!==y)){if(v=Hp,w="onMouseLeave",m="onMouseEnter",d="mouse",(e==="pointerout"||e==="pointerover")&&(v=Up,w="onPointerLeave",m="onPointerEnter",d="pointer"),h=_==null?f:$s(_),g=y==null?f:$s(y),f=new v(w,d+"leave",_,r,p),f.target=h,f.relatedTarget=g,w=null,ls(p)===c&&(v=new v(m,d+"enter",y,r,p),v.target=g,v.relatedTarget=h,w=v),h=w,_&&y)t:{for(v=_,m=y,d=0,g=v;g;g=As(g))d++;for(g=0,w=m;w;w=As(w))g++;for(;0<d-g;)v=As(v),d--;for(;0<g-d;)m=As(m),g--;for(;d--;){if(v===m||m!==null&&v===m.alternate)break t;v=As(v),m=As(m)}v=null}else v=null;_!==null&&em(u,f,_,v,!1),y!==null&&h!==null&&em(u,h,y,v,!0)}}e:{if(f=c?$s(c):window,_=f.nodeName&&f.nodeName.toLowerCase(),_==="select"||_==="input"&&f.type==="file")var b=Qx;else if(Kp(f))if(N_)b=rb;else{b=eb;var x=Zx}else(_=f.nodeName)&&_.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(b=tb);if(b&&(b=b(e,c))){O_(u,b,r,p);break e}x&&x(e,f,c),e==="focusout"&&(x=f._wrapperState)&&x.controlled&&f.type==="number"&&$u(f,"number",f.value)}switch(x=c?$s(c):window,e){case"focusin":(Kp(x)||x.contentEditable==="true")&&(js=x,Qu=c,no=null);break;case"focusout":no=Qu=js=null;break;case"mousedown":Zu=!0;break;case"contextmenu":case"mouseup":case"dragend":Zu=!1,Jp(u,r,p);break;case"selectionchange":if(ib)break;case"keydown":case"keyup":Jp(u,r,p)}var C;if(Pd)e:{switch(e){case"compositionstart":var S="onCompositionStart";break e;case"compositionend":S="onCompositionEnd";break e;case"compositionupdate":S="onCompositionUpdate";break e}S=void 0}else Ns?I_(e,r)&&(S="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(S="onCompositionStart");S&&(P_&&r.locale!=="ko"&&(Ns||S!=="onCompositionStart"?S==="onCompositionEnd"&&Ns&&(C=A_()):(An=p,Dd="value"in An?An.value:An.textContent,Ns=!0)),x=vl(c,S),0<x.length&&(S=new zp(S,e,null,r,p),u.push({event:S,listeners:x}),C?S.data=C:(C=B_(r),C!==null&&(S.data=C)))),(C=Gx?qx(e,r):Xx(e,r))&&(c=vl(c,"onBeforeInput"),0<c.length&&(p=new zp("onBeforeInput","beforeinput",null,r,p),u.push({event:p,listeners:c}),p.data=C))}G_(u,t)})}function Lo(e,t,r){return{instance:e,listener:t,currentTarget:r}}function vl(e,t){for(var r=t+"Capture",n=[];e!==null;){var i=e,a=i.stateNode;i.tag===5&&a!==null&&(i=a,a=wo(e,r),a!=null&&n.unshift(Lo(e,a,i)),a=wo(e,t),a!=null&&n.push(Lo(e,a,i))),e=e.return}return n}function As(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function em(e,t,r,n,i){for(var a=t._reactName,l=[];r!==null&&r!==n;){var s=r,o=s.alternate,c=s.stateNode;if(o!==null&&o===n)break;s.tag===5&&c!==null&&(s=c,i?(o=wo(r,a),o!=null&&l.unshift(Lo(r,o,s))):i||(o=wo(r,a),o!=null&&l.push(Lo(r,o,s)))),r=r.return}l.length!==0&&e.push({event:t,listeners:l})}var cb=/\r\n?/g,ub=/\u0000|\uFFFD/g;function tm(e){return(typeof e=="string"?e:""+e).replace(cb,`
38
- `).replace(ub,"")}function ya(e,t,r){if(t=tm(t),tm(e)!==t&&r)throw Error(ce(425))}function _l(){}var eh=null,th=null;function rh(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var nh=typeof setTimeout=="function"?setTimeout:void 0,hb=typeof clearTimeout=="function"?clearTimeout:void 0,rm=typeof Promise=="function"?Promise:void 0,db=typeof queueMicrotask=="function"?queueMicrotask:typeof rm<"u"?function(e){return rm.resolve(null).then(e).catch(fb)}:nh;function fb(e){setTimeout(function(){throw e})}function Uc(e,t){var r=t,n=0;do{var i=r.nextSibling;if(e.removeChild(r),i&&i.nodeType===8)if(r=i.data,r==="/$"){if(n===0){e.removeChild(i),bo(t);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=i}while(r);bo(t)}function jn(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==="$?")break;if(t==="/$")return null}}return e}function nm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var xi=Math.random().toString(36).slice(2),Hr="__reactFiber$"+xi,To="__reactProps$"+xi,mn="__reactContainer$"+xi,sh="__reactEvents$"+xi,pb="__reactListeners$"+xi,mb="__reactHandles$"+xi;function ls(e){var t=e[Hr];if(t)return t;for(var r=e.parentNode;r;){if(t=r[mn]||r[Hr]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=nm(e);e!==null;){if(r=e[Hr])return r;e=nm(e)}return t}e=r,r=e.parentNode}return null}function Yo(e){return e=e[Hr]||e[mn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function $s(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(ce(33))}function sc(e){return e[To]||null}var ih=[],Hs=-1;function qn(e){return{current:e}}function nt(e){0>Hs||(e.current=ih[Hs],ih[Hs]=null,Hs--)}function Ze(e,t){Hs++,ih[Hs]=e.current,e.current=t}var Wn={},Xt=qn(Wn),ir=qn(!1),ys=Wn;function ui(e,t){var r=e.type.contextTypes;if(!r)return Wn;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in r)i[a]=t[a];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function or(e){return e=e.childContextTypes,e!=null}function yl(){nt(ir),nt(Xt)}function sm(e,t,r){if(Xt.current!==Wn)throw Error(ce(168));Ze(Xt,t),Ze(ir,r)}function X_(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in t))throw Error(ce(108,ZS(e)||"Unknown",i));return ut({},r,n)}function wl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Wn,ys=Xt.current,Ze(Xt,e),Ze(ir,ir.current),!0}function im(e,t,r){var n=e.stateNode;if(!n)throw Error(ce(169));r?(e=X_(e,t,ys),n.__reactInternalMemoizedMergedChildContext=e,nt(ir),nt(Xt),Ze(Xt,e)):nt(ir),Ze(ir,r)}var ln=null,ic=!1,Wc=!1;function Y_(e){ln===null?ln=[e]:ln.push(e)}function gb(e){ic=!0,Y_(e)}function Xn(){if(!Wc&&ln!==null){Wc=!0;var e=0,t=Je;try{var r=ln;for(Je=1;e<r.length;e++){var n=r[e];do n=n(!0);while(n!==null)}ln=null,ic=!1}catch(i){throw ln!==null&&(ln=ln.slice(e+1)),S_(kd,Xn),i}finally{Je=t,Wc=!1}}return null}var zs=[],Us=0,Sl=null,xl=0,_r=[],yr=0,ws=null,cn=1,un="";function is(e,t){zs[Us++]=xl,zs[Us++]=Sl,Sl=e,xl=t}function J_(e,t,r){_r[yr++]=cn,_r[yr++]=un,_r[yr++]=ws,ws=e;var n=cn;e=un;var i=32-Br(n)-1;n&=~(1<<i),r+=1;var a=32-Br(t)+i;if(30<a){var l=i-i%5;a=(n&(1<<l)-1).toString(32),n>>=l,i-=l,cn=1<<32-Br(t)+i|r<<i|n,un=a+e}else cn=1<<a|r<<i|n,un=e}function Bd(e){e.return!==null&&(is(e,1),J_(e,1,0))}function Od(e){for(;e===Sl;)Sl=zs[--Us],zs[Us]=null,xl=zs[--Us],zs[Us]=null;for(;e===ws;)ws=_r[--yr],_r[yr]=null,un=_r[--yr],_r[yr]=null,cn=_r[--yr],_r[yr]=null}var dr=null,hr=null,it=!1,Pr=null;function Q_(e,t){var r=wr(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function om(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,dr=e,hr=jn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,dr=e,hr=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=ws!==null?{id:cn,overflow:un}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=wr(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,dr=e,hr=null,!0):!1;default:return!1}}function oh(e){return(e.mode&1)!==0&&(e.flags&128)===0}function ah(e){if(it){var t=hr;if(t){var r=t;if(!om(e,t)){if(oh(e))throw Error(ce(418));t=jn(r.nextSibling);var n=dr;t&&om(e,t)?Q_(n,r):(e.flags=e.flags&-4097|2,it=!1,dr=e)}}else{if(oh(e))throw Error(ce(418));e.flags=e.flags&-4097|2,it=!1,dr=e}}}function am(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;dr=e}function wa(e){if(e!==dr)return!1;if(!it)return am(e),it=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!rh(e.type,e.memoizedProps)),t&&(t=hr)){if(oh(e))throw Z_(),Error(ce(418));for(;t;)Q_(e,t),t=jn(t.nextSibling)}if(am(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(ce(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){hr=jn(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}hr=null}}else hr=dr?jn(e.stateNode.nextSibling):null;return!0}function Z_(){for(var e=hr;e;)e=jn(e.nextSibling)}function hi(){hr=dr=null,it=!1}function Nd(e){Pr===null?Pr=[e]:Pr.push(e)}var vb=yn.ReactCurrentBatchConfig;function Ni(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(ce(309));var n=r.stateNode}if(!n)throw Error(ce(147,e));var i=n,a=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===a?t.ref:(t=function(l){var s=i.refs;l===null?delete s[a]:s[a]=l},t._stringRef=a,t)}if(typeof e!="string")throw Error(ce(284));if(!r._owner)throw Error(ce(290,e))}return e}function Sa(e,t){throw e=Object.prototype.toString.call(t),Error(ce(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function lm(e){var t=e._init;return t(e._payload)}function e0(e){function t(m,d){if(e){var g=m.deletions;g===null?(m.deletions=[d],m.flags|=16):g.push(d)}}function r(m,d){if(!e)return null;for(;d!==null;)t(m,d),d=d.sibling;return null}function n(m,d){for(m=new Map;d!==null;)d.key!==null?m.set(d.key,d):m.set(d.index,d),d=d.sibling;return m}function i(m,d){return m=zn(m,d),m.index=0,m.sibling=null,m}function a(m,d,g){return m.index=g,e?(g=m.alternate,g!==null?(g=g.index,g<d?(m.flags|=2,d):g):(m.flags|=2,d)):(m.flags|=1048576,d)}function l(m){return e&&m.alternate===null&&(m.flags|=2),m}function s(m,d,g,w){return d===null||d.tag!==6?(d=Jc(g,m.mode,w),d.return=m,d):(d=i(d,g),d.return=m,d)}function o(m,d,g,w){var b=g.type;return b===Os?p(m,d,g.props.children,w,g.key):d!==null&&(d.elementType===b||typeof b=="object"&&b!==null&&b.$$typeof===Ln&&lm(b)===d.type)?(w=i(d,g.props),w.ref=Ni(m,d,g),w.return=m,w):(w=el(g.type,g.key,g.props,null,m.mode,w),w.ref=Ni(m,d,g),w.return=m,w)}function c(m,d,g,w){return d===null||d.tag!==4||d.stateNode.containerInfo!==g.containerInfo||d.stateNode.implementation!==g.implementation?(d=Qc(g,m.mode,w),d.return=m,d):(d=i(d,g.children||[]),d.return=m,d)}function p(m,d,g,w,b){return d===null||d.tag!==7?(d=gs(g,m.mode,w,b),d.return=m,d):(d=i(d,g),d.return=m,d)}function u(m,d,g){if(typeof d=="string"&&d!==""||typeof d=="number")return d=Jc(""+d,m.mode,g),d.return=m,d;if(typeof d=="object"&&d!==null){switch(d.$$typeof){case ua:return g=el(d.type,d.key,d.props,null,m.mode,g),g.ref=Ni(m,null,d),g.return=m,g;case Bs:return d=Qc(d,m.mode,g),d.return=m,d;case Ln:var w=d._init;return u(m,w(d._payload),g)}if(Ki(d)||Ai(d))return d=gs(d,m.mode,g,null),d.return=m,d;Sa(m,d)}return null}function f(m,d,g,w){var b=d!==null?d.key:null;if(typeof g=="string"&&g!==""||typeof g=="number")return b!==null?null:s(m,d,""+g,w);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case ua:return g.key===b?o(m,d,g,w):null;case Bs:return g.key===b?c(m,d,g,w):null;case Ln:return b=g._init,f(m,d,b(g._payload),w)}if(Ki(g)||Ai(g))return b!==null?null:p(m,d,g,w,null);Sa(m,g)}return null}function _(m,d,g,w,b){if(typeof w=="string"&&w!==""||typeof w=="number")return m=m.get(g)||null,s(d,m,""+w,b);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case ua:return m=m.get(w.key===null?g:w.key)||null,o(d,m,w,b);case Bs:return m=m.get(w.key===null?g:w.key)||null,c(d,m,w,b);case Ln:var x=w._init;return _(m,d,g,x(w._payload),b)}if(Ki(w)||Ai(w))return m=m.get(g)||null,p(d,m,w,b,null);Sa(d,w)}return null}function y(m,d,g,w){for(var b=null,x=null,C=d,S=d=0,E=null;C!==null&&S<g.length;S++){C.index>S?(E=C,C=null):E=C.sibling;var L=f(m,C,g[S],w);if(L===null){C===null&&(C=E);break}e&&C&&L.alternate===null&&t(m,C),d=a(L,d,S),x===null?b=L:x.sibling=L,x=L,C=E}if(S===g.length)return r(m,C),it&&is(m,S),b;if(C===null){for(;S<g.length;S++)C=u(m,g[S],w),C!==null&&(d=a(C,d,S),x===null?b=C:x.sibling=C,x=C);return it&&is(m,S),b}for(C=n(m,C);S<g.length;S++)E=_(C,m,S,g[S],w),E!==null&&(e&&E.alternate!==null&&C.delete(E.key===null?S:E.key),d=a(E,d,S),x===null?b=E:x.sibling=E,x=E);return e&&C.forEach(function(A){return t(m,A)}),it&&is(m,S),b}function v(m,d,g,w){var b=Ai(g);if(typeof b!="function")throw Error(ce(150));if(g=b.call(g),g==null)throw Error(ce(151));for(var x=b=null,C=d,S=d=0,E=null,L=g.next();C!==null&&!L.done;S++,L=g.next()){C.index>S?(E=C,C=null):E=C.sibling;var A=f(m,C,L.value,w);if(A===null){C===null&&(C=E);break}e&&C&&A.alternate===null&&t(m,C),d=a(A,d,S),x===null?b=A:x.sibling=A,x=A,C=E}if(L.done)return r(m,C),it&&is(m,S),b;if(C===null){for(;!L.done;S++,L=g.next())L=u(m,L.value,w),L!==null&&(d=a(L,d,S),x===null?b=L:x.sibling=L,x=L);return it&&is(m,S),b}for(C=n(m,C);!L.done;S++,L=g.next())L=_(C,m,S,L.value,w),L!==null&&(e&&L.alternate!==null&&C.delete(L.key===null?S:L.key),d=a(L,d,S),x===null?b=L:x.sibling=L,x=L);return e&&C.forEach(function(M){return t(m,M)}),it&&is(m,S),b}function h(m,d,g,w){if(typeof g=="object"&&g!==null&&g.type===Os&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case ua:e:{for(var b=g.key,x=d;x!==null;){if(x.key===b){if(b=g.type,b===Os){if(x.tag===7){r(m,x.sibling),d=i(x,g.props.children),d.return=m,m=d;break e}}else if(x.elementType===b||typeof b=="object"&&b!==null&&b.$$typeof===Ln&&lm(b)===x.type){r(m,x.sibling),d=i(x,g.props),d.ref=Ni(m,x,g),d.return=m,m=d;break e}r(m,x);break}else t(m,x);x=x.sibling}g.type===Os?(d=gs(g.props.children,m.mode,w,g.key),d.return=m,m=d):(w=el(g.type,g.key,g.props,null,m.mode,w),w.ref=Ni(m,d,g),w.return=m,m=w)}return l(m);case Bs:e:{for(x=g.key;d!==null;){if(d.key===x)if(d.tag===4&&d.stateNode.containerInfo===g.containerInfo&&d.stateNode.implementation===g.implementation){r(m,d.sibling),d=i(d,g.children||[]),d.return=m,m=d;break e}else{r(m,d);break}else t(m,d);d=d.sibling}d=Qc(g,m.mode,w),d.return=m,m=d}return l(m);case Ln:return x=g._init,h(m,d,x(g._payload),w)}if(Ki(g))return y(m,d,g,w);if(Ai(g))return v(m,d,g,w);Sa(m,g)}return typeof g=="string"&&g!==""||typeof g=="number"?(g=""+g,d!==null&&d.tag===6?(r(m,d.sibling),d=i(d,g),d.return=m,m=d):(r(m,d),d=Jc(g,m.mode,w),d.return=m,m=d),l(m)):r(m,d)}return h}var di=e0(!0),t0=e0(!1),bl=qn(null),Cl=null,Ws=null,jd=null;function Fd(){jd=Ws=Cl=null}function $d(e){var t=bl.current;nt(bl),e._currentValue=t}function lh(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function ri(e,t){Cl=e,jd=Ws=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(sr=!0),e.firstContext=null)}function Cr(e){var t=e._currentValue;if(jd!==e)if(e={context:e,memoizedValue:t,next:null},Ws===null){if(Cl===null)throw Error(ce(308));Ws=e,Cl.dependencies={lanes:0,firstContext:e}}else Ws=Ws.next=e;return t}var cs=null;function Hd(e){cs===null?cs=[e]:cs.push(e)}function r0(e,t,r,n){var i=t.interleaved;return i===null?(r.next=r,Hd(t)):(r.next=i.next,i.next=r),t.interleaved=r,gn(e,n)}function gn(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var Tn=!1;function zd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function n0(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function dn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Fn(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,qe&2){var i=n.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),n.pending=t,gn(e,r)}return i=n.interleaved,i===null?(t.next=t,Hd(n)):(t.next=i.next,i.next=t),n.interleaved=t,gn(e,r)}function qa(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Ld(e,r)}}function cm(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var i=null,a=null;if(r=r.firstBaseUpdate,r!==null){do{var l={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};a===null?i=a=l:a=a.next=l,r=r.next}while(r!==null);a===null?i=a=t:a=a.next=t}else i=a=t;r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function El(e,t,r,n){var i=e.updateQueue;Tn=!1;var a=i.firstBaseUpdate,l=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var o=s,c=o.next;o.next=null,l===null?a=c:l.next=c,l=o;var p=e.alternate;p!==null&&(p=p.updateQueue,s=p.lastBaseUpdate,s!==l&&(s===null?p.firstBaseUpdate=c:s.next=c,p.lastBaseUpdate=o))}if(a!==null){var u=i.baseState;l=0,p=c=o=null,s=a;do{var f=s.lane,_=s.eventTime;if((n&f)===f){p!==null&&(p=p.next={eventTime:_,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var y=e,v=s;switch(f=t,_=r,v.tag){case 1:if(y=v.payload,typeof y=="function"){u=y.call(_,u,f);break e}u=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=v.payload,f=typeof y=="function"?y.call(_,u,f):y,f==null)break e;u=ut({},u,f);break e;case 2:Tn=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[s]:f.push(s))}else _={eventTime:_,lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},p===null?(c=p=_,o=u):p=p.next=_,l|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;f=s,s=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(!0);if(p===null&&(o=u),i.baseState=o,i.firstBaseUpdate=c,i.lastBaseUpdate=p,t=i.shared.interleaved,t!==null){i=t;do l|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);xs|=l,e.lanes=l,e.memoizedState=u}}function um(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var n=e[t],i=n.callback;if(i!==null){if(n.callback=null,n=r,typeof i!="function")throw Error(ce(191,i));i.call(n)}}}var Jo={},Wr=qn(Jo),Ro=qn(Jo),Do=qn(Jo);function us(e){if(e===Jo)throw Error(ce(174));return e}function Ud(e,t){switch(Ze(Do,t),Ze(Ro,e),Ze(Wr,Jo),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:zu(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=zu(t,e)}nt(Wr),Ze(Wr,t)}function fi(){nt(Wr),nt(Ro),nt(Do)}function s0(e){us(Do.current);var t=us(Wr.current),r=zu(t,e.type);t!==r&&(Ze(Ro,e),Ze(Wr,r))}function Wd(e){Ro.current===e&&(nt(Wr),nt(Ro))}var at=qn(0);function kl(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)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 Vc=[];function Vd(){for(var e=0;e<Vc.length;e++)Vc[e]._workInProgressVersionPrimary=null;Vc.length=0}var Xa=yn.ReactCurrentDispatcher,Kc=yn.ReactCurrentBatchConfig,Ss=0,ct=null,St=null,Lt=null,Ll=!1,so=!1,Mo=0,_b=0;function Ut(){throw Error(ce(321))}function Kd(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!Nr(e[r],t[r]))return!1;return!0}function Gd(e,t,r,n,i,a){if(Ss=a,ct=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Xa.current=e===null||e.memoizedState===null?xb:bb,e=r(n,i),so){a=0;do{if(so=!1,Mo=0,25<=a)throw Error(ce(301));a+=1,Lt=St=null,t.updateQueue=null,Xa.current=Cb,e=r(n,i)}while(so)}if(Xa.current=Tl,t=St!==null&&St.next!==null,Ss=0,Lt=St=ct=null,Ll=!1,t)throw Error(ce(300));return e}function qd(){var e=Mo!==0;return Mo=0,e}function $r(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Lt===null?ct.memoizedState=Lt=e:Lt=Lt.next=e,Lt}function Er(){if(St===null){var e=ct.alternate;e=e!==null?e.memoizedState:null}else e=St.next;var t=Lt===null?ct.memoizedState:Lt.next;if(t!==null)Lt=t,St=e;else{if(e===null)throw Error(ce(310));St=e,e={memoizedState:St.memoizedState,baseState:St.baseState,baseQueue:St.baseQueue,queue:St.queue,next:null},Lt===null?ct.memoizedState=Lt=e:Lt=Lt.next=e}return Lt}function Ao(e,t){return typeof t=="function"?t(e):t}function Gc(e){var t=Er(),r=t.queue;if(r===null)throw Error(ce(311));r.lastRenderedReducer=e;var n=St,i=n.baseQueue,a=r.pending;if(a!==null){if(i!==null){var l=i.next;i.next=a.next,a.next=l}n.baseQueue=i=a,r.pending=null}if(i!==null){a=i.next,n=n.baseState;var s=l=null,o=null,c=a;do{var p=c.lane;if((Ss&p)===p)o!==null&&(o=o.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),n=c.hasEagerState?c.eagerState:e(n,c.action);else{var u={lane:p,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};o===null?(s=o=u,l=n):o=o.next=u,ct.lanes|=p,xs|=p}c=c.next}while(c!==null&&c!==a);o===null?l=n:o.next=s,Nr(n,t.memoizedState)||(sr=!0),t.memoizedState=n,t.baseState=l,t.baseQueue=o,r.lastRenderedState=n}if(e=r.interleaved,e!==null){i=e;do a=i.lane,ct.lanes|=a,xs|=a,i=i.next;while(i!==e)}else i===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function qc(e){var t=Er(),r=t.queue;if(r===null)throw Error(ce(311));r.lastRenderedReducer=e;var n=r.dispatch,i=r.pending,a=t.memoizedState;if(i!==null){r.pending=null;var l=i=i.next;do a=e(a,l.action),l=l.next;while(l!==i);Nr(a,t.memoizedState)||(sr=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),r.lastRenderedState=a}return[a,n]}function i0(){}function o0(e,t){var r=ct,n=Er(),i=t(),a=!Nr(n.memoizedState,i);if(a&&(n.memoizedState=i,sr=!0),n=n.queue,Xd(c0.bind(null,r,n,e),[e]),n.getSnapshot!==t||a||Lt!==null&&Lt.memoizedState.tag&1){if(r.flags|=2048,Po(9,l0.bind(null,r,n,i,t),void 0,null),Pt===null)throw Error(ce(349));Ss&30||a0(r,t,i)}return i}function a0(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=ct.updateQueue,t===null?(t={lastEffect:null,stores:null},ct.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function l0(e,t,r,n){t.value=r,t.getSnapshot=n,u0(t)&&h0(e)}function c0(e,t,r){return r(function(){u0(t)&&h0(e)})}function u0(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Nr(e,r)}catch{return!0}}function h0(e){var t=gn(e,1);t!==null&&Or(t,e,1,-1)}function hm(e){var t=$r();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ao,lastRenderedState:e},t.queue=e,e=e.dispatch=Sb.bind(null,ct,e),[t.memoizedState,e]}function Po(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},t=ct.updateQueue,t===null?(t={lastEffect:null,stores:null},ct.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e)),e}function d0(){return Er().memoizedState}function Ya(e,t,r,n){var i=$r();ct.flags|=e,i.memoizedState=Po(1|t,r,void 0,n===void 0?null:n)}function oc(e,t,r,n){var i=Er();n=n===void 0?null:n;var a=void 0;if(St!==null){var l=St.memoizedState;if(a=l.destroy,n!==null&&Kd(n,l.deps)){i.memoizedState=Po(t,r,a,n);return}}ct.flags|=e,i.memoizedState=Po(1|t,r,a,n)}function dm(e,t){return Ya(8390656,8,e,t)}function Xd(e,t){return oc(2048,8,e,t)}function f0(e,t){return oc(4,2,e,t)}function p0(e,t){return oc(4,4,e,t)}function m0(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function g0(e,t,r){return r=r!=null?r.concat([e]):null,oc(4,4,m0.bind(null,t,e),r)}function Yd(){}function v0(e,t){var r=Er();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&Kd(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function _0(e,t){var r=Er();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&Kd(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function y0(e,t,r){return Ss&21?(Nr(r,t)||(r=C_(),ct.lanes|=r,xs|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,sr=!0),e.memoizedState=r)}function yb(e,t){var r=Je;Je=r!==0&&4>r?r:4,e(!0);var n=Kc.transition;Kc.transition={};try{e(!1),t()}finally{Je=r,Kc.transition=n}}function w0(){return Er().memoizedState}function wb(e,t,r){var n=Hn(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},S0(e))x0(t,r);else if(r=r0(e,t,r,n),r!==null){var i=er();Or(r,e,n,i),b0(r,t,n)}}function Sb(e,t,r){var n=Hn(e),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(S0(e))x0(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var l=t.lastRenderedState,s=a(l,r);if(i.hasEagerState=!0,i.eagerState=s,Nr(s,l)){var o=t.interleaved;o===null?(i.next=i,Hd(t)):(i.next=o.next,o.next=i),t.interleaved=i;return}}catch{}finally{}r=r0(e,t,i,n),r!==null&&(i=er(),Or(r,e,n,i),b0(r,t,n))}}function S0(e){var t=e.alternate;return e===ct||t!==null&&t===ct}function x0(e,t){so=Ll=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function b0(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Ld(e,r)}}var Tl={readContext:Cr,useCallback:Ut,useContext:Ut,useEffect:Ut,useImperativeHandle:Ut,useInsertionEffect:Ut,useLayoutEffect:Ut,useMemo:Ut,useReducer:Ut,useRef:Ut,useState:Ut,useDebugValue:Ut,useDeferredValue:Ut,useTransition:Ut,useMutableSource:Ut,useSyncExternalStore:Ut,useId:Ut,unstable_isNewReconciler:!1},xb={readContext:Cr,useCallback:function(e,t){return $r().memoizedState=[e,t===void 0?null:t],e},useContext:Cr,useEffect:dm,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Ya(4194308,4,m0.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Ya(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ya(4,2,e,t)},useMemo:function(e,t){var r=$r();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=$r();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=wb.bind(null,ct,e),[n.memoizedState,e]},useRef:function(e){var t=$r();return e={current:e},t.memoizedState=e},useState:hm,useDebugValue:Yd,useDeferredValue:function(e){return $r().memoizedState=e},useTransition:function(){var e=hm(!1),t=e[0];return e=yb.bind(null,e[1]),$r().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=ct,i=$r();if(it){if(r===void 0)throw Error(ce(407));r=r()}else{if(r=t(),Pt===null)throw Error(ce(349));Ss&30||a0(n,t,r)}i.memoizedState=r;var a={value:r,getSnapshot:t};return i.queue=a,dm(c0.bind(null,n,a,e),[e]),n.flags|=2048,Po(9,l0.bind(null,n,a,r,t),void 0,null),r},useId:function(){var e=$r(),t=Pt.identifierPrefix;if(it){var r=un,n=cn;r=(n&~(1<<32-Br(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=Mo++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=_b++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},bb={readContext:Cr,useCallback:v0,useContext:Cr,useEffect:Xd,useImperativeHandle:g0,useInsertionEffect:f0,useLayoutEffect:p0,useMemo:_0,useReducer:Gc,useRef:d0,useState:function(){return Gc(Ao)},useDebugValue:Yd,useDeferredValue:function(e){var t=Er();return y0(t,St.memoizedState,e)},useTransition:function(){var e=Gc(Ao)[0],t=Er().memoizedState;return[e,t]},useMutableSource:i0,useSyncExternalStore:o0,useId:w0,unstable_isNewReconciler:!1},Cb={readContext:Cr,useCallback:v0,useContext:Cr,useEffect:Xd,useImperativeHandle:g0,useInsertionEffect:f0,useLayoutEffect:p0,useMemo:_0,useReducer:qc,useRef:d0,useState:function(){return qc(Ao)},useDebugValue:Yd,useDeferredValue:function(e){var t=Er();return St===null?t.memoizedState=e:y0(t,St.memoizedState,e)},useTransition:function(){var e=qc(Ao)[0],t=Er().memoizedState;return[e,t]},useMutableSource:i0,useSyncExternalStore:o0,useId:w0,unstable_isNewReconciler:!1};function Dr(e,t){if(e&&e.defaultProps){t=ut({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function ch(e,t,r,n){t=e.memoizedState,r=r(n,t),r=r==null?t:ut({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var ac={isMounted:function(e){return(e=e._reactInternals)?Es(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=er(),i=Hn(e),a=dn(n,i);a.payload=t,r!=null&&(a.callback=r),t=Fn(e,a,i),t!==null&&(Or(t,e,i,n),qa(t,e,i))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=er(),i=Hn(e),a=dn(n,i);a.tag=1,a.payload=t,r!=null&&(a.callback=r),t=Fn(e,a,i),t!==null&&(Or(t,e,i,n),qa(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=er(),n=Hn(e),i=dn(r,n);i.tag=2,t!=null&&(i.callback=t),t=Fn(e,i,n),t!==null&&(Or(t,e,n,r),qa(t,e,n))}};function fm(e,t,r,n,i,a,l){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,a,l):t.prototype&&t.prototype.isPureReactComponent?!Eo(r,n)||!Eo(i,a):!0}function C0(e,t,r){var n=!1,i=Wn,a=t.contextType;return typeof a=="object"&&a!==null?a=Cr(a):(i=or(t)?ys:Xt.current,n=t.contextTypes,a=(n=n!=null)?ui(e,i):Wn),t=new t(r,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=ac,e.stateNode=t,t._reactInternals=e,n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function pm(e,t,r,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,n),t.state!==e&&ac.enqueueReplaceState(t,t.state,null)}function uh(e,t,r,n){var i=e.stateNode;i.props=r,i.state=e.memoizedState,i.refs={},zd(e);var a=t.contextType;typeof a=="object"&&a!==null?i.context=Cr(a):(a=or(t)?ys:Xt.current,i.context=ui(e,a)),i.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a=="function"&&(ch(e,t,a,r),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&ac.enqueueReplaceState(i,i.state,null),El(e,r,i,n),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function pi(e,t){try{var r="",n=t;do r+=QS(n),n=n.return;while(n);var i=r}catch(a){i=`
37
+ `+i[l].replace(" at new "," at ");return e.displayName&&o.includes("<anonymous>")&&(o=o.replace("<anonymous>",e.displayName)),o}while(1<=l&&0<=s);break}}}finally{Rc=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Vi(e):""}function QS(e){switch(e.tag){case 5:return Vi(e.type);case 16:return Vi("Lazy");case 13:return Vi("Suspense");case 19:return Vi("SuspenseList");case 0:case 2:case 15:return e=Dc(e.type,!1),e;case 11:return e=Dc(e.type.render,!1),e;case 1:return e=Dc(e.type,!0),e;default:return""}}function Nu(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Os:return"Fragment";case Bs:return"Portal";case Iu:return"Profiler";case xd:return"StrictMode";case Bu:return"Suspense";case Ou:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case n_:return(e.displayName||"Context")+".Consumer";case r_:return(e._context.displayName||"Context")+".Provider";case bd:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Cd:return t=e.displayName||null,t!==null?t:Nu(e.type)||"Memo";case Ln:t=e._payload,e=e._init;try{return Nu(e(t))}catch{}}return null}function ZS(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Nu(t);case 8:return t===xd?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Un(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function i_(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function ex(e){var t=i_(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(l){n=""+l,a.call(this,l)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(l){n=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ha(e){e._valueTracker||(e._valueTracker=ex(e))}function o_(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=i_(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function ul(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}}function ju(e,t){var r=t.checked;return ut({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function Mp(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=Un(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function a_(e,t){t=t.checked,t!=null&&Sd(e,"checked",t,!1)}function Fu(e,t){a_(e,t);var r=Un(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?$u(e,t.type,r):t.hasOwnProperty("defaultValue")&&$u(e,t.type,Un(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Ap(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function $u(e,t,r){(t!=="number"||ul(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Ki=Array.isArray;function Qs(e,t,r,n){if(e=e.options,t){t={};for(var i=0;i<r.length;i++)t["$"+r[i]]=!0;for(r=0;r<e.length;r++)i=t.hasOwnProperty("$"+e[r].value),e[r].selected!==i&&(e[r].selected=i),i&&n&&(e[r].defaultSelected=!0)}else{for(r=""+Un(r),t=null,i=0;i<e.length;i++){if(e[i].value===r){e[i].selected=!0,n&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Hu(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(ce(91));return ut({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Pp(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(ce(92));if(Ki(r)){if(1<r.length)throw Error(ce(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:Un(r)}}function l_(e,t){var r=Un(t.value),n=Un(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),n!=null&&(e.defaultValue=""+n)}function Ip(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function c_(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function zu(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?c_(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var da,u_=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,n,i){MSApp.execUnsafeLocalFunction(function(){return e(t,r,n,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(da=da||document.createElement("div"),da.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=da.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function yo(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Zi={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},tx=["Webkit","ms","Moz","O"];Object.keys(Zi).forEach(function(e){tx.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Zi[t]=Zi[e]})});function h_(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Zi.hasOwnProperty(e)&&Zi[e]?(""+t).trim():t+"px"}function d_(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=h_(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}var rx=ut({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Uu(e,t){if(t){if(rx[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ce(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ce(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ce(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ce(62))}}function Wu(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";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 Vu=null;function Ed(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ku=null,Zs=null,ei=null;function Bp(e){if(e=Yo(e)){if(typeof Ku!="function")throw Error(ce(280));var t=e.stateNode;t&&(t=sc(t),Ku(e.stateNode,e.type,t))}}function f_(e){Zs?ei?ei.push(e):ei=[e]:Zs=e}function p_(){if(Zs){var e=Zs,t=ei;if(ei=Zs=null,Bp(e),t)for(e=0;e<t.length;e++)Bp(t[e])}}function m_(e,t){return e(t)}function g_(){}var Mc=!1;function v_(e,t,r){if(Mc)return e(t,r);Mc=!0;try{return m_(e,t,r)}finally{Mc=!1,(Zs!==null||ei!==null)&&(g_(),p_())}}function wo(e,t){var r=e.stateNode;if(r===null)return null;var n=sc(r);if(n===null)return null;r=n[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":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(ce(231,t,typeof r));return r}var Gu=!1;if(pn)try{var Pi={};Object.defineProperty(Pi,"passive",{get:function(){Gu=!0}}),window.addEventListener("test",Pi,Pi),window.removeEventListener("test",Pi,Pi)}catch{Gu=!1}function nx(e,t,r,n,i,a,l,s,o){var c=Array.prototype.slice.call(arguments,3);try{t.apply(r,c)}catch(p){this.onError(p)}}var eo=!1,hl=null,dl=!1,qu=null,sx={onError:function(e){eo=!0,hl=e}};function ix(e,t,r,n,i,a,l,s,o){eo=!1,hl=null,nx.apply(sx,arguments)}function ox(e,t,r,n,i,a,l,s,o){if(ix.apply(this,arguments),eo){if(eo){var c=hl;eo=!1,hl=null}else throw Error(ce(198));dl||(dl=!0,qu=c)}}function Es(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function __(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 Op(e){if(Es(e)!==e)throw Error(ce(188))}function ax(e){var t=e.alternate;if(!t){if(t=Es(e),t===null)throw Error(ce(188));return t!==e?null:e}for(var r=e,n=t;;){var i=r.return;if(i===null)break;var a=i.alternate;if(a===null){if(n=i.return,n!==null){r=n;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===r)return Op(i),e;if(a===n)return Op(i),t;a=a.sibling}throw Error(ce(188))}if(r.return!==n.return)r=i,n=a;else{for(var l=!1,s=i.child;s;){if(s===r){l=!0,r=i,n=a;break}if(s===n){l=!0,n=i,r=a;break}s=s.sibling}if(!l){for(s=a.child;s;){if(s===r){l=!0,r=a,n=i;break}if(s===n){l=!0,n=a,r=i;break}s=s.sibling}if(!l)throw Error(ce(189))}}if(r.alternate!==n)throw Error(ce(190))}if(r.tag!==3)throw Error(ce(188));return r.stateNode.current===r?e:t}function y_(e){return e=ax(e),e!==null?w_(e):null}function w_(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=w_(e);if(t!==null)return t;e=e.sibling}return null}var S_=fr.unstable_scheduleCallback,Np=fr.unstable_cancelCallback,lx=fr.unstable_shouldYield,cx=fr.unstable_requestPaint,pt=fr.unstable_now,ux=fr.unstable_getCurrentPriorityLevel,kd=fr.unstable_ImmediatePriority,x_=fr.unstable_UserBlockingPriority,fl=fr.unstable_NormalPriority,hx=fr.unstable_LowPriority,b_=fr.unstable_IdlePriority,ec=null,Ur=null;function dx(e){if(Ur&&typeof Ur.onCommitFiberRoot=="function")try{Ur.onCommitFiberRoot(ec,e,void 0,(e.current.flags&128)===128)}catch{}}var Br=Math.clz32?Math.clz32:mx,fx=Math.log,px=Math.LN2;function mx(e){return e>>>=0,e===0?32:31-(fx(e)/px|0)|0}var fa=64,pa=4194304;function Gi(e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function pl(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,i=e.suspendedLanes,a=e.pingedLanes,l=r&268435455;if(l!==0){var s=l&~i;s!==0?n=Gi(s):(a&=l,a!==0&&(n=Gi(a)))}else l=r&~i,l!==0?n=Gi(l):a!==0&&(n=Gi(a));if(n===0)return 0;if(t!==0&&t!==n&&!(t&i)&&(i=n&-n,a=t&-t,i>=a||i===16&&(a&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0<t;)r=31-Br(t),i=1<<r,n|=e[r],t&=~i;return n}function gx(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64: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:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function vx(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var l=31-Br(a),s=1<<l,o=i[l];o===-1?(!(s&r)||s&n)&&(i[l]=gx(s,t)):o<=t&&(e.expiredLanes|=s),a&=~s}}function Xu(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function C_(){var e=fa;return fa<<=1,!(fa&4194240)&&(fa=64),e}function Ac(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function qo(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Br(t),e[t]=r}function _x(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0<r;){var i=31-Br(r),a=1<<i;t[i]=0,n[i]=-1,e[i]=-1,r&=~a}}function Ld(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-Br(r),i=1<<n;i&t|e[n]&t&&(e[n]|=t),r&=~i}}var Qe=0;function E_(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var k_,Td,L_,T_,R_,Yu=!1,ma=[],Bn=null,On=null,Nn=null,So=new Map,xo=new Map,Dn=[],yx="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 submit".split(" ");function jp(e,t){switch(e){case"focusin":case"focusout":Bn=null;break;case"dragenter":case"dragleave":On=null;break;case"mouseover":case"mouseout":Nn=null;break;case"pointerover":case"pointerout":So.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":xo.delete(t.pointerId)}}function Ii(e,t,r,n,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:r,eventSystemFlags:n,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Yo(t),t!==null&&Td(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function wx(e,t,r,n,i){switch(t){case"focusin":return Bn=Ii(Bn,e,t,r,n,i),!0;case"dragenter":return On=Ii(On,e,t,r,n,i),!0;case"mouseover":return Nn=Ii(Nn,e,t,r,n,i),!0;case"pointerover":var a=i.pointerId;return So.set(a,Ii(So.get(a)||null,e,t,r,n,i)),!0;case"gotpointercapture":return a=i.pointerId,xo.set(a,Ii(xo.get(a)||null,e,t,r,n,i)),!0}return!1}function D_(e){var t=ls(e.target);if(t!==null){var r=Es(t);if(r!==null){if(t=r.tag,t===13){if(t=__(r),t!==null){e.blockedOn=t,R_(e.priority,function(){L_(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Va(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=Ju(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var n=new r.constructor(r.type,r);Vu=n,r.target.dispatchEvent(n),Vu=null}else return t=Yo(r),t!==null&&Td(t),e.blockedOn=r,!1;t.shift()}return!0}function Fp(e,t,r){Va(e)&&r.delete(t)}function Sx(){Yu=!1,Bn!==null&&Va(Bn)&&(Bn=null),On!==null&&Va(On)&&(On=null),Nn!==null&&Va(Nn)&&(Nn=null),So.forEach(Fp),xo.forEach(Fp)}function Bi(e,t){e.blockedOn===t&&(e.blockedOn=null,Yu||(Yu=!0,fr.unstable_scheduleCallback(fr.unstable_NormalPriority,Sx)))}function bo(e){function t(i){return Bi(i,e)}if(0<ma.length){Bi(ma[0],e);for(var r=1;r<ma.length;r++){var n=ma[r];n.blockedOn===e&&(n.blockedOn=null)}}for(Bn!==null&&Bi(Bn,e),On!==null&&Bi(On,e),Nn!==null&&Bi(Nn,e),So.forEach(t),xo.forEach(t),r=0;r<Dn.length;r++)n=Dn[r],n.blockedOn===e&&(n.blockedOn=null);for(;0<Dn.length&&(r=Dn[0],r.blockedOn===null);)D_(r),r.blockedOn===null&&Dn.shift()}var ti=yn.ReactCurrentBatchConfig,ml=!0;function xx(e,t,r,n){var i=Qe,a=ti.transition;ti.transition=null;try{Qe=1,Rd(e,t,r,n)}finally{Qe=i,ti.transition=a}}function bx(e,t,r,n){var i=Qe,a=ti.transition;ti.transition=null;try{Qe=4,Rd(e,t,r,n)}finally{Qe=i,ti.transition=a}}function Rd(e,t,r,n){if(ml){var i=Ju(e,t,r,n);if(i===null)zc(e,t,n,gl,r),jp(e,n);else if(wx(i,e,t,r,n))n.stopPropagation();else if(jp(e,n),t&4&&-1<yx.indexOf(e)){for(;i!==null;){var a=Yo(i);if(a!==null&&k_(a),a=Ju(e,t,r,n),a===null&&zc(e,t,n,gl,r),a===i)break;i=a}i!==null&&n.stopPropagation()}else zc(e,t,n,null,r)}}var gl=null;function Ju(e,t,r,n){if(gl=null,e=Ed(n),e=ls(e),e!==null)if(t=Es(e),t===null)e=null;else if(r=t.tag,r===13){if(e=__(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return gl=e,null}function M_(e){switch(e){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(ux()){case kd:return 1;case x_:return 4;case fl:case hx:return 16;case b_:return 536870912;default:return 16}default:return 16}}var An=null,Dd=null,Ka=null;function A_(){if(Ka)return Ka;var e,t=Dd,r=t.length,n,i="value"in An?An.value:An.textContent,a=i.length;for(e=0;e<r&&t[e]===i[e];e++);var l=r-e;for(n=1;n<=l&&t[r-n]===i[a-n];n++);return Ka=i.slice(e,1<n?1-n:void 0)}function Ga(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 ga(){return!0}function $p(){return!1}function mr(e){function t(r,n,i,a,l){this._reactName=r,this._targetInst=i,this.type=n,this.nativeEvent=a,this.target=l,this.currentTarget=null;for(var s in e)e.hasOwnProperty(s)&&(r=e[s],this[s]=r?r(a):a[s]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?ga:$p,this.isPropagationStopped=$p,this}return ut(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=ga)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=ga)},persist:function(){},isPersistent:ga}),t}var Si={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Md=mr(Si),Xo=ut({},Si,{view:0,detail:0}),Cx=mr(Xo),Pc,Ic,Oi,tc=ut({},Xo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ad,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!==Oi&&(Oi&&e.type==="mousemove"?(Pc=e.screenX-Oi.screenX,Ic=e.screenY-Oi.screenY):Ic=Pc=0,Oi=e),Pc)},movementY:function(e){return"movementY"in e?e.movementY:Ic}}),Hp=mr(tc),Ex=ut({},tc,{dataTransfer:0}),kx=mr(Ex),Lx=ut({},Xo,{relatedTarget:0}),Bc=mr(Lx),Tx=ut({},Si,{animationName:0,elapsedTime:0,pseudoElement:0}),Rx=mr(Tx),Dx=ut({},Si,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Mx=mr(Dx),Ax=ut({},Si,{data:0}),zp=mr(Ax),Px={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ix={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"},Bx={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ox(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Bx[e])?!!t[e]:!1}function Ad(){return Ox}var Nx=ut({},Xo,{key:function(e){if(e.key){var t=Px[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ga(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Ix[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ad,charCode:function(e){return e.type==="keypress"?Ga(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ga(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),jx=mr(Nx),Fx=ut({},tc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Up=mr(Fx),$x=ut({},Xo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ad}),Hx=mr($x),zx=ut({},Si,{propertyName:0,elapsedTime:0,pseudoElement:0}),Ux=mr(zx),Wx=ut({},tc,{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}),Vx=mr(Wx),Kx=[9,13,27,32],Pd=pn&&"CompositionEvent"in window,to=null;pn&&"documentMode"in document&&(to=document.documentMode);var Gx=pn&&"TextEvent"in window&&!to,P_=pn&&(!Pd||to&&8<to&&11>=to),Wp=" ",Vp=!1;function I_(e,t){switch(e){case"keyup":return Kx.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function B_(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ns=!1;function qx(e,t){switch(e){case"compositionend":return B_(t);case"keypress":return t.which!==32?null:(Vp=!0,Wp);case"textInput":return e=t.data,e===Wp&&Vp?null:e;default:return null}}function Xx(e,t){if(Ns)return e==="compositionend"||!Pd&&I_(e,t)?(e=A_(),Ka=Dd=An=null,Ns=!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 P_&&t.locale!=="ko"?null:t.data;default:return null}}var Yx={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 Kp(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Yx[e.type]:t==="textarea"}function O_(e,t,r,n){f_(n),t=vl(t,"onChange"),0<t.length&&(r=new Md("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var ro=null,Co=null;function Jx(e){G_(e,0)}function rc(e){var t=$s(e);if(o_(t))return e}function Qx(e,t){if(e==="change")return t}var N_=!1;if(pn){var Oc;if(pn){var Nc="oninput"in document;if(!Nc){var Gp=document.createElement("div");Gp.setAttribute("oninput","return;"),Nc=typeof Gp.oninput=="function"}Oc=Nc}else Oc=!1;N_=Oc&&(!document.documentMode||9<document.documentMode)}function qp(){ro&&(ro.detachEvent("onpropertychange",j_),Co=ro=null)}function j_(e){if(e.propertyName==="value"&&rc(Co)){var t=[];O_(t,Co,e,Ed(e)),v_(Jx,t)}}function Zx(e,t,r){e==="focusin"?(qp(),ro=t,Co=r,ro.attachEvent("onpropertychange",j_)):e==="focusout"&&qp()}function eb(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return rc(Co)}function tb(e,t){if(e==="click")return rc(t)}function rb(e,t){if(e==="input"||e==="change")return rc(t)}function nb(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Nr=typeof Object.is=="function"?Object.is:nb;function Eo(e,t){if(Nr(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var i=r[n];if(!Pu.call(t,i)||!Nr(e[i],t[i]))return!1}return!0}function Xp(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Yp(e,t){var r=Xp(e);e=0;for(var n;r;){if(r.nodeType===3){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Xp(r)}}function F_(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?F_(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function $_(){for(var e=window,t=ul();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=ul(e.document)}return t}function Id(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")}function sb(e){var t=$_(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&F_(r.ownerDocument.documentElement,r)){if(n!==null&&Id(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=r.textContent.length,a=Math.min(n.start,i);n=n.end===void 0?a:Math.min(n.end,i),!e.extend&&a>n&&(i=n,n=a,a=i),i=Yp(r,a);var l=Yp(r,n);i&&l&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==l.node||e.focusOffset!==l.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>n?(e.addRange(t),e.extend(l.node,l.offset)):(t.setEnd(l.node,l.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var ib=pn&&"documentMode"in document&&11>=document.documentMode,js=null,Qu=null,no=null,Zu=!1;function Jp(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Zu||js==null||js!==ul(n)||(n=js,"selectionStart"in n&&Id(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),no&&Eo(no,n)||(no=n,n=vl(Qu,"onSelect"),0<n.length&&(t=new Md("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=js)))}function va(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var Fs={animationend:va("Animation","AnimationEnd"),animationiteration:va("Animation","AnimationIteration"),animationstart:va("Animation","AnimationStart"),transitionend:va("Transition","TransitionEnd")},jc={},H_={};pn&&(H_=document.createElement("div").style,"AnimationEvent"in window||(delete Fs.animationend.animation,delete Fs.animationiteration.animation,delete Fs.animationstart.animation),"TransitionEvent"in window||delete Fs.transitionend.transition);function nc(e){if(jc[e])return jc[e];if(!Fs[e])return e;var t=Fs[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in H_)return jc[e]=t[r];return e}var z_=nc("animationend"),U_=nc("animationiteration"),W_=nc("animationstart"),V_=nc("transitionend"),K_=new Map,Qp="abort auxClick 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(" ");function Gn(e,t){K_.set(e,t),Cs(t,[e])}for(var Fc=0;Fc<Qp.length;Fc++){var $c=Qp[Fc],ob=$c.toLowerCase(),ab=$c[0].toUpperCase()+$c.slice(1);Gn(ob,"on"+ab)}Gn(z_,"onAnimationEnd");Gn(U_,"onAnimationIteration");Gn(W_,"onAnimationStart");Gn("dblclick","onDoubleClick");Gn("focusin","onFocus");Gn("focusout","onBlur");Gn(V_,"onTransitionEnd");ci("onMouseEnter",["mouseout","mouseover"]);ci("onMouseLeave",["mouseout","mouseover"]);ci("onPointerEnter",["pointerout","pointerover"]);ci("onPointerLeave",["pointerout","pointerover"]);Cs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Cs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Cs("onBeforeInput",["compositionend","keypress","textInput","paste"]);Cs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Cs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Cs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var qi="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),lb=new Set("cancel close invalid load scroll toggle".split(" ").concat(qi));function Zp(e,t,r){var n=e.type||"unknown-event";e.currentTarget=r,ox(n,t,void 0,e),e.currentTarget=null}function G_(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var n=e[r],i=n.event;n=n.listeners;e:{var a=void 0;if(t)for(var l=n.length-1;0<=l;l--){var s=n[l],o=s.instance,c=s.currentTarget;if(s=s.listener,o!==a&&i.isPropagationStopped())break e;Zp(i,s,c),a=o}else for(l=0;l<n.length;l++){if(s=n[l],o=s.instance,c=s.currentTarget,s=s.listener,o!==a&&i.isPropagationStopped())break e;Zp(i,s,c),a=o}}}if(dl)throw e=qu,dl=!1,qu=null,e}function rt(e,t){var r=t[sh];r===void 0&&(r=t[sh]=new Set);var n=e+"__bubble";r.has(n)||(q_(t,e,2,!1),r.add(n))}function Hc(e,t,r){var n=0;t&&(n|=4),q_(r,e,n,t)}var _a="_reactListening"+Math.random().toString(36).slice(2);function ko(e){if(!e[_a]){e[_a]=!0,t_.forEach(function(r){r!=="selectionchange"&&(lb.has(r)||Hc(r,!1,e),Hc(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[_a]||(t[_a]=!0,Hc("selectionchange",!1,t))}}function q_(e,t,r,n){switch(M_(t)){case 1:var i=xx;break;case 4:i=bx;break;default:i=Rd}r=i.bind(null,t,r,e),i=void 0,!Gu||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),n?i!==void 0?e.addEventListener(t,r,{capture:!0,passive:i}):e.addEventListener(t,r,!0):i!==void 0?e.addEventListener(t,r,{passive:i}):e.addEventListener(t,r,!1)}function zc(e,t,r,n,i){var a=n;if(!(t&1)&&!(t&2)&&n!==null)e:for(;;){if(n===null)return;var l=n.tag;if(l===3||l===4){var s=n.stateNode.containerInfo;if(s===i||s.nodeType===8&&s.parentNode===i)break;if(l===4)for(l=n.return;l!==null;){var o=l.tag;if((o===3||o===4)&&(o=l.stateNode.containerInfo,o===i||o.nodeType===8&&o.parentNode===i))return;l=l.return}for(;s!==null;){if(l=ls(s),l===null)return;if(o=l.tag,o===5||o===6){n=a=l;continue e}s=s.parentNode}}n=n.return}v_(function(){var c=a,p=Ed(r),u=[];e:{var f=K_.get(e);if(f!==void 0){var _=Md,y=e;switch(e){case"keypress":if(Ga(r)===0)break e;case"keydown":case"keyup":_=jx;break;case"focusin":y="focus",_=Bc;break;case"focusout":y="blur",_=Bc;break;case"beforeblur":case"afterblur":_=Bc;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":_=Hp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":_=kx;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":_=Hx;break;case z_:case U_:case W_:_=Rx;break;case V_:_=Ux;break;case"scroll":_=Cx;break;case"wheel":_=Vx;break;case"copy":case"cut":case"paste":_=Mx;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":_=Up}var v=(t&4)!==0,h=!v&&e==="scroll",m=v?f!==null?f+"Capture":null:f;v=[];for(var d=c,g;d!==null;){g=d;var w=g.stateNode;if(g.tag===5&&w!==null&&(g=w,m!==null&&(w=wo(d,m),w!=null&&v.push(Lo(d,w,g)))),h)break;d=d.return}0<v.length&&(f=new _(f,y,null,r,p),u.push({event:f,listeners:v}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",_=e==="mouseout"||e==="pointerout",f&&r!==Vu&&(y=r.relatedTarget||r.fromElement)&&(ls(y)||y[mn]))break e;if((_||f)&&(f=p.window===p?p:(f=p.ownerDocument)?f.defaultView||f.parentWindow:window,_?(y=r.relatedTarget||r.toElement,_=c,y=y?ls(y):null,y!==null&&(h=Es(y),y!==h||y.tag!==5&&y.tag!==6)&&(y=null)):(_=null,y=c),_!==y)){if(v=Hp,w="onMouseLeave",m="onMouseEnter",d="mouse",(e==="pointerout"||e==="pointerover")&&(v=Up,w="onPointerLeave",m="onPointerEnter",d="pointer"),h=_==null?f:$s(_),g=y==null?f:$s(y),f=new v(w,d+"leave",_,r,p),f.target=h,f.relatedTarget=g,w=null,ls(p)===c&&(v=new v(m,d+"enter",y,r,p),v.target=g,v.relatedTarget=h,w=v),h=w,_&&y)t:{for(v=_,m=y,d=0,g=v;g;g=As(g))d++;for(g=0,w=m;w;w=As(w))g++;for(;0<d-g;)v=As(v),d--;for(;0<g-d;)m=As(m),g--;for(;d--;){if(v===m||m!==null&&v===m.alternate)break t;v=As(v),m=As(m)}v=null}else v=null;_!==null&&em(u,f,_,v,!1),y!==null&&h!==null&&em(u,h,y,v,!0)}}e:{if(f=c?$s(c):window,_=f.nodeName&&f.nodeName.toLowerCase(),_==="select"||_==="input"&&f.type==="file")var b=Qx;else if(Kp(f))if(N_)b=rb;else{b=eb;var x=Zx}else(_=f.nodeName)&&_.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(b=tb);if(b&&(b=b(e,c))){O_(u,b,r,p);break e}x&&x(e,f,c),e==="focusout"&&(x=f._wrapperState)&&x.controlled&&f.type==="number"&&$u(f,"number",f.value)}switch(x=c?$s(c):window,e){case"focusin":(Kp(x)||x.contentEditable==="true")&&(js=x,Qu=c,no=null);break;case"focusout":no=Qu=js=null;break;case"mousedown":Zu=!0;break;case"contextmenu":case"mouseup":case"dragend":Zu=!1,Jp(u,r,p);break;case"selectionchange":if(ib)break;case"keydown":case"keyup":Jp(u,r,p)}var C;if(Pd)e:{switch(e){case"compositionstart":var S="onCompositionStart";break e;case"compositionend":S="onCompositionEnd";break e;case"compositionupdate":S="onCompositionUpdate";break e}S=void 0}else Ns?I_(e,r)&&(S="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(S="onCompositionStart");S&&(P_&&r.locale!=="ko"&&(Ns||S!=="onCompositionStart"?S==="onCompositionEnd"&&Ns&&(C=A_()):(An=p,Dd="value"in An?An.value:An.textContent,Ns=!0)),x=vl(c,S),0<x.length&&(S=new zp(S,e,null,r,p),u.push({event:S,listeners:x}),C?S.data=C:(C=B_(r),C!==null&&(S.data=C)))),(C=Gx?qx(e,r):Xx(e,r))&&(c=vl(c,"onBeforeInput"),0<c.length&&(p=new zp("onBeforeInput","beforeinput",null,r,p),u.push({event:p,listeners:c}),p.data=C))}G_(u,t)})}function Lo(e,t,r){return{instance:e,listener:t,currentTarget:r}}function vl(e,t){for(var r=t+"Capture",n=[];e!==null;){var i=e,a=i.stateNode;i.tag===5&&a!==null&&(i=a,a=wo(e,r),a!=null&&n.unshift(Lo(e,a,i)),a=wo(e,t),a!=null&&n.push(Lo(e,a,i))),e=e.return}return n}function As(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function em(e,t,r,n,i){for(var a=t._reactName,l=[];r!==null&&r!==n;){var s=r,o=s.alternate,c=s.stateNode;if(o!==null&&o===n)break;s.tag===5&&c!==null&&(s=c,i?(o=wo(r,a),o!=null&&l.unshift(Lo(r,o,s))):i||(o=wo(r,a),o!=null&&l.push(Lo(r,o,s)))),r=r.return}l.length!==0&&e.push({event:t,listeners:l})}var cb=/\r\n?/g,ub=/\u0000|\uFFFD/g;function tm(e){return(typeof e=="string"?e:""+e).replace(cb,`
38
+ `).replace(ub,"")}function ya(e,t,r){if(t=tm(t),tm(e)!==t&&r)throw Error(ce(425))}function _l(){}var eh=null,th=null;function rh(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var nh=typeof setTimeout=="function"?setTimeout:void 0,hb=typeof clearTimeout=="function"?clearTimeout:void 0,rm=typeof Promise=="function"?Promise:void 0,db=typeof queueMicrotask=="function"?queueMicrotask:typeof rm<"u"?function(e){return rm.resolve(null).then(e).catch(fb)}:nh;function fb(e){setTimeout(function(){throw e})}function Uc(e,t){var r=t,n=0;do{var i=r.nextSibling;if(e.removeChild(r),i&&i.nodeType===8)if(r=i.data,r==="/$"){if(n===0){e.removeChild(i),bo(t);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=i}while(r);bo(t)}function jn(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==="$?")break;if(t==="/$")return null}}return e}function nm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var xi=Math.random().toString(36).slice(2),Hr="__reactFiber$"+xi,To="__reactProps$"+xi,mn="__reactContainer$"+xi,sh="__reactEvents$"+xi,pb="__reactListeners$"+xi,mb="__reactHandles$"+xi;function ls(e){var t=e[Hr];if(t)return t;for(var r=e.parentNode;r;){if(t=r[mn]||r[Hr]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=nm(e);e!==null;){if(r=e[Hr])return r;e=nm(e)}return t}e=r,r=e.parentNode}return null}function Yo(e){return e=e[Hr]||e[mn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function $s(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(ce(33))}function sc(e){return e[To]||null}var ih=[],Hs=-1;function qn(e){return{current:e}}function nt(e){0>Hs||(e.current=ih[Hs],ih[Hs]=null,Hs--)}function Ze(e,t){Hs++,ih[Hs]=e.current,e.current=t}var Wn={},Xt=qn(Wn),ir=qn(!1),ys=Wn;function ui(e,t){var r=e.type.contextTypes;if(!r)return Wn;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in r)i[a]=t[a];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function or(e){return e=e.childContextTypes,e!=null}function yl(){nt(ir),nt(Xt)}function sm(e,t,r){if(Xt.current!==Wn)throw Error(ce(168));Ze(Xt,t),Ze(ir,r)}function X_(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in t))throw Error(ce(108,ZS(e)||"Unknown",i));return ut({},r,n)}function wl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Wn,ys=Xt.current,Ze(Xt,e),Ze(ir,ir.current),!0}function im(e,t,r){var n=e.stateNode;if(!n)throw Error(ce(169));r?(e=X_(e,t,ys),n.__reactInternalMemoizedMergedChildContext=e,nt(ir),nt(Xt),Ze(Xt,e)):nt(ir),Ze(ir,r)}var ln=null,ic=!1,Wc=!1;function Y_(e){ln===null?ln=[e]:ln.push(e)}function gb(e){ic=!0,Y_(e)}function Xn(){if(!Wc&&ln!==null){Wc=!0;var e=0,t=Qe;try{var r=ln;for(Qe=1;e<r.length;e++){var n=r[e];do n=n(!0);while(n!==null)}ln=null,ic=!1}catch(i){throw ln!==null&&(ln=ln.slice(e+1)),S_(kd,Xn),i}finally{Qe=t,Wc=!1}}return null}var zs=[],Us=0,Sl=null,xl=0,_r=[],yr=0,ws=null,cn=1,un="";function is(e,t){zs[Us++]=xl,zs[Us++]=Sl,Sl=e,xl=t}function J_(e,t,r){_r[yr++]=cn,_r[yr++]=un,_r[yr++]=ws,ws=e;var n=cn;e=un;var i=32-Br(n)-1;n&=~(1<<i),r+=1;var a=32-Br(t)+i;if(30<a){var l=i-i%5;a=(n&(1<<l)-1).toString(32),n>>=l,i-=l,cn=1<<32-Br(t)+i|r<<i|n,un=a+e}else cn=1<<a|r<<i|n,un=e}function Bd(e){e.return!==null&&(is(e,1),J_(e,1,0))}function Od(e){for(;e===Sl;)Sl=zs[--Us],zs[Us]=null,xl=zs[--Us],zs[Us]=null;for(;e===ws;)ws=_r[--yr],_r[yr]=null,un=_r[--yr],_r[yr]=null,cn=_r[--yr],_r[yr]=null}var dr=null,hr=null,it=!1,Pr=null;function Q_(e,t){var r=wr(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function om(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,dr=e,hr=jn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,dr=e,hr=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=ws!==null?{id:cn,overflow:un}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=wr(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,dr=e,hr=null,!0):!1;default:return!1}}function oh(e){return(e.mode&1)!==0&&(e.flags&128)===0}function ah(e){if(it){var t=hr;if(t){var r=t;if(!om(e,t)){if(oh(e))throw Error(ce(418));t=jn(r.nextSibling);var n=dr;t&&om(e,t)?Q_(n,r):(e.flags=e.flags&-4097|2,it=!1,dr=e)}}else{if(oh(e))throw Error(ce(418));e.flags=e.flags&-4097|2,it=!1,dr=e}}}function am(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;dr=e}function wa(e){if(e!==dr)return!1;if(!it)return am(e),it=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!rh(e.type,e.memoizedProps)),t&&(t=hr)){if(oh(e))throw Z_(),Error(ce(418));for(;t;)Q_(e,t),t=jn(t.nextSibling)}if(am(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(ce(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){hr=jn(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}hr=null}}else hr=dr?jn(e.stateNode.nextSibling):null;return!0}function Z_(){for(var e=hr;e;)e=jn(e.nextSibling)}function hi(){hr=dr=null,it=!1}function Nd(e){Pr===null?Pr=[e]:Pr.push(e)}var vb=yn.ReactCurrentBatchConfig;function Ni(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(ce(309));var n=r.stateNode}if(!n)throw Error(ce(147,e));var i=n,a=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===a?t.ref:(t=function(l){var s=i.refs;l===null?delete s[a]:s[a]=l},t._stringRef=a,t)}if(typeof e!="string")throw Error(ce(284));if(!r._owner)throw Error(ce(290,e))}return e}function Sa(e,t){throw e=Object.prototype.toString.call(t),Error(ce(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function lm(e){var t=e._init;return t(e._payload)}function e0(e){function t(m,d){if(e){var g=m.deletions;g===null?(m.deletions=[d],m.flags|=16):g.push(d)}}function r(m,d){if(!e)return null;for(;d!==null;)t(m,d),d=d.sibling;return null}function n(m,d){for(m=new Map;d!==null;)d.key!==null?m.set(d.key,d):m.set(d.index,d),d=d.sibling;return m}function i(m,d){return m=zn(m,d),m.index=0,m.sibling=null,m}function a(m,d,g){return m.index=g,e?(g=m.alternate,g!==null?(g=g.index,g<d?(m.flags|=2,d):g):(m.flags|=2,d)):(m.flags|=1048576,d)}function l(m){return e&&m.alternate===null&&(m.flags|=2),m}function s(m,d,g,w){return d===null||d.tag!==6?(d=Jc(g,m.mode,w),d.return=m,d):(d=i(d,g),d.return=m,d)}function o(m,d,g,w){var b=g.type;return b===Os?p(m,d,g.props.children,w,g.key):d!==null&&(d.elementType===b||typeof b=="object"&&b!==null&&b.$$typeof===Ln&&lm(b)===d.type)?(w=i(d,g.props),w.ref=Ni(m,d,g),w.return=m,w):(w=el(g.type,g.key,g.props,null,m.mode,w),w.ref=Ni(m,d,g),w.return=m,w)}function c(m,d,g,w){return d===null||d.tag!==4||d.stateNode.containerInfo!==g.containerInfo||d.stateNode.implementation!==g.implementation?(d=Qc(g,m.mode,w),d.return=m,d):(d=i(d,g.children||[]),d.return=m,d)}function p(m,d,g,w,b){return d===null||d.tag!==7?(d=gs(g,m.mode,w,b),d.return=m,d):(d=i(d,g),d.return=m,d)}function u(m,d,g){if(typeof d=="string"&&d!==""||typeof d=="number")return d=Jc(""+d,m.mode,g),d.return=m,d;if(typeof d=="object"&&d!==null){switch(d.$$typeof){case ua:return g=el(d.type,d.key,d.props,null,m.mode,g),g.ref=Ni(m,null,d),g.return=m,g;case Bs:return d=Qc(d,m.mode,g),d.return=m,d;case Ln:var w=d._init;return u(m,w(d._payload),g)}if(Ki(d)||Ai(d))return d=gs(d,m.mode,g,null),d.return=m,d;Sa(m,d)}return null}function f(m,d,g,w){var b=d!==null?d.key:null;if(typeof g=="string"&&g!==""||typeof g=="number")return b!==null?null:s(m,d,""+g,w);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case ua:return g.key===b?o(m,d,g,w):null;case Bs:return g.key===b?c(m,d,g,w):null;case Ln:return b=g._init,f(m,d,b(g._payload),w)}if(Ki(g)||Ai(g))return b!==null?null:p(m,d,g,w,null);Sa(m,g)}return null}function _(m,d,g,w,b){if(typeof w=="string"&&w!==""||typeof w=="number")return m=m.get(g)||null,s(d,m,""+w,b);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case ua:return m=m.get(w.key===null?g:w.key)||null,o(d,m,w,b);case Bs:return m=m.get(w.key===null?g:w.key)||null,c(d,m,w,b);case Ln:var x=w._init;return _(m,d,g,x(w._payload),b)}if(Ki(w)||Ai(w))return m=m.get(g)||null,p(d,m,w,b,null);Sa(d,w)}return null}function y(m,d,g,w){for(var b=null,x=null,C=d,S=d=0,E=null;C!==null&&S<g.length;S++){C.index>S?(E=C,C=null):E=C.sibling;var L=f(m,C,g[S],w);if(L===null){C===null&&(C=E);break}e&&C&&L.alternate===null&&t(m,C),d=a(L,d,S),x===null?b=L:x.sibling=L,x=L,C=E}if(S===g.length)return r(m,C),it&&is(m,S),b;if(C===null){for(;S<g.length;S++)C=u(m,g[S],w),C!==null&&(d=a(C,d,S),x===null?b=C:x.sibling=C,x=C);return it&&is(m,S),b}for(C=n(m,C);S<g.length;S++)E=_(C,m,S,g[S],w),E!==null&&(e&&E.alternate!==null&&C.delete(E.key===null?S:E.key),d=a(E,d,S),x===null?b=E:x.sibling=E,x=E);return e&&C.forEach(function(A){return t(m,A)}),it&&is(m,S),b}function v(m,d,g,w){var b=Ai(g);if(typeof b!="function")throw Error(ce(150));if(g=b.call(g),g==null)throw Error(ce(151));for(var x=b=null,C=d,S=d=0,E=null,L=g.next();C!==null&&!L.done;S++,L=g.next()){C.index>S?(E=C,C=null):E=C.sibling;var A=f(m,C,L.value,w);if(A===null){C===null&&(C=E);break}e&&C&&A.alternate===null&&t(m,C),d=a(A,d,S),x===null?b=A:x.sibling=A,x=A,C=E}if(L.done)return r(m,C),it&&is(m,S),b;if(C===null){for(;!L.done;S++,L=g.next())L=u(m,L.value,w),L!==null&&(d=a(L,d,S),x===null?b=L:x.sibling=L,x=L);return it&&is(m,S),b}for(C=n(m,C);!L.done;S++,L=g.next())L=_(C,m,S,L.value,w),L!==null&&(e&&L.alternate!==null&&C.delete(L.key===null?S:L.key),d=a(L,d,S),x===null?b=L:x.sibling=L,x=L);return e&&C.forEach(function(M){return t(m,M)}),it&&is(m,S),b}function h(m,d,g,w){if(typeof g=="object"&&g!==null&&g.type===Os&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case ua:e:{for(var b=g.key,x=d;x!==null;){if(x.key===b){if(b=g.type,b===Os){if(x.tag===7){r(m,x.sibling),d=i(x,g.props.children),d.return=m,m=d;break e}}else if(x.elementType===b||typeof b=="object"&&b!==null&&b.$$typeof===Ln&&lm(b)===x.type){r(m,x.sibling),d=i(x,g.props),d.ref=Ni(m,x,g),d.return=m,m=d;break e}r(m,x);break}else t(m,x);x=x.sibling}g.type===Os?(d=gs(g.props.children,m.mode,w,g.key),d.return=m,m=d):(w=el(g.type,g.key,g.props,null,m.mode,w),w.ref=Ni(m,d,g),w.return=m,m=w)}return l(m);case Bs:e:{for(x=g.key;d!==null;){if(d.key===x)if(d.tag===4&&d.stateNode.containerInfo===g.containerInfo&&d.stateNode.implementation===g.implementation){r(m,d.sibling),d=i(d,g.children||[]),d.return=m,m=d;break e}else{r(m,d);break}else t(m,d);d=d.sibling}d=Qc(g,m.mode,w),d.return=m,m=d}return l(m);case Ln:return x=g._init,h(m,d,x(g._payload),w)}if(Ki(g))return y(m,d,g,w);if(Ai(g))return v(m,d,g,w);Sa(m,g)}return typeof g=="string"&&g!==""||typeof g=="number"?(g=""+g,d!==null&&d.tag===6?(r(m,d.sibling),d=i(d,g),d.return=m,m=d):(r(m,d),d=Jc(g,m.mode,w),d.return=m,m=d),l(m)):r(m,d)}return h}var di=e0(!0),t0=e0(!1),bl=qn(null),Cl=null,Ws=null,jd=null;function Fd(){jd=Ws=Cl=null}function $d(e){var t=bl.current;nt(bl),e._currentValue=t}function lh(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function ri(e,t){Cl=e,jd=Ws=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(sr=!0),e.firstContext=null)}function Cr(e){var t=e._currentValue;if(jd!==e)if(e={context:e,memoizedValue:t,next:null},Ws===null){if(Cl===null)throw Error(ce(308));Ws=e,Cl.dependencies={lanes:0,firstContext:e}}else Ws=Ws.next=e;return t}var cs=null;function Hd(e){cs===null?cs=[e]:cs.push(e)}function r0(e,t,r,n){var i=t.interleaved;return i===null?(r.next=r,Hd(t)):(r.next=i.next,i.next=r),t.interleaved=r,gn(e,n)}function gn(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var Tn=!1;function zd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function n0(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function dn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Fn(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,qe&2){var i=n.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),n.pending=t,gn(e,r)}return i=n.interleaved,i===null?(t.next=t,Hd(n)):(t.next=i.next,i.next=t),n.interleaved=t,gn(e,r)}function qa(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Ld(e,r)}}function cm(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var i=null,a=null;if(r=r.firstBaseUpdate,r!==null){do{var l={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};a===null?i=a=l:a=a.next=l,r=r.next}while(r!==null);a===null?i=a=t:a=a.next=t}else i=a=t;r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function El(e,t,r,n){var i=e.updateQueue;Tn=!1;var a=i.firstBaseUpdate,l=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var o=s,c=o.next;o.next=null,l===null?a=c:l.next=c,l=o;var p=e.alternate;p!==null&&(p=p.updateQueue,s=p.lastBaseUpdate,s!==l&&(s===null?p.firstBaseUpdate=c:s.next=c,p.lastBaseUpdate=o))}if(a!==null){var u=i.baseState;l=0,p=c=o=null,s=a;do{var f=s.lane,_=s.eventTime;if((n&f)===f){p!==null&&(p=p.next={eventTime:_,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var y=e,v=s;switch(f=t,_=r,v.tag){case 1:if(y=v.payload,typeof y=="function"){u=y.call(_,u,f);break e}u=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=v.payload,f=typeof y=="function"?y.call(_,u,f):y,f==null)break e;u=ut({},u,f);break e;case 2:Tn=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[s]:f.push(s))}else _={eventTime:_,lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},p===null?(c=p=_,o=u):p=p.next=_,l|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;f=s,s=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(!0);if(p===null&&(o=u),i.baseState=o,i.firstBaseUpdate=c,i.lastBaseUpdate=p,t=i.shared.interleaved,t!==null){i=t;do l|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);xs|=l,e.lanes=l,e.memoizedState=u}}function um(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var n=e[t],i=n.callback;if(i!==null){if(n.callback=null,n=r,typeof i!="function")throw Error(ce(191,i));i.call(n)}}}var Jo={},Wr=qn(Jo),Ro=qn(Jo),Do=qn(Jo);function us(e){if(e===Jo)throw Error(ce(174));return e}function Ud(e,t){switch(Ze(Do,t),Ze(Ro,e),Ze(Wr,Jo),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:zu(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=zu(t,e)}nt(Wr),Ze(Wr,t)}function fi(){nt(Wr),nt(Ro),nt(Do)}function s0(e){us(Do.current);var t=us(Wr.current),r=zu(t,e.type);t!==r&&(Ze(Ro,e),Ze(Wr,r))}function Wd(e){Ro.current===e&&(nt(Wr),nt(Ro))}var at=qn(0);function kl(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)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 Vc=[];function Vd(){for(var e=0;e<Vc.length;e++)Vc[e]._workInProgressVersionPrimary=null;Vc.length=0}var Xa=yn.ReactCurrentDispatcher,Kc=yn.ReactCurrentBatchConfig,Ss=0,ct=null,St=null,Lt=null,Ll=!1,so=!1,Mo=0,_b=0;function Ut(){throw Error(ce(321))}function Kd(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!Nr(e[r],t[r]))return!1;return!0}function Gd(e,t,r,n,i,a){if(Ss=a,ct=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Xa.current=e===null||e.memoizedState===null?xb:bb,e=r(n,i),so){a=0;do{if(so=!1,Mo=0,25<=a)throw Error(ce(301));a+=1,Lt=St=null,t.updateQueue=null,Xa.current=Cb,e=r(n,i)}while(so)}if(Xa.current=Tl,t=St!==null&&St.next!==null,Ss=0,Lt=St=ct=null,Ll=!1,t)throw Error(ce(300));return e}function qd(){var e=Mo!==0;return Mo=0,e}function $r(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Lt===null?ct.memoizedState=Lt=e:Lt=Lt.next=e,Lt}function Er(){if(St===null){var e=ct.alternate;e=e!==null?e.memoizedState:null}else e=St.next;var t=Lt===null?ct.memoizedState:Lt.next;if(t!==null)Lt=t,St=e;else{if(e===null)throw Error(ce(310));St=e,e={memoizedState:St.memoizedState,baseState:St.baseState,baseQueue:St.baseQueue,queue:St.queue,next:null},Lt===null?ct.memoizedState=Lt=e:Lt=Lt.next=e}return Lt}function Ao(e,t){return typeof t=="function"?t(e):t}function Gc(e){var t=Er(),r=t.queue;if(r===null)throw Error(ce(311));r.lastRenderedReducer=e;var n=St,i=n.baseQueue,a=r.pending;if(a!==null){if(i!==null){var l=i.next;i.next=a.next,a.next=l}n.baseQueue=i=a,r.pending=null}if(i!==null){a=i.next,n=n.baseState;var s=l=null,o=null,c=a;do{var p=c.lane;if((Ss&p)===p)o!==null&&(o=o.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),n=c.hasEagerState?c.eagerState:e(n,c.action);else{var u={lane:p,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};o===null?(s=o=u,l=n):o=o.next=u,ct.lanes|=p,xs|=p}c=c.next}while(c!==null&&c!==a);o===null?l=n:o.next=s,Nr(n,t.memoizedState)||(sr=!0),t.memoizedState=n,t.baseState=l,t.baseQueue=o,r.lastRenderedState=n}if(e=r.interleaved,e!==null){i=e;do a=i.lane,ct.lanes|=a,xs|=a,i=i.next;while(i!==e)}else i===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function qc(e){var t=Er(),r=t.queue;if(r===null)throw Error(ce(311));r.lastRenderedReducer=e;var n=r.dispatch,i=r.pending,a=t.memoizedState;if(i!==null){r.pending=null;var l=i=i.next;do a=e(a,l.action),l=l.next;while(l!==i);Nr(a,t.memoizedState)||(sr=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),r.lastRenderedState=a}return[a,n]}function i0(){}function o0(e,t){var r=ct,n=Er(),i=t(),a=!Nr(n.memoizedState,i);if(a&&(n.memoizedState=i,sr=!0),n=n.queue,Xd(c0.bind(null,r,n,e),[e]),n.getSnapshot!==t||a||Lt!==null&&Lt.memoizedState.tag&1){if(r.flags|=2048,Po(9,l0.bind(null,r,n,i,t),void 0,null),Pt===null)throw Error(ce(349));Ss&30||a0(r,t,i)}return i}function a0(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=ct.updateQueue,t===null?(t={lastEffect:null,stores:null},ct.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function l0(e,t,r,n){t.value=r,t.getSnapshot=n,u0(t)&&h0(e)}function c0(e,t,r){return r(function(){u0(t)&&h0(e)})}function u0(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Nr(e,r)}catch{return!0}}function h0(e){var t=gn(e,1);t!==null&&Or(t,e,1,-1)}function hm(e){var t=$r();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ao,lastRenderedState:e},t.queue=e,e=e.dispatch=Sb.bind(null,ct,e),[t.memoizedState,e]}function Po(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},t=ct.updateQueue,t===null?(t={lastEffect:null,stores:null},ct.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e)),e}function d0(){return Er().memoizedState}function Ya(e,t,r,n){var i=$r();ct.flags|=e,i.memoizedState=Po(1|t,r,void 0,n===void 0?null:n)}function oc(e,t,r,n){var i=Er();n=n===void 0?null:n;var a=void 0;if(St!==null){var l=St.memoizedState;if(a=l.destroy,n!==null&&Kd(n,l.deps)){i.memoizedState=Po(t,r,a,n);return}}ct.flags|=e,i.memoizedState=Po(1|t,r,a,n)}function dm(e,t){return Ya(8390656,8,e,t)}function Xd(e,t){return oc(2048,8,e,t)}function f0(e,t){return oc(4,2,e,t)}function p0(e,t){return oc(4,4,e,t)}function m0(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function g0(e,t,r){return r=r!=null?r.concat([e]):null,oc(4,4,m0.bind(null,t,e),r)}function Yd(){}function v0(e,t){var r=Er();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&Kd(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function _0(e,t){var r=Er();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&Kd(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function y0(e,t,r){return Ss&21?(Nr(r,t)||(r=C_(),ct.lanes|=r,xs|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,sr=!0),e.memoizedState=r)}function yb(e,t){var r=Qe;Qe=r!==0&&4>r?r:4,e(!0);var n=Kc.transition;Kc.transition={};try{e(!1),t()}finally{Qe=r,Kc.transition=n}}function w0(){return Er().memoizedState}function wb(e,t,r){var n=Hn(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},S0(e))x0(t,r);else if(r=r0(e,t,r,n),r!==null){var i=er();Or(r,e,n,i),b0(r,t,n)}}function Sb(e,t,r){var n=Hn(e),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(S0(e))x0(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var l=t.lastRenderedState,s=a(l,r);if(i.hasEagerState=!0,i.eagerState=s,Nr(s,l)){var o=t.interleaved;o===null?(i.next=i,Hd(t)):(i.next=o.next,o.next=i),t.interleaved=i;return}}catch{}finally{}r=r0(e,t,i,n),r!==null&&(i=er(),Or(r,e,n,i),b0(r,t,n))}}function S0(e){var t=e.alternate;return e===ct||t!==null&&t===ct}function x0(e,t){so=Ll=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function b0(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Ld(e,r)}}var Tl={readContext:Cr,useCallback:Ut,useContext:Ut,useEffect:Ut,useImperativeHandle:Ut,useInsertionEffect:Ut,useLayoutEffect:Ut,useMemo:Ut,useReducer:Ut,useRef:Ut,useState:Ut,useDebugValue:Ut,useDeferredValue:Ut,useTransition:Ut,useMutableSource:Ut,useSyncExternalStore:Ut,useId:Ut,unstable_isNewReconciler:!1},xb={readContext:Cr,useCallback:function(e,t){return $r().memoizedState=[e,t===void 0?null:t],e},useContext:Cr,useEffect:dm,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Ya(4194308,4,m0.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Ya(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ya(4,2,e,t)},useMemo:function(e,t){var r=$r();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=$r();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=wb.bind(null,ct,e),[n.memoizedState,e]},useRef:function(e){var t=$r();return e={current:e},t.memoizedState=e},useState:hm,useDebugValue:Yd,useDeferredValue:function(e){return $r().memoizedState=e},useTransition:function(){var e=hm(!1),t=e[0];return e=yb.bind(null,e[1]),$r().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=ct,i=$r();if(it){if(r===void 0)throw Error(ce(407));r=r()}else{if(r=t(),Pt===null)throw Error(ce(349));Ss&30||a0(n,t,r)}i.memoizedState=r;var a={value:r,getSnapshot:t};return i.queue=a,dm(c0.bind(null,n,a,e),[e]),n.flags|=2048,Po(9,l0.bind(null,n,a,r,t),void 0,null),r},useId:function(){var e=$r(),t=Pt.identifierPrefix;if(it){var r=un,n=cn;r=(n&~(1<<32-Br(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=Mo++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=_b++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},bb={readContext:Cr,useCallback:v0,useContext:Cr,useEffect:Xd,useImperativeHandle:g0,useInsertionEffect:f0,useLayoutEffect:p0,useMemo:_0,useReducer:Gc,useRef:d0,useState:function(){return Gc(Ao)},useDebugValue:Yd,useDeferredValue:function(e){var t=Er();return y0(t,St.memoizedState,e)},useTransition:function(){var e=Gc(Ao)[0],t=Er().memoizedState;return[e,t]},useMutableSource:i0,useSyncExternalStore:o0,useId:w0,unstable_isNewReconciler:!1},Cb={readContext:Cr,useCallback:v0,useContext:Cr,useEffect:Xd,useImperativeHandle:g0,useInsertionEffect:f0,useLayoutEffect:p0,useMemo:_0,useReducer:qc,useRef:d0,useState:function(){return qc(Ao)},useDebugValue:Yd,useDeferredValue:function(e){var t=Er();return St===null?t.memoizedState=e:y0(t,St.memoizedState,e)},useTransition:function(){var e=qc(Ao)[0],t=Er().memoizedState;return[e,t]},useMutableSource:i0,useSyncExternalStore:o0,useId:w0,unstable_isNewReconciler:!1};function Dr(e,t){if(e&&e.defaultProps){t=ut({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function ch(e,t,r,n){t=e.memoizedState,r=r(n,t),r=r==null?t:ut({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var ac={isMounted:function(e){return(e=e._reactInternals)?Es(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=er(),i=Hn(e),a=dn(n,i);a.payload=t,r!=null&&(a.callback=r),t=Fn(e,a,i),t!==null&&(Or(t,e,i,n),qa(t,e,i))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=er(),i=Hn(e),a=dn(n,i);a.tag=1,a.payload=t,r!=null&&(a.callback=r),t=Fn(e,a,i),t!==null&&(Or(t,e,i,n),qa(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=er(),n=Hn(e),i=dn(r,n);i.tag=2,t!=null&&(i.callback=t),t=Fn(e,i,n),t!==null&&(Or(t,e,n,r),qa(t,e,n))}};function fm(e,t,r,n,i,a,l){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,a,l):t.prototype&&t.prototype.isPureReactComponent?!Eo(r,n)||!Eo(i,a):!0}function C0(e,t,r){var n=!1,i=Wn,a=t.contextType;return typeof a=="object"&&a!==null?a=Cr(a):(i=or(t)?ys:Xt.current,n=t.contextTypes,a=(n=n!=null)?ui(e,i):Wn),t=new t(r,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=ac,e.stateNode=t,t._reactInternals=e,n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function pm(e,t,r,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,n),t.state!==e&&ac.enqueueReplaceState(t,t.state,null)}function uh(e,t,r,n){var i=e.stateNode;i.props=r,i.state=e.memoizedState,i.refs={},zd(e);var a=t.contextType;typeof a=="object"&&a!==null?i.context=Cr(a):(a=or(t)?ys:Xt.current,i.context=ui(e,a)),i.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a=="function"&&(ch(e,t,a,r),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&ac.enqueueReplaceState(i,i.state,null),El(e,r,i,n),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function pi(e,t){try{var r="",n=t;do r+=QS(n),n=n.return;while(n);var i=r}catch(a){i=`
39
39
  Error generating stack: `+a.message+`
40
- `+a.stack}return{value:e,source:t,stack:i,digest:null}}function Xc(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function hh(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var Eb=typeof WeakMap=="function"?WeakMap:Map;function E0(e,t,r){r=dn(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){Dl||(Dl=!0,Sh=n),hh(e,t)},r}function k0(e,t,r){r=dn(-1,r),r.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var i=t.value;r.payload=function(){return n(i)},r.callback=function(){hh(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(r.callback=function(){hh(e,t),typeof n!="function"&&($n===null?$n=new Set([this]):$n.add(this));var l=t.stack;this.componentDidCatch(t.value,{componentStack:l!==null?l:""})}),r}function mm(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new Eb;var i=new Set;n.set(t,i)}else i=n.get(t),i===void 0&&(i=new Set,n.set(t,i));i.has(r)||(i.add(r),e=Fb.bind(null,e,t,r),t.then(e,e))}function gm(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function vm(e,t,r,n,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=dn(-1,1),t.tag=2,Fn(r,t,1))),r.lanes|=1),e)}var kb=yn.ReactCurrentOwner,sr=!1;function Jt(e,t,r,n){t.child=e===null?t0(t,null,r,n):di(t,e.child,r,n)}function _m(e,t,r,n,i){r=r.render;var a=t.ref;return ri(t,i),n=Gd(e,t,r,n,a,i),r=qd(),e!==null&&!sr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,vn(e,t,i)):(it&&r&&Bd(t),t.flags|=1,Jt(e,t,n,i),t.child)}function ym(e,t,r,n,i){if(e===null){var a=r.type;return typeof a=="function"&&!sf(a)&&a.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=a,L0(e,t,a,n,i)):(e=el(r.type,null,n,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!(e.lanes&i)){var l=a.memoizedProps;if(r=r.compare,r=r!==null?r:Eo,r(l,n)&&e.ref===t.ref)return vn(e,t,i)}return t.flags|=1,e=zn(a,n),e.ref=t.ref,e.return=t,t.child=e}function L0(e,t,r,n,i){if(e!==null){var a=e.memoizedProps;if(Eo(a,n)&&e.ref===t.ref)if(sr=!1,t.pendingProps=n=a,(e.lanes&i)!==0)e.flags&131072&&(sr=!0);else return t.lanes=e.lanes,vn(e,t,i)}return dh(e,t,r,n,i)}function T0(e,t,r){var n=t.pendingProps,i=n.children,a=e!==null?e.memoizedState:null;if(n.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ze(Ks,cr),cr|=r;else{if(!(r&1073741824))return e=a!==null?a.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ze(Ks,cr),cr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=a!==null?a.baseLanes:r,Ze(Ks,cr),cr|=n}else a!==null?(n=a.baseLanes|r,t.memoizedState=null):n=r,Ze(Ks,cr),cr|=n;return Jt(e,t,i,r),t.child}function R0(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function dh(e,t,r,n,i){var a=or(r)?ys:Xt.current;return a=ui(t,a),ri(t,i),r=Gd(e,t,r,n,a,i),n=qd(),e!==null&&!sr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,vn(e,t,i)):(it&&n&&Bd(t),t.flags|=1,Jt(e,t,r,i),t.child)}function wm(e,t,r,n,i){if(or(r)){var a=!0;wl(t)}else a=!1;if(ri(t,i),t.stateNode===null)Ja(e,t),C0(t,r,n),uh(t,r,n,i),n=!0;else if(e===null){var l=t.stateNode,s=t.memoizedProps;l.props=s;var o=l.context,c=r.contextType;typeof c=="object"&&c!==null?c=Cr(c):(c=or(r)?ys:Xt.current,c=ui(t,c));var p=r.getDerivedStateFromProps,u=typeof p=="function"||typeof l.getSnapshotBeforeUpdate=="function";u||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(s!==n||o!==c)&&pm(t,l,n,c),Tn=!1;var f=t.memoizedState;l.state=f,El(t,n,l,i),o=t.memoizedState,s!==n||f!==o||ir.current||Tn?(typeof p=="function"&&(ch(t,r,p,n),o=t.memoizedState),(s=Tn||fm(t,r,s,n,f,o,c))?(u||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount()),typeof l.componentDidMount=="function"&&(t.flags|=4194308)):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=o),l.props=n,l.state=o,l.context=c,n=s):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{l=t.stateNode,n0(e,t),s=t.memoizedProps,c=t.type===t.elementType?s:Dr(t.type,s),l.props=c,u=t.pendingProps,f=l.context,o=r.contextType,typeof o=="object"&&o!==null?o=Cr(o):(o=or(r)?ys:Xt.current,o=ui(t,o));var _=r.getDerivedStateFromProps;(p=typeof _=="function"||typeof l.getSnapshotBeforeUpdate=="function")||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(s!==u||f!==o)&&pm(t,l,n,o),Tn=!1,f=t.memoizedState,l.state=f,El(t,n,l,i);var y=t.memoizedState;s!==u||f!==y||ir.current||Tn?(typeof _=="function"&&(ch(t,r,_,n),y=t.memoizedState),(c=Tn||fm(t,r,c,n,f,y,o)||!1)?(p||typeof l.UNSAFE_componentWillUpdate!="function"&&typeof l.componentWillUpdate!="function"||(typeof l.componentWillUpdate=="function"&&l.componentWillUpdate(n,y,o),typeof l.UNSAFE_componentWillUpdate=="function"&&l.UNSAFE_componentWillUpdate(n,y,o)),typeof l.componentDidUpdate=="function"&&(t.flags|=4),typeof l.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof l.componentDidUpdate!="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=y),l.props=n,l.state=y,l.context=o,n=c):(typeof l.componentDidUpdate!="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),n=!1)}return fh(e,t,r,n,a,i)}function fh(e,t,r,n,i,a){R0(e,t);var l=(t.flags&128)!==0;if(!n&&!l)return i&&im(t,r,!1),vn(e,t,a);n=t.stateNode,kb.current=t;var s=l&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&l?(t.child=di(t,e.child,null,a),t.child=di(t,null,s,a)):Jt(e,t,s,a),t.memoizedState=n.state,i&&im(t,r,!0),t.child}function D0(e){var t=e.stateNode;t.pendingContext?sm(e,t.pendingContext,t.pendingContext!==t.context):t.context&&sm(e,t.context,!1),Ud(e,t.containerInfo)}function Sm(e,t,r,n,i){return hi(),Nd(i),t.flags|=256,Jt(e,t,r,n),t.child}var ph={dehydrated:null,treeContext:null,retryLane:0};function mh(e){return{baseLanes:e,cachePool:null,transitions:null}}function M0(e,t,r){var n=t.pendingProps,i=at.current,a=!1,l=(t.flags&128)!==0,s;if((s=l)||(s=e!==null&&e.memoizedState===null?!1:(i&2)!==0),s?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),Ze(at,i&1),e===null)return ah(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(l=n.children,e=n.fallback,a?(n=t.mode,a=t.child,l={mode:"hidden",children:l},!(n&1)&&a!==null?(a.childLanes=0,a.pendingProps=l):a=uc(l,n,0,null),e=gs(e,n,r,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=mh(r),t.memoizedState=ph,e):Jd(t,l));if(i=e.memoizedState,i!==null&&(s=i.dehydrated,s!==null))return Lb(e,t,l,n,s,i,r);if(a){a=n.fallback,l=t.mode,i=e.child,s=i.sibling;var o={mode:"hidden",children:n.children};return!(l&1)&&t.child!==i?(n=t.child,n.childLanes=0,n.pendingProps=o,t.deletions=null):(n=zn(i,o),n.subtreeFlags=i.subtreeFlags&14680064),s!==null?a=zn(s,a):(a=gs(a,l,r,null),a.flags|=2),a.return=t,n.return=t,n.sibling=a,t.child=n,n=a,a=t.child,l=e.child.memoizedState,l=l===null?mh(r):{baseLanes:l.baseLanes|r,cachePool:null,transitions:l.transitions},a.memoizedState=l,a.childLanes=e.childLanes&~r,t.memoizedState=ph,n}return a=e.child,e=a.sibling,n=zn(a,{mode:"visible",children:n.children}),!(t.mode&1)&&(n.lanes=r),n.return=t,n.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n}function Jd(e,t){return t=uc({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function xa(e,t,r,n){return n!==null&&Nd(n),di(t,e.child,null,r),e=Jd(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Lb(e,t,r,n,i,a,l){if(r)return t.flags&256?(t.flags&=-257,n=Xc(Error(ce(422))),xa(e,t,l,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=n.fallback,i=t.mode,n=uc({mode:"visible",children:n.children},i,0,null),a=gs(a,i,l,null),a.flags|=2,n.return=t,a.return=t,n.sibling=a,t.child=n,t.mode&1&&di(t,e.child,null,l),t.child.memoizedState=mh(l),t.memoizedState=ph,a);if(!(t.mode&1))return xa(e,t,l,null);if(i.data==="$!"){if(n=i.nextSibling&&i.nextSibling.dataset,n)var s=n.dgst;return n=s,a=Error(ce(419)),n=Xc(a,n,void 0),xa(e,t,l,n)}if(s=(l&e.childLanes)!==0,sr||s){if(n=Pt,n!==null){switch(l&-l){case 4:i=2;break;case 16:i=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(n.suspendedLanes|l)?0:i,i!==0&&i!==a.retryLane&&(a.retryLane=i,gn(e,i),Or(n,e,i,-1))}return nf(),n=Xc(Error(ce(421))),xa(e,t,l,n)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=$b.bind(null,e),i._reactRetry=t,null):(e=a.treeContext,hr=jn(i.nextSibling),dr=t,it=!0,Pr=null,e!==null&&(_r[yr++]=cn,_r[yr++]=un,_r[yr++]=ws,cn=e.id,un=e.overflow,ws=t),t=Jd(t,n.children),t.flags|=4096,t)}function xm(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),lh(e.return,t,r)}function Yc(e,t,r,n,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=n,a.tail=r,a.tailMode=i)}function A0(e,t,r){var n=t.pendingProps,i=n.revealOrder,a=n.tail;if(Jt(e,t,n.children,r),n=at.current,n&2)n=n&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&xm(e,r,t);else if(e.tag===19)xm(e,r,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}n&=1}if(Ze(at,n),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(r=t.child,i=null;r!==null;)e=r.alternate,e!==null&&kl(e)===null&&(i=r),r=r.sibling;r=i,r===null?(i=t.child,t.child=null):(i=r.sibling,r.sibling=null),Yc(t,!1,i,r,a);break;case"backwards":for(r=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&kl(e)===null){t.child=i;break}e=i.sibling,i.sibling=r,r=i,i=e}Yc(t,!0,r,null,a);break;case"together":Yc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ja(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function vn(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),xs|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(ce(153));if(t.child!==null){for(e=t.child,r=zn(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=zn(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function Tb(e,t,r){switch(t.tag){case 3:D0(t),hi();break;case 5:s0(t);break;case 1:or(t.type)&&wl(t);break;case 4:Ud(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,i=t.memoizedProps.value;Ze(bl,n._currentValue),n._currentValue=i;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(Ze(at,at.current&1),t.flags|=128,null):r&t.child.childLanes?M0(e,t,r):(Ze(at,at.current&1),e=vn(e,t,r),e!==null?e.sibling:null);Ze(at,at.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return A0(e,t,r);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ze(at,at.current),n)break;return null;case 22:case 23:return t.lanes=0,T0(e,t,r)}return vn(e,t,r)}var P0,gh,I0,B0;P0=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};gh=function(){};I0=function(e,t,r,n){var i=e.memoizedProps;if(i!==n){e=t.stateNode,us(Wr.current);var a=null;switch(r){case"input":i=ju(e,i),n=ju(e,n),a=[];break;case"select":i=ut({},i,{value:void 0}),n=ut({},n,{value:void 0}),a=[];break;case"textarea":i=Hu(e,i),n=Hu(e,n),a=[];break;default:typeof i.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=_l)}Uu(r,n);var l;r=null;for(c in i)if(!n.hasOwnProperty(c)&&i.hasOwnProperty(c)&&i[c]!=null)if(c==="style"){var s=i[c];for(l in s)s.hasOwnProperty(l)&&(r||(r={}),r[l]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(_o.hasOwnProperty(c)?a||(a=[]):(a=a||[]).push(c,null));for(c in n){var o=n[c];if(s=i!=null?i[c]:void 0,n.hasOwnProperty(c)&&o!==s&&(o!=null||s!=null))if(c==="style")if(s){for(l in s)!s.hasOwnProperty(l)||o&&o.hasOwnProperty(l)||(r||(r={}),r[l]="");for(l in o)o.hasOwnProperty(l)&&s[l]!==o[l]&&(r||(r={}),r[l]=o[l])}else r||(a||(a=[]),a.push(c,r)),r=o;else c==="dangerouslySetInnerHTML"?(o=o?o.__html:void 0,s=s?s.__html:void 0,o!=null&&s!==o&&(a=a||[]).push(c,o)):c==="children"?typeof o!="string"&&typeof o!="number"||(a=a||[]).push(c,""+o):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(_o.hasOwnProperty(c)?(o!=null&&c==="onScroll"&&rt("scroll",e),a||s===o||(a=[])):(a=a||[]).push(c,o))}r&&(a=a||[]).push("style",r);var c=a;(t.updateQueue=c)&&(t.flags|=4)}};B0=function(e,t,r,n){r!==n&&(t.flags|=4)};function ji(e,t){if(!it)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function Wt(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,n=0;if(t)for(var i=e.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags&14680064,n|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags,n|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function Rb(e,t,r){var n=t.pendingProps;switch(Od(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Wt(t),null;case 1:return or(t.type)&&yl(),Wt(t),null;case 3:return n=t.stateNode,fi(),nt(ir),nt(Xt),Vd(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(wa(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Pr!==null&&(Ch(Pr),Pr=null))),gh(e,t),Wt(t),null;case 5:Wd(t);var i=us(Do.current);if(r=t.type,e!==null&&t.stateNode!=null)I0(e,t,r,n,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(t.stateNode===null)throw Error(ce(166));return Wt(t),null}if(e=us(Wr.current),wa(t)){n=t.stateNode,r=t.type;var a=t.memoizedProps;switch(n[Hr]=t,n[To]=a,e=(t.mode&1)!==0,r){case"dialog":rt("cancel",n),rt("close",n);break;case"iframe":case"object":case"embed":rt("load",n);break;case"video":case"audio":for(i=0;i<qi.length;i++)rt(qi[i],n);break;case"source":rt("error",n);break;case"img":case"image":case"link":rt("error",n),rt("load",n);break;case"details":rt("toggle",n);break;case"input":Mp(n,a),rt("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!a.multiple},rt("invalid",n);break;case"textarea":Pp(n,a),rt("invalid",n)}Uu(r,a),i=null;for(var l in a)if(a.hasOwnProperty(l)){var s=a[l];l==="children"?typeof s=="string"?n.textContent!==s&&(a.suppressHydrationWarning!==!0&&ya(n.textContent,s,e),i=["children",s]):typeof s=="number"&&n.textContent!==""+s&&(a.suppressHydrationWarning!==!0&&ya(n.textContent,s,e),i=["children",""+s]):_o.hasOwnProperty(l)&&s!=null&&l==="onScroll"&&rt("scroll",n)}switch(r){case"input":ha(n),Ap(n,a,!0);break;case"textarea":ha(n),Ip(n);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(n.onclick=_l)}n=i,t.updateQueue=n,n!==null&&(t.flags|=4)}else{l=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=c_(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=l.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=l.createElement(r,{is:n.is}):(e=l.createElement(r),r==="select"&&(l=e,n.multiple?l.multiple=!0:n.size&&(l.size=n.size))):e=l.createElementNS(e,r),e[Hr]=t,e[To]=n,P0(e,t,!1,!1),t.stateNode=e;e:{switch(l=Wu(r,n),r){case"dialog":rt("cancel",e),rt("close",e),i=n;break;case"iframe":case"object":case"embed":rt("load",e),i=n;break;case"video":case"audio":for(i=0;i<qi.length;i++)rt(qi[i],e);i=n;break;case"source":rt("error",e),i=n;break;case"img":case"image":case"link":rt("error",e),rt("load",e),i=n;break;case"details":rt("toggle",e),i=n;break;case"input":Mp(e,n),i=ju(e,n),rt("invalid",e);break;case"option":i=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},i=ut({},n,{value:void 0}),rt("invalid",e);break;case"textarea":Pp(e,n),i=Hu(e,n),rt("invalid",e);break;default:i=n}Uu(r,i),s=i;for(a in s)if(s.hasOwnProperty(a)){var o=s[a];a==="style"?d_(e,o):a==="dangerouslySetInnerHTML"?(o=o?o.__html:void 0,o!=null&&u_(e,o)):a==="children"?typeof o=="string"?(r!=="textarea"||o!=="")&&yo(e,o):typeof o=="number"&&yo(e,""+o):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(_o.hasOwnProperty(a)?o!=null&&a==="onScroll"&&rt("scroll",e):o!=null&&Sd(e,a,o,l))}switch(r){case"input":ha(e),Ap(e,n,!1);break;case"textarea":ha(e),Ip(e);break;case"option":n.value!=null&&e.setAttribute("value",""+Un(n.value));break;case"select":e.multiple=!!n.multiple,a=n.value,a!=null?Qs(e,!!n.multiple,a,!1):n.defaultValue!=null&&Qs(e,!!n.multiple,n.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=_l)}switch(r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Wt(t),null;case 6:if(e&&t.stateNode!=null)B0(e,t,e.memoizedProps,n);else{if(typeof n!="string"&&t.stateNode===null)throw Error(ce(166));if(r=us(Do.current),us(Wr.current),wa(t)){if(n=t.stateNode,r=t.memoizedProps,n[Hr]=t,(a=n.nodeValue!==r)&&(e=dr,e!==null))switch(e.tag){case 3:ya(n.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&ya(n.nodeValue,r,(e.mode&1)!==0)}a&&(t.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[Hr]=t,t.stateNode=n}return Wt(t),null;case 13:if(nt(at),n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(it&&hr!==null&&t.mode&1&&!(t.flags&128))Z_(),hi(),t.flags|=98560,a=!1;else if(a=wa(t),n!==null&&n.dehydrated!==null){if(e===null){if(!a)throw Error(ce(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(ce(317));a[Hr]=t}else hi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Wt(t),a=!1}else Pr!==null&&(Ch(Pr),Pr=null),a=!0;if(!a)return t.flags&65536?t:null}return t.flags&128?(t.lanes=r,t):(n=n!==null,n!==(e!==null&&e.memoizedState!==null)&&n&&(t.child.flags|=8192,t.mode&1&&(e===null||at.current&1?Ct===0&&(Ct=3):nf())),t.updateQueue!==null&&(t.flags|=4),Wt(t),null);case 4:return fi(),gh(e,t),e===null&&ko(t.stateNode.containerInfo),Wt(t),null;case 10:return $d(t.type._context),Wt(t),null;case 17:return or(t.type)&&yl(),Wt(t),null;case 19:if(nt(at),a=t.memoizedState,a===null)return Wt(t),null;if(n=(t.flags&128)!==0,l=a.rendering,l===null)if(n)ji(a,!1);else{if(Ct!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(l=kl(e),l!==null){for(t.flags|=128,ji(a,!1),n=l.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),t.subtreeFlags=0,n=r,r=t.child;r!==null;)a=r,e=n,a.flags&=14680066,l=a.alternate,l===null?(a.childLanes=0,a.lanes=e,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=l.childLanes,a.lanes=l.lanes,a.child=l.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=l.memoizedProps,a.memoizedState=l.memoizedState,a.updateQueue=l.updateQueue,a.type=l.type,e=l.dependencies,a.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return Ze(at,at.current&1|2),t.child}e=e.sibling}a.tail!==null&&pt()>mi&&(t.flags|=128,n=!0,ji(a,!1),t.lanes=4194304)}else{if(!n)if(e=kl(l),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),ji(a,!0),a.tail===null&&a.tailMode==="hidden"&&!l.alternate&&!it)return Wt(t),null}else 2*pt()-a.renderingStartTime>mi&&r!==1073741824&&(t.flags|=128,n=!0,ji(a,!1),t.lanes=4194304);a.isBackwards?(l.sibling=t.child,t.child=l):(r=a.last,r!==null?r.sibling=l:t.child=l,a.last=l)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=pt(),t.sibling=null,r=at.current,Ze(at,n?r&1|2:r&1),t):(Wt(t),null);case 22:case 23:return rf(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?cr&1073741824&&(Wt(t),t.subtreeFlags&6&&(t.flags|=8192)):Wt(t),null;case 24:return null;case 25:return null}throw Error(ce(156,t.tag))}function Db(e,t){switch(Od(t),t.tag){case 1:return or(t.type)&&yl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return fi(),nt(ir),nt(Xt),Vd(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Wd(t),null;case 13:if(nt(at),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ce(340));hi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return nt(at),null;case 4:return fi(),null;case 10:return $d(t.type._context),null;case 22:case 23:return rf(),null;case 24:return null;default:return null}}var ba=!1,Vt=!1,Mb=typeof WeakSet=="function"?WeakSet:Set,Se=null;function Vs(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){ft(e,t,n)}else r.current=null}function vh(e,t,r){try{r()}catch(n){ft(e,t,n)}}var bm=!1;function Ab(e,t){if(eh=ml,e=$_(),Id(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,a=n.focusNode;n=n.focusOffset;try{r.nodeType,a.nodeType}catch{r=null;break e}var l=0,s=-1,o=-1,c=0,p=0,u=e,f=null;t:for(;;){for(var _;u!==r||i!==0&&u.nodeType!==3||(s=l+i),u!==a||n!==0&&u.nodeType!==3||(o=l+n),u.nodeType===3&&(l+=u.nodeValue.length),(_=u.firstChild)!==null;)f=u,u=_;for(;;){if(u===e)break t;if(f===r&&++c===i&&(s=l),f===a&&++p===n&&(o=l),(_=u.nextSibling)!==null)break;u=f,f=u.parentNode}u=_}r=s===-1||o===-1?null:{start:s,end:o}}else r=null}r=r||{start:0,end:0}}else r=null;for(th={focusedElem:e,selectionRange:r},ml=!1,Se=t;Se!==null;)if(t=Se,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Se=e;else for(;Se!==null;){t=Se;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var v=y.memoizedProps,h=y.memoizedState,m=t.stateNode,d=m.getSnapshotBeforeUpdate(t.elementType===t.type?v:Dr(t.type,v),h);m.__reactInternalSnapshotBeforeUpdate=d}break;case 3:var g=t.stateNode.containerInfo;g.nodeType===1?g.textContent="":g.nodeType===9&&g.documentElement&&g.removeChild(g.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ce(163))}}catch(w){ft(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,Se=e;break}Se=t.return}return y=bm,bm=!1,y}function io(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&vh(t,r,a)}i=i.next}while(i!==n)}}function lc(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function _h(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function O0(e){var t=e.alternate;t!==null&&(e.alternate=null,O0(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Hr],delete t[To],delete t[sh],delete t[pb],delete t[mb])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function N0(e){return e.tag===5||e.tag===3||e.tag===4}function Cm(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||N0(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.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 yh(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=_l));else if(n!==4&&(e=e.child,e!==null))for(yh(e,t,r),e=e.sibling;e!==null;)yh(e,t,r),e=e.sibling}function wh(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(wh(e,t,r),e=e.sibling;e!==null;)wh(e,t,r),e=e.sibling}var Ot=null,Mr=!1;function xn(e,t,r){for(r=r.child;r!==null;)j0(e,t,r),r=r.sibling}function j0(e,t,r){if(Ur&&typeof Ur.onCommitFiberUnmount=="function")try{Ur.onCommitFiberUnmount(ec,r)}catch{}switch(r.tag){case 5:Vt||Vs(r,t);case 6:var n=Ot,i=Mr;Ot=null,xn(e,t,r),Ot=n,Mr=i,Ot!==null&&(Mr?(e=Ot,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Ot.removeChild(r.stateNode));break;case 18:Ot!==null&&(Mr?(e=Ot,r=r.stateNode,e.nodeType===8?Uc(e.parentNode,r):e.nodeType===1&&Uc(e,r),bo(e)):Uc(Ot,r.stateNode));break;case 4:n=Ot,i=Mr,Ot=r.stateNode.containerInfo,Mr=!0,xn(e,t,r),Ot=n,Mr=i;break;case 0:case 11:case 14:case 15:if(!Vt&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var a=i,l=a.destroy;a=a.tag,l!==void 0&&(a&2||a&4)&&vh(r,t,l),i=i.next}while(i!==n)}xn(e,t,r);break;case 1:if(!Vt&&(Vs(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(s){ft(r,t,s)}xn(e,t,r);break;case 21:xn(e,t,r);break;case 22:r.mode&1?(Vt=(n=Vt)||r.memoizedState!==null,xn(e,t,r),Vt=n):xn(e,t,r);break;default:xn(e,t,r)}}function Em(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new Mb),t.forEach(function(n){var i=Hb.bind(null,e,n);r.has(n)||(r.add(n),n.then(i,i))})}}function kr(e,t){var r=t.deletions;if(r!==null)for(var n=0;n<r.length;n++){var i=r[n];try{var a=e,l=t,s=l;e:for(;s!==null;){switch(s.tag){case 5:Ot=s.stateNode,Mr=!1;break e;case 3:Ot=s.stateNode.containerInfo,Mr=!0;break e;case 4:Ot=s.stateNode.containerInfo,Mr=!0;break e}s=s.return}if(Ot===null)throw Error(ce(160));j0(a,l,i),Ot=null,Mr=!1;var o=i.alternate;o!==null&&(o.return=null),i.return=null}catch(c){ft(i,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)F0(t,e),t=t.sibling}function F0(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(kr(t,e),Fr(e),n&4){try{io(3,e,e.return),lc(3,e)}catch(v){ft(e,e.return,v)}try{io(5,e,e.return)}catch(v){ft(e,e.return,v)}}break;case 1:kr(t,e),Fr(e),n&512&&r!==null&&Vs(r,r.return);break;case 5:if(kr(t,e),Fr(e),n&512&&r!==null&&Vs(r,r.return),e.flags&32){var i=e.stateNode;try{yo(i,"")}catch(v){ft(e,e.return,v)}}if(n&4&&(i=e.stateNode,i!=null)){var a=e.memoizedProps,l=r!==null?r.memoizedProps:a,s=e.type,o=e.updateQueue;if(e.updateQueue=null,o!==null)try{s==="input"&&a.type==="radio"&&a.name!=null&&a_(i,a),Wu(s,l);var c=Wu(s,a);for(l=0;l<o.length;l+=2){var p=o[l],u=o[l+1];p==="style"?d_(i,u):p==="dangerouslySetInnerHTML"?u_(i,u):p==="children"?yo(i,u):Sd(i,p,u,c)}switch(s){case"input":Fu(i,a);break;case"textarea":l_(i,a);break;case"select":var f=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!a.multiple;var _=a.value;_!=null?Qs(i,!!a.multiple,_,!1):f!==!!a.multiple&&(a.defaultValue!=null?Qs(i,!!a.multiple,a.defaultValue,!0):Qs(i,!!a.multiple,a.multiple?[]:"",!1))}i[To]=a}catch(v){ft(e,e.return,v)}}break;case 6:if(kr(t,e),Fr(e),n&4){if(e.stateNode===null)throw Error(ce(162));i=e.stateNode,a=e.memoizedProps;try{i.nodeValue=a}catch(v){ft(e,e.return,v)}}break;case 3:if(kr(t,e),Fr(e),n&4&&r!==null&&r.memoizedState.isDehydrated)try{bo(t.containerInfo)}catch(v){ft(e,e.return,v)}break;case 4:kr(t,e),Fr(e);break;case 13:kr(t,e),Fr(e),i=e.child,i.flags&8192&&(a=i.memoizedState!==null,i.stateNode.isHidden=a,!a||i.alternate!==null&&i.alternate.memoizedState!==null||(ef=pt())),n&4&&Em(e);break;case 22:if(p=r!==null&&r.memoizedState!==null,e.mode&1?(Vt=(c=Vt)||p,kr(t,e),Vt=c):kr(t,e),Fr(e),n&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!p&&e.mode&1)for(Se=e,p=e.child;p!==null;){for(u=Se=p;Se!==null;){switch(f=Se,_=f.child,f.tag){case 0:case 11:case 14:case 15:io(4,f,f.return);break;case 1:Vs(f,f.return);var y=f.stateNode;if(typeof y.componentWillUnmount=="function"){n=f,r=f.return;try{t=n,y.props=t.memoizedProps,y.state=t.memoizedState,y.componentWillUnmount()}catch(v){ft(n,r,v)}}break;case 5:Vs(f,f.return);break;case 22:if(f.memoizedState!==null){Lm(u);continue}}_!==null?(_.return=f,Se=_):Lm(u)}p=p.sibling}e:for(p=null,u=e;;){if(u.tag===5){if(p===null){p=u;try{i=u.stateNode,c?(a=i.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"):(s=u.stateNode,o=u.memoizedProps.style,l=o!=null&&o.hasOwnProperty("display")?o.display:null,s.style.display=h_("display",l))}catch(v){ft(e,e.return,v)}}}else if(u.tag===6){if(p===null)try{u.stateNode.nodeValue=c?"":u.memoizedProps}catch(v){ft(e,e.return,v)}}else if((u.tag!==22&&u.tag!==23||u.memoizedState===null||u===e)&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===e)break e;for(;u.sibling===null;){if(u.return===null||u.return===e)break e;p===u&&(p=null),u=u.return}p===u&&(p=null),u.sibling.return=u.return,u=u.sibling}}break;case 19:kr(t,e),Fr(e),n&4&&Em(e);break;case 21:break;default:kr(t,e),Fr(e)}}function Fr(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(N0(r)){var n=r;break e}r=r.return}throw Error(ce(160))}switch(n.tag){case 5:var i=n.stateNode;n.flags&32&&(yo(i,""),n.flags&=-33);var a=Cm(e);wh(e,a,i);break;case 3:case 4:var l=n.stateNode.containerInfo,s=Cm(e);yh(e,s,l);break;default:throw Error(ce(161))}}catch(o){ft(e,e.return,o)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Pb(e,t,r){Se=e,$0(e)}function $0(e,t,r){for(var n=(e.mode&1)!==0;Se!==null;){var i=Se,a=i.child;if(i.tag===22&&n){var l=i.memoizedState!==null||ba;if(!l){var s=i.alternate,o=s!==null&&s.memoizedState!==null||Vt;s=ba;var c=Vt;if(ba=l,(Vt=o)&&!c)for(Se=i;Se!==null;)l=Se,o=l.child,l.tag===22&&l.memoizedState!==null?Tm(i):o!==null?(o.return=l,Se=o):Tm(i);for(;a!==null;)Se=a,$0(a),a=a.sibling;Se=i,ba=s,Vt=c}km(e)}else i.subtreeFlags&8772&&a!==null?(a.return=i,Se=a):km(e)}}function km(e){for(;Se!==null;){var t=Se;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Vt||lc(5,t);break;case 1:var n=t.stateNode;if(t.flags&4&&!Vt)if(r===null)n.componentDidMount();else{var i=t.elementType===t.type?r.memoizedProps:Dr(t.type,r.memoizedProps);n.componentDidUpdate(i,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;a!==null&&um(t,a,n);break;case 3:var l=t.updateQueue;if(l!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}um(t,l,r)}break;case 5:var s=t.stateNode;if(r===null&&t.flags&4){r=s;var o=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":o.autoFocus&&r.focus();break;case"img":o.src&&(r.src=o.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var p=c.memoizedState;if(p!==null){var u=p.dehydrated;u!==null&&bo(u)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(ce(163))}Vt||t.flags&512&&_h(t)}catch(f){ft(t,t.return,f)}}if(t===e){Se=null;break}if(r=t.sibling,r!==null){r.return=t.return,Se=r;break}Se=t.return}}function Lm(e){for(;Se!==null;){var t=Se;if(t===e){Se=null;break}var r=t.sibling;if(r!==null){r.return=t.return,Se=r;break}Se=t.return}}function Tm(e){for(;Se!==null;){var t=Se;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{lc(4,t)}catch(o){ft(t,r,o)}break;case 1:var n=t.stateNode;if(typeof n.componentDidMount=="function"){var i=t.return;try{n.componentDidMount()}catch(o){ft(t,i,o)}}var a=t.return;try{_h(t)}catch(o){ft(t,a,o)}break;case 5:var l=t.return;try{_h(t)}catch(o){ft(t,l,o)}}}catch(o){ft(t,t.return,o)}if(t===e){Se=null;break}var s=t.sibling;if(s!==null){s.return=t.return,Se=s;break}Se=t.return}}var Ib=Math.ceil,Rl=yn.ReactCurrentDispatcher,Qd=yn.ReactCurrentOwner,xr=yn.ReactCurrentBatchConfig,qe=0,Pt=null,vt=null,Ft=0,cr=0,Ks=qn(0),Ct=0,Io=null,xs=0,cc=0,Zd=0,oo=null,nr=null,ef=0,mi=1/0,an=null,Dl=!1,Sh=null,$n=null,Ca=!1,Pn=null,Ml=0,ao=0,xh=null,Qa=-1,Za=0;function er(){return qe&6?pt():Qa!==-1?Qa:Qa=pt()}function Hn(e){return e.mode&1?qe&2&&Ft!==0?Ft&-Ft:vb.transition!==null?(Za===0&&(Za=C_()),Za):(e=Je,e!==0||(e=window.event,e=e===void 0?16:M_(e.type)),e):1}function Or(e,t,r,n){if(50<ao)throw ao=0,xh=null,Error(ce(185));qo(e,r,n),(!(qe&2)||e!==Pt)&&(e===Pt&&(!(qe&2)&&(cc|=r),Ct===4&&Mn(e,Ft)),ar(e,n),r===1&&qe===0&&!(t.mode&1)&&(mi=pt()+500,ic&&Xn()))}function ar(e,t){var r=e.callbackNode;vx(e,t);var n=pl(e,e===Pt?Ft:0);if(n===0)r!==null&&Np(r),e.callbackNode=null,e.callbackPriority=0;else if(t=n&-n,e.callbackPriority!==t){if(r!=null&&Np(r),t===1)e.tag===0?gb(Rm.bind(null,e)):Y_(Rm.bind(null,e)),db(function(){!(qe&6)&&Xn()}),r=null;else{switch(E_(n)){case 1:r=kd;break;case 4:r=x_;break;case 16:r=fl;break;case 536870912:r=b_;break;default:r=fl}r=q0(r,H0.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function H0(e,t){if(Qa=-1,Za=0,qe&6)throw Error(ce(327));var r=e.callbackNode;if(ni()&&e.callbackNode!==r)return null;var n=pl(e,e===Pt?Ft:0);if(n===0)return null;if(n&30||n&e.expiredLanes||t)t=Al(e,n);else{t=n;var i=qe;qe|=2;var a=U0();(Pt!==e||Ft!==t)&&(an=null,mi=pt()+500,ms(e,t));do try{Nb();break}catch(s){z0(e,s)}while(!0);Fd(),Rl.current=a,qe=i,vt!==null?t=0:(Pt=null,Ft=0,t=Ct)}if(t!==0){if(t===2&&(i=Xu(e),i!==0&&(n=i,t=bh(e,i))),t===1)throw r=Io,ms(e,0),Mn(e,n),ar(e,pt()),r;if(t===6)Mn(e,n);else{if(i=e.current.alternate,!(n&30)&&!Bb(i)&&(t=Al(e,n),t===2&&(a=Xu(e),a!==0&&(n=a,t=bh(e,a))),t===1))throw r=Io,ms(e,0),Mn(e,n),ar(e,pt()),r;switch(e.finishedWork=i,e.finishedLanes=n,t){case 0:case 1:throw Error(ce(345));case 2:os(e,nr,an);break;case 3:if(Mn(e,n),(n&130023424)===n&&(t=ef+500-pt(),10<t)){if(pl(e,0)!==0)break;if(i=e.suspendedLanes,(i&n)!==n){er(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=nh(os.bind(null,e,nr,an),t);break}os(e,nr,an);break;case 4:if(Mn(e,n),(n&4194240)===n)break;for(t=e.eventTimes,i=-1;0<n;){var l=31-Br(n);a=1<<l,l=t[l],l>i&&(i=l),n&=~a}if(n=i,n=pt()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*Ib(n/1960))-n,10<n){e.timeoutHandle=nh(os.bind(null,e,nr,an),n);break}os(e,nr,an);break;case 5:os(e,nr,an);break;default:throw Error(ce(329))}}}return ar(e,pt()),e.callbackNode===r?H0.bind(null,e):null}function bh(e,t){var r=oo;return e.current.memoizedState.isDehydrated&&(ms(e,t).flags|=256),e=Al(e,t),e!==2&&(t=nr,nr=r,t!==null&&Ch(t)),e}function Ch(e){nr===null?nr=e:nr.push.apply(nr,e)}function Bb(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var n=0;n<r.length;n++){var i=r[n],a=i.getSnapshot;i=i.value;try{if(!Nr(a(),i))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;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 Mn(e,t){for(t&=~Zd,t&=~cc,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-Br(t),n=1<<r;e[r]=-1,t&=~n}}function Rm(e){if(qe&6)throw Error(ce(327));ni();var t=pl(e,0);if(!(t&1))return ar(e,pt()),null;var r=Al(e,t);if(e.tag!==0&&r===2){var n=Xu(e);n!==0&&(t=n,r=bh(e,n))}if(r===1)throw r=Io,ms(e,0),Mn(e,t),ar(e,pt()),r;if(r===6)throw Error(ce(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,os(e,nr,an),ar(e,pt()),null}function tf(e,t){var r=qe;qe|=1;try{return e(t)}finally{qe=r,qe===0&&(mi=pt()+500,ic&&Xn())}}function bs(e){Pn!==null&&Pn.tag===0&&!(qe&6)&&ni();var t=qe;qe|=1;var r=xr.transition,n=Je;try{if(xr.transition=null,Je=1,e)return e()}finally{Je=n,xr.transition=r,qe=t,!(qe&6)&&Xn()}}function rf(){cr=Ks.current,nt(Ks)}function ms(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,hb(r)),vt!==null)for(r=vt.return;r!==null;){var n=r;switch(Od(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&yl();break;case 3:fi(),nt(ir),nt(Xt),Vd();break;case 5:Wd(n);break;case 4:fi();break;case 13:nt(at);break;case 19:nt(at);break;case 10:$d(n.type._context);break;case 22:case 23:rf()}r=r.return}if(Pt=e,vt=e=zn(e.current,null),Ft=cr=t,Ct=0,Io=null,Zd=cc=xs=0,nr=oo=null,cs!==null){for(t=0;t<cs.length;t++)if(r=cs[t],n=r.interleaved,n!==null){r.interleaved=null;var i=n.next,a=r.pending;if(a!==null){var l=a.next;a.next=i,n.next=l}r.pending=n}cs=null}return e}function z0(e,t){do{var r=vt;try{if(Fd(),Xa.current=Tl,Ll){for(var n=ct.memoizedState;n!==null;){var i=n.queue;i!==null&&(i.pending=null),n=n.next}Ll=!1}if(Ss=0,Lt=St=ct=null,so=!1,Mo=0,Qd.current=null,r===null||r.return===null){Ct=1,Io=t,vt=null;break}e:{var a=e,l=r.return,s=r,o=t;if(t=Ft,s.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){var c=o,p=s,u=p.tag;if(!(p.mode&1)&&(u===0||u===11||u===15)){var f=p.alternate;f?(p.updateQueue=f.updateQueue,p.memoizedState=f.memoizedState,p.lanes=f.lanes):(p.updateQueue=null,p.memoizedState=null)}var _=gm(l);if(_!==null){_.flags&=-257,vm(_,l,s,a,t),_.mode&1&&mm(a,c,t),t=_,o=c;var y=t.updateQueue;if(y===null){var v=new Set;v.add(o),t.updateQueue=v}else y.add(o);break e}else{if(!(t&1)){mm(a,c,t),nf();break e}o=Error(ce(426))}}else if(it&&s.mode&1){var h=gm(l);if(h!==null){!(h.flags&65536)&&(h.flags|=256),vm(h,l,s,a,t),Nd(pi(o,s));break e}}a=o=pi(o,s),Ct!==4&&(Ct=2),oo===null?oo=[a]:oo.push(a),a=l;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var m=E0(a,o,t);cm(a,m);break e;case 1:s=o;var d=a.type,g=a.stateNode;if(!(a.flags&128)&&(typeof d.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&($n===null||!$n.has(g)))){a.flags|=65536,t&=-t,a.lanes|=t;var w=k0(a,s,t);cm(a,w);break e}}a=a.return}while(a!==null)}V0(r)}catch(b){t=b,vt===r&&r!==null&&(vt=r=r.return);continue}break}while(!0)}function U0(){var e=Rl.current;return Rl.current=Tl,e===null?Tl:e}function nf(){(Ct===0||Ct===3||Ct===2)&&(Ct=4),Pt===null||!(xs&268435455)&&!(cc&268435455)||Mn(Pt,Ft)}function Al(e,t){var r=qe;qe|=2;var n=U0();(Pt!==e||Ft!==t)&&(an=null,ms(e,t));do try{Ob();break}catch(i){z0(e,i)}while(!0);if(Fd(),qe=r,Rl.current=n,vt!==null)throw Error(ce(261));return Pt=null,Ft=0,Ct}function Ob(){for(;vt!==null;)W0(vt)}function Nb(){for(;vt!==null&&!lx();)W0(vt)}function W0(e){var t=G0(e.alternate,e,cr);e.memoizedProps=e.pendingProps,t===null?V0(e):vt=t,Qd.current=null}function V0(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=Db(r,t),r!==null){r.flags&=32767,vt=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ct=6,vt=null;return}}else if(r=Rb(r,t,cr),r!==null){vt=r;return}if(t=t.sibling,t!==null){vt=t;return}vt=t=e}while(t!==null);Ct===0&&(Ct=5)}function os(e,t,r){var n=Je,i=xr.transition;try{xr.transition=null,Je=1,jb(e,t,r,n)}finally{xr.transition=i,Je=n}return null}function jb(e,t,r,n){do ni();while(Pn!==null);if(qe&6)throw Error(ce(327));r=e.finishedWork;var i=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(ce(177));e.callbackNode=null,e.callbackPriority=0;var a=r.lanes|r.childLanes;if(_x(e,a),e===Pt&&(vt=Pt=null,Ft=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||Ca||(Ca=!0,q0(fl,function(){return ni(),null})),a=(r.flags&15990)!==0,r.subtreeFlags&15990||a){a=xr.transition,xr.transition=null;var l=Je;Je=1;var s=qe;qe|=4,Qd.current=null,Ab(e,r),F0(r,e),sb(th),ml=!!eh,th=eh=null,e.current=r,Pb(r),cx(),qe=s,Je=l,xr.transition=a}else e.current=r;if(Ca&&(Ca=!1,Pn=e,Ml=i),a=e.pendingLanes,a===0&&($n=null),dx(r.stateNode),ar(e,pt()),t!==null)for(n=e.onRecoverableError,r=0;r<t.length;r++)i=t[r],n(i.value,{componentStack:i.stack,digest:i.digest});if(Dl)throw Dl=!1,e=Sh,Sh=null,e;return Ml&1&&e.tag!==0&&ni(),a=e.pendingLanes,a&1?e===xh?ao++:(ao=0,xh=e):ao=0,Xn(),null}function ni(){if(Pn!==null){var e=E_(Ml),t=xr.transition,r=Je;try{if(xr.transition=null,Je=16>e?16:e,Pn===null)var n=!1;else{if(e=Pn,Pn=null,Ml=0,qe&6)throw Error(ce(331));var i=qe;for(qe|=4,Se=e.current;Se!==null;){var a=Se,l=a.child;if(Se.flags&16){var s=a.deletions;if(s!==null){for(var o=0;o<s.length;o++){var c=s[o];for(Se=c;Se!==null;){var p=Se;switch(p.tag){case 0:case 11:case 15:io(8,p,a)}var u=p.child;if(u!==null)u.return=p,Se=u;else for(;Se!==null;){p=Se;var f=p.sibling,_=p.return;if(O0(p),p===c){Se=null;break}if(f!==null){f.return=_,Se=f;break}Se=_}}}var y=a.alternate;if(y!==null){var v=y.child;if(v!==null){y.child=null;do{var h=v.sibling;v.sibling=null,v=h}while(v!==null)}}Se=a}}if(a.subtreeFlags&2064&&l!==null)l.return=a,Se=l;else e:for(;Se!==null;){if(a=Se,a.flags&2048)switch(a.tag){case 0:case 11:case 15:io(9,a,a.return)}var m=a.sibling;if(m!==null){m.return=a.return,Se=m;break e}Se=a.return}}var d=e.current;for(Se=d;Se!==null;){l=Se;var g=l.child;if(l.subtreeFlags&2064&&g!==null)g.return=l,Se=g;else e:for(l=d;Se!==null;){if(s=Se,s.flags&2048)try{switch(s.tag){case 0:case 11:case 15:lc(9,s)}}catch(b){ft(s,s.return,b)}if(s===l){Se=null;break e}var w=s.sibling;if(w!==null){w.return=s.return,Se=w;break e}Se=s.return}}if(qe=i,Xn(),Ur&&typeof Ur.onPostCommitFiberRoot=="function")try{Ur.onPostCommitFiberRoot(ec,e)}catch{}n=!0}return n}finally{Je=r,xr.transition=t}}return!1}function Dm(e,t,r){t=pi(r,t),t=E0(e,t,1),e=Fn(e,t,1),t=er(),e!==null&&(qo(e,1,t),ar(e,t))}function ft(e,t,r){if(e.tag===3)Dm(e,e,r);else for(;t!==null;){if(t.tag===3){Dm(t,e,r);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&($n===null||!$n.has(n))){e=pi(r,e),e=k0(t,e,1),t=Fn(t,e,1),e=er(),t!==null&&(qo(t,1,e),ar(t,e));break}}t=t.return}}function Fb(e,t,r){var n=e.pingCache;n!==null&&n.delete(t),t=er(),e.pingedLanes|=e.suspendedLanes&r,Pt===e&&(Ft&r)===r&&(Ct===4||Ct===3&&(Ft&130023424)===Ft&&500>pt()-ef?ms(e,0):Zd|=r),ar(e,t)}function K0(e,t){t===0&&(e.mode&1?(t=pa,pa<<=1,!(pa&130023424)&&(pa=4194304)):t=1);var r=er();e=gn(e,t),e!==null&&(qo(e,t,r),ar(e,r))}function $b(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),K0(e,r)}function Hb(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,i=e.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(ce(314))}n!==null&&n.delete(t),K0(e,r)}var G0;G0=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||ir.current)sr=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return sr=!1,Tb(e,t,r);sr=!!(e.flags&131072)}else sr=!1,it&&t.flags&1048576&&J_(t,xl,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;Ja(e,t),e=t.pendingProps;var i=ui(t,Xt.current);ri(t,r),i=Gd(null,t,n,e,i,r);var a=qd();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,or(n)?(a=!0,wl(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,zd(t),i.updater=ac,t.stateNode=i,i._reactInternals=t,uh(t,n,e,r),t=fh(null,t,n,!0,a,r)):(t.tag=0,it&&a&&Bd(t),Jt(null,t,i,r),t=t.child),t;case 16:n=t.elementType;e:{switch(Ja(e,t),e=t.pendingProps,i=n._init,n=i(n._payload),t.type=n,i=t.tag=Ub(n),e=Dr(n,e),i){case 0:t=dh(null,t,n,e,r);break e;case 1:t=wm(null,t,n,e,r);break e;case 11:t=_m(null,t,n,e,r);break e;case 14:t=ym(null,t,n,Dr(n.type,e),r);break e}throw Error(ce(306,n,""))}return t;case 0:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Dr(n,i),dh(e,t,n,i,r);case 1:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Dr(n,i),wm(e,t,n,i,r);case 3:e:{if(D0(t),e===null)throw Error(ce(387));n=t.pendingProps,a=t.memoizedState,i=a.element,n0(e,t),El(t,n,null,r);var l=t.memoizedState;if(n=l.element,a.isDehydrated)if(a={element:n,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){i=pi(Error(ce(423)),t),t=Sm(e,t,n,r,i);break e}else if(n!==i){i=pi(Error(ce(424)),t),t=Sm(e,t,n,r,i);break e}else for(hr=jn(t.stateNode.containerInfo.firstChild),dr=t,it=!0,Pr=null,r=t0(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(hi(),n===i){t=vn(e,t,r);break e}Jt(e,t,n,r)}t=t.child}return t;case 5:return s0(t),e===null&&ah(t),n=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,l=i.children,rh(n,i)?l=null:a!==null&&rh(n,a)&&(t.flags|=32),R0(e,t),Jt(e,t,l,r),t.child;case 6:return e===null&&ah(t),null;case 13:return M0(e,t,r);case 4:return Ud(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=di(t,null,n,r):Jt(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Dr(n,i),_m(e,t,n,i,r);case 7:return Jt(e,t,t.pendingProps,r),t.child;case 8:return Jt(e,t,t.pendingProps.children,r),t.child;case 12:return Jt(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,i=t.pendingProps,a=t.memoizedProps,l=i.value,Ze(bl,n._currentValue),n._currentValue=l,a!==null)if(Nr(a.value,l)){if(a.children===i.children&&!ir.current){t=vn(e,t,r);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var s=a.dependencies;if(s!==null){l=a.child;for(var o=s.firstContext;o!==null;){if(o.context===n){if(a.tag===1){o=dn(-1,r&-r),o.tag=2;var c=a.updateQueue;if(c!==null){c=c.shared;var p=c.pending;p===null?o.next=o:(o.next=p.next,p.next=o),c.pending=o}}a.lanes|=r,o=a.alternate,o!==null&&(o.lanes|=r),lh(a.return,r,t),s.lanes|=r;break}o=o.next}}else if(a.tag===10)l=a.type===t.type?null:a.child;else if(a.tag===18){if(l=a.return,l===null)throw Error(ce(341));l.lanes|=r,s=l.alternate,s!==null&&(s.lanes|=r),lh(l,r,t),l=a.sibling}else l=a.child;if(l!==null)l.return=a;else for(l=a;l!==null;){if(l===t){l=null;break}if(a=l.sibling,a!==null){a.return=l.return,l=a;break}l=l.return}a=l}Jt(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,n=t.pendingProps.children,ri(t,r),i=Cr(i),n=n(i),t.flags|=1,Jt(e,t,n,r),t.child;case 14:return n=t.type,i=Dr(n,t.pendingProps),i=Dr(n.type,i),ym(e,t,n,i,r);case 15:return L0(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Dr(n,i),Ja(e,t),t.tag=1,or(n)?(e=!0,wl(t)):e=!1,ri(t,r),C0(t,n,i),uh(t,n,i,r),fh(null,t,n,!0,e,r);case 19:return A0(e,t,r);case 22:return T0(e,t,r)}throw Error(ce(156,t.tag))};function q0(e,t){return S_(e,t)}function zb(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function wr(e,t,r,n){return new zb(e,t,r,n)}function sf(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ub(e){if(typeof e=="function")return sf(e)?1:0;if(e!=null){if(e=e.$$typeof,e===bd)return 11;if(e===Cd)return 14}return 2}function zn(e,t){var r=e.alternate;return r===null?(r=wr(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function el(e,t,r,n,i,a){var l=2;if(n=e,typeof e=="function")sf(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case Os:return gs(r.children,i,a,t);case xd:l=8,i|=8;break;case Iu:return e=wr(12,r,t,i|2),e.elementType=Iu,e.lanes=a,e;case Bu:return e=wr(13,r,t,i),e.elementType=Bu,e.lanes=a,e;case Ou:return e=wr(19,r,t,i),e.elementType=Ou,e.lanes=a,e;case s_:return uc(r,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case r_:l=10;break e;case n_:l=9;break e;case bd:l=11;break e;case Cd:l=14;break e;case Ln:l=16,n=null;break e}throw Error(ce(130,e==null?e:typeof e,""))}return t=wr(l,r,t,i),t.elementType=e,t.type=n,t.lanes=a,t}function gs(e,t,r,n){return e=wr(7,e,n,t),e.lanes=r,e}function uc(e,t,r,n){return e=wr(22,e,n,t),e.elementType=s_,e.lanes=r,e.stateNode={isHidden:!1},e}function Jc(e,t,r){return e=wr(6,e,null,t),e.lanes=r,e}function Qc(e,t,r){return t=wr(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Wb(e,t,r,n,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ac(0),this.expirationTimes=Ac(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ac(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function of(e,t,r,n,i,a,l,s,o){return e=new Wb(e,t,r,s,o),t===1?(t=1,a===!0&&(t|=8)):t=0,a=wr(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},zd(a),e}function Vb(e,t,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Bs,key:n==null?null:""+n,children:e,containerInfo:t,implementation:r}}function X0(e){if(!e)return Wn;e=e._reactInternals;e:{if(Es(e)!==e||e.tag!==1)throw Error(ce(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(or(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(ce(171))}if(e.tag===1){var r=e.type;if(or(r))return X_(e,r,t)}return t}function Y0(e,t,r,n,i,a,l,s,o){return e=of(r,n,!0,e,i,a,l,s,o),e.context=X0(null),r=e.current,n=er(),i=Hn(r),a=dn(n,i),a.callback=t??null,Fn(r,a,i),e.current.lanes=i,qo(e,i,n),ar(e,n),e}function hc(e,t,r,n){var i=t.current,a=er(),l=Hn(i);return r=X0(r),t.context===null?t.context=r:t.pendingContext=r,t=dn(a,l),t.payload={element:e},n=n===void 0?null:n,n!==null&&(t.callback=n),e=Fn(i,t,l),e!==null&&(Or(e,i,l,a),qa(e,i,l)),l}function Pl(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Mm(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function af(e,t){Mm(e,t),(e=e.alternate)&&Mm(e,t)}function Kb(){return null}var J0=typeof reportError=="function"?reportError:function(e){console.error(e)};function lf(e){this._internalRoot=e}dc.prototype.render=lf.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(ce(409));hc(e,t,null,null)};dc.prototype.unmount=lf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;bs(function(){hc(null,e,null,null)}),t[mn]=null}};function dc(e){this._internalRoot=e}dc.prototype.unstable_scheduleHydration=function(e){if(e){var t=T_();e={blockedOn:null,target:e,priority:t};for(var r=0;r<Dn.length&&t!==0&&t<Dn[r].priority;r++);Dn.splice(r,0,e),r===0&&D_(e)}};function cf(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function fc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Am(){}function Gb(e,t,r,n,i){if(i){if(typeof n=="function"){var a=n;n=function(){var c=Pl(l);a.call(c)}}var l=Y0(t,n,e,0,null,!1,!1,"",Am);return e._reactRootContainer=l,e[mn]=l.current,ko(e.nodeType===8?e.parentNode:e),bs(),l}for(;i=e.lastChild;)e.removeChild(i);if(typeof n=="function"){var s=n;n=function(){var c=Pl(o);s.call(c)}}var o=of(e,0,!1,null,null,!1,!1,"",Am);return e._reactRootContainer=o,e[mn]=o.current,ko(e.nodeType===8?e.parentNode:e),bs(function(){hc(t,o,r,n)}),o}function pc(e,t,r,n,i){var a=r._reactRootContainer;if(a){var l=a;if(typeof i=="function"){var s=i;i=function(){var o=Pl(l);s.call(o)}}hc(t,l,e,i)}else l=Gb(r,t,e,i,n);return Pl(l)}k_=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=Gi(t.pendingLanes);r!==0&&(Ld(t,r|1),ar(t,pt()),!(qe&6)&&(mi=pt()+500,Xn()))}break;case 13:bs(function(){var n=gn(e,1);if(n!==null){var i=er();Or(n,e,1,i)}}),af(e,1)}};Td=function(e){if(e.tag===13){var t=gn(e,134217728);if(t!==null){var r=er();Or(t,e,134217728,r)}af(e,134217728)}};L_=function(e){if(e.tag===13){var t=Hn(e),r=gn(e,t);if(r!==null){var n=er();Or(r,e,t,n)}af(e,t)}};T_=function(){return Je};R_=function(e,t){var r=Je;try{return Je=e,t()}finally{Je=r}};Ku=function(e,t,r){switch(t){case"input":if(Fu(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var n=r[t];if(n!==e&&n.form===e.form){var i=sc(n);if(!i)throw Error(ce(90));o_(n),Fu(n,i)}}}break;case"textarea":l_(e,r);break;case"select":t=r.value,t!=null&&Qs(e,!!r.multiple,t,!1)}};m_=tf;g_=bs;var qb={usingClientEntryPoint:!1,Events:[Yo,$s,sc,f_,p_,tf]},Fi={findFiberByHostInstance:ls,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Xb={bundleType:Fi.bundleType,version:Fi.version,rendererPackageName:Fi.rendererPackageName,rendererConfig:Fi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:yn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=y_(e),e===null?null:e.stateNode},findFiberByHostInstance:Fi.findFiberByHostInstance||Kb,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ea=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ea.isDisabled&&Ea.supportsFiber)try{ec=Ea.inject(Xb),Ur=Ea}catch{}}pr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=qb;pr.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!cf(t))throw Error(ce(200));return Vb(e,t,null,r)};pr.createRoot=function(e,t){if(!cf(e))throw Error(ce(299));var r=!1,n="",i=J0;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=of(e,1,!1,null,null,r,!1,n,i),e[mn]=t.current,ko(e.nodeType===8?e.parentNode:e),new lf(t)};pr.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(ce(188)):(e=Object.keys(e).join(","),Error(ce(268,e)));return e=y_(t),e=e===null?null:e.stateNode,e};pr.flushSync=function(e){return bs(e)};pr.hydrate=function(e,t,r){if(!fc(t))throw Error(ce(200));return pc(null,e,t,!0,r)};pr.hydrateRoot=function(e,t,r){if(!cf(e))throw Error(ce(405));var n=r!=null&&r.hydratedSources||null,i=!1,a="",l=J0;if(r!=null&&(r.unstable_strictMode===!0&&(i=!0),r.identifierPrefix!==void 0&&(a=r.identifierPrefix),r.onRecoverableError!==void 0&&(l=r.onRecoverableError)),t=Y0(t,null,e,1,r??null,i,!1,a,l),e[mn]=t.current,ko(e),n)for(e=0;e<n.length;e++)r=n[e],i=r._getVersion,i=i(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,i]:t.mutableSourceEagerHydrationData.push(r,i);return new dc(t)};pr.render=function(e,t,r){if(!fc(t))throw Error(ce(200));return pc(null,e,t,!1,r)};pr.unmountComponentAtNode=function(e){if(!fc(e))throw Error(ce(40));return e._reactRootContainer?(bs(function(){pc(null,null,e,!1,function(){e._reactRootContainer=null,e[mn]=null})}),!0):!1};pr.unstable_batchedUpdates=tf;pr.unstable_renderSubtreeIntoContainer=function(e,t,r,n){if(!fc(r))throw Error(ce(200));if(e==null||e._reactInternals===void 0)throw Error(ce(38));return pc(e,t,r,!1,n)};pr.version="18.3.1-next-f1338f8080-20240426";function Q0(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Q0)}catch(e){console.error(e)}}Q0(),Qv.exports=pr;var hn=Qv.exports,Z0,Pm=hn;Z0=Pm.createRoot,Pm.hydrateRoot;const Im=e=>{let t;const r=new Set,n=(c,p)=>{const u=typeof c=="function"?c(t):c;if(!Object.is(u,t)){const f=t;t=p??(typeof u!="object"||u===null)?u:Object.assign({},t,u),r.forEach(_=>_(t,f))}},i=()=>t,s={setState:n,getState:i,getInitialState:()=>o,subscribe:c=>(r.add(c),()=>r.delete(c))},o=t=e(n,i,s);return s},Yb=e=>e?Im(e):Im,Jb=e=>e;function Qb(e,t=Jb){const r=gt.useSyncExternalStore(e.subscribe,gt.useCallback(()=>t(e.getState()),[e,t]),gt.useCallback(()=>t(e.getInitialState()),[e,t]));return gt.useDebugValue(r),r}const Zb=e=>{const t=Yb(e),r=n=>Qb(t,n);return Object.assign(r,t),r},uf=e=>Zb;function mc(e,t){let r;try{r=e()}catch{return}return{getItem:i=>{var a;const l=o=>o===null?null:JSON.parse(o,void 0),s=(a=r.getItem(i))!=null?a:null;return s instanceof Promise?s.then(l):l(s)},setItem:(i,a)=>r.setItem(i,JSON.stringify(a,void 0)),removeItem:i=>r.removeItem(i)}}const Eh=e=>t=>{try{const r=e(t);return r instanceof Promise?r:{then(n){return Eh(n)(r)},catch(n){return this}}}catch(r){return{then(n){return this},catch(n){return Eh(n)(r)}}}},eC=(e,t)=>(r,n,i)=>{let a={storage:mc(()=>localStorage),partialize:v=>v,version:0,merge:(v,h)=>({...h,...v}),...t},l=!1;const s=new Set,o=new Set;let c=a.storage;if(!c)return e((...v)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),r(...v)},n,i);const p=()=>{const v=a.partialize({...n()});return c.setItem(a.name,{state:v,version:a.version})},u=i.setState;i.setState=(v,h)=>(u(v,h),p());const f=e((...v)=>(r(...v),p()),n,i);i.getInitialState=()=>f;let _;const y=()=>{var v,h;if(!c)return;l=!1,s.forEach(d=>{var g;return d((g=n())!=null?g:f)});const m=((h=a.onRehydrateStorage)==null?void 0:h.call(a,(v=n())!=null?v:f))||void 0;return Eh(c.getItem.bind(c))(a.name).then(d=>{if(d)if(typeof d.version=="number"&&d.version!==a.version){if(a.migrate){const g=a.migrate(d.state,d.version);return g instanceof Promise?g.then(w=>[!0,w]):[!0,g]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,d.state];return[!1,void 0]}).then(d=>{var g;const[w,b]=d;if(_=a.merge(b,(g=n())!=null?g:f),r(_,!0),w)return p()}).then(()=>{m==null||m(_,void 0),_=n(),l=!0,o.forEach(d=>d(_))}).catch(d=>{m==null||m(void 0,d)})};return i.persist={setOptions:v=>{a={...a,...v},v.storage&&(c=v.storage)},clearStorage:()=>{c==null||c.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>y(),hasHydrated:()=>l,onHydrate:v=>(s.add(v),()=>{s.delete(v)}),onFinishHydration:v=>(o.add(v),()=>{o.delete(v)})},a.skipHydration||y(),_||f},hf=eC;function tC(){const e=new Map;return{getItem:t=>e.get(t)??null,setItem:(t,r)=>{e.set(t,r)},removeItem:t=>{e.delete(t)}}}const Ps=tC(),df={getItem:e=>{if(typeof localStorage>"u")return Ps.getItem(e);try{return localStorage.getItem(e)}catch{return Ps.getItem(e)}},setItem:(e,t)=>{if(typeof localStorage>"u"){Ps.setItem(e,t);return}try{localStorage.setItem(e,t)}catch{Ps.setItem(e,t)}},removeItem:e=>{if(typeof localStorage>"u"){Ps.removeItem(e);return}try{localStorage.removeItem(e)}catch{Ps.removeItem(e)}}},kh="~/Documents/GitHub",rC="claude",si=50,nC=typeof navigator<"u"&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&!/iPhone|iPad|iPod/.test(navigator.userAgent),sC=!(nC&&(typeof devicePixelRatio<"u"?devicePixelRatio:1)>1),Lh=[{id:"jetbrains-mono",label:"JetBrains Mono",family:'"JetBrains Mono Variable", "JetBrains Mono", "SF Mono", "Fira Code", ui-monospace, monospace'},{id:"system",label:"System Default",family:'ui-monospace, "SF Mono", Menlo, Monaco, "Cascadia Code", "Consolas", monospace'},{id:"custom",label:"Custom",family:""}];function iC(e,t){if(e==="custom"&&t.trim())return t.trim();const r=Lh.find(n=>n.id===e);return(r==null?void 0:r.family)||Lh[0].family}const ka=[{id:"claude",label:"Claude",command:"claude",isBuiltIn:!0,agentType:"claude"},{id:"codex",label:"Codex",command:"codex",isBuiltIn:!0,agentType:"codex"},{id:"pi",label:"Pi",command:"pi",isBuiltIn:!0,agentType:"pi"}];function oC(e){if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.id=="string"&&t.id.length>=1&&t.id.length<=128&&typeof t.label=="string"&&t.label.trim().length>=1&&t.label.length<=64&&typeof t.command=="string"&&t.command.trim().length>=1&&t.command.length<=1024&&typeof t.isBuiltIn=="boolean"&&(t.agentType===void 0||t.agentType==="claude"||t.agentType==="codex"||t.agentType==="pi")}function Bm(e){return{...e,label:e.label.trim().slice(0,64),command:e.command.trim().slice(0,1024)}}function $i(e){return e.command.trim()}function Om(e){for(let r=0;r<100;r++){const n=`custom-${Date.now()}-${Math.random().toString(36).slice(2,6)}`;if(!e.has(n))return n}return`custom-${Date.now()}-${Math.random().toString(36).slice(2)}`}function Nm(e,t){var r;return e.some(n=>n.id===t)?t:((r=e[0])==null?void 0:r.id)||"claude"}const ey=180,ty=400,aC=240,pe=uf()(hf((e,t)=>({defaultProjectDir:kh,setDefaultProjectDir:r=>e({defaultProjectDir:r}),defaultCommand:rC,setDefaultCommand:r=>e({defaultCommand:r}),lastProjectPath:null,setLastProjectPath:r=>e({lastProjectPath:r}),recentPaths:[],addRecentPath:r=>e(n=>({recentPaths:[r,...n.recentPaths.filter(i=>i!==r)].slice(0,5)})),sessionSortMode:"created",setSessionSortMode:r=>e({sessionSortMode:r}),sessionSortDirection:"desc",setSessionSortDirection:r=>e({sessionSortDirection:r}),manualSessionOrder:[],setManualSessionOrder:r=>e({manualSessionOrder:r}),useWebGL:sC,setUseWebGL:r=>e({useWebGL:r}),fontSize:13,setFontSize:r=>e({fontSize:Math.max(6,Math.min(24,r))}),lineHeight:1,setLineHeight:r=>e({lineHeight:Math.max(1,Math.min(2,r))}),letterSpacing:0,setLetterSpacing:r=>e({letterSpacing:Math.max(-3,Math.min(3,r))}),fontOption:"jetbrains-mono",setFontOption:r=>e({fontOption:r}),customFontFamily:"",setCustomFontFamily:r=>e({customFontFamily:r.slice(0,256)}),shortcutModifier:"auto",setShortcutModifier:r=>e({shortcutModifier:r}),showProjectName:!0,setShowProjectName:r=>e({showProjectName:r}),showLastUserMessage:!0,setShowLastUserMessage:r=>e({showLastUserMessage:r}),showSessionIdPrefix:!1,setShowSessionIdPrefix:r=>e({showSessionIdPrefix:r}),inactiveSessionsExpanded:!1,setInactiveSessionsExpanded:r=>e({inactiveSessionsExpanded:r}),sidebarWidth:aC,setSidebarWidth:r=>e({sidebarWidth:Math.max(ey,Math.min(ty,r))}),projectFilters:[],setProjectFilters:r=>e({projectFilters:r}),hostFilters:[],setHostFilters:r=>e({hostFilters:r}),soundOnPermission:!1,setSoundOnPermission:r=>e({soundOnPermission:r}),soundOnIdle:!1,setSoundOnIdle:r=>e({soundOnIdle:r}),commandPresets:ka,setCommandPresets:r=>e({commandPresets:r}),defaultPresetId:"claude",setDefaultPresetId:r=>e({defaultPresetId:r}),updatePresetCommand:(r,n)=>{const{commandPresets:i}=t(),a=i.map(l=>l.id===r?{...l,command:n.trim().slice(0,1024)}:l);e({commandPresets:a})},addPreset:r=>{const{commandPresets:n}=t();if(n.length>=si){console.warn("[agentboard:settings] Max presets reached");return}const i=new Set(n.map(l=>l.id)),a={...Bm({...r,id:"",isBuiltIn:!1}),id:Om(i),isBuiltIn:!1};e({commandPresets:[...n,a]})},removePreset:r=>{const{commandPresets:n,defaultPresetId:i}=t(),a=n.find(o=>o.id===r);if(!a||a.isBuiltIn)return;const l=n.filter(o=>o.id!==r),s=r===i?Nm(l,i):i;e({commandPresets:l,defaultPresetId:s})}}),{name:"agentboard-settings",storage:mc(()=>df),version:4,partialize:e=>{const{manualSessionOrder:t,...r}=e;return r},migrate:(e,t)=>{const r=e,n=f=>{if(typeof f.command=="string")return f;const _=typeof f.baseCommand=="string"?f.baseCommand.trim():"",y=typeof f.modifiers=="string"?f.modifiers.trim():"",v=y?`${_} ${y}`:_;return{id:f.id,label:f.label,command:v||"claude",isBuiltIn:f.isBuiltIn,agentType:f.agentType}};if(t===0||!Array.isArray(r.commandPresets)){const f=typeof r.defaultCommand=="string"?r.defaultCommand:"claude",_=[...ka];let y="claude";if(f==="codex")y="codex";else if(f!=="claude"){const v=new Set(_.map(m=>m.id)),h={id:Om(v),label:"Migrated",command:f,isBuiltIn:!1};_.push(h),y=h.id}return console.info("[agentboard:settings] Migrated from v0 to v2"),{...r,commandPresets:_,defaultPresetId:y,defaultCommand:f,recentPaths:[]}}const l=r.commandPresets.map(n).filter(oC);if(!(l.some(f=>f.id==="claude")&&l.some(f=>f.id==="codex"))||l.length===0)return console.warn("[agentboard:settings] Invalid presets, resetting to defaults"),{...r,commandPresets:ka,defaultPresetId:"claude"};const o=l.length>si?[...l.filter(f=>f.isBuiltIn),...l.filter(f=>!f.isBuiltIn).slice(0,si-2)]:l,c=new Set(o.map(f=>f.id)),p=ka.filter(f=>f.isBuiltIn&&!c.has(f.id)),u=[...o,...p];return t<4&&console.info(`[agentboard:settings] Migrated from v${t} to v4 (ensured all built-in presets)`),{...r,commandPresets:u.map(Bm),defaultPresetId:Nm(o,r.defaultPresetId)}}}));function lC({title:e,titleId:t,...r},n){return k.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?k.createElement("title",{id:t},e):null,k.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v4m0 4h.01M10.615 3.892L2.39 18.098c-.456.788-.684 1.182-.65 1.506a1 1 0 00.406.705c.263.191.718.191 1.629.191h16.45c.91 0 1.365 0 1.628-.191a1 1 0 00.407-.705c.034-.324-.195-.718-.65-1.506L13.383 3.892c-.454-.785-.681-1.178-.978-1.31a1 1 0 00-.813 0c-.296.132-.523.525-.978 1.31z"}))}const cC=k.forwardRef(lC);function uC({title:e,titleId:t,...r},n){return k.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?k.createElement("title",{id:t},e):null,k.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 9l6 6 6-6"}))}const ff=k.forwardRef(uC);function hC({title:e,titleId:t,...r},n){return k.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?k.createElement("title",{id:t},e):null,k.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 18l6-6-6-6"}))}const dC=k.forwardRef(hC);function fC({title:e,titleId:t,...r},n){return k.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?k.createElement("title",{id:t},e):null,k.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15c-.932 0-1.398 0-1.765-.152a2 2 0 01-1.083-1.083C2 13.398 2 12.932 2 12V5.2c0-1.12 0-1.68.218-2.108a2 2 0 01.874-.874C3.52 2 4.08 2 5.2 2H12c.932 0 1.398 0 1.765.152a2 2 0 011.083 1.083C15 3.602 15 4.068 15 5m-2.8 17h6.6c1.12 0 1.68 0 2.108-.218a2 2 0 00.874-.874C22 20.48 22 19.92 22 18.8v-6.6c0-1.12 0-1.68-.218-2.108a2 2 0 00-.874-.874C20.48 9 19.92 9 18.8 9h-6.6c-1.12 0-1.68 0-2.108.218a2 2 0 00-.874.874C9 10.52 9 11.08 9 12.2v6.6c0 1.12 0 1.68.218 2.108a2 2 0 00.874.874C10.52 22 11.08 22 12.2 22z"}))}const ry=k.forwardRef(fC);function pC({title:e,titleId:t,...r},n){return k.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?k.createElement("title",{id:t},e):null,k.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20 4v1.4c0 3.36 0 5.04-.654 6.324a6 6 0 01-2.622 2.622C15.44 15 13.76 15 10.4 15H4m0 0l5-5m-5 5l5 5"}))}const mC=k.forwardRef(pC);function gC({title:e,titleId:t,...r},n){return k.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?k.createElement("title",{id:t},e):null,k.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 13a1 1 0 100-2 1 1 0 000 2zM12 6a1 1 0 100-2 1 1 0 000 2zM12 20a1 1 0 100-2 1 1 0 000 2z"}))}const vC=k.forwardRef(gC);function _C({title:e,titleId:t,...r},n){return k.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?k.createElement("title",{id:t},e):null,k.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11 4H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 00-1.311 1.311C2 6.28 2 7.12 2 8.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 001.311 1.311C4.28 22 5.12 22 6.8 22h8.4c1.68 0 2.52 0 3.162-.327a3 3 0 001.311-1.311C20 19.72 20 18.88 20 17.2V13M8 16h1.675c.489 0 .733 0 .963-.055.204-.05.4-.13.579-.24.201-.123.374-.296.72-.642L21.5 5.5a2.121 2.121 0 00-3-3l-9.563 9.563c-.346.346-.519.519-.642.72a2 2 0 00-.24.579c-.055.23-.055.474-.055.963V16z"}))}const ny=k.forwardRef(_C);function yC({title:e,titleId:t,...r},n){return k.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?k.createElement("title",{id:t},e):null,k.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14 2.27V6.4c0 .56 0 .84.109 1.054a1 1 0 00.437.437c.214.11.494.11 1.054.11h4.13M16 13H8m8 4H8m2-8H8m6-7H8.8c-1.68 0-2.52 0-3.162.327a3 3 0 00-1.311 1.311C4 4.28 4 5.12 4 6.8v10.4c0 1.68 0 2.52.327 3.162a3 3 0 001.311 1.311C6.28 22 7.12 22 8.8 22h6.4c1.68 0 2.52 0 3.162-.327a3 3 0 001.311-1.311C20 19.72 20 18.88 20 17.2V8l-6-6z"}))}const sy=k.forwardRef(yC);function wC({title:e,titleId:t,...r},n){return k.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?k.createElement("title",{id:t},e):null,k.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 7l-1.116-2.231c-.32-.642-.481-.963-.72-1.198a2 2 0 00-.748-.462C10.1 3 9.74 3 9.022 3H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 00-.874.874C2 4.52 2 5.08 2 6.2V7m0 0h15.2c1.68 0 2.52 0 3.162.327a3 3 0 011.311 1.311C22 9.28 22 10.12 22 11.8v4.4c0 1.68 0 2.52-.327 3.162a3 3 0 01-1.311 1.311C19.72 21 18.88 21 17.2 21H6.8c-1.68 0-2.52 0-3.162-.327a3 3 0 01-1.311-1.311C2 18.72 2 17.88 2 16.2V7z"}))}const SC=k.forwardRef(wC);function xC({title:e,titleId:t,...r},n){return k.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?k.createElement("title",{id:t},e):null,k.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.9 11.444v2.778m0-2.778V4.778c0-.92.761-1.667 1.7-1.667s1.7.746 1.7 1.667m-3.4 6.666c0-.92-.761-1.666-1.7-1.666s-1.7.746-1.7 1.666v2.223C3.5 18.269 7.306 22 12 22s8.5-3.731 8.5-8.333V8.11c0-.92-.761-1.667-1.7-1.667s-1.7.747-1.7 1.667m-6.8-3.333v6.11m0-6.11V3.667C10.3 2.747 11.061 2 12 2s1.7.746 1.7 1.667v1.11m0 0v6.112m0-6.111c0-.92.761-1.667 1.7-1.667s1.7.746 1.7 1.667V8.11m0 0v2.778"}))}const bC=k.forwardRef(xC);function CC({title:e,titleId:t,...r},n){return k.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?k.createElement("title",{id:t},e):null,k.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 12h18M3 6h18M3 18h18"}))}const EC=k.forwardRef(CC);function kC({title:e,titleId:t,...r},n){return k.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?k.createElement("title",{id:t},e):null,k.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 9l-3 3m0 0l3 3m-3-3h20M9 5l3-3m0 0l3 3m-3-3v20m3-3l-3 3m0 0l-3-3M19 9l3 3m0 0l-3 3"}))}const LC=k.forwardRef(kC);function TC({title:e,titleId:t,...r},n){return k.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?k.createElement("title",{id:t},e):null,k.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.377 15.616L2.72 21.273m8.974-14.631l-1.56 1.56a2.1 2.1 0 01-.264.242 1 1 0 01-.207.111c-.082.032-.17.05-.347.085l-3.665.733c-.952.19-1.428.286-1.65.537a1 1 0 00-.243.8c.046.333.39.677 1.076 1.363l7.086 7.086c.686.687 1.03 1.03 1.362 1.076a1 1 0 00.801-.242c.251-.223.346-.7.537-1.651l.733-3.665c.035-.176.053-.265.085-.347a.997.997 0 01.11-.207c.051-.072.115-.136.242-.263l1.561-1.561c.082-.082.122-.122.167-.158.04-.031.082-.06.126-.085.05-.029.103-.051.208-.097l2.495-1.069c.727-.312 1.091-.467 1.256-.72a1 1 0 00.144-.747c-.06-.295-.34-.575-.9-1.135l-5.142-5.143c-.56-.56-.84-.84-1.135-.9a1 1 0 00-.748.145c-.252.165-.407.529-.72 1.256l-1.068 2.495a2.096 2.096 0 01-.097.208.998.998 0 01-.085.126 2.065 2.065 0 01-.158.167z"}))}const Il=k.forwardRef(TC);function RC({title:e,titleId:t,...r},n){return k.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?k.createElement("title",{id:t},e):null,k.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 5v14m-7-7h14"}))}const iy=k.forwardRef(RC);function DC({title:e,titleId:t,...r},n){return k.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?k.createElement("title",{id:t},e):null,k.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 15a3 3 0 100-6 3 3 0 000 6z"}),k.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18.727 14.727a1.5 1.5 0 00.3 1.655l.055.054a1.816 1.816 0 010 2.573 1.818 1.818 0 01-2.573 0l-.055-.055a1.5 1.5 0 00-1.654-.3 1.5 1.5 0 00-.91 1.373v.155a1.818 1.818 0 11-3.636 0V20.1a1.5 1.5 0 00-.981-1.373 1.5 1.5 0 00-1.655.3l-.054.055a1.818 1.818 0 01-3.106-1.287 1.818 1.818 0 01.533-1.286l.054-.055a1.5 1.5 0 00.3-1.654 1.5 1.5 0 00-1.372-.91h-.155a1.818 1.818 0 110-3.636H3.9a1.5 1.5 0 001.373-.981 1.5 1.5 0 00-.3-1.655l-.055-.054A1.818 1.818 0 117.491 4.99l.054.054a1.5 1.5 0 001.655.3h.073a1.5 1.5 0 00.909-1.372v-.155a1.818 1.818 0 013.636 0V3.9a1.499 1.499 0 00.91 1.373 1.5 1.5 0 001.654-.3l.054-.055a1.817 1.817 0 012.573 0 1.819 1.819 0 010 2.573l-.055.054a1.5 1.5 0 00-.3 1.655v.073a1.5 1.5 0 001.373.909h.155a1.818 1.818 0 010 3.636H20.1a1.499 1.499 0 00-1.373.91z"}))}const MC=k.forwardRef(DC);function AC({title:e,titleId:t,...r},n){return k.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?k.createElement("title",{id:t},e):null,k.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 15a3 3 0 100-6 3 3 0 000 6z"}),k.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.29 19.371l.584 1.315a2.213 2.213 0 004.044 0l.585-1.315a2.426 2.426 0 012.47-1.423l1.43.152a2.212 2.212 0 002.022-3.502l-.847-1.164a2.428 2.428 0 01-.46-1.434c0-.513.163-1.014.465-1.429l.847-1.163a2.212 2.212 0 00-2.023-3.502l-1.43.152a2.433 2.433 0 01-1.47-.312 2.425 2.425 0 01-1-1.117l-.588-1.315a2.212 2.212 0 00-4.045 0L9.29 4.63c-.207.468-.558.86-1 1.117-.445.256-.96.365-1.47.312l-1.435-.152a2.212 2.212 0 00-2.022 3.502l.847 1.163a2.43 2.43 0 010 2.858l-.847 1.163a2.21 2.21 0 00.786 3.273c.381.195.81.274 1.236.23l1.43-.153a2.434 2.434 0 012.475 1.43z"}))}const PC=k.forwardRef(AC);function IC({title:e,titleId:t,...r},n){return k.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?k.createElement("title",{id:t},e):null,k.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 17l6-6-6-6m8 14h8"}))}const BC=k.forwardRef(IC);function OC({title:e,titleId:t,...r},n){return k.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?k.createElement("title",{id:t},e):null,k.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18 6L6 18M6 6l12 12"}))}const Th=k.forwardRef(OC);function Qo(){if(typeof navigator>"u")return!1;const e=navigator.userAgent,t=/iPad|iPhone|iPod/.test(e),r=navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1;return t||r}function NC(){return typeof navigator>"u"?!1:Qo()&&navigator.standalone===!0}function jC(){return typeof navigator>"u"?!1:navigator.platform.toUpperCase().indexOf("MAC")>=0}function Zo(e){return e==="auto"?jC()?"ctrl-option":"ctrl-shift":e}const FC={"ctrl-option":"⌃⌥","ctrl-shift":"⌃⇧","cmd-option":"⌘⌥","cmd-shift":"⌘⇧"};function ii(e){return FC[e]}function $C(e,t){switch(t){case"ctrl-option":return e.ctrlKey&&e.altKey&&!e.metaKey&&!e.shiftKey;case"ctrl-shift":return e.ctrlKey&&e.shiftKey&&!e.metaKey&&!e.altKey;case"cmd-option":return e.metaKey&&e.altKey&&!e.ctrlKey&&!e.shiftKey;case"cmd-shift":return e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey}}const HC={connected:"bg-working",connecting:"bg-approval",reconnecting:"bg-approval",disconnected:"bg-danger"};function zC({connectionStatus:e,onNewSession:t,onOpenSettings:r,tailscaleIp:n}){const[i,a]=k.useState(!1),l=pe(c=>c.shortcutModifier),s=ii(Zo(l)),o=()=>{if(!n)return;const c=`http://${n}:${window.location.port||"4040"}`;navigator.clipboard.writeText(c),a(!0),setTimeout(()=>a(!1),1500)};return T.jsxs("header",{className:"flex h-10 shrink-0 items-center justify-between border-b border-border bg-elevated px-3",children:[T.jsxs("div",{className:"flex items-center gap-2",children:[T.jsx("h1",{className:"text-sm font-semibold tracking-tight text-primary text-balance",children:"AGENTBOARD"}),T.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted",children:[T.jsx("span",{className:`h-2 w-2 rounded-full ${HC[e]}`}),n&&T.jsxs("button",{onClick:o,className:"ml-3 inline-flex items-center gap-1 text-muted/70 hover:text-muted transition-colors cursor-pointer",title:"Tailscale IP - click to copy remote access URL",children:[T.jsx("span",{className:"leading-none translate-y-[1px]",children:i?"Copied!":n}),!i&&T.jsx(ry,{width:12,height:12,className:"shrink-0"})]})]})]}),T.jsxs("div",{className:"flex items-center gap-1.5",children:[T.jsx("button",{onClick:t,className:"flex h-7 w-7 items-center justify-center rounded bg-accent text-white hover:bg-accent/90 active:scale-95 transition-all",title:`New session (${s}N)`,"aria-label":"New session",children:T.jsx(iy,{width:16,height:16})}),T.jsx("button",{onClick:r,className:"flex h-7 w-7 items-center justify-center rounded border border-border text-secondary hover:bg-hover hover:text-primary active:scale-95 transition-all",title:"Settings","aria-label":"Settings",children:T.jsx(PC,{width:14,height:14})})]})]})}const pf=k.createContext({});function mf(e){const t=k.useRef(null);return t.current===null&&(t.current=e()),t.current}const gf=typeof window<"u",oy=gf?k.useLayoutEffect:k.useEffect,gc=k.createContext(null);function vf(e,t){e.indexOf(t)===-1&&e.push(t)}function _f(e,t){const r=e.indexOf(t);r>-1&&e.splice(r,1)}const Kr=(e,t,r)=>r>t?t:r<e?e:r;let yf=()=>{};const _n={},ay=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function ly(e){return typeof e=="object"&&e!==null}const cy=e=>/^0[^.\s]+$/u.test(e);function wf(e){let t;return()=>(t===void 0&&(t=e()),t)}const br=e=>e,UC=(e,t)=>r=>t(e(r)),ea=(...e)=>e.reduce(UC),Bo=(e,t,r)=>{const n=t-e;return n===0?1:(r-e)/n};class Sf{constructor(){this.subscriptions=[]}add(t){return vf(this.subscriptions,t),()=>_f(this.subscriptions,t)}notify(t,r,n){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,r,n);else for(let a=0;a<i;a++){const l=this.subscriptions[a];l&&l(t,r,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const fn=e=>e*1e3,Sr=e=>e/1e3;function uy(e,t){return t?e*(1e3/t):0}const hy=(e,t,r)=>(((1-3*r+3*t)*e+(3*r-6*t))*e+3*t)*e,WC=1e-7,VC=12;function KC(e,t,r,n,i){let a,l,s=0;do l=t+(r-t)/2,a=hy(l,n,i)-e,a>0?r=l:t=l;while(Math.abs(a)>WC&&++s<VC);return l}function ta(e,t,r,n){if(e===t&&r===n)return br;const i=a=>KC(a,0,1,e,r);return a=>a===0||a===1?a:hy(i(a),t,n)}const dy=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,fy=e=>t=>1-e(1-t),py=ta(.33,1.53,.69,.99),xf=fy(py),my=dy(xf),gy=e=>(e*=2)<1?.5*xf(e):.5*(2-Math.pow(2,-10*(e-1))),bf=e=>1-Math.sin(Math.acos(e)),vy=fy(bf),_y=dy(bf),GC=ta(.42,0,1,1),qC=ta(0,0,.58,1),yy=ta(.42,0,.58,1),XC=e=>Array.isArray(e)&&typeof e[0]!="number",wy=e=>Array.isArray(e)&&typeof e[0]=="number",YC={linear:br,easeIn:GC,easeInOut:yy,easeOut:qC,circIn:bf,circInOut:_y,circOut:vy,backIn:xf,backInOut:my,backOut:py,anticipate:gy},JC=e=>typeof e=="string",jm=e=>{if(wy(e)){yf(e.length===4);const[t,r,n,i]=e;return ta(t,r,n,i)}else if(JC(e))return YC[e];return e},La=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function QC(e,t){let r=new Set,n=new Set,i=!1,a=!1;const l=new WeakSet;let s={delta:0,timestamp:0,isProcessing:!1};function o(p){l.has(p)&&(c.schedule(p),e()),p(s)}const c={schedule:(p,u=!1,f=!1)=>{const y=f&&i?r:n;return u&&l.add(p),y.has(p)||y.add(p),p},cancel:p=>{n.delete(p),l.delete(p)},process:p=>{if(s=p,i){a=!0;return}i=!0,[r,n]=[n,r],r.forEach(o),r.clear(),i=!1,a&&(a=!1,c.process(p))}};return c}const ZC=40;function Sy(e,t){let r=!1,n=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>r=!0,l=La.reduce((g,w)=>(g[w]=QC(a),g),{}),{setup:s,read:o,resolveKeyframes:c,preUpdate:p,update:u,preRender:f,render:_,postRender:y}=l,v=()=>{const g=_n.useManualTiming?i.timestamp:performance.now();r=!1,_n.useManualTiming||(i.delta=n?1e3/60:Math.max(Math.min(g-i.timestamp,ZC),1)),i.timestamp=g,i.isProcessing=!0,s.process(i),o.process(i),c.process(i),p.process(i),u.process(i),f.process(i),_.process(i),y.process(i),i.isProcessing=!1,r&&t&&(n=!1,e(v))},h=()=>{r=!0,n=!0,i.isProcessing||e(v)};return{schedule:La.reduce((g,w)=>{const b=l[w];return g[w]=(x,C=!1,S=!1)=>(r||h(),b.schedule(x,C,S)),g},{}),cancel:g=>{for(let w=0;w<La.length;w++)l[La[w]].cancel(g)},state:i,steps:l}}const{schedule:st,cancel:Vn,state:Nt,steps:Zc}=Sy(typeof requestAnimationFrame<"u"?requestAnimationFrame:br,!0);let tl;function e2(){tl=void 0}const Qt={now:()=>(tl===void 0&&Qt.set(Nt.isProcessing||_n.useManualTiming?Nt.timestamp:performance.now()),tl),set:e=>{tl=e,queueMicrotask(e2)}},xy=e=>t=>typeof t=="string"&&t.startsWith(e),by=xy("--"),t2=xy("var(--"),Cf=e=>t2(e)?r2.test(e.split("/*")[0].trim()):!1,r2=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Fm(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const bi={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Oo={...bi,transform:e=>Kr(0,1,e)},Ta={...bi,default:1},lo=e=>Math.round(e*1e5)/1e5,Ef=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function n2(e){return e==null}const s2=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,kf=(e,t)=>r=>!!(typeof r=="string"&&s2.test(r)&&r.startsWith(e)||t&&!n2(r)&&Object.prototype.hasOwnProperty.call(r,t)),Cy=(e,t,r)=>n=>{if(typeof n!="string")return n;const[i,a,l,s]=n.match(Ef);return{[e]:parseFloat(i),[t]:parseFloat(a),[r]:parseFloat(l),alpha:s!==void 0?parseFloat(s):1}},i2=e=>Kr(0,255,e),eu={...bi,transform:e=>Math.round(i2(e))},hs={test:kf("rgb","red"),parse:Cy("red","green","blue"),transform:({red:e,green:t,blue:r,alpha:n=1})=>"rgba("+eu.transform(e)+", "+eu.transform(t)+", "+eu.transform(r)+", "+lo(Oo.transform(n))+")"};function o2(e){let t="",r="",n="",i="";return e.length>5?(t=e.substring(1,3),r=e.substring(3,5),n=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),r=e.substring(2,3),n=e.substring(3,4),i=e.substring(4,5),t+=t,r+=r,n+=n,i+=i),{red:parseInt(t,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}}const Rh={test:kf("#"),parse:o2,transform:hs.transform},ra=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),kn=ra("deg"),Vr=ra("%"),we=ra("px"),a2=ra("vh"),l2=ra("vw"),$m={...Vr,parse:e=>Vr.parse(e)/100,transform:e=>Vr.transform(e*100)},Gs={test:kf("hsl","hue"),parse:Cy("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:r,alpha:n=1})=>"hsla("+Math.round(e)+", "+Vr.transform(lo(t))+", "+Vr.transform(lo(r))+", "+lo(Oo.transform(n))+")"},mt={test:e=>hs.test(e)||Rh.test(e)||Gs.test(e),parse:e=>hs.test(e)?hs.parse(e):Gs.test(e)?Gs.parse(e):Rh.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?hs.transform(e):Gs.transform(e),getAnimatableNone:e=>{const t=mt.parse(e);return t.alpha=0,mt.transform(t)}},c2=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function u2(e){var t,r;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Ef))==null?void 0:t.length)||0)+(((r=e.match(c2))==null?void 0:r.length)||0)>0}const Ey="number",ky="color",h2="var",d2="var(",Hm="${}",f2=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function No(e){const t=e.toString(),r=[],n={color:[],number:[],var:[]},i=[];let a=0;const s=t.replace(f2,o=>(mt.test(o)?(n.color.push(a),i.push(ky),r.push(mt.parse(o))):o.startsWith(d2)?(n.var.push(a),i.push(h2),r.push(o)):(n.number.push(a),i.push(Ey),r.push(parseFloat(o))),++a,Hm)).split(Hm);return{values:r,split:s,indexes:n,types:i}}function Ly(e){return No(e).values}function Ty(e){const{split:t,types:r}=No(e),n=t.length;return i=>{let a="";for(let l=0;l<n;l++)if(a+=t[l],i[l]!==void 0){const s=r[l];s===Ey?a+=lo(i[l]):s===ky?a+=mt.transform(i[l]):a+=i[l]}return a}}const p2=e=>typeof e=="number"?0:mt.test(e)?mt.getAnimatableNone(e):e;function m2(e){const t=Ly(e);return Ty(e)(t.map(p2))}const Kn={test:u2,parse:Ly,createTransformer:Ty,getAnimatableNone:m2};function tu(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function g2({hue:e,saturation:t,lightness:r,alpha:n}){e/=360,t/=100,r/=100;let i=0,a=0,l=0;if(!t)i=a=l=r;else{const s=r<.5?r*(1+t):r+t-r*t,o=2*r-s;i=tu(o,s,e+1/3),a=tu(o,s,e),l=tu(o,s,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(l*255),alpha:n}}function Bl(e,t){return r=>r>0?t:e}const lt=(e,t,r)=>e+(t-e)*r,ru=(e,t,r)=>{const n=e*e,i=r*(t*t-n)+n;return i<0?0:Math.sqrt(i)},v2=[Rh,hs,Gs],_2=e=>v2.find(t=>t.test(e));function zm(e){const t=_2(e);if(!t)return!1;let r=t.parse(e);return t===Gs&&(r=g2(r)),r}const Um=(e,t)=>{const r=zm(e),n=zm(t);if(!r||!n)return Bl(e,t);const i={...r};return a=>(i.red=ru(r.red,n.red,a),i.green=ru(r.green,n.green,a),i.blue=ru(r.blue,n.blue,a),i.alpha=lt(r.alpha,n.alpha,a),hs.transform(i))},Dh=new Set(["none","hidden"]);function y2(e,t){return Dh.has(e)?r=>r<=0?e:t:r=>r>=1?t:e}function w2(e,t){return r=>lt(e,t,r)}function Lf(e){return typeof e=="number"?w2:typeof e=="string"?Cf(e)?Bl:mt.test(e)?Um:b2:Array.isArray(e)?Ry:typeof e=="object"?mt.test(e)?Um:S2:Bl}function Ry(e,t){const r=[...e],n=r.length,i=e.map((a,l)=>Lf(a)(a,t[l]));return a=>{for(let l=0;l<n;l++)r[l]=i[l](a);return r}}function S2(e,t){const r={...e,...t},n={};for(const i in r)e[i]!==void 0&&t[i]!==void 0&&(n[i]=Lf(e[i])(e[i],t[i]));return i=>{for(const a in n)r[a]=n[a](i);return r}}function x2(e,t){const r=[],n={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){const a=t.types[i],l=e.indexes[a][n[a]],s=e.values[l]??0;r[i]=s,n[a]++}return r}const b2=(e,t)=>{const r=Kn.createTransformer(t),n=No(e),i=No(t);return n.indexes.var.length===i.indexes.var.length&&n.indexes.color.length===i.indexes.color.length&&n.indexes.number.length>=i.indexes.number.length?Dh.has(e)&&!i.values.length||Dh.has(t)&&!n.values.length?y2(e,t):ea(Ry(x2(n,i),i.values),r):Bl(e,t)};function Dy(e,t,r){return typeof e=="number"&&typeof t=="number"&&typeof r=="number"?lt(e,t,r):Lf(e)(e,t)}const C2=e=>{const t=({timestamp:r})=>e(r);return{start:(r=!0)=>st.update(t,r),stop:()=>Vn(t),now:()=>Nt.isProcessing?Nt.timestamp:Qt.now()}},My=(e,t,r=10)=>{let n="";const i=Math.max(Math.round(t/r),2);for(let a=0;a<i;a++)n+=Math.round(e(a/(i-1))*1e4)/1e4+", ";return`linear(${n.substring(0,n.length-2)})`},Ol=2e4;function Tf(e){let t=0;const r=50;let n=e.next(t);for(;!n.done&&t<Ol;)t+=r,n=e.next(t);return t>=Ol?1/0:t}function E2(e,t=100,r){const n=r({...e,keyframes:[0,t]}),i=Math.min(Tf(n),Ol);return{type:"keyframes",ease:a=>n.next(i*a).value/t,duration:Sr(i)}}const k2=5;function Ay(e,t,r){const n=Math.max(t-k2,0);return uy(r-e(n),t-n)}const ht={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},nu=.001;function L2({duration:e=ht.duration,bounce:t=ht.bounce,velocity:r=ht.velocity,mass:n=ht.mass}){let i,a,l=1-t;l=Kr(ht.minDamping,ht.maxDamping,l),e=Kr(ht.minDuration,ht.maxDuration,Sr(e)),l<1?(i=c=>{const p=c*l,u=p*e,f=p-r,_=Mh(c,l),y=Math.exp(-u);return nu-f/_*y},a=c=>{const u=c*l*e,f=u*r+r,_=Math.pow(l,2)*Math.pow(c,2)*e,y=Math.exp(-u),v=Mh(Math.pow(c,2),l);return(-i(c)+nu>0?-1:1)*((f-_)*y)/v}):(i=c=>{const p=Math.exp(-c*e),u=(c-r)*e+1;return-nu+p*u},a=c=>{const p=Math.exp(-c*e),u=(r-c)*(e*e);return p*u});const s=5/e,o=R2(i,a,s);if(e=fn(e),isNaN(o))return{stiffness:ht.stiffness,damping:ht.damping,duration:e};{const c=Math.pow(o,2)*n;return{stiffness:c,damping:l*2*Math.sqrt(n*c),duration:e}}}const T2=12;function R2(e,t,r){let n=r;for(let i=1;i<T2;i++)n=n-e(n)/t(n);return n}function Mh(e,t){return e*Math.sqrt(1-t*t)}const D2=["duration","bounce"],M2=["stiffness","damping","mass"];function Wm(e,t){return t.some(r=>e[r]!==void 0)}function A2(e){let t={velocity:ht.velocity,stiffness:ht.stiffness,damping:ht.damping,mass:ht.mass,isResolvedFromDuration:!1,...e};if(!Wm(e,M2)&&Wm(e,D2))if(e.visualDuration){const r=e.visualDuration,n=2*Math.PI/(r*1.2),i=n*n,a=2*Kr(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:ht.mass,stiffness:i,damping:a}}else{const r=L2(e);t={...t,...r,mass:ht.mass},t.isResolvedFromDuration=!0}return t}function Nl(e=ht.visualDuration,t=ht.bounce){const r=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:n,restDelta:i}=r;const a=r.keyframes[0],l=r.keyframes[r.keyframes.length-1],s={done:!1,value:a},{stiffness:o,damping:c,mass:p,duration:u,velocity:f,isResolvedFromDuration:_}=A2({...r,velocity:-Sr(r.velocity||0)}),y=f||0,v=c/(2*Math.sqrt(o*p)),h=l-a,m=Sr(Math.sqrt(o/p)),d=Math.abs(h)<5;n||(n=d?ht.restSpeed.granular:ht.restSpeed.default),i||(i=d?ht.restDelta.granular:ht.restDelta.default);let g;if(v<1){const b=Mh(m,v);g=x=>{const C=Math.exp(-v*m*x);return l-C*((y+v*m*h)/b*Math.sin(b*x)+h*Math.cos(b*x))}}else if(v===1)g=b=>l-Math.exp(-m*b)*(h+(y+m*h)*b);else{const b=m*Math.sqrt(v*v-1);g=x=>{const C=Math.exp(-v*m*x),S=Math.min(b*x,300);return l-C*((y+v*m*h)*Math.sinh(S)+b*h*Math.cosh(S))/b}}const w={calculatedDuration:_&&u||null,next:b=>{const x=g(b);if(_)s.done=b>=u;else{let C=b===0?y:0;v<1&&(C=b===0?fn(y):Ay(g,b,x));const S=Math.abs(C)<=n,E=Math.abs(l-x)<=i;s.done=S&&E}return s.value=s.done?l:x,s},toString:()=>{const b=Math.min(Tf(w),Ol),x=My(C=>w.next(b*C).value,b,30);return b+"ms "+x},toTransition:()=>{}};return w}Nl.applyToOptions=e=>{const t=E2(e,100,Nl);return e.ease=t.ease,e.duration=fn(t.duration),e.type="keyframes",e};function Ah({keyframes:e,velocity:t=0,power:r=.8,timeConstant:n=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:l,min:s,max:o,restDelta:c=.5,restSpeed:p}){const u=e[0],f={done:!1,value:u},_=S=>s!==void 0&&S<s||o!==void 0&&S>o,y=S=>s===void 0?o:o===void 0||Math.abs(s-S)<Math.abs(o-S)?s:o;let v=r*t;const h=u+v,m=l===void 0?h:l(h);m!==h&&(v=m-u);const d=S=>-v*Math.exp(-S/n),g=S=>m+d(S),w=S=>{const E=d(S),L=g(S);f.done=Math.abs(E)<=c,f.value=f.done?m:L};let b,x;const C=S=>{_(f.value)&&(b=S,x=Nl({keyframes:[f.value,y(f.value)],velocity:Ay(g,S,f.value),damping:i,stiffness:a,restDelta:c,restSpeed:p}))};return C(0),{calculatedDuration:null,next:S=>{let E=!1;return!x&&b===void 0&&(E=!0,w(S),C(S)),b!==void 0&&S>=b?x.next(S-b):(!E&&w(S),f)}}}function P2(e,t,r){const n=[],i=r||_n.mix||Dy,a=e.length-1;for(let l=0;l<a;l++){let s=i(e[l],e[l+1]);if(t){const o=Array.isArray(t)?t[l]||br:t;s=ea(o,s)}n.push(s)}return n}function I2(e,t,{clamp:r=!0,ease:n,mixer:i}={}){const a=e.length;if(yf(a===t.length),a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];const l=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());const s=P2(t,n,i),o=s.length,c=p=>{if(l&&p<e[0])return t[0];let u=0;if(o>1)for(;u<e.length-2&&!(p<e[u+1]);u++);const f=Bo(e[u],e[u+1],p);return s[u](f)};return r?p=>c(Kr(e[0],e[a-1],p)):c}function B2(e,t){const r=e[e.length-1];for(let n=1;n<=t;n++){const i=Bo(0,t,n);e.push(lt(r,1,i))}}function O2(e){const t=[0];return B2(t,e.length-1),t}function N2(e,t){return e.map(r=>r*t)}function j2(e,t){return e.map(()=>t||yy).splice(0,e.length-1)}function co({duration:e=300,keyframes:t,times:r,ease:n="easeInOut"}){const i=XC(n)?n.map(jm):jm(n),a={done:!1,value:t[0]},l=N2(r&&r.length===t.length?r:O2(t),e),s=I2(l,t,{ease:Array.isArray(i)?i:j2(t,i)});return{calculatedDuration:e,next:o=>(a.value=s(o),a.done=o>=e,a)}}const F2=e=>e!==null;function Rf(e,{repeat:t,repeatType:r="loop"},n,i=1){const a=e.filter(F2),s=i<0||t&&r!=="loop"&&t%2===1?0:a.length-1;return!s||n===void 0?a[s]:n}const $2={decay:Ah,inertia:Ah,tween:co,keyframes:co,spring:Nl};function Py(e){typeof e.type=="string"&&(e.type=$2[e.type])}class Df{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,r){return this.finished.then(t,r)}}const H2=e=>e/100;class Mf extends Df{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var n,i;const{motionValue:r}=this.options;r&&r.updatedAt!==Qt.now()&&this.tick(Qt.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(i=(n=this.options).onStop)==null||i.call(n))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;Py(t);const{type:r=co,repeat:n=0,repeatDelay:i=0,repeatType:a,velocity:l=0}=t;let{keyframes:s}=t;const o=r||co;o!==co&&typeof s[0]!="number"&&(this.mixKeyframes=ea(H2,Dy(s[0],s[1])),s=[0,100]);const c=o({...t,keyframes:s});a==="mirror"&&(this.mirroredGenerator=o({...t,keyframes:[...s].reverse(),velocity:-l})),c.calculatedDuration===null&&(c.calculatedDuration=Tf(c));const{calculatedDuration:p}=c;this.calculatedDuration=p,this.resolvedDuration=p+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=c}updateTime(t){const r=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=r}tick(t,r=!1){const{generator:n,totalDuration:i,mixKeyframes:a,mirroredGenerator:l,resolvedDuration:s,calculatedDuration:o}=this;if(this.startTime===null)return n.next(0);const{delay:c=0,keyframes:p,repeat:u,repeatType:f,repeatDelay:_,type:y,onUpdate:v,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),r?this.currentTime=t:this.updateTime(t);const m=this.currentTime-c*(this.playbackSpeed>=0?1:-1),d=this.playbackSpeed>=0?m<0:m>i;this.currentTime=Math.max(m,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let g=this.currentTime,w=n;if(u){const S=Math.min(this.currentTime,i)/s;let E=Math.floor(S),L=S%1;!L&&S>=1&&(L=1),L===1&&E--,E=Math.min(E,u+1),!!(E%2)&&(f==="reverse"?(L=1-L,_&&(L-=_/s)):f==="mirror"&&(w=l)),g=Kr(0,1,L)*s}const b=d?{done:!1,value:p[0]}:w.next(g);a&&(b.value=a(b.value));let{done:x}=b;!d&&o!==null&&(x=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const C=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&x);return C&&y!==Ah&&(b.value=Rf(p,this.options,h,this.speed)),v&&v(b.value),C&&this.finish(),b}then(t,r){return this.finished.then(t,r)}get duration(){return Sr(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Sr(t)}get time(){return Sr(this.currentTime)}set time(t){var r;t=fn(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),(r=this.driver)==null||r.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(Qt.now());const r=this.playbackSpeed!==t;this.playbackSpeed=t,r&&(this.time=Sr(this.currentTime))}play(){var i,a;if(this.isStopped)return;const{driver:t=C2,startTime:r}=this.options;this.driver||(this.driver=t(l=>this.tick(l))),(a=(i=this.options).onPlay)==null||a.call(i);const n=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=n):this.holdTime!==null?this.startTime=n-this.holdTime:this.startTime||(this.startTime=r??n),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Qt.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,r;this.notifyFinished(),this.teardown(),this.state="finished",(r=(t=this.options).onComplete)==null||r.call(t)}cancel(){var t,r;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(r=(t=this.options).onCancel)==null||r.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var r;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(r=this.driver)==null||r.stop(),t.observe(this)}}function z2(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const ds=e=>e*180/Math.PI,Ph=e=>{const t=ds(Math.atan2(e[1],e[0]));return Ih(t)},U2={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Ph,rotateZ:Ph,skewX:e=>ds(Math.atan(e[1])),skewY:e=>ds(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Ih=e=>(e=e%360,e<0&&(e+=360),e),Vm=Ph,Km=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Gm=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),W2={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Km,scaleY:Gm,scale:e=>(Km(e)+Gm(e))/2,rotateX:e=>Ih(ds(Math.atan2(e[6],e[5]))),rotateY:e=>Ih(ds(Math.atan2(-e[2],e[0]))),rotateZ:Vm,rotate:Vm,skewX:e=>ds(Math.atan(e[4])),skewY:e=>ds(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Bh(e){return e.includes("scale")?1:0}function Oh(e,t){if(!e||e==="none")return Bh(t);const r=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let n,i;if(r)n=W2,i=r;else{const s=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=U2,i=s}if(!i)return Bh(t);const a=n[t],l=i[1].split(",").map(K2);return typeof a=="function"?a(l):l[a]}const V2=(e,t)=>{const{transform:r="none"}=getComputedStyle(e);return Oh(r,t)};function K2(e){return parseFloat(e.trim())}const Ci=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ei=new Set(Ci),qm=e=>e===bi||e===we,G2=new Set(["x","y","z"]),q2=Ci.filter(e=>!G2.has(e));function X2(e){const t=[];return q2.forEach(r=>{const n=e.getValue(r);n!==void 0&&(t.push([r,n.get()]),n.set(r.startsWith("scale")?1:0))}),t}const In={width:({x:e},{paddingLeft:t="0",paddingRight:r="0"})=>e.max-e.min-parseFloat(t)-parseFloat(r),height:({y:e},{paddingTop:t="0",paddingBottom:r="0"})=>e.max-e.min-parseFloat(t)-parseFloat(r),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Oh(t,"x"),y:(e,{transform:t})=>Oh(t,"y")};In.translateX=In.x;In.translateY=In.y;const vs=new Set;let Nh=!1,jh=!1,Fh=!1;function Iy(){if(jh){const e=Array.from(vs).filter(n=>n.needsMeasurement),t=new Set(e.map(n=>n.element)),r=new Map;t.forEach(n=>{const i=X2(n);i.length&&(r.set(n,i),n.render())}),e.forEach(n=>n.measureInitialState()),t.forEach(n=>{n.render();const i=r.get(n);i&&i.forEach(([a,l])=>{var s;(s=n.getValue(a))==null||s.set(l)})}),e.forEach(n=>n.measureEndState()),e.forEach(n=>{n.suspendedScrollY!==void 0&&window.scrollTo(0,n.suspendedScrollY)})}jh=!1,Nh=!1,vs.forEach(e=>e.complete(Fh)),vs.clear()}function By(){vs.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(jh=!0)})}function Y2(){Fh=!0,By(),Iy(),Fh=!1}class Af{constructor(t,r,n,i,a,l=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=r,this.name=n,this.motionValue=i,this.element=a,this.isAsync=l}scheduleResolve(){this.state="scheduled",this.isAsync?(vs.add(this),Nh||(Nh=!0,st.read(By),st.resolveKeyframes(Iy))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:r,element:n,motionValue:i}=this;if(t[0]===null){const a=i==null?void 0:i.get(),l=t[t.length-1];if(a!==void 0)t[0]=a;else if(n&&r){const s=n.readValue(r,l);s!=null&&(t[0]=s)}t[0]===void 0&&(t[0]=l),i&&a===void 0&&i.set(t[0])}z2(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),vs.delete(this)}cancel(){this.state==="scheduled"&&(vs.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const J2=e=>e.startsWith("--");function Q2(e,t,r){J2(t)?e.style.setProperty(t,r):e.style[t]=r}const Z2=wf(()=>window.ScrollTimeline!==void 0),e5={};function t5(e,t){const r=wf(e);return()=>e5[t]??r()}const Oy=t5(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Xi=([e,t,r,n])=>`cubic-bezier(${e}, ${t}, ${r}, ${n})`,Xm={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Xi([0,.65,.55,1]),circOut:Xi([.55,0,1,.45]),backIn:Xi([.31,.01,.66,-.59]),backOut:Xi([.33,1.53,.69,.99])};function Ny(e,t){if(e)return typeof e=="function"?Oy()?My(e,t):"ease-out":wy(e)?Xi(e):Array.isArray(e)?e.map(r=>Ny(r,t)||Xm.easeOut):Xm[e]}function r5(e,t,r,{delay:n=0,duration:i=300,repeat:a=0,repeatType:l="loop",ease:s="easeOut",times:o}={},c=void 0){const p={[t]:r};o&&(p.offset=o);const u=Ny(s,i);Array.isArray(u)&&(p.easing=u);const f={delay:n,duration:i,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:a+1,direction:l==="reverse"?"alternate":"normal"};return c&&(f.pseudoElement=c),e.animate(p,f)}function jy(e){return typeof e=="function"&&"applyToOptions"in e}function n5({type:e,...t}){return jy(e)&&Oy()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class s5 extends Df{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:r,name:n,keyframes:i,pseudoElement:a,allowFlatten:l=!1,finalKeyframe:s,onComplete:o}=t;this.isPseudoElement=!!a,this.allowFlatten=l,this.options=t,yf(typeof t.type!="string");const c=n5(t);this.animation=r5(r,n,i,c,a),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!a){const p=Rf(i,this.options,s,this.speed);this.updateMotionValue?this.updateMotionValue(p):Q2(r,n,p),this.animation.cancel()}o==null||o(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,r;(r=(t=this.animation).finish)==null||r.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var t,r;this.isPseudoElement||(r=(t=this.animation).commitStyles)==null||r.call(t)}get duration(){var r,n;const t=((n=(r=this.animation.effect)==null?void 0:r.getComputedTiming)==null?void 0:n.call(r).duration)||0;return Sr(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Sr(t)}get time(){return Sr(Number(this.animation.currentTime)||0)}set time(t){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=fn(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,observe:r}){var n;return this.allowFlatten&&((n=this.animation.effect)==null||n.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&Z2()?(this.animation.timeline=t,br):r(this)}}const Fy={anticipate:gy,backInOut:my,circInOut:_y};function i5(e){return e in Fy}function o5(e){typeof e.ease=="string"&&i5(e.ease)&&(e.ease=Fy[e.ease])}const su=10;class a5 extends s5{constructor(t){o5(t),Py(t),super(t),t.startTime!==void 0&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:r,onUpdate:n,onComplete:i,element:a,...l}=this.options;if(!r)return;if(t!==void 0){r.set(t);return}const s=new Mf({...l,autoplay:!1}),o=Math.max(su,Qt.now()-this.startTime),c=Kr(0,su,o-su);r.setWithVelocity(s.sample(Math.max(0,o-c)).value,s.sample(o).value,c),s.stop()}}const Ym=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Kn.test(e)||e==="0")&&!e.startsWith("url("));function l5(e){const t=e[0];if(e.length===1)return!0;for(let r=0;r<e.length;r++)if(e[r]!==t)return!0}function c5(e,t,r,n){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const a=e[e.length-1],l=Ym(i,t),s=Ym(a,t);return!l||!s?!1:l5(e)||(r==="spring"||jy(r))&&n}function $h(e){e.duration=0,e.type="keyframes"}const u5=new Set(["opacity","clipPath","filter","transform"]),h5=wf(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function d5(e){var p;const{motionValue:t,name:r,repeatDelay:n,repeatType:i,damping:a,type:l}=e;if(!(((p=t==null?void 0:t.owner)==null?void 0:p.current)instanceof HTMLElement))return!1;const{onUpdate:o,transformTemplate:c}=t.owner.getProps();return h5()&&r&&u5.has(r)&&(r!=="transform"||!c)&&!o&&!n&&i!=="mirror"&&a!==0&&l!=="inertia"}const f5=40;class p5 extends Df{constructor({autoplay:t=!0,delay:r=0,type:n="keyframes",repeat:i=0,repeatDelay:a=0,repeatType:l="loop",keyframes:s,name:o,motionValue:c,element:p,...u}){var y;super(),this.stop=()=>{var v,h;this._animation&&(this._animation.stop(),(v=this.stopTimeline)==null||v.call(this)),(h=this.keyframeResolver)==null||h.cancel()},this.createdAt=Qt.now();const f={autoplay:t,delay:r,type:n,repeat:i,repeatDelay:a,repeatType:l,name:o,motionValue:c,element:p,...u},_=(p==null?void 0:p.KeyframeResolver)||Af;this.keyframeResolver=new _(s,(v,h,m)=>this.onKeyframesResolved(v,h,f,!m),o,c,p),(y=this.keyframeResolver)==null||y.scheduleResolve()}onKeyframesResolved(t,r,n,i){this.keyframeResolver=void 0;const{name:a,type:l,velocity:s,delay:o,isHandoff:c,onUpdate:p}=n;this.resolvedAt=Qt.now(),c5(t,a,l,s)||((_n.instantAnimations||!o)&&(p==null||p(Rf(t,n,r))),t[0]=t[t.length-1],$h(n),n.repeat=0);const f={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>f5?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:r,...n,keyframes:t},_=!c&&d5(f)?new a5({...f,element:f.motionValue.owner.current}):new Mf(f);_.finished.then(()=>this.notifyFinished()).catch(br),this.pendingTimeline&&(this.stopTimeline=_.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=_}get finished(){return this._animation?this.animation.finished:this._finished}then(t,r){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),Y2()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}const m5=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function g5(e){const t=m5.exec(e);if(!t)return[,];const[,r,n,i]=t;return[`--${r??n}`,i]}function $y(e,t,r=1){const[n,i]=g5(e);if(!n)return;const a=window.getComputedStyle(t).getPropertyValue(n);if(a){const l=a.trim();return ay(l)?parseFloat(l):l}return Cf(i)?$y(i,t,r+1):i}function Pf(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const Hy=new Set(["width","height","top","left","right","bottom",...Ci]),v5={test:e=>e==="auto",parse:e=>e},zy=e=>t=>t.test(e),Uy=[bi,we,Vr,kn,l2,a2,v5],Jm=e=>Uy.find(zy(e));function _5(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||cy(e):!0}const y5=new Set(["brightness","contrast","saturate","opacity"]);function w5(e){const[t,r]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[n]=r.match(Ef)||[];if(!n)return e;const i=r.replace(n,"");let a=y5.has(t)?1:0;return n!==r&&(a*=100),t+"("+a+i+")"}const S5=/\b([a-z-]*)\(.*?\)/gu,Hh={...Kn,getAnimatableNone:e=>{const t=e.match(S5);return t?t.map(w5).join(" "):e}},Qm={...bi,transform:Math.round},x5={rotate:kn,rotateX:kn,rotateY:kn,rotateZ:kn,scale:Ta,scaleX:Ta,scaleY:Ta,scaleZ:Ta,skew:kn,skewX:kn,skewY:kn,distance:we,translateX:we,translateY:we,translateZ:we,x:we,y:we,z:we,perspective:we,transformPerspective:we,opacity:Oo,originX:$m,originY:$m,originZ:we},If={borderWidth:we,borderTopWidth:we,borderRightWidth:we,borderBottomWidth:we,borderLeftWidth:we,borderRadius:we,radius:we,borderTopLeftRadius:we,borderTopRightRadius:we,borderBottomRightRadius:we,borderBottomLeftRadius:we,width:we,maxWidth:we,height:we,maxHeight:we,top:we,right:we,bottom:we,left:we,inset:we,insetBlock:we,insetBlockStart:we,insetBlockEnd:we,insetInline:we,insetInlineStart:we,insetInlineEnd:we,padding:we,paddingTop:we,paddingRight:we,paddingBottom:we,paddingLeft:we,paddingBlock:we,paddingBlockStart:we,paddingBlockEnd:we,paddingInline:we,paddingInlineStart:we,paddingInlineEnd:we,margin:we,marginTop:we,marginRight:we,marginBottom:we,marginLeft:we,marginBlock:we,marginBlockStart:we,marginBlockEnd:we,marginInline:we,marginInlineStart:we,marginInlineEnd:we,backgroundPositionX:we,backgroundPositionY:we,...x5,zIndex:Qm,fillOpacity:Oo,strokeOpacity:Oo,numOctaves:Qm},b5={...If,color:mt,backgroundColor:mt,outlineColor:mt,fill:mt,stroke:mt,borderColor:mt,borderTopColor:mt,borderRightColor:mt,borderBottomColor:mt,borderLeftColor:mt,filter:Hh,WebkitFilter:Hh},Wy=e=>b5[e];function Vy(e,t){let r=Wy(e);return r!==Hh&&(r=Kn),r.getAnimatableNone?r.getAnimatableNone(t):void 0}const C5=new Set(["auto","none","0"]);function E5(e,t,r){let n=0,i;for(;n<e.length&&!i;){const a=e[n];typeof a=="string"&&!C5.has(a)&&No(a).values.length&&(i=e[n]),n++}if(i&&r)for(const a of t)e[a]=Vy(r,i)}class k5 extends Af{constructor(t,r,n,i,a){super(t,r,n,i,a,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:r,name:n}=this;if(!r||!r.current)return;super.readKeyframes();for(let p=0;p<t.length;p++){let u=t[p];if(typeof u=="string"&&(u=u.trim(),Cf(u))){const f=$y(u,r.current);f!==void 0&&(t[p]=f),p===t.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!Hy.has(n)||t.length!==2)return;const[i,a]=t,l=Jm(i),s=Jm(a),o=Fm(i),c=Fm(a);if(o!==c&&In[n]){this.needsMeasurement=!0;return}if(l!==s)if(qm(l)&&qm(s))for(let p=0;p<t.length;p++){const u=t[p];typeof u=="string"&&(t[p]=parseFloat(u))}else In[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:r}=this,n=[];for(let i=0;i<t.length;i++)(t[i]===null||_5(t[i]))&&n.push(i);n.length&&E5(t,n,r)}measureInitialState(){const{element:t,unresolvedKeyframes:r,name:n}=this;if(!t||!t.current)return;n==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=In[n](t.measureViewportBox(),window.getComputedStyle(t.current)),r[0]=this.measuredOrigin;const i=r[r.length-1];i!==void 0&&t.getValue(n,i).jump(i,!1)}measureEndState(){var s;const{element:t,name:r,unresolvedKeyframes:n}=this;if(!t||!t.current)return;const i=t.getValue(r);i&&i.jump(this.measuredOrigin,!1);const a=n.length-1,l=n[a];n[a]=In[r](t.measureViewportBox(),window.getComputedStyle(t.current)),l!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=l),(s=this.removedTransforms)!=null&&s.length&&this.removedTransforms.forEach(([o,c])=>{t.getValue(o).set(c)}),this.resolveNoneKeyframes()}}function L5(e,t,r){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let n=document;const i=(r==null?void 0:r[e])??n.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e)}const Ky=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Gy(e){return ly(e)&&"offsetHeight"in e}const Zm=30,T5=e=>!isNaN(parseFloat(e));class R5{constructor(t,r={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=n=>{var a;const i=Qt.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(n),this.current!==this.prev&&((a=this.events.change)==null||a.notify(this.current),this.dependents))for(const l of this.dependents)l.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=r.owner}setCurrent(t){this.current=t,this.updatedAt=Qt.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=T5(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,r){this.events[t]||(this.events[t]=new Sf);const n=this.events[t].add(r);return t==="change"?()=>{n(),st.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,r){this.passiveEffect=t,this.stopPassiveEffect=r}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,r,n){this.set(r),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,r=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,r&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Qt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Zm)return 0;const r=Math.min(this.updatedAt-this.prevUpdatedAt,Zm);return uy(parseFloat(this.current)-parseFloat(this.prevFrameValue),r)}start(t){return this.stop(),new Promise(r=>{this.hasAnimated=!0,this.animation=t(r),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,r;(t=this.dependents)==null||t.clear(),(r=this.events.destroy)==null||r.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function gi(e,t){return new R5(e,t)}const{schedule:Bf}=Sy(queueMicrotask,!1),Rr={x:!1,y:!1};function qy(){return Rr.x||Rr.y}function D5(e){return e==="x"||e==="y"?Rr[e]?null:(Rr[e]=!0,()=>{Rr[e]=!1}):Rr.x||Rr.y?null:(Rr.x=Rr.y=!0,()=>{Rr.x=Rr.y=!1})}function Xy(e,t){const r=L5(e),n=new AbortController,i={passive:!0,...t,signal:n.signal};return[r,i,()=>n.abort()]}function eg(e){return!(e.pointerType==="touch"||qy())}function M5(e,t,r={}){const[n,i,a]=Xy(e,r),l=s=>{if(!eg(s))return;const{target:o}=s,c=t(o,s);if(typeof c!="function"||!o)return;const p=u=>{eg(u)&&(c(u),o.removeEventListener("pointerleave",p))};o.addEventListener("pointerleave",p,i)};return n.forEach(s=>{s.addEventListener("pointerenter",l,i)}),a}const Yy=(e,t)=>t?e===t?!0:Yy(e,t.parentElement):!1,Of=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,A5=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Jy(e){return A5.has(e.tagName)||e.isContentEditable===!0}const rl=new WeakSet;function tg(e){return t=>{t.key==="Enter"&&e(t)}}function iu(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const P5=(e,t)=>{const r=e.currentTarget;if(!r)return;const n=tg(()=>{if(rl.has(r))return;iu(r,"down");const i=tg(()=>{iu(r,"up")}),a=()=>iu(r,"cancel");r.addEventListener("keyup",i,t),r.addEventListener("blur",a,t)});r.addEventListener("keydown",n,t),r.addEventListener("blur",()=>r.removeEventListener("keydown",n),t)};function rg(e){return Of(e)&&!qy()}function I5(e,t,r={}){const[n,i,a]=Xy(e,r),l=s=>{const o=s.currentTarget;if(!rg(s))return;rl.add(o);const c=t(o,s),p=(_,y)=>{window.removeEventListener("pointerup",u),window.removeEventListener("pointercancel",f),rl.has(o)&&rl.delete(o),rg(_)&&typeof c=="function"&&c(_,{success:y})},u=_=>{p(_,o===window||o===document||r.useGlobalTarget||Yy(o,_.target))},f=_=>{p(_,!1)};window.addEventListener("pointerup",u,i),window.addEventListener("pointercancel",f,i)};return n.forEach(s=>{(r.useGlobalTarget?window:s).addEventListener("pointerdown",l,i),Gy(s)&&(s.addEventListener("focus",c=>P5(c,i)),!Jy(s)&&!s.hasAttribute("tabindex")&&(s.tabIndex=0))}),a}function Qy(e){return ly(e)&&"ownerSVGElement"in e}function B5(e){return Qy(e)&&e.tagName==="svg"}const Gt=e=>!!(e&&e.getVelocity),O5=[...Uy,mt,Kn],N5=e=>O5.find(zy(e)),Nf=k.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function ng(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function j5(...e){return t=>{let r=!1;const n=e.map(i=>{const a=ng(i,t);return!r&&typeof a=="function"&&(r=!0),a});if(r)return()=>{for(let i=0;i<n.length;i++){const a=n[i];typeof a=="function"?a():ng(e[i],null)}}}}function F5(...e){return k.useCallback(j5(...e),e)}class $5 extends k.Component{getSnapshotBeforeUpdate(t){const r=this.props.childRef.current;if(r&&t.isPresent&&!this.props.isPresent){const n=r.offsetParent,i=Gy(n)&&n.offsetWidth||0,a=this.props.sizeRef.current;a.height=r.offsetHeight||0,a.width=r.offsetWidth||0,a.top=r.offsetTop,a.left=r.offsetLeft,a.right=i-a.width-a.left}return null}componentDidUpdate(){}render(){return this.props.children}}function H5({children:e,isPresent:t,anchorX:r,root:n}){var p;const i=k.useId(),a=k.useRef(null),l=k.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:s}=k.useContext(Nf),o=((p=e.props)==null?void 0:p.ref)??(e==null?void 0:e.ref),c=F5(a,o);return k.useInsertionEffect(()=>{const{width:u,height:f,top:_,left:y,right:v}=l.current;if(t||!a.current||!u||!f)return;const h=r==="left"?`left: ${y}`:`right: ${v}`;a.current.dataset.motionPopId=i;const m=document.createElement("style");s&&(m.nonce=s);const d=n??document.head;return d.appendChild(m),m.sheet&&m.sheet.insertRule(`
40
+ `+a.stack}return{value:e,source:t,stack:i,digest:null}}function Xc(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function hh(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var Eb=typeof WeakMap=="function"?WeakMap:Map;function E0(e,t,r){r=dn(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){Dl||(Dl=!0,Sh=n),hh(e,t)},r}function k0(e,t,r){r=dn(-1,r),r.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var i=t.value;r.payload=function(){return n(i)},r.callback=function(){hh(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(r.callback=function(){hh(e,t),typeof n!="function"&&($n===null?$n=new Set([this]):$n.add(this));var l=t.stack;this.componentDidCatch(t.value,{componentStack:l!==null?l:""})}),r}function mm(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new Eb;var i=new Set;n.set(t,i)}else i=n.get(t),i===void 0&&(i=new Set,n.set(t,i));i.has(r)||(i.add(r),e=Fb.bind(null,e,t,r),t.then(e,e))}function gm(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function vm(e,t,r,n,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=dn(-1,1),t.tag=2,Fn(r,t,1))),r.lanes|=1),e)}var kb=yn.ReactCurrentOwner,sr=!1;function Jt(e,t,r,n){t.child=e===null?t0(t,null,r,n):di(t,e.child,r,n)}function _m(e,t,r,n,i){r=r.render;var a=t.ref;return ri(t,i),n=Gd(e,t,r,n,a,i),r=qd(),e!==null&&!sr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,vn(e,t,i)):(it&&r&&Bd(t),t.flags|=1,Jt(e,t,n,i),t.child)}function ym(e,t,r,n,i){if(e===null){var a=r.type;return typeof a=="function"&&!sf(a)&&a.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=a,L0(e,t,a,n,i)):(e=el(r.type,null,n,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!(e.lanes&i)){var l=a.memoizedProps;if(r=r.compare,r=r!==null?r:Eo,r(l,n)&&e.ref===t.ref)return vn(e,t,i)}return t.flags|=1,e=zn(a,n),e.ref=t.ref,e.return=t,t.child=e}function L0(e,t,r,n,i){if(e!==null){var a=e.memoizedProps;if(Eo(a,n)&&e.ref===t.ref)if(sr=!1,t.pendingProps=n=a,(e.lanes&i)!==0)e.flags&131072&&(sr=!0);else return t.lanes=e.lanes,vn(e,t,i)}return dh(e,t,r,n,i)}function T0(e,t,r){var n=t.pendingProps,i=n.children,a=e!==null?e.memoizedState:null;if(n.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ze(Ks,cr),cr|=r;else{if(!(r&1073741824))return e=a!==null?a.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ze(Ks,cr),cr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=a!==null?a.baseLanes:r,Ze(Ks,cr),cr|=n}else a!==null?(n=a.baseLanes|r,t.memoizedState=null):n=r,Ze(Ks,cr),cr|=n;return Jt(e,t,i,r),t.child}function R0(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function dh(e,t,r,n,i){var a=or(r)?ys:Xt.current;return a=ui(t,a),ri(t,i),r=Gd(e,t,r,n,a,i),n=qd(),e!==null&&!sr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,vn(e,t,i)):(it&&n&&Bd(t),t.flags|=1,Jt(e,t,r,i),t.child)}function wm(e,t,r,n,i){if(or(r)){var a=!0;wl(t)}else a=!1;if(ri(t,i),t.stateNode===null)Ja(e,t),C0(t,r,n),uh(t,r,n,i),n=!0;else if(e===null){var l=t.stateNode,s=t.memoizedProps;l.props=s;var o=l.context,c=r.contextType;typeof c=="object"&&c!==null?c=Cr(c):(c=or(r)?ys:Xt.current,c=ui(t,c));var p=r.getDerivedStateFromProps,u=typeof p=="function"||typeof l.getSnapshotBeforeUpdate=="function";u||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(s!==n||o!==c)&&pm(t,l,n,c),Tn=!1;var f=t.memoizedState;l.state=f,El(t,n,l,i),o=t.memoizedState,s!==n||f!==o||ir.current||Tn?(typeof p=="function"&&(ch(t,r,p,n),o=t.memoizedState),(s=Tn||fm(t,r,s,n,f,o,c))?(u||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount()),typeof l.componentDidMount=="function"&&(t.flags|=4194308)):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=o),l.props=n,l.state=o,l.context=c,n=s):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{l=t.stateNode,n0(e,t),s=t.memoizedProps,c=t.type===t.elementType?s:Dr(t.type,s),l.props=c,u=t.pendingProps,f=l.context,o=r.contextType,typeof o=="object"&&o!==null?o=Cr(o):(o=or(r)?ys:Xt.current,o=ui(t,o));var _=r.getDerivedStateFromProps;(p=typeof _=="function"||typeof l.getSnapshotBeforeUpdate=="function")||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(s!==u||f!==o)&&pm(t,l,n,o),Tn=!1,f=t.memoizedState,l.state=f,El(t,n,l,i);var y=t.memoizedState;s!==u||f!==y||ir.current||Tn?(typeof _=="function"&&(ch(t,r,_,n),y=t.memoizedState),(c=Tn||fm(t,r,c,n,f,y,o)||!1)?(p||typeof l.UNSAFE_componentWillUpdate!="function"&&typeof l.componentWillUpdate!="function"||(typeof l.componentWillUpdate=="function"&&l.componentWillUpdate(n,y,o),typeof l.UNSAFE_componentWillUpdate=="function"&&l.UNSAFE_componentWillUpdate(n,y,o)),typeof l.componentDidUpdate=="function"&&(t.flags|=4),typeof l.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof l.componentDidUpdate!="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=y),l.props=n,l.state=y,l.context=o,n=c):(typeof l.componentDidUpdate!="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),n=!1)}return fh(e,t,r,n,a,i)}function fh(e,t,r,n,i,a){R0(e,t);var l=(t.flags&128)!==0;if(!n&&!l)return i&&im(t,r,!1),vn(e,t,a);n=t.stateNode,kb.current=t;var s=l&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&l?(t.child=di(t,e.child,null,a),t.child=di(t,null,s,a)):Jt(e,t,s,a),t.memoizedState=n.state,i&&im(t,r,!0),t.child}function D0(e){var t=e.stateNode;t.pendingContext?sm(e,t.pendingContext,t.pendingContext!==t.context):t.context&&sm(e,t.context,!1),Ud(e,t.containerInfo)}function Sm(e,t,r,n,i){return hi(),Nd(i),t.flags|=256,Jt(e,t,r,n),t.child}var ph={dehydrated:null,treeContext:null,retryLane:0};function mh(e){return{baseLanes:e,cachePool:null,transitions:null}}function M0(e,t,r){var n=t.pendingProps,i=at.current,a=!1,l=(t.flags&128)!==0,s;if((s=l)||(s=e!==null&&e.memoizedState===null?!1:(i&2)!==0),s?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),Ze(at,i&1),e===null)return ah(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(l=n.children,e=n.fallback,a?(n=t.mode,a=t.child,l={mode:"hidden",children:l},!(n&1)&&a!==null?(a.childLanes=0,a.pendingProps=l):a=uc(l,n,0,null),e=gs(e,n,r,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=mh(r),t.memoizedState=ph,e):Jd(t,l));if(i=e.memoizedState,i!==null&&(s=i.dehydrated,s!==null))return Lb(e,t,l,n,s,i,r);if(a){a=n.fallback,l=t.mode,i=e.child,s=i.sibling;var o={mode:"hidden",children:n.children};return!(l&1)&&t.child!==i?(n=t.child,n.childLanes=0,n.pendingProps=o,t.deletions=null):(n=zn(i,o),n.subtreeFlags=i.subtreeFlags&14680064),s!==null?a=zn(s,a):(a=gs(a,l,r,null),a.flags|=2),a.return=t,n.return=t,n.sibling=a,t.child=n,n=a,a=t.child,l=e.child.memoizedState,l=l===null?mh(r):{baseLanes:l.baseLanes|r,cachePool:null,transitions:l.transitions},a.memoizedState=l,a.childLanes=e.childLanes&~r,t.memoizedState=ph,n}return a=e.child,e=a.sibling,n=zn(a,{mode:"visible",children:n.children}),!(t.mode&1)&&(n.lanes=r),n.return=t,n.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n}function Jd(e,t){return t=uc({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function xa(e,t,r,n){return n!==null&&Nd(n),di(t,e.child,null,r),e=Jd(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Lb(e,t,r,n,i,a,l){if(r)return t.flags&256?(t.flags&=-257,n=Xc(Error(ce(422))),xa(e,t,l,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=n.fallback,i=t.mode,n=uc({mode:"visible",children:n.children},i,0,null),a=gs(a,i,l,null),a.flags|=2,n.return=t,a.return=t,n.sibling=a,t.child=n,t.mode&1&&di(t,e.child,null,l),t.child.memoizedState=mh(l),t.memoizedState=ph,a);if(!(t.mode&1))return xa(e,t,l,null);if(i.data==="$!"){if(n=i.nextSibling&&i.nextSibling.dataset,n)var s=n.dgst;return n=s,a=Error(ce(419)),n=Xc(a,n,void 0),xa(e,t,l,n)}if(s=(l&e.childLanes)!==0,sr||s){if(n=Pt,n!==null){switch(l&-l){case 4:i=2;break;case 16:i=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(n.suspendedLanes|l)?0:i,i!==0&&i!==a.retryLane&&(a.retryLane=i,gn(e,i),Or(n,e,i,-1))}return nf(),n=Xc(Error(ce(421))),xa(e,t,l,n)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=$b.bind(null,e),i._reactRetry=t,null):(e=a.treeContext,hr=jn(i.nextSibling),dr=t,it=!0,Pr=null,e!==null&&(_r[yr++]=cn,_r[yr++]=un,_r[yr++]=ws,cn=e.id,un=e.overflow,ws=t),t=Jd(t,n.children),t.flags|=4096,t)}function xm(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),lh(e.return,t,r)}function Yc(e,t,r,n,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=n,a.tail=r,a.tailMode=i)}function A0(e,t,r){var n=t.pendingProps,i=n.revealOrder,a=n.tail;if(Jt(e,t,n.children,r),n=at.current,n&2)n=n&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&xm(e,r,t);else if(e.tag===19)xm(e,r,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}n&=1}if(Ze(at,n),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(r=t.child,i=null;r!==null;)e=r.alternate,e!==null&&kl(e)===null&&(i=r),r=r.sibling;r=i,r===null?(i=t.child,t.child=null):(i=r.sibling,r.sibling=null),Yc(t,!1,i,r,a);break;case"backwards":for(r=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&kl(e)===null){t.child=i;break}e=i.sibling,i.sibling=r,r=i,i=e}Yc(t,!0,r,null,a);break;case"together":Yc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ja(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function vn(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),xs|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(ce(153));if(t.child!==null){for(e=t.child,r=zn(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=zn(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function Tb(e,t,r){switch(t.tag){case 3:D0(t),hi();break;case 5:s0(t);break;case 1:or(t.type)&&wl(t);break;case 4:Ud(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,i=t.memoizedProps.value;Ze(bl,n._currentValue),n._currentValue=i;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(Ze(at,at.current&1),t.flags|=128,null):r&t.child.childLanes?M0(e,t,r):(Ze(at,at.current&1),e=vn(e,t,r),e!==null?e.sibling:null);Ze(at,at.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return A0(e,t,r);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ze(at,at.current),n)break;return null;case 22:case 23:return t.lanes=0,T0(e,t,r)}return vn(e,t,r)}var P0,gh,I0,B0;P0=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};gh=function(){};I0=function(e,t,r,n){var i=e.memoizedProps;if(i!==n){e=t.stateNode,us(Wr.current);var a=null;switch(r){case"input":i=ju(e,i),n=ju(e,n),a=[];break;case"select":i=ut({},i,{value:void 0}),n=ut({},n,{value:void 0}),a=[];break;case"textarea":i=Hu(e,i),n=Hu(e,n),a=[];break;default:typeof i.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=_l)}Uu(r,n);var l;r=null;for(c in i)if(!n.hasOwnProperty(c)&&i.hasOwnProperty(c)&&i[c]!=null)if(c==="style"){var s=i[c];for(l in s)s.hasOwnProperty(l)&&(r||(r={}),r[l]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(_o.hasOwnProperty(c)?a||(a=[]):(a=a||[]).push(c,null));for(c in n){var o=n[c];if(s=i!=null?i[c]:void 0,n.hasOwnProperty(c)&&o!==s&&(o!=null||s!=null))if(c==="style")if(s){for(l in s)!s.hasOwnProperty(l)||o&&o.hasOwnProperty(l)||(r||(r={}),r[l]="");for(l in o)o.hasOwnProperty(l)&&s[l]!==o[l]&&(r||(r={}),r[l]=o[l])}else r||(a||(a=[]),a.push(c,r)),r=o;else c==="dangerouslySetInnerHTML"?(o=o?o.__html:void 0,s=s?s.__html:void 0,o!=null&&s!==o&&(a=a||[]).push(c,o)):c==="children"?typeof o!="string"&&typeof o!="number"||(a=a||[]).push(c,""+o):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(_o.hasOwnProperty(c)?(o!=null&&c==="onScroll"&&rt("scroll",e),a||s===o||(a=[])):(a=a||[]).push(c,o))}r&&(a=a||[]).push("style",r);var c=a;(t.updateQueue=c)&&(t.flags|=4)}};B0=function(e,t,r,n){r!==n&&(t.flags|=4)};function ji(e,t){if(!it)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function Wt(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,n=0;if(t)for(var i=e.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags&14680064,n|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags,n|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function Rb(e,t,r){var n=t.pendingProps;switch(Od(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Wt(t),null;case 1:return or(t.type)&&yl(),Wt(t),null;case 3:return n=t.stateNode,fi(),nt(ir),nt(Xt),Vd(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(wa(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Pr!==null&&(Ch(Pr),Pr=null))),gh(e,t),Wt(t),null;case 5:Wd(t);var i=us(Do.current);if(r=t.type,e!==null&&t.stateNode!=null)I0(e,t,r,n,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(t.stateNode===null)throw Error(ce(166));return Wt(t),null}if(e=us(Wr.current),wa(t)){n=t.stateNode,r=t.type;var a=t.memoizedProps;switch(n[Hr]=t,n[To]=a,e=(t.mode&1)!==0,r){case"dialog":rt("cancel",n),rt("close",n);break;case"iframe":case"object":case"embed":rt("load",n);break;case"video":case"audio":for(i=0;i<qi.length;i++)rt(qi[i],n);break;case"source":rt("error",n);break;case"img":case"image":case"link":rt("error",n),rt("load",n);break;case"details":rt("toggle",n);break;case"input":Mp(n,a),rt("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!a.multiple},rt("invalid",n);break;case"textarea":Pp(n,a),rt("invalid",n)}Uu(r,a),i=null;for(var l in a)if(a.hasOwnProperty(l)){var s=a[l];l==="children"?typeof s=="string"?n.textContent!==s&&(a.suppressHydrationWarning!==!0&&ya(n.textContent,s,e),i=["children",s]):typeof s=="number"&&n.textContent!==""+s&&(a.suppressHydrationWarning!==!0&&ya(n.textContent,s,e),i=["children",""+s]):_o.hasOwnProperty(l)&&s!=null&&l==="onScroll"&&rt("scroll",n)}switch(r){case"input":ha(n),Ap(n,a,!0);break;case"textarea":ha(n),Ip(n);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(n.onclick=_l)}n=i,t.updateQueue=n,n!==null&&(t.flags|=4)}else{l=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=c_(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=l.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=l.createElement(r,{is:n.is}):(e=l.createElement(r),r==="select"&&(l=e,n.multiple?l.multiple=!0:n.size&&(l.size=n.size))):e=l.createElementNS(e,r),e[Hr]=t,e[To]=n,P0(e,t,!1,!1),t.stateNode=e;e:{switch(l=Wu(r,n),r){case"dialog":rt("cancel",e),rt("close",e),i=n;break;case"iframe":case"object":case"embed":rt("load",e),i=n;break;case"video":case"audio":for(i=0;i<qi.length;i++)rt(qi[i],e);i=n;break;case"source":rt("error",e),i=n;break;case"img":case"image":case"link":rt("error",e),rt("load",e),i=n;break;case"details":rt("toggle",e),i=n;break;case"input":Mp(e,n),i=ju(e,n),rt("invalid",e);break;case"option":i=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},i=ut({},n,{value:void 0}),rt("invalid",e);break;case"textarea":Pp(e,n),i=Hu(e,n),rt("invalid",e);break;default:i=n}Uu(r,i),s=i;for(a in s)if(s.hasOwnProperty(a)){var o=s[a];a==="style"?d_(e,o):a==="dangerouslySetInnerHTML"?(o=o?o.__html:void 0,o!=null&&u_(e,o)):a==="children"?typeof o=="string"?(r!=="textarea"||o!=="")&&yo(e,o):typeof o=="number"&&yo(e,""+o):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(_o.hasOwnProperty(a)?o!=null&&a==="onScroll"&&rt("scroll",e):o!=null&&Sd(e,a,o,l))}switch(r){case"input":ha(e),Ap(e,n,!1);break;case"textarea":ha(e),Ip(e);break;case"option":n.value!=null&&e.setAttribute("value",""+Un(n.value));break;case"select":e.multiple=!!n.multiple,a=n.value,a!=null?Qs(e,!!n.multiple,a,!1):n.defaultValue!=null&&Qs(e,!!n.multiple,n.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=_l)}switch(r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Wt(t),null;case 6:if(e&&t.stateNode!=null)B0(e,t,e.memoizedProps,n);else{if(typeof n!="string"&&t.stateNode===null)throw Error(ce(166));if(r=us(Do.current),us(Wr.current),wa(t)){if(n=t.stateNode,r=t.memoizedProps,n[Hr]=t,(a=n.nodeValue!==r)&&(e=dr,e!==null))switch(e.tag){case 3:ya(n.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&ya(n.nodeValue,r,(e.mode&1)!==0)}a&&(t.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[Hr]=t,t.stateNode=n}return Wt(t),null;case 13:if(nt(at),n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(it&&hr!==null&&t.mode&1&&!(t.flags&128))Z_(),hi(),t.flags|=98560,a=!1;else if(a=wa(t),n!==null&&n.dehydrated!==null){if(e===null){if(!a)throw Error(ce(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(ce(317));a[Hr]=t}else hi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Wt(t),a=!1}else Pr!==null&&(Ch(Pr),Pr=null),a=!0;if(!a)return t.flags&65536?t:null}return t.flags&128?(t.lanes=r,t):(n=n!==null,n!==(e!==null&&e.memoizedState!==null)&&n&&(t.child.flags|=8192,t.mode&1&&(e===null||at.current&1?Ct===0&&(Ct=3):nf())),t.updateQueue!==null&&(t.flags|=4),Wt(t),null);case 4:return fi(),gh(e,t),e===null&&ko(t.stateNode.containerInfo),Wt(t),null;case 10:return $d(t.type._context),Wt(t),null;case 17:return or(t.type)&&yl(),Wt(t),null;case 19:if(nt(at),a=t.memoizedState,a===null)return Wt(t),null;if(n=(t.flags&128)!==0,l=a.rendering,l===null)if(n)ji(a,!1);else{if(Ct!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(l=kl(e),l!==null){for(t.flags|=128,ji(a,!1),n=l.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),t.subtreeFlags=0,n=r,r=t.child;r!==null;)a=r,e=n,a.flags&=14680066,l=a.alternate,l===null?(a.childLanes=0,a.lanes=e,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=l.childLanes,a.lanes=l.lanes,a.child=l.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=l.memoizedProps,a.memoizedState=l.memoizedState,a.updateQueue=l.updateQueue,a.type=l.type,e=l.dependencies,a.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return Ze(at,at.current&1|2),t.child}e=e.sibling}a.tail!==null&&pt()>mi&&(t.flags|=128,n=!0,ji(a,!1),t.lanes=4194304)}else{if(!n)if(e=kl(l),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),ji(a,!0),a.tail===null&&a.tailMode==="hidden"&&!l.alternate&&!it)return Wt(t),null}else 2*pt()-a.renderingStartTime>mi&&r!==1073741824&&(t.flags|=128,n=!0,ji(a,!1),t.lanes=4194304);a.isBackwards?(l.sibling=t.child,t.child=l):(r=a.last,r!==null?r.sibling=l:t.child=l,a.last=l)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=pt(),t.sibling=null,r=at.current,Ze(at,n?r&1|2:r&1),t):(Wt(t),null);case 22:case 23:return rf(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?cr&1073741824&&(Wt(t),t.subtreeFlags&6&&(t.flags|=8192)):Wt(t),null;case 24:return null;case 25:return null}throw Error(ce(156,t.tag))}function Db(e,t){switch(Od(t),t.tag){case 1:return or(t.type)&&yl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return fi(),nt(ir),nt(Xt),Vd(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Wd(t),null;case 13:if(nt(at),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ce(340));hi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return nt(at),null;case 4:return fi(),null;case 10:return $d(t.type._context),null;case 22:case 23:return rf(),null;case 24:return null;default:return null}}var ba=!1,Vt=!1,Mb=typeof WeakSet=="function"?WeakSet:Set,Se=null;function Vs(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){ft(e,t,n)}else r.current=null}function vh(e,t,r){try{r()}catch(n){ft(e,t,n)}}var bm=!1;function Ab(e,t){if(eh=ml,e=$_(),Id(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,a=n.focusNode;n=n.focusOffset;try{r.nodeType,a.nodeType}catch{r=null;break e}var l=0,s=-1,o=-1,c=0,p=0,u=e,f=null;t:for(;;){for(var _;u!==r||i!==0&&u.nodeType!==3||(s=l+i),u!==a||n!==0&&u.nodeType!==3||(o=l+n),u.nodeType===3&&(l+=u.nodeValue.length),(_=u.firstChild)!==null;)f=u,u=_;for(;;){if(u===e)break t;if(f===r&&++c===i&&(s=l),f===a&&++p===n&&(o=l),(_=u.nextSibling)!==null)break;u=f,f=u.parentNode}u=_}r=s===-1||o===-1?null:{start:s,end:o}}else r=null}r=r||{start:0,end:0}}else r=null;for(th={focusedElem:e,selectionRange:r},ml=!1,Se=t;Se!==null;)if(t=Se,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Se=e;else for(;Se!==null;){t=Se;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var v=y.memoizedProps,h=y.memoizedState,m=t.stateNode,d=m.getSnapshotBeforeUpdate(t.elementType===t.type?v:Dr(t.type,v),h);m.__reactInternalSnapshotBeforeUpdate=d}break;case 3:var g=t.stateNode.containerInfo;g.nodeType===1?g.textContent="":g.nodeType===9&&g.documentElement&&g.removeChild(g.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ce(163))}}catch(w){ft(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,Se=e;break}Se=t.return}return y=bm,bm=!1,y}function io(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&vh(t,r,a)}i=i.next}while(i!==n)}}function lc(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function _h(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function O0(e){var t=e.alternate;t!==null&&(e.alternate=null,O0(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Hr],delete t[To],delete t[sh],delete t[pb],delete t[mb])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function N0(e){return e.tag===5||e.tag===3||e.tag===4}function Cm(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||N0(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.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 yh(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=_l));else if(n!==4&&(e=e.child,e!==null))for(yh(e,t,r),e=e.sibling;e!==null;)yh(e,t,r),e=e.sibling}function wh(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(wh(e,t,r),e=e.sibling;e!==null;)wh(e,t,r),e=e.sibling}var Ot=null,Mr=!1;function xn(e,t,r){for(r=r.child;r!==null;)j0(e,t,r),r=r.sibling}function j0(e,t,r){if(Ur&&typeof Ur.onCommitFiberUnmount=="function")try{Ur.onCommitFiberUnmount(ec,r)}catch{}switch(r.tag){case 5:Vt||Vs(r,t);case 6:var n=Ot,i=Mr;Ot=null,xn(e,t,r),Ot=n,Mr=i,Ot!==null&&(Mr?(e=Ot,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Ot.removeChild(r.stateNode));break;case 18:Ot!==null&&(Mr?(e=Ot,r=r.stateNode,e.nodeType===8?Uc(e.parentNode,r):e.nodeType===1&&Uc(e,r),bo(e)):Uc(Ot,r.stateNode));break;case 4:n=Ot,i=Mr,Ot=r.stateNode.containerInfo,Mr=!0,xn(e,t,r),Ot=n,Mr=i;break;case 0:case 11:case 14:case 15:if(!Vt&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var a=i,l=a.destroy;a=a.tag,l!==void 0&&(a&2||a&4)&&vh(r,t,l),i=i.next}while(i!==n)}xn(e,t,r);break;case 1:if(!Vt&&(Vs(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(s){ft(r,t,s)}xn(e,t,r);break;case 21:xn(e,t,r);break;case 22:r.mode&1?(Vt=(n=Vt)||r.memoizedState!==null,xn(e,t,r),Vt=n):xn(e,t,r);break;default:xn(e,t,r)}}function Em(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new Mb),t.forEach(function(n){var i=Hb.bind(null,e,n);r.has(n)||(r.add(n),n.then(i,i))})}}function kr(e,t){var r=t.deletions;if(r!==null)for(var n=0;n<r.length;n++){var i=r[n];try{var a=e,l=t,s=l;e:for(;s!==null;){switch(s.tag){case 5:Ot=s.stateNode,Mr=!1;break e;case 3:Ot=s.stateNode.containerInfo,Mr=!0;break e;case 4:Ot=s.stateNode.containerInfo,Mr=!0;break e}s=s.return}if(Ot===null)throw Error(ce(160));j0(a,l,i),Ot=null,Mr=!1;var o=i.alternate;o!==null&&(o.return=null),i.return=null}catch(c){ft(i,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)F0(t,e),t=t.sibling}function F0(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(kr(t,e),Fr(e),n&4){try{io(3,e,e.return),lc(3,e)}catch(v){ft(e,e.return,v)}try{io(5,e,e.return)}catch(v){ft(e,e.return,v)}}break;case 1:kr(t,e),Fr(e),n&512&&r!==null&&Vs(r,r.return);break;case 5:if(kr(t,e),Fr(e),n&512&&r!==null&&Vs(r,r.return),e.flags&32){var i=e.stateNode;try{yo(i,"")}catch(v){ft(e,e.return,v)}}if(n&4&&(i=e.stateNode,i!=null)){var a=e.memoizedProps,l=r!==null?r.memoizedProps:a,s=e.type,o=e.updateQueue;if(e.updateQueue=null,o!==null)try{s==="input"&&a.type==="radio"&&a.name!=null&&a_(i,a),Wu(s,l);var c=Wu(s,a);for(l=0;l<o.length;l+=2){var p=o[l],u=o[l+1];p==="style"?d_(i,u):p==="dangerouslySetInnerHTML"?u_(i,u):p==="children"?yo(i,u):Sd(i,p,u,c)}switch(s){case"input":Fu(i,a);break;case"textarea":l_(i,a);break;case"select":var f=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!a.multiple;var _=a.value;_!=null?Qs(i,!!a.multiple,_,!1):f!==!!a.multiple&&(a.defaultValue!=null?Qs(i,!!a.multiple,a.defaultValue,!0):Qs(i,!!a.multiple,a.multiple?[]:"",!1))}i[To]=a}catch(v){ft(e,e.return,v)}}break;case 6:if(kr(t,e),Fr(e),n&4){if(e.stateNode===null)throw Error(ce(162));i=e.stateNode,a=e.memoizedProps;try{i.nodeValue=a}catch(v){ft(e,e.return,v)}}break;case 3:if(kr(t,e),Fr(e),n&4&&r!==null&&r.memoizedState.isDehydrated)try{bo(t.containerInfo)}catch(v){ft(e,e.return,v)}break;case 4:kr(t,e),Fr(e);break;case 13:kr(t,e),Fr(e),i=e.child,i.flags&8192&&(a=i.memoizedState!==null,i.stateNode.isHidden=a,!a||i.alternate!==null&&i.alternate.memoizedState!==null||(ef=pt())),n&4&&Em(e);break;case 22:if(p=r!==null&&r.memoizedState!==null,e.mode&1?(Vt=(c=Vt)||p,kr(t,e),Vt=c):kr(t,e),Fr(e),n&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!p&&e.mode&1)for(Se=e,p=e.child;p!==null;){for(u=Se=p;Se!==null;){switch(f=Se,_=f.child,f.tag){case 0:case 11:case 14:case 15:io(4,f,f.return);break;case 1:Vs(f,f.return);var y=f.stateNode;if(typeof y.componentWillUnmount=="function"){n=f,r=f.return;try{t=n,y.props=t.memoizedProps,y.state=t.memoizedState,y.componentWillUnmount()}catch(v){ft(n,r,v)}}break;case 5:Vs(f,f.return);break;case 22:if(f.memoizedState!==null){Lm(u);continue}}_!==null?(_.return=f,Se=_):Lm(u)}p=p.sibling}e:for(p=null,u=e;;){if(u.tag===5){if(p===null){p=u;try{i=u.stateNode,c?(a=i.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"):(s=u.stateNode,o=u.memoizedProps.style,l=o!=null&&o.hasOwnProperty("display")?o.display:null,s.style.display=h_("display",l))}catch(v){ft(e,e.return,v)}}}else if(u.tag===6){if(p===null)try{u.stateNode.nodeValue=c?"":u.memoizedProps}catch(v){ft(e,e.return,v)}}else if((u.tag!==22&&u.tag!==23||u.memoizedState===null||u===e)&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===e)break e;for(;u.sibling===null;){if(u.return===null||u.return===e)break e;p===u&&(p=null),u=u.return}p===u&&(p=null),u.sibling.return=u.return,u=u.sibling}}break;case 19:kr(t,e),Fr(e),n&4&&Em(e);break;case 21:break;default:kr(t,e),Fr(e)}}function Fr(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(N0(r)){var n=r;break e}r=r.return}throw Error(ce(160))}switch(n.tag){case 5:var i=n.stateNode;n.flags&32&&(yo(i,""),n.flags&=-33);var a=Cm(e);wh(e,a,i);break;case 3:case 4:var l=n.stateNode.containerInfo,s=Cm(e);yh(e,s,l);break;default:throw Error(ce(161))}}catch(o){ft(e,e.return,o)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Pb(e,t,r){Se=e,$0(e)}function $0(e,t,r){for(var n=(e.mode&1)!==0;Se!==null;){var i=Se,a=i.child;if(i.tag===22&&n){var l=i.memoizedState!==null||ba;if(!l){var s=i.alternate,o=s!==null&&s.memoizedState!==null||Vt;s=ba;var c=Vt;if(ba=l,(Vt=o)&&!c)for(Se=i;Se!==null;)l=Se,o=l.child,l.tag===22&&l.memoizedState!==null?Tm(i):o!==null?(o.return=l,Se=o):Tm(i);for(;a!==null;)Se=a,$0(a),a=a.sibling;Se=i,ba=s,Vt=c}km(e)}else i.subtreeFlags&8772&&a!==null?(a.return=i,Se=a):km(e)}}function km(e){for(;Se!==null;){var t=Se;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Vt||lc(5,t);break;case 1:var n=t.stateNode;if(t.flags&4&&!Vt)if(r===null)n.componentDidMount();else{var i=t.elementType===t.type?r.memoizedProps:Dr(t.type,r.memoizedProps);n.componentDidUpdate(i,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;a!==null&&um(t,a,n);break;case 3:var l=t.updateQueue;if(l!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}um(t,l,r)}break;case 5:var s=t.stateNode;if(r===null&&t.flags&4){r=s;var o=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":o.autoFocus&&r.focus();break;case"img":o.src&&(r.src=o.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var p=c.memoizedState;if(p!==null){var u=p.dehydrated;u!==null&&bo(u)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(ce(163))}Vt||t.flags&512&&_h(t)}catch(f){ft(t,t.return,f)}}if(t===e){Se=null;break}if(r=t.sibling,r!==null){r.return=t.return,Se=r;break}Se=t.return}}function Lm(e){for(;Se!==null;){var t=Se;if(t===e){Se=null;break}var r=t.sibling;if(r!==null){r.return=t.return,Se=r;break}Se=t.return}}function Tm(e){for(;Se!==null;){var t=Se;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{lc(4,t)}catch(o){ft(t,r,o)}break;case 1:var n=t.stateNode;if(typeof n.componentDidMount=="function"){var i=t.return;try{n.componentDidMount()}catch(o){ft(t,i,o)}}var a=t.return;try{_h(t)}catch(o){ft(t,a,o)}break;case 5:var l=t.return;try{_h(t)}catch(o){ft(t,l,o)}}}catch(o){ft(t,t.return,o)}if(t===e){Se=null;break}var s=t.sibling;if(s!==null){s.return=t.return,Se=s;break}Se=t.return}}var Ib=Math.ceil,Rl=yn.ReactCurrentDispatcher,Qd=yn.ReactCurrentOwner,xr=yn.ReactCurrentBatchConfig,qe=0,Pt=null,vt=null,Ft=0,cr=0,Ks=qn(0),Ct=0,Io=null,xs=0,cc=0,Zd=0,oo=null,nr=null,ef=0,mi=1/0,an=null,Dl=!1,Sh=null,$n=null,Ca=!1,Pn=null,Ml=0,ao=0,xh=null,Qa=-1,Za=0;function er(){return qe&6?pt():Qa!==-1?Qa:Qa=pt()}function Hn(e){return e.mode&1?qe&2&&Ft!==0?Ft&-Ft:vb.transition!==null?(Za===0&&(Za=C_()),Za):(e=Qe,e!==0||(e=window.event,e=e===void 0?16:M_(e.type)),e):1}function Or(e,t,r,n){if(50<ao)throw ao=0,xh=null,Error(ce(185));qo(e,r,n),(!(qe&2)||e!==Pt)&&(e===Pt&&(!(qe&2)&&(cc|=r),Ct===4&&Mn(e,Ft)),ar(e,n),r===1&&qe===0&&!(t.mode&1)&&(mi=pt()+500,ic&&Xn()))}function ar(e,t){var r=e.callbackNode;vx(e,t);var n=pl(e,e===Pt?Ft:0);if(n===0)r!==null&&Np(r),e.callbackNode=null,e.callbackPriority=0;else if(t=n&-n,e.callbackPriority!==t){if(r!=null&&Np(r),t===1)e.tag===0?gb(Rm.bind(null,e)):Y_(Rm.bind(null,e)),db(function(){!(qe&6)&&Xn()}),r=null;else{switch(E_(n)){case 1:r=kd;break;case 4:r=x_;break;case 16:r=fl;break;case 536870912:r=b_;break;default:r=fl}r=q0(r,H0.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function H0(e,t){if(Qa=-1,Za=0,qe&6)throw Error(ce(327));var r=e.callbackNode;if(ni()&&e.callbackNode!==r)return null;var n=pl(e,e===Pt?Ft:0);if(n===0)return null;if(n&30||n&e.expiredLanes||t)t=Al(e,n);else{t=n;var i=qe;qe|=2;var a=U0();(Pt!==e||Ft!==t)&&(an=null,mi=pt()+500,ms(e,t));do try{Nb();break}catch(s){z0(e,s)}while(!0);Fd(),Rl.current=a,qe=i,vt!==null?t=0:(Pt=null,Ft=0,t=Ct)}if(t!==0){if(t===2&&(i=Xu(e),i!==0&&(n=i,t=bh(e,i))),t===1)throw r=Io,ms(e,0),Mn(e,n),ar(e,pt()),r;if(t===6)Mn(e,n);else{if(i=e.current.alternate,!(n&30)&&!Bb(i)&&(t=Al(e,n),t===2&&(a=Xu(e),a!==0&&(n=a,t=bh(e,a))),t===1))throw r=Io,ms(e,0),Mn(e,n),ar(e,pt()),r;switch(e.finishedWork=i,e.finishedLanes=n,t){case 0:case 1:throw Error(ce(345));case 2:os(e,nr,an);break;case 3:if(Mn(e,n),(n&130023424)===n&&(t=ef+500-pt(),10<t)){if(pl(e,0)!==0)break;if(i=e.suspendedLanes,(i&n)!==n){er(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=nh(os.bind(null,e,nr,an),t);break}os(e,nr,an);break;case 4:if(Mn(e,n),(n&4194240)===n)break;for(t=e.eventTimes,i=-1;0<n;){var l=31-Br(n);a=1<<l,l=t[l],l>i&&(i=l),n&=~a}if(n=i,n=pt()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*Ib(n/1960))-n,10<n){e.timeoutHandle=nh(os.bind(null,e,nr,an),n);break}os(e,nr,an);break;case 5:os(e,nr,an);break;default:throw Error(ce(329))}}}return ar(e,pt()),e.callbackNode===r?H0.bind(null,e):null}function bh(e,t){var r=oo;return e.current.memoizedState.isDehydrated&&(ms(e,t).flags|=256),e=Al(e,t),e!==2&&(t=nr,nr=r,t!==null&&Ch(t)),e}function Ch(e){nr===null?nr=e:nr.push.apply(nr,e)}function Bb(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var n=0;n<r.length;n++){var i=r[n],a=i.getSnapshot;i=i.value;try{if(!Nr(a(),i))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;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 Mn(e,t){for(t&=~Zd,t&=~cc,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-Br(t),n=1<<r;e[r]=-1,t&=~n}}function Rm(e){if(qe&6)throw Error(ce(327));ni();var t=pl(e,0);if(!(t&1))return ar(e,pt()),null;var r=Al(e,t);if(e.tag!==0&&r===2){var n=Xu(e);n!==0&&(t=n,r=bh(e,n))}if(r===1)throw r=Io,ms(e,0),Mn(e,t),ar(e,pt()),r;if(r===6)throw Error(ce(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,os(e,nr,an),ar(e,pt()),null}function tf(e,t){var r=qe;qe|=1;try{return e(t)}finally{qe=r,qe===0&&(mi=pt()+500,ic&&Xn())}}function bs(e){Pn!==null&&Pn.tag===0&&!(qe&6)&&ni();var t=qe;qe|=1;var r=xr.transition,n=Qe;try{if(xr.transition=null,Qe=1,e)return e()}finally{Qe=n,xr.transition=r,qe=t,!(qe&6)&&Xn()}}function rf(){cr=Ks.current,nt(Ks)}function ms(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,hb(r)),vt!==null)for(r=vt.return;r!==null;){var n=r;switch(Od(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&yl();break;case 3:fi(),nt(ir),nt(Xt),Vd();break;case 5:Wd(n);break;case 4:fi();break;case 13:nt(at);break;case 19:nt(at);break;case 10:$d(n.type._context);break;case 22:case 23:rf()}r=r.return}if(Pt=e,vt=e=zn(e.current,null),Ft=cr=t,Ct=0,Io=null,Zd=cc=xs=0,nr=oo=null,cs!==null){for(t=0;t<cs.length;t++)if(r=cs[t],n=r.interleaved,n!==null){r.interleaved=null;var i=n.next,a=r.pending;if(a!==null){var l=a.next;a.next=i,n.next=l}r.pending=n}cs=null}return e}function z0(e,t){do{var r=vt;try{if(Fd(),Xa.current=Tl,Ll){for(var n=ct.memoizedState;n!==null;){var i=n.queue;i!==null&&(i.pending=null),n=n.next}Ll=!1}if(Ss=0,Lt=St=ct=null,so=!1,Mo=0,Qd.current=null,r===null||r.return===null){Ct=1,Io=t,vt=null;break}e:{var a=e,l=r.return,s=r,o=t;if(t=Ft,s.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){var c=o,p=s,u=p.tag;if(!(p.mode&1)&&(u===0||u===11||u===15)){var f=p.alternate;f?(p.updateQueue=f.updateQueue,p.memoizedState=f.memoizedState,p.lanes=f.lanes):(p.updateQueue=null,p.memoizedState=null)}var _=gm(l);if(_!==null){_.flags&=-257,vm(_,l,s,a,t),_.mode&1&&mm(a,c,t),t=_,o=c;var y=t.updateQueue;if(y===null){var v=new Set;v.add(o),t.updateQueue=v}else y.add(o);break e}else{if(!(t&1)){mm(a,c,t),nf();break e}o=Error(ce(426))}}else if(it&&s.mode&1){var h=gm(l);if(h!==null){!(h.flags&65536)&&(h.flags|=256),vm(h,l,s,a,t),Nd(pi(o,s));break e}}a=o=pi(o,s),Ct!==4&&(Ct=2),oo===null?oo=[a]:oo.push(a),a=l;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var m=E0(a,o,t);cm(a,m);break e;case 1:s=o;var d=a.type,g=a.stateNode;if(!(a.flags&128)&&(typeof d.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&($n===null||!$n.has(g)))){a.flags|=65536,t&=-t,a.lanes|=t;var w=k0(a,s,t);cm(a,w);break e}}a=a.return}while(a!==null)}V0(r)}catch(b){t=b,vt===r&&r!==null&&(vt=r=r.return);continue}break}while(!0)}function U0(){var e=Rl.current;return Rl.current=Tl,e===null?Tl:e}function nf(){(Ct===0||Ct===3||Ct===2)&&(Ct=4),Pt===null||!(xs&268435455)&&!(cc&268435455)||Mn(Pt,Ft)}function Al(e,t){var r=qe;qe|=2;var n=U0();(Pt!==e||Ft!==t)&&(an=null,ms(e,t));do try{Ob();break}catch(i){z0(e,i)}while(!0);if(Fd(),qe=r,Rl.current=n,vt!==null)throw Error(ce(261));return Pt=null,Ft=0,Ct}function Ob(){for(;vt!==null;)W0(vt)}function Nb(){for(;vt!==null&&!lx();)W0(vt)}function W0(e){var t=G0(e.alternate,e,cr);e.memoizedProps=e.pendingProps,t===null?V0(e):vt=t,Qd.current=null}function V0(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=Db(r,t),r!==null){r.flags&=32767,vt=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ct=6,vt=null;return}}else if(r=Rb(r,t,cr),r!==null){vt=r;return}if(t=t.sibling,t!==null){vt=t;return}vt=t=e}while(t!==null);Ct===0&&(Ct=5)}function os(e,t,r){var n=Qe,i=xr.transition;try{xr.transition=null,Qe=1,jb(e,t,r,n)}finally{xr.transition=i,Qe=n}return null}function jb(e,t,r,n){do ni();while(Pn!==null);if(qe&6)throw Error(ce(327));r=e.finishedWork;var i=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(ce(177));e.callbackNode=null,e.callbackPriority=0;var a=r.lanes|r.childLanes;if(_x(e,a),e===Pt&&(vt=Pt=null,Ft=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||Ca||(Ca=!0,q0(fl,function(){return ni(),null})),a=(r.flags&15990)!==0,r.subtreeFlags&15990||a){a=xr.transition,xr.transition=null;var l=Qe;Qe=1;var s=qe;qe|=4,Qd.current=null,Ab(e,r),F0(r,e),sb(th),ml=!!eh,th=eh=null,e.current=r,Pb(r),cx(),qe=s,Qe=l,xr.transition=a}else e.current=r;if(Ca&&(Ca=!1,Pn=e,Ml=i),a=e.pendingLanes,a===0&&($n=null),dx(r.stateNode),ar(e,pt()),t!==null)for(n=e.onRecoverableError,r=0;r<t.length;r++)i=t[r],n(i.value,{componentStack:i.stack,digest:i.digest});if(Dl)throw Dl=!1,e=Sh,Sh=null,e;return Ml&1&&e.tag!==0&&ni(),a=e.pendingLanes,a&1?e===xh?ao++:(ao=0,xh=e):ao=0,Xn(),null}function ni(){if(Pn!==null){var e=E_(Ml),t=xr.transition,r=Qe;try{if(xr.transition=null,Qe=16>e?16:e,Pn===null)var n=!1;else{if(e=Pn,Pn=null,Ml=0,qe&6)throw Error(ce(331));var i=qe;for(qe|=4,Se=e.current;Se!==null;){var a=Se,l=a.child;if(Se.flags&16){var s=a.deletions;if(s!==null){for(var o=0;o<s.length;o++){var c=s[o];for(Se=c;Se!==null;){var p=Se;switch(p.tag){case 0:case 11:case 15:io(8,p,a)}var u=p.child;if(u!==null)u.return=p,Se=u;else for(;Se!==null;){p=Se;var f=p.sibling,_=p.return;if(O0(p),p===c){Se=null;break}if(f!==null){f.return=_,Se=f;break}Se=_}}}var y=a.alternate;if(y!==null){var v=y.child;if(v!==null){y.child=null;do{var h=v.sibling;v.sibling=null,v=h}while(v!==null)}}Se=a}}if(a.subtreeFlags&2064&&l!==null)l.return=a,Se=l;else e:for(;Se!==null;){if(a=Se,a.flags&2048)switch(a.tag){case 0:case 11:case 15:io(9,a,a.return)}var m=a.sibling;if(m!==null){m.return=a.return,Se=m;break e}Se=a.return}}var d=e.current;for(Se=d;Se!==null;){l=Se;var g=l.child;if(l.subtreeFlags&2064&&g!==null)g.return=l,Se=g;else e:for(l=d;Se!==null;){if(s=Se,s.flags&2048)try{switch(s.tag){case 0:case 11:case 15:lc(9,s)}}catch(b){ft(s,s.return,b)}if(s===l){Se=null;break e}var w=s.sibling;if(w!==null){w.return=s.return,Se=w;break e}Se=s.return}}if(qe=i,Xn(),Ur&&typeof Ur.onPostCommitFiberRoot=="function")try{Ur.onPostCommitFiberRoot(ec,e)}catch{}n=!0}return n}finally{Qe=r,xr.transition=t}}return!1}function Dm(e,t,r){t=pi(r,t),t=E0(e,t,1),e=Fn(e,t,1),t=er(),e!==null&&(qo(e,1,t),ar(e,t))}function ft(e,t,r){if(e.tag===3)Dm(e,e,r);else for(;t!==null;){if(t.tag===3){Dm(t,e,r);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&($n===null||!$n.has(n))){e=pi(r,e),e=k0(t,e,1),t=Fn(t,e,1),e=er(),t!==null&&(qo(t,1,e),ar(t,e));break}}t=t.return}}function Fb(e,t,r){var n=e.pingCache;n!==null&&n.delete(t),t=er(),e.pingedLanes|=e.suspendedLanes&r,Pt===e&&(Ft&r)===r&&(Ct===4||Ct===3&&(Ft&130023424)===Ft&&500>pt()-ef?ms(e,0):Zd|=r),ar(e,t)}function K0(e,t){t===0&&(e.mode&1?(t=pa,pa<<=1,!(pa&130023424)&&(pa=4194304)):t=1);var r=er();e=gn(e,t),e!==null&&(qo(e,t,r),ar(e,r))}function $b(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),K0(e,r)}function Hb(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,i=e.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(ce(314))}n!==null&&n.delete(t),K0(e,r)}var G0;G0=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||ir.current)sr=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return sr=!1,Tb(e,t,r);sr=!!(e.flags&131072)}else sr=!1,it&&t.flags&1048576&&J_(t,xl,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;Ja(e,t),e=t.pendingProps;var i=ui(t,Xt.current);ri(t,r),i=Gd(null,t,n,e,i,r);var a=qd();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,or(n)?(a=!0,wl(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,zd(t),i.updater=ac,t.stateNode=i,i._reactInternals=t,uh(t,n,e,r),t=fh(null,t,n,!0,a,r)):(t.tag=0,it&&a&&Bd(t),Jt(null,t,i,r),t=t.child),t;case 16:n=t.elementType;e:{switch(Ja(e,t),e=t.pendingProps,i=n._init,n=i(n._payload),t.type=n,i=t.tag=Ub(n),e=Dr(n,e),i){case 0:t=dh(null,t,n,e,r);break e;case 1:t=wm(null,t,n,e,r);break e;case 11:t=_m(null,t,n,e,r);break e;case 14:t=ym(null,t,n,Dr(n.type,e),r);break e}throw Error(ce(306,n,""))}return t;case 0:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Dr(n,i),dh(e,t,n,i,r);case 1:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Dr(n,i),wm(e,t,n,i,r);case 3:e:{if(D0(t),e===null)throw Error(ce(387));n=t.pendingProps,a=t.memoizedState,i=a.element,n0(e,t),El(t,n,null,r);var l=t.memoizedState;if(n=l.element,a.isDehydrated)if(a={element:n,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){i=pi(Error(ce(423)),t),t=Sm(e,t,n,r,i);break e}else if(n!==i){i=pi(Error(ce(424)),t),t=Sm(e,t,n,r,i);break e}else for(hr=jn(t.stateNode.containerInfo.firstChild),dr=t,it=!0,Pr=null,r=t0(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(hi(),n===i){t=vn(e,t,r);break e}Jt(e,t,n,r)}t=t.child}return t;case 5:return s0(t),e===null&&ah(t),n=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,l=i.children,rh(n,i)?l=null:a!==null&&rh(n,a)&&(t.flags|=32),R0(e,t),Jt(e,t,l,r),t.child;case 6:return e===null&&ah(t),null;case 13:return M0(e,t,r);case 4:return Ud(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=di(t,null,n,r):Jt(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Dr(n,i),_m(e,t,n,i,r);case 7:return Jt(e,t,t.pendingProps,r),t.child;case 8:return Jt(e,t,t.pendingProps.children,r),t.child;case 12:return Jt(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,i=t.pendingProps,a=t.memoizedProps,l=i.value,Ze(bl,n._currentValue),n._currentValue=l,a!==null)if(Nr(a.value,l)){if(a.children===i.children&&!ir.current){t=vn(e,t,r);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var s=a.dependencies;if(s!==null){l=a.child;for(var o=s.firstContext;o!==null;){if(o.context===n){if(a.tag===1){o=dn(-1,r&-r),o.tag=2;var c=a.updateQueue;if(c!==null){c=c.shared;var p=c.pending;p===null?o.next=o:(o.next=p.next,p.next=o),c.pending=o}}a.lanes|=r,o=a.alternate,o!==null&&(o.lanes|=r),lh(a.return,r,t),s.lanes|=r;break}o=o.next}}else if(a.tag===10)l=a.type===t.type?null:a.child;else if(a.tag===18){if(l=a.return,l===null)throw Error(ce(341));l.lanes|=r,s=l.alternate,s!==null&&(s.lanes|=r),lh(l,r,t),l=a.sibling}else l=a.child;if(l!==null)l.return=a;else for(l=a;l!==null;){if(l===t){l=null;break}if(a=l.sibling,a!==null){a.return=l.return,l=a;break}l=l.return}a=l}Jt(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,n=t.pendingProps.children,ri(t,r),i=Cr(i),n=n(i),t.flags|=1,Jt(e,t,n,r),t.child;case 14:return n=t.type,i=Dr(n,t.pendingProps),i=Dr(n.type,i),ym(e,t,n,i,r);case 15:return L0(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Dr(n,i),Ja(e,t),t.tag=1,or(n)?(e=!0,wl(t)):e=!1,ri(t,r),C0(t,n,i),uh(t,n,i,r),fh(null,t,n,!0,e,r);case 19:return A0(e,t,r);case 22:return T0(e,t,r)}throw Error(ce(156,t.tag))};function q0(e,t){return S_(e,t)}function zb(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function wr(e,t,r,n){return new zb(e,t,r,n)}function sf(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ub(e){if(typeof e=="function")return sf(e)?1:0;if(e!=null){if(e=e.$$typeof,e===bd)return 11;if(e===Cd)return 14}return 2}function zn(e,t){var r=e.alternate;return r===null?(r=wr(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function el(e,t,r,n,i,a){var l=2;if(n=e,typeof e=="function")sf(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case Os:return gs(r.children,i,a,t);case xd:l=8,i|=8;break;case Iu:return e=wr(12,r,t,i|2),e.elementType=Iu,e.lanes=a,e;case Bu:return e=wr(13,r,t,i),e.elementType=Bu,e.lanes=a,e;case Ou:return e=wr(19,r,t,i),e.elementType=Ou,e.lanes=a,e;case s_:return uc(r,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case r_:l=10;break e;case n_:l=9;break e;case bd:l=11;break e;case Cd:l=14;break e;case Ln:l=16,n=null;break e}throw Error(ce(130,e==null?e:typeof e,""))}return t=wr(l,r,t,i),t.elementType=e,t.type=n,t.lanes=a,t}function gs(e,t,r,n){return e=wr(7,e,n,t),e.lanes=r,e}function uc(e,t,r,n){return e=wr(22,e,n,t),e.elementType=s_,e.lanes=r,e.stateNode={isHidden:!1},e}function Jc(e,t,r){return e=wr(6,e,null,t),e.lanes=r,e}function Qc(e,t,r){return t=wr(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Wb(e,t,r,n,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ac(0),this.expirationTimes=Ac(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ac(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function of(e,t,r,n,i,a,l,s,o){return e=new Wb(e,t,r,s,o),t===1?(t=1,a===!0&&(t|=8)):t=0,a=wr(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},zd(a),e}function Vb(e,t,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Bs,key:n==null?null:""+n,children:e,containerInfo:t,implementation:r}}function X0(e){if(!e)return Wn;e=e._reactInternals;e:{if(Es(e)!==e||e.tag!==1)throw Error(ce(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(or(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(ce(171))}if(e.tag===1){var r=e.type;if(or(r))return X_(e,r,t)}return t}function Y0(e,t,r,n,i,a,l,s,o){return e=of(r,n,!0,e,i,a,l,s,o),e.context=X0(null),r=e.current,n=er(),i=Hn(r),a=dn(n,i),a.callback=t??null,Fn(r,a,i),e.current.lanes=i,qo(e,i,n),ar(e,n),e}function hc(e,t,r,n){var i=t.current,a=er(),l=Hn(i);return r=X0(r),t.context===null?t.context=r:t.pendingContext=r,t=dn(a,l),t.payload={element:e},n=n===void 0?null:n,n!==null&&(t.callback=n),e=Fn(i,t,l),e!==null&&(Or(e,i,l,a),qa(e,i,l)),l}function Pl(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Mm(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function af(e,t){Mm(e,t),(e=e.alternate)&&Mm(e,t)}function Kb(){return null}var J0=typeof reportError=="function"?reportError:function(e){console.error(e)};function lf(e){this._internalRoot=e}dc.prototype.render=lf.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(ce(409));hc(e,t,null,null)};dc.prototype.unmount=lf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;bs(function(){hc(null,e,null,null)}),t[mn]=null}};function dc(e){this._internalRoot=e}dc.prototype.unstable_scheduleHydration=function(e){if(e){var t=T_();e={blockedOn:null,target:e,priority:t};for(var r=0;r<Dn.length&&t!==0&&t<Dn[r].priority;r++);Dn.splice(r,0,e),r===0&&D_(e)}};function cf(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function fc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Am(){}function Gb(e,t,r,n,i){if(i){if(typeof n=="function"){var a=n;n=function(){var c=Pl(l);a.call(c)}}var l=Y0(t,n,e,0,null,!1,!1,"",Am);return e._reactRootContainer=l,e[mn]=l.current,ko(e.nodeType===8?e.parentNode:e),bs(),l}for(;i=e.lastChild;)e.removeChild(i);if(typeof n=="function"){var s=n;n=function(){var c=Pl(o);s.call(c)}}var o=of(e,0,!1,null,null,!1,!1,"",Am);return e._reactRootContainer=o,e[mn]=o.current,ko(e.nodeType===8?e.parentNode:e),bs(function(){hc(t,o,r,n)}),o}function pc(e,t,r,n,i){var a=r._reactRootContainer;if(a){var l=a;if(typeof i=="function"){var s=i;i=function(){var o=Pl(l);s.call(o)}}hc(t,l,e,i)}else l=Gb(r,t,e,i,n);return Pl(l)}k_=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=Gi(t.pendingLanes);r!==0&&(Ld(t,r|1),ar(t,pt()),!(qe&6)&&(mi=pt()+500,Xn()))}break;case 13:bs(function(){var n=gn(e,1);if(n!==null){var i=er();Or(n,e,1,i)}}),af(e,1)}};Td=function(e){if(e.tag===13){var t=gn(e,134217728);if(t!==null){var r=er();Or(t,e,134217728,r)}af(e,134217728)}};L_=function(e){if(e.tag===13){var t=Hn(e),r=gn(e,t);if(r!==null){var n=er();Or(r,e,t,n)}af(e,t)}};T_=function(){return Qe};R_=function(e,t){var r=Qe;try{return Qe=e,t()}finally{Qe=r}};Ku=function(e,t,r){switch(t){case"input":if(Fu(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var n=r[t];if(n!==e&&n.form===e.form){var i=sc(n);if(!i)throw Error(ce(90));o_(n),Fu(n,i)}}}break;case"textarea":l_(e,r);break;case"select":t=r.value,t!=null&&Qs(e,!!r.multiple,t,!1)}};m_=tf;g_=bs;var qb={usingClientEntryPoint:!1,Events:[Yo,$s,sc,f_,p_,tf]},Fi={findFiberByHostInstance:ls,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Xb={bundleType:Fi.bundleType,version:Fi.version,rendererPackageName:Fi.rendererPackageName,rendererConfig:Fi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:yn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=y_(e),e===null?null:e.stateNode},findFiberByHostInstance:Fi.findFiberByHostInstance||Kb,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ea=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ea.isDisabled&&Ea.supportsFiber)try{ec=Ea.inject(Xb),Ur=Ea}catch{}}pr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=qb;pr.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!cf(t))throw Error(ce(200));return Vb(e,t,null,r)};pr.createRoot=function(e,t){if(!cf(e))throw Error(ce(299));var r=!1,n="",i=J0;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=of(e,1,!1,null,null,r,!1,n,i),e[mn]=t.current,ko(e.nodeType===8?e.parentNode:e),new lf(t)};pr.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(ce(188)):(e=Object.keys(e).join(","),Error(ce(268,e)));return e=y_(t),e=e===null?null:e.stateNode,e};pr.flushSync=function(e){return bs(e)};pr.hydrate=function(e,t,r){if(!fc(t))throw Error(ce(200));return pc(null,e,t,!0,r)};pr.hydrateRoot=function(e,t,r){if(!cf(e))throw Error(ce(405));var n=r!=null&&r.hydratedSources||null,i=!1,a="",l=J0;if(r!=null&&(r.unstable_strictMode===!0&&(i=!0),r.identifierPrefix!==void 0&&(a=r.identifierPrefix),r.onRecoverableError!==void 0&&(l=r.onRecoverableError)),t=Y0(t,null,e,1,r??null,i,!1,a,l),e[mn]=t.current,ko(e),n)for(e=0;e<n.length;e++)r=n[e],i=r._getVersion,i=i(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,i]:t.mutableSourceEagerHydrationData.push(r,i);return new dc(t)};pr.render=function(e,t,r){if(!fc(t))throw Error(ce(200));return pc(null,e,t,!1,r)};pr.unmountComponentAtNode=function(e){if(!fc(e))throw Error(ce(40));return e._reactRootContainer?(bs(function(){pc(null,null,e,!1,function(){e._reactRootContainer=null,e[mn]=null})}),!0):!1};pr.unstable_batchedUpdates=tf;pr.unstable_renderSubtreeIntoContainer=function(e,t,r,n){if(!fc(r))throw Error(ce(200));if(e==null||e._reactInternals===void 0)throw Error(ce(38));return pc(e,t,r,!1,n)};pr.version="18.3.1-next-f1338f8080-20240426";function Q0(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Q0)}catch(e){console.error(e)}}Q0(),Qv.exports=pr;var hn=Qv.exports,Z0,Pm=hn;Z0=Pm.createRoot,Pm.hydrateRoot;const Im=e=>{let t;const r=new Set,n=(c,p)=>{const u=typeof c=="function"?c(t):c;if(!Object.is(u,t)){const f=t;t=p??(typeof u!="object"||u===null)?u:Object.assign({},t,u),r.forEach(_=>_(t,f))}},i=()=>t,s={setState:n,getState:i,getInitialState:()=>o,subscribe:c=>(r.add(c),()=>r.delete(c))},o=t=e(n,i,s);return s},Yb=e=>e?Im(e):Im,Jb=e=>e;function Qb(e,t=Jb){const r=gt.useSyncExternalStore(e.subscribe,gt.useCallback(()=>t(e.getState()),[e,t]),gt.useCallback(()=>t(e.getInitialState()),[e,t]));return gt.useDebugValue(r),r}const Zb=e=>{const t=Yb(e),r=n=>Qb(t,n);return Object.assign(r,t),r},uf=e=>Zb;function mc(e,t){let r;try{r=e()}catch{return}return{getItem:i=>{var a;const l=o=>o===null?null:JSON.parse(o,void 0),s=(a=r.getItem(i))!=null?a:null;return s instanceof Promise?s.then(l):l(s)},setItem:(i,a)=>r.setItem(i,JSON.stringify(a,void 0)),removeItem:i=>r.removeItem(i)}}const Eh=e=>t=>{try{const r=e(t);return r instanceof Promise?r:{then(n){return Eh(n)(r)},catch(n){return this}}}catch(r){return{then(n){return this},catch(n){return Eh(n)(r)}}}},eC=(e,t)=>(r,n,i)=>{let a={storage:mc(()=>localStorage),partialize:v=>v,version:0,merge:(v,h)=>({...h,...v}),...t},l=!1;const s=new Set,o=new Set;let c=a.storage;if(!c)return e((...v)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),r(...v)},n,i);const p=()=>{const v=a.partialize({...n()});return c.setItem(a.name,{state:v,version:a.version})},u=i.setState;i.setState=(v,h)=>(u(v,h),p());const f=e((...v)=>(r(...v),p()),n,i);i.getInitialState=()=>f;let _;const y=()=>{var v,h;if(!c)return;l=!1,s.forEach(d=>{var g;return d((g=n())!=null?g:f)});const m=((h=a.onRehydrateStorage)==null?void 0:h.call(a,(v=n())!=null?v:f))||void 0;return Eh(c.getItem.bind(c))(a.name).then(d=>{if(d)if(typeof d.version=="number"&&d.version!==a.version){if(a.migrate){const g=a.migrate(d.state,d.version);return g instanceof Promise?g.then(w=>[!0,w]):[!0,g]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,d.state];return[!1,void 0]}).then(d=>{var g;const[w,b]=d;if(_=a.merge(b,(g=n())!=null?g:f),r(_,!0),w)return p()}).then(()=>{m==null||m(_,void 0),_=n(),l=!0,o.forEach(d=>d(_))}).catch(d=>{m==null||m(void 0,d)})};return i.persist={setOptions:v=>{a={...a,...v},v.storage&&(c=v.storage)},clearStorage:()=>{c==null||c.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>y(),hasHydrated:()=>l,onHydrate:v=>(s.add(v),()=>{s.delete(v)}),onFinishHydration:v=>(o.add(v),()=>{o.delete(v)})},a.skipHydration||y(),_||f},hf=eC;function tC(){const e=new Map;return{getItem:t=>e.get(t)??null,setItem:(t,r)=>{e.set(t,r)},removeItem:t=>{e.delete(t)}}}const Ps=tC(),df={getItem:e=>{if(typeof localStorage>"u")return Ps.getItem(e);try{return localStorage.getItem(e)}catch{return Ps.getItem(e)}},setItem:(e,t)=>{if(typeof localStorage>"u"){Ps.setItem(e,t);return}try{localStorage.setItem(e,t)}catch{Ps.setItem(e,t)}},removeItem:e=>{if(typeof localStorage>"u"){Ps.removeItem(e);return}try{localStorage.removeItem(e)}catch{Ps.removeItem(e)}}},kh="~/Documents/GitHub",rC="claude",si=50,nC=typeof navigator<"u"&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&!/iPhone|iPad|iPod/.test(navigator.userAgent),sC=!(nC&&(typeof devicePixelRatio<"u"?devicePixelRatio:1)>1),Lh=[{id:"jetbrains-mono",label:"JetBrains Mono",family:'"JetBrains Mono Variable", "JetBrains Mono", "SF Mono", "Fira Code", ui-monospace, monospace'},{id:"system",label:"System Default",family:'ui-monospace, "SF Mono", Menlo, Monaco, "Cascadia Code", "Consolas", monospace'},{id:"custom",label:"Custom",family:""}];function iC(e,t){if(e==="custom"&&t.trim())return t.trim();const r=Lh.find(n=>n.id===e);return(r==null?void 0:r.family)||Lh[0].family}const ka=[{id:"claude",label:"Claude",command:"claude",isBuiltIn:!0,agentType:"claude"},{id:"codex",label:"Codex",command:"codex",isBuiltIn:!0,agentType:"codex"},{id:"pi",label:"Pi",command:"pi",isBuiltIn:!0,agentType:"pi"}];function oC(e){if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.id=="string"&&t.id.length>=1&&t.id.length<=128&&typeof t.label=="string"&&t.label.trim().length>=1&&t.label.length<=64&&typeof t.command=="string"&&t.command.trim().length>=1&&t.command.length<=1024&&typeof t.isBuiltIn=="boolean"&&(t.agentType===void 0||t.agentType==="claude"||t.agentType==="codex"||t.agentType==="pi")}function Bm(e){return{...e,label:e.label.trim().slice(0,64),command:e.command.trim().slice(0,1024)}}function $i(e){return e.command.trim()}function Om(e){for(let r=0;r<100;r++){const n=`custom-${Date.now()}-${Math.random().toString(36).slice(2,6)}`;if(!e.has(n))return n}return`custom-${Date.now()}-${Math.random().toString(36).slice(2)}`}function Nm(e,t){var r;return e.some(n=>n.id===t)?t:((r=e[0])==null?void 0:r.id)||"claude"}const ey=180,ty=400,aC=240,pe=uf()(hf((e,t)=>({defaultProjectDir:kh,setDefaultProjectDir:r=>e({defaultProjectDir:r}),defaultCommand:rC,setDefaultCommand:r=>e({defaultCommand:r}),lastProjectPath:null,setLastProjectPath:r=>e({lastProjectPath:r}),recentPaths:[],addRecentPath:r=>e(n=>({recentPaths:[r,...n.recentPaths.filter(i=>i!==r)].slice(0,5)})),sessionSortMode:"created",setSessionSortMode:r=>e({sessionSortMode:r}),sessionSortDirection:"desc",setSessionSortDirection:r=>e({sessionSortDirection:r}),manualSessionOrder:[],setManualSessionOrder:r=>e({manualSessionOrder:r}),useWebGL:sC,setUseWebGL:r=>e({useWebGL:r}),fontSize:13,setFontSize:r=>e({fontSize:Math.max(6,Math.min(24,r))}),lineHeight:1,setLineHeight:r=>e({lineHeight:Math.max(1,Math.min(2,r))}),letterSpacing:0,setLetterSpacing:r=>e({letterSpacing:Math.max(-3,Math.min(3,r))}),fontOption:"jetbrains-mono",setFontOption:r=>e({fontOption:r}),customFontFamily:"",setCustomFontFamily:r=>e({customFontFamily:r.slice(0,256)}),shortcutModifier:"auto",setShortcutModifier:r=>e({shortcutModifier:r}),showProjectName:!0,setShowProjectName:r=>e({showProjectName:r}),showLastUserMessage:!0,setShowLastUserMessage:r=>e({showLastUserMessage:r}),showSessionIdPrefix:!1,setShowSessionIdPrefix:r=>e({showSessionIdPrefix:r}),inactiveSessionsExpanded:!1,setInactiveSessionsExpanded:r=>e({inactiveSessionsExpanded:r}),sidebarWidth:aC,setSidebarWidth:r=>e({sidebarWidth:Math.max(ey,Math.min(ty,r))}),projectFilters:[],setProjectFilters:r=>e({projectFilters:r}),hostFilters:[],setHostFilters:r=>e({hostFilters:r}),soundOnPermission:!1,setSoundOnPermission:r=>e({soundOnPermission:r}),soundOnIdle:!1,setSoundOnIdle:r=>e({soundOnIdle:r}),commandPresets:ka,setCommandPresets:r=>e({commandPresets:r}),defaultPresetId:"claude",setDefaultPresetId:r=>e({defaultPresetId:r}),updatePresetCommand:(r,n)=>{const{commandPresets:i}=t(),a=i.map(l=>l.id===r?{...l,command:n.trim().slice(0,1024)}:l);e({commandPresets:a})},addPreset:r=>{const{commandPresets:n}=t();if(n.length>=si){console.warn("[agentboard:settings] Max presets reached");return}const i=new Set(n.map(l=>l.id)),a={...Bm({...r,id:"",isBuiltIn:!1}),id:Om(i),isBuiltIn:!1};e({commandPresets:[...n,a]})},removePreset:r=>{const{commandPresets:n,defaultPresetId:i}=t(),a=n.find(o=>o.id===r);if(!a||a.isBuiltIn)return;const l=n.filter(o=>o.id!==r),s=r===i?Nm(l,i):i;e({commandPresets:l,defaultPresetId:s})}}),{name:"agentboard-settings",storage:mc(()=>df),version:4,partialize:e=>{const{manualSessionOrder:t,...r}=e;return r},migrate:(e,t)=>{const r=e,n=f=>{if(typeof f.command=="string")return f;const _=typeof f.baseCommand=="string"?f.baseCommand.trim():"",y=typeof f.modifiers=="string"?f.modifiers.trim():"",v=y?`${_} ${y}`:_;return{id:f.id,label:f.label,command:v||"claude",isBuiltIn:f.isBuiltIn,agentType:f.agentType}};if(t===0||!Array.isArray(r.commandPresets)){const f=typeof r.defaultCommand=="string"?r.defaultCommand:"claude",_=[...ka];let y="claude";if(f==="codex")y="codex";else if(f!=="claude"){const v=new Set(_.map(m=>m.id)),h={id:Om(v),label:"Migrated",command:f,isBuiltIn:!1};_.push(h),y=h.id}return console.info("[agentboard:settings] Migrated from v0 to v2"),{...r,commandPresets:_,defaultPresetId:y,defaultCommand:f,recentPaths:[]}}const l=r.commandPresets.map(n).filter(oC);if(!(l.some(f=>f.id==="claude")&&l.some(f=>f.id==="codex"))||l.length===0)return console.warn("[agentboard:settings] Invalid presets, resetting to defaults"),{...r,commandPresets:ka,defaultPresetId:"claude"};const o=l.length>si?[...l.filter(f=>f.isBuiltIn),...l.filter(f=>!f.isBuiltIn).slice(0,si-2)]:l,c=new Set(o.map(f=>f.id)),p=ka.filter(f=>f.isBuiltIn&&!c.has(f.id)),u=[...o,...p];return t<4&&console.info(`[agentboard:settings] Migrated from v${t} to v4 (ensured all built-in presets)`),{...r,commandPresets:u.map(Bm),defaultPresetId:Nm(o,r.defaultPresetId)}}}));function lC({title:e,titleId:t,...r},n){return k.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?k.createElement("title",{id:t},e):null,k.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v4m0 4h.01M10.615 3.892L2.39 18.098c-.456.788-.684 1.182-.65 1.506a1 1 0 00.406.705c.263.191.718.191 1.629.191h16.45c.91 0 1.365 0 1.628-.191a1 1 0 00.407-.705c.034-.324-.195-.718-.65-1.506L13.383 3.892c-.454-.785-.681-1.178-.978-1.31a1 1 0 00-.813 0c-.296.132-.523.525-.978 1.31z"}))}const cC=k.forwardRef(lC);function uC({title:e,titleId:t,...r},n){return k.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?k.createElement("title",{id:t},e):null,k.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 9l6 6 6-6"}))}const ff=k.forwardRef(uC);function hC({title:e,titleId:t,...r},n){return k.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?k.createElement("title",{id:t},e):null,k.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 18l6-6-6-6"}))}const dC=k.forwardRef(hC);function fC({title:e,titleId:t,...r},n){return k.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?k.createElement("title",{id:t},e):null,k.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15c-.932 0-1.398 0-1.765-.152a2 2 0 01-1.083-1.083C2 13.398 2 12.932 2 12V5.2c0-1.12 0-1.68.218-2.108a2 2 0 01.874-.874C3.52 2 4.08 2 5.2 2H12c.932 0 1.398 0 1.765.152a2 2 0 011.083 1.083C15 3.602 15 4.068 15 5m-2.8 17h6.6c1.12 0 1.68 0 2.108-.218a2 2 0 00.874-.874C22 20.48 22 19.92 22 18.8v-6.6c0-1.12 0-1.68-.218-2.108a2 2 0 00-.874-.874C20.48 9 19.92 9 18.8 9h-6.6c-1.12 0-1.68 0-2.108.218a2 2 0 00-.874.874C9 10.52 9 11.08 9 12.2v6.6c0 1.12 0 1.68.218 2.108a2 2 0 00.874.874C10.52 22 11.08 22 12.2 22z"}))}const ry=k.forwardRef(fC);function pC({title:e,titleId:t,...r},n){return k.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?k.createElement("title",{id:t},e):null,k.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20 4v1.4c0 3.36 0 5.04-.654 6.324a6 6 0 01-2.622 2.622C15.44 15 13.76 15 10.4 15H4m0 0l5-5m-5 5l5 5"}))}const mC=k.forwardRef(pC);function gC({title:e,titleId:t,...r},n){return k.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?k.createElement("title",{id:t},e):null,k.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 13a1 1 0 100-2 1 1 0 000 2zM12 6a1 1 0 100-2 1 1 0 000 2zM12 20a1 1 0 100-2 1 1 0 000 2z"}))}const vC=k.forwardRef(gC);function _C({title:e,titleId:t,...r},n){return k.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?k.createElement("title",{id:t},e):null,k.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11 4H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 00-1.311 1.311C2 6.28 2 7.12 2 8.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 001.311 1.311C4.28 22 5.12 22 6.8 22h8.4c1.68 0 2.52 0 3.162-.327a3 3 0 001.311-1.311C20 19.72 20 18.88 20 17.2V13M8 16h1.675c.489 0 .733 0 .963-.055.204-.05.4-.13.579-.24.201-.123.374-.296.72-.642L21.5 5.5a2.121 2.121 0 00-3-3l-9.563 9.563c-.346.346-.519.519-.642.72a2 2 0 00-.24.579c-.055.23-.055.474-.055.963V16z"}))}const ny=k.forwardRef(_C);function yC({title:e,titleId:t,...r},n){return k.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?k.createElement("title",{id:t},e):null,k.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14 2.27V6.4c0 .56 0 .84.109 1.054a1 1 0 00.437.437c.214.11.494.11 1.054.11h4.13M16 13H8m8 4H8m2-8H8m6-7H8.8c-1.68 0-2.52 0-3.162.327a3 3 0 00-1.311 1.311C4 4.28 4 5.12 4 6.8v10.4c0 1.68 0 2.52.327 3.162a3 3 0 001.311 1.311C6.28 22 7.12 22 8.8 22h6.4c1.68 0 2.52 0 3.162-.327a3 3 0 001.311-1.311C20 19.72 20 18.88 20 17.2V8l-6-6z"}))}const sy=k.forwardRef(yC);function wC({title:e,titleId:t,...r},n){return k.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?k.createElement("title",{id:t},e):null,k.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 7l-1.116-2.231c-.32-.642-.481-.963-.72-1.198a2 2 0 00-.748-.462C10.1 3 9.74 3 9.022 3H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 00-.874.874C2 4.52 2 5.08 2 6.2V7m0 0h15.2c1.68 0 2.52 0 3.162.327a3 3 0 011.311 1.311C22 9.28 22 10.12 22 11.8v4.4c0 1.68 0 2.52-.327 3.162a3 3 0 01-1.311 1.311C19.72 21 18.88 21 17.2 21H6.8c-1.68 0-2.52 0-3.162-.327a3 3 0 01-1.311-1.311C2 18.72 2 17.88 2 16.2V7z"}))}const SC=k.forwardRef(wC);function xC({title:e,titleId:t,...r},n){return k.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?k.createElement("title",{id:t},e):null,k.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.9 11.444v2.778m0-2.778V4.778c0-.92.761-1.667 1.7-1.667s1.7.746 1.7 1.667m-3.4 6.666c0-.92-.761-1.666-1.7-1.666s-1.7.746-1.7 1.666v2.223C3.5 18.269 7.306 22 12 22s8.5-3.731 8.5-8.333V8.11c0-.92-.761-1.667-1.7-1.667s-1.7.747-1.7 1.667m-6.8-3.333v6.11m0-6.11V3.667C10.3 2.747 11.061 2 12 2s1.7.746 1.7 1.667v1.11m0 0v6.112m0-6.111c0-.92.761-1.667 1.7-1.667s1.7.746 1.7 1.667V8.11m0 0v2.778"}))}const bC=k.forwardRef(xC);function CC({title:e,titleId:t,...r},n){return k.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?k.createElement("title",{id:t},e):null,k.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 12h18M3 6h18M3 18h18"}))}const EC=k.forwardRef(CC);function kC({title:e,titleId:t,...r},n){return k.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?k.createElement("title",{id:t},e):null,k.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 9l-3 3m0 0l3 3m-3-3h20M9 5l3-3m0 0l3 3m-3-3v20m3-3l-3 3m0 0l-3-3M19 9l3 3m0 0l-3 3"}))}const LC=k.forwardRef(kC);function TC({title:e,titleId:t,...r},n){return k.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?k.createElement("title",{id:t},e):null,k.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.377 15.616L2.72 21.273m8.974-14.631l-1.56 1.56a2.1 2.1 0 01-.264.242 1 1 0 01-.207.111c-.082.032-.17.05-.347.085l-3.665.733c-.952.19-1.428.286-1.65.537a1 1 0 00-.243.8c.046.333.39.677 1.076 1.363l7.086 7.086c.686.687 1.03 1.03 1.362 1.076a1 1 0 00.801-.242c.251-.223.346-.7.537-1.651l.733-3.665c.035-.176.053-.265.085-.347a.997.997 0 01.11-.207c.051-.072.115-.136.242-.263l1.561-1.561c.082-.082.122-.122.167-.158.04-.031.082-.06.126-.085.05-.029.103-.051.208-.097l2.495-1.069c.727-.312 1.091-.467 1.256-.72a1 1 0 00.144-.747c-.06-.295-.34-.575-.9-1.135l-5.142-5.143c-.56-.56-.84-.84-1.135-.9a1 1 0 00-.748.145c-.252.165-.407.529-.72 1.256l-1.068 2.495a2.096 2.096 0 01-.097.208.998.998 0 01-.085.126 2.065 2.065 0 01-.158.167z"}))}const Il=k.forwardRef(TC);function RC({title:e,titleId:t,...r},n){return k.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?k.createElement("title",{id:t},e):null,k.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 5v14m-7-7h14"}))}const iy=k.forwardRef(RC);function DC({title:e,titleId:t,...r},n){return k.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?k.createElement("title",{id:t},e):null,k.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 15a3 3 0 100-6 3 3 0 000 6z"}),k.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18.727 14.727a1.5 1.5 0 00.3 1.655l.055.054a1.816 1.816 0 010 2.573 1.818 1.818 0 01-2.573 0l-.055-.055a1.5 1.5 0 00-1.654-.3 1.5 1.5 0 00-.91 1.373v.155a1.818 1.818 0 11-3.636 0V20.1a1.5 1.5 0 00-.981-1.373 1.5 1.5 0 00-1.655.3l-.054.055a1.818 1.818 0 01-3.106-1.287 1.818 1.818 0 01.533-1.286l.054-.055a1.5 1.5 0 00.3-1.654 1.5 1.5 0 00-1.372-.91h-.155a1.818 1.818 0 110-3.636H3.9a1.5 1.5 0 001.373-.981 1.5 1.5 0 00-.3-1.655l-.055-.054A1.818 1.818 0 117.491 4.99l.054.054a1.5 1.5 0 001.655.3h.073a1.5 1.5 0 00.909-1.372v-.155a1.818 1.818 0 013.636 0V3.9a1.499 1.499 0 00.91 1.373 1.5 1.5 0 001.654-.3l.054-.055a1.817 1.817 0 012.573 0 1.819 1.819 0 010 2.573l-.055.054a1.5 1.5 0 00-.3 1.655v.073a1.5 1.5 0 001.373.909h.155a1.818 1.818 0 010 3.636H20.1a1.499 1.499 0 00-1.373.91z"}))}const MC=k.forwardRef(DC);function AC({title:e,titleId:t,...r},n){return k.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?k.createElement("title",{id:t},e):null,k.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 15a3 3 0 100-6 3 3 0 000 6z"}),k.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.29 19.371l.584 1.315a2.213 2.213 0 004.044 0l.585-1.315a2.426 2.426 0 012.47-1.423l1.43.152a2.212 2.212 0 002.022-3.502l-.847-1.164a2.428 2.428 0 01-.46-1.434c0-.513.163-1.014.465-1.429l.847-1.163a2.212 2.212 0 00-2.023-3.502l-1.43.152a2.433 2.433 0 01-1.47-.312 2.425 2.425 0 01-1-1.117l-.588-1.315a2.212 2.212 0 00-4.045 0L9.29 4.63c-.207.468-.558.86-1 1.117-.445.256-.96.365-1.47.312l-1.435-.152a2.212 2.212 0 00-2.022 3.502l.847 1.163a2.43 2.43 0 010 2.858l-.847 1.163a2.21 2.21 0 00.786 3.273c.381.195.81.274 1.236.23l1.43-.153a2.434 2.434 0 012.475 1.43z"}))}const PC=k.forwardRef(AC);function IC({title:e,titleId:t,...r},n){return k.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?k.createElement("title",{id:t},e):null,k.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 17l6-6-6-6m8 14h8"}))}const BC=k.forwardRef(IC);function OC({title:e,titleId:t,...r},n){return k.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?k.createElement("title",{id:t},e):null,k.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18 6L6 18M6 6l12 12"}))}const Th=k.forwardRef(OC);function Qo(){if(typeof navigator>"u")return!1;const e=navigator.userAgent,t=/iPad|iPhone|iPod/.test(e),r=navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1;return t||r}function NC(){return typeof navigator>"u"?!1:Qo()&&navigator.standalone===!0}function jC(){return typeof navigator>"u"?!1:navigator.platform.toUpperCase().indexOf("MAC")>=0}function Zo(e){return e==="auto"?jC()?"ctrl-option":"ctrl-shift":e}const FC={"ctrl-option":"⌃⌥","ctrl-shift":"⌃⇧","cmd-option":"⌘⌥","cmd-shift":"⌘⇧"};function ii(e){return FC[e]}function $C(e,t){switch(t){case"ctrl-option":return e.ctrlKey&&e.altKey&&!e.metaKey&&!e.shiftKey;case"ctrl-shift":return e.ctrlKey&&e.shiftKey&&!e.metaKey&&!e.altKey;case"cmd-option":return e.metaKey&&e.altKey&&!e.ctrlKey&&!e.shiftKey;case"cmd-shift":return e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey}}const HC={connected:"bg-working",connecting:"bg-approval",reconnecting:"bg-approval",disconnected:"bg-danger"};function zC({connectionStatus:e,onNewSession:t,onOpenSettings:r,tailscaleIp:n}){const[i,a]=k.useState(!1),l=pe(c=>c.shortcutModifier),s=ii(Zo(l)),o=()=>{if(!n)return;const c=`http://${n}:${window.location.port||"4040"}`;navigator.clipboard.writeText(c),a(!0),setTimeout(()=>a(!1),1500)};return T.jsxs("header",{className:"flex h-10 shrink-0 items-center justify-between border-b border-border bg-elevated px-3",children:[T.jsxs("div",{className:"flex items-center gap-2",children:[T.jsx("h1",{className:"text-sm font-semibold tracking-tight text-primary text-balance",children:"AGENTBOARD"}),T.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted",children:[T.jsx("span",{className:`h-2 w-2 rounded-full ${HC[e]}`}),n&&T.jsxs("button",{onClick:o,className:"ml-3 inline-flex items-center gap-1 text-muted/70 hover:text-muted transition-colors cursor-pointer",title:"Tailscale IP - click to copy remote access URL",children:[T.jsx("span",{className:"leading-none translate-y-[1px]",children:i?"Copied!":n}),!i&&T.jsx(ry,{width:12,height:12,className:"shrink-0"})]})]})]}),T.jsxs("div",{className:"flex items-center gap-1.5",children:[T.jsx("button",{onClick:t,className:"flex h-7 w-7 items-center justify-center rounded bg-accent text-white hover:bg-accent/90 active:scale-95 transition-all",title:`New session (${s}N)`,"aria-label":"New session",children:T.jsx(iy,{width:16,height:16})}),T.jsx("button",{onClick:r,className:"flex h-7 w-7 items-center justify-center rounded border border-border text-secondary hover:bg-hover hover:text-primary active:scale-95 transition-all",title:"Settings","aria-label":"Settings",children:T.jsx(PC,{width:14,height:14})})]})]})}const pf=k.createContext({});function mf(e){const t=k.useRef(null);return t.current===null&&(t.current=e()),t.current}const gf=typeof window<"u",oy=gf?k.useLayoutEffect:k.useEffect,gc=k.createContext(null);function vf(e,t){e.indexOf(t)===-1&&e.push(t)}function _f(e,t){const r=e.indexOf(t);r>-1&&e.splice(r,1)}const Kr=(e,t,r)=>r>t?t:r<e?e:r;let yf=()=>{};const _n={},ay=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function ly(e){return typeof e=="object"&&e!==null}const cy=e=>/^0[^.\s]+$/u.test(e);function wf(e){let t;return()=>(t===void 0&&(t=e()),t)}const br=e=>e,UC=(e,t)=>r=>t(e(r)),ea=(...e)=>e.reduce(UC),Bo=(e,t,r)=>{const n=t-e;return n===0?1:(r-e)/n};class Sf{constructor(){this.subscriptions=[]}add(t){return vf(this.subscriptions,t),()=>_f(this.subscriptions,t)}notify(t,r,n){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,r,n);else for(let a=0;a<i;a++){const l=this.subscriptions[a];l&&l(t,r,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const fn=e=>e*1e3,Sr=e=>e/1e3;function uy(e,t){return t?e*(1e3/t):0}const hy=(e,t,r)=>(((1-3*r+3*t)*e+(3*r-6*t))*e+3*t)*e,WC=1e-7,VC=12;function KC(e,t,r,n,i){let a,l,s=0;do l=t+(r-t)/2,a=hy(l,n,i)-e,a>0?r=l:t=l;while(Math.abs(a)>WC&&++s<VC);return l}function ta(e,t,r,n){if(e===t&&r===n)return br;const i=a=>KC(a,0,1,e,r);return a=>a===0||a===1?a:hy(i(a),t,n)}const dy=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,fy=e=>t=>1-e(1-t),py=ta(.33,1.53,.69,.99),xf=fy(py),my=dy(xf),gy=e=>(e*=2)<1?.5*xf(e):.5*(2-Math.pow(2,-10*(e-1))),bf=e=>1-Math.sin(Math.acos(e)),vy=fy(bf),_y=dy(bf),GC=ta(.42,0,1,1),qC=ta(0,0,.58,1),yy=ta(.42,0,.58,1),XC=e=>Array.isArray(e)&&typeof e[0]!="number",wy=e=>Array.isArray(e)&&typeof e[0]=="number",YC={linear:br,easeIn:GC,easeInOut:yy,easeOut:qC,circIn:bf,circInOut:_y,circOut:vy,backIn:xf,backInOut:my,backOut:py,anticipate:gy},JC=e=>typeof e=="string",jm=e=>{if(wy(e)){yf(e.length===4);const[t,r,n,i]=e;return ta(t,r,n,i)}else if(JC(e))return YC[e];return e},La=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function QC(e,t){let r=new Set,n=new Set,i=!1,a=!1;const l=new WeakSet;let s={delta:0,timestamp:0,isProcessing:!1};function o(p){l.has(p)&&(c.schedule(p),e()),p(s)}const c={schedule:(p,u=!1,f=!1)=>{const y=f&&i?r:n;return u&&l.add(p),y.has(p)||y.add(p),p},cancel:p=>{n.delete(p),l.delete(p)},process:p=>{if(s=p,i){a=!0;return}i=!0,[r,n]=[n,r],r.forEach(o),r.clear(),i=!1,a&&(a=!1,c.process(p))}};return c}const ZC=40;function Sy(e,t){let r=!1,n=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>r=!0,l=La.reduce((g,w)=>(g[w]=QC(a),g),{}),{setup:s,read:o,resolveKeyframes:c,preUpdate:p,update:u,preRender:f,render:_,postRender:y}=l,v=()=>{const g=_n.useManualTiming?i.timestamp:performance.now();r=!1,_n.useManualTiming||(i.delta=n?1e3/60:Math.max(Math.min(g-i.timestamp,ZC),1)),i.timestamp=g,i.isProcessing=!0,s.process(i),o.process(i),c.process(i),p.process(i),u.process(i),f.process(i),_.process(i),y.process(i),i.isProcessing=!1,r&&t&&(n=!1,e(v))},h=()=>{r=!0,n=!0,i.isProcessing||e(v)};return{schedule:La.reduce((g,w)=>{const b=l[w];return g[w]=(x,C=!1,S=!1)=>(r||h(),b.schedule(x,C,S)),g},{}),cancel:g=>{for(let w=0;w<La.length;w++)l[La[w]].cancel(g)},state:i,steps:l}}const{schedule:st,cancel:Vn,state:Nt,steps:Zc}=Sy(typeof requestAnimationFrame<"u"?requestAnimationFrame:br,!0);let tl;function e2(){tl=void 0}const Qt={now:()=>(tl===void 0&&Qt.set(Nt.isProcessing||_n.useManualTiming?Nt.timestamp:performance.now()),tl),set:e=>{tl=e,queueMicrotask(e2)}},xy=e=>t=>typeof t=="string"&&t.startsWith(e),by=xy("--"),t2=xy("var(--"),Cf=e=>t2(e)?r2.test(e.split("/*")[0].trim()):!1,r2=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Fm(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const bi={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Oo={...bi,transform:e=>Kr(0,1,e)},Ta={...bi,default:1},lo=e=>Math.round(e*1e5)/1e5,Ef=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function n2(e){return e==null}const s2=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,kf=(e,t)=>r=>!!(typeof r=="string"&&s2.test(r)&&r.startsWith(e)||t&&!n2(r)&&Object.prototype.hasOwnProperty.call(r,t)),Cy=(e,t,r)=>n=>{if(typeof n!="string")return n;const[i,a,l,s]=n.match(Ef);return{[e]:parseFloat(i),[t]:parseFloat(a),[r]:parseFloat(l),alpha:s!==void 0?parseFloat(s):1}},i2=e=>Kr(0,255,e),eu={...bi,transform:e=>Math.round(i2(e))},hs={test:kf("rgb","red"),parse:Cy("red","green","blue"),transform:({red:e,green:t,blue:r,alpha:n=1})=>"rgba("+eu.transform(e)+", "+eu.transform(t)+", "+eu.transform(r)+", "+lo(Oo.transform(n))+")"};function o2(e){let t="",r="",n="",i="";return e.length>5?(t=e.substring(1,3),r=e.substring(3,5),n=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),r=e.substring(2,3),n=e.substring(3,4),i=e.substring(4,5),t+=t,r+=r,n+=n,i+=i),{red:parseInt(t,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}}const Rh={test:kf("#"),parse:o2,transform:hs.transform},ra=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),kn=ra("deg"),Vr=ra("%"),we=ra("px"),a2=ra("vh"),l2=ra("vw"),$m={...Vr,parse:e=>Vr.parse(e)/100,transform:e=>Vr.transform(e*100)},Gs={test:kf("hsl","hue"),parse:Cy("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:r,alpha:n=1})=>"hsla("+Math.round(e)+", "+Vr.transform(lo(t))+", "+Vr.transform(lo(r))+", "+lo(Oo.transform(n))+")"},mt={test:e=>hs.test(e)||Rh.test(e)||Gs.test(e),parse:e=>hs.test(e)?hs.parse(e):Gs.test(e)?Gs.parse(e):Rh.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?hs.transform(e):Gs.transform(e),getAnimatableNone:e=>{const t=mt.parse(e);return t.alpha=0,mt.transform(t)}},c2=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function u2(e){var t,r;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Ef))==null?void 0:t.length)||0)+(((r=e.match(c2))==null?void 0:r.length)||0)>0}const Ey="number",ky="color",h2="var",d2="var(",Hm="${}",f2=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function No(e){const t=e.toString(),r=[],n={color:[],number:[],var:[]},i=[];let a=0;const s=t.replace(f2,o=>(mt.test(o)?(n.color.push(a),i.push(ky),r.push(mt.parse(o))):o.startsWith(d2)?(n.var.push(a),i.push(h2),r.push(o)):(n.number.push(a),i.push(Ey),r.push(parseFloat(o))),++a,Hm)).split(Hm);return{values:r,split:s,indexes:n,types:i}}function Ly(e){return No(e).values}function Ty(e){const{split:t,types:r}=No(e),n=t.length;return i=>{let a="";for(let l=0;l<n;l++)if(a+=t[l],i[l]!==void 0){const s=r[l];s===Ey?a+=lo(i[l]):s===ky?a+=mt.transform(i[l]):a+=i[l]}return a}}const p2=e=>typeof e=="number"?0:mt.test(e)?mt.getAnimatableNone(e):e;function m2(e){const t=Ly(e);return Ty(e)(t.map(p2))}const Kn={test:u2,parse:Ly,createTransformer:Ty,getAnimatableNone:m2};function tu(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function g2({hue:e,saturation:t,lightness:r,alpha:n}){e/=360,t/=100,r/=100;let i=0,a=0,l=0;if(!t)i=a=l=r;else{const s=r<.5?r*(1+t):r+t-r*t,o=2*r-s;i=tu(o,s,e+1/3),a=tu(o,s,e),l=tu(o,s,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(l*255),alpha:n}}function Bl(e,t){return r=>r>0?t:e}const lt=(e,t,r)=>e+(t-e)*r,ru=(e,t,r)=>{const n=e*e,i=r*(t*t-n)+n;return i<0?0:Math.sqrt(i)},v2=[Rh,hs,Gs],_2=e=>v2.find(t=>t.test(e));function zm(e){const t=_2(e);if(!t)return!1;let r=t.parse(e);return t===Gs&&(r=g2(r)),r}const Um=(e,t)=>{const r=zm(e),n=zm(t);if(!r||!n)return Bl(e,t);const i={...r};return a=>(i.red=ru(r.red,n.red,a),i.green=ru(r.green,n.green,a),i.blue=ru(r.blue,n.blue,a),i.alpha=lt(r.alpha,n.alpha,a),hs.transform(i))},Dh=new Set(["none","hidden"]);function y2(e,t){return Dh.has(e)?r=>r<=0?e:t:r=>r>=1?t:e}function w2(e,t){return r=>lt(e,t,r)}function Lf(e){return typeof e=="number"?w2:typeof e=="string"?Cf(e)?Bl:mt.test(e)?Um:b2:Array.isArray(e)?Ry:typeof e=="object"?mt.test(e)?Um:S2:Bl}function Ry(e,t){const r=[...e],n=r.length,i=e.map((a,l)=>Lf(a)(a,t[l]));return a=>{for(let l=0;l<n;l++)r[l]=i[l](a);return r}}function S2(e,t){const r={...e,...t},n={};for(const i in r)e[i]!==void 0&&t[i]!==void 0&&(n[i]=Lf(e[i])(e[i],t[i]));return i=>{for(const a in n)r[a]=n[a](i);return r}}function x2(e,t){const r=[],n={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){const a=t.types[i],l=e.indexes[a][n[a]],s=e.values[l]??0;r[i]=s,n[a]++}return r}const b2=(e,t)=>{const r=Kn.createTransformer(t),n=No(e),i=No(t);return n.indexes.var.length===i.indexes.var.length&&n.indexes.color.length===i.indexes.color.length&&n.indexes.number.length>=i.indexes.number.length?Dh.has(e)&&!i.values.length||Dh.has(t)&&!n.values.length?y2(e,t):ea(Ry(x2(n,i),i.values),r):Bl(e,t)};function Dy(e,t,r){return typeof e=="number"&&typeof t=="number"&&typeof r=="number"?lt(e,t,r):Lf(e)(e,t)}const C2=e=>{const t=({timestamp:r})=>e(r);return{start:(r=!0)=>st.update(t,r),stop:()=>Vn(t),now:()=>Nt.isProcessing?Nt.timestamp:Qt.now()}},My=(e,t,r=10)=>{let n="";const i=Math.max(Math.round(t/r),2);for(let a=0;a<i;a++)n+=Math.round(e(a/(i-1))*1e4)/1e4+", ";return`linear(${n.substring(0,n.length-2)})`},Ol=2e4;function Tf(e){let t=0;const r=50;let n=e.next(t);for(;!n.done&&t<Ol;)t+=r,n=e.next(t);return t>=Ol?1/0:t}function E2(e,t=100,r){const n=r({...e,keyframes:[0,t]}),i=Math.min(Tf(n),Ol);return{type:"keyframes",ease:a=>n.next(i*a).value/t,duration:Sr(i)}}const k2=5;function Ay(e,t,r){const n=Math.max(t-k2,0);return uy(r-e(n),t-n)}const ht={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},nu=.001;function L2({duration:e=ht.duration,bounce:t=ht.bounce,velocity:r=ht.velocity,mass:n=ht.mass}){let i,a,l=1-t;l=Kr(ht.minDamping,ht.maxDamping,l),e=Kr(ht.minDuration,ht.maxDuration,Sr(e)),l<1?(i=c=>{const p=c*l,u=p*e,f=p-r,_=Mh(c,l),y=Math.exp(-u);return nu-f/_*y},a=c=>{const u=c*l*e,f=u*r+r,_=Math.pow(l,2)*Math.pow(c,2)*e,y=Math.exp(-u),v=Mh(Math.pow(c,2),l);return(-i(c)+nu>0?-1:1)*((f-_)*y)/v}):(i=c=>{const p=Math.exp(-c*e),u=(c-r)*e+1;return-nu+p*u},a=c=>{const p=Math.exp(-c*e),u=(r-c)*(e*e);return p*u});const s=5/e,o=R2(i,a,s);if(e=fn(e),isNaN(o))return{stiffness:ht.stiffness,damping:ht.damping,duration:e};{const c=Math.pow(o,2)*n;return{stiffness:c,damping:l*2*Math.sqrt(n*c),duration:e}}}const T2=12;function R2(e,t,r){let n=r;for(let i=1;i<T2;i++)n=n-e(n)/t(n);return n}function Mh(e,t){return e*Math.sqrt(1-t*t)}const D2=["duration","bounce"],M2=["stiffness","damping","mass"];function Wm(e,t){return t.some(r=>e[r]!==void 0)}function A2(e){let t={velocity:ht.velocity,stiffness:ht.stiffness,damping:ht.damping,mass:ht.mass,isResolvedFromDuration:!1,...e};if(!Wm(e,M2)&&Wm(e,D2))if(e.visualDuration){const r=e.visualDuration,n=2*Math.PI/(r*1.2),i=n*n,a=2*Kr(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:ht.mass,stiffness:i,damping:a}}else{const r=L2(e);t={...t,...r,mass:ht.mass},t.isResolvedFromDuration=!0}return t}function Nl(e=ht.visualDuration,t=ht.bounce){const r=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:n,restDelta:i}=r;const a=r.keyframes[0],l=r.keyframes[r.keyframes.length-1],s={done:!1,value:a},{stiffness:o,damping:c,mass:p,duration:u,velocity:f,isResolvedFromDuration:_}=A2({...r,velocity:-Sr(r.velocity||0)}),y=f||0,v=c/(2*Math.sqrt(o*p)),h=l-a,m=Sr(Math.sqrt(o/p)),d=Math.abs(h)<5;n||(n=d?ht.restSpeed.granular:ht.restSpeed.default),i||(i=d?ht.restDelta.granular:ht.restDelta.default);let g;if(v<1){const b=Mh(m,v);g=x=>{const C=Math.exp(-v*m*x);return l-C*((y+v*m*h)/b*Math.sin(b*x)+h*Math.cos(b*x))}}else if(v===1)g=b=>l-Math.exp(-m*b)*(h+(y+m*h)*b);else{const b=m*Math.sqrt(v*v-1);g=x=>{const C=Math.exp(-v*m*x),S=Math.min(b*x,300);return l-C*((y+v*m*h)*Math.sinh(S)+b*h*Math.cosh(S))/b}}const w={calculatedDuration:_&&u||null,next:b=>{const x=g(b);if(_)s.done=b>=u;else{let C=b===0?y:0;v<1&&(C=b===0?fn(y):Ay(g,b,x));const S=Math.abs(C)<=n,E=Math.abs(l-x)<=i;s.done=S&&E}return s.value=s.done?l:x,s},toString:()=>{const b=Math.min(Tf(w),Ol),x=My(C=>w.next(b*C).value,b,30);return b+"ms "+x},toTransition:()=>{}};return w}Nl.applyToOptions=e=>{const t=E2(e,100,Nl);return e.ease=t.ease,e.duration=fn(t.duration),e.type="keyframes",e};function Ah({keyframes:e,velocity:t=0,power:r=.8,timeConstant:n=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:l,min:s,max:o,restDelta:c=.5,restSpeed:p}){const u=e[0],f={done:!1,value:u},_=S=>s!==void 0&&S<s||o!==void 0&&S>o,y=S=>s===void 0?o:o===void 0||Math.abs(s-S)<Math.abs(o-S)?s:o;let v=r*t;const h=u+v,m=l===void 0?h:l(h);m!==h&&(v=m-u);const d=S=>-v*Math.exp(-S/n),g=S=>m+d(S),w=S=>{const E=d(S),L=g(S);f.done=Math.abs(E)<=c,f.value=f.done?m:L};let b,x;const C=S=>{_(f.value)&&(b=S,x=Nl({keyframes:[f.value,y(f.value)],velocity:Ay(g,S,f.value),damping:i,stiffness:a,restDelta:c,restSpeed:p}))};return C(0),{calculatedDuration:null,next:S=>{let E=!1;return!x&&b===void 0&&(E=!0,w(S),C(S)),b!==void 0&&S>=b?x.next(S-b):(!E&&w(S),f)}}}function P2(e,t,r){const n=[],i=r||_n.mix||Dy,a=e.length-1;for(let l=0;l<a;l++){let s=i(e[l],e[l+1]);if(t){const o=Array.isArray(t)?t[l]||br:t;s=ea(o,s)}n.push(s)}return n}function I2(e,t,{clamp:r=!0,ease:n,mixer:i}={}){const a=e.length;if(yf(a===t.length),a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];const l=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());const s=P2(t,n,i),o=s.length,c=p=>{if(l&&p<e[0])return t[0];let u=0;if(o>1)for(;u<e.length-2&&!(p<e[u+1]);u++);const f=Bo(e[u],e[u+1],p);return s[u](f)};return r?p=>c(Kr(e[0],e[a-1],p)):c}function B2(e,t){const r=e[e.length-1];for(let n=1;n<=t;n++){const i=Bo(0,t,n);e.push(lt(r,1,i))}}function O2(e){const t=[0];return B2(t,e.length-1),t}function N2(e,t){return e.map(r=>r*t)}function j2(e,t){return e.map(()=>t||yy).splice(0,e.length-1)}function co({duration:e=300,keyframes:t,times:r,ease:n="easeInOut"}){const i=XC(n)?n.map(jm):jm(n),a={done:!1,value:t[0]},l=N2(r&&r.length===t.length?r:O2(t),e),s=I2(l,t,{ease:Array.isArray(i)?i:j2(t,i)});return{calculatedDuration:e,next:o=>(a.value=s(o),a.done=o>=e,a)}}const F2=e=>e!==null;function Rf(e,{repeat:t,repeatType:r="loop"},n,i=1){const a=e.filter(F2),s=i<0||t&&r!=="loop"&&t%2===1?0:a.length-1;return!s||n===void 0?a[s]:n}const $2={decay:Ah,inertia:Ah,tween:co,keyframes:co,spring:Nl};function Py(e){typeof e.type=="string"&&(e.type=$2[e.type])}class Df{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,r){return this.finished.then(t,r)}}const H2=e=>e/100;class Mf extends Df{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var n,i;const{motionValue:r}=this.options;r&&r.updatedAt!==Qt.now()&&this.tick(Qt.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(i=(n=this.options).onStop)==null||i.call(n))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;Py(t);const{type:r=co,repeat:n=0,repeatDelay:i=0,repeatType:a,velocity:l=0}=t;let{keyframes:s}=t;const o=r||co;o!==co&&typeof s[0]!="number"&&(this.mixKeyframes=ea(H2,Dy(s[0],s[1])),s=[0,100]);const c=o({...t,keyframes:s});a==="mirror"&&(this.mirroredGenerator=o({...t,keyframes:[...s].reverse(),velocity:-l})),c.calculatedDuration===null&&(c.calculatedDuration=Tf(c));const{calculatedDuration:p}=c;this.calculatedDuration=p,this.resolvedDuration=p+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=c}updateTime(t){const r=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=r}tick(t,r=!1){const{generator:n,totalDuration:i,mixKeyframes:a,mirroredGenerator:l,resolvedDuration:s,calculatedDuration:o}=this;if(this.startTime===null)return n.next(0);const{delay:c=0,keyframes:p,repeat:u,repeatType:f,repeatDelay:_,type:y,onUpdate:v,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),r?this.currentTime=t:this.updateTime(t);const m=this.currentTime-c*(this.playbackSpeed>=0?1:-1),d=this.playbackSpeed>=0?m<0:m>i;this.currentTime=Math.max(m,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let g=this.currentTime,w=n;if(u){const S=Math.min(this.currentTime,i)/s;let E=Math.floor(S),L=S%1;!L&&S>=1&&(L=1),L===1&&E--,E=Math.min(E,u+1),!!(E%2)&&(f==="reverse"?(L=1-L,_&&(L-=_/s)):f==="mirror"&&(w=l)),g=Kr(0,1,L)*s}const b=d?{done:!1,value:p[0]}:w.next(g);a&&(b.value=a(b.value));let{done:x}=b;!d&&o!==null&&(x=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const C=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&x);return C&&y!==Ah&&(b.value=Rf(p,this.options,h,this.speed)),v&&v(b.value),C&&this.finish(),b}then(t,r){return this.finished.then(t,r)}get duration(){return Sr(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Sr(t)}get time(){return Sr(this.currentTime)}set time(t){var r;t=fn(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),(r=this.driver)==null||r.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(Qt.now());const r=this.playbackSpeed!==t;this.playbackSpeed=t,r&&(this.time=Sr(this.currentTime))}play(){var i,a;if(this.isStopped)return;const{driver:t=C2,startTime:r}=this.options;this.driver||(this.driver=t(l=>this.tick(l))),(a=(i=this.options).onPlay)==null||a.call(i);const n=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=n):this.holdTime!==null?this.startTime=n-this.holdTime:this.startTime||(this.startTime=r??n),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Qt.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,r;this.notifyFinished(),this.teardown(),this.state="finished",(r=(t=this.options).onComplete)==null||r.call(t)}cancel(){var t,r;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(r=(t=this.options).onCancel)==null||r.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var r;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(r=this.driver)==null||r.stop(),t.observe(this)}}function z2(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const ds=e=>e*180/Math.PI,Ph=e=>{const t=ds(Math.atan2(e[1],e[0]));return Ih(t)},U2={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Ph,rotateZ:Ph,skewX:e=>ds(Math.atan(e[1])),skewY:e=>ds(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Ih=e=>(e=e%360,e<0&&(e+=360),e),Vm=Ph,Km=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Gm=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),W2={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Km,scaleY:Gm,scale:e=>(Km(e)+Gm(e))/2,rotateX:e=>Ih(ds(Math.atan2(e[6],e[5]))),rotateY:e=>Ih(ds(Math.atan2(-e[2],e[0]))),rotateZ:Vm,rotate:Vm,skewX:e=>ds(Math.atan(e[4])),skewY:e=>ds(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Bh(e){return e.includes("scale")?1:0}function Oh(e,t){if(!e||e==="none")return Bh(t);const r=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let n,i;if(r)n=W2,i=r;else{const s=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=U2,i=s}if(!i)return Bh(t);const a=n[t],l=i[1].split(",").map(K2);return typeof a=="function"?a(l):l[a]}const V2=(e,t)=>{const{transform:r="none"}=getComputedStyle(e);return Oh(r,t)};function K2(e){return parseFloat(e.trim())}const Ci=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ei=new Set(Ci),qm=e=>e===bi||e===we,G2=new Set(["x","y","z"]),q2=Ci.filter(e=>!G2.has(e));function X2(e){const t=[];return q2.forEach(r=>{const n=e.getValue(r);n!==void 0&&(t.push([r,n.get()]),n.set(r.startsWith("scale")?1:0))}),t}const In={width:({x:e},{paddingLeft:t="0",paddingRight:r="0"})=>e.max-e.min-parseFloat(t)-parseFloat(r),height:({y:e},{paddingTop:t="0",paddingBottom:r="0"})=>e.max-e.min-parseFloat(t)-parseFloat(r),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Oh(t,"x"),y:(e,{transform:t})=>Oh(t,"y")};In.translateX=In.x;In.translateY=In.y;const vs=new Set;let Nh=!1,jh=!1,Fh=!1;function Iy(){if(jh){const e=Array.from(vs).filter(n=>n.needsMeasurement),t=new Set(e.map(n=>n.element)),r=new Map;t.forEach(n=>{const i=X2(n);i.length&&(r.set(n,i),n.render())}),e.forEach(n=>n.measureInitialState()),t.forEach(n=>{n.render();const i=r.get(n);i&&i.forEach(([a,l])=>{var s;(s=n.getValue(a))==null||s.set(l)})}),e.forEach(n=>n.measureEndState()),e.forEach(n=>{n.suspendedScrollY!==void 0&&window.scrollTo(0,n.suspendedScrollY)})}jh=!1,Nh=!1,vs.forEach(e=>e.complete(Fh)),vs.clear()}function By(){vs.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(jh=!0)})}function Y2(){Fh=!0,By(),Iy(),Fh=!1}class Af{constructor(t,r,n,i,a,l=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=r,this.name=n,this.motionValue=i,this.element=a,this.isAsync=l}scheduleResolve(){this.state="scheduled",this.isAsync?(vs.add(this),Nh||(Nh=!0,st.read(By),st.resolveKeyframes(Iy))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:r,element:n,motionValue:i}=this;if(t[0]===null){const a=i==null?void 0:i.get(),l=t[t.length-1];if(a!==void 0)t[0]=a;else if(n&&r){const s=n.readValue(r,l);s!=null&&(t[0]=s)}t[0]===void 0&&(t[0]=l),i&&a===void 0&&i.set(t[0])}z2(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),vs.delete(this)}cancel(){this.state==="scheduled"&&(vs.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const J2=e=>e.startsWith("--");function Q2(e,t,r){J2(t)?e.style.setProperty(t,r):e.style[t]=r}const Z2=wf(()=>window.ScrollTimeline!==void 0),e5={};function t5(e,t){const r=wf(e);return()=>e5[t]??r()}const Oy=t5(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Xi=([e,t,r,n])=>`cubic-bezier(${e}, ${t}, ${r}, ${n})`,Xm={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Xi([0,.65,.55,1]),circOut:Xi([.55,0,1,.45]),backIn:Xi([.31,.01,.66,-.59]),backOut:Xi([.33,1.53,.69,.99])};function Ny(e,t){if(e)return typeof e=="function"?Oy()?My(e,t):"ease-out":wy(e)?Xi(e):Array.isArray(e)?e.map(r=>Ny(r,t)||Xm.easeOut):Xm[e]}function r5(e,t,r,{delay:n=0,duration:i=300,repeat:a=0,repeatType:l="loop",ease:s="easeOut",times:o}={},c=void 0){const p={[t]:r};o&&(p.offset=o);const u=Ny(s,i);Array.isArray(u)&&(p.easing=u);const f={delay:n,duration:i,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:a+1,direction:l==="reverse"?"alternate":"normal"};return c&&(f.pseudoElement=c),e.animate(p,f)}function jy(e){return typeof e=="function"&&"applyToOptions"in e}function n5({type:e,...t}){return jy(e)&&Oy()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class s5 extends Df{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:r,name:n,keyframes:i,pseudoElement:a,allowFlatten:l=!1,finalKeyframe:s,onComplete:o}=t;this.isPseudoElement=!!a,this.allowFlatten=l,this.options=t,yf(typeof t.type!="string");const c=n5(t);this.animation=r5(r,n,i,c,a),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!a){const p=Rf(i,this.options,s,this.speed);this.updateMotionValue?this.updateMotionValue(p):Q2(r,n,p),this.animation.cancel()}o==null||o(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,r;(r=(t=this.animation).finish)==null||r.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var t,r;this.isPseudoElement||(r=(t=this.animation).commitStyles)==null||r.call(t)}get duration(){var r,n;const t=((n=(r=this.animation.effect)==null?void 0:r.getComputedTiming)==null?void 0:n.call(r).duration)||0;return Sr(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Sr(t)}get time(){return Sr(Number(this.animation.currentTime)||0)}set time(t){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=fn(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,observe:r}){var n;return this.allowFlatten&&((n=this.animation.effect)==null||n.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&Z2()?(this.animation.timeline=t,br):r(this)}}const Fy={anticipate:gy,backInOut:my,circInOut:_y};function i5(e){return e in Fy}function o5(e){typeof e.ease=="string"&&i5(e.ease)&&(e.ease=Fy[e.ease])}const su=10;class a5 extends s5{constructor(t){o5(t),Py(t),super(t),t.startTime!==void 0&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:r,onUpdate:n,onComplete:i,element:a,...l}=this.options;if(!r)return;if(t!==void 0){r.set(t);return}const s=new Mf({...l,autoplay:!1}),o=Math.max(su,Qt.now()-this.startTime),c=Kr(0,su,o-su);r.setWithVelocity(s.sample(Math.max(0,o-c)).value,s.sample(o).value,c),s.stop()}}const Ym=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Kn.test(e)||e==="0")&&!e.startsWith("url("));function l5(e){const t=e[0];if(e.length===1)return!0;for(let r=0;r<e.length;r++)if(e[r]!==t)return!0}function c5(e,t,r,n){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const a=e[e.length-1],l=Ym(i,t),s=Ym(a,t);return!l||!s?!1:l5(e)||(r==="spring"||jy(r))&&n}function $h(e){e.duration=0,e.type="keyframes"}const u5=new Set(["opacity","clipPath","filter","transform"]),h5=wf(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function d5(e){var p;const{motionValue:t,name:r,repeatDelay:n,repeatType:i,damping:a,type:l}=e;if(!(((p=t==null?void 0:t.owner)==null?void 0:p.current)instanceof HTMLElement))return!1;const{onUpdate:o,transformTemplate:c}=t.owner.getProps();return h5()&&r&&u5.has(r)&&(r!=="transform"||!c)&&!o&&!n&&i!=="mirror"&&a!==0&&l!=="inertia"}const f5=40;class p5 extends Df{constructor({autoplay:t=!0,delay:r=0,type:n="keyframes",repeat:i=0,repeatDelay:a=0,repeatType:l="loop",keyframes:s,name:o,motionValue:c,element:p,...u}){var y;super(),this.stop=()=>{var v,h;this._animation&&(this._animation.stop(),(v=this.stopTimeline)==null||v.call(this)),(h=this.keyframeResolver)==null||h.cancel()},this.createdAt=Qt.now();const f={autoplay:t,delay:r,type:n,repeat:i,repeatDelay:a,repeatType:l,name:o,motionValue:c,element:p,...u},_=(p==null?void 0:p.KeyframeResolver)||Af;this.keyframeResolver=new _(s,(v,h,m)=>this.onKeyframesResolved(v,h,f,!m),o,c,p),(y=this.keyframeResolver)==null||y.scheduleResolve()}onKeyframesResolved(t,r,n,i){this.keyframeResolver=void 0;const{name:a,type:l,velocity:s,delay:o,isHandoff:c,onUpdate:p}=n;this.resolvedAt=Qt.now(),c5(t,a,l,s)||((_n.instantAnimations||!o)&&(p==null||p(Rf(t,n,r))),t[0]=t[t.length-1],$h(n),n.repeat=0);const f={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>f5?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:r,...n,keyframes:t},_=!c&&d5(f)?new a5({...f,element:f.motionValue.owner.current}):new Mf(f);_.finished.then(()=>this.notifyFinished()).catch(br),this.pendingTimeline&&(this.stopTimeline=_.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=_}get finished(){return this._animation?this.animation.finished:this._finished}then(t,r){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),Y2()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}const m5=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function g5(e){const t=m5.exec(e);if(!t)return[,];const[,r,n,i]=t;return[`--${r??n}`,i]}function $y(e,t,r=1){const[n,i]=g5(e);if(!n)return;const a=window.getComputedStyle(t).getPropertyValue(n);if(a){const l=a.trim();return ay(l)?parseFloat(l):l}return Cf(i)?$y(i,t,r+1):i}function Pf(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const Hy=new Set(["width","height","top","left","right","bottom",...Ci]),v5={test:e=>e==="auto",parse:e=>e},zy=e=>t=>t.test(e),Uy=[bi,we,Vr,kn,l2,a2,v5],Jm=e=>Uy.find(zy(e));function _5(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||cy(e):!0}const y5=new Set(["brightness","contrast","saturate","opacity"]);function w5(e){const[t,r]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[n]=r.match(Ef)||[];if(!n)return e;const i=r.replace(n,"");let a=y5.has(t)?1:0;return n!==r&&(a*=100),t+"("+a+i+")"}const S5=/\b([a-z-]*)\(.*?\)/gu,Hh={...Kn,getAnimatableNone:e=>{const t=e.match(S5);return t?t.map(w5).join(" "):e}},Qm={...bi,transform:Math.round},x5={rotate:kn,rotateX:kn,rotateY:kn,rotateZ:kn,scale:Ta,scaleX:Ta,scaleY:Ta,scaleZ:Ta,skew:kn,skewX:kn,skewY:kn,distance:we,translateX:we,translateY:we,translateZ:we,x:we,y:we,z:we,perspective:we,transformPerspective:we,opacity:Oo,originX:$m,originY:$m,originZ:we},If={borderWidth:we,borderTopWidth:we,borderRightWidth:we,borderBottomWidth:we,borderLeftWidth:we,borderRadius:we,radius:we,borderTopLeftRadius:we,borderTopRightRadius:we,borderBottomRightRadius:we,borderBottomLeftRadius:we,width:we,maxWidth:we,height:we,maxHeight:we,top:we,right:we,bottom:we,left:we,inset:we,insetBlock:we,insetBlockStart:we,insetBlockEnd:we,insetInline:we,insetInlineStart:we,insetInlineEnd:we,padding:we,paddingTop:we,paddingRight:we,paddingBottom:we,paddingLeft:we,paddingBlock:we,paddingBlockStart:we,paddingBlockEnd:we,paddingInline:we,paddingInlineStart:we,paddingInlineEnd:we,margin:we,marginTop:we,marginRight:we,marginBottom:we,marginLeft:we,marginBlock:we,marginBlockStart:we,marginBlockEnd:we,marginInline:we,marginInlineStart:we,marginInlineEnd:we,backgroundPositionX:we,backgroundPositionY:we,...x5,zIndex:Qm,fillOpacity:Oo,strokeOpacity:Oo,numOctaves:Qm},b5={...If,color:mt,backgroundColor:mt,outlineColor:mt,fill:mt,stroke:mt,borderColor:mt,borderTopColor:mt,borderRightColor:mt,borderBottomColor:mt,borderLeftColor:mt,filter:Hh,WebkitFilter:Hh},Wy=e=>b5[e];function Vy(e,t){let r=Wy(e);return r!==Hh&&(r=Kn),r.getAnimatableNone?r.getAnimatableNone(t):void 0}const C5=new Set(["auto","none","0"]);function E5(e,t,r){let n=0,i;for(;n<e.length&&!i;){const a=e[n];typeof a=="string"&&!C5.has(a)&&No(a).values.length&&(i=e[n]),n++}if(i&&r)for(const a of t)e[a]=Vy(r,i)}class k5 extends Af{constructor(t,r,n,i,a){super(t,r,n,i,a,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:r,name:n}=this;if(!r||!r.current)return;super.readKeyframes();for(let p=0;p<t.length;p++){let u=t[p];if(typeof u=="string"&&(u=u.trim(),Cf(u))){const f=$y(u,r.current);f!==void 0&&(t[p]=f),p===t.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!Hy.has(n)||t.length!==2)return;const[i,a]=t,l=Jm(i),s=Jm(a),o=Fm(i),c=Fm(a);if(o!==c&&In[n]){this.needsMeasurement=!0;return}if(l!==s)if(qm(l)&&qm(s))for(let p=0;p<t.length;p++){const u=t[p];typeof u=="string"&&(t[p]=parseFloat(u))}else In[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:r}=this,n=[];for(let i=0;i<t.length;i++)(t[i]===null||_5(t[i]))&&n.push(i);n.length&&E5(t,n,r)}measureInitialState(){const{element:t,unresolvedKeyframes:r,name:n}=this;if(!t||!t.current)return;n==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=In[n](t.measureViewportBox(),window.getComputedStyle(t.current)),r[0]=this.measuredOrigin;const i=r[r.length-1];i!==void 0&&t.getValue(n,i).jump(i,!1)}measureEndState(){var s;const{element:t,name:r,unresolvedKeyframes:n}=this;if(!t||!t.current)return;const i=t.getValue(r);i&&i.jump(this.measuredOrigin,!1);const a=n.length-1,l=n[a];n[a]=In[r](t.measureViewportBox(),window.getComputedStyle(t.current)),l!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=l),(s=this.removedTransforms)!=null&&s.length&&this.removedTransforms.forEach(([o,c])=>{t.getValue(o).set(c)}),this.resolveNoneKeyframes()}}function L5(e,t,r){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let n=document;const i=(r==null?void 0:r[e])??n.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e)}const Ky=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Gy(e){return ly(e)&&"offsetHeight"in e}const Zm=30,T5=e=>!isNaN(parseFloat(e));class R5{constructor(t,r={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=n=>{var a;const i=Qt.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(n),this.current!==this.prev&&((a=this.events.change)==null||a.notify(this.current),this.dependents))for(const l of this.dependents)l.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=r.owner}setCurrent(t){this.current=t,this.updatedAt=Qt.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=T5(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,r){this.events[t]||(this.events[t]=new Sf);const n=this.events[t].add(r);return t==="change"?()=>{n(),st.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,r){this.passiveEffect=t,this.stopPassiveEffect=r}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,r,n){this.set(r),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,r=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,r&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Qt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Zm)return 0;const r=Math.min(this.updatedAt-this.prevUpdatedAt,Zm);return uy(parseFloat(this.current)-parseFloat(this.prevFrameValue),r)}start(t){return this.stop(),new Promise(r=>{this.hasAnimated=!0,this.animation=t(r),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,r;(t=this.dependents)==null||t.clear(),(r=this.events.destroy)==null||r.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function gi(e,t){return new R5(e,t)}const{schedule:Bf}=Sy(queueMicrotask,!1),Rr={x:!1,y:!1};function qy(){return Rr.x||Rr.y}function D5(e){return e==="x"||e==="y"?Rr[e]?null:(Rr[e]=!0,()=>{Rr[e]=!1}):Rr.x||Rr.y?null:(Rr.x=Rr.y=!0,()=>{Rr.x=Rr.y=!1})}function Xy(e,t){const r=L5(e),n=new AbortController,i={passive:!0,...t,signal:n.signal};return[r,i,()=>n.abort()]}function eg(e){return!(e.pointerType==="touch"||qy())}function M5(e,t,r={}){const[n,i,a]=Xy(e,r),l=s=>{if(!eg(s))return;const{target:o}=s,c=t(o,s);if(typeof c!="function"||!o)return;const p=u=>{eg(u)&&(c(u),o.removeEventListener("pointerleave",p))};o.addEventListener("pointerleave",p,i)};return n.forEach(s=>{s.addEventListener("pointerenter",l,i)}),a}const Yy=(e,t)=>t?e===t?!0:Yy(e,t.parentElement):!1,Of=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,A5=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Jy(e){return A5.has(e.tagName)||e.isContentEditable===!0}const rl=new WeakSet;function tg(e){return t=>{t.key==="Enter"&&e(t)}}function iu(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const P5=(e,t)=>{const r=e.currentTarget;if(!r)return;const n=tg(()=>{if(rl.has(r))return;iu(r,"down");const i=tg(()=>{iu(r,"up")}),a=()=>iu(r,"cancel");r.addEventListener("keyup",i,t),r.addEventListener("blur",a,t)});r.addEventListener("keydown",n,t),r.addEventListener("blur",()=>r.removeEventListener("keydown",n),t)};function rg(e){return Of(e)&&!qy()}function I5(e,t,r={}){const[n,i,a]=Xy(e,r),l=s=>{const o=s.currentTarget;if(!rg(s))return;rl.add(o);const c=t(o,s),p=(_,y)=>{window.removeEventListener("pointerup",u),window.removeEventListener("pointercancel",f),rl.has(o)&&rl.delete(o),rg(_)&&typeof c=="function"&&c(_,{success:y})},u=_=>{p(_,o===window||o===document||r.useGlobalTarget||Yy(o,_.target))},f=_=>{p(_,!1)};window.addEventListener("pointerup",u,i),window.addEventListener("pointercancel",f,i)};return n.forEach(s=>{(r.useGlobalTarget?window:s).addEventListener("pointerdown",l,i),Gy(s)&&(s.addEventListener("focus",c=>P5(c,i)),!Jy(s)&&!s.hasAttribute("tabindex")&&(s.tabIndex=0))}),a}function Qy(e){return ly(e)&&"ownerSVGElement"in e}function B5(e){return Qy(e)&&e.tagName==="svg"}const Gt=e=>!!(e&&e.getVelocity),O5=[...Uy,mt,Kn],N5=e=>O5.find(zy(e)),Nf=k.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function ng(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function j5(...e){return t=>{let r=!1;const n=e.map(i=>{const a=ng(i,t);return!r&&typeof a=="function"&&(r=!0),a});if(r)return()=>{for(let i=0;i<n.length;i++){const a=n[i];typeof a=="function"?a():ng(e[i],null)}}}}function F5(...e){return k.useCallback(j5(...e),e)}class $5 extends k.Component{getSnapshotBeforeUpdate(t){const r=this.props.childRef.current;if(r&&t.isPresent&&!this.props.isPresent){const n=r.offsetParent,i=Gy(n)&&n.offsetWidth||0,a=this.props.sizeRef.current;a.height=r.offsetHeight||0,a.width=r.offsetWidth||0,a.top=r.offsetTop,a.left=r.offsetLeft,a.right=i-a.width-a.left}return null}componentDidUpdate(){}render(){return this.props.children}}function H5({children:e,isPresent:t,anchorX:r,root:n}){var p;const i=k.useId(),a=k.useRef(null),l=k.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:s}=k.useContext(Nf),o=((p=e.props)==null?void 0:p.ref)??(e==null?void 0:e.ref),c=F5(a,o);return k.useInsertionEffect(()=>{const{width:u,height:f,top:_,left:y,right:v}=l.current;if(t||!a.current||!u||!f)return;const h=r==="left"?`left: ${y}`:`right: ${v}`;a.current.dataset.motionPopId=i;const m=document.createElement("style");s&&(m.nonce=s);const d=n??document.head;return d.appendChild(m),m.sheet&&m.sheet.insertRule(`
41
41
  [data-motion-pop-id="${i}"] {
42
42
  position: absolute !important;
43
43
  width: ${u}px !important;
@@ -49,7 +49,7 @@ Error generating stack: `+a.message+`
49
49
  To pick up a draggable item, press the space bar.
50
50
  While dragging, use the arrow keys to move the item.
51
51
  Press space again to drop the item in its new position, or press escape to cancel.
52
- `},PL={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was moved over droppable area "+r.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was dropped over droppable area "+r.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function IL(e){let{announcements:t=PL,container:r,hiddenTextDescribedById:n,screenReaderInstructions:i=AL}=e;const{announce:a,announcement:l}=RL(),s=oa("DndLiveRegion"),[o,c]=k.useState(!1);if(k.useEffect(()=>{c(!0)},[]),DL(k.useMemo(()=>({onDragStart(u){let{active:f}=u;a(t.onDragStart({active:f}))},onDragMove(u){let{active:f,over:_}=u;t.onDragMove&&a(t.onDragMove({active:f,over:_}))},onDragOver(u){let{active:f,over:_}=u;a(t.onDragOver({active:f,over:_}))},onDragEnd(u){let{active:f,over:_}=u;a(t.onDragEnd({active:f,over:_}))},onDragCancel(u){let{active:f,over:_}=u;a(t.onDragCancel({active:f,over:_}))}}),[a,t])),!o)return null;const p=gt.createElement(gt.Fragment,null,gt.createElement(LL,{id:n,value:i.draggable}),gt.createElement(TL,{id:s,announcement:l}));return r?hn.createPortal(p,r):p}var xt;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(xt||(xt={}));function Wl(){}function BL(e,t){return k.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function OL(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return k.useMemo(()=>[...t].filter(n=>n!=null),[...t])}const jr=Object.freeze({x:0,y:0});function NL(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function jL(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return r-n}function FL(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return n-r}function $L(e,t){if(!e||e.length===0)return null;const[r]=e;return r[t]}function Zg(e,t,r){return t===void 0&&(t=e.left),r===void 0&&(r=e.top),{x:t+e.width*.5,y:r+e.height*.5}}const HL=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const i=Zg(t,t.left,t.top),a=[];for(const l of n){const{id:s}=l,o=r.get(s);if(o){const c=NL(Zg(o),i);a.push({id:s,data:{droppableContainer:l,value:c}})}}return a.sort(jL)};function zL(e,t){const r=Math.max(t.top,e.top),n=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),l=i-n,s=a-r;if(n<i&&r<a){const o=t.width*t.height,c=e.width*e.height,p=l*s,u=p/(o+c-p);return Number(u.toFixed(4))}return 0}const UL=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const i=[];for(const a of n){const{id:l}=a,s=r.get(l);if(s){const o=zL(s,t);o>0&&i.push({id:l,data:{droppableContainer:a,value:o}})}}return i.sort(FL)};function WL(e,t,r){return{...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}function W1(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:jr}function VL(e){return function(r){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];return i.reduce((l,s)=>({...l,top:l.top+e*s.y,bottom:l.bottom+e*s.y,left:l.left+e*s.x,right:l.right+e*s.x}),{...r})}}const KL=VL(1);function GL(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function qL(e,t,r){const n=GL(t);if(!n)return e;const{scaleX:i,scaleY:a,x:l,y:s}=n,o=e.left-l-(1-i)*parseFloat(r),c=e.top-s-(1-a)*parseFloat(r.slice(r.indexOf(" ")+1)),p=i?e.width/i:e.width,u=a?e.height/a:e.height;return{width:p,height:u,top:c,right:o+p,bottom:c+u,left:o}}const XL={ignoreTransform:!1};function Ti(e,t){t===void 0&&(t=XL);let r=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:c,transformOrigin:p}=lr(e).getComputedStyle(e);c&&(r=qL(r,c,p))}const{top:n,left:i,width:a,height:l,bottom:s,right:o}=r;return{top:n,left:i,width:a,height:l,bottom:s,right:o}}function ev(e){return Ti(e,{ignoreTransform:!0})}function YL(e){const t=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:t,bottom:r,width:t,height:r}}function JL(e,t){return t===void 0&&(t=lr(e).getComputedStyle(e)),t.position==="fixed"}function QL(e,t){t===void 0&&(t=lr(e).getComputedStyle(e));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(i=>{const a=t[i];return typeof a=="string"?r.test(a):!1})}function Qf(e,t){const r=[];function n(i){if(t!=null&&r.length>=t||!i)return r;if(Xf(i)&&i.scrollingElement!=null&&!r.includes(i.scrollingElement))return r.push(i.scrollingElement),r;if(!sa(i)||H1(i)||r.includes(i))return r;const a=lr(e).getComputedStyle(i);return i!==e&&QL(i,a)&&r.push(i),JL(i,a)?r:n(i.parentNode)}return e?n(e):r}function V1(e){const[t]=Qf(e,1);return t??null}function gu(e){return!wc||!e?null:ki(e)?e:qf(e)?Xf(e)||e===Li(e).scrollingElement?window:sa(e)?e:null:null}function K1(e){return ki(e)?e.scrollX:e.scrollLeft}function G1(e){return ki(e)?e.scrollY:e.scrollTop}function Zh(e){return{x:K1(e),y:G1(e)}}var Tt;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Tt||(Tt={}));function q1(e){return!wc||!e?!1:e===document.scrollingElement}function X1(e){const t={x:0,y:0},r=q1(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},n={x:e.scrollWidth-r.width,y:e.scrollHeight-r.height},i=e.scrollTop<=t.y,a=e.scrollLeft<=t.x,l=e.scrollTop>=n.y,s=e.scrollLeft>=n.x;return{isTop:i,isLeft:a,isBottom:l,isRight:s,maxScroll:n,minScroll:t}}const ZL={x:.2,y:.2};function eT(e,t,r,n,i){let{top:a,left:l,right:s,bottom:o}=r;n===void 0&&(n=10),i===void 0&&(i=ZL);const{isTop:c,isBottom:p,isLeft:u,isRight:f}=X1(e),_={x:0,y:0},y={x:0,y:0},v={height:t.height*i.y,width:t.width*i.x};return!c&&a<=t.top+v.height?(_.y=Tt.Backward,y.y=n*Math.abs((t.top+v.height-a)/v.height)):!p&&o>=t.bottom-v.height&&(_.y=Tt.Forward,y.y=n*Math.abs((t.bottom-v.height-o)/v.height)),!f&&s>=t.right-v.width?(_.x=Tt.Forward,y.x=n*Math.abs((t.right-v.width-s)/v.width)):!u&&l<=t.left+v.width&&(_.x=Tt.Backward,y.x=n*Math.abs((t.left+v.width-l)/v.width)),{direction:_,speed:y}}function tT(e){if(e===document.scrollingElement){const{innerWidth:a,innerHeight:l}=window;return{top:0,left:0,right:a,bottom:l,width:a,height:l}}const{top:t,left:r,right:n,bottom:i}=e.getBoundingClientRect();return{top:t,left:r,right:n,bottom:i,width:e.clientWidth,height:e.clientHeight}}function Y1(e){return e.reduce((t,r)=>ai(t,Zh(r)),jr)}function rT(e){return e.reduce((t,r)=>t+K1(r),0)}function nT(e){return e.reduce((t,r)=>t+G1(r),0)}function sT(e,t){if(t===void 0&&(t=Ti),!e)return;const{top:r,left:n,bottom:i,right:a}=t(e);V1(e)&&(i<=0||a<=0||r>=window.innerHeight||n>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const iT=[["x",["left","right"],rT],["y",["top","bottom"],nT]];class Zf{constructor(t,r){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=Qf(r),i=Y1(n);this.rect={...t},this.width=t.width,this.height=t.height;for(const[a,l,s]of iT)for(const o of l)Object.defineProperty(this,o,{get:()=>{const c=s(n),p=i[a]-c;return this.rect[o]+p},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class fo{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var n;return(n=this.target)==null?void 0:n.removeEventListener(...r)})},this.target=t}add(t,r,n){var i;(i=this.target)==null||i.addEventListener(t,r,n),this.listeners.push([t,r,n])}}function oT(e){const{EventTarget:t}=lr(e);return e instanceof t?e:Li(e)}function vu(e,t){const r=Math.abs(e.x),n=Math.abs(e.y);return typeof t=="number"?Math.sqrt(r**2+n**2)>t:"x"in t&&"y"in t?r>t.x&&n>t.y:"x"in t?r>t.x:"y"in t?n>t.y:!1}var vr;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(vr||(vr={}));function tv(e){e.preventDefault()}function aT(e){e.stopPropagation()}var Ye;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(Ye||(Ye={}));const J1={start:[Ye.Space,Ye.Enter],cancel:[Ye.Esc],end:[Ye.Space,Ye.Enter,Ye.Tab]},lT=(e,t)=>{let{currentCoordinates:r}=t;switch(e.code){case Ye.Right:return{...r,x:r.x+25};case Ye.Left:return{...r,x:r.x-25};case Ye.Down:return{...r,y:r.y+25};case Ye.Up:return{...r,y:r.y-25}}};class Q1{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:r}}=t;this.props=t,this.listeners=new fo(Li(r)),this.windowListeners=new fo(lr(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(vr.Resize,this.handleCancel),this.windowListeners.add(vr.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(vr.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:r}=this.props,n=t.node.current;n&&sT(n),r(jr)}handleKeyDown(t){if(Jf(t)){const{active:r,context:n,options:i}=this.props,{keyboardCodes:a=J1,coordinateGetter:l=lT,scrollBehavior:s="smooth"}=i,{code:o}=t;if(a.end.includes(o)){this.handleEnd(t);return}if(a.cancel.includes(o)){this.handleCancel(t);return}const{collisionRect:c}=n.current,p=c?{x:c.left,y:c.top}:jr;this.referenceCoordinates||(this.referenceCoordinates=p);const u=l(t,{active:r,context:n.current,currentCoordinates:p});if(u){const f=Ul(u,p),_={x:0,y:0},{scrollableAncestors:y}=n.current;for(const v of y){const h=t.code,{isTop:m,isRight:d,isLeft:g,isBottom:w,maxScroll:b,minScroll:x}=X1(v),C=tT(v),S={x:Math.min(h===Ye.Right?C.right-C.width/2:C.right,Math.max(h===Ye.Right?C.left:C.left+C.width/2,u.x)),y:Math.min(h===Ye.Down?C.bottom-C.height/2:C.bottom,Math.max(h===Ye.Down?C.top:C.top+C.height/2,u.y))},E=h===Ye.Right&&!d||h===Ye.Left&&!g,L=h===Ye.Down&&!w||h===Ye.Up&&!m;if(E&&S.x!==u.x){const A=v.scrollLeft+f.x,M=h===Ye.Right&&A<=b.x||h===Ye.Left&&A>=x.x;if(M&&!f.y){v.scrollTo({left:A,behavior:s});return}M?_.x=v.scrollLeft-A:_.x=h===Ye.Right?v.scrollLeft-b.x:v.scrollLeft-x.x,_.x&&v.scrollBy({left:-_.x,behavior:s});break}else if(L&&S.y!==u.y){const A=v.scrollTop+f.y,M=h===Ye.Down&&A<=b.y||h===Ye.Up&&A>=x.y;if(M&&!f.x){v.scrollTo({top:A,behavior:s});return}M?_.y=v.scrollTop-A:_.y=h===Ye.Down?v.scrollTop-b.y:v.scrollTop-x.y,_.y&&v.scrollBy({top:-_.y,behavior:s});break}}this.handleMove(t,ai(Ul(u,this.referenceCoordinates),_))}}}handleMove(t,r){const{onMove:n}=this.props;t.preventDefault(),n(r)}handleEnd(t){const{onEnd:r}=this.props;t.preventDefault(),this.detach(),r()}handleCancel(t){const{onCancel:r}=this.props;t.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Q1.activators=[{eventName:"onKeyDown",handler:(e,t,r)=>{let{keyboardCodes:n=J1,onActivation:i}=t,{active:a}=r;const{code:l}=e.nativeEvent;if(n.start.includes(l)){const s=a.activatorNode.current;return s&&e.target!==s?!1:(e.preventDefault(),i==null||i({event:e.nativeEvent}),!0)}return!1}}];function rv(e){return!!(e&&"distance"in e)}function nv(e){return!!(e&&"delay"in e)}class ep{constructor(t,r,n){var i;n===void 0&&(n=oT(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=r;const{event:a}=t,{target:l}=a;this.props=t,this.events=r,this.document=Li(l),this.documentListeners=new fo(this.document),this.listeners=new fo(n),this.windowListeners=new fo(lr(l)),this.initialCoordinates=(i=Qh(a))!=null?i:jr,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:r,bypassActivationConstraint:n}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(vr.Resize,this.handleCancel),this.windowListeners.add(vr.DragStart,tv),this.windowListeners.add(vr.VisibilityChange,this.handleCancel),this.windowListeners.add(vr.ContextMenu,tv),this.documentListeners.add(vr.Keydown,this.handleKeydown),r){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(nv(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(rv(r)){this.handlePending(r);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,r){const{active:n,onPending:i}=this.props;i(n,t,this.initialCoordinates,r)}handleStart(){const{initialCoordinates:t}=this,{onStart:r}=this.props;t&&(this.activated=!0,this.documentListeners.add(vr.Click,aT,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(vr.SelectionChange,this.removeTextSelection),r(t))}handleMove(t){var r;const{activated:n,initialCoordinates:i,props:a}=this,{onMove:l,options:{activationConstraint:s}}=a;if(!i)return;const o=(r=Qh(t))!=null?r:jr,c=Ul(i,o);if(!n&&s){if(rv(s)){if(s.tolerance!=null&&vu(c,s.tolerance))return this.handleCancel();if(vu(c,s.distance))return this.handleStart()}if(nv(s)&&vu(c,s.tolerance))return this.handleCancel();this.handlePending(s,c);return}t.cancelable&&t.preventDefault(),l(o)}handleEnd(){const{onAbort:t,onEnd:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleCancel(){const{onAbort:t,onCancel:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleKeydown(t){t.code===Ye.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const cT={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class tp extends ep{constructor(t){const{event:r}=t,n=Li(r.target);super(t,cT,n)}}tp.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return!r.isPrimary||r.button!==0?!1:(n==null||n({event:r}),!0)}}];const uT={move:{name:"mousemove"},end:{name:"mouseup"}};var ed;(function(e){e[e.RightClick=2]="RightClick"})(ed||(ed={}));class hT extends ep{constructor(t){super(t,uT,Li(t.event.target))}}hT.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return r.button===ed.RightClick?!1:(n==null||n({event:r}),!0)}}];const _u={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class dT extends ep{constructor(t){super(t,_u)}static setup(){return window.addEventListener(_u.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(_u.move.name,t)};function t(){}}}dT.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;const{touches:i}=r;return i.length>1?!1:(n==null||n({event:r}),!0)}}];var po;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(po||(po={}));var Vl;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Vl||(Vl={}));function fT(e){let{acceleration:t,activator:r=po.Pointer,canScroll:n,draggingRect:i,enabled:a,interval:l=5,order:s=Vl.TreeOrder,pointerCoordinates:o,scrollableAncestors:c,scrollableAncestorRects:p,delta:u,threshold:f}=e;const _=mT({delta:u,disabled:!a}),[y,v]=xL(),h=k.useRef({x:0,y:0}),m=k.useRef({x:0,y:0}),d=k.useMemo(()=>{switch(r){case po.Pointer:return o?{top:o.y,bottom:o.y,left:o.x,right:o.x}:null;case po.DraggableRect:return i}},[r,i,o]),g=k.useRef(null),w=k.useCallback(()=>{const x=g.current;if(!x)return;const C=h.current.x*m.current.x,S=h.current.y*m.current.y;x.scrollBy(C,S)},[]),b=k.useMemo(()=>s===Vl.TreeOrder?[...c].reverse():c,[s,c]);k.useEffect(()=>{if(!a||!c.length||!d){v();return}for(const x of b){if((n==null?void 0:n(x))===!1)continue;const C=c.indexOf(x),S=p[C];if(!S)continue;const{direction:E,speed:L}=eT(x,S,d,t,f);for(const A of["x","y"])_[A][E[A]]||(L[A]=0,E[A]=0);if(L.x>0||L.y>0){v(),g.current=x,y(w,l),h.current=L,m.current=E;return}}h.current={x:0,y:0},m.current={x:0,y:0},v()},[t,w,n,v,a,l,JSON.stringify(d),JSON.stringify(_),y,c,b,p,JSON.stringify(f)])}const pT={x:{[Tt.Backward]:!1,[Tt.Forward]:!1},y:{[Tt.Backward]:!1,[Tt.Forward]:!1}};function mT(e){let{delta:t,disabled:r}=e;const n=Jh(t);return ia(i=>{if(r||!n||!i)return pT;const a={x:Math.sign(t.x-n.x),y:Math.sign(t.y-n.y)};return{x:{[Tt.Backward]:i.x[Tt.Backward]||a.x===-1,[Tt.Forward]:i.x[Tt.Forward]||a.x===1},y:{[Tt.Backward]:i.y[Tt.Backward]||a.y===-1,[Tt.Forward]:i.y[Tt.Forward]||a.y===1}}},[r,t,n])}function gT(e,t){const r=t!=null?e.get(t):void 0,n=r?r.node.current:null;return ia(i=>{var a;return t==null?null:(a=n??i)!=null?a:null},[n,t])}function vT(e,t){return k.useMemo(()=>e.reduce((r,n)=>{const{sensor:i}=n,a=i.activators.map(l=>({eventName:l.eventName,handler:t(l.handler,n)}));return[...r,...a]},[]),[e,t])}var zo;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(zo||(zo={}));var td;(function(e){e.Optimized="optimized"})(td||(td={}));const sv=new Map;function _T(e,t){let{dragging:r,dependencies:n,config:i}=t;const[a,l]=k.useState(null),{frequency:s,measure:o,strategy:c}=i,p=k.useRef(e),u=h(),f=$o(u),_=k.useCallback(function(m){m===void 0&&(m=[]),!f.current&&l(d=>d===null?m:d.concat(m.filter(g=>!d.includes(g))))},[f]),y=k.useRef(null),v=ia(m=>{if(u&&!r)return sv;if(!m||m===sv||p.current!==e||a!=null){const d=new Map;for(let g of e){if(!g)continue;if(a&&a.length>0&&!a.includes(g.id)&&g.rect.current){d.set(g.id,g.rect.current);continue}const w=g.node.current,b=w?new Zf(o(w),w):null;g.rect.current=b,b&&d.set(g.id,b)}return d}return m},[e,a,r,u,o]);return k.useEffect(()=>{p.current=e},[e]),k.useEffect(()=>{u||_()},[r,u]),k.useEffect(()=>{a&&a.length>0&&l(null)},[JSON.stringify(a)]),k.useEffect(()=>{u||typeof s!="number"||y.current!==null||(y.current=setTimeout(()=>{_(),y.current=null},s))},[s,u,_,...n]),{droppableRects:v,measureDroppableContainers:_,measuringScheduled:a!=null};function h(){switch(c){case zo.Always:return!1;case zo.BeforeDragging:return r;default:return!r}}}function Z1(e,t){return ia(r=>e?r||(typeof t=="function"?t(e):e):null,[t,e])}function yT(e,t){return Z1(e,t)}function wT(e){let{callback:t,disabled:r}=e;const n=Yf(t),i=k.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:a}=window;return new a(n)},[n,r]);return k.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function Sc(e){let{callback:t,disabled:r}=e;const n=Yf(t),i=k.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:a}=window;return new a(n)},[r]);return k.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function ST(e){return new Zf(Ti(e),e)}function iv(e,t,r){t===void 0&&(t=ST);const[n,i]=k.useState(null);function a(){i(o=>{if(!e)return null;if(e.isConnected===!1){var c;return(c=o??r)!=null?c:null}const p=t(e);return JSON.stringify(o)===JSON.stringify(p)?o:p})}const l=wT({callback(o){if(e)for(const c of o){const{type:p,target:u}=c;if(p==="childList"&&u instanceof HTMLElement&&u.contains(e)){a();break}}}}),s=Sc({callback:a});return Gr(()=>{a(),e?(s==null||s.observe(e),l==null||l.observe(document.body,{childList:!0,subtree:!0})):(s==null||s.disconnect(),l==null||l.disconnect())},[e]),n}function xT(e){const t=Z1(e);return W1(e,t)}const ov=[];function bT(e){const t=k.useRef(e),r=ia(n=>e?n&&n!==ov&&e&&t.current&&e.parentNode===t.current.parentNode?n:Qf(e):ov,[e]);return k.useEffect(()=>{t.current=e},[e]),r}function CT(e){const[t,r]=k.useState(null),n=k.useRef(e),i=k.useCallback(a=>{const l=gu(a.target);l&&r(s=>s?(s.set(l,Zh(l)),new Map(s)):null)},[]);return k.useEffect(()=>{const a=n.current;if(e!==a){l(a);const s=e.map(o=>{const c=gu(o);return c?(c.addEventListener("scroll",i,{passive:!0}),[c,Zh(c)]):null}).filter(o=>o!=null);r(s.length?new Map(s):null),n.current=e}return()=>{l(e),l(a)};function l(s){s.forEach(o=>{const c=gu(o);c==null||c.removeEventListener("scroll",i)})}},[i,e]),k.useMemo(()=>e.length?t?Array.from(t.values()).reduce((a,l)=>ai(a,l),jr):Y1(e):jr,[e,t])}function av(e,t){t===void 0&&(t=[]);const r=k.useRef(null);return k.useEffect(()=>{r.current=null},t),k.useEffect(()=>{const n=e!==jr;n&&!r.current&&(r.current=e),!n&&r.current&&(r.current=null)},[e]),r.current?Ul(e,r.current):jr}function ET(e){k.useEffect(()=>{if(!wc)return;const t=e.map(r=>{let{sensor:n}=r;return n.setup==null?void 0:n.setup()});return()=>{for(const r of t)r==null||r()}},e.map(t=>{let{sensor:r}=t;return r}))}function kT(e,t){return k.useMemo(()=>e.reduce((r,n)=>{let{eventName:i,handler:a}=n;return r[i]=l=>{a(l,t)},r},{}),[e,t])}function ew(e){return k.useMemo(()=>e?YL(e):null,[e])}const lv=[];function LT(e,t){t===void 0&&(t=Ti);const[r]=e,n=ew(r?lr(r):null),[i,a]=k.useState(lv);function l(){a(()=>e.length?e.map(o=>q1(o)?n:new Zf(t(o),o)):lv)}const s=Sc({callback:l});return Gr(()=>{s==null||s.disconnect(),l(),e.forEach(o=>s==null?void 0:s.observe(o))},[e]),i}function TT(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return sa(t)?t:e}function RT(e){let{measure:t}=e;const[r,n]=k.useState(null),i=k.useCallback(c=>{for(const{target:p}of c)if(sa(p)){n(u=>{const f=t(p);return u?{...u,width:f.width,height:f.height}:f});break}},[t]),a=Sc({callback:i}),l=k.useCallback(c=>{const p=TT(c);a==null||a.disconnect(),p&&(a==null||a.observe(p)),n(p?t(p):null)},[t,a]),[s,o]=zl(l);return k.useMemo(()=>({nodeRef:s,rect:r,setRef:o}),[r,s,o])}const DT=[{sensor:tp,options:{}},{sensor:Q1,options:{}}],MT={current:{}},il={draggable:{measure:ev},droppable:{measure:ev,strategy:zo.WhileDragging,frequency:td.Optimized},dragOverlay:{measure:Ti}};class mo extends Map{get(t){var r;return t!=null&&(r=super.get(t))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:r}=t;return!r})}getNodeFor(t){var r,n;return(r=(n=this.get(t))==null?void 0:n.node.current)!=null?r:void 0}}const AT={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new mo,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Wl},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:il,measureDroppableContainers:Wl,windowRect:null,measuringScheduled:!1},PT={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Wl,draggableNodes:new Map,over:null,measureDroppableContainers:Wl},xc=k.createContext(PT),tw=k.createContext(AT);function IT(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new mo}}}function BT(e,t){switch(t.type){case xt.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case xt.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case xt.DragEnd:case xt.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case xt.RegisterDroppable:{const{element:r}=t,{id:n}=r,i=new mo(e.droppable.containers);return i.set(n,r),{...e,droppable:{...e.droppable,containers:i}}}case xt.SetDroppableDisabled:{const{id:r,key:n,disabled:i}=t,a=e.droppable.containers.get(r);if(!a||n!==a.key)return e;const l=new mo(e.droppable.containers);return l.set(r,{...a,disabled:i}),{...e,droppable:{...e.droppable,containers:l}}}case xt.UnregisterDroppable:{const{id:r,key:n}=t,i=e.droppable.containers.get(r);if(!i||n!==i.key)return e;const a=new mo(e.droppable.containers);return a.delete(r),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function OT(e){let{disabled:t}=e;const{active:r,activatorEvent:n,draggableNodes:i}=k.useContext(xc),a=Jh(n),l=Jh(r==null?void 0:r.id);return k.useEffect(()=>{if(!t&&!n&&a&&l!=null){if(!Jf(a)||document.activeElement===a.target)return;const s=i.get(l);if(!s)return;const{activatorNode:o,node:c}=s;if(!o.current&&!c.current)return;requestAnimationFrame(()=>{for(const p of[o.current,c.current]){if(!p)continue;const u=EL(p);if(u){u.focus();break}}})}},[n,t,i,l,a]),null}function NT(e,t){let{transform:r,...n}=t;return e!=null&&e.length?e.reduce((i,a)=>a({transform:i,...n}),r):r}function jT(e){return k.useMemo(()=>({draggable:{...il.draggable,...e==null?void 0:e.draggable},droppable:{...il.droppable,...e==null?void 0:e.droppable},dragOverlay:{...il.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function FT(e){let{activeNode:t,measure:r,initialRect:n,config:i=!0}=e;const a=k.useRef(!1),{x:l,y:s}=typeof i=="boolean"?{x:i,y:i}:i;Gr(()=>{if(!l&&!s||!t){a.current=!1;return}if(a.current||!n)return;const c=t==null?void 0:t.node.current;if(!c||c.isConnected===!1)return;const p=r(c),u=W1(p,n);if(l||(u.x=0),s||(u.y=0),a.current=!0,Math.abs(u.x)>0||Math.abs(u.y)>0){const f=V1(c);f&&f.scrollBy({top:u.y,left:u.x})}},[t,l,s,n,r])}const rw=k.createContext({...jr,scaleX:1,scaleY:1});var Rn;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Rn||(Rn={}));const $T=k.memo(function(t){var r,n,i,a;let{id:l,accessibility:s,autoScroll:o=!0,children:c,sensors:p=DT,collisionDetection:u=UL,measuring:f,modifiers:_,...y}=t;const v=k.useReducer(BT,void 0,IT),[h,m]=v,[d,g]=ML(),[w,b]=k.useState(Rn.Uninitialized),x=w===Rn.Initialized,{draggable:{active:C,nodes:S,translate:E},droppable:{containers:L}}=h,A=C!=null?S.get(C):null,M=k.useRef({initial:null,translated:null}),D=k.useMemo(()=>{var fe;return C!=null?{id:C,data:(fe=A==null?void 0:A.data)!=null?fe:MT,rect:M}:null},[C,A]),B=k.useRef(null),[H,F]=k.useState(null),[$,I]=k.useState(null),R=$o(y,Object.values(y)),P=oa("DndDescribedBy",l),N=k.useMemo(()=>L.getEnabled(),[L]),j=jT(f),{droppableRects:U,measureDroppableContainers:V,measuringScheduled:ee}=_T(N,{dragging:x,dependencies:[E.x,E.y],config:j.droppable}),Q=gT(S,C),z=k.useMemo(()=>$?Qh($):null,[$]),O=de(),K=yT(Q,j.draggable.measure);FT({activeNode:C!=null?S.get(C):null,config:O.layoutShiftCompensation,initialRect:K,measure:j.draggable.measure});const W=iv(Q,j.draggable.measure,K),te=iv(Q?Q.parentElement:null),J=k.useRef({activatorEvent:null,active:null,activeNode:Q,collisionRect:null,collisions:null,droppableRects:U,draggableNodes:S,draggingNode:null,draggingNodeRect:null,droppableContainers:L,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),_e=L.getNodeFor((r=J.current.over)==null?void 0:r.id),ue=RT({measure:j.dragOverlay.measure}),se=(n=ue.nodeRef.current)!=null?n:Q,re=x?(i=ue.rect)!=null?i:W:null,ae=!!(ue.nodeRef.current&&ue.rect),ye=xT(ae?null:W),ve=ew(se?lr(se):null),ne=bT(x?_e??Q:null),ie=LT(ne),he=NT(_,{transform:{x:E.x-ye.x,y:E.y-ye.y,scaleX:1,scaleY:1},activatorEvent:$,active:D,activeNodeRect:W,containerNodeRect:te,draggingNodeRect:re,over:J.current.over,overlayNodeRect:ue.rect,scrollableAncestors:ne,scrollableAncestorRects:ie,windowRect:ve}),oe=z?ai(z,E):null,me=CT(ne),xe=av(me),ke=av(me,[W]),Ne=ai(he,xe),Ke=re?KL(re,he):null,Ae=D&&Ke?u({active:D,collisionRect:Ke,droppableRects:U,droppableContainers:N,pointerCoordinates:oe}):null,Pe=$L(Ae,"id"),[G,Y]=k.useState(null),Oe=ae?he:ai(he,ke),$e=WL(Oe,(a=G==null?void 0:G.rect)!=null?a:null,W),X=k.useRef(null),le=k.useCallback((fe,Ee)=>{let{sensor:Re,options:je}=Ee;if(B.current==null)return;const Me=S.get(B.current);if(!Me)return;const Ie=fe.nativeEvent,Ve=new Re({active:B.current,activeNode:Me,event:Ie,options:je,context:J,onAbort(He){if(!S.get(He))return;const{onDragAbort:De}=R.current,ze={id:He};De==null||De(ze),d({type:"onDragAbort",event:ze})},onPending(He,Te,De,ze){if(!S.get(He))return;const{onDragPending:Ht}=R.current,_t={id:He,constraint:Te,initialCoordinates:De,offset:ze};Ht==null||Ht(_t),d({type:"onDragPending",event:_t})},onStart(He){const Te=B.current;if(Te==null)return;const De=S.get(Te);if(!De)return;const{onDragStart:ze}=R.current,Xe={activatorEvent:Ie,active:{id:Te,data:De.data,rect:M}};hn.unstable_batchedUpdates(()=>{ze==null||ze(Xe),b(Rn.Initializing),m({type:xt.DragStart,initialCoordinates:He,active:Te}),d({type:"onDragStart",event:Xe}),F(X.current),I(Ie)})},onMove(He){m({type:xt.DragMove,coordinates:He})},onEnd:ot(xt.DragEnd),onCancel:ot(xt.DragCancel)});X.current=Ve;function ot(He){return async function(){const{active:De,collisions:ze,over:Xe,scrollAdjustedTranslate:Ht}=J.current;let _t=null;if(De&&Ht){const{cancelDrop:zt}=R.current;_t={activatorEvent:Ie,active:De,collisions:ze,delta:Ht,over:Xe},He===xt.DragEnd&&typeof zt=="function"&&await Promise.resolve(zt(_t))&&(He=xt.DragCancel)}B.current=null,hn.unstable_batchedUpdates(()=>{m({type:He}),b(Rn.Uninitialized),Y(null),F(null),I(null),X.current=null;const zt=He===xt.DragEnd?"onDragEnd":"onDragCancel";if(_t){const It=R.current[zt];It==null||It(_t),d({type:zt,event:_t})}})}}},[S]),ge=k.useCallback((fe,Ee)=>(Re,je)=>{const Me=Re.nativeEvent,Ie=S.get(je);if(B.current!==null||!Ie||Me.dndKit||Me.defaultPrevented)return;const Ve={active:Ie};fe(Re,Ee.options,Ve)===!0&&(Me.dndKit={capturedBy:Ee.sensor},B.current=je,le(Re,Ee))},[S,le]),We=vT(p,ge);ET(p),Gr(()=>{W&&w===Rn.Initializing&&b(Rn.Initialized)},[W,w]),k.useEffect(()=>{const{onDragMove:fe}=R.current,{active:Ee,activatorEvent:Re,collisions:je,over:Me}=J.current;if(!Ee||!Re)return;const Ie={active:Ee,activatorEvent:Re,collisions:je,delta:{x:Ne.x,y:Ne.y},over:Me};hn.unstable_batchedUpdates(()=>{fe==null||fe(Ie),d({type:"onDragMove",event:Ie})})},[Ne.x,Ne.y]),k.useEffect(()=>{const{active:fe,activatorEvent:Ee,collisions:Re,droppableContainers:je,scrollAdjustedTranslate:Me}=J.current;if(!fe||B.current==null||!Ee||!Me)return;const{onDragOver:Ie}=R.current,Ve=je.get(Pe),ot=Ve&&Ve.rect.current?{id:Ve.id,rect:Ve.rect.current,data:Ve.data,disabled:Ve.disabled}:null,He={active:fe,activatorEvent:Ee,collisions:Re,delta:{x:Me.x,y:Me.y},over:ot};hn.unstable_batchedUpdates(()=>{Y(ot),Ie==null||Ie(He),d({type:"onDragOver",event:He})})},[Pe]),Gr(()=>{J.current={activatorEvent:$,active:D,activeNode:Q,collisionRect:Ke,collisions:Ae,droppableRects:U,draggableNodes:S,draggingNode:se,draggingNodeRect:re,droppableContainers:L,over:G,scrollableAncestors:ne,scrollAdjustedTranslate:Ne},M.current={initial:re,translated:Ke}},[D,Q,Ae,Ke,S,se,re,U,L,G,ne,Ne]),fT({...O,delta:E,draggingRect:Ke,pointerCoordinates:oe,scrollableAncestors:ne,scrollableAncestorRects:ie});const Z=k.useMemo(()=>({active:D,activeNode:Q,activeNodeRect:W,activatorEvent:$,collisions:Ae,containerNodeRect:te,dragOverlay:ue,draggableNodes:S,droppableContainers:L,droppableRects:U,over:G,measureDroppableContainers:V,scrollableAncestors:ne,scrollableAncestorRects:ie,measuringConfiguration:j,measuringScheduled:ee,windowRect:ve}),[D,Q,W,$,Ae,te,ue,S,L,U,G,V,ne,ie,j,ee,ve]),Le=k.useMemo(()=>({activatorEvent:$,activators:We,active:D,activeNodeRect:W,ariaDescribedById:{draggable:P},dispatch:m,draggableNodes:S,over:G,measureDroppableContainers:V}),[$,We,D,W,m,P,S,G,V]);return gt.createElement(U1.Provider,{value:g},gt.createElement(xc.Provider,{value:Le},gt.createElement(tw.Provider,{value:Z},gt.createElement(rw.Provider,{value:$e},c)),gt.createElement(OT,{disabled:(s==null?void 0:s.restoreFocus)===!1})),gt.createElement(IL,{...s,hiddenTextDescribedById:P}));function de(){const fe=(H==null?void 0:H.autoScrollEnabled)===!1,Ee=typeof o=="object"?o.enabled===!1:o===!1,Re=x&&!fe&&!Ee;return typeof o=="object"?{...o,enabled:Re}:{enabled:Re}}}),HT=k.createContext(null),cv="button",zT="Draggable";function UT(e){let{id:t,data:r,disabled:n=!1,attributes:i}=e;const a=oa(zT),{activators:l,activatorEvent:s,active:o,activeNodeRect:c,ariaDescribedById:p,draggableNodes:u,over:f}=k.useContext(xc),{role:_=cv,roleDescription:y="draggable",tabIndex:v=0}=i??{},h=(o==null?void 0:o.id)===t,m=k.useContext(h?rw:HT),[d,g]=zl(),[w,b]=zl(),x=kT(l,t),C=$o(r);Gr(()=>(u.set(t,{id:t,key:a,node:d,activatorNode:w,data:C}),()=>{const E=u.get(t);E&&E.key===a&&u.delete(t)}),[u,t]);const S=k.useMemo(()=>({role:_,tabIndex:v,"aria-disabled":n,"aria-pressed":h&&_===cv?!0:void 0,"aria-roledescription":y,"aria-describedby":p.draggable}),[n,_,v,h,y,p.draggable]);return{active:o,activatorEvent:s,activeNodeRect:c,attributes:S,isDragging:h,listeners:n?void 0:x,node:d,over:f,setNodeRef:g,setActivatorNodeRef:b,transform:m}}function WT(){return k.useContext(tw)}const VT="Droppable",KT={timeout:25};function GT(e){let{data:t,disabled:r=!1,id:n,resizeObserverConfig:i}=e;const a=oa(VT),{active:l,dispatch:s,over:o,measureDroppableContainers:c}=k.useContext(xc),p=k.useRef({disabled:r}),u=k.useRef(!1),f=k.useRef(null),_=k.useRef(null),{disabled:y,updateMeasurementsFor:v,timeout:h}={...KT,...i},m=$o(v??n),d=k.useCallback(()=>{if(!u.current){u.current=!0;return}_.current!=null&&clearTimeout(_.current),_.current=setTimeout(()=>{c(Array.isArray(m.current)?m.current:[m.current]),_.current=null},h)},[h]),g=Sc({callback:d,disabled:y||!l}),w=k.useCallback((S,E)=>{g&&(E&&(g.unobserve(E),u.current=!1),S&&g.observe(S))},[g]),[b,x]=zl(w),C=$o(t);return k.useEffect(()=>{!g||!b.current||(g.disconnect(),u.current=!1,g.observe(b.current))},[b,g]),k.useEffect(()=>(s({type:xt.RegisterDroppable,element:{id:n,key:a,disabled:r,node:b,rect:f,data:C}}),()=>s({type:xt.UnregisterDroppable,key:a,id:n})),[n]),k.useEffect(()=>{r!==p.current.disabled&&(s({type:xt.SetDroppableDisabled,id:n,key:a,disabled:r}),p.current.disabled=r)},[n,a,r,s]),{active:l,rect:f,isOver:(o==null?void 0:o.id)===n,node:b,over:o,setNodeRef:x}}function nw(e,t,r){const n=e.slice();return n.splice(r<0?n.length+r:r,0,n.splice(t,1)[0]),n}function qT(e,t){return e.reduce((r,n,i)=>{const a=t.get(n);return a&&(r[i]=a),r},Array(e.length))}function Ma(e){return e!==null&&e>=0}function XT(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function YT(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const sw=e=>{let{rects:t,activeIndex:r,overIndex:n,index:i}=e;const a=nw(t,n,r),l=t[i],s=a[i];return!s||!l?null:{x:s.left-l.left,y:s.top-l.top,scaleX:s.width/l.width,scaleY:s.height/l.height}},Aa={scaleX:1,scaleY:1},JT=e=>{var t;let{activeIndex:r,activeNodeRect:n,index:i,rects:a,overIndex:l}=e;const s=(t=a[r])!=null?t:n;if(!s)return null;if(i===r){const c=a[l];return c?{x:0,y:r<l?c.top+c.height-(s.top+s.height):c.top-s.top,...Aa}:null}const o=QT(a,i,r);return i>r&&i<=l?{x:0,y:-s.height-o,...Aa}:i<r&&i>=l?{x:0,y:s.height+o,...Aa}:{x:0,y:0,...Aa}};function QT(e,t,r){const n=e[t],i=e[t-1],a=e[t+1];return n?r<t?i?n.top-(i.top+i.height):a?a.top-(n.top+n.height):0:a?a.top-(n.top+n.height):i?n.top-(i.top+i.height):0:0}const iw="Sortable",ow=gt.createContext({activeIndex:-1,containerId:iw,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:sw,disabled:{draggable:!1,droppable:!1}});function ZT(e){let{children:t,id:r,items:n,strategy:i=sw,disabled:a=!1}=e;const{active:l,dragOverlay:s,droppableRects:o,over:c,measureDroppableContainers:p}=WT(),u=oa(iw,r),f=s.rect!==null,_=k.useMemo(()=>n.map(x=>typeof x=="object"&&"id"in x?x.id:x),[n]),y=l!=null,v=l?_.indexOf(l.id):-1,h=c?_.indexOf(c.id):-1,m=k.useRef(_),d=!XT(_,m.current),g=h!==-1&&v===-1||d,w=YT(a);Gr(()=>{d&&y&&p(_)},[d,_,y,p]),k.useEffect(()=>{m.current=_},[_]);const b=k.useMemo(()=>({activeIndex:v,containerId:u,disabled:w,disableTransforms:g,items:_,overIndex:h,useDragOverlay:f,sortedRects:qT(_,o),strategy:i}),[v,u,w.draggable,w.droppable,g,_,h,o,f,i]);return gt.createElement(ow.Provider,{value:b},t)}const eR=e=>{let{id:t,items:r,activeIndex:n,overIndex:i}=e;return nw(r,n,i).indexOf(t)},tR=e=>{let{containerId:t,isSorting:r,wasDragging:n,index:i,items:a,newIndex:l,previousItems:s,previousContainerId:o,transition:c}=e;return!c||!n||s!==a&&i===l?!1:r?!0:l!==i&&t===o},rR={duration:200,easing:"ease"},aw="transform",nR=Ho.Transition.toString({property:aw,duration:0,easing:"linear"}),sR={roleDescription:"sortable"};function iR(e){let{disabled:t,index:r,node:n,rect:i}=e;const[a,l]=k.useState(null),s=k.useRef(r);return Gr(()=>{if(!t&&r!==s.current&&n.current){const o=i.current;if(o){const c=Ti(n.current,{ignoreTransform:!0}),p={x:o.left-c.left,y:o.top-c.top,scaleX:o.width/c.width,scaleY:o.height/c.height};(p.x||p.y)&&l(p)}}r!==s.current&&(s.current=r)},[t,r,n,i]),k.useEffect(()=>{a&&l(null)},[a]),a}function oR(e){let{animateLayoutChanges:t=tR,attributes:r,disabled:n,data:i,getNewIndex:a=eR,id:l,strategy:s,resizeObserverConfig:o,transition:c=rR}=e;const{items:p,containerId:u,activeIndex:f,disabled:_,disableTransforms:y,sortedRects:v,overIndex:h,useDragOverlay:m,strategy:d}=k.useContext(ow),g=aR(n,_),w=p.indexOf(l),b=k.useMemo(()=>({sortable:{containerId:u,index:w,items:p},...i}),[u,i,w,p]),x=k.useMemo(()=>p.slice(p.indexOf(l)),[p,l]),{rect:C,node:S,isOver:E,setNodeRef:L}=GT({id:l,data:b,disabled:g.droppable,resizeObserverConfig:{updateMeasurementsFor:x,...o}}),{active:A,activatorEvent:M,activeNodeRect:D,attributes:B,setNodeRef:H,listeners:F,isDragging:$,over:I,setActivatorNodeRef:R,transform:P}=UT({id:l,data:b,attributes:{...sR,...r},disabled:g.draggable}),N=SL(L,H),j=!!A,U=j&&!y&&Ma(f)&&Ma(h),V=!m&&$,ee=V&&U?P:null,z=U?ee??(s??d)({rects:v,activeNodeRect:D,activeIndex:f,overIndex:h,index:w}):null,O=Ma(f)&&Ma(h)?a({id:l,items:p,activeIndex:f,overIndex:h}):w,K=A==null?void 0:A.id,W=k.useRef({activeId:K,items:p,newIndex:O,containerId:u}),te=p!==W.current.items,J=t({active:A,containerId:u,isDragging:$,isSorting:j,id:l,index:w,items:p,newIndex:W.current.newIndex,previousItems:W.current.items,previousContainerId:W.current.containerId,transition:c,wasDragging:W.current.activeId!=null}),_e=iR({disabled:!J,index:w,node:S,rect:C});return k.useEffect(()=>{j&&W.current.newIndex!==O&&(W.current.newIndex=O),u!==W.current.containerId&&(W.current.containerId=u),p!==W.current.items&&(W.current.items=p)},[j,O,u,p]),k.useEffect(()=>{if(K===W.current.activeId)return;if(K!=null&&W.current.activeId==null){W.current.activeId=K;return}const se=setTimeout(()=>{W.current.activeId=K},50);return()=>clearTimeout(se)},[K]),{active:A,activeIndex:f,attributes:B,data:b,rect:C,index:w,newIndex:O,items:p,isOver:E,isSorting:j,isDragging:$,listeners:F,node:S,overIndex:h,over:I,setNodeRef:N,setActivatorNodeRef:R,setDroppableNodeRef:L,setDraggableNodeRef:H,transform:_e??z,transition:ue()};function ue(){if(_e||te&&W.current.newIndex===w)return nR;if(!(V&&!Jf(M)||!c)&&(j||J))return Ho.Transition.toString({...c,property:aw})}}function aR(e,t){var r,n;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(r=e==null?void 0:e.draggable)!=null?r:t.draggable,droppable:(n=e==null?void 0:e.droppable)!=null?n:t.droppable}}Ye.Down,Ye.Right,Ye.Up,Ye.Left;const Pa={permission:0,waiting:1,working:2,unknown:3};function go(e){var r;const t=(r=e.agentSessionId)==null?void 0:r.trim();return t&&t.length>0?t:e.id}const lR={mode:"created",direction:"desc"};function rp(e,t=lR){const{mode:r,direction:n,manualOrder:i}=t;if(r==="manual"&&i&&i.length>0){const a=new Map(i.map((l,s)=>[l,s]));return e.toSorted((l,s)=>{const o=go(l),c=go(s),p=a.get(o)??a.get(l.id)??1/0,u=a.get(c)??a.get(s.id)??1/0;return p===1/0&&u===1/0?Date.parse(s.createdAt)-Date.parse(l.createdAt):p-u})}return e.toSorted((a,l)=>{if(r==="status"){const c=Pa[a.status]??Pa.unknown,p=Pa[l.status]??Pa.unknown;return c!==p?c-p:Date.parse(l.lastActivity)-Date.parse(a.lastActivity)}const s=Date.parse(a.createdAt),o=Date.parse(l.createdAt);return n==="desc"?o-s:s-o})}function cR(e,t){var n,i;const r=new Map;for(const a of e){const l=(n=a.projectPath)==null?void 0:n.trim();if(l){const s=Date.parse(a.lastActivity)||0,o=r.get(l)||0;s>o&&r.set(l,s)}}for(const a of t){const l=(i=a.projectPath)==null?void 0:i.trim();if(l){const s=Date.parse(a.lastActivityAt)||0,o=r.get(l)||0;s>o&&r.set(l,s)}}return Array.from(r.keys()).toSorted((a,l)=>{const s=r.get(a)||0;return(r.get(l)||0)-s})}function uR(e,t){var n,i;const r=new Map;for(const a of e){const l=(n=a.host)==null?void 0:n.trim();if(l){const s=Date.parse(a.lastActivity)||0,o=r.get(l)||0;s>o&&r.set(l,s)}}for(const a of t){const l=(i=a.host)==null?void 0:i.trim();if(l){const s=Date.parse(a.lastActivityAt)||0,o=r.get(l)||0;s>o&&r.set(l,s)}}return Array.from(r.keys()).toSorted((a,l)=>{const s=r.get(a)||0;return(r.get(l)||0)-s})}function np(e){const t=Date.parse(e);if(Number.isNaN(t))return"";const r=Date.now()-t,n=Math.floor(r/6e4);if(n<1)return"now";if(n<60)return`${n}m`;const i=Math.floor(n/60);return i<24?`${i}h`:`${Math.floor(i/24)}d`}function _s(e){const t=e.trim();if(!t)return null;const r=t.replace(/[\\/]+$/,"");if(!r)return null;const n=r.split(/[\\/]/);return n[n.length-1]||null}function hR(e){const t=e.map(s=>{const o=s.trim(),c=o.replace(/[\\/]+$/,""),p=c.split(/[\\/]/).filter(Boolean);return{path:s,parts:p,fallback:c||o||s}}),r=new Map;for(const s of t)r.set(s.path,1);let n=!0;for(;n;){n=!1;const s=new Map;for(const o of t){if(o.parts.length===0)continue;const c=r.get(o.path)??1,p=o.parts.slice(-c).join("/");s.set(p,(s.get(p)??0)+1)}for(const o of t){if(o.parts.length===0)continue;const c=r.get(o.path)??1,p=o.parts.slice(-c).join("/");(s.get(p)??0)>1&&c<o.parts.length&&(r.set(o.path,c+1),n=!0)}}const i=new Map,a=new Map;for(const s of t){let o=s.fallback;if(s.parts.length>0){const c=r.get(s.path)??1;o=s.parts.slice(-c).join("/")}i.set(s.path,o),a.set(o,(a.get(o)??0)+1)}const l=new Map;for(const s of t){let o=i.get(s.path)??s.fallback;(a.get(o)??0)>1&&(o=s.fallback),l.set(s.path,o)}return l}function lw(e){const t=e.trim();return!t||t.length<=6?t:`${t.slice(0,3)}…${t.slice(-3)}`}const Ge=uf()(hf((e,t)=>({sessions:[],agentSessions:{active:[],inactive:[]},hostStatuses:[],exitingSessions:new Map,selectedSessionId:null,hasLoaded:!1,connectionStatus:"connecting",connectionError:null,remoteAllowControl:!1,remoteAllowAttach:!1,hostLabel:null,setSessions:r=>{var p;const n=t(),i=n.selectedSessionId,a=n.sessions,l=n.exitingSessions,s=new Set(r.map(u=>u.id)),o=a.filter(u=>!s.has(u.id)&&!l.has(u.id));let c=i;if(i!==null&&!r.some(u=>u.id===i)){const{sessionSortMode:u,sessionSortDirection:f}=pe.getState();c=((p=rp(r,{mode:u,direction:f})[0])==null?void 0:p.id)??null}if(o.length>0){const u=new Map(l);for(const f of o)u.set(f.id,f);e({sessions:r,hasLoaded:!0,selectedSessionId:c,exitingSessions:u})}else e({sessions:r,hasLoaded:!0,selectedSessionId:c})},setAgentSessions:(r,n)=>e({agentSessions:{active:r,inactive:n}}),setHostStatuses:r=>e({hostStatuses:r}),updateSession:r=>e(n=>({sessions:n.sessions.map(i=>i.id===r.id?r:i)})),setSelectedSessionId:r=>e({selectedSessionId:r}),setConnectionStatus:r=>e({connectionStatus:r}),setConnectionError:r=>e({connectionError:r}),setRemoteAllowControl:r=>e({remoteAllowControl:r}),setRemoteAllowAttach:r=>e({remoteAllowAttach:r}),setHostLabel:r=>e({hostLabel:r}),markSessionExiting:r=>{const n=t().sessions.find(i=>i.id===r);if(n){const i=new Map(t().exitingSessions);i.set(r,n),e({exitingSessions:i})}},clearExitingSession:r=>{const n=new Map(t().exitingSessions);n.delete(r),e({exitingSessions:n})}}),{name:"agentboard-session",storage:mc(()=>df),partialize:e=>({selectedSessionId:e.selectedSessionId})}));function uv(e,t,r=!1){const[n,i]=k.useState(!1),a=k.useRef(e),l=k.useRef(!1);return k.useEffect(()=>{const o=a.current;if(r?e>o:e!==o){l.current=!0;const p=setTimeout(()=>{l.current&&(i(!0),l.current=!1)},t);return a.current=e,()=>clearTimeout(p)}a.current=e},[e,t,r]),[n,()=>i(!1)]}function dR(e,t,r,n){const i=k.useRef(new Map);k.useEffect(()=>{const a=new Set(e.map(l=>l.id));for(const l of t.keys())if(a.has(l)){const s=i.current.get(l);s&&(clearTimeout(s),i.current.delete(l)),r(l)}else if(!i.current.has(l)){const s=setTimeout(()=>{i.current.delete(l),r(l)},n+100);i.current.set(l,s)}},[e,t,r,n]),k.useEffect(()=>()=>{for(const a of i.current.values())clearTimeout(a);i.current.clear()},[])}function fR({className:e}){return T.jsx("svg",{viewBox:"0 0 92.2 92.2",fill:"currentColor",className:e,"aria-label":"Anthropic",children:T.jsx("path",{d:"M66.5,0H52.4l25.7,65h14.1L66.5,0z M25.7,0L0,65h14.4l5.3-13.6h26.9L51.8,65h14.4L40.5,0C40.5,0,25.7,0,25.7,0z M24.3,39.3l8.8-22.8l8.8,22.8H24.3z",transform:"translate(0, 13.6)"})})}function pR({className:e}){return T.jsx("svg",{viewBox:"-1 -1 26 26",fill:"currentColor",className:e,"aria-label":"OpenAI",children:T.jsx("path",{d:"M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z"})})}function mR({className:e}){return T.jsx("svg",{viewBox:"0 0 588.42 568.88",fill:"currentColor",className:e,"aria-label":"Pi",children:T.jsx("path",{d:"M 10.499686,177.03840 L 31.174931,178.56990 C 52.615925,154.32116 61.039171,82.595924 187.38789,96.634671 C 182.79339,403.95560 48.021426,436.37234 56.444675,499.41907 C 59.507674,535.15406 87.840417,557.10556 118.47041,558.38181 C 215.21014,555.06356 210.87089,424.63084 240.99038,95.868921 L 365.80760,95.868921 C 359.17110,211.75239 341.04836,327.63586 339.00636,441.22208 C 340.53786,516.77606 386.48285,557.10556 446.97708,557.61606 C 546.52456,560.93431 577.92030,444.79558 577.92030,395.27709 L 556.47931,395.27710 C 554.43731,436.11709 534.78306,465.47083 492.92207,467.25758 C 378.82535,468.78908 441.61683,266.63113 442.38258,97.400421 L 577.92030,98.166171 L 577.15455,11.636437 C 13.807491,8.9075799 85.312284,-2.1366151 10.499686,177.03840 z"})})}const gR=[["claude",fR],["codex",pR],["pi",mR]];function bc({agentType:e,command:t,className:r=""}){const n=(e||(t==null?void 0:t.split(" ")[0])||"").toLowerCase();for(const[i,a]of gR)if(n.startsWith(i))return T.jsx(a,{className:r});return T.jsx(BC,{className:r})}const vR=360;function _R(e){let t=0;for(let r=0;r<e.length;r++){const n=e.charCodeAt(r);t=(t<<5)-t+n,t=t&t}return Math.abs(t)}function cw(e){return{"--badge-hue":`${_R(e)%vR}`}}function uw({name:e,fullPath:t,className:r=""}){const n=cw(e);return T.jsx("span",{className:`project-badge inline-flex items-center rounded-full px-1.5 py-0.5 text-[10px] font-medium leading-none ${r}`,style:n,title:t,children:e})}const yR=k.memo(function({session:t,showSessionIdPrefix:r,showProjectName:n,showLastUserMessage:i,onResume:a,onPreview:l,onSetPinned:s}){const o=np(t.lastActivityAt),c=_s(t.projectPath),p=t.displayName||c||t.sessionId.slice(0,8),u=n&&!!c,f=i&&!!t.lastUserMessage,_=r?lw(t.sessionId):"",y=k.useRef(null),[v,h]=k.useState(null);k.useEffect(()=>{if(!v)return;const d=w=>{y.current&&!y.current.contains(w.target)&&h(null)},g=w=>{w.key==="Escape"&&h(null)};return document.addEventListener("mousedown",d),document.addEventListener("touchstart",d),document.addEventListener("keydown",g),()=>{document.removeEventListener("mousedown",d),document.removeEventListener("touchstart",d),document.removeEventListener("keydown",g)}},[v]);const m=d=>{d.preventDefault(),d.stopPropagation(),h({x:d.clientX,y:d.clientY})};return T.jsxs("div",{className:"group relative cursor-pointer px-3 py-2 hover:bg-hover",role:"button",tabIndex:0,title:"Click to preview",onClick:()=>l(t),onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),l(t))},onContextMenu:m,children:[T.jsx("button",{type:"button",className:"absolute right-3 top-1/2 -translate-y-1/2 text-xs text-muted opacity-0 hover:text-primary group-hover:opacity-100",title:"Resume directly",onClick:d=>{d.stopPropagation(),a(t.sessionId)},children:"▶"}),T.jsxs("div",{className:"flex flex-col gap-0.5 pl-2.5 group-hover:pr-4",children:[T.jsxs("div",{className:"flex items-center gap-2",children:[T.jsx(bc,{agentType:t.agentType,className:"h-3.5 w-3.5 shrink-0 text-muted"}),T.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium text-primary",children:p}),t.lastResumeError&&T.jsx(cC,{className:"h-3 w-3 shrink-0 text-amber-500","aria-label":"Resume failed",title:`Last resume failed: ${t.lastResumeError}`}),t.isPinned&&T.jsx(Il,{className:"h-3 w-3 shrink-0 text-muted","aria-label":"Pinned",title:"Pinned - will auto-resume on server restart"}),_&&T.jsx("span",{className:"shrink-0 text-[11px] font-mono text-muted",title:t.sessionId,children:_}),T.jsx("span",{className:"ml-1 w-8 shrink-0 text-right text-xs tabular-nums text-muted",children:o})]}),(u||f)&&T.jsxs("div",{className:"flex flex-wrap items-center gap-1 pl-[1.375rem]",children:[u&&T.jsx(uw,{name:c,fullPath:t.projectPath}),f&&T.jsxs("span",{className:"truncate text-xs italic text-muted",children:['"',t.lastUserMessage.length>200?t.lastUserMessage.slice(0,200)+"…":t.lastUserMessage,'"']})]})]}),v&&T.jsxs("div",{ref:y,className:"fixed z-50 min-w-[160px] rounded-md border border-border bg-elevated shadow-lg py-1",style:{left:v.x,top:v.y},role:"menu",children:[s&&T.jsxs("button",{onClick:d=>{d.stopPropagation(),h(null),s(t.sessionId,!t.isPinned)},className:"w-full px-3 py-2 text-left text-sm text-secondary hover:bg-hover hover:text-primary flex items-center gap-2",role:"menuitem",title:t.isPinned?"Remove from auto-resume list":"Auto-resume on server restart",children:[T.jsx(Il,{width:14,height:14}),t.isPinned?"Unpin":"Pin"]}),t.logFilePath&&T.jsxs("button",{onClick:d=>{d.stopPropagation(),navigator.clipboard.writeText(t.logFilePath).catch(()=>{}),h(null)},className:"w-full px-3 py-2 text-left text-sm text-secondary hover:bg-hover hover:text-primary flex items-center gap-2",role:"menuitem",title:t.logFilePath,children:[T.jsx(sy,{width:14,height:14}),"Copy Log Path"]})]})]})});function wR({name:e,className:t=""}){const r=cw(`host:${e}`);return T.jsx("span",{className:`inline-flex items-center rounded-full px-1.5 py-0.5 text-[10px] font-medium uppercase leading-none tracking-wide ${t}`,style:r,title:e,children:e})}function SR({hosts:e,selectedHosts:t,onSelect:r,statuses:n=[]}){const[i,a]=k.useState(!1),l=k.useId(),s=k.useRef(null),o=k.useMemo(()=>new Set(t),[t]),c=k.useMemo(()=>new Map(n.map(_=>[_.host,_])),[n]),p=k.useMemo(()=>t.length===0?"All Hosts":t.join(", "),[t]),u=k.useMemo(()=>t.length===0?"All Hosts":t.length===1?t[0]:`${t.length} hosts`,[t]);k.useEffect(()=>{if(!i||typeof document>"u"||!document.addEventListener||!document.removeEventListener)return;const _=v=>{var m;const h=v.target;h&&((m=s.current)!=null&&m.contains(h))||a(!1)},y=v=>{v.key==="Escape"&&a(!1)};return document.addEventListener("mousedown",_),document.addEventListener("touchstart",_,{passive:!0}),document.addEventListener("keydown",y),()=>{document.removeEventListener("mousedown",_),document.removeEventListener("touchstart",_),document.removeEventListener("keydown",y)}},[i]);const f=_=>{const y=new Set(o);y.has(_)?y.delete(_):y.add(_);const v=e.filter(h=>y.has(h));r(v)};return T.jsxs("div",{ref:s,className:"relative",children:[T.jsxs("button",{type:"button","aria-haspopup":"menu","aria-expanded":i,"aria-controls":l,"aria-label":"Filter by host",onClick:()=>a(_=>!_),className:"flex h-6 max-w-[9rem] items-center gap-1 rounded border border-border bg-base px-2 text-[11px] text-primary hover:bg-hover focus:border-accent focus:outline-none",title:p,children:[T.jsx("span",{className:"truncate",children:u}),T.jsx(ff,{className:"h-3 w-3 shrink-0 text-muted"})]}),i&&T.jsxs("div",{id:l,role:"menu",className:"absolute right-0 z-20 mt-1 w-48 rounded border border-border bg-surface p-2 text-xs shadow-lg",children:[T.jsxs("label",{role:"menuitemcheckbox","aria-checked":t.length===0,className:"flex cursor-pointer items-center gap-2 rounded px-2 py-1.5 text-primary hover:bg-hover",children:[T.jsx("input",{type:"checkbox",checked:t.length===0,onChange:()=>r([]),className:"h-3.5 w-3.5 accent-approval"}),T.jsx("span",{children:"All Hosts"})]}),T.jsx("div",{className:"my-2 h-px bg-border"}),e.length===0?T.jsx("div",{className:"px-2 py-1 text-muted",children:"No hosts"}):T.jsx("div",{className:"max-h-48 overflow-y-auto pr-1",children:e.map(_=>{const y=c.get(_),v=y?!y.ok:!1;return T.jsxs("label",{role:"menuitemcheckbox","aria-checked":o.has(_),className:"flex cursor-pointer items-center gap-2 rounded px-2 py-1.5 text-primary hover:bg-hover",title:y!=null&&y.error?`${_}: ${y.error}`:_,children:[T.jsx("input",{type:"checkbox",checked:o.has(_),onChange:()=>f(_),className:"h-3.5 w-3.5 accent-approval"}),T.jsx("span",{className:"truncate",children:_}),v&&T.jsx("span",{className:"ml-auto text-[10px] uppercase text-danger",children:"offline"})]},_)})})]})]})}function xR({projects:e,selectedProjects:t,onSelect:r,hasHiddenPermissions:n}){const[i,a]=k.useState(!1),l=k.useId(),s=k.useRef(null),o=k.useMemo(()=>hR(e),[e]),c=k.useMemo(()=>new Set(t),[t]),p=n&&t.length>0,u=k.useMemo(()=>t.length===0?"All Projects":t.map(y=>o.get(y)??_s(y)??y).join(", "),[o,t]),f=k.useMemo(()=>{if(t.length===0)return"All Projects";if(t.length===1){const y=t[0];return o.get(y)??_s(y)??y}return`${t.length} projects`},[o,t]);k.useEffect(()=>{if(!i||typeof document>"u"||!document.addEventListener||!document.removeEventListener)return;const y=h=>{var d;const m=h.target;m&&((d=s.current)!=null&&d.contains(m))||a(!1)},v=h=>{h.key==="Escape"&&a(!1)};return document.addEventListener("mousedown",y),document.addEventListener("touchstart",y,{passive:!0}),document.addEventListener("keydown",v),()=>{document.removeEventListener("mousedown",y),document.removeEventListener("touchstart",y),document.removeEventListener("keydown",v)}},[i]);const _=y=>{const v=new Set(c);v.has(y)?v.delete(y):v.add(y);const h=e.filter(m=>v.has(m));r(h)};return T.jsxs("div",{ref:s,className:"relative",children:[T.jsxs("button",{type:"button","aria-haspopup":"menu","aria-expanded":i,"aria-controls":l,"aria-label":"Filter by project",onClick:()=>a(y=>!y),className:"flex h-6 max-w-[11rem] items-center gap-1 rounded border border-border bg-base px-2 text-[11px] text-primary hover:bg-hover focus:border-accent focus:outline-none",title:u,children:[T.jsx("span",{className:"truncate",children:f}),T.jsx(ff,{className:"h-3 w-3 shrink-0 text-muted"})]}),i&&T.jsxs("div",{id:l,role:"menu",className:"absolute right-0 z-20 mt-1 w-60 rounded border border-border bg-surface p-2 text-xs shadow-lg",children:[T.jsxs("label",{className:"flex cursor-pointer items-center gap-2 rounded px-2 py-1.5 text-primary hover:bg-hover",children:[T.jsx("input",{type:"checkbox",checked:t.length===0,onChange:()=>r([]),className:"h-3.5 w-3.5 accent-approval"}),T.jsx("span",{children:"All Projects"})]}),T.jsx("div",{className:"my-2 h-px bg-border"}),e.length===0?T.jsx("div",{className:"px-2 py-1 text-muted",children:"No projects"}):T.jsx("div",{className:"max-h-48 overflow-y-auto pr-1",children:e.map(y=>{const v=o.get(y)??_s(y)??y;return T.jsxs("label",{className:"flex cursor-pointer items-center gap-2 rounded px-2 py-1.5 text-primary hover:bg-hover",title:y,children:[T.jsx("input",{type:"checkbox",checked:c.has(y),onChange:()=>_(y),className:"h-3.5 w-3.5 accent-approval"}),T.jsx("span",{className:"truncate",children:v})]},y)})})]}),p&&T.jsx("button",{type:"button",className:"absolute -right-1 -top-1 h-2 w-2 rounded-full bg-approval pulse-approval ring-2 ring-elevated",title:"Hidden sessions need attention","aria-label":"Clear project filters",onClick:y=>{y.stopPropagation(),r([])},children:T.jsx("span",{className:"sr-only",children:"Clear project filters"})})]})}const Kl=new Set(["tool_result","custom_tool_call_output"]),bR=new Set(["text","input_text","output_text"]);function qr(e){return!e||typeof e!="object"?null:e}function At(e){return typeof e=="string"?e:null}function Uo(e){return e==="user"?"user":e==="assistant"?"assistant":e==="system"||e==="developer"?"system":e==="tool"?"tool":"other"}function CR(e){const t=At(e.type)??"",r=qr(e.payload),n=At(r==null?void 0:r.type)??"",i=At(e.source)??At(r==null?void 0:r.source)??"",a=At(e.agent)??"";return i.toLowerCase()==="pi"||a.toLowerCase()==="pi"?"pi":t==="response_item"||t==="event_msg"?"codex":t==="tool_use"||t==="result"||t==="user"||t==="assistant"||t==="system"?"claude":n==="user_message"||n==="assistant_message"?"codex":"unknown"}function ER(e){const t=qr(e.payload),r=At(t==null?void 0:t.type);return{family:CR(e),rawType:At(e.type)??"unknown",...r?{payloadType:r}:{}}}function bt(e){if(!e)return[];if(typeof e=="string")return e.trim()?[e]:[];if(Array.isArray(e)){const r=[];for(const n of e){if(typeof n=="string"){n.trim()&&r.push(n);continue}const i=qr(n);if(!i)continue;const a=At(i.type);if(a&&Kl.has(a)||a&&!bR.has(a))continue;const l=At(i.text);l&&l.trim()&&r.push(l)}return r}const t=qr(e);if(t){const r=At(t.type);if(r&&Kl.has(r))return[];const n=At(t.text);return n&&n.trim()?[n]:[...bt(t.content),...bt(t.message)]}return[]}function kR(e,t){if(e.type!=="response_item")return[];const r=qr(e.payload);if(!r||r.type!=="message")return[];const n=Uo(r.role);return bt(r.content).map(i=>({kind:"message",role:n,text:i,source:t}))}function LR(e,t){if(e.type!=="event_msg")return[];const r=qr(e.payload);if(!r)return[];const n=At(r.type);let i=null;if(n==="user_message"?i="user":n==="assistant_message"?i="assistant":n==="system_message"?i="system":n==="message"&&(i=Uo(r.role)),!i||!["user","assistant","system"].includes(i))return[];const a=Array.from(new Set([...bt(r.message),...bt(r.content),...bt(r.text)]));return a.length===0?[]:a.map(l=>({kind:"message",role:i,text:l,source:t}))}function TR(e,t){const r=Uo(e.type),n=qr(e.message);if(n){const a=Uo(n.role??e.type);return[...bt(n.content),...bt(n.text),...bt(n.message)].map(s=>({kind:"message",role:a,text:s,source:t}))}return["user","assistant","system"].includes(r)?[...bt(e.content),...bt(e.text)].map(a=>({kind:"message",role:r,text:a,source:t})):[]}function RR(e,t){const r=Uo(e.role);return["user","assistant","system"].includes(r)?[...bt(e.content),...bt(e.message),...bt(e.text)].map(i=>({kind:"message",role:r,text:i,source:t})):[]}function DR(e,t){const r=At(e.type),n=At(e.event);return r!=="tool_use"&&n!=="tool_use"?[]:[{kind:"tool_call",role:"assistant",text:`[Tool: ${At(e.name)??"tool"}]`,source:t}]}function MR(e,t){if(e.type!=="result")return[];const r=At(e.result);return!r||!r.trim()?[]:[{kind:"result",role:"system",text:r,source:t}]}function AR(e,t){const r=qr(e.payload),n=[...bt(e.message),...bt(e.content),...bt(e.text),...bt(r==null?void 0:r.message),...bt(r==null?void 0:r.content)];return n.length===0?[]:n.map(i=>({kind:"unknown",role:"other",text:i,source:t}))}function PR(e,t){const r=At(e.type),n=qr(e.payload),i=At(n==null?void 0:n.type);return r&&Kl.has(r)||i&&Kl.has(i)?[{kind:"tool_result",role:"tool",text:"",source:t}]:[]}function IR(e){const t=qr(e);if(!t)return[];const r=ER(t),n=[...kR(t,r),...LR(t,r),...TR(t,r),...DR(t,r),...MR(t,r),...PR(t,r)];if(n.length>0)return n;const i=RR(t,r);return i.length>0?i:AR(t,r)}function BR(e){const t=e.trim();if(!t)return null;try{const r=JSON.parse(t);return{parsed:!0,events:IR(r),raw:r}}catch{return{parsed:!1,events:[{kind:"unknown",role:"other",text:t,source:{family:"unknown",rawType:"raw_text"}}],raw:e}}}function OR(e){return e==="user"?"user":e==="assistant"?"assistant":e==="system"?"system":"other"}function NR(e){const t=BR(e);if(!t)return[];const r=t.events.map(n=>({type:OR(n.role),content:n.text.trim(),raw:e})).filter(n=>n.content.length>0);return r.length>0?r:!t.parsed&&e.trim()?[{type:"other",content:e.trim(),raw:e}]:[]}function jR({session:e,onClose:t,onResume:r}){const[n,i]=k.useState(!0),[a,l]=k.useState(null),[s,o]=k.useState(null),[c,p]=k.useState(!1),u=k.useRef(null),f=k.useRef(null);k.useEffect(()=>{(async()=>{try{const m=await fetch(`/api/session-preview/${e.sessionId}`);if(!m.ok){const g=await m.json();throw new Error(g.error||"Failed to load preview")}const d=await m.json();o(d)}catch(m){l(m instanceof Error?m.message:"Failed to load preview")}finally{i(!1)}})()},[e.sessionId]),k.useEffect(()=>{u.current&&s&&(u.current.scrollTop=u.current.scrollHeight)},[s,c]),k.useEffect(()=>{const h=m=>{m.key==="Escape"?(m.stopPropagation(),t()):m.key==="Enter"&&!n&&!a&&(m.preventDefault(),r(e.sessionId))};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[t,r,e.sessionId,n,a]),k.useEffect(()=>{var h;(h=f.current)==null||h.focus()},[]);const _=e.displayName||_s(e.projectPath)||e.sessionId.slice(0,8),y=np(e.lastActivityAt),v=(s==null?void 0:s.lines.flatMap(NR).slice(-30))??[];return T.jsx("div",{role:"dialog","aria-modal":"true","aria-labelledby":"preview-title",className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4",onClick:h=>{h.target===h.currentTarget&&t()},children:T.jsxs("div",{ref:f,tabIndex:-1,className:"flex max-h-[80vh] w-full max-w-2xl flex-col border border-border bg-elevated",children:[T.jsxs("div",{className:"flex items-center gap-3 border-b border-border px-4 py-3",children:[T.jsx(bc,{agentType:e.agentType,className:"h-5 w-5 shrink-0 text-muted"}),T.jsxs("div",{className:"min-w-0 flex-1",children:[T.jsx("h2",{id:"preview-title",className:"truncate text-sm font-semibold text-primary",children:_}),T.jsxs("p",{className:"truncate text-xs text-muted",title:e.projectPath,children:[_s(e.projectPath)," · ",y]})]}),T.jsx("button",{type:"button",onClick:()=>p(h=>!h),className:`btn text-xs ${c?"btn-primary":""}`,children:c?"Parsed":"Raw"})]}),T.jsxs("div",{ref:u,className:"flex-1 overflow-y-auto p-4 font-mono text-xs",children:[n&&T.jsx("div",{className:"flex items-center justify-center py-8 text-muted",children:"Loading preview..."}),a&&T.jsx("div",{className:"flex items-center justify-center py-8 text-danger",children:a}),s&&!c&&T.jsx("div",{className:"space-y-2",children:v.length===0?T.jsx("div",{className:"py-8 text-center text-muted",children:"No readable content found. Try raw view."}):v.map((h,m)=>T.jsx("div",{className:`rounded px-2 py-1 ${h.type==="user"?"bg-blue-500/10 text-blue-400":h.type==="assistant"?"bg-emerald-500/10 text-emerald-400":h.type==="system"?"bg-yellow-500/10 text-yellow-400":"text-muted"}`,children:T.jsx("span",{className:"whitespace-pre-wrap break-words",children:h.content.length>500?`${h.content.slice(0,500)}...`:h.content})},m))}),s&&c&&T.jsx("div",{className:"space-y-1",children:s.lines.slice(-50).map((h,m)=>T.jsx("div",{className:"whitespace-pre-wrap break-all text-muted",children:h||" "},m))})]}),T.jsxs("div",{className:"flex items-center justify-end gap-2 border-t border-border px-4 py-3",children:[T.jsx("button",{type:"button",onClick:t,className:"btn",children:"Cancel"}),T.jsx("button",{type:"button",onClick:()=>r(e.sessionId),disabled:n||!!a,className:"btn btn-primary",children:"Resume"})]})]})})}const hv={working:"bg-green-500/20 text-green-600",waiting:"bg-zinc-500/20 text-zinc-400",permission:"bg-amber-500/20 text-amber-600",unknown:"bg-zinc-500/20 text-zinc-400"};function FR(){const[,e]=k.useState(0);k.useEffect(()=>{const t=setInterval(()=>e(r=>r+1),3e4);return()=>clearInterval(t)},[])}function hw({sessions:e,inactiveSessions:t=[],selectedSessionId:r,loading:n,error:i,onSelect:a,onRename:l,onResume:s,onKill:o,onDuplicate:c,onSetPinned:p}){FR();const[u,f]=k.useState(null),_=pe(X=>X.inactiveSessionsExpanded),y=pe(X=>X.setInactiveSessionsExpanded),[v,h]=k.useState(null),[m,d]=k.useState(20),g=$1();k.useEffect(()=>{_||d(20)},[_]);const w=200,[b,x]=uv(e.length,w),[C,S]=uv(t.length,w,!0),E=k.useRef(new Set(e.map(X=>X.id))),L=k.useRef(new Set(t.map(X=>X.sessionId))),[A,M]=k.useState(new Set);k.useEffect(()=>{var We;const X=new Set(e.map(Z=>Z.id)),le=new Set(t.map(Z=>Z.sessionId)),ge=new Set;for(const Z of X)E.current.has(Z)||ge.add(Z);for(const Z of e){const Le=(We=Z.agentSessionId)==null?void 0:We.trim();Le&&L.current.has(Le)&&!le.has(Le)&&ge.add(Z.id)}E.current=X,L.current=le,ge.size>0&&M(ge)},[e,t]),k.useEffect(()=>{if(A.size===0)return;const X=setTimeout(()=>M(new Set),500);return()=>clearTimeout(X)},[A]);const D=pe(X=>X.shortcutModifier),B=ii(Zo(D)),H=pe(X=>X.sessionSortMode),F=pe(X=>X.setSessionSortMode),$=pe(X=>X.sessionSortDirection),I=pe(X=>X.manualSessionOrder),R=pe(X=>X.setManualSessionOrder),P=pe(X=>X.showProjectName),N=pe(X=>X.showLastUserMessage),j=pe(X=>X.showSessionIdPrefix),U=pe(X=>X.projectFilters),V=pe(X=>X.setProjectFilters),ee=pe(X=>X.hostFilters),Q=pe(X=>X.setHostFilters),z=Ge(X=>X.exitingSessions),O=Ge(X=>X.clearExitingSession),K=Ge(X=>X.hostStatuses),W=Ge(X=>X.remoteAllowControl);dR(e,z,O,w),k.useEffect(()=>{if(I.length===0)return;const X=new Set;for(const ge of e)X.add(go(ge)),X.add(ge.id);for(const ge of t)X.add(ge.sessionId);const le=I.filter(ge=>X.has(ge));le.length!==I.length&&R(le)},[e,t,I,R]);const J=k.useMemo(()=>rp(e,{mode:H,direction:$,manualOrder:I}),[e,H,$,I]),_e=k.useMemo(()=>cR(e,t),[e,t]),ue=k.useMemo(()=>{const X=uR(e,t),le=K.map(Z=>Z.host),ge=new Set,We=[];for(const Z of le)!Z||ge.has(Z)||(ge.add(Z),We.push(Z));for(const Z of X)!Z||ge.has(Z)||(ge.add(Z),We.push(Z));return We},[e,t,K]),se=k.useMemo(()=>ue.length>1,[ue]),re=k.useMemo(()=>{let X=J;return U.length>0&&(X=X.filter(le=>U.includes(le.projectPath))),ee.length>0&&(X=X.filter(le=>ee.includes(le.host??""))),X},[J,U,ee]),ae=k.useMemo(()=>{const X=U.length===0?"all-projects":U.join("|"),le=ee.length===0?"all-hosts":ee.join("|");return`${X}::${le}`},[U,ee]),ye=k.useRef(new Set(re.map(X=>X.id))),[ve,ne]=k.useState(new Set);k.useEffect(()=>{const X=new Set(re.map(ge=>ge.id)),le=new Set;for(const ge of X)ye.current.has(ge)||A.has(ge)||le.add(ge);ye.current=X,le.size>0&&ne(le)},[re,A]),k.useEffect(()=>{if(ve.size===0)return;const X=setTimeout(()=>ne(new Set),500);return()=>clearTimeout(X)},[ve]);const ie=k.useMemo(()=>{let X=t;return U.length>0&&(X=X.filter(le=>U.includes(le.projectPath))),ee.length>0&&(X=X.filter(le=>ee.includes(le.host??""))),X},[t,U,ee]),he=k.useMemo(()=>{if(U.length===0)return 0;const X=new Set(U);return e.filter(le=>!X.has(le.projectPath)&&le.status==="permission").length},[e,U]);k.useEffect(()=>{if(U.length===0||_e.length===0)return;const X=new Set(_e),le=U.filter(ge=>X.has(ge));le.length!==U.length&&V(le)},[U,_e,V]),k.useEffect(()=>{if(ee.length===0||ue.length===0)return;const X=new Set(ue),le=ee.filter(ge=>X.has(ge));le.length!==ee.length&&Q(le)},[ee,ue,Q]);const oe=OL(BL(tp,{activationConstraint:{distance:8}})),[me,xe]=k.useState(null),[ke,Ne]=k.useState(null),[Ke,Ae]=k.useState(!1),Pe=k.useCallback(X=>{xe(X.active.id),Ae(!0)},[]),G=k.useCallback(X=>{var le;Ne((le=X.over)==null?void 0:le.id)},[]),Y=k.useCallback(X=>{const{active:le,over:ge}=X;if(xe(null),Ne(null),!ge||le.id===ge.id){setTimeout(()=>Ae(!1),100);return}const We=re.findIndex(Me=>Me.id===le.id),Z=re.findIndex(Me=>Me.id===ge.id);if(We===-1||Z===-1){setTimeout(()=>Ae(!1),100);return}const Le=re.map(Me=>go(Me)),[de]=Le.splice(We,1);Le.splice(Z,0,de);const fe=J.map(Me=>go(Me)),Ee=new Set(Le);let Re=0;const je=fe.map(Me=>{if(!Ee.has(Me))return Me;const Ie=Le[Re];return Re+=1,Ie});H!=="manual"&&F("manual"),R(je),setTimeout(()=>Ae(!1),100)},[re,J,H,F,R]),Oe=k.useCallback(()=>{xe(null),Ne(null),setTimeout(()=>Ae(!1),100)},[]);k.useEffect(()=>{if(!me&&!ke)return;const X=new Set(re.map(ge=>ge.id));let le=!1;me&&!X.has(me)&&(xe(null),le=!0),ke&&!X.has(ke)&&(Ne(null),le=!0),le&&Ae(!1)},[re,me,ke]);const $e=(X,le)=>{l(X,le),f(null)};return T.jsxs("aside",{className:"flex min-h-0 flex-1 flex-col border-r border-border bg-elevated",children:[i&&T.jsx("div",{className:"shrink-0 border-b border-danger/30 bg-danger/10 px-3 py-2 text-xs text-danger",children:i}),T.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto",children:[T.jsxs("div",{className:"sticky top-0 z-10 flex h-10 items-center justify-between border-b border-border bg-elevated px-3",children:[T.jsx("span",{className:"text-xs font-medium uppercase tracking-wider text-muted",children:"Sessions"}),T.jsxs("div",{className:"flex items-center gap-4",children:[se&&T.jsx(SR,{hosts:ue,selectedHosts:ee,onSelect:Q,statuses:K}),T.jsx(xR,{projects:_e,selectedProjects:U,onSelect:V,hasHiddenPermissions:he>0}),T.jsx(Yh.span,{className:"w-8 text-right text-xs text-muted",animate:b&&!g?{scale:[1,1.3,1]}:{},transition:{duration:.3},onAnimationComplete:x,children:re.length})]})]}),n?T.jsx("div",{className:"space-y-1 p-2",children:[0,1,2].map(X=>T.jsx("div",{className:"h-14 animate-pulse rounded bg-surface"},X))}):re.length===0?T.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted",children:"No sessions"}):T.jsx($T,{sensors:oe,collisionDetection:HL,onDragStart:Pe,onDragOver:G,onDragEnd:Y,onDragCancel:Oe,children:T.jsx(ZT,{items:re.map(X=>X.id),strategy:JT,children:T.jsx("div",{children:T.jsx(W5,{initial:!1,mode:"popLayout",children:re.map((X,le)=>{const ge=A.has(X.id),We=ve.has(X.id),Z=X.remote===!0,Le=X.source==="managed",de=!Z||W&&Le,fe=me?re.findIndex(Me=>Me.id===me):-1,Re=ke===X.id&&me!==X.id?fe>le?"above":"below":null,je=ge||We;return T.jsx(dw,{session:X,isNew:je,exitDuration:w,prefersReducedMotion:g,layoutAnimationsDisabled:Ke,isSelected:X.id===r,isEditing:X.id===u,showSessionIdPrefix:j,showProjectName:P,showLastUserMessage:N,showHostInfo:se,dropIndicator:Re,onSelect:()=>a(X.id),onStartEdit:de?()=>f(X.id):void 0,onCancelEdit:()=>f(null),onRename:Me=>$e(X.id,Me),onKill:o&&de?()=>o(X.id):void 0,onDuplicate:c&&de?()=>c(X.id):void 0,onSetPinned:p&&X.agentSessionId?Me=>p(X.agentSessionId.trim(),Me):void 0},X.id)})})},ae)})}),ie.length>0&&T.jsxs("div",{className:"border-t border-border",children:[T.jsxs("button",{type:"button",onClick:()=>y(!_),className:"flex w-full items-center justify-between px-3 py-2 text-left text-xs font-medium uppercase tracking-wider text-muted hover:text-primary",children:[T.jsxs("span",{className:"flex items-center gap-2",children:[_?T.jsx(ff,{className:"h-4 w-4"}):T.jsx(dC,{className:"h-4 w-4"}),"Inactive Sessions"]}),T.jsx(Yh.span,{className:"w-8 text-right text-xs",animate:C&&!g?{scale:[1,1.3,1]}:{},transition:{duration:.3},onAnimationComplete:S,children:ie.length})]}),_&&T.jsxs("div",{className:"py-1",children:[ie.slice(0,m).map(X=>T.jsx(yR,{session:X,showSessionIdPrefix:j,showProjectName:P,showLastUserMessage:N,onResume:le=>s==null?void 0:s(le),onPreview:h,onSetPinned:p},X.sessionId)),ie.length>m&&T.jsxs("button",{type:"button",onClick:()=>d(X=>X+20),className:"w-full px-3 py-2 text-center text-xs text-muted hover:text-primary hover:bg-hover",children:["Show more (",ie.length-m," remaining)"]})]})]})]}),T.jsx("div",{className:"hidden shrink-0 border-t border-border px-3 py-2 md:block",children:T.jsxs("div",{className:"flex flex-wrap gap-x-3 gap-y-0.5 text-[10px] text-muted",children:[T.jsxs("span",{children:[B,"[ ] nav"]}),T.jsxs("span",{children:[B,"N new"]}),T.jsxs("span",{children:[B,"X kill"]})]})}),v&&T.jsx(jR,{session:v,onClose:()=>h(null),onResume:X=>{h(null),s==null||s(X)}})]})}const dw=k.forwardRef(function({session:t,isNew:r,exitDuration:n,prefersReducedMotion:i,layoutAnimationsDisabled:a,isSelected:l,isEditing:s,showSessionIdPrefix:o,showProjectName:c,showLastUserMessage:p,showHostInfo:u,dropIndicator:f,onSelect:_,onStartEdit:y,onCancelEdit:v,onRename:h,onKill:m,onDuplicate:d,onSetPinned:g},w){const{attributes:b,listeners:x,setNodeRef:C,transform:S,transition:E,isDragging:L}=oR({id:t.id,animateLayoutChanges:({isSorting:H,wasDragging:F})=>H||F}),A=Ho.Transform.toString(S),D={...!!(i&&A)?{transform:A,transition:E}:{},zIndex:L?10:void 0,opacity:L?.9:void 0},B=k.useCallback(H=>{C(H),typeof w=="function"?w(H):w&&(w.current=H)},[C,w]);return T.jsxs(Yh.div,{ref:B,style:{...D,overflow:"hidden"},className:"relative",layout:!i&&!L&&!a&&!r,transformTemplate:(H,F)=>A?!F||F==="none"?A:`${A} ${F}`:F,initial:i||!r?!1:{opacity:0,scale:.97},animate:i?{opacity:1}:r?{opacity:1,scale:[1.02,.99,1]}:{opacity:1,scale:1},exit:i?{opacity:0}:{opacity:0,height:0,scale:.97},transition:i?{duration:0}:{layout:{type:"spring",stiffness:500,damping:35},opacity:{duration:n/1e3},scale:{duration:n/1e3,ease:[.34,1.56,.64,1]},height:{duration:n/1e3,ease:"easeOut"}},...b,...x,children:[f==="above"&&T.jsx("div",{className:"absolute -top-px left-3 right-3 h-0.5 border-t-2 border-dashed border-accent"}),T.jsx($R,{session:t,isSelected:l,isEditing:s,showSessionIdPrefix:o,showProjectName:c,showLastUserMessage:p,showHostInfo:u,isDragging:L,onSelect:_,onStartEdit:y,onCancelEdit:v,onRename:h,onKill:m,onDuplicate:d,onSetPinned:g}),f==="below"&&T.jsx("div",{className:"absolute -bottom-px left-3 right-3 h-0.5 border-t-2 border-dashed border-accent"})]})});dw.displayName="SortableSessionItem";function $R({session:e,isSelected:t,isEditing:r,showSessionIdPrefix:n,showProjectName:i,showLastUserMessage:a,showHostInfo:l,isDragging:s=!1,onSelect:o,onStartEdit:c,onCancelEdit:p,onRename:u,onKill:f,onDuplicate:_,onSetPinned:y}){var Q,z,O,K;const v=np(e.lastActivity),h=k.useRef(null),m=k.useRef(null),d=((Q=e.agentSessionName)==null?void 0:Q.trim())||((z=e.name)==null?void 0:z.trim())||e.id,[g,w]=k.useState(d),b=k.useRef(null),[x,C]=k.useState(null),S=_s(e.projectPath),E=(O=e.host)==null?void 0:O.trim(),L=e.status==="permission",A=(K=e.agentSessionId)==null?void 0:K.trim(),M=n&&A?lw(A):"",D=i&&!!S,B=l&&!!E,H=a&&!!e.lastUserMessage,F=k.useRef(e.status),[$,I]=k.useState(!1);k.useEffect(()=>{const W=F.current,te=e.status;W==="working"&&te==="waiting"?I(!0):F.current=te},[e.status]);const R=()=>{I(!1),F.current=e.status};k.useEffect(()=>{r&&h.current&&(h.current.focus(),h.current.select())},[r]),k.useEffect(()=>{w(d)},[d]);const P=()=>{const W=g.trim();W&&W!==d?u(W):p()},N=W=>{W.key==="Enter"?(W.preventDefault(),P()):W.key==="Escape"&&(W.preventDefault(),w(d),p())},j=k.useRef(null),U=W=>{if(s)return;const te=W.touches[0];j.current={x:te.clientX,y:te.clientY},b.current=setTimeout(()=>{j.current&&C(j.current)},500)},V=()=>{b.current&&(clearTimeout(b.current),b.current=null)};k.useEffect(()=>{if(!x)return;const W=J=>{m.current&&!m.current.contains(J.target)&&C(null)},te=J=>{J.key==="Escape"&&C(null)};return document.addEventListener("mousedown",W),document.addEventListener("touchstart",W),document.addEventListener("keydown",te),()=>{document.removeEventListener("mousedown",W),document.removeEventListener("touchstart",W),document.removeEventListener("keydown",te)}},[x]);const ee=W=>{W.preventDefault(),W.stopPropagation(),C({x:W.clientX,y:W.clientY})};return T.jsxs("div",{className:`session-row group cursor-pointer select-none px-3 py-2 ${t?"selected":""} ${s?"cursor-grabbing shadow-lg ring-1 ring-accent/30 bg-elevated":"cursor-grab"}`,role:"button",tabIndex:0,"data-testid":"session-card","data-session-id":e.id,onClick:s?void 0:o,onKeyDown:W=>{(W.key==="Enter"||W.key===" ")&&o()},onContextMenu:ee,onTouchStart:U,onTouchEnd:V,onTouchCancel:V,children:[T.jsxs("div",{className:"flex flex-col gap-0.5 pl-0.5",children:[T.jsxs("div",{className:"flex items-center gap-2",children:[T.jsx(bc,{agentType:e.agentType,command:e.command,className:"h-3.5 w-3.5 shrink-0 text-muted"}),r?T.jsx("input",{ref:h,type:"text",value:g,onChange:W=>w(W.target.value),onBlur:P,onKeyDown:N,onClick:W=>W.stopPropagation(),className:"min-w-0 flex-1 rounded border border-border bg-surface px-1.5 py-0.5 text-sm font-medium text-primary outline-none focus:border-accent"}):T.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium text-primary",children:d}),e.isPinned&&T.jsx(Il,{className:"h-3 w-3 shrink-0 text-primary","aria-label":"Pinned",title:"Pinned - will auto-resume on server restart"}),M&&T.jsx("span",{className:"shrink-0 text-[11px] font-mono text-muted",title:A,children:M}),L?T.jsx("span",{className:`ml-1 flex shrink-0 items-center justify-center rounded-full px-1.5 py-0.5 ${hv[e.status]} pulse-approval`,onAnimationEnd:R,children:T.jsx(bC,{className:"h-3 w-3","aria-label":"Needs input"})}):T.jsx("span",{className:`ml-1 shrink-0 rounded-full px-1.5 py-0.5 text-right text-xs tabular-nums ${hv[e.status]}${$?" pulse-complete":""}`,onAnimationEnd:R,children:v})]}),(D||B||H)&&T.jsxs("div",{className:"flex flex-wrap items-center gap-1 pl-[1.375rem]",children:[B&&T.jsx(wR,{name:E}),D&&T.jsx(uw,{name:S,fullPath:e.projectPath}),H&&T.jsxs("span",{className:"line-clamp-2 text-xs italic text-muted",children:['"',e.lastUserMessage.length>200?e.lastUserMessage.slice(0,200)+"…":e.lastUserMessage,'"']})]})]}),x&&T.jsxs("div",{ref:m,className:"fixed z-50 min-w-[160px] rounded-md border border-border bg-elevated shadow-lg py-1",style:{left:x.x,top:x.y},role:"menu",children:[c&&T.jsxs("button",{onClick:W=>{W.stopPropagation(),C(null),c()},className:"w-full px-3 py-2 text-left text-sm text-secondary hover:bg-hover hover:text-primary flex items-center gap-2",role:"menuitem",children:[T.jsx(ny,{width:14,height:14}),"Rename"]}),_&&T.jsxs("button",{onClick:W=>{W.stopPropagation(),C(null),_()},className:"w-full px-3 py-2 text-left text-sm text-secondary hover:bg-hover hover:text-primary flex items-center gap-2",role:"menuitem",title:"Create a copy in a new tmux window",children:[T.jsx(ry,{width:14,height:14}),"Duplicate"]}),y&&T.jsxs("button",{onClick:W=>{W.stopPropagation(),C(null),y(!e.isPinned)},className:"w-full px-3 py-2 text-left text-sm text-secondary hover:bg-hover hover:text-primary flex items-center gap-2",role:"menuitem",title:e.isPinned?"Remove from auto-resume list":"Auto-resume on server restart",children:[T.jsx(Il,{width:14,height:14}),e.isPinned?"Unpin":"Pin"]}),e.logFilePath&&T.jsxs("button",{onClick:W=>{W.stopPropagation();const te=e.logFilePath;if(C(null),te){const J=document.createElement("textarea");J.value=te,J.style.position="fixed",J.style.left="-9999px",document.body.appendChild(J),J.focus(),J.select();try{document.execCommand("copy")}catch{navigator.clipboard.writeText(te).catch(()=>{})}document.body.removeChild(J)}},className:"w-full px-3 py-2 text-left text-sm text-secondary hover:bg-hover hover:text-primary flex items-center gap-2",role:"menuitem",title:e.logFilePath,children:[T.jsx(sy,{width:14,height:14}),"Copy Log Path"]}),f&&T.jsxs(T.Fragment,{children:[T.jsx("div",{className:"my-1 border-t border-border"}),T.jsxs("button",{onClick:W=>{W.stopPropagation(),C(null),f()},className:"w-full px-3 py-2 text-left text-sm text-danger hover:bg-danger/10 flex items-center gap-2",role:"menuitem",children:[T.jsx(Th,{width:14,height:14}),"Kill Session"]})]})]})]})}const rd={debug:0,info:1,warn:2,error:3};let fw="info";function HR(e){const t=e.toLowerCase();t in rd&&(fw=t)}function Qe(e,t,r="debug"){if(!(rd[r]<rd[fw]))try{fetch("/api/client-log",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({event:e,data:t,level:r})}).catch(()=>{})}catch{}}var pw={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(globalThis,()=>(()=>{var r={4567:function(l,s,o){var c=this&&this.__decorate||function(d,g,w,b){var x,C=arguments.length,S=C<3?g:b===null?b=Object.getOwnPropertyDescriptor(g,w):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(d,g,w,b);else for(var E=d.length-1;E>=0;E--)(x=d[E])&&(S=(C<3?x(S):C>3?x(g,w,S):x(g,w))||S);return C>3&&S&&Object.defineProperty(g,w,S),S},p=this&&this.__param||function(d,g){return function(w,b){g(w,b,d)}};Object.defineProperty(s,"__esModule",{value:!0}),s.AccessibilityManager=void 0;const u=o(9042),f=o(9924),_=o(844),y=o(4725),v=o(2585),h=o(3656);let m=s.AccessibilityManager=class extends _.Disposable{constructor(d,g,w,b){super(),this._terminal=d,this._coreBrowserService=w,this._renderService=b,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let x=0;x<this._terminal.rows;x++)this._rowElements[x]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[x]);if(this._topBoundaryFocusListener=x=>this._handleBoundaryFocus(x,0),this._bottomBoundaryFocusListener=x=>this._handleBoundaryFocus(x,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new f.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize(x=>this._handleResize(x.rows))),this.register(this._terminal.onRender(x=>this._refreshRows(x.start,x.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(x=>this._handleChar(x))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
52
+ `},PL={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was moved over droppable area "+r.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was dropped over droppable area "+r.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function IL(e){let{announcements:t=PL,container:r,hiddenTextDescribedById:n,screenReaderInstructions:i=AL}=e;const{announce:a,announcement:l}=RL(),s=oa("DndLiveRegion"),[o,c]=k.useState(!1);if(k.useEffect(()=>{c(!0)},[]),DL(k.useMemo(()=>({onDragStart(u){let{active:f}=u;a(t.onDragStart({active:f}))},onDragMove(u){let{active:f,over:_}=u;t.onDragMove&&a(t.onDragMove({active:f,over:_}))},onDragOver(u){let{active:f,over:_}=u;a(t.onDragOver({active:f,over:_}))},onDragEnd(u){let{active:f,over:_}=u;a(t.onDragEnd({active:f,over:_}))},onDragCancel(u){let{active:f,over:_}=u;a(t.onDragCancel({active:f,over:_}))}}),[a,t])),!o)return null;const p=gt.createElement(gt.Fragment,null,gt.createElement(LL,{id:n,value:i.draggable}),gt.createElement(TL,{id:s,announcement:l}));return r?hn.createPortal(p,r):p}var xt;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(xt||(xt={}));function Wl(){}function BL(e,t){return k.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function OL(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return k.useMemo(()=>[...t].filter(n=>n!=null),[...t])}const jr=Object.freeze({x:0,y:0});function NL(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function jL(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return r-n}function FL(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return n-r}function $L(e,t){if(!e||e.length===0)return null;const[r]=e;return r[t]}function Zg(e,t,r){return t===void 0&&(t=e.left),r===void 0&&(r=e.top),{x:t+e.width*.5,y:r+e.height*.5}}const HL=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const i=Zg(t,t.left,t.top),a=[];for(const l of n){const{id:s}=l,o=r.get(s);if(o){const c=NL(Zg(o),i);a.push({id:s,data:{droppableContainer:l,value:c}})}}return a.sort(jL)};function zL(e,t){const r=Math.max(t.top,e.top),n=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),l=i-n,s=a-r;if(n<i&&r<a){const o=t.width*t.height,c=e.width*e.height,p=l*s,u=p/(o+c-p);return Number(u.toFixed(4))}return 0}const UL=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const i=[];for(const a of n){const{id:l}=a,s=r.get(l);if(s){const o=zL(s,t);o>0&&i.push({id:l,data:{droppableContainer:a,value:o}})}}return i.sort(FL)};function WL(e,t,r){return{...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}function W1(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:jr}function VL(e){return function(r){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];return i.reduce((l,s)=>({...l,top:l.top+e*s.y,bottom:l.bottom+e*s.y,left:l.left+e*s.x,right:l.right+e*s.x}),{...r})}}const KL=VL(1);function GL(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function qL(e,t,r){const n=GL(t);if(!n)return e;const{scaleX:i,scaleY:a,x:l,y:s}=n,o=e.left-l-(1-i)*parseFloat(r),c=e.top-s-(1-a)*parseFloat(r.slice(r.indexOf(" ")+1)),p=i?e.width/i:e.width,u=a?e.height/a:e.height;return{width:p,height:u,top:c,right:o+p,bottom:c+u,left:o}}const XL={ignoreTransform:!1};function Ti(e,t){t===void 0&&(t=XL);let r=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:c,transformOrigin:p}=lr(e).getComputedStyle(e);c&&(r=qL(r,c,p))}const{top:n,left:i,width:a,height:l,bottom:s,right:o}=r;return{top:n,left:i,width:a,height:l,bottom:s,right:o}}function ev(e){return Ti(e,{ignoreTransform:!0})}function YL(e){const t=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:t,bottom:r,width:t,height:r}}function JL(e,t){return t===void 0&&(t=lr(e).getComputedStyle(e)),t.position==="fixed"}function QL(e,t){t===void 0&&(t=lr(e).getComputedStyle(e));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(i=>{const a=t[i];return typeof a=="string"?r.test(a):!1})}function Qf(e,t){const r=[];function n(i){if(t!=null&&r.length>=t||!i)return r;if(Xf(i)&&i.scrollingElement!=null&&!r.includes(i.scrollingElement))return r.push(i.scrollingElement),r;if(!sa(i)||H1(i)||r.includes(i))return r;const a=lr(e).getComputedStyle(i);return i!==e&&QL(i,a)&&r.push(i),JL(i,a)?r:n(i.parentNode)}return e?n(e):r}function V1(e){const[t]=Qf(e,1);return t??null}function gu(e){return!wc||!e?null:ki(e)?e:qf(e)?Xf(e)||e===Li(e).scrollingElement?window:sa(e)?e:null:null}function K1(e){return ki(e)?e.scrollX:e.scrollLeft}function G1(e){return ki(e)?e.scrollY:e.scrollTop}function Zh(e){return{x:K1(e),y:G1(e)}}var Tt;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Tt||(Tt={}));function q1(e){return!wc||!e?!1:e===document.scrollingElement}function X1(e){const t={x:0,y:0},r=q1(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},n={x:e.scrollWidth-r.width,y:e.scrollHeight-r.height},i=e.scrollTop<=t.y,a=e.scrollLeft<=t.x,l=e.scrollTop>=n.y,s=e.scrollLeft>=n.x;return{isTop:i,isLeft:a,isBottom:l,isRight:s,maxScroll:n,minScroll:t}}const ZL={x:.2,y:.2};function eT(e,t,r,n,i){let{top:a,left:l,right:s,bottom:o}=r;n===void 0&&(n=10),i===void 0&&(i=ZL);const{isTop:c,isBottom:p,isLeft:u,isRight:f}=X1(e),_={x:0,y:0},y={x:0,y:0},v={height:t.height*i.y,width:t.width*i.x};return!c&&a<=t.top+v.height?(_.y=Tt.Backward,y.y=n*Math.abs((t.top+v.height-a)/v.height)):!p&&o>=t.bottom-v.height&&(_.y=Tt.Forward,y.y=n*Math.abs((t.bottom-v.height-o)/v.height)),!f&&s>=t.right-v.width?(_.x=Tt.Forward,y.x=n*Math.abs((t.right-v.width-s)/v.width)):!u&&l<=t.left+v.width&&(_.x=Tt.Backward,y.x=n*Math.abs((t.left+v.width-l)/v.width)),{direction:_,speed:y}}function tT(e){if(e===document.scrollingElement){const{innerWidth:a,innerHeight:l}=window;return{top:0,left:0,right:a,bottom:l,width:a,height:l}}const{top:t,left:r,right:n,bottom:i}=e.getBoundingClientRect();return{top:t,left:r,right:n,bottom:i,width:e.clientWidth,height:e.clientHeight}}function Y1(e){return e.reduce((t,r)=>ai(t,Zh(r)),jr)}function rT(e){return e.reduce((t,r)=>t+K1(r),0)}function nT(e){return e.reduce((t,r)=>t+G1(r),0)}function sT(e,t){if(t===void 0&&(t=Ti),!e)return;const{top:r,left:n,bottom:i,right:a}=t(e);V1(e)&&(i<=0||a<=0||r>=window.innerHeight||n>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const iT=[["x",["left","right"],rT],["y",["top","bottom"],nT]];class Zf{constructor(t,r){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=Qf(r),i=Y1(n);this.rect={...t},this.width=t.width,this.height=t.height;for(const[a,l,s]of iT)for(const o of l)Object.defineProperty(this,o,{get:()=>{const c=s(n),p=i[a]-c;return this.rect[o]+p},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class fo{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var n;return(n=this.target)==null?void 0:n.removeEventListener(...r)})},this.target=t}add(t,r,n){var i;(i=this.target)==null||i.addEventListener(t,r,n),this.listeners.push([t,r,n])}}function oT(e){const{EventTarget:t}=lr(e);return e instanceof t?e:Li(e)}function vu(e,t){const r=Math.abs(e.x),n=Math.abs(e.y);return typeof t=="number"?Math.sqrt(r**2+n**2)>t:"x"in t&&"y"in t?r>t.x&&n>t.y:"x"in t?r>t.x:"y"in t?n>t.y:!1}var vr;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(vr||(vr={}));function tv(e){e.preventDefault()}function aT(e){e.stopPropagation()}var Ye;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(Ye||(Ye={}));const J1={start:[Ye.Space,Ye.Enter],cancel:[Ye.Esc],end:[Ye.Space,Ye.Enter,Ye.Tab]},lT=(e,t)=>{let{currentCoordinates:r}=t;switch(e.code){case Ye.Right:return{...r,x:r.x+25};case Ye.Left:return{...r,x:r.x-25};case Ye.Down:return{...r,y:r.y+25};case Ye.Up:return{...r,y:r.y-25}}};class Q1{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:r}}=t;this.props=t,this.listeners=new fo(Li(r)),this.windowListeners=new fo(lr(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(vr.Resize,this.handleCancel),this.windowListeners.add(vr.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(vr.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:r}=this.props,n=t.node.current;n&&sT(n),r(jr)}handleKeyDown(t){if(Jf(t)){const{active:r,context:n,options:i}=this.props,{keyboardCodes:a=J1,coordinateGetter:l=lT,scrollBehavior:s="smooth"}=i,{code:o}=t;if(a.end.includes(o)){this.handleEnd(t);return}if(a.cancel.includes(o)){this.handleCancel(t);return}const{collisionRect:c}=n.current,p=c?{x:c.left,y:c.top}:jr;this.referenceCoordinates||(this.referenceCoordinates=p);const u=l(t,{active:r,context:n.current,currentCoordinates:p});if(u){const f=Ul(u,p),_={x:0,y:0},{scrollableAncestors:y}=n.current;for(const v of y){const h=t.code,{isTop:m,isRight:d,isLeft:g,isBottom:w,maxScroll:b,minScroll:x}=X1(v),C=tT(v),S={x:Math.min(h===Ye.Right?C.right-C.width/2:C.right,Math.max(h===Ye.Right?C.left:C.left+C.width/2,u.x)),y:Math.min(h===Ye.Down?C.bottom-C.height/2:C.bottom,Math.max(h===Ye.Down?C.top:C.top+C.height/2,u.y))},E=h===Ye.Right&&!d||h===Ye.Left&&!g,L=h===Ye.Down&&!w||h===Ye.Up&&!m;if(E&&S.x!==u.x){const A=v.scrollLeft+f.x,M=h===Ye.Right&&A<=b.x||h===Ye.Left&&A>=x.x;if(M&&!f.y){v.scrollTo({left:A,behavior:s});return}M?_.x=v.scrollLeft-A:_.x=h===Ye.Right?v.scrollLeft-b.x:v.scrollLeft-x.x,_.x&&v.scrollBy({left:-_.x,behavior:s});break}else if(L&&S.y!==u.y){const A=v.scrollTop+f.y,M=h===Ye.Down&&A<=b.y||h===Ye.Up&&A>=x.y;if(M&&!f.x){v.scrollTo({top:A,behavior:s});return}M?_.y=v.scrollTop-A:_.y=h===Ye.Down?v.scrollTop-b.y:v.scrollTop-x.y,_.y&&v.scrollBy({top:-_.y,behavior:s});break}}this.handleMove(t,ai(Ul(u,this.referenceCoordinates),_))}}}handleMove(t,r){const{onMove:n}=this.props;t.preventDefault(),n(r)}handleEnd(t){const{onEnd:r}=this.props;t.preventDefault(),this.detach(),r()}handleCancel(t){const{onCancel:r}=this.props;t.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Q1.activators=[{eventName:"onKeyDown",handler:(e,t,r)=>{let{keyboardCodes:n=J1,onActivation:i}=t,{active:a}=r;const{code:l}=e.nativeEvent;if(n.start.includes(l)){const s=a.activatorNode.current;return s&&e.target!==s?!1:(e.preventDefault(),i==null||i({event:e.nativeEvent}),!0)}return!1}}];function rv(e){return!!(e&&"distance"in e)}function nv(e){return!!(e&&"delay"in e)}class ep{constructor(t,r,n){var i;n===void 0&&(n=oT(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=r;const{event:a}=t,{target:l}=a;this.props=t,this.events=r,this.document=Li(l),this.documentListeners=new fo(this.document),this.listeners=new fo(n),this.windowListeners=new fo(lr(l)),this.initialCoordinates=(i=Qh(a))!=null?i:jr,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:r,bypassActivationConstraint:n}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(vr.Resize,this.handleCancel),this.windowListeners.add(vr.DragStart,tv),this.windowListeners.add(vr.VisibilityChange,this.handleCancel),this.windowListeners.add(vr.ContextMenu,tv),this.documentListeners.add(vr.Keydown,this.handleKeydown),r){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(nv(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(rv(r)){this.handlePending(r);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,r){const{active:n,onPending:i}=this.props;i(n,t,this.initialCoordinates,r)}handleStart(){const{initialCoordinates:t}=this,{onStart:r}=this.props;t&&(this.activated=!0,this.documentListeners.add(vr.Click,aT,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(vr.SelectionChange,this.removeTextSelection),r(t))}handleMove(t){var r;const{activated:n,initialCoordinates:i,props:a}=this,{onMove:l,options:{activationConstraint:s}}=a;if(!i)return;const o=(r=Qh(t))!=null?r:jr,c=Ul(i,o);if(!n&&s){if(rv(s)){if(s.tolerance!=null&&vu(c,s.tolerance))return this.handleCancel();if(vu(c,s.distance))return this.handleStart()}if(nv(s)&&vu(c,s.tolerance))return this.handleCancel();this.handlePending(s,c);return}t.cancelable&&t.preventDefault(),l(o)}handleEnd(){const{onAbort:t,onEnd:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleCancel(){const{onAbort:t,onCancel:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleKeydown(t){t.code===Ye.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const cT={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class tp extends ep{constructor(t){const{event:r}=t,n=Li(r.target);super(t,cT,n)}}tp.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return!r.isPrimary||r.button!==0?!1:(n==null||n({event:r}),!0)}}];const uT={move:{name:"mousemove"},end:{name:"mouseup"}};var ed;(function(e){e[e.RightClick=2]="RightClick"})(ed||(ed={}));class hT extends ep{constructor(t){super(t,uT,Li(t.event.target))}}hT.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return r.button===ed.RightClick?!1:(n==null||n({event:r}),!0)}}];const _u={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class dT extends ep{constructor(t){super(t,_u)}static setup(){return window.addEventListener(_u.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(_u.move.name,t)};function t(){}}}dT.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;const{touches:i}=r;return i.length>1?!1:(n==null||n({event:r}),!0)}}];var po;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(po||(po={}));var Vl;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Vl||(Vl={}));function fT(e){let{acceleration:t,activator:r=po.Pointer,canScroll:n,draggingRect:i,enabled:a,interval:l=5,order:s=Vl.TreeOrder,pointerCoordinates:o,scrollableAncestors:c,scrollableAncestorRects:p,delta:u,threshold:f}=e;const _=mT({delta:u,disabled:!a}),[y,v]=xL(),h=k.useRef({x:0,y:0}),m=k.useRef({x:0,y:0}),d=k.useMemo(()=>{switch(r){case po.Pointer:return o?{top:o.y,bottom:o.y,left:o.x,right:o.x}:null;case po.DraggableRect:return i}},[r,i,o]),g=k.useRef(null),w=k.useCallback(()=>{const x=g.current;if(!x)return;const C=h.current.x*m.current.x,S=h.current.y*m.current.y;x.scrollBy(C,S)},[]),b=k.useMemo(()=>s===Vl.TreeOrder?[...c].reverse():c,[s,c]);k.useEffect(()=>{if(!a||!c.length||!d){v();return}for(const x of b){if((n==null?void 0:n(x))===!1)continue;const C=c.indexOf(x),S=p[C];if(!S)continue;const{direction:E,speed:L}=eT(x,S,d,t,f);for(const A of["x","y"])_[A][E[A]]||(L[A]=0,E[A]=0);if(L.x>0||L.y>0){v(),g.current=x,y(w,l),h.current=L,m.current=E;return}}h.current={x:0,y:0},m.current={x:0,y:0},v()},[t,w,n,v,a,l,JSON.stringify(d),JSON.stringify(_),y,c,b,p,JSON.stringify(f)])}const pT={x:{[Tt.Backward]:!1,[Tt.Forward]:!1},y:{[Tt.Backward]:!1,[Tt.Forward]:!1}};function mT(e){let{delta:t,disabled:r}=e;const n=Jh(t);return ia(i=>{if(r||!n||!i)return pT;const a={x:Math.sign(t.x-n.x),y:Math.sign(t.y-n.y)};return{x:{[Tt.Backward]:i.x[Tt.Backward]||a.x===-1,[Tt.Forward]:i.x[Tt.Forward]||a.x===1},y:{[Tt.Backward]:i.y[Tt.Backward]||a.y===-1,[Tt.Forward]:i.y[Tt.Forward]||a.y===1}}},[r,t,n])}function gT(e,t){const r=t!=null?e.get(t):void 0,n=r?r.node.current:null;return ia(i=>{var a;return t==null?null:(a=n??i)!=null?a:null},[n,t])}function vT(e,t){return k.useMemo(()=>e.reduce((r,n)=>{const{sensor:i}=n,a=i.activators.map(l=>({eventName:l.eventName,handler:t(l.handler,n)}));return[...r,...a]},[]),[e,t])}var zo;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(zo||(zo={}));var td;(function(e){e.Optimized="optimized"})(td||(td={}));const sv=new Map;function _T(e,t){let{dragging:r,dependencies:n,config:i}=t;const[a,l]=k.useState(null),{frequency:s,measure:o,strategy:c}=i,p=k.useRef(e),u=h(),f=$o(u),_=k.useCallback(function(m){m===void 0&&(m=[]),!f.current&&l(d=>d===null?m:d.concat(m.filter(g=>!d.includes(g))))},[f]),y=k.useRef(null),v=ia(m=>{if(u&&!r)return sv;if(!m||m===sv||p.current!==e||a!=null){const d=new Map;for(let g of e){if(!g)continue;if(a&&a.length>0&&!a.includes(g.id)&&g.rect.current){d.set(g.id,g.rect.current);continue}const w=g.node.current,b=w?new Zf(o(w),w):null;g.rect.current=b,b&&d.set(g.id,b)}return d}return m},[e,a,r,u,o]);return k.useEffect(()=>{p.current=e},[e]),k.useEffect(()=>{u||_()},[r,u]),k.useEffect(()=>{a&&a.length>0&&l(null)},[JSON.stringify(a)]),k.useEffect(()=>{u||typeof s!="number"||y.current!==null||(y.current=setTimeout(()=>{_(),y.current=null},s))},[s,u,_,...n]),{droppableRects:v,measureDroppableContainers:_,measuringScheduled:a!=null};function h(){switch(c){case zo.Always:return!1;case zo.BeforeDragging:return r;default:return!r}}}function Z1(e,t){return ia(r=>e?r||(typeof t=="function"?t(e):e):null,[t,e])}function yT(e,t){return Z1(e,t)}function wT(e){let{callback:t,disabled:r}=e;const n=Yf(t),i=k.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:a}=window;return new a(n)},[n,r]);return k.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function Sc(e){let{callback:t,disabled:r}=e;const n=Yf(t),i=k.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:a}=window;return new a(n)},[r]);return k.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function ST(e){return new Zf(Ti(e),e)}function iv(e,t,r){t===void 0&&(t=ST);const[n,i]=k.useState(null);function a(){i(o=>{if(!e)return null;if(e.isConnected===!1){var c;return(c=o??r)!=null?c:null}const p=t(e);return JSON.stringify(o)===JSON.stringify(p)?o:p})}const l=wT({callback(o){if(e)for(const c of o){const{type:p,target:u}=c;if(p==="childList"&&u instanceof HTMLElement&&u.contains(e)){a();break}}}}),s=Sc({callback:a});return Gr(()=>{a(),e?(s==null||s.observe(e),l==null||l.observe(document.body,{childList:!0,subtree:!0})):(s==null||s.disconnect(),l==null||l.disconnect())},[e]),n}function xT(e){const t=Z1(e);return W1(e,t)}const ov=[];function bT(e){const t=k.useRef(e),r=ia(n=>e?n&&n!==ov&&e&&t.current&&e.parentNode===t.current.parentNode?n:Qf(e):ov,[e]);return k.useEffect(()=>{t.current=e},[e]),r}function CT(e){const[t,r]=k.useState(null),n=k.useRef(e),i=k.useCallback(a=>{const l=gu(a.target);l&&r(s=>s?(s.set(l,Zh(l)),new Map(s)):null)},[]);return k.useEffect(()=>{const a=n.current;if(e!==a){l(a);const s=e.map(o=>{const c=gu(o);return c?(c.addEventListener("scroll",i,{passive:!0}),[c,Zh(c)]):null}).filter(o=>o!=null);r(s.length?new Map(s):null),n.current=e}return()=>{l(e),l(a)};function l(s){s.forEach(o=>{const c=gu(o);c==null||c.removeEventListener("scroll",i)})}},[i,e]),k.useMemo(()=>e.length?t?Array.from(t.values()).reduce((a,l)=>ai(a,l),jr):Y1(e):jr,[e,t])}function av(e,t){t===void 0&&(t=[]);const r=k.useRef(null);return k.useEffect(()=>{r.current=null},t),k.useEffect(()=>{const n=e!==jr;n&&!r.current&&(r.current=e),!n&&r.current&&(r.current=null)},[e]),r.current?Ul(e,r.current):jr}function ET(e){k.useEffect(()=>{if(!wc)return;const t=e.map(r=>{let{sensor:n}=r;return n.setup==null?void 0:n.setup()});return()=>{for(const r of t)r==null||r()}},e.map(t=>{let{sensor:r}=t;return r}))}function kT(e,t){return k.useMemo(()=>e.reduce((r,n)=>{let{eventName:i,handler:a}=n;return r[i]=l=>{a(l,t)},r},{}),[e,t])}function ew(e){return k.useMemo(()=>e?YL(e):null,[e])}const lv=[];function LT(e,t){t===void 0&&(t=Ti);const[r]=e,n=ew(r?lr(r):null),[i,a]=k.useState(lv);function l(){a(()=>e.length?e.map(o=>q1(o)?n:new Zf(t(o),o)):lv)}const s=Sc({callback:l});return Gr(()=>{s==null||s.disconnect(),l(),e.forEach(o=>s==null?void 0:s.observe(o))},[e]),i}function TT(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return sa(t)?t:e}function RT(e){let{measure:t}=e;const[r,n]=k.useState(null),i=k.useCallback(c=>{for(const{target:p}of c)if(sa(p)){n(u=>{const f=t(p);return u?{...u,width:f.width,height:f.height}:f});break}},[t]),a=Sc({callback:i}),l=k.useCallback(c=>{const p=TT(c);a==null||a.disconnect(),p&&(a==null||a.observe(p)),n(p?t(p):null)},[t,a]),[s,o]=zl(l);return k.useMemo(()=>({nodeRef:s,rect:r,setRef:o}),[r,s,o])}const DT=[{sensor:tp,options:{}},{sensor:Q1,options:{}}],MT={current:{}},il={draggable:{measure:ev},droppable:{measure:ev,strategy:zo.WhileDragging,frequency:td.Optimized},dragOverlay:{measure:Ti}};class mo extends Map{get(t){var r;return t!=null&&(r=super.get(t))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:r}=t;return!r})}getNodeFor(t){var r,n;return(r=(n=this.get(t))==null?void 0:n.node.current)!=null?r:void 0}}const AT={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new mo,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Wl},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:il,measureDroppableContainers:Wl,windowRect:null,measuringScheduled:!1},PT={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Wl,draggableNodes:new Map,over:null,measureDroppableContainers:Wl},xc=k.createContext(PT),tw=k.createContext(AT);function IT(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new mo}}}function BT(e,t){switch(t.type){case xt.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case xt.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case xt.DragEnd:case xt.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case xt.RegisterDroppable:{const{element:r}=t,{id:n}=r,i=new mo(e.droppable.containers);return i.set(n,r),{...e,droppable:{...e.droppable,containers:i}}}case xt.SetDroppableDisabled:{const{id:r,key:n,disabled:i}=t,a=e.droppable.containers.get(r);if(!a||n!==a.key)return e;const l=new mo(e.droppable.containers);return l.set(r,{...a,disabled:i}),{...e,droppable:{...e.droppable,containers:l}}}case xt.UnregisterDroppable:{const{id:r,key:n}=t,i=e.droppable.containers.get(r);if(!i||n!==i.key)return e;const a=new mo(e.droppable.containers);return a.delete(r),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function OT(e){let{disabled:t}=e;const{active:r,activatorEvent:n,draggableNodes:i}=k.useContext(xc),a=Jh(n),l=Jh(r==null?void 0:r.id);return k.useEffect(()=>{if(!t&&!n&&a&&l!=null){if(!Jf(a)||document.activeElement===a.target)return;const s=i.get(l);if(!s)return;const{activatorNode:o,node:c}=s;if(!o.current&&!c.current)return;requestAnimationFrame(()=>{for(const p of[o.current,c.current]){if(!p)continue;const u=EL(p);if(u){u.focus();break}}})}},[n,t,i,l,a]),null}function NT(e,t){let{transform:r,...n}=t;return e!=null&&e.length?e.reduce((i,a)=>a({transform:i,...n}),r):r}function jT(e){return k.useMemo(()=>({draggable:{...il.draggable,...e==null?void 0:e.draggable},droppable:{...il.droppable,...e==null?void 0:e.droppable},dragOverlay:{...il.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function FT(e){let{activeNode:t,measure:r,initialRect:n,config:i=!0}=e;const a=k.useRef(!1),{x:l,y:s}=typeof i=="boolean"?{x:i,y:i}:i;Gr(()=>{if(!l&&!s||!t){a.current=!1;return}if(a.current||!n)return;const c=t==null?void 0:t.node.current;if(!c||c.isConnected===!1)return;const p=r(c),u=W1(p,n);if(l||(u.x=0),s||(u.y=0),a.current=!0,Math.abs(u.x)>0||Math.abs(u.y)>0){const f=V1(c);f&&f.scrollBy({top:u.y,left:u.x})}},[t,l,s,n,r])}const rw=k.createContext({...jr,scaleX:1,scaleY:1});var Rn;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Rn||(Rn={}));const $T=k.memo(function(t){var r,n,i,a;let{id:l,accessibility:s,autoScroll:o=!0,children:c,sensors:p=DT,collisionDetection:u=UL,measuring:f,modifiers:_,...y}=t;const v=k.useReducer(BT,void 0,IT),[h,m]=v,[d,g]=ML(),[w,b]=k.useState(Rn.Uninitialized),x=w===Rn.Initialized,{draggable:{active:C,nodes:S,translate:E},droppable:{containers:L}}=h,A=C!=null?S.get(C):null,M=k.useRef({initial:null,translated:null}),D=k.useMemo(()=>{var fe;return C!=null?{id:C,data:(fe=A==null?void 0:A.data)!=null?fe:MT,rect:M}:null},[C,A]),B=k.useRef(null),[H,F]=k.useState(null),[$,I]=k.useState(null),R=$o(y,Object.values(y)),P=oa("DndDescribedBy",l),N=k.useMemo(()=>L.getEnabled(),[L]),j=jT(f),{droppableRects:U,measureDroppableContainers:V,measuringScheduled:ee}=_T(N,{dragging:x,dependencies:[E.x,E.y],config:j.droppable}),Q=gT(S,C),z=k.useMemo(()=>$?Qh($):null,[$]),O=de(),K=yT(Q,j.draggable.measure);FT({activeNode:C!=null?S.get(C):null,config:O.layoutShiftCompensation,initialRect:K,measure:j.draggable.measure});const W=iv(Q,j.draggable.measure,K),te=iv(Q?Q.parentElement:null),J=k.useRef({activatorEvent:null,active:null,activeNode:Q,collisionRect:null,collisions:null,droppableRects:U,draggableNodes:S,draggingNode:null,draggingNodeRect:null,droppableContainers:L,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),_e=L.getNodeFor((r=J.current.over)==null?void 0:r.id),ue=RT({measure:j.dragOverlay.measure}),se=(n=ue.nodeRef.current)!=null?n:Q,re=x?(i=ue.rect)!=null?i:W:null,ae=!!(ue.nodeRef.current&&ue.rect),ye=xT(ae?null:W),ve=ew(se?lr(se):null),ne=bT(x?_e??Q:null),ie=LT(ne),he=NT(_,{transform:{x:E.x-ye.x,y:E.y-ye.y,scaleX:1,scaleY:1},activatorEvent:$,active:D,activeNodeRect:W,containerNodeRect:te,draggingNodeRect:re,over:J.current.over,overlayNodeRect:ue.rect,scrollableAncestors:ne,scrollableAncestorRects:ie,windowRect:ve}),oe=z?ai(z,E):null,me=CT(ne),xe=av(me),ke=av(me,[W]),Ne=ai(he,xe),Ke=re?KL(re,he):null,Ae=D&&Ke?u({active:D,collisionRect:Ke,droppableRects:U,droppableContainers:N,pointerCoordinates:oe}):null,Pe=$L(Ae,"id"),[G,Y]=k.useState(null),Oe=ae?he:ai(he,ke),$e=WL(Oe,(a=G==null?void 0:G.rect)!=null?a:null,W),X=k.useRef(null),le=k.useCallback((fe,Ee)=>{let{sensor:Re,options:je}=Ee;if(B.current==null)return;const Me=S.get(B.current);if(!Me)return;const Ie=fe.nativeEvent,Ve=new Re({active:B.current,activeNode:Me,event:Ie,options:je,context:J,onAbort(He){if(!S.get(He))return;const{onDragAbort:De}=R.current,ze={id:He};De==null||De(ze),d({type:"onDragAbort",event:ze})},onPending(He,Te,De,ze){if(!S.get(He))return;const{onDragPending:Ht}=R.current,_t={id:He,constraint:Te,initialCoordinates:De,offset:ze};Ht==null||Ht(_t),d({type:"onDragPending",event:_t})},onStart(He){const Te=B.current;if(Te==null)return;const De=S.get(Te);if(!De)return;const{onDragStart:ze}=R.current,Xe={activatorEvent:Ie,active:{id:Te,data:De.data,rect:M}};hn.unstable_batchedUpdates(()=>{ze==null||ze(Xe),b(Rn.Initializing),m({type:xt.DragStart,initialCoordinates:He,active:Te}),d({type:"onDragStart",event:Xe}),F(X.current),I(Ie)})},onMove(He){m({type:xt.DragMove,coordinates:He})},onEnd:ot(xt.DragEnd),onCancel:ot(xt.DragCancel)});X.current=Ve;function ot(He){return async function(){const{active:De,collisions:ze,over:Xe,scrollAdjustedTranslate:Ht}=J.current;let _t=null;if(De&&Ht){const{cancelDrop:zt}=R.current;_t={activatorEvent:Ie,active:De,collisions:ze,delta:Ht,over:Xe},He===xt.DragEnd&&typeof zt=="function"&&await Promise.resolve(zt(_t))&&(He=xt.DragCancel)}B.current=null,hn.unstable_batchedUpdates(()=>{m({type:He}),b(Rn.Uninitialized),Y(null),F(null),I(null),X.current=null;const zt=He===xt.DragEnd?"onDragEnd":"onDragCancel";if(_t){const It=R.current[zt];It==null||It(_t),d({type:zt,event:_t})}})}}},[S]),ge=k.useCallback((fe,Ee)=>(Re,je)=>{const Me=Re.nativeEvent,Ie=S.get(je);if(B.current!==null||!Ie||Me.dndKit||Me.defaultPrevented)return;const Ve={active:Ie};fe(Re,Ee.options,Ve)===!0&&(Me.dndKit={capturedBy:Ee.sensor},B.current=je,le(Re,Ee))},[S,le]),We=vT(p,ge);ET(p),Gr(()=>{W&&w===Rn.Initializing&&b(Rn.Initialized)},[W,w]),k.useEffect(()=>{const{onDragMove:fe}=R.current,{active:Ee,activatorEvent:Re,collisions:je,over:Me}=J.current;if(!Ee||!Re)return;const Ie={active:Ee,activatorEvent:Re,collisions:je,delta:{x:Ne.x,y:Ne.y},over:Me};hn.unstable_batchedUpdates(()=>{fe==null||fe(Ie),d({type:"onDragMove",event:Ie})})},[Ne.x,Ne.y]),k.useEffect(()=>{const{active:fe,activatorEvent:Ee,collisions:Re,droppableContainers:je,scrollAdjustedTranslate:Me}=J.current;if(!fe||B.current==null||!Ee||!Me)return;const{onDragOver:Ie}=R.current,Ve=je.get(Pe),ot=Ve&&Ve.rect.current?{id:Ve.id,rect:Ve.rect.current,data:Ve.data,disabled:Ve.disabled}:null,He={active:fe,activatorEvent:Ee,collisions:Re,delta:{x:Me.x,y:Me.y},over:ot};hn.unstable_batchedUpdates(()=>{Y(ot),Ie==null||Ie(He),d({type:"onDragOver",event:He})})},[Pe]),Gr(()=>{J.current={activatorEvent:$,active:D,activeNode:Q,collisionRect:Ke,collisions:Ae,droppableRects:U,draggableNodes:S,draggingNode:se,draggingNodeRect:re,droppableContainers:L,over:G,scrollableAncestors:ne,scrollAdjustedTranslate:Ne},M.current={initial:re,translated:Ke}},[D,Q,Ae,Ke,S,se,re,U,L,G,ne,Ne]),fT({...O,delta:E,draggingRect:Ke,pointerCoordinates:oe,scrollableAncestors:ne,scrollableAncestorRects:ie});const Z=k.useMemo(()=>({active:D,activeNode:Q,activeNodeRect:W,activatorEvent:$,collisions:Ae,containerNodeRect:te,dragOverlay:ue,draggableNodes:S,droppableContainers:L,droppableRects:U,over:G,measureDroppableContainers:V,scrollableAncestors:ne,scrollableAncestorRects:ie,measuringConfiguration:j,measuringScheduled:ee,windowRect:ve}),[D,Q,W,$,Ae,te,ue,S,L,U,G,V,ne,ie,j,ee,ve]),Le=k.useMemo(()=>({activatorEvent:$,activators:We,active:D,activeNodeRect:W,ariaDescribedById:{draggable:P},dispatch:m,draggableNodes:S,over:G,measureDroppableContainers:V}),[$,We,D,W,m,P,S,G,V]);return gt.createElement(U1.Provider,{value:g},gt.createElement(xc.Provider,{value:Le},gt.createElement(tw.Provider,{value:Z},gt.createElement(rw.Provider,{value:$e},c)),gt.createElement(OT,{disabled:(s==null?void 0:s.restoreFocus)===!1})),gt.createElement(IL,{...s,hiddenTextDescribedById:P}));function de(){const fe=(H==null?void 0:H.autoScrollEnabled)===!1,Ee=typeof o=="object"?o.enabled===!1:o===!1,Re=x&&!fe&&!Ee;return typeof o=="object"?{...o,enabled:Re}:{enabled:Re}}}),HT=k.createContext(null),cv="button",zT="Draggable";function UT(e){let{id:t,data:r,disabled:n=!1,attributes:i}=e;const a=oa(zT),{activators:l,activatorEvent:s,active:o,activeNodeRect:c,ariaDescribedById:p,draggableNodes:u,over:f}=k.useContext(xc),{role:_=cv,roleDescription:y="draggable",tabIndex:v=0}=i??{},h=(o==null?void 0:o.id)===t,m=k.useContext(h?rw:HT),[d,g]=zl(),[w,b]=zl(),x=kT(l,t),C=$o(r);Gr(()=>(u.set(t,{id:t,key:a,node:d,activatorNode:w,data:C}),()=>{const E=u.get(t);E&&E.key===a&&u.delete(t)}),[u,t]);const S=k.useMemo(()=>({role:_,tabIndex:v,"aria-disabled":n,"aria-pressed":h&&_===cv?!0:void 0,"aria-roledescription":y,"aria-describedby":p.draggable}),[n,_,v,h,y,p.draggable]);return{active:o,activatorEvent:s,activeNodeRect:c,attributes:S,isDragging:h,listeners:n?void 0:x,node:d,over:f,setNodeRef:g,setActivatorNodeRef:b,transform:m}}function WT(){return k.useContext(tw)}const VT="Droppable",KT={timeout:25};function GT(e){let{data:t,disabled:r=!1,id:n,resizeObserverConfig:i}=e;const a=oa(VT),{active:l,dispatch:s,over:o,measureDroppableContainers:c}=k.useContext(xc),p=k.useRef({disabled:r}),u=k.useRef(!1),f=k.useRef(null),_=k.useRef(null),{disabled:y,updateMeasurementsFor:v,timeout:h}={...KT,...i},m=$o(v??n),d=k.useCallback(()=>{if(!u.current){u.current=!0;return}_.current!=null&&clearTimeout(_.current),_.current=setTimeout(()=>{c(Array.isArray(m.current)?m.current:[m.current]),_.current=null},h)},[h]),g=Sc({callback:d,disabled:y||!l}),w=k.useCallback((S,E)=>{g&&(E&&(g.unobserve(E),u.current=!1),S&&g.observe(S))},[g]),[b,x]=zl(w),C=$o(t);return k.useEffect(()=>{!g||!b.current||(g.disconnect(),u.current=!1,g.observe(b.current))},[b,g]),k.useEffect(()=>(s({type:xt.RegisterDroppable,element:{id:n,key:a,disabled:r,node:b,rect:f,data:C}}),()=>s({type:xt.UnregisterDroppable,key:a,id:n})),[n]),k.useEffect(()=>{r!==p.current.disabled&&(s({type:xt.SetDroppableDisabled,id:n,key:a,disabled:r}),p.current.disabled=r)},[n,a,r,s]),{active:l,rect:f,isOver:(o==null?void 0:o.id)===n,node:b,over:o,setNodeRef:x}}function nw(e,t,r){const n=e.slice();return n.splice(r<0?n.length+r:r,0,n.splice(t,1)[0]),n}function qT(e,t){return e.reduce((r,n,i)=>{const a=t.get(n);return a&&(r[i]=a),r},Array(e.length))}function Ma(e){return e!==null&&e>=0}function XT(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function YT(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const sw=e=>{let{rects:t,activeIndex:r,overIndex:n,index:i}=e;const a=nw(t,n,r),l=t[i],s=a[i];return!s||!l?null:{x:s.left-l.left,y:s.top-l.top,scaleX:s.width/l.width,scaleY:s.height/l.height}},Aa={scaleX:1,scaleY:1},JT=e=>{var t;let{activeIndex:r,activeNodeRect:n,index:i,rects:a,overIndex:l}=e;const s=(t=a[r])!=null?t:n;if(!s)return null;if(i===r){const c=a[l];return c?{x:0,y:r<l?c.top+c.height-(s.top+s.height):c.top-s.top,...Aa}:null}const o=QT(a,i,r);return i>r&&i<=l?{x:0,y:-s.height-o,...Aa}:i<r&&i>=l?{x:0,y:s.height+o,...Aa}:{x:0,y:0,...Aa}};function QT(e,t,r){const n=e[t],i=e[t-1],a=e[t+1];return n?r<t?i?n.top-(i.top+i.height):a?a.top-(n.top+n.height):0:a?a.top-(n.top+n.height):i?n.top-(i.top+i.height):0:0}const iw="Sortable",ow=gt.createContext({activeIndex:-1,containerId:iw,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:sw,disabled:{draggable:!1,droppable:!1}});function ZT(e){let{children:t,id:r,items:n,strategy:i=sw,disabled:a=!1}=e;const{active:l,dragOverlay:s,droppableRects:o,over:c,measureDroppableContainers:p}=WT(),u=oa(iw,r),f=s.rect!==null,_=k.useMemo(()=>n.map(x=>typeof x=="object"&&"id"in x?x.id:x),[n]),y=l!=null,v=l?_.indexOf(l.id):-1,h=c?_.indexOf(c.id):-1,m=k.useRef(_),d=!XT(_,m.current),g=h!==-1&&v===-1||d,w=YT(a);Gr(()=>{d&&y&&p(_)},[d,_,y,p]),k.useEffect(()=>{m.current=_},[_]);const b=k.useMemo(()=>({activeIndex:v,containerId:u,disabled:w,disableTransforms:g,items:_,overIndex:h,useDragOverlay:f,sortedRects:qT(_,o),strategy:i}),[v,u,w.draggable,w.droppable,g,_,h,o,f,i]);return gt.createElement(ow.Provider,{value:b},t)}const eR=e=>{let{id:t,items:r,activeIndex:n,overIndex:i}=e;return nw(r,n,i).indexOf(t)},tR=e=>{let{containerId:t,isSorting:r,wasDragging:n,index:i,items:a,newIndex:l,previousItems:s,previousContainerId:o,transition:c}=e;return!c||!n||s!==a&&i===l?!1:r?!0:l!==i&&t===o},rR={duration:200,easing:"ease"},aw="transform",nR=Ho.Transition.toString({property:aw,duration:0,easing:"linear"}),sR={roleDescription:"sortable"};function iR(e){let{disabled:t,index:r,node:n,rect:i}=e;const[a,l]=k.useState(null),s=k.useRef(r);return Gr(()=>{if(!t&&r!==s.current&&n.current){const o=i.current;if(o){const c=Ti(n.current,{ignoreTransform:!0}),p={x:o.left-c.left,y:o.top-c.top,scaleX:o.width/c.width,scaleY:o.height/c.height};(p.x||p.y)&&l(p)}}r!==s.current&&(s.current=r)},[t,r,n,i]),k.useEffect(()=>{a&&l(null)},[a]),a}function oR(e){let{animateLayoutChanges:t=tR,attributes:r,disabled:n,data:i,getNewIndex:a=eR,id:l,strategy:s,resizeObserverConfig:o,transition:c=rR}=e;const{items:p,containerId:u,activeIndex:f,disabled:_,disableTransforms:y,sortedRects:v,overIndex:h,useDragOverlay:m,strategy:d}=k.useContext(ow),g=aR(n,_),w=p.indexOf(l),b=k.useMemo(()=>({sortable:{containerId:u,index:w,items:p},...i}),[u,i,w,p]),x=k.useMemo(()=>p.slice(p.indexOf(l)),[p,l]),{rect:C,node:S,isOver:E,setNodeRef:L}=GT({id:l,data:b,disabled:g.droppable,resizeObserverConfig:{updateMeasurementsFor:x,...o}}),{active:A,activatorEvent:M,activeNodeRect:D,attributes:B,setNodeRef:H,listeners:F,isDragging:$,over:I,setActivatorNodeRef:R,transform:P}=UT({id:l,data:b,attributes:{...sR,...r},disabled:g.draggable}),N=SL(L,H),j=!!A,U=j&&!y&&Ma(f)&&Ma(h),V=!m&&$,ee=V&&U?P:null,z=U?ee??(s??d)({rects:v,activeNodeRect:D,activeIndex:f,overIndex:h,index:w}):null,O=Ma(f)&&Ma(h)?a({id:l,items:p,activeIndex:f,overIndex:h}):w,K=A==null?void 0:A.id,W=k.useRef({activeId:K,items:p,newIndex:O,containerId:u}),te=p!==W.current.items,J=t({active:A,containerId:u,isDragging:$,isSorting:j,id:l,index:w,items:p,newIndex:W.current.newIndex,previousItems:W.current.items,previousContainerId:W.current.containerId,transition:c,wasDragging:W.current.activeId!=null}),_e=iR({disabled:!J,index:w,node:S,rect:C});return k.useEffect(()=>{j&&W.current.newIndex!==O&&(W.current.newIndex=O),u!==W.current.containerId&&(W.current.containerId=u),p!==W.current.items&&(W.current.items=p)},[j,O,u,p]),k.useEffect(()=>{if(K===W.current.activeId)return;if(K!=null&&W.current.activeId==null){W.current.activeId=K;return}const se=setTimeout(()=>{W.current.activeId=K},50);return()=>clearTimeout(se)},[K]),{active:A,activeIndex:f,attributes:B,data:b,rect:C,index:w,newIndex:O,items:p,isOver:E,isSorting:j,isDragging:$,listeners:F,node:S,overIndex:h,over:I,setNodeRef:N,setActivatorNodeRef:R,setDroppableNodeRef:L,setDraggableNodeRef:H,transform:_e??z,transition:ue()};function ue(){if(_e||te&&W.current.newIndex===w)return nR;if(!(V&&!Jf(M)||!c)&&(j||J))return Ho.Transition.toString({...c,property:aw})}}function aR(e,t){var r,n;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(r=e==null?void 0:e.draggable)!=null?r:t.draggable,droppable:(n=e==null?void 0:e.droppable)!=null?n:t.droppable}}Ye.Down,Ye.Right,Ye.Up,Ye.Left;const Pa={permission:0,waiting:1,working:2,unknown:3};function go(e){var r;const t=(r=e.agentSessionId)==null?void 0:r.trim();return t&&t.length>0?t:e.id}const lR={mode:"created",direction:"desc"};function rp(e,t=lR){const{mode:r,direction:n,manualOrder:i}=t;if(r==="manual"&&i&&i.length>0){const a=new Map(i.map((l,s)=>[l,s]));return e.toSorted((l,s)=>{const o=go(l),c=go(s),p=a.get(o)??a.get(l.id)??1/0,u=a.get(c)??a.get(s.id)??1/0;return p===1/0&&u===1/0?Date.parse(s.createdAt)-Date.parse(l.createdAt):p-u})}return e.toSorted((a,l)=>{if(r==="status"){const c=Pa[a.status]??Pa.unknown,p=Pa[l.status]??Pa.unknown;return c!==p?c-p:Date.parse(l.lastActivity)-Date.parse(a.lastActivity)}const s=Date.parse(a.createdAt),o=Date.parse(l.createdAt);return n==="desc"?o-s:s-o})}function cR(e,t){var n,i;const r=new Map;for(const a of e){const l=(n=a.projectPath)==null?void 0:n.trim();if(l){const s=Date.parse(a.lastActivity)||0,o=r.get(l)||0;s>o&&r.set(l,s)}}for(const a of t){const l=(i=a.projectPath)==null?void 0:i.trim();if(l){const s=Date.parse(a.lastActivityAt)||0,o=r.get(l)||0;s>o&&r.set(l,s)}}return Array.from(r.keys()).toSorted((a,l)=>{const s=r.get(a)||0;return(r.get(l)||0)-s})}function uR(e,t){var n,i;const r=new Map;for(const a of e){const l=(n=a.host)==null?void 0:n.trim();if(l){const s=Date.parse(a.lastActivity)||0,o=r.get(l)||0;s>o&&r.set(l,s)}}for(const a of t){const l=(i=a.host)==null?void 0:i.trim();if(l){const s=Date.parse(a.lastActivityAt)||0,o=r.get(l)||0;s>o&&r.set(l,s)}}return Array.from(r.keys()).toSorted((a,l)=>{const s=r.get(a)||0;return(r.get(l)||0)-s})}function np(e){const t=Date.parse(e);if(Number.isNaN(t))return"";const r=Date.now()-t,n=Math.floor(r/6e4);if(n<1)return"now";if(n<60)return`${n}m`;const i=Math.floor(n/60);return i<24?`${i}h`:`${Math.floor(i/24)}d`}function _s(e){const t=e.trim();if(!t)return null;const r=t.replace(/[\\/]+$/,"");if(!r)return null;const n=r.split(/[\\/]/);return n[n.length-1]||null}function hR(e){const t=e.map(s=>{const o=s.trim(),c=o.replace(/[\\/]+$/,""),p=c.split(/[\\/]/).filter(Boolean);return{path:s,parts:p,fallback:c||o||s}}),r=new Map;for(const s of t)r.set(s.path,1);let n=!0;for(;n;){n=!1;const s=new Map;for(const o of t){if(o.parts.length===0)continue;const c=r.get(o.path)??1,p=o.parts.slice(-c).join("/");s.set(p,(s.get(p)??0)+1)}for(const o of t){if(o.parts.length===0)continue;const c=r.get(o.path)??1,p=o.parts.slice(-c).join("/");(s.get(p)??0)>1&&c<o.parts.length&&(r.set(o.path,c+1),n=!0)}}const i=new Map,a=new Map;for(const s of t){let o=s.fallback;if(s.parts.length>0){const c=r.get(s.path)??1;o=s.parts.slice(-c).join("/")}i.set(s.path,o),a.set(o,(a.get(o)??0)+1)}const l=new Map;for(const s of t){let o=i.get(s.path)??s.fallback;(a.get(o)??0)>1&&(o=s.fallback),l.set(s.path,o)}return l}function lw(e){const t=e.trim();return!t||t.length<=6?t:`${t.slice(0,3)}…${t.slice(-3)}`}const Ge=uf()(hf((e,t)=>({sessions:[],agentSessions:{active:[],inactive:[]},hostStatuses:[],exitingSessions:new Map,selectedSessionId:null,hasLoaded:!1,connectionStatus:"connecting",connectionError:null,remoteAllowControl:!1,remoteAllowAttach:!1,hostLabel:null,setSessions:r=>{var p;const n=t(),i=n.selectedSessionId,a=n.sessions,l=n.exitingSessions,s=new Set(r.map(u=>u.id)),o=a.filter(u=>!s.has(u.id)&&!l.has(u.id));let c=i;if(i!==null&&!r.some(u=>u.id===i)){const{sessionSortMode:u,sessionSortDirection:f}=pe.getState();c=((p=rp(r,{mode:u,direction:f})[0])==null?void 0:p.id)??null}if(o.length>0){const u=new Map(l);for(const f of o)u.set(f.id,f);e({sessions:r,hasLoaded:!0,selectedSessionId:c,exitingSessions:u})}else e({sessions:r,hasLoaded:!0,selectedSessionId:c})},setAgentSessions:(r,n)=>e({agentSessions:{active:r,inactive:n}}),setHostStatuses:r=>e({hostStatuses:r}),updateSession:r=>e(n=>({sessions:n.sessions.map(i=>i.id===r.id?r:i)})),setSelectedSessionId:r=>e({selectedSessionId:r}),setConnectionStatus:r=>e({connectionStatus:r}),setConnectionError:r=>e({connectionError:r}),setRemoteAllowControl:r=>e({remoteAllowControl:r}),setRemoteAllowAttach:r=>e({remoteAllowAttach:r}),setHostLabel:r=>e({hostLabel:r}),markSessionExiting:r=>{const n=t().sessions.find(i=>i.id===r);if(n){const i=new Map(t().exitingSessions);i.set(r,n),e({exitingSessions:i})}},clearExitingSession:r=>{const n=new Map(t().exitingSessions);n.delete(r),e({exitingSessions:n})}}),{name:"agentboard-session",storage:mc(()=>df),partialize:e=>({selectedSessionId:e.selectedSessionId})}));function uv(e,t,r=!1){const[n,i]=k.useState(!1),a=k.useRef(e),l=k.useRef(!1);return k.useEffect(()=>{const o=a.current;if(r?e>o:e!==o){l.current=!0;const p=setTimeout(()=>{l.current&&(i(!0),l.current=!1)},t);return a.current=e,()=>clearTimeout(p)}a.current=e},[e,t,r]),[n,()=>i(!1)]}function dR(e,t,r,n){const i=k.useRef(new Map);k.useEffect(()=>{const a=new Set(e.map(l=>l.id));for(const l of t.keys())if(a.has(l)){const s=i.current.get(l);s&&(clearTimeout(s),i.current.delete(l)),r(l)}else if(!i.current.has(l)){const s=setTimeout(()=>{i.current.delete(l),r(l)},n+100);i.current.set(l,s)}},[e,t,r,n]),k.useEffect(()=>()=>{for(const a of i.current.values())clearTimeout(a);i.current.clear()},[])}function fR({className:e}){return T.jsx("svg",{viewBox:"0 0 92.2 92.2",fill:"currentColor",className:e,"aria-label":"Anthropic",children:T.jsx("path",{d:"M66.5,0H52.4l25.7,65h14.1L66.5,0z M25.7,0L0,65h14.4l5.3-13.6h26.9L51.8,65h14.4L40.5,0C40.5,0,25.7,0,25.7,0z M24.3,39.3l8.8-22.8l8.8,22.8H24.3z",transform:"translate(0, 13.6)"})})}function pR({className:e}){return T.jsx("svg",{viewBox:"-1 -1 26 26",fill:"currentColor",className:e,"aria-label":"OpenAI",children:T.jsx("path",{d:"M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z"})})}function mR({className:e}){return T.jsx("svg",{viewBox:"0 0 588.42 568.88",fill:"currentColor",className:e,"aria-label":"Pi",children:T.jsx("path",{d:"M 10.499686,177.03840 L 31.174931,178.56990 C 52.615925,154.32116 61.039171,82.595924 187.38789,96.634671 C 182.79339,403.95560 48.021426,436.37234 56.444675,499.41907 C 59.507674,535.15406 87.840417,557.10556 118.47041,558.38181 C 215.21014,555.06356 210.87089,424.63084 240.99038,95.868921 L 365.80760,95.868921 C 359.17110,211.75239 341.04836,327.63586 339.00636,441.22208 C 340.53786,516.77606 386.48285,557.10556 446.97708,557.61606 C 546.52456,560.93431 577.92030,444.79558 577.92030,395.27709 L 556.47931,395.27710 C 554.43731,436.11709 534.78306,465.47083 492.92207,467.25758 C 378.82535,468.78908 441.61683,266.63113 442.38258,97.400421 L 577.92030,98.166171 L 577.15455,11.636437 C 13.807491,8.9075799 85.312284,-2.1366151 10.499686,177.03840 z"})})}const gR=[["claude",fR],["codex",pR],["pi",mR]];function bc({agentType:e,command:t,className:r=""}){const n=(e||(t==null?void 0:t.split(" ")[0])||"").toLowerCase();for(const[i,a]of gR)if(n.startsWith(i))return T.jsx(a,{className:r});return T.jsx(BC,{className:r})}const vR=360;function _R(e){let t=0;for(let r=0;r<e.length;r++){const n=e.charCodeAt(r);t=(t<<5)-t+n,t=t&t}return Math.abs(t)}function cw(e){return{"--badge-hue":`${_R(e)%vR}`}}function uw({name:e,fullPath:t,className:r=""}){const n=cw(e);return T.jsx("span",{className:`project-badge inline-flex items-center rounded-full px-1.5 py-0.5 text-[10px] font-medium leading-none ${r}`,style:n,title:t,children:e})}const yR=k.memo(function({session:t,showSessionIdPrefix:r,showProjectName:n,showLastUserMessage:i,onResume:a,onPreview:l,onSetPinned:s}){const o=np(t.lastActivityAt),c=_s(t.projectPath),p=t.displayName||c||t.sessionId.slice(0,8),u=n&&!!c,f=i&&!!t.lastUserMessage,_=r?lw(t.sessionId):"",y=k.useRef(null),[v,h]=k.useState(null);k.useEffect(()=>{if(!v)return;const d=w=>{y.current&&!y.current.contains(w.target)&&h(null)},g=w=>{w.key==="Escape"&&h(null)};return document.addEventListener("mousedown",d),document.addEventListener("touchstart",d),document.addEventListener("keydown",g),()=>{document.removeEventListener("mousedown",d),document.removeEventListener("touchstart",d),document.removeEventListener("keydown",g)}},[v]);const m=d=>{d.preventDefault(),d.stopPropagation(),h({x:d.clientX,y:d.clientY})};return T.jsxs("div",{className:"group relative cursor-pointer px-3 py-2 hover:bg-hover",role:"button",tabIndex:0,title:"Click to preview",onClick:()=>l(t),onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),l(t))},onContextMenu:m,children:[T.jsx("button",{type:"button",className:"absolute right-3 top-1/2 -translate-y-1/2 text-xs text-muted opacity-0 hover:text-primary group-hover:opacity-100",title:"Resume directly",onClick:d=>{d.stopPropagation(),a(t.sessionId)},children:"▶"}),T.jsxs("div",{className:"flex flex-col gap-0.5 pl-2.5 group-hover:pr-4",children:[T.jsxs("div",{className:"flex items-center gap-2",children:[T.jsx(bc,{agentType:t.agentType,className:"h-3.5 w-3.5 shrink-0 text-muted"}),T.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium text-primary",children:p}),t.lastResumeError&&T.jsx(cC,{className:"h-3 w-3 shrink-0 text-amber-500","aria-label":"Resume failed",title:`Last resume failed: ${t.lastResumeError}`}),t.isPinned&&T.jsx(Il,{className:"h-3 w-3 shrink-0 text-muted","aria-label":"Pinned",title:"Pinned - will auto-resume on server restart"}),_&&T.jsx("span",{className:"shrink-0 text-[11px] font-mono text-muted",title:t.sessionId,children:_}),T.jsx("span",{className:"ml-1 w-8 shrink-0 text-right text-xs tabular-nums text-muted",children:o})]}),(u||f)&&T.jsxs("div",{className:"flex flex-wrap items-center gap-1 pl-[1.375rem]",children:[u&&T.jsx(uw,{name:c,fullPath:t.projectPath}),f&&T.jsxs("span",{className:"truncate text-xs italic text-muted",children:['"',t.lastUserMessage.length>200?t.lastUserMessage.slice(0,200)+"…":t.lastUserMessage,'"']})]})]}),v&&T.jsxs("div",{ref:y,className:"fixed z-50 min-w-[160px] rounded-md border border-border bg-elevated shadow-lg py-1",style:{left:v.x,top:v.y},role:"menu",children:[s&&T.jsxs("button",{onClick:d=>{d.stopPropagation(),h(null),s(t.sessionId,!t.isPinned)},className:"w-full px-3 py-2 text-left text-sm text-secondary hover:bg-hover hover:text-primary flex items-center gap-2",role:"menuitem",title:t.isPinned?"Remove from auto-resume list":"Auto-resume on server restart",children:[T.jsx(Il,{width:14,height:14}),t.isPinned?"Unpin":"Pin"]}),t.logFilePath&&T.jsxs("button",{onClick:d=>{d.stopPropagation(),navigator.clipboard.writeText(t.logFilePath).catch(()=>{}),h(null)},className:"w-full px-3 py-2 text-left text-sm text-secondary hover:bg-hover hover:text-primary flex items-center gap-2",role:"menuitem",title:t.logFilePath,children:[T.jsx(sy,{width:14,height:14}),"Copy Log Path"]})]})]})});function wR({name:e,className:t=""}){const r=cw(`host:${e}`);return T.jsx("span",{className:`inline-flex items-center rounded-full px-1.5 py-0.5 text-[10px] font-medium uppercase leading-none tracking-wide ${t}`,style:r,title:e,children:e})}function SR({hosts:e,selectedHosts:t,onSelect:r,statuses:n=[]}){const[i,a]=k.useState(!1),l=k.useId(),s=k.useRef(null),o=k.useMemo(()=>new Set(t),[t]),c=k.useMemo(()=>new Map(n.map(_=>[_.host,_])),[n]),p=k.useMemo(()=>t.length===0?"All Hosts":t.join(", "),[t]),u=k.useMemo(()=>t.length===0?"All Hosts":t.length===1?t[0]:`${t.length} hosts`,[t]);k.useEffect(()=>{if(!i||typeof document>"u"||!document.addEventListener||!document.removeEventListener)return;const _=v=>{var m;const h=v.target;h&&((m=s.current)!=null&&m.contains(h))||a(!1)},y=v=>{v.key==="Escape"&&a(!1)};return document.addEventListener("mousedown",_),document.addEventListener("touchstart",_,{passive:!0}),document.addEventListener("keydown",y),()=>{document.removeEventListener("mousedown",_),document.removeEventListener("touchstart",_),document.removeEventListener("keydown",y)}},[i]);const f=_=>{const y=new Set(o);y.has(_)?y.delete(_):y.add(_);const v=e.filter(h=>y.has(h));r(v)};return T.jsxs("div",{ref:s,className:"relative",children:[T.jsxs("button",{type:"button","aria-haspopup":"menu","aria-expanded":i,"aria-controls":l,"aria-label":"Filter by host",onClick:()=>a(_=>!_),className:"flex h-6 max-w-[9rem] items-center gap-1 rounded border border-border bg-base px-2 text-[11px] text-primary hover:bg-hover focus:border-accent focus:outline-none",title:p,children:[T.jsx("span",{className:"truncate",children:u}),T.jsx(ff,{className:"h-3 w-3 shrink-0 text-muted"})]}),i&&T.jsxs("div",{id:l,role:"menu",className:"absolute right-0 z-20 mt-1 w-48 rounded border border-border bg-surface p-2 text-xs shadow-lg",children:[T.jsxs("label",{role:"menuitemcheckbox","aria-checked":t.length===0,className:"flex cursor-pointer items-center gap-2 rounded px-2 py-1.5 text-primary hover:bg-hover",children:[T.jsx("input",{type:"checkbox",checked:t.length===0,onChange:()=>r([]),className:"h-3.5 w-3.5 accent-approval"}),T.jsx("span",{children:"All Hosts"})]}),T.jsx("div",{className:"my-2 h-px bg-border"}),e.length===0?T.jsx("div",{className:"px-2 py-1 text-muted",children:"No hosts"}):T.jsx("div",{className:"max-h-48 overflow-y-auto pr-1",children:e.map(_=>{const y=c.get(_),v=y?!y.ok:!1;return T.jsxs("label",{role:"menuitemcheckbox","aria-checked":o.has(_),className:"flex cursor-pointer items-center gap-2 rounded px-2 py-1.5 text-primary hover:bg-hover",title:y!=null&&y.error?`${_}: ${y.error}`:_,children:[T.jsx("input",{type:"checkbox",checked:o.has(_),onChange:()=>f(_),className:"h-3.5 w-3.5 accent-approval"}),T.jsx("span",{className:"truncate",children:_}),v&&T.jsx("span",{className:"ml-auto text-[10px] uppercase text-danger",children:"offline"})]},_)})})]})]})}function xR({projects:e,selectedProjects:t,onSelect:r,hasHiddenPermissions:n}){const[i,a]=k.useState(!1),l=k.useId(),s=k.useRef(null),o=k.useMemo(()=>hR(e),[e]),c=k.useMemo(()=>new Set(t),[t]),p=n&&t.length>0,u=k.useMemo(()=>t.length===0?"All Projects":t.map(y=>o.get(y)??_s(y)??y).join(", "),[o,t]),f=k.useMemo(()=>{if(t.length===0)return"All Projects";if(t.length===1){const y=t[0];return o.get(y)??_s(y)??y}return`${t.length} projects`},[o,t]);k.useEffect(()=>{if(!i||typeof document>"u"||!document.addEventListener||!document.removeEventListener)return;const y=h=>{var d;const m=h.target;m&&((d=s.current)!=null&&d.contains(m))||a(!1)},v=h=>{h.key==="Escape"&&a(!1)};return document.addEventListener("mousedown",y),document.addEventListener("touchstart",y,{passive:!0}),document.addEventListener("keydown",v),()=>{document.removeEventListener("mousedown",y),document.removeEventListener("touchstart",y),document.removeEventListener("keydown",v)}},[i]);const _=y=>{const v=new Set(c);v.has(y)?v.delete(y):v.add(y);const h=e.filter(m=>v.has(m));r(h)};return T.jsxs("div",{ref:s,className:"relative",children:[T.jsxs("button",{type:"button","aria-haspopup":"menu","aria-expanded":i,"aria-controls":l,"aria-label":"Filter by project",onClick:()=>a(y=>!y),className:"flex h-6 max-w-[11rem] items-center gap-1 rounded border border-border bg-base px-2 text-[11px] text-primary hover:bg-hover focus:border-accent focus:outline-none",title:u,children:[T.jsx("span",{className:"truncate",children:f}),T.jsx(ff,{className:"h-3 w-3 shrink-0 text-muted"})]}),i&&T.jsxs("div",{id:l,role:"menu",className:"absolute right-0 z-20 mt-1 w-60 rounded border border-border bg-surface p-2 text-xs shadow-lg",children:[T.jsxs("label",{className:"flex cursor-pointer items-center gap-2 rounded px-2 py-1.5 text-primary hover:bg-hover",children:[T.jsx("input",{type:"checkbox",checked:t.length===0,onChange:()=>r([]),className:"h-3.5 w-3.5 accent-approval"}),T.jsx("span",{children:"All Projects"})]}),T.jsx("div",{className:"my-2 h-px bg-border"}),e.length===0?T.jsx("div",{className:"px-2 py-1 text-muted",children:"No projects"}):T.jsx("div",{className:"max-h-48 overflow-y-auto pr-1",children:e.map(y=>{const v=o.get(y)??_s(y)??y;return T.jsxs("label",{className:"flex cursor-pointer items-center gap-2 rounded px-2 py-1.5 text-primary hover:bg-hover",title:y,children:[T.jsx("input",{type:"checkbox",checked:c.has(y),onChange:()=>_(y),className:"h-3.5 w-3.5 accent-approval"}),T.jsx("span",{className:"truncate",children:v})]},y)})})]}),p&&T.jsx("button",{type:"button",className:"absolute -right-1 -top-1 h-2 w-2 rounded-full bg-approval pulse-approval ring-2 ring-elevated",title:"Hidden sessions need attention","aria-label":"Clear project filters",onClick:y=>{y.stopPropagation(),r([])},children:T.jsx("span",{className:"sr-only",children:"Clear project filters"})})]})}const Kl=new Set(["tool_result","custom_tool_call_output"]),bR=new Set(["text","input_text","output_text"]);function qr(e){return!e||typeof e!="object"?null:e}function At(e){return typeof e=="string"?e:null}function Uo(e){return e==="user"?"user":e==="assistant"?"assistant":e==="system"||e==="developer"?"system":e==="tool"?"tool":"other"}function CR(e){const t=At(e.type)??"",r=qr(e.payload),n=At(r==null?void 0:r.type)??"",i=At(e.source)??At(r==null?void 0:r.source)??"",a=At(e.agent)??"";return i.toLowerCase()==="pi"||a.toLowerCase()==="pi"?"pi":t==="response_item"||t==="event_msg"?"codex":t==="tool_use"||t==="result"||t==="user"||t==="assistant"||t==="system"?"claude":n==="user_message"||n==="assistant_message"?"codex":"unknown"}function ER(e){const t=qr(e.payload),r=At(t==null?void 0:t.type);return{family:CR(e),rawType:At(e.type)??"unknown",...r?{payloadType:r}:{}}}function bt(e){if(!e)return[];if(typeof e=="string")return e.trim()?[e]:[];if(Array.isArray(e)){const r=[];for(const n of e){if(typeof n=="string"){n.trim()&&r.push(n);continue}const i=qr(n);if(!i)continue;const a=At(i.type);if(a&&Kl.has(a)||a&&!bR.has(a))continue;const l=At(i.text);l&&l.trim()&&r.push(l)}return r}const t=qr(e);if(t){const r=At(t.type);if(r&&Kl.has(r))return[];const n=At(t.text);return n&&n.trim()?[n]:[...bt(t.content),...bt(t.message)]}return[]}function kR(e,t){if(e.type!=="response_item")return[];const r=qr(e.payload);if(!r||r.type!=="message")return[];const n=Uo(r.role);return bt(r.content).map(i=>({kind:"message",role:n,text:i,source:t}))}function LR(e,t){if(e.type!=="event_msg")return[];const r=qr(e.payload);if(!r)return[];const n=At(r.type);let i=null;if(n==="user_message"?i="user":n==="assistant_message"?i="assistant":n==="system_message"?i="system":n==="message"&&(i=Uo(r.role)),!i||!["user","assistant","system"].includes(i))return[];const a=Array.from(new Set([...bt(r.message),...bt(r.content),...bt(r.text)]));return a.length===0?[]:a.map(l=>({kind:"message",role:i,text:l,source:t}))}function TR(e,t){const r=Uo(e.type),n=qr(e.message);if(n){const a=Uo(n.role??e.type);return[...bt(n.content),...bt(n.text),...bt(n.message)].map(s=>({kind:"message",role:a,text:s,source:t}))}return["user","assistant","system"].includes(r)?[...bt(e.content),...bt(e.text)].map(a=>({kind:"message",role:r,text:a,source:t})):[]}function RR(e,t){const r=Uo(e.role);return["user","assistant","system"].includes(r)?[...bt(e.content),...bt(e.message),...bt(e.text)].map(i=>({kind:"message",role:r,text:i,source:t})):[]}function DR(e,t){const r=At(e.type),n=At(e.event);return r!=="tool_use"&&n!=="tool_use"?[]:[{kind:"tool_call",role:"assistant",text:`[Tool: ${At(e.name)??"tool"}]`,source:t}]}function MR(e,t){if(e.type!=="result")return[];const r=At(e.result);return!r||!r.trim()?[]:[{kind:"result",role:"system",text:r,source:t}]}function AR(e,t){const r=qr(e.payload),n=[...bt(e.message),...bt(e.content),...bt(e.text),...bt(r==null?void 0:r.message),...bt(r==null?void 0:r.content)];return n.length===0?[]:n.map(i=>({kind:"unknown",role:"other",text:i,source:t}))}function PR(e,t){const r=At(e.type),n=qr(e.payload),i=At(n==null?void 0:n.type);return r&&Kl.has(r)||i&&Kl.has(i)?[{kind:"tool_result",role:"tool",text:"",source:t}]:[]}function IR(e){const t=qr(e);if(!t)return[];const r=ER(t),n=[...kR(t,r),...LR(t,r),...TR(t,r),...DR(t,r),...MR(t,r),...PR(t,r)];if(n.length>0)return n;const i=RR(t,r);return i.length>0?i:AR(t,r)}function BR(e){const t=e.trim();if(!t)return null;try{const r=JSON.parse(t);return{parsed:!0,events:IR(r),raw:r}}catch{return{parsed:!1,events:[{kind:"unknown",role:"other",text:t,source:{family:"unknown",rawType:"raw_text"}}],raw:e}}}function OR(e){return e==="user"?"user":e==="assistant"?"assistant":e==="system"?"system":"other"}function NR(e){const t=BR(e);if(!t)return[];const r=t.events.map(n=>({type:OR(n.role),content:n.text.trim(),raw:e})).filter(n=>n.content.length>0);return r.length>0?r:!t.parsed&&e.trim()?[{type:"other",content:e.trim(),raw:e}]:[]}function jR({session:e,onClose:t,onResume:r}){const[n,i]=k.useState(!0),[a,l]=k.useState(null),[s,o]=k.useState(null),[c,p]=k.useState(!1),u=k.useRef(null),f=k.useRef(null);k.useEffect(()=>{(async()=>{try{const m=await fetch(`/api/session-preview/${e.sessionId}`);if(!m.ok){const g=await m.json();throw new Error(g.error||"Failed to load preview")}const d=await m.json();o(d)}catch(m){l(m instanceof Error?m.message:"Failed to load preview")}finally{i(!1)}})()},[e.sessionId]),k.useEffect(()=>{u.current&&s&&(u.current.scrollTop=u.current.scrollHeight)},[s,c]),k.useEffect(()=>{const h=m=>{m.key==="Escape"?(m.stopPropagation(),t()):m.key==="Enter"&&!n&&!a&&(m.preventDefault(),r(e.sessionId))};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[t,r,e.sessionId,n,a]),k.useEffect(()=>{var h;(h=f.current)==null||h.focus()},[]);const _=e.displayName||_s(e.projectPath)||e.sessionId.slice(0,8),y=np(e.lastActivityAt),v=(s==null?void 0:s.lines.flatMap(NR).slice(-30))??[];return T.jsx("div",{role:"dialog","aria-modal":"true","aria-labelledby":"preview-title",className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4",onClick:h=>{h.target===h.currentTarget&&t()},children:T.jsxs("div",{ref:f,tabIndex:-1,className:"flex max-h-[80vh] w-full max-w-2xl flex-col border border-border bg-elevated",children:[T.jsxs("div",{className:"flex items-center gap-3 border-b border-border px-4 py-3",children:[T.jsx(bc,{agentType:e.agentType,className:"h-5 w-5 shrink-0 text-muted"}),T.jsxs("div",{className:"min-w-0 flex-1",children:[T.jsx("h2",{id:"preview-title",className:"truncate text-sm font-semibold text-primary",children:_}),T.jsxs("p",{className:"truncate text-xs text-muted",title:e.projectPath,children:[_s(e.projectPath)," · ",y]})]}),T.jsx("button",{type:"button",onClick:()=>p(h=>!h),className:`btn text-xs ${c?"btn-primary":""}`,children:c?"Parsed":"Raw"})]}),T.jsxs("div",{ref:u,className:"flex-1 overflow-y-auto p-4 font-mono text-xs",children:[n&&T.jsx("div",{className:"flex items-center justify-center py-8 text-muted",children:"Loading preview..."}),a&&T.jsx("div",{className:"flex items-center justify-center py-8 text-danger",children:a}),s&&!c&&T.jsx("div",{className:"space-y-2",children:v.length===0?T.jsx("div",{className:"py-8 text-center text-muted",children:"No readable content found. Try raw view."}):v.map((h,m)=>T.jsx("div",{className:`rounded px-2 py-1 ${h.type==="user"?"bg-blue-500/10 text-blue-400":h.type==="assistant"?"bg-emerald-500/10 text-emerald-400":h.type==="system"?"bg-yellow-500/10 text-yellow-400":"text-muted"}`,children:T.jsx("span",{className:"whitespace-pre-wrap break-words",children:h.content.length>500?`${h.content.slice(0,500)}...`:h.content})},m))}),s&&c&&T.jsx("div",{className:"space-y-1",children:s.lines.slice(-50).map((h,m)=>T.jsx("div",{className:"whitespace-pre-wrap break-all text-muted",children:h||" "},m))})]}),T.jsxs("div",{className:"flex items-center justify-end gap-2 border-t border-border px-4 py-3",children:[T.jsx("button",{type:"button",onClick:t,className:"btn",children:"Cancel"}),T.jsx("button",{type:"button",onClick:()=>r(e.sessionId),disabled:n||!!a,className:"btn btn-primary",children:"Resume"})]})]})})}const hv={working:"bg-green-500/20 text-green-600",waiting:"bg-zinc-500/20 text-zinc-400",permission:"bg-amber-500/20 text-amber-600",unknown:"bg-zinc-500/20 text-zinc-400"};function FR(){const[,e]=k.useState(0);k.useEffect(()=>{const t=setInterval(()=>e(r=>r+1),3e4);return()=>clearInterval(t)},[])}function hw({sessions:e,inactiveSessions:t=[],selectedSessionId:r,loading:n,error:i,onSelect:a,onRename:l,onResume:s,onKill:o,onDuplicate:c,onSetPinned:p}){FR();const[u,f]=k.useState(null),_=pe(X=>X.inactiveSessionsExpanded),y=pe(X=>X.setInactiveSessionsExpanded),[v,h]=k.useState(null),[m,d]=k.useState(20),g=$1();k.useEffect(()=>{_||d(20)},[_]);const w=200,[b,x]=uv(e.length,w),[C,S]=uv(t.length,w,!0),E=k.useRef(new Set(e.map(X=>X.id))),L=k.useRef(new Set(t.map(X=>X.sessionId))),[A,M]=k.useState(new Set);k.useEffect(()=>{var We;const X=new Set(e.map(Z=>Z.id)),le=new Set(t.map(Z=>Z.sessionId)),ge=new Set;for(const Z of X)E.current.has(Z)||ge.add(Z);for(const Z of e){const Le=(We=Z.agentSessionId)==null?void 0:We.trim();Le&&L.current.has(Le)&&!le.has(Le)&&ge.add(Z.id)}E.current=X,L.current=le,ge.size>0&&M(ge)},[e,t]),k.useEffect(()=>{if(A.size===0)return;const X=setTimeout(()=>M(new Set),500);return()=>clearTimeout(X)},[A]);const D=pe(X=>X.shortcutModifier),B=ii(Zo(D)),H=pe(X=>X.sessionSortMode),F=pe(X=>X.setSessionSortMode),$=pe(X=>X.sessionSortDirection),I=pe(X=>X.manualSessionOrder),R=pe(X=>X.setManualSessionOrder),P=pe(X=>X.showProjectName),N=pe(X=>X.showLastUserMessage),j=pe(X=>X.showSessionIdPrefix),U=pe(X=>X.projectFilters),V=pe(X=>X.setProjectFilters),ee=pe(X=>X.hostFilters),Q=pe(X=>X.setHostFilters),z=Ge(X=>X.exitingSessions),O=Ge(X=>X.clearExitingSession),K=Ge(X=>X.hostStatuses),W=Ge(X=>X.remoteAllowControl);dR(e,z,O,w),k.useEffect(()=>{if(I.length===0)return;const X=new Set;for(const ge of e)X.add(go(ge)),X.add(ge.id);for(const ge of t)X.add(ge.sessionId);const le=I.filter(ge=>X.has(ge));le.length!==I.length&&R(le)},[e,t,I,R]);const J=k.useMemo(()=>rp(e,{mode:H,direction:$,manualOrder:I}),[e,H,$,I]),_e=k.useMemo(()=>cR(e,t),[e,t]),ue=k.useMemo(()=>{const X=uR(e,t),le=K.map(Z=>Z.host),ge=new Set,We=[];for(const Z of le)!Z||ge.has(Z)||(ge.add(Z),We.push(Z));for(const Z of X)!Z||ge.has(Z)||(ge.add(Z),We.push(Z));return We},[e,t,K]),se=k.useMemo(()=>ue.length>1,[ue]),re=k.useMemo(()=>{let X=J;return U.length>0&&(X=X.filter(le=>U.includes(le.projectPath))),ee.length>0&&(X=X.filter(le=>ee.includes(le.host??""))),X},[J,U,ee]),ae=k.useMemo(()=>{const X=U.length===0?"all-projects":U.join("|"),le=ee.length===0?"all-hosts":ee.join("|");return`${X}::${le}`},[U,ee]),ye=k.useRef(new Set(re.map(X=>X.id))),[ve,ne]=k.useState(new Set);k.useEffect(()=>{const X=new Set(re.map(ge=>ge.id)),le=new Set;for(const ge of X)ye.current.has(ge)||A.has(ge)||le.add(ge);ye.current=X,le.size>0&&ne(le)},[re,A]),k.useEffect(()=>{if(ve.size===0)return;const X=setTimeout(()=>ne(new Set),500);return()=>clearTimeout(X)},[ve]);const ie=k.useMemo(()=>{let X=t;return U.length>0&&(X=X.filter(le=>U.includes(le.projectPath))),ee.length>0&&(X=X.filter(le=>ee.includes(le.host??""))),X},[t,U,ee]),he=k.useMemo(()=>{if(U.length===0)return 0;const X=new Set(U);return e.filter(le=>!X.has(le.projectPath)&&le.status==="permission").length},[e,U]);k.useEffect(()=>{if(U.length===0||_e.length===0)return;const X=new Set(_e),le=U.filter(ge=>X.has(ge));le.length!==U.length&&V(le)},[U,_e,V]),k.useEffect(()=>{if(ee.length===0||ue.length===0)return;const X=new Set(ue),le=ee.filter(ge=>X.has(ge));le.length!==ee.length&&Q(le)},[ee,ue,Q]);const oe=OL(BL(tp,{activationConstraint:{distance:8}})),[me,xe]=k.useState(null),[ke,Ne]=k.useState(null),[Ke,Ae]=k.useState(!1),Pe=k.useCallback(X=>{xe(X.active.id),Ae(!0)},[]),G=k.useCallback(X=>{var le;Ne((le=X.over)==null?void 0:le.id)},[]),Y=k.useCallback(X=>{const{active:le,over:ge}=X;if(xe(null),Ne(null),!ge||le.id===ge.id){setTimeout(()=>Ae(!1),100);return}const We=re.findIndex(Me=>Me.id===le.id),Z=re.findIndex(Me=>Me.id===ge.id);if(We===-1||Z===-1){setTimeout(()=>Ae(!1),100);return}const Le=re.map(Me=>go(Me)),[de]=Le.splice(We,1);Le.splice(Z,0,de);const fe=J.map(Me=>go(Me)),Ee=new Set(Le);let Re=0;const je=fe.map(Me=>{if(!Ee.has(Me))return Me;const Ie=Le[Re];return Re+=1,Ie});H!=="manual"&&F("manual"),R(je),setTimeout(()=>Ae(!1),100)},[re,J,H,F,R]),Oe=k.useCallback(()=>{xe(null),Ne(null),setTimeout(()=>Ae(!1),100)},[]);k.useEffect(()=>{if(!me&&!ke)return;const X=new Set(re.map(ge=>ge.id));let le=!1;me&&!X.has(me)&&(xe(null),le=!0),ke&&!X.has(ke)&&(Ne(null),le=!0),le&&Ae(!1)},[re,me,ke]);const $e=(X,le)=>{l(X,le),f(null)};return T.jsxs("aside",{className:"flex min-h-0 flex-1 flex-col border-r border-border bg-elevated",children:[i&&T.jsx("div",{className:"shrink-0 border-b border-danger/30 bg-danger/10 px-3 py-2 text-xs text-danger",children:i}),T.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto",children:[T.jsxs("div",{className:"sticky top-0 z-10 flex h-10 items-center justify-between border-b border-border bg-elevated px-3",children:[T.jsx("span",{className:"text-xs font-medium uppercase tracking-wider text-muted",children:"Sessions"}),T.jsxs("div",{className:"flex items-center gap-4",children:[se&&T.jsx(SR,{hosts:ue,selectedHosts:ee,onSelect:Q,statuses:K}),T.jsx(xR,{projects:_e,selectedProjects:U,onSelect:V,hasHiddenPermissions:he>0}),T.jsx(Yh.span,{className:"w-8 text-right text-xs text-muted",animate:b&&!g?{scale:[1,1.3,1]}:{},transition:{duration:.3},onAnimationComplete:x,children:re.length})]})]}),n?T.jsx("div",{className:"space-y-1 p-2",children:[0,1,2].map(X=>T.jsx("div",{className:"h-14 animate-pulse rounded bg-surface"},X))}):re.length===0?T.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted",children:"No sessions"}):T.jsx($T,{sensors:oe,collisionDetection:HL,onDragStart:Pe,onDragOver:G,onDragEnd:Y,onDragCancel:Oe,children:T.jsx(ZT,{items:re.map(X=>X.id),strategy:JT,children:T.jsx("div",{children:T.jsx(W5,{initial:!1,mode:"popLayout",children:re.map((X,le)=>{const ge=A.has(X.id),We=ve.has(X.id),Z=X.remote===!0,Le=X.source==="managed",de=!Z||W&&Le,fe=me?re.findIndex(Me=>Me.id===me):-1,Re=ke===X.id&&me!==X.id?fe>le?"above":"below":null,je=ge||We;return T.jsx(dw,{session:X,isNew:je,exitDuration:w,prefersReducedMotion:g,layoutAnimationsDisabled:Ke,isSelected:X.id===r,isEditing:X.id===u,showSessionIdPrefix:j,showProjectName:P,showLastUserMessage:N,showHostInfo:se,dropIndicator:Re,onSelect:()=>a(X.id),onStartEdit:de?()=>f(X.id):void 0,onCancelEdit:()=>f(null),onRename:Me=>$e(X.id,Me),onKill:o&&de?()=>o(X.id):void 0,onDuplicate:c&&de?()=>c(X.id):void 0,onSetPinned:p&&X.agentSessionId?Me=>p(X.agentSessionId.trim(),Me):void 0},X.id)})})},ae)})}),ie.length>0&&T.jsxs("div",{className:"border-t border-border",children:[T.jsxs("button",{type:"button",onClick:()=>y(!_),className:"flex w-full items-center justify-between px-3 py-2 text-left text-xs font-medium uppercase tracking-wider text-muted hover:text-primary",children:[T.jsxs("span",{className:"flex items-center gap-2",children:[_?T.jsx(ff,{className:"h-4 w-4"}):T.jsx(dC,{className:"h-4 w-4"}),"Inactive Sessions"]}),T.jsx(Yh.span,{className:"w-8 text-right text-xs",animate:C&&!g?{scale:[1,1.3,1]}:{},transition:{duration:.3},onAnimationComplete:S,children:ie.length})]}),_&&T.jsxs("div",{className:"py-1",children:[ie.slice(0,m).map(X=>T.jsx(yR,{session:X,showSessionIdPrefix:j,showProjectName:P,showLastUserMessage:N,onResume:le=>s==null?void 0:s(le),onPreview:h,onSetPinned:p},X.sessionId)),ie.length>m&&T.jsxs("button",{type:"button",onClick:()=>d(X=>X+20),className:"w-full px-3 py-2 text-center text-xs text-muted hover:text-primary hover:bg-hover",children:["Show more (",ie.length-m," remaining)"]})]})]})]}),T.jsx("div",{className:"hidden shrink-0 border-t border-border px-3 py-2 md:block",children:T.jsxs("div",{className:"flex flex-wrap gap-x-3 gap-y-0.5 text-[10px] text-muted",children:[T.jsxs("span",{children:[B,"[ ] nav"]}),T.jsxs("span",{children:[B,"N new"]}),T.jsxs("span",{children:[B,"X kill"]})]})}),v&&T.jsx(jR,{session:v,onClose:()=>h(null),onResume:X=>{h(null),s==null||s(X)}})]})}const dw=k.forwardRef(function({session:t,isNew:r,exitDuration:n,prefersReducedMotion:i,layoutAnimationsDisabled:a,isSelected:l,isEditing:s,showSessionIdPrefix:o,showProjectName:c,showLastUserMessage:p,showHostInfo:u,dropIndicator:f,onSelect:_,onStartEdit:y,onCancelEdit:v,onRename:h,onKill:m,onDuplicate:d,onSetPinned:g},w){const{attributes:b,listeners:x,setNodeRef:C,transform:S,transition:E,isDragging:L}=oR({id:t.id,animateLayoutChanges:({isSorting:H,wasDragging:F})=>H||F}),A=Ho.Transform.toString(S),D={...!!(i&&A)?{transform:A,transition:E}:{},zIndex:L?10:void 0,opacity:L?.9:void 0},B=k.useCallback(H=>{C(H),typeof w=="function"?w(H):w&&(w.current=H)},[C,w]);return T.jsxs(Yh.div,{ref:B,style:{...D,overflow:"hidden"},className:"relative",layout:!i&&!L&&!a&&!r,transformTemplate:(H,F)=>A?!F||F==="none"?A:`${A} ${F}`:F,initial:i||!r?!1:{opacity:0,scale:.97},animate:i?{opacity:1}:r?{opacity:1,scale:[1.02,.99,1]}:{opacity:1,scale:1},exit:i?{opacity:0}:{opacity:0,height:0,scale:.97},transition:i?{duration:0}:{layout:{type:"spring",stiffness:500,damping:35},opacity:{duration:n/1e3},scale:{duration:n/1e3,ease:[.34,1.56,.64,1]},height:{duration:n/1e3,ease:"easeOut"}},...b,...x,children:[f==="above"&&T.jsx("div",{className:"absolute -top-px left-3 right-3 h-0.5 border-t-2 border-dashed border-accent"}),T.jsx($R,{session:t,isSelected:l,isEditing:s,showSessionIdPrefix:o,showProjectName:c,showLastUserMessage:p,showHostInfo:u,isDragging:L,onSelect:_,onStartEdit:y,onCancelEdit:v,onRename:h,onKill:m,onDuplicate:d,onSetPinned:g}),f==="below"&&T.jsx("div",{className:"absolute -bottom-px left-3 right-3 h-0.5 border-t-2 border-dashed border-accent"})]})});dw.displayName="SortableSessionItem";function $R({session:e,isSelected:t,isEditing:r,showSessionIdPrefix:n,showProjectName:i,showLastUserMessage:a,showHostInfo:l,isDragging:s=!1,onSelect:o,onStartEdit:c,onCancelEdit:p,onRename:u,onKill:f,onDuplicate:_,onSetPinned:y}){var Q,z,O,K;const v=np(e.lastActivity),h=k.useRef(null),m=k.useRef(null),d=((Q=e.agentSessionName)==null?void 0:Q.trim())||((z=e.name)==null?void 0:z.trim())||e.id,[g,w]=k.useState(d),b=k.useRef(null),[x,C]=k.useState(null),S=_s(e.projectPath),E=(O=e.host)==null?void 0:O.trim(),L=e.status==="permission",A=(K=e.agentSessionId)==null?void 0:K.trim(),M=n&&A?lw(A):"",D=i&&!!S,B=l&&!!E,H=a&&!!e.lastUserMessage,F=k.useRef(e.status),[$,I]=k.useState(!1);k.useEffect(()=>{const W=F.current,te=e.status;W==="working"&&te==="waiting"?I(!0):F.current=te},[e.status]);const R=()=>{I(!1),F.current=e.status};k.useEffect(()=>{r&&h.current&&(h.current.focus(),h.current.select())},[r]),k.useEffect(()=>{w(d)},[d]);const P=()=>{const W=g.trim();W&&W!==d?u(W):p()},N=W=>{W.key==="Enter"?(W.preventDefault(),P()):W.key==="Escape"&&(W.preventDefault(),w(d),p())},j=k.useRef(null),U=W=>{if(s)return;const te=W.touches[0];j.current={x:te.clientX,y:te.clientY},b.current=setTimeout(()=>{j.current&&C(j.current)},500)},V=()=>{b.current&&(clearTimeout(b.current),b.current=null)};k.useEffect(()=>{if(!x)return;const W=J=>{m.current&&!m.current.contains(J.target)&&C(null)},te=J=>{J.key==="Escape"&&C(null)};return document.addEventListener("mousedown",W),document.addEventListener("touchstart",W),document.addEventListener("keydown",te),()=>{document.removeEventListener("mousedown",W),document.removeEventListener("touchstart",W),document.removeEventListener("keydown",te)}},[x]);const ee=W=>{W.preventDefault(),W.stopPropagation(),C({x:W.clientX,y:W.clientY})};return T.jsxs("div",{className:`session-row group cursor-pointer select-none px-3 py-2 ${t?"selected":""} ${s?"cursor-grabbing shadow-lg ring-1 ring-accent/30 bg-elevated":"cursor-grab"}`,role:"button",tabIndex:0,"data-testid":"session-card","data-session-id":e.id,onClick:s?void 0:o,onKeyDown:W=>{(W.key==="Enter"||W.key===" ")&&o()},onContextMenu:ee,onTouchStart:U,onTouchEnd:V,onTouchCancel:V,children:[T.jsxs("div",{className:"flex flex-col gap-0.5 pl-0.5",children:[T.jsxs("div",{className:"flex items-center gap-2",children:[T.jsx(bc,{agentType:e.agentType,command:e.command,className:"h-3.5 w-3.5 shrink-0 text-muted"}),r?T.jsx("input",{ref:h,type:"text",value:g,onChange:W=>w(W.target.value),onBlur:P,onKeyDown:N,onClick:W=>W.stopPropagation(),className:"min-w-0 flex-1 rounded border border-border bg-surface px-1.5 py-0.5 text-sm font-medium text-primary outline-none focus:border-accent"}):T.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium text-primary",children:d}),e.isPinned&&T.jsx(Il,{className:"h-3 w-3 shrink-0 text-primary","aria-label":"Pinned",title:"Pinned - will auto-resume on server restart"}),M&&T.jsx("span",{className:"shrink-0 text-[11px] font-mono text-muted",title:A,children:M}),L?T.jsx("span",{className:`ml-1 flex shrink-0 items-center justify-center rounded-full px-1.5 py-0.5 ${hv[e.status]} pulse-approval`,onAnimationEnd:R,children:T.jsx(bC,{className:"h-3 w-3","aria-label":"Needs input"})}):T.jsx("span",{className:`ml-1 shrink-0 rounded-full px-1.5 py-0.5 text-right text-xs tabular-nums ${hv[e.status]}${$?" pulse-complete":""}`,onAnimationEnd:R,children:v})]}),(D||B||H)&&T.jsxs("div",{className:"flex flex-wrap items-center gap-1 pl-[1.375rem]",children:[B&&T.jsx(wR,{name:E}),D&&T.jsx(uw,{name:S,fullPath:e.projectPath}),H&&T.jsxs("span",{className:"line-clamp-2 text-xs italic text-muted",children:['"',e.lastUserMessage.length>200?e.lastUserMessage.slice(0,200)+"…":e.lastUserMessage,'"']})]})]}),x&&T.jsxs("div",{ref:m,className:"fixed z-50 min-w-[160px] rounded-md border border-border bg-elevated shadow-lg py-1",style:{left:x.x,top:x.y},role:"menu",children:[c&&T.jsxs("button",{onClick:W=>{W.stopPropagation(),C(null),c()},className:"w-full px-3 py-2 text-left text-sm text-secondary hover:bg-hover hover:text-primary flex items-center gap-2",role:"menuitem",children:[T.jsx(ny,{width:14,height:14}),"Rename"]}),_&&T.jsxs("button",{onClick:W=>{W.stopPropagation(),C(null),_()},className:"w-full px-3 py-2 text-left text-sm text-secondary hover:bg-hover hover:text-primary flex items-center gap-2",role:"menuitem",title:"Create a copy in a new tmux window",children:[T.jsx(ry,{width:14,height:14}),"Duplicate"]}),y&&T.jsxs("button",{onClick:W=>{W.stopPropagation(),C(null),y(!e.isPinned)},className:"w-full px-3 py-2 text-left text-sm text-secondary hover:bg-hover hover:text-primary flex items-center gap-2",role:"menuitem",title:e.isPinned?"Remove from auto-resume list":"Auto-resume on server restart",children:[T.jsx(Il,{width:14,height:14}),e.isPinned?"Unpin":"Pin"]}),e.logFilePath&&T.jsxs("button",{onClick:W=>{W.stopPropagation();const te=e.logFilePath;if(C(null),te){const J=document.createElement("textarea");J.value=te,J.style.position="fixed",J.style.left="-9999px",document.body.appendChild(J),J.focus(),J.select();try{document.execCommand("copy")}catch{navigator.clipboard.writeText(te).catch(()=>{})}document.body.removeChild(J)}},className:"w-full px-3 py-2 text-left text-sm text-secondary hover:bg-hover hover:text-primary flex items-center gap-2",role:"menuitem",title:e.logFilePath,children:[T.jsx(sy,{width:14,height:14}),"Copy Log Path"]}),f&&T.jsxs(T.Fragment,{children:[T.jsx("div",{className:"my-1 border-t border-border"}),T.jsxs("button",{onClick:W=>{W.stopPropagation(),C(null),f()},className:"w-full px-3 py-2 text-left text-sm text-danger hover:bg-danger/10 flex items-center gap-2",role:"menuitem",children:[T.jsx(Th,{width:14,height:14}),"Kill Session"]})]})]})]})}const rd={debug:0,info:1,warn:2,error:3};let fw="info";function HR(e){const t=e.toLowerCase();t in rd&&(fw=t)}function Je(e,t,r="debug"){if(!(rd[r]<rd[fw]))try{fetch("/api/client-log",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({event:e,data:t,level:r})}).catch(()=>{})}catch{}}var pw={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(globalThis,()=>(()=>{var r={4567:function(l,s,o){var c=this&&this.__decorate||function(d,g,w,b){var x,C=arguments.length,S=C<3?g:b===null?b=Object.getOwnPropertyDescriptor(g,w):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(d,g,w,b);else for(var E=d.length-1;E>=0;E--)(x=d[E])&&(S=(C<3?x(S):C>3?x(g,w,S):x(g,w))||S);return C>3&&S&&Object.defineProperty(g,w,S),S},p=this&&this.__param||function(d,g){return function(w,b){g(w,b,d)}};Object.defineProperty(s,"__esModule",{value:!0}),s.AccessibilityManager=void 0;const u=o(9042),f=o(9924),_=o(844),y=o(4725),v=o(2585),h=o(3656);let m=s.AccessibilityManager=class extends _.Disposable{constructor(d,g,w,b){super(),this._terminal=d,this._coreBrowserService=w,this._renderService=b,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let x=0;x<this._terminal.rows;x++)this._rowElements[x]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[x]);if(this._topBoundaryFocusListener=x=>this._handleBoundaryFocus(x,0),this._bottomBoundaryFocusListener=x=>this._handleBoundaryFocus(x,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new f.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize(x=>this._handleResize(x.rows))),this.register(this._terminal.onRender(x=>this._refreshRows(x.start,x.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(x=>this._handleChar(x))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
53
53
  `))),this.register(this._terminal.onA11yTab(x=>this._handleTab(x))),this.register(this._terminal.onKey(x=>this._handleKey(x.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this.register((0,h.addDisposableDomListener)(document,"selectionchange",()=>this._handleSelectionChange())),this.register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRows(),this.register((0,_.toDisposable)(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(d){for(let g=0;g<d;g++)this._handleChar(" ")}_handleChar(d){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==d&&(this._charsToAnnounce+=d):this._charsToAnnounce+=d,d===`
54
54
  `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=u.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(d){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(d)||this._charsToConsume.push(d)}_refreshRows(d,g){this._liveRegionDebouncer.refresh(d,g,this._terminal.rows)}_renderRows(d,g){const w=this._terminal.buffer,b=w.lines.length.toString();for(let x=d;x<=g;x++){const C=w.lines.get(w.ydisp+x),S=[],E=(C==null?void 0:C.translateToString(!0,void 0,void 0,S))||"",L=(w.ydisp+x+1).toString(),A=this._rowElements[x];A&&(E.length===0?(A.innerText=" ",this._rowColumns.set(A,[0,1])):(A.textContent=E,this._rowColumns.set(A,S)),A.setAttribute("aria-posinset",L),A.setAttribute("aria-setsize",b))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(d,g){const w=d.target,b=this._rowElements[g===0?1:this._rowElements.length-2];if(w.getAttribute("aria-posinset")===(g===0?"1":`${this._terminal.buffer.lines.length}`)||d.relatedTarget!==b)return;let x,C;if(g===0?(x=w,C=this._rowElements.pop(),this._rowContainer.removeChild(C)):(x=this._rowElements.shift(),C=w,this._rowContainer.removeChild(x)),x.removeEventListener("focus",this._topBoundaryFocusListener),C.removeEventListener("focus",this._bottomBoundaryFocusListener),g===0){const S=this._createAccessibilityTreeNode();this._rowElements.unshift(S),this._rowContainer.insertAdjacentElement("afterbegin",S)}else{const S=this._createAccessibilityTreeNode();this._rowElements.push(S),this._rowContainer.appendChild(S)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(g===0?-1:1),this._rowElements[g===0?1:this._rowElements.length-2].focus(),d.preventDefault(),d.stopImmediatePropagation()}_handleSelectionChange(){var E;if(this._rowElements.length===0)return;const d=document.getSelection();if(!d)return;if(d.isCollapsed)return void(this._rowContainer.contains(d.anchorNode)&&this._terminal.clearSelection());if(!d.anchorNode||!d.focusNode)return void console.error("anchorNode and/or focusNode are null");let g={node:d.anchorNode,offset:d.anchorOffset},w={node:d.focusNode,offset:d.focusOffset};if((g.node.compareDocumentPosition(w.node)&Node.DOCUMENT_POSITION_PRECEDING||g.node===w.node&&g.offset>w.offset)&&([g,w]=[w,g]),g.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(g={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(g.node))return;const b=this._rowElements.slice(-1)[0];if(w.node.compareDocumentPosition(b)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(w={node:b,offset:((E=b.textContent)==null?void 0:E.length)??0}),!this._rowContainer.contains(w.node))return;const x=({node:L,offset:A})=>{const M=L instanceof Text?L.parentNode:L;let D=parseInt(M==null?void 0:M.getAttribute("aria-posinset"),10)-1;if(isNaN(D))return console.warn("row is invalid. Race condition?"),null;const B=this._rowColumns.get(M);if(!B)return console.warn("columns is null. Race condition?"),null;let H=A<B.length?B[A]:B.slice(-1)[0]+1;return H>=this._terminal.cols&&(++D,H=0),{row:D,column:H}},C=x(g),S=x(w);if(C&&S){if(C.row>S.row||C.row===S.row&&C.column>=S.column)throw new Error("invalid range");this._terminal.select(C.column,C.row,(S.row-C.row)*this._terminal.cols-C.column+S.column)}}_handleResize(d){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let g=this._rowContainer.children.length;g<this._terminal.rows;g++)this._rowElements[g]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[g]);for(;this._rowElements.length>d;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const d=this._coreBrowserService.mainDocument.createElement("div");return d.setAttribute("role","listitem"),d.tabIndex=-1,this._refreshRowDimensions(d),d}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let d=0;d<this._terminal.rows;d++)this._refreshRowDimensions(this._rowElements[d])}}_refreshRowDimensions(d){d.style.height=`${this._renderService.dimensions.css.cell.height}px`}};s.AccessibilityManager=m=c([p(1,v.IInstantiationService),p(2,y.ICoreBrowserService),p(3,y.IRenderService)],m)},3614:(l,s)=>{function o(f){return f.replace(/\r?\n/g,"\r")}function c(f,_){return _?"\x1B[200~"+f+"\x1B[201~":f}function p(f,_,y,v){f=c(f=o(f),y.decPrivateModes.bracketedPasteMode&&v.rawOptions.ignoreBracketedPasteMode!==!0),y.triggerDataEvent(f,!0),_.value=""}function u(f,_,y){const v=y.getBoundingClientRect(),h=f.clientX-v.left-10,m=f.clientY-v.top-10;_.style.width="20px",_.style.height="20px",_.style.left=`${h}px`,_.style.top=`${m}px`,_.style.zIndex="1000",_.focus()}Object.defineProperty(s,"__esModule",{value:!0}),s.rightClickHandler=s.moveTextAreaUnderMouseCursor=s.paste=s.handlePasteEvent=s.copyHandler=s.bracketTextForPaste=s.prepareTextForTerminal=void 0,s.prepareTextForTerminal=o,s.bracketTextForPaste=c,s.copyHandler=function(f,_){f.clipboardData&&f.clipboardData.setData("text/plain",_.selectionText),f.preventDefault()},s.handlePasteEvent=function(f,_,y,v){f.stopPropagation(),f.clipboardData&&p(f.clipboardData.getData("text/plain"),_,y,v)},s.paste=p,s.moveTextAreaUnderMouseCursor=u,s.rightClickHandler=function(f,_,y,v,h){u(f,_,y),h&&v.rightClickSelect(f),_.value=v.selectionText,_.select()}},7239:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorContrastCache=void 0;const c=o(1505);s.ColorContrastCache=class{constructor(){this._color=new c.TwoKeyMap,this._css=new c.TwoKeyMap}setCss(p,u,f){this._css.set(p,u,f)}getCss(p,u){return this._css.get(p,u)}setColor(p,u,f){this._color.set(p,u,f)}getColor(p,u){return this._color.get(p,u)}clear(){this._color.clear(),this._css.clear()}}},3656:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.addDisposableDomListener=void 0,s.addDisposableDomListener=function(o,c,p,u){o.addEventListener(c,p,u);let f=!1;return{dispose:()=>{f||(f=!0,o.removeEventListener(c,p,u))}}}},3551:function(l,s,o){var c=this&&this.__decorate||function(m,d,g,w){var b,x=arguments.length,C=x<3?d:w===null?w=Object.getOwnPropertyDescriptor(d,g):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(m,d,g,w);else for(var S=m.length-1;S>=0;S--)(b=m[S])&&(C=(x<3?b(C):x>3?b(d,g,C):b(d,g))||C);return x>3&&C&&Object.defineProperty(d,g,C),C},p=this&&this.__param||function(m,d){return function(g,w){d(g,w,m)}};Object.defineProperty(s,"__esModule",{value:!0}),s.Linkifier=void 0;const u=o(3656),f=o(8460),_=o(844),y=o(2585),v=o(4725);let h=s.Linkifier=class extends _.Disposable{get currentLink(){return this._currentLink}constructor(m,d,g,w,b){super(),this._element=m,this._mouseService=d,this._renderService=g,this._bufferService=w,this._linkProviderService=b,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new f.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new f.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,_.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,_.toDisposable)(()=>{var x;this._lastMouseEvent=void 0,(x=this._activeProviderReplies)==null||x.clear()})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this.register((0,u.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,u.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(m){this._lastMouseEvent=m;const d=this._positionFromMouseEvent(m,this._element,this._mouseService);if(!d)return;this._isMouseOut=!1;const g=m.composedPath();for(let w=0;w<g.length;w++){const b=g[w];if(b.classList.contains("xterm"))break;if(b.classList.contains("xterm-hover"))return}this._lastBufferCell&&d.x===this._lastBufferCell.x&&d.y===this._lastBufferCell.y||(this._handleHover(d),this._lastBufferCell=d)}_handleHover(m){if(this._activeLine!==m.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(m,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,m)||(this._clearCurrentLink(),this._askForLink(m,!0))}_askForLink(m,d){var w,b;this._activeProviderReplies&&d||((w=this._activeProviderReplies)==null||w.forEach(x=>{x==null||x.forEach(C=>{C.link.dispose&&C.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=m.y);let g=!1;for(const[x,C]of this._linkProviderService.linkProviders.entries())d?(b=this._activeProviderReplies)!=null&&b.get(x)&&(g=this._checkLinkProviderResult(x,m,g)):C.provideLinks(m.y,S=>{var L,A;if(this._isMouseOut)return;const E=S==null?void 0:S.map(M=>({link:M}));(L=this._activeProviderReplies)==null||L.set(x,E),g=this._checkLinkProviderResult(x,m,g),((A=this._activeProviderReplies)==null?void 0:A.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(m.y,this._activeProviderReplies)})}_removeIntersectingLinks(m,d){const g=new Set;for(let w=0;w<d.size;w++){const b=d.get(w);if(b)for(let x=0;x<b.length;x++){const C=b[x],S=C.link.range.start.y<m?0:C.link.range.start.x,E=C.link.range.end.y>m?this._bufferService.cols:C.link.range.end.x;for(let L=S;L<=E;L++){if(g.has(L)){b.splice(x--,1);break}g.add(L)}}}}_checkLinkProviderResult(m,d,g){var x;if(!this._activeProviderReplies)return g;const w=this._activeProviderReplies.get(m);let b=!1;for(let C=0;C<m;C++)this._activeProviderReplies.has(C)&&!this._activeProviderReplies.get(C)||(b=!0);if(!b&&w){const C=w.find(S=>this._linkAtPosition(S.link,d));C&&(g=!0,this._handleNewLink(C))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!g)for(let C=0;C<this._activeProviderReplies.size;C++){const S=(x=this._activeProviderReplies.get(C))==null?void 0:x.find(E=>this._linkAtPosition(E.link,d));if(S){g=!0,this._handleNewLink(S);break}}return g}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(m){if(!this._currentLink)return;const d=this._positionFromMouseEvent(m,this._element,this._mouseService);d&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,d)&&this._currentLink.link.activate(m,this._currentLink.link.text)}_clearCurrentLink(m,d){this._currentLink&&this._lastMouseEvent&&(!m||!d||this._currentLink.link.range.start.y>=m&&this._currentLink.link.range.end.y<=d)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,_.disposeArray)(this._linkCacheDisposables))}_handleNewLink(m){if(!this._lastMouseEvent)return;const d=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);d&&this._linkAtPosition(m.link,d)&&(this._currentLink=m,this._currentLink.state={decorations:{underline:m.link.decorations===void 0||m.link.decorations.underline,pointerCursor:m.link.decorations===void 0||m.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,m.link,this._lastMouseEvent),m.link.decorations={},Object.defineProperties(m.link.decorations,{pointerCursor:{get:()=>{var g,w;return(w=(g=this._currentLink)==null?void 0:g.state)==null?void 0:w.decorations.pointerCursor},set:g=>{var w;(w=this._currentLink)!=null&&w.state&&this._currentLink.state.decorations.pointerCursor!==g&&(this._currentLink.state.decorations.pointerCursor=g,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",g))}},underline:{get:()=>{var g,w;return(w=(g=this._currentLink)==null?void 0:g.state)==null?void 0:w.decorations.underline},set:g=>{var w,b,x;(w=this._currentLink)!=null&&w.state&&((x=(b=this._currentLink)==null?void 0:b.state)==null?void 0:x.decorations.underline)!==g&&(this._currentLink.state.decorations.underline=g,this._currentLink.state.isHovered&&this._fireUnderlineEvent(m.link,g))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(g=>{if(!this._currentLink)return;const w=g.start===0?0:g.start+1+this._bufferService.buffer.ydisp,b=this._bufferService.buffer.ydisp+1+g.end;if(this._currentLink.link.range.start.y>=w&&this._currentLink.link.range.end.y<=b&&(this._clearCurrentLink(w,b),this._lastMouseEvent)){const x=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);x&&this._askForLink(x,!1)}})))}_linkHover(m,d,g){var w;(w=this._currentLink)!=null&&w.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(d,!0),this._currentLink.state.decorations.pointerCursor&&m.classList.add("xterm-cursor-pointer")),d.hover&&d.hover(g,d.text)}_fireUnderlineEvent(m,d){const g=m.range,w=this._bufferService.buffer.ydisp,b=this._createLinkUnderlineEvent(g.start.x-1,g.start.y-w-1,g.end.x,g.end.y-w-1,void 0);(d?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(b)}_linkLeave(m,d,g){var w;(w=this._currentLink)!=null&&w.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(d,!1),this._currentLink.state.decorations.pointerCursor&&m.classList.remove("xterm-cursor-pointer")),d.leave&&d.leave(g,d.text)}_linkAtPosition(m,d){const g=m.range.start.y*this._bufferService.cols+m.range.start.x,w=m.range.end.y*this._bufferService.cols+m.range.end.x,b=d.y*this._bufferService.cols+d.x;return g<=b&&b<=w}_positionFromMouseEvent(m,d,g){const w=g.getCoords(m,d,this._bufferService.cols,this._bufferService.rows);if(w)return{x:w[0],y:w[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(m,d,g,w,b){return{x1:m,y1:d,x2:g,y2:w,cols:this._bufferService.cols,fg:b}}};s.Linkifier=h=c([p(1,v.IMouseService),p(2,v.IRenderService),p(3,y.IBufferService),p(4,v.ILinkProviderService)],h)},9042:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.tooMuchOutput=s.promptLabel=void 0,s.promptLabel="Terminal input",s.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(l,s,o){var c=this&&this.__decorate||function(v,h,m,d){var g,w=arguments.length,b=w<3?h:d===null?d=Object.getOwnPropertyDescriptor(h,m):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(v,h,m,d);else for(var x=v.length-1;x>=0;x--)(g=v[x])&&(b=(w<3?g(b):w>3?g(h,m,b):g(h,m))||b);return w>3&&b&&Object.defineProperty(h,m,b),b},p=this&&this.__param||function(v,h){return function(m,d){h(m,d,v)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OscLinkProvider=void 0;const u=o(511),f=o(2585);let _=s.OscLinkProvider=class{constructor(v,h,m){this._bufferService=v,this._optionsService=h,this._oscLinkService=m}provideLinks(v,h){var E;const m=this._bufferService.buffer.lines.get(v-1);if(!m)return void h(void 0);const d=[],g=this._optionsService.rawOptions.linkHandler,w=new u.CellData,b=m.getTrimmedLength();let x=-1,C=-1,S=!1;for(let L=0;L<b;L++)if(C!==-1||m.hasContent(L)){if(m.loadCell(L,w),w.hasExtendedAttrs()&&w.extended.urlId){if(C===-1){C=L,x=w.extended.urlId;continue}S=w.extended.urlId!==x}else C!==-1&&(S=!0);if(S||C!==-1&&L===b-1){const A=(E=this._oscLinkService.getLinkData(x))==null?void 0:E.uri;if(A){const M={start:{x:C+1,y:v},end:{x:L+(S||L!==b-1?0:1),y:v}};let D=!1;if(!(g!=null&&g.allowNonHttpProtocols))try{const B=new URL(A);["http:","https:"].includes(B.protocol)||(D=!0)}catch{D=!0}D||d.push({text:A,range:M,activate:(B,H)=>g?g.activate(B,H,M):y(0,H),hover:(B,H)=>{var F;return(F=g==null?void 0:g.hover)==null?void 0:F.call(g,B,H,M)},leave:(B,H)=>{var F;return(F=g==null?void 0:g.leave)==null?void 0:F.call(g,B,H,M)}})}S=!1,w.hasExtendedAttrs()&&w.extended.urlId?(C=L,x=w.extended.urlId):(C=-1,x=-1)}}h(d)}};function y(v,h){if(confirm(`Do you want to navigate to ${h}?
55
55
 
@@ -184,7 +184,7 @@ void main() {
184
184
  pointer-events: none;
185
185
  max-width: 400px;
186
186
  word-break: break-all;
187
- `,ke=document.createElement("div"),xe.appendChild(ke),Ne=document.createElement("div"),Ne.style.color="var(--text-muted)",Ne.style.marginTop="2px",Ne.style.fontSize="11px",xe.appendChild(Ne),w.current=xe);const Ke=(de,fe)=>{if(!ve.element||!xe||!ke||!Ne)return;const Ee=yu(fe);if(!Ee)return;const Re=ve.element.getBoundingClientRect(),je=Ee.length>60?Ee.slice(0,57)+"...":Ee;ke.textContent=je,Ne.textContent=`${Oa()?"⌘":"Ctrl"}+click to open`,xe.style.left=`${de.clientX-Re.left+10}px`,xe.style.top=`${de.clientY-Re.top+10}px`,xe.style.display="block"},Ae=()=>{xe&&(xe.style.display="none")};let Pe=null,G=!1,Y=null;const Oe={activate:(de,fe)=>{if(!G&&(de.metaKey||de.ctrlKey)){const Ee=yu(fe);if(!Ee)return;window.open(Ee,"_blank","noopener")}},hover:(de,fe)=>{Pe=yu(fe)||null,Ke(de,fe)},leave:()=>{Pe=null,Ae()}},$e=de=>{Pe&&(de.metaKey||de.ctrlKey)&&(de.preventDefault(),de.stopPropagation(),G=!0,window.open(Pe,"_blank","noopener"),Y&&clearTimeout(Y),Y=setTimeout(()=>{G=!1},100))};se.addEventListener("mousedown",$e,!0),ve.options.linkHandler=Oe;const X=new JR((de,fe)=>Oe.activate(de,fe),{urlRegex:yD,hover:(de,fe)=>Oe.hover(de,fe),leave:()=>Oe.leave()});ve.loadAddon(X),g.current=X;let le=null,ge=null;const We=Oa()?"metaKey":"ctrlKey";ve.attachCustomKeyEventHandler(de=>{if((de.ctrlKey||de.metaKey)&&de.key.toLowerCase()==="c"&&ve.hasSelection()){const fe=ve.getSelection();return fe!=null&&fe.trim()&&navigator.clipboard&&navigator.clipboard.writeText(fe),!1}if(Oa()&&!y&&de.ctrlKey&&!de.metaKey&&de.key.toLowerCase()==="v"&&de.type==="keydown")return B.current&&(M.current&&(I.current({type:"tmux-cancel-copy-mode",sessionId:B.current}),J(!1)),I.current({type:"terminal-input",sessionId:B.current,data:xD})),!B.current;if(de[We]&&de.key.toLowerCase()==="v"&&de.type==="keydown"){ge!==null&&(clearTimeout(ge),ge=null),le=null;const fe=new Promise(Ee=>{ge=setTimeout(()=>{ge=null,le=null,Ee(null)},100),le=Re=>{ge!==null&&(clearTimeout(ge),ge=null),Ee(Re)}});return(async()=>{try{const Ee=B.current;if(!Ee)return;let Re=await fe;if(Re==null)try{Re=await navigator.clipboard.readText()}catch{Re=""}if(!Re&&Oa()&&!y)try{const je=await fetch("/api/clipboard-file-path");if(je.ok){const{path:Me}=await je.json();if(Me){I.current({type:"terminal-input",sessionId:Ee,data:Me});return}}}catch{}Re&&ve.paste(Re)}finally{le=null}})(),!1}if(de.ctrlKey&&de.key==="Backspace"&&de.type==="keydown"){const fe=B.current;return fe&&I.current({type:"terminal-input",sessionId:fe,data:""}),!1}return!0});const Z=de=>{var Re;if(!le)return;de.preventDefault(),de.stopPropagation();const fe=((Re=de.clipboardData)==null?void 0:Re.getData("text/plain"))??"",Ee=le;le=null,Ee(fe)};return se.addEventListener("paste",Z,{capture:!0}),ve.onData(de=>{const fe=B.current;if(fe){const Ee=/^\x1b\[(<[\d;]+[Mm]|[\d;]+M|M[\x20-\xff]{3})$/.test(de);if(M.current&&Ee)return;M.current&&(I.current({type:"tmux-cancel-copy-mode",sessionId:fe}),J(!1)),I.current({type:"terminal-input",sessionId:fe,data:de})}}),ve.attachCustomWheelEventHandler(de=>{const fe=B.current;if(!fe)return!0;const Ee=de.target;if(Ee!=null&&Ee.closest('input, textarea, [contenteditable="true"], .xterm-hover')||ve.hasSelection()||de.shiftKey)return!0;const Re=30;A.current+=de.deltaY;const je=ve.cols,Me=ve.rows,Ie=Math.floor(je/2),Ve=Math.floor(Me/2);let ot=!1,He=!1;for(;Math.abs(A.current)>=Re;){He=!0;const Te=A.current>0;A.current+=Te?-Re:Re;const De=Te?65:64;Te||(ot=!0),I.current({type:"terminal-input",sessionId:fe,data:`\x1B[<${De};${Ie};${Ve}M`})}return ot&&J(!0),He&&_e(),!1}),h.current=ve,m.current=ne,()=>{if(re=!0,Y&&clearTimeout(Y),Pe=null,se.removeEventListener("mousedown",$e,!0),se.removeEventListener("paste",Z,!0),ge!==null&&(clearTimeout(ge),ge=null),le=null,w.current&&(w.current.remove(),w.current=null),g.current){try{g.current.dispose()}catch{}g.current=null}if(d.current){try{d.current.dispose()}catch{}d.current=null}try{ve.dispose()}catch{}se&&(se.innerHTML=""),h.current=null,m.current=null,b.current=null,x.current=null,C.current=null,L.current&&window.clearTimeout(L.current),D.current!==null&&window.clearTimeout(D.current)}},[ue]),k.useEffect(()=>{h.current&&(h.current.options.theme=s)},[s]),k.useEffect(()=>{const se=h.current,re=m.current;if(se&&re){se.options.fontFamily=u,se.options.fontSize=o,se.options.lineHeight=Math.round(o*c)/o,se.options.letterSpacing=p,re.fit();const ae=B.current;ae&&I.current({type:"terminal-resize",sessionId:ae,cols:se.cols,rows:se.rows})}},[o,c,p,u]),k.useEffect(()=>{const se=h.current;if(!se)return;const re=P.current;if(P.current=f,re!==f){if(f){if(!d.current)try{const ae=new dv.WebglAddon;ae.onContextLoss(()=>{try{ae.dispose()}catch{}d.current=null}),se.loadAddon(ae),d.current=ae}catch{}}else if(d.current){try{d.current.dispose()}catch{}d.current=null}}},[f]),k.useEffect(()=>{const se=h.current;if(!se)return;const re=B.current,ae=H.current;if(!r){re&&(I.current({type:"terminal-detach",sessionId:re}),B.current=null,H.current=null,F.current=-1,M.current=!1),se.reset();return}if(n!=="connected"){re&&(Qe("terminal_detach_on_disconnect",{connectionStatus:n,prevAttached:re}),B.current=null,H.current=null,F.current=-1,M.current=!1);return}re&&re!==e&&(I.current({type:"terminal-detach",sessionId:re}),B.current=null,H.current=null,F.current=-1,M.current=!1);const ye=F.current,ve=i!==ye;if(e&&(e!==re||t!==ae||ve)){Qe("terminal_attach",{sessionId:e,tmuxTarget:t,prevAttached:re,prevTarget:ae,connectionStatus:n,connectionEpoch:i,attachedEpoch:ye});const ne=performance.now();se.reset();const ie=performance.now(),he=m.current;he&&he.fit();const oe=performance.now();I.current({type:"terminal-attach",sessionId:e,tmuxTarget:t??void 0,cols:se.cols,rows:se.rows}),B.current=e,H.current=t??null,F.current=i,I.current({type:"tmux-check-copy-mode",sessionId:e}),Qe("switch_attach_sent",{sessionId:e,resetMs:Math.round(ie-ne),fitMs:Math.round(oe-ie),totalMs:Math.round(performance.now()-ne),from:re??null}),$.current=ne,E.current&&window.clearTimeout(E.current),E.current=window.setTimeout(()=>{se.scrollToBottom(),te(),se.focus()},300)}e&&e===re&&t===ae&&!ve&&Qe("terminal_attach_skip",{sessionId:e,prevAttached:re,connectionStatus:n,connectionEpoch:i,attachedEpoch:ye}),!e&&re&&(B.current=null,H.current=null,F.current=-1)},[e,t,r,n,i,te]),k.useEffect(()=>{const se=()=>{j.current!==null&&(window.clearTimeout(j.current),j.current=null),U.current!==null&&(window.clearTimeout(U.current),U.current=null);const ye=h.current,ve=N.current;if(!ye||!ve)return;N.current="";const ne=performance.now(),ie=ve.length;ye.write(ve,()=>{const he=Math.round(performance.now()-ne);he>50&&Qe("switch_write_slow",{sessionId:B.current,writeMs:he,bytes:ie}),te()})},re=()=>{j.current!==null&&window.clearTimeout(j.current),j.current=window.setTimeout(se,V),U.current===null&&(U.current=window.setTimeout(se,ee))},ae=l(ye=>{const ve=B.current;if(ye.type==="terminal-output"&&ve&&ye.sessionId===ve){const ne=$.current;ne&&(Qe("switch_first_output",{sessionId:ye.sessionId,serverRoundtripMs:Math.round(performance.now()-ne),bytes:ye.data.length}),$.current=null),N.current+=y?LD(ye.data):ye.data,re()}if(ye.type==="terminal-ready"&&ve&&ye.sessionId===ve){const ne=$.current;ne&&(Qe("switch_ready",{sessionId:ye.sessionId,totalMs:Math.round(performance.now()-ne)}),$.current=null),y&&(se(),W(50))}ye.type==="tmux-copy-mode-status"&&ve&&ye.sessionId===ve&&J(ye.inCopyMode)});return()=>{ae(),se(),K()}},[l,te,J]),k.useEffect(()=>{const se=v.current,re=h.current,ae=m.current;if(!se||!re||!ae)return;const ye=()=>{S.current&&window.clearTimeout(S.current),S.current=window.setTimeout(()=>{ue()},150)},ve=new ResizeObserver(ye);return ve.observe(se),ye(),()=>{ve.disconnect(),S.current&&window.clearTimeout(S.current)}},[]),k.useEffect(()=>{if(!y)return;const se=()=>{document.visibilityState!=="hidden"&&W(200)},re=ye=>{ye.persisted&&W(200)},ae=()=>{W(200)};return document.addEventListener("visibilitychange",se),window.addEventListener("pageshow",re),window.addEventListener("focus",ae),()=>{document.removeEventListener("visibilitychange",se),window.removeEventListener("pageshow",re),window.removeEventListener("focus",ae),K()}},[]),{containerRef:v,terminalRef:h,searchAddonRef:b,serializeAddonRef:x,progressAddonRef:C,inTmuxCopyModeRef:M,setTmuxCopyMode:J}}function RD(e="(max-width: 767px)"){const[t,r]=k.useState(()=>typeof window>"u"||!window.matchMedia?!1:window.matchMedia(e).matches);return k.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const n=window.matchMedia(e),i=()=>r(n.matches);return i(),typeof n.addEventListener=="function"?(n.addEventListener("change",i),()=>n.removeEventListener("change",i)):(n.addListener(i),()=>n.removeListener(i))},[e]),t}function DD(e,t,r){k.useEffect(()=>{if(!t)return;const n=i=>{e.current&&!e.current.contains(i.target)&&r()};return document.addEventListener("mousedown",n),document.addEventListener("touchstart",n),()=>{document.removeEventListener("mousedown",n),document.removeEventListener("touchstart",n)}},[e,t,r])}function MD(e,t){k.useEffect(()=>{if(!e)return;const r=n=>{n.key==="Escape"&&(n.preventDefault(),t())};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[e,t])}function AD({enabled:e,isOpen:t,onOpen:r,edgeThresholdPx:n=30,swipeDistancePx:i=50,swipeRatio:a=1.5}){const l=k.useRef(!1);return k.useEffect(()=>{if(!e)return;let s=0,o=0,c=!1;const p=f=>{if(t)return;const _=f.touches[0];_.clientX<=n?(s=_.clientX,o=_.clientY,c=!0,l.current=!0):c=!1},u=f=>{if(l.current=!1,!c||t)return;const _=f.changedTouches[0],y=_.clientX-s,v=Math.abs(_.clientY-o);y>=i&&y>v*a&&r(),c=!1};return document.addEventListener("touchstart",p,{passive:!0}),document.addEventListener("touchend",u,{passive:!0}),()=>{l.current=!1,document.removeEventListener("touchstart",p),document.removeEventListener("touchend",u)}},[e,t,r,n,i,a]),l}const Gl=uf()(hf(e=>({theme:"dark",setTheme:t=>e({theme:t}),toggleTheme:()=>e(t=>({theme:t.theme==="dark"?"light":"dark"}))}),{name:"agentboard-theme",storage:mc(()=>df)})),PD={dark:{background:"#2d2d2d",foreground:"#d4d4d4",cursor:"#3b82f6",cursorAccent:"#2d2d2d",selectionBackground:"rgba(59, 130, 246, 0.35)",selectionForeground:"#ffffff",black:"#808080",red:"#f87171",green:"#4ade80",yellow:"#fbbf24",blue:"#60a5fa",magenta:"#c084fc",cyan:"#22d3ee",white:"#d4d4d4",brightBlack:"#a0a0a0",brightRed:"#fca5a5",brightGreen:"#86efac",brightYellow:"#fde047",brightBlue:"#93c5fd",brightMagenta:"#d8b4fe",brightCyan:"#67e8f9",brightWhite:"#ffffff"},light:{background:"#fafafa",foreground:"#171717",cursor:"#2563eb",cursorAccent:"#fafafa",selectionBackground:"rgba(37, 99, 235, 0.2)",selectionForeground:"#000000",black:"#171717",red:"#dc2626",green:"#16a34a",yellow:"#ca8a04",blue:"#2563eb",magenta:"#9333ea",cyan:"#0891b2",white:"#f5f5f5",brightBlack:"#737373",brightRed:"#ef4444",brightGreen:"#22c55e",brightYellow:"#eab308",brightBlue:"#3b82f6",brightMagenta:"#a855f7",brightCyan:"#06b6d4",brightWhite:"#ffffff"}},ID={up:"\x1B[A",down:"\x1B[B",left:"\x1B[D",right:"\x1B[C"},BD=150,OD=250,ND=400,Sv=1500,jD=15,Qi=70;function wu(e=10){"vibrate"in navigator&&navigator.vibrate(e)}function FD(e,t){const r=Math.sqrt(e*e+t*t);if(r<jD)return{direction:null,distance:0};const n=Math.atan2(t,e)*(180/Math.PI);let i;return n>=-45&&n<45?i="right":n>=45&&n<135?i="down":n>=-135&&n<-45?i="up":i="left",{direction:i,distance:r}}function $D(e){const t=Qi-20,r=Math.min(e/t,1);return Sv-r*(Sv-ND)}function HD({onSendKey:e,disabled:t=!1,onRefocus:r,isKeyboardVisible:n}){const[i,a]=k.useState(!1),[l,s]=k.useState(null),[o,c]=k.useState({x:0,y:0}),[p,u]=k.useState({x:0,y:0}),f=k.useRef(null),_=k.useRef(null),y=k.useRef(null),v=k.useRef(!1),h=k.useRef(null),m=k.useRef(0),d=k.useCallback(()=>{f.current&&(clearTimeout(f.current),f.current=null),_.current&&(clearTimeout(_.current),_.current=null),y.current&&(clearInterval(y.current),y.current=null)},[]),g=k.useCallback(()=>{_.current&&(clearTimeout(_.current),_.current=null),y.current&&(clearInterval(y.current),y.current=null)},[]),w=k.useCallback(D=>{const B=$D(m.current);y.current=setTimeout(()=>{h.current&&(wu(5),e(D),w(D))},B)},[e]),b=k.useCallback((D,B)=>{if(!D||t)return;const H=ID[D];m.current=B,wu(8),e(H),g(),_.current=setTimeout(()=>{w(H)},OD)},[t,e,g,w]),x=k.useCallback((D,B)=>{const H=D-o.x,F=B-o.y,$=Math.sqrt(H*H+F*F),I=Math.min($,Qi-20),R=$>0?I/$:0;u({x:H*R,y:F*R});const{direction:P,distance:N}=FD(H,F);m.current=N,P!==h.current&&(h.current=P,s(P),g(),P&&b(P,N))},[o,g,b]),C=k.useCallback(()=>{a(!1),s(null),u({x:0,y:0}),g(),h.current=null,v.current&&(r==null||r())},[g,r]),S=k.useCallback(D=>{if(t)return;D.preventDefault(),D.stopPropagation();const B=D.touches[0];v.current=(n==null?void 0:n())??!1,f.current=setTimeout(()=>{wu(15),c({x:B.clientX,y:B.clientY-80}),u({x:0,y:0}),a(!0)},BD)},[t,n]),E=k.useCallback(D=>{if(D.preventDefault(),D.stopPropagation(),!i)return;const B=D.touches[0];x(B.clientX,B.clientY)},[i,x]),L=k.useCallback(D=>{D.preventDefault(),D.stopPropagation(),f.current&&(clearTimeout(f.current),f.current=null),i&&C()},[i,C]),A=k.useCallback(D=>{D.preventDefault(),d(),C()},[d,C]);k.useEffect(()=>()=>{d()},[d]);const M=[{dir:"up",angle:-90,label:"↑"},{dir:"right",angle:0,label:"→"},{dir:"down",angle:90,label:"↓"},{dir:"left",angle:180,label:"←"}];return T.jsxs(T.Fragment,{children:[T.jsx("button",{type:"button","aria-label":"Arrow keys",className:`
187
+ `,ke=document.createElement("div"),xe.appendChild(ke),Ne=document.createElement("div"),Ne.style.color="var(--text-muted)",Ne.style.marginTop="2px",Ne.style.fontSize="11px",xe.appendChild(Ne),w.current=xe);const Ke=(de,fe)=>{if(!ve.element||!xe||!ke||!Ne)return;const Ee=yu(fe);if(!Ee)return;const Re=ve.element.getBoundingClientRect(),je=Ee.length>60?Ee.slice(0,57)+"...":Ee;ke.textContent=je,Ne.textContent=`${Oa()?"⌘":"Ctrl"}+click to open`,xe.style.left=`${de.clientX-Re.left+10}px`,xe.style.top=`${de.clientY-Re.top+10}px`,xe.style.display="block"},Ae=()=>{xe&&(xe.style.display="none")};let Pe=null,G=!1,Y=null;const Oe={activate:(de,fe)=>{if(!G&&(de.metaKey||de.ctrlKey)){const Ee=yu(fe);if(!Ee)return;window.open(Ee,"_blank","noopener")}},hover:(de,fe)=>{Pe=yu(fe)||null,Ke(de,fe)},leave:()=>{Pe=null,Ae()}},$e=de=>{Pe&&(de.metaKey||de.ctrlKey)&&(de.preventDefault(),de.stopPropagation(),G=!0,window.open(Pe,"_blank","noopener"),Y&&clearTimeout(Y),Y=setTimeout(()=>{G=!1},100))};se.addEventListener("mousedown",$e,!0),ve.options.linkHandler=Oe;const X=new JR((de,fe)=>Oe.activate(de,fe),{urlRegex:yD,hover:(de,fe)=>Oe.hover(de,fe),leave:()=>Oe.leave()});ve.loadAddon(X),g.current=X;let le=null,ge=null;const We=Oa()?"metaKey":"ctrlKey";ve.attachCustomKeyEventHandler(de=>{if((de.ctrlKey||de.metaKey)&&de.key.toLowerCase()==="c"&&ve.hasSelection()){const fe=ve.getSelection();return fe!=null&&fe.trim()&&navigator.clipboard&&navigator.clipboard.writeText(fe),!1}if(Oa()&&!y&&de.ctrlKey&&!de.metaKey&&de.key.toLowerCase()==="v"&&de.type==="keydown")return B.current&&(M.current&&(I.current({type:"tmux-cancel-copy-mode",sessionId:B.current}),J(!1)),I.current({type:"terminal-input",sessionId:B.current,data:xD})),!B.current;if(de[We]&&de.key.toLowerCase()==="v"&&de.type==="keydown"){ge!==null&&(clearTimeout(ge),ge=null),le=null;const fe=new Promise(Ee=>{ge=setTimeout(()=>{ge=null,le=null,Ee(null)},100),le=Re=>{ge!==null&&(clearTimeout(ge),ge=null),Ee(Re)}});return(async()=>{try{const Ee=B.current;if(!Ee)return;let Re=await fe;if(Re==null)try{Re=await navigator.clipboard.readText()}catch{Re=""}if(!Re&&Oa()&&!y)try{const je=await fetch("/api/clipboard-file-path");if(je.ok){const{path:Me}=await je.json();if(Me){I.current({type:"terminal-input",sessionId:Ee,data:Me});return}}}catch{}Re&&ve.paste(Re)}finally{le=null}})(),!1}if(de.ctrlKey&&de.key==="Backspace"&&de.type==="keydown"){const fe=B.current;return fe&&I.current({type:"terminal-input",sessionId:fe,data:""}),!1}return!0});const Z=de=>{var Re;if(!le)return;de.preventDefault(),de.stopPropagation();const fe=((Re=de.clipboardData)==null?void 0:Re.getData("text/plain"))??"",Ee=le;le=null,Ee(fe)};return se.addEventListener("paste",Z,{capture:!0}),ve.onData(de=>{const fe=B.current;if(fe){const Ee=/^\x1b\[(<[\d;]+[Mm]|[\d;]+M|M[\x20-\xff]{3})$/.test(de);if(M.current&&Ee)return;M.current&&(I.current({type:"tmux-cancel-copy-mode",sessionId:fe}),J(!1)),I.current({type:"terminal-input",sessionId:fe,data:de})}}),ve.attachCustomWheelEventHandler(de=>{const fe=B.current;if(!fe)return!0;const Ee=de.target;if(Ee!=null&&Ee.closest('input, textarea, [contenteditable="true"], .xterm-hover')||ve.hasSelection()||de.shiftKey)return!0;const Re=30;A.current+=de.deltaY;const je=ve.cols,Me=ve.rows,Ie=Math.floor(je/2),Ve=Math.floor(Me/2);let ot=!1,He=!1;for(;Math.abs(A.current)>=Re;){He=!0;const Te=A.current>0;A.current+=Te?-Re:Re;const De=Te?65:64;Te||(ot=!0),I.current({type:"terminal-input",sessionId:fe,data:`\x1B[<${De};${Ie};${Ve}M`})}return ot&&J(!0),He&&_e(),!1}),h.current=ve,m.current=ne,()=>{if(re=!0,Y&&clearTimeout(Y),Pe=null,se.removeEventListener("mousedown",$e,!0),se.removeEventListener("paste",Z,!0),ge!==null&&(clearTimeout(ge),ge=null),le=null,w.current&&(w.current.remove(),w.current=null),g.current){try{g.current.dispose()}catch{}g.current=null}if(d.current){try{d.current.dispose()}catch{}d.current=null}try{ve.dispose()}catch{}se&&(se.innerHTML=""),h.current=null,m.current=null,b.current=null,x.current=null,C.current=null,L.current&&window.clearTimeout(L.current),D.current!==null&&window.clearTimeout(D.current)}},[ue]),k.useEffect(()=>{h.current&&(h.current.options.theme=s)},[s]),k.useEffect(()=>{const se=h.current,re=m.current;if(se&&re){se.options.fontFamily=u,se.options.fontSize=o,se.options.lineHeight=Math.round(o*c)/o,se.options.letterSpacing=p,re.fit();const ae=B.current;ae&&I.current({type:"terminal-resize",sessionId:ae,cols:se.cols,rows:se.rows})}},[o,c,p,u]),k.useEffect(()=>{const se=h.current;if(!se)return;const re=P.current;if(P.current=f,re!==f){if(f){if(!d.current)try{const ae=new dv.WebglAddon;ae.onContextLoss(()=>{try{ae.dispose()}catch{}d.current=null}),se.loadAddon(ae),d.current=ae}catch{}}else if(d.current){try{d.current.dispose()}catch{}d.current=null}}},[f]),k.useEffect(()=>{const se=h.current;if(!se)return;const re=B.current,ae=H.current;if(!r){re&&(I.current({type:"terminal-detach",sessionId:re}),B.current=null,H.current=null,F.current=-1,M.current=!1),se.reset();return}if(n!=="connected"){re&&(Je("terminal_detach_on_disconnect",{connectionStatus:n,prevAttached:re}),B.current=null,H.current=null,F.current=-1,M.current=!1);return}re&&re!==e&&(I.current({type:"terminal-detach",sessionId:re}),B.current=null,H.current=null,F.current=-1,M.current=!1);const ye=F.current,ve=i!==ye;if(e&&(e!==re||t!==ae||ve)){Je("terminal_attach",{sessionId:e,tmuxTarget:t,prevAttached:re,prevTarget:ae,connectionStatus:n,connectionEpoch:i,attachedEpoch:ye});const ne=performance.now();se.reset();const ie=performance.now(),he=m.current;he&&he.fit();const oe=performance.now();I.current({type:"terminal-attach",sessionId:e,tmuxTarget:t??void 0,cols:se.cols,rows:se.rows}),B.current=e,H.current=t??null,F.current=i,I.current({type:"tmux-check-copy-mode",sessionId:e}),Je("switch_attach_sent",{sessionId:e,resetMs:Math.round(ie-ne),fitMs:Math.round(oe-ie),totalMs:Math.round(performance.now()-ne),from:re??null}),$.current=ne,E.current&&window.clearTimeout(E.current),E.current=window.setTimeout(()=>{se.scrollToBottom(),te(),se.focus()},300)}e&&e===re&&t===ae&&!ve&&Je("terminal_attach_skip",{sessionId:e,prevAttached:re,connectionStatus:n,connectionEpoch:i,attachedEpoch:ye}),!e&&re&&(B.current=null,H.current=null,F.current=-1)},[e,t,r,n,i,te]),k.useEffect(()=>{const se=()=>{j.current!==null&&(window.clearTimeout(j.current),j.current=null),U.current!==null&&(window.clearTimeout(U.current),U.current=null);const ye=h.current,ve=N.current;if(!ye||!ve)return;N.current="";const ne=performance.now(),ie=ve.length;ye.write(ve,()=>{const he=Math.round(performance.now()-ne);he>50&&Je("switch_write_slow",{sessionId:B.current,writeMs:he,bytes:ie}),te()})},re=()=>{j.current!==null&&window.clearTimeout(j.current),j.current=window.setTimeout(se,V),U.current===null&&(U.current=window.setTimeout(se,ee))},ae=l(ye=>{const ve=B.current;if(ye.type==="terminal-output"&&ve&&ye.sessionId===ve){const ne=$.current;ne&&(Je("switch_first_output",{sessionId:ye.sessionId,serverRoundtripMs:Math.round(performance.now()-ne),bytes:ye.data.length}),$.current=null),N.current+=y?LD(ye.data):ye.data,re()}if(ye.type==="terminal-ready"&&ve&&ye.sessionId===ve){const ne=$.current;ne&&(Je("switch_ready",{sessionId:ye.sessionId,totalMs:Math.round(performance.now()-ne)}),$.current=null),y&&(se(),W(50))}ye.type==="tmux-copy-mode-status"&&ve&&ye.sessionId===ve&&J(ye.inCopyMode)});return()=>{ae(),se(),K()}},[l,te,J]),k.useEffect(()=>{const se=v.current,re=h.current,ae=m.current;if(!se||!re||!ae)return;const ye=()=>{S.current&&window.clearTimeout(S.current),S.current=window.setTimeout(()=>{ue()},150)},ve=new ResizeObserver(ye);return ve.observe(se),ye(),()=>{ve.disconnect(),S.current&&window.clearTimeout(S.current)}},[]),k.useEffect(()=>{if(!y)return;const se=()=>{document.visibilityState!=="hidden"&&W(200)},re=ye=>{ye.persisted&&W(200)},ae=()=>{W(200)};return document.addEventListener("visibilitychange",se),window.addEventListener("pageshow",re),window.addEventListener("focus",ae),()=>{document.removeEventListener("visibilitychange",se),window.removeEventListener("pageshow",re),window.removeEventListener("focus",ae),K()}},[]),{containerRef:v,terminalRef:h,searchAddonRef:b,serializeAddonRef:x,progressAddonRef:C,inTmuxCopyModeRef:M,setTmuxCopyMode:J}}function RD(e="(max-width: 767px)"){const[t,r]=k.useState(()=>typeof window>"u"||!window.matchMedia?!1:window.matchMedia(e).matches);return k.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const n=window.matchMedia(e),i=()=>r(n.matches);return i(),typeof n.addEventListener=="function"?(n.addEventListener("change",i),()=>n.removeEventListener("change",i)):(n.addListener(i),()=>n.removeListener(i))},[e]),t}function DD(e,t,r){k.useEffect(()=>{if(!t)return;const n=i=>{e.current&&!e.current.contains(i.target)&&r()};return document.addEventListener("mousedown",n),document.addEventListener("touchstart",n),()=>{document.removeEventListener("mousedown",n),document.removeEventListener("touchstart",n)}},[e,t,r])}function MD(e,t){k.useEffect(()=>{if(!e)return;const r=n=>{n.key==="Escape"&&(n.preventDefault(),t())};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[e,t])}function AD({enabled:e,isOpen:t,onOpen:r,edgeThresholdPx:n=30,swipeDistancePx:i=50,swipeRatio:a=1.5}){const l=k.useRef(!1);return k.useEffect(()=>{if(!e)return;let s=0,o=0,c=!1;const p=f=>{if(t)return;const _=f.touches[0];_.clientX<=n?(s=_.clientX,o=_.clientY,c=!0,l.current=!0):c=!1},u=f=>{if(l.current=!1,!c||t)return;const _=f.changedTouches[0],y=_.clientX-s,v=Math.abs(_.clientY-o);y>=i&&y>v*a&&r(),c=!1};return document.addEventListener("touchstart",p,{passive:!0}),document.addEventListener("touchend",u,{passive:!0}),()=>{l.current=!1,document.removeEventListener("touchstart",p),document.removeEventListener("touchend",u)}},[e,t,r,n,i,a]),l}const Gl=uf()(hf(e=>({theme:"dark",setTheme:t=>e({theme:t}),toggleTheme:()=>e(t=>({theme:t.theme==="dark"?"light":"dark"}))}),{name:"agentboard-theme",storage:mc(()=>df)})),PD={dark:{background:"#2d2d2d",foreground:"#d4d4d4",cursor:"#3b82f6",cursorAccent:"#2d2d2d",selectionBackground:"rgba(59, 130, 246, 0.35)",selectionForeground:"#ffffff",black:"#808080",red:"#f87171",green:"#4ade80",yellow:"#fbbf24",blue:"#60a5fa",magenta:"#c084fc",cyan:"#22d3ee",white:"#d4d4d4",brightBlack:"#a0a0a0",brightRed:"#fca5a5",brightGreen:"#86efac",brightYellow:"#fde047",brightBlue:"#93c5fd",brightMagenta:"#d8b4fe",brightCyan:"#67e8f9",brightWhite:"#ffffff"},light:{background:"#fafafa",foreground:"#171717",cursor:"#2563eb",cursorAccent:"#fafafa",selectionBackground:"rgba(37, 99, 235, 0.2)",selectionForeground:"#000000",black:"#171717",red:"#dc2626",green:"#16a34a",yellow:"#ca8a04",blue:"#2563eb",magenta:"#9333ea",cyan:"#0891b2",white:"#f5f5f5",brightBlack:"#737373",brightRed:"#ef4444",brightGreen:"#22c55e",brightYellow:"#eab308",brightBlue:"#3b82f6",brightMagenta:"#a855f7",brightCyan:"#06b6d4",brightWhite:"#ffffff"}},ID={up:"\x1B[A",down:"\x1B[B",left:"\x1B[D",right:"\x1B[C"},BD=150,OD=250,ND=400,Sv=1500,jD=15,Qi=70;function wu(e=10){"vibrate"in navigator&&navigator.vibrate(e)}function FD(e,t){const r=Math.sqrt(e*e+t*t);if(r<jD)return{direction:null,distance:0};const n=Math.atan2(t,e)*(180/Math.PI);let i;return n>=-45&&n<45?i="right":n>=45&&n<135?i="down":n>=-135&&n<-45?i="up":i="left",{direction:i,distance:r}}function $D(e){const t=Qi-20,r=Math.min(e/t,1);return Sv-r*(Sv-ND)}function HD({onSendKey:e,disabled:t=!1,onRefocus:r,isKeyboardVisible:n}){const[i,a]=k.useState(!1),[l,s]=k.useState(null),[o,c]=k.useState({x:0,y:0}),[p,u]=k.useState({x:0,y:0}),f=k.useRef(null),_=k.useRef(null),y=k.useRef(null),v=k.useRef(!1),h=k.useRef(null),m=k.useRef(0),d=k.useCallback(()=>{f.current&&(clearTimeout(f.current),f.current=null),_.current&&(clearTimeout(_.current),_.current=null),y.current&&(clearInterval(y.current),y.current=null)},[]),g=k.useCallback(()=>{_.current&&(clearTimeout(_.current),_.current=null),y.current&&(clearInterval(y.current),y.current=null)},[]),w=k.useCallback(D=>{const B=$D(m.current);y.current=setTimeout(()=>{h.current&&(wu(5),e(D),w(D))},B)},[e]),b=k.useCallback((D,B)=>{if(!D||t)return;const H=ID[D];m.current=B,wu(8),e(H),g(),_.current=setTimeout(()=>{w(H)},OD)},[t,e,g,w]),x=k.useCallback((D,B)=>{const H=D-o.x,F=B-o.y,$=Math.sqrt(H*H+F*F),I=Math.min($,Qi-20),R=$>0?I/$:0;u({x:H*R,y:F*R});const{direction:P,distance:N}=FD(H,F);m.current=N,P!==h.current&&(h.current=P,s(P),g(),P&&b(P,N))},[o,g,b]),C=k.useCallback(()=>{a(!1),s(null),u({x:0,y:0}),g(),h.current=null,v.current&&(r==null||r())},[g,r]),S=k.useCallback(D=>{if(t)return;D.preventDefault(),D.stopPropagation();const B=D.touches[0];v.current=(n==null?void 0:n())??!1,f.current=setTimeout(()=>{wu(15),c({x:B.clientX,y:B.clientY-80}),u({x:0,y:0}),a(!0)},BD)},[t,n]),E=k.useCallback(D=>{if(D.preventDefault(),D.stopPropagation(),!i)return;const B=D.touches[0];x(B.clientX,B.clientY)},[i,x]),L=k.useCallback(D=>{D.preventDefault(),D.stopPropagation(),f.current&&(clearTimeout(f.current),f.current=null),i&&C()},[i,C]),A=k.useCallback(D=>{D.preventDefault(),d(),C()},[d,C]);k.useEffect(()=>()=>{d()},[d]);const M=[{dir:"up",angle:-90,label:"↑"},{dir:"right",angle:0,label:"→"},{dir:"down",angle:90,label:"↓"},{dir:"left",angle:180,label:"←"}];return T.jsxs(T.Fragment,{children:[T.jsx("button",{type:"button","aria-label":"Arrow keys",className:`
188
188
  terminal-key
189
189
  flex items-center justify-center
190
190
  h-11 min-w-[2.75rem] px-2.5
@@ -291,7 +291,7 @@ void main() {
291
291
  select-none touch-manipulation
292
292
  text-secondary
293
293
  ${t?"opacity-50":""}
294
- `,onMouseDown:F=>F.preventDefault(),onTouchStart:B(M),onClick:H(M),disabled:t,children:qD})]}),c&&T.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:T.jsxs("div",{ref:d,className:"mx-4 w-full max-w-sm rounded-lg border border-border bg-elevated p-4 shadow-xl",children:[T.jsx("h3",{className:"text-base font-medium text-primary mb-1 text-balance",children:"Paste"}),T.jsx("p",{className:"text-xs text-muted mb-3 text-pretty",children:"Text or image (long-press → Paste)"}),_?T.jsx("div",{className:"w-full h-11 flex items-center justify-center bg-surface border border-border rounded-md text-secondary",children:"Uploading image..."}):T.jsx("input",{ref:m,type:"text",value:u,onChange:F=>f(F.target.value),onKeyDown:F=>{F.key==="Enter"?(F.preventDefault(),E()):F.key==="Escape"&&(F.preventDefault(),L())},placeholder:"Paste here...",className:"w-full h-11 px-3 text-[16px] bg-surface border border-border rounded-md text-primary placeholder:text-muted outline-none focus:border-accent",style:{fontSize:"16px"}}),T.jsxs("div",{className:"flex justify-end gap-2 mt-4",children:[T.jsx("button",{type:"button",onClick:L,className:"px-4 py-2 text-sm font-medium text-secondary bg-surface border border-border rounded-md active:scale-95 transition-transform",children:"Cancel"}),T.jsx("button",{type:"button",onClick:E,disabled:_,className:"px-4 py-2 text-sm font-medium bg-accent text-white rounded-md active:scale-95 transition-transform disabled:opacity-50",children:"Send"})]})]})})]})}function ZD({isOpen:e,onClose:t,sessions:r,inactiveSessions:n=[],selectedSessionId:i,onSelect:a,onRename:l,onResume:s,onSetPinned:o,onNewSession:c,loading:p,error:u}){const f=$1(),_=k.useRef(null),y=k.useRef(null);k.useEffect(()=>{if(!e)return;const m=d=>{d.key==="Escape"&&(d.preventDefault(),t())};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[e,t]),k.useEffect(()=>{var m;e?(y.current=document.activeElement,(m=_.current)==null||m.focus()):y.current&&(y.current.focus(),y.current=null)},[e]),k.useEffect(()=>{if(!e)return;const m=_.current;if(!m)return;const d=50,g=1.5;let w=0,b=0;const x=S=>{const E=S.touches[0];w=E.clientX,b=E.clientY},C=S=>{const E=S.changedTouches[0],L=w-E.clientX,A=Math.abs(E.clientY-b);L>=d&&L>A*g&&("vibrate"in navigator&&navigator.vibrate(10),t())};return m.addEventListener("touchstart",x,{passive:!0}),m.addEventListener("touchend",C,{passive:!0}),()=>{m.removeEventListener("touchstart",x),m.removeEventListener("touchend",C)}},[e,t]);const v=m=>{a(m),t()},h=f?{transition:"none"}:void 0;return T.jsxs(T.Fragment,{children:[T.jsx("div",{className:`session-drawer-backdrop ${e?"open":""}`,style:h,onClick:t,"aria-hidden":"true"}),T.jsxs("div",{ref:_,className:`session-drawer ${e?"open":""}`,style:h,role:"dialog","aria-modal":"true","aria-label":"Session list",tabIndex:-1,children:[T.jsx(hw,{sessions:r,inactiveSessions:n,selectedSessionId:i,onSelect:v,onRename:l,onResume:s,onSetPinned:o,loading:p,error:u}),T.jsx("div",{className:"shrink-0 border-t border-border px-2 pt-2",style:{paddingBottom:"max(0.5rem, env(safe-area-inset-bottom, 0.5rem))"},children:T.jsx("button",{onClick:()=>{c(),t()},className:"btn btn-primary w-full py-2 text-sm",children:"New Session"})})]})]})}const eM={working:"Working",waiting:"Waiting",permission:"Needs Input",unknown:"Unknown"},tM={working:"text-working",waiting:"text-waiting",permission:"text-approval",unknown:"text-muted"},rM={working:"bg-green-500/35 text-white",waiting:"bg-blue-500/35 text-white",permission:"bg-amber-500/35 text-white",unknown:"bg-gray-500/35 text-white"},nM={working:"bg-working text-white",waiting:"bg-waiting text-white",permission:"bg-approval text-white",unknown:"bg-muted text-white"};function xv(){"vibrate"in navigator&&navigator.vibrate(10)}function sM({session:e,sessions:t,inactiveSessions:r=[],connectionStatus:n,connectionEpoch:i=0,sendMessage:a,subscribe:l,onClose:s,onSelectSession:o,onNewSession:c,onKillSession:p,onRenameSession:u,onResumeSession:f,onSetPinned:_,onOpenSettings:y,loading:v=!1,error:h=null}){const m=Gl(Z=>Z.theme),d=PD[m],g=pe(Z=>Z.useWebGL),w=pe(Z=>Z.fontSize),b=pe(Z=>Z.lineHeight),x=pe(Z=>Z.letterSpacing),C=pe(Z=>Z.fontOption),S=pe(Z=>Z.customFontFamily),E=iC(C,S),L=pe(Z=>Z.shortcutModifier),A=ii(Zo(L)),M=Qo(),D=RD(),[B,H]=k.useState(!1),[F,$]=k.useState(!1),[I,R]=k.useState(!1),[P,N]=k.useState(!1),[j,U]=k.useState(!1),[V,ee]=k.useState(!1),[Q,z]=k.useState(""),O=k.useRef(!1),K=k.useRef(null),W=k.useRef(null),te=k.useRef(null),J=k.useRef(null),_e=(e==null?void 0:e.remote)===!0,ue=Ge(Z=>Z.remoteAllowControl),se=Ge(Z=>Z.remoteAllowAttach),re=_e&&!se,ae=!_e||ue&&(e==null?void 0:e.source)==="managed",{containerRef:ye,terminalRef:ve,inTmuxCopyModeRef:ne,setTmuxCopyMode:ie}=TD({sessionId:(e==null?void 0:e.id)??null,tmuxTarget:(e==null?void 0:e.tmuxWindow)??null,allowAttach:!re,connectionStatus:n,connectionEpoch:i,sendMessage:a,subscribe:l,theme:d,fontSize:w,lineHeight:b,letterSpacing:x,fontFamily:E,useWebGL:g,onScrollChange:Z=>{H(!Z)}}),he=k.useCallback(()=>{var Z;!e||re||(a({type:"tmux-cancel-copy-mode",sessionId:e.id}),ie(!1),(Z=ve.current)==null||Z.scrollToBottom())},[e,re,a,ie,ve]),oe=k.useCallback(()=>{U(!0),xv()},[]),me=AD({enabled:D||M,isOpen:j,onOpen:oe});k.useEffect(()=>{!D&&!M&&j&&U(!1)},[j,D,M]);const xe=k.useCallback(()=>N(!1),[]);DD(W,P,xe),k.useEffect(()=>{V&&te.current&&(te.current.focus(),te.current.select())},[V]),k.useEffect(()=>{I&&J.current&&J.current.focus()},[I]);const ke=k.useCallback(()=>R(!1),[]);MD(I,ke);const Ne=()=>{e&&(p(e.id),R(!1))},Ke=()=>{e&&(z(e.agentSessionName||e.name),ee(!0),N(!1))},Ae=()=>{if(!e)return;const Z=Q.trim(),Le=e.agentSessionName||e.name;Z&&Z!==Le&&u(e.id,Z),ee(!1)},Pe=Z=>{Z.key==="Enter"?(Z.preventDefault(),Ae()):Z.key==="Escape"&&(Z.preventDefault(),ee(!1))};k.useEffect(()=>{if(!M||!e){$(!1);return}const Z=ye.current;if(!Z)return;const Le=Te=>{const De=Z.querySelector(".xterm-accessibility-tree");if(!De)return!1;const ze=Te.anchorNode,Xe=Te.focusNode;return!!ze&&De.contains(ze)||!!Xe&&De.contains(Xe)},de=()=>{const Te=Z.querySelector(".xterm-accessibility"),De=Z.querySelector(".xterm-accessibility-tree");!Te||!De||(Te.style.setProperty("opacity","0"),De.style.setProperty("opacity","0"),Te.style.setProperty("-webkit-user-select","none"),Te.style.setProperty("user-select","none"),De.style.setProperty("-webkit-user-select","none"),De.style.setProperty("user-select","none"),Te.offsetHeight,requestAnimationFrame(()=>{Te.style.removeProperty("opacity"),De.style.removeProperty("opacity"),Te.style.removeProperty("-webkit-user-select"),Te.style.removeProperty("user-select"),De.style.removeProperty("-webkit-user-select"),De.style.removeProperty("user-select")}))},fe=()=>{var De;O.current=!1;const Te=window.getSelection();try{Te==null||Te.removeAllRanges()}catch{}(De=ve.current)==null||De.clearSelection(),de(),$(!1)};K.current=fe;const Ee=()=>{const Te=window.getSelection();if(!Te||Te.rangeCount===0||Te.isCollapsed){O.current?fe():$(Xe=>Xe&&!1);return}const De=Le(Te);if(!De&&O.current){fe();return}O.current=De;const ze=De;$(Xe=>Xe!==ze?ze:Xe)},Re=()=>{const Te=window.getSelection();!Te||Te.isCollapsed||Le(Te)&&setTimeout(fe,0)},je=10;let Me=null,Ie=!1;const Ve=Te=>{if(Te.touches.length===1){const De=Te.touches[0];Me={x:De.clientX,y:De.clientY},Ie=!1}},ot=Te=>{if(Ie||!Me||Te.touches.length!==1)return;const De=Te.touches[0],ze=Math.abs(De.clientX-Me.x),Xe=Math.abs(De.clientY-Me.y);(ze>je||Xe>je)&&(Ie=!0)},He=Te=>{const De=Ie;Me=null,Ie=!1;const ze=window.getSelection();if(!ze||ze.rangeCount===0||ze.isCollapsed){$(!1);return}const Xe=Z.querySelector(".xterm-accessibility-tree");if(!Xe)return;if(!Le(ze)){$(!1);return}if(De)return;const Ht=Te.target,_t=Ht?Xe.contains(Ht):!1;let zt=!1;if(_t&&Ht)try{zt=ze.containsNode(Ht,!0)}catch{zt=!1}(!_t||!zt)&&setTimeout(fe,0)};return document.addEventListener("selectionchange",Ee),document.addEventListener("copy",Re),document.addEventListener("touchstart",Ve,{passive:!0}),document.addEventListener("touchmove",ot,{passive:!0}),document.addEventListener("touchend",He,{passive:!0}),()=>{document.removeEventListener("selectionchange",Ee),document.removeEventListener("copy",Re),document.removeEventListener("touchstart",Ve),document.removeEventListener("touchmove",ot),document.removeEventListener("touchend",He),K.current=null,O.current=!1}},[ye,M,e==null?void 0:e.id]),k.useEffect(()=>{var Me;if(!M)return;const Z=ye.current;if(!Z)return;const Le=()=>{const Ie=ve.current,Ve=Z.querySelector(".xterm");if(!Ie||!Ve)return;const ot=Ve.querySelector(".xterm-screen"),He=Ve.querySelector(".xterm-accessibility"),Te=Ve.querySelector(".xterm-accessibility-tree");if(!ot||!He||!Te)return;const De=Ve.getBoundingClientRect(),ze=ot.getBoundingClientRect(),Xe=ze.left-De.left,Ht=ze.top-De.top;Object.assign(He.style,{left:`${Xe}px`,top:`${Ht}px`,right:"auto",bottom:"auto",width:`${ze.width}px`,height:`${ze.height}px`});const _t=ze.width/Ie.cols,zt=ze.height/Ie.rows,It=document.createElement("span");It.textContent="0".repeat(200),It.style.cssText="position:absolute;visibility:hidden;white-space:pre;pointer-events:none;letter-spacing:0px",Te.appendChild(It);const wn=It.getBoundingClientRect().width/200;It.remove();const Ts=Math.max(-2,Math.min(2,_t-wn));Z.style.setProperty("--xterm-font-size",`${Ie.options.fontSize}px`),Z.style.setProperty("--xterm-cell-height",`${zt}px`),Z.style.setProperty("--xterm-a11y-letter-spacing",`${Ts}px`)},de=performance.now();Le();const fe=Math.round(performance.now()-de);fe>10&&Qe("switch_a11y_overlay",{sessionId:e==null?void 0:e.id,a11yMs:fe});const Ee=window.requestAnimationFrame(Le),Re=window.setTimeout(Le,100),je=()=>window.requestAnimationFrame(Le);return(Me=window.visualViewport)==null||Me.addEventListener("resize",je),window.addEventListener("orientationchange",je),()=>{var Ie;window.cancelAnimationFrame(Ee),window.clearTimeout(Re),(Ie=window.visualViewport)==null||Ie.removeEventListener("resize",je),window.removeEventListener("orientationchange",je)}},[ye,w,M,e==null?void 0:e.id,ve]);const G=k.useRef(F);k.useEffect(()=>{G.current=F},[F]);const Y=k.useRef(e==null?void 0:e.id);k.useEffect(()=>{Y.current=e==null?void 0:e.id},[e==null?void 0:e.id]);const Oe=k.useRef(a);k.useEffect(()=>{Oe.current=a},[a]);const $e=k.useRef(!1);k.useEffect(()=>{const Z=ye.current;if(!Z||!(e!=null&&e.id)||!D&&!M)return;const Le=6,de=350;let fe={x:0,y:0},Ee=0,Re=!1,je=null,Me=0,Ie=0,Ve=0,ot=Math.round(w*b),He=null;const Te=()=>{const Et=window.getComputedStyle(Z).getPropertyValue("--xterm-cell-height").trim(),kt=Number.parseFloat(Et);return!Number.isNaN(kt)&&kt>0?kt:Math.round(w*b)},De=()=>Z.querySelector(".xterm-helper-textarea"),ze=()=>{const Be=De();Be&&document.activeElement!==Be&&(Be.disabled=!0)},Xe=()=>{const Be=De();Be&&(Be.disabled=!1)};ze();const Ht=()=>{if(ne.current)return;const Be=De();Be&&(Be.disabled=!1,Be.focus())},_t=()=>{He!==null&&(cancelAnimationFrame(He),He=null),Ie=0},zt=Be=>{const Et=Y.current;if(!Et||Be===0)return!1;const kt=ve.current,Zr=(kt==null?void 0:kt.cols)??80,Ds=(kt==null?void 0:kt.rows)??24,Ms=Math.floor(Zr/2),Jn=Math.floor(Ds/2),Qn=Be>0?65:64,Zn=Math.abs(Be),Sn=Be<0;for(let en=0;en<Zn;en++)Oe.current({type:"terminal-input",sessionId:Et,data:`\x1B[<${Qn};${Ms};${Jn}M`});return Sn&&ie(!0),Sn},It=()=>{je=null,Ie=0,Ve=0},wn=()=>{if(!M)return!1;const Be=window.getSelection();if(!Be||Be.isCollapsed)return!1;const Et=Z.querySelector(".xterm-accessibility-tree");if(!Et)return!1;const kt=Be.anchorNode,Zr=Be.focusNode;return!!kt&&Et.contains(kt)||!!Zr&&Et.contains(Zr)},Ts=()=>{var Be;!M||!O.current||wn()||(Be=K.current)==null||Be.call(K)},la=Be=>{if(_t(),Ts(),me.current||j){It();return}if(G.current){It();return}if(Be.touches.length===1){const Et=Be.touches[0];fe={x:Et.clientX,y:Et.clientY},Ee=performance.now(),Re=!1,je=Et.clientY,Me=Ee,Ie=0,Ve=0,ot=Te(),Xe()}},q=Be=>{if(Be.touches.length!==1||je===null)return;if(Ts(),me.current||j){It();return}if(G.current||wn()){It();return}Be.preventDefault(),Be.stopPropagation();const Et=performance.now(),kt=Be.touches[0],Zr=kt.clientX,Ds=kt.clientY,Ms=Math.abs(Zr-fe.x),Jn=Math.abs(Ds-fe.y);!Re&&(Ms>Le||Jn>Le)&&(Re=!0,ze());const Qn=je-Ds,Zn=Et-Me;if(je=Ds,Me=Et,Zn>0){const Ec=Qn/Zn;Ie=Ie*.7+Ec*.3}Ve+=Qn;const Sn=Math.max(6,ot*.6),en=Math.trunc(Ve/Sn);en!==0&&(zt(en),Ve-=en*Sn)},et=Be=>{var Ms;const Et=Ie,kt=performance.now()-Ee;if(It(),me.current||j)return;const Zr=wn();if(G.current&&!Zr&&((Ms=K.current)==null||Ms.call(K)),G.current||Zr){ne.current&&($e.current=!0);return}if(!Re){if(M&&kt>=de)return;if(ne.current){Be.preventDefault(),Be.stopPropagation(),$e.current=!0;return}Ht();return}if(Math.abs(Et)>.12){let Jn=Et,Qn=performance.now();const Zn=()=>{const Sn=performance.now(),en=Sn-Qn;Qn=Sn;const Ec=Jn*en;Ve+=Ec;const Cp=Math.max(6,ot*.6),kc=Math.trunc(Ve/Cp);kc!==0&&(zt(kc),Ve-=kc*Cp),Jn*=Math.pow(.95,en/16.67),Math.abs(Jn)>.02?He=requestAnimationFrame(Zn):He=null};He=requestAnimationFrame(Zn)}},Jr=Be=>{$e.current&&(Be.preventDefault(),Be.stopPropagation(),$e.current=!1)},Qr={passive:!0,capture:!0},Rs={passive:!1,capture:!0},xp={passive:!1,capture:!0},bp={capture:!0};return Z.addEventListener("touchstart",la,Qr),Z.addEventListener("touchmove",q,Rs),Z.addEventListener("touchend",et,xp),Z.addEventListener("mousedown",Jr,bp),()=>{Z.removeEventListener("touchstart",la,Qr),Z.removeEventListener("touchmove",q,Rs),Z.removeEventListener("touchend",et,xp),Z.removeEventListener("mousedown",Jr,bp);const Be=De();Be&&(Be.disabled=!1)}},[e==null?void 0:e.id,ye,ve,M,D,j,w,b]);const X=k.useCallback(Z=>{!e||re||a({type:"terminal-input",sessionId:e.id,data:Z})},[e,re,a]),le=k.useCallback(()=>{const Z=ye.current;if(!Z)return;const Le=Z.querySelector(".xterm-helper-textarea");Le&&(Le.removeAttribute("disabled"),Le.focus())},[ye]),ge=k.useCallback(()=>{if(!e||re)return;ne.current&&(a({type:"tmux-cancel-copy-mode",sessionId:e.id}),ie(!1));const Z=ye.current;if(!Z)return;const Le=Z.querySelector(".xterm-helper-textarea");Le&&(Le.removeAttribute("disabled"),Le.focus())},[e,re,a,ye,ne,ie]),We=k.useCallback(()=>{var Re,je;if(typeof document>"u")return!1;const Z=ye.current;if(!Z)return!1;const Le=Z.querySelector(".xterm-helper-textarea");if(Le&&document.activeElement===Le)return!0;const de=document.activeElement,fe=typeof HTMLInputElement<"u"&&de instanceof HTMLInputElement,Ee=typeof HTMLTextAreaElement<"u"&&de instanceof HTMLTextAreaElement;return fe||Ee||de&&de.isContentEditable?!1:!!((je=(Re=document.documentElement)==null?void 0:Re.classList)!=null&&je.contains("keyboard-visible"))},[ye]);return k.useEffect(()=>{if(!M)return;const Z=ye.current;if(!Z)return;const Le=Z.querySelector(".xterm-accessibility"),de=Z.querySelector(".xterm-accessibility-tree");if(!Le||!de)return;const fe=()=>{const Ee=Z.querySelector(".xterm-helper-textarea");(Ee?document.activeElement===Ee:!1)&&!G.current?(Le.style.pointerEvents="none",de.style.pointerEvents="none"):(Le.style.removeProperty("pointer-events"),de.style.removeProperty("pointer-events"))};return fe(),document.addEventListener("focusin",fe),document.addEventListener("focusout",fe),()=>{document.removeEventListener("focusin",fe),document.removeEventListener("focusout",fe)}},[ye,M,F]),T.jsxs("section",{className:`flex flex-1 flex-col bg-base terminal-mobile-overlay md:relative md:inset-auto ${M?"ios-native-term-selection":""}`,"data-testid":"terminal-panel",children:[T.jsxs("div",{className:`flex h-10 shrink-0 items-center justify-between border-b border-border bg-elevated px-3 ${e?"":"md:hidden"}`,children:[T.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[T.jsx("button",{onClick:()=>U(!0),className:"flex h-7 w-7 items-center justify-center rounded bg-surface border border-border text-secondary hover:bg-hover hover:text-primary active:scale-95 transition-all md:hidden shrink-0","aria-label":"Open session menu",children:T.jsx(EC,{width:16,height:16})}),e&&ae&&T.jsx("button",{onClick:()=>R(!0),className:"hidden md:flex h-7 w-7 items-center justify-center rounded bg-danger/10 border border-danger/30 text-danger hover:bg-danger/20 active:scale-95 transition-all shrink-0",title:`Kill session (${A}X)`,"aria-label":"Kill session",children:T.jsx(Th,{width:16,height:16})}),e?T.jsxs("div",{className:"flex items-baseline gap-3 min-w-0",children:[V?T.jsx("input",{ref:te,type:"text",value:Q,onChange:Z=>z(Z.target.value),onBlur:Ae,onKeyDown:Pe,className:"w-full max-w-[200px] rounded border border-border bg-surface px-2 py-0.5 text-sm font-medium text-primary outline-none focus:border-accent"}):T.jsx("span",{className:"text-sm font-medium text-primary truncate",children:e.agentSessionName||e.name}),T.jsx("span",{className:`text-xs shrink-0 ${tM[e.status]}`,children:eM[e.status]})]}):T.jsx("span",{className:"text-sm font-medium text-primary md:hidden",children:"Sessions"})]}),T.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[n!=="connected"&&T.jsx("span",{className:"text-xs text-approval",children:n}),T.jsx("button",{onClick:c,className:"flex h-7 w-7 items-center justify-center rounded bg-accent text-white hover:bg-accent/90 active:scale-95 transition-all md:hidden",title:`New session (${A}N)`,"aria-label":"New session",children:T.jsx(iy,{width:16,height:16})}),e&&ae&&T.jsx("button",{onClick:()=>R(!0),className:"flex md:hidden h-7 w-7 items-center justify-center rounded bg-danger/10 border border-danger/30 text-danger hover:bg-danger/20 active:scale-95 transition-all",title:`Kill session (${A}X)`,"aria-label":"Kill session",children:T.jsx(Th,{width:16,height:16})}),e&&T.jsxs("div",{className:"relative md:hidden",ref:W,children:[T.jsx("button",{onClick:()=>N(!P),className:"flex h-7 w-7 items-center justify-center rounded bg-surface border border-border text-secondary hover:bg-hover hover:text-primary active:scale-95 transition-all",title:"More options","aria-label":"More options",children:T.jsx(vC,{width:16,height:16})}),P&&T.jsxs("div",{className:"absolute right-0 top-full mt-1 z-20 min-w-[140px] rounded-md border border-border bg-elevated shadow-lg py-1",children:[ae&&T.jsxs("button",{onClick:Ke,className:"w-full px-3 py-2 text-left text-sm text-secondary hover:bg-hover hover:text-primary flex items-center gap-2",children:[T.jsx(ny,{width:14,height:14}),"Rename"]}),T.jsxs("button",{onClick:()=>{y(),N(!1)},className:"w-full px-3 py-2 text-left text-sm text-secondary hover:bg-hover hover:text-primary flex items-center gap-2",children:[T.jsx(MC,{width:14,height:14}),"Settings"]})]})]})]})]}),e&&t.length>1&&T.jsxs("div",{className:"relative overflow-hidden bg-elevated border-b border-border md:hidden",children:[T.jsx("div",{className:"absolute right-0 top-0 bottom-0 w-4 bg-gradient-to-l from-elevated to-transparent z-10 pointer-events-none"}),T.jsx("div",{className:"flex items-center gap-1.5 pl-5 pr-3 py-1.5 overflow-x-auto scrollbar-none scroll-smooth snap-x snap-mandatory",style:{WebkitOverflowScrolling:"touch"},children:t.map((Z,Le)=>{const de=Z.id===e.id;return T.jsx("button",{type:"button",className:`
294
+ `,onMouseDown:F=>F.preventDefault(),onTouchStart:B(M),onClick:H(M),disabled:t,children:qD})]}),c&&T.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:T.jsxs("div",{ref:d,className:"mx-4 w-full max-w-sm rounded-lg border border-border bg-elevated p-4 shadow-xl",children:[T.jsx("h3",{className:"text-base font-medium text-primary mb-1 text-balance",children:"Paste"}),T.jsx("p",{className:"text-xs text-muted mb-3 text-pretty",children:"Text or image (long-press → Paste)"}),_?T.jsx("div",{className:"w-full h-11 flex items-center justify-center bg-surface border border-border rounded-md text-secondary",children:"Uploading image..."}):T.jsx("input",{ref:m,type:"text",value:u,onChange:F=>f(F.target.value),onKeyDown:F=>{F.key==="Enter"?(F.preventDefault(),E()):F.key==="Escape"&&(F.preventDefault(),L())},placeholder:"Paste here...",className:"w-full h-11 px-3 text-[16px] bg-surface border border-border rounded-md text-primary placeholder:text-muted outline-none focus:border-accent",style:{fontSize:"16px"}}),T.jsxs("div",{className:"flex justify-end gap-2 mt-4",children:[T.jsx("button",{type:"button",onClick:L,className:"px-4 py-2 text-sm font-medium text-secondary bg-surface border border-border rounded-md active:scale-95 transition-transform",children:"Cancel"}),T.jsx("button",{type:"button",onClick:E,disabled:_,className:"px-4 py-2 text-sm font-medium bg-accent text-white rounded-md active:scale-95 transition-transform disabled:opacity-50",children:"Send"})]})]})})]})}function ZD({isOpen:e,onClose:t,sessions:r,inactiveSessions:n=[],selectedSessionId:i,onSelect:a,onRename:l,onResume:s,onSetPinned:o,onNewSession:c,loading:p,error:u}){const f=$1(),_=k.useRef(null),y=k.useRef(null);k.useEffect(()=>{if(!e)return;const m=d=>{d.key==="Escape"&&(d.preventDefault(),t())};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[e,t]),k.useEffect(()=>{var m;e?(y.current=document.activeElement,(m=_.current)==null||m.focus()):y.current&&(y.current.focus(),y.current=null)},[e]),k.useEffect(()=>{if(!e)return;const m=_.current;if(!m)return;const d=50,g=1.5;let w=0,b=0;const x=S=>{const E=S.touches[0];w=E.clientX,b=E.clientY},C=S=>{const E=S.changedTouches[0],L=w-E.clientX,A=Math.abs(E.clientY-b);L>=d&&L>A*g&&("vibrate"in navigator&&navigator.vibrate(10),t())};return m.addEventListener("touchstart",x,{passive:!0}),m.addEventListener("touchend",C,{passive:!0}),()=>{m.removeEventListener("touchstart",x),m.removeEventListener("touchend",C)}},[e,t]);const v=m=>{a(m),t()},h=f?{transition:"none"}:void 0;return T.jsxs(T.Fragment,{children:[T.jsx("div",{className:`session-drawer-backdrop ${e?"open":""}`,style:h,onClick:t,"aria-hidden":"true"}),T.jsxs("div",{ref:_,className:`session-drawer ${e?"open":""}`,style:h,role:"dialog","aria-modal":"true","aria-label":"Session list",tabIndex:-1,children:[T.jsx(hw,{sessions:r,inactiveSessions:n,selectedSessionId:i,onSelect:v,onRename:l,onResume:s,onSetPinned:o,loading:p,error:u}),T.jsx("div",{className:"shrink-0 border-t border-border px-2 pt-2",style:{paddingBottom:"max(0.5rem, env(safe-area-inset-bottom, 0.5rem))"},children:T.jsx("button",{onClick:()=>{c(),t()},className:"btn btn-primary w-full py-2 text-sm",children:"New Session"})})]})]})}const eM={working:"Working",waiting:"Waiting",permission:"Needs Input",unknown:"Unknown"},tM={working:"text-working",waiting:"text-waiting",permission:"text-approval",unknown:"text-muted"},rM={working:"bg-green-500/35 text-white",waiting:"bg-blue-500/35 text-white",permission:"bg-amber-500/35 text-white",unknown:"bg-gray-500/35 text-white"},nM={working:"bg-working text-white",waiting:"bg-waiting text-white",permission:"bg-approval text-white",unknown:"bg-muted text-white"};function xv(){"vibrate"in navigator&&navigator.vibrate(10)}function sM({session:e,sessions:t,inactiveSessions:r=[],connectionStatus:n,connectionEpoch:i=0,sendMessage:a,subscribe:l,onClose:s,onSelectSession:o,onNewSession:c,onKillSession:p,onRenameSession:u,onResumeSession:f,onSetPinned:_,onOpenSettings:y,loading:v=!1,error:h=null}){const m=Gl(Z=>Z.theme),d=PD[m],g=pe(Z=>Z.useWebGL),w=pe(Z=>Z.fontSize),b=pe(Z=>Z.lineHeight),x=pe(Z=>Z.letterSpacing),C=pe(Z=>Z.fontOption),S=pe(Z=>Z.customFontFamily),E=iC(C,S),L=pe(Z=>Z.shortcutModifier),A=ii(Zo(L)),M=Qo(),D=RD(),[B,H]=k.useState(!1),[F,$]=k.useState(!1),[I,R]=k.useState(!1),[P,N]=k.useState(!1),[j,U]=k.useState(!1),[V,ee]=k.useState(!1),[Q,z]=k.useState(""),O=k.useRef(!1),K=k.useRef(null),W=k.useRef(null),te=k.useRef(null),J=k.useRef(null),_e=(e==null?void 0:e.remote)===!0,ue=Ge(Z=>Z.remoteAllowControl),se=Ge(Z=>Z.remoteAllowAttach),re=_e&&!se,ae=!_e||ue&&(e==null?void 0:e.source)==="managed",{containerRef:ye,terminalRef:ve,inTmuxCopyModeRef:ne,setTmuxCopyMode:ie}=TD({sessionId:(e==null?void 0:e.id)??null,tmuxTarget:(e==null?void 0:e.tmuxWindow)??null,allowAttach:!re,connectionStatus:n,connectionEpoch:i,sendMessage:a,subscribe:l,theme:d,fontSize:w,lineHeight:b,letterSpacing:x,fontFamily:E,useWebGL:g,onScrollChange:Z=>{H(!Z)}}),he=k.useCallback(()=>{var Z;!e||re||(a({type:"tmux-cancel-copy-mode",sessionId:e.id}),ie(!1),(Z=ve.current)==null||Z.scrollToBottom())},[e,re,a,ie,ve]),oe=k.useCallback(()=>{U(!0),xv()},[]),me=AD({enabled:D||M,isOpen:j,onOpen:oe});k.useEffect(()=>{!D&&!M&&j&&U(!1)},[j,D,M]);const xe=k.useCallback(()=>N(!1),[]);DD(W,P,xe),k.useEffect(()=>{V&&te.current&&(te.current.focus(),te.current.select())},[V]),k.useEffect(()=>{I&&J.current&&J.current.focus()},[I]);const ke=k.useCallback(()=>R(!1),[]);MD(I,ke);const Ne=()=>{e&&(p(e.id),R(!1))},Ke=()=>{e&&(z(e.agentSessionName||e.name),ee(!0),N(!1))},Ae=()=>{if(!e)return;const Z=Q.trim(),Le=e.agentSessionName||e.name;Z&&Z!==Le&&u(e.id,Z),ee(!1)},Pe=Z=>{Z.key==="Enter"?(Z.preventDefault(),Ae()):Z.key==="Escape"&&(Z.preventDefault(),ee(!1))};k.useEffect(()=>{if(!M||!e){$(!1);return}const Z=ye.current;if(!Z)return;const Le=Te=>{const De=Z.querySelector(".xterm-accessibility-tree");if(!De)return!1;const ze=Te.anchorNode,Xe=Te.focusNode;return!!ze&&De.contains(ze)||!!Xe&&De.contains(Xe)},de=()=>{const Te=Z.querySelector(".xterm-accessibility"),De=Z.querySelector(".xterm-accessibility-tree");!Te||!De||(Te.style.setProperty("opacity","0"),De.style.setProperty("opacity","0"),Te.style.setProperty("-webkit-user-select","none"),Te.style.setProperty("user-select","none"),De.style.setProperty("-webkit-user-select","none"),De.style.setProperty("user-select","none"),Te.offsetHeight,requestAnimationFrame(()=>{Te.style.removeProperty("opacity"),De.style.removeProperty("opacity"),Te.style.removeProperty("-webkit-user-select"),Te.style.removeProperty("user-select"),De.style.removeProperty("-webkit-user-select"),De.style.removeProperty("user-select")}))},fe=()=>{var De;O.current=!1;const Te=window.getSelection();try{Te==null||Te.removeAllRanges()}catch{}(De=ve.current)==null||De.clearSelection(),de(),$(!1)};K.current=fe;const Ee=()=>{const Te=window.getSelection();if(!Te||Te.rangeCount===0||Te.isCollapsed){O.current?fe():$(Xe=>Xe&&!1);return}const De=Le(Te);if(!De&&O.current){fe();return}O.current=De;const ze=De;$(Xe=>Xe!==ze?ze:Xe)},Re=()=>{const Te=window.getSelection();!Te||Te.isCollapsed||Le(Te)&&setTimeout(fe,0)},je=10;let Me=null,Ie=!1;const Ve=Te=>{if(Te.touches.length===1){const De=Te.touches[0];Me={x:De.clientX,y:De.clientY},Ie=!1}},ot=Te=>{if(Ie||!Me||Te.touches.length!==1)return;const De=Te.touches[0],ze=Math.abs(De.clientX-Me.x),Xe=Math.abs(De.clientY-Me.y);(ze>je||Xe>je)&&(Ie=!0)},He=Te=>{const De=Ie;Me=null,Ie=!1;const ze=window.getSelection();if(!ze||ze.rangeCount===0||ze.isCollapsed){$(!1);return}const Xe=Z.querySelector(".xterm-accessibility-tree");if(!Xe)return;if(!Le(ze)){$(!1);return}if(De)return;const Ht=Te.target,_t=Ht?Xe.contains(Ht):!1;let zt=!1;if(_t&&Ht)try{zt=ze.containsNode(Ht,!0)}catch{zt=!1}(!_t||!zt)&&setTimeout(fe,0)};return document.addEventListener("selectionchange",Ee),document.addEventListener("copy",Re),document.addEventListener("touchstart",Ve,{passive:!0}),document.addEventListener("touchmove",ot,{passive:!0}),document.addEventListener("touchend",He,{passive:!0}),()=>{document.removeEventListener("selectionchange",Ee),document.removeEventListener("copy",Re),document.removeEventListener("touchstart",Ve),document.removeEventListener("touchmove",ot),document.removeEventListener("touchend",He),K.current=null,O.current=!1}},[ye,M,e==null?void 0:e.id]),k.useEffect(()=>{var Me;if(!M)return;const Z=ye.current;if(!Z)return;const Le=()=>{const Ie=ve.current,Ve=Z.querySelector(".xterm");if(!Ie||!Ve)return;const ot=Ve.querySelector(".xterm-screen"),He=Ve.querySelector(".xterm-accessibility"),Te=Ve.querySelector(".xterm-accessibility-tree");if(!ot||!He||!Te)return;const De=Ve.getBoundingClientRect(),ze=ot.getBoundingClientRect(),Xe=ze.left-De.left,Ht=ze.top-De.top;Object.assign(He.style,{left:`${Xe}px`,top:`${Ht}px`,right:"auto",bottom:"auto",width:`${ze.width}px`,height:`${ze.height}px`});const _t=ze.width/Ie.cols,zt=ze.height/Ie.rows,It=document.createElement("span");It.textContent="0".repeat(200),It.style.cssText="position:absolute;visibility:hidden;white-space:pre;pointer-events:none;letter-spacing:0px",Te.appendChild(It);const wn=It.getBoundingClientRect().width/200;It.remove();const Ts=Math.max(-2,Math.min(2,_t-wn));Z.style.setProperty("--xterm-font-size",`${Ie.options.fontSize}px`),Z.style.setProperty("--xterm-cell-height",`${zt}px`),Z.style.setProperty("--xterm-a11y-letter-spacing",`${Ts}px`)},de=performance.now();Le();const fe=Math.round(performance.now()-de);fe>10&&Je("switch_a11y_overlay",{sessionId:e==null?void 0:e.id,a11yMs:fe});const Ee=window.requestAnimationFrame(Le),Re=window.setTimeout(Le,100),je=()=>window.requestAnimationFrame(Le);return(Me=window.visualViewport)==null||Me.addEventListener("resize",je),window.addEventListener("orientationchange",je),()=>{var Ie;window.cancelAnimationFrame(Ee),window.clearTimeout(Re),(Ie=window.visualViewport)==null||Ie.removeEventListener("resize",je),window.removeEventListener("orientationchange",je)}},[ye,w,M,e==null?void 0:e.id,ve]);const G=k.useRef(F);k.useEffect(()=>{G.current=F},[F]);const Y=k.useRef(e==null?void 0:e.id);k.useEffect(()=>{Y.current=e==null?void 0:e.id},[e==null?void 0:e.id]);const Oe=k.useRef(a);k.useEffect(()=>{Oe.current=a},[a]);const $e=k.useRef(!1);k.useEffect(()=>{const Z=ye.current;if(!Z||!(e!=null&&e.id)||!D&&!M)return;const Le=6,de=350;let fe={x:0,y:0},Ee=0,Re=!1,je=null,Me=0,Ie=0,Ve=0,ot=Math.round(w*b),He=null;const Te=()=>{const Et=window.getComputedStyle(Z).getPropertyValue("--xterm-cell-height").trim(),kt=Number.parseFloat(Et);return!Number.isNaN(kt)&&kt>0?kt:Math.round(w*b)},De=()=>Z.querySelector(".xterm-helper-textarea"),ze=()=>{const Be=De();Be&&document.activeElement!==Be&&(Be.disabled=!0)},Xe=()=>{const Be=De();Be&&(Be.disabled=!1)};ze();const Ht=()=>{if(ne.current)return;const Be=De();Be&&(Be.disabled=!1,Be.focus())},_t=()=>{He!==null&&(cancelAnimationFrame(He),He=null),Ie=0},zt=Be=>{const Et=Y.current;if(!Et||Be===0)return!1;const kt=ve.current,Zr=(kt==null?void 0:kt.cols)??80,Ds=(kt==null?void 0:kt.rows)??24,Ms=Math.floor(Zr/2),Jn=Math.floor(Ds/2),Qn=Be>0?65:64,Zn=Math.abs(Be),Sn=Be<0;for(let en=0;en<Zn;en++)Oe.current({type:"terminal-input",sessionId:Et,data:`\x1B[<${Qn};${Ms};${Jn}M`});return Sn&&ie(!0),Sn},It=()=>{je=null,Ie=0,Ve=0},wn=()=>{if(!M)return!1;const Be=window.getSelection();if(!Be||Be.isCollapsed)return!1;const Et=Z.querySelector(".xterm-accessibility-tree");if(!Et)return!1;const kt=Be.anchorNode,Zr=Be.focusNode;return!!kt&&Et.contains(kt)||!!Zr&&Et.contains(Zr)},Ts=()=>{var Be;!M||!O.current||wn()||(Be=K.current)==null||Be.call(K)},la=Be=>{if(_t(),Ts(),me.current||j){It();return}if(G.current){It();return}if(Be.touches.length===1){const Et=Be.touches[0];fe={x:Et.clientX,y:Et.clientY},Ee=performance.now(),Re=!1,je=Et.clientY,Me=Ee,Ie=0,Ve=0,ot=Te(),Xe()}},q=Be=>{if(Be.touches.length!==1||je===null)return;if(Ts(),me.current||j){It();return}if(G.current||wn()){It();return}Be.preventDefault(),Be.stopPropagation();const Et=performance.now(),kt=Be.touches[0],Zr=kt.clientX,Ds=kt.clientY,Ms=Math.abs(Zr-fe.x),Jn=Math.abs(Ds-fe.y);!Re&&(Ms>Le||Jn>Le)&&(Re=!0,ze());const Qn=je-Ds,Zn=Et-Me;if(je=Ds,Me=Et,Zn>0){const Ec=Qn/Zn;Ie=Ie*.7+Ec*.3}Ve+=Qn;const Sn=Math.max(6,ot*.6),en=Math.trunc(Ve/Sn);en!==0&&(zt(en),Ve-=en*Sn)},et=Be=>{var Ms;const Et=Ie,kt=performance.now()-Ee;if(It(),me.current||j)return;const Zr=wn();if(G.current&&!Zr&&((Ms=K.current)==null||Ms.call(K)),G.current||Zr){ne.current&&($e.current=!0);return}if(!Re){if(M&&kt>=de)return;if(ne.current){Be.preventDefault(),Be.stopPropagation(),$e.current=!0;return}Ht();return}if(Math.abs(Et)>.12){let Jn=Et,Qn=performance.now();const Zn=()=>{const Sn=performance.now(),en=Sn-Qn;Qn=Sn;const Ec=Jn*en;Ve+=Ec;const Cp=Math.max(6,ot*.6),kc=Math.trunc(Ve/Cp);kc!==0&&(zt(kc),Ve-=kc*Cp),Jn*=Math.pow(.95,en/16.67),Math.abs(Jn)>.02?He=requestAnimationFrame(Zn):He=null};He=requestAnimationFrame(Zn)}},Jr=Be=>{$e.current&&(Be.preventDefault(),Be.stopPropagation(),$e.current=!1)},Qr={passive:!0,capture:!0},Rs={passive:!1,capture:!0},xp={passive:!1,capture:!0},bp={capture:!0};return Z.addEventListener("touchstart",la,Qr),Z.addEventListener("touchmove",q,Rs),Z.addEventListener("touchend",et,xp),Z.addEventListener("mousedown",Jr,bp),()=>{Z.removeEventListener("touchstart",la,Qr),Z.removeEventListener("touchmove",q,Rs),Z.removeEventListener("touchend",et,xp),Z.removeEventListener("mousedown",Jr,bp);const Be=De();Be&&(Be.disabled=!1)}},[e==null?void 0:e.id,ye,ve,M,D,j,w,b]);const X=k.useCallback(Z=>{!e||re||a({type:"terminal-input",sessionId:e.id,data:Z})},[e,re,a]),le=k.useCallback(()=>{const Z=ye.current;if(!Z)return;const Le=Z.querySelector(".xterm-helper-textarea");Le&&(Le.removeAttribute("disabled"),Le.focus())},[ye]),ge=k.useCallback(()=>{if(!e||re)return;ne.current&&(a({type:"tmux-cancel-copy-mode",sessionId:e.id}),ie(!1));const Z=ye.current;if(!Z)return;const Le=Z.querySelector(".xterm-helper-textarea");Le&&(Le.removeAttribute("disabled"),Le.focus())},[e,re,a,ye,ne,ie]),We=k.useCallback(()=>{var Re,je;if(typeof document>"u")return!1;const Z=ye.current;if(!Z)return!1;const Le=Z.querySelector(".xterm-helper-textarea");if(Le&&document.activeElement===Le)return!0;const de=document.activeElement,fe=typeof HTMLInputElement<"u"&&de instanceof HTMLInputElement,Ee=typeof HTMLTextAreaElement<"u"&&de instanceof HTMLTextAreaElement;return fe||Ee||de&&de.isContentEditable?!1:!!((je=(Re=document.documentElement)==null?void 0:Re.classList)!=null&&je.contains("keyboard-visible"))},[ye]);return k.useEffect(()=>{if(!M)return;const Z=ye.current;if(!Z)return;const Le=Z.querySelector(".xterm-accessibility"),de=Z.querySelector(".xterm-accessibility-tree");if(!Le||!de)return;const fe=()=>{const Ee=Z.querySelector(".xterm-helper-textarea");(Ee?document.activeElement===Ee:!1)&&!G.current?(Le.style.pointerEvents="none",de.style.pointerEvents="none"):(Le.style.removeProperty("pointer-events"),de.style.removeProperty("pointer-events"))};return fe(),document.addEventListener("focusin",fe),document.addEventListener("focusout",fe),()=>{document.removeEventListener("focusin",fe),document.removeEventListener("focusout",fe)}},[ye,M,F]),T.jsxs("section",{className:`flex flex-1 flex-col bg-base terminal-mobile-overlay md:relative md:inset-auto ${M?"ios-native-term-selection":""}`,"data-testid":"terminal-panel",children:[T.jsxs("div",{className:`flex h-10 shrink-0 items-center justify-between border-b border-border bg-elevated px-3 ${e?"":"md:hidden"}`,children:[T.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[T.jsx("button",{onClick:()=>U(!0),className:"flex h-7 w-7 items-center justify-center rounded bg-surface border border-border text-secondary hover:bg-hover hover:text-primary active:scale-95 transition-all md:hidden shrink-0","aria-label":"Open session menu",children:T.jsx(EC,{width:16,height:16})}),e&&ae&&T.jsx("button",{onClick:()=>R(!0),className:"hidden md:flex h-7 w-7 items-center justify-center rounded bg-danger/10 border border-danger/30 text-danger hover:bg-danger/20 active:scale-95 transition-all shrink-0",title:`Kill session (${A}X)`,"aria-label":"Kill session",children:T.jsx(Th,{width:16,height:16})}),e?T.jsxs("div",{className:"flex items-baseline gap-3 min-w-0",children:[V?T.jsx("input",{ref:te,type:"text",value:Q,onChange:Z=>z(Z.target.value),onBlur:Ae,onKeyDown:Pe,className:"w-full max-w-[200px] rounded border border-border bg-surface px-2 py-0.5 text-sm font-medium text-primary outline-none focus:border-accent"}):T.jsx("span",{className:"text-sm font-medium text-primary truncate",children:e.agentSessionName||e.name}),T.jsx("span",{className:`text-xs shrink-0 ${tM[e.status]}`,children:eM[e.status]})]}):T.jsx("span",{className:"text-sm font-medium text-primary md:hidden",children:"Sessions"})]}),T.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[n!=="connected"&&T.jsx("span",{className:"text-xs text-approval",children:n}),T.jsx("button",{onClick:c,className:"flex h-7 w-7 items-center justify-center rounded bg-accent text-white hover:bg-accent/90 active:scale-95 transition-all md:hidden",title:`New session (${A}N)`,"aria-label":"New session",children:T.jsx(iy,{width:16,height:16})}),e&&ae&&T.jsx("button",{onClick:()=>R(!0),className:"flex md:hidden h-7 w-7 items-center justify-center rounded bg-danger/10 border border-danger/30 text-danger hover:bg-danger/20 active:scale-95 transition-all",title:`Kill session (${A}X)`,"aria-label":"Kill session",children:T.jsx(Th,{width:16,height:16})}),e&&T.jsxs("div",{className:"relative md:hidden",ref:W,children:[T.jsx("button",{onClick:()=>N(!P),className:"flex h-7 w-7 items-center justify-center rounded bg-surface border border-border text-secondary hover:bg-hover hover:text-primary active:scale-95 transition-all",title:"More options","aria-label":"More options",children:T.jsx(vC,{width:16,height:16})}),P&&T.jsxs("div",{className:"absolute right-0 top-full mt-1 z-20 min-w-[140px] rounded-md border border-border bg-elevated shadow-lg py-1",children:[ae&&T.jsxs("button",{onClick:Ke,className:"w-full px-3 py-2 text-left text-sm text-secondary hover:bg-hover hover:text-primary flex items-center gap-2",children:[T.jsx(ny,{width:14,height:14}),"Rename"]}),T.jsxs("button",{onClick:()=>{y(),N(!1)},className:"w-full px-3 py-2 text-left text-sm text-secondary hover:bg-hover hover:text-primary flex items-center gap-2",children:[T.jsx(MC,{width:14,height:14}),"Settings"]})]})]})]})]}),e&&t.length>1&&T.jsxs("div",{className:"relative overflow-hidden bg-elevated border-b border-border md:hidden",children:[T.jsx("div",{className:"absolute right-0 top-0 bottom-0 w-4 bg-gradient-to-l from-elevated to-transparent z-10 pointer-events-none"}),T.jsx("div",{className:"flex items-center gap-1.5 pl-5 pr-3 py-1.5 overflow-x-auto scrollbar-none scroll-smooth snap-x snap-mandatory",style:{WebkitOverflowScrolling:"touch"},children:t.map((Z,Le)=>{const de=Z.id===e.id;return T.jsx("button",{type:"button",className:`
295
295
  flex items-center justify-center shrink-0 snap-start
296
296
  h-8 w-8 text-sm font-extrabold rounded-lg
297
297
  active:scale-95 transition-all duration-75
@@ -313,4 +313,4 @@ void main() {
313
313
  *
314
314
  * This source code is licensed under the MIT license found in the
315
315
  * LICENSE file in the root directory of this source tree.
316
- */var Cc=k,_A=fS;function yA(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var wA=typeof Object.is=="function"?Object.is:yA,SA=_A.useSyncExternalStore,xA=Cc.useRef,bA=Cc.useEffect,CA=Cc.useMemo,EA=Cc.useDebugValue;mS.useSyncExternalStoreWithSelector=function(e,t,r,n,i){var a=xA(null);if(a.current===null){var l={hasValue:!1,value:null};a.current=l}else l=a.current;a=CA(function(){function o(_){if(!c){if(c=!0,p=_,_=n(_),i!==void 0&&l.hasValue){var y=l.value;if(i(y,_))return u=y}return u=_}if(y=u,wA(p,_))return y;var v=n(_);return i!==void 0&&i(y,v)?(p=_,y):(p=_,u=v)}var c=!1,p,u,f=r===void 0?null:r;return[function(){return o(t())},f===null?void 0:function(){return o(f())}]},[t,r,n,i]);var s=SA(e,a[0],a[1]);return bA(function(){l.hasValue=!0,l.value=s},[s]),EA(s),s};pS.exports=mS;var kA=pS.exports;const LA=ap(19),TA=LA?DA:MA;function gS(e,t,r,n,i){return TA(e,t,r,n,i)}function RA(e,t,r,n,i){const a=k.useCallback(()=>t(e.getSnapshot(),r,n,i),[e,t,r,n,i]);return fS.useSyncExternalStore(e.subscribe,a,a)}function DA(e,t,r,n,i){return RA(e,t,r,n,i)}function MA(e,t,r,n,i){return kA.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,a=>t(a,r,n,i))}class AA{constructor(t){tt(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));tt(this,"getSnapshot",()=>this.state);this.state=t,this.listeners=new Set,this.updateTick=0}setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const r=this.updateTick;for(const n of this.listeners){if(r!==this.updateTick)return;n(t)}}update(t){for(const r in t)if(!Object.is(this.state[r],t[r])){this.setState({...this.state,...t});return}}set(t,r){Object.is(this.state[t],r)||this.setState({...this.state,[t]:r})}notifyAll(){const t={...this.state};this.setState(t)}use(t,r,n,i){return gS(this,t,r,n,i)}}class PA extends AA{constructor(t,r={},n){super(t),this.context=r,this.selectors=n}useSyncedValue(t,r){k.useDebugValue(t),qt(()=>{this.state[t]!==r&&this.set(t,r)},[t,r])}useSyncedValueWithCleanup(t,r){const n=this;qt(()=>(n.state[t]!==r&&n.set(t,r),()=>{n.set(t,void 0)}),[n,t,r])}useSyncedValues(t){const r=this,n=Object.values(t);qt(()=>{r.update(t)},[r,...n])}useControlledProp(t,r){k.useDebugValue(t);const n=r!==void 0;qt(()=>{n&&!Object.is(this.state[t],r)&&super.setState({...this.state,[t]:r})},[t,r,n])}select(t,r,n,i){const a=this.selectors[t];return a(this.state,r,n,i)}useState(t,r,n,i){return k.useDebugValue(t),gS(this,this.selectors[t],r,n,i)}useContextCallback(t,r){k.useDebugValue(t);const n=Xr(r??ur);this.context[t]=n}useStateSetter(t){const r=k.useRef(void 0);return r.current===void 0&&(r.current=n=>{this.set(t,n)}),r.current}observe(t,r){let n;typeof t=="function"?n=t:n=this.selectors[t];let i=n(this.state);return r(i,i,this),this.subscribe(a=>{const l=n(a);if(!Object.is(i,l)){const s=i;i=l,r(l,s,this)}})}}const $a=null;class IA{constructor(){tt(this,"callbacks",[]);tt(this,"callbacksCount",0);tt(this,"nextId",1);tt(this,"startId",1);tt(this,"isScheduled",!1);tt(this,"tick",t=>{var i;this.isScheduled=!1;const r=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let a=0;a<r.length;a+=1)(i=r[a])==null||i.call(r,t)})}request(t){const r=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,(!this.isScheduled||!1)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),r}cancel(t){const r=t-this.startId;r<0||r>=this.callbacks.length||(this.callbacks[r]=null,this.callbacksCount-=1)}}const Ha=new IA;class _p{constructor(){tt(this,"currentId",$a);tt(this,"cancel",()=>{this.currentId!==$a&&(Ha.cancel(this.currentId),this.currentId=$a)});tt(this,"disposeEffect",()=>this.cancel)}static create(){return new _p}static request(t){return Ha.request(t)}static cancel(t){return Ha.cancel(t)}request(t){this.cancel(),this.currentId=Ha.request(()=>{this.currentId=$a,t()})}}function BA(){const e=ks(_p.create).current;return mp(e.disposeEffect),e}const Ui=0;class Ko{constructor(){tt(this,"currentId",Ui);tt(this,"clear",()=>{this.currentId!==Ui&&(clearTimeout(this.currentId),this.currentId=Ui)});tt(this,"disposeEffect",()=>this.clear)}static create(){return new Ko}start(t,r){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Ui,r()},t)}isStarted(){return this.currentId!==Ui}}function OA(){const e=ks(Ko.create).current;return mp(e.disposeEffect),e}let Ov=0;function vS(e){return Ov+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${Ov}`}function Js(e){return(e==null?void 0:e.ownerDocument)||document}function Du(e,t){if(typeof e=="string")return{description:e};if(typeof e=="function"){const r=e(t);return typeof r=="string"?{description:r}:r}return e}const aa=typeof navigator<"u",Mu=HA(),NA=UA(),jA=zA();typeof CSS>"u"||!CSS.supports||CSS.supports("-webkit-backdrop-filter:none");Mu.platform==="MacIntel"&&Mu.maxTouchPoints>1||/iP(hone|ad|od)|iOS/.test(Mu.platform);const FA=aa&&/apple/i.test(navigator.vendor);aa&&NA.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints;const $A=jA.includes("jsdom/");function HA(){if(!aa)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e!=null&&e.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function zA(){if(!aa)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:r})=>`${t}/${r}`).join(" "):navigator.userAgent}function UA(){if(!aa)return"";const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform??""}function Ql(e){var r;let t=e.activeElement;for(;((r=t==null?void 0:t.shadowRoot)==null?void 0:r.activeElement)!=null;)t=t.shadowRoot.activeElement;return t}function yi(e,t){var n;if(!e||!t)return!1;const r=(n=t.getRootNode)==null?void 0:n.call(t);if(e.contains(t))return!0;if(r&&PM(r)){let i=t;for(;i;){if(e===i)return!0;i=i.parentNode||i.host}}return!1}function yp(e){return"composedPath"in e?e.composedPath()[0]:e.target}function pd(e){if(!e||$A)return!0;try{return e.matches(":focus-visible")}catch{return!0}}const za=lA(e=>e.toasts,e=>{const t=new Map;let r=0,n=0;return e.forEach((i,a)=>{const l=i.transitionStatus==="ending";t.set(i.id,{value:i,domIndex:a,visibleIndex:l?-1:r,offsetY:n}),n+=i.height||0,l||(r+=1)}),t}),nn={toasts:Tr(e=>e.toasts),isEmpty:Tr(e=>e.toasts.length===0),toast:Tr(za,(e,t)=>{var r;return(r=e.get(t))==null?void 0:r.value}),toastIndex:Tr(za,(e,t)=>{var r;return((r=e.get(t))==null?void 0:r.domIndex)??-1}),toastOffsetY:Tr(za,(e,t)=>{var r;return((r=e.get(t))==null?void 0:r.offsetY)??0}),toastVisibleIndex:Tr(za,(e,t)=>{var r;return((r=e.get(t))==null?void 0:r.visibleIndex)??-1}),hovering:Tr(e=>e.hovering),focused:Tr(e=>e.focused),expanded:Tr(e=>e.hovering||e.focused),expandedOrOutOfFocus:Tr(e=>e.hovering||e.focused||!e.isWindowFocused),prevFocusElement:Tr(e=>e.prevFocusElement)};class WA extends PA{constructor(r){super(r,{},nn);tt(this,"timers",new Map);tt(this,"areTimersPaused",!1);tt(this,"setViewport",r=>{this.set("viewport",r)});tt(this,"disposeEffect",()=>()=>{this.timers.forEach(r=>{var n;(n=r.timeout)==null||n.clear()}),this.timers.clear()});tt(this,"addToast",r=>{const{toasts:n,timeout:i,limit:a}=this.state,l=r.id||vS("toast"),s={...r,id:l,transitionStatus:"starting"},o=[s,...n],c=o.filter(u=>u.transitionStatus!=="ending");if(c.length>a){const u=c.length-a,f=c.slice(-u),_=new Set(f.map(y=>y.id));this.setToasts(o.map(y=>{const v=_.has(y.id);return y.limited!==v?{...y,limited:v}:y}))}else this.setToasts(o.map(u=>u.limited?{...u,limited:!1}:u));const p=s.timeout??i;return s.type!=="loading"&&p>0&&this.scheduleTimer(l,p,()=>this.closeToast(l)),nn.expandedOrOutOfFocus(this.state)&&this.pauseTimers(),l});tt(this,"updateToast",(r,n)=>{this.updateToastInternal(r,n)});tt(this,"updateToastInternal",(r,n)=>{var v,h;const{timeout:i,toasts:a}=this.state,l=nn.toast(this.state,r)??null;if(!l||l.transitionStatus==="ending")return;const s={...l,...n};this.setToasts(a.map(m=>m.id===r?{...m,...n}:m));const o=s.timeout??i,c=(l==null?void 0:l.timeout)??i,p=Object.hasOwn(n,"timeout"),u=s.transitionStatus!=="ending"&&s.type!=="loading"&&o>0,f=this.timers.has(r),_=c!==o,y=(l==null?void 0:l.type)==="loading";if(!u&&f){const m=this.timers.get(r);(v=m==null?void 0:m.timeout)==null||v.clear(),this.timers.delete(r);return}if(u&&(!f||_||p||y)){const m=this.timers.get(r);m&&((h=m.timeout)==null||h.clear(),this.timers.delete(r)),this.scheduleTimer(r,o,()=>this.closeToast(r)),nn.expandedOrOutOfFocus(this.state)&&this.pauseTimers()}});tt(this,"closeToast",r=>{var c;const n=nn.toast(this.state,r);(c=n==null?void 0:n.onClose)==null||c.call(n);const{limit:i,toasts:a}=this.state;let l=0;const s=a.map(p=>{if(p.id===r)return{...p,transitionStatus:"ending",height:0};if(p.transitionStatus==="ending")return p;const u=l>=i;return l+=1,p.limited!==u?{...p,limited:u}:p}),o=this.timers.get(r);o&&o.timeout&&(o.timeout.clear(),this.timers.delete(r)),this.handleFocusManagement(r),this.setToasts(s)});tt(this,"promiseToast",(r,n)=>{const i=Du(n.loading),a=this.addToast({...i,type:"loading"}),l=r.then(s=>{const o=Du(n.success,s);return this.updateToast(a,{...o,type:"success",timeout:o.timeout}),s}).catch(s=>{const o=Du(n.error,s);return this.updateToast(a,{...o,type:"error",timeout:o.timeout}),Promise.reject(s)});return{}.hasOwnProperty.call(n,"setPromise")&&n.setPromise(l),l});tt(this,"handleDocumentPointerDown",r=>{if(r.pointerType!=="touch")return;const n=yp(r);yi(this.state.viewport,n)||(this.resumeTimers(),this.update({hovering:!1,focused:!1}))})}setFocused(r){this.set("focused",r)}setHovering(r){this.set("hovering",r)}setIsWindowFocused(r){this.set("isWindowFocused",r)}setPrevFocusElement(r){this.set("prevFocusElement",r)}removeToast(r){var l;const n=nn.toastIndex(this.state,r);if(n===-1)return;const i=this.state.toasts[n];(l=i==null?void 0:i.onRemove)==null||l.call(i);const a=[...this.state.toasts];a.splice(n,1),this.setToasts(a)}pauseTimers(){this.areTimersPaused||(this.areTimersPaused=!0,this.timers.forEach(r=>{if(r.timeout){r.timeout.clear();const n=Date.now()-r.start,i=r.delay-n;r.remaining=i>0?i:0}}))}resumeTimers(){this.areTimersPaused&&(this.areTimersPaused=!1,this.timers.forEach((r,n)=>{r.remaining=r.remaining>0?r.remaining:r.delay,r.timeout??(r.timeout=Ko.create()),r.timeout.start(r.remaining,()=>{this.timers.delete(n),r.callback()}),r.start=Date.now()}))}restoreFocusToPrevElement(){var r;(r=this.state.prevFocusElement)==null||r.focus({preventScroll:!0})}scheduleTimer(r,n,i){const a=Date.now(),l=!nn.expandedOrOutOfFocus(this.state),s=l?Ko.create():void 0;s==null||s.start(n,()=>{this.timers.delete(r),i()}),this.timers.set(r,{timeout:s,start:l?a:0,delay:n,remaining:n,callback:i})}setToasts(r){const n={toasts:r};r.length===0&&(n.hovering=!1,n.focused=!1),this.update(n)}handleFocusManagement(r){var o,c;const n=Ql(Js(this.state.viewport));if(!this.state.viewport||!yi(this.state.viewport,n)||!pd(n))return;const i=nn.toasts(this.state),a=nn.toastIndex(this.state,r);let l=null,s=a+1;for(;s<i.length;){if(i[s].transitionStatus!=="ending"){l=i[s];break}s+=1}if(!l)for(s=a-1;s>=0;){if(i[s].transitionStatus!=="ending"){l=i[s];break}s-=1}l?(c=(o=l.ref)==null?void 0:o.current)==null||c.focus():this.restoreFocusToPrevElement()}}const VA=function(t){const{children:r,timeout:n=5e3,limit:i=3,toastManager:a}=t,l=ks(()=>new WA({timeout:n,limit:i,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return mp(l.disposeEffect),k.useEffect(function(){return a?a[" subscribe"](({action:c,options:p})=>{const u=p.id;c==="promise"&&p.promise?l.promiseToast(p.promise,p):c==="update"&&u?l.updateToast(u,p):c==="close"&&u?l.closeToast(u):l.addToast(p)}):void 0},[l,n,a]),l.useSyncedValues({timeout:n,limit:i}),T.jsx(gp.Provider,{value:l,children:r})},Au=k.forwardRef(function(t,r){const[n,i]=k.useState();qt(()=>{FA&&i("button")},[]);const a={tabIndex:0,role:n};return T.jsx("span",{...t,ref:r,style:op,"aria-hidden":n?void 0:!0,...a,"data-base-ui-focus-guard":""})});let KA=function(e){return e.frontmostHeight="--toast-frontmost-height",e}({});const GA=k.forwardRef(function(t,r){var M;const{render:n,className:i,children:a,...l}=t,s=vp(),o=OA(),c=k.useRef(!1),p=k.useRef(!1),u=s.useState("isEmpty"),f=s.useState("toasts"),_=s.useState("focused"),y=s.useState("expanded"),v=s.useState("prevFocusElement"),h=((M=f[0])==null?void 0:M.height)??0,m=k.useMemo(()=>f.some(D=>D.transitionStatus==="ending"),[f]);k.useEffect(()=>{const D=s.state.viewport;if(!D)return;function B(F){u||F.key==="F6"&&F.target!==D&&(F.preventDefault(),s.setPrevFocusElement(Ql(Js(D))),D==null||D.focus({preventScroll:!0}),s.pauseTimers(),s.setFocused(!0))}const H=Vo(D);return H.addEventListener("keydown",B),()=>{H.removeEventListener("keydown",B)}},[s,u]),k.useEffect(()=>{const D=s.state.viewport;if(!D||u)return;const B=Vo(D);function H($){$.target===B&&(s.setIsWindowFocused(!1),s.pauseTimers())}function F($){if($.relatedTarget||$.target===B)return;const I=yp($),R=Ql(Js(D));(!yi(D,I)||!pd(R))&&s.resumeTimers(),o.start(0,()=>s.setIsWindowFocused(!0))}return B.addEventListener("blur",H,!0),B.addEventListener("focus",F,!0),()=>{B.removeEventListener("blur",H,!0),B.removeEventListener("focus",F,!0)}},[s,o,u]),k.useEffect(()=>{const D=s.state.viewport;if(!D||u)return;const B=Js(D);return B.addEventListener("pointerdown",s.handleDocumentPointerDown,!0),()=>{B.removeEventListener("pointerdown",s.handleDocumentPointerDown,!0)}},[u,s]);function d(D){var H,F,$;const B=s.state.viewport;B&&(c.current=!0,D.relatedTarget===B?($=(F=(H=f[0])==null?void 0:H.ref)==null?void 0:F.current)==null||$.focus():s.restoreFocusToPrevElement())}function g(D){D.key==="Tab"&&D.shiftKey&&D.target===s.state.viewport&&(D.preventDefault(),s.restoreFocusToPrevElement(),s.resumeTimers())}k.useEffect(()=>{!s.state.isWindowFocused||m||!p.current||(s.resumeTimers(),s.setHovering(!1),p.current=!1)},[m,s]);function w(){s.pauseTimers(),s.setHovering(!0),p.current=!1}function b(){m?p.current=!0:(s.resumeTimers(),s.setHovering(!1))}function x(){if(c.current){c.current=!1;return}_||pd(Js(s.state.viewport).activeElement)&&(s.setFocused(!0),s.pauseTimers())}function C(D){!_||yi(s.state.viewport,D.relatedTarget)||(s.setFocused(!1),s.resumeTimers())}const S={tabIndex:-1,role:"region","aria-live":"polite","aria-atomic":!1,"aria-relevant":"additions text","aria-label":"Notifications",onMouseEnter:w,onMouseMove:w,onMouseLeave:b,onFocus:x,onBlur:C,onKeyDown:g,onClick:x},E={expanded:y},L=Ls("div",t,{ref:[r,s.setViewport],state:E,props:[S,{style:{[KA.frontmostHeight]:h?`${h}px`:void 0}},l,{children:T.jsxs(k.Fragment,{children:[!u&&v&&T.jsx(Au,{onFocus:d}),a,!u&&v&&T.jsx(Au,{onFocus:d})]})}]}),A=k.useMemo(()=>f.filter(D=>D.priority==="high"),[f]);return T.jsxs(k.Fragment,{children:[!u&&v&&T.jsx(Au,{onFocus:d}),L,!_&&A.length>0&&T.jsx("div",{style:op,children:A.map(D=>T.jsxs("div",{role:"alert","aria-atomic":!0,children:[T.jsx("div",{children:D.title}),T.jsx("div",{children:D.description})]},D.id))})]})});function qA(e){return ap(19)?e:e?"true":void 0}const _S=k.createContext(void 0);function wp(){const e=k.useContext(_S);if(!e)throw new Error(Yr(66));return e}let Sp=function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e}({});const XA={[Sp.startingStyle]:""},YA={[Sp.endingStyle]:""},JA={transitionStatus(e){return e==="starting"?XA:e==="ending"?YA:null}};function QA(e){return e==null?e:"current"in e?e.current:e}function ZA(e,t=!1,r=!0){const n=BA();return Xr((i,a=null)=>{n.cancel();function l(){hn.flushSync(i)}const s=QA(e);if(s==null)return;const o=s;if(typeof o.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)i();else{let u=function(){const _=Sp.startingStyle;if(!o.hasAttribute(_)){n.request(f);return}const y=new MutationObserver(()=>{o.hasAttribute(_)||(y.disconnect(),f())});y.observe(o,{attributes:!0,attributeFilter:[_]}),a==null||a.addEventListener("abort",()=>y.disconnect(),{once:!0})},f=function(){Promise.all(o.getAnimations().map(_=>_.finished)).then(()=>{a!=null&&a.aborted||l()}).catch(()=>{const _=o.getAnimations();if(r){if(a!=null&&a.aborted)return;l()}else _.length>0&&_.some(y=>y.pending||y.playState!=="finished")&&f()})};var c=u,p=f;if(t){u();return}n.request(f)}})}function eP(e){const{enabled:t=!0,open:r,ref:n,onComplete:i}=e,a=Xr(i),l=ZA(n,r,!1);k.useEffect(()=>{if(!t)return;const s=new AbortController;return l(a,s.signal),()=>{s.abort()}},[t,r,a,l])}let ss=function(e){return e.index="--toast-index",e.offsetY="--toast-offset-y",e.height="--toast-height",e.swipeMovementX="--toast-swipe-movement-x",e.swipeMovementY="--toast-swipe-movement-y",e}({});const tP={...JA,swipeDirection(e){return e?{"data-swipe-direction":e}:null}},Wi=40,rP=10,En=.5,nP=1;function Nv(e,t,r){switch(e){case"up":return-r;case"down":return r;case"left":return-t;case"right":return t;default:return 0}}function sP(e){const r=window.getComputedStyle(e).transform;let n=0,i=0,a=1;if(r&&r!=="none"){const l=r.match(/matrix(?:3d)?\(([^)]+)\)/);if(l){const s=l[1].split(", ").map(parseFloat);s.length===6?(n=s[4],i=s[5],a=Math.sqrt(s[0]*s[0]+s[1]*s[1])):s.length===16&&(n=s[12],i=s[13],a=s[0])}}return{x:n,y:i,scale:a}}const iP=k.forwardRef(function(t,r){var ve;const{toast:n,render:i,className:a,swipeDirection:l=["down","right"],...s}=t,o=((ve=n.positionerProps)==null?void 0:ve.anchor)!==void 0;let c=[];o||(c=Array.isArray(l)?l:[l]);const p=c.length>0,u=vp(),[f,_]=k.useState(void 0),[y,v]=k.useState(!1),[h,m]=k.useState(!1),[d,g]=k.useState(!1),[w,b]=k.useState({x:0,y:0}),[x,C]=k.useState({x:0,y:0,scale:1}),[S,E]=k.useState(),[L,A]=k.useState(),[M,D]=k.useState(null),B=k.useRef(null),H=k.useRef({x:0,y:0}),F=k.useRef({x:0,y:0,scale:1}),$=k.useRef(void 0),I=k.useRef(0),R=k.useRef(!1),P=k.useRef({x:0,y:0}),N=k.useRef(!1),j=u.useState("toastIndex",n.id),U=u.useState("toastVisibleIndex",n.id),V=u.useState("toastOffsetY",n.id),ee=u.useState("focused"),Q=u.useState("expanded");eP({open:n.transitionStatus!=="ending",ref:B,onComplete(){n.transitionStatus==="ending"&&u.removeToast(n.id)}});const z=Xr((ne=!1)=>{const ie=B.current;if(!ie)return;const he=ie.style.height;ie.style.height="auto";const oe=ie.offsetHeight;ie.style.height=he;function me(){u.updateToastInternal(n.id,{ref:B,height:oe,...n.transitionStatus==="starting"?{transitionStatus:void 0}:{}})}ne?hn.flushSync(me):me()});qt(z,[z]);function O(ne,ie){let he=ne,oe=ie;return!c.includes("left")&&!c.includes("right")?he=ne>0?ne**En:-(Math.abs(ne)**En):(!c.includes("right")&&ne>0&&(he=ne**En),!c.includes("left")&&ne<0&&(he=-(Math.abs(ne)**En))),!c.includes("up")&&!c.includes("down")?oe=ie>0?ie**En:-(Math.abs(ie)**En):(!c.includes("down")&&ie>0&&(oe=ie**En),!c.includes("up")&&ie<0&&(oe=-(Math.abs(ie)**En))),{x:he,y:oe}}function K(ne){var oe;if(ne.button!==0)return;ne.pointerType==="touch"&&u.pauseTimers();const ie=yp(ne.nativeEvent);if(!(ie&&ie.closest('button,a,input,textarea,[role="button"],[data-swipe-ignore]'))){if(R.current=!1,$.current=void 0,I.current=0,H.current={x:ne.clientX,y:ne.clientY},P.current=H.current,B.current){const me=sP(B.current);F.current=me,C(me),b({x:me.x,y:me.y})}u.setHovering(!0),v(!0),m(!1),D(null),N.current=!0,(oe=B.current)==null||oe.setPointerCapture(ne.pointerId)}}function W(ne){if(!y)return;ne.preventDefault(),N.current&&(H.current={x:ne.clientX,y:ne.clientY},N.current=!1);const{clientY:ie,clientX:he,movementX:oe,movementY:me}=ne;(me<0&&ie>P.current.y||me>0&&ie<P.current.y)&&(P.current={x:P.current.x,y:ie}),(oe<0&&he>P.current.x||oe>0&&he<P.current.x)&&(P.current={x:he,y:P.current.y});const xe=he-H.current.x,ke=ie-H.current.y,Ne=ie-P.current.y,Ke=he-P.current.x;if(!h&&Math.sqrt(xe*xe+ke*ke)>=nP&&(m(!0),M===null)){const $e=c.includes("left")||c.includes("right"),X=c.includes("up")||c.includes("down");if($e&&X){const le=Math.abs(xe),ge=Math.abs(ke);D(le>ge?"horizontal":"vertical")}}let Ae;if(!$.current)M==="vertical"?ke>0?Ae="down":ke<0&&(Ae="up"):M==="horizontal"?xe>0?Ae="right":xe<0&&(Ae="left"):Math.abs(xe)>=Math.abs(ke)?Ae=xe>0?"right":"left":Ae=ke>0?"down":"up",Ae&&c.includes(Ae)&&($.current=Ae,I.current=Nv(Ae,xe,ke),_(Ae));else{const Oe=$.current,$e=Nv(Oe,Ke,Ne);$e>Wi?(R.current=!1,_(Oe)):!(c.includes("left")&&c.includes("right"))&&!(c.includes("up")&&c.includes("down"))&&I.current-$e>=rP&&(R.current=!0)}const Pe=O(xe,ke);let G=F.current.x,Y=F.current.y;M==="horizontal"?(c.includes("left")||c.includes("right"))&&(G+=Pe.x):(M==="vertical"||(c.includes("left")||c.includes("right"))&&(G+=Pe.x),(c.includes("up")||c.includes("down"))&&(Y+=Pe.y)),b({x:G,y:Y})}function te(ne){var xe;if(!y)return;if(v(!1),m(!1),D(null),(xe=B.current)==null||xe.releasePointerCapture(ne.pointerId),R.current){b({x:x.x,y:x.y}),_(void 0);return}let ie=!1;const he=w.x-x.x,oe=w.y-x.y;let me;for(const ke of c){switch(ke){case"right":he>Wi&&(ie=!0,me="right");break;case"left":he<-Wi&&(ie=!0,me="left");break;case"down":oe>Wi&&(ie=!0,me="down");break;case"up":oe<-Wi&&(ie=!0,me="up");break}if(ie)break}ie?(_(me),g(!0),u.closeToast(n.id)):(b({x:x.x,y:x.y}),_(void 0))}function J(ne){if(ne.key==="Escape"){if(!B.current||!yi(B.current,Ql(Js(B.current))))return;u.closeToast(n.id)}}k.useEffect(()=>{if(!p)return;const ne=B.current;if(!ne)return;function ie(he){yi(ne,he.target)&&he.preventDefault()}return ne.addEventListener("touchmove",ie,{passive:!1}),()=>{ne.removeEventListener("touchmove",ie)}},[p]);function _e(){if(!y&&w.x===x.x&&w.y===x.y&&!d)return{[ss.swipeMovementX]:"0px",[ss.swipeMovementY]:"0px"};const ne=w.x-x.x,ie=w.y-x.y;return{transition:y?"none":void 0,transform:y?`translateX(${w.x}px) translateY(${w.y}px) scale(${x.scale})`:void 0,[ss.swipeMovementX]:`${ne}px`,[ss.swipeMovementY]:`${ie}px`}}const ue=n.priority==="high",se={role:ue?"alertdialog":"dialog",tabIndex:0,"aria-modal":!1,"aria-labelledby":S,"aria-describedby":L,"aria-hidden":ue&&!ee?!0:void 0,onPointerDown:p?K:void 0,onPointerMove:p?W:void 0,onPointerUp:p?te:void 0,onKeyDown:J,inert:qA(n.limited),style:{..._e(),[ss.index]:n.transitionStatus==="ending"?j:U,[ss.offsetY]:`${V}px`,[ss.height]:n.height?`${n.height}px`:void 0}},re=k.useMemo(()=>({rootRef:B,toast:n,titleId:S,setTitleId:E,descriptionId:L,setDescriptionId:A,swiping:y,swipeDirection:f,recalculateHeight:z,index:j,visibleIndex:U,expanded:Q}),[n,S,L,y,f,z,j,U,Q]),ae={transitionStatus:n.transitionStatus,expanded:Q,limited:n.limited||!1,type:n.type,swiping:re.swiping,swipeDirection:re.swipeDirection},ye=Ls("div",t,{ref:[r,re.rootRef],state:ae,stateAttributesMapping:tP,props:[se,s]});return T.jsx(_S.Provider,{value:re,children:ye})}),oP=k.forwardRef(function(t,r){const{render:n,className:i,id:a,children:l,...s}=t,{toast:o,setDescriptionId:c}=wp(),p=l??o.description,u=!!p,f=cp(a);qt(()=>{if(u)return c(f),()=>{c(void 0)}},[u,f,c]);const _={type:o.type},y=Ls("p",t,{ref:r,state:_,props:{...s,id:f,children:p}});return u?y:null}),aP=k.forwardRef(function(t,r){const{render:n,className:i,id:a,children:l,...s}=t,{toast:o,setTitleId:c}=wp(),p=l??o.title,u=!!p,f=cp(a);qt(()=>{if(u)return c(f),()=>{c(void 0)}},[u,f,c]);const _={type:o.type},y=Ls("h2",t,{ref:r,state:_,props:{...s,id:f,children:p}});return u?y:null}),lP=k.forwardRef(function(t,r){const{render:n,className:i,disabled:a,nativeButton:l=!0,...s}=t,o=vp(),{toast:c}=wp(),p=o.useState("expanded"),[u,f]=k.useState(!1),{getButtonProps:_,buttonRef:y}=Uw({disabled:a,native:l}),v={type:c.type};return Ls("button",t,{ref:[r,y],state:v,props:[{"aria-hidden":!p&&!u,onClick(){o.closeToast(c.id)},onFocus(){f(!0)},onBlur(){f(!1)}},s,_]})});function cP(){const e=k.useContext(gp);if(!e)throw new Error(Yr(73));const t=e.useState("toasts");return k.useMemo(()=>({toasts:t,add:e.addToast,close:e.closeToast,update:e.updateToast,promise:e.promiseToast}),[t,e])}function uP(){const e=new Set;function t(r){e.forEach(n=>n(r))}return{" subscribe":function(n){return e.add(n),()=>{e.delete(n)}},add(r){const n=r.id||vS("toast"),i={...r,id:n,transitionStatus:"starting"};return t({action:"add",options:i}),n},close(r){t({action:"close",options:{id:r}})},update(r,n){t({action:"update",options:{...n,id:r}})},promise(r,n){let i=r;return t({action:"promise",options:{...n,promise:r,setPromise(a){i=a}}}),i}}}const hP=5e3,yS=uP();function dP({toast:e}){return T.jsxs(iP,{toast:e,className:Xl("relative flex w-80 items-start gap-3 border bg-elevated p-4 shadow-lg","data-[swipe=move]:translate-x-[var(--toast-swipe-move-x)]","data-[ending-style]:translate-x-[var(--toast-swipe-end-x)]","data-[ending-style]:opacity-0","data-[starting-style]:translate-y-2 data-[starting-style]:opacity-0","transition-all duration-200",e.type==="error"&&"border-error/50",e.type==="success"&&"border-approval/50",(!e.type||e.type==="info")&&"border-border"),children:[T.jsxs("div",{className:"flex-1 min-w-0",children:[T.jsx(aP,{className:Xl("text-sm font-medium",e.type==="error"&&"text-error",e.type==="success"&&"text-approval",(!e.type||e.type==="info")&&"text-primary"),children:e.title}),e.description&&T.jsx(oP,{className:"mt-1 text-xs text-muted line-clamp-2",children:e.description})]}),T.jsx(lP,{className:"shrink-0 text-muted hover:text-primary transition-colors","aria-label":"Close",children:T.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[T.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),T.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})}function fP(){const{toasts:e}=cP();return T.jsx(T.Fragment,{children:e.map(t=>T.jsx(dP,{toast:t},t.id))})}function pP(){return T.jsxs(VA,{timeout:hP,toastManager:yS,children:[T.jsx(fP,{}),T.jsx(GA,{className:"fixed bottom-4 right-4 z-[100] flex flex-col gap-2"})]})}const jv=["CONNECTING","OPEN","CLOSING","CLOSED"],mP=3e3,gP=15e3,vP=5e3,_P=1e4,yP=2e4,wP=1e4,SP=3e3;class xP{constructor(){this.ws=null,this.listeners=new Set,this.statusListeners=new Set,this.status="connecting",this.error=null,this.reconnectAttempts=0,this.reconnectTimer=null,this.connectTimer=null,this.manualClose=!1,this.lastTick=Date.now(),this.wakeCheckInterval=null,this.lifecycleStarted=!1,this.heartbeatTimer=null,this.pongTimer=null,this.lastForceReconnectTs=0,this.pingSeq=0,this.connectionEpoch=0,this.onVisibilityChange=()=>{if(Qe("ws_visibility",{state:document.visibilityState,...this.wsSnap()}),document.visibilityState==="visible"){const t=Date.now(),n=t-this.lastTick>_P;this.lastTick=t,this.forceReconnect("visibilitychange",n),!n&&this.status==="connected"&&(this.startHeartbeat(),this.sendVerificationPing())}else this.stopHeartbeat(),this.reconnectTimer&&(window.clearTimeout(this.reconnectTimer),this.reconnectTimer=null)},this.onPageShow=t=>{Qe("ws_pageshow",{persisted:t.persisted,...this.wsSnap()}),t.persisted&&(this.lastTick=Date.now(),this.forceReconnect("pageshow",!0))}}wsSnap(){return{status:this.status,ws:this.ws?jv[this.ws.readyState]:null,attempt:this.reconnectAttempts}}connect(){if(this.ws){const i=this.ws.readyState===WebSocket.OPEN;if(i&&this.status==="connected"){Qe("ws_connect_skip",{reason:"already_open",...this.wsSnap()});return}Qe("ws_connect_destroy_zombie",{reason:i?"open_desynced":"not_open",...this.wsSnap()}),this.destroySocket()}this.manualClose=!1,this.clearConnectTimer(),this.setStatus("connecting");const r=`${window.location.protocol==="https:"?"wss":"ws"}://${window.location.host}/ws`;Qe("ws_connect",{url:r,...this.wsSnap()});const n=new WebSocket(r);this.ws=n,this.connectTimer=window.setTimeout(()=>{if(this.ws!==n)return;this.connectTimer=null,n.readyState===WebSocket.OPEN&&this.status==="connected"||(Qe("ws_connect_timeout",{wsState:jv[n.readyState],managerStatus:this.status,...this.wsSnap()}),this.destroySocket(),this.scheduleReconnect())},mP),n.onopen=()=>{Qe("ws_onopen",this.wsSnap()),this.clearConnectTimer(),this.reconnectAttempts=0,this.connectionEpoch+=1,this.setStatus("connected"),this.startHeartbeat()},n.onmessage=i=>{try{const a=JSON.parse(i.data);if(a.type==="pong"){a.seq===this.pingSeq&&this.clearPongTimer();return}this.listeners.forEach(l=>l(a))}catch{}},n.onerror=()=>{Qe("ws_onerror",this.wsSnap()),this.clearConnectTimer()},n.onclose=i=>{Qe("ws_onclose",{code:i.code,reason:i.reason,clean:i.wasClean,...this.wsSnap()}),this.clearConnectTimer(),this.ws=null,this.manualClose?this.setStatus("disconnected"):this.scheduleReconnect()}}disconnect(){this.manualClose=!0,this.clearConnectTimer(),this.reconnectTimer&&(window.clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.destroySocket(),this.setStatus("disconnected")}startLifecycleListeners(){this.lifecycleStarted||typeof document>"u"||typeof window>"u"||(this.lifecycleStarted=!0,document.addEventListener("visibilitychange",this.onVisibilityChange),window.addEventListener("pageshow",this.onPageShow),this.lastTick=Date.now(),this.wakeCheckInterval=window.setInterval(()=>{const t=Date.now(),r=t-this.lastTick;this.isHidden()||(r>gP&&(Qe("ws_time_jump",{gapMs:r,...this.wsSnap()}),this.forceReconnect("time_jump",!0)),this.lastTick=t)},vP))}stopLifecycleListeners(){this.lifecycleStarted&&(this.lifecycleStarted=!1,document.removeEventListener("visibilitychange",this.onVisibilityChange),window.removeEventListener("pageshow",this.onPageShow),this.wakeCheckInterval!==null&&(window.clearInterval(this.wakeCheckInterval),this.wakeCheckInterval=null))}send(t){var r;if(((r=this.ws)==null?void 0:r.readyState)!==WebSocket.OPEN)return!1;try{return this.ws.send(JSON.stringify(t)),!0}catch(n){return Qe("ws_send_error",{messageType:t.type,error:n instanceof Error?n.message:String(n),...this.wsSnap()}),this.destroySocket(),this.scheduleReconnect(),!1}}subscribe(t){return this.listeners.add(t),()=>this.listeners.delete(t)}subscribeStatus(t){return this.statusListeners.add(t),t(this.status,this.error,this.connectionEpoch),()=>this.statusListeners.delete(t)}getStatus(){return this.status}getConnectionEpoch(){return this.connectionEpoch}forceReconnect(t="unknown",r=!1){var a;if(this.manualClose){Qe("ws_force_skip",{trigger:t,reason:"manual_close"});return}const n=Date.now(),i=r?200:500;if(n-this.lastForceReconnectTs<i){Qe("ws_force_skip",{trigger:t,reason:"debounce",force:r});return}if(!r&&((a=this.ws)==null?void 0:a.readyState)===WebSocket.OPEN&&this.status==="connected"){Qe("ws_force_skip",{trigger:t,reason:"already_connected"});return}this.lastForceReconnectTs=n,Qe("ws_force_reconnect",{trigger:t,force:r,...this.wsSnap()}),this.reconnectAttempts=0,this.reconnectTimer&&(window.clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.destroySocket(),this.connect()}startHeartbeat(){this.stopHeartbeat(),this.heartbeatTimer=window.setInterval(()=>{var t;((t=this.ws)==null?void 0:t.readyState)===WebSocket.OPEN&&(this.pingSeq+=1,this.send({type:"ping",seq:this.pingSeq})&&(this.clearPongTimer(),this.pongTimer=window.setTimeout(()=>{this.pongTimer=null,Qe("ws_pong_timeout",this.wsSnap()),this.destroySocket(),this.scheduleReconnect()},wP)))},yP)}sendVerificationPing(){var r;if(((r=this.ws)==null?void 0:r.readyState)!==WebSocket.OPEN)return;this.pingSeq+=1;const t=this.pingSeq;Qe("ws_resume_verify",{seq:t,...this.wsSnap()}),this.send({type:"ping",seq:t})&&(this.clearPongTimer(),this.pongTimer=window.setTimeout(()=>{this.pongTimer=null,Qe("ws_resume_verify_timeout",{seq:t,...this.wsSnap()}),this.destroySocket(),this.reconnectAttempts=0,this.connect()},SP))}stopHeartbeat(){this.heartbeatTimer!==null&&(window.clearInterval(this.heartbeatTimer),this.heartbeatTimer=null),this.clearPongTimer()}clearPongTimer(){this.pongTimer!==null&&(window.clearTimeout(this.pongTimer),this.pongTimer=null)}setStatus(t,r=null){this.status=t,this.error=r,this.statusListeners.forEach(n=>n(t,r,this.connectionEpoch))}scheduleReconnect(){if(this.stopHeartbeat(),this.isHidden()){Qe("ws_schedule_skip",{reason:"hidden",...this.wsSnap()}),this.setStatus("reconnecting");return}this.reconnectAttempts+=1;const t=Math.min(1e3*2**(this.reconnectAttempts-1),3e4);Qe("ws_schedule_reconnect",{delay:t,...this.wsSnap()}),this.setStatus("reconnecting"),this.reconnectTimer&&window.clearTimeout(this.reconnectTimer),this.reconnectTimer=window.setTimeout(()=>{this.reconnectTimer=null,this.connect()},t)}isHidden(){return typeof document<"u"&&document.visibilityState==="hidden"}clearConnectTimer(){this.connectTimer&&(window.clearTimeout(this.connectTimer),this.connectTimer=null)}destroySocket(){if(this.clearConnectTimer(),this.stopHeartbeat(),!this.ws)return;const t=this.ws;this.ws=null,t.onopen=null,t.onmessage=null,t.onerror=null,t.onclose=null;try{t.close()}catch{}}}const sn=new xP;function bP(){const e=Ge(o=>o.setConnectionStatus),t=Ge(o=>o.setConnectionError),[r,n]=k.useState(sn.getStatus()),[i,a]=k.useState(sn.getConnectionEpoch());k.useEffect(()=>{sn.connect(),sn.startLifecycleListeners();const o=sn.subscribeStatus((c,p,u)=>{n(c),a(u),e(c),t(p)});return()=>{o(),sn.stopLifecycleListeners()}},[t,e]);const l=k.useMemo(()=>o=>{sn.send(o)},[]),s=k.useMemo(()=>sn.subscribe.bind(sn),[]);return{status:r,connectionEpoch:i,sendMessage:l,subscribe:s}}const CP=100;function EP({viewport:e,win:t,doc:r}){if(!e)return!1;const n=Math.max(0,e.offsetTop||0),i=Math.max(0,e.offsetLeft||0),a=t.innerHeight-(e.height+n),l=Math.max(0,a),s=Math.max(0,e.height||0),o=Math.max(0,e.width||0);return r.documentElement.style.setProperty("--keyboard-inset",`${l}px`),r.documentElement.style.setProperty("--viewport-offset-top",`${n}px`),r.documentElement.style.setProperty("--viewport-offset-left",`${i}px`),r.documentElement.style.setProperty("--visual-viewport-height",`${s}px`),r.documentElement.style.setProperty("--visual-viewport-width",`${o}px`),l>CP?r.documentElement.classList.add("keyboard-visible"):r.documentElement.classList.remove("keyboard-visible"),!0}function kP(e){e.documentElement.style.removeProperty("--keyboard-inset"),e.documentElement.style.removeProperty("--viewport-offset-top"),e.documentElement.style.removeProperty("--viewport-offset-left"),e.documentElement.style.removeProperty("--visual-viewport-height"),e.documentElement.style.removeProperty("--visual-viewport-width"),e.documentElement.classList.remove("keyboard-visible")}function LP(){k.useEffect(()=>{const e=window.visualViewport;if(!e)return;let t=null,r=null;const n=()=>{var v;const _=document.activeElement;if(!_)return!1;const y=(v=_.tagName)==null?void 0:v.toLowerCase();return y==="input"||y==="textarea"?!0:!!_.isContentEditable},i=()=>{EP({viewport:e,win:window,doc:document})},a=()=>{if(typeof window.requestAnimationFrame!="function"){i();return}t!==null&&window.cancelAnimationFrame(t);const _=performance.now(),y=()=>{i(),performance.now()-_<1500?t=window.requestAnimationFrame(y):t=null};t=window.requestAnimationFrame(y)},l=()=>{if(!n()){o();return}i()},s=()=>{r!==null||typeof window.setInterval!="function"||(r=window.setInterval(l,250),l())},o=()=>{r===null||typeof window.clearInterval!="function"||(window.clearInterval(r),r=null)},c=()=>{n()?(a(),s(),i()):o()},p=()=>{c()},u=()=>{c()},f=()=>{a()};return i(),c(),e.addEventListener("resize",i),e.addEventListener("scroll",i),typeof window.addEventListener=="function"&&(window.addEventListener("resize",i),window.addEventListener("orientationchange",f)),typeof document.addEventListener=="function"&&(document.addEventListener("focusin",p),document.addEventListener("focusout",u),document.addEventListener("focus",p,!0),document.addEventListener("blur",u,!0)),()=>{e.removeEventListener("resize",i),e.removeEventListener("scroll",i),typeof window.removeEventListener=="function"&&(window.removeEventListener("resize",i),window.removeEventListener("orientationchange",f)),typeof document.removeEventListener=="function"&&(document.removeEventListener("focusin",p),document.removeEventListener("focusout",u),document.removeEventListener("focus",p,!0),document.removeEventListener("blur",u,!0)),t!==null&&typeof window.cancelAnimationFrame=="function"&&window.cancelAnimationFrame(t),o(),kP(document)}},[])}function TP(){const[e,t]=k.useState(!1),[r,n]=k.useState(void 0),[i,a]=k.useState(void 0),[l,s]=k.useState(void 0),[o,c]=k.useState(!1),[p,u]=k.useState(null),[f,_]=k.useState(null),y=Ge(G=>G.sessions),v=Ge(G=>G.agentSessions),h=Ge(G=>G.selectedSessionId),m=Ge(G=>G.setSessions),d=Ge(G=>G.setAgentSessions),g=Ge(G=>G.setHostStatuses),w=Ge(G=>G.updateSession),b=Ge(G=>G.setSelectedSessionId),x=Ge(G=>G.hasLoaded),C=Ge(G=>G.connectionStatus),S=Ge(G=>G.connectionError),E=Ge(G=>G.clearExitingSession),L=Ge(G=>G.markSessionExiting),A=Ge(G=>G.setRemoteAllowControl),M=Ge(G=>G.setRemoteAllowAttach),D=Ge(G=>G.setHostLabel),B=Ge(G=>G.hostStatuses),H=Ge(G=>G.remoteAllowControl),F=Ge(G=>G.hostLabel),$=Gl(G=>G.theme),I=pe(G=>G.defaultProjectDir),R=pe(G=>G.commandPresets),P=pe(G=>G.defaultPresetId),N=pe(G=>G.lastProjectPath),j=pe(G=>G.setLastProjectPath),U=pe(G=>G.addRecentPath),V=pe(G=>G.shortcutModifier),ee=pe(G=>G.sidebarWidth),Q=pe(G=>G.setSidebarWidth),z=pe(G=>G.projectFilters),O=pe(G=>G.hostFilters),K=pe(G=>G.soundOnPermission),W=pe(G=>G.soundOnIdle),{sendMessage:te,subscribe:J,connectionEpoch:_e}=bP();LP(),k.useEffect(()=>{if(typeof document>"u"||!K&&!W)return;let G=!1;const Y=()=>{G&&!z3()||(G=!0,hd())};return document.addEventListener("click",Y,{passive:!0}),document.addEventListener("keydown",Y,{passive:!0}),document.addEventListener("touchstart",Y,{passive:!0}),()=>{document.removeEventListener("click",Y),document.removeEventListener("keydown",Y),document.removeEventListener("touchstart",Y)}},[K,W]);const ue=k.useRef(!1),se=k.useCallback(G=>{G.preventDefault(),ue.current=!0,document.body.style.cursor="col-resize",document.body.style.userSelect="none"},[]);k.useEffect(()=>{if(typeof document>"u"||typeof document.addEventListener!="function")return;const G=Oe=>{if(!ue.current)return;const $e=Oe.clientX;Q(Math.max(ey,Math.min(ty,$e)))},Y=()=>{ue.current&&(ue.current=!1,document.body.style.cursor="",document.body.style.userSelect="")};return document.addEventListener("mousemove",G),document.addEventListener("mouseup",Y),()=>{document.removeEventListener("mousemove",G),document.removeEventListener("mouseup",Y)}},[Q]),k.useEffect(()=>{const G=J(Y=>{var Oe,$e;if(Y.type==="sessions"){const X=Ge.getState().sessions,{soundOnPermission:le,soundOnIdle:ge}=pe.getState();if(le||ge)for(const We of Y.sessions){const Z=X.find(Le=>Le.id===We.id);Z&&Z.status!==We.status&&(Z.status!=="permission"&&We.status==="permission"&&le&&dd(),Z.status==="working"&&We.status==="waiting"&&ge&&fd())}m(Y.sessions)}if(Y.type==="host-status"&&g(Y.hosts),Y.type==="server-config"&&(A(Y.remoteAllowControl),M(Y.remoteAllowAttach),D(Y.hostLabel),Y.clientLogLevel&&HR(Y.clientLogLevel)),Y.type==="session-update"){const le=Ge.getState().sessions.find(Z=>Z.id===Y.session.id),ge=le==null?void 0:le.status,We=Y.session.status;if(w(Y.session),ge){const{soundOnPermission:Z,soundOnIdle:Le}=pe.getState();ge!=="permission"&&We==="permission"&&Z&&dd(),ge==="working"&&We==="waiting"&&Le&&fd()}}if(Y.type==="session-created"){const X=Ge.getState().sessions;X.some(We=>We.id===Y.session.id)||m([Y.session,...X]),b(Y.session.id),U(Y.session.projectPath);const{projectFilters:le,setProjectFilters:ge}=pe.getState();le.length>0&&!le.includes(Y.session.projectPath)&&ge([...le,Y.session.projectPath])}if(Y.type==="session-removed"){const X=Ge.getState().sessions,le=X.filter(ge=>ge.id!==Y.sessionId);le.length!==X.length&&m(le)}if(Y.type==="agent-sessions"&&d(Y.active,Y.inactive),Y.type==="session-orphaned"&&!Y.supersededBy){const X=Ge.getState().sessions,le=X.filter(ge=>{var We;return((We=ge.agentSessionId)==null?void 0:We.trim())!==Y.session.sessionId});le.length!==X.length&&m(le)}if(Y.type==="session-activated"){const X=Ge.getState().sessions.find(le=>le.tmuxWindow===Y.window);X&&w({...X,agentSessionId:Y.session.sessionId,agentSessionName:Y.session.displayName,logFilePath:Y.session.logFilePath,isPinned:Y.session.isPinned,lastUserMessage:Y.session.lastUserMessage??X.lastUserMessage})}if(Y.type==="session-resume-result")if(Y.ok&&Y.session){const X=Ge.getState().sessions;X.some(le=>le.id===Y.session.id)||m([Y.session,...X]),b(Y.session.id)}else Y.ok||(u(`${(Oe=Y.error)==null?void 0:Oe.code}: ${($e=Y.error)==null?void 0:$e.message}`),window.setTimeout(()=>u(null),6e3));Y.type==="terminal-error"&&(!Y.sessionId||Y.sessionId===h)&&(u(`${Y.code}: ${Y.message}`),window.setTimeout(()=>u(null),6e3)),Y.type==="terminal-ready"&&Y.sessionId===h&&u(null),Y.type==="error"&&(u(Y.message),window.setTimeout(()=>u(null),6e3)),Y.type==="kill-failed"&&(E(Y.sessionId),u(Y.message),window.setTimeout(()=>u(null),6e3)),Y.type==="session-pin-result"&&!Y.ok&&Y.error&&(u(Y.error),window.setTimeout(()=>u(null),6e3)),Y.type==="session-resurrection-failed"&&yS.add({title:"Session resurrection failed",description:`"${Y.displayName}" could not be resumed: ${Y.error}`,type:"error",timeout:8e3})});return()=>{G()}},[h,U,E,te,b,m,d,g,A,M,D,J,w]);const re=k.useMemo(()=>y.find(G=>G.id===h)||null,[h,y]);k.useEffect(()=>{re!=null&&re.projectPath&&!re.remote&&j(re.projectPath)},[re==null?void 0:re.projectPath,re==null?void 0:re.remote,j]);const ae=pe(G=>G.sessionSortMode),ye=pe(G=>G.sessionSortDirection),ve=pe(G=>G.manualSessionOrder),ne=k.useMemo(()=>rp(y,{mode:ae,direction:ye,manualOrder:ve}),[y,ae,ye,ve]),ie=k.useMemo(()=>{let G=ne;return z.length>0&&(G=G.filter(Y=>z.includes(Y.projectPath))),O.length>0&&(G=G.filter(Y=>O.includes(Y.host??""))),G},[ne,z,O]);k.useEffect(()=>{h&&ie.length>0&&!ie.some(G=>G.id===h)&&b(ie[0].id)},[h,ie,b]),k.useEffect(()=>{window.matchMedia("(max-width: 767px)").matches&&x&&h===null&&ne.length>0&&b(ne[0].id)},[x,h,ne,b]);const he=k.useCallback(G=>{L(G),te({type:"session-kill",sessionId:G})},[L,te]);k.useEffect(()=>{const G=Zo(V),Y=Oe=>{if(Oe.defaultPrevented)return;const $e=Oe.code,X=$C(Oe,G);if(X&&($e==="BracketLeft"||$e==="BracketRight")){Oe.preventDefault();const le=ie;if(le.length===0)return;const ge=le.findIndex(Le=>Le.id===h);if(ge===-1){b(le[0].id);return}const Z=(ge+($e==="BracketLeft"?-1:1)+le.length)%le.length;b(le[Z].id);return}if(X&&$e==="KeyN"){Oe.preventDefault(),e||t(!0);return}if(X&&$e==="KeyX"){Oe.preventDefault(),h&&!e&&he(h);return}};return window.addEventListener("keydown",Y),()=>window.removeEventListener("keydown",Y)},[e,h,b,ie,he,V]);const oe=()=>{n(void 0),a(void 0),s(void 0),t(!0)},me=()=>c(!0),xe=(G,Y,Oe,$e)=>{te({type:"session-create",projectPath:G,name:Y,command:Oe,host:$e}),$e||j(G)},ke=G=>{te({type:"session-resume",sessionId:G})},Ne=(G,Y)=>{te({type:"session-rename",sessionId:G,newName:Y})},Ke=k.useCallback(G=>{const Y=y.find(Oe=>Oe.id===G);Y&&te({type:"session-create",projectPath:Y.projectPath,command:Y.command||void 0,host:Y.remote&&Y.host?Y.host:void 0})},[y,te]),Ae=k.useCallback((G,Y)=>{te({type:"session-pin",sessionId:G,isPinned:Y})},[te]);k.useEffect(()=>{document.documentElement.setAttribute("data-theme",$)},[$]),k.useEffect(()=>{fetch("/api/server-info").then(G=>G.json()).then(G=>_(G)).catch(()=>{})},[]);const Pe=k.useMemo(()=>F?B.filter(G=>G.host!==F):B,[B,F]);return T.jsxs("div",{className:"flex h-full overflow-hidden",children:[T.jsxs("div",{className:"hidden h-full flex-col md:flex md:shrink-0",style:{width:ee},children:[T.jsx(zC,{connectionStatus:C,onNewSession:oe,onOpenSettings:me,tailscaleIp:(f==null?void 0:f.tailscaleIp)??null}),T.jsx(hw,{sessions:y,inactiveSessions:v.inactive,selectedSessionId:h,onSelect:b,onRename:Ne,onResume:ke,onKill:he,onDuplicate:Ke,onSetPinned:Ae,loading:!x,error:S||p})]}),T.jsx("div",{className:"hidden md:block w-1 shrink-0 cursor-col-resize bg-transparent transition-colors hover:bg-white/10 active:bg-white/20",onMouseDown:se}),T.jsx(sM,{session:re,sessions:ie,connectionStatus:C,connectionEpoch:_e,sendMessage:te,subscribe:J,onClose:()=>b(null),onSelectSession:b,onNewSession:oe,onKillSession:he,onRenameSession:Ne,onOpenSettings:me,onResumeSession:ke,onSetPinned:Ae,inactiveSessions:v.inactive,loading:!x,error:S||p}),T.jsx(oM,{isOpen:e,onClose:()=>t(!1),onCreate:xe,defaultProjectDir:I,commandPresets:R,defaultPresetId:P,lastProjectPath:N,activeProjectPath:re&&!re.remote?re.projectPath:void 0,remoteHosts:Pe,remoteAllowControl:H,initialHost:r,initialPath:i,initialCommand:l}),T.jsx(W3,{isOpen:o,onClose:()=>c(!1)}),T.jsx(pP,{})]})}const RP="modulepreload",DP=function(e){return"/"+e},Fv={},MP=function(t,r,n){let i=Promise.resolve();if(r&&r.length>0){document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),s=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));i=Promise.allSettled(r.map(o=>{if(o=DP(o),o in Fv)return;Fv[o]=!0;const c=o.endsWith(".css"),p=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${o}"]${p}`))return;const u=document.createElement("link");if(u.rel=c?"stylesheet":RP,c||(u.as="script"),u.crossOrigin="",u.href=o,s&&u.setAttribute("nonce",s),document.head.appendChild(u),c)return new Promise((f,_)=>{u.addEventListener("load",f),u.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${o}`)))})}))}function a(l){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=l,window.dispatchEvent(s),!s.defaultPrevented)throw l}return i.then(l=>{for(const s of l||[])s.status==="rejected"&&a(s.reason);return t().catch(a)})};function AP(e={}){const{immediate:t=!1,onNeedRefresh:r,onOfflineReady:n,onRegistered:i,onRegisteredSW:a,onRegisterError:l}=e;let s,o;const c=async(u=!0)=>{await o};async function p(){if("serviceWorker"in navigator){if(s=await MP(async()=>{const{Workbox:u}=await import("./workbox-window.prod.es5-vqzQaGvo.js");return{Workbox:u}},[]).then(({Workbox:u})=>new u("/sw.js",{scope:"/",type:"classic"})).catch(u=>{l==null||l(u)}),!s)return;s.addEventListener("activated",u=>{(u.isUpdate||u.isExternal)&&window.location.reload()}),s.addEventListener("installed",u=>{u.isUpdate||n==null||n()}),s.register({immediate:t}).then(u=>{a?a("/sw.js",u):i==null||i(u)}).catch(u=>{l==null||l(u)})}}return o=p(),c}Qo()&&document.documentElement.classList.add("ios");NC()&&document.documentElement.classList.add("ios-pwa");AP({immediate:!0,onRegisteredSW(e,t){t&&(setInterval(()=>{t.update()},5*60*1e3),document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&t.update()}))}});const wS=document.getElementById("root");if(!wS)throw new Error("Root element not found");Z0(wS).render(T.jsx(gt.StrictMode,{children:T.jsx(TP,{})}));
316
+ */var Cc=k,_A=fS;function yA(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var wA=typeof Object.is=="function"?Object.is:yA,SA=_A.useSyncExternalStore,xA=Cc.useRef,bA=Cc.useEffect,CA=Cc.useMemo,EA=Cc.useDebugValue;mS.useSyncExternalStoreWithSelector=function(e,t,r,n,i){var a=xA(null);if(a.current===null){var l={hasValue:!1,value:null};a.current=l}else l=a.current;a=CA(function(){function o(_){if(!c){if(c=!0,p=_,_=n(_),i!==void 0&&l.hasValue){var y=l.value;if(i(y,_))return u=y}return u=_}if(y=u,wA(p,_))return y;var v=n(_);return i!==void 0&&i(y,v)?(p=_,y):(p=_,u=v)}var c=!1,p,u,f=r===void 0?null:r;return[function(){return o(t())},f===null?void 0:function(){return o(f())}]},[t,r,n,i]);var s=SA(e,a[0],a[1]);return bA(function(){l.hasValue=!0,l.value=s},[s]),EA(s),s};pS.exports=mS;var kA=pS.exports;const LA=ap(19),TA=LA?DA:MA;function gS(e,t,r,n,i){return TA(e,t,r,n,i)}function RA(e,t,r,n,i){const a=k.useCallback(()=>t(e.getSnapshot(),r,n,i),[e,t,r,n,i]);return fS.useSyncExternalStore(e.subscribe,a,a)}function DA(e,t,r,n,i){return RA(e,t,r,n,i)}function MA(e,t,r,n,i){return kA.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,a=>t(a,r,n,i))}class AA{constructor(t){tt(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));tt(this,"getSnapshot",()=>this.state);this.state=t,this.listeners=new Set,this.updateTick=0}setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const r=this.updateTick;for(const n of this.listeners){if(r!==this.updateTick)return;n(t)}}update(t){for(const r in t)if(!Object.is(this.state[r],t[r])){this.setState({...this.state,...t});return}}set(t,r){Object.is(this.state[t],r)||this.setState({...this.state,[t]:r})}notifyAll(){const t={...this.state};this.setState(t)}use(t,r,n,i){return gS(this,t,r,n,i)}}class PA extends AA{constructor(t,r={},n){super(t),this.context=r,this.selectors=n}useSyncedValue(t,r){k.useDebugValue(t),qt(()=>{this.state[t]!==r&&this.set(t,r)},[t,r])}useSyncedValueWithCleanup(t,r){const n=this;qt(()=>(n.state[t]!==r&&n.set(t,r),()=>{n.set(t,void 0)}),[n,t,r])}useSyncedValues(t){const r=this,n=Object.values(t);qt(()=>{r.update(t)},[r,...n])}useControlledProp(t,r){k.useDebugValue(t);const n=r!==void 0;qt(()=>{n&&!Object.is(this.state[t],r)&&super.setState({...this.state,[t]:r})},[t,r,n])}select(t,r,n,i){const a=this.selectors[t];return a(this.state,r,n,i)}useState(t,r,n,i){return k.useDebugValue(t),gS(this,this.selectors[t],r,n,i)}useContextCallback(t,r){k.useDebugValue(t);const n=Xr(r??ur);this.context[t]=n}useStateSetter(t){const r=k.useRef(void 0);return r.current===void 0&&(r.current=n=>{this.set(t,n)}),r.current}observe(t,r){let n;typeof t=="function"?n=t:n=this.selectors[t];let i=n(this.state);return r(i,i,this),this.subscribe(a=>{const l=n(a);if(!Object.is(i,l)){const s=i;i=l,r(l,s,this)}})}}const $a=null;class IA{constructor(){tt(this,"callbacks",[]);tt(this,"callbacksCount",0);tt(this,"nextId",1);tt(this,"startId",1);tt(this,"isScheduled",!1);tt(this,"tick",t=>{var i;this.isScheduled=!1;const r=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let a=0;a<r.length;a+=1)(i=r[a])==null||i.call(r,t)})}request(t){const r=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,(!this.isScheduled||!1)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),r}cancel(t){const r=t-this.startId;r<0||r>=this.callbacks.length||(this.callbacks[r]=null,this.callbacksCount-=1)}}const Ha=new IA;class _p{constructor(){tt(this,"currentId",$a);tt(this,"cancel",()=>{this.currentId!==$a&&(Ha.cancel(this.currentId),this.currentId=$a)});tt(this,"disposeEffect",()=>this.cancel)}static create(){return new _p}static request(t){return Ha.request(t)}static cancel(t){return Ha.cancel(t)}request(t){this.cancel(),this.currentId=Ha.request(()=>{this.currentId=$a,t()})}}function BA(){const e=ks(_p.create).current;return mp(e.disposeEffect),e}const Ui=0;class Ko{constructor(){tt(this,"currentId",Ui);tt(this,"clear",()=>{this.currentId!==Ui&&(clearTimeout(this.currentId),this.currentId=Ui)});tt(this,"disposeEffect",()=>this.clear)}static create(){return new Ko}start(t,r){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Ui,r()},t)}isStarted(){return this.currentId!==Ui}}function OA(){const e=ks(Ko.create).current;return mp(e.disposeEffect),e}let Ov=0;function vS(e){return Ov+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${Ov}`}function Js(e){return(e==null?void 0:e.ownerDocument)||document}function Du(e,t){if(typeof e=="string")return{description:e};if(typeof e=="function"){const r=e(t);return typeof r=="string"?{description:r}:r}return e}const aa=typeof navigator<"u",Mu=HA(),NA=UA(),jA=zA();typeof CSS>"u"||!CSS.supports||CSS.supports("-webkit-backdrop-filter:none");Mu.platform==="MacIntel"&&Mu.maxTouchPoints>1||/iP(hone|ad|od)|iOS/.test(Mu.platform);const FA=aa&&/apple/i.test(navigator.vendor);aa&&NA.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints;const $A=jA.includes("jsdom/");function HA(){if(!aa)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e!=null&&e.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function zA(){if(!aa)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:r})=>`${t}/${r}`).join(" "):navigator.userAgent}function UA(){if(!aa)return"";const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform??""}function Ql(e){var r;let t=e.activeElement;for(;((r=t==null?void 0:t.shadowRoot)==null?void 0:r.activeElement)!=null;)t=t.shadowRoot.activeElement;return t}function yi(e,t){var n;if(!e||!t)return!1;const r=(n=t.getRootNode)==null?void 0:n.call(t);if(e.contains(t))return!0;if(r&&PM(r)){let i=t;for(;i;){if(e===i)return!0;i=i.parentNode||i.host}}return!1}function yp(e){return"composedPath"in e?e.composedPath()[0]:e.target}function pd(e){if(!e||$A)return!0;try{return e.matches(":focus-visible")}catch{return!0}}const za=lA(e=>e.toasts,e=>{const t=new Map;let r=0,n=0;return e.forEach((i,a)=>{const l=i.transitionStatus==="ending";t.set(i.id,{value:i,domIndex:a,visibleIndex:l?-1:r,offsetY:n}),n+=i.height||0,l||(r+=1)}),t}),nn={toasts:Tr(e=>e.toasts),isEmpty:Tr(e=>e.toasts.length===0),toast:Tr(za,(e,t)=>{var r;return(r=e.get(t))==null?void 0:r.value}),toastIndex:Tr(za,(e,t)=>{var r;return((r=e.get(t))==null?void 0:r.domIndex)??-1}),toastOffsetY:Tr(za,(e,t)=>{var r;return((r=e.get(t))==null?void 0:r.offsetY)??0}),toastVisibleIndex:Tr(za,(e,t)=>{var r;return((r=e.get(t))==null?void 0:r.visibleIndex)??-1}),hovering:Tr(e=>e.hovering),focused:Tr(e=>e.focused),expanded:Tr(e=>e.hovering||e.focused),expandedOrOutOfFocus:Tr(e=>e.hovering||e.focused||!e.isWindowFocused),prevFocusElement:Tr(e=>e.prevFocusElement)};class WA extends PA{constructor(r){super(r,{},nn);tt(this,"timers",new Map);tt(this,"areTimersPaused",!1);tt(this,"setViewport",r=>{this.set("viewport",r)});tt(this,"disposeEffect",()=>()=>{this.timers.forEach(r=>{var n;(n=r.timeout)==null||n.clear()}),this.timers.clear()});tt(this,"addToast",r=>{const{toasts:n,timeout:i,limit:a}=this.state,l=r.id||vS("toast"),s={...r,id:l,transitionStatus:"starting"},o=[s,...n],c=o.filter(u=>u.transitionStatus!=="ending");if(c.length>a){const u=c.length-a,f=c.slice(-u),_=new Set(f.map(y=>y.id));this.setToasts(o.map(y=>{const v=_.has(y.id);return y.limited!==v?{...y,limited:v}:y}))}else this.setToasts(o.map(u=>u.limited?{...u,limited:!1}:u));const p=s.timeout??i;return s.type!=="loading"&&p>0&&this.scheduleTimer(l,p,()=>this.closeToast(l)),nn.expandedOrOutOfFocus(this.state)&&this.pauseTimers(),l});tt(this,"updateToast",(r,n)=>{this.updateToastInternal(r,n)});tt(this,"updateToastInternal",(r,n)=>{var v,h;const{timeout:i,toasts:a}=this.state,l=nn.toast(this.state,r)??null;if(!l||l.transitionStatus==="ending")return;const s={...l,...n};this.setToasts(a.map(m=>m.id===r?{...m,...n}:m));const o=s.timeout??i,c=(l==null?void 0:l.timeout)??i,p=Object.hasOwn(n,"timeout"),u=s.transitionStatus!=="ending"&&s.type!=="loading"&&o>0,f=this.timers.has(r),_=c!==o,y=(l==null?void 0:l.type)==="loading";if(!u&&f){const m=this.timers.get(r);(v=m==null?void 0:m.timeout)==null||v.clear(),this.timers.delete(r);return}if(u&&(!f||_||p||y)){const m=this.timers.get(r);m&&((h=m.timeout)==null||h.clear(),this.timers.delete(r)),this.scheduleTimer(r,o,()=>this.closeToast(r)),nn.expandedOrOutOfFocus(this.state)&&this.pauseTimers()}});tt(this,"closeToast",r=>{var c;const n=nn.toast(this.state,r);(c=n==null?void 0:n.onClose)==null||c.call(n);const{limit:i,toasts:a}=this.state;let l=0;const s=a.map(p=>{if(p.id===r)return{...p,transitionStatus:"ending",height:0};if(p.transitionStatus==="ending")return p;const u=l>=i;return l+=1,p.limited!==u?{...p,limited:u}:p}),o=this.timers.get(r);o&&o.timeout&&(o.timeout.clear(),this.timers.delete(r)),this.handleFocusManagement(r),this.setToasts(s)});tt(this,"promiseToast",(r,n)=>{const i=Du(n.loading),a=this.addToast({...i,type:"loading"}),l=r.then(s=>{const o=Du(n.success,s);return this.updateToast(a,{...o,type:"success",timeout:o.timeout}),s}).catch(s=>{const o=Du(n.error,s);return this.updateToast(a,{...o,type:"error",timeout:o.timeout}),Promise.reject(s)});return{}.hasOwnProperty.call(n,"setPromise")&&n.setPromise(l),l});tt(this,"handleDocumentPointerDown",r=>{if(r.pointerType!=="touch")return;const n=yp(r);yi(this.state.viewport,n)||(this.resumeTimers(),this.update({hovering:!1,focused:!1}))})}setFocused(r){this.set("focused",r)}setHovering(r){this.set("hovering",r)}setIsWindowFocused(r){this.set("isWindowFocused",r)}setPrevFocusElement(r){this.set("prevFocusElement",r)}removeToast(r){var l;const n=nn.toastIndex(this.state,r);if(n===-1)return;const i=this.state.toasts[n];(l=i==null?void 0:i.onRemove)==null||l.call(i);const a=[...this.state.toasts];a.splice(n,1),this.setToasts(a)}pauseTimers(){this.areTimersPaused||(this.areTimersPaused=!0,this.timers.forEach(r=>{if(r.timeout){r.timeout.clear();const n=Date.now()-r.start,i=r.delay-n;r.remaining=i>0?i:0}}))}resumeTimers(){this.areTimersPaused&&(this.areTimersPaused=!1,this.timers.forEach((r,n)=>{r.remaining=r.remaining>0?r.remaining:r.delay,r.timeout??(r.timeout=Ko.create()),r.timeout.start(r.remaining,()=>{this.timers.delete(n),r.callback()}),r.start=Date.now()}))}restoreFocusToPrevElement(){var r;(r=this.state.prevFocusElement)==null||r.focus({preventScroll:!0})}scheduleTimer(r,n,i){const a=Date.now(),l=!nn.expandedOrOutOfFocus(this.state),s=l?Ko.create():void 0;s==null||s.start(n,()=>{this.timers.delete(r),i()}),this.timers.set(r,{timeout:s,start:l?a:0,delay:n,remaining:n,callback:i})}setToasts(r){const n={toasts:r};r.length===0&&(n.hovering=!1,n.focused=!1),this.update(n)}handleFocusManagement(r){var o,c;const n=Ql(Js(this.state.viewport));if(!this.state.viewport||!yi(this.state.viewport,n)||!pd(n))return;const i=nn.toasts(this.state),a=nn.toastIndex(this.state,r);let l=null,s=a+1;for(;s<i.length;){if(i[s].transitionStatus!=="ending"){l=i[s];break}s+=1}if(!l)for(s=a-1;s>=0;){if(i[s].transitionStatus!=="ending"){l=i[s];break}s-=1}l?(c=(o=l.ref)==null?void 0:o.current)==null||c.focus():this.restoreFocusToPrevElement()}}const VA=function(t){const{children:r,timeout:n=5e3,limit:i=3,toastManager:a}=t,l=ks(()=>new WA({timeout:n,limit:i,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return mp(l.disposeEffect),k.useEffect(function(){return a?a[" subscribe"](({action:c,options:p})=>{const u=p.id;c==="promise"&&p.promise?l.promiseToast(p.promise,p):c==="update"&&u?l.updateToast(u,p):c==="close"&&u?l.closeToast(u):l.addToast(p)}):void 0},[l,n,a]),l.useSyncedValues({timeout:n,limit:i}),T.jsx(gp.Provider,{value:l,children:r})},Au=k.forwardRef(function(t,r){const[n,i]=k.useState();qt(()=>{FA&&i("button")},[]);const a={tabIndex:0,role:n};return T.jsx("span",{...t,ref:r,style:op,"aria-hidden":n?void 0:!0,...a,"data-base-ui-focus-guard":""})});let KA=function(e){return e.frontmostHeight="--toast-frontmost-height",e}({});const GA=k.forwardRef(function(t,r){var M;const{render:n,className:i,children:a,...l}=t,s=vp(),o=OA(),c=k.useRef(!1),p=k.useRef(!1),u=s.useState("isEmpty"),f=s.useState("toasts"),_=s.useState("focused"),y=s.useState("expanded"),v=s.useState("prevFocusElement"),h=((M=f[0])==null?void 0:M.height)??0,m=k.useMemo(()=>f.some(D=>D.transitionStatus==="ending"),[f]);k.useEffect(()=>{const D=s.state.viewport;if(!D)return;function B(F){u||F.key==="F6"&&F.target!==D&&(F.preventDefault(),s.setPrevFocusElement(Ql(Js(D))),D==null||D.focus({preventScroll:!0}),s.pauseTimers(),s.setFocused(!0))}const H=Vo(D);return H.addEventListener("keydown",B),()=>{H.removeEventListener("keydown",B)}},[s,u]),k.useEffect(()=>{const D=s.state.viewport;if(!D||u)return;const B=Vo(D);function H($){$.target===B&&(s.setIsWindowFocused(!1),s.pauseTimers())}function F($){if($.relatedTarget||$.target===B)return;const I=yp($),R=Ql(Js(D));(!yi(D,I)||!pd(R))&&s.resumeTimers(),o.start(0,()=>s.setIsWindowFocused(!0))}return B.addEventListener("blur",H,!0),B.addEventListener("focus",F,!0),()=>{B.removeEventListener("blur",H,!0),B.removeEventListener("focus",F,!0)}},[s,o,u]),k.useEffect(()=>{const D=s.state.viewport;if(!D||u)return;const B=Js(D);return B.addEventListener("pointerdown",s.handleDocumentPointerDown,!0),()=>{B.removeEventListener("pointerdown",s.handleDocumentPointerDown,!0)}},[u,s]);function d(D){var H,F,$;const B=s.state.viewport;B&&(c.current=!0,D.relatedTarget===B?($=(F=(H=f[0])==null?void 0:H.ref)==null?void 0:F.current)==null||$.focus():s.restoreFocusToPrevElement())}function g(D){D.key==="Tab"&&D.shiftKey&&D.target===s.state.viewport&&(D.preventDefault(),s.restoreFocusToPrevElement(),s.resumeTimers())}k.useEffect(()=>{!s.state.isWindowFocused||m||!p.current||(s.resumeTimers(),s.setHovering(!1),p.current=!1)},[m,s]);function w(){s.pauseTimers(),s.setHovering(!0),p.current=!1}function b(){m?p.current=!0:(s.resumeTimers(),s.setHovering(!1))}function x(){if(c.current){c.current=!1;return}_||pd(Js(s.state.viewport).activeElement)&&(s.setFocused(!0),s.pauseTimers())}function C(D){!_||yi(s.state.viewport,D.relatedTarget)||(s.setFocused(!1),s.resumeTimers())}const S={tabIndex:-1,role:"region","aria-live":"polite","aria-atomic":!1,"aria-relevant":"additions text","aria-label":"Notifications",onMouseEnter:w,onMouseMove:w,onMouseLeave:b,onFocus:x,onBlur:C,onKeyDown:g,onClick:x},E={expanded:y},L=Ls("div",t,{ref:[r,s.setViewport],state:E,props:[S,{style:{[KA.frontmostHeight]:h?`${h}px`:void 0}},l,{children:T.jsxs(k.Fragment,{children:[!u&&v&&T.jsx(Au,{onFocus:d}),a,!u&&v&&T.jsx(Au,{onFocus:d})]})}]}),A=k.useMemo(()=>f.filter(D=>D.priority==="high"),[f]);return T.jsxs(k.Fragment,{children:[!u&&v&&T.jsx(Au,{onFocus:d}),L,!_&&A.length>0&&T.jsx("div",{style:op,children:A.map(D=>T.jsxs("div",{role:"alert","aria-atomic":!0,children:[T.jsx("div",{children:D.title}),T.jsx("div",{children:D.description})]},D.id))})]})});function qA(e){return ap(19)?e:e?"true":void 0}const _S=k.createContext(void 0);function wp(){const e=k.useContext(_S);if(!e)throw new Error(Yr(66));return e}let Sp=function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e}({});const XA={[Sp.startingStyle]:""},YA={[Sp.endingStyle]:""},JA={transitionStatus(e){return e==="starting"?XA:e==="ending"?YA:null}};function QA(e){return e==null?e:"current"in e?e.current:e}function ZA(e,t=!1,r=!0){const n=BA();return Xr((i,a=null)=>{n.cancel();function l(){hn.flushSync(i)}const s=QA(e);if(s==null)return;const o=s;if(typeof o.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)i();else{let u=function(){const _=Sp.startingStyle;if(!o.hasAttribute(_)){n.request(f);return}const y=new MutationObserver(()=>{o.hasAttribute(_)||(y.disconnect(),f())});y.observe(o,{attributes:!0,attributeFilter:[_]}),a==null||a.addEventListener("abort",()=>y.disconnect(),{once:!0})},f=function(){Promise.all(o.getAnimations().map(_=>_.finished)).then(()=>{a!=null&&a.aborted||l()}).catch(()=>{const _=o.getAnimations();if(r){if(a!=null&&a.aborted)return;l()}else _.length>0&&_.some(y=>y.pending||y.playState!=="finished")&&f()})};var c=u,p=f;if(t){u();return}n.request(f)}})}function eP(e){const{enabled:t=!0,open:r,ref:n,onComplete:i}=e,a=Xr(i),l=ZA(n,r,!1);k.useEffect(()=>{if(!t)return;const s=new AbortController;return l(a,s.signal),()=>{s.abort()}},[t,r,a,l])}let ss=function(e){return e.index="--toast-index",e.offsetY="--toast-offset-y",e.height="--toast-height",e.swipeMovementX="--toast-swipe-movement-x",e.swipeMovementY="--toast-swipe-movement-y",e}({});const tP={...JA,swipeDirection(e){return e?{"data-swipe-direction":e}:null}},Wi=40,rP=10,En=.5,nP=1;function Nv(e,t,r){switch(e){case"up":return-r;case"down":return r;case"left":return-t;case"right":return t;default:return 0}}function sP(e){const r=window.getComputedStyle(e).transform;let n=0,i=0,a=1;if(r&&r!=="none"){const l=r.match(/matrix(?:3d)?\(([^)]+)\)/);if(l){const s=l[1].split(", ").map(parseFloat);s.length===6?(n=s[4],i=s[5],a=Math.sqrt(s[0]*s[0]+s[1]*s[1])):s.length===16&&(n=s[12],i=s[13],a=s[0])}}return{x:n,y:i,scale:a}}const iP=k.forwardRef(function(t,r){var ve;const{toast:n,render:i,className:a,swipeDirection:l=["down","right"],...s}=t,o=((ve=n.positionerProps)==null?void 0:ve.anchor)!==void 0;let c=[];o||(c=Array.isArray(l)?l:[l]);const p=c.length>0,u=vp(),[f,_]=k.useState(void 0),[y,v]=k.useState(!1),[h,m]=k.useState(!1),[d,g]=k.useState(!1),[w,b]=k.useState({x:0,y:0}),[x,C]=k.useState({x:0,y:0,scale:1}),[S,E]=k.useState(),[L,A]=k.useState(),[M,D]=k.useState(null),B=k.useRef(null),H=k.useRef({x:0,y:0}),F=k.useRef({x:0,y:0,scale:1}),$=k.useRef(void 0),I=k.useRef(0),R=k.useRef(!1),P=k.useRef({x:0,y:0}),N=k.useRef(!1),j=u.useState("toastIndex",n.id),U=u.useState("toastVisibleIndex",n.id),V=u.useState("toastOffsetY",n.id),ee=u.useState("focused"),Q=u.useState("expanded");eP({open:n.transitionStatus!=="ending",ref:B,onComplete(){n.transitionStatus==="ending"&&u.removeToast(n.id)}});const z=Xr((ne=!1)=>{const ie=B.current;if(!ie)return;const he=ie.style.height;ie.style.height="auto";const oe=ie.offsetHeight;ie.style.height=he;function me(){u.updateToastInternal(n.id,{ref:B,height:oe,...n.transitionStatus==="starting"?{transitionStatus:void 0}:{}})}ne?hn.flushSync(me):me()});qt(z,[z]);function O(ne,ie){let he=ne,oe=ie;return!c.includes("left")&&!c.includes("right")?he=ne>0?ne**En:-(Math.abs(ne)**En):(!c.includes("right")&&ne>0&&(he=ne**En),!c.includes("left")&&ne<0&&(he=-(Math.abs(ne)**En))),!c.includes("up")&&!c.includes("down")?oe=ie>0?ie**En:-(Math.abs(ie)**En):(!c.includes("down")&&ie>0&&(oe=ie**En),!c.includes("up")&&ie<0&&(oe=-(Math.abs(ie)**En))),{x:he,y:oe}}function K(ne){var oe;if(ne.button!==0)return;ne.pointerType==="touch"&&u.pauseTimers();const ie=yp(ne.nativeEvent);if(!(ie&&ie.closest('button,a,input,textarea,[role="button"],[data-swipe-ignore]'))){if(R.current=!1,$.current=void 0,I.current=0,H.current={x:ne.clientX,y:ne.clientY},P.current=H.current,B.current){const me=sP(B.current);F.current=me,C(me),b({x:me.x,y:me.y})}u.setHovering(!0),v(!0),m(!1),D(null),N.current=!0,(oe=B.current)==null||oe.setPointerCapture(ne.pointerId)}}function W(ne){if(!y)return;ne.preventDefault(),N.current&&(H.current={x:ne.clientX,y:ne.clientY},N.current=!1);const{clientY:ie,clientX:he,movementX:oe,movementY:me}=ne;(me<0&&ie>P.current.y||me>0&&ie<P.current.y)&&(P.current={x:P.current.x,y:ie}),(oe<0&&he>P.current.x||oe>0&&he<P.current.x)&&(P.current={x:he,y:P.current.y});const xe=he-H.current.x,ke=ie-H.current.y,Ne=ie-P.current.y,Ke=he-P.current.x;if(!h&&Math.sqrt(xe*xe+ke*ke)>=nP&&(m(!0),M===null)){const $e=c.includes("left")||c.includes("right"),X=c.includes("up")||c.includes("down");if($e&&X){const le=Math.abs(xe),ge=Math.abs(ke);D(le>ge?"horizontal":"vertical")}}let Ae;if(!$.current)M==="vertical"?ke>0?Ae="down":ke<0&&(Ae="up"):M==="horizontal"?xe>0?Ae="right":xe<0&&(Ae="left"):Math.abs(xe)>=Math.abs(ke)?Ae=xe>0?"right":"left":Ae=ke>0?"down":"up",Ae&&c.includes(Ae)&&($.current=Ae,I.current=Nv(Ae,xe,ke),_(Ae));else{const Oe=$.current,$e=Nv(Oe,Ke,Ne);$e>Wi?(R.current=!1,_(Oe)):!(c.includes("left")&&c.includes("right"))&&!(c.includes("up")&&c.includes("down"))&&I.current-$e>=rP&&(R.current=!0)}const Pe=O(xe,ke);let G=F.current.x,Y=F.current.y;M==="horizontal"?(c.includes("left")||c.includes("right"))&&(G+=Pe.x):(M==="vertical"||(c.includes("left")||c.includes("right"))&&(G+=Pe.x),(c.includes("up")||c.includes("down"))&&(Y+=Pe.y)),b({x:G,y:Y})}function te(ne){var xe;if(!y)return;if(v(!1),m(!1),D(null),(xe=B.current)==null||xe.releasePointerCapture(ne.pointerId),R.current){b({x:x.x,y:x.y}),_(void 0);return}let ie=!1;const he=w.x-x.x,oe=w.y-x.y;let me;for(const ke of c){switch(ke){case"right":he>Wi&&(ie=!0,me="right");break;case"left":he<-Wi&&(ie=!0,me="left");break;case"down":oe>Wi&&(ie=!0,me="down");break;case"up":oe<-Wi&&(ie=!0,me="up");break}if(ie)break}ie?(_(me),g(!0),u.closeToast(n.id)):(b({x:x.x,y:x.y}),_(void 0))}function J(ne){if(ne.key==="Escape"){if(!B.current||!yi(B.current,Ql(Js(B.current))))return;u.closeToast(n.id)}}k.useEffect(()=>{if(!p)return;const ne=B.current;if(!ne)return;function ie(he){yi(ne,he.target)&&he.preventDefault()}return ne.addEventListener("touchmove",ie,{passive:!1}),()=>{ne.removeEventListener("touchmove",ie)}},[p]);function _e(){if(!y&&w.x===x.x&&w.y===x.y&&!d)return{[ss.swipeMovementX]:"0px",[ss.swipeMovementY]:"0px"};const ne=w.x-x.x,ie=w.y-x.y;return{transition:y?"none":void 0,transform:y?`translateX(${w.x}px) translateY(${w.y}px) scale(${x.scale})`:void 0,[ss.swipeMovementX]:`${ne}px`,[ss.swipeMovementY]:`${ie}px`}}const ue=n.priority==="high",se={role:ue?"alertdialog":"dialog",tabIndex:0,"aria-modal":!1,"aria-labelledby":S,"aria-describedby":L,"aria-hidden":ue&&!ee?!0:void 0,onPointerDown:p?K:void 0,onPointerMove:p?W:void 0,onPointerUp:p?te:void 0,onKeyDown:J,inert:qA(n.limited),style:{..._e(),[ss.index]:n.transitionStatus==="ending"?j:U,[ss.offsetY]:`${V}px`,[ss.height]:n.height?`${n.height}px`:void 0}},re=k.useMemo(()=>({rootRef:B,toast:n,titleId:S,setTitleId:E,descriptionId:L,setDescriptionId:A,swiping:y,swipeDirection:f,recalculateHeight:z,index:j,visibleIndex:U,expanded:Q}),[n,S,L,y,f,z,j,U,Q]),ae={transitionStatus:n.transitionStatus,expanded:Q,limited:n.limited||!1,type:n.type,swiping:re.swiping,swipeDirection:re.swipeDirection},ye=Ls("div",t,{ref:[r,re.rootRef],state:ae,stateAttributesMapping:tP,props:[se,s]});return T.jsx(_S.Provider,{value:re,children:ye})}),oP=k.forwardRef(function(t,r){const{render:n,className:i,id:a,children:l,...s}=t,{toast:o,setDescriptionId:c}=wp(),p=l??o.description,u=!!p,f=cp(a);qt(()=>{if(u)return c(f),()=>{c(void 0)}},[u,f,c]);const _={type:o.type},y=Ls("p",t,{ref:r,state:_,props:{...s,id:f,children:p}});return u?y:null}),aP=k.forwardRef(function(t,r){const{render:n,className:i,id:a,children:l,...s}=t,{toast:o,setTitleId:c}=wp(),p=l??o.title,u=!!p,f=cp(a);qt(()=>{if(u)return c(f),()=>{c(void 0)}},[u,f,c]);const _={type:o.type},y=Ls("h2",t,{ref:r,state:_,props:{...s,id:f,children:p}});return u?y:null}),lP=k.forwardRef(function(t,r){const{render:n,className:i,disabled:a,nativeButton:l=!0,...s}=t,o=vp(),{toast:c}=wp(),p=o.useState("expanded"),[u,f]=k.useState(!1),{getButtonProps:_,buttonRef:y}=Uw({disabled:a,native:l}),v={type:c.type};return Ls("button",t,{ref:[r,y],state:v,props:[{"aria-hidden":!p&&!u,onClick(){o.closeToast(c.id)},onFocus(){f(!0)},onBlur(){f(!1)}},s,_]})});function cP(){const e=k.useContext(gp);if(!e)throw new Error(Yr(73));const t=e.useState("toasts");return k.useMemo(()=>({toasts:t,add:e.addToast,close:e.closeToast,update:e.updateToast,promise:e.promiseToast}),[t,e])}function uP(){const e=new Set;function t(r){e.forEach(n=>n(r))}return{" subscribe":function(n){return e.add(n),()=>{e.delete(n)}},add(r){const n=r.id||vS("toast"),i={...r,id:n,transitionStatus:"starting"};return t({action:"add",options:i}),n},close(r){t({action:"close",options:{id:r}})},update(r,n){t({action:"update",options:{...n,id:r}})},promise(r,n){let i=r;return t({action:"promise",options:{...n,promise:r,setPromise(a){i=a}}}),i}}}const hP=5e3,yS=uP();function dP({toast:e}){return T.jsxs(iP,{toast:e,className:Xl("relative flex w-80 items-start gap-3 border bg-elevated p-4 shadow-lg","data-[swipe=move]:translate-x-[var(--toast-swipe-move-x)]","data-[ending-style]:translate-x-[var(--toast-swipe-end-x)]","data-[ending-style]:opacity-0","data-[starting-style]:translate-y-2 data-[starting-style]:opacity-0","transition-all duration-200",e.type==="error"&&"border-error/50",e.type==="success"&&"border-approval/50",(!e.type||e.type==="info")&&"border-border"),children:[T.jsxs("div",{className:"flex-1 min-w-0",children:[T.jsx(aP,{className:Xl("text-sm font-medium",e.type==="error"&&"text-error",e.type==="success"&&"text-approval",(!e.type||e.type==="info")&&"text-primary"),children:e.title}),e.description&&T.jsx(oP,{className:"mt-1 text-xs text-muted line-clamp-2",children:e.description})]}),T.jsx(lP,{className:"shrink-0 text-muted hover:text-primary transition-colors","aria-label":"Close",children:T.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[T.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),T.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})}function fP(){const{toasts:e}=cP();return T.jsx(T.Fragment,{children:e.map(t=>T.jsx(dP,{toast:t},t.id))})}function pP(){return T.jsxs(VA,{timeout:hP,toastManager:yS,children:[T.jsx(fP,{}),T.jsx(GA,{className:"fixed bottom-4 right-4 z-[100] flex flex-col gap-2"})]})}const jv=["CONNECTING","OPEN","CLOSING","CLOSED"],mP=3e3,gP=8e3,vP=15e3,_P=5e3,yP=2e4,wP=1e4,SP=750,xP=4,bP=5e3;class CP{constructor(){this.ws=null,this.listeners=new Set,this.statusListeners=new Set,this.status="connecting",this.error=null,this.reconnectAttempts=0,this.reconnectTimer=null,this.connectTimer=null,this.manualClose=!1,this.lastTick=Date.now(),this.wakeCheckInterval=null,this.lifecycleStarted=!1,this.heartbeatTimer=null,this.pongTimer=null,this.lastForceReconnectTs=0,this.pingSeq=0,this.connectionEpoch=0,this.consecutiveFailures=0,this.isResumeAttempt=!1,this.leakedSockets=new Set,this.onVisibilityChange=()=>{if(Je("ws_visibility",{state:document.visibilityState,...this.wsSnap()}),document.visibilityState==="visible"){const t=Date.now(),r=t-this.lastTick;this.lastTick=t,Je("ws_resume",{gapMs:r}),this.forceReconnect("visibilitychange",!0)}else this.stopHeartbeat(),this.reconnectTimer&&(window.clearTimeout(this.reconnectTimer),this.reconnectTimer=null)},this.onPageShow=t=>{Je("ws_pageshow",{persisted:t.persisted,...this.wsSnap()}),t.persisted&&(this.lastTick=Date.now(),this.forceReconnect("pageshow",!0))}}wsSnap(){return{status:this.status,ws:this.ws?jv[this.ws.readyState]:null,attempt:this.reconnectAttempts,failures:this.consecutiveFailures,leaked:this.leakedSockets.size,online:typeof navigator<"u"?navigator.onLine:void 0}}connect(){if(this.ws){const a=this.ws.readyState===WebSocket.OPEN;if(a&&this.status==="connected"){Je("ws_connect_skip",{reason:"already_open",...this.wsSnap()});return}Je("ws_connect_destroy_zombie",{reason:a?"open_desynced":"not_open",...this.wsSnap()}),this.destroySocket()}this.manualClose=!1,this.clearConnectTimer(),this.setStatus("connecting");const r=`${window.location.protocol==="https:"?"wss":"ws"}://${window.location.host}/ws`;Je("ws_connect",{url:r,resume:this.isResumeAttempt,...this.wsSnap()});const n=new WebSocket(r);this.ws=n,this.leakedSockets.add(n);const i=this.isResumeAttempt?gP:mP;this.isResumeAttempt=!1,this.connectTimer=window.setTimeout(()=>{if(this.ws!==n)return;this.connectTimer=null,n.readyState===WebSocket.OPEN&&this.status==="connected"||(Je("ws_connect_timeout",{wsState:jv[n.readyState],managerStatus:this.status,timeoutMs:i,...this.wsSnap()}),this.consecutiveFailures+=1,this.destroySocket(),this.scheduleReconnect())},i),n.onopen=()=>{Je("ws_onopen",this.wsSnap()),this.clearConnectTimer(),this.reconnectAttempts=0,this.consecutiveFailures=0,this.connectionEpoch+=1,this.leakedSockets.delete(n),this.setStatus("connected"),this.startHeartbeat()},n.onmessage=a=>{try{const l=JSON.parse(a.data);if(l.type==="pong"){l.seq===this.pingSeq&&this.clearPongTimer();return}this.listeners.forEach(s=>s(l))}catch{}},n.onerror=()=>{Je("ws_onerror",this.wsSnap()),this.clearConnectTimer()},n.onclose=a=>{Je("ws_onclose",{code:a.code,reason:a.reason,clean:a.wasClean,...this.wsSnap()}),this.clearConnectTimer(),this.consecutiveFailures+=1,this.ws=null,this.manualClose?this.setStatus("disconnected"):this.scheduleReconnect()}}disconnect(){this.manualClose=!0,this.clearConnectTimer(),this.reconnectTimer&&(window.clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.destroySocket(),this.setStatus("disconnected")}startLifecycleListeners(){this.lifecycleStarted||typeof document>"u"||typeof window>"u"||(this.lifecycleStarted=!0,document.addEventListener("visibilitychange",this.onVisibilityChange),window.addEventListener("pageshow",this.onPageShow),this.lastTick=Date.now(),this.wakeCheckInterval=window.setInterval(()=>{const t=Date.now(),r=t-this.lastTick;this.isHidden()||(r>vP&&(Je("ws_time_jump",{gapMs:r,...this.wsSnap()}),this.forceReconnect("time_jump",!0)),this.lastTick=t)},_P))}stopLifecycleListeners(){this.lifecycleStarted&&(this.lifecycleStarted=!1,document.removeEventListener("visibilitychange",this.onVisibilityChange),window.removeEventListener("pageshow",this.onPageShow),this.wakeCheckInterval!==null&&(window.clearInterval(this.wakeCheckInterval),this.wakeCheckInterval=null))}send(t){var r;if(((r=this.ws)==null?void 0:r.readyState)!==WebSocket.OPEN)return!1;try{return this.ws.send(JSON.stringify(t)),!0}catch(n){return Je("ws_send_error",{messageType:t.type,error:n instanceof Error?n.message:String(n),...this.wsSnap()}),this.destroySocket(),this.scheduleReconnect(),!1}}subscribe(t){return this.listeners.add(t),()=>this.listeners.delete(t)}subscribeStatus(t){return this.statusListeners.add(t),t(this.status,this.error,this.connectionEpoch),()=>this.statusListeners.delete(t)}getStatus(){return this.status}getConnectionEpoch(){return this.connectionEpoch}forceReconnect(t="unknown",r=!1){var a;if(this.manualClose){Je("ws_force_skip",{trigger:t,reason:"manual_close"});return}const n=Date.now(),i=r?200:500;if(n-this.lastForceReconnectTs<i){Je("ws_force_skip",{trigger:t,reason:"debounce",force:r});return}if(!r&&((a=this.ws)==null?void 0:a.readyState)===WebSocket.OPEN&&this.status==="connected"){Je("ws_force_skip",{trigger:t,reason:"already_connected"});return}this.lastForceReconnectTs=n,Je("ws_force_reconnect",{trigger:t,force:r,...this.wsSnap()}),this.reconnectAttempts=0,this.consecutiveFailures=0,this.reconnectTimer&&(window.clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.destroySocket(),r?(this.purgeLeakedSockets(),this.isResumeAttempt=!0,this.setStatus("reconnecting"),this.reconnectTimer=window.setTimeout(()=>{this.reconnectTimer=null,this.connect()},SP)):this.connect()}startHeartbeat(){this.stopHeartbeat(),this.heartbeatTimer=window.setInterval(()=>{var t;((t=this.ws)==null?void 0:t.readyState)===WebSocket.OPEN&&(this.pingSeq+=1,this.send({type:"ping",seq:this.pingSeq})&&(this.clearPongTimer(),this.pongTimer=window.setTimeout(()=>{this.pongTimer=null,Je("ws_pong_timeout",this.wsSnap()),this.destroySocket(),this.scheduleReconnect()},wP)))},yP)}stopHeartbeat(){this.heartbeatTimer!==null&&(window.clearInterval(this.heartbeatTimer),this.heartbeatTimer=null),this.clearPongTimer()}clearPongTimer(){this.pongTimer!==null&&(window.clearTimeout(this.pongTimer),this.pongTimer=null)}setStatus(t,r=null){this.status=t,this.error=r,this.statusListeners.forEach(n=>n(t,r,this.connectionEpoch))}scheduleReconnect(){if(this.stopHeartbeat(),this.isHidden()){Je("ws_schedule_skip",{reason:"hidden",...this.wsSnap()}),this.setStatus("reconnecting");return}if(this.consecutiveFailures>=xP){Je("ws_stall_detected",this.wsSnap()),this.purgeLeakedSockets(),this.consecutiveFailures=0,this.reconnectAttempts=0,this.isResumeAttempt=!0,this.setStatus("reconnecting"),this.reconnectTimer=window.setTimeout(()=>{this.reconnectTimer=null,this.connect()},bP);return}this.reconnectAttempts+=1;const t=Math.min(1e3*2**(this.reconnectAttempts-1),3e4);Je("ws_schedule_reconnect",{delay:t,...this.wsSnap()}),this.setStatus("reconnecting"),this.reconnectTimer&&window.clearTimeout(this.reconnectTimer),this.reconnectTimer=window.setTimeout(()=>{this.reconnectTimer=null,this.connect()},t)}isHidden(){return typeof document<"u"&&document.visibilityState==="hidden"}clearConnectTimer(){this.connectTimer&&(window.clearTimeout(this.connectTimer),this.connectTimer=null)}destroySocket(){if(this.clearConnectTimer(),this.stopHeartbeat(),!this.ws)return;const t=this.ws;this.ws=null,t.onopen=null,t.onmessage=null,t.onerror=null,t.onclose=null;try{t.close()}catch{}}purgeLeakedSockets(){if(this.leakedSockets.size!==0){Je("ws_purge_leaked",{count:this.leakedSockets.size});for(const t of this.leakedSockets)try{t.onopen=null,t.onmessage=null,t.onerror=null,t.onclose=null,t.close()}catch{}this.leakedSockets.clear()}}}const sn=new CP;function EP(){const e=Ge(o=>o.setConnectionStatus),t=Ge(o=>o.setConnectionError),[r,n]=k.useState(sn.getStatus()),[i,a]=k.useState(sn.getConnectionEpoch());k.useEffect(()=>{sn.connect(),sn.startLifecycleListeners();const o=sn.subscribeStatus((c,p,u)=>{n(c),a(u),e(c),t(p)});return()=>{o(),sn.stopLifecycleListeners()}},[t,e]);const l=k.useMemo(()=>o=>{sn.send(o)},[]),s=k.useMemo(()=>sn.subscribe.bind(sn),[]);return{status:r,connectionEpoch:i,sendMessage:l,subscribe:s}}const kP=100;function LP({viewport:e,win:t,doc:r}){if(!e)return!1;const n=Math.max(0,e.offsetTop||0),i=Math.max(0,e.offsetLeft||0),a=t.innerHeight-(e.height+n),l=Math.max(0,a),s=Math.max(0,e.height||0),o=Math.max(0,e.width||0);return r.documentElement.style.setProperty("--keyboard-inset",`${l}px`),r.documentElement.style.setProperty("--viewport-offset-top",`${n}px`),r.documentElement.style.setProperty("--viewport-offset-left",`${i}px`),r.documentElement.style.setProperty("--visual-viewport-height",`${s}px`),r.documentElement.style.setProperty("--visual-viewport-width",`${o}px`),l>kP?r.documentElement.classList.add("keyboard-visible"):r.documentElement.classList.remove("keyboard-visible"),!0}function TP(e){e.documentElement.style.removeProperty("--keyboard-inset"),e.documentElement.style.removeProperty("--viewport-offset-top"),e.documentElement.style.removeProperty("--viewport-offset-left"),e.documentElement.style.removeProperty("--visual-viewport-height"),e.documentElement.style.removeProperty("--visual-viewport-width"),e.documentElement.classList.remove("keyboard-visible")}function RP(){k.useEffect(()=>{const e=window.visualViewport;if(!e)return;let t=null,r=null;const n=()=>{var v;const _=document.activeElement;if(!_)return!1;const y=(v=_.tagName)==null?void 0:v.toLowerCase();return y==="input"||y==="textarea"?!0:!!_.isContentEditable},i=()=>{LP({viewport:e,win:window,doc:document})},a=()=>{if(typeof window.requestAnimationFrame!="function"){i();return}t!==null&&window.cancelAnimationFrame(t);const _=performance.now(),y=()=>{i(),performance.now()-_<1500?t=window.requestAnimationFrame(y):t=null};t=window.requestAnimationFrame(y)},l=()=>{if(!n()){o();return}i()},s=()=>{r!==null||typeof window.setInterval!="function"||(r=window.setInterval(l,250),l())},o=()=>{r===null||typeof window.clearInterval!="function"||(window.clearInterval(r),r=null)},c=()=>{n()?(a(),s(),i()):o()},p=()=>{c()},u=()=>{c()},f=()=>{a()};return i(),c(),e.addEventListener("resize",i),e.addEventListener("scroll",i),typeof window.addEventListener=="function"&&(window.addEventListener("resize",i),window.addEventListener("orientationchange",f)),typeof document.addEventListener=="function"&&(document.addEventListener("focusin",p),document.addEventListener("focusout",u),document.addEventListener("focus",p,!0),document.addEventListener("blur",u,!0)),()=>{e.removeEventListener("resize",i),e.removeEventListener("scroll",i),typeof window.removeEventListener=="function"&&(window.removeEventListener("resize",i),window.removeEventListener("orientationchange",f)),typeof document.removeEventListener=="function"&&(document.removeEventListener("focusin",p),document.removeEventListener("focusout",u),document.removeEventListener("focus",p,!0),document.removeEventListener("blur",u,!0)),t!==null&&typeof window.cancelAnimationFrame=="function"&&window.cancelAnimationFrame(t),o(),TP(document)}},[])}function DP(){const[e,t]=k.useState(!1),[r,n]=k.useState(void 0),[i,a]=k.useState(void 0),[l,s]=k.useState(void 0),[o,c]=k.useState(!1),[p,u]=k.useState(null),[f,_]=k.useState(null),y=Ge(G=>G.sessions),v=Ge(G=>G.agentSessions),h=Ge(G=>G.selectedSessionId),m=Ge(G=>G.setSessions),d=Ge(G=>G.setAgentSessions),g=Ge(G=>G.setHostStatuses),w=Ge(G=>G.updateSession),b=Ge(G=>G.setSelectedSessionId),x=Ge(G=>G.hasLoaded),C=Ge(G=>G.connectionStatus),S=Ge(G=>G.connectionError),E=Ge(G=>G.clearExitingSession),L=Ge(G=>G.markSessionExiting),A=Ge(G=>G.setRemoteAllowControl),M=Ge(G=>G.setRemoteAllowAttach),D=Ge(G=>G.setHostLabel),B=Ge(G=>G.hostStatuses),H=Ge(G=>G.remoteAllowControl),F=Ge(G=>G.hostLabel),$=Gl(G=>G.theme),I=pe(G=>G.defaultProjectDir),R=pe(G=>G.commandPresets),P=pe(G=>G.defaultPresetId),N=pe(G=>G.lastProjectPath),j=pe(G=>G.setLastProjectPath),U=pe(G=>G.addRecentPath),V=pe(G=>G.shortcutModifier),ee=pe(G=>G.sidebarWidth),Q=pe(G=>G.setSidebarWidth),z=pe(G=>G.projectFilters),O=pe(G=>G.hostFilters),K=pe(G=>G.soundOnPermission),W=pe(G=>G.soundOnIdle),{sendMessage:te,subscribe:J,connectionEpoch:_e}=EP();RP(),k.useEffect(()=>{if(typeof document>"u"||!K&&!W)return;let G=!1;const Y=()=>{G&&!z3()||(G=!0,hd())};return document.addEventListener("click",Y,{passive:!0}),document.addEventListener("keydown",Y,{passive:!0}),document.addEventListener("touchstart",Y,{passive:!0}),()=>{document.removeEventListener("click",Y),document.removeEventListener("keydown",Y),document.removeEventListener("touchstart",Y)}},[K,W]);const ue=k.useRef(!1),se=k.useCallback(G=>{G.preventDefault(),ue.current=!0,document.body.style.cursor="col-resize",document.body.style.userSelect="none"},[]);k.useEffect(()=>{if(typeof document>"u"||typeof document.addEventListener!="function")return;const G=Oe=>{if(!ue.current)return;const $e=Oe.clientX;Q(Math.max(ey,Math.min(ty,$e)))},Y=()=>{ue.current&&(ue.current=!1,document.body.style.cursor="",document.body.style.userSelect="")};return document.addEventListener("mousemove",G),document.addEventListener("mouseup",Y),()=>{document.removeEventListener("mousemove",G),document.removeEventListener("mouseup",Y)}},[Q]),k.useEffect(()=>{const G=J(Y=>{var Oe,$e;if(Y.type==="sessions"){const X=Ge.getState().sessions,{soundOnPermission:le,soundOnIdle:ge}=pe.getState();if(le||ge)for(const We of Y.sessions){const Z=X.find(Le=>Le.id===We.id);Z&&Z.status!==We.status&&(Z.status!=="permission"&&We.status==="permission"&&le&&dd(),Z.status==="working"&&We.status==="waiting"&&ge&&fd())}m(Y.sessions)}if(Y.type==="host-status"&&g(Y.hosts),Y.type==="server-config"&&(A(Y.remoteAllowControl),M(Y.remoteAllowAttach),D(Y.hostLabel),Y.clientLogLevel&&HR(Y.clientLogLevel)),Y.type==="session-update"){const le=Ge.getState().sessions.find(Z=>Z.id===Y.session.id),ge=le==null?void 0:le.status,We=Y.session.status;if(w(Y.session),ge){const{soundOnPermission:Z,soundOnIdle:Le}=pe.getState();ge!=="permission"&&We==="permission"&&Z&&dd(),ge==="working"&&We==="waiting"&&Le&&fd()}}if(Y.type==="session-created"){const X=Ge.getState().sessions;X.some(We=>We.id===Y.session.id)||m([Y.session,...X]),b(Y.session.id),U(Y.session.projectPath);const{projectFilters:le,setProjectFilters:ge}=pe.getState();le.length>0&&!le.includes(Y.session.projectPath)&&ge([...le,Y.session.projectPath])}if(Y.type==="session-removed"){const X=Ge.getState().sessions,le=X.filter(ge=>ge.id!==Y.sessionId);le.length!==X.length&&m(le)}if(Y.type==="agent-sessions"&&d(Y.active,Y.inactive),Y.type==="session-orphaned"&&!Y.supersededBy){const X=Ge.getState().sessions,le=X.filter(ge=>{var We;return((We=ge.agentSessionId)==null?void 0:We.trim())!==Y.session.sessionId});le.length!==X.length&&m(le)}if(Y.type==="session-activated"){const X=Ge.getState().sessions.find(le=>le.tmuxWindow===Y.window);X&&w({...X,agentSessionId:Y.session.sessionId,agentSessionName:Y.session.displayName,logFilePath:Y.session.logFilePath,isPinned:Y.session.isPinned,lastUserMessage:Y.session.lastUserMessage??X.lastUserMessage})}if(Y.type==="session-resume-result")if(Y.ok&&Y.session){const X=Ge.getState().sessions;X.some(le=>le.id===Y.session.id)||m([Y.session,...X]),b(Y.session.id)}else Y.ok||(u(`${(Oe=Y.error)==null?void 0:Oe.code}: ${($e=Y.error)==null?void 0:$e.message}`),window.setTimeout(()=>u(null),6e3));Y.type==="terminal-error"&&(!Y.sessionId||Y.sessionId===h)&&(u(`${Y.code}: ${Y.message}`),window.setTimeout(()=>u(null),6e3)),Y.type==="terminal-ready"&&Y.sessionId===h&&u(null),Y.type==="error"&&(u(Y.message),window.setTimeout(()=>u(null),6e3)),Y.type==="kill-failed"&&(E(Y.sessionId),u(Y.message),window.setTimeout(()=>u(null),6e3)),Y.type==="session-pin-result"&&!Y.ok&&Y.error&&(u(Y.error),window.setTimeout(()=>u(null),6e3)),Y.type==="session-resurrection-failed"&&yS.add({title:"Session resurrection failed",description:`"${Y.displayName}" could not be resumed: ${Y.error}`,type:"error",timeout:8e3})});return()=>{G()}},[h,U,E,te,b,m,d,g,A,M,D,J,w]);const re=k.useMemo(()=>y.find(G=>G.id===h)||null,[h,y]);k.useEffect(()=>{re!=null&&re.projectPath&&!re.remote&&j(re.projectPath)},[re==null?void 0:re.projectPath,re==null?void 0:re.remote,j]);const ae=pe(G=>G.sessionSortMode),ye=pe(G=>G.sessionSortDirection),ve=pe(G=>G.manualSessionOrder),ne=k.useMemo(()=>rp(y,{mode:ae,direction:ye,manualOrder:ve}),[y,ae,ye,ve]),ie=k.useMemo(()=>{let G=ne;return z.length>0&&(G=G.filter(Y=>z.includes(Y.projectPath))),O.length>0&&(G=G.filter(Y=>O.includes(Y.host??""))),G},[ne,z,O]);k.useEffect(()=>{h&&ie.length>0&&!ie.some(G=>G.id===h)&&b(ie[0].id)},[h,ie,b]),k.useEffect(()=>{window.matchMedia("(max-width: 767px)").matches&&x&&h===null&&ne.length>0&&b(ne[0].id)},[x,h,ne,b]);const he=k.useCallback(G=>{L(G),te({type:"session-kill",sessionId:G})},[L,te]);k.useEffect(()=>{const G=Zo(V),Y=Oe=>{if(Oe.defaultPrevented)return;const $e=Oe.code,X=$C(Oe,G);if(X&&($e==="BracketLeft"||$e==="BracketRight")){Oe.preventDefault();const le=ie;if(le.length===0)return;const ge=le.findIndex(Le=>Le.id===h);if(ge===-1){b(le[0].id);return}const Z=(ge+($e==="BracketLeft"?-1:1)+le.length)%le.length;b(le[Z].id);return}if(X&&$e==="KeyN"){Oe.preventDefault(),e||t(!0);return}if(X&&$e==="KeyX"){Oe.preventDefault(),h&&!e&&he(h);return}};return window.addEventListener("keydown",Y),()=>window.removeEventListener("keydown",Y)},[e,h,b,ie,he,V]);const oe=()=>{n(void 0),a(void 0),s(void 0),t(!0)},me=()=>c(!0),xe=(G,Y,Oe,$e)=>{te({type:"session-create",projectPath:G,name:Y,command:Oe,host:$e}),$e||j(G)},ke=G=>{te({type:"session-resume",sessionId:G})},Ne=(G,Y)=>{te({type:"session-rename",sessionId:G,newName:Y})},Ke=k.useCallback(G=>{const Y=y.find(Oe=>Oe.id===G);Y&&te({type:"session-create",projectPath:Y.projectPath,command:Y.command||void 0,host:Y.remote&&Y.host?Y.host:void 0})},[y,te]),Ae=k.useCallback((G,Y)=>{te({type:"session-pin",sessionId:G,isPinned:Y})},[te]);k.useEffect(()=>{document.documentElement.setAttribute("data-theme",$)},[$]),k.useEffect(()=>{fetch("/api/server-info").then(G=>G.json()).then(G=>_(G)).catch(()=>{})},[]);const Pe=k.useMemo(()=>F?B.filter(G=>G.host!==F):B,[B,F]);return T.jsxs("div",{className:"flex h-full overflow-hidden",children:[T.jsxs("div",{className:"hidden h-full flex-col md:flex md:shrink-0",style:{width:ee},children:[T.jsx(zC,{connectionStatus:C,onNewSession:oe,onOpenSettings:me,tailscaleIp:(f==null?void 0:f.tailscaleIp)??null}),T.jsx(hw,{sessions:y,inactiveSessions:v.inactive,selectedSessionId:h,onSelect:b,onRename:Ne,onResume:ke,onKill:he,onDuplicate:Ke,onSetPinned:Ae,loading:!x,error:S||p})]}),T.jsx("div",{className:"hidden md:block w-1 shrink-0 cursor-col-resize bg-transparent transition-colors hover:bg-white/10 active:bg-white/20",onMouseDown:se}),T.jsx(sM,{session:re,sessions:ie,connectionStatus:C,connectionEpoch:_e,sendMessage:te,subscribe:J,onClose:()=>b(null),onSelectSession:b,onNewSession:oe,onKillSession:he,onRenameSession:Ne,onOpenSettings:me,onResumeSession:ke,onSetPinned:Ae,inactiveSessions:v.inactive,loading:!x,error:S||p}),T.jsx(oM,{isOpen:e,onClose:()=>t(!1),onCreate:xe,defaultProjectDir:I,commandPresets:R,defaultPresetId:P,lastProjectPath:N,activeProjectPath:re&&!re.remote?re.projectPath:void 0,remoteHosts:Pe,remoteAllowControl:H,initialHost:r,initialPath:i,initialCommand:l}),T.jsx(W3,{isOpen:o,onClose:()=>c(!1)}),T.jsx(pP,{})]})}const MP="modulepreload",AP=function(e){return"/"+e},Fv={},PP=function(t,r,n){let i=Promise.resolve();if(r&&r.length>0){document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),s=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));i=Promise.allSettled(r.map(o=>{if(o=AP(o),o in Fv)return;Fv[o]=!0;const c=o.endsWith(".css"),p=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${o}"]${p}`))return;const u=document.createElement("link");if(u.rel=c?"stylesheet":MP,c||(u.as="script"),u.crossOrigin="",u.href=o,s&&u.setAttribute("nonce",s),document.head.appendChild(u),c)return new Promise((f,_)=>{u.addEventListener("load",f),u.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${o}`)))})}))}function a(l){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=l,window.dispatchEvent(s),!s.defaultPrevented)throw l}return i.then(l=>{for(const s of l||[])s.status==="rejected"&&a(s.reason);return t().catch(a)})};function IP(e={}){const{immediate:t=!1,onNeedRefresh:r,onOfflineReady:n,onRegistered:i,onRegisteredSW:a,onRegisterError:l}=e;let s,o;const c=async(u=!0)=>{await o};async function p(){if("serviceWorker"in navigator){if(s=await PP(async()=>{const{Workbox:u}=await import("./workbox-window.prod.es5-vqzQaGvo.js");return{Workbox:u}},[]).then(({Workbox:u})=>new u("/sw.js",{scope:"/",type:"classic"})).catch(u=>{l==null||l(u)}),!s)return;s.addEventListener("activated",u=>{(u.isUpdate||u.isExternal)&&window.location.reload()}),s.addEventListener("installed",u=>{u.isUpdate||n==null||n()}),s.register({immediate:t}).then(u=>{a?a("/sw.js",u):i==null||i(u)}).catch(u=>{l==null||l(u)})}}return o=p(),c}Qo()&&document.documentElement.classList.add("ios");NC()&&document.documentElement.classList.add("ios-pwa");IP({immediate:!0,onRegisteredSW(e,t){t&&(setInterval(()=>{t.update()},5*60*1e3),document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&t.update()}))}});const wS=document.getElementById("root");if(!wS)throw new Error("Root element not found");Z0(wS).render(T.jsx(gt.StrictMode,{children:T.jsx(DP,{})}));