diff --git a/Packages/macOS/CmuxNext/Sources/CmuxNextAgentPane/Resources/agent-pane/index.html b/Packages/macOS/CmuxNext/Sources/CmuxNextAgentPane/Resources/agent-pane/index.html index d3fe69b1534b..f6b8812b6a68 100644 --- a/Packages/macOS/CmuxNext/Sources/CmuxNextAgentPane/Resources/agent-pane/index.html +++ b/Packages/macOS/CmuxNext/Sources/CmuxNextAgentPane/Resources/agent-pane/index.html @@ -2008,11 +2008,11 @@ `);for(i=l=0;li||c[l]!==r[i]){var f=` `+c[l].replace(" at new "," at ");return e.displayName&&f.includes("")&&(f=f.replace("",e.displayName)),f}while(1<=l&&0<=i);break}}}finally{Ns=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?zn(n):""}function vm(e,t){switch(e.tag){case 26:case 27:case 5:return zn(e.type);case 16:return zn("Lazy");case 13:return e.child!==t&&t!==null?zn("Suspense Fallback"):zn("Suspense");case 19:return zn("SuspenseList");case 0:case 15:return Ms(e.type,!1);case 11:return Ms(e.type.render,!1);case 1:return Ms(e.type,!0);case 31:return zn("Activity");default:return""}}function cf(e){try{var t="",n=null;do t+=vm(e,n),n=e,e=e.return;while(e);return t}catch(l){return` Error generating stack: `+l.message+` -`+l.stack}}var rc=Object.prototype.hasOwnProperty,Pc=be.unstable_scheduleCallback,Cs=be.unstable_cancelCallback,Am=be.unstable_shouldYield,bm=be.unstable_requestPaint,$e=be.unstable_now,Em=be.unstable_getCurrentPriorityLevel,L0=be.unstable_ImmediatePriority,q0=be.unstable_UserBlockingPriority,nu=be.unstable_NormalPriority,Nm=be.unstable_LowPriority,H0=be.unstable_IdlePriority,Mm=be.log,Cm=be.unstable_setDisableYieldValue,Ji=null,Ie=null;function rn(e){if(typeof Mm=="function"&&Cm(e),Ie&&typeof Ie.setStrictMode=="function")try{Ie.setStrictMode(Ji,e)}catch{}}var Pe=Math.clz32?Math.clz32:Dm,Fm=Math.log,km=Math.LN2;function Dm(e){return e>>>=0,e===0?32:31-(Fm(e)/km|0)|0}var Aa=256,ba=262144,Ea=4194304;function wn(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ku(e,t,n){var l=e.pendingLanes;if(l===0)return 0;var i=0,a=e.suspendedLanes,u=e.pingedLanes;e=e.warmLanes;var s=l&134217727;return s!==0?(l=s&~a,l!==0?i=wn(l):(u&=s,u!==0?i=wn(u):n||(n=s&~e,n!==0&&(i=wn(n))))):(s=l&~a,s!==0?i=wn(s):u!==0?i=wn(u):n||(n=l&~e,n!==0&&(i=wn(n)))),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&(n&4194048)!==0)?t:i}function Wi(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Tm(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function U0(){var e=Ea;return Ea<<=1,(Ea&62914560)===0&&(Ea=4194304),e}function Fs(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function $i(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Bm(e,t,n,l,i,a){var u=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,r=e.hiddenUpdates;for(n=u&~n;0"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Lm=/[\n"\\]/g;function ct(e){return e.replace(Lm,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function dc(e,t,n,l,i,a,u,s){e.name="",u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"?e.type=u:e.removeAttribute("type"),t!=null?u==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+at(t)):e.value!==""+at(t)&&(e.value=""+at(t)):u!=="submit"&&u!=="reset"||e.removeAttribute("value"),t!=null?hc(e,u,at(t)):n!=null?hc(e,u,at(n)):l!=null&&e.removeAttribute("value"),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!="function"&&typeof i!="symbol"),s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"?e.name=""+at(s):e.removeAttribute("name")}function J0(e,t,n,l,i,a,u,s){if(a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"&&(e.type=a),t!=null||n!=null){if(!(a!=="submit"&&a!=="reset"||t!=null)){fc(e);return}n=n!=null?""+at(n):"",t=t!=null?""+at(t):n,s||t===e.value||(e.value=t),e.defaultValue=t}l=l??i,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=s?e.checked:!!l,e.defaultChecked=!!l,u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(e.name=u),fc(e)}function hc(e,t,n){t==="number"&&lu(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Cl(e,t,n,l){if(e=e.options,t){t={};for(var i=0;i"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),mc=!1;if(Qt)try{cl={},Object.defineProperty(cl,"passive",{get:function(){mc=!0}}),window.addEventListener("test",cl,cl),window.removeEventListener("test",cl,cl)}catch{mc=!1}var cl,on=null,ar=null,Ua=null;function ed(){if(Ua)return Ua;var e,t=ar,n=t.length,l,i="value"in on?on.value:on.textContent,a=i.length;for(e=0;e=Ai),yf=" ",vf=!1;function nd(e,t){switch(e){case"keyup":return fp.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ld(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var gl=!1;function hp(e,t){switch(e){case"compositionend":return ld(t);case"keypress":return t.which!==32?null:(vf=!0,yf);case"textInput":return e=t.data,e===yf&&vf?null:e;default:return null}}function xp(e,t){if(gl)return e==="compositionend"||!sr&&nd(e,t)?(e=ed(),Ua=ar=on=null,gl=!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)return{node:n,offset:t-e};e=l}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Nf(n)}}function sd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?sd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function cd(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=lu(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=lu(e.document)}return t}function cr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var bp=Qt&&"documentMode"in document&&11>=document.documentMode,Sl=null,pc=null,Ei=null,gc=!1;function Cf(e,t,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;gc||Sl==null||Sl!==lu(l)||(l=Sl,"selectionStart"in l&&cr(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Ei&&Li(Ei,l)||(Ei=l,l=Au(pc,"onSelect"),0>=u,i-=u,Et=1<<32-Pe(t)+i|n<k?(y=F,F=null):y=F.sibling;var E=o(d,F,p[k],g);if(E===null){F===null&&(F=y);break}e&&F&&E.alternate===null&&t(d,F),h=a(E,h,k),T===null?N=E:T.sibling=E,T=E,F=y}if(k===p.length)return n(d,F),X&&_t(d,k),N;if(F===null){for(;kk?(y=F,F=null):y=F.sibling;var D=o(d,F,E.value,g);if(D===null){F===null&&(F=y);break}e&&F&&D.alternate===null&&t(d,F),h=a(D,h,k),T===null?N=D:T.sibling=D,T=D,F=y}if(E.done)return n(d,F),X&&_t(d,k),N;if(F===null){for(;!E.done;k++,E=p.next())E=x(d,E.value,g),E!==null&&(h=a(E,h,k),T===null?N=E:T.sibling=E,T=E);return X&&_t(d,k),N}for(F=l(F);!E.done;k++,E=p.next())E=m(F,d,k,E.value,g),E!==null&&(e&&E.alternate!==null&&F.delete(E.key===null?k:E.key),h=a(E,h,k),T===null?N=E:T.sibling=E,T=E);return e&&F.forEach(function(U){return t(d,U)}),X&&_t(d,k),N}function A(d,h,p,g){if(typeof p=="object"&&p!==null&&p.type===hl&&p.key===null&&(p=p.props.children),typeof p=="object"&&p!==null){switch(p.$$typeof){case va:e:{for(var N=p.key;h!==null;){if(h.key===N){if(N=p.type,N===hl){if(h.tag===7){n(d,h.sibling),g=i(h,p.props.children),g.return=d,d=g;break e}}else if(h.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===nn&&_n(N)===h.type){n(d,h.sibling),g=i(h,p.props),fi(g,p),g.return=d,d=g;break e}n(d,h);break}else t(d,h);h=h.sibling}p.type===hl?(g=Hn(p.props.children,d.mode,g,p.key),g.return=d,d=g):(g=Ya(p.type,p.key,p.props,null,d.mode,g),fi(g,p),g.return=d,d=g)}return u(d);case pi:e:{for(N=p.key;h!==null;){if(h.key===N)if(h.tag===4&&h.stateNode.containerInfo===p.containerInfo&&h.stateNode.implementation===p.implementation){n(d,h.sibling),g=i(h,p.children||[]),g.return=d,d=g;break e}else{n(d,h);break}else t(d,h);h=h.sibling}g=ws(p,d.mode,g),g.return=d,d=g}return u(d);case nn:return p=_n(p),A(d,h,p,g)}if(gi(p))return S(d,h,p,g);if(ri(p)){if(N=ri(p),typeof N!="function")throw Error(b(150));return p=N.call(p),v(d,h,p,g)}if(typeof p.then=="function")return A(d,h,Da(p),g);if(p.$$typeof===qt)return A(d,h,ka(d,p),g);Ta(d,p)}return typeof p=="string"&&p!==""||typeof p=="number"||typeof p=="bigint"?(p=""+p,h!==null&&h.tag===6?(n(d,h.sibling),g=i(h,p),g.return=d,d=g):(n(d,h),g=zs(p,d.mode,g),g.return=d,d=g),u(d)):n(d,h)}return function(d,h,p,g){try{Ui=0;var N=A(d,h,p,g);return Dl=null,N}catch(F){if(F===Zl||F===zu)throw F;var T=Je(29,F,null,d.mode);return T.lanes=g,T.return=d,T}}}var Xn=Ed(!0),Nd=Ed(!1),ln=!1;function gr(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Nc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function pn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function gn(e,t,n){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(V&2)!==0){var i=l.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),l.pending=t,t=au(e),md(e,null,n),t}return Ru(e,l,t,n),au(e)}function Mi(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,Y0(e,n)}}function Ls(e,t){var n=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,n===l)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var u={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=u:a=a.next=u,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:l.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:l.shared,callbacks:l.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Mc=!1;function Ci(){if(Mc){var e=kl;if(e!==null)throw e}}function Fi(e,t,n,l){Mc=!1;var i=e.updateQueue;ln=!1;var a=i.firstBaseUpdate,u=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,r=c.next;c.next=null,u===null?a=r:u.next=r,u=c;var f=e.alternate;f!==null&&(f=f.updateQueue,s=f.lastBaseUpdate,s!==u&&(s===null?f.firstBaseUpdate=r:s.next=r,f.lastBaseUpdate=c))}if(a!==null){var x=i.baseState;u=0,f=r=c=null,s=a;do{var o=s.lane&-536870913,m=o!==s.lane;if(m?(Q&o)===o:(l&o)===o){o!==0&&o===wl&&(Mc=!0),f!==null&&(f=f.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});e:{var S=e,v=s;o=t;var A=n;switch(v.tag){case 1:if(S=v.payload,typeof S=="function"){x=S.call(A,x,o);break e}x=S;break e;case 3:S.flags=S.flags&-65537|128;case 0:if(S=v.payload,o=typeof S=="function"?S.call(A,x,o):S,o==null)break e;x=re({},x,o);break e;case 2:ln=!0}}o=s.callback,o!==null&&(e.flags|=64,m&&(e.flags|=8192),m=i.callbacks,m===null?i.callbacks=[o]:m.push(o))}else m={lane:o,tag:s.tag,payload:s.payload,callback:s.callback,next:null},f===null?(r=f=m,c=x):f=f.next=m,u|=o;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;m=s,s=m.next,m.next=null,i.lastBaseUpdate=m,i.shared.pending=null}}while(!0);f===null&&(c=x),i.baseState=c,i.firstBaseUpdate=r,i.lastBaseUpdate=f,a===null&&(i.shared.lanes=0),Cn|=u,e.lanes=u,e.memoizedState=x}}function Md(e,t){if(typeof e!="function")throw Error(b(191,e));e.call(t)}function Cd(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;ea?a:8;var u=w.T,s={};w.T=s,Tr(e,!1,t,n);try{var c=i(),r=w.S;if(r!==null&&r(s,c),c!==null&&typeof c=="object"&&typeof c.then=="function"){var f=Bp(c,l);ki(e,t,f,et(e))}else ki(e,t,l,et(e))}catch(x){ki(e,t,{then:function(){},status:"rejected",reason:x},et())}finally{K.p=a,u!==null&&s.types!==null&&(u.types=s.types),w.T=u}}function Lp(){}function Tc(e,t,n,l){if(e.tag!==5)throw Error(b(476));var i=$d(e).queue;Wd(e,i,t,qn,n===null?Lp:function(){return Id(e),n(l)})}function $d(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:qn,baseState:qn,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zt,lastRenderedState:qn},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zt,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Id(e){var t=$d(e);t.next===null&&(t=e.alternate.memoizedState),ki(e,t.next.queue,{},et())}function Dr(){return Te(Xi)}function Pd(){return pe().memoizedState}function eh(){return pe().memoizedState}function qp(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=et();e=pn(n);var l=gn(t,e,n);l!==null&&(Ge(l,t,n),Mi(l,t,n)),t={cache:xr()},e.payload=t;return}t=t.return}}function Hp(e,t,n){var l=et();n={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},qu(e)?nh(t,n):(n=or(e,t,n,l),n!==null&&(Ge(n,e,l),lh(n,t,l)))}function th(e,t,n){var l=et();ki(e,t,n,l)}function ki(e,t,n,l){var i={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(qu(e))nh(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var u=t.lastRenderedState,s=a(u,n);if(i.hasEagerState=!0,i.eagerState=s,tt(s,u))return Ru(e,t,i,0),le===null&&Ou(),!1}catch{}if(n=or(e,t,i,l),n!==null)return Ge(n,e,l),lh(n,t,l),!0}return!1}function Tr(e,t,n,l){if(l={lane:2,revertLane:Hr(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},qu(e)){if(t)throw Error(b(479))}else t=or(e,n,l,2),t!==null&&Ge(t,e,2)}function qu(e){var t=e.alternate;return e===L||t!==null&&t===L}function nh(e,t){Tl=fu=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function lh(e,t,n){if((n&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,Y0(e,n)}}var Yi={readContext:Te,use:_u,useCallback:he,useContext:he,useEffect:he,useImperativeHandle:he,useLayoutEffect:he,useInsertionEffect:he,useMemo:he,useReducer:he,useRef:he,useState:he,useDebugValue:he,useDeferredValue:he,useTransition:he,useSyncExternalStore:he,useId:he,useHostTransitionStatus:he,useFormState:he,useActionState:he,useOptimistic:he,useMemoCache:he,useCacheRefresh:he};Yi.useEffectEvent=he;var ih={readContext:Te,use:_u,useCallback:function(e,t){return we().memoizedState=[e,t===void 0?null:t],e},useContext:Te,useEffect:Gf,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Xa(4194308,4,Xd.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Xa(4194308,4,e,t)},useInsertionEffect:function(e,t){Xa(4,2,e,t)},useMemo:function(e,t){var n=we();t=t===void 0?null:t;var l=e();if(Zn){rn(!0);try{e()}finally{rn(!1)}}return n.memoizedState=[l,t],l},useReducer:function(e,t,n){var l=we();if(n!==void 0){var i=n(t);if(Zn){rn(!0);try{n(t)}finally{rn(!1)}}}else i=t;return l.memoizedState=l.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},l.queue=e,e=e.dispatch=Hp.bind(null,L,e),[l.memoizedState,e]},useRef:function(e){var t=we();return e={current:e},t.memoizedState=e},useState:function(e){e=kc(e);var t=e.queue,n=th.bind(null,L,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Fr,useDeferredValue:function(e,t){var n=we();return kr(n,e,t)},useTransition:function(){var e=kc(!1);return e=Wd.bind(null,L,e.queue,!0,!1),we().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var l=L,i=we();if(X){if(n===void 0)throw Error(b(407));n=n()}else{if(n=t(),le===null)throw Error(b(349));(Q&127)!==0||Bd(l,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,Gf(Rd.bind(null,l,a,e),[e]),l.flags|=2048,Ll(9,{destroy:void 0},Od.bind(null,l,a,n,t),null),n},useId:function(){var e=we(),t=le.identifierPrefix;if(X){var n=Nt,l=Et;n=(l&~(1<<32-Pe(l)-1)).toString(32)+n,t="_"+t+"R_"+n,n=du++,0<\/script>",a=a.removeChild(a.firstChild);break;case"select":a=typeof l.is=="string"?u.createElement("select",{is:l.is}):u.createElement("select"),l.multiple?a.multiple=!0:l.size&&(a.size=l.size);break;default:a=typeof l.is=="string"?u.createElement(i,{is:l.is}):u.createElement(i)}}a[ke]=t,a[Ye]=l;e:for(u=t.child;u!==null;){if(u.tag===5||u.tag===6)a.appendChild(u.stateNode);else if(u.tag!==4&&u.tag!==27&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===t)break e;for(;u.sibling===null;){if(u.return===null||u.return===t)break e;u=u.return}u.sibling.return=u.return,u=u.sibling}t.stateNode=a;e:switch(Be(a,i,l),i){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&Ot(t)}}return se(t),Xs(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&Ot(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(b(166));if(e=xn.current,rl(t)){if(e=t.stateNode,n=t.memoizedProps,l=null,i=De,i!==null)switch(i.tag){case 27:case 5:l=i.memoizedProps}e[ke]=t,e=!!(e.nodeValue===n||l!==null&&l.suppressHydrationWarning===!0||t1(e.nodeValue,n)),e||Nn(t,!0)}else e=bu(e).createTextNode(l),e[ke]=t,t.stateNode=e}return se(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(l=rl(t),n!==null){if(e===null){if(!l)throw Error(b(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(b(557));e[ke]=t}else jn(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;se(t),e=!1}else n=_s(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Ke(t),t):(Ke(t),null);if((t.flags&128)!==0)throw Error(b(558))}return se(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=rl(t),l!==null&&l.dehydrated!==null){if(e===null){if(!i)throw Error(b(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(b(317));i[ke]=t}else jn(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;se(t),i=!1}else i=_s(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(Ke(t),t):(Ke(t),null)}return Ke(t),(t.flags&128)!==0?(t.lanes=n,t):(n=l!==null,e=e!==null&&e.memoizedState!==null,n&&(l=t.child,i=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(i=l.alternate.memoizedState.cachePool.pool),a=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(a=l.memoizedState.cachePool.pool),a!==i&&(l.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Ba(t,t.updateQueue),se(t),null);case 4:return Ol(),e===null&&Ur(t.stateNode.containerInfo),se(t),null;case 10:return Yt(t.type),se(t),null;case 19:if(Me(me),l=t.memoizedState,l===null)return se(t),null;if(i=(t.flags&128)!==0,a=l.rendering,a===null)if(i)di(l,!1);else{if(xe!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(a=ou(e),a!==null){for(t.flags|=128,di(l,!1),e=a.updateQueue,t.updateQueue=e,Ba(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)pd(n,e),n=n.sibling;return ae(me,me.current&1|2),X&&_t(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&$e()>pu&&(t.flags|=128,i=!0,di(l,!1),t.lanes=4194304)}else{if(!i)if(e=ou(a),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,Ba(t,e),di(l,!0),l.tail===null&&l.tailMode==="hidden"&&!a.alternate&&!X)return se(t),null}else 2*$e()-l.renderingStartTime>pu&&n!==536870912&&(t.flags|=128,i=!0,di(l,!1),t.lanes=4194304);l.isBackwards?(a.sibling=t.child,t.child=a):(e=l.last,e!==null?e.sibling=a:t.child=a,l.last=a)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=$e(),e.sibling=null,n=me.current,ae(me,i?n&1|2:n&1),X&&_t(t,l.treeForkCount),e):(se(t),null);case 22:case 23:return Ke(t),Sr(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(n&536870912)!==0&&(t.flags&128)===0&&(se(t),t.subtreeFlags&6&&(t.flags|=8192)):se(t),n=t.updateQueue,n!==null&&Ba(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==n&&(t.flags|=2048),e!==null&&Me(Un),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Yt(ye),se(t),null;case 25:return null;case 30:return null}throw Error(b(156,t.tag))}function Qp(e,t){switch(hr(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Yt(ye),Ol(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return tu(t),null;case 31:if(t.memoizedState!==null){if(Ke(t),t.alternate===null)throw Error(b(340));jn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Ke(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(b(340));jn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Me(me),null;case 4:return Ol(),null;case 10:return Yt(t.type),null;case 22:case 23:return Ke(t),Sr(),e!==null&&Me(Un),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Yt(ye),null;case 25:return null;default:return null}}function ph(e,t){switch(hr(t),t.tag){case 3:Yt(ye),Ol();break;case 26:case 27:case 5:tu(t);break;case 4:Ol();break;case 31:t.memoizedState!==null&&Ke(t);break;case 13:Ke(t);break;case 19:Me(me);break;case 10:Yt(t.type);break;case 22:case 23:Ke(t),Sr(),e!==null&&Me(Un);break;case 24:Yt(ye)}}function na(e,t){try{var n=t.updateQueue,l=n!==null?n.lastEffect:null;if(l!==null){var i=l.next;n=i;do{if((n.tag&e)===e){l=void 0;var a=n.create,u=n.inst;l=a(),u.destroy=l}n=n.next}while(n!==i)}}catch(s){$(t,t.return,s)}}function Mn(e,t,n){try{var l=t.updateQueue,i=l!==null?l.lastEffect:null;if(i!==null){var a=i.next;l=a;do{if((l.tag&e)===e){var u=l.inst,s=u.destroy;if(s!==void 0){u.destroy=void 0,i=t;var c=n,r=s;try{r()}catch(f){$(i,c,f)}}}l=l.next}while(l!==a)}}catch(f){$(t,t.return,f)}}function gh(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Cd(t,n)}catch(l){$(e,e.return,l)}}}function Sh(e,t,n){n.props=Vn(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(l){$(e,t,l)}}function Di(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:l=e.stateNode;break;default:l=e.stateNode}typeof n=="function"?e.refCleanup=n(l):n.current=l}}catch(i){$(e,t,i)}}function Mt(e,t){var n=e.ref,l=e.refCleanup;if(n!==null)if(typeof l=="function")try{l()}catch(i){$(e,t,i)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(i){$(e,t,i)}else n.current=null}function yh(e){var t=e.type,n=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&l.focus();break e;case"img":n.src?l.src=n.src:n.srcSet&&(l.srcset=n.srcSet)}}catch(i){$(e,e.return,i)}}function Zs(e,t,n){try{var l=e.stateNode;og(l,e.type,n,t),l[Ye]=t}catch(i){$(e,e.return,i)}}function vh(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&kn(e.type)||e.tag===4}function Vs(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||vh(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&kn(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function wc(e,t,n){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Ht));else if(l!==4&&(l===27&&kn(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(wc(e,t,n),e=e.sibling;e!==null;)wc(e,t,n),e=e.sibling}function mu(e,t,n){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(l!==4&&(l===27&&kn(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(mu(e,t,n),e=e.sibling;e!==null;)mu(e,t,n),e=e.sibling}function Ah(e){var t=e.stateNode,n=e.memoizedProps;try{for(var l=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Be(t,l,n),t[ke]=e,t[Ye]=n}catch(a){$(e,e.return,a)}}var Lt=!1,Se=!1,Ks=!1,e0=typeof WeakSet=="function"?WeakSet:Set,Ee=null;function Xp(e,t){if(e=e.containerInfo,Yc=Cu,e=cd(e),cr(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var l=n.getSelection&&n.getSelection();if(l&&l.rangeCount!==0){n=l.anchorNode;var i=l.anchorOffset,a=l.focusNode;l=l.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var u=0,s=-1,c=-1,r=0,f=0,x=e,o=null;t:for(;;){for(var m;x!==n||i!==0&&x.nodeType!==3||(s=u+i),x!==a||l!==0&&x.nodeType!==3||(c=u+l),x.nodeType===3&&(u+=x.nodeValue.length),(m=x.firstChild)!==null;)o=x,x=m;for(;;){if(x===e)break t;if(o===n&&++r===i&&(s=u),o===a&&++f===l&&(c=u),(m=x.nextSibling)!==null)break;x=o,o=x.parentNode}x=m}n=s===-1||c===-1?null:{start:s,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(jc={focusedElem:e,selectionRange:n},Cu=!1,Ee=t;Ee!==null;)if(t=Ee,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ee=e;else for(;Ee!==null;){switch(t=Ee,a=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n title"))),Be(a,l,n),a[ke]=e,Ne(a),l=a;break e;case"link":var u=b0("link","href",i).get(l+(n.href||""));if(u){for(var s=0;sA&&(u=A,A=v,v=u);var d=Mf(s,v),h=Mf(s,A);if(d&&h&&(m.rangeCount!==1||m.anchorNode!==d.node||m.anchorOffset!==d.offset||m.focusNode!==h.node||m.focusOffset!==h.offset)){var p=x.createRange();p.setStart(d.node,d.offset),m.removeAllRanges(),v>A?(m.addRange(p),m.extend(h.node,h.offset)):(p.setEnd(h.node,h.offset),m.addRange(p))}}}}for(x=[],m=s;m=m.parentNode;)m.nodeType===1&&x.push({element:m,left:m.scrollLeft,top:m.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;sn?32:n,w.T=null,n=qc,qc=null;var a=yn,u=jt;if(Ae=0,Hl=yn=null,jt=0,(V&6)!==0)throw Error(b(331));var s=V;if(V|=4,Oh(a.current),Dh(a,a.current,u,n),V=s,la(0,!1),Ie&&typeof Ie.onPostCommitFiberRoot=="function")try{Ie.onPostCommitFiberRoot(Ji,a)}catch{}return!0}finally{K.p=i,w.T=l,Vh(e,t)}}function i0(e,t,n){t=rt(n,t),t=Oc(e.stateNode,t,2),e=gn(e,t,2),e!==null&&($i(e,2),kt(e))}function $(e,t,n){if(e.tag===3)i0(e,e,n);else for(;t!==null;){if(t.tag===3){i0(t,e,n);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Sn===null||!Sn.has(l))){e=rt(n,e),n=rh(2),l=gn(t,n,2),l!==null&&(oh(n,l,t,e),$i(l,2),kt(l));break}}t=t.return}}function Ws(e,t,n){var l=e.pingCache;if(l===null){l=e.pingCache=new Kp;var i=new Set;l.set(t,i)}else i=l.get(t),i===void 0&&(i=new Set,l.set(t,i));i.has(n)||(_r=!0,i.add(n),e=Pp.bind(null,e,t,n),t.then(e,e))}function Pp(e,t,n){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,le===e&&(Q&n)===n&&(xe===4||xe===3&&(Q&62914560)===Q&&300>$e()-Hu?(V&2)===0&&Ul(e,0):Lr|=n,ql===Q&&(ql=0)),kt(e)}function Jh(e,t){t===0&&(t=U0()),e=$n(e,t),e!==null&&($i(e,t),kt(e))}function eg(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Jh(e,n)}function tg(e,t){var n=0;switch(e.tag){case 31:case 13:var l=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(b(314))}l!==null&&l.delete(t),Jh(e,n)}function ng(e,t){return Pc(e,t)}var yu=null,dl=null,Uc=!1,vu=!1,$s=!1,hn=0;function kt(e){e!==dl&&e.next===null&&(dl===null?yu=dl=e:dl=dl.next=e),vu=!0,Uc||(Uc=!0,ig())}function la(e,t){if(!$s&&vu){$s=!0;do for(var n=!1,l=yu;l!==null;){if(!t)if(e!==0){var i=l.pendingLanes;if(i===0)var a=0;else{var u=l.suspendedLanes,s=l.pingedLanes;a=(1<<31-Pe(42|e)+1)-1,a&=i&~(u&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,a0(l,a))}else a=Q,a=ku(l,l===le?a:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(a&3)===0||Wi(l,a)||(n=!0,a0(l,a));l=l.next}while(n);$s=!1}}function lg(){Wh()}function Wh(){vu=Uc=!1;var e=0;hn!==0&&dg()&&(e=hn);for(var t=$e(),n=null,l=yu;l!==null;){var i=l.next,a=$h(l,t);a===0?(l.next=null,n===null?yu=i:n.next=i,i===null&&(dl=n)):(n=l,(e!==0||(a&3)!==0)&&(vu=!0)),l=i}Ae!==0&&Ae!==5||la(e,!1),hn!==0&&(hn=0)}function $h(e,t){for(var n=e.suspendedLanes,l=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0>>=0,e===0?32:31-(Fm(e)/km|0)|0}var Aa=256,ba=262144,Ea=4194304;function wn(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ku(e,t,n){var l=e.pendingLanes;if(l===0)return 0;var i=0,a=e.suspendedLanes,u=e.pingedLanes;e=e.warmLanes;var s=l&134217727;return s!==0?(l=s&~a,l!==0?i=wn(l):(u&=s,u!==0?i=wn(u):n||(n=s&~e,n!==0&&(i=wn(n))))):(s=l&~a,s!==0?i=wn(s):u!==0?i=wn(u):n||(n=l&~e,n!==0&&(i=wn(n)))),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&(n&4194048)!==0)?t:i}function Wi(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Tm(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function U0(){var e=Ea;return Ea<<=1,(Ea&62914560)===0&&(Ea=4194304),e}function Fs(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function $i(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Bm(e,t,n,l,i,a){var u=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,r=e.hiddenUpdates;for(n=u&~n;0"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Lm=/[\n"\\]/g;function ct(e){return e.replace(Lm,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function dc(e,t,n,l,i,a,u,s){e.name="",u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"?e.type=u:e.removeAttribute("type"),t!=null?u==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+at(t)):e.value!==""+at(t)&&(e.value=""+at(t)):u!=="submit"&&u!=="reset"||e.removeAttribute("value"),t!=null?hc(e,u,at(t)):n!=null?hc(e,u,at(n)):l!=null&&e.removeAttribute("value"),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!="function"&&typeof i!="symbol"),s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"?e.name=""+at(s):e.removeAttribute("name")}function J0(e,t,n,l,i,a,u,s){if(a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"&&(e.type=a),t!=null||n!=null){if(!(a!=="submit"&&a!=="reset"||t!=null)){fc(e);return}n=n!=null?""+at(n):"",t=t!=null?""+at(t):n,s||t===e.value||(e.value=t),e.defaultValue=t}l=l??i,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=s?e.checked:!!l,e.defaultChecked=!!l,u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(e.name=u),fc(e)}function hc(e,t,n){t==="number"&&lu(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Cl(e,t,n,l){if(e=e.options,t){t={};for(var i=0;i"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),mc=!1;if(Qt)try{cl={},Object.defineProperty(cl,"passive",{get:function(){mc=!0}}),window.addEventListener("test",cl,cl),window.removeEventListener("test",cl,cl)}catch{mc=!1}var cl,on=null,ar=null,Ua=null;function ed(){if(Ua)return Ua;var e,t=ar,n=t.length,l,i="value"in on?on.value:on.textContent,a=i.length;for(e=0;e=Ai),yf=" ",vf=!1;function nd(e,t){switch(e){case"keyup":return fp.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ld(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var gl=!1;function hp(e,t){switch(e){case"compositionend":return ld(t);case"keypress":return t.which!==32?null:(vf=!0,yf);case"textInput":return e=t.data,e===yf&&vf?null:e;default:return null}}function xp(e,t){if(gl)return e==="compositionend"||!sr&&nd(e,t)?(e=ed(),Ua=ar=on=null,gl=!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)return{node:n,offset:t-e};e=l}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Nf(n)}}function sd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?sd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function cd(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=lu(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=lu(e.document)}return t}function cr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var bp=Qt&&"documentMode"in document&&11>=document.documentMode,Sl=null,pc=null,Ei=null,gc=!1;function Cf(e,t,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;gc||Sl==null||Sl!==lu(l)||(l=Sl,"selectionStart"in l&&cr(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Ei&&Li(Ei,l)||(Ei=l,l=Au(pc,"onSelect"),0>=u,i-=u,Et=1<<32-Pe(t)+i|n<k?(y=F,F=null):y=F.sibling;var E=o(d,F,p[k],g);if(E===null){F===null&&(F=y);break}e&&F&&E.alternate===null&&t(d,F),h=a(E,h,k),T===null?M=E:T.sibling=E,T=E,F=y}if(k===p.length)return n(d,F),X&&_t(d,k),M;if(F===null){for(;kk?(y=F,F=null):y=F.sibling;var D=o(d,F,E.value,g);if(D===null){F===null&&(F=y);break}e&&F&&D.alternate===null&&t(d,F),h=a(D,h,k),T===null?M=D:T.sibling=D,T=D,F=y}if(E.done)return n(d,F),X&&_t(d,k),M;if(F===null){for(;!E.done;k++,E=p.next())E=x(d,E.value,g),E!==null&&(h=a(E,h,k),T===null?M=E:T.sibling=E,T=E);return X&&_t(d,k),M}for(F=l(F);!E.done;k++,E=p.next())E=m(F,d,k,E.value,g),E!==null&&(e&&E.alternate!==null&&F.delete(E.key===null?k:E.key),h=a(E,h,k),T===null?M=E:T.sibling=E,T=E);return e&&F.forEach(function(U){return t(d,U)}),X&&_t(d,k),M}function A(d,h,p,g){if(typeof p=="object"&&p!==null&&p.type===hl&&p.key===null&&(p=p.props.children),typeof p=="object"&&p!==null){switch(p.$$typeof){case va:e:{for(var M=p.key;h!==null;){if(h.key===M){if(M=p.type,M===hl){if(h.tag===7){n(d,h.sibling),g=i(h,p.props.children),g.return=d,d=g;break e}}else if(h.elementType===M||typeof M=="object"&&M!==null&&M.$$typeof===nn&&_n(M)===h.type){n(d,h.sibling),g=i(h,p.props),fi(g,p),g.return=d,d=g;break e}n(d,h);break}else t(d,h);h=h.sibling}p.type===hl?(g=Hn(p.props.children,d.mode,g,p.key),g.return=d,d=g):(g=Ya(p.type,p.key,p.props,null,d.mode,g),fi(g,p),g.return=d,d=g)}return u(d);case pi:e:{for(M=p.key;h!==null;){if(h.key===M)if(h.tag===4&&h.stateNode.containerInfo===p.containerInfo&&h.stateNode.implementation===p.implementation){n(d,h.sibling),g=i(h,p.children||[]),g.return=d,d=g;break e}else{n(d,h);break}else t(d,h);h=h.sibling}g=ws(p,d.mode,g),g.return=d,d=g}return u(d);case nn:return p=_n(p),A(d,h,p,g)}if(gi(p))return S(d,h,p,g);if(ri(p)){if(M=ri(p),typeof M!="function")throw Error(b(150));return p=M.call(p),v(d,h,p,g)}if(typeof p.then=="function")return A(d,h,Da(p),g);if(p.$$typeof===qt)return A(d,h,ka(d,p),g);Ta(d,p)}return typeof p=="string"&&p!==""||typeof p=="number"||typeof p=="bigint"?(p=""+p,h!==null&&h.tag===6?(n(d,h.sibling),g=i(h,p),g.return=d,d=g):(n(d,h),g=zs(p,d.mode,g),g.return=d,d=g),u(d)):n(d,h)}return function(d,h,p,g){try{Ui=0;var M=A(d,h,p,g);return Dl=null,M}catch(F){if(F===Zl||F===zu)throw F;var T=Je(29,F,null,d.mode);return T.lanes=g,T.return=d,T}}}var Xn=Ed(!0),Nd=Ed(!1),ln=!1;function gr(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Nc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function pn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function gn(e,t,n){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(V&2)!==0){var i=l.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),l.pending=t,t=au(e),md(e,null,n),t}return Ru(e,l,t,n),au(e)}function Mi(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,Y0(e,n)}}function Ls(e,t){var n=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,n===l)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var u={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=u:a=a.next=u,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:l.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:l.shared,callbacks:l.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Mc=!1;function Ci(){if(Mc){var e=kl;if(e!==null)throw e}}function Fi(e,t,n,l){Mc=!1;var i=e.updateQueue;ln=!1;var a=i.firstBaseUpdate,u=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,r=c.next;c.next=null,u===null?a=r:u.next=r,u=c;var f=e.alternate;f!==null&&(f=f.updateQueue,s=f.lastBaseUpdate,s!==u&&(s===null?f.firstBaseUpdate=r:s.next=r,f.lastBaseUpdate=c))}if(a!==null){var x=i.baseState;u=0,f=r=c=null,s=a;do{var o=s.lane&-536870913,m=o!==s.lane;if(m?(Q&o)===o:(l&o)===o){o!==0&&o===wl&&(Mc=!0),f!==null&&(f=f.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});e:{var S=e,v=s;o=t;var A=n;switch(v.tag){case 1:if(S=v.payload,typeof S=="function"){x=S.call(A,x,o);break e}x=S;break e;case 3:S.flags=S.flags&-65537|128;case 0:if(S=v.payload,o=typeof S=="function"?S.call(A,x,o):S,o==null)break e;x=re({},x,o);break e;case 2:ln=!0}}o=s.callback,o!==null&&(e.flags|=64,m&&(e.flags|=8192),m=i.callbacks,m===null?i.callbacks=[o]:m.push(o))}else m={lane:o,tag:s.tag,payload:s.payload,callback:s.callback,next:null},f===null?(r=f=m,c=x):f=f.next=m,u|=o;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;m=s,s=m.next,m.next=null,i.lastBaseUpdate=m,i.shared.pending=null}}while(!0);f===null&&(c=x),i.baseState=c,i.firstBaseUpdate=r,i.lastBaseUpdate=f,a===null&&(i.shared.lanes=0),Cn|=u,e.lanes=u,e.memoizedState=x}}function Md(e,t){if(typeof e!="function")throw Error(b(191,e));e.call(t)}function Cd(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;ea?a:8;var u=w.T,s={};w.T=s,Tr(e,!1,t,n);try{var c=i(),r=w.S;if(r!==null&&r(s,c),c!==null&&typeof c=="object"&&typeof c.then=="function"){var f=Bp(c,l);ki(e,t,f,et(e))}else ki(e,t,l,et(e))}catch(x){ki(e,t,{then:function(){},status:"rejected",reason:x},et())}finally{K.p=a,u!==null&&s.types!==null&&(u.types=s.types),w.T=u}}function Lp(){}function Tc(e,t,n,l){if(e.tag!==5)throw Error(b(476));var i=$d(e).queue;Wd(e,i,t,qn,n===null?Lp:function(){return Id(e),n(l)})}function $d(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:qn,baseState:qn,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zt,lastRenderedState:qn},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zt,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Id(e){var t=$d(e);t.next===null&&(t=e.alternate.memoizedState),ki(e,t.next.queue,{},et())}function Dr(){return Te(Xi)}function Pd(){return pe().memoizedState}function eh(){return pe().memoizedState}function qp(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=et();e=pn(n);var l=gn(t,e,n);l!==null&&(Ge(l,t,n),Mi(l,t,n)),t={cache:xr()},e.payload=t;return}t=t.return}}function Hp(e,t,n){var l=et();n={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},qu(e)?nh(t,n):(n=or(e,t,n,l),n!==null&&(Ge(n,e,l),lh(n,t,l)))}function th(e,t,n){var l=et();ki(e,t,n,l)}function ki(e,t,n,l){var i={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(qu(e))nh(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var u=t.lastRenderedState,s=a(u,n);if(i.hasEagerState=!0,i.eagerState=s,tt(s,u))return Ru(e,t,i,0),le===null&&Ou(),!1}catch{}if(n=or(e,t,i,l),n!==null)return Ge(n,e,l),lh(n,t,l),!0}return!1}function Tr(e,t,n,l){if(l={lane:2,revertLane:Hr(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},qu(e)){if(t)throw Error(b(479))}else t=or(e,n,l,2),t!==null&&Ge(t,e,2)}function qu(e){var t=e.alternate;return e===L||t!==null&&t===L}function nh(e,t){Tl=fu=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function lh(e,t,n){if((n&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,Y0(e,n)}}var Yi={readContext:Te,use:_u,useCallback:he,useContext:he,useEffect:he,useImperativeHandle:he,useLayoutEffect:he,useInsertionEffect:he,useMemo:he,useReducer:he,useRef:he,useState:he,useDebugValue:he,useDeferredValue:he,useTransition:he,useSyncExternalStore:he,useId:he,useHostTransitionStatus:he,useFormState:he,useActionState:he,useOptimistic:he,useMemoCache:he,useCacheRefresh:he};Yi.useEffectEvent=he;var ih={readContext:Te,use:_u,useCallback:function(e,t){return we().memoizedState=[e,t===void 0?null:t],e},useContext:Te,useEffect:Gf,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Xa(4194308,4,Xd.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Xa(4194308,4,e,t)},useInsertionEffect:function(e,t){Xa(4,2,e,t)},useMemo:function(e,t){var n=we();t=t===void 0?null:t;var l=e();if(Zn){rn(!0);try{e()}finally{rn(!1)}}return n.memoizedState=[l,t],l},useReducer:function(e,t,n){var l=we();if(n!==void 0){var i=n(t);if(Zn){rn(!0);try{n(t)}finally{rn(!1)}}}else i=t;return l.memoizedState=l.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},l.queue=e,e=e.dispatch=Hp.bind(null,L,e),[l.memoizedState,e]},useRef:function(e){var t=we();return e={current:e},t.memoizedState=e},useState:function(e){e=kc(e);var t=e.queue,n=th.bind(null,L,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Fr,useDeferredValue:function(e,t){var n=we();return kr(n,e,t)},useTransition:function(){var e=kc(!1);return e=Wd.bind(null,L,e.queue,!0,!1),we().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var l=L,i=we();if(X){if(n===void 0)throw Error(b(407));n=n()}else{if(n=t(),le===null)throw Error(b(349));(Q&127)!==0||Bd(l,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,Gf(Rd.bind(null,l,a,e),[e]),l.flags|=2048,Ll(9,{destroy:void 0},Od.bind(null,l,a,n,t),null),n},useId:function(){var e=we(),t=le.identifierPrefix;if(X){var n=Nt,l=Et;n=(l&~(1<<32-Pe(l)-1)).toString(32)+n,t="_"+t+"R_"+n,n=du++,0<\/script>",a=a.removeChild(a.firstChild);break;case"select":a=typeof l.is=="string"?u.createElement("select",{is:l.is}):u.createElement("select"),l.multiple?a.multiple=!0:l.size&&(a.size=l.size);break;default:a=typeof l.is=="string"?u.createElement(i,{is:l.is}):u.createElement(i)}}a[ke]=t,a[Ye]=l;e:for(u=t.child;u!==null;){if(u.tag===5||u.tag===6)a.appendChild(u.stateNode);else if(u.tag!==4&&u.tag!==27&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===t)break e;for(;u.sibling===null;){if(u.return===null||u.return===t)break e;u=u.return}u.sibling.return=u.return,u=u.sibling}t.stateNode=a;e:switch(Be(a,i,l),i){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&Ot(t)}}return se(t),Xs(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&Ot(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(b(166));if(e=xn.current,rl(t)){if(e=t.stateNode,n=t.memoizedProps,l=null,i=De,i!==null)switch(i.tag){case 27:case 5:l=i.memoizedProps}e[ke]=t,e=!!(e.nodeValue===n||l!==null&&l.suppressHydrationWarning===!0||t1(e.nodeValue,n)),e||Nn(t,!0)}else e=bu(e).createTextNode(l),e[ke]=t,t.stateNode=e}return se(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(l=rl(t),n!==null){if(e===null){if(!l)throw Error(b(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(b(557));e[ke]=t}else jn(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;se(t),e=!1}else n=_s(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Ke(t),t):(Ke(t),null);if((t.flags&128)!==0)throw Error(b(558))}return se(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=rl(t),l!==null&&l.dehydrated!==null){if(e===null){if(!i)throw Error(b(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(b(317));i[ke]=t}else jn(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;se(t),i=!1}else i=_s(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(Ke(t),t):(Ke(t),null)}return Ke(t),(t.flags&128)!==0?(t.lanes=n,t):(n=l!==null,e=e!==null&&e.memoizedState!==null,n&&(l=t.child,i=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(i=l.alternate.memoizedState.cachePool.pool),a=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(a=l.memoizedState.cachePool.pool),a!==i&&(l.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Ba(t,t.updateQueue),se(t),null);case 4:return Ol(),e===null&&Ur(t.stateNode.containerInfo),se(t),null;case 10:return Yt(t.type),se(t),null;case 19:if(Me(me),l=t.memoizedState,l===null)return se(t),null;if(i=(t.flags&128)!==0,a=l.rendering,a===null)if(i)di(l,!1);else{if(xe!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(a=ou(e),a!==null){for(t.flags|=128,di(l,!1),e=a.updateQueue,t.updateQueue=e,Ba(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)pd(n,e),n=n.sibling;return ae(me,me.current&1|2),X&&_t(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&$e()>pu&&(t.flags|=128,i=!0,di(l,!1),t.lanes=4194304)}else{if(!i)if(e=ou(a),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,Ba(t,e),di(l,!0),l.tail===null&&l.tailMode==="hidden"&&!a.alternate&&!X)return se(t),null}else 2*$e()-l.renderingStartTime>pu&&n!==536870912&&(t.flags|=128,i=!0,di(l,!1),t.lanes=4194304);l.isBackwards?(a.sibling=t.child,t.child=a):(e=l.last,e!==null?e.sibling=a:t.child=a,l.last=a)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=$e(),e.sibling=null,n=me.current,ae(me,i?n&1|2:n&1),X&&_t(t,l.treeForkCount),e):(se(t),null);case 22:case 23:return Ke(t),Sr(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(n&536870912)!==0&&(t.flags&128)===0&&(se(t),t.subtreeFlags&6&&(t.flags|=8192)):se(t),n=t.updateQueue,n!==null&&Ba(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==n&&(t.flags|=2048),e!==null&&Me(Un),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Yt(ye),se(t),null;case 25:return null;case 30:return null}throw Error(b(156,t.tag))}function Qp(e,t){switch(hr(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Yt(ye),Ol(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return tu(t),null;case 31:if(t.memoizedState!==null){if(Ke(t),t.alternate===null)throw Error(b(340));jn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Ke(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(b(340));jn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Me(me),null;case 4:return Ol(),null;case 10:return Yt(t.type),null;case 22:case 23:return Ke(t),Sr(),e!==null&&Me(Un),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Yt(ye),null;case 25:return null;default:return null}}function ph(e,t){switch(hr(t),t.tag){case 3:Yt(ye),Ol();break;case 26:case 27:case 5:tu(t);break;case 4:Ol();break;case 31:t.memoizedState!==null&&Ke(t);break;case 13:Ke(t);break;case 19:Me(me);break;case 10:Yt(t.type);break;case 22:case 23:Ke(t),Sr(),e!==null&&Me(Un);break;case 24:Yt(ye)}}function na(e,t){try{var n=t.updateQueue,l=n!==null?n.lastEffect:null;if(l!==null){var i=l.next;n=i;do{if((n.tag&e)===e){l=void 0;var a=n.create,u=n.inst;l=a(),u.destroy=l}n=n.next}while(n!==i)}}catch(s){$(t,t.return,s)}}function Mn(e,t,n){try{var l=t.updateQueue,i=l!==null?l.lastEffect:null;if(i!==null){var a=i.next;l=a;do{if((l.tag&e)===e){var u=l.inst,s=u.destroy;if(s!==void 0){u.destroy=void 0,i=t;var c=n,r=s;try{r()}catch(f){$(i,c,f)}}}l=l.next}while(l!==a)}}catch(f){$(t,t.return,f)}}function gh(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Cd(t,n)}catch(l){$(e,e.return,l)}}}function Sh(e,t,n){n.props=Vn(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(l){$(e,t,l)}}function Di(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:l=e.stateNode;break;default:l=e.stateNode}typeof n=="function"?e.refCleanup=n(l):n.current=l}}catch(i){$(e,t,i)}}function Mt(e,t){var n=e.ref,l=e.refCleanup;if(n!==null)if(typeof l=="function")try{l()}catch(i){$(e,t,i)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(i){$(e,t,i)}else n.current=null}function yh(e){var t=e.type,n=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&l.focus();break e;case"img":n.src?l.src=n.src:n.srcSet&&(l.srcset=n.srcSet)}}catch(i){$(e,e.return,i)}}function Zs(e,t,n){try{var l=e.stateNode;og(l,e.type,n,t),l[Ye]=t}catch(i){$(e,e.return,i)}}function vh(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&kn(e.type)||e.tag===4}function Vs(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||vh(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&kn(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function wc(e,t,n){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Ht));else if(l!==4&&(l===27&&kn(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(wc(e,t,n),e=e.sibling;e!==null;)wc(e,t,n),e=e.sibling}function mu(e,t,n){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(l!==4&&(l===27&&kn(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(mu(e,t,n),e=e.sibling;e!==null;)mu(e,t,n),e=e.sibling}function Ah(e){var t=e.stateNode,n=e.memoizedProps;try{for(var l=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Be(t,l,n),t[ke]=e,t[Ye]=n}catch(a){$(e,e.return,a)}}var Lt=!1,Se=!1,Ks=!1,e0=typeof WeakSet=="function"?WeakSet:Set,Ee=null;function Xp(e,t){if(e=e.containerInfo,Yc=Cu,e=cd(e),cr(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var l=n.getSelection&&n.getSelection();if(l&&l.rangeCount!==0){n=l.anchorNode;var i=l.anchorOffset,a=l.focusNode;l=l.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var u=0,s=-1,c=-1,r=0,f=0,x=e,o=null;t:for(;;){for(var m;x!==n||i!==0&&x.nodeType!==3||(s=u+i),x!==a||l!==0&&x.nodeType!==3||(c=u+l),x.nodeType===3&&(u+=x.nodeValue.length),(m=x.firstChild)!==null;)o=x,x=m;for(;;){if(x===e)break t;if(o===n&&++r===i&&(s=u),o===a&&++f===l&&(c=u),(m=x.nextSibling)!==null)break;x=o,o=x.parentNode}x=m}n=s===-1||c===-1?null:{start:s,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(jc={focusedElem:e,selectionRange:n},Cu=!1,Ee=t;Ee!==null;)if(t=Ee,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ee=e;else for(;Ee!==null;){switch(t=Ee,a=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n title"))),Be(a,l,n),a[ke]=e,Ne(a),l=a;break e;case"link":var u=b0("link","href",i).get(l+(n.href||""));if(u){for(var s=0;sA&&(u=A,A=v,v=u);var d=Mf(s,v),h=Mf(s,A);if(d&&h&&(m.rangeCount!==1||m.anchorNode!==d.node||m.anchorOffset!==d.offset||m.focusNode!==h.node||m.focusOffset!==h.offset)){var p=x.createRange();p.setStart(d.node,d.offset),m.removeAllRanges(),v>A?(m.addRange(p),m.extend(h.node,h.offset)):(p.setEnd(h.node,h.offset),m.addRange(p))}}}}for(x=[],m=s;m=m.parentNode;)m.nodeType===1&&x.push({element:m,left:m.scrollLeft,top:m.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;sn?32:n,w.T=null,n=qc,qc=null;var a=yn,u=jt;if(Ae=0,Hl=yn=null,jt=0,(V&6)!==0)throw Error(b(331));var s=V;if(V|=4,Oh(a.current),Dh(a,a.current,u,n),V=s,la(0,!1),Ie&&typeof Ie.onPostCommitFiberRoot=="function")try{Ie.onPostCommitFiberRoot(Ji,a)}catch{}return!0}finally{K.p=i,w.T=l,Vh(e,t)}}function i0(e,t,n){t=rt(n,t),t=Oc(e.stateNode,t,2),e=gn(e,t,2),e!==null&&($i(e,2),kt(e))}function $(e,t,n){if(e.tag===3)i0(e,e,n);else for(;t!==null;){if(t.tag===3){i0(t,e,n);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Sn===null||!Sn.has(l))){e=rt(n,e),n=rh(2),l=gn(t,n,2),l!==null&&(oh(n,l,t,e),$i(l,2),kt(l));break}}t=t.return}}function Ws(e,t,n){var l=e.pingCache;if(l===null){l=e.pingCache=new Kp;var i=new Set;l.set(t,i)}else i=l.get(t),i===void 0&&(i=new Set,l.set(t,i));i.has(n)||(_r=!0,i.add(n),e=Pp.bind(null,e,t,n),t.then(e,e))}function Pp(e,t,n){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,le===e&&(Q&n)===n&&(xe===4||xe===3&&(Q&62914560)===Q&&300>$e()-Hu?(V&2)===0&&Ul(e,0):Lr|=n,ql===Q&&(ql=0)),kt(e)}function Jh(e,t){t===0&&(t=U0()),e=$n(e,t),e!==null&&($i(e,t),kt(e))}function eg(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Jh(e,n)}function tg(e,t){var n=0;switch(e.tag){case 31:case 13:var l=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(b(314))}l!==null&&l.delete(t),Jh(e,n)}function ng(e,t){return Pc(e,t)}var yu=null,dl=null,Uc=!1,vu=!1,$s=!1,hn=0;function kt(e){e!==dl&&e.next===null&&(dl===null?yu=dl=e:dl=dl.next=e),vu=!0,Uc||(Uc=!0,ig())}function la(e,t){if(!$s&&vu){$s=!0;do for(var n=!1,l=yu;l!==null;){if(!t)if(e!==0){var i=l.pendingLanes;if(i===0)var a=0;else{var u=l.suspendedLanes,s=l.pingedLanes;a=(1<<31-Pe(42|e)+1)-1,a&=i&~(u&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,a0(l,a))}else a=Q,a=ku(l,l===le?a:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(a&3)===0||Wi(l,a)||(n=!0,a0(l,a));l=l.next}while(n);$s=!1}}function lg(){Wh()}function Wh(){vu=Uc=!1;var e=0;hn!==0&&dg()&&(e=hn);for(var t=$e(),n=null,l=yu;l!==null;){var i=l.next,a=$h(l,t);a===0?(l.next=null,n===null?yu=i:n.next=i,i===null&&(dl=n)):(n=l,(e!==0||(a&3)!==0)&&(vu=!0)),l=i}Ae!==0&&Ae!==5||la(e,!1),hn!==0&&(hn=0)}function $h(e,t){for(var n=e.suspendedLanes,l=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0s)break;var f=c.transferSize,x=c.initiatorType;f&&d0(x)&&(c=c.responseEnd,u+=f*(c"u"?null:document;function u1(e,t,n){var l=Kl;if(l&&typeof t=="string"&&t){var i=ct(t);i='link[rel="'+e+'"][href="'+i+'"]',typeof n=="string"&&(i+='[crossorigin="'+n+'"]'),y0.has(i)||(y0.add(i),e={rel:e,crossOrigin:n,href:t},l.querySelector(i)===null&&(t=l.createElement("link"),Be(t,"link",e),Ne(t),l.head.appendChild(t)))}}function Ag(e){Jt.D(e),u1("dns-prefetch",e,null)}function bg(e,t){Jt.C(e,t),u1("preconnect",e,t)}function Eg(e,t,n){Jt.L(e,t,n);var l=Kl;if(l&&e&&t){var i='link[rel="preload"][as="'+ct(t)+'"]';t==="image"&&n&&n.imageSrcSet?(i+='[imagesrcset="'+ct(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(i+='[imagesizes="'+ct(n.imageSizes)+'"]')):i+='[href="'+ct(e)+'"]';var a=i;switch(t){case"style":a=Gl(e);break;case"script":a=Jl(e)}ht.has(a)||(e=re({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),ht.set(a,e),l.querySelector(i)!==null||t==="style"&&l.querySelector(ia(a))||t==="script"&&l.querySelector(aa(a))||(t=l.createElement("link"),Be(t,"link",e),Ne(t),l.head.appendChild(t)))}}function Ng(e,t){Jt.m(e,t);var n=Kl;if(n&&e){var l=t&&typeof t.as=="string"?t.as:"script",i='link[rel="modulepreload"][as="'+ct(l)+'"][href="'+ct(e)+'"]',a=i;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":a=Jl(e)}if(!ht.has(a)&&(e=re({rel:"modulepreload",href:e},t),ht.set(a,e),n.querySelector(i)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(aa(a)))return}l=n.createElement("link"),Be(l,"link",e),Ne(l),n.head.appendChild(l)}}}function Mg(e,t,n){Jt.S(e,t,n);var l=Kl;if(l&&e){var i=Ml(l).hoistableStyles,a=Gl(e);t=t||"default";var u=i.get(a);if(!u){var s={loading:0,preload:null};if(u=l.querySelector(ia(a)))s.loading=5;else{e=re({rel:"stylesheet",href:e,"data-precedence":t},n),(n=ht.get(a))&&Gr(e,n);var c=u=l.createElement("link");Ne(c),Be(c,"link",e),c._p=new Promise(function(r,f){c.onload=r,c.onerror=f}),c.addEventListener("load",function(){s.loading|=1}),c.addEventListener("error",function(){s.loading|=2}),s.loading|=4,Ja(u,t,l)}u={type:"stylesheet",instance:u,count:1,state:s},i.set(a,u)}}}function Cg(e,t){Jt.X(e,t);var n=Kl;if(n&&e){var l=Ml(n).hoistableScripts,i=Jl(e),a=l.get(i);a||(a=n.querySelector(aa(i)),a||(e=re({src:e,async:!0},t),(t=ht.get(i))&&Yr(e,t),a=n.createElement("script"),Ne(a),Be(a,"link",e),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},l.set(i,a))}}function Fg(e,t){Jt.M(e,t);var n=Kl;if(n&&e){var l=Ml(n).hoistableScripts,i=Jl(e),a=l.get(i);a||(a=n.querySelector(aa(i)),a||(e=re({src:e,async:!0,type:"module"},t),(t=ht.get(i))&&Yr(e,t),a=n.createElement("script"),Ne(a),Be(a,"link",e),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},l.set(i,a))}}function v0(e,t,n,l){var i=(i=xn.current)?Eu(i):null;if(!i)throw Error(b(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Gl(n.href),n=Ml(i).hoistableStyles,l=n.get(t),l||(l={type:"style",instance:null,count:0,state:null},n.set(t,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Gl(n.href);var a=Ml(i).hoistableStyles,u=a.get(e);if(u||(i=i.ownerDocument||i,u={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},a.set(e,u),(a=i.querySelector(ia(e)))&&!a._p&&(u.instance=a,u.state.loading=5),ht.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},ht.set(e,n),a||kg(i,e,n,u.state))),t&&l===null)throw Error(b(528,""));return u}if(t&&l!==null)throw Error(b(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Jl(n),n=Ml(i).hoistableScripts,l=n.get(t),l||(l={type:"script",instance:null,count:0,state:null},n.set(t,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(b(444,e))}}function Gl(e){return'href="'+ct(e)+'"'}function ia(e){return'link[rel="stylesheet"]['+e+"]"}function s1(e){return re({},e,{"data-precedence":e.precedence,precedence:null})}function kg(e,t,n,l){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?l.loading=1:(t=e.createElement("link"),l.preload=t,t.addEventListener("load",function(){return l.loading|=1}),t.addEventListener("error",function(){return l.loading|=2}),Be(t,"link",n),Ne(t),e.head.appendChild(t))}function Jl(e){return'[src="'+ct(e)+'"]'}function aa(e){return"script[async]"+e}function A0(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+ct(n.href)+'"]');if(l)return t.instance=l,Ne(l),l;var i=re({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),Ne(l),Be(l,"style",i),Ja(l,n.precedence,e),t.instance=l;case"stylesheet":i=Gl(n.href);var a=e.querySelector(ia(i));if(a)return t.state.loading|=4,t.instance=a,Ne(a),a;l=s1(n),(i=ht.get(i))&&Gr(l,i),a=(e.ownerDocument||e).createElement("link"),Ne(a);var u=a;return u._p=new Promise(function(s,c){u.onload=s,u.onerror=c}),Be(a,"link",l),t.state.loading|=4,Ja(a,n.precedence,e),t.instance=a;case"script":return a=Jl(n.src),(i=e.querySelector(aa(a)))?(t.instance=i,Ne(i),i):(l=n,(i=ht.get(a))&&(l=re({},n),Yr(l,i)),e=e.ownerDocument||e,i=e.createElement("script"),Ne(i),Be(i,"link",l),e.head.appendChild(i),t.instance=i);case"void":return null;default:throw Error(b(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,Ja(l,n.precedence,e));return t.instance}function Ja(e,t,n){for(var l=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=l.length?l[l.length-1]:null,a=i,u=0;u title"):null)}function Dg(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function c1(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Tg(e,t,n,l){if(n.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var i=Gl(l.href),a=t.querySelector(ia(i));if(a){t=a._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Nu.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Ne(a);return}a=t.ownerDocument||t,l=s1(l),(i=ht.get(i))&&Gr(l,i),a=a.createElement("link"),Ne(a);var u=a;u._p=new Promise(function(s,c){u.onload=s,u.onerror=c}),Be(a,"link",l),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=Nu.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var tc=0;function Bg(e,t){return e.stylesheets&&e.count===0&&$a(e,e.stylesheets),0tc?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(i)}}:null}function Nu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)$a(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Mu=null;function $a(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Mu=new Map,t.forEach(Og,e),Mu=null,Nu.call(e))}function Og(e,t){if(!(t.state.loading&4)){var n=Mu.get(e);if(n)var l=n.get(null);else{n=new Map,Mu.set(e,n);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),a=0;a{"use strict";function g1(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(g1)}catch(e){console.error(e)}}g1(),S1.exports=p1()});var zx=At(as=>{"use strict";var kv=Symbol.for("react.transitional.element"),Dv=Symbol.for("react.fragment");function Rx(e,t,n){var l=null;if(n!==void 0&&(l=""+n),t.key!==void 0&&(l=""+t.key),"key"in t){n={};for(var i in t)i!=="key"&&(n[i]=t[i])}else n=t;return t=n.ref,{$$typeof:kv,type:e,key:l,ref:t!==void 0?t:null,props:n}}as.Fragment=Dv;as.jsx=Rx;as.jsxs=Rx});var ha=At((UA,wx)=>{"use strict";wx.exports=zx()});var Ux=On(y1(),1);var z=On(Sa(),1),Co=On(bs(),1);var Ug={isDark:null,pageBackground:"--agent-page-bg",surfaceBackground:"--agent-surface",surfaceElevatedBackground:"--agent-surface-elevated",inputBackground:"--agent-input-bg",border:"--agent-border",borderStrong:"--agent-border-strong",text:"--agent-text",mutedText:"--agent-muted",softText:"--agent-soft",accent:"--agent-accent",accentSoft:"--agent-accent-soft",danger:"--agent-danger",shadow:"--agent-shadow"};function v1(e){if(typeof document>"u")return;let t=document.documentElement;t.dataset.theme=e.isDark?"dark":"light",Gg(),t.classList.toggle("dark",e.isDark),t.classList.toggle("electron-dark",e.isDark),t.classList.toggle("light",!e.isDark),t.style.colorScheme=e.isDark?"dark":"light";for(let[n,l]of Object.entries(Ug))l&&t.style.setProperty(l,String(e[n]))}function Gg(){if(typeof document>"u")return;let e=document.documentElement;e.dataset.codexWindowType="electron",e.dataset.windowType="electron",e.dataset.codexOs=Yg(),document.body&&(document.body.dataset.codexWindowType="electron")}function Yg(){if(typeof navigator>"u")return"unknown";let e=navigator,t=(e.userAgentData?.platform??e.platform??e.userAgent).toLowerCase();return t.includes("win")?"win32":t.includes("mac")||t.includes("darwin")?"darwin":t.includes("linux")?"linux":"unknown"}var A1=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","ON","ON","ET","ET","ET","ON","ON","ON","ON","ON","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","ON","ET","ET","ET","ET","ON","ON","ON","ON","L","ON","ON","BN","ON","ON","ET","ET","EN","EN","ON","L","ON","ON","ON","EN","L","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L"],Vr=[[697,698,"ON"],[706,719,"ON"],[722,735,"ON"],[741,749,"ON"],[751,767,"ON"],[768,879,"NSM"],[884,885,"ON"],[894,894,"ON"],[900,901,"ON"],[903,903,"ON"],[1014,1014,"ON"],[1155,1161,"NSM"],[1418,1418,"ON"],[1421,1422,"ON"],[1423,1423,"ET"],[1424,1424,"R"],[1425,1469,"NSM"],[1470,1470,"R"],[1471,1471,"NSM"],[1472,1472,"R"],[1473,1474,"NSM"],[1475,1475,"R"],[1476,1477,"NSM"],[1478,1478,"R"],[1479,1479,"NSM"],[1480,1535,"R"],[1536,1541,"AN"],[1542,1543,"ON"],[1544,1544,"AL"],[1545,1546,"ET"],[1547,1547,"AL"],[1548,1548,"CS"],[1549,1549,"AL"],[1550,1551,"ON"],[1552,1562,"NSM"],[1563,1610,"AL"],[1611,1631,"NSM"],[1632,1641,"AN"],[1642,1642,"ET"],[1643,1644,"AN"],[1645,1647,"AL"],[1648,1648,"NSM"],[1649,1749,"AL"],[1750,1756,"NSM"],[1757,1757,"AN"],[1758,1758,"ON"],[1759,1764,"NSM"],[1765,1766,"AL"],[1767,1768,"NSM"],[1769,1769,"ON"],[1770,1773,"NSM"],[1774,1775,"AL"],[1776,1785,"EN"],[1786,1808,"AL"],[1809,1809,"NSM"],[1810,1839,"AL"],[1840,1866,"NSM"],[1867,1957,"AL"],[1958,1968,"NSM"],[1969,1983,"AL"],[1984,2026,"R"],[2027,2035,"NSM"],[2036,2037,"R"],[2038,2041,"ON"],[2042,2044,"R"],[2045,2045,"NSM"],[2046,2069,"R"],[2070,2073,"NSM"],[2074,2074,"R"],[2075,2083,"NSM"],[2084,2084,"R"],[2085,2087,"NSM"],[2088,2088,"R"],[2089,2093,"NSM"],[2094,2136,"R"],[2137,2139,"NSM"],[2140,2143,"R"],[2144,2191,"AL"],[2192,2193,"AN"],[2194,2198,"AL"],[2199,2207,"NSM"],[2208,2249,"AL"],[2250,2273,"NSM"],[2274,2274,"AN"],[2275,2306,"NSM"],[2362,2362,"NSM"],[2364,2364,"NSM"],[2369,2376,"NSM"],[2381,2381,"NSM"],[2385,2391,"NSM"],[2402,2403,"NSM"],[2433,2433,"NSM"],[2492,2492,"NSM"],[2497,2500,"NSM"],[2509,2509,"NSM"],[2530,2531,"NSM"],[2546,2547,"ET"],[2555,2555,"ET"],[2558,2558,"NSM"],[2561,2562,"NSM"],[2620,2620,"NSM"],[2625,2626,"NSM"],[2631,2632,"NSM"],[2635,2637,"NSM"],[2641,2641,"NSM"],[2672,2673,"NSM"],[2677,2677,"NSM"],[2689,2690,"NSM"],[2748,2748,"NSM"],[2753,2757,"NSM"],[2759,2760,"NSM"],[2765,2765,"NSM"],[2786,2787,"NSM"],[2801,2801,"ET"],[2810,2815,"NSM"],[2817,2817,"NSM"],[2876,2876,"NSM"],[2879,2879,"NSM"],[2881,2884,"NSM"],[2893,2893,"NSM"],[2901,2902,"NSM"],[2914,2915,"NSM"],[2946,2946,"NSM"],[3008,3008,"NSM"],[3021,3021,"NSM"],[3059,3064,"ON"],[3065,3065,"ET"],[3066,3066,"ON"],[3072,3072,"NSM"],[3076,3076,"NSM"],[3132,3132,"NSM"],[3134,3136,"NSM"],[3142,3144,"NSM"],[3146,3149,"NSM"],[3157,3158,"NSM"],[3170,3171,"NSM"],[3192,3198,"ON"],[3201,3201,"NSM"],[3260,3260,"NSM"],[3276,3277,"NSM"],[3298,3299,"NSM"],[3328,3329,"NSM"],[3387,3388,"NSM"],[3393,3396,"NSM"],[3405,3405,"NSM"],[3426,3427,"NSM"],[3457,3457,"NSM"],[3530,3530,"NSM"],[3538,3540,"NSM"],[3542,3542,"NSM"],[3633,3633,"NSM"],[3636,3642,"NSM"],[3647,3647,"ET"],[3655,3662,"NSM"],[3761,3761,"NSM"],[3764,3772,"NSM"],[3784,3790,"NSM"],[3864,3865,"NSM"],[3893,3893,"NSM"],[3895,3895,"NSM"],[3897,3897,"NSM"],[3898,3901,"ON"],[3953,3966,"NSM"],[3968,3972,"NSM"],[3974,3975,"NSM"],[3981,3991,"NSM"],[3993,4028,"NSM"],[4038,4038,"NSM"],[4141,4144,"NSM"],[4146,4151,"NSM"],[4153,4154,"NSM"],[4157,4158,"NSM"],[4184,4185,"NSM"],[4190,4192,"NSM"],[4209,4212,"NSM"],[4226,4226,"NSM"],[4229,4230,"NSM"],[4237,4237,"NSM"],[4253,4253,"NSM"],[4957,4959,"NSM"],[5008,5017,"ON"],[5120,5120,"ON"],[5760,5760,"WS"],[5787,5788,"ON"],[5906,5908,"NSM"],[5938,5939,"NSM"],[5970,5971,"NSM"],[6002,6003,"NSM"],[6068,6069,"NSM"],[6071,6077,"NSM"],[6086,6086,"NSM"],[6089,6099,"NSM"],[6107,6107,"ET"],[6109,6109,"NSM"],[6128,6137,"ON"],[6144,6154,"ON"],[6155,6157,"NSM"],[6158,6158,"BN"],[6159,6159,"NSM"],[6277,6278,"NSM"],[6313,6313,"NSM"],[6432,6434,"NSM"],[6439,6440,"NSM"],[6450,6450,"NSM"],[6457,6459,"NSM"],[6464,6464,"ON"],[6468,6469,"ON"],[6622,6655,"ON"],[6679,6680,"NSM"],[6683,6683,"NSM"],[6742,6742,"NSM"],[6744,6750,"NSM"],[6752,6752,"NSM"],[6754,6754,"NSM"],[6757,6764,"NSM"],[6771,6780,"NSM"],[6783,6783,"NSM"],[6832,6877,"NSM"],[6880,6891,"NSM"],[6912,6915,"NSM"],[6964,6964,"NSM"],[6966,6970,"NSM"],[6972,6972,"NSM"],[6978,6978,"NSM"],[7019,7027,"NSM"],[7040,7041,"NSM"],[7074,7077,"NSM"],[7080,7081,"NSM"],[7083,7085,"NSM"],[7142,7142,"NSM"],[7144,7145,"NSM"],[7149,7149,"NSM"],[7151,7153,"NSM"],[7212,7219,"NSM"],[7222,7223,"NSM"],[7376,7378,"NSM"],[7380,7392,"NSM"],[7394,7400,"NSM"],[7405,7405,"NSM"],[7412,7412,"NSM"],[7416,7417,"NSM"],[7616,7679,"NSM"],[8125,8125,"ON"],[8127,8129,"ON"],[8141,8143,"ON"],[8157,8159,"ON"],[8173,8175,"ON"],[8189,8190,"ON"],[8192,8202,"WS"],[8203,8205,"BN"],[8207,8207,"R"],[8208,8231,"ON"],[8232,8232,"WS"],[8233,8233,"B"],[8234,8238,"BN"],[8239,8239,"CS"],[8240,8244,"ET"],[8245,8259,"ON"],[8260,8260,"CS"],[8261,8286,"ON"],[8287,8287,"WS"],[8288,8303,"BN"],[8304,8304,"EN"],[8308,8313,"EN"],[8314,8315,"ES"],[8316,8318,"ON"],[8320,8329,"EN"],[8330,8331,"ES"],[8332,8334,"ON"],[8352,8399,"ET"],[8400,8432,"NSM"],[8448,8449,"ON"],[8451,8454,"ON"],[8456,8457,"ON"],[8468,8468,"ON"],[8470,8472,"ON"],[8478,8483,"ON"],[8485,8485,"ON"],[8487,8487,"ON"],[8489,8489,"ON"],[8494,8494,"ET"],[8506,8507,"ON"],[8512,8516,"ON"],[8522,8525,"ON"],[8528,8543,"ON"],[8585,8587,"ON"],[8592,8721,"ON"],[8722,8722,"ES"],[8723,8723,"ET"],[8724,9013,"ON"],[9083,9108,"ON"],[9110,9257,"ON"],[9280,9290,"ON"],[9312,9351,"ON"],[9352,9371,"EN"],[9450,9899,"ON"],[9901,10239,"ON"],[10496,11123,"ON"],[11126,11263,"ON"],[11493,11498,"ON"],[11503,11505,"NSM"],[11513,11519,"ON"],[11647,11647,"NSM"],[11744,11775,"NSM"],[11776,11869,"ON"],[11904,11929,"ON"],[11931,12019,"ON"],[12032,12245,"ON"],[12272,12287,"ON"],[12288,12288,"WS"],[12289,12292,"ON"],[12296,12320,"ON"],[12330,12333,"NSM"],[12336,12336,"ON"],[12342,12343,"ON"],[12349,12351,"ON"],[12441,12442,"NSM"],[12443,12444,"ON"],[12448,12448,"ON"],[12539,12539,"ON"],[12736,12773,"ON"],[12783,12783,"ON"],[12829,12830,"ON"],[12880,12895,"ON"],[12924,12926,"ON"],[12977,12991,"ON"],[13004,13007,"ON"],[13175,13178,"ON"],[13278,13279,"ON"],[13311,13311,"ON"],[19904,19967,"ON"],[42128,42182,"ON"],[42509,42511,"ON"],[42607,42610,"NSM"],[42611,42611,"ON"],[42612,42621,"NSM"],[42622,42623,"ON"],[42654,42655,"NSM"],[42736,42737,"NSM"],[42752,42785,"ON"],[42888,42888,"ON"],[43010,43010,"NSM"],[43014,43014,"NSM"],[43019,43019,"NSM"],[43045,43046,"NSM"],[43048,43051,"ON"],[43052,43052,"NSM"],[43064,43065,"ET"],[43124,43127,"ON"],[43204,43205,"NSM"],[43232,43249,"NSM"],[43263,43263,"NSM"],[43302,43309,"NSM"],[43335,43345,"NSM"],[43392,43394,"NSM"],[43443,43443,"NSM"],[43446,43449,"NSM"],[43452,43453,"NSM"],[43493,43493,"NSM"],[43561,43566,"NSM"],[43569,43570,"NSM"],[43573,43574,"NSM"],[43587,43587,"NSM"],[43596,43596,"NSM"],[43644,43644,"NSM"],[43696,43696,"NSM"],[43698,43700,"NSM"],[43703,43704,"NSM"],[43710,43711,"NSM"],[43713,43713,"NSM"],[43756,43757,"NSM"],[43766,43766,"NSM"],[43882,43883,"ON"],[44005,44005,"NSM"],[44008,44008,"NSM"],[44013,44013,"NSM"],[64285,64285,"R"],[64286,64286,"NSM"],[64287,64296,"R"],[64297,64297,"ES"],[64298,64335,"R"],[64336,64450,"AL"],[64451,64466,"ON"],[64467,64829,"AL"],[64830,64847,"ON"],[64848,64911,"AL"],[64912,64913,"ON"],[64914,64967,"AL"],[64968,64975,"ON"],[64976,65007,"BN"],[65008,65020,"AL"],[65021,65023,"ON"],[65024,65039,"NSM"],[65040,65049,"ON"],[65056,65071,"NSM"],[65072,65103,"ON"],[65104,65104,"CS"],[65105,65105,"ON"],[65106,65106,"CS"],[65108,65108,"ON"],[65109,65109,"CS"],[65110,65118,"ON"],[65119,65119,"ET"],[65120,65121,"ON"],[65122,65123,"ES"],[65124,65126,"ON"],[65128,65128,"ON"],[65129,65130,"ET"],[65131,65131,"ON"],[65136,65278,"AL"],[65279,65279,"BN"],[65281,65282,"ON"],[65283,65285,"ET"],[65286,65290,"ON"],[65291,65291,"ES"],[65292,65292,"CS"],[65293,65293,"ES"],[65294,65295,"CS"],[65296,65305,"EN"],[65306,65306,"CS"],[65307,65312,"ON"],[65339,65344,"ON"],[65371,65381,"ON"],[65504,65505,"ET"],[65506,65508,"ON"],[65509,65510,"ET"],[65512,65518,"ON"],[65520,65528,"BN"],[65529,65533,"ON"],[65534,65535,"BN"],[65793,65793,"ON"],[65856,65932,"ON"],[65936,65948,"ON"],[65952,65952,"ON"],[66045,66045,"NSM"],[66272,66272,"NSM"],[66273,66299,"EN"],[66422,66426,"NSM"],[67584,67870,"R"],[67871,67871,"ON"],[67872,68096,"R"],[68097,68099,"NSM"],[68100,68100,"R"],[68101,68102,"NSM"],[68103,68107,"R"],[68108,68111,"NSM"],[68112,68151,"R"],[68152,68154,"NSM"],[68155,68158,"R"],[68159,68159,"NSM"],[68160,68324,"R"],[68325,68326,"NSM"],[68327,68408,"R"],[68409,68415,"ON"],[68416,68863,"R"],[68864,68899,"AL"],[68900,68903,"NSM"],[68904,68911,"AL"],[68912,68921,"AN"],[68922,68927,"AL"],[68928,68937,"AN"],[68938,68968,"R"],[68969,68973,"NSM"],[68974,68974,"ON"],[68975,69215,"R"],[69216,69246,"AN"],[69247,69290,"R"],[69291,69292,"NSM"],[69293,69311,"R"],[69312,69327,"AL"],[69328,69336,"ON"],[69337,69369,"AL"],[69370,69375,"NSM"],[69376,69423,"R"],[69424,69445,"AL"],[69446,69456,"NSM"],[69457,69487,"AL"],[69488,69505,"R"],[69506,69509,"NSM"],[69510,69631,"R"],[69633,69633,"NSM"],[69688,69702,"NSM"],[69714,69733,"ON"],[69744,69744,"NSM"],[69747,69748,"NSM"],[69759,69761,"NSM"],[69811,69814,"NSM"],[69817,69818,"NSM"],[69826,69826,"NSM"],[69888,69890,"NSM"],[69927,69931,"NSM"],[69933,69940,"NSM"],[70003,70003,"NSM"],[70016,70017,"NSM"],[70070,70078,"NSM"],[70089,70092,"NSM"],[70095,70095,"NSM"],[70191,70193,"NSM"],[70196,70196,"NSM"],[70198,70199,"NSM"],[70206,70206,"NSM"],[70209,70209,"NSM"],[70367,70367,"NSM"],[70371,70378,"NSM"],[70400,70401,"NSM"],[70459,70460,"NSM"],[70464,70464,"NSM"],[70502,70508,"NSM"],[70512,70516,"NSM"],[70587,70592,"NSM"],[70606,70606,"NSM"],[70608,70608,"NSM"],[70610,70610,"NSM"],[70625,70626,"NSM"],[70712,70719,"NSM"],[70722,70724,"NSM"],[70726,70726,"NSM"],[70750,70750,"NSM"],[70835,70840,"NSM"],[70842,70842,"NSM"],[70847,70848,"NSM"],[70850,70851,"NSM"],[71090,71093,"NSM"],[71100,71101,"NSM"],[71103,71104,"NSM"],[71132,71133,"NSM"],[71219,71226,"NSM"],[71229,71229,"NSM"],[71231,71232,"NSM"],[71264,71276,"ON"],[71339,71339,"NSM"],[71341,71341,"NSM"],[71344,71349,"NSM"],[71351,71351,"NSM"],[71453,71453,"NSM"],[71455,71455,"NSM"],[71458,71461,"NSM"],[71463,71467,"NSM"],[71727,71735,"NSM"],[71737,71738,"NSM"],[71995,71996,"NSM"],[71998,71998,"NSM"],[72003,72003,"NSM"],[72148,72151,"NSM"],[72154,72155,"NSM"],[72160,72160,"NSM"],[72193,72198,"NSM"],[72201,72202,"NSM"],[72243,72248,"NSM"],[72251,72254,"NSM"],[72263,72263,"NSM"],[72273,72278,"NSM"],[72281,72283,"NSM"],[72330,72342,"NSM"],[72344,72345,"NSM"],[72544,72544,"NSM"],[72546,72548,"NSM"],[72550,72550,"NSM"],[72752,72758,"NSM"],[72760,72765,"NSM"],[72850,72871,"NSM"],[72874,72880,"NSM"],[72882,72883,"NSM"],[72885,72886,"NSM"],[73009,73014,"NSM"],[73018,73018,"NSM"],[73020,73021,"NSM"],[73023,73029,"NSM"],[73031,73031,"NSM"],[73104,73105,"NSM"],[73109,73109,"NSM"],[73111,73111,"NSM"],[73459,73460,"NSM"],[73472,73473,"NSM"],[73526,73530,"NSM"],[73536,73536,"NSM"],[73538,73538,"NSM"],[73562,73562,"NSM"],[73685,73692,"ON"],[73693,73696,"ET"],[73697,73713,"ON"],[78912,78912,"NSM"],[78919,78933,"NSM"],[90398,90409,"NSM"],[90413,90415,"NSM"],[92912,92916,"NSM"],[92976,92982,"NSM"],[94031,94031,"NSM"],[94095,94098,"NSM"],[94178,94178,"ON"],[94180,94180,"NSM"],[113821,113822,"NSM"],[113824,113827,"BN"],[117760,117973,"ON"],[118e3,118009,"EN"],[118010,118012,"ON"],[118016,118451,"ON"],[118458,118480,"ON"],[118496,118512,"ON"],[118528,118573,"NSM"],[118576,118598,"NSM"],[119143,119145,"NSM"],[119155,119162,"BN"],[119163,119170,"NSM"],[119173,119179,"NSM"],[119210,119213,"NSM"],[119273,119274,"ON"],[119296,119361,"ON"],[119362,119364,"NSM"],[119365,119365,"ON"],[119552,119638,"ON"],[120513,120513,"ON"],[120539,120539,"ON"],[120571,120571,"ON"],[120597,120597,"ON"],[120629,120629,"ON"],[120655,120655,"ON"],[120687,120687,"ON"],[120713,120713,"ON"],[120745,120745,"ON"],[120771,120771,"ON"],[120782,120831,"EN"],[121344,121398,"NSM"],[121403,121452,"NSM"],[121461,121461,"NSM"],[121476,121476,"NSM"],[121499,121503,"NSM"],[121505,121519,"NSM"],[122880,122886,"NSM"],[122888,122904,"NSM"],[122907,122913,"NSM"],[122915,122916,"NSM"],[122918,122922,"NSM"],[123023,123023,"NSM"],[123184,123190,"NSM"],[123566,123566,"NSM"],[123628,123631,"NSM"],[123647,123647,"ET"],[124140,124143,"NSM"],[124398,124399,"NSM"],[124643,124643,"NSM"],[124646,124646,"NSM"],[124654,124655,"NSM"],[124661,124661,"NSM"],[124928,125135,"R"],[125136,125142,"NSM"],[125143,125251,"R"],[125252,125258,"NSM"],[125259,126063,"R"],[126064,126143,"AL"],[126144,126207,"R"],[126208,126287,"AL"],[126288,126463,"R"],[126464,126703,"AL"],[126704,126705,"ON"],[126706,126719,"AL"],[126720,126975,"R"],[126976,127019,"ON"],[127024,127123,"ON"],[127136,127150,"ON"],[127153,127167,"ON"],[127169,127183,"ON"],[127185,127221,"ON"],[127232,127242,"EN"],[127243,127247,"ON"],[127279,127279,"ON"],[127338,127343,"ON"],[127405,127405,"ON"],[127584,127589,"ON"],[127744,128728,"ON"],[128732,128748,"ON"],[128752,128764,"ON"],[128768,128985,"ON"],[128992,129003,"ON"],[129008,129008,"ON"],[129024,129035,"ON"],[129040,129095,"ON"],[129104,129113,"ON"],[129120,129159,"ON"],[129168,129197,"ON"],[129200,129211,"ON"],[129216,129217,"ON"],[129232,129240,"ON"],[129280,129623,"ON"],[129632,129645,"ON"],[129648,129660,"ON"],[129664,129674,"ON"],[129678,129734,"ON"],[129736,129736,"ON"],[129741,129756,"ON"],[129759,129770,"ON"],[129775,129784,"ON"],[129792,129938,"ON"],[129940,130031,"ON"],[130032,130041,"EN"],[130042,130042,"ON"],[131070,131071,"BN"],[196606,196607,"BN"],[262142,262143,"BN"],[327678,327679,"BN"],[393214,393215,"BN"],[458750,458751,"BN"],[524286,524287,"BN"],[589822,589823,"BN"],[655358,655359,"BN"],[720894,720895,"BN"],[786430,786431,"BN"],[851966,851967,"BN"],[917502,917759,"BN"],[917760,917999,"NSM"],[918e3,921599,"BN"],[983038,983039,"BN"],[1048574,1048575,"BN"],[1114110,1114111,"BN"]];function jg(e){if(e<=255)return A1[e];let t=0,n=Vr.length-1;for(;t<=n;){let l=t+n>>1,i=Vr[l];if(ei[1]){t=l+1;continue}return i[2]}return"L"}function Qg(e){let t=e.length;if(t===0)return null;let n=new Array(t),l=!1,i=0,a=null;for(let u=0;u=55296&&s<=56319&&u+1=56320&&x<=57343&&(c=(s-55296<<10)+(x-56320)+65536,r=2)}let f=jg(c);(f==="R"||f==="AL"||f==="AN")&&(l=!0);for(let x=0;x=n&&e[r]==="ET";r--)e[r]="EN";for(r=c+1;rn?e[c-1]:u,x=r0&&t.charCodeAt(t.length-1)===32&&(t=t.slice(0,-1)),t}function Kg(e){return/[\r\f]/.test(e)?e.replace(/\r\n/g,` `).replace(/[\r\f]/g,` `):e}var Kr=null;function Tn(){return Kr===null&&(Kr=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Kr}var Jr=null,Jg;function Wg(){return Jr===null&&(Jr=new Intl.Segmenter(Jg,{granularity:"word"})),Jr}var $g=/\p{Script=Arabic}/u,$t=/\p{M}/u,sa=/\p{Nd}/u;function N1(e){return $g.test(e)}var Ig=/[\u3000-\u30FF\u3130-\u318F\u3400-\u4DBF\u4E00-\u9FFF\uAC00-\uD7AF\uF900-\uFAFF\uFF00-\uFFEF\u{20000}-\u{2A6DF}\u{2A700}-\u{2EE5D}\u{2F800}-\u{2FA1F}\u{30000}-\u{33479}]/u;function Qe(e){return Ig.test(e)}function Pg(e){let t=ca(e);return t!==null&&(Pr.has(t)||Pn.has(t))}var eS=new Set(["\xA0","\u202F","\u2060","\uFEFF"]),tS=new Set(["-","\u2010","\u2013","\u2014"]);function nS(e){let t=ca(e);return t!==null&&eS.has(t)}function lS(e){let t=ca(e);return t!==null&&tS.has(t)}function T1(e,t){return nS(e)?!1:t?!(Pg(e)||lS(e)):!0}var Pr=new Set(["\uFF0C","\uFF0E","\uFF01","\uFF1A","\uFF1B","\uFF1F","\u3001","\u3002","\u30FB","\uFF09","\u3015","\u3009","\u300B","\u300D","\u300F","\u3011","\u3017","\u3019","\u301B","\u30FC","\u3005","\u303B","\u309D","\u309E","\u30FD","\u30FE"]),Zu=new Set(['"',"(","[","{","\xA1","\xBF","\u201C","\u2018","\u201A","\u201E","\xAB","\u2039","\u2E18","\uFF08","\u3014","\u3008","\u300A","\u300C","\u300E","\u3010","\u3016","\u3018","\u301A"]),eo=new Set(["'","\u2019"]),Pn=new Set([".",",","!","?",":",";","\u060C","\u061B","\u061F","\u0964","\u0965","\u104A","\u104B","\u104C","\u104D","\u104F",")","]","}","%",'"',"\u201D","\u2019","\xBB","\u203A","\u2026"]),iS=new Set([":",".","\u060C","\u061B"]),aS=new Set(["\u104F"]),uS=new Set(["\u201D","\u2019","\xBB","\u203A","\u300D","\u300F","\u3011","\u300B","\u3009","\u3015","\uFF09"]);function sS(e){if(to(e))return!0;let t=!1;for(let n of e){if(Pn.has(n)||el(n)){t=!0;continue}if(!(t&&$t.test(n)))return!1}return t}function cS(e){for(let t of e)if(!Pr.has(t)&&!Pn.has(t))return!1;return e.length>0}function rS(e){if(to(e))return!0;for(let t of e)if(!Zu.has(t)&&!eo.has(t)&&!$t.test(t)&&!el(t))return!1;return e.length>0}function to(e){let t=!1;for(let n of e)if(!(n==="\\"||$t.test(n))){if(Zu.has(n)||Pn.has(n)||eo.has(n)){t=!0;continue}return!1}return t}function Wl(e,t){let n=t-1;if(n<=0)return Math.max(n,0);let l=e.charCodeAt(n);if(l<56320||l>57343)return n;let i=n-1;if(i<0)return n;let a=e.charCodeAt(i);return a>=55296&&a<=56319?i:n}function ca(e){if(e.length===0)return null;let t=Wl(e,e.length);return e.slice(t)}function oS(e){for(let t of e)if(!$t.test(t))return t;return null}function no(e,t=e.length){for(;t>0;){let n=Wl(e,t),l=e.slice(n,t);if(!$t.test(l))return l;t=n}return null}var fS=[36,37,43,43,92,92,162,165,176,177,1423,1423,1545,1547,1642,1642,2046,2047,2546,2547,2553,2555,2801,2801,3065,3065,3449,3449,3647,3647,6107,6107,8240,8247,8279,8279,8352,8399,8451,8451,8457,8457,8470,8470,8722,8723,43064,43064,65020,65020,65129,65130,65284,65285,65504,65505,65509,65510,73693,73696,123647,123647,126124,126124,126128,126128];function dS(e,t){for(let n=0;n=t[n]&&e<=t[n+1])return!0;return!1}function el(e){let t=e.codePointAt(0);return t!==void 0&&dS(t,fS)}function hS(e){let t=no(e);return t!==null&&el(t)}function xS(e){let t=oS(e);return t!==null&&sa.test(t)}function mS(e){let t=e.length;for(;t>0;){let n=Wl(e,t),l=e.slice(n,t);if($t.test(l)||Zu.has(l)||eo.has(l)){t=n;continue}break}return t<=0||t===e.length?null:{head:e.slice(0,t),tail:e.slice(t)}}function pS(e,t,n){return n==="text"&&!t&&e.length===1&&e!=="-"&&e!=="\u2014"?e:null}function M1(e,t){return e&&t!==null&&iS.has(t)}function gS(e){let t=ca(e);return t!==null&&aS.has(t)}function SS(e){if(e.length<2||e[0]!==" ")return null;let t=e.slice(1);return/^\p{M}+$/u.test(t)?{space:" ",marks:t}:null}function $r(e){let t=e.length;for(;t>0;){let n=Wl(e,t),l=e.slice(n,t);if(uS.has(l))return!0;if(!Pn.has(l))return!1;t=n}return!1}function yS(e,t){if(t==="pre-wrap"){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(e===` -`)return"hard-break"}return e===" "?"space":e==="\xA0"||e==="\u202F"||e==="\u2060"||e==="\uFEFF"?"glue":e==="\u200B"?"zero-width-break":e==="\xAD"?"soft-hyphen":"text"}var vS=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function Dn(e){return e.length===1?e[0]:e.join("")}function C1(e,t){let n=[];for(let l=e.length-1;l>=0;l--)n.push(e[l]);return n.push(t),Dn(n)}function AS(e,t,n,l){if(!vS.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];let i=[],a=null,u=0,s=!1,c=0;for(let r of e){let f=yS(r,l),x=f==="text"&&t;if(a!==null&&f===a&&x===s){c+=r.length;continue}a!==null&&i.push({text:e.slice(u,c),isWordLike:s,kind:a,start:n+u}),a=f,u=c,s=x,c+=r.length}return a!==null&&i.push({text:e.slice(u),isWordLike:s,kind:a,start:n+u}),i}function Wr(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}var bS=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function F1(e,t){let n=e.texts[t];return n.startsWith("www.")?!0:bS.test(n)&&t+1=e.len||Wr(e.kinds[m]))continue;let S=[],v=o<0?e.starts[m]:o,A=m;for(;A0&&(l.push(Dn(S)),i.push(!0),a.push("text"),u.push(v),s=A-1)}return{len:l.length,texts:l,isWordLike:i,kinds:a,starts:u}}var MS=new Set([":","-","/","\xD7",",",".","+","\u2013","\u2014"]),CS=/[\p{P}\p{S}\p{Co}]/u,B1=/\p{Emoji_Presentation}/u,FS=new Set(["?","\u058A","-","\u2010","\u2012","\u2013","\u2014","\u2026","\u203C","\u203D","\u2049"]);function kS(e){return e>=33&&e<=47&&e!==45||e>=58&&e<=64&&e!==63||e>=91&&e<=96||e>=123&&e<=126}function O1(e){let t=e.charCodeAt(0);return t<128?kS(t):!FS.has(e)&&!B1.test(e)&&CS.test(e)}function k1(e){let t=!1;for(let n of e)if(!$t.test(n)){if(!O1(n))return!1;t=!0}return t}function DS(e){for(let t=e.length;t>0;){let n=Wl(e,t),l=e.slice(n,t);if($t.test(l)){t=n;continue}return O1(l)||el(l)}return!1}var Ir=/[A-Za-z#&*<=>@^_`~]/;function R1(e,t){return e.charCodeAt(0)<128&&t.charCodeAt(0)<128}function Wt(e,t,n){if(!n.geckoAsciiLineBreaks||t<=0||t>=e.length)return null;let l=no(e,t),i=String.fromCodePoint(e.codePointAt(t));if(l===null||!R1(l,i))return null;let a=el(l),u=el(i);return!a&&!u?null:!!(i===")"||i==="]"||i==="}"||"!,.:;?/".includes(i)||"([{".includes(l)||l==='"'||l==="'"||i==='"'||i==="'"||i==="|"||i==="-"||a&&Ir.test(i)||Ir.test(l)&&u||u&&(")]}".includes(l)||/[0-9]/.test(l))||a&&("([{".includes(i)||/[0-9]/.test(i)))}function Xu(e,t,n,l=e.length){let i=t[0];if(i===void 0||!"([{".includes(i))return null;let a=no(e,l);return a===null?null:n.geckoAsciiLineBreaks&&R1(a,i)?Ir.test(a)||sa.test(a)||`"'([{`.includes(a)||el(a):a.charCodeAt(0)>=128?!Qe(a)&&/[\p{L}\p{N}]/u.test(a)?!0:null:/[A-Za-z0-9]/.test(a)||"$'(/<@[^_`{".includes(a)}function TS(e,t,n,l,i){if(n[0]==="-"&&Qe(e))return!0;if(Qe(e)||Qe(n))return!1;let a=Xu(e,n,i);if(a!==null)return a;let u=!t&&k1(e),s=!l&&k1(n),c=hS(e),r=(t||c)&&DS(e);return!u&&!s&&!r?!1:(t||u||c)&&(l||s)}function D1(e){for(let t of e)if(sa.test(t))return!0;return!1}function ua(e){if(e.length===0)return!1;for(let t of e)if(!(sa.test(t)||MS.has(t)))return!1;return!0}function BS(e,t,n){let l=[],i=[],a=[],u=[];function s(c,r){if(c.includes("-")){let f=c.split("-"),x=f.length>1;for(let o=0;os+1){l.push(Dn(x)),i.push(m),a.push("text"),u.push(e.starts[s]),s=o;continue}}l.push(c),i.push(f),a.push(r),u.push(e.starts[s]),s++}return{len:l.length,texts:l,isWordLike:i,kinds:a,starts:u}}function RS(e){let t=[],n=[],l=[],i=[],a=0;for(;a=0;y--){let E=a[y];if(E.length===0)continue;let D=N?.at(-1)??(g>=0?a[g]:null);if(s[y]==="text"&&!u[y]&&D!==null&&s[g]==="text"&&((Wt(e,c[y]+E.length,t)??(rS(E)&&Xu(E,D,t)!==!1))||E==="-"&&xS(D))){N===null&&(N=[]),N.push(E),c[g]=c[y],a[y]="";continue}N!==null&&(a[g]=C1(N,a[g]),N=null),g=y}N!==null&&(a[g]=C1(N,a[g]));let T=0;for(let y=0;y=0&&(!T1(t.texts[o-1],n.breakKeepAllAfterPunctuation)||Wt(e,t.starts[o],n)===!1)&&x(o),s<0&&(s=o),c=c||Qe(m);continue}x(o),l.push(m),i.push(t.isWordLike[o]),a.push(S),u.push(t.starts[o])}return x(t.len),{len:l.length,texts:l,isWordLike:i,kinds:a,starts:u}}function z1(e,t){let n=e.charCodeAt(t+1);if(n<128){if(n<48||n>57)return!1}else{let l=e.codePointAt(t+1);if(l===void 0||!sa.test(String.fromCodePoint(l)))return!1}for(let l=t;l>0;){let i=Wl(e,l),a=e.slice(i,l);if(!$t.test(a))return Qe(a)||!/[\p{L}\p{N}]/u.test(a);l=i}return!0}function LS(e,t){let n=[],l=0,i=0,a=!1,u=!1,s=!1,c=!1,r=!1;function f(){i!==l&&(n.push({text:e.slice(l,i),start:l,overflow:a?c?"grapheme":"none":"word-like"}),l=i,a=!1,u=!1,s=!1,c=!1,r=!1)}function x(m,S,v){l=S,i=S+m.length,a=v,c=m==="-",u=$r(m),s=Zu.has(m)}function o(m,S){i+=m.length,a=a||S,c=c||m==="-";let v=$r(m);m.length===1&&Pn.has(m)?u=u||v:u=v,s=!1}for(let m of Tn().segment(e)){let S=m.segment,v=Qe(S);if(i===l){x(S,m.index,v);continue}let A=S==="-"&&a;if(A&&z1(e,m.index)&&(r=!0),s||Pr.has(S)||Pn.has(S)||A||r&&!v||t.carryCJKAfterClosingQuote&&v&&u){o(S,v);continue}if(!a&&!v){o(S,v);continue}f(),x(S,m.index,v)}return f(),n}function qS(e,t,n){if(t.length<=1)return t;let l=[],i=-1,a=!1;function u(c,r){let f=t[c].start,x=r=0&&(!T1(t[c-1].text,n.breakKeepAllAfterPunctuation)||Wt(e,r.start,n)===!1)&&s(c),i<0&&(i=c),a=a||Qe(r.text)}return s(t.length),l}function w1(e,t,n){let l=LS(e,t);return n==="keep-all"?qS(e,l,t):l}function HS(e){return e==="-"||e==="\u058A"||e==="\u2010"||e==="\u2012"||e==="\u2013"||e==="\u2014"}function _1(e){if(e.length===0||/\p{Cf}/u.test(e))return!1;for(let{segment:t}of Tn().segment(e)){let n=String.fromCodePoint(t.codePointAt(0));if(!/[\p{P}\p{S}]/u.test(n)||B1.test(n)||t.includes("\uFE0F")||/\p{Emoji_Modifier}/u.test(n))return!1}return!0}function L1(e){if(!/[-\u058A\u2010\u2012\u2013\u2014]/u.test(e))return null;let t=[],n=0;for(let l of Tn().segment(e)){n++;let i=l.segment==="-"&&z1(e,l.index);HS(l.segment)&&!i&&t.push(n)}return t.length===0?null:t}function q1(e,t,n="normal",l="normal"){let i=n==="pre-wrap"?Kg(e):Vg(e);if(i.length===0)return{normalized:i,len:0,texts:[],isWordLike:[],kinds:[],starts:[]};let a=wS(i,t,n),u=l==="keep-all"?_S(i,a,t):a;return{normalized:i,...u}}var $l=null,H1=new Map,Il=null,US=96,GS=/\p{Emoji_Presentation}/u,YS=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u,U1=new Map;function lo(){if($l!==null)return $l;if(typeof OffscreenCanvas<"u")return $l=new OffscreenCanvas(1,1).getContext("2d"),$l;if(typeof document<"u")return $l=document.createElement("canvas").getContext("2d"),$l;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function jS(e){let t=H1.get(e);return t||(t=new Map,H1.set(e,t)),t}function It(e,t){let n=t.get(e);return n===void 0&&(n={width:lo().measureText(e).width},t.set(e,n)),n}function Pl(){if(Il!==null)return Il;if(typeof navigator>"u")return Il={geckoAsciiLineBreaks:!1,lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,breakKeepAllAfterPunctuation:!0,preferPrefixWidthsForBreakableRuns:!1},Il;let e=navigator.userAgent,n=navigator.vendor==="Apple Computer, Inc."&&e.includes("Safari/")&&!e.includes("Chrome/")&&!e.includes("Chromium/")&&!e.includes("CriOS/")&&!e.includes("FxiOS/")&&!e.includes("EdgiOS/"),l=e.includes("Chrome/")||e.includes("Chromium/")||e.includes("CriOS/")||e.includes("Edg/");return Il={geckoAsciiLineBreaks:e.includes("Firefox/")&&!e.includes("FxiOS/"),lineFitEpsilon:n?1/64:.005,carryCJKAfterClosingQuote:l,breakKeepAllAfterPunctuation:!n,preferPrefixWidthsForBreakableRuns:n},Il}function QS(e){let t=e.match(/(?:^|\D)(\d+(?:\.\d+)?)\s*px/);return t?parseFloat(t[1]):16}function XS(e){return GS.test(e)||e.includes("\uFE0F")}function G1(e){return YS.test(e)}function ZS(e){let t=U1.get(e);if(t!==void 0)return t;let n=QS(e),l=lo();l.font=e;let i=l.measureText("\u{1F600}").width;if(t=0,i>n+.5&&typeof document<"u"&&document.body!==null){let a=document.createElement("span");a.style.font=e,a.style.display="inline-block",a.style.visibility="hidden",a.style.position="absolute",a.textContent="\u{1F600}",document.body.appendChild(a);let u=a.getBoundingClientRect().width;document.body.removeChild(a),i-u>.5&&(t=i-u)}return U1.set(e,t),t}function VS(e){let t=0,n=Tn();for(let l of n.segment(e))XS(l.segment)&&t++;return t}function KS(e,t){return t.emojiCount===void 0&&(t.emojiCount=VS(e)),t.emojiCount}function Bn(e,t,n){return n===0?t.width:t.width-KS(e,t)*n}function Y1(e,t,n,l,i){if(t.breakableFitAdvances!==void 0&&t.breakableFitMode===i)return t.breakableFitAdvances;t.breakableFitMode=i;let a=Tn(),u=[];for(let f of a.segment(e))u.push(f.segment);if(u.length<=1)return t.breakableFitAdvances=null,t.breakableFitAdvances;if(i==="sum-graphemes"){let f=[];for(let x of u){let o=It(x,n);f.push(Bn(x,o,l))}return t.breakableFitAdvances=f,t.breakableFitAdvances}if(i==="pair-context"||u.length>US){let f=[],x=null,o=0;for(let m of u){let S=It(m,n),v=Bn(m,S,l);if(x===null)f.push(v);else{let A=x+m,d=It(A,n);f.push(Bn(A,d,l)-o)}x=m,o=v}return t.breakableFitAdvances=f,t.breakableFitAdvances}let s=[],c="",r=0;for(let f of u){c+=f;let x=It(c,n),o=Bn(c,x,l);s.push(o-r),r=o}return t.breakableFitAdvances=s,t.breakableFitAdvances}function j1(e,t){let n=lo();n.font=e;let l=jS(e),i=t?ZS(e):0;return{cache:l,emojiCorrection:i}}function JS(e,t,n){return n===0&&t>0&&t0?e.letterSpacing:0}function ao(e,t){return t===0?0:e+t}function PS(e,t){return e.letterSpacing!==0&&e.spacingGraphemeCounts[t]>0?e.letterSpacing:0}function ey(e,t,n,l,i){let a=t==="tab"?i+PS(e,n):e.lineEndFitAdvances[n];return ao(l,a)}function Q1(e,t,n,l){let i=t==="tab"?0:e.lineEndFitAdvances[n];return ao(l,i)}function X1(e,t,n,l,i){let a=t==="tab"?i:e.lineEndPaintAdvances[n];return ao(l,a)}function ty(e,t,n){return e.letterSpacing!==0&&t?n+e.letterSpacing:n}function ny(e,t){return e.letterSpacing===0?t:t+e.letterSpacing}function io(e,t,n){let l=t;if(l>=e.length||e[l]>=n)return l;let i=e.length;for(l++;l0)return e.spacingGraphemeCounts[l]>0?e.letterSpacing:0;if(JS(e.kinds,l,i))return 0;for(let a=l-1;a>=t;a--){let u=e.kinds[a];if(!(u==="space"||u==="zero-width-break"||u==="hard-break"||u==="soft-hyphen"))return a===t&&n>0||e.spacingGraphemeCounts[a]>0?e.letterSpacing:0}return 0}function iy(e,t,n,l,i,a){return t+ly(e,n,l,i,a)}function ay(e,t){let n=0,l=e.chunks.length;for(;n0)return t;for(let i=t;i=e.widths.length)return-1;l=a.consumedEndSegmentIndex,n.segmentIndex=l,n.graphemeIndex=0}return-1}function J1(e,t){if(t.segmentIndex>=e.widths.length)return-1;let n=ay(e,t.segmentIndex);return n<0?-1:K1(e,n,t)}function uy(e,t,n){if(n.segmentIndex>=e.widths.length)return-1;let l=t;for(;l=e.chunks[l].consumedEndSegmentIndex;)l++;return l>=e.chunks.length?-1:K1(e,l,n)}function W1(e,t){return $1(e,t)}function sy(e,t,n){let{widths:l,kinds:i,breakableFitAdvances:a,breakablePreferredBreaks:u}=e;if(l.length===0)return 0;let c=Pl().lineFitEpsilon,r=t+c,f=0,x=0,o=!1,m=0,S=0,v=0,A=0,d=-1,h=0;function p(){d=-1,h=0}function g(E=v,D=A,U=x){f++,n?.(U,m,S,E,D),x=0,o=!1,p()}function N(E,D){o=!0,m=E,S=0,v=E+1,A=0,x=D}function T(E,D,U){o=!0,m=E,S=D,v=E,A=D+1,x=U}function F(E,D){if(!o){N(E,D);return}x+=D,v=E+1,A=0}function k(E,D){let U=a[E],H=u[E]??null,ie=H===null?-1:io(H,0,D+1),j=-1,oe=0,R=D;for(;Rr){if(H!==null&&j>D){g(E,j,oe),R=j,ie=io(H,ie,R+1),j=-1,oe=0;continue}g(),T(E,R,C)}else x+=C,v=E,A=R+1;let M=R+1;H!==null&&H[ie]===M&&(j=M,oe=x,ie++),R++}o&&v===E&&A===U.length&&(v=E+1,A=0)}let y=0;for(;y=l.length));){let E=l[y],D=i[y],U=Z1(D);if(!o){E>r&&a[y]!==null?k(y,0):N(y,E),U&&(d=y+1,h=x-E),y++;continue}if(x+E>r){if(U){F(y,E),g(y+1,0,x-E),y++;continue}if(d>=0){if(v>d||v===d&&A>0){g();continue}g(d,0,h);continue}if(E>r&&a[y]!==null){g(),k(y,0),y++;continue}g();continue}F(y,E),U&&(d=y+1,h=x-E),y++}return o&&g(),f}function $1(e,t,n){if(e.simpleLineWalkFastPath)return sy(e,t,n);let l={segmentIndex:0,graphemeIndex:0},i=J1(e,l);return cy(e,l,i,t,n).lineCount}function cy(e,t,n,l,i,a=Number.POSITIVE_INFINITY){let{widths:u,kinds:s,breakableFitAdvances:c,breakablePreferredBreaks:r,discretionaryHyphenWidth:f}=e,o=Pl().lineFitEpsilon,m=l+o,S,v,A,d,h,p,g,N,T,F;function k(){return F==="soft-hyphen"&&g===h&&p===0?T:A}function y(R=h,C=p,M=k()){return d?(t.segmentIndex=R,t.graphemeIndex=C,iy(e,M,S,v,R,C)):null}function E(R,C){d=!0,h=R+1,p=0,A=C}function D(R,C,M){d=!0,h=R,p=C+1,A=M}function U(R,C){if(!d){E(R,C);return}A+=C,h=R+1,p=0}function H(R,C,M,O,q,J){if(!C)return;let P=Q1(e,R,M,q),Ce=X1(e,R,M,q,O);g=M+1,N=A-J+P,T=A-J+Ce,F=R}function ie(R,C){let M=c[R],O=r[R]??null,q=O===null?-1:io(O,0,C+1),J=-1,P=0;for(let Ce=C;Cem)return O!==null&&J>C?y(R,J,P):y();A=vt,h=R,p=Ce+1}let Pt=Ce+1;O!==null&&O[q]===Pt&&(J=Pt,P=A,q++)}return d&&h===R&&p===M.length&&(h=R+1,p=0),null}let j=0,oe=null;for(;n>=0&&j0){let vt=ie(M,J);if(vt!==null){C=vt;break e}}else if(Pt>m&&c[M]!==null){let vt=ie(M,0);if(vt!==null){C=vt;break e}}else E(M,Ce);H(O,q,M,Ce,P,Ze);continue}if(A+Pt>m){let vt=A+Q1(e,O,M,P),Yx=A+X1(e,O,M,P,Ce);if(q&&vt<=m){U(M,Ze),C=y(M+1,0,Yx);break e}if(g>=0&&N<=m){if(h>g||h===g&&p>0){C=y();break e}C=y(g,0,T);break e}C=y();break e}U(M,Ze),H(O,q,M,Ce,P,Ze)}C===null&&(C=g===R.consumedEndSegmentIndex&&p===0?y(R.consumedEndSegmentIndex,0,T):y(R.consumedEndSegmentIndex,0,A))}if(C===null)break;oe=C,j++,i?.(C,S,v,t.segmentIndex,t.graphemeIndex),j1?e+(t-1)*n:e}function fy(e,t,n,l,i){let a=Pl(),{cache:u,emojiCorrection:s}=j1(t,G1(e.normalized)),c=Bn("-",It("-",u),s)+(i===0?0:i*2),f=Bn(" ",It(" ",u),s)*8,x=i!==0;if(e.len===0)return ry(n);let o=[],m=[],S=[],v=[],A=!x,d=n?[]:null,h=[],p=[],g=[],N=n?[]:null,T=[],F=0;function k(D,U,H,ie,j,oe,R,C,M){j!=="text"&&j!=="space"&&j!=="zero-width-break"&&(A=!1),o.push(U),m.push(H),S.push(ie),v.push(j),d?.push(oe),h.push(R),p.push(C),x&&g.push(M),N!==null&&N.push(D)}function y(D,U,H,ie,j){let oe=x?I1(D,H):0,R=oy(Bn(D,U,s),oe,i),C=H==="space"||H==="preserved-space"||H==="zero-width-break"?0:R,M=C===0?0:C+(oe>0?i:0),O=H==="space"||H==="zero-width-break"?0:R;if(j&&D.length>1){let q="sum-graphemes";i!==0?q="segment-prefixes":ua(D)?q="pair-context":a.preferPrefixWidthsForBreakableRuns&&(q="segment-prefixes");let J=Y1(D,U,u,s,q),P=J===null||l==="keep-all"?null:L1(D);k(D,R,M,O,H,ie,J,P,oe);return}k(D,R,M,O,H,ie,null,null,oe)}for(let D=0;Dnull};function Z(e,t=""){let n=typeof e=="string"?e:e.source,l={replace:(i,a)=>{let u=typeof a=="string"?a:a.source;return u=u.replace(_e.caret,"$1"),n=n.replace(i,u),l},getRegex:()=>new RegExp(n,t)};return l}var hy=(()=>{try{return!!new RegExp("(?<=1)(?/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}>`)},xy=/^(?:[ \t]*(?:\n|$))+/,my=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,py=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,da=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,gy=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,oo=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,cx=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,rx=Z(cx).replace(/bull/g,oo).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Sy=Z(cx).replace(/bull/g,oo).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),fo=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,yy=/^[^\n]+/,ho=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,vy=Z(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",ho).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ay=Z(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,oo).getRegex(),$u="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",xo=/<\!--(?:-?>|[\s\S]*?(?:-->|$))/,by=Z("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",xo).replace("tag",$u).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ox=Z(fo).replace("hr",da).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",$u).getRegex(),Ey=Z(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ox).getRegex(),mo={blockquote:Ey,code:my,def:vy,fences:py,heading:gy,hr:da,html:by,lheading:rx,list:Ay,newline:xy,paragraph:ox,table:tl,text:yy},tx=Z("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",da).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",$u).getRegex(),Ny={...mo,lheading:Sy,table:tx,paragraph:Z(fo).replace("hr",da).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",tx).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",$u).getRegex()},My={...mo,html:Z(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",xo).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:tl,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Z(fo).replace("hr",da).replace("heading",` *#{1,6} *[^ +`)return"hard-break"}return e===" "?"space":e==="\xA0"||e==="\u202F"||e==="\u2060"||e==="\uFEFF"?"glue":e==="\u200B"?"zero-width-break":e==="\xAD"?"soft-hyphen":"text"}var vS=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function Dn(e){return e.length===1?e[0]:e.join("")}function C1(e,t){let n=[];for(let l=e.length-1;l>=0;l--)n.push(e[l]);return n.push(t),Dn(n)}function AS(e,t,n,l){if(!vS.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];let i=[],a=null,u=0,s=!1,c=0;for(let r of e){let f=yS(r,l),x=f==="text"&&t;if(a!==null&&f===a&&x===s){c+=r.length;continue}a!==null&&i.push({text:e.slice(u,c),isWordLike:s,kind:a,start:n+u}),a=f,u=c,s=x,c+=r.length}return a!==null&&i.push({text:e.slice(u),isWordLike:s,kind:a,start:n+u}),i}function Wr(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}var bS=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function F1(e,t){let n=e.texts[t];return n.startsWith("www.")?!0:bS.test(n)&&t+1=e.len||Wr(e.kinds[m]))continue;let S=[],v=o<0?e.starts[m]:o,A=m;for(;A0&&(l.push(Dn(S)),i.push(!0),a.push("text"),u.push(v),s=A-1)}return{len:l.length,texts:l,isWordLike:i,kinds:a,starts:u}}var MS=new Set([":","-","/","\xD7",",",".","+","\u2013","\u2014"]),CS=/[\p{P}\p{S}\p{Co}]/u,B1=/\p{Emoji_Presentation}/u,FS=new Set(["?","\u058A","-","\u2010","\u2012","\u2013","\u2014","\u2026","\u203C","\u203D","\u2049"]);function kS(e){return e>=33&&e<=47&&e!==45||e>=58&&e<=64&&e!==63||e>=91&&e<=96||e>=123&&e<=126}function O1(e){let t=e.charCodeAt(0);return t<128?kS(t):!FS.has(e)&&!B1.test(e)&&CS.test(e)}function k1(e){let t=!1;for(let n of e)if(!$t.test(n)){if(!O1(n))return!1;t=!0}return t}function DS(e){for(let t=e.length;t>0;){let n=Wl(e,t),l=e.slice(n,t);if($t.test(l)){t=n;continue}return O1(l)||el(l)}return!1}var Ir=/[A-Za-z#&*<=>@^_`~]/;function R1(e,t){return e.charCodeAt(0)<128&&t.charCodeAt(0)<128}function Wt(e,t,n){if(!n.geckoAsciiLineBreaks||t<=0||t>=e.length)return null;let l=no(e,t),i=String.fromCodePoint(e.codePointAt(t));if(l===null||!R1(l,i))return null;let a=el(l),u=el(i);return!a&&!u?null:!!(i===")"||i==="]"||i==="}"||"!,.:;?/".includes(i)||"([{".includes(l)||l==='"'||l==="'"||i==='"'||i==="'"||i==="|"||i==="-"||a&&Ir.test(i)||Ir.test(l)&&u||u&&(")]}".includes(l)||/[0-9]/.test(l))||a&&("([{".includes(i)||/[0-9]/.test(i)))}function Xu(e,t,n,l=e.length){let i=t[0];if(i===void 0||!"([{".includes(i))return null;let a=no(e,l);return a===null?null:n.geckoAsciiLineBreaks&&R1(a,i)?Ir.test(a)||sa.test(a)||`"'([{`.includes(a)||el(a):a.charCodeAt(0)>=128?!Qe(a)&&/[\p{L}\p{N}]/u.test(a)?!0:null:/[A-Za-z0-9]/.test(a)||"$'(/<@[^_`{".includes(a)}function TS(e,t,n,l,i){if(n[0]==="-"&&Qe(e))return!0;if(Qe(e)||Qe(n))return!1;let a=Xu(e,n,i);if(a!==null)return a;let u=!t&&k1(e),s=!l&&k1(n),c=hS(e),r=(t||c)&&DS(e);return!u&&!s&&!r?!1:(t||u||c)&&(l||s)}function D1(e){for(let t of e)if(sa.test(t))return!0;return!1}function ua(e){if(e.length===0)return!1;for(let t of e)if(!(sa.test(t)||MS.has(t)))return!1;return!0}function BS(e,t,n){let l=[],i=[],a=[],u=[];function s(c,r){if(c.includes("-")){let f=c.split("-"),x=f.length>1;for(let o=0;os+1){l.push(Dn(x)),i.push(m),a.push("text"),u.push(e.starts[s]),s=o;continue}}l.push(c),i.push(f),a.push(r),u.push(e.starts[s]),s++}return{len:l.length,texts:l,isWordLike:i,kinds:a,starts:u}}function RS(e){let t=[],n=[],l=[],i=[],a=0;for(;a=0;y--){let E=a[y];if(E.length===0)continue;let D=M?.at(-1)??(g>=0?a[g]:null);if(s[y]==="text"&&!u[y]&&D!==null&&s[g]==="text"&&((Wt(e,c[y]+E.length,t)??(rS(E)&&Xu(E,D,t)!==!1))||E==="-"&&xS(D))){M===null&&(M=[]),M.push(E),c[g]=c[y],a[y]="";continue}M!==null&&(a[g]=C1(M,a[g]),M=null),g=y}M!==null&&(a[g]=C1(M,a[g]));let T=0;for(let y=0;y=0&&(!T1(t.texts[o-1],n.breakKeepAllAfterPunctuation)||Wt(e,t.starts[o],n)===!1)&&x(o),s<0&&(s=o),c=c||Qe(m);continue}x(o),l.push(m),i.push(t.isWordLike[o]),a.push(S),u.push(t.starts[o])}return x(t.len),{len:l.length,texts:l,isWordLike:i,kinds:a,starts:u}}function z1(e,t){let n=e.charCodeAt(t+1);if(n<128){if(n<48||n>57)return!1}else{let l=e.codePointAt(t+1);if(l===void 0||!sa.test(String.fromCodePoint(l)))return!1}for(let l=t;l>0;){let i=Wl(e,l),a=e.slice(i,l);if(!$t.test(a))return Qe(a)||!/[\p{L}\p{N}]/u.test(a);l=i}return!0}function LS(e,t){let n=[],l=0,i=0,a=!1,u=!1,s=!1,c=!1,r=!1;function f(){i!==l&&(n.push({text:e.slice(l,i),start:l,overflow:a?c?"grapheme":"none":"word-like"}),l=i,a=!1,u=!1,s=!1,c=!1,r=!1)}function x(m,S,v){l=S,i=S+m.length,a=v,c=m==="-",u=$r(m),s=Zu.has(m)}function o(m,S){i+=m.length,a=a||S,c=c||m==="-";let v=$r(m);m.length===1&&Pn.has(m)?u=u||v:u=v,s=!1}for(let m of Tn().segment(e)){let S=m.segment,v=Qe(S);if(i===l){x(S,m.index,v);continue}let A=S==="-"&&a;if(A&&z1(e,m.index)&&(r=!0),s||Pr.has(S)||Pn.has(S)||A||r&&!v||t.carryCJKAfterClosingQuote&&v&&u){o(S,v);continue}if(!a&&!v){o(S,v);continue}f(),x(S,m.index,v)}return f(),n}function qS(e,t,n){if(t.length<=1)return t;let l=[],i=-1,a=!1;function u(c,r){let f=t[c].start,x=r=0&&(!T1(t[c-1].text,n.breakKeepAllAfterPunctuation)||Wt(e,r.start,n)===!1)&&s(c),i<0&&(i=c),a=a||Qe(r.text)}return s(t.length),l}function w1(e,t,n){let l=LS(e,t);return n==="keep-all"?qS(e,l,t):l}function HS(e){return e==="-"||e==="\u058A"||e==="\u2010"||e==="\u2012"||e==="\u2013"||e==="\u2014"}function _1(e){if(e.length===0||/\p{Cf}/u.test(e))return!1;for(let{segment:t}of Tn().segment(e)){let n=String.fromCodePoint(t.codePointAt(0));if(!/[\p{P}\p{S}]/u.test(n)||B1.test(n)||t.includes("\uFE0F")||/\p{Emoji_Modifier}/u.test(n))return!1}return!0}function L1(e){if(!/[-\u058A\u2010\u2012\u2013\u2014]/u.test(e))return null;let t=[],n=0;for(let l of Tn().segment(e)){n++;let i=l.segment==="-"&&z1(e,l.index);HS(l.segment)&&!i&&t.push(n)}return t.length===0?null:t}function q1(e,t,n="normal",l="normal"){let i=n==="pre-wrap"?Kg(e):Vg(e);if(i.length===0)return{normalized:i,len:0,texts:[],isWordLike:[],kinds:[],starts:[]};let a=wS(i,t,n),u=l==="keep-all"?_S(i,a,t):a;return{normalized:i,...u}}var $l=null,H1=new Map,Il=null,US=96,GS=/\p{Emoji_Presentation}/u,YS=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u,U1=new Map;function lo(){if($l!==null)return $l;if(typeof OffscreenCanvas<"u")return $l=new OffscreenCanvas(1,1).getContext("2d"),$l;if(typeof document<"u")return $l=document.createElement("canvas").getContext("2d"),$l;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function jS(e){let t=H1.get(e);return t||(t=new Map,H1.set(e,t)),t}function It(e,t){let n=t.get(e);return n===void 0&&(n={width:lo().measureText(e).width},t.set(e,n)),n}function Pl(){if(Il!==null)return Il;if(typeof navigator>"u")return Il={geckoAsciiLineBreaks:!1,lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,breakKeepAllAfterPunctuation:!0,preferPrefixWidthsForBreakableRuns:!1},Il;let e=navigator.userAgent,n=navigator.vendor==="Apple Computer, Inc."&&e.includes("Safari/")&&!e.includes("Chrome/")&&!e.includes("Chromium/")&&!e.includes("CriOS/")&&!e.includes("FxiOS/")&&!e.includes("EdgiOS/"),l=e.includes("Chrome/")||e.includes("Chromium/")||e.includes("CriOS/")||e.includes("Edg/");return Il={geckoAsciiLineBreaks:e.includes("Firefox/")&&!e.includes("FxiOS/"),lineFitEpsilon:n?1/64:.005,carryCJKAfterClosingQuote:l,breakKeepAllAfterPunctuation:!n,preferPrefixWidthsForBreakableRuns:n},Il}function QS(e){let t=e.match(/(?:^|\D)(\d+(?:\.\d+)?)\s*px/);return t?parseFloat(t[1]):16}function XS(e){return GS.test(e)||e.includes("\uFE0F")}function G1(e){return YS.test(e)}function ZS(e){let t=U1.get(e);if(t!==void 0)return t;let n=QS(e),l=lo();l.font=e;let i=l.measureText("\u{1F600}").width;if(t=0,i>n+.5&&typeof document<"u"&&document.body!==null){let a=document.createElement("span");a.style.font=e,a.style.display="inline-block",a.style.visibility="hidden",a.style.position="absolute",a.textContent="\u{1F600}",document.body.appendChild(a);let u=a.getBoundingClientRect().width;document.body.removeChild(a),i-u>.5&&(t=i-u)}return U1.set(e,t),t}function VS(e){let t=0,n=Tn();for(let l of n.segment(e))XS(l.segment)&&t++;return t}function KS(e,t){return t.emojiCount===void 0&&(t.emojiCount=VS(e)),t.emojiCount}function Bn(e,t,n){return n===0?t.width:t.width-KS(e,t)*n}function Y1(e,t,n,l,i){if(t.breakableFitAdvances!==void 0&&t.breakableFitMode===i)return t.breakableFitAdvances;t.breakableFitMode=i;let a=Tn(),u=[];for(let f of a.segment(e))u.push(f.segment);if(u.length<=1)return t.breakableFitAdvances=null,t.breakableFitAdvances;if(i==="sum-graphemes"){let f=[];for(let x of u){let o=It(x,n);f.push(Bn(x,o,l))}return t.breakableFitAdvances=f,t.breakableFitAdvances}if(i==="pair-context"||u.length>US){let f=[],x=null,o=0;for(let m of u){let S=It(m,n),v=Bn(m,S,l);if(x===null)f.push(v);else{let A=x+m,d=It(A,n);f.push(Bn(A,d,l)-o)}x=m,o=v}return t.breakableFitAdvances=f,t.breakableFitAdvances}let s=[],c="",r=0;for(let f of u){c+=f;let x=It(c,n),o=Bn(c,x,l);s.push(o-r),r=o}return t.breakableFitAdvances=s,t.breakableFitAdvances}function j1(e,t){let n=lo();n.font=e;let l=jS(e),i=t?ZS(e):0;return{cache:l,emojiCorrection:i}}function JS(e,t,n){return n===0&&t>0&&t0?e.letterSpacing:0}function ao(e,t){return t===0?0:e+t}function PS(e,t){return e.letterSpacing!==0&&e.spacingGraphemeCounts[t]>0?e.letterSpacing:0}function ey(e,t,n,l,i){let a=t==="tab"?i+PS(e,n):e.lineEndFitAdvances[n];return ao(l,a)}function Q1(e,t,n,l){let i=t==="tab"?0:e.lineEndFitAdvances[n];return ao(l,i)}function X1(e,t,n,l,i){let a=t==="tab"?i:e.lineEndPaintAdvances[n];return ao(l,a)}function ty(e,t,n){return e.letterSpacing!==0&&t?n+e.letterSpacing:n}function ny(e,t){return e.letterSpacing===0?t:t+e.letterSpacing}function io(e,t,n){let l=t;if(l>=e.length||e[l]>=n)return l;let i=e.length;for(l++;l0)return e.spacingGraphemeCounts[l]>0?e.letterSpacing:0;if(JS(e.kinds,l,i))return 0;for(let a=l-1;a>=t;a--){let u=e.kinds[a];if(!(u==="space"||u==="zero-width-break"||u==="hard-break"||u==="soft-hyphen"))return a===t&&n>0||e.spacingGraphemeCounts[a]>0?e.letterSpacing:0}return 0}function iy(e,t,n,l,i,a){return t+ly(e,n,l,i,a)}function ay(e,t){let n=0,l=e.chunks.length;for(;n0)return t;for(let i=t;i=e.widths.length)return-1;l=a.consumedEndSegmentIndex,n.segmentIndex=l,n.graphemeIndex=0}return-1}function J1(e,t){if(t.segmentIndex>=e.widths.length)return-1;let n=ay(e,t.segmentIndex);return n<0?-1:K1(e,n,t)}function uy(e,t,n){if(n.segmentIndex>=e.widths.length)return-1;let l=t;for(;l=e.chunks[l].consumedEndSegmentIndex;)l++;return l>=e.chunks.length?-1:K1(e,l,n)}function W1(e,t){return $1(e,t)}function sy(e,t,n){let{widths:l,kinds:i,breakableFitAdvances:a,breakablePreferredBreaks:u}=e;if(l.length===0)return 0;let c=Pl().lineFitEpsilon,r=t+c,f=0,x=0,o=!1,m=0,S=0,v=0,A=0,d=-1,h=0;function p(){d=-1,h=0}function g(E=v,D=A,U=x){f++,n?.(U,m,S,E,D),x=0,o=!1,p()}function M(E,D){o=!0,m=E,S=0,v=E+1,A=0,x=D}function T(E,D,U){o=!0,m=E,S=D,v=E,A=D+1,x=U}function F(E,D){if(!o){M(E,D);return}x+=D,v=E+1,A=0}function k(E,D){let U=a[E],H=u[E]??null,ie=H===null?-1:io(H,0,D+1),j=-1,oe=0,R=D;for(;Rr){if(H!==null&&j>D){g(E,j,oe),R=j,ie=io(H,ie,R+1),j=-1,oe=0;continue}g(),T(E,R,C)}else x+=C,v=E,A=R+1;let N=R+1;H!==null&&H[ie]===N&&(j=N,oe=x,ie++),R++}o&&v===E&&A===U.length&&(v=E+1,A=0)}let y=0;for(;y=l.length));){let E=l[y],D=i[y],U=Z1(D);if(!o){E>r&&a[y]!==null?k(y,0):M(y,E),U&&(d=y+1,h=x-E),y++;continue}if(x+E>r){if(U){F(y,E),g(y+1,0,x-E),y++;continue}if(d>=0){if(v>d||v===d&&A>0){g();continue}g(d,0,h);continue}if(E>r&&a[y]!==null){g(),k(y,0),y++;continue}g();continue}F(y,E),U&&(d=y+1,h=x-E),y++}return o&&g(),f}function $1(e,t,n){if(e.simpleLineWalkFastPath)return sy(e,t,n);let l={segmentIndex:0,graphemeIndex:0},i=J1(e,l);return cy(e,l,i,t,n).lineCount}function cy(e,t,n,l,i,a=Number.POSITIVE_INFINITY){let{widths:u,kinds:s,breakableFitAdvances:c,breakablePreferredBreaks:r,discretionaryHyphenWidth:f}=e,o=Pl().lineFitEpsilon,m=l+o,S,v,A,d,h,p,g,M,T,F;function k(){return F==="soft-hyphen"&&g===h&&p===0?T:A}function y(R=h,C=p,N=k()){return d?(t.segmentIndex=R,t.graphemeIndex=C,iy(e,N,S,v,R,C)):null}function E(R,C){d=!0,h=R+1,p=0,A=C}function D(R,C,N){d=!0,h=R,p=C+1,A=N}function U(R,C){if(!d){E(R,C);return}A+=C,h=R+1,p=0}function H(R,C,N,O,q,J){if(!C)return;let P=Q1(e,R,N,q),Ce=X1(e,R,N,q,O);g=N+1,M=A-J+P,T=A-J+Ce,F=R}function ie(R,C){let N=c[R],O=r[R]??null,q=O===null?-1:io(O,0,C+1),J=-1,P=0;for(let Ce=C;Cem)return O!==null&&J>C?y(R,J,P):y();A=vt,h=R,p=Ce+1}let Pt=Ce+1;O!==null&&O[q]===Pt&&(J=Pt,P=A,q++)}return d&&h===R&&p===N.length&&(h=R+1,p=0),null}let j=0,oe=null;for(;n>=0&&j0){let vt=ie(N,J);if(vt!==null){C=vt;break e}}else if(Pt>m&&c[N]!==null){let vt=ie(N,0);if(vt!==null){C=vt;break e}}else E(N,Ce);H(O,q,N,Ce,P,Ze);continue}if(A+Pt>m){let vt=A+Q1(e,O,N,P),Yx=A+X1(e,O,N,P,Ce);if(q&&vt<=m){U(N,Ze),C=y(N+1,0,Yx);break e}if(g>=0&&M<=m){if(h>g||h===g&&p>0){C=y();break e}C=y(g,0,T);break e}C=y();break e}U(N,Ze),H(O,q,N,Ce,P,Ze)}C===null&&(C=g===R.consumedEndSegmentIndex&&p===0?y(R.consumedEndSegmentIndex,0,T):y(R.consumedEndSegmentIndex,0,A))}if(C===null)break;oe=C,j++,i?.(C,S,v,t.segmentIndex,t.graphemeIndex),j1?e+(t-1)*n:e}function fy(e,t,n,l,i){let a=Pl(),{cache:u,emojiCorrection:s}=j1(t,G1(e.normalized)),c=Bn("-",It("-",u),s)+(i===0?0:i*2),f=Bn(" ",It(" ",u),s)*8,x=i!==0;if(e.len===0)return ry(n);let o=[],m=[],S=[],v=[],A=!x,d=n?[]:null,h=[],p=[],g=[],M=n?[]:null,T=[],F=0;function k(D,U,H,ie,j,oe,R,C,N){j!=="text"&&j!=="space"&&j!=="zero-width-break"&&(A=!1),o.push(U),m.push(H),S.push(ie),v.push(j),d?.push(oe),h.push(R),p.push(C),x&&g.push(N),M!==null&&M.push(D)}function y(D,U,H,ie,j){let oe=x?I1(D,H):0,R=oy(Bn(D,U,s),oe,i),C=H==="space"||H==="preserved-space"||H==="zero-width-break"?0:R,N=C===0?0:C+(oe>0?i:0),O=H==="space"||H==="zero-width-break"?0:R;if(j&&D.length>1){let q="sum-graphemes";i!==0?q="segment-prefixes":ua(D)?q="pair-context":a.preferPrefixWidthsForBreakableRuns&&(q="segment-prefixes");let J=Y1(D,U,u,s,q),P=J===null||l==="keep-all"?null:L1(D);k(D,R,N,O,H,ie,J,P,oe);return}k(D,R,N,O,H,ie,null,null,oe)}for(let D=0;Dnull};function Z(e,t=""){let n=typeof e=="string"?e:e.source,l={replace:(i,a)=>{let u=typeof a=="string"?a:a.source;return u=u.replace(_e.caret,"$1"),n=n.replace(i,u),l},getRegex:()=>new RegExp(n,t)};return l}var hy=(()=>{try{return!!new RegExp("(?<=1)(?/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}>`)},xy=/^(?:[ \t]*(?:\n|$))+/,my=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,py=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,da=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,gy=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,oo=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,cx=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,rx=Z(cx).replace(/bull/g,oo).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Sy=Z(cx).replace(/bull/g,oo).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),fo=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,yy=/^[^\n]+/,ho=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,vy=Z(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",ho).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ay=Z(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,oo).getRegex(),$u="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",xo=/<\!--(?:-?>|[\s\S]*?(?:-->|$))/,by=Z("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",xo).replace("tag",$u).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ox=Z(fo).replace("hr",da).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",$u).getRegex(),Ey=Z(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ox).getRegex(),mo={blockquote:Ey,code:my,def:vy,fences:py,heading:gy,hr:da,html:by,lheading:rx,list:Ay,newline:xy,paragraph:ox,table:tl,text:yy},tx=Z("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",da).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",$u).getRegex(),Ny={...mo,lheading:Sy,table:tx,paragraph:Z(fo).replace("hr",da).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",tx).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",$u).getRegex()},My={...mo,html:Z(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",xo).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:tl,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Z(fo).replace("hr",da).replace("heading",` *#{1,6} *[^ ]`).replace("lheading",rx).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Cy=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Fy=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,fx=/^( {2,}|\\)\n(?!\s*$)/,ky=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",hy?"(?`+)[^`]+\k(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),hx=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Ry=Z(hx,"u").replace(/punct/g,ei).getRegex(),zy=Z(hx,"u").replace(/punct/g,dx).getRegex(),xx="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",wy=Z(xx,"gu").replace(/notPunctSpace/g,po).replace(/punctSpace/g,Iu).replace(/punct/g,ei).getRegex(),_y=Z(xx,"gu").replace(/notPunctSpace/g,By).replace(/punctSpace/g,Ty).replace(/punct/g,dx).getRegex(),Ly=Z("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,po).replace(/punctSpace/g,Iu).replace(/punct/g,ei).getRegex(),qy=Z(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,ei).getRegex(),Hy="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Uy=Z(Hy,"gu").replace(/notPunctSpace/g,po).replace(/punctSpace/g,Iu).replace(/punct/g,ei).getRegex(),Gy=Z(/\\(punct)/,"gu").replace(/punct/g,ei).getRegex(),Yy=Z(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),jy=Z(xo).replace("(?:-->|$)","-->").getRegex(),Qy=Z("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",jy).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ku=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Xy=Z(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Ku).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),mx=Z(/^!?\[(label)\]\[(ref)\]/).replace("label",Ku).replace("ref",ho).getRegex(),px=Z(/^!?\[(ref)\](?:\[\])?/).replace("ref",ho).getRegex(),Zy=Z("reflink|nolink(?!\\()","g").replace("reflink",mx).replace("nolink",px).getRegex(),nx=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,go={_backpedal:tl,anyPunctuation:Gy,autolink:Yy,blockSkip:Oy,br:fx,code:Fy,del:tl,delLDelim:tl,delRDelim:tl,emStrongLDelim:Ry,emStrongRDelimAst:wy,emStrongRDelimUnd:Ly,escape:Cy,link:Xy,nolink:px,punctuation:Dy,reflink:mx,reflinkSearch:Zy,tag:Qy,text:ky,url:tl},Vy={...go,link:Z(/^!?\[(label)\]\((.*?)\)/).replace("label",Ku).getRegex(),reflink:Z(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ku).getRegex()},uo={...go,emStrongRDelimAst:_y,emStrongLDelim:zy,delLDelim:qy,delRDelim:Uy,url:Z(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",nx).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Z(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},lx=e=>Jy[e];function Dt(e,t){if(t){if(_e.escapeTest.test(e))return e.replace(_e.escapeReplace,lx)}else if(_e.escapeTestNoEncode.test(e))return e.replace(_e.escapeReplaceNoEncode,lx);return e}function ix(e){try{e=encodeURI(e).replace(_e.percentDecode,"%")}catch{return null}return e}function ax(e,t){let n=e.replace(_e.findPipe,(a,u,s)=>{let c=!1,r=u;for(;--r>=0&&s[r]==="\\";)c=!c;return c?"|":" |"}),l=n.split(_e.splitPipe),i=0;if(l[0].trim()||l.shift(),l.length>0&&!l.at(-1)?.trim()&&l.pop(),t)if(l.length>t)l.splice(t);else for(;l.length0?-2:-1}function $y(e,t=0){let n=t,l="";for(let i of e)if(i===" "){let a=4-n%4;l+=" ".repeat(a),n+=a}else l+=i,n++;return l}function ux(e,t,n,l,i){let a=t.href,u=t.title||null,s=e[1].replace(i.other.outputLinkReplace,"$1");l.state.inLink=!0;let c={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:a,title:u,text:s,tokens:l.inlineTokens(s)};return l.state.inLink=!1,c}function Iy(e,t,n){let l=e.match(n.other.indentCodeCompensation);if(l===null)return t;let i=l[1];return t.split(` `).map(a=>{let u=a.match(n.other.beginningSpace);if(u===null)return a;let[s]=u;return s.length>=i.length?a.slice(i.length):a}).join(` `)}var Ju=class{options;rules;lexer;constructor(e){this.options=e||ll}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:oa(n,` @@ -2031,11 +2031,11 @@ `);continue}}return{type:"blockquote",raw:l,tokens:a,text:i}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),l=n.length>1,i={type:"list",raw:"",ordered:l,start:l?+n.slice(0,-1):"",loose:!1,items:[]};n=l?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=l?n:"[*+-]");let a=this.rules.other.listItemRegex(n),u=!1;for(;e;){let c=!1,r="",f="";if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let x=$y(t[2].split(` `,1)[0],t[1].length),o=e.split(` `,1)[0],m=!x.trim(),S=0;if(this.options.pedantic?(S=2,f=x.trimStart()):m?S=t[1].length+1:(S=x.search(this.rules.other.nonSpaceChar),S=S>4?1:S,f=x.slice(S),S+=t[1].length),m&&this.rules.other.blankLine.test(o)&&(r+=o+` -`,e=e.substring(o.length+1),c=!0),!c){let v=this.rules.other.nextBulletRegex(S),A=this.rules.other.hrRegex(S),d=this.rules.other.fencesBeginRegex(S),h=this.rules.other.headingBeginRegex(S),p=this.rules.other.htmlBeginRegex(S),g=this.rules.other.blockquoteBeginRegex(S);for(;e;){let N=e.split(` -`,1)[0],T;if(o=N,this.options.pedantic?(o=o.replace(this.rules.other.listReplaceNesting," "),T=o):T=o.replace(this.rules.other.tabCharGlobal," "),d.test(o)||h.test(o)||p.test(o)||g.test(o)||v.test(o)||A.test(o))break;if(T.search(this.rules.other.nonSpaceChar)>=S||!o.trim())f+=` +`,e=e.substring(o.length+1),c=!0),!c){let v=this.rules.other.nextBulletRegex(S),A=this.rules.other.hrRegex(S),d=this.rules.other.fencesBeginRegex(S),h=this.rules.other.headingBeginRegex(S),p=this.rules.other.htmlBeginRegex(S),g=this.rules.other.blockquoteBeginRegex(S);for(;e;){let M=e.split(` +`,1)[0],T;if(o=M,this.options.pedantic?(o=o.replace(this.rules.other.listReplaceNesting," "),T=o):T=o.replace(this.rules.other.tabCharGlobal," "),d.test(o)||h.test(o)||p.test(o)||g.test(o)||v.test(o)||A.test(o))break;if(T.search(this.rules.other.nonSpaceChar)>=S||!o.trim())f+=` `+T.slice(S);else{if(m||x.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||d.test(x)||h.test(x)||A.test(x))break;f+=` -`+o}m=!o.trim(),r+=N+` -`,e=e.substring(N.length+1),x=T.slice(S)}}i.loose||(u?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(u=!0)),i.items.push({type:"list_item",raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(f),loose:!1,text:f,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let c of i.items){if(this.lexer.state.top=!1,c.tokens=this.lexer.blockTokens(c.text,[]),c.task){if(c.text=c.text.replace(this.rules.other.listReplaceTask,""),c.tokens[0]?.type==="text"||c.tokens[0]?.type==="paragraph"){c.tokens[0].raw=c.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),c.tokens[0].text=c.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let f=this.lexer.inlineQueue.length-1;f>=0;f--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[f].src)){this.lexer.inlineQueue[f].src=this.lexer.inlineQueue[f].src.replace(this.rules.other.listReplaceTask,"");break}}let r=this.rules.other.listTaskCheckbox.exec(c.raw);if(r){let f={type:"checkbox",raw:r[0]+" ",checked:r[0]!=="[ ]"};c.checked=f.checked,i.loose?c.tokens[0]&&["paragraph","text"].includes(c.tokens[0].type)&&"tokens"in c.tokens[0]&&c.tokens[0].tokens?(c.tokens[0].raw=f.raw+c.tokens[0].raw,c.tokens[0].text=f.raw+c.tokens[0].text,c.tokens[0].tokens.unshift(f)):c.tokens.unshift({type:"paragraph",raw:f.raw,text:f.raw,tokens:[f]}):c.tokens.unshift(f)}}if(!i.loose){let r=c.tokens.filter(x=>x.type==="space"),f=r.length>0&&r.some(x=>this.rules.other.anyLine.test(x.raw));i.loose=f}}if(i.loose)for(let c of i.items){c.loose=!0;for(let r of c.tokens)r.type==="text"&&(r.type="paragraph")}return i}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),l=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:l,title:i}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=ax(t[1]),l=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(` +`+o}m=!o.trim(),r+=M+` +`,e=e.substring(M.length+1),x=T.slice(S)}}i.loose||(u?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(u=!0)),i.items.push({type:"list_item",raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(f),loose:!1,text:f,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let c of i.items){if(this.lexer.state.top=!1,c.tokens=this.lexer.blockTokens(c.text,[]),c.task){if(c.text=c.text.replace(this.rules.other.listReplaceTask,""),c.tokens[0]?.type==="text"||c.tokens[0]?.type==="paragraph"){c.tokens[0].raw=c.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),c.tokens[0].text=c.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let f=this.lexer.inlineQueue.length-1;f>=0;f--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[f].src)){this.lexer.inlineQueue[f].src=this.lexer.inlineQueue[f].src.replace(this.rules.other.listReplaceTask,"");break}}let r=this.rules.other.listTaskCheckbox.exec(c.raw);if(r){let f={type:"checkbox",raw:r[0]+" ",checked:r[0]!=="[ ]"};c.checked=f.checked,i.loose?c.tokens[0]&&["paragraph","text"].includes(c.tokens[0].type)&&"tokens"in c.tokens[0]&&c.tokens[0].tokens?(c.tokens[0].raw=f.raw+c.tokens[0].raw,c.tokens[0].text=f.raw+c.tokens[0].text,c.tokens[0].tokens.unshift(f)):c.tokens.unshift({type:"paragraph",raw:f.raw,text:f.raw,tokens:[f]}):c.tokens.unshift(f)}}if(!i.loose){let r=c.tokens.filter(x=>x.type==="space"),f=r.length>0&&r.some(x=>this.rules.other.anyLine.test(x.raw));i.loose=f}}if(i.loose)for(let c of i.items){c.loose=!0;for(let r of c.tokens)r.type==="text"&&(r.type="paragraph")}return i}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),l=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:l,title:i}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=ax(t[1]),l=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(` `):[],a={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===l.length){for(let u of l)this.rules.other.tableAlignRight.test(u)?a.align.push("right"):this.rules.other.tableAlignCenter.test(u)?a.align.push("center"):this.rules.other.tableAlignLeft.test(u)?a.align.push("left"):a.align.push(null);for(let u=0;u({text:s,tokens:this.lexer.inline(s),header:!1,align:a.align[c]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let n=t[1].trim();return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let n=t[1].charAt(t[1].length-1)===` `?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let a=oa(n.slice(0,-1),"\\");if((n.length-a.length)%2===0)return}else{let a=Wy(t[2],"()");if(a===-2)return;if(a>-1){let u=(t[0].indexOf("!")===0?5:4)+t[1].length+a;t[2]=t[2].substring(0,a),t[0]=t[0].substring(0,u).trim(),t[3]=""}}let l=t[2],i="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(l);a&&(l=a[1],i=a[3])}else i=t[3]?t[3].slice(1,-1):"";return l=l.trim(),this.rules.other.startAngleBracket.test(l)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?l=l.slice(1):l=l.slice(1,-1)),ux(t,{href:l&&l.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let l=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=t[l.toLowerCase()];if(!i){let a=n[0].charAt(0);return{type:"text",raw:a,text:a}}return ux(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let l=this.rules.inline.emStrongLDelim.exec(e);if(!(!l||!l[1]&&!l[2]&&!l[3]&&!l[4]||l[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(l[1]||l[3])||!n||this.rules.inline.punctuation.exec(n))){let i=[...l[0]].length-1,a,u,s=i,c=0,r=l[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(r.lastIndex=0,t=t.slice(-1*e.length+i);(l=r.exec(t))!=null;){if(a=l[1]||l[2]||l[3]||l[4]||l[5]||l[6],!a)continue;if(u=[...a].length,l[3]||l[4]){s+=u;continue}else if((l[5]||l[6])&&i%3&&!((i+u)%3)){c+=u;continue}if(s-=u,s>0)continue;u=Math.min(u,u+s+c);let f=[...l[0]][0].length,x=e.slice(0,i+l.index+f+u);if(Math.min(i,u)%2){let m=x.slice(1,-1);return{type:"em",raw:x,text:m,tokens:this.lexer.inlineTokens(m)}}let o=x.slice(2,-2);return{type:"strong",raw:x,text:o,tokens:this.lexer.inlineTokens(o)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," "),l=this.rules.other.nonSpaceChar.test(n),i=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return l&&i&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e,t,n=""){let l=this.rules.inline.delLDelim.exec(e);if(l&&(!l[1]||!n||this.rules.inline.punctuation.exec(n))){let i=[...l[0]].length-1,a,u,s=i,c=this.rules.inline.delRDelim;for(c.lastIndex=0,t=t.slice(-1*e.length+i);(l=c.exec(t))!=null;){if(a=l[1]||l[2]||l[3]||l[4]||l[5]||l[6],!a||(u=[...a].length,u!==i))continue;if(l[3]||l[4]){s+=u;continue}if(s-=u,s>0)continue;u=Math.min(u,u+s);let r=[...l[0]][0].length,f=e.slice(0,i+l.index+r+u),x=f.slice(i,-i);return{type:"del",raw:f,text:x,tokens:this.lexer.inlineTokens(x)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let n,l;return t[2]==="@"?(n=t[1],l="mailto:"+n):(n=t[1],l=n),{type:"link",raw:t[0],text:n,href:l,tokens:[{type:"text",raw:n,text:n}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let n,l;if(t[2]==="@")n=t[0],l="mailto:"+n;else{let i;do i=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(i!==t[0]);n=t[0],t[1]==="www."?l="http://"+t[0]:l=t[0]}return{type:"link",raw:t[0],text:n,href:l,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:n}}}},gt=class so{tokens;options;state;inlineQueue;tokenizer;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||ll,this.options.tokenizer=this.options.tokenizer||new Ju,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:_e,block:Vu.normal,inline:ra.normal};this.options.pedantic?(n.block=Vu.pedantic,n.inline=ra.pedantic):this.options.gfm&&(n.block=Vu.gfm,this.options.breaks?n.inline=ra.breaks:n.inline=ra.gfm),this.tokenizer.rules=n}static get rules(){return{block:Vu,inline:ra}}static lex(t,n){return new so(n).lex(t)}static lexInline(t,n){return new so(n).inlineTokens(t)}lex(t){t=t.replace(_e.carriageReturn,` `),this.blockTokens(t,this.tokens);for(let n=0;n(i=u.call({lexer:this},t,n))?(t=t.substring(i.raw.length),n.push(i),!0):!1))continue;if(i=this.tokenizer.space(t)){t=t.substring(i.raw.length);let u=n.at(-1);i.raw.length===1&&u!==void 0?u.raw+=` @@ -2081,7 +2081,7 @@ \`\`\`swift let value = ${a} print(value) -\`\`\``),l({id:`synthetic-assistant-${a}`,kind:"assistant",text:u}),l({id:`synthetic-end-${a}`,kind:"turnSummary",durationMs:1e3,toolCount:0,status:"completed"})}return t}var Mv=30;function Cv(){return new Promise(e=>requestAnimationFrame(e))}function Ox(e){let t=[],n=16.666666666666668,l=!1,i=0,a=()=>t.length<2?{running:l,frames:0}:{running:l,rows:e.rowCount(),...kx(t,n)};return{async seedRows(u=5e3){I.enable();let s=Bx(Math.max(3,Math.floor(u))),c=performance.now(),r=I.nextCommit();e.replaceRows(s);let f=await r;return{rows:s.length,commit_ms:f===void 0?null:Xe(f-c)}},async startFling(u=3,s={}){I.enable();let c=document.querySelector(".acpmux-scroll");if(!c)return{error:"no transcript"};let r=++i,f=Math.max(.1,u)*1e3;t=[],l=!0,I.resetFrames(),c.scrollTop=c.scrollHeight;let x=(async()=>{let o=[];for(let S=0;S0?s.nominal_ms:Math.max(1,Fx(o.slice(1).map((S,v)=>S-o[v]))),c.scrollTop=c.scrollHeight;let m=c.scrollTop;I.resetFrames(),await new Promise(S=>{let v,A=d=>{if(r!==i)return S();v??=d,t.push(d);let h=Math.min(1,(d-v)/f);c.scrollTop=m*(1-h),I.markFrame(d,Dx(I.mountedTop,I.mountedBottom,c.scrollTop,c.clientHeight,c.scrollHeight)),h<1?requestAnimationFrame(A):S()};requestAnimationFrame(A)}),r===i&&(l=!1)})();return s.wait?(await x,a()):{started:!0,rows:e.rowCount(),seconds:f/1e3}},flingStats:a,perfStats(u={}){return I.enable(),{running:l,...I.stats(u.raw===!0)}},typingStats(){return I.enable(),Tx(I.typing)},resetTyping(){return I.enable(),I.typing.length=0,{keys:0}}}}var Fv=()=>({requestFrame:e=>requestAnimationFrame(e),cancelFrame:e=>cancelAnimationFrame(e),setTimer:(e,t)=>setTimeout(e,t),clearTimer:e=>clearTimeout(e)}),is=class e{constructor(t,n=Fv()){this.report=t;this.clock=n}report;clock;static settleMs=250;static maximumFrames=640;intervals=[];lastFrame;frame;settle;scrolled(){this.frame===void 0&&(this.frame=this.clock.requestFrame(this.tick)),this.settle!==void 0&&this.clock.clearTimer(this.settle),this.settle=this.clock.setTimer(this.finish,e.settleMs)}stop(){this.frame!==void 0&&this.clock.cancelFrame(this.frame),this.settle!==void 0&&this.clock.clearTimer(this.settle),this.reset()}tick=t=>{this.lastFrame!==void 0&&this.intervals.length{this.frame!==void 0&&this.clock.cancelFrame(this.frame);let t=this.intervals;this.reset(),t.length&&this.report(t)};reset(){this.intervals=[],this.lastFrame=void 0,this.frame=void 0,this.settle=void 0}};var B=On(ha(),1);function yt(e,t={}){let n=window.cmuxAcpmuxActions?.[e];if(n)return n(t);let l=window.webkit?.messageHandlers?.agentSession;return l?Promise.resolve(l.postMessage({id:crypto.randomUUID(),method:e,params:t})).then(i=>{if(!i.ok)throw new Error(i.error?.userMessage??"Request failed");return i.value}):Promise.reject(new Error("Native bridge is unavailable"))}function ii(e,t){return e?.length?e.map((n,l)=>{if(n.type==="codespan")return(0,B.jsx)("code",{children:n.text},l);if(n.type==="link"){let i=yo(n.href);return i?(0,B.jsx)("a",{href:i,rel:"noreferrer",children:ii(n.tokens,n.text)},l):n.text}return"tokens"in n?(0,B.jsx)(z.default.Fragment,{children:ii(n.tokens,"text"in n?n.text:n.raw??"")},l):n.raw??("text"in n?n.text:"")}):t}function Tv({source:e}){return(0,B.jsx)(B.Fragment,{children:ns(e).map((t,n)=>t.type==="code"?(0,B.jsx)("pre",{children:(0,B.jsx)("code",{children:t.text})},n):t.type==="heading"?(0,B.jsx)("div",{className:`acpmux-heading acpmux-heading-${t.depth}`,children:ii(t.tokens,t.text)},n):t.type==="paragraph"||t.type==="text"?(0,B.jsx)("p",{children:ii(t.tokens,t.text)},n):t.type==="list"?(0,B.jsx)("ul",{children:t.items.map((l,i)=>(0,B.jsx)("li",{children:ii(l.tokens,l.text)},i))},n):t.type==="blockquote"?(0,B.jsx)("blockquote",{children:ii(t.tokens,t.text)},n):t.type==="hr"?(0,B.jsx)("hr",{},n):(0,B.jsx)("p",{children:t.raw},n))})}var _x=(0,z.memo)(function({row:t}){return(0,B.jsx)("div",{className:`acpmux-markdown ${t.kind==="user"?"acpmux-user-bubble":""}`,children:(0,B.jsx)(Tv,{source:t.text??""})})},(e,t)=>e.row.id===t.row.id&&e.row.version===t.row.version),Bv=(0,z.memo)(function({row:t,onToggleActivity:n,expanded:l}){return(0,B.jsxs)("div",{className:"acpmux-activity",children:[(0,B.jsxs)("button",{className:"acpmux-activity-toggle","aria-expanded":l,onClick:()=>n(t.id),children:[l?"\u2304":"\u203A"," Worked with ",t.toolCount??0," tool calls"]}),l&&(0,B.jsx)("div",{className:"acpmux-activity-items",children:(t.items??[]).map(i=>(0,B.jsxs)("div",{className:"acpmux-activity-item",children:[(0,B.jsx)("span",{className:"acpmux-glyph",children:i.kind==="tool"?"\u25A3":"\u2726"}),i.text,i.tool?.output&&(0,B.jsx)("pre",{children:i.tool.output})]},`${t.id}-${i.text}`))})]})},(e,t)=>e.row.id===t.row.id&&e.row.version===t.row.version&&e.expanded===t.expanded),Ov=(0,z.memo)(function({row:t}){return(0,B.jsx)("div",{className:"acpmux-summary",children:`Worked for ${Math.round((t.durationMs??0)/1e3)}s \xB7 ${t.toolCount??0} tool calls`})},(e,t)=>e.row.id===t.row.id&&e.row.version===t.row.version),us=(0,z.memo)(function({row:t}){return(0,B.jsx)("div",{className:"acpmux-muted",children:t.text})},(e,t)=>e.row.id===t.row.id&&e.row.version===t.row.version),Rv=(0,z.memo)(function({row:t}){let n=t.permission;return(0,B.jsxs)("div",{className:"acpmux-permission-card",children:[(0,B.jsx)("strong",{children:n?.title||"Permission required"}),(0,B.jsx)("div",{className:"acpmux-permission-buttons",children:n?.options.map(l=>(0,B.jsx)("button",{onClick:()=>{yt("chat.permission",{permissionId:n.permissionId,optionId:l.id})},children:l.name},l.id))})]})},(e,t)=>e.row.id===t.row.id&&e.row.version===t.row.version),zv=(0,z.memo)(function({row:t}){let n=(t.items??[]).filter(l=>l.tool?.kind==="edit"||l.tool?.kind==="fileChange");return(0,B.jsxs)("div",{className:"acpmux-edited-files",children:[(0,B.jsx)("strong",{children:"Edited files"}),n.map(l=>(0,B.jsxs)("div",{children:["\u25A4 ",l.tool?.inputSummary||l.text]},l.tool?.id||l.text))]})},(e,t)=>e.row.id===t.row.id&&e.row.version===t.row.version),Fo={user:_x,assistant:_x,activity:Bv,editedFiles:zv,turnSummary:Ov,notice:us,plan:us,typing:us,permission:Rv};function wv({row:e,kind:t,index:n,setSize:l,top:i,rowWidth:a,expanded:u,observer:s,report:c,children:r}){let f=(0,z.useRef)(null);return(0,z.useLayoutEffect)(()=>{let x=f.current;if(!(!x||!s))return s.observe(x),()=>s.unobserve(x)},[s]),(0,z.useLayoutEffect)(()=>{let x=f.current;x&&c(e.id,e.version,x.getBoundingClientRect().height)},[e.id,e.version,a,u,c]),(0,B.jsx)("article",{ref:f,"data-row-id":e.id,className:`acpmux-row acpmux-${t}`,"aria-label":_v(t),"aria-posinset":n+1,"aria-setsize":l,style:{transform:`translateY(${i}px)`},children:r})}var _v=e=>e==="user"?"You":e==="assistant"?"Agent":void 0,Lx=e=>e.kind==="activity"&&e.items?.some(t=>t.tool?.kind==="edit"||t.tool?.kind==="fileChange")?"editedFiles":e.kind,Mo=()=>({...Fo,...window.cmuxAcpmuxRegistry}),qx=(e,t)=>({top:e.scrollTop,atLatest:e.scrollTop>=t-e.clientHeight-1}),Lv=2,qv=4;function Hv({rows:e,onToggleActivity:t,expanded:n,registry:l=Fo,canLoadOlder:i=!1}){let a=I.enabled?performance.now():0,[u,s]=(0,z.useState)({top:0,delta:0}),[c,r]=(0,z.useState)(600),f=(0,z.useRef)(null),[x,o]=(0,z.useState)(760),[m,S]=(0,z.useState)(new Map),v=(0,z.useRef)(new Map),A=(0,z.useRef)(ti(x));A.current=ti(x);let d=(0,z.useRef)(e);d.current=e;let h=(0,z.useCallback)((C,M,O)=>{O>0&&v.current.set(C,{version:M,width:A.current,height:O})},[]),p=(0,z.useCallback)(()=>{if(!v.current.size)return;let C=v.current;v.current=new Map,S(M=>{let O;for(let[q,J]of C){let P=M.get(q);P&&P.version===J.version&&P.width===J.width&&Math.abs(P.height-J.height)<.5||(O??=new Map(M),O.set(q,J))}return O??M})},[]),g=(0,z.useMemo)(()=>typeof ResizeObserver>"u"?void 0:new ResizeObserver(C=>{for(let M of C??[]){let O=M.target,q=d.current[Number(O.getAttribute("aria-posinset"))-1];q&&q.id===O.dataset.rowId&&h(q.id,q.version,O.getBoundingClientRect().height)}(0,Co.flushSync)(p)}),[h,p]);(0,z.useEffect)(()=>()=>g?.disconnect(),[g]),(0,z.useEffect)(()=>{let C=T.current;if(C.size<=e.length&&m.size<=e.length)return;let M=new Set(e.map(O=>O.id));for(let O of C.keys())M.has(O)||C.delete(O);S(O=>[...O.keys()].every(q=>M.has(q))?O:new Map([...O].filter(([q])=>M.has(q))))},[e,m]),(0,z.useLayoutEffect)(p);let N=(0,z.useRef)(!1),T=(0,z.useRef)(new Map);(0,z.useEffect)(()=>{let C=f.current;if(!C)return;let M=new ResizeObserver(()=>{r(C.clientHeight),o(C.clientWidth)});return M.observe(C),o(C.clientWidth),()=>M.disconnect()},[]);let F=(0,z.useRef)(null),k=(0,z.useRef)({top:0,atLatest:!1}),y=(0,z.useMemo)(()=>{let C=I.enabled?performance.now():0;return{layout:Ex(e,ti(x),T.current,(O,q)=>l[Lx(O)]?.measure?.(O,q)),ms:I.enabled?performance.now()-C:0}},[e,x,l]),E=(0,z.useMemo)(()=>{let C=I.enabled?performance.now():0,M=ti(x);return{layout:m.size===0?y.layout:Nx(y.layout,q=>{let J=m.get(e[q].id);return J&&J.version===e[q].version&&J.width===M?J.height:void 0}),ms:I.enabled?performance.now()-C:0}},[y,m,e,x]),D=E.layout,U=(0,z.useRef)(null),H=(0,z.useRef)(null),ie=Math.min(Math.abs(u.delta)*Lv,c*qv),j=vo(D,u.delta<0?u.top-ie:u.top,c+ie);(0,z.useLayoutEffect)(()=>{let C=j.last-1;I.mountedTop=j.last>j.first?D.tops[j.first]:0,I.mountedBottom=j.last>j.first?D.tops[C]+D.heights[C]:0;let M=U.current!==E;U.current=E;let O=H.current!==y;H.current=y;let q=(M?E.ms:0)+(O?y.ms:0);if(I.enabled&&M&&I.addLayout(q),I.enabled&&a>0){let J=performance.now();I.commit(J-a,q,I.mountedTop,I.mountedBottom,J)}}),(0,z.useLayoutEffect)(()=>{let C=F.current,M=f.current;if(C&&M&&C.tops.length===D.tops.length){let O=M.scrollTop,q=O=D.totalHeight-M.clientHeight-1,J=Math.abs(O-k.current.top)<=.5,P=q?k.current.top:O,Ce=q||J?k.current.atLatest:P>=C.totalHeight-M.clientHeight-1;if(P>0&&N.current&&Ce){let Ze=Math.max(0,D.totalHeight-M.clientHeight);Math.abs(Ze-M.scrollTop)>.5&&(M.scrollTop=Ze)}else if(P>0){let Ze=vo(C,P,0,0).first,Pt=D.tops[Ze]-C.tops[Ze];(q||Math.abs(Pt)>.5)&&(M.scrollTop=P+Pt)}}if(!N.current&&M&&D.totalHeight>M.clientHeight){let O=Math.max(0,D.totalHeight-M.clientHeight);M.scrollTop=O,s({top:O,delta:0}),N.current=!0}F.current=D,M&&(k.current=qx(M,D.totalHeight))},[D,j.first,c]);let oe=(0,z.useMemo)(()=>new is(C=>{yt("pane.framePacing",{intervals:C}).catch(()=>{})}),[]);return(0,z.useEffect)(()=>()=>oe.stop(),[oe]),(0,B.jsx)("div",{ref:f,className:"acpmux-scroll",role:"feed","aria-label":"Transcript",onScroll:C=>{oe.scrolled();let M=C.currentTarget.scrollTop;k.current=qx(C.currentTarget,D.totalHeight),(0,Co.flushSync)(()=>s(O=>({top:M,delta:M-O.top})))},children:(0,B.jsx)("div",{className:"acpmux-spacer",style:{height:D.totalHeight},children:(0,B.jsx)("div",{className:"acpmux-thread",children:e.slice(j.first,j.last).map((C,M)=>{let O=j.first+M,q=Lx(C),J=l[q]??us,P=n.has(C.id);return(0,B.jsx)(wv,{row:C,kind:q,index:O,setSize:i?-1:e.length,top:D.tops[O],rowWidth:ti(x),expanded:P,observer:g,report:h,children:(0,B.jsx)(J,{row:C,onToggleActivity:t,expanded:P})},C.id)})})})})}function Uv({permission:e}){return(0,B.jsxs)("div",{className:"acpmux-permission-card",children:[(0,B.jsx)("strong",{children:e.title||"Permission required"}),(0,B.jsx)("div",{className:"acpmux-permission-buttons",children:e.options.map(t=>(0,B.jsx)("button",{onClick:()=>{yt("chat.permission",{permissionId:e.permissionId,optionId:t.id})},children:t.name},t.id))})]})}function Gv({snapshot:e}){let t=e.catalog.find(i=>i.id===e.summary?.harness)?.models??[],n=e.summary?.modes?.availableModes??[],l=e.summary?.configOptions?.find(i=>i.category==="thought_level"||i.id==="effort"||i.id==="reasoning_effort");return(0,B.jsxs)("div",{className:"acpmux-chips",children:[(0,B.jsx)("select",{className:"acpmux-model","aria-label":"Model",value:e.summary?.model??"",onChange:i=>{yt("chat.model",{modelId:i.target.value})},children:t.map(i=>(0,B.jsx)("option",{value:i.id,children:i.name||i.id},i.id))}),(0,B.jsx)("select",{className:"acpmux-mode","aria-label":"Mode",value:e.summary?.modes?.currentModeId??"",onChange:i=>{yt("chat.mode",{modeId:i.target.value})},children:n.map(i=>(0,B.jsx)("option",{value:i.id,children:i.name||i.id},i.id))}),l&&(0,B.jsx)("select",{className:"acpmux-effort","aria-label":"Effort",value:l.currentValue??"",onChange:i=>{yt("chat.effort",{configId:l.id,value:i.target.value})},children:l.options.map(i=>(0,B.jsx)("option",{value:i.value,children:i.name||i.value},i.value))})]})}function Hx(){let[e,t]=(0,z.useState)({type:"snapshot",protocolVersion:1,rows:[],sessions:[],connection:"connecting",isWorking:!1,queue:[],catalog:[],canLoadOlder:!1}),[n,l]=(0,z.useState)(new Set),[i,a]=(0,z.useState)(Fo),u=(0,z.useRef)(new Map),s=(0,z.useRef)(void 0);(0,z.useEffect)(()=>{window.React=z.default,window.cmuxAcpmuxRegistry={register(A,d,h){let p=window.cmuxAcpmuxRegistry;p[A]===d&&(!h?.measure||h.measure===d.measure)||(h?.measure&&(d.measure=h.measure),p[A]=d,a(Mo()))},configure(){a(Mo())}},window.cmuxAcpmuxBridge={receive(A){if(A.protocolVersion!==1)return;let d=bx(u.current,A.rows);u.current=new Map(A.rows.map(h=>[h.id,h])),t(A)},applyTheme(A){v1(A)},applyCustomization(A){if("themeCSS"in A){let d=document.getElementById("acpmux-user-theme");d||(d=document.createElement("style"),d.id="acpmux-user-theme",document.head.append(d)),d.textContent=A.themeCSS??""}if(A.registryJS)try{(0,eval)(A.registryJS),a(Mo())}catch{}A.layout&&window.cmuxAcpmuxRegistry?.configure(A.layout)}},window.cmuxAcpmuxDebug=Ox({replaceRows(A){u.current=new Map(A.map(d=>[d.id,d])),t(d=>({...d,rows:A,connection:"debug",isWorking:!1,canLoadOlder:!1}))},rowCount:()=>u.current.size});let f=!1,x,o=250,m=2e3,S=!1,v=async()=>{try{let A=await yt("ready",S?{reconnect:S}:{});if(f)return;if(A.transport==="mock"){window.cmuxAcpmuxActions=Cx(p=>{u.current=new Map(p.rows.map(g=>[g.id,g])),t(p)});return}if(A.transport!=="acpmux-websocket"||!A.endpoint||!A.token)return;let d=await ls.connect(A,p=>{u.current=new Map(p.rows.map(g=>[g.id,g])),t(p)},()=>{f||(S=!0,s.current=void 0,delete window.cmuxAcpmuxActions,x=window.setTimeout(()=>{v()},o),o=Math.min(o*2,S?m:3e4))});if(f){d.close();return}s.current=d,o=250;let h=p=>p?yt("chat.persistSession",{sessionId:p}).catch(()=>{}):Promise.resolve();window.cmuxAcpmuxActions={"chat.send":async({text:p})=>{let g=await d.ensureSession();return await h(g),d.send(String(p??""))},"chat.cancel":()=>d.cancel(),"chat.permission":({permissionId:p,optionId:g})=>d.permission(String(p),String(g)),"chat.model":({modelId:p})=>d.setModel(String(p)),"chat.mode":({modeId:p})=>d.setMode(String(p)),"chat.effort":({configId:p,value:g})=>d.setConfig(String(p),String(g)),"chat.select":async({sessionId:p})=>h(await d.select(String(p))),"chat.new":async({harness:p})=>h(await d.create(p?String(p):void 0)),"chat.history":()=>d.loadOlder()},d.snapshot()}catch(A){f||(t(d=>({...d,connection:`connecting: ${String(A)}`})),x=window.setTimeout(()=>{v()},o),o=Math.min(o*2,S?m:3e4))}};return v(),()=>{f=!0,x!==void 0&&window.clearTimeout(x),s.current?.close(),s.current=void 0,delete window.cmuxAcpmuxActions}},[]);let c=f=>{f.preventDefault();let o=f.currentTarget.elements.namedItem("prompt"),m=o.value.trim();m&&(o.value="",yt("chat.send",{text:m}))},r=window.cmuxAcpmuxRegistry?.composerChips??Gv;return(0,B.jsxs)("section",{className:"acpmux-shell",children:[(0,B.jsxs)("header",{className:"acpmux-header",children:[(0,B.jsxs)("div",{children:[(0,B.jsx)("strong",{className:"acpmux-title",children:e.summary?.title||e.summary?.name||"Agent Chat"}),(0,B.jsx)("span",{className:"acpmux-status",children:e.isWorking?"Working":e.connection})]}),(0,B.jsx)("select",{className:"acpmux-session",value:e.sessionId??"",onChange:f=>{yt("chat.select",{sessionId:f.target.value})},children:e.sessions.map(f=>(0,B.jsx)("option",{value:f.sessionId,children:f.title||f.name||f.sessionId.slice(0,8)},f.sessionId))})]}),(0,B.jsx)(Hv,{rows:e.rows,canLoadOlder:e.canLoadOlder,expanded:n,registry:i,onToggleActivity:f=>l(x=>{let o=new Set(x);return o.has(f)?o.delete(f):o.add(f),o})}),e.queue.length>0&&(0,B.jsx)("div",{className:"acpmux-queue",children:e.queue.map(f=>(0,B.jsxs)("span",{className:"acpmux-queued",children:["Queued: ",f.prompt]},f.id))}),e.permission?.pending&&(0,B.jsx)("div",{className:"acpmux-permission",children:(0,B.jsx)(Uv,{permission:e.permission})}),(0,B.jsxs)("form",{className:"acpmux-composer",onSubmit:c,children:[(0,B.jsx)(r,{snapshot:e}),(0,B.jsx)("textarea",{"aria-label":"Prompt",name:"prompt",rows:2,placeholder:"Ask anything"}),(0,B.jsx)("button",{type:"submit",children:"Send"}),(0,B.jsx)("button",{type:"button",className:"acpmux-cancel",onClick:()=>{yt("chat.cancel")},children:"Stop"})]})]})}var Gx=On(ha(),1);document.documentElement.dataset.cmuxWebviewKind="acpmux-agent-session";(0,Ux.createRoot)(document.getElementById("root")).render((0,Gx.jsx)(Hx,{})); +\`\`\``),l({id:`synthetic-assistant-${a}`,kind:"assistant",text:u}),l({id:`synthetic-end-${a}`,kind:"turnSummary",durationMs:1e3,toolCount:0,status:"completed"})}return t}var Mv=30;function Cv(){return new Promise(e=>requestAnimationFrame(e))}function Ox(e){let t=[],n=16.666666666666668,l=!1,i=0,a=()=>t.length<2?{running:l,frames:0}:{running:l,rows:e.rowCount(),...kx(t,n)};return{async seedRows(u=5e3){I.enable();let s=Bx(Math.max(3,Math.floor(u))),c=performance.now(),r=I.nextCommit();e.replaceRows(s);let f=await r;return{rows:s.length,commit_ms:f===void 0?null:Xe(f-c)}},async startFling(u=3,s={}){I.enable();let c=document.querySelector(".acpmux-scroll");if(!c)return{error:"no transcript"};let r=++i,f=Math.max(.1,u)*1e3;t=[],l=!0,I.resetFrames(),c.scrollTop=c.scrollHeight;let x=(async()=>{let o=[];for(let S=0;S0?s.nominal_ms:Math.max(1,Fx(o.slice(1).map((S,v)=>S-o[v]))),c.scrollTop=c.scrollHeight;let m=c.scrollTop;I.resetFrames(),await new Promise(S=>{let v,A=d=>{if(r!==i)return S();v??=d,t.push(d);let h=Math.min(1,(d-v)/f);c.scrollTop=m*(1-h),I.markFrame(d,Dx(I.mountedTop,I.mountedBottom,c.scrollTop,c.clientHeight,c.scrollHeight)),h<1?requestAnimationFrame(A):S()};requestAnimationFrame(A)}),r===i&&(l=!1)})();return s.wait?(await x,a()):{started:!0,rows:e.rowCount(),seconds:f/1e3}},flingStats:a,perfStats(u={}){return I.enable(),{running:l,...I.stats(u.raw===!0)}},typingStats(){return I.enable(),Tx(I.typing)},resetTyping(){return I.enable(),I.typing.length=0,{keys:0}}}}var Fv=()=>({requestFrame:e=>requestAnimationFrame(e),cancelFrame:e=>cancelAnimationFrame(e),setTimer:(e,t)=>setTimeout(e,t),clearTimer:e=>clearTimeout(e)}),is=class e{constructor(t,n=Fv()){this.report=t;this.clock=n}report;clock;static settleMs=250;static maximumFrames=640;intervals=[];lastFrame;frame;settle;scrolled(){this.frame===void 0&&(this.frame=this.clock.requestFrame(this.tick)),this.settle!==void 0&&this.clock.clearTimer(this.settle),this.settle=this.clock.setTimer(this.finish,e.settleMs)}stop(){this.frame!==void 0&&this.clock.cancelFrame(this.frame),this.settle!==void 0&&this.clock.clearTimer(this.settle),this.reset()}tick=t=>{this.lastFrame!==void 0&&this.intervals.length{this.frame!==void 0&&this.clock.cancelFrame(this.frame);let t=this.intervals;this.reset(),t.length&&this.report(t)};reset(){this.intervals=[],this.lastFrame=void 0,this.frame=void 0,this.settle=void 0}};var B=On(ha(),1);function yt(e,t={}){let n=window.cmuxAcpmuxActions?.[e];if(n)return n(t);let l=window.webkit?.messageHandlers?.agentSession;return l?Promise.resolve(l.postMessage({id:crypto.randomUUID(),method:e,params:t})).then(i=>{if(!i.ok)throw new Error(i.error?.userMessage??"Request failed");return i.value}):Promise.reject(new Error("Native bridge is unavailable"))}function ii(e,t){return e?.length?e.map((n,l)=>{if(n.type==="codespan")return(0,B.jsx)("code",{children:n.text},l);if(n.type==="link"){let i=yo(n.href);return i?(0,B.jsx)("a",{href:i,rel:"noreferrer",children:ii(n.tokens,n.text)},l):n.text}return"tokens"in n?(0,B.jsx)(z.default.Fragment,{children:ii(n.tokens,"text"in n?n.text:n.raw??"")},l):n.raw??("text"in n?n.text:"")}):t}function Tv({source:e}){return(0,B.jsx)(B.Fragment,{children:ns(e).map((t,n)=>t.type==="code"?(0,B.jsx)("pre",{children:(0,B.jsx)("code",{children:t.text})},n):t.type==="heading"?(0,B.jsx)("div",{className:`acpmux-heading acpmux-heading-${t.depth}`,children:ii(t.tokens,t.text)},n):t.type==="paragraph"||t.type==="text"?(0,B.jsx)("p",{children:ii(t.tokens,t.text)},n):t.type==="list"?(0,B.jsx)("ul",{children:t.items.map((l,i)=>(0,B.jsx)("li",{children:ii(l.tokens,l.text)},i))},n):t.type==="blockquote"?(0,B.jsx)("blockquote",{children:ii(t.tokens,t.text)},n):t.type==="hr"?(0,B.jsx)("hr",{},n):(0,B.jsx)("p",{children:t.raw},n))})}var _x=(0,z.memo)(function({row:t}){return(0,B.jsx)("div",{className:`acpmux-markdown ${t.kind==="user"?"acpmux-user-bubble":""}`,children:(0,B.jsx)(Tv,{source:t.text??""})})},(e,t)=>e.row.id===t.row.id&&e.row.version===t.row.version),Bv=(0,z.memo)(function({row:t,onToggleActivity:n,expanded:l}){return(0,B.jsxs)("div",{className:"acpmux-activity",children:[(0,B.jsxs)("button",{className:"acpmux-activity-toggle","aria-expanded":l,onClick:()=>n(t.id),children:[l?"\u2304":"\u203A"," Worked with ",t.toolCount??0," tool calls"]}),l&&(0,B.jsx)("div",{className:"acpmux-activity-items",children:(t.items??[]).map(i=>(0,B.jsxs)("div",{className:"acpmux-activity-item",children:[(0,B.jsx)("span",{className:"acpmux-glyph",children:i.kind==="tool"?"\u25A3":"\u2726"}),i.text,i.tool?.output&&(0,B.jsx)("pre",{children:i.tool.output})]},`${t.id}-${i.text}`))})]})},(e,t)=>e.row.id===t.row.id&&e.row.version===t.row.version&&e.expanded===t.expanded),Ov=(0,z.memo)(function({row:t}){return(0,B.jsx)("div",{className:"acpmux-summary",children:`Worked for ${Math.round((t.durationMs??0)/1e3)}s \xB7 ${t.toolCount??0} tool calls`})},(e,t)=>e.row.id===t.row.id&&e.row.version===t.row.version),us=(0,z.memo)(function({row:t}){return(0,B.jsx)("div",{className:"acpmux-muted",children:t.text})},(e,t)=>e.row.id===t.row.id&&e.row.version===t.row.version),Rv=(0,z.memo)(function({row:t}){let n=t.permission;return(0,B.jsxs)("div",{className:"acpmux-permission-card",children:[(0,B.jsx)("strong",{children:n?.title||"Permission required"}),(0,B.jsx)("div",{className:"acpmux-permission-buttons",children:n?.options.map(l=>(0,B.jsx)("button",{onClick:()=>{yt("chat.permission",{permissionId:n.permissionId,optionId:l.id})},children:l.name},l.id))})]})},(e,t)=>e.row.id===t.row.id&&e.row.version===t.row.version),zv=(0,z.memo)(function({row:t}){let n=(t.items??[]).filter(l=>l.tool?.kind==="edit"||l.tool?.kind==="fileChange");return(0,B.jsxs)("div",{className:"acpmux-edited-files",children:[(0,B.jsx)("strong",{children:"Edited files"}),n.map(l=>(0,B.jsxs)("div",{children:["\u25A4 ",l.tool?.inputSummary||l.text]},l.tool?.id||l.text))]})},(e,t)=>e.row.id===t.row.id&&e.row.version===t.row.version),Fo={user:_x,assistant:_x,activity:Bv,editedFiles:zv,turnSummary:Ov,notice:us,plan:us,typing:us,permission:Rv};function wv({row:e,kind:t,index:n,setSize:l,top:i,rowWidth:a,expanded:u,observer:s,report:c,children:r}){let f=(0,z.useRef)(null);return(0,z.useLayoutEffect)(()=>{let x=f.current;if(!(!x||!s))return s.observe(x),()=>s.unobserve(x)},[s]),(0,z.useLayoutEffect)(()=>{let x=f.current;x&&c(e.id,e.version,x.getBoundingClientRect().height)},[e.id,e.version,a,u,c]),(0,B.jsx)("article",{ref:f,"data-row-id":e.id,className:`acpmux-row acpmux-${t}`,"aria-label":_v(t),"aria-posinset":n+1,"aria-setsize":l,style:{transform:`translateY(${i}px)`},children:r})}var _v=e=>e==="user"?"You":e==="assistant"?"Agent":void 0,Lx=e=>e.kind==="activity"&&e.items?.some(t=>t.tool?.kind==="edit"||t.tool?.kind==="fileChange")?"editedFiles":e.kind,Mo=()=>({...Fo,...window.cmuxAcpmuxRegistry}),qx=(e,t)=>({top:e.scrollTop,atLatest:e.scrollTop>=t-e.clientHeight-1}),Lv=2,qv=4;function Hv({rows:e,onToggleActivity:t,expanded:n,registry:l=Fo,canLoadOlder:i=!1}){let a=I.enabled?performance.now():0,[u,s]=(0,z.useState)({top:0,delta:0}),[c,r]=(0,z.useState)(600),f=(0,z.useRef)(null),[x,o]=(0,z.useState)(760),[m,S]=(0,z.useState)(new Map),v=(0,z.useRef)(new Map),A=(0,z.useRef)(ti(x));A.current=ti(x);let d=(0,z.useRef)(e);d.current=e;let h=(0,z.useCallback)((C,N,O)=>{O>0&&v.current.set(C,{version:N,width:A.current,height:O})},[]),p=(0,z.useCallback)(()=>{if(!v.current.size)return;let C=v.current;v.current=new Map,S(N=>{let O;for(let[q,J]of C){let P=N.get(q);P&&P.version===J.version&&P.width===J.width&&Math.abs(P.height-J.height)<.5||(O??=new Map(N),O.set(q,J))}return O??N})},[]),g=(0,z.useMemo)(()=>typeof ResizeObserver>"u"?void 0:new ResizeObserver(C=>{for(let N of C??[]){let O=N.target,q=d.current[Number(O.getAttribute("aria-posinset"))-1];q&&q.id===O.dataset.rowId&&h(q.id,q.version,O.getBoundingClientRect().height)}(0,Co.flushSync)(p)}),[h,p]);(0,z.useEffect)(()=>()=>g?.disconnect(),[g]),(0,z.useEffect)(()=>{let C=T.current;if(C.size<=e.length&&m.size<=e.length)return;let N=new Set(e.map(O=>O.id));for(let O of C.keys())N.has(O)||C.delete(O);S(O=>[...O.keys()].every(q=>N.has(q))?O:new Map([...O].filter(([q])=>N.has(q))))},[e,m]),(0,z.useLayoutEffect)(p);let M=(0,z.useRef)(!1),T=(0,z.useRef)(new Map);(0,z.useEffect)(()=>{let C=f.current;if(!C)return;let N=new ResizeObserver(()=>{r(C.clientHeight),o(C.clientWidth)});return N.observe(C),o(C.clientWidth),()=>N.disconnect()},[]);let F=(0,z.useRef)(null),k=(0,z.useRef)({top:0,atLatest:!1}),y=(0,z.useMemo)(()=>{let C=I.enabled?performance.now():0;return{layout:Ex(e,ti(x),T.current,(O,q)=>l[Lx(O)]?.measure?.(O,q)),ms:I.enabled?performance.now()-C:0}},[e,x,l]),E=(0,z.useMemo)(()=>{let C=I.enabled?performance.now():0,N=ti(x);return{layout:m.size===0?y.layout:Nx(y.layout,q=>{let J=m.get(e[q].id);return J&&J.version===e[q].version&&J.width===N?J.height:void 0}),ms:I.enabled?performance.now()-C:0}},[y,m,e,x]),D=E.layout,U=(0,z.useRef)(null),H=(0,z.useRef)(null),ie=Math.min(Math.abs(u.delta)*Lv,c*qv),j=vo(D,u.delta<0?u.top-ie:u.top,c+ie);(0,z.useLayoutEffect)(()=>{let C=j.last-1;I.mountedTop=j.last>j.first?D.tops[j.first]:0,I.mountedBottom=j.last>j.first?D.tops[C]+D.heights[C]:0;let N=U.current!==E;U.current=E;let O=H.current!==y;H.current=y;let q=(N?E.ms:0)+(O?y.ms:0);if(I.enabled&&N&&I.addLayout(q),I.enabled&&a>0){let J=performance.now();I.commit(J-a,q,I.mountedTop,I.mountedBottom,J)}}),(0,z.useLayoutEffect)(()=>{let C=F.current,N=f.current;if(C&&N&&C.tops.length===D.tops.length){let O=N.scrollTop,q=O=N.scrollHeight-N.clientHeight-.5,J=Math.abs(O-k.current.top)<=.5,P=q?k.current.top:O,Ce=q||J?k.current.atLatest:P>=C.totalHeight-N.clientHeight-1;if(P>0&&M.current&&Ce){let Ze=Math.max(0,D.totalHeight-N.clientHeight);Math.abs(Ze-N.scrollTop)>.5&&(N.scrollTop=Ze)}else if(P>0){let Ze=vo(C,P,0,0).first,Pt=D.tops[Ze]-C.tops[Ze];(q||Math.abs(Pt)>.5)&&(N.scrollTop=P+Pt)}}if(!M.current&&N&&D.totalHeight>N.clientHeight){let O=Math.max(0,D.totalHeight-N.clientHeight);N.scrollTop=O,s({top:O,delta:0}),M.current=!0}F.current=D,N&&(k.current=qx(N,D.totalHeight))},[D,j.first,c]);let oe=(0,z.useMemo)(()=>new is(C=>{yt("pane.framePacing",{intervals:C}).catch(()=>{})}),[]);return(0,z.useEffect)(()=>()=>oe.stop(),[oe]),(0,B.jsx)("div",{ref:f,className:"acpmux-scroll",role:"feed","aria-label":"Transcript",onScroll:C=>{oe.scrolled();let N=C.currentTarget.scrollTop;k.current=qx(C.currentTarget,D.totalHeight),(0,Co.flushSync)(()=>s(O=>({top:N,delta:N-O.top})))},children:(0,B.jsx)("div",{className:"acpmux-spacer",style:{height:D.totalHeight},children:(0,B.jsx)("div",{className:"acpmux-thread",children:e.slice(j.first,j.last).map((C,N)=>{let O=j.first+N,q=Lx(C),J=l[q]??us,P=n.has(C.id);return(0,B.jsx)(wv,{row:C,kind:q,index:O,setSize:i?-1:e.length,top:D.tops[O],rowWidth:ti(x),expanded:P,observer:g,report:h,children:(0,B.jsx)(J,{row:C,onToggleActivity:t,expanded:P})},C.id)})})})})}function Uv({permission:e}){return(0,B.jsxs)("div",{className:"acpmux-permission-card",children:[(0,B.jsx)("strong",{children:e.title||"Permission required"}),(0,B.jsx)("div",{className:"acpmux-permission-buttons",children:e.options.map(t=>(0,B.jsx)("button",{onClick:()=>{yt("chat.permission",{permissionId:e.permissionId,optionId:t.id})},children:t.name},t.id))})]})}function Gv({snapshot:e}){let t=e.catalog.find(i=>i.id===e.summary?.harness)?.models??[],n=e.summary?.modes?.availableModes??[],l=e.summary?.configOptions?.find(i=>i.category==="thought_level"||i.id==="effort"||i.id==="reasoning_effort");return(0,B.jsxs)("div",{className:"acpmux-chips",children:[(0,B.jsx)("select",{className:"acpmux-model","aria-label":"Model",value:e.summary?.model??"",onChange:i=>{yt("chat.model",{modelId:i.target.value})},children:t.map(i=>(0,B.jsx)("option",{value:i.id,children:i.name||i.id},i.id))}),(0,B.jsx)("select",{className:"acpmux-mode","aria-label":"Mode",value:e.summary?.modes?.currentModeId??"",onChange:i=>{yt("chat.mode",{modeId:i.target.value})},children:n.map(i=>(0,B.jsx)("option",{value:i.id,children:i.name||i.id},i.id))}),l&&(0,B.jsx)("select",{className:"acpmux-effort","aria-label":"Effort",value:l.currentValue??"",onChange:i=>{yt("chat.effort",{configId:l.id,value:i.target.value})},children:l.options.map(i=>(0,B.jsx)("option",{value:i.value,children:i.name||i.value},i.value))})]})}function Hx(){let[e,t]=(0,z.useState)({type:"snapshot",protocolVersion:1,rows:[],sessions:[],connection:"connecting",isWorking:!1,queue:[],catalog:[],canLoadOlder:!1}),[n,l]=(0,z.useState)(new Set),[i,a]=(0,z.useState)(Fo),u=(0,z.useRef)(new Map),s=(0,z.useRef)(void 0);(0,z.useEffect)(()=>{window.React=z.default,window.cmuxAcpmuxRegistry={register(A,d,h){let p=window.cmuxAcpmuxRegistry;p[A]===d&&(!h?.measure||h.measure===d.measure)||(h?.measure&&(d.measure=h.measure),p[A]=d,a(Mo()))},configure(){a(Mo())}},window.cmuxAcpmuxBridge={receive(A){if(A.protocolVersion!==1)return;let d=bx(u.current,A.rows);u.current=new Map(A.rows.map(h=>[h.id,h])),t(A)},applyTheme(A){v1(A)},applyCustomization(A){if("themeCSS"in A){let d=document.getElementById("acpmux-user-theme");d||(d=document.createElement("style"),d.id="acpmux-user-theme",document.head.append(d)),d.textContent=A.themeCSS??""}if(A.registryJS)try{(0,eval)(A.registryJS),a(Mo())}catch{}A.layout&&window.cmuxAcpmuxRegistry?.configure(A.layout)}},window.cmuxAcpmuxDebug=Ox({replaceRows(A){u.current=new Map(A.map(d=>[d.id,d])),t(d=>({...d,rows:A,connection:"debug",isWorking:!1,canLoadOlder:!1}))},rowCount:()=>u.current.size});let f=!1,x,o=250,m=2e3,S=!1,v=async()=>{try{let A=await yt("ready",S?{reconnect:S}:{});if(f)return;if(A.transport==="mock"){window.cmuxAcpmuxActions=Cx(p=>{u.current=new Map(p.rows.map(g=>[g.id,g])),t(p)});return}if(A.transport!=="acpmux-websocket"||!A.endpoint||!A.token)return;let d=await ls.connect(A,p=>{u.current=new Map(p.rows.map(g=>[g.id,g])),t(p)},()=>{f||(S=!0,s.current=void 0,delete window.cmuxAcpmuxActions,x=window.setTimeout(()=>{v()},o),o=Math.min(o*2,S?m:3e4))});if(f){d.close();return}s.current=d,o=250;let h=p=>p?yt("chat.persistSession",{sessionId:p}).catch(()=>{}):Promise.resolve();window.cmuxAcpmuxActions={"chat.send":async({text:p})=>{let g=await d.ensureSession();return await h(g),d.send(String(p??""))},"chat.cancel":()=>d.cancel(),"chat.permission":({permissionId:p,optionId:g})=>d.permission(String(p),String(g)),"chat.model":({modelId:p})=>d.setModel(String(p)),"chat.mode":({modeId:p})=>d.setMode(String(p)),"chat.effort":({configId:p,value:g})=>d.setConfig(String(p),String(g)),"chat.select":async({sessionId:p})=>h(await d.select(String(p))),"chat.new":async({harness:p})=>h(await d.create(p?String(p):void 0)),"chat.history":()=>d.loadOlder()},d.snapshot()}catch(A){f||(t(d=>({...d,connection:`connecting: ${String(A)}`})),x=window.setTimeout(()=>{v()},o),o=Math.min(o*2,S?m:3e4))}};return v(),()=>{f=!0,x!==void 0&&window.clearTimeout(x),s.current?.close(),s.current=void 0,delete window.cmuxAcpmuxActions}},[]);let c=f=>{f.preventDefault();let o=f.currentTarget.elements.namedItem("prompt"),m=o.value.trim();m&&(o.value="",yt("chat.send",{text:m}))},r=window.cmuxAcpmuxRegistry?.composerChips??Gv;return(0,B.jsxs)("section",{className:"acpmux-shell",children:[(0,B.jsxs)("header",{className:"acpmux-header",children:[(0,B.jsxs)("div",{children:[(0,B.jsx)("strong",{className:"acpmux-title",children:e.summary?.title||e.summary?.name||"Agent Chat"}),(0,B.jsx)("span",{className:"acpmux-status",children:e.isWorking?"Working":e.connection})]}),(0,B.jsx)("select",{className:"acpmux-session",value:e.sessionId??"",onChange:f=>{yt("chat.select",{sessionId:f.target.value})},children:e.sessions.map(f=>(0,B.jsx)("option",{value:f.sessionId,children:f.title||f.name||f.sessionId.slice(0,8)},f.sessionId))})]}),(0,B.jsx)(Hv,{rows:e.rows,canLoadOlder:e.canLoadOlder,expanded:n,registry:i,onToggleActivity:f=>l(x=>{let o=new Set(x);return o.has(f)?o.delete(f):o.add(f),o})}),e.queue.length>0&&(0,B.jsx)("div",{className:"acpmux-queue",children:e.queue.map(f=>(0,B.jsxs)("span",{className:"acpmux-queued",children:["Queued: ",f.prompt]},f.id))}),e.permission?.pending&&(0,B.jsx)("div",{className:"acpmux-permission",children:(0,B.jsx)(Uv,{permission:e.permission})}),(0,B.jsxs)("form",{className:"acpmux-composer",onSubmit:c,children:[(0,B.jsx)(r,{snapshot:e}),(0,B.jsx)("textarea",{"aria-label":"Prompt",name:"prompt",rows:2,placeholder:"Ask anything"}),(0,B.jsx)("button",{type:"submit",children:"Send"}),(0,B.jsx)("button",{type:"button",className:"acpmux-cancel",onClick:()=>{yt("chat.cancel")},children:"Stop"})]})]})}var Gx=On(ha(),1);document.documentElement.dataset.cmuxWebviewKind="acpmux-agent-session";(0,Ux.createRoot)(document.getElementById("root")).render((0,Gx.jsx)(Hx,{})); diff --git a/webviews/src/agent-session/acpmux/App.tsx b/webviews/src/agent-session/acpmux/App.tsx index fc7f228038d9..04920ea3086f 100644 --- a/webviews/src/agent-session/acpmux/App.tsx +++ b/webviews/src/agent-session/acpmux/App.tsx @@ -218,8 +218,10 @@ export function VirtualTranscript({ rows, onToggleActivity, expanded, registry = if (old && node && old.tops.length === layout.tops.length) { // Content that shrank under the viewport has already clamped the live offset to // the new end; the offset recorded before this commit is where the reader was. + // A clamp lands exactly on the scroller's own end, which rounds the layout's + // fractional height, so compare with that rather than allow for the rounding. const live = node.scrollTop; - const clamped = live < scrolledTo.current.top - 0.5 && live >= layout.totalHeight - node.clientHeight - 1; + const clamped = live < scrolledTo.current.top - 0.5 && live >= node.scrollHeight - node.clientHeight - 0.5; // An offset that has not moved since it was recorded was at the latest row if it was // then; a shorter viewport alone would otherwise read as scrolled up. const unmoved = Math.abs(live - scrolledTo.current.top) <= 0.5; diff --git a/webviews/src/agent-session/acpmux/transcript.test.tsx b/webviews/src/agent-session/acpmux/transcript.test.tsx index 2f01612e1177..d410194ea5ce 100644 --- a/webviews/src/agent-session/acpmux/transcript.test.tsx +++ b/webviews/src/agent-session/acpmux/transcript.test.tsx @@ -33,9 +33,11 @@ function fakeViewport(size: { width: number; height: number }) { Object.defineProperty(prototype, "clientHeight", { configurable: true, get(this: HTMLElement) { return isScroller(this) ? size.height : 0; } }); Object.defineProperty(prototype, "clientWidth", { configurable: true, get(this: HTMLElement) { return isScroller(this) ? size.width : 0; } }); // Like a browser, the offset clamps to the content once it lays out again. - const maximum = (node: HTMLElement) => Math.max(0, parseFloat(node.querySelector(".acpmux-spacer")?.style.height || "0") - size.height); + const contentHeight = (node: HTMLElement) => parseFloat(node.querySelector(".acpmux-spacer")?.style.height || "0"); + const maximum = (node: HTMLElement) => Math.max(0, contentHeight(node) - size.height); + Object.defineProperty(prototype, "scrollHeight", { configurable: true, get(this: HTMLElement) { return isScroller(this) ? Math.max(contentHeight(this), size.height) : 0; } }); Object.defineProperty(prototype, "scrollTop", { configurable: true, get(this: HTMLElement) { const offset = Math.min(offsets.get(this) ?? 0, maximum(this)); offsets.set(this, offset); return offset; }, set(this: HTMLElement, value: number) { offsets.set(this, Math.max(0, Math.min(value, maximum(this)))); } }); - return () => { for (const key of ["clientHeight", "clientWidth", "scrollTop"]) delete (prototype as unknown as Record)[key]; }; + return () => { for (const key of ["clientHeight", "clientWidth", "scrollHeight", "scrollTop"]) delete (prototype as unknown as Record)[key]; }; } const rows: AcpmuxRow[] = Array.from({ length: 200 }, (_, index) => ({ id: `row-${index}`, version: 1, at: index, kind: index % 2 ? "assistant" : "user", text: `message ${index}` })); @@ -316,6 +318,42 @@ describe("acpmux measured rows", () => { } }); + /// A reader near the end scrolls up, and before that scroll's event a row below draws shorter. + /// The offset lands just under the new end without the browser clamping it, so the reader stays. + test("a small scroll-up at the latest row survives a row below drawing shorter", async () => { + const restore = fakeViewport({ width: 760, height: 600 }); + const prototype = dom.window.HTMLElement.prototype; + const original = prototype.getBoundingClientRect; + let lastHeight = 120; + prototype.getBoundingClientRect = function (this: HTMLElement) { + const height = this.classList.contains("acpmux-row") && this.getAttribute("aria-posinset") === "200" ? lastHeight : 0; + return { x: 0, y: 0, top: 0, left: 0, right: 0, bottom: height, width: 0, height, toJSON() { return {}; } } as DOMRect; + }; + const root = createRoot(dom.window.document.getElementById("root")!); + const reportLatest = async () => { + const latest = dom.window.document.querySelector('.acpmux-row[aria-posinset="200"]')!; + await act(async () => { for (const callback of resizeCallbacks) (callback as (entries: { target: Element }[]) => void)([{ target: latest }]); }); + }; + try { + await act(async () => root.render(createElement(VirtualTranscript, { rows, onToggleActivity: () => {}, expanded: new Set() }))); + await reportLatest(); + const scroller = dom.window.document.querySelector(".acpmux-scroll") as HTMLElement; + const spacer = dom.window.document.querySelector(".acpmux-spacer") as HTMLElement; + const end = parseFloat(spacer.style.height) - 600; + expect(scroller.scrollTop).toBe(end); + // Up by 10.75px; the latest row then draws 10px shorter, so the new end is 0.75px below the reader. + scroller.scrollTop = end - 10.75; + lastHeight -= 10; + await reportLatest(); + expect(parseFloat(spacer.style.height) - 600).toBe(end - 10); + expect(scroller.scrollTop).toBe(end - 10.75); + } finally { + await act(async () => root.unmount()); + prototype.getBoundingClientRect = original; + restore(); + } + }); + /// Rows that draw shorter than estimated shrink the content under a viewport at the latest row, /// and the browser clamps the offset before the layout effect sees it. test("opened at the latest row, it stays there as rows draw shorter than estimated", async () => {