@ingit/cli-darwin-x64 0.2.2 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/assets/SettingsDialog-DRhvy5Hz.js +7 -0
- package/client/assets/index-Dbzf1_eA.js +679 -0
- package/client/index.html +1 -1
- package/ingit +0 -0
- package/libziggit.dylib +0 -0
- package/package.json +1 -1
- package/client/assets/SettingsDialog-Cp20_664.js +0 -7
- package/client/assets/index-CCpdvVsv.js +0 -615
|
@@ -0,0 +1,679 @@
|
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),u=o(((e,t)=>{t.exports=l()})),d=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function ee(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function E(e,t){return ee(e.type,t,e.props)}function D(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function te(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var ne=/\/+/g;function re(e,t){return typeof e==`object`&&e&&e.key!=null?te(``+e.key):t.toString(36)}function ie(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function ae(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,ae(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+re(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(ne,`$&/`)+`/`),ae(o,r,i,``,function(e){return e})):o!=null&&(D(o)&&(o=E(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(ne,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+re(a,u),c+=ae(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+re(a,u++),c+=ae(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return ae(ie(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function oe(e,t,n){if(e==null)return e;var r=[],i=0;return ae(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function se(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var O=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},ce={map:oe,forEach:function(e,t,n){oe(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return oe(e,function(){t++}),t},toArray:function(e){return oe(e,function(e){return e})||[]},only:function(e){if(!D(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=ce,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return ee(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return ee(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=D,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:se}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,O)}catch(e){O(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.8`})),f=o(((e,t)=>{t.exports=d()})),p=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,D());else{var t=n(l);t!==null&&re(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function ee(){return g?!0:!(e.unstable_now()-T<w)}function E(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&ee());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&re(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?D():S=!1}}}var D;if(typeof y==`function`)D=function(){y(E)};else if(typeof MessageChannel<`u`){var te=new MessageChannel,ne=te.port2;te.port1.onmessage=E,D=function(){ne.postMessage(null)}}else D=function(){_(E,0)};function re(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,re(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,D()))),r},e.unstable_shouldYield=ee,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),m=o(((e,t)=>{t.exports=p()})),h=o((e=>{var t=f();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.8`})),g=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=h()})),_=o((e=>{var t=m(),n=f(),r=g();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}var p=Object.assign,h=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),ee=Symbol.for(`react.suspense_list`),E=Symbol.for(`react.memo`),D=Symbol.for(`react.lazy`),te=Symbol.for(`react.activity`),ne=Symbol.for(`react.memo_cache_sentinel`),re=Symbol.iterator;function ie(e){return typeof e!=`object`||!e?null:(e=re&&e[re]||e[`@@iterator`],typeof e==`function`?e:null)}var ae=Symbol.for(`react.client.reference`);function oe(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ae?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case ee:return`SuspenseList`;case te:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case E:return t=e.displayName||null,t===null?oe(e.type)||`Memo`:t;case D:t=e._payload,e=e._init;try{return oe(e(t))}catch{}}return null}var se=Array.isArray,O=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ce=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,le={pending:!1,data:null,method:null,action:null},ue=[],de=-1;function fe(e){return{current:e}}function pe(e){0>de||(e.current=ue[de],ue[de]=null,de--)}function k(e,t){de++,ue[de]=e.current,e.current=t}var me=fe(null),he=fe(null),ge=fe(null),_e=fe(null);function ve(e,t){switch(k(ge,t),k(he,e),k(me,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Zd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Zd(t),e=Qd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}pe(me),k(me,e)}function ye(){pe(me),pe(he),pe(ge)}function be(e){e.memoizedState!==null&&k(_e,e);var t=me.current,n=Qd(t,e.type);t!==n&&(k(he,e),k(me,n))}function xe(e){he.current===e&&(pe(me),pe(he)),_e.current===e&&(pe(_e),op._currentValue=le)}var Se,Ce;function we(e){if(Se===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Se=t&&t[1]||``,Ce=-1<e.stack.indexOf(`
|
|
2
|
+
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
3
|
+
`+Se+e+Ce}var Te=!1;function Ee(e,t){if(!e||Te)return``;Te=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
4
|
+
`),l=s.split(`
|
|
5
|
+
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
|
|
6
|
+
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Te=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?we(n):``}function De(e,t){switch(e.tag){case 26:case 27:case 5:return we(e.type);case 16:return we(`Lazy`);case 13:return e.child!==t&&t!==null?we(`Suspense Fallback`):we(`Suspense`);case 19:return we(`SuspenseList`);case 0:case 15:return Ee(e.type,!1);case 11:return Ee(e.type.render,!1);case 1:return Ee(e.type,!0);case 31:return we(`Activity`);default:return``}}function Oe(e){try{var t=``,n=null;do t+=De(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
7
|
+
Error generating stack: `+e.message+`
|
|
8
|
+
`+e.stack}}var ke=Object.prototype.hasOwnProperty,Ae=t.unstable_scheduleCallback,je=t.unstable_cancelCallback,Me=t.unstable_shouldYield,Ne=t.unstable_requestPaint,A=t.unstable_now,Pe=t.unstable_getCurrentPriorityLevel,Fe=t.unstable_ImmediatePriority,Ie=t.unstable_UserBlockingPriority,Le=t.unstable_NormalPriority,Re=t.unstable_LowPriority,ze=t.unstable_IdlePriority,Be=t.log,Ve=t.unstable_setDisableYieldValue,He=null,Ue=null;function We(e){if(typeof Be==`function`&&Ve(e),Ue&&typeof Ue.setStrictMode==`function`)try{Ue.setStrictMode(He,e)}catch{}}var Ge=Math.clz32?Math.clz32:Je,Ke=Math.log,qe=Math.LN2;function Je(e){return e>>>=0,e===0?32:31-(Ke(e)/qe|0)|0}var Ye=256,Xe=262144,Ze=4194304;function Qe(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 $e(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Qe(n))):i=Qe(o):i=Qe(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Qe(n))):i=Qe(o)):i=Qe(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function et(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function tt(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 nt(){var e=Ze;return Ze<<=1,!(Ze&62914560)&&(Ze=4194304),e}function rt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function it(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function at(e,t,n,r,i,a){var o=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,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Ge(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&ot(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function ot(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ge(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function st(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ge(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function ct(e,t){var n=t&-t;return n=n&42?1:lt(n),(n&(e.suspendedLanes|t))===0?n:0}function lt(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function ut(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function dt(){var e=ce.p;return e===0?(e=window.event,e===void 0?32:Sp(e.type)):e}function ft(e,t){var n=ce.p;try{return ce.p=e,t()}finally{ce.p=n}}var j=Math.random().toString(36).slice(2),pt=`__reactFiber$`+j,mt=`__reactProps$`+j,M=`__reactContainer$`+j,ht=`__reactEvents$`+j,gt=`__reactListeners$`+j,_t=`__reactHandles$`+j,vt=`__reactResources$`+j,yt=`__reactMarker$`+j;function bt(e){delete e[pt],delete e[mt],delete e[ht],delete e[gt],delete e[_t]}function xt(e){var t=e[pt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[M]||n[pt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=xf(e);e!==null;){if(n=e[pt])return n;e=xf(e)}return t}e=n,n=e.parentNode}return null}function St(e){if(e=e[pt]||e[M]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ct(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function wt(e){var t=e[vt];return t||=e[vt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function N(e){e[yt]=!0}var P=new Set,Tt={};function Et(e,t){Dt(e,t),Dt(e+`Capture`,t)}function Dt(e,t){for(Tt[e]=t,e=0;e<t.length;e++)P.add(t[e])}var Ot=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),kt={},At={};function jt(e){return ke.call(At,e)?!0:ke.call(kt,e)?!1:Ot.test(e)?At[e]=!0:(kt[e]=!0,!1)}function Mt(e,t,n){if(jt(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function Nt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function Pt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function Ft(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function It(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Lt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function F(e){if(!e._valueTracker){var t=It(e)?`checked`:`value`;e._valueTracker=Lt(e,t,``+e[t])}}function Rt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=It(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function zt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Bt=/[\n"\\]/g;function Vt(e){return e.replace(Bt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Ht(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Ft(t)):e.value!==``+Ft(t)&&(e.value=``+Ft(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Wt(e,o,Ft(n)):Wt(e,o,Ft(t)),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=``+Ft(s):e.removeAttribute(`name`)}function Ut(e,t,n,r,i,a,o,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)){F(e);return}n=n==null?``:``+Ft(n),t=t==null?n:``+Ft(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),F(e)}function Wt(e,t,n){t===`number`&&zt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Gt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Ft(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Kt(e,t,n){if(t!=null&&(t=``+Ft(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Ft(n)}function qt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(se(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Ft(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),F(e)}function Jt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Yt=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function Xt(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Yt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Zt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Xt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Xt(e,o,t[o])}function Qt(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var $t=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),en=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function tn(e){return en.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function nn(){}var rn=null;function an(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var on=null,sn=null;function cn(e){var t=St(e);if(t&&(e=t.stateNode)){var n=e[mt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Ht(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Vt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[mt]||null;if(!a)throw Error(i(90));Ht(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Rt(r)}break a;case`textarea`:Kt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Gt(e,!!n.multiple,t,!1)}}}var ln=!1;function un(e,t,n){if(ln)return e(t,n);ln=!0;try{return e(t)}finally{if(ln=!1,(on!==null||sn!==null)&&(ku(),on&&(t=on,e=sn,sn=on=null,cn(t),e)))for(t=0;t<e.length;t++)cn(e[t])}}function dn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[mt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var fn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),pn=!1;if(fn)try{var mn={};Object.defineProperty(mn,"passive",{get:function(){pn=!0}}),window.addEventListener(`test`,mn,mn),window.removeEventListener(`test`,mn,mn)}catch{pn=!1}var hn=null,gn=null,_n=null;function vn(){if(_n)return _n;var e,t=gn,n=t.length,r,i=`value`in hn?hn.value:hn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return _n=i.slice(e,1<r?1-r:void 0)}function yn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function bn(){return!0}function xn(){return!1}function Sn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?bn:xn,this.isPropagationStopped=xn,this}return p(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=bn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=bn)},persist:function(){},isPersistent:bn}),t}var Cn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},wn=Sn(Cn),Tn=p({},Cn,{view:0,detail:0}),En=Sn(Tn),Dn,On,kn,An=p({},Tn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Vn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==kn&&(kn&&e.type===`mousemove`?(Dn=e.screenX-kn.screenX,On=e.screenY-kn.screenY):On=Dn=0,kn=e),Dn)},movementY:function(e){return`movementY`in e?e.movementY:On}}),jn=Sn(An),Mn=Sn(p({},An,{dataTransfer:0})),Nn=Sn(p({},Tn,{relatedTarget:0})),Pn=Sn(p({},Cn,{animationName:0,elapsedTime:0,pseudoElement:0})),Fn=Sn(p({},Cn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),In=Sn(p({},Cn,{data:0})),Ln={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Rn={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},zn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Bn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=zn[e])?!!t[e]:!1}function Vn(){return Bn}var Hn=Sn(p({},Tn,{key:function(e){if(e.key){var t=Ln[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=yn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Rn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Vn,charCode:function(e){return e.type===`keypress`?yn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?yn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Un=Sn(p({},An,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Wn=Sn(p({},Tn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Vn})),Gn=Sn(p({},Cn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Kn=Sn(p({},An,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),qn=Sn(p({},Cn,{newState:0,oldState:0})),Jn=[9,13,27,32],Yn=fn&&`CompositionEvent`in window,Xn=null;fn&&`documentMode`in document&&(Xn=document.documentMode);var Zn=fn&&`TextEvent`in window&&!Xn,Qn=fn&&(!Yn||Xn&&8<Xn&&11>=Xn),$n=` `,er=!1;function tr(e,t){switch(e){case`keyup`:return Jn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function nr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var rr=!1;function ir(e,t){switch(e){case`compositionend`:return nr(t);case`keypress`:return t.which===32?(er=!0,$n):null;case`textInput`:return e=t.data,e===$n&&er?null:e;default:return null}}function ar(e,t){if(rr)return e===`compositionend`||!Yn&&tr(e,t)?(e=vn(),_n=gn=hn=null,rr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return Qn&&t.locale!==`ko`?null:t.data;default:return null}}var or={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function sr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!or[e.type]:t===`textarea`}function cr(e,t,n,r){on?sn?sn.push(r):sn=[r]:on=r,t=Id(t,`onChange`),0<t.length&&(n=new wn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var lr=null,ur=null;function dr(e){kd(e,0)}function fr(e){if(Rt(Ct(e)))return e}function pr(e,t){if(e===`change`)return t}var mr=!1;if(fn){var hr;if(fn){var gr=`oninput`in document;if(!gr){var _r=document.createElement(`div`);_r.setAttribute(`oninput`,`return;`),gr=typeof _r.oninput==`function`}hr=gr}else hr=!1;mr=hr&&(!document.documentMode||9<document.documentMode)}function vr(){lr&&(lr.detachEvent(`onpropertychange`,yr),ur=lr=null)}function yr(e){if(e.propertyName===`value`&&fr(ur)){var t=[];cr(t,ur,e,an(e)),un(dr,t)}}function br(e,t,n){e===`focusin`?(vr(),lr=t,ur=n,lr.attachEvent(`onpropertychange`,yr)):e===`focusout`&&vr()}function xr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return fr(ur)}function Sr(e,t){if(e===`click`)return fr(t)}function Cr(e,t){if(e===`input`||e===`change`)return fr(t)}function wr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Tr=typeof Object.is==`function`?Object.is:wr;function Er(e,t){if(Tr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!ke.call(t,i)||!Tr(e[i],t[i]))return!1}return!0}function Dr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Or(e,t){var n=Dr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Dr(n)}}function kr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?kr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ar(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=zt(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=zt(e.document)}return t}function jr(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 Mr=fn&&`documentMode`in document&&11>=document.documentMode,Nr=null,Pr=null,Fr=null,Ir=!1;function Lr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ir||Nr==null||Nr!==zt(r)||(r=Nr,`selectionStart`in r&&jr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Fr&&Er(Fr,r)||(Fr=r,r=Id(Pr,`onSelect`),0<r.length&&(t=new wn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Nr)))}function Rr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var zr={animationend:Rr(`Animation`,`AnimationEnd`),animationiteration:Rr(`Animation`,`AnimationIteration`),animationstart:Rr(`Animation`,`AnimationStart`),transitionrun:Rr(`Transition`,`TransitionRun`),transitionstart:Rr(`Transition`,`TransitionStart`),transitioncancel:Rr(`Transition`,`TransitionCancel`),transitionend:Rr(`Transition`,`TransitionEnd`)},Br={},Vr={};fn&&(Vr=document.createElement(`div`).style,`AnimationEvent`in window||(delete zr.animationend.animation,delete zr.animationiteration.animation,delete zr.animationstart.animation),`TransitionEvent`in window||delete zr.transitionend.transition);function Hr(e){if(Br[e])return Br[e];if(!zr[e])return e;var t=zr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Vr)return Br[e]=t[n];return e}var Ur=Hr(`animationend`),Wr=Hr(`animationiteration`),Gr=Hr(`animationstart`),Kr=Hr(`transitionrun`),qr=Hr(`transitionstart`),Jr=Hr(`transitioncancel`),Yr=Hr(`transitionend`),Xr=new Map,Zr=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);Zr.push(`scrollEnd`);function Qr(e,t){Xr.set(e,t),Et(t,[e])}var $r=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},ei=[],ti=0,ni=0;function ri(){for(var e=ti,t=ni=ti=0;t<e;){var n=ei[t];ei[t++]=null;var r=ei[t];ei[t++]=null;var i=ei[t];ei[t++]=null;var a=ei[t];if(ei[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&si(n,i,a)}}function ii(e,t,n,r){ei[ti++]=e,ei[ti++]=t,ei[ti++]=n,ei[ti++]=r,ni|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function ai(e,t,n,r){return ii(e,t,n,r),ci(e)}function oi(e,t){return ii(e,null,null,t),ci(e)}function si(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Ge(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ci(e){if(50<bu)throw bu=0,xu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var li={};function ui(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function di(e,t,n,r){return new ui(e,t,n,r)}function fi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function pi(e,t){var n=e.alternate;return n===null?(n=di(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function mi(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function hi(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)fi(e)&&(s=1);else if(typeof e==`string`)s=Qf(e,n,me.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case te:return e=di(31,n,t,a),e.elementType=te,e.lanes=o,e;case y:return gi(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=di(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=di(13,n,t,a),e.elementType=T,e.lanes=o,e;case ee:return e=di(19,n,t,a),e.elementType=ee,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case E:s=14;break a;case D:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=di(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function gi(e,t,n,r){return e=di(7,e,r,t),e.lanes=n,e}function _i(e,t,n){return e=di(6,e,null,t),e.lanes=n,e}function vi(e){var t=di(18,null,null,0);return t.stateNode=e,t}function yi(e,t,n){return t=di(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var bi=new WeakMap;function xi(e,t){if(typeof e==`object`&&e){var n=bi.get(e);return n===void 0?(t={value:e,source:t,stack:Oe(t)},bi.set(e,t),t):n}return{value:e,source:t,stack:Oe(t)}}var Si=[],Ci=0,wi=null,Ti=0,Ei=[],Di=0,Oi=null,ki=1,Ai=``;function ji(e,t){Si[Ci++]=Ti,Si[Ci++]=wi,wi=e,Ti=t}function Mi(e,t,n){Ei[Di++]=ki,Ei[Di++]=Ai,Ei[Di++]=Oi,Oi=e;var r=ki;e=Ai;var i=32-Ge(r)-1;r&=~(1<<i),n+=1;var a=32-Ge(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,ki=1<<32-Ge(t)+i|n<<i|r,Ai=a+e}else ki=1<<a|n<<i|r,Ai=e}function Ni(e){e.return!==null&&(ji(e,1),Mi(e,1,0))}function Pi(e){for(;e===wi;)wi=Si[--Ci],Si[Ci]=null,Ti=Si[--Ci],Si[Ci]=null;for(;e===Oi;)Oi=Ei[--Di],Ei[Di]=null,Ai=Ei[--Di],Ei[Di]=null,ki=Ei[--Di],Ei[Di]=null}function Fi(e,t){Ei[Di++]=ki,Ei[Di++]=Ai,Ei[Di++]=Oi,ki=t.id,Ai=t.overflow,Oi=e}var Ii=null,Li=null,I=!1,Ri=null,zi=!1,Bi=Error(i(519));function Vi(e){throw qi(xi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Bi}function Hi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[pt]=e,t[mt]=r,n){case`dialog`:H(`cancel`,t),H(`close`,t);break;case`iframe`:case`object`:case`embed`:H(`load`,t);break;case`video`:case`audio`:for(n=0;n<Dd.length;n++)H(Dd[n],t);break;case`source`:H(`error`,t);break;case`img`:case`image`:case`link`:H(`error`,t),H(`load`,t);break;case`details`:H(`toggle`,t);break;case`input`:H(`invalid`,t),Ut(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:H(`invalid`,t);break;case`textarea`:H(`invalid`,t),qt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Hd(t.textContent,n)?(r.popover!=null&&(H(`beforetoggle`,t),H(`toggle`,t)),r.onScroll!=null&&H(`scroll`,t),r.onScrollEnd!=null&&H(`scrollend`,t),r.onClick!=null&&(t.onclick=nn),t=!0):t=!1,t||Vi(e,!0)}function Ui(e){for(Ii=e.return;Ii;)switch(Ii.tag){case 5:case 31:case 13:zi=!1;return;case 27:case 3:zi=!0;return;default:Ii=Ii.return}}function Wi(e){if(e!==Ii)return!1;if(!I)return Ui(e),I=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||$d(e.type,e.memoizedProps)),n=!n),n&&Li&&Vi(e),Ui(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Li=bf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Li=bf(e)}else t===27?(t=Li,cf(e.type)?(e=yf,yf=null,Li=e):Li=t):Li=Ii?vf(e.stateNode.nextSibling):null;return!0}function Gi(){Li=Ii=null,I=!1}function Ki(){var e=Ri;return e!==null&&(ou===null?ou=e:ou.push.apply(ou,e),Ri=null),e}function qi(e){Ri===null?Ri=[e]:Ri.push(e)}var Ji=fe(null),Yi=null,Xi=null;function Zi(e,t,n){k(Ji,t._currentValue),t._currentValue=n}function Qi(e){e._currentValue=Ji.current,pe(Ji)}function $i(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function ea(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),$i(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),$i(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function ta(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;Tr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===_e.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[op]:e.push(op))}a=a.return}e!==null&&ea(t,e,n,r),t.flags|=262144}function na(e){for(e=e.firstContext;e!==null;){if(!Tr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ra(e){Yi=e,Xi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ia(e){return oa(Yi,e)}function aa(e,t){return Yi===null&&ra(e),oa(e,t)}function oa(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Xi===null){if(e===null)throw Error(i(308));Xi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Xi=Xi.next=t;return n}var sa=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},ca=t.unstable_scheduleCallback,la=t.unstable_NormalPriority,ua={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function L(){return{controller:new sa,data:new Map,refCount:0}}function da(e){e.refCount--,e.refCount===0&&ca(la,function(){e.controller.abort()})}var fa=null,pa=0,ma=0,ha=null;function ga(e,t){if(fa===null){var n=fa=[];pa=0,ma=xd(),ha={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return pa++,t.then(_a,_a),t}function _a(){if(--pa===0&&fa!==null){ha!==null&&(ha.status=`fulfilled`);var e=fa;fa=null,ma=0,ha=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function va(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var ya=O.S;O.S=function(e,t){lu=A(),typeof t==`object`&&t&&typeof t.then==`function`&&ga(e,t),ya!==null&&ya(e,t)};var ba=fe(null);function xa(){var e=ba.current;return e===null?Kl.pooledCache:e}function Sa(e,t){t===null?k(ba,ba.current):k(ba,t.pool)}function Ca(){var e=xa();return e===null?null:{parent:ua._currentValue,pool:e}}var wa=Error(i(460)),Ta=Error(i(474)),Ea=Error(i(542)),Da={then:function(){}};function Oa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function ka(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(nn,nn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ma(e),e;default:if(typeof t.status==`string`)t.then(nn,nn);else{if(e=Kl,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ma(e),e}throw Aa=t,wa}}function R(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Aa=e,wa):e}}var Aa=null;function ja(){if(Aa===null)throw Error(i(459));var e=Aa;return Aa=null,e}function Ma(e){if(e===wa||e===Ea)throw Error(i(483))}var Na=null,Pa=0;function Fa(e){var t=Pa;return Pa+=1,Na===null&&(Na=[]),ka(Na,e,t)}function Ia(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function La(e,t){throw t.$$typeof===h?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Ra(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=pi(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=_i(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===D&&R(i)===t.type)?(t=a(t,n.props),Ia(t,n),t.return=e,t):(t=hi(n.type,n.key,n.props,null,e.mode,r),Ia(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=yi(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=gi(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=_i(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=hi(t.type,t.key,t.props,null,e.mode,n),Ia(n,t),n.return=e,n;case v:return t=yi(t,e.mode,n),t.return=e,t;case D:return t=R(t),f(e,t,n)}if(se(t)||ie(t))return t=gi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Fa(t),n);if(t.$$typeof===C)return f(e,aa(e,t),n);La(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case _:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case D:return n=R(n),p(e,t,n,r)}if(se(n)||ie(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Fa(n),r);if(n.$$typeof===C)return p(e,t,aa(e,n),r);La(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case _:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case D:return r=R(r),m(e,t,n,r,i)}if(se(r)||ie(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Fa(r),i);if(r.$$typeof===C)return m(e,t,n,aa(t,r),i);La(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),I&&ji(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return I&&ji(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),I&&ji(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),I&&ji(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return I&&ji(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),I&&ji(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===D&&R(l)===r.type){n(e,r.sibling),c=a(r,o.props),Ia(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=gi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=hi(o.type,o.key,o.props,null,e.mode,c),Ia(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=yi(o,e.mode,c),c.return=e,e=c}return s(e);case D:return o=R(o),b(e,r,o,c)}if(se(o))return h(e,r,o,c);if(ie(o)){if(l=ie(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Fa(o),c);if(o.$$typeof===C)return b(e,r,aa(e,o),c);La(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=_i(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Pa=0;var i=b(e,t,n,r);return Na=null,i}catch(t){if(t===wa||t===Ea)throw t;var a=di(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var za=Ra(!0),Ba=Ra(!1),Va=!1;function Ha(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ua(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 Wa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ga(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Gl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ci(e),si(e,null,n),t}return ii(e,r,t,n),ci(e)}function Ka(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,st(e,n)}}function qa(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ja=!1;function Ya(){if(Ja){var e=ha;if(e!==null)throw e}}function Xa(e,t,n,r){Ja=!1;var i=e.updateQueue;Va=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,m=f!==s.lane;if(m?(V&f)===f:(r&f)===f){f!==0&&f===ma&&(Ja=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,f);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==`function`?h.call(_,d,f):h,f==null)break a;d=p({},d,f);break a;case 2:Va=!0}}f=s.callback,f!==null&&(e.flags|=64,m&&(e.flags|=8192),m=i.callbacks,m===null?i.callbacks=[f]:m.push(f))}else m={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=m,c=d):u=u.next=m,o|=f;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(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),eu|=o,e.lanes=o,e.memoizedState=d}}function Za(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Qa(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Za(n[e],t)}var $a=fe(null),eo=fe(0);function to(e,t){e=Ql,k(eo,e),k($a,t),Ql=e|t.baseLanes}function no(){k(eo,Ql),k($a,$a.current)}function ro(){Ql=eo.current,pe($a),pe(eo)}var io=fe(null),ao=null;function oo(e){var t=e.alternate;k(fo,fo.current&1),k(io,e),ao===null&&(t===null||$a.current!==null||t.memoizedState!==null)&&(ao=e)}function so(e){k(fo,fo.current),k(io,e),ao===null&&(ao=e)}function co(e){e.tag===22?(k(fo,fo.current),k(io,e),ao===null&&(ao=e)):lo(e)}function lo(){k(fo,fo.current),k(io,io.current)}function uo(e){pe(io),ao===e&&(ao=null),pe(fo)}var fo=fe(0);function po(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||hf(n)||gf(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var mo=0,z=null,ho=null,go=null,_o=!1,vo=!1,yo=!1,bo=0,xo=0,So=null,Co=0;function wo(){throw Error(i(321))}function To(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Tr(e[n],t[n]))return!1;return!0}function Eo(e,t,n,r,i,a){return mo=a,z=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,O.H=e===null||e.memoizedState===null?Us:Ws,yo=!1,a=n(r,i),yo=!1,vo&&(a=Oo(t,n,r,i)),Do(e),a}function Do(e){O.H=Hs;var t=ho!==null&&ho.next!==null;if(mo=0,go=ho=z=null,_o=!1,xo=0,So=null,t)throw Error(i(300));e===null||sc||(e=e.dependencies,e!==null&&na(e)&&(sc=!0))}function Oo(e,t,n,r){z=e;var a=0;do{if(vo&&(So=null),xo=0,vo=!1,25<=a)throw Error(i(301));if(a+=1,go=ho=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}O.H=Gs,o=t(n,r)}while(vo);return o}function ko(){var e=O.H,t=e.useState()[0];return t=typeof t.then==`function`?Io(t):t,e=e.useState()[0],(ho===null?null:ho.memoizedState)!==e&&(z.flags|=1024),t}function Ao(){var e=bo!==0;return bo=0,e}function jo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Mo(e){if(_o){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}_o=!1}mo=0,go=ho=z=null,vo=!1,xo=bo=0,So=null}function No(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return go===null?z.memoizedState=go=e:go=go.next=e,go}function Po(){if(ho===null){var e=z.alternate;e=e===null?null:e.memoizedState}else e=ho.next;var t=go===null?z.memoizedState:go.next;if(t!==null)go=t,ho=e;else{if(e===null)throw z.alternate===null?Error(i(467)):Error(i(310));ho=e,e={memoizedState:ho.memoizedState,baseState:ho.baseState,baseQueue:ho.baseQueue,queue:ho.queue,next:null},go===null?z.memoizedState=go=e:go=go.next=e}return go}function Fo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Io(e){var t=xo;return xo+=1,So===null&&(So=[]),e=ka(So,e,t),t=z,(go===null?t.memoizedState:go.next)===null&&(t=t.alternate,O.H=t===null||t.memoizedState===null?Us:Ws),e}function Lo(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Io(e);if(e.$$typeof===C)return ia(e)}throw Error(i(438,String(e)))}function Ro(e){var t=null,n=z.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=z.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=Fo(),z.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=ne;return t.index++,n}function zo(e,t){return typeof t==`function`?t(e):t}function Bo(e){return Vo(Po(),ho,e)}function Vo(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(mo&f)===f:(V&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===ma&&(d=!0);else if((mo&p)===p){u=u.next,p===ma&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,z.lanes|=p,eu|=p;f=u.action,yo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,z.lanes|=f,eu|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Tr(o,e.memoizedState)&&(sc=!0,d&&(n=ha,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Ho(e){var t=Po(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Tr(o,t.memoizedState)||(sc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Uo(e,t,n){var r=z,a=Po(),o=I;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Tr((ho||a).memoizedState,n);if(s&&(a.memoizedState=n,sc=!0),a=a.queue,ms(Ko.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||go!==null&&go.memoizedState.tag&1){if(r.flags|=2048,ls(9,{destroy:void 0},Go.bind(null,r,a,n,t),null),Kl===null)throw Error(i(349));o||mo&127||Wo(r,t,n)}return n}function Wo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=z.updateQueue,t===null?(t=Fo(),z.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Go(e,t,n,r){t.value=n,t.getSnapshot=r,qo(t)&&Jo(e)}function Ko(e,t,n){return n(function(){qo(t)&&Jo(e)})}function qo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Tr(e,n)}catch{return!0}}function Jo(e){var t=oi(e,2);t!==null&&wu(t,e,2)}function Yo(e){var t=No();if(typeof e==`function`){var n=e;if(e=n(),yo){We(!0);try{n()}finally{We(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:zo,lastRenderedState:e},t}function Xo(e,t,n,r){return e.baseState=n,Vo(e,ho,typeof r==`function`?r:zo)}function Zo(e,t,n,r,a){if(zs(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};O.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Qo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Qo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=O.T,o={};O.T=o;try{var s=n(i,r),c=O.S;c!==null&&c(o,s),$o(e,t,s)}catch(n){ts(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),O.T=a}}else try{a=n(i,r),$o(e,t,a)}catch(n){ts(e,t,n)}}function $o(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){es(e,t,n)},function(n){return ts(e,t,n)}):es(e,t,n)}function es(e,t,n){t.status=`fulfilled`,t.value=n,ns(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Qo(e,n)))}function ts(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,ns(t),t=t.next;while(t!==r)}e.action=null}function ns(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function rs(e,t){return t}function is(e,t){if(I){var n=Kl.formState;if(n!==null){a:{var r=z;if(I){if(Li){b:{for(var i=Li,a=zi;i.nodeType!==8;){if(!a){i=null;break b}if(i=vf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Li=vf(i.nextSibling),r=i.data===`F!`;break a}}Vi(r)}r=!1}r&&(t=n[0])}}return n=No(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:rs,lastRenderedState:t},n.queue=r,n=Is.bind(null,z,r),r.dispatch=n,r=Yo(!1),a=Rs.bind(null,z,!1,r.queue),r=No(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Zo.bind(null,z,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function as(e){return os(Po(),ho,e)}function os(e,t,n){if(t=Vo(e,t,rs)[0],e=Bo(zo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Io(t)}catch(e){throw e===wa?Ea:e}else r=t;t=Po();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(z.flags|=2048,ls(9,{destroy:void 0},ss.bind(null,i,n),null)),[r,a,e]}function ss(e,t){e.action=t}function cs(e){var t=Po(),n=ho;if(n!==null)return os(t,n,e);Po(),t=t.memoizedState,n=Po();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function ls(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=z.updateQueue,t===null&&(t=Fo(),z.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function us(){return Po().memoizedState}function ds(e,t,n,r){var i=No();z.flags|=e,i.memoizedState=ls(1|t,{destroy:void 0},n,r===void 0?null:r)}function fs(e,t,n,r){var i=Po();r=r===void 0?null:r;var a=i.memoizedState.inst;ho!==null&&r!==null&&To(r,ho.memoizedState.deps)?i.memoizedState=ls(t,a,n,r):(z.flags|=e,i.memoizedState=ls(1|t,a,n,r))}function ps(e,t){ds(8390656,8,e,t)}function ms(e,t){fs(2048,8,e,t)}function hs(e){z.flags|=4;var t=z.updateQueue;if(t===null)t=Fo(),z.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function gs(e){var t=Po().memoizedState;return hs({ref:t,nextImpl:e}),function(){if(Gl&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function _s(e,t){return fs(4,2,e,t)}function vs(e,t){return fs(4,4,e,t)}function ys(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function bs(e,t,n){n=n==null?null:n.concat([e]),fs(4,4,ys.bind(null,t,e),n)}function xs(){}function Ss(e,t){var n=Po();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&To(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Cs(e,t){var n=Po();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&To(t,r[1]))return r[0];if(r=e(),yo){We(!0);try{e()}finally{We(!1)}}return n.memoizedState=[r,t],r}function ws(e,t,n){return n===void 0||mo&1073741824&&!(V&261930)?e.memoizedState=t:(e.memoizedState=n,e=Cu(),z.lanes|=e,eu|=e,n)}function Ts(e,t,n,r){return Tr(n,t)?n:$a.current===null?!(mo&42)||mo&1073741824&&!(V&261930)?(sc=!0,e.memoizedState=n):(e=Cu(),z.lanes|=e,eu|=e,t):(e=ws(e,n,r),Tr(e,t)||(sc=!0),e)}function Es(e,t,n,r,i){var a=ce.p;ce.p=a!==0&&8>a?a:8;var o=O.T,s={};O.T=s,Rs(e,!1,t,n);try{var c=i(),l=O.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Ls(e,t,va(c,r),Su(e)):Ls(e,t,r,Su(e))}catch(n){Ls(e,t,{then:function(){},status:`rejected`,reason:n},Su())}finally{ce.p=a,o!==null&&s.types!==null&&(o.types=s.types),O.T=o}}function Ds(){}function Os(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=ks(e).queue;Es(e,a,t,le,n===null?Ds:function(){return As(e),n(r)})}function ks(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:le,baseState:le,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:zo,lastRenderedState:le},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:zo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function As(e){var t=ks(e);t.next===null&&(t=e.alternate.memoizedState),Ls(e,t.next.queue,{},Su())}function js(){return ia(op)}function Ms(){return Po().memoizedState}function Ns(){return Po().memoizedState}function Ps(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Su();e=Wa(n);var r=Ga(t,e,n);r!==null&&(wu(r,t,n),Ka(r,t,n)),t={cache:L()},e.payload=t;return}t=t.return}}function Fs(e,t,n){var r=Su();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},zs(e)?Bs(t,n):(n=ai(e,t,n,r),n!==null&&(wu(n,e,r),Vs(n,t,r)))}function Is(e,t,n){Ls(e,t,n,Su())}function Ls(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(zs(e))Bs(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Tr(s,o))return ii(e,t,i,0),Kl===null&&ri(),!1}catch{}if(n=ai(e,t,i,r),n!==null)return wu(n,e,r),Vs(n,t,r),!0}return!1}function Rs(e,t,n,r){if(r={lane:2,revertLane:xd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},zs(e)){if(t)throw Error(i(479))}else t=ai(e,n,r,2),t!==null&&wu(t,e,2)}function zs(e){var t=e.alternate;return e===z||t!==null&&t===z}function Bs(e,t){vo=_o=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Vs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,st(e,n)}}var Hs={readContext:ia,use:Lo,useCallback:wo,useContext:wo,useEffect:wo,useImperativeHandle:wo,useLayoutEffect:wo,useInsertionEffect:wo,useMemo:wo,useReducer:wo,useRef:wo,useState:wo,useDebugValue:wo,useDeferredValue:wo,useTransition:wo,useSyncExternalStore:wo,useId:wo,useHostTransitionStatus:wo,useFormState:wo,useActionState:wo,useOptimistic:wo,useMemoCache:wo,useCacheRefresh:wo};Hs.useEffectEvent=wo;var Us={readContext:ia,use:Lo,useCallback:function(e,t){return No().memoizedState=[e,t===void 0?null:t],e},useContext:ia,useEffect:ps,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),ds(4194308,4,ys.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ds(4194308,4,e,t)},useInsertionEffect:function(e,t){ds(4,2,e,t)},useMemo:function(e,t){var n=No();t=t===void 0?null:t;var r=e();if(yo){We(!0);try{e()}finally{We(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=No();if(n!==void 0){var i=n(t);if(yo){We(!0);try{n(t)}finally{We(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Fs.bind(null,z,e),[r.memoizedState,e]},useRef:function(e){var t=No();return e={current:e},t.memoizedState=e},useState:function(e){e=Yo(e);var t=e.queue,n=Is.bind(null,z,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:xs,useDeferredValue:function(e,t){return ws(No(),e,t)},useTransition:function(){var e=Yo(!1);return e=Es.bind(null,z,e.queue,!0,!1),No().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=z,a=No();if(I){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Kl===null)throw Error(i(349));V&127||Wo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,ps(Ko.bind(null,r,o,e),[e]),r.flags|=2048,ls(9,{destroy:void 0},Go.bind(null,r,o,n,t),null),n},useId:function(){var e=No(),t=Kl.identifierPrefix;if(I){var n=Ai,r=ki;n=(r&~(1<<32-Ge(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=bo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Co++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:js,useFormState:is,useActionState:is,useOptimistic:function(e){var t=No();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Rs.bind(null,z,!0,n),n.dispatch=t,[e,t]},useMemoCache:Ro,useCacheRefresh:function(){return No().memoizedState=Ps.bind(null,z)},useEffectEvent:function(e){var t=No(),n={impl:e};return t.memoizedState=n,function(){if(Gl&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Ws={readContext:ia,use:Lo,useCallback:Ss,useContext:ia,useEffect:ms,useImperativeHandle:bs,useInsertionEffect:_s,useLayoutEffect:vs,useMemo:Cs,useReducer:Bo,useRef:us,useState:function(){return Bo(zo)},useDebugValue:xs,useDeferredValue:function(e,t){return Ts(Po(),ho.memoizedState,e,t)},useTransition:function(){var e=Bo(zo)[0],t=Po().memoizedState;return[typeof e==`boolean`?e:Io(e),t]},useSyncExternalStore:Uo,useId:Ms,useHostTransitionStatus:js,useFormState:as,useActionState:as,useOptimistic:function(e,t){return Xo(Po(),ho,e,t)},useMemoCache:Ro,useCacheRefresh:Ns};Ws.useEffectEvent=gs;var Gs={readContext:ia,use:Lo,useCallback:Ss,useContext:ia,useEffect:ms,useImperativeHandle:bs,useInsertionEffect:_s,useLayoutEffect:vs,useMemo:Cs,useReducer:Ho,useRef:us,useState:function(){return Ho(zo)},useDebugValue:xs,useDeferredValue:function(e,t){var n=Po();return ho===null?ws(n,e,t):Ts(n,ho.memoizedState,e,t)},useTransition:function(){var e=Ho(zo)[0],t=Po().memoizedState;return[typeof e==`boolean`?e:Io(e),t]},useSyncExternalStore:Uo,useId:Ms,useHostTransitionStatus:js,useFormState:cs,useActionState:cs,useOptimistic:function(e,t){var n=Po();return ho===null?(n.baseState=e,[e,n.queue.dispatch]):Xo(n,ho,e,t)},useMemoCache:Ro,useCacheRefresh:Ns};Gs.useEffectEvent=gs;function Ks(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:p({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var qs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Su(),i=Wa(r);i.payload=t,n!=null&&(i.callback=n),t=Ga(e,i,r),t!==null&&(wu(t,e,r),Ka(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Su(),i=Wa(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ga(e,i,r),t!==null&&(wu(t,e,r),Ka(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Su(),r=Wa(n);r.tag=2,t!=null&&(r.callback=t),t=Ga(e,r,n),t!==null&&(wu(t,e,n),Ka(t,e,n))}};function Js(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Er(n,r)||!Er(i,a):!0}function Ys(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&qs.enqueueReplaceState(t,t.state,null)}function Xs(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=p({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Zs(e){$r(e)}function Qs(e){console.error(e)}function $s(e){$r(e)}function ec(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function tc(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function nc(e,t,n){return n=Wa(n),n.tag=3,n.payload={element:null},n.callback=function(){ec(e,t)},n}function rc(e){return e=Wa(e),e.tag=3,e}function ic(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){tc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){tc(t,n,r),typeof i!=`function`&&(fu===null?fu=new Set([this]):fu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function ac(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&ta(t,n,a,!0),n=io.current,n!==null){switch(n.tag){case 31:case 13:return ao===null?Iu():n.alternate===null&&$l===0&&($l=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Da?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),td(e,r,a)),!1;case 22:return n.flags|=65536,r===Da?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),td(e,r,a)),!1}throw Error(i(435,n.tag))}return td(e,r,a),Iu(),!1}if(I)return t=io.current,t===null?(r!==Bi&&(t=Error(i(423),{cause:r}),qi(xi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=xi(r,n),a=nc(e.stateNode,r,a),qa(e,a),$l!==4&&($l=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Bi&&(e=Error(i(422),{cause:r}),qi(xi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=xi(o,n),au===null?au=[o]:au.push(o),$l!==4&&($l=2),t===null)return!0;r=xi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=nc(n.stateNode,r,e),qa(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(fu===null||!fu.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=rc(a),ic(a,e,n,r),qa(n,a),!1}n=n.return}while(n!==null);return!1}var oc=Error(i(461)),sc=!1;function cc(e,t,n,r){t.child=e===null?Ba(t,null,n,r):za(t,e.child,n,r)}function lc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return ra(t),r=Eo(e,t,n,o,a,i),s=Ao(),e!==null&&!sc?(jo(e,t,i),Nc(e,t,i)):(I&&s&&Ni(t),t.flags|=1,cc(e,t,r,i),t.child)}function uc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!fi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,dc(e,t,a,r,i)):(e=hi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Pc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Er:n,n(o,r)&&e.ref===t.ref)return Nc(e,t,i)}return t.flags|=1,e=pi(a,r),e.ref=t.ref,e.return=t,t.child=e}function dc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Er(a,r)&&e.ref===t.ref)if(sc=!1,t.pendingProps=r=a,Pc(e,i))e.flags&131072&&(sc=!0);else return t.lanes=e.lanes,Nc(e,t,i)}return yc(e,t,n,r,i)}function fc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return mc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Sa(t,a===null?null:a.cachePool),a===null?no():to(t,a),co(t);else return r=t.lanes=536870912,mc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Sa(t,null),no(),lo(t)):(Sa(t,a.cachePool),to(t,a),lo(t),t.memoizedState=null);return cc(e,t,i,n),t.child}function pc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function mc(e,t,n,r,i){var a=xa();return a=a===null?null:{parent:ua._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Sa(t,null),no(),co(t),e!==null&&ta(e,t,r,!0),t.childLanes=i,null}function hc(e,t){return t=Oc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function gc(e,t,n){return za(t,e.child,null,n),e=hc(t,t.pendingProps),e.flags|=2,uo(t),t.memoizedState=null,e}function _c(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(I){if(r.mode===`hidden`)return e=hc(t,r),t.lanes=536870912,pc(null,e);if(so(t),(e=Li)?(e=mf(e,zi),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Oi===null?null:{id:ki,overflow:Ai},retryLane:536870912,hydrationErrors:null},n=vi(e),n.return=t,t.child=n,Ii=t,Li=null)):e=null,e===null)throw Vi(t);return t.lanes=536870912,null}return hc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(so(t),a)if(t.flags&256)t.flags&=-257,t=gc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(sc||ta(e,t,n,!1),a=(n&e.childLanes)!==0,sc||a){if(r=Kl,r!==null&&(s=ct(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,oi(e,s),wu(r,e,s),oc;Iu(),t=gc(e,t,n)}else e=o.treeContext,Li=vf(s.nextSibling),Ii=t,I=!0,Ri=null,zi=!1,e!==null&&Fi(t,e),t=hc(t,r),t.flags|=4096;return t}return e=pi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function vc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function yc(e,t,n,r,i){return ra(t),n=Eo(e,t,n,r,void 0,i),r=Ao(),e!==null&&!sc?(jo(e,t,i),Nc(e,t,i)):(I&&r&&Ni(t),t.flags|=1,cc(e,t,n,i),t.child)}function bc(e,t,n,r,i,a){return ra(t),t.updateQueue=null,n=Oo(t,r,n,i),Do(e),r=Ao(),e!==null&&!sc?(jo(e,t,a),Nc(e,t,a)):(I&&r&&Ni(t),t.flags|=1,cc(e,t,n,a),t.child)}function xc(e,t,n,r,i){if(ra(t),t.stateNode===null){var a=li,o=n.contextType;typeof o==`object`&&o&&(a=ia(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=qs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Ha(t),o=n.contextType,a.context=typeof o==`object`&&o?ia(o):li,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Ks(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&qs.enqueueReplaceState(a,a.state,null),Xa(t,r,a,i),Ya(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Xs(n,s);a.props=c;var l=a.context,u=n.contextType;o=li,typeof u==`object`&&u&&(o=ia(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Ys(t,a,r,o),Va=!1;var f=t.memoizedState;a.state=f,Xa(t,r,a,i),Ya(),l=t.memoizedState,s||f!==l||Va?(typeof d==`function`&&(Ks(t,n,d,r),l=t.memoizedState),(c=Va||Js(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Ua(e,t),o=t.memoizedProps,u=Xs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=li,typeof l==`object`&&l&&(c=ia(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Ys(t,a,r,c),Va=!1,f=t.memoizedState,a.state=f,Xa(t,r,a,i),Ya();var p=t.memoizedState;o!==d||f!==p||Va||e!==null&&e.dependencies!==null&&na(e.dependencies)?(typeof s==`function`&&(Ks(t,n,s,r),p=t.memoizedState),(u=Va||Js(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&na(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,vc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=za(t,e.child,null,i),t.child=za(t,null,n,i)):cc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Nc(e,t,i),e}function Sc(e,t,n,r){return Gi(),t.flags|=256,cc(e,t,n,r),t.child}var Cc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function wc(e){return{baseLanes:e,cachePool:Ca()}}function Tc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=ru),e}function Ec(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(fo.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(I){if(a?oo(t):lo(t),(e=Li)?(e=mf(e,zi),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Oi===null?null:{id:ki,overflow:Ai},retryLane:536870912,hydrationErrors:null},n=vi(e),n.return=t,t.child=n,Ii=t,Li=null)):e=null,e===null)throw Vi(t);return gf(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(lo(t),a=t.mode,c=Oc({mode:`hidden`,children:c},a),r=gi(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=wc(n),r.childLanes=Tc(e,s,n),t.memoizedState=Cc,pc(null,r)):(oo(t),Dc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(oo(t),t.flags&=-257,t=kc(e,t,n)):t.memoizedState===null?(lo(t),c=r.fallback,a=t.mode,r=Oc({mode:`visible`,children:r.children},a),c=gi(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,za(t,e.child,null,n),r=t.child,r.memoizedState=wc(n),r.childLanes=Tc(e,s,n),t.memoizedState=Cc,t=pc(null,r)):(lo(t),t.child=e.child,t.flags|=128,t=null);else if(oo(t),gf(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,qi({value:r,source:null,stack:null}),t=kc(e,t,n)}else if(sc||ta(e,t,n,!1),s=(n&e.childLanes)!==0,sc||s){if(s=Kl,s!==null&&(r=ct(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,oi(e,r),wu(s,e,r),oc;hf(c)||Iu(),t=kc(e,t,n)}else hf(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Li=vf(c.nextSibling),Ii=t,I=!0,Ri=null,zi=!1,e!==null&&Fi(t,e),t=Dc(t,r.children),t.flags|=4096);return t}return a?(lo(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=pi(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=gi(c,a,n,null),c.flags|=2):c=pi(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,pc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=wc(n):(a=c.cachePool,a===null?a=Ca():(l=ua._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=Tc(e,s,n),t.memoizedState=Cc,pc(e.child,r)):(oo(t),n=e.child,e=n.sibling,n=pi(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function Dc(e,t){return t=Oc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Oc(e,t){return e=di(22,e,null,t),e.lanes=0,e}function kc(e,t,n){return za(t,e.child,null,n),e=Dc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Ac(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),$i(e.return,t,n)}function jc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function Mc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=fo.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,k(fo,o),cc(e,t,r,n),r=I?Ti:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Ac(e,n,t);else if(e.tag===19)Ac(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&po(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),jc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&po(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}jc(t,!0,n,null,a,r);break;case`together`:jc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Nc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),eu|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(ta(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=pi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=pi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Pc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&na(e))):!0}function Fc(e,t,n){switch(t.tag){case 3:ve(t,t.stateNode.containerInfo),Zi(t,ua,e.memoizedState.cache),Gi();break;case 27:case 5:be(t);break;case 4:ve(t,t.stateNode.containerInfo);break;case 10:Zi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,so(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(oo(t),e=Nc(e,t,n),e===null?null:e.sibling):Ec(e,t,n):(oo(t),t.flags|=128,null);oo(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(ta(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Mc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),k(fo,fo.current),r)break;return null;case 22:return t.lanes=0,fc(e,t,n,t.pendingProps);case 24:Zi(t,ua,e.memoizedState.cache)}return Nc(e,t,n)}function Ic(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)sc=!0;else{if(!Pc(e,n)&&!(t.flags&128))return sc=!1,Fc(e,t,n);sc=!!(e.flags&131072)}else sc=!1,I&&t.flags&1048576&&Mi(t,Ti,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=R(t.elementType),t.type=e,typeof e==`function`)fi(e)?(r=Xs(e,r),t.tag=1,t=xc(null,t,e,r,n)):(t.tag=0,t=yc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=lc(null,t,e,r,n);break a}else if(a===E){t.tag=14,t=uc(null,t,e,r,n);break a}}throw t=oe(e)||e,Error(i(306,t,``))}}return t;case 0:return yc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Xs(r,t.pendingProps),xc(e,t,r,a,n);case 3:a:{if(ve(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Ua(e,t),Xa(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Zi(t,ua,r),r!==o.cache&&ea(t,[ua],n,!0),Ya(),r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Sc(e,t,r,n);break a}else if(r!==a){a=xi(Error(i(424)),t),qi(a),t=Sc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Li=vf(e.firstChild),Ii=t,I=!0,Ri=null,zi=!0,n=Ba(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Gi(),r===a){t=Nc(e,t,n);break a}cc(e,t,r,n)}t=t.child}return t;case 26:return vc(e,t),e===null?(n=Rf(t.type,null,t.pendingProps,null))?t.memoizedState=n:I||(n=t.type,e=t.pendingProps,r=Xd(ge.current).createElement(n),r[pt]=t,r[mt]=e,Wd(r,n,e),N(r),t.stateNode=r):t.memoizedState=Rf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return be(t),e===null&&I&&(r=t.stateNode=Sf(t.type,t.pendingProps,ge.current),Ii=t,zi=!0,a=Li,cf(t.type)?(yf=a,Li=vf(r.firstChild)):Li=a),cc(e,t,t.pendingProps.children,n),vc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&I&&((a=r=Li)&&(r=ff(r,t.type,t.pendingProps,zi),r===null?a=!1:(t.stateNode=r,Ii=t,Li=vf(r.firstChild),zi=!1,a=!0)),a||Vi(t)),be(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,$d(a,o)?r=null:s!==null&&$d(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Eo(e,t,ko,null,null,n),op._currentValue=a),vc(e,t),cc(e,t,r,n),t.child;case 6:return e===null&&I&&((e=n=Li)&&(n=pf(n,t.pendingProps,zi),n===null?e=!1:(t.stateNode=n,Ii=t,Li=null,e=!0)),e||Vi(t)),null;case 13:return Ec(e,t,n);case 4:return ve(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=za(t,null,r,n):cc(e,t,r,n),t.child;case 11:return lc(e,t,t.type,t.pendingProps,n);case 7:return cc(e,t,t.pendingProps,n),t.child;case 8:return cc(e,t,t.pendingProps.children,n),t.child;case 12:return cc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Zi(t,t.type,r.value),cc(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,ra(t),a=ia(a),r=r(a),t.flags|=1,cc(e,t,r,n),t.child;case 14:return uc(e,t,t.type,t.pendingProps,n);case 15:return dc(e,t,t.type,t.pendingProps,n);case 19:return Mc(e,t,n);case 31:return _c(e,t,n);case 22:return fc(e,t,n,t.pendingProps);case 24:return ra(t),r=ia(ua),e===null?(a=xa(),a===null&&(a=Kl,o=L(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Ha(t),Zi(t,ua,a)):((e.lanes&n)!==0&&(Ua(e,t),Xa(t,null,null,n),Ya()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Zi(t,ua,r),r!==a.cache&&ea(t,[ua],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Zi(t,ua,r))),cc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Lc(e){e.flags|=4}function Rc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Nu())e.flags|=8192;else throw Aa=Da,Ta}else e.flags&=-16777217}function zc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!$f(t))if(Nu())e.flags|=8192;else throw Aa=Da,Ta}function Bc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:nt(),e.lanes|=t,iu|=t)}function Vc(e,t){if(!I)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Hc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Uc(e,t,n){var r=t.pendingProps;switch(Pi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Hc(t),null;case 1:return Hc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Qi(ua),ye(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Wi(t)?Lc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ki())),Hc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Lc(t),o===null?(Hc(t),Rc(t,a,null,r,n)):(Hc(t),zc(t,o))):o?o===e.memoizedState?(Hc(t),t.flags&=-16777217):(Lc(t),Hc(t),zc(t,o)):(e=e.memoizedProps,e!==r&&Lc(t),Hc(t),Rc(t,a,e,r,n)),null;case 27:if(xe(t),n=ge.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Lc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Hc(t),null}e=me.current,Wi(t)?Hi(t,e):(e=Sf(a,r,n),t.stateNode=e,Lc(t))}return Hc(t),null;case 5:if(xe(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Lc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Hc(t),null}if(o=me.current,Wi(t))Hi(t,o);else{var s=Xd(ge.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[pt]=t,o[mt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Wd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Lc(t)}}return Hc(t),Rc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Lc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=ge.current,Wi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Ii,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[pt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Hd(e.nodeValue,n)),e||Vi(t,!0)}else e=Xd(e).createTextNode(r),e[pt]=t,t.stateNode=e}return Hc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Wi(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[pt]=t}else Gi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Hc(t),e=!1}else n=Ki(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(uo(t),t):(uo(t),null);if(t.flags&128)throw Error(i(558))}return Hc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Wi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[pt]=t}else Gi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Hc(t),a=!1}else a=Ki(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(uo(t),t):(uo(t),null)}return uo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Bc(t,t.updateQueue),Hc(t),null);case 4:return ye(),e===null&&Md(t.stateNode.containerInfo),Hc(t),null;case 10:return Qi(t.type),Hc(t),null;case 19:if(pe(fo),r=t.memoizedState,r===null)return Hc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Vc(r,!1);else{if($l!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=po(e),o!==null){for(t.flags|=128,Vc(r,!1),e=o.updateQueue,t.updateQueue=e,Bc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)mi(n,e),n=n.sibling;return k(fo,fo.current&1|2),I&&ji(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&A()>uu&&(t.flags|=128,a=!0,Vc(r,!1),t.lanes=4194304)}else{if(!a)if(e=po(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Bc(t,e),Vc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!I)return Hc(t),null}else 2*A()-r.renderingStartTime>uu&&n!==536870912&&(t.flags|=128,a=!0,Vc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Hc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=A(),e.sibling=null,n=fo.current,k(fo,a?n&1|2:n&1),I&&ji(t,r.treeForkCount),e);case 22:case 23:return uo(t),ro(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Hc(t),t.subtreeFlags&6&&(t.flags|=8192)):Hc(t),n=t.updateQueue,n!==null&&Bc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&pe(ba),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Qi(ua),Hc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Wc(e,t){switch(Pi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Qi(ua),ye(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return xe(t),null;case 31:if(t.memoizedState!==null){if(uo(t),t.alternate===null)throw Error(i(340));Gi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(uo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Gi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return pe(fo),null;case 4:return ye(),null;case 10:return Qi(t.type),null;case 22:case 23:return uo(t),ro(),e!==null&&pe(ba),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Qi(ua),null;case 25:return null;default:return null}}function Gc(e,t){switch(Pi(t),t.tag){case 3:Qi(ua),ye();break;case 26:case 27:case 5:xe(t);break;case 4:ye();break;case 31:t.memoizedState!==null&&uo(t);break;case 13:uo(t);break;case 19:pe(fo);break;case 10:Qi(t.type);break;case 22:case 23:uo(t),ro(),e!==null&&pe(ba);break;case 24:Qi(ua)}}function Kc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){ed(t,t.return,e)}}function qc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){ed(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){ed(t,t.return,e)}}function Jc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Qa(t,n)}catch(t){ed(e,e.return,t)}}}function Yc(e,t,n){n.props=Xs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){ed(e,t,n)}}function Xc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){ed(e,t,n)}}function Zc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){ed(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){ed(e,t,n)}else n.current=null}function Qc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){ed(e,e.return,t)}}function $c(e,t,n){try{var r=e.stateNode;Gd(r,e.type,n,t),r[mt]=t}catch(t){ed(e,e.return,t)}}function el(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&cf(e.type)||e.tag===4}function tl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||el(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&&cf(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function nl(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=nn));else if(r!==4&&(r===27&&cf(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(nl(e,t,n),e=e.sibling;e!==null;)nl(e,t,n),e=e.sibling}function rl(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&cf(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(rl(e,t,n),e=e.sibling;e!==null;)rl(e,t,n),e=e.sibling}function il(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Wd(t,r,n),t[pt]=e,t[mt]=n}catch(t){ed(e,e.return,t)}}var al=!1,ol=!1,sl=!1,cl=typeof WeakSet==`function`?WeakSet:Set,ll=null;function ul(e,t){if(e=e.containerInfo,Jd=hp,e=Ar(e),jr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Yd={focusedElem:e,selectionRange:n},hp=!1,ll=t;ll!==null;)if(t=ll,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,ll=e;else for(;ll!==null;){switch(t=ll,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Xs(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){ed(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)df(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:df(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,ll=e;break}ll=t.return}}function dl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:El(e,n),r&4&&Kc(5,n);break;case 1:if(El(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){ed(n,n.return,e)}else{var i=Xs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){ed(n,n.return,e)}}r&64&&Jc(n),r&512&&Xc(n,n.return);break;case 3:if(El(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Qa(e,t)}catch(e){ed(n,n.return,e)}}break;case 27:t===null&&r&4&&il(n);case 26:case 5:El(e,n),t===null&&r&4&&Qc(n),r&512&&Xc(n,n.return);break;case 12:El(e,n);break;case 31:El(e,n),r&4&&_l(e,n);break;case 13:El(e,n),r&4&&vl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=id.bind(null,n),_f(e,n))));break;case 22:if(r=n.memoizedState!==null||al,!r){t=t!==null&&t.memoizedState!==null||ol,i=al;var a=ol;al=r,(ol=t)&&!a?Ol(e,n,(n.subtreeFlags&8772)!=0):El(e,n),al=i,ol=a}break;case 30:break;default:El(e,n)}}function fl(e){var t=e.alternate;t!==null&&(e.alternate=null,fl(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&bt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var pl=null,ml=!1;function hl(e,t,n){for(n=n.child;n!==null;)gl(e,t,n),n=n.sibling}function gl(e,t,n){if(Ue&&typeof Ue.onCommitFiberUnmount==`function`)try{Ue.onCommitFiberUnmount(He,n)}catch{}switch(n.tag){case 26:ol||Zc(n,t),hl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:ol||Zc(n,t);var r=pl,i=ml;cf(n.type)&&(pl=n.stateNode,ml=!1),hl(e,t,n),Cf(n.stateNode),pl=r,ml=i;break;case 5:ol||Zc(n,t);case 6:if(r=pl,i=ml,pl=null,hl(e,t,n),pl=r,ml=i,pl!==null)if(ml)try{(pl.nodeType===9?pl.body:pl.nodeName===`HTML`?pl.ownerDocument.body:pl).removeChild(n.stateNode)}catch(e){ed(n,t,e)}else try{pl.removeChild(n.stateNode)}catch(e){ed(n,t,e)}break;case 18:pl!==null&&(ml?(e=pl,lf(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Vp(e)):lf(pl,n.stateNode));break;case 4:r=pl,i=ml,pl=n.stateNode.containerInfo,ml=!0,hl(e,t,n),pl=r,ml=i;break;case 0:case 11:case 14:case 15:qc(2,n,t),ol||qc(4,n,t),hl(e,t,n);break;case 1:ol||(Zc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Yc(n,t,r)),hl(e,t,n);break;case 21:hl(e,t,n);break;case 22:ol=(r=ol)||n.memoizedState!==null,hl(e,t,n),ol=r;break;default:hl(e,t,n)}}function _l(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Vp(e)}catch(e){ed(t,t.return,e)}}}function vl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Vp(e)}catch(e){ed(t,t.return,e)}}function yl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new cl),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new cl),t;default:throw Error(i(435,e.tag))}}function bl(e,t){var n=yl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=ad.bind(null,e,t);t.then(r,r)}})}function xl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(cf(c.type)){pl=c.stateNode,ml=!1;break a}break;case 5:pl=c.stateNode,ml=!1;break a;case 3:case 4:pl=c.stateNode.containerInfo,ml=!0;break a}c=c.return}if(pl===null)throw Error(i(160));gl(o,s,a),pl=null,ml=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Cl(t,e),t=t.sibling}var Sl=null;function Cl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:xl(t,e),wl(e),r&4&&(qc(3,e,e.return),Kc(3,e),qc(5,e,e.return));break;case 1:xl(t,e),wl(e),r&512&&(ol||n===null||Zc(n,n.return)),r&64&&al&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=Sl;if(xl(t,e),wl(e),r&512&&(ol||n===null||Zc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[yt]||o[pt]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Wd(o,r,n),o[pt]=e,N(o),r=o;break a;case`link`:var s=Xf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Wd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Xf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Wd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[pt]=e,N(o),r=o}e.stateNode=r}else Zf(a,e.type,e.stateNode);else e.stateNode=Gf(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&$c(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Zf(a,e.type,e.stateNode):Gf(a,r,e.memoizedProps))}break;case 27:xl(t,e),wl(e),r&512&&(ol||n===null||Zc(n,n.return)),n!==null&&r&4&&$c(e,e.memoizedProps,n.memoizedProps);break;case 5:if(xl(t,e),wl(e),r&512&&(ol||n===null||Zc(n,n.return)),e.flags&32){a=e.stateNode;try{Jt(a,``)}catch(t){ed(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,$c(e,a,n===null?a:n.memoizedProps)),r&1024&&(sl=!0);break;case 6:if(xl(t,e),wl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){ed(e,e.return,t)}}break;case 3:if(Yf=null,a=Sl,Sl=Ef(t.containerInfo),xl(t,e),Sl=a,wl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Vp(t.containerInfo)}catch(t){ed(e,e.return,t)}sl&&(sl=!1,Tl(e));break;case 4:r=Sl,Sl=Ef(e.stateNode.containerInfo),xl(t,e),wl(e),Sl=r;break;case 12:xl(t,e),wl(e);break;case 31:xl(t,e),wl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,bl(e,r)));break;case 13:xl(t,e),wl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(cu=A()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,bl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=al,d=ol;if(al=u||a,ol=d||l,xl(t,e),ol=d,al=u,wl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||al||ol||Dl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){ed(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){ed(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?uf(m,!0):uf(l.stateNode,!1)}catch(e){ed(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,bl(e,n))));break;case 19:xl(t,e),wl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,bl(e,r)));break;case 30:break;case 21:break;default:xl(t,e),wl(e)}}function wl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(el(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;rl(e,tl(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Jt(o,``),n.flags&=-33),rl(e,tl(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;nl(e,tl(e),s);break;default:throw Error(i(161))}}catch(t){ed(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Tl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Tl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function El(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)dl(e,t.alternate,t),t=t.sibling}function Dl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:qc(4,t,t.return),Dl(t);break;case 1:Zc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Yc(t,t.return,n),Dl(t);break;case 27:Cf(t.stateNode);case 26:case 5:Zc(t,t.return),Dl(t);break;case 22:t.memoizedState===null&&Dl(t);break;case 30:Dl(t);break;default:Dl(t)}e=e.sibling}}function Ol(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:Ol(i,a,n),Kc(4,a);break;case 1:if(Ol(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){ed(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Za(c[i],s)}catch(e){ed(r,r.return,e)}}n&&o&64&&Jc(a),Xc(a,a.return);break;case 27:il(a);case 26:case 5:Ol(i,a,n),n&&r===null&&o&4&&Qc(a),Xc(a,a.return);break;case 12:Ol(i,a,n);break;case 31:Ol(i,a,n),n&&o&4&&_l(i,a);break;case 13:Ol(i,a,n),n&&o&4&&vl(i,a);break;case 22:a.memoizedState===null&&Ol(i,a,n),Xc(a,a.return);break;case 30:break;default:Ol(i,a,n)}t=t.sibling}}function kl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&da(n))}function Al(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&da(e))}function jl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Ml(e,t,n,r),t=t.sibling}function Ml(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:jl(e,t,n,r),i&2048&&Kc(9,t);break;case 1:jl(e,t,n,r);break;case 3:jl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&da(e)));break;case 12:if(i&2048){jl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){ed(t,t.return,e)}}else jl(e,t,n,r);break;case 31:jl(e,t,n,r);break;case 13:jl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?jl(e,t,n,r):(a._visibility|=2,Nl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?jl(e,t,n,r):Pl(e,t),i&2048&&kl(o,t);break;case 24:jl(e,t,n,r),i&2048&&Al(t.alternate,t);break;default:jl(e,t,n,r)}}function Nl(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Nl(a,o,s,c,i),Kc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Nl(a,o,s,c,i)):u._visibility&2?Nl(a,o,s,c,i):Pl(a,o),i&&l&2048&&kl(o.alternate,o);break;case 24:Nl(a,o,s,c,i),i&&l&2048&&Al(o.alternate,o);break;default:Nl(a,o,s,c,i)}t=t.sibling}}function Pl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Pl(n,r),i&2048&&kl(r.alternate,r);break;case 24:Pl(n,r),i&2048&&Al(r.alternate,r);break;default:Pl(n,r)}t=t.sibling}}var Fl=8192;function Il(e,t,n){if(e.subtreeFlags&Fl)for(e=e.child;e!==null;)Ll(e,t,n),e=e.sibling}function Ll(e,t,n){switch(e.tag){case 26:Il(e,t,n),e.flags&Fl&&e.memoizedState!==null&&ep(n,Sl,e.memoizedState,e.memoizedProps);break;case 5:Il(e,t,n);break;case 3:case 4:var r=Sl;Sl=Ef(e.stateNode.containerInfo),Il(e,t,n),Sl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Fl,Fl=16777216,Il(e,t,n),Fl=r):Il(e,t,n));break;default:Il(e,t,n)}}function Rl(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function zl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ll=r,Hl(r,e)}Rl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Bl(e),e=e.sibling}function Bl(e){switch(e.tag){case 0:case 11:case 15:zl(e),e.flags&2048&&qc(9,e,e.return);break;case 3:zl(e);break;case 12:zl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Vl(e)):zl(e);break;default:zl(e)}}function Vl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ll=r,Hl(r,e)}Rl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:qc(8,t,t.return),Vl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Vl(t));break;default:Vl(t)}e=e.sibling}}function Hl(e,t){for(;ll!==null;){var n=ll;switch(n.tag){case 0:case 11:case 15:qc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:da(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,ll=r;else a:for(n=e;ll!==null;){r=ll;var i=r.sibling,a=r.return;if(fl(r),r===n){ll=null;break a}if(i!==null){i.return=a,ll=i;break a}ll=a}}}var Ul={getCacheForType:function(e){var t=ia(ua),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ia(ua).controller.signal}},Wl=typeof WeakMap==`function`?WeakMap:Map,Gl=0,Kl=null,B=null,V=0,ql=0,Jl=null,Yl=!1,Xl=!1,Zl=!1,Ql=0,$l=0,eu=0,tu=0,nu=0,ru=0,iu=0,au=null,ou=null,su=!1,cu=0,lu=0,uu=1/0,du=null,fu=null,pu=0,mu=null,hu=null,gu=0,_u=0,vu=null,yu=null,bu=0,xu=null;function Su(){return Gl&2&&V!==0?V&-V:O.T===null?dt():xd()}function Cu(){if(ru===0)if(!(V&536870912)||I){var e=Xe;Xe<<=1,!(Xe&3932160)&&(Xe=262144),ru=e}else ru=536870912;return e=io.current,e!==null&&(e.flags|=32),ru}function wu(e,t,n){(e===Kl&&(ql===2||ql===9)||e.cancelPendingCommit!==null)&&(ju(e,0),Ou(e,V,ru,!1)),it(e,n),(!(Gl&2)||e!==Kl)&&(e===Kl&&(!(Gl&2)&&(tu|=n),$l===4&&Ou(e,V,ru,!1)),pd(e))}function Tu(e,t,n){if(Gl&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||et(e,t),a=r?zu(e,t):Lu(e,t,!0),o=r;do{if(a===0){Xl&&!r&&Ou(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!Du(n)){a=Lu(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=au;var l=c.current.memoizedState.isDehydrated;if(l&&(ju(c,s).flags|=256),s=Lu(c,s,!1),s!==2){if(Zl&&!l){c.errorRecoveryDisabledLanes|=o,tu|=o,a=4;break a}o=ou,ou=a,o!==null&&(ou===null?ou=o:ou.push.apply(ou,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){ju(e,0),Ou(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:Ou(r,t,ru,!Yl);break a;case 2:ou=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=cu+300-A(),10<a)){if(Ou(r,t,ru,!Yl),$e(r,0,!0)!==0)break a;gu=t,r.timeoutHandle=nf(Eu.bind(null,r,n,ou,du,su,t,ru,tu,iu,Yl,o,`Throttled`,-0,0),a);break a}Eu(r,n,ou,du,su,t,ru,tu,iu,Yl,o,null,-0,0)}}break}while(1);pd(e)}function Eu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:nn},Ll(t,a,d);var m=(a&62914560)===a?cu-A():(a&4194048)===a?lu-A():0;if(m=np(d,m),m!==null){gu=a,e.cancelPendingCommit=m(Ku.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),Ou(e,a,o,!l);return}}Ku(e,t,a,n,r,i,o,s,c)}function Du(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Tr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Ou(e,t,n,r){t&=~nu,t&=~tu,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Ge(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&ot(e,n,t)}function ku(){return Gl&6?!0:(md(0,!1),!1)}function Au(){if(B!==null){if(ql===0)var e=B.return;else e=B,Xi=Yi=null,Mo(e),Na=null,Pa=0,e=B;for(;e!==null;)Gc(e.alternate,e),e=e.return;B=null}}function ju(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,rf(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),gu=0,Au(),Kl=e,B=n=pi(e.current,null),V=t,ql=0,Jl=null,Yl=!1,Xl=et(e,t),Zl=!1,iu=ru=nu=tu=eu=$l=0,ou=au=null,su=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Ge(r),a=1<<i;t|=e[i],r&=~a}return Ql=t,ri(),n}function Mu(e,t){z=null,O.H=Hs,t===wa||t===Ea?(t=ja(),ql=3):t===Ta?(t=ja(),ql=4):ql=t===oc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Jl=t,B===null&&($l=1,ec(e,xi(t,e.current)))}function Nu(){var e=io.current;return e===null?!0:(V&4194048)===V?ao===null:(V&62914560)===V||V&536870912?e===ao:!1}function Pu(){var e=O.H;return O.H=Hs,e===null?Hs:e}function Fu(){var e=O.A;return O.A=Ul,e}function Iu(){$l=4,Yl||(V&4194048)!==V&&io.current!==null||(Xl=!0),!(eu&134217727)&&!(tu&134217727)||Kl===null||Ou(Kl,V,ru,!1)}function Lu(e,t,n){var r=Gl;Gl|=2;var i=Pu(),a=Fu();(Kl!==e||V!==t)&&(du=null,ju(e,t)),t=!1;var o=$l;a:do try{if(ql!==0&&B!==null){var s=B,c=Jl;switch(ql){case 8:Au(),o=6;break a;case 3:case 2:case 9:case 6:io.current===null&&(t=!0);var l=ql;if(ql=0,Jl=null,Uu(e,s,c,l),n&&Xl){o=0;break a}break;default:l=ql,ql=0,Jl=null,Uu(e,s,c,l)}}Ru(),o=$l;break}catch(t){Mu(e,t)}while(1);return t&&e.shellSuspendCounter++,Xi=Yi=null,Gl=r,O.H=i,O.A=a,B===null&&(Kl=null,V=0,ri()),o}function Ru(){for(;B!==null;)Vu(B)}function zu(e,t){var n=Gl;Gl|=2;var r=Pu(),a=Fu();Kl!==e||V!==t?(du=null,uu=A()+500,ju(e,t)):Xl=et(e,t);a:do try{if(ql!==0&&B!==null){t=B;var o=Jl;b:switch(ql){case 1:ql=0,Jl=null,Uu(e,t,o,1);break;case 2:case 9:if(Oa(o)){ql=0,Jl=null,Hu(t);break}t=function(){ql!==2&&ql!==9||Kl!==e||(ql=7),pd(e)},o.then(t,t);break a;case 3:ql=7;break a;case 4:ql=5;break a;case 7:Oa(o)?(ql=0,Jl=null,Hu(t)):(ql=0,Jl=null,Uu(e,t,o,7));break;case 5:var s=null;switch(B.tag){case 26:s=B.memoizedState;case 5:case 27:var c=B;if(s?$f(s):c.stateNode.complete){ql=0,Jl=null;var l=c.sibling;if(l!==null)B=l;else{var u=c.return;u===null?B=null:(B=u,Wu(u))}break b}}ql=0,Jl=null,Uu(e,t,o,5);break;case 6:ql=0,Jl=null,Uu(e,t,o,6);break;case 8:Au(),$l=6;break a;default:throw Error(i(462))}}Bu();break}catch(t){Mu(e,t)}while(1);return Xi=Yi=null,O.H=r,O.A=a,Gl=n,B===null?(Kl=null,V=0,ri(),$l):0}function Bu(){for(;B!==null&&!Me();)Vu(B)}function Vu(e){var t=Ic(e.alternate,e,Ql);e.memoizedProps=e.pendingProps,t===null?Wu(e):B=t}function Hu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=bc(n,t,t.pendingProps,t.type,void 0,V);break;case 11:t=bc(n,t,t.pendingProps,t.type.render,t.ref,V);break;case 5:Mo(t);default:Gc(n,t),t=B=mi(t,Ql),t=Ic(n,t,Ql)}e.memoizedProps=e.pendingProps,t===null?Wu(e):B=t}function Uu(e,t,n,r){Xi=Yi=null,Mo(t),Na=null,Pa=0;var i=t.return;try{if(ac(e,i,t,n,V)){$l=1,ec(e,xi(n,e.current)),B=null;return}}catch(t){if(i!==null)throw B=i,t;$l=1,ec(e,xi(n,e.current)),B=null;return}t.flags&32768?(I||r===1?e=!0:Xl||V&536870912?e=!1:(Yl=e=!0,(r===2||r===9||r===3||r===6)&&(r=io.current,r!==null&&r.tag===13&&(r.flags|=16384))),Gu(t,e)):Wu(t)}function Wu(e){var t=e;do{if(t.flags&32768){Gu(t,Yl);return}e=t.return;var n=Uc(t.alternate,t,Ql);if(n!==null){B=n;return}if(t=t.sibling,t!==null){B=t;return}B=t=e}while(t!==null);$l===0&&($l=5)}function Gu(e,t){do{var n=Wc(e.alternate,e);if(n!==null){n.flags&=32767,B=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){B=e;return}B=e=n}while(e!==null);$l=6,B=null}function Ku(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Zu();while(pu!==0);if(Gl&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=ni,at(e,n,o,s,c,l),e===Kl&&(B=Kl=null,V=0),hu=t,mu=e,gu=n,_u=o,vu=a,yu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,od(Le,function(){return Qu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=O.T,O.T=null,a=ce.p,ce.p=2,s=Gl,Gl|=4;try{ul(e,t,n)}finally{Gl=s,ce.p=a,O.T=r}}pu=1,qu(),Ju(),Yu()}}function qu(){if(pu===1){pu=0;var e=mu,t=hu,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=O.T,O.T=null;var r=ce.p;ce.p=2;var i=Gl;Gl|=4;try{Cl(t,e);var a=Yd,o=Ar(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&kr(s.ownerDocument.documentElement,s)){if(c!==null&&jr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Or(s,h),v=Or(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}hp=!!Jd,Yd=Jd=null}finally{Gl=i,ce.p=r,O.T=n}}e.current=t,pu=2}}function Ju(){if(pu===2){pu=0;var e=mu,t=hu,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=O.T,O.T=null;var r=ce.p;ce.p=2;var i=Gl;Gl|=4;try{dl(e,t.alternate,t)}finally{Gl=i,ce.p=r,O.T=n}}pu=3}}function Yu(){if(pu===4||pu===3){pu=0,Ne();var e=mu,t=hu,n=gu,r=yu;t.subtreeFlags&10256||t.flags&10256?pu=5:(pu=0,hu=mu=null,Xu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(fu=null),ut(n),t=t.stateNode,Ue&&typeof Ue.onCommitFiberRoot==`function`)try{Ue.onCommitFiberRoot(He,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=O.T,i=ce.p,ce.p=2,O.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{O.T=t,ce.p=i}}gu&3&&Zu(),pd(e),i=e.pendingLanes,n&261930&&i&42?e===xu?bu++:(bu=0,xu=e):bu=0,md(0,!1)}}function Xu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,da(t)))}function Zu(){return qu(),Ju(),Yu(),Qu()}function Qu(){if(pu!==5)return!1;var e=mu,t=_u;_u=0;var n=ut(gu),r=O.T,a=ce.p;try{ce.p=32>n?32:n,O.T=null,n=vu,vu=null;var o=mu,s=gu;if(pu=0,hu=mu=null,gu=0,Gl&6)throw Error(i(331));var c=Gl;if(Gl|=4,Bl(o.current),Ml(o,o.current,s,n),Gl=c,md(0,!1),Ue&&typeof Ue.onPostCommitFiberRoot==`function`)try{Ue.onPostCommitFiberRoot(He,o)}catch{}return!0}finally{ce.p=a,O.T=r,Xu(e,t)}}function $u(e,t,n){t=xi(n,t),t=nc(e.stateNode,t,2),e=Ga(e,t,2),e!==null&&(it(e,2),pd(e))}function ed(e,t,n){if(e.tag===3)$u(e,e,n);else for(;t!==null;){if(t.tag===3){$u(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(fu===null||!fu.has(r))){e=xi(n,e),n=rc(2),r=Ga(t,n,2),r!==null&&(ic(n,r,t,e),it(r,2),pd(r));break}}t=t.return}}function td(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Wl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Zl=!0,i.add(n),e=nd.bind(null,e,t,n),t.then(e,e))}function nd(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Kl===e&&(V&n)===n&&($l===4||$l===3&&(V&62914560)===V&&300>A()-cu?!(Gl&2)&&ju(e,0):nu|=n,iu===V&&(iu=0)),pd(e)}function rd(e,t){t===0&&(t=nt()),e=oi(e,t),e!==null&&(it(e,t),pd(e))}function id(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),rd(e,n)}function ad(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),rd(e,n)}function od(e,t){return Ae(e,t)}var sd=null,cd=null,ld=!1,ud=!1,dd=!1,fd=0;function pd(e){e!==cd&&e.next===null&&(cd===null?sd=cd=e:cd=cd.next=e),ud=!0,ld||(ld=!0,bd())}function md(e,t){if(!dd&&ud){dd=!0;do for(var n=!1,r=sd;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Ge(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,yd(r,a))}else a=V,a=$e(r,r===Kl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||et(r,a)||(n=!0,yd(r,a));r=r.next}while(n);dd=!1}}function hd(){gd()}function gd(){ud=ld=!1;var e=0;fd!==0&&tf()&&(e=fd);for(var t=A(),n=null,r=sd;r!==null;){var i=r.next,a=_d(r,t);a===0?(r.next=null,n===null?sd=i:n.next=i,i===null&&(cd=n)):(n=r,(e!==0||a&3)&&(ud=!0)),r=i}pu!==0&&pu!==5||md(e,!1),fd!==0&&(fd=0)}function _d(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Ge(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=tt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Kl,n=V,n=$e(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(ql===2||ql===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&je(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||et(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&je(r),ut(n)){case 2:case 8:n=Ie;break;case 32:n=Le;break;case 268435456:n=ze;break;default:n=Le}return r=vd.bind(null,e),n=Ae(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&je(r),e.callbackPriority=2,e.callbackNode=null,2}function vd(e,t){if(pu!==0&&pu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Zu()&&e.callbackNode!==n)return null;var r=V;return r=$e(e,e===Kl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Tu(e,r,t),_d(e,A()),e.callbackNode!=null&&e.callbackNode===n?vd.bind(null,e):null)}function yd(e,t){if(Zu())return null;Tu(e,t,!0)}function bd(){of(function(){Gl&6?Ae(Fe,hd):gd()})}function xd(){if(fd===0){var e=ma;e===0&&(e=Ye,Ye<<=1,!(Ye&261888)&&(Ye=256)),fd=e}return fd}function Sd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:tn(``+e)}function Cd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function wd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Sd((i[mt]||null).action),o=r.submitter;o&&(t=(t=o[mt]||null)?Sd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new wn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(fd!==0){var e=o?Cd(i,o):new FormData(i);Os(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?Cd(i,o):new FormData(i),Os(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Td=0;Td<Zr.length;Td++){var Ed=Zr[Td];Qr(Ed.toLowerCase(),`on`+(Ed[0].toUpperCase()+Ed.slice(1)))}Qr(Ur,`onAnimationEnd`),Qr(Wr,`onAnimationIteration`),Qr(Gr,`onAnimationStart`),Qr(`dblclick`,`onDoubleClick`),Qr(`focusin`,`onFocus`),Qr(`focusout`,`onBlur`),Qr(Kr,`onTransitionRun`),Qr(qr,`onTransitionStart`),Qr(Jr,`onTransitionCancel`),Qr(Yr,`onTransitionEnd`),Dt(`onMouseEnter`,[`mouseout`,`mouseover`]),Dt(`onMouseLeave`,[`mouseout`,`mouseover`]),Dt(`onPointerEnter`,[`pointerout`,`pointerover`]),Dt(`onPointerLeave`,[`pointerout`,`pointerover`]),Et(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Et(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Et(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Et(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Et(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Et(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Dd=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),Od=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Dd));function kd(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){$r(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){$r(e)}i.currentTarget=null,a=c}}}}function H(e,t){var n=t[ht];n===void 0&&(n=t[ht]=new Set);var r=e+`__bubble`;n.has(r)||(Nd(t,e,2,!1),n.add(r))}function Ad(e,t,n){var r=0;t&&(r|=4),Nd(n,e,r,t)}var jd=`_reactListening`+Math.random().toString(36).slice(2);function Md(e){if(!e[jd]){e[jd]=!0,P.forEach(function(t){t!==`selectionchange`&&(Od.has(t)||Ad(t,!1,e),Ad(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[jd]||(t[jd]=!0,Ad(`selectionchange`,!1,t))}}function Nd(e,t,n,r){switch(Sp(t)){case 2:var i=gp;break;case 8:i=_p;break;default:i=vp}n=i.bind(null,t,n,e),i=void 0,!pn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Pd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=xt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}un(function(){var r=a,i=an(n),s=[];a:{var c=Xr.get(e);if(c!==void 0){var l=wn,u=e;switch(e){case`keypress`:if(yn(n)===0)break a;case`keydown`:case`keyup`:l=Hn;break;case`focusin`:u=`focus`,l=Nn;break;case`focusout`:u=`blur`,l=Nn;break;case`beforeblur`:case`afterblur`:l=Nn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=jn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Mn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Wn;break;case Ur:case Wr:case Gr:l=Pn;break;case Yr:l=Gn;break;case`scroll`:case`scrollend`:l=En;break;case`wheel`:l=Kn;break;case`copy`:case`cut`:case`paste`:l=Fn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Un;break;case`toggle`:case`beforetoggle`:l=qn}var d=(t&4)!=0,f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=dn(m,p),g!=null&&d.push(Fd(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==rn&&(u=n.relatedTarget||n.fromElement)&&(xt(u)||u[M]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?xt(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=jn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Un,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:Ct(l),h=u==null?c:Ct(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,xt(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Ld,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Rd(s,c,l,d,!1),u!==null&&f!==null&&Rd(s,f,u,d,!0)}}a:{if(c=r?Ct(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=pr;else if(sr(c))if(mr)v=Cr;else{v=xr;var y=br}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Qt(r.elementType)&&(v=pr):v=Sr;if(v&&=v(e,r)){cr(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Wt(c,`number`,c.value)}switch(y=r?Ct(r):window,e){case`focusin`:(sr(y)||y.contentEditable===`true`)&&(Nr=y,Pr=r,Fr=null);break;case`focusout`:Fr=Pr=Nr=null;break;case`mousedown`:Ir=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Ir=!1,Lr(s,n,i);break;case`selectionchange`:if(Mr)break;case`keydown`:case`keyup`:Lr(s,n,i)}var b;if(Yn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else rr?tr(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Qn&&n.locale!==`ko`&&(rr||x!==`onCompositionStart`?x===`onCompositionEnd`&&rr&&(b=vn()):(hn=i,gn=`value`in hn?hn.value:hn.textContent,rr=!0)),y=Id(r,x),0<y.length&&(x=new In(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=nr(n),b!==null&&(x.data=b)))),(b=Zn?ir(e,n):ar(e,n))&&(x=Id(r,`onBeforeInput`),0<x.length&&(y=new In(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),wd(s,e,r,n,i)}kd(s,t)})}function Fd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Id(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=dn(e,n),i!=null&&r.unshift(Fd(e,i,a)),i=dn(e,t),i!=null&&r.push(Fd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Ld(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Rd(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=dn(n,a),l!=null&&o.unshift(Fd(n,l,c))):i||(l=dn(n,a),l!=null&&o.push(Fd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var zd=/\r\n?/g,Bd=/\u0000|\uFFFD/g;function Vd(e){return(typeof e==`string`?e:``+e).replace(zd,`
|
|
9
|
+
`).replace(Bd,``)}function Hd(e,t){return t=Vd(t),Vd(e)===t}function U(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Jt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Jt(e,``+r);break;case`className`:Nt(e,`class`,r);break;case`tabIndex`:Nt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Nt(e,n,r);break;case`style`:Zt(e,r,o);break;case`data`:if(t!==`object`){Nt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=tn(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&U(e,t,`name`,a.name,a,null),U(e,t,`formEncType`,a.formEncType,a,null),U(e,t,`formMethod`,a.formMethod,a,null),U(e,t,`formTarget`,a.formTarget,a,null)):(U(e,t,`encType`,a.encType,a,null),U(e,t,`method`,a.method,a,null),U(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=tn(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=nn);break;case`onScroll`:r!=null&&H(`scroll`,e);break;case`onScrollEnd`:r!=null&&H(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=tn(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:H(`beforetoggle`,e),H(`toggle`,e),Mt(e,`popover`,r);break;case`xlinkActuate`:Pt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Pt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Pt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Pt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Pt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Pt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Pt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Pt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Pt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Mt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=$t.get(n)||n,Mt(e,n,r))}}function Ud(e,t,n,r,a,o){switch(n){case`style`:Zt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Jt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Jt(e,``+r);break;case`onScroll`:r!=null&&H(`scroll`,e);break;case`onScrollEnd`:r!=null&&H(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=nn);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!Tt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[mt]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):Mt(e,n,r)}}}function Wd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:H(`error`,e),H(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:U(e,t,o,s,n,null)}}a&&U(e,t,`srcSet`,n.srcSet,n,null),r&&U(e,t,`src`,n.src,n,null);return;case`input`:H(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:U(e,t,r,d,n,null)}}Ut(e,o,c,l,u,s,a,!1);return;case`select`:for(a in H(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:U(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Gt(e,!!r,n,!0):Gt(e,!!r,t,!1);return;case`textarea`:for(s in H(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:U(e,t,s,c,n,null)}qt(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:U(e,t,l,r,n,null)}return;case`dialog`:H(`beforetoggle`,e),H(`toggle`,e),H(`cancel`,e),H(`close`,e);break;case`iframe`:case`object`:H(`load`,e);break;case`video`:case`audio`:for(r=0;r<Dd.length;r++)H(Dd[r],e);break;case`image`:H(`error`,e),H(`load`,e);break;case`details`:H(`toggle`,e);break;case`embed`:case`source`:case`link`:H(`error`,e),H(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:U(e,t,u,r,n,null)}return;default:if(Qt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Ud(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&U(e,t,c,r,n,null))}function Gd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||U(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&U(e,t,p,m,r,f)}}Ht(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||U(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&U(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Gt(e,!!n,n?[]:``,!1):Gt(e,!!n,t,!0)):Gt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:U(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&U(e,t,s,a,r,o)}Kt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:U(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:U(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&U(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:U(e,t,u,p,r,m)}return;default:if(Qt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Ud(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Ud(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&U(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||U(e,t,f,p,r,m)}function Kd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function qd(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Kd(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Kd(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Jd=null,Yd=null;function Xd(e){return e.nodeType===9?e:e.ownerDocument}function Zd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Qd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function $d(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var ef=null;function tf(){var e=window.event;return e&&e.type===`popstate`?e===ef?!1:(ef=e,!0):(ef=null,!1)}var nf=typeof setTimeout==`function`?setTimeout:void 0,rf=typeof clearTimeout==`function`?clearTimeout:void 0,af=typeof Promise==`function`?Promise:void 0,of=typeof queueMicrotask==`function`?queueMicrotask:af===void 0?nf:function(e){return af.resolve(null).then(e).catch(sf)};function sf(e){setTimeout(function(){throw e})}function cf(e){return e===`head`}function lf(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Vp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Cf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Cf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[yt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Cf(e.ownerDocument.body);n=i}while(n);Vp(t)}function uf(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function df(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:df(n),bt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function ff(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;else if(!e[yt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=vf(e.nextSibling),e===null)break}return null}function pf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=vf(e.nextSibling),e===null))return null;return e}function mf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=vf(e.nextSibling),e===null))return null;return e}function hf(e){return e.data===`$?`||e.data===`$~`}function gf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function _f(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function vf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var yf=null;function bf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return vf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function xf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function Sf(e,t,n){switch(t=Xd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function Cf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);bt(e)}var wf=new Map,Tf=new Set;function Ef(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Df=ce.d;ce.d={f:Of,r:kf,D:Mf,C:Nf,L:Pf,m:Ff,X:If,S:W,M:Lf};function Of(){var e=Df.f(),t=ku();return e||t}function kf(e){var t=St(e);t!==null&&t.tag===5&&t.type===`form`?As(t):Df.r(e)}var Af=typeof document>`u`?null:document;function jf(e,t,n){var r=Af;if(r&&typeof t==`string`&&t){var i=Vt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Tf.has(i)||(Tf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Wd(t,`link`,e),N(t),r.head.appendChild(t)))}}function Mf(e){Df.D(e),jf(`dns-prefetch`,e,null)}function Nf(e,t){Df.C(e,t),jf(`preconnect`,e,t)}function Pf(e,t,n){Df.L(e,t,n);var r=Af;if(r&&e&&t){var i=`link[rel="preload"][as="`+Vt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Vt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Vt(n.imageSizes)+`"]`)):i+=`[href="`+Vt(e)+`"]`;var a=i;switch(t){case`style`:a=zf(e);break;case`script`:a=Uf(e)}wf.has(a)||(e=p({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),wf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Bf(a))||t===`script`&&r.querySelector(Wf(a))||(t=r.createElement(`link`),Wd(t,`link`,e),N(t),r.head.appendChild(t)))}}function Ff(e,t){Df.m(e,t);var n=Af;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Vt(r)+`"][href="`+Vt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Uf(e)}if(!wf.has(a)&&(e=p({rel:`modulepreload`,href:e},t),wf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Wf(a)))return}r=n.createElement(`link`),Wd(r,`link`,e),N(r),n.head.appendChild(r)}}}function W(e,t,n){Df.S(e,t,n);var r=Af;if(r&&e){var i=wt(r).hoistableStyles,a=zf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Bf(a)))s.loading=5;else{e=p({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=wf.get(a))&&qf(e,n);var c=o=r.createElement(`link`);N(c),Wd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Kf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function If(e,t){Df.X(e,t);var n=Af;if(n&&e){var r=wt(n).hoistableScripts,i=Uf(e),a=r.get(i);a||(a=n.querySelector(Wf(i)),a||(e=p({src:e,async:!0},t),(t=wf.get(i))&&Jf(e,t),a=n.createElement(`script`),N(a),Wd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Lf(e,t){Df.M(e,t);var n=Af;if(n&&e){var r=wt(n).hoistableScripts,i=Uf(e),a=r.get(i);a||(a=n.querySelector(Wf(i)),a||(e=p({src:e,async:!0,type:`module`},t),(t=wf.get(i))&&Jf(e,t),a=n.createElement(`script`),N(a),Wd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Rf(e,t,n,r){var a=(a=ge.current)?Ef(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=zf(n.href),n=wt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=zf(n.href);var o=wt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Bf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),wf.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},wf.set(e,n),o||Hf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Uf(n),n=wt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function zf(e){return`href="`+Vt(e)+`"`}function Bf(e){return`link[rel="stylesheet"][`+e+`]`}function Vf(e){return p({},e,{"data-precedence":e.precedence,precedence:null})}function Hf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Wd(t,`link`,n),N(t),e.head.appendChild(t))}function Uf(e){return`[src="`+Vt(e)+`"]`}function Wf(e){return`script[async]`+e}function Gf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Vt(n.href)+`"]`);if(r)return t.instance=r,N(r),r;var a=p({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),N(r),Wd(r,`style`,a),Kf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=zf(n.href);var o=e.querySelector(Bf(a));if(o)return t.state.loading|=4,t.instance=o,N(o),o;r=Vf(n),(a=wf.get(a))&&qf(r,a),o=(e.ownerDocument||e).createElement(`link`),N(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Wd(o,`link`,r),t.state.loading|=4,Kf(o,n.precedence,e),t.instance=o;case`script`:return o=Uf(n.src),(a=e.querySelector(Wf(o)))?(t.instance=a,N(a),a):(r=n,(a=wf.get(o))&&(r=p({},n),Jf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),N(a),Wd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Kf(r,n.precedence,e));return t.instance}function Kf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function qf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Jf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Yf=null;function Xf(e,t,n){if(Yf===null){var r=new Map,i=Yf=new Map;i.set(n,r)}else i=Yf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[yt]||a[pt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Zf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Qf(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;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function $f(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function ep(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=zf(r.href),a=t.querySelector(Bf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=rp.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,N(a);return}a=t.ownerDocument||t,r=Vf(r),(i=wf.get(i))&&qf(r,i),a=a.createElement(`link`),N(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Wd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=rp.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var tp=0;function np(e,t){return e.stylesheets&&e.count===0&&G(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&G(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&tp===0&&(tp=62500*qd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&G(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>tp?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function rp(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)G(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ip=null;function G(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ip=new Map,t.forEach(ap,e),ip=null,rp.call(e))}function ap(e,t){if(!(t.state.loading&4)){var n=ip.get(e);if(n)var r=n.get(null);else{n=new Map,ip.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=rp.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var op={$$typeof:C,Provider:null,Consumer:null,_currentValue:le,_currentValue2:le,_threadCount:0};function sp(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=rt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=rt(0),this.hiddenUpdates=rt(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function cp(e,t,n,r,i,a,o,s,c,l,u,d){return e=new sp(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=di(3,null,null,t),e.current=a,a.stateNode=e,t=L(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Ha(a),e}function lp(e){return e?(e=li,e):li}function up(e,t,n,r,i,a){i=lp(i),r.context===null?r.context=i:r.pendingContext=i,r=Wa(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ga(e,r,t),n!==null&&(wu(n,e,t),Ka(n,e,t))}function dp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function fp(e,t){dp(e,t),(e=e.alternate)&&dp(e,t)}function pp(e){if(e.tag===13||e.tag===31){var t=oi(e,67108864);t!==null&&wu(t,e,67108864),fp(e,67108864)}}function mp(e){if(e.tag===13||e.tag===31){var t=Su();t=lt(t);var n=oi(e,t);n!==null&&wu(n,e,t),fp(e,t)}}var hp=!0;function gp(e,t,n,r){var i=O.T;O.T=null;var a=ce.p;try{ce.p=2,vp(e,t,n,r)}finally{ce.p=a,O.T=i}}function _p(e,t,n,r){var i=O.T;O.T=null;var a=ce.p;try{ce.p=8,vp(e,t,n,r)}finally{ce.p=a,O.T=i}}function vp(e,t,n,r){if(hp){var i=yp(r);if(i===null)Pd(e,t,r,bp,n),jp(e,r);else if(Np(i,e,t,n,r))r.stopPropagation();else if(jp(e,r),t&4&&-1<Ap.indexOf(e)){for(;i!==null;){var a=St(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Qe(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Ge(o);s.entanglements[1]|=c,o&=~c}pd(a),!(Gl&6)&&(uu=A()+500,md(0,!1))}}break;case 31:case 13:s=oi(a,2),s!==null&&wu(s,a,2),ku(),fp(a,2)}if(a=yp(r),a===null&&Pd(e,t,r,bp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Pd(e,t,r,null,n)}}function yp(e){return e=an(e),xp(e)}var bp=null;function xp(e){if(bp=null,e=xt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return bp=e,null}function Sp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Pe()){case Fe:return 2;case Ie:return 8;case Le:case Re:return 32;case ze:return 268435456;default:return 32}default:return 32}}var Cp=!1,wp=null,Tp=null,Ep=null,Dp=new Map,Op=new Map,kp=[],Ap=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function jp(e,t){switch(e){case`focusin`:case`focusout`:wp=null;break;case`dragenter`:case`dragleave`:Tp=null;break;case`mouseover`:case`mouseout`:Ep=null;break;case`pointerover`:case`pointerout`:Dp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Op.delete(t.pointerId)}}function Mp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=St(t),t!==null&&pp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Np(e,t,n,r,i){switch(t){case`focusin`:return wp=Mp(wp,e,t,n,r,i),!0;case`dragenter`:return Tp=Mp(Tp,e,t,n,r,i),!0;case`mouseover`:return Ep=Mp(Ep,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Dp.set(a,Mp(Dp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Op.set(a,Mp(Op.get(a)||null,e,t,n,r,i)),!0}return!1}function Pp(e){var t=xt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,ft(e.priority,function(){mp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,ft(e.priority,function(){mp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Fp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=yp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);rn=r,n.target.dispatchEvent(r),rn=null}else return t=St(n),t!==null&&pp(t),e.blockedOn=n,!1;t.shift()}return!0}function Ip(e,t,n){Fp(e)&&n.delete(t)}function Lp(){Cp=!1,wp!==null&&Fp(wp)&&(wp=null),Tp!==null&&Fp(Tp)&&(Tp=null),Ep!==null&&Fp(Ep)&&(Ep=null),Dp.forEach(Ip),Op.forEach(Ip)}function Rp(e,n){e.blockedOn===n&&(e.blockedOn=null,Cp||(Cp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Lp)))}var zp=null;function Bp(e){zp!==e&&(zp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){zp===e&&(zp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(xp(r||n)===null)continue;break}var a=St(n);a!==null&&(e.splice(t,3),t-=3,Os(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Vp(e){function t(t){return Rp(t,e)}wp!==null&&Rp(wp,e),Tp!==null&&Rp(Tp,e),Ep!==null&&Rp(Ep,e),Dp.forEach(t),Op.forEach(t);for(var n=0;n<kp.length;n++){var r=kp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<kp.length&&(n=kp[0],n.blockedOn===null);)Pp(n),n.blockedOn===null&&kp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[mt]||null;if(typeof a==`function`)o||Bp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[mt]||null)s=o.formAction;else if(xp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Bp(n)}}}function Hp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Up(e){this._internalRoot=e}Wp.prototype.render=Up.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;up(n,Su(),e,t,null,null)},Wp.prototype.unmount=Up.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;up(e.current,2,null,e,null,null),ku(),t[M]=null}};function Wp(e){this._internalRoot=e}Wp.prototype.unstable_scheduleHydration=function(e){if(e){var t=dt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<kp.length&&t!==0&&t<kp[n].priority;n++);kp.splice(n,0,e),n===0&&Pp(e)}};var Gp=n.version;if(Gp!==`19.2.8`)throw Error(i(527,Gp,`19.2.8`));ce.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:d(e),e=e===null?null:e.stateNode,e};var Kp={bundleType:0,version:`19.2.8`,rendererPackageName:`react-dom`,currentDispatcherRef:O,reconcilerVersion:`19.2.8`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var qp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!qp.isDisabled&&qp.supportsFiber)try{He=qp.inject(Kp),Ue=qp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Zs,s=Qs,c=$s;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=cp(e,1,!1,null,null,n,r,null,o,s,c,Hp),e[M]=t.current,Md(e),new Up(t)}})),v=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=_()})),y=u(),b=c(f(),1),x=v(),S=e=>Symbol.iterator in e,C=e=>`entries`in e,w=(e,t)=>{let n=e instanceof Map?e:new Map(e.entries()),r=t instanceof Map?t:new Map(t.entries());if(n.size!==r.size)return!1;for(let[e,t]of n)if(!r.has(e)||!Object.is(t,r.get(e)))return!1;return!0},T=(e,t)=>{let n=e[Symbol.iterator](),r=t[Symbol.iterator](),i=n.next(),a=r.next();for(;!i.done&&!a.done;){if(!Object.is(i.value,a.value))return!1;i=n.next(),a=r.next()}return!!i.done&&!!a.done};function ee(e,t){return Object.is(e,t)?!0:typeof e!=`object`||!e||typeof t!=`object`||!t||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t)?!1:S(e)&&S(t)?C(e)&&C(t)?w(e,t):T(e,t):w({entries:()=>Object.entries(e)},{entries:()=>Object.entries(t)})}function E(e){let t=b.useRef(void 0);return n=>{let r=e(n);return ee(t.current,r)?t.current:t.current=r}}var D=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},te=(e=>e?D(e):D),ne=e=>e;function re(e,t=ne){let n=b.useSyncExternalStore(e.subscribe,b.useCallback(()=>t(e.getState()),[e,t]),b.useCallback(()=>t(e.getInitialState()),[e,t]));return b.useDebugValue(n),n}var ie=e=>{let t=te(e),n=e=>re(t,e);return Object.assign(n,t),n},ae=(e=>e?ie(e):ie);function oe(e){return e[0]??{}}function se(e){return Array.isArray(e)?e:e==null?[]:[e]}function O(e){return typeof e.bytes==`function`?e.bytes():e.arrayBuffer()}var ce=`orpc`,le=`@orpc/shared`,ue=`1.14.8`,de=class extends Error{constructor(...e){super(...e),this.name=`AbortError`}};function fe(e){let t=Promise.resolve();return(...n)=>t=t.catch(()=>{}).then(()=>e(...n))}var pe=2,k=`__${le}@${ue}/otel/config__`;function me(){return globalThis[k]}function he(e,t={},n){return(me()?.tracer)?.startSpan(e,t,n)}function ge(e,t,n={}){if(!e)return;let r=_e(t);e.recordException(r),(!n.signal?.aborted||n.signal.reason!==t)&&e.setStatus({code:pe,message:r.message})}function _e(e){if(e instanceof Error){let t={message:e.message,name:e.name,stack:e.stack};return`code`in e&&(typeof e.code==`string`||typeof e.code==`number`)&&(t.code=e.code),t}return{message:String(e)}}async function ve({name:e,context:t,...n},r){let i=me()?.tracer;if(!i)return r();let a=async e=>{try{return await r(e)}catch(t){throw ge(e,t,n),t}finally{e.end()}};return t?i.startActiveSpan(e,n,t,a):i.startActiveSpan(e,n,a)}async function ye(e,t){let n=me();if(!e||!n)return t();let r=n.trace.setSpan(n.context.active(),e);return n.context.with(r,t)}var be=class{openIds=new Set;queues=new Map;waiters=new Map;get length(){return this.openIds.size}get waiterIds(){return Array.from(this.waiters.keys())}hasBufferedItems(e){return!!this.queues.get(e)?.length}open(e){this.openIds.add(e)}isOpen(e){return this.openIds.has(e)}push(e,t){this.assertOpen(e);let n=this.waiters.get(e);if(n?.length)n.shift()[0](t),n.length===0&&this.waiters.delete(e);else{let n=this.queues.get(e);n?n.push(t):this.queues.set(e,[t])}}async pull(e){this.assertOpen(e);let t=this.queues.get(e);if(t?.length){let n=t.shift();return t.length===0&&this.queues.delete(e),n}return new Promise((t,n)=>{let r=this.waiters.get(e),i=[t,n];r?r.push(i):this.waiters.set(e,[i])})}close({id:e,reason:t}={}){if(e===void 0){this.waiters.forEach((e,n)=>{let r=t??new de(`[AsyncIdQueue] Queue[${n}] was closed or aborted while waiting for pulling.`);e.forEach(([,e])=>e(r))}),this.waiters.clear(),this.openIds.clear(),this.queues.clear();return}let n=t??new de(`[AsyncIdQueue] Queue[${e}] was closed or aborted while waiting for pulling.`);this.waiters.get(e)?.forEach(([,e])=>e(n)),this.waiters.delete(e),this.openIds.delete(e),this.queues.delete(e)}assertOpen(e){if(!this.isOpen(e))throw Error(`[AsyncIdQueue] Cannot access queue[${e}] because it is not open or aborted.`)}};function xe(e){return!e||typeof e!=`object`?!1:`next`in e&&typeof e.next==`function`&&Symbol.asyncIterator in e&&typeof e[Symbol.asyncIterator]==`function`}var Se=Symbol.asyncDispose??Symbol.for(`asyncDispose`),Ce=class{#e=!1;#t=!1;#n;#r;constructor(e,t){this.#n=t,this.#r=fe(async()=>{if(this.#e)return{done:!0,value:void 0};try{let t=await e();return t.done&&(this.#e=!0),t}catch(e){throw this.#e=!0,e}finally{this.#e&&!this.#t&&(this.#t=!0,await this.#n(`next`))}})}next(){return this.#r()}async return(e){return this.#e=!0,this.#t||(this.#t=!0,await this.#n(`return`)),{done:!0,value:e}}async throw(e){throw this.#e=!0,this.#t||(this.#t=!0,await this.#n(`throw`)),e}async[Se](){this.#e=!0,this.#t||(this.#t=!0,await this.#n(`dispose`))}[Symbol.asyncIterator](){return this}};function we({name:e,...t},n){let r;return new Ce(async()=>{r??=he(e);try{let e=await ye(r,()=>n.next());return r?.addEvent(e.done?`completed`:`yielded`),e}catch(e){throw ge(r,e,t),e}},async e=>{try{e!==`next`&&await ye(r,()=>n.return?.())}catch(e){throw ge(r,e,t),e}finally{r?.end()}})}var Te=class{index=BigInt(1);generate(){let e=this.index.toString(36);return this.index++,e}};function Ee(e,t,n){let r=(t,i)=>{let a=e[i];return a?a({...t,next:(e=t)=>r(e,i+1)}):n(t)};return r(t,0)}function De(e){return JSON.stringify(e)}function Oe(e){return Ae(e)?Object.getPrototypeOf(e)?.constructor:null}function ke(e){if(!e||typeof e!=`object`)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||!t||!t.constructor}function Ae(e){return!!e&&(typeof e==`object`||typeof e==`function`)}function je(e){if(Array.isArray(e))return e.map(je);if(ke(e)){let t={};for(let n in e)t[n]=je(e[n]);for(let n of Object.getOwnPropertySymbols(e))t[n]=je(e[n]);return t}return e}function Me(e,...t){return typeof e==`function`?e(...t):e}function Ne(e){return new Proxy(e,{get(e,t,n){let r=Reflect.get(e,t,n);return t!==`then`||typeof r!=`function`?r:new Proxy(r,{apply(t,n,r){if(r.length!==2||r.some(e=>!Pe(e)))return Reflect.apply(t,n,r);let i=!0;r[0].call(n,Ne(new Proxy(e,{get:(e,t,n)=>{if(i&&t===`then`){i=!1;return}return Reflect.get(e,t,n)}})))}})}})}var A=/^\s*function\s*\(\)\s*\{\s*\[native code\]\s*\}\s*$/;function Pe(e){return typeof e==`function`&&A.test(e.toString())}function Fe(e){try{return decodeURIComponent(e)}catch{return e}}var Ie=`@orpc/client`,Le=`1.14.8`,Re={BAD_REQUEST:{status:400,message:`Bad Request`},UNAUTHORIZED:{status:401,message:`Unauthorized`},FORBIDDEN:{status:403,message:`Forbidden`},NOT_FOUND:{status:404,message:`Not Found`},METHOD_NOT_SUPPORTED:{status:405,message:`Method Not Supported`},NOT_ACCEPTABLE:{status:406,message:`Not Acceptable`},TIMEOUT:{status:408,message:`Request Timeout`},CONFLICT:{status:409,message:`Conflict`},PRECONDITION_FAILED:{status:412,message:`Precondition Failed`},PAYLOAD_TOO_LARGE:{status:413,message:`Payload Too Large`},UNSUPPORTED_MEDIA_TYPE:{status:415,message:`Unsupported Media Type`},UNPROCESSABLE_CONTENT:{status:422,message:`Unprocessable Content`},TOO_MANY_REQUESTS:{status:429,message:`Too Many Requests`},CLIENT_CLOSED_REQUEST:{status:499,message:`Client Closed Request`},INTERNAL_SERVER_ERROR:{status:500,message:`Internal Server Error`},NOT_IMPLEMENTED:{status:501,message:`Not Implemented`},BAD_GATEWAY:{status:502,message:`Bad Gateway`},SERVICE_UNAVAILABLE:{status:503,message:`Service Unavailable`},GATEWAY_TIMEOUT:{status:504,message:`Gateway Timeout`}};function ze(e,t){return t??Re[e]?.status??500}function Be(e,t){return t||Re[e]?.message||e}var Ve,He=class e extends Error{defined;code;status;data;static{let t=Symbol.for(`__${Ie}@${Le}/error/ORPC_ERROR_CONSTRUCTORS__`);globalThis[t]??=new WeakSet,Ve=globalThis[t],Ve.add(e)}constructor(e,...t){let n=oe(t);if(n.status!==void 0&&!We(n.status))throw Error(`[ORPCError] Invalid error status code.`);let r=Be(e,n.message);super(r,n),this.code=e,this.status=ze(e,n.status),this.defined=n.defined??!1,this.data=n.data}toJSON(){return{defined:this.defined,code:this.code,status:this.status,message:this.message,data:this.data}}static[Symbol.hasInstance](e){if(Ve.has(this)){let t=Oe(e);if(t&&Ve.has(t))return!0}return super[Symbol.hasInstance](e)}};function Ue(e){return e instanceof He?e:new He(`INTERNAL_SERVER_ERROR`,{message:`Internal server error`,cause:e})}function We(e){return e<200||e>=400}function Ge(e){if(!ke(e))return!1;let t=[`defined`,`code`,`status`,`message`,`data`];return!Object.keys(e).some(e=>!t.includes(e))&&`defined`in e&&typeof e.defined==`boolean`&&`code`in e&&typeof e.code==`string`&&`status`in e&&typeof e.status==`number`&&We(e.status)&&`message`in e&&typeof e.message==`string`}function Ke(e,t={}){return new He(e.code,{...t,...e})}var qe=class extends TypeError{},Je=class extends Error{data;constructor(e){super(e?.message??`An error event was received`,e),this.data=e?.data}};TransformStream;function Ye(e){if(e.includes(`
|
|
10
|
+
`))throw new qe(`Event's id must not contain a newline character`)}function Xe(e){if(!Number.isInteger(e)||e<0)throw new qe(`Event's retry must be a integer and >= 0`)}function Ze(e){if(e.includes(`
|
|
11
|
+
`))throw new qe(`Event's comment must not contain a newline character`)}var Qe=Symbol(`ORPC_EVENT_SOURCE_META`);function $e(e,t){if(t.id===void 0&&t.retry===void 0&&!t.comments?.length)return e;if(t.id!==void 0&&Ye(t.id),t.retry!==void 0&&Xe(t.retry),t.comments!==void 0)for(let e of t.comments)Ze(e);return new Proxy(e,{get(e,n,r){return n===Qe?t:Reflect.get(e,n,r)}})}function et(e){return Ae(e)?Reflect.get(e,Qe):void 0}function tt(e,t=`inline`){return`${t}; filename="${e.replace(/[^\x20-\x7E]/g,`_`).replace(/"/g,`\\"`)}"; filename*=utf-8''${encodeURIComponent(e).replace(/['()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`).replace(/%(7C|60|5E)/g,(e,t)=>String.fromCharCode(Number.parseInt(t,16)))}`}function nt(e){let t=e.match(/filename\*=(UTF-8'')?([^;]*)/i);if(t&&typeof t[2]==`string`)return Fe(t[2]);let n=e.match(/filename="((?:\\"|[^"])*)"/i);if(n&&typeof n[1]==`string`)return n[1].replace(/\\"/g,`"`)}function rt(e,t){let n={...e};for(let e in t)Array.isArray(t[e])?n[e]=[...se(n[e]),...t[e]]:t[e]!==void 0&&(Array.isArray(n[e])?n[e]=[...n[e],t[e]]:n[e]===void 0?n[e]=t[e]:n[e]=[n[e],t[e]]);return n}function it(e){if(typeof e==`string`||e===void 0)return e;if(e.length!==0)return e.join(`, `)}function at(e){return!!(it(e[`content-type`])?.startsWith(`text/event-stream`)&&it(e[`content-disposition`])===void 0)}function ot(e,t){let n=async e=>{let n=await t.error(e);if(n!==e){let t=et(e);t&&Ae(n)&&(n=$e(n,t))}return n};return new Ce(async()=>{let{done:r,value:i}=await(async()=>{try{return await e.next()}catch(e){throw await n(e)}})(),a=await t.value(i,r);if(a!==i){let e=et(i);e&&Ae(a)&&(a=$e(a,e))}return{done:r,value:a}},async()=>{try{await e.return?.()}catch(e){throw await n(e)}})}function st(e){return{...e,context:e.context??{}}}function ct(e,t={}){let n=t.path??[];return Ne(new Proxy(async(...[t,r={}])=>await e.call(n,t,st(r)),{get(r,i){return typeof i==`string`?ct(e,{...t,path:[...n,i]}):Reflect.get(r,i)}}))}var lt=/^http:\/\/orpc\//,ut=(e=>(e[e.REQUEST=1]=`REQUEST`,e[e.RESPONSE=2]=`RESPONSE`,e[e.EVENT_ITERATOR=3]=`EVENT_ITERATOR`,e[e.ABORT_SIGNAL=4]=`ABORT_SIGNAL`,e))(ut||{});function dt(e,t,n){if(t===3){let r=n;return{i:e,t,p:{e:r.event,d:r.data,m:r.meta}}}if(t===4)return{i:e,t,p:n};let r=n;return{i:e,p:{u:r.url.toString().replace(lt,`/`),b:r.body,h:Object.keys(r.headers).length>0?r.headers:void 0,m:r.method===`POST`?void 0:r.method}}}function ft(e){let t=e.i,n=e.t;if(n===3){let r=e.p;return[t,n,{event:r.e,data:r.d,meta:r.m}]}if(n===4)return[t,n,e.p];let r=e.p;return[t,2,{status:r.s??200,headers:r.h??{},body:r.b}]}async function j(e,t,n){if(t===3||t===4)return gt(dt(e,t,n));let r=n,{body:i,headers:a}=await mt(r.body,r.headers),o=dt(e,1,{...r,body:i instanceof Blob?void 0:i,headers:a});return i instanceof Blob?gt(o,i):gt(o)}async function pt(e){let{json:t,buffer:n}=await _t(e),[r,i,a]=ft(t);if(i===3||i===4)return[r,i,a];let o=a,s=await M(o.headers,o.body,n);return[r,i,{...o,body:s}]}async function mt(e,t){let n={...t},r=n[`content-disposition`];if(delete n[`content-type`],delete n[`content-disposition`],e instanceof Blob)return n[`content-type`]=e.type,n[`content-disposition`]=r??tt(e instanceof File?e.name:`blob`),{body:e,headers:n};if(e instanceof FormData){let t=new Response(e);return n[`content-type`]=t.headers.get(`content-type`),{body:await t.blob(),headers:n}}return e instanceof URLSearchParams?(n[`content-type`]=`application/x-www-form-urlencoded`,{body:e.toString(),headers:n}):xe(e)?(n[`content-type`]=`text/event-stream`,{body:void 0,headers:n}):{body:e,headers:n}}async function M(e,t,n){let r=it(e[`content-type`]),i=it(e[`content-disposition`]);if(typeof i==`string`){let e=nt(i)??`blob`;return new File(n===void 0?[]:[n],e,{type:r})}return r?.startsWith(`multipart/form-data`)?new Response(n,{headers:{"content-type":r}}).formData():r?.startsWith(`application/x-www-form-urlencoded`)&&typeof t==`string`?new URLSearchParams(t):t}var ht=255;async function gt(e,t){let n=De(e);return t===void 0||t.size===0?n:O(new Blob([new TextEncoder().encode(n),new Uint8Array([ht]),t]))}async function _t(e){if(typeof e==`string`)return{json:JSON.parse(e)};let t=e instanceof Uint8Array?e:new Uint8Array(e),n=t.indexOf(ht);if(n===-1){let e=new TextDecoder().decode(t);return{json:JSON.parse(e)}}let r=new TextDecoder().decode(t.subarray(0,n)),i=t.subarray(n+1);return{json:JSON.parse(r),buffer:i}}function vt(e,t,n,r={}){let i;return new Ce(async()=>{i??=he(`consume_event_iterator_stream`);try{let n=await ye(i,()=>e.pull(t));switch(n.event){case`message`:{let e=n.data;return n.meta&&Ae(e)&&(e=$e(e,n.meta)),i?.addEvent(`message`),{value:e,done:!1}}case`error`:{let e=new Je({data:n.data});throw n.meta&&(e=$e(e,n.meta)),i?.addEvent(`error`),e}case`done`:{let e=n.data;return n.meta&&Ae(e)&&(e=$e(e,n.meta)),i?.addEvent(`done`),{value:e,done:!0}}}}catch(e){throw e instanceof Je||ge(i,e,r),e}},async e=>{try{e!==`next`&&i?.addEvent(`cancelled`),await ye(i,()=>n(e))}catch(e){throw ge(i,e,r),e}finally{i?.end()}})}function yt(e,t){return ve({name:`stream_event_iterator`},async n=>{for(;;){let r=await(async()=>{try{let{value:t,done:r}=await e.next();return r?(n?.addEvent(`done`),{event:`done`,data:t,meta:et(t)}):(n?.addEvent(`message`),{event:`message`,data:t,meta:et(t)})}catch(e){if(e instanceof Je)return n?.addEvent(`error`),{event:`error`,data:e.data,meta:et(e)};try{await t({event:`error`,data:void 0})}catch(t){throw ge(n,e),t}throw e}})(),i=!1;try{let n=await t(r);if(r.event===`done`||r.event===`error`)return;if(n===`abort`){i=!0,await e.return?.();return}}catch(t){if(!i)try{await e.return?.()}catch(e){throw ge(n,t),e}throw t}}})}var bt=class{peer;constructor(e){this.peer=new xt(async([t,n,r])=>{await e(await j(t,n,r))})}get length(){return this.peer.length}open(e){return this.peer.open(e)}async request(e){return this.peer.request(e)}async message(e){return this.peer.message(await pt(e))}close(e={}){return this.peer.close(e)}},xt=class{idGenerator=new Te;responseQueue=new be;serverEventIteratorQueue=new be;serverControllers=new Map;cleanupFns=new Map;send;constructor(e){this.send=async t=>{let n=t[0];this.serverControllers.has(n)&&await e(t)}}get length(){return(+this.responseQueue.length+this.serverEventIteratorQueue.length+this.serverControllers.size+this.cleanupFns.size)/4}open(e){this.serverEventIteratorQueue.open(e),this.responseQueue.open(e);let t=new AbortController;return this.serverControllers.set(e,t),this.cleanupFns.set(e,[]),t}async request(e){let t=e.signal;return ve({name:`send_peer_request`,signal:t},async()=>{if(t?.aborted)throw t.reason;let n=this.idGenerator.generate(),r=this.open(n);try{let i=me();if(i){let t=je(e.headers);i.propagation.inject(i.context.active(),t),e={...e,headers:t}}if(await this.send([n,ut.REQUEST,e]),t?.aborted)throw await this.send([n,ut.ABORT_SIGNAL,void 0]),t.reason;let a;if(t?.addEventListener(`abort`,a=async()=>{await this.send([n,ut.ABORT_SIGNAL,void 0]),this.close({id:n,reason:t.reason})},{once:!0}),this.cleanupFns.get(n)?.push(()=>{t?.removeEventListener(`abort`,a)}),xe(e.body)){let t=e.body;yt(t,async e=>r.signal.aborted?`abort`:(await this.send([n,ut.EVENT_ITERATOR,e]),`next`))}let o=await this.responseQueue.pull(n);if(at(o.headers)){let e=vt(this.serverEventIteratorQueue,n,async e=>{try{e!==`next`&&await this.send([n,ut.ABORT_SIGNAL,void 0])}finally{this.close({id:n})}},{signal:t});return{...o,body:e}}return this.close({id:n}),o}catch(e){throw this.close({id:n,reason:e}),e}})}async message([e,t,n]){if(t===ut.ABORT_SIGNAL){this.serverControllers.get(e)?.abort();return}if(t===ut.EVENT_ITERATOR){this.serverEventIteratorQueue.isOpen(e)&&this.serverEventIteratorQueue.push(e,n);return}this.responseQueue.isOpen(e)&&this.responseQueue.push(e,n)}close(e={}){e.id===void 0?(this.serverControllers.forEach(t=>t.abort(e.reason)),this.serverControllers.clear(),this.cleanupFns.forEach(e=>e.forEach(e=>e())),this.cleanupFns.clear()):(this.serverControllers.get(e.id)?.abort(e.reason),this.serverControllers.delete(e.id),this.cleanupFns.get(e.id)?.forEach(e=>e()),this.cleanupFns.delete(e.id)),this.responseQueue.close(e),this.serverEventIteratorQueue.close(e)}};function St(e,t={}){return e.forEach((e,n)=>{Array.isArray(t[n])?t[n].push(e):t[n]===void 0?t[n]=e:t[n]=[t[n],e]}),t}var Ct=class{plugins;constructor(e=[]){this.plugins=[...e].sort((e,t)=>(e.order??0)-(t.order??0))}init(e){for(let t of this.plugins)t.init?.(e)}},wt=class{constructor(e,t,n={}){this.codec=e,this.sender=t,new Ct(n.plugins).init(n),this.interceptors=se(n.interceptors),this.clientInterceptors=se(n.clientInterceptors)}interceptors;clientInterceptors;call(e,t,n){return ve({name:`${ce}.${e.join(`/`)}`,signal:n.signal},r=>(r?.setAttribute(`rpc.system`,ce),r?.setAttribute(`rpc.method`,e.join(`.`)),xe(t)&&(t=we({name:`consume_event_iterator_input`,signal:n.signal},t)),Ee(this.interceptors,{...n,path:e,input:t},async({path:e,input:t,...n})=>{let i=me(),a,o=i?.trace.getActiveSpan()??r;o&&i&&(a=i?.trace.setSpan(i.context.active(),o));let s=await ve({name:`encode_request`,context:a},()=>this.codec.encode(e,t,n)),c=await Ee(this.clientInterceptors,{...n,input:t,path:e,request:s},({input:e,path:t,request:n,...r})=>ve({name:`send_request`,signal:r.signal,context:a},()=>this.sender.call(n,r,t,e))),l=await ve({name:`decode_response`,context:a},()=>this.codec.decode(c,n,e,t));return xe(l)?we({name:`consume_event_iterator_output`,signal:n.signal},l):l})))}},N={BIGINT:0,DATE:1,NAN:2,UNDEFINED:3,URL:4,REGEXP:5,SET:6,MAP:7},P=class{customSerializers;constructor(e={}){if(this.customSerializers=e.customJsonSerializers??[],this.customSerializers.length!==new Set(this.customSerializers.map(e=>e.type)).size)throw Error(`Custom serializer type must be unique.`)}serialize(e,t=[],n=[],r=[],i=[]){for(let a of this.customSerializers)if(a.condition(e)){let o=this.serialize(a.serialize(e),t,n,r,i);return n.push([a.type,...t]),o}if(e instanceof Blob)return r.push(t),i.push(e),[e,n,r,i];if(typeof e==`bigint`)return n.push([N.BIGINT,...t]),[e.toString(),n,r,i];if(e instanceof Date)return n.push([N.DATE,...t]),Number.isNaN(e.getTime())?[null,n,r,i]:[e.toISOString(),n,r,i];if(Number.isNaN(e))return n.push([N.NAN,...t]),[null,n,r,i];if(e instanceof URL)return n.push([N.URL,...t]),[e.toString(),n,r,i];if(e instanceof RegExp)return n.push([N.REGEXP,...t]),[e.toString(),n,r,i];if(e instanceof Set){let a=this.serialize(Array.from(e),t,n,r,i);return n.push([N.SET,...t]),a}if(e instanceof Map){let a=this.serialize(Array.from(e.entries()),t,n,r,i);return n.push([N.MAP,...t]),a}if(Array.isArray(e))return[e.map((e,a)=>e===void 0?(n.push([N.UNDEFINED,...t,a]),null):this.serialize(e,[...t,a],n,r,i)[0]),n,r,i];if(ke(e)){let a={};for(let o in e)o===`toJSON`&&typeof e[o]==`function`||(a[o]=this.serialize(e[o],[...t,o],n,r,i)[0]);return[a,n,r,i]}return[e,n,r,i]}deserialize(e,t,n,r){let i={data:e};n&&r&&n.forEach((e,t)=>{let n=i,a=`data`;e.forEach(e=>{if(n=n[a],a=e,!Object.hasOwn(n,a))throw Error(`Security error: accessing non-existent path during deserialization. Path segment: ${a}`)}),n[a]=r(t)});for(let e of t){let t=e[0],n=i,r=`data`;for(let t=1;t<e.length;t++)if(n=n[r],r=e[t],!Object.hasOwn(n,r))throw Error(`Security error: accessing non-existent path during deserialization. Path segment: ${r}`);for(let e of this.customSerializers)if(e.type===t){n[r]=e.deserialize(n[r]);break}switch(t){case N.BIGINT:n[r]=BigInt(n[r]);break;case N.DATE:n[r]=new Date(n[r]??`Invalid Date`);break;case N.NAN:n[r]=NaN;break;case N.UNDEFINED:n[r]=void 0;break;case N.URL:n[r]=new URL(n[r]);break;case N.REGEXP:{let[,e,t]=n[r].match(/^\/(.*)\/([a-z]*)$/);n[r]=new RegExp(e,t);break}case N.SET:n[r]=new Set(n[r]);break;case N.MAP:n[r]=new Map(n[r]);break}}return i.data}};function Tt(e){return`/${e.map(encodeURIComponent).join(`/`)}`}function Et(e){return typeof e.forEach==`function`?St(e):e}function Dt(e){return Object.entries(Re).find(([,t])=>t.status===e)?.[0]??`MALFORMED_ORPC_ERROR_RESPONSE`}var Ot=class{constructor(e,t){this.serializer=e,this.baseUrl=t.url,this.maxUrlLength=t.maxUrlLength??2083,this.fallbackMethod=t.fallbackMethod??`POST`,this.expectedMethod=t.method??this.fallbackMethod,this.headers=t.headers??{}}baseUrl;maxUrlLength;fallbackMethod;expectedMethod;headers;async encode(e,t,n){let r=Et(await Me(this.headers,n,e,t));n.lastEventId!==void 0&&(r=rt(r,{"last-event-id":n.lastEventId}));let i=await Me(this.expectedMethod,n,e,t),a=await Me(this.baseUrl,n,e,t),o=new URL(a);o.pathname=`${o.pathname.replace(/\/$/,``)}${Tt(e)}`;let s=this.serializer.serialize(t);if(i===`GET`&&!(s instanceof FormData)&&!xe(s)){let a=await Me(this.maxUrlLength,n,e,t),c=new URL(o);if(c.searchParams.append(`data`,De(s)),c.toString().length<=a)return{body:void 0,method:i,headers:r,url:c,signal:n.signal}}return{url:o,method:i===`GET`?this.fallbackMethod:i,headers:r,body:s,signal:n.signal}}async decode(e){let t=!We(e.status),n=await(async()=>{let t=!1;try{let n=await e.body();return t=!0,this.serializer.deserialize(n)}catch(e){throw Error(t?`Invalid RPC response format.`:`Cannot parse response body, please check the response body and content-type.`,{cause:e})}})();if(!t)throw Ge(n)?Ke(n):new He(Dt(e.status),{status:e.status,data:{...e,body:n}});return n}},kt=class{constructor(e){this.jsonSerializer=e}serialize(e){return xe(e)?ot(e,{value:async e=>this.#e(e,!1),error:async e=>new Je({data:this.#e(Ue(e).toJSON(),!1),cause:e})}):this.#e(e,!0)}#e(e,t){let[n,r,i,a]=this.jsonSerializer.serialize(e),o=r.length===0?void 0:r;if(!t||a.length===0)return{json:n,meta:o};let s=new FormData;return s.set(`data`,De({json:n,meta:o,maps:i})),a.forEach((e,t)=>{s.set(t.toString(),e)}),s}deserialize(e){return xe(e)?ot(e,{value:async e=>this.#t(e),error:async e=>{if(!(e instanceof Je))return e;let t=this.#t(e.data);return Ge(t)?Ke(t,{cause:e}):new Je({data:t,cause:e})}}):this.#t(e)}#t(e){if(e===void 0)return;if(!(e instanceof FormData))return this.jsonSerializer.deserialize(e.json,e.meta??[]);let t=JSON.parse(e.get(`data`));return this.jsonSerializer.deserialize(t.json,t.meta??[],t.maps,t=>e.get(t.toString()))}},At=class extends wt{constructor(e,t){let n=new Ot(new kt(new P(t)),t);super(n,e,t)}},jt=0,Mt=1,Nt=class{peer;constructor(e){this.peer=new bt(async t=>{if(e.websocket.readyState===jt&&await new Promise(t=>{let n=()=>{e.websocket.removeEventListener(`open`,n),e.websocket.removeEventListener(`close`,n),t()};e.websocket.addEventListener(`open`,n,{once:!0}),e.websocket.addEventListener(`close`,n,{once:!0})}),e.websocket.readyState!==Mt)throw Error(`Cannot send message, WebSocket is not open.`);return e.websocket.send(t)}),e.websocket.addEventListener(`message`,async e=>{let t=e.data instanceof Blob?await O(e.data):e.data;this.peer.message(t)}),e.websocket.addEventListener(`close`,()=>{this.peer.close()})}async call(e,t,n,r){let i=await this.peer.request(e);return{...i,body:()=>Promise.resolve(i.body)}}},Pt=class extends At{constructor(e){let t=new Nt(e);super(t,{...e,url:`http://orpc`})}},Ft=null,It=null;function Lt(){return`${location.protocol===`https:`?`wss:`:`ws:`}//${location.host}/rpc`}function F(){if(Ft&&It&&It.readyState<=WebSocket.OPEN)return Ft;let e=new WebSocket(Lt());return e.addEventListener(`close`,()=>{It===e&&(It=null,Ft=null)}),It=e,Ft=ct(new Pt({websocket:e})),Ft}function Rt(e){return e instanceof Error&&/AsyncIdQueue|closed or aborted|WebSocket/i.test(e.message)}function zt(e){return F().openRepo(e)}async function Bt(e){let t=await F().openTerminal({repoId:e});if(!t.ok)throw Error(t.error??`Could not open a terminal`)}function Vt(){return F().getRecentRepos({})}function Ht(e){return F().discoverRepos({folder:e})}function Ut(e){return F().listDirectory({folder:e})}function Wt(e){return F().getRefs({repoId:e})}function Gt(e){return F().getWorktrees({repoId:e})}function Kt(e,t){return F().removeWorktree({repoId:e,path:t})}function qt(e){return F().getWorktreeChanges({repoId:e})}function Jt(e){return F().getStashes({repoId:e})}function Yt(e,t){return F().getStashDiff({repoId:e,stashSha:t})}function Xt(e,t,n,r){return F().getStashFileDiff({repoId:e,stashSha:t,path:n,oldPath:r})}function Zt(e,t){return F().stashAction({repoId:e,action:`create`,message:t})}function Qt(e,t){return F().stashAction({repoId:e,action:`apply`,stashSha:t})}function $t(e,t){return F().stashAction({repoId:e,action:`drop`,stashSha:t})}function en(e,t,n){return F().stageAction({repoId:e,action:t,paths:n})}function tn(e,t,n,r){return F().installAndResolveLockfile({repoId:e,path:t,fileName:n,command:r})}function nn(e,t,n,r){return F().getWorktreeFileDiff({repoId:e,path:t,area:n,oldPath:r})}function rn(e,t,n,r){return F().commit({repoId:e,message:t,noVerify:n,amend:r})}function an(e,t){return F().queryHistory(t)}function on(e,t){return F().getCommitDetail({repoId:e,sha:t})}function sn(e,t){return F().getCommitAuthor({repoId:e,sha:t})}function cn(e,t){return F().getCommitDiff({repoId:e,sha:t})}function ln(e,t,n,r){return F().getCommitFileDiff({repoId:e,sha:t,path:n,oldPath:r})}function un(e,t){return F().getCommitPRs({repoId:e,sha:t})}function dn(e,t){return F().getCommitCIStatuses({repoId:e,shas:t})}function fn(e,t,n){return F().commitAction({repoId:e,action:t,sha:n})}function pn(e,t){return F().getMergePreview({repoId:e,refName:t})}function mn(e,t){return F().mergeRef({repoId:e,refName:t})}function hn(e,t){return F().rebaseRef({repoId:e,refName:t})}function gn(e,t){return F().abortOperation({repoId:e,operation:t})}function _n(e,t){return F().continueOperation({repoId:e,operation:t})}function vn(e,t,n,r,i){return F().refAction({repoId:e,action:t,refName:n,sha:r,force:i})}function yn(e,t,n){return F().getReflog({repoId:e,ref:t,maxCount:n})}function bn(){return F().listAgentSessions({})}function xn(e,t){return F().focusAgentSession({pid:e,cwd:t})}function Sn(){return F().installWindowCalls({})}var Cn=class{activeLanes=new Map;reserved=new Map;nextSideFromCenter=`right`;firstParentChildren;constructor(e,t){this.firstParentChildren=t??new Map}reserveLane(e,t){this.reserved.set(e,t),this.activeLanes.set(t,e)}assignLane(e,t){let n=this.reserved.get(e);if(n!==void 0)this.reserved.delete(e),this.activeLanes.set(n,e);else{let r=t[0],i=r?this.reserved.get(r):void 0;n=i===void 0?this.findFreeLane():this.findFreeLaneNear(i),this.activeLanes.set(n,e)}if(t.length===0)return this.activeLanes.delete(n),n;let r=t[0];this.reserved.has(r)?this.reserved.get(r)===n?this.activeLanes.set(n,r):this.activeLanes.delete(n):(this.reserved.set(r,n),this.activeLanes.set(n,r));for(let e=1;e<t.length;e++){let n=t[e];if(!this.reserved.has(n)){let e=this.findOccupiedLineLane(n)??this.findFreeLaneOutsideCluster();this.reserved.set(n,e),this.activeLanes.set(e,n)}}return n}findOccupiedLineLane(e){let t=new Set([e]),n=this.firstParentChildren.get(e)??[];for(;n.length>0&&t.size<=128;){let e=[];for(let r of n){if(t.has(r))continue;t.add(r);let n=this.reserved.get(r);if(n!==void 0&&this.isLaneHeldBy(n,t))return n;e.push(...this.firstParentChildren.get(r)??[])}n=e}}isLaneHeldBy(e,t){let n=this.activeLanes.get(e);return n===void 0||t.has(n)}findFreeLane(){if(!this.activeLanes.has(0))return 0;for(let e=1;;e++){let t=this.activeLanes.has(-e)?void 0:-e,n=this.activeLanes.has(e)?void 0:e;if(!(t===void 0&&n===void 0))return this.pickLaneFromCenter(t,n)}}findFreeLaneNear(e){for(let t=1;;t++){let n=e-t,r=e+t,i=!this.activeLanes.has(n),a=!this.activeLanes.has(r);if(!(!i&&!a))return e<0?i?n:r:e>0?a?r:n:this.pickLaneFromCenter(i?n:void 0,a?r:void 0)}}findFreeLaneOutsideCluster(){if(this.activeLanes.size===0)return this.findFreeLane();let e=1/0,t=-1/0;for(let n of this.activeLanes.keys())n<e&&(e=n),n>t&&(t=n);return this.pickLaneFromCenter(e-1,t+1)}pickLaneFromCenter(e,t){if(e===void 0&&t===void 0)throw Error(`pickLaneFromCenter requires at least one candidate lane`);if(e===void 0)return this.recordChosenSide(`right`),t;if(t===void 0)return this.recordChosenSide(`left`),e;let n=this.sideLoad(`left`),r=this.sideLoad(`right`);if(n<r)return this.recordChosenSide(`left`),e;if(r<n)return this.recordChosenSide(`right`),t;let i=this.nextSideFromCenter;return this.recordChosenSide(i),i===`left`?e:t}sideLoad(e){let t=0;for(let n of this.activeLanes.keys())e===`left`&&n<0&&t++,e===`right`&&n>0&&t++;return t}recordChosenSide(e){this.nextSideFromCenter=e===`left`?`right`:`left`}snapshot(){return{activeLanes:[...this.activeLanes.entries()].sort((e,t)=>e[0]-t[0]).map(([e,t])=>({lane:e,sha:t})),nextSideFromCenter:this.nextSideFromCenter}}restore(e){this.activeLanes=new Map,this.reserved=new Map,this.nextSideFromCenter=e.nextSideFromCenter;for(let t of e.activeLanes)this.activeLanes.set(t.lane,t.sha),this.reserved.set(t.sha,t.lane)}};function wn(e,t){let n=t===void 0?void 0:Math.max(0,Math.floor(t));if(n===0)return new Map(e.map(e=>[e.sha,0]));let{segments:r,centerMergeTargetIds:i,preferredChildByParent:a}=Tn(e),o=new Map(r.map(e=>[e.id,e])),s=Dn(r,o,n,i),c=new Map;for(let e of r)if(e.lane===0)for(let t of e.shas)c.set(t,0);return jn(r.filter(e=>s.get(e.id)===`left`),`left`,c,o,n,i),jn(r.filter(e=>s.get(e.id)===`right`),`right`,c,o,n,i),n!==void 0&&In(r,c,n),Fn(e,c,a),c}function Tn(e){let t=new Map(e.map(e=>[e.sha,e])),n=new Map;for(let t of e){let e=t.parentShas[0];if(!e)continue;let r=n.get(e);r?r.push(t):n.set(e,[t])}let r=new Set;for(let n of e)for(let e of n.parentShas.slice(1)){let i=t.get(e);i&&(n.lane===0&&i.lane!==0?r.add(i.sha):n.lane!==0&&i.lane===0&&r.add(n.sha))}let i=new Map;for(let n of e){let e=(i.get(n.sha)??0)+ +!!r.has(n.sha);i.set(n.sha,e);let a=n.parentShas[0];a&&t.has(a)&&i.set(a,Math.max(i.get(a)??0,e))}let a=new Map;for(let[e,r]of n){if(r.length<2)continue;let n=t.get(e);if(!n||n.lane===0)continue;let o=r.find(e=>e.lane===n.lane);if(!o)continue;let s=o,c=i.get(s.sha)??0;for(let e of r){let t=i.get(e.sha)??0;Math.sign(e.lane)===Math.sign(s.lane)&&t>=2&&t>c&&(s=e,c=t)}s.sha!==o.sha&&a.set(e,s.sha)}let o=new Map(e.map(e=>[e.sha,e.sha])),s=e=>{let t=o.get(e);if(t===e)return e;let n=s(t);return o.set(e,n),n},c=(e,t)=>{let n=s(e),r=s(t);n!==r&&o.set(r,n)};for(let n of e){let e=n.parentShas[0],r=e?t.get(e):void 0;r?.lane===n.lane&&c(n.sha,r.sha)}let l=new Set([...r].map(e=>s(e)));for(let r of e){if(r.lane===0)continue;let e=r.parentShas[0],i=e?t.get(e):void 0;!i||i.lane===0||i.lane===r.lane||new Set((n.get(i.sha)??[]).map(e=>s(e.sha)).filter(e=>l.has(e))).size===1&&l.has(s(r.sha))&&l.has(s(i.sha))&&c(r.sha,i.sha)}let u=new Map;for(let n of e){let e=s(n.sha),r=u.get(e);r||(r={id:e,lane:n.lane,shas:[],startRow:n.row,endRow:n.row,continuity:0,maxConcurrency:1},u.set(e,r)),r.shas.push(n.sha),r.startRow=Math.min(r.startRow,n.row),r.endRow=Math.max(r.endRow,n.row);let i=n.parentShas[0],a=i?t.get(i):void 0;a&&(r.continuity+=Math.abs(a.row-n.row),a.lane!==n.lane&&En(r,a.row))}for(let n of e)for(let e of n.parentShas.slice(1)){let r=t.get(e);if(!r)continue;let i=u.get(s(r.sha));i&&(i.continuity+=Math.abs(r.row-n.row),En(i,n.row))}for(let n of e){let e=n.parentShas[0],r=e?t.get(e):void 0;if(!r)continue;let i=u.get(s(n.sha)),a=u.get(s(r.sha));i&&a&&i.id!==a.id&&i.lane!==0&&a.lane!==0&&(i.inwardSegmentId??=a.id)}let d=new Set;for(let e of l)d.add(s(e));return{segments:[...u.values()],centerMergeTargetIds:d,preferredChildByParent:a}}function En(e,t){e.startRow=Math.min(e.startRow,t),e.endRow=Math.max(e.endRow,t)}function Dn(e,t,n,r){let i=new Map,a=new Set,o={left:0,right:0},s=e.filter(e=>{if(e.lane===0||!r?.has(e.id))return!1;let n=e.inwardSegmentId?t.get(e.inwardSegmentId):void 0;return!n||n.lane===0}).sort(Mn);for(let e of s){let t=o.right<=o.left?`right`:`left`;i.set(e.id,t),o[t]++}let c=e=>{let n=i.get(e.id);if(n)return n;if(a.has(e.id))return e.lane<0?`left`:`right`;a.add(e.id);let r=e.inwardSegmentId?t.get(e.inwardSegmentId):void 0,o=r&&r.lane!==0?c(r):e.lane<0?`left`:`right`;return a.delete(e.id),i.set(e.id,o),o};for(let t of e)t.lane!==0&&c(t);return n!==void 0&&On(e,t,n,i),i}function On(e,t,n,r){let i={left:new Map,right:new Map},a=new Map,o=new Set,s=e=>{let n=a.get(e.id);if(n)return n;if(o.has(e.id))return e.id;o.add(e.id);let r=e.inwardSegmentId?t.get(e.inwardSegmentId):void 0,i=r&&r.lane!==0?s(r):e.id;return o.delete(e.id),a.set(e.id,i),i},c=new Map;for(let t of e){if(t.lane===0)continue;let e=s(t),n=c.get(e);n?n.push(t):c.set(e,[t])}let l=[...c.entries()].sort((e,n)=>{let r=e[1].reduce((e,t)=>e+t.continuity,0);return n[1].reduce((e,t)=>e+t.continuity,0)-r||Mn(t.get(e[0]),t.get(n[0]))});for(let[e,a]of l){let o=t.get(e),s=r.get(o.id)??(o.lane<0?`left`:`right`),c=s===`left`?`right`:`left`,l=kn(a,i[s],n),u=kn(a,i[c],n)<l?c:s;for(let e of a)r.set(e.id,u);An(a,i[u],n)}}function kn(e,t,n){return An(e,new Map([...t].map(([e,t])=>[e,[...t]])),n)}function An(e,t,n){let r=0;for(let i of[...e].sort(Mn)){let e=Rn(i,t,n,Math.min(Math.abs(i.lane),n)),a=t.get(e)??[];r+=a.reduce((e,t)=>e+Hn(i,t),0),a.length>0?a.push(i):t.set(e,[i])}return r}function jn(e,t,n,r,i,a){if(e.length===0)return;let o=new Map,s=new Map,c=e.filter(e=>{if(a?.has(e.id))return!1;let t=e.inwardSegmentId?r.get(e.inwardSegmentId):void 0;return t!==void 0&&t.lane!==0}),l=new Set(c.map(e=>e.id)),u=e.filter(e=>!l.has(e.id));Nn(u);let d=i??Math.max(0,...u.map(e=>Math.abs(e.lane))),f=u.filter(e=>a?.has(e.id)).sort(Mn);for(let e of f){let r=Bn(e,o,1,d,1);r??=i===void 0?zn(e,o,d+1):Rn(e,o,d,1),Pn(e,r,t,n,o,s)}let p=[...u].filter(e=>!a?.has(e.id)).sort(Mn);for(let e of p){let r=i===void 0?e.maxConcurrency:Math.min(e.maxConcurrency,d),a=Bn(e,o,r,1,-1);a===void 0&&(a=Bn(e,o,r+1,d,1)),a??=i===void 0?Math.abs(e.lane):Rn(e,o,d,Math.min(Math.abs(e.lane),d)),Pn(e,a,t,n,o,s)}let m=new Set(c);for(;m.size>0;){let e=[...m].filter(e=>e.inwardSegmentId!==void 0&&s.has(e.inwardSegmentId)).sort((e,t)=>s.get(e.inwardSegmentId)-s.get(t.inwardSegmentId)||e.continuity-t.continuity||e.endRow-e.startRow-(t.endRow-t.startRow)||e.startRow-t.startRow||e.id.localeCompare(t.id));if(e.length===0){for(let e of m){let r=Math.max(1,Math.abs(e.lane));Pn(e,i===void 0?zn(e,o,r):Ln(e,o,i,Math.min(r,i)),t,n,o,s)}break}for(let r of e){let e=s.get(r.inwardSegmentId);Pn(r,i===void 0?zn(r,o,e+1):Ln(r,o,i,Math.min(e+1,i),e),t,n,o,s),m.delete(r)}}}function Mn(e,t){return t.continuity-e.continuity||t.endRow-t.startRow-(e.endRow-e.startRow)||e.startRow-t.startRow||Math.abs(e.lane)-Math.abs(t.lane)||e.id.localeCompare(t.id)}function Nn(e){let t=[...e].sort((e,t)=>e.startRow-t.startRow),n=[];for(let e of t){n=n.filter(t=>t.endRow>=e.startRow),n.push(e);let t=n.length;for(let e of n)e.maxConcurrency=Math.max(e.maxConcurrency,t)}}function Pn(e,t,n,r,i,a){let o=i.get(t);o?o.push(e):i.set(t,[e]),a.set(e.id,t);let s=n===`left`?-t:t;for(let t of e.shas)r.set(t,s)}function Fn(e,t,n){if(n.size===0)return;let r=new Map(e.map(e=>[e.sha,e])),i=new Map;for(let t of e){let e=t.parentShas[0];if(!e)continue;let n=i.get(e);n?n.push(t):i.set(e,[t])}for(let[a,o]of n){let n=r.get(a),s=r.get(o);if(!n||!s)continue;let c=(i.get(a)??[]).find(e=>e.lane===n.lane);if(!c)continue;let l=t.get(a),u=t.get(c.sha),d=t.get(o);if(l===void 0||u!==l||d===void 0||d===l||d===0||Math.sign(d)!==Math.sign(l))continue;let f=[],p=n;for(;p&&p.lane===n.lane&&t.get(p.sha)===l;){f.push(p);let e=p.parentShas[0];p=e?r.get(e):void 0}if(f.length===0)continue;let m=new Set(f.map(e=>e.sha)),{startRow:h,endRow:g}=f.reduce((e,t)=>({startRow:Math.min(e.startRow,t.row),endRow:Math.max(e.endRow,t.row)}),{startRow:1/0,endRow:-1/0}),_=(e,t)=>Math.max(Math.min(e,t),h)<Math.min(Math.max(e,t),g),v=!0;for(let n of e){if(m.has(n.sha))continue;let e=t.get(n.sha);if(e===d&&n.row>=h&&n.row<=g){v=!1;break}let i=n.parentShas[0],a=i?r.get(i):void 0;if(n.sha!==o&&e===d&&a&&_(n.row,a.row)){v=!1;break}for(let e of n.parentShas.slice(1)){let i=r.get(e);if(i&&!m.has(i.sha)&&t.get(i.sha)===d&&_(n.row,i.row)){v=!1;break}}if(!v)break}if(v)for(let e of f)t.set(e.sha,d)}}function In(e,t,n){if(n<1)return;let r=e.filter(e=>e.lane!==0),i=new Map(r.map(e=>[e.id,t.get(e.shas[0])??0])),a=Array.from({length:n*2},(e,t)=>{let r=t%n+1;return t<n?r:-r}),o=[...r].sort((e,t)=>e.continuity-t.continuity||e.endRow-e.startRow-(t.endRow-t.startRow)||t.startRow-e.startRow||e.id.localeCompare(t.id)),s=(e,t)=>r.reduce((n,r)=>r.id===e.id||i.get(r.id)!==t?n:n+Hn(e,r),0),c=!0;for(;c;){c=!1;for(let e of o){let n=i.get(e.id),r=s(e,n);if(r===0)continue;let o=n,l=r,u=1/0;for(let t of a){if(Math.sign(t)!==Math.sign(n))continue;let i=s(e,t),a=Math.abs(t-n);(i<l||i===l&&i<r&&a<u)&&(o=t,l=i,u=a)}if(!(o===n||l>=r)){i.set(e.id,o);for(let n of e.shas)t.set(n,o);c=!0}}}}function Ln(e,t,n,r,i){let a=Bn(e,t,r,n,1);return a===i&&(a=void 0),a===void 0&&(a=Bn(e,t,1,r-1,1),a===i&&(a=void 0)),a??Rn(e,t,n,r,i)}function Rn(e,t,n,r,i){let a=1,o=1/0,s=1/0;for(let c=1;c<=n;c++){if(n>1&&c===i)continue;let l=(t.get(c)??[]).reduce((t,n)=>t+Hn(e,n),0),u=Math.abs(c-r);(l<o||l===o&&u<s||l===o&&u===s&&c<a)&&(a=c,o=l,s=u)}return a}function zn(e,t,n){for(let r=n;;r++)if((t.get(r)??[]).every(t=>!Vn(e,t)))return r}function Bn(e,t,n,r,i){for(let a=n;i>0?a<=r:a>=r;a+=i)if((t.get(a)??[]).every(t=>!Vn(e,t)))return a}function Vn(e,t){return e.startRow<=t.endRow&&t.startRow<=e.endRow}function Hn(e,t){let n=Math.max(e.startRow,t.startRow),r=Math.min(e.endRow,t.endRow);return r<n?0:r-n+1}function Un(e,t,n){let r=[];for(let{sha:i,parentShas:a,row:o,lane:s}of e)for(let e=0;e<a.length;e++){let i=a[e],c=t.get(i)??-1,l=n.get(i)??s,u;u=e===0?s===l?`linear`:`fork`:`merge`,r.push({fromRow:o,toRow:c,fromLane:s,toLane:l,kind:u})}return r}var Wn=class{id;repoId;scope;ordering;entries=[];shaIndex=new Map;firstParentChildren=new Map;constructor(e,t,n,r){this.id=e,this.repoId=t,this.scope=n,this.ordering=r}appendEntries(e){let t=this.entries.length;for(let n=0;n<e.length;n++){let{sha:r,parentShas:i}=e[n],a=t+n;this.entries.push({sha:r,parentShas:i,row:a}),this.shaIndex.set(r,a);let o=i[0];if(o){let e=this.firstParentChildren.get(o);e?e.push(r):this.firstParentChildren.set(o,[r])}}}getWindow(e,t,n){let r=Math.max(0,e-t),i=Math.min(this.entries.length-1,e+n);return{entries:this.entries.slice(r,i+1),startRow:r,endRow:i}}findRow(e){return this.shaIndex.get(e)}totalRows(){return this.entries.length}getKnownParentShas(e){return e.filter(e=>this.shaIndex.has(e))}checkpoint(e=256){let t=[],n=new Cn(void 0,this.firstParentChildren);for(let r=0;r<this.entries.length;r++){let i=this.entries[r];r%e===0&&t.push({row:i.row,sha:i.sha,laneSnapshot:n.snapshot()}),n.assignLane(i.sha,this.getKnownParentShas(i.parentShas))}return t}restoreFrom(e,t){t.restore(e.laneSnapshot)}computeGeometry(e,t,n,r){let i=Math.max(0,e),a=Math.min(this.entries.length-1,t),o=new Cn(void 0,this.firstParentChildren);if(r){let e=r;for(;e!==void 0;){o.reserveLane(e,0);let t=this.shaIndex.get(e);if(t===void 0)break;let n=this.entries[t];e=n.parentShas.length>0?n.parentShas[0]:void 0}}let s=0;n&&n.row<=i&&(this.restoreFrom(n,o),s=n.row);for(let e=s;e<i;e++){let t=this.entries[e];o.assignLane(t.sha,this.getKnownParentShas(t.parentShas))}let c=new Map,l=[];for(let e=i;e<=a;e++){let t=this.entries[e],n=o.assignLane(t.sha,this.getKnownParentShas(t.parentShas));c.set(t.sha,n),l.push({sha:t.sha,parentShas:t.parentShas,row:t.row,lane:n})}let u=wn(l);for(let e of l)e.lane=u.get(e.sha)??e.lane,c.set(e.sha,e.lane);let d=new Map,f=new Map(c);for(let e of this.entries)d.set(e.sha,e.row);return{lanes:c,edges:Un(l,d,f)}}};function Gn(e,t){return{...e,headSha:t,staged:[]}}function Kn(e,t,n){let r={...e,headSha:t};if(n)return{...r,branch:n};let{branch:i,...a}=r;return a}var qn=0;function Jn(e){return qn+=1,`optimistic-${e}-${Date.now().toString(36)}-${qn}`}function Yn(e){return{authorName:e.authorName,authorEmail:e.authorEmail,authorUnix:e.authorUnix,committerUnix:e.committerUnix,subject:e.subject,additions:e.additions,deletions:e.deletions,locChanged:e.locChanged,bodyPreview:e.bodyPreview}}function Xn(e){return e.find(e=>e.kind===`head`&&e.isCurrent)??null}function Zn(e,t){return e.find(e=>e.shortName===t)??null}function Qn(e){return e.peeledSha??e.targetSha}function $n(e,t){let n=new Set,r=[e];for(;r.length>0;){let e=r.pop();if(n.has(e))continue;n.add(e);let i=t.get(e);if(i)for(let e of i)n.has(e)||r.push(e)}return n}function er(e,t,n){let r=new Wn(`optimistic`,`optimistic`,{kind:`all`},`date`);r.appendEntries(e.map(e=>({sha:e.sha,parentShas:e.parentShas})));let{lanes:i}=r.computeGeometry(0,e.length-1,void 0,n??void 0),a=new Map;for(let e of t){let t=Qn(e),n=a.get(t);n?n.push(e.shortName):a.set(t,[e.shortName])}return e.map((e,t)=>({row:t,sha:e.sha,parentShas:e.parentShas,authorName:e.meta.authorName,authorEmail:e.meta.authorEmail,authorUnix:e.meta.authorUnix,committerUnix:e.meta.committerUnix,subject:e.meta.subject,additions:e.meta.additions,deletions:e.meta.deletions,locChanged:e.meta.locChanged,bodyPreview:e.meta.bodyPreview,refNames:a.get(e.sha)??[],lane:i.get(e.sha)??0}))}function tr(e){return e.map(e=>({sha:e.sha,parentShas:e.parentShas,meta:Yn(e)}))}function nr(e,t){return e.map(e=>{if(e.kind!==`head`)return e;let n=t!==null&&e.shortName===t;return!!e.isCurrent===n?e:{...e,isCurrent:n}})}function rr(e,t,n){return e.map(e=>e.kind===`head`&&e.shortName===t?{...e,targetSha:n,peeledSha:void 0}:e)}function ir(e,t,n,r){if(e.length===0)return null;let i=nr(t,n);return{rows:er(tr(e),i,r),refs:i,headSha:r}}function ar(e,t,n,r){if(e.length===0)return null;let i=Zn(t,n);if(!i||i.kind!==`head`)return null;let a=rr(t,n,r),o=Xn(a),s=o?o.targetSha:null;return{rows:er(tr(e),a,s),refs:a,headSha:s}}function or(e,t,n){let r=Xn(t);if(!r)return null;let i=e.find(e=>e.sha===n);if(!i)return null;let a=i.parentShas[0];if(!a)return null;let o=t.some(e=>e!==r&&Qn(e)===n&&e.shortName!==r.shortName),s=tr(e);o||(s=s.filter(e=>e.sha!==n));let c=rr(t,r.shortName,a);return{rows:er(s,c,a),refs:c,headSha:a}}function sr(e,t,n,r){let i=Xn(t);if(!i)return null;let a=i.targetSha;if(!e.some(e=>e.sha===a))return null;let o=Math.floor(Date.now()/1e3),s=Jn(r),c=[{sha:s,parentShas:[a],meta:{authorName:``,authorEmail:``,authorUnix:o,committerUnix:o,subject:n,additions:0,deletions:0,locChanged:0}},...tr(e)],l=rr(t,i.shortName,s);return{rows:er(c,l,s),refs:l,headSha:s}}function cr(e,t,n){let r=Xn(t);if(!r)return null;let i=r.targetSha,a=e.find(e=>e.sha===i);if(!a)return null;let o=Jn(`amend`),s={sha:o,parentShas:a.parentShas,meta:{...Yn(a),subject:n}},c=t.some(e=>e!==r&&e.shortName!==r.shortName&&Qn(e)===i)?[s,...tr(e)]:tr(e).map(e=>e.sha===i?s:e),l=rr(t,r.shortName,o);return{rows:er(c,l,o),refs:l,headSha:o}}function lr(e,t,n){let r=Xn(t);if(!r)return null;let i=Zn(t,n);if(!i)return null;let a=r.targetSha,o=Qn(i);if(!e.some(e=>e.sha===a))return null;let s=new Map(e.map(e=>[e.sha,e.parentShas])),c=$n(o,s);if($n(a,s).has(o))return null;if(c.has(a)){if(!e.some(e=>e.sha===o))return null;let n=rr(t,r.shortName,o);return{rows:er(tr(e),n,o),refs:n,headSha:o}}if(!e.some(e=>e.sha===o))return null;let l=Math.floor(Date.now()/1e3),u=Jn(`merge`),d=[{sha:u,parentShas:[a,o],meta:{authorName:``,authorEmail:``,authorUnix:l,committerUnix:l,subject:`Merge ${n}`,additions:0,deletions:0,locChanged:0}},...tr(e)],f=rr(t,r.shortName,u);return{rows:er(d,f,u),refs:f,headSha:u}}function ur(e,t,n){let r=Xn(t);if(!r)return null;let i=Zn(t,n);if(!i)return null;let a=r.targetSha,o=Qn(i);if(!e.some(e=>e.sha===a)||!e.some(e=>e.sha===o))return null;let s=new Map(e.map(e=>[e.sha,e.parentShas])),c=$n(a,s),l=$n(o,s);if(l.has(a)){let n=rr(t,r.shortName,o);return{rows:er(tr(e),n,o),refs:n,headSha:o}}let u=e.filter(e=>c.has(e.sha)&&!l.has(e.sha));if(u.length===0||u.some(e=>e.parentShas.length>1))return null;let d=new Set(u.map(e=>e.sha)),f=u[u.length-1],p=tr(e).filter(e=>!d.has(e.sha));if(!p.some(e=>e.sha===o))return null;let m=Math.floor(Date.now()/1e3),h=[...u.map(e=>({sha:e.sha,parentShas:e.sha===f.sha?[o]:e.parentShas,meta:{...Yn(e),committerUnix:m}})),...p],g=t.slice();return{rows:er(h,g,a),refs:g,headSha:a}}function dr(e,t,n){return e+t>=n/2}function fr(e,t,n){return n&&e!==t}function pr(e,t){if(!e||e.rows.every((e,n)=>t.rows[n]?.sha===e.sha))return t;let n=new Set(e.rows.map(e=>e.sha)),r=t.rows.filter(e=>!n.has(e.sha));return r.length===0?{...e,hasMoreAfter:t.hasMoreAfter}:{...t,rows:[...e.rows,...r],edges:[...e.edges,...t.edges],hasMoreBefore:e.hasMoreBefore}}var mr=80,hr=.2,gr=3,_r=[`#89b4fa`,`#a6e3a1`,`#f9e2af`,`#f38ba8`,`#cba6f7`,`#94e2d5`,`#fab387`,`#74c7ec`,`#f5c2e7`,`#b4befe`];function vr(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)>>>0;return t}function yr(e){return _r[(e%_r.length+_r.length)%_r.length]}function br(e){return _r[vr(e)%_r.length]}function xr(e,t){let n=Math.max(0,e),r=n/2,i=(n>=480?Math.floor(gr/2):0)*80+80/2,a=Math.max(0,r-i),o=Math.min(Math.max(0,t),Math.max(0,a-120)),s=Math.min(520,Math.max(mr,n*hr)),c=Math.min(s,Math.max(0,a-80)),l=120+o,u=80+c,d=Math.max(80/2,Math.min(r-l,n-r-u));return{extraLeftGutter:o,rightGutter:c,maxLaneRadius:Math.max(0,Math.floor((d-80/2)/80)),laneCenterX:r,layoutWidth:n}}function Sr(e,t,n,r){let i=Math.max(n,.1),a=Math.max(0,e),o=Math.max(0,t);return{...xr(a/i,r),laneCenterX:(a/2-o)/i,layoutWidth:Math.max(0,a-o)/i}}function Cr(e,t){if(e.length===0)return{laneCenterX:t.laneCenterX,laneRadius:t.maxLaneRadius,totalWidth:t.layoutWidth};let n=1/0,r=-1/0;for(let t of e)n=Math.min(n,t.lane),r=Math.max(r,t.lane);let i=t.maxLaneRadius,a=-((n+r)/2)*80,o=(-i-n)*80,s=(i-r)*80,c=Math.max(o,Math.min(s,a));return{laneCenterX:t.laneCenterX+c,laneRadius:i,totalWidth:t.layoutWidth}}function wr(e,t){let n=wn(e,t),r=!1,i=e.map(e=>{let t=n.get(e.sha)??0;return t===e.lane?e:(r=!0,{...e,lane:t})});return r?i:e}function Tr(e,t){let n=t.get(e);return n?br(n):_r[vr(e)%_r.length]}function Er(e){return e.length===0?null:e.find(e=>!e.includes(`/`))||(e.find(e=>e.includes(`/`)&&e!==`origin`&&e!==`HEAD`)??null)}function Dr(e,t=0,n=520,r){let i=1/0,a=-1/0,o=[],s=new Map,c=new Map;for(let t=0;t<e.length;t++){let n=e[t];n.lane<i&&(i=n.lane),n.lane>a&&(a=n.lane),c.set(n.sha,n)}let l=Number.isFinite(i)?i:0,u=Number.isFinite(a)?a:0,d=r?.laneRadius??Math.max(Math.abs(l),Math.abs(u)),f=160+t;for(let t=0;t<e.length;t++){let n=e[t],i={row:n,x:r?r.laneCenterX+n.lane*80:f+(n.lane+d)*80,y:152+t*56,idx:t};o.push(i),s.set(n.sha,i)}let p=new Map;for(let t of e){let e=Er(t.refNames);if(!e)continue;let n=t.sha;for(;n&&!p.has(n);){p.set(n,e);let t=c.get(n);if(!t||t.parentShas.length===0)break;n=t.parentShas[0]}}let m=new Map;for(let e of o)m.set(e.row.sha,Tr(e.row.sha,p));return{nodes:o,shaToNode:s,shaToBranch:p,shaToColor:m,maxLane:a,totalWidth:r?.totalWidth??200+t+(d*2+1)*80+n,totalHeight:e.length*56+80+112}}function Or(e,t){let n=e.nodes.map((e,n)=>({...e,row:t[n]}));return{...e,nodes:n,shaToNode:new Map(n.map(e=>[e.row.sha,e]))}}function kr(e,t){if(!t)return e;let n=e.findIndex(e=>e.refNames.includes(t));if(n<=0)return e;let r=e[n],i=r.lane,a=new Map;for(let t=0;t<n;t++){let n=e[t].parentShas[0];if(!n)continue;let r=a.get(n);r?r.push(t):a.set(n,[t])}let o=new Set,s=[r.sha],c=new Set;for(;s.length>0;){let t=s.pop();if(!c.has(t)){c.add(t);for(let n of a.get(t)??[]){let t=e[n];t.lane===i&&(o.add(n),s.push(t.sha))}}}if(o.size===0)return e;let l=Math.min(...o),u=Math.max(0,l-1),d=n-1,f=new Map(e.map((e,t)=>[e.sha,t])),p=t=>{for(let n=0;n<e.length;n++){if(o.has(n))continue;let r=e[n];if(r.lane===t&&u<=n&&n<=d)return!1;let i=f.get(r.parentShas[0]??``);if(!(i===void 0||r.lane!==t)&&e[i].lane===t&&Math.min(n,i)<=d&&u<=Math.max(n,i))return!1}return!0},m=Math.max(i,...e.map(e=>e.lane)),h=Math.max(i+1,m);for(;!p(h);)h++;return e.map((e,t)=>o.has(t)?{...e,lane:h}:e)}var Ar=12,jr=new WeakMap,Mr=new Map,Nr={requests:0,referenceHits:0,topologyHits:0,builds:0,totalBuildMs:0};function Pr(e){return e?e.staged.length+e.unstaged.length:0}function Fr(e){return e.find(e=>e.isCurrent)?.shortName??null}function Ir(e,t,n){return`${e??``}\u0000${+!!t}\u0000${n}`}function Lr(e,t){let n=`${t}|${e.length}`;for(let t of e)n+=`\u0001${t.sha}\u0002${t.lane}\u0002${t.parentShas.join(`,`)}\u0002${t.refNames.join(`,`)}`;return n}function Rr(){return typeof performance>`u`?Date.now():performance.now()}function zr(e,t){if(Mr.delete(e),Mr.set(e,t),Mr.size>Ar){let e=Mr.keys().next().value;e!==void 0&&Mr.delete(e)}}function Br(e,t,n,r){if(!e||e.rows.length===0)return null;Nr.requests++;let i=e.rows,a=Fr(t),o=Pr(n)>0,s=r?260:0,c=Ir(a,o,s),l=jr.get(i),u=l?.get(c);if(u)return Nr.referenceHits++,u;let d=o?kr(i,a):i,f=Lr(d,s),p=Mr.get(f),m;if(p)Nr.topologyHits++,m=p.rows===d?p.layout:Or(p.layout,d),zr(f,{rows:d,layout:m});else{let e=Rr();m=Dr(d,s),Nr.totalBuildMs+=Rr()-e,Nr.builds++,zr(f,{rows:d,layout:m})}let h={currentBranch:a,renderedRows:d,layout:m},g=l??new Map;return g.set(c,h),l||jr.set(i,g),h}function Vr(){return{status:`no-repo`,repoId:null,repoPath:null,currentWorktreePath:null,totalCommitCount:0,recentRepos:[],discoveredFolder:null,discoveredRepos:[],githubUrl:null,openError:null}}function Hr(){return{refs:[],historyWindow:null,graphModel:null,reflog:null,reflogLoading:!1,reflogMaxCount:300,selectedSha:null,selectedRefName:null,scrollToSha:null,scrollToKey:0,commitDetail:null,commitDiff:null,commitPRs:[],commitAuthorAvatars:{},mergePreview:null,loadingMore:!1,commitCIStatus:{},pendingMutation:!1,pendingCheckout:!1,graphAnimationSuppressToken:0}}function Ur(e,t){return`${e}:${t}`}function Wr(e,t){return`${e}:${t}`}function Gr(e,t){return`${e}:${t}`}function Kr(){return{stashes:[],selectedStashSha:null,stashDiff:null,stashFileDiffs:{},worktrees:[],worktreeChanges:null,worktreeSelected:!1,worktreeCommitMessage:``,worktreeFileDiffs:{},commitFileDiffs:{}}}var qr=.1;function Jr(e,t){try{let n=localStorage.getItem(e);return n===null?t:n===`true`}catch{return t}}function Yr(e){return Number.isFinite(e)?Math.max(qr,Math.min(3,e)):1}function Xr(e){let t=Yr(e);try{localStorage.setItem(`graphZoom`,String(t))}catch{}return t}function Zr(){try{let e=localStorage.getItem(`graphZoom`);return e===null?1:Yr(Number(e))}catch{return 1}}function Qr(){return{viewMode:`history`,errorDialog:null,showCommitMessages:Jr(`showCommitMessages`,!0),showGutterColors:Jr(`showGutterColors`,!1),graphZoom:Zr()}}var $r=100,ei=1e3,ti=500,ni=12,ri=3e4,ii=13e4,ai=class extends Error{constructor(){super(`The operation timed out`),this.name=`MutationTimeoutError`}};function oi(e,t){return new Promise((n,r)=>{let i=setTimeout(()=>r(new ai),t);e.then(e=>{clearTimeout(i),n(e)},e=>{clearTimeout(i),r(e)})})}function si(e){return e.startsWith(`optimistic-`)||e.startsWith(`preview:`)}function ci(e){return new Set(e.unstaged.filter(e=>e.status===`U`).map(e=>e.path)).size}function li(e){return e.staged.length+e.unstaged.length}function ui(e,t,n,r){if(!n){e({pendingMutation:!0,...r?{selectedSha:null,selectedRefName:r,commitDetail:null,commitDiff:null,commitPRs:[],commitFileDiffs:{},mergePreview:null}:{}});return}e(e=>({pendingMutation:!0,refs:n.refs,historyWindow:fi(t.historyWindow,n.rows),selectedSha:r?null:n.headSha,selectedRefName:r??null,scrollToSha:n.headSha,scrollToKey:e.scrollToKey+1,commitDetail:null,commitDiff:null,commitPRs:[],commitFileDiffs:{},mergePreview:null}))}function di(e){return{refs:e.refs,historyWindow:e.historyWindow,worktreeChanges:e.worktreeChanges,selectedSha:e.selectedSha,selectedRefName:e.selectedRefName,scrollToSha:e.scrollToSha,totalCommitCount:e.totalCommitCount,mergePreview:e.mergePreview,commitDetail:e.commitDetail,commitDiff:e.commitDiff,commitPRs:e.commitPRs,commitFileDiffs:e.commitFileDiffs}}function fi(e,t){return e?{...e,rows:t,totalRowsKnown:t.length,checkpointsKnownUntilRow:Math.max(0,t.length-1)}:null}function pi(e){return Promise.all([Wt(e),an(e,{repoId:e,scope:{kind:`all`},anchor:{kind:`head`},beforeRows:0,afterRows:ei,firstParent:!1,topoOrder:!0})])}async function mi(e){let[[t,n],r,i]=await Promise.all([pi(e),qt(e),Gt(e)]);return[t,n,r,i]}function hi(e){return Promise.all([Wt(e),an(e,{repoId:e,scope:{kind:`all`},anchor:{kind:`head`},beforeRows:0,afterRows:ei,firstParent:!1,topoOrder:!0}),qt(e),Gt(e),Jt(e)])}function gi(e,t){Promise.all([on(e,t),cn(e,t)]).then(([e,n])=>{I.getState().selectedSha===t&&I.setState({commitDetail:e,commitDiff:n})}).catch(e=>console.error(`Failed to load commit detail:`,e)),I.getState().githubUrl&&(_i(e,t),un(e,t).then(e=>{I.getState().selectedSha===t&&I.setState({commitPRs:e})}).catch(()=>{})),I.getState().fetchCommitCIStatusesIfNeeded([t])}function _i(e,t){let n=I.getState();!n.githubUrl||t in n.commitAuthorAvatars||sn(e,t).then(({avatarUrl:n})=>{I.getState().repoId===e&&I.setState(e=>({commitAuthorAvatars:{...e.commitAuthorAvatars,[t]:n}}))}).catch(()=>{})}function vi(e){let t=e.find(e=>e.kind===`head`&&e.isCurrent);if(!t)return null;if(t.upstream){let n=e.find(e=>e.kind===`remote`&&e.name===t.upstream);if(n)return n.peeledSha??n.targetSha}return t.peeledSha??t.targetSha}function yi(e,t){return e.rows.some(e=>e.sha===t)}function bi(){let e=window.location.hash;return e.startsWith(`#/repository`)?new URLSearchParams(e.split(`?`)[1]??``).get(`path`):null}function xi(e){window.location.hash=`#/repository?path=${encodeURIComponent(e)}`}function Si(){window.history.replaceState(null,``,`${window.location.pathname}${window.location.search}`)}var Ci=0;function wi(e){return e instanceof Error&&e.message.includes(`No session found`)}function Ti(e,t){return[t,...e.filter(e=>e!==t)].slice(0,ni)}async function Ei(e,t,n,r){let i=++Ci;t({status:`loading`,repoId:null,repoPath:null,currentWorktreePath:null,totalCommitCount:0,refs:[],stashes:[],selectedStashSha:null,stashDiff:null,stashFileDiffs:{},worktrees:[],historyWindow:null,selectedSha:null,selectedRefName:null,scrollToSha:null,commitDetail:null,commitDiff:null,commitPRs:[],commitAuthorAvatars:{},commitCIStatus:{},mergePreview:null,githubUrl:null,openError:null,loadingMore:!1,worktreeChanges:null,worktreeSelected:!1,worktreeCommitMessage:``,worktreeFileDiffs:{},commitFileDiffs:{},reflog:null,reflogLoading:!1,pendingMutation:!1,pendingCheckout:!1});try{let r=await zt({path:e});if(i!==Ci)return;let[a,o,s,c]=await Promise.all([Wt(r.repoId),an(r.repoId,{repoId:r.repoId,scope:{kind:`all`},anchor:{kind:`head`},beforeRows:0,afterRows:$r,firstParent:!1,topoOrder:!0}),Gt(r.repoId),Jt(r.repoId)]);if(i!==Ci)return;let l=a.find(e=>e.isCurrent)?.targetSha??r.head.sha;xi(r.currentWorktreePath),Ai.clear(),Mi(),t(e=>({status:`ready`,repoId:r.repoId,repoPath:r.currentWorktreePath,currentWorktreePath:r.currentWorktreePath,totalCommitCount:Math.max(r.totalCommitCount,o.rows.length),recentRepos:Ti(n().recentRepos,r.currentWorktreePath),githubUrl:r.githubUrl,refs:a,stashes:c,worktrees:s,historyWindow:o,commitAuthorAvatars:{},commitCIStatus:{},openError:null,selectedRefName:null,scrollToSha:l,scrollToKey:e.scrollToKey+1,mergePreview:null,worktreeChanges:null,worktreeSelected:!1,worktreeFileDiffs:{},commitFileDiffs:{},reflog:null,reflogMaxCount:300})),n().viewMode===`reflog`&&n().loadReflog(),n().loadWorktreeChanges()}catch(e){if(i!==Ci)return;let a=n().recentRepos;try{a=await Vt()}catch(e){console.error(`Failed to load recent repositories:`,e)}if(i!==Ci)return;t({status:`no-repo`,recentRepos:a,openError:r.showOpenError?e instanceof Error?e.message:`Failed to open repository`:null})}}var Di=1e4,Oi=10*6e4,ki=new Set([`success`,`failure`,`neutral`]),Ai=new Map,ji=null;function Mi(){ji!==null&&(clearInterval(ji),ji=null)}function Ni(){ji===null&&(ji=setInterval(Fi,Di))}function Pi(e){let{repoId:t}=I.getState();!t||e.length===0||dn(t,e).then(n=>{I.getState().repoId===t&&I.setState(t=>{let r={...t.commitCIStatus};for(let t of e){let e=n[t];r[t]=e?{state:e.state,runs:e.runs??[]}:{state:`none`,runs:[]}}return{commitCIStatus:r}})}).catch(e=>console.warn(`[CI] poll fetch failed`,e))}function Fi(){let{repoId:e,commitCIStatus:t}=I.getState();if(!e){Mi();return}let n=Date.now(),r=new Set;for(let[e,i]of Ai){let a=t[e]?.state;n>i||a!==void 0&&ki.has(a)?Ai.delete(e):r.add(e)}for(let[e,n]of Object.entries(t))n.state===`pending`&&r.add(e);if(r.size===0){Mi();return}Pi([...r])}var Ii=new Set([`historyWindow`,`refs`,`worktreeChanges`,`showCommitMessages`]);function Li(e){return Object.keys(e).some(e=>Ii.has(e))}var I=ae((e,t)=>{let n=t=>{e(e=>{let n=typeof t==`function`?t(e):t;if(!Li(n))return n;let r={...e,...n};return{...n,graphModel:Br(r.historyWindow,r.refs,r.worktreeChanges,r.showCommitMessages)}})};return{...Vr(),...Hr(),...Kr(),...Qr(),setShowCommitMessages:e=>{try{localStorage.setItem(`showCommitMessages`,String(e))}catch{}n({showCommitMessages:e})},setShowGutterColors:e=>{try{localStorage.setItem(`showGutterColors`,String(e))}catch{}n({showGutterColors:e})},setGraphZoom:e=>{let t=Xr(e);n({graphZoom:t})},setWorktreeCommitMessage:e=>n({worktreeCommitMessage:e}),reloadFromServer:async()=>{let{repoPath:e}=t(),r=t().repoId;if(!(!r||!e)&&!t().pendingMutation)try{let i,a,o,s,c;try{[i,a,o,s,c]=await hi(r)}catch(t){if(wi(t)||Rt(t)){let t=await zt({path:e});r=t.repoId,n({repoId:r,githubUrl:t.githubUrl,totalCommitCount:t.totalCommitCount});let l=await hi(r);i=l[0],a=l[1],o=l[2],s=l[3],c=l[4]}else throw t}n(e=>({refs:i,stashes:c,selectedStashSha:e.selectedStashSha&&c.some(t=>t.sha===e.selectedStashSha)?e.selectedStashSha:null,stashDiff:e.selectedStashSha&&c.some(t=>t.sha===e.selectedStashSha)?e.stashDiff:null,stashFileDiffs:e.selectedStashSha&&c.some(t=>t.sha===e.selectedStashSha)?e.stashFileDiffs:{},worktrees:s,historyWindow:a,totalCommitCount:Math.max(e.totalCommitCount,a.rows.length),mergePreview:null,worktreeChanges:o,worktreeFileDiffs:{},worktreeSelected:ci(o)>0||li(o)>0&&e.worktreeSelected})),t().viewMode===`reflog`&&t().loadReflog()}catch(e){console.error(`Failed to reload repository state:`,e)}},loadWorktrees:async()=>{let{repoId:e}=t();if(e)try{let r=await Gt(e);t().repoId===e&&n({worktrees:r})}catch(e){console.error(`Failed to load linked worktrees:`,e)}},removeWorktree:async e=>{let{repoId:r}=t();if(!r)return!1;try{let i=await Kt(r,e);return t().repoId===r&&n({worktrees:i.worktrees}),!0}catch(e){return t().showError(`Remove worktree failed`,e),!1}},loadWorktreeChanges:async()=>{let{repoId:e}=t();if(e)try{let r=await qt(e);if(t().repoId!==e)return;n(e=>({worktreeChanges:r,worktreeFileDiffs:{},worktreeSelected:ci(r)>0||li(r)>0&&e.worktreeSelected}))}catch(e){console.error(`Failed to load worktree changes:`,e)}},createStash:async e=>{let{repoId:r}=t();if(!r||t().pendingMutation)return!1;n({pendingMutation:!0});try{let i=await oi(Zt(r,e?.trim()||void 0),ri);return t().repoId===r?(n(e=>({pendingMutation:!1,stashes:i.stashes,worktreeChanges:i.changes,worktreeFileDiffs:{},worktreeSelected:li(i.changes)>0&&e.worktreeSelected})),!0):!1}catch(e){return t().repoId===r&&n({pendingMutation:!1}),t().showError(`Stash failed`,e),!1}},applyStash:async e=>{let{repoId:r}=t();if(!r||t().pendingMutation)return!1;n({pendingMutation:!0});try{let i=await oi(Qt(r,e),ri);return t().repoId===r?(n({pendingMutation:!1,stashes:i.stashes,selectedStashSha:null,stashDiff:null,stashFileDiffs:{},worktreeChanges:i.changes,worktreeFileDiffs:{},worktreeSelected:li(i.changes)>0}),!0):!1}catch(e){try{let[e,i]=await Promise.all([Jt(r),qt(r)]);t().repoId===r&&n({pendingMutation:!1,stashes:e,selectedStashSha:null,stashDiff:null,stashFileDiffs:{},worktreeChanges:i,worktreeFileDiffs:{},worktreeSelected:li(i)>0})}catch{t().repoId===r&&n({pendingMutation:!1})}return t().showError(`Apply stash failed`,e),!1}},dropStash:async e=>{let{repoId:r}=t();if(!r||t().pendingMutation)return!1;n({pendingMutation:!0});try{let i=await oi($t(r,e),ri);return t().repoId===r?(n(t=>({pendingMutation:!1,stashes:i.stashes,worktreeChanges:i.changes,selectedStashSha:t.selectedStashSha===e?null:t.selectedStashSha,stashDiff:t.selectedStashSha===e?null:t.stashDiff,stashFileDiffs:t.selectedStashSha===e?{}:t.stashFileDiffs})),!0):!1}catch(e){return t().repoId===r&&n({pendingMutation:!1}),t().showError(`Drop stash failed`,e),!1}},selectStash:e=>{let{repoId:r}=t();n({selectedStashSha:e,stashDiff:null,stashFileDiffs:{},worktreeSelected:!1,selectedSha:null,selectedRefName:null,commitDetail:null,commitDiff:null,commitPRs:[],commitFileDiffs:{},mergePreview:null}),r&&Yt(r,e).then(i=>{t().repoId===r&&t().selectedStashSha===e&&n({stashDiff:i})}).catch(n=>{t().repoId===r&&t().selectedStashSha===e&&t().showError(`Load stash details failed`,n)})},loadStashFileDiff:async(e,r)=>{let{repoId:i}=t();if(!i)return;let a=Gr(e,r.path),o=t().stashFileDiffs[a];if(!(o&&(o.loading||o.patchText!==void 0))){n(e=>({stashFileDiffs:{...e.stashFileDiffs,[a]:{loading:!0}}}));try{let o=await Xt(i,e,r.path,r.oldPath);if(t().repoId!==i||t().selectedStashSha!==e)return;n(e=>({stashFileDiffs:{...e.stashFileDiffs,[a]:{loading:!1,patchText:o.patchText,isBinary:o.isBinary,imageDiff:o.imageDiff}}}))}catch(r){if(t().repoId!==i||t().selectedStashSha!==e)return;n(e=>({stashFileDiffs:{...e.stashFileDiffs,[a]:{loading:!1,error:r instanceof Error?r.message:`Failed to load diff`}}}))}}},loadWorktreeFileDiff:async(e,r)=>{let{repoId:i}=t();if(!i)return;let a=Ur(r,e.path),o=t().worktreeFileDiffs[a];if(!(o&&(o.loading||o.patchText!==void 0))){n(e=>({worktreeFileDiffs:{...e.worktreeFileDiffs,[a]:{loading:!0}}}));try{let t=await nn(i,e.path,r,e.oldPath);n(e=>({worktreeFileDiffs:{...e.worktreeFileDiffs,[a]:{loading:!1,patchText:t.patchText,isBinary:t.isBinary,imageDiff:t.imageDiff}}}))}catch(e){n(t=>({worktreeFileDiffs:{...t.worktreeFileDiffs,[a]:{loading:!1,error:e instanceof Error?e.message:`Failed to load diff`}}}))}}},loadCommitFileDiff:async(e,r)=>{let{repoId:i}=t();if(!i)return;let a=Wr(e,r.path),o=t().commitFileDiffs[a];if(!(o&&(o.loading||o.patchText!==void 0))){n(e=>({commitFileDiffs:{...e.commitFileDiffs,[a]:{loading:!0}}}));try{let t=await ln(i,e,r.path,r.oldPath);n(e=>({commitFileDiffs:{...e.commitFileDiffs,[a]:{loading:!1,patchText:t.patchText,isBinary:t.isBinary,imageDiff:t.imageDiff}}}))}catch(e){n(t=>({commitFileDiffs:{...t.commitFileDiffs,[a]:{loading:!1,error:e instanceof Error?e.message:`Failed to load diff`}}}))}}},performCommit:async(e,r,i=!1)=>{let{repoPath:a}=t(),o=t().repoId;if(!o||!a||t().pendingMutation)return!1;let s=di(t()),c=s.historyWindow?.rows??[],l=e.split(`
|
|
12
|
+
`)[0],u=i?cr(c,s.refs,l):sr(c,s.refs,l,`commit`),d=t().worktreeChanges,f=t().worktreeFileDiffs,p=d?Gn(d,u?.headSha??d.headSha):null;n(u?{pendingMutation:!0,refs:u.refs,historyWindow:fi(s.historyWindow,u.rows),worktreeChanges:p,worktreeFileDiffs:{}}:{pendingMutation:!0,worktreeChanges:p,worktreeFileDiffs:{}});let m;try{m=await oi((async()=>{try{return await rn(o,e,r,i)}catch(t){if(wi(t)){let t=await zt({path:a});return o=t.repoId,n({repoId:o,githubUrl:t.githubUrl,totalCommitCount:t.totalCommitCount}),await rn(o,e,r,i)}throw t}})(),ii)}catch(e){return n({...s,pendingMutation:!1,worktreeChanges:d,worktreeFileDiffs:f}),t().showError(`Commit failed`,e),!1}let[h,g]=await pi(o);return n(e=>({pendingMutation:!1,graphAnimationSuppressToken:u?e.graphAnimationSuppressToken+1:e.graphAnimationSuppressToken,refs:h,historyWindow:g,totalCommitCount:Math.max(i?e.totalCommitCount:e.totalCommitCount+1,g.rows.length),worktreeChanges:m.changes,worktreeFileDiffs:{}})),t().viewMode===`reflog`&&t().loadReflog(),!0},selectWorktree:()=>{n({worktreeSelected:!0,selectedStashSha:null,stashDiff:null,stashFileDiffs:{},selectedSha:null,selectedRefName:null,commitDetail:null,commitDiff:null,commitPRs:[],mergePreview:null,commitFileDiffs:{}}),t().loadWorktreeChanges()},runStageAction:async(e,r)=>{let{repoPath:i}=t(),a=t().repoId;if(!a||!i)return!1;try{let t;try{t=await en(a,e,r)}catch(o){if(!wi(o)&&!Rt(o))throw o;let s=await zt({path:i});a=s.repoId,n({repoId:a,githubUrl:s.githubUrl,totalCommitCount:s.totalCommitCount}),t=await en(a,e,r)}return n({worktreeChanges:t,worktreeFileDiffs:{}}),!0}catch(n){return t().showError(e.startsWith(`discard`)?`Discard changes failed`:`Staging action failed`,n),!1}},setViewMode:e=>{n({viewMode:e}),e===`reflog`&&!t().reflog&&t().loadReflog()},loadReflog:async()=>{let{repoPath:e,reflogMaxCount:r}=t(),i=t().repoId;if(!(!i||!e)){n({reflogLoading:!0});try{let t;try{t=await yn(i,`HEAD`,r)}catch(a){if(wi(a)||Rt(a)){let a=await zt({path:e});i=a.repoId,n({repoId:i,githubUrl:a.githubUrl,totalCommitCount:a.totalCommitCount}),t=await yn(i,`HEAD`,r)}else throw a}n({reflog:t})}catch(e){console.error(`Failed to load reflog:`,e),t().showError(`Failed to load reflog`,e)}finally{n({reflogLoading:!1})}}},loadMoreReflog:async()=>{t().reflogLoading||(n({reflogMaxCount:t().reflogMaxCount+300}),await t().loadReflog())},recoverBranch:async(e,r)=>{await t().performRefAction(`create`,e,r),n({selectedSha:r}),t().loadReflog()},fetchCommitCIStatusesIfNeeded:e=>{let{repoId:r,commitCIStatus:i}=t();if(!r)return;let a=e.filter(e=>!si(e)&&i[e]===void 0);a.length!==0&&(n(e=>{let t={...e.commitCIStatus};for(let e of a)t[e]={state:`loading`,runs:[]};return{commitCIStatus:t}}),dn(r,a).then(e=>{n(t=>{let n={...t.commitCIStatus};for(let t of a){let r=e[t];n[t]=r?{state:r.state,runs:r.runs??[]}:{state:`none`,runs:[]}}return{commitCIStatus:n}})}).catch(e=>{console.warn(`[CI] batch fetch failed`,e),n(e=>{let t={...e.commitCIStatus};for(let e of a)t[e]={state:`none`,runs:[]};return{commitCIStatus:t}})}))},watchCommitCIStatus:e=>{Ai.set(e,Date.now()+Oi),Pi([e]),Ni()},showError:(e,t,r)=>{let i=t instanceof Error?t.message:typeof t==`string`?t:`Unknown error`;n({errorDialog:{title:e,message:i,action:r}})},dismissError:()=>n({errorDialog:null}),openRepoByPath:async e=>{await Ei(e,n,t,{showOpenError:!0})},closeRepo:()=>{Ci+=1,Ai.clear(),Mi(),Si(),n({status:`no-repo`,repoId:null,repoPath:null,currentWorktreePath:null,totalCommitCount:0,refs:[],stashes:[],selectedStashSha:null,stashDiff:null,stashFileDiffs:{},worktrees:[],historyWindow:null,selectedSha:null,selectedRefName:null,scrollToSha:null,commitDetail:null,commitDiff:null,commitPRs:[],commitAuthorAvatars:{},mergePreview:null,githubUrl:null,openError:null,loadingMore:!1,commitCIStatus:{},worktreeChanges:null,worktreeSelected:!1,worktreeCommitMessage:``,worktreeFileDiffs:{},commitFileDiffs:{},pendingMutation:!1,pendingCheckout:!1,reflog:null,reflogLoading:!1,reflogMaxCount:300,viewMode:`history`})},loadRecentRepos:async()=>{try{n({recentRepos:await Vt()})}catch(e){console.error(`Failed to load recent repositories:`,e)}},loadDiscoveredRepos:async e=>{try{let{folder:t,repos:r}=await Ht(e);n({discoveredFolder:t,discoveredRepos:r})}catch(e){console.error(`Failed to discover repositories:`,e)}},openFromUrl:()=>{let e=bi();t().loadRecentRepos(),t().loadDiscoveredRepos(),!(e&&e===t().repoPath)&&(e?t().openRepoByPath(e):Ei(`.`,n,t,{showOpenError:!1}))},selectCommit:e=>{n({selectedSha:e,selectedStashSha:null,stashDiff:null,stashFileDiffs:{},worktreeSelected:!1,scrollToSha:null,scrollToKey:t().scrollToKey,commitDetail:null,commitDiff:null,commitPRs:[],commitFileDiffs:{}});let{repoId:r,githubUrl:i}=t();r&&(t().fetchCommitCIStatusesIfNeeded([e]),Promise.all([on(r,e),cn(r,e)]).then(([r,i])=>{t().selectedSha===e&&n({commitDetail:r,commitDiff:i})}).catch(e=>console.error(`Failed to load commit detail:`,e)),i&&(_i(r,e),un(r,e).then(r=>{t().selectedSha===e&&n({commitPRs:r})}).catch(()=>{})))},selectRef:e=>{t().selectCommit(e.targetSha)},selectGraphRef:e=>{let{repoId:r}=t();n({selectedSha:null,selectedStashSha:null,stashDiff:null,stashFileDiffs:{},worktreeSelected:!1,selectedRefName:e,commitDetail:null,commitDiff:null,commitPRs:[],commitFileDiffs:{},mergePreview:null}),r&&pn(r,e).then(r=>{t().selectedRefName===e&&n({mergePreview:r})}).catch(()=>{})},clearGraphRefSelection:()=>{n({selectedSha:null,selectedStashSha:null,stashDiff:null,stashFileDiffs:{},worktreeSelected:!1,selectedRefName:null,commitDetail:null,commitDiff:null,commitPRs:[],commitFileDiffs:{},mergePreview:null})},ensureMergePreview:async e=>{let{repoId:r,mergePreview:i}=t();if(!r)return null;if(i?.sourceRefName===e)return i;let a=await pn(r,e);return t().selectedRefName===e&&n({mergePreview:a}),a},navigateTo:async e=>{let{historyWindow:r,repoId:i}=t();if(r?.rows.some(t=>t.sha===e))n(t=>({viewMode:`history`,selectedSha:e,selectedStashSha:null,stashDiff:null,stashFileDiffs:{},selectedRefName:null,worktreeSelected:!1,scrollToSha:e,scrollToKey:t.scrollToKey+1,commitDetail:null,commitDiff:null,commitPRs:[],commitFileDiffs:{},mergePreview:null}));else if(i){let r=!1,a=t().historyWindow?.rows.length??ei;for(let t=0;t<3&&!r;t++){a=Math.min(a*3,1e4);try{let t=await an(i,{repoId:i,scope:{kind:`all`},anchor:{kind:`head`},beforeRows:0,afterRows:a,firstParent:!1,topoOrder:!0});if(r=t.rows.some(t=>t.sha===e||t.sha.startsWith(e)),n(n=>({viewMode:`history`,historyWindow:r?t:pr(n.historyWindow,t),selectedSha:e,selectedStashSha:null,stashDiff:null,stashFileDiffs:{},selectedRefName:null,worktreeSelected:!1,scrollToSha:r?e:null,scrollToKey:r?n.scrollToKey+1:n.scrollToKey,commitDetail:null,commitDiff:null,commitPRs:[],commitFileDiffs:{},mergePreview:null})),!r&&!t.hasMoreAfter)break}catch(e){console.error(`Failed to load history for navigation:`,e);break}}if(!r)try{let t=await an(i,{repoId:i,scope:{kind:`all`},anchor:{kind:`sha`,value:e},beforeRows:0,afterRows:ei,firstParent:!1,topoOrder:!0});r=t.rows.some(t=>t.sha===e||t.sha.startsWith(e)),r&&n(n=>({viewMode:`history`,historyWindow:t,selectedSha:e,selectedStashSha:null,stashDiff:null,stashFileDiffs:{},selectedRefName:null,worktreeSelected:!1,scrollToSha:e,scrollToKey:n.scrollToKey+1,commitDetail:null,commitDiff:null,commitPRs:[],commitFileDiffs:{},mergePreview:null}))}catch(e){console.error(`Failed to load history anchored at commit:`,e)}r||console.warn(`Commit ${e} not found in history`)}let{repoId:a}=t();a&&(t().fetchCommitCIStatusesIfNeeded([e]),_i(a,e),Promise.all([on(a,e),cn(a,e)]).then(([r,i])=>{t().selectedSha===e&&n({commitDetail:r,commitDiff:i})}).catch(()=>{}))},requestMore:async e=>{let{repoId:r,historyWindow:i,loadingMore:a}=t();if(!(!r||!i||a)&&!(e===`down`&&!i.hasMoreAfter)){n({loadingMore:!0});try{let e=await an(r,{repoId:r,scope:{kind:`all`},anchor:{kind:`head`},beforeRows:0,afterRows:i.rows.length+ti,firstParent:!1,topoOrder:!0});n(t=>({historyWindow:pr(t.historyWindow,e)}))}catch(e){console.error(`Failed to load more history:`,e)}finally{n({loadingMore:!1})}}},performRefAction:async(e,r,i,a)=>{let{repoPath:o}=t(),s=t().repoId;if(!s||!o||t().pendingMutation)return;let c=di(t()),l=c.historyWindow?.rows??[],u=null;e===`checkout`?u=ir(l,c.refs,r,i):(e===`move`||e===`reset`)&&(u=ar(l,c.refs,r,i));let d=e===`checkout`?u?.refs.find(e=>e.kind===`head`&&e.isCurrent)?.shortName??null:null,f=e===`checkout`&&c.worktreeChanges?Kn(c.worktreeChanges,i,d):c.worktreeChanges;n(u?{pendingMutation:!0,...e===`checkout`?{pendingCheckout:!0,worktreeChanges:f}:{},refs:u.refs,historyWindow:fi(c.historyWindow,u.rows),mergePreview:null,...e===`move`?{selectedRefName:r,selectedSha:i,scrollToSha:null,commitDetail:null,commitDiff:null,commitPRs:[],commitFileDiffs:{}}:{selectedRefName:null}}:{pendingMutation:!0,...e===`checkout`?{pendingCheckout:!0,worktreeChanges:f}:{}});try{await oi((async()=>{try{await vn(s,e,r,i,a)}catch(t){if(e!==`checkout`&&(wi(t)||Rt(t))){let t=await zt({path:o});s=t.repoId,n({repoId:s,githubUrl:t.githubUrl,totalCommitCount:t.totalCommitCount}),await vn(s,e,r,i,a)}else throw t}})(),ri)}catch(t){if(e===`checkout`)try{if(wi(t)||Rt(t)){let e=await zt({path:o});s=e.repoId,n({repoId:s,githubUrl:e.githubUrl,totalCommitCount:e.totalCommitCount})}let[e,r,i,a,l]=await hi(s),u=c.refs.find(e=>e.kind===`head`&&e.isCurrent),d=e.find(e=>e.kind===`head`&&e.isCurrent),f=d?.shortName!==u?.shortName||d?.targetSha!==u?.targetSha,p=d?.targetSha??i.headSha;n(t=>({...f?{selectedSha:p,selectedRefName:null,scrollToSha:p,scrollToKey:t.scrollToKey+1,commitDetail:null,commitDiff:null,commitPRs:[],commitFileDiffs:{},mergePreview:null}:c,pendingMutation:!1,pendingCheckout:!1,refs:e,stashes:l,worktrees:a,historyWindow:r,totalCommitCount:Math.max(t.totalCommitCount,r.rows.length),worktreeChanges:i,worktreeFileDiffs:{},worktreeSelected:li(i)>0?f||t.worktreeSelected:!1})),f&&gi(s,p)}catch{n({...c,pendingMutation:!1,pendingCheckout:!1})}else n({...c,pendingMutation:!1});throw t}if(e===`checkout`){let[e,r,i,a]=await mi(s);n(t=>({pendingMutation:!1,pendingCheckout:!1,graphAnimationSuppressToken:u?t.graphAnimationSuppressToken+1:t.graphAnimationSuppressToken,refs:e,historyWindow:r,totalCommitCount:Math.max(t.totalCommitCount,r.rows.length),worktreeChanges:i,worktreeFileDiffs:{},worktreeSelected:ci(i)>0||li(i)>0&&t.worktreeSelected,worktrees:a,selectedRefName:null,mergePreview:null})),t().viewMode===`reflog`&&t().loadReflog();return}let[p,m]=await pi(s);if(t().loadWorktreeChanges(),t().loadWorktrees(),e===`fetch`){let e=vi(p),r=e&&yi(m,e)?e:null;n(e=>({pendingMutation:!1,refs:p,historyWindow:m,totalCommitCount:Math.max(e.totalCommitCount,m.rows.length),selectedSha:r??e.selectedSha,selectedRefName:null,scrollToSha:r??e.scrollToSha,scrollToKey:r?e.scrollToKey+1:e.scrollToKey,commitDetail:r?null:e.commitDetail,commitDiff:r?null:e.commitDiff,commitPRs:r?[]:e.commitPRs,commitFileDiffs:r?{}:e.commitFileDiffs,mergePreview:null})),r&&gi(s,r),t().viewMode===`reflog`&&t().loadReflog();return}if(e===`move`){n(e=>({pendingMutation:!1,graphAnimationSuppressToken:u?e.graphAnimationSuppressToken+1:e.graphAnimationSuppressToken,refs:p,historyWindow:m,selectedRefName:r,selectedSha:i,scrollToSha:null,commitDetail:null,commitDiff:null,commitPRs:[],commitFileDiffs:{},mergePreview:null})),gi(s,i);return}if(e===`push`&&t().watchCommitCIStatus(i),e===`create`||e===`create-tag`){n(e=>({pendingMutation:!1,graphAnimationSuppressToken:u?e.graphAnimationSuppressToken+1:e.graphAnimationSuppressToken,refs:p,historyWindow:m,selectedRefName:r,selectedSha:i,scrollToSha:null,commitDetail:null,commitDiff:null,commitPRs:[],commitFileDiffs:{},mergePreview:null})),gi(s,i);return}n(e=>({pendingMutation:!1,pendingCheckout:!1,graphAnimationSuppressToken:u?e.graphAnimationSuppressToken+1:e.graphAnimationSuppressToken,refs:p,historyWindow:m,selectedRefName:null,mergePreview:null}))},performCommitAction:async(e,r)=>{let{repoPath:i}=t(),a=t().repoId;if(!a||!i||t().pendingMutation)return;let o=di(t()),s=o.historyWindow?.rows??[],c=null;if(e===`uncommit`)c=or(s,o.refs,r);else{let t=s.find(e=>e.sha===r),n=e===`revert`?`Revert "${t?.subject??r.slice(0,8)}"`:t?.subject??r.slice(0,8);c=sr(s,o.refs,n,e)}ui(n,o,c);let l;try{l=await oi((async()=>{try{return await fn(a,e,r)}catch(t){if(wi(t)){let t=await zt({path:i});return a=t.repoId,n({repoId:a,githubUrl:t.githubUrl,totalCommitCount:t.totalCommitCount}),await fn(a,e,r)}throw t}})(),ri)}catch(e){throw n({...o,pendingMutation:!1}),e}let[u,d]=await pi(a),f=l.headSha,p=e===`uncommit`?-1:1;n(e=>({pendingMutation:!1,graphAnimationSuppressToken:c?e.graphAnimationSuppressToken+1:e.graphAnimationSuppressToken,refs:u,historyWindow:d,totalCommitCount:Math.max(e.totalCommitCount+p,d.rows.length),selectedSha:f,selectedRefName:null,scrollToSha:f,scrollToKey:e.scrollToKey+1,commitDetail:null,commitDiff:null,commitPRs:[],commitFileDiffs:{},mergePreview:null})),gi(a,f),t().loadWorktreeChanges(),t().viewMode===`reflog`&&t().loadReflog()},performMergeRef:async e=>{let{repoPath:r}=t(),i=t().repoId;if(!i||!r||t().pendingMutation)return;let a=di(t()),o=lr(a.historyWindow?.rows??[],a.refs,e),s=a.refs.find(e=>e.kind===`head`&&e.isCurrent)?.shortName;ui(n,a,o,s);let c;try{c=await oi((async()=>{try{return await mn(i,e)}catch(t){if(wi(t)){let t=await zt({path:r});return i=t.repoId,n({repoId:i,githubUrl:t.githubUrl,totalCommitCount:t.totalCommitCount}),await mn(i,e)}throw t}})(),ri)}catch(e){let t=null;try{t=await qt(i)}catch(e){console.error(`Failed to load worktree after failed merge:`,e)}throw n({...a,pendingMutation:!1,...t?{worktreeChanges:t,worktreeFileDiffs:{},worktreeSelected:ci(t)>0}:{}}),e}let[l,u]=await pi(i),d=c.headSha,f=l.find(e=>e.kind===`head`&&e.isCurrent)?.shortName??s;n(e=>({pendingMutation:!1,graphAnimationSuppressToken:o?e.graphAnimationSuppressToken+1:e.graphAnimationSuppressToken,refs:l,historyWindow:u,totalCommitCount:Math.max(e.totalCommitCount+1,u.rows.length),selectedSha:f?null:d,selectedRefName:f??null,scrollToSha:d,scrollToKey:e.scrollToKey+1,commitDetail:null,commitDiff:null,commitPRs:[],commitFileDiffs:{},mergePreview:null})),f||gi(i,d),t().loadWorktreeChanges()},performRebaseRef:async e=>{let{repoPath:r}=t(),i=t().repoId;if(!i||!r||t().pendingMutation)return;let a=di(t()),o=ur(a.historyWindow?.rows??[],a.refs,e);ui(n,a,o);let s;try{s=await oi((async()=>{try{return await hn(i,e)}catch(t){if(wi(t)){let t=await zt({path:r});return i=t.repoId,n({repoId:i,githubUrl:t.githubUrl,totalCommitCount:t.totalCommitCount}),await hn(i,e)}throw t}})(),ri)}catch(e){let t=null,r=null,o=null;try{[t,r,o]=await Promise.all([Wt(i),an(i,{repoId:i,scope:{kind:`all`},anchor:{kind:`head`},beforeRows:0,afterRows:ei,firstParent:!1,topoOrder:!0}),qt(i)])}catch(e){console.error(`Failed to load graph after failed rebase:`,e)}throw n(e=>!t||!r?{...a,pendingMutation:!1,...o?{worktreeChanges:o,worktreeFileDiffs:{},worktreeSelected:ci(o)>0}:{}}:{pendingMutation:!1,refs:t,historyWindow:r,totalCommitCount:Math.max(e.totalCommitCount,r.rows.length),selectedSha:null,selectedRefName:null,scrollToSha:o?.headSha??null,scrollToKey:o?e.scrollToKey+1:e.scrollToKey,commitDetail:null,commitDiff:null,commitPRs:[],commitFileDiffs:{},mergePreview:null,worktreeChanges:o,worktreeFileDiffs:{},worktreeSelected:o?ci(o)>0:e.worktreeSelected}),e}let[c,l]=await pi(i),u=s.headSha;n(e=>({pendingMutation:!1,graphAnimationSuppressToken:o?e.graphAnimationSuppressToken+1:e.graphAnimationSuppressToken,refs:c,historyWindow:l,totalCommitCount:Math.max(e.totalCommitCount,l.rows.length),selectedSha:u,selectedRefName:null,scrollToSha:u,scrollToKey:e.scrollToKey+1,commitDetail:null,commitDiff:null,commitPRs:[],commitFileDiffs:{},mergePreview:null})),gi(i,u),t().loadWorktreeChanges()},abortInProgressOperation:async e=>{let{repoPath:r}=t(),i=t().repoId;if(!(!i||!r)&&!t().pendingMutation){n({pendingMutation:!0});try{let a;try{a=await gn(i,e)}catch(t){if(wi(t)){let t=await zt({path:r});i=t.repoId,n({repoId:i,githubUrl:t.githubUrl,totalCommitCount:t.totalCommitCount}),a=await gn(i,e)}else throw t}let[o,s]=await pi(i),c=a.headSha;n(e=>({pendingMutation:!1,refs:o,historyWindow:s,totalCommitCount:Math.max(e.totalCommitCount,s.rows.length),selectedSha:c,selectedRefName:null,scrollToSha:c,scrollToKey:e.scrollToKey+1,commitDetail:null,commitDiff:null,commitPRs:[],commitFileDiffs:{},mergePreview:null,worktreeChanges:a.changes,worktreeFileDiffs:{},worktreeSelected:li(a.changes)>0})),gi(i,c),t().viewMode===`reflog`&&t().loadReflog()}catch(r){n({pendingMutation:!1}),t().showError(`Abort ${e} failed`,r)}}},continueInProgressOperation:async e=>{let{repoPath:r}=t(),i=t().repoId;if(!(!i||!r)&&!t().pendingMutation){n({pendingMutation:!0});try{let a;try{a=await _n(i,e)}catch(t){if(wi(t)){let t=await zt({path:r});i=t.repoId,n({repoId:i,githubUrl:t.githubUrl,totalCommitCount:t.totalCommitCount}),a=await _n(i,e)}else throw t}let[o,s]=await pi(i),c=a.headSha;n(e=>({pendingMutation:!1,refs:o,historyWindow:s,totalCommitCount:Math.max(e.totalCommitCount,s.rows.length),selectedSha:c,selectedRefName:null,scrollToSha:c,scrollToKey:e.scrollToKey+1,commitDetail:null,commitDiff:null,commitPRs:[],commitFileDiffs:{},mergePreview:null,worktreeChanges:a.changes,worktreeFileDiffs:{},worktreeSelected:li(a.changes)>0})),gi(i,c),t().viewMode===`reflog`&&t().loadReflog()}catch(r){let a=null,o=null,s=null;try{[a,o,s]=await Promise.all([Wt(i),an(i,{repoId:i,scope:{kind:`all`},anchor:{kind:`head`},beforeRows:0,afterRows:ei,firstParent:!1,topoOrder:!0}),qt(i)])}catch(e){console.error(`Failed to reload state after failed continue:`,e)}n(e=>({pendingMutation:!1,...a&&o?{refs:a,historyWindow:o,totalCommitCount:Math.max(e.totalCommitCount,o.rows.length)}:{},...s?{worktreeChanges:s,worktreeFileDiffs:{},worktreeSelected:ci(s)>0||e.worktreeSelected}:{}})),t().showError(`Continue ${e} failed`,r)}}},checkoutSha:async e=>{let{repoPath:r}=t(),i=t().repoId;if(!i||!r||t().pendingMutation)return;let a=di(t()),o=ir(a.historyWindow?.rows??[],a.refs,null,e),s=a.worktreeChanges?Kn(a.worktreeChanges,e,null):null;n(o?{pendingMutation:!0,pendingCheckout:!0,refs:o.refs,historyWindow:fi(a.historyWindow,o.rows),worktreeChanges:s,selectedRefName:null,mergePreview:null}:{pendingMutation:!0,pendingCheckout:!0,worktreeChanges:s});try{await oi((async()=>{try{await vn(i,`checkout`,e,e)}catch(t){if(wi(t))i=(await zt({path:r})).repoId,n({repoId:i}),await vn(i,`checkout`,e,e);else throw t}})(),ri)}catch(e){throw n({...a,pendingMutation:!1,pendingCheckout:!1}),e}let[c,l,u,d]=await mi(i);n(e=>({pendingMutation:!1,pendingCheckout:!1,graphAnimationSuppressToken:o?e.graphAnimationSuppressToken+1:e.graphAnimationSuppressToken,refs:c,historyWindow:l,totalCommitCount:Math.max(e.totalCommitCount,l.rows.length),worktreeChanges:u,worktreeFileDiffs:{},worktreeSelected:ci(u)>0||li(u)>0&&e.worktreeSelected,worktrees:d,selectedRefName:null,mergePreview:null})),t().viewMode===`reflog`&&t().loadReflog()}}}),Ri=5e3;function zi(e){let t=[],n=new Map;for(let r of e){if(r.kind!==`ide`){t.push({...r,count:1});continue}let e=`${r.agent}\0${r.ide}\0${r.cwd}`,i=n.get(e);if(i)i.count+=1;else{let i={...r,count:1};n.set(e,i),t.push(i)}}return t}function Bi(e,t=e=>e.cwd){let n=new Map;for(let r of zi(e)){let e=t(r),i=n.get(e);i||(i={cwd:e,sessions:[]},n.set(e,i)),i.sessions.push(r)}return[...n.values()]}function Vi(e){return e.kind===`ide`?e.ide??`ide`:e.kind===`terminal`?e.tty?.replace(`/dev/`,``)??`terminal`:`background`}function Hi(){let[e,t]=(0,b.useState)([]),[n,r]=(0,b.useState)(null),[i,a]=(0,b.useState)(null),[o,s]=(0,b.useState)(!1),c=I(e=>e.showError),l=(0,b.useCallback)(async()=>{let e=await bn();t(e.sessions),r(e.capabilities)},[]);return(0,b.useEffect)(()=>{let e=!1,n=()=>{bn().then(n=>{e||(t(n.sessions),r(n.capabilities))}).catch(()=>{})};n();let i=setInterval(n,Ri);return()=>{e=!0,clearInterval(i)}},[]),{sessions:e,capabilities:n,focusingPid:i,installing:o,focus:(0,b.useCallback)(async e=>{a(e.pid),console.info(`[agent-focus] click`,{pid:e.pid,cwd:e.cwd,tty:e.tty,kind:e.kind});try{let t=await xn(e.pid,e.cwd);return console.info(`[agent-focus] response`,t),t.ok?!0:(c(`Could not focus agent session`,t.error??`Unknown error`),!1)}catch(e){return console.error(`[agent-focus] request failed`,e),c(`Could not focus agent session`,e),!1}finally{a(null)}},[c]),install:(0,b.useCallback)(async()=>{s(!0);try{let e=await Sn();if(!e.ok){c(`Extension install failed`,e.error??`Unknown error`);return}await l().catch(()=>{})}catch(e){c(`Extension install failed`,e)}finally{s(!1)}},[l,c]),canInstallWindowCalls:n?.canInstallWindowCalls===!0&&!n.canFocusTerminals&&e.some(e=>e.kind===`terminal`)}}var Ui=`#D97757`,Wi=[[12,6.6],[16.2,8.6],[17.3,13.2],[14.3,16.9],[9.7,16.9],[6.7,13.2],[7.8,8.6]];function Gi({agent:e,size:t=12,busy:n=!1}){let r=(0,b.useId)(),i={width:t,height:t,style:{flexShrink:0,animation:n?`agent-icon-pulse 1.2s ease-in-out infinite`:void 0},"aria-label":e,role:`img`};return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`style`,{children:`@keyframes agent-icon-pulse { 50% { opacity: 0.25; } }`}),e===`claude`?(0,y.jsx)(`svg`,{viewBox:`0 0 24 24`,...i,children:(0,y.jsxs)(`g`,{stroke:Ui,strokeWidth:`2.8`,strokeLinecap:`round`,children:[(0,y.jsx)(`line`,{x1:`12`,y1:`2.5`,x2:`12`,y2:`21.5`}),(0,y.jsx)(`line`,{x1:`2.5`,y1:`12`,x2:`21.5`,y2:`12`}),(0,y.jsx)(`line`,{x1:`5.3`,y1:`5.3`,x2:`18.7`,y2:`18.7`}),(0,y.jsx)(`line`,{x1:`18.7`,y1:`5.3`,x2:`5.3`,y2:`18.7`})]})}):(0,y.jsxs)(`svg`,{viewBox:`0 0 24 24`,...i,children:[(0,y.jsx)(`defs`,{children:(0,y.jsxs)(`linearGradient`,{id:r,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,y.jsx)(`stop`,{offset:`0`,stopColor:`#9a86ee`}),(0,y.jsx)(`stop`,{offset:`1`,stopColor:`#3d31ee`})]})}),(0,y.jsxs)(`g`,{fill:`url(#${r})`,children:[Wi.map(([e,t])=>(0,y.jsx)(`circle`,{cx:e,cy:t,r:5},`${e}-${t}`)),(0,y.jsx)(`circle`,{cx:`12`,cy:`12`,r:`6.5`})]}),(0,y.jsxs)(`g`,{stroke:`#fff`,strokeWidth:`2.1`,strokeLinecap:`round`,strokeLinejoin:`round`,fill:`none`,children:[(0,y.jsx)(`path`,{d:`M8.8 9 L11.8 12 L8.8 15`}),(0,y.jsx)(`line`,{x1:`13.4`,y1:`15`,x2:`16.8`,y2:`15`})]})]})]})}var Ki=8;function qi(e){return e.replace(/[\\/]+$/,``).split(/[\\/]/).filter(Boolean).pop()??e}function Ji(e){return e.replace(/[^a-z0-9_-]/gi,`_`)}function Yi(e){if(e.trim().length===0)return null;let t=e.lastIndexOf(`/`),n=e.lastIndexOf(`\\`),r=Math.max(t,n);if(r===-1)return{folder:`.`,prefix:e};let i=e.slice(r+1),a=e[r],o=e.slice(0,r);return/^[A-Za-z]:$/.test(o)&&(o+=a),o||=e.startsWith(`/`)||e.startsWith(`\\`)?a:`.`,{folder:o,prefix:i}}function Xi(e){let t=e.replace(/[\\/]+$/,``)||e,n=t.includes(`\\`)&&!t.includes(`/`)?`\\`:`/`;if(/^[A-Za-z]:[\\/]/.test(t)){let e=`${t.slice(0,2)}${n}`,r=[{label:e,path:e}],i=e;for(let e of t.slice(3).split(/[\\/]+/).filter(Boolean))i=i.endsWith(n)?`${i}${e}`:`${i}${n}${e}`,r.push({label:e,path:i});return r}if(t.startsWith(`/`)||t.startsWith(`\\`)){let e=[{label:`/`,path:`/`}],n=``;for(let r of t.split(/[\\/]+/).filter(Boolean))n=`${n}/${r}`,e.push({label:r,path:n});return e}let r=``;return t.split(/[\\/]+/).filter(Boolean).map(e=>(r=r?`${r}${n}${e}`:e,{label:e,path:r}))}function Zi({onOpen:e,error:t,recentRepos:n,discoveredFolder:r,discoveredRepos:i=[]}){let{sessions:a,focusingPid:o,focus:s}=Hi(),[c,l]=(0,b.useState)(``),[u,d]=(0,b.useState)(null),[f,p]=(0,b.useState)({}),[m,h]=(0,b.useState)(!1),[g,_]=(0,b.useState)(!1),[v,x]=(0,b.useState)(!1),[S,C]=(0,b.useState)([]),[w,T]=(0,b.useState)(0),ee=(0,b.useCallback)(async(e,t)=>{e&&p(t=>({...t,[e]:{...t[e],expanded:!0,loading:!0,error:void 0}}));try{let n=await Ut(e);p(e=>({...e,[n.path]:{listing:n,expanded:!0,loading:!1,error:n.error}})),(!e||t?.makeRoot)&&d(n.path)}catch(t){let n=t instanceof Error?t.message:`Unable to read directory`;e&&p(t=>({...t,[e]:{...t[e],expanded:!0,loading:!1,error:n}}))}},[]);(0,b.useEffect)(()=>{ee(void 0,{makeRoot:!0})},[ee]),(0,b.useEffect)(()=>{if(!m){_(!1),x(!1);return}let e=Yi(c);if(!e){C([]),_(!1),x(!1);return}let t=!1,n=window.setTimeout(()=>{x(!0),Ut(e.folder).then(n=>{if(t)return;let r=e.prefix.toLowerCase(),i=n.entries.filter(e=>r.length===0||e.name.toLowerCase().startsWith(r)).slice(0,Ki);C(i),T(0),_(m&&i.length>0)}).catch(()=>{t||(C([]),_(!1))}).finally(()=>{t||x(!1)})},120);return()=>{t=!0,window.clearTimeout(n)}},[c,m]);function E(t){t.preventDefault();let n=c.trim();n&&e(n)}function D(e){l(e.path),_(!1),T(0)}function te(e){if(!g||S.length===0){e.key===`Escape`&&_(!1);return}if(e.key===`ArrowDown`){e.preventDefault(),T(e=>(e+1)%S.length);return}if(e.key===`ArrowUp`){e.preventDefault(),T(e=>(e-1+S.length)%S.length);return}if(e.key===`Tab`||e.key===`Enter`){e.preventDefault(),D(S[w]);return}e.key===`Escape`&&(e.preventDefault(),_(!1))}function ne(e){let t=f[e.path];if(t?.expanded){p(n=>({...n,[e.path]:{...t,expanded:!1}}));return}if(t?.listing){p(n=>({...n,[e.path]:{...t,expanded:!0}}));return}ee(e.path)}function re(t,n){let r=f[t],i=r?.listing?.entries??[];return r?.error?(0,y.jsx)(`div`,{className:`repo-open-tree-empty`,style:{paddingLeft:34+n*18},children:r.error}):!r?.loading&&i.length===0?(0,y.jsx)(`div`,{className:`repo-open-tree-empty`,style:{paddingLeft:34+n*18},children:`No folders`}):i.map(t=>{let r=f[t.path],i=r?.expanded??!1,a=r?.loading??!1;return(0,y.jsxs)(`div`,{children:[(0,y.jsxs)(`div`,{className:`repo-open-tree-row${t.isGitRepo?` repo-open-tree-row-repo`:``}`,onClick:()=>l(t.path),onDoubleClick:()=>{t.isGitRepo&&e(t.path)},style:{paddingLeft:10+n*18},children:[(0,y.jsx)(`button`,{type:`button`,className:`repo-open-expand`,onClick:e=>{e.stopPropagation(),ne(t)},"aria-label":i?`Collapse ${t.name}`:`Expand ${t.name}`,"aria-controls":`folder-${Ji(t.path)}`,title:i?`Collapse`:`Expand`,children:a?`...`:i?`-`:`+`}),(0,y.jsx)(`span`,{className:`repo-open-folder-name`,children:t.name}),t.isGitRepo&&(0,y.jsx)(`span`,{className:`repo-open-repo-badge`,children:`repo`}),t.isGitRepo&&(0,y.jsx)(`button`,{type:`button`,className:`repo-open-row-action`,onClick:n=>{n.stopPropagation(),e(t.path)},children:`Open`})]}),i&&(0,y.jsx)(`div`,{id:`folder-${Ji(t.path)}`,children:r?.loading?(0,y.jsx)(`div`,{className:`repo-open-tree-empty`,style:{paddingLeft:34+(n+1)*18},children:`Loading...`}):re(t.path,n+1)})]},t.path)})}let ie=Bi(a.filter(e=>e.gitRoot!==null),e=>e.gitRoot),ae=u?f[u]?.listing:null,oe=!u||f[u]?.loading,se=m&&(v||g&&S.length>0);return(0,y.jsxs)(`div`,{className:`repo-open-page`,children:[(0,y.jsx)(`style`,{children:`
|
|
13
|
+
.repo-open-page {
|
|
14
|
+
display: flex;
|
|
15
|
+
align-items: center;
|
|
16
|
+
justify-content: center;
|
|
17
|
+
height: 100%;
|
|
18
|
+
width: 100%;
|
|
19
|
+
background: #171820;
|
|
20
|
+
color: #d7dae5;
|
|
21
|
+
padding: 24px;
|
|
22
|
+
box-sizing: border-box;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.repo-open-stack {
|
|
26
|
+
width: min(1360px, 100%);
|
|
27
|
+
max-height: 100%;
|
|
28
|
+
display: flex;
|
|
29
|
+
flex-direction: column;
|
|
30
|
+
gap: 16px;
|
|
31
|
+
min-height: 0;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.repo-open-agents-card {
|
|
35
|
+
flex-shrink: 0;
|
|
36
|
+
max-height: 42%;
|
|
37
|
+
overflow: auto;
|
|
38
|
+
overscroll-behavior: contain;
|
|
39
|
+
background: linear-gradient(180deg, #262a3a 0%, #222430 100%);
|
|
40
|
+
border: 1px solid #4a5366;
|
|
41
|
+
border-radius: 8px;
|
|
42
|
+
box-shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
|
|
43
|
+
padding: 14px 16px 16px;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.repo-open-agents-brand {
|
|
47
|
+
display: flex;
|
|
48
|
+
justify-content: center;
|
|
49
|
+
margin-bottom: 8px;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.repo-open-agents-logo {
|
|
53
|
+
width: 34px;
|
|
54
|
+
height: 34px;
|
|
55
|
+
display: block;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.repo-open-agents-title {
|
|
59
|
+
color: #eef0f6;
|
|
60
|
+
font-size: 14px;
|
|
61
|
+
font-weight: 650;
|
|
62
|
+
margin-bottom: 10px;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.repo-open-agents-grid {
|
|
66
|
+
display: grid;
|
|
67
|
+
grid-template-columns: repeat(auto-fill, minmax(min(760px, 100%), 1fr));
|
|
68
|
+
gap: 8px;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.repo-open-shell {
|
|
72
|
+
flex: 1;
|
|
73
|
+
width: 100%;
|
|
74
|
+
min-height: 380px;
|
|
75
|
+
background: #222430;
|
|
76
|
+
border: 1px solid #343847;
|
|
77
|
+
border-radius: 8px;
|
|
78
|
+
box-shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
|
|
79
|
+
display: flex;
|
|
80
|
+
flex-direction: column;
|
|
81
|
+
overflow: hidden;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.repo-open-version {
|
|
85
|
+
flex-shrink: 0;
|
|
86
|
+
align-self: center;
|
|
87
|
+
color: #777d8e;
|
|
88
|
+
font-size: 12px;
|
|
89
|
+
line-height: 1;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.repo-open-header {
|
|
93
|
+
display: flex;
|
|
94
|
+
align-items: center;
|
|
95
|
+
justify-content: space-between;
|
|
96
|
+
gap: 16px;
|
|
97
|
+
padding: 18px 20px;
|
|
98
|
+
border-bottom: 1px solid #343847;
|
|
99
|
+
background: #1d1f29;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.repo-open-title {
|
|
103
|
+
margin: 0;
|
|
104
|
+
font-size: 18px;
|
|
105
|
+
line-height: 1.2;
|
|
106
|
+
font-weight: 650;
|
|
107
|
+
color: #eef0f6;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.repo-open-form {
|
|
111
|
+
display: flex;
|
|
112
|
+
align-items: center;
|
|
113
|
+
gap: 8px;
|
|
114
|
+
min-width: min(520px, 58%);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.repo-open-input-wrap {
|
|
118
|
+
position: relative;
|
|
119
|
+
flex: 1;
|
|
120
|
+
min-width: 0;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.repo-open-input {
|
|
124
|
+
flex: 1;
|
|
125
|
+
min-width: 0;
|
|
126
|
+
width: 100%;
|
|
127
|
+
height: 32px;
|
|
128
|
+
background: #171820;
|
|
129
|
+
border: 1px solid #3d4253;
|
|
130
|
+
border-radius: 5px;
|
|
131
|
+
color: #eef0f6;
|
|
132
|
+
font-size: 13px;
|
|
133
|
+
padding: 0 10px;
|
|
134
|
+
outline: none;
|
|
135
|
+
font-family: inherit;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.repo-open-input:focus {
|
|
139
|
+
border-color: #6ea8fe;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.repo-open-path-suggestions {
|
|
143
|
+
position: absolute;
|
|
144
|
+
z-index: 20;
|
|
145
|
+
top: calc(100% + 6px);
|
|
146
|
+
left: 0;
|
|
147
|
+
right: 0;
|
|
148
|
+
max-height: 238px;
|
|
149
|
+
overflow: auto;
|
|
150
|
+
overscroll-behavior: contain;
|
|
151
|
+
padding: 5px;
|
|
152
|
+
border: 1px solid #3d4253;
|
|
153
|
+
border-radius: 6px;
|
|
154
|
+
background: #171820;
|
|
155
|
+
box-shadow: 0 12px 30px rgba(0, 0, 0, 0.36);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.repo-open-path-suggestion {
|
|
159
|
+
width: 100%;
|
|
160
|
+
min-width: 0;
|
|
161
|
+
min-height: 34px;
|
|
162
|
+
display: flex;
|
|
163
|
+
align-items: center;
|
|
164
|
+
gap: 8px;
|
|
165
|
+
padding: 6px 8px;
|
|
166
|
+
border: none;
|
|
167
|
+
border-radius: 4px;
|
|
168
|
+
background: transparent;
|
|
169
|
+
color: #d7dae5;
|
|
170
|
+
font: inherit;
|
|
171
|
+
text-align: left;
|
|
172
|
+
cursor: pointer;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.repo-open-path-suggestion-active,
|
|
176
|
+
.repo-open-path-suggestion:hover {
|
|
177
|
+
background: #2a2e3b;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.repo-open-path-suggestion-main {
|
|
181
|
+
flex: 1;
|
|
182
|
+
min-width: 0;
|
|
183
|
+
display: flex;
|
|
184
|
+
flex-direction: column;
|
|
185
|
+
gap: 2px;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.repo-open-path-suggestion-name,
|
|
189
|
+
.repo-open-path-suggestion-path {
|
|
190
|
+
max-width: 100%;
|
|
191
|
+
overflow: hidden;
|
|
192
|
+
text-overflow: ellipsis;
|
|
193
|
+
white-space: nowrap;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.repo-open-path-suggestion-name {
|
|
197
|
+
color: #eef0f6;
|
|
198
|
+
font-size: 13px;
|
|
199
|
+
font-weight: 650;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.repo-open-path-suggestion-path {
|
|
203
|
+
color: #8f96a8;
|
|
204
|
+
font: 11px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.repo-open-path-suggestions-loading {
|
|
208
|
+
min-height: 30px;
|
|
209
|
+
display: flex;
|
|
210
|
+
align-items: center;
|
|
211
|
+
padding: 0 8px;
|
|
212
|
+
color: #8f96a8;
|
|
213
|
+
font-size: 12px;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.repo-open-button,
|
|
217
|
+
.repo-open-row-action,
|
|
218
|
+
.repo-open-root-action,
|
|
219
|
+
.repo-open-root-nav {
|
|
220
|
+
border: 1px solid #4a5366;
|
|
221
|
+
border-radius: 5px;
|
|
222
|
+
background: #2b3140;
|
|
223
|
+
color: #f1f3f8;
|
|
224
|
+
font: inherit;
|
|
225
|
+
font-size: 12px;
|
|
226
|
+
cursor: pointer;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.repo-open-button {
|
|
230
|
+
height: 32px;
|
|
231
|
+
padding: 0 14px;
|
|
232
|
+
font-weight: 650;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.repo-open-button:disabled {
|
|
236
|
+
cursor: default;
|
|
237
|
+
color: #777d8e;
|
|
238
|
+
background: #242733;
|
|
239
|
+
border-color: #343847;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.repo-open-body {
|
|
243
|
+
flex: 1;
|
|
244
|
+
min-height: 0;
|
|
245
|
+
display: grid;
|
|
246
|
+
grid-template-columns: minmax(0, 1fr) 460px;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.repo-open-explorer {
|
|
250
|
+
min-width: 0;
|
|
251
|
+
min-height: 0;
|
|
252
|
+
display: flex;
|
|
253
|
+
flex-direction: column;
|
|
254
|
+
overflow: hidden;
|
|
255
|
+
border-right: 1px solid #343847;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
.repo-open-explorer-head {
|
|
259
|
+
display: flex;
|
|
260
|
+
align-items: center;
|
|
261
|
+
gap: 8px;
|
|
262
|
+
min-height: 44px;
|
|
263
|
+
padding: 0 12px;
|
|
264
|
+
border-bottom: 1px solid #343847;
|
|
265
|
+
background: #20232d;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
.repo-open-root-nav {
|
|
269
|
+
width: 30px;
|
|
270
|
+
height: 26px;
|
|
271
|
+
padding: 0;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
.repo-open-root-nav:disabled {
|
|
275
|
+
cursor: default;
|
|
276
|
+
color: #5f6575;
|
|
277
|
+
border-color: #343847;
|
|
278
|
+
background: #222430;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
.repo-open-root-path {
|
|
282
|
+
flex: 1;
|
|
283
|
+
min-width: 0;
|
|
284
|
+
display: flex;
|
|
285
|
+
align-items: center;
|
|
286
|
+
gap: 2px;
|
|
287
|
+
overflow: auto hidden;
|
|
288
|
+
scrollbar-width: none;
|
|
289
|
+
white-space: nowrap;
|
|
290
|
+
font: 12px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
|
291
|
+
color: #aeb5c6;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
.repo-open-root-path::-webkit-scrollbar {
|
|
295
|
+
display: none;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
.repo-open-root-crumb {
|
|
299
|
+
flex: 0 0 auto;
|
|
300
|
+
max-width: 160px;
|
|
301
|
+
overflow: hidden;
|
|
302
|
+
text-overflow: ellipsis;
|
|
303
|
+
white-space: nowrap;
|
|
304
|
+
border: 1px solid transparent;
|
|
305
|
+
border-radius: 4px;
|
|
306
|
+
background: transparent;
|
|
307
|
+
color: #aeb5c6;
|
|
308
|
+
font: inherit;
|
|
309
|
+
padding: 3px 5px;
|
|
310
|
+
cursor: pointer;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
.repo-open-root-crumb:hover {
|
|
314
|
+
border-color: #3d4253;
|
|
315
|
+
background: #2a2e3b;
|
|
316
|
+
color: #eef0f6;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
.repo-open-root-separator {
|
|
320
|
+
flex: 0 0 auto;
|
|
321
|
+
color: #596072;
|
|
322
|
+
font-size: 11px;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
.repo-open-root-action {
|
|
326
|
+
height: 26px;
|
|
327
|
+
padding: 0 10px;
|
|
328
|
+
color: #b7f0c0;
|
|
329
|
+
border-color: #3f7350;
|
|
330
|
+
background: #213229;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
.repo-open-tree {
|
|
334
|
+
flex: 1;
|
|
335
|
+
min-width: 0;
|
|
336
|
+
min-height: 0;
|
|
337
|
+
overflow: auto;
|
|
338
|
+
overscroll-behavior: contain;
|
|
339
|
+
padding: 8px 0;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
.repo-open-tree-row {
|
|
343
|
+
display: flex;
|
|
344
|
+
align-items: center;
|
|
345
|
+
gap: 8px;
|
|
346
|
+
min-height: 30px;
|
|
347
|
+
padding-top: 0;
|
|
348
|
+
padding-right: 10px;
|
|
349
|
+
padding-bottom: 0;
|
|
350
|
+
color: #c7ccd8;
|
|
351
|
+
cursor: default;
|
|
352
|
+
box-sizing: border-box;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
.repo-open-tree-row:hover {
|
|
356
|
+
background: #2a2e3b;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
.repo-open-tree-row-repo {
|
|
360
|
+
color: #eef0f6;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
.repo-open-expand {
|
|
364
|
+
width: 20px;
|
|
365
|
+
height: 20px;
|
|
366
|
+
flex: 0 0 20px;
|
|
367
|
+
display: inline-flex;
|
|
368
|
+
align-items: center;
|
|
369
|
+
justify-content: center;
|
|
370
|
+
border: 1px solid transparent;
|
|
371
|
+
border-radius: 4px;
|
|
372
|
+
background: transparent;
|
|
373
|
+
color: #8f96a8;
|
|
374
|
+
font: 12px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
|
375
|
+
cursor: pointer;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
.repo-open-expand:hover {
|
|
379
|
+
border-color: #3d4253;
|
|
380
|
+
background: #20232d;
|
|
381
|
+
color: #d7dae5;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
.repo-open-folder-name {
|
|
385
|
+
flex: 1;
|
|
386
|
+
min-width: 0;
|
|
387
|
+
overflow: hidden;
|
|
388
|
+
text-overflow: ellipsis;
|
|
389
|
+
white-space: nowrap;
|
|
390
|
+
font-size: 13px;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
.repo-open-repo-badge {
|
|
394
|
+
flex: 0 0 auto;
|
|
395
|
+
border: 1px solid #3f7350;
|
|
396
|
+
border-radius: 4px;
|
|
397
|
+
padding: 2px 6px;
|
|
398
|
+
color: #b7f0c0;
|
|
399
|
+
background: #213229;
|
|
400
|
+
font-size: 11px;
|
|
401
|
+
line-height: 1;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
.repo-open-row-action {
|
|
405
|
+
height: 24px;
|
|
406
|
+
padding: 0 9px;
|
|
407
|
+
color: #eef0f6;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
.repo-open-tree-empty {
|
|
411
|
+
min-height: 28px;
|
|
412
|
+
display: flex;
|
|
413
|
+
align-items: center;
|
|
414
|
+
color: #777d8e;
|
|
415
|
+
font-size: 12px;
|
|
416
|
+
box-sizing: border-box;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
.repo-open-side {
|
|
420
|
+
min-width: 0;
|
|
421
|
+
min-height: 0;
|
|
422
|
+
display: flex;
|
|
423
|
+
flex-direction: column;
|
|
424
|
+
gap: 18px;
|
|
425
|
+
padding: 16px;
|
|
426
|
+
overflow: auto;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
.repo-open-section {
|
|
430
|
+
display: flex;
|
|
431
|
+
flex-direction: column;
|
|
432
|
+
gap: 8px;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
.repo-open-section-title {
|
|
436
|
+
color: #8f96a8;
|
|
437
|
+
font-size: 12px;
|
|
438
|
+
font-weight: 650;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
.repo-open-list {
|
|
442
|
+
display: flex;
|
|
443
|
+
flex-direction: column;
|
|
444
|
+
gap: 6px;
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
.repo-open-list-button {
|
|
448
|
+
display: flex;
|
|
449
|
+
flex-direction: column;
|
|
450
|
+
align-items: flex-start;
|
|
451
|
+
gap: 3px;
|
|
452
|
+
min-width: 0;
|
|
453
|
+
border: 1px solid #343847;
|
|
454
|
+
border-radius: 6px;
|
|
455
|
+
background: #1d1f29;
|
|
456
|
+
color: #d7dae5;
|
|
457
|
+
cursor: pointer;
|
|
458
|
+
padding: 9px 10px;
|
|
459
|
+
text-align: left;
|
|
460
|
+
font: inherit;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
.repo-open-list-button:hover {
|
|
464
|
+
border-color: #4a5366;
|
|
465
|
+
background: #242835;
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
.repo-open-list-name {
|
|
469
|
+
max-width: 100%;
|
|
470
|
+
overflow: hidden;
|
|
471
|
+
text-overflow: ellipsis;
|
|
472
|
+
white-space: nowrap;
|
|
473
|
+
font-size: 13px;
|
|
474
|
+
font-weight: 650;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
.repo-open-list-path,
|
|
478
|
+
.repo-open-folder-caption {
|
|
479
|
+
max-width: 100%;
|
|
480
|
+
overflow: hidden;
|
|
481
|
+
text-overflow: ellipsis;
|
|
482
|
+
white-space: nowrap;
|
|
483
|
+
font: 11px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
|
484
|
+
color: #8f96a8;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
.repo-open-claude-row {
|
|
488
|
+
position: relative;
|
|
489
|
+
padding-right: 62px;
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
.repo-open-agent-name {
|
|
493
|
+
display: inline-flex;
|
|
494
|
+
align-items: center;
|
|
495
|
+
gap: 7px;
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
.repo-open-claude-chips {
|
|
499
|
+
display: flex;
|
|
500
|
+
flex-wrap: wrap;
|
|
501
|
+
gap: 5px;
|
|
502
|
+
margin-top: 3px;
|
|
503
|
+
min-width: 0;
|
|
504
|
+
max-width: 100%;
|
|
505
|
+
align-self: stretch;
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
.repo-open-claude-chip {
|
|
509
|
+
border: 1px solid #3d4253;
|
|
510
|
+
border-radius: 4px;
|
|
511
|
+
background: #20232d;
|
|
512
|
+
color: #aeb5c6;
|
|
513
|
+
padding: 3px 8px;
|
|
514
|
+
font: 11px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
|
515
|
+
cursor: pointer;
|
|
516
|
+
flex: 1 1 80%;
|
|
517
|
+
min-width: 0;
|
|
518
|
+
max-width: 80%;
|
|
519
|
+
overflow: hidden;
|
|
520
|
+
text-overflow: ellipsis;
|
|
521
|
+
white-space: nowrap;
|
|
522
|
+
text-align: left;
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
.repo-open-claude-chip:hover:not(:disabled) {
|
|
526
|
+
border-color: #6ea8fe;
|
|
527
|
+
color: #eef0f6;
|
|
528
|
+
background: #262c3c;
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
.repo-open-claude-chip-busy {
|
|
532
|
+
border-color: #d8b45a;
|
|
533
|
+
color: #ecd08a;
|
|
534
|
+
animation: repo-open-chip-pulse 1.2s ease-in-out infinite;
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
@keyframes repo-open-chip-pulse {
|
|
538
|
+
50% { opacity: 0.55; }
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
.repo-open-claude-chip:disabled {
|
|
542
|
+
cursor: default;
|
|
543
|
+
color: #5f6575;
|
|
544
|
+
border-color: #2c2f3b;
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
.repo-open-claude-open {
|
|
548
|
+
position: absolute;
|
|
549
|
+
top: 50%;
|
|
550
|
+
right: 10px;
|
|
551
|
+
transform: translateY(-50%);
|
|
552
|
+
height: 24px;
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
.repo-open-error {
|
|
556
|
+
margin: 0;
|
|
557
|
+
color: #ff9ca8;
|
|
558
|
+
font-size: 12px;
|
|
559
|
+
line-height: 1.4;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
@media (max-width: 760px) {
|
|
563
|
+
.repo-open-page {
|
|
564
|
+
padding: 12px;
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
.repo-open-shell {
|
|
568
|
+
height: 100%;
|
|
569
|
+
min-height: 0;
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
.repo-open-header {
|
|
573
|
+
align-items: stretch;
|
|
574
|
+
flex-direction: column;
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
.repo-open-form {
|
|
578
|
+
min-width: 0;
|
|
579
|
+
width: 100%;
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
.repo-open-body {
|
|
583
|
+
grid-template-columns: 1fr;
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
.repo-open-explorer {
|
|
587
|
+
min-height: 340px;
|
|
588
|
+
border-right: none;
|
|
589
|
+
border-bottom: 1px solid #343847;
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
.repo-open-agents-grid {
|
|
593
|
+
grid-template-columns: 1fr;
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
`}),(0,y.jsxs)(`div`,{className:`repo-open-stack`,children:[ie.length>0&&(0,y.jsxs)(`section`,{className:`repo-open-agents-card`,children:[(0,y.jsx)(`div`,{className:`repo-open-agents-brand`,children:(0,y.jsx)(`img`,{className:`repo-open-agents-logo`,src:`/press-kit/ingit-icon-mark-light.svg`,alt:`ingit`})}),(0,y.jsx)(`div`,{className:`repo-open-agents-title`,children:`Running agent sessions`}),(0,y.jsx)(`div`,{className:`repo-open-agents-grid`,children:ie.map(t=>(0,y.jsxs)(`div`,{className:`repo-open-list-button repo-open-claude-row`,children:[(0,y.jsxs)(`span`,{className:`repo-open-list-name repo-open-agent-name`,children:[[...new Set(t.sessions.map(e=>e.agent))].map(e=>(0,y.jsx)(Gi,{agent:e,size:15,busy:t.sessions.some(t=>t.agent===e&&t.busy)},e)),qi(t.cwd)]}),(0,y.jsx)(`span`,{className:`repo-open-list-path`,children:t.cwd}),(0,y.jsx)(`span`,{className:`repo-open-claude-chips`,children:t.sessions.map(e=>(0,y.jsx)(`button`,{type:`button`,className:`repo-open-claude-chip${e.busy?` repo-open-claude-chip-busy`:``}`,disabled:!e.focusable||o!==null,title:e.focusable?`Focus this session's window — ${Vi(e)} (pid ${e.pid})`:`${Vi(e)} (pid ${e.pid}) — window focus unavailable for this session`,onClick:()=>void s(e),children:o===e.pid?`focusing…`:`${e.title??`${e.agent===`codex`?`codex `:``}${Vi(e)}`}${e.count>1?` ×${e.count}`:``}`},`${e.pid}:${e.cwd}`))}),(0,y.jsx)(`button`,{type:`button`,className:`repo-open-row-action repo-open-claude-open`,onClick:()=>e(t.cwd),children:`Open`})]},t.cwd))})]}),(0,y.jsxs)(`div`,{className:`repo-open-shell`,children:[(0,y.jsxs)(`div`,{className:`repo-open-header`,children:[(0,y.jsx)(`h1`,{className:`repo-open-title`,children:`Open repository`}),(0,y.jsxs)(`form`,{onSubmit:E,className:`repo-open-form`,children:[(0,y.jsxs)(`div`,{className:`repo-open-input-wrap`,children:[(0,y.jsx)(`input`,{type:`text`,value:c,onChange:e=>l(e.target.value),onFocus:()=>{h(!0),S.length>0&&_(!0)},onBlur:()=>{h(!1),_(!1)},onKeyDown:te,placeholder:`/home/user/my-project`,className:`repo-open-input`,autoComplete:`off`,role:`combobox`,"aria-expanded":se,"aria-controls":`repo-open-path-suggestions`,"aria-autocomplete":`list`}),se&&(0,y.jsx)(`div`,{id:`repo-open-path-suggestions`,className:`repo-open-path-suggestions`,role:`listbox`,children:v&&S.length===0?(0,y.jsx)(`div`,{className:`repo-open-path-suggestions-loading`,children:`Loading...`}):S.map((e,t)=>(0,y.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":t===w,className:`repo-open-path-suggestion${t===w?` repo-open-path-suggestion-active`:``}`,onMouseEnter:()=>T(t),onMouseDown:t=>{t.preventDefault(),D(e)},children:[(0,y.jsxs)(`span`,{className:`repo-open-path-suggestion-main`,children:[(0,y.jsx)(`span`,{className:`repo-open-path-suggestion-name`,children:e.name}),(0,y.jsx)(`span`,{className:`repo-open-path-suggestion-path`,children:e.path})]}),e.isGitRepo&&(0,y.jsx)(`span`,{className:`repo-open-repo-badge`,children:`repo`})]},e.path))})]}),(0,y.jsx)(`button`,{type:`submit`,disabled:!c.trim(),className:`repo-open-button`,children:`Open`})]})]}),(0,y.jsxs)(`div`,{className:`repo-open-body`,children:[(0,y.jsxs)(`section`,{className:`repo-open-explorer`,"aria-label":`Folder tree`,children:[(0,y.jsxs)(`div`,{className:`repo-open-explorer-head`,children:[(0,y.jsx)(`button`,{type:`button`,className:`repo-open-root-nav`,disabled:!ae?.parentPath,onClick:()=>{ae?.parentPath&&ee(ae.parentPath,{makeRoot:!0})},title:`Parent folder`,"aria-label":`Parent folder`,children:`..`}),(0,y.jsx)(`div`,{className:`repo-open-root-path`,children:ae?Xi(ae.path).map((e,t,n)=>(0,y.jsxs)(`span`,{style:{display:`inline-flex`,alignItems:`center`,minWidth:0},children:[t>0&&!/^(\/|[A-Za-z]:[\\/])$/.test(n[t-1].label)&&(0,y.jsx)(`span`,{className:`repo-open-root-separator`,children:`/`}),(0,y.jsx)(`button`,{type:`button`,className:`repo-open-root-crumb`,onClick:()=>void ee(e.path,{makeRoot:!0}),title:e.path,children:e.label})]},e.path)):`Loading...`}),ae?.isGitRepo&&(0,y.jsx)(`button`,{type:`button`,className:`repo-open-root-action`,onClick:()=>e(ae.path),children:`Open`})]}),(0,y.jsxs)(`div`,{className:`repo-open-tree`,children:[oe&&(0,y.jsx)(`div`,{className:`repo-open-tree-empty`,style:{paddingLeft:16},children:`Loading...`}),u&&!oe&&re(u,0)]})]}),(0,y.jsxs)(`aside`,{className:`repo-open-side`,children:[t&&(0,y.jsx)(`p`,{className:`repo-open-error`,children:t}),n.length>0&&(0,y.jsxs)(`section`,{className:`repo-open-section`,children:[(0,y.jsx)(`div`,{className:`repo-open-section-title`,children:`Recent repositories`}),(0,y.jsx)(`div`,{className:`repo-open-list`,children:n.map(t=>(0,y.jsxs)(`button`,{type:`button`,onClick:()=>e(t),className:`repo-open-list-button`,children:[(0,y.jsx)(`span`,{className:`repo-open-list-name`,children:qi(t)}),(0,y.jsx)(`span`,{className:`repo-open-list-path`,children:t})]},t))})]}),i.length>0&&(0,y.jsxs)(`section`,{className:`repo-open-section`,children:[(0,y.jsx)(`div`,{className:`repo-open-section-title`,children:`Repositories`}),r&&(0,y.jsx)(`div`,{className:`repo-open-folder-caption`,children:r}),(0,y.jsx)(`div`,{className:`repo-open-list`,children:i.map(t=>(0,y.jsxs)(`button`,{type:`button`,onClick:()=>e(t),className:`repo-open-list-button`,children:[(0,y.jsx)(`span`,{className:`repo-open-list-name`,children:qi(t)}),(0,y.jsx)(`span`,{className:`repo-open-list-path`,children:t})]},t))})]})]})]})]}),(0,y.jsxs)(`div`,{className:`repo-open-version`,children:[`v`,`0.3.0`]})]})]})}var Qi={head:`Branches`,remote:`Remotes`,tag:`Tags`},$i=[`head`,`remote`,`tag`];function ea({refs:e,stashes:t,worktrees:n,onSelectRef:r,onSelectStash:i,onSelectStashParent:a,onOpenWorktree:o,onRemoveWorktree:s,selectedStashSha:c,selectedSha:l,onClose:u,onOpenSettings:d,settingsOpen:f=!1}){let[p,m]=(0,b.useState)({head:!0,remote:!0,tag:!0}),[h,g]=(0,b.useState)(``),[_,v]=(0,b.useState)(!1),[x,S]=(0,b.useState)(!0),[C,w]=(0,b.useState)(null),T=h.toLowerCase(),ee=n.filter(e=>!T||e.path.toLowerCase().includes(T)||e.branchShortName?.toLowerCase().includes(T)),E={head:[],remote:[],tag:[]};for(let t of e)T&&!t.shortName.toLowerCase().includes(T)||E[t.kind].push(t);function D(e){m(t=>({...t,[e]:!t[e]}))}async function te(e){if(!(e.isCurrent||C)&&window.confirm(`Remove the worktree at ${e.path}? Git will refuse if it contains uncommitted changes.`)){w(e.path);try{await s(e.path)}finally{w(null)}}}return(0,y.jsxs)(`div`,{style:{width:250,flexShrink:0,height:`100%`,background:`#181825`,borderRight:`1px solid #313244`,display:`flex`,flexDirection:`column`,overflowY:`auto`,userSelect:`none`},children:[(0,y.jsxs)(`div`,{style:{padding:`8px 14px`,fontSize:11,fontWeight:700,letterSpacing:`0.08em`,color:`#6c7086`,textTransform:`uppercase`,borderBottom:`1px solid #313244`,display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[`Refs`,(0,y.jsx)(`button`,{onClick:u,title:`Hide refs`,style:{background:`none`,border:`none`,color:`#6c7086`,cursor:`pointer`,fontSize:14,padding:`0 2px`,lineHeight:1},children:`✕`})]}),(0,y.jsx)(`div`,{style:{padding:`6px 10px`,borderBottom:`1px solid #313244`},children:(0,y.jsx)(`input`,{type:`text`,value:h,onChange:e=>g(e.target.value),placeholder:`Filter refs and worktrees...`,style:{width:`100%`,background:`#1e1e2e`,border:`1px solid #45475a`,borderRadius:4,color:`#cdd6f4`,fontSize:12,padding:`5px 8px`,outline:`none`,fontFamily:`inherit`},onFocus:e=>{e.currentTarget.style.borderColor=`#89b4fa`},onBlur:e=>{e.currentTarget.style.borderColor=`#45475a`}})}),(0,y.jsxs)(`div`,{style:{margin:`8px 10px 4px`,border:`1px solid #704752`,borderRadius:7,background:`#55323c`,overflow:`hidden`,flexShrink:0},children:[(0,y.jsx)(`div`,{style:{display:`flex`,alignItems:`stretch`},children:(0,y.jsxs)(`button`,{type:`button`,onClick:()=>v(e=>!e),"aria-expanded":_,style:{flex:1,minWidth:0,display:`flex`,alignItems:`center`,gap:7,padding:`7px 9px`,border:`none`,background:`transparent`,color:`#f5e0dc`,fontFamily:`inherit`,fontSize:12,fontWeight:700,textAlign:`left`,cursor:`pointer`},children:[(0,y.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-block`,transform:_?`rotate(90deg)`:`rotate(0deg)`,transition:`transform 0.15s`,color:`#d7a6b2`,fontSize:9},children:`▶`}),`Stashes`,(0,y.jsx)(`span`,{style:{marginLeft:`auto`,minWidth:16,padding:`1px 5px`,borderRadius:8,background:`#311f25aa`,color:`#d7a6b2`,fontSize:10,fontWeight:600,textAlign:`center`},children:t.length})]})}),_&&(0,y.jsx)(`div`,{style:{borderTop:`1px solid #704752`},children:t.length===0?(0,y.jsx)(`div`,{style:{padding:`9px 10px 5px`,color:`#c4939f`,fontSize:11},children:`No stashed changes`}):(0,y.jsx)(`div`,{children:t.map(e=>{let t=ta(e.message);return(0,y.jsxs)(`div`,{role:`button`,tabIndex:0,"aria-pressed":c===e.sha,onClick:()=>i(e.sha),onKeyDown:t=>{t.target===t.currentTarget&&(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),i(e.sha))},style:{padding:`8px 9px`,borderBottom:`1px solid #704752`,display:`flex`,flexDirection:`column`,gap:5,background:c===e.sha?`#f5c2e71a`:`transparent`,boxShadow:c===e.sha?`inset 3px 0 #f5c2e7`:`none`,cursor:`pointer`},children:[(0,y.jsx)(`div`,{style:{display:`flex`,alignItems:`flex-start`,gap:7},children:(0,y.jsxs)(`div`,{style:{minWidth:0,flex:1},children:[(0,y.jsx)(`div`,{title:e.message,style:{color:`#f5e0dc`,fontSize:11,fontWeight:650,lineHeight:1.35,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:t.message||e.selector}),(0,y.jsxs)(`div`,{style:{marginTop:2,color:`#c4939f`,fontSize:9.5},children:[e.selector,t.context?` · ${t.context}`:``,` · `,na(e.createdAt)]})]})}),(0,y.jsxs)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),a(e.parentSha)},title:`Go to ${e.parentSha}`,style:{alignSelf:`flex-start`,padding:0,border:`none`,background:`none`,color:`#89b4fa`,fontFamily:`monospace`,fontSize:10,cursor:`pointer`,textDecoration:`underline`,textUnderlineOffset:2},children:[`parent `,e.parentSha.slice(0,8)]})]},e.sha)})})})]}),(0,y.jsxs)(`div`,{children:[(0,y.jsxs)(`button`,{type:`button`,onClick:()=>S(e=>!e),"aria-expanded":h?!0:x,style:{width:`100%`,display:`flex`,alignItems:`center`,gap:6,padding:`6px 14px`,background:`none`,border:`none`,color:`#a6adc8`,fontSize:12,fontWeight:600,cursor:`pointer`,textAlign:`left`,fontFamily:`inherit`},children:[(0,y.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-block`,transform:!h&&!x?`rotate(-90deg)`:`rotate(0deg)`,transition:`transform 0.15s`,fontSize:10,lineHeight:1},children:`▼`}),`Worktrees`,(0,y.jsx)(`span`,{style:{marginLeft:`auto`,background:`#313244`,borderRadius:8,padding:`1px 6px`,fontSize:10,color:`#6c7086`,fontWeight:500},children:ee.length})]}),(h||x)&&(0,y.jsx)(`div`,{children:ee.length===0?(0,y.jsx)(`div`,{style:{padding:`5px 14px 7px 28px`,color:`#6c7086`,fontSize:11},children:`No matching worktrees`}):ee.map(e=>{let t=ia(e),n=C===e.path;return(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`stretch`,paddingLeft:20},children:[(0,y.jsxs)(`button`,{type:`button`,onClick:()=>{e.isCurrent||o(e.path)},title:e.isCurrent?`${e.path} (current worktree)`:`Open ${e.path}`,disabled:e.isCurrent,style:{minWidth:0,flex:1,display:`flex`,alignItems:`center`,gap:7,padding:`5px 6px 5px 8px`,background:`none`,border:`none`,color:e.isCurrent?`#a6e3a1`:`#cdd6f4`,cursor:e.isCurrent?`default`:`pointer`,textAlign:`left`,fontFamily:`inherit`},children:[(0,y.jsx)(aa,{current:e.isCurrent}),(0,y.jsxs)(`span`,{style:{minWidth:0,flex:1},children:[(0,y.jsx)(`span`,{style:{display:`block`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,fontSize:12,fontWeight:e.isCurrent?700:500},children:t}),(0,y.jsx)(`span`,{style:{display:`block`,marginTop:1,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,color:`#6c7086`,fontSize:9.5},children:e.path})]})]}),(0,y.jsx)(`button`,{type:`button`,onClick:()=>{te(e)},disabled:e.isCurrent||C!==null,title:e.isCurrent?`The current worktree cannot be removed`:`Remove worktree ${e.path}`,"aria-label":n?`Removing worktree ${t}`:`Remove worktree ${t}`,style:{width:32,flexShrink:0,display:`grid`,placeItems:`center`,padding:0,border:`none`,background:`none`,color:n?`#f9e2af`:`#f38ba8`,cursor:e.isCurrent||C!==null?`default`:`pointer`,opacity:e.isCurrent?.25:C&&!n?.4:.8},children:(0,y.jsx)(oa,{})})]},e.path)})})]}),$i.map(e=>{let t=E[e];if(t.length===0)return null;let n=!h&&p[e];return(0,y.jsxs)(`div`,{children:[(0,y.jsxs)(`button`,{onClick:()=>D(e),style:{width:`100%`,display:`flex`,alignItems:`center`,gap:6,padding:`6px 14px`,background:`none`,border:`none`,color:`#a6adc8`,fontSize:12,fontWeight:600,cursor:`pointer`,textAlign:`left`,fontFamily:`inherit`},children:[(0,y.jsx)(`span`,{style:{display:`inline-block`,transform:n?`rotate(-90deg)`:`rotate(0deg)`,transition:`transform 0.15s`,fontSize:10,lineHeight:1},children:`▼`}),Qi[e],(0,y.jsx)(`span`,{style:{marginLeft:`auto`,background:`#313244`,borderRadius:8,padding:`1px 6px`,fontSize:10,color:`#6c7086`,fontWeight:500},children:t.length})]}),!n&&(0,y.jsx)(`div`,{children:t.map(e=>{let t=e.targetSha===l;return(0,y.jsxs)(`button`,{onClick:()=>r(e),title:e.name,style:{width:`100%`,display:`flex`,alignItems:`center`,gap:8,padding:`5px 14px 5px 28px`,background:t?`#313244`:`none`,border:`none`,color:t?`#89b4fa`:`#cdd6f4`,fontSize:13,fontWeight:e.isCurrent?700:`normal`,cursor:`pointer`,textAlign:`left`,fontFamily:`inherit`,overflow:`hidden`},children:[(0,y.jsx)(ra,{kind:e.kind,isCurrent:e.isCurrent}),(0,y.jsx)(`span`,{style:{flex:1,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:e.shortName}),(e.ahead!=null||e.behind!=null)&&(0,y.jsxs)(`span`,{style:{display:`flex`,gap:4,flexShrink:0,fontSize:11},children:[e.ahead!=null&&e.ahead>0&&(0,y.jsxs)(`span`,{style:{color:`#a6e3a1`},children:[`↑`,e.ahead]}),e.behind!=null&&e.behind>0&&(0,y.jsxs)(`span`,{style:{color:`#f38ba8`},children:[`↓`,e.behind]})]})]},e.name)})})]},e)}),(0,y.jsx)(`div`,{style:{marginTop:`auto`,padding:`10px`,borderTop:`1px solid #313244`},children:(0,y.jsxs)(`button`,{type:`button`,onClick:d,title:`Open settings`,"aria-label":`Open settings`,style:{width:`100%`,display:`flex`,alignItems:`center`,gap:8,padding:`7px 10px`,borderRadius:5,border:`1px solid #313244`,background:f?`#89b4fa20`:`transparent`,color:f?`#89b4fa`:`#a6adc8`,fontSize:12,fontWeight:600,fontFamily:`inherit`,cursor:`pointer`},children:[(0,y.jsx)(`span`,{"aria-hidden":`true`,style:{color:f?`#89b4fa`:`#6c7086`},children:`⚙`}),`Settings`]})})]})}function ta(e){let t=/^(?:WIP )?on ([^:]+):\s*(.*)$/i.exec(e);return t?{message:t[2]??e,context:`on ${t[1]}`}:{message:e,context:``}}function na(e){return new Date(e*1e3).toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}function ra({kind:e,isCurrent:t}){let n={flexShrink:0,fontSize:11,width:14,textAlign:`center`};return e===`head`?(0,y.jsx)(`span`,{style:{...n,color:t?`#a6e3a1`:`#89b4fa`},children:t?`●`:`⎇`}):e===`remote`?(0,y.jsx)(`span`,{style:{...n,color:`#94e2d5`},children:`◉`}):(0,y.jsx)(`span`,{style:{...n,color:`#f9e2af`},children:`◆`})}function ia(e){return e.branchShortName?e.branchShortName:e.detached&&e.headSha?`Detached at ${e.headSha.slice(0,8)}`:e.path.replace(/[\\/]+$/,``).split(/[\\/]+/).at(-1)||e.path}function aa({current:e}){return(0,y.jsxs)(`svg`,{"aria-hidden":`true`,width:`13`,height:`13`,viewBox:`0 0 16 16`,fill:`none`,style:{flexShrink:0},children:[(0,y.jsx)(`circle`,{cx:`4`,cy:`3`,r:`2`,fill:e?`#a6e3a1`:`#94e2d5`}),(0,y.jsx)(`circle`,{cx:`12`,cy:`5`,r:`2`,fill:e?`#a6e3a1`:`#94e2d5`}),(0,y.jsx)(`circle`,{cx:`8`,cy:`13`,r:`2`,fill:e?`#a6e3a1`:`#94e2d5`}),(0,y.jsx)(`path`,{d:`M4 5v2.5A2.5 2.5 0 0 0 6.5 10H8m4-3v.5A2.5 2.5 0 0 1 9.5 10H8v1`,stroke:e?`#a6e3a1`:`#94e2d5`,strokeWidth:`1.4`,strokeLinecap:`round`})]})}function oa(){return(0,y.jsxs)(`svg`,{"aria-hidden":`true`,width:`13`,height:`13`,viewBox:`0 0 16 16`,fill:`none`,children:[(0,y.jsx)(`path`,{d:`M3.5 5h9m-6-2h3l.75 2h-4.5l.75-2Z`,stroke:`currentColor`,strokeWidth:`1.4`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,y.jsx)(`path`,{d:`M5 5.5 5.5 13h5l.5-7.5M7 7.5v3.5m2-3.5v3.5`,stroke:`currentColor`,strokeWidth:`1.4`,strokeLinecap:`round`,strokeLinejoin:`round`})]})}var sa=g(),ca=Object.defineProperty,la=(e,t)=>{let n={};for(var r in e)ca(n,r,{get:e[r],enumerable:!0});return t||ca(n,Symbol.toStringTag,{value:`Module`}),n},ua=Ea(),L=e=>xa(e,ua),da=Ea();L.write=e=>xa(e,da);var fa=Ea();L.onStart=e=>xa(e,fa);var pa=Ea();L.onFrame=e=>xa(e,pa);var ma=Ea();L.onFinish=e=>xa(e,ma);var ha=[];L.setTimeout=(e,t)=>{let n=L.now()+t,r=()=>{let e=ha.findIndex(e=>e.cancel==r);~e&&ha.splice(e,1),ya-=+!!~e},i={time:n,handler:e,cancel:r};return ha.splice(ga(n),0,i),ya+=1,Sa(),i};var ga=e=>~(~ha.findIndex(t=>t.time>e)||~ha.length);L.cancel=e=>{fa.delete(e),pa.delete(e),ma.delete(e),ua.delete(e),da.delete(e)},L.sync=e=>{ba=!0,L.batchedUpdates(e),ba=!1},L.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function r(...e){t=e,L.onStart(n)}return r.handler=e,r.cancel=()=>{fa.delete(n),t=null},r};var _a=typeof window<`u`?window.requestAnimationFrame:()=>{};L.use=e=>_a=e,L.now=typeof performance<`u`?()=>performance.now():Date.now,L.batchedUpdates=e=>e(),L.catch=console.error,L.frameLoop=`always`,L.onDemand=()=>{},L.advance=()=>{L.frameLoop===`demand`?Ta():console.warn(`Cannot call the manual advancement of rafz whilst frameLoop is not set as demand`)};var va=-1,ya=0,ba=!1;function xa(e,t){ba?(t.delete(e),e(0)):(t.add(e),Sa(),L.frameLoop===`demand`&&L.onDemand())}function Sa(){va<0&&(va=0,L.frameLoop!==`demand`&&_a(wa))}function Ca(){va=-1}function wa(){~va&&(_a(wa),L.batchedUpdates(Ta))}function Ta(){let e=va;va=L.now();let t=ga(va);if(t&&(Da(ha.splice(0,t),e=>e.handler()),ya-=t),!ya){Ca();return}fa.flush(),ua.flush(e?Math.min(64,va-e):16.667),pa.flush(),da.flush(),ma.flush(),L.frameLoop===`demand`&&ya>0&&L.onDemand()}function Ea(){let e=new Set,t=e;return{add(n){ya+=+(t==e&&!e.has(n)),e.add(n)},delete(n){return ya-=t==e&&e.has(n)?1:0,e.delete(n)},flush(n){t.size&&(e=new Set,ya-=t.size,Da(t,t=>t(n)&&e.add(t)),ya+=e.size,t=e)}}}function Da(e,t){e.forEach(e=>{try{t(e)}catch(e){L.catch(e)}})}function Oa(){}var ka=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),R={arr:Array.isArray,obj:e=>!!e&&e.constructor.name===`Object`,fun:(e=>typeof e==`function`),str:e=>typeof e==`string`,num:e=>typeof e==`number`,und:e=>e===void 0};function Aa(e,t){if(R.arr(e)){if(!R.arr(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return e===t}var ja=(e,t)=>e.forEach(t);function Ma(e,t,n){if(R.arr(e)){for(let r=0;r<e.length;r++)t.call(n,e[r],`${r}`);return}for(let r in e)e.hasOwnProperty(r)&&t.call(n,e[r],r)}var Na=e=>R.und(e)?[]:R.arr(e)?e:[e];function Pa(e,t){if(e.size){let n=Array.from(e);e.clear(),ja(n,t)}}var Fa=(e,...t)=>Pa(e,e=>e(...t)),Ia=()=>typeof window>`u`||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),La=la({assign:()=>Ua,colors:()=>Ba,createStringInterpolator:()=>Ra,skipAnimation:()=>Va,to:()=>za,willAdvance:()=>Ha}),Ra,za,Ba=null,Va=!1,Ha=Oa,Ua=e=>{e.to&&(za=e.to),e.now&&(L.now=e.now),e.colors!==void 0&&(Ba=e.colors),e.skipAnimation!=null&&(Va=e.skipAnimation),e.createStringInterpolator&&(Ra=e.createStringInterpolator),e.requestAnimationFrame&&L.use(e.requestAnimationFrame),e.batchedUpdates&&(L.batchedUpdates=e.batchedUpdates),e.willAdvance&&(Ha=e.willAdvance),e.frameLoop&&(L.frameLoop=e.frameLoop),e.onDemand&&(L.onDemand=e.onDemand)},Wa=new Set,Ga=[],Ka=[],qa=0,Ja={get idle(){return!Wa.size&&!Ga.length},start(e){qa>e.priority?(Wa.add(e),L.onStart(Ya)):(Xa(e),L(Qa))},advance:Qa,sort(e){if(qa)L.onFrame(()=>Ja.sort(e));else{let t=Ga.indexOf(e);~t&&(Ga.splice(t,1),Za(e))}},clear(){Ga=[],Wa.clear()}};function Ya(){Wa.forEach(Xa),Wa.clear(),L(Qa)}function Xa(e){Ga.includes(e)||Za(e)}function Za(e){Ga.splice($a(Ga,t=>t.priority>e.priority),0,e)}function Qa(e){let t=Ka;for(let n=0;n<Ga.length;n++){let r=Ga[n];qa=r.priority,r.idle||(Ha(r),r.advance(e),r.idle||t.push(r))}return qa=0,Ka=Ga,Ka.length=0,Ga=t,Ga.length>0}function $a(e,t){let n=e.findIndex(t);return n<0?e.length:n}var eo=(e,t,n)=>Math.min(Math.max(n,e),t),to={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},no=`[-+]?\\d*\\.?\\d+`,ro=`[-+]?\\d*\\.?\\d+%`;function io(...e){return`\\(\\s*(`+e.join(`)\\s*,\\s*(`)+`)\\s*\\)`}var ao=RegExp(`rgb`+io(no,no,no)),oo=RegExp(`rgba`+io(no,no,no,no)),so=RegExp(`hsl`+io(no,ro,ro)),co=RegExp(`hsla`+io(no,ro,ro,no)),lo=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,uo=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,fo=/^#([0-9a-fA-F]{6})$/,po=/^#([0-9a-fA-F]{8})$/;function mo(e){let t;return typeof e==`number`?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=fo.exec(e))?parseInt(t[1]+`ff`,16)>>>0:Ba&&Ba[e]!==void 0?Ba[e]:(t=ao.exec(e))?(go(t[1])<<24|go(t[2])<<16|go(t[3])<<8|255)>>>0:(t=oo.exec(e))?(go(t[1])<<24|go(t[2])<<16|go(t[3])<<8|vo(t[4]))>>>0:(t=lo.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+`ff`,16)>>>0:(t=po.exec(e))?parseInt(t[1],16)>>>0:(t=uo.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=so.exec(e))?(ho(_o(t[1]),yo(t[2]),yo(t[3]))|255)>>>0:(t=co.exec(e))?(ho(_o(t[1]),yo(t[2]),yo(t[3]))|vo(t[4]))>>>0:null}function z(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function ho(e,t,n){let r=n<.5?n*(1+t):n+t-n*t,i=2*n-r,a=z(i,r,e+1/3),o=z(i,r,e),s=z(i,r,e-1/3);return Math.round(a*255)<<24|Math.round(o*255)<<16|Math.round(s*255)<<8}function go(e){let t=parseInt(e,10);return t<0?0:t>255?255:t}function _o(e){return(parseFloat(e)%360+360)%360/360}function vo(e){let t=parseFloat(e);return t<0?0:t>1?255:Math.round(t*255)}function yo(e){let t=parseFloat(e);return t<0?0:t>100?1:t/100}function bo(e){let t=mo(e);return t===null?e:(t||=0,`rgba(${(t&4278190080)>>>24}, ${(t&16711680)>>>16}, ${(t&65280)>>>8}, ${(t&255)/255})`)}var xo=(e,t,n)=>{if(R.fun(e))return e;if(R.arr(e))return xo({range:e,output:t,extrapolate:n});if(R.str(e.output[0]))return Ra(e);let r=e,i=r.output,a=r.range||[0,1],o=r.extrapolateLeft||r.extrapolate||`extend`,s=r.extrapolateRight||r.extrapolate||`extend`,c=r.easing||(e=>e);return e=>{let t=Co(e,a);return So(e,a[t],a[t+1],i[t],i[t+1],c,o,s,r.map)}};function So(e,t,n,r,i,a,o,s,c){let l=c?c(e):e;if(l<t){if(o===`identity`)return l;o===`clamp`&&(l=t)}if(l>n){if(s===`identity`)return l;s===`clamp`&&(l=n)}return r===i?r:t===n?e<=t?r:i:(t===-1/0?l=-l:n===1/0?l-=t:l=(l-t)/(n-t),l=a(l),r===-1/0?l=-l:i===1/0?l+=r:l=l*(i-r)+r,l)}function Co(e,t){for(var n=1;n<t.length-1&&!(t[n]>=e);++n);return n-1}var wo=(e,t=`end`)=>n=>{n=t===`end`?Math.min(n,.999):Math.max(n,.001);let r=n*e;return eo(0,1,(t===`end`?Math.floor(r):Math.ceil(r))/e)},To=1.70158,Eo=To*1.525,Do=2.70158,Oo=2*Math.PI/3,ko=2*Math.PI/4.5,Ao=e=>{let t=7.5625,n=2.75;return e<1/n?t*e*e:e<2/n?t*(e-=1.5/n)*e+.75:e<2.5/n?t*(e-=2.25/n)*e+.9375:t*(e-=2.625/n)*e+.984375},jo={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>1-(1-e)*(1-e),easeInOutQuad:e=>e<.5?2*e*e:1-(-2*e+2)**2/2,easeInCubic:e=>e*e*e,easeOutCubic:e=>1-(1-e)**3,easeInOutCubic:e=>e<.5?4*e*e*e:1-(-2*e+2)**3/2,easeInQuart:e=>e*e*e*e,easeOutQuart:e=>1-(1-e)**4,easeInOutQuart:e=>e<.5?8*e*e*e*e:1-(-2*e+2)**4/2,easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>1-(1-e)**5,easeInOutQuint:e=>e<.5?16*e*e*e*e*e:1-(-2*e+2)**5/2,easeInSine:e=>1-Math.cos(e*Math.PI/2),easeOutSine:e=>Math.sin(e*Math.PI/2),easeInOutSine:e=>-(Math.cos(Math.PI*e)-1)/2,easeInExpo:e=>e===0?0:2**(10*e-10),easeOutExpo:e=>e===1?1:1-2**(-10*e),easeInOutExpo:e=>e===0?0:e===1?1:e<.5?2**(20*e-10)/2:(2-2**(-20*e+10))/2,easeInCirc:e=>1-Math.sqrt(1-e**2),easeOutCirc:e=>Math.sqrt(1-(e-1)**2),easeInOutCirc:e=>e<.5?(1-Math.sqrt(1-(2*e)**2))/2:(Math.sqrt(1-(-2*e+2)**2)+1)/2,easeInBack:e=>Do*e*e*e-To*e*e,easeOutBack:e=>1+Do*(e-1)**3+To*(e-1)**2,easeInOutBack:e=>e<.5?(2*e)**2*(3.5949095*2*e-Eo)/2:((2*e-2)**2*(3.5949095*(e*2-2)+Eo)+2)/2,easeInElastic:e=>e===0?0:e===1?1:-(2**(10*e-10))*Math.sin((e*10-10.75)*Oo),easeOutElastic:e=>e===0?0:e===1?1:2**(-10*e)*Math.sin((e*10-.75)*Oo)+1,easeInOutElastic:e=>e===0?0:e===1?1:e<.5?-(2**(20*e-10)*Math.sin((20*e-11.125)*ko))/2:2**(-20*e+10)*Math.sin((20*e-11.125)*ko)/2+1,easeInBounce:e=>1-Ao(1-e),easeOutBounce:Ao,easeInOutBounce:e=>e<.5?(1-Ao(1-2*e))/2:(1+Ao(2*e-1))/2,steps:wo},Mo=Symbol.for(`FluidValue.get`),No=Symbol.for(`FluidValue.observers`),Po=e=>!!(e&&e[Mo]),Fo=e=>e&&e[Mo]?e[Mo]():e,Io=e=>e[No]||null;function Lo(e,t){e.eventObserved?e.eventObserved(t):e(t)}function Ro(e,t){let n=e[No];n&&n.forEach(e=>{Lo(e,t)})}var zo=class{constructor(e){if(!e&&!(e=this.get))throw Error(`Unknown getter`);Bo(this,e)}},Bo=(e,t)=>Uo(e,Mo,t);function Vo(e,t){if(e[Mo]){let n=e[No];n||Uo(e,No,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function Ho(e,t){let n=e[No];if(n&&n.has(t)){let r=n.size-1;r?n.delete(t):e[No]=null,e.observerRemoved&&e.observerRemoved(r,t)}}var Uo=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),Wo=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,Go=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,Ko=RegExp(`(${Wo.source})(%|[a-z]+)`,`i`),qo=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,Jo=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,Yo=e=>{let[t,n]=Xo(e);if(!t||Ia())return e;let r=window.getComputedStyle(document.documentElement).getPropertyValue(t);return r?r.trim():n&&n.startsWith(`--`)?window.getComputedStyle(document.documentElement).getPropertyValue(n)||e:n&&Jo.test(n)?Yo(n):n||e},Xo=e=>{let t=Jo.exec(e);if(!t)return[,];let[,n,r]=t;return[n,r]},Zo,Qo=(e,t,n,r,i)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(r)}, ${i})`,$o=e=>e.match(Wo)??[],es=e=>{Zo||=Ba?RegExp(`(${Object.keys(Ba).join(`|`)})(?!\\w)`,`g`):/^\b$/;let t=e.output.map(e=>Fo(e).replace(Jo,Yo).replace(Go,bo).replace(Zo,bo)),n=t.map(e=>$o(e).map(Number)),r=n[0].map((e,t)=>n.map(e=>{if(!(t in e))throw Error(`The arity of each "output" value must be equal`);return e[t]})).map(t=>xo({...e,output:t})),i=e.range||[0,1],a=t.map(e=>$o(e)),o=a[0].map((e,t)=>{let n=a.map(e=>{let n=e[t],r=n.indexOf(`.`);return r===-1?0:n.length-r-1});return n.every(e=>e===n[0])&&n[0]>0?n[0]:null});return e=>{let n=i.indexOf(e);if(n!==-1)return t[n];let a=!Ko.test(t[0])&&t.find(e=>Ko.test(e))?.replace(Wo,``),s=0;return t[0].replace(Wo,()=>{let t=s++,n=r[t](e),i=o[t];return`${i==null?n:n.toFixed(i)}${a||``}`}).replace(qo,Qo)}},ts=`react-spring: `,ns=e=>{let t=e,n=!1;if(typeof t!=`function`)throw TypeError(`${ts}once requires a function parameter`);return(...e)=>{n||=(t(...e),!0)}},rs=ns(console.warn);function is(){rs(`${ts}The "interpolate" function is deprecated in v9 (use "to" instead)`)}var as=ns(console.warn);function os(){as(`${ts}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`)}function ss(e){return R.str(e)&&(e[0]==`#`||/\d/.test(e)||!Ia()&&Jo.test(e)||e in(Ba||{}))}var cs=Ia()?b.useEffect:b.useLayoutEffect,ls=()=>{let e=(0,b.useRef)(!1);return cs(()=>(e.current=!0,()=>{e.current=!1}),[]),e};function us(){let e=(0,b.useState)()[1],t=ls();return()=>{t.current&&e(Math.random())}}var ds=e=>(0,b.useEffect)(e,fs),fs=[];function ps(e){let t=(0,b.useRef)(void 0);return(0,b.useEffect)(()=>{t.current=e}),t.current}var ms=Symbol.for(`Animated:node`),hs=e=>!!e&&e[ms]===e,gs=e=>e&&e[ms],_s=(e,t)=>ka(e,ms,t),vs=e=>e&&e[ms]&&e[ms].getPayload(),ys=class{constructor(){_s(this,this)}getPayload(){return this.payload||[]}},bs=class e extends ys{constructor(e){super(),this._value=e,this.done=!0,this.durationProgress=0,R.num(this._value)&&(this.lastPosition=this._value)}static create(t){return new e(t)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return R.num(e)&&(this.lastPosition=e,t&&(e=Math.round(e/t)*t,this.done&&(this.lastPosition=e))),this._value===e?!1:(this._value=e,!0)}reset(){let{done:e}=this;this.done=!1,R.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}},xs=class e extends bs{constructor(e){super(0),this._string=null,this._toString=xo({output:[e,e]})}static create(t){return new e(t)}getValue(){return this._string??=this._toString(this._value)}setValue(e){if(R.str(e)){if(e==this._string)return!1;this._string=e,this._value=1}else if(super.setValue(e))this._string=null;else return!1;return!0}reset(e){e&&(this._toString=xo({output:[this.getValue(),e]})),this._value=0,super.reset()}},Ss={dependencies:null},Cs=class extends ys{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){let t={};return Ma(this.source,(n,r)=>{hs(n)?t[r]=n.getValue(e):Po(n)?t[r]=Fo(n):e||(t[r]=n)}),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&ja(this.payload,e=>e.reset())}_makePayload(e){if(e){let t=new Set;return Ma(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){Ss.dependencies&&Po(e)&&Ss.dependencies.add(e);let t=vs(e);t&&ja(t,e=>this.add(e))}},ws=class e extends Cs{constructor(e){super(e)}static create(t){return new e(t)}getValue(){return this.source.map(e=>e.getValue())}setValue(e){let t=this.getPayload();return e.length==t.length?t.map((t,n)=>t.setValue(e[n])).some(Boolean):(super.setValue(e.map(Ts)),!0)}};function Ts(e){return(ss(e)?xs:bs).create(e)}function Es(e){let t=gs(e);return t?t.constructor:R.arr(e)?ws:ss(e)?xs:bs}var Ds=(e,t)=>{let n=!R.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,b.forwardRef)((r,i)=>{let a=(0,b.useRef)(null),o=n&&(0,b.useCallback)(e=>{a.current=As(i,e)},[i]),[s,c]=ks(r,t),l=us(),u=()=>{let e=a.current;n&&!e||(e?t.applyAnimatedValues(e,s.getValue(!0)):!1)===!1&&l()},d=new Os(u,c),f=(0,b.useRef)(void 0);cs(()=>(f.current=d,ja(c,e=>Vo(e,d)),()=>{f.current&&(ja(f.current.deps,e=>Ho(e,f.current)),L.cancel(f.current.update))})),(0,b.useEffect)(u,[]),ds(()=>()=>{let e=f.current;ja(e.deps,t=>Ho(t,e))});let p=t.getComponentProps(s.getValue());return b.createElement(e,{...p,ref:o})})},Os=class{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){e.type==`change`&&L.write(this.update)}};function ks(e,t){let n=new Set;return Ss.dependencies=n,e.style&&(e={...e,style:t.createAnimatedStyle(e.style)}),e=new Cs(e),Ss.dependencies=null,[e,n]}function As(e,t){return e&&(R.fun(e)?e(t):e.current=t),t}var js=Symbol.for(`AnimatedComponent`),Ms=new WeakMap,Ns=(e,{applyAnimatedValues:t=()=>!1,createAnimatedStyle:n=e=>new Cs(e),getComponentProps:r=e=>e}={})=>{let i={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:r},a=e=>{let t=Ps(e)||`Anonymous`;if(R.str(e))e=a[e]||(a[e]=Ds(e,i));else{let t=e[js]??Ms.get(e);if(!t){t=Ds(e,i);try{e[js]=t}catch{}Ms.set(e,t)}e=t}return e.displayName=`Animated(${t})`,e};return Ma(e,(t,n)=>{R.arr(e)&&(n=Ps(t)),a[n]=a(t)}),{animated:a}},Ps=e=>R.str(e)?e:e&&R.str(e.displayName)?e.displayName:R.fun(e)&&e.name||null;function Fs(e,...t){return R.fun(e)?e(...t):e}var Is=(e,t)=>e===!0||!!(t&&e&&(R.fun(e)?e(t):Na(e).includes(t))),Ls=(e,t)=>R.obj(e)?t&&e[t]:e,Rs=(e,t)=>e.default===!0?e[t]:e.default?e.default[t]:void 0,zs=e=>e,Bs=(e,t=zs)=>{let n=Vs;e.default&&e.default!==!0&&(e=e.default,n=Object.keys(e));let r={};for(let i of n){let n=t(e[i],i);R.und(n)||(r[i]=n)}return r},Vs=[`config`,`onProps`,`onStart`,`onChange`,`onPause`,`onResume`,`onRest`],Hs={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function Us(e){let t={},n=0;if(Ma(e,(e,r)=>{Hs[r]||(t[r]=e,n++)}),n)return t}function Ws(e){let t=Us(e);if(t){let n={to:t};return Ma(e,(e,r)=>r in t||(n[r]=e)),n}return{...e}}function Gs(e){let t=Fo(e);return R.arr(t)?t.map(Gs):ss(t)?La.createStringInterpolator({range:[0,1],output:[t,t]})(1):t}function Ks(e){for(let t in e)return!0;return!1}function qs(e){return R.fun(e)||R.arr(e)&&R.obj(e[0])}function Js(e,t){e.ref?.delete(e),t?.delete(e)}function Ys(e,t){t&&e.ref!==t&&(e.ref?.delete(e),t.add(e),e.ref=t)}var Xs={...{default:{tension:170,friction:26},gentle:{tension:120,friction:14},wobbly:{tension:180,friction:12},stiff:{tension:210,friction:20},slow:{tension:280,friction:60},molasses:{tension:280,friction:120}}.default,mass:1,damping:1,easing:jo.linear,clamp:!1},Zs=class{constructor(){this.velocity=0,Object.assign(this,Xs)}};function Qs(e,t,n){n&&(n={...n},$s(n,t),t={...n,...t}),$s(e,t),Object.assign(e,t);for(let t in Xs)e[t]??(e[t]=Xs[t]);let{frequency:r,damping:i}=e,{mass:a}=e;return R.und(r)||(r<.01&&(r=.01),i<0&&(i=0),e.tension=(2*Math.PI/r)**2*a,e.friction=4*Math.PI*i*a/r),e}function $s(e,t){if(!R.und(t.decay))e.duration=void 0;else{let n=!R.und(t.tension)||!R.und(t.friction);(n||!R.und(t.frequency)||!R.und(t.damping)||!R.und(t.mass))&&(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}}var ec=[],tc=class{constructor(){this.changed=!1,this.values=ec,this.toValues=null,this.fromValues=ec,this.config=new Zs,this.immediate=!1}};function nc(e,{key:t,props:n,defaultProps:r,state:i,actions:a}){return new Promise((o,s)=>{let c,l,u=Is(n.cancel??r?.cancel,t);if(u)p();else{R.und(n.pause)||(i.paused=Is(n.pause,t));let e=r?.pause;e!==!0&&(e=i.paused||Is(e,t)),c=Fs(n.delay||0,t),e?(i.resumeQueue.add(f),a.pause()):(a.resume(),f())}function d(){i.resumeQueue.add(f),i.timeouts.delete(l),l.cancel(),c=l.time-L.now()}function f(){c>0&&!La.skipAnimation?(i.delayed=!0,l=L.setTimeout(p,c),i.pauseQueue.add(d),i.timeouts.add(l)):p()}function p(){i.delayed&&=!1,i.pauseQueue.delete(d),i.timeouts.delete(l),e<=(i.cancelId||0)&&(u=!0);try{a.start({...n,callId:e,cancel:u},o)}catch(e){s(e)}}})}var rc=(e,t)=>t.length==1?t[0]:t.some(e=>e.cancelled)?oc(e.get()):t.every(e=>e.noop)?ic(e.get()):ac(e.get(),t.every(e=>e.finished)),ic=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),ac=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),oc=e=>({value:e,cancelled:!0,finished:!1});function sc(e,t,n,r){let{callId:i,parentId:a,onRest:o}=t,{asyncTo:s,promise:c}=n;return!a&&e===s&&!t.reset?c:n.promise=(async()=>{n.asyncId=i,n.asyncTo=e;let l=Bs(t,(e,t)=>t===`onRest`?void 0:e),u,d,f=new Promise((e,t)=>(u=e,d=t)),p=e=>{let t=i<=(n.cancelId||0)&&oc(r)||i!==n.asyncId&&ac(r,!1);if(t)throw e.result=t,d(e),e},m=0,h=(e,t)=>{let a=new lc,o=new uc;return(async()=>{p(a);let s=R.obj(e)?{...e}:{...t,to:e};if(s.parentId=i,Ma(l,(e,t)=>{R.und(s[t])&&(s[t]=e)}),La.skipAnimation){if(++m>1024)throw cc(n),o.result=ac(r,!1),d(o),o;return s.immediate=!0,await r.start(s)}let c=await r.start(s);return p(a),n.paused&&await new Promise(e=>{n.resumeQueue.add(e)}),c})()},g;try{let t;t=R.arr(e)?(async e=>{for(let t of e)await h(t)})(e):Promise.resolve(e(h,r.stop.bind(r))),await Promise.all([t.then(u),f]),g=ac(r.get(),!0,!1)}catch(e){if(e instanceof lc)g=e.result;else if(e instanceof uc)g=e.result;else throw e}finally{i==n.asyncId&&(n.asyncId=a,n.asyncTo=a?s:void 0,n.promise=a?c:void 0)}return R.fun(o)&&L.batchedUpdates(()=>{o(g,r,r.item)}),g})()}function cc(e,t){Pa(e.timeouts,e=>e.cancel()),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}var lc=class extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},uc=class extends Error{constructor(){super(`SkipAnimationSignal`)}},dc=e=>e instanceof pc,fc=1,pc=class extends zo{constructor(...e){super(...e),this.id=fc++,this._priority=0}get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){let e=gs(this);return e&&e.getValue()}to(...e){return La.to(this,e)}interpolate(...e){return is(),La.to(this,e)}toJSON(){return this.get()}observerAdded(e){e==1&&this._attach()}observerRemoved(e){e==0&&this._detach()}_attach(){}_detach(){}_onChange(e,t=!1){Ro(this,{type:`change`,parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||Ja.sort(this),Ro(this,{type:`priority`,parent:this,priority:e})}},mc=Symbol.for(`SpringPhase`),hc=1,gc=2,_c=4,vc=e=>(e[mc]&hc)>0,yc=e=>(e[mc]&gc)>0,bc=e=>(e[mc]&_c)>0,xc=(e,t)=>t?e[mc]|=3:e[mc]&=-3,Sc=(e,t)=>t?e[mc]|=_c:e[mc]&=-5,Cc=class extends pc{constructor(e,t){if(super(),this.animation=new tc,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!R.und(e)||!R.und(t)){let n=R.obj(e)?{...e}:{...t,from:e};R.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(yc(this)||this._state.asyncTo)||bc(this)}get goal(){return Fo(this.animation.to)}get velocity(){let e=gs(this);return e instanceof bs?e.lastVelocity||0:e.getPayload().map(e=>e.lastVelocity||0)}get hasAnimated(){return vc(this)}get isAnimating(){return yc(this)}get isPaused(){return bc(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,n=!1,r=this.animation,{toValues:i}=r,{config:a}=r,o=vs(r.to);!o&&Po(r.to)&&(i=Na(Fo(r.to))),r.values.forEach((s,c)=>{if(s.done)return;let l=s.constructor==xs?1:o?o[c].lastPosition:i[c],u=r.immediate,d=l;if(!u){if(d=s.lastPosition,a.tension<=0){s.done=!0;return}let t=s.elapsedTime+=e,n=r.fromValues[c],i=s.v0==null?s.v0=R.arr(a.velocity)?a.velocity[c]:a.velocity:s.v0,o,f=a.precision||(n==l?.005:Math.max(Math.max(Math.abs(l),Math.abs(n),1)*2**-52,Math.min(1,Math.abs(l-n)*.001)));if(!R.und(a.duration)){let r=1;a.duration>0&&(this._memoizedDuration!==a.duration&&(this._memoizedDuration=a.duration,s.durationProgress>0&&(s.elapsedTime=a.duration*s.durationProgress,t=s.elapsedTime+=e)),r=(a.progress||0)+t/this._memoizedDuration,r=r>1?1:r<0?0:r,s.durationProgress=r),d=n+a.easing(r)*(l-n),o=(d-s.lastPosition)/e,u=r==1}else if(a.decay){let e=a.decay===!0?.998:a.decay,r=Math.exp(-(1-e)*t);d=n+i/(1-e)*(1-r),u=Math.abs(s.lastPosition-d)<=f,o=i*r}else{o=s.lastVelocity==null?i:s.lastVelocity;let t=a.restVelocity||f/10,r=a.clamp?0:a.bounce,c=!R.und(r),p=n==l?s.v0>0:n<l,m,h=!1,g=Math.ceil(e/1);for(let e=0;e<g&&(m=Math.abs(o)>t,!(!m&&(u=Math.abs(l-d)<=f,u)));++e){c&&(h=d==l||d>l==p,h&&(o=-o*r,d=l));let e=(-a.tension*1e-6*(d-l)+-a.friction*.001*o)/a.mass;o+=e*1,d+=o*1}}s.lastVelocity=o,Number.isNaN(d)&&(console.warn(`Got NaN while animating:`,this),u=!0)}o&&!o[c].done&&(u=!1),u?s.done=!0:t=!1,s.setValue(d,a.round)&&(n=!0)});let s=gs(this),c=s.getValue();if(t){let e=Fo(r.to);(c!==e||n)&&!a.decay?(s.setValue(e),this._onChange(e)):n&&a.decay&&this._onChange(c),this._stop()}else n&&this._onChange(c)}set(e){return L.batchedUpdates(()=>{this._stop(),this._focus(e),this._set(e)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(yc(this)){let{to:e,config:t}=this.animation;L.batchedUpdates(()=>{this._onStart(),t.decay||this._set(e,!1),this._stop()})}return this}update(e){return(this.queue||=[]).push(e),this}start(e,t){let n;return R.und(e)?(n=this.queue||[],this.queue=[]):n=[R.obj(e)?e:{...t,to:e}],Promise.all(n.map(e=>this._update(e))).then(e=>rc(this,e))}stop(e){let{to:t}=this.animation;return R.und(t)||this._focus(this.get()),cc(this._state,e&&this._lastCallId),L.batchedUpdates(()=>this._stop(t,e)),this}reset(){this._update({reset:!0})}eventObserved(e){e.type==`change`?this._start():e.type==`priority`&&(this.priority=e.priority+1)}_prepareNode(e){let t=this.key||``,{to:n,from:r}=e;n=R.obj(n)?n[t]:n,(n==null||qs(n))&&(n=void 0),r=R.obj(r)?r[t]:r,r??=void 0;let i={to:n,from:r};return vc(this)||(e.reverse&&([n,r]=[r,n]),r=Fo(r),R.und(r)?gs(this)||this._set(n):this._set(r)),i}_update({...e},t){let{key:n,defaultProps:r}=this;e.default&&Object.assign(r,Bs(e,(e,t)=>/^on/.test(t)?Ls(e,n):e)),Ac(this,e,`onProps`),jc(this,`onProps`,e,this);let i=this._prepareNode(e);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");let a=this._state;return nc(++this._lastCallId,{key:n,props:e,defaultProps:r,state:a,actions:{pause:()=>{bc(this)||(Sc(this,!0),Fa(a.pauseQueue),jc(this,`onPause`,ac(this,wc(this,this.animation.to)),this))},resume:()=>{bc(this)&&(Sc(this,!1),yc(this)&&this._resume(),Fa(a.resumeQueue),jc(this,`onResume`,ac(this,wc(this,this.animation.to)),this))},start:this._merge.bind(this,i)}}).then(n=>{if(e.loop&&n.finished&&!(t&&n.noop)){let t=Tc(e);if(t)return this._update(t,!0)}return n})}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(oc(this));let r=!R.und(e.to),i=!R.und(e.from);if(r||i)if(t.callId>this._lastToId)this._lastToId=t.callId;else return n(oc(this));let{key:a,defaultProps:o,animation:s}=this,{to:c,from:l}=s,{to:u=c,from:d=l}=e;i&&!r&&(!t.default||R.und(u))&&(u=d),t.reverse&&([u,d]=[d,u]);let f=!Aa(d,l);f&&(s.from=d),d=Fo(d);let p=!Aa(u,c);p&&this._focus(u);let m=qs(t.to),{config:h}=s,{decay:g,velocity:_}=h;(r||i)&&!h.decay&&(h.velocity=0),t.config&&!m&&Qs(h,Fs(t.config,a),t.config===o.config?void 0:Fs(o.config,a));let v=gs(this);if(!v||R.und(u))return n(ac(this,!0));let y=R.und(t.reset)?i&&!t.default:!R.und(d)&&Is(t.reset,a),b=y?d:this.get(),x=Gs(u),S=R.num(x)||R.arr(x)||ss(x),C=!m&&(!S||Is(o.immediate||t.immediate,a));if(p){let e=Es(u);if(e!==v.constructor)if(C)v=this._set(x);else throw Error(`Cannot animate between ${v.constructor.name} and ${e.name}, as the "to" prop suggests`)}let w=v.constructor,T=Po(u),ee=!1;if(!T){let e=y||!vc(this)&&f;(p||e)&&(ee=Aa(Gs(b),x),T=!ee),(!Aa(s.immediate,C)&&!C||!Aa(h.decay,g)||!Aa(h.velocity,_))&&(T=!0)}if(ee&&yc(this)&&(s.changed&&!y?T=!0:T||this._stop(c)),!m&&((T||Po(c))&&(s.values=v.getPayload(),s.toValues=Po(u)?null:w==xs?[1]:Na(x)),s.immediate!=C&&(s.immediate=C,!C&&!y&&this._set(c)),T)){let{onRest:e}=s;ja(kc,e=>Ac(this,t,e));let r=ac(this,wc(this,c));Fa(this._pendingCalls,r),this._pendingCalls.add(n),s.changed&&L.batchedUpdates(()=>{s.changed=!y,e?.(r,this),y?Fs(o.onRest,r):s.onStart?.(r,this)})}y&&this._set(b),m?n(sc(t.to,t,this._state,this)):T?this._start():yc(this)&&!p?this._pendingCalls.add(n):n(ic(b))}_focus(e){let t=this.animation;e!==t.to&&(Io(this)&&this._detach(),t.to=e,Io(this)&&this._attach())}_attach(){let e=0,{to:t}=this.animation;Po(t)&&(Vo(t,this),dc(t)&&(e=t.priority+1)),this.priority=e}_detach(){let{to:e}=this.animation;Po(e)&&Ho(e,this)}_set(e,t=!0){let n=Fo(e);if(!R.und(n)){let e=gs(this);if(!e||!Aa(n,e.getValue())){let r=Es(n);!e||e.constructor!=r?_s(this,r.create(n)):e.setValue(n),e&&L.batchedUpdates(()=>{this._onChange(n,t)})}}return gs(this)}_onStart(){let e=this.animation;e.changed||(e.changed=!0,jc(this,`onStart`,ac(this,wc(this,e.to)),this))}_onChange(e,t){let n=ac(e,!1);t||(this._onStart(),Fs(this.animation.onChange,n,this)),Fs(this.defaultProps.onChange,n,this),super._onChange(e,t)}_start(){let e=this.animation;gs(this).reset(Fo(e.to)),e.immediate||(e.fromValues=e.values.map(e=>e.lastPosition)),yc(this)||(xc(this,!0),bc(this)||this._resume())}_resume(){La.skipAnimation?this.finish():Ja.start(this)}_stop(e,t){if(yc(this)){xc(this,!1);let n=this.animation;ja(n.values,e=>{e.done=!0}),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),Ro(this,{type:`idle`,parent:this});let r=t?oc(this.get()):ac(this.get(),wc(this,e??n.to));Fa(this._pendingCalls,r),n.changed=!1,jc(this,`onRest`,r,this)}}};function wc(e,t){let n=Gs(t);return Aa(Gs(e.get()),n)}function Tc(e,t=e.loop,n=e.to){let r=Fs(t);if(r){let i=r!==!0&&Ws(r),a=(i||e).reverse,o=!i||i.reset;return Ec({...e,loop:t,default:!1,pause:void 0,to:!a||qs(n)?n:void 0,from:o?e.from:void 0,reset:o,...i})}}function Ec(e){let{to:t,from:n}=e=Ws(e),r=new Set;return R.obj(t)&&Oc(t,r),R.obj(n)&&Oc(n,r),e.keys=r.size?Array.from(r):null,e}function Dc(e){let t=Ec(e);return R.und(t.default)&&(t.default=Bs(t)),t}function Oc(e,t){Ma(e,(e,n)=>e!=null&&t.add(n))}var kc=[`onStart`,`onRest`,`onChange`,`onPause`,`onResume`];function Ac(e,t,n){e.animation[n]=t[n]===Rs(t,n)?void 0:Ls(t[n],e.key)}function jc(e,t,...n){e.animation[t]?.(...n),e.defaultProps[t]?.(...n)}var Mc=[`onStart`,`onChange`,`onRest`],Nc=1,Pc=class{constructor(e,t){this.id=Nc++,this.springs={},this.queue=[],this._lastAsyncId=0,this._lastLoopId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),t&&(this._flush=t),e&&this.start({default:!0,...e})}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every(e=>e.idle&&!e.isDelayed&&!e.isPaused)}get item(){return this._item}set item(e){this._item=e}get(){let e={};return this.each((t,n)=>e[n]=t.get()),e}set(e){for(let t in e){let n=e[t];R.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(Ec(e)),this}start(e){let{queue:t}=this;return e?t=Na(e).map(Ec):this.queue=[],this._flush?this._flush(this,t):(Vc(this,t),Fc(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){let n=this.springs;ja(Na(t),t=>n[t].stop(!!e))}else cc(this._state,this._lastAsyncId),this.each(t=>t.stop(!!e));return this}pause(e){if(R.und(e))this.start({pause:!0});else{let t=this.springs;ja(Na(e),e=>t[e].pause())}return this}resume(e){if(R.und(e))this.start({pause:!1});else{let t=this.springs;ja(Na(e),e=>t[e].resume())}return this}each(e){Ma(this.springs,e)}onLoopReset(e){let t=this._onLoopReset??=new Set;return t.add(e),()=>{t.delete(e)}}_onFrame(){let{onStart:e,onChange:t,onRest:n}=this._events,r=this._active.size>0,i=this._changed.size>0;(r&&!this._started||i&&!this._started)&&(this._started=!0,Pa(e,([e,t])=>{t.value=this.get(),e(t,this,this._item)}));let a=!r&&this._started,o=i||a&&n.size?this.get():null;i&&t.size&&Pa(t,([e,t])=>{t.value=o,e(t,this,this._item)}),a&&(this._started=!1,Pa(n,([e,t])=>{t.value=o,e(t,this,this._item)}))}eventObserved(e){if(e.type==`change`)this._changed.add(e.parent),e.idle||this._active.add(e.parent);else if(e.type==`idle`)this._active.delete(e.parent);else return;L.onFrame(this._onFrame)}};function Fc(e,t){return Promise.all(t.map(t=>Ic(e,t))).then(t=>rc(e,t))}async function Ic(e,t,n){let{keys:r,to:i,from:a,loop:o,onRest:s,onResolve:c}=t,l=R.obj(t.default)&&t.default;o&&(t.loop=!1);let u=t,d=!n&&!u.parentId&&`loop`in t?++e._lastLoopId:n?u.loopId:e._lastLoopId;i===!1&&(t.to=null),a===!1&&(t.from=null);let f=R.arr(i)||R.fun(i)?i:void 0;f?(t.to=void 0,t.onRest=void 0,l&&(l.onRest=void 0)):ja(Mc,n=>{let r=t[n];if(R.fun(r)){let i=e._events[n];t[n]=(({finished:e,cancelled:t})=>{let n=i.get(r);n?(e||(n.finished=!1),t&&(n.cancelled=!0)):i.set(r,{value:null,finished:e||!1,cancelled:t||!1})}),l&&(l[n]=t[n])}});let p=e._state;t.pause===!p.paused?(p.paused=t.pause,Fa(t.pause?p.pauseQueue:p.resumeQueue)):p.paused&&(t.pause=!0);let m=(r||Object.keys(e.springs)).map(n=>e.springs[n].start(t)),h=t.cancel===!0||Rs(t,`cancel`)===!0;(f||h&&p.asyncId)&&m.push(nc(++e._lastAsyncId,{props:t,state:p,actions:{pause:Oa,resume:Oa,start(t,n){h?(cc(p,e._lastAsyncId),n(oc(e))):(t.onRest=s,n(sc(f,t,p,e)))}}})),p.paused&&await new Promise(e=>{p.resumeQueue.add(e)});let g=rc(e,await Promise.all(m));if(o&&g.finished&&!(n&&g.noop)&&d===e._lastLoopId){let n=Tc(t,o,i);if(n)return n.loopId=d,e._onLoopReset?.forEach(e=>e()),Vc(e,[n]),Ic(e,n,!0)}return c&&L.batchedUpdates(()=>c(g,e,e.item)),g}function Lc(e,t){let n={...e.springs};return t&&ja(Na(t),e=>{R.und(e.keys)&&(e=Ec(e)),R.obj(e.to)||(e={...e,to:void 0}),Bc(n,e,e=>zc(e))}),Rc(e,n),n}function Rc(e,t){Ma(t,(t,n)=>{e.springs[n]||(e.springs[n]=t,Vo(t,e))})}function zc(e,t){let n=new Cc;return n.key=e,t&&Vo(n,t),n}function Bc(e,t,n){t.keys&&ja(t.keys,r=>{(e[r]||(e[r]=n(r)))._prepareNode(t)})}function Vc(e,t){ja(t,t=>{Bc(e.springs,t,t=>zc(t,e))})}var Hc=b.createContext({pause:!1,immediate:!1}),Uc=()=>{let e=[],t=function(t){os();let r=[];return ja(e,(e,i)=>{if(R.und(t))r.push(e.start());else{let a=n(t,e,i);a&&r.push(e.start(a))}}),r};t.current=e,t.add=function(t){e.includes(t)||e.push(t)},t.delete=function(t){let n=e.indexOf(t);~n&&e.splice(n,1)},t.pause=function(){return ja(e,e=>e.pause(...arguments)),this},t.resume=function(){return ja(e,e=>e.resume(...arguments)),this},t.set=function(t){ja(e,(e,n)=>{let r=R.fun(t)?t(n,e):t;r&&e.set(r)})},t.start=function(t){let n=[];return ja(e,(e,r)=>{if(R.und(t))n.push(e.start());else{let i=this._getProps(t,e,r);i&&n.push(e.start(i))}}),n},t.stop=function(){return ja(e,e=>e.stop(...arguments)),this},t.update=function(t){return ja(e,(e,n)=>e.update(this._getProps(t,e,n))),this};let n=function(e,t,n){return R.fun(e)?e(n,t):e};return t._getProps=n,t};function Wc(e,t,n){let r=R.fun(t)&&t;r&&!n&&(n=[]);let i=(0,b.useMemo)(()=>r||arguments.length==3?Uc():void 0,[]),a=(0,b.useRef)(0),o=us(),s=(0,b.useMemo)(()=>({ctrls:[],queue:[],flush(e,t){let n=Lc(e,t);return a.current>0&&!s.queue.length&&!Object.keys(n).some(t=>!e.springs[t])?Fc(e,t):new Promise(r=>{Rc(e,n),s.queue.push(()=>{r(Fc(e,t))}),o()})}}),[]),c=(0,b.useRef)([...s.ctrls]),l=(0,b.useRef)([]),u=(0,b.useRef)([]);u.current=[];let d=ps(e)||0;(0,b.useMemo)(()=>{ja(c.current.slice(e,d),e=>{Js(e,i),e.stop(!0)}),c.current.length=e,f(d,e)},[e]),(0,b.useMemo)(()=>{f(0,Math.min(d,e))},n);function f(e,n){for(let i=e;i<n;i++){let e=c.current[i]||(c.current[i]=new Pc(null,s.flush)),n=r?r(i,e):t[i];n&&(l.current[i]=Dc(n))}}let p=c.current.map((e,t)=>Lc(e,l.current[t])),m=(0,b.useContext)(Hc),h=m!==ps(m)&&Ks(m);cs(()=>{a.current++,s.ctrls=c.current;let{queue:e}=s;e.length&&(s.queue=[],ja(e,e=>e()));let t=l.current.length>0?l.current:u.current;ja(c.current,(e,n)=>{i?.add(e),h&&e.start({default:m});let r=t[n];r&&(Ys(e,r.ref),e.ref?e.queue.push({...r,default:R.obj(r.default)?{...r.default}:r.default}):e.start(r))}),l.current.length>0&&(u.current=l.current),l.current=[]}),ds(()=>()=>{ja(s.ctrls,e=>e.stop(!0))});let g=p.map(e=>({...e}));return i?[g,i]:g}function Gc(e,t){let n=R.fun(e),[[r],i]=Wc(1,n?e:[e],n?t||[]:t);return n||arguments.length==2?[r,i]:r}var Kc=class extends pc{constructor(e,t){super(),this.source=e,this.idle=!0,this._active=new Set,this.calc=xo(...t);let n=this._get(),r=Es(n);_s(this,r.create(n))}advance(e){let t=this._get();Aa(t,this.get())||(gs(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&Jc(this._active)&&Yc(this)}_get(){let e=R.arr(this.source)?this.source.map(Fo):Na(Fo(this.source));return this.calc(...e)}_start(){this.idle&&!Jc(this._active)&&(this.idle=!1,ja(vs(this),e=>{e.done=!1}),La.skipAnimation?(L.batchedUpdates(()=>this.advance()),Yc(this)):Ja.start(this))}_attach(){let e=1;ja(Na(this.source),t=>{Po(t)&&Vo(t,this),dc(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))}),this.priority=e,this._start()}_detach(){ja(Na(this.source),e=>{Po(e)&&Ho(e,this)}),this._active.clear(),Yc(this)}eventObserved(e){e.type==`change`?e.idle?this.advance():(this._active.add(e.parent),this._start()):e.type==`idle`?this._active.delete(e.parent):e.type==`priority`&&(this.priority=Na(this.source).reduce((e,t)=>Math.max(e,(dc(t)?t.priority:0)+1),0))}};function qc(e){return e.idle!==!1}function Jc(e){return!e.size||Array.from(e).every(qc)}function Yc(e){e.idle||(e.idle=!0,ja(vs(e),e=>{e.done=!0}),Ro(e,{type:`idle`,parent:e}))}var Xc=(e,...t)=>new Kc(e,t);La.assign({createStringInterpolator:es,to:(e,t)=>new Kc(e,t)}),Ja.advance;var Zc=/^--/;function Qc(e,t){return t==null||typeof t==`boolean`||t===``?``:typeof t==`number`&&t!==0&&!Zc.test(e)&&!(tl.hasOwnProperty(e)&&tl[e])?t+`px`:(``+t).trim()}var $c={};function el(e,t){if(!e.nodeType||!e.setAttribute||!e.removeAttribute)return!1;let n=e.nodeName===`filter`||e.parentNode&&e.parentNode.nodeName===`filter`,{className:r,style:i,children:a,scrollTop:o,scrollLeft:s,viewBox:c,...l}=t,u=Object.values(l),d=Object.keys(l).map(t=>n||e.hasAttribute(t)?t:$c[t]||($c[t]=t.replace(/([A-Z])/g,e=>`-`+e.toLowerCase())));t.hasOwnProperty(`children`)&&(e.textContent=a);for(let t in i)if(i.hasOwnProperty(t)){let n=Qc(t,i[t]);Zc.test(t)?e.style.setProperty(t,n):e.style[t]=n}d.forEach((t,n)=>{let r=u[n];r===void 0?e.removeAttribute(t):e.setAttribute(t,r)}),t.hasOwnProperty(`className`)&&(r===void 0?e.removeAttribute(`class`):e.className=r),o!==void 0&&(e.scrollTop=o),s!==void 0&&(e.scrollLeft=s),t.hasOwnProperty(`viewBox`)&&(c===void 0?e.removeAttribute(`viewBox`):e.setAttribute(`viewBox`,c))}var tl={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},nl=(e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1),rl=[`Webkit`,`Ms`,`Moz`,`O`];tl=Object.keys(tl).reduce((e,t)=>(rl.forEach(n=>e[nl(n,t)]=e[t]),e),tl);var il=/^(matrix3d|matrix|translate3d|translate[XYZ]?|scale3d|scale[XYZ]?|rotate3d|rotate[XYZ]?|skew[XY]?)$/,al=/^(translate)/,ol=/^(rotate|skew)/,sl=(e,t)=>R.num(e)&&e!==0?e+t:e,cl=(e,t)=>R.arr(e)?e.every(e=>cl(e,t)):R.num(e)?e===t:parseFloat(e)===t,ll=class extends Cs{constructor({x:e,y:t,z:n,...r}){let i=[],a=[];(e||t||n)&&(i.push([e||0,t||0,n||0]),a.push(e=>[`translate3d(${e.map(e=>sl(e,`px`)).join(`,`)})`,cl(e,0)])),Ma(r,(e,t)=>{if(t===`transform`)i.push([e||``]),a.push(e=>[e,e===``]);else if(il.test(t)){if(delete r[t],R.und(e))return;let n=al.test(t)?`px`:ol.test(t)?`deg`:``;i.push(Na(e)),a.push(t===`rotate3d`?([e,t,r,i])=>[`rotate3d(${e},${t},${r},${sl(i,n)})`,cl(i,0)]:e=>[`${t}(${e.map(e=>sl(e,n)).join(`,`)})`,cl(e,+!!t.startsWith(`scale`))])}}),i.length&&(r.transform=new ul(i,a)),super(r)}},ul=class extends zo{constructor(e,t){super(),this.inputs=e,this.transforms=t,this._value=null}get(){return this._value||=this._get()}_get(){let e=``,t=!0;return ja(this.inputs,(n,r)=>{let i=Fo(n[0]),[a,o]=this.transforms[r](R.arr(i)?i:n.map(Fo));e+=` `+a,t&&=o}),t?`none`:e}observerAdded(e){e==1&&ja(this.inputs,e=>ja(e,e=>Po(e)&&Vo(e,this)))}observerRemoved(e){e==0&&ja(this.inputs,e=>ja(e,e=>Po(e)&&Ho(e,this)))}eventObserved(e){e.type==`change`&&(this._value=null),Ro(this,e)}},dl=`a.abbr.address.area.article.aside.audio.b.base.bdi.bdo.big.blockquote.body.br.button.canvas.caption.cite.code.col.colgroup.data.datalist.dd.del.details.dfn.dialog.div.dl.dt.em.embed.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.iframe.img.input.ins.kbd.keygen.label.legend.li.link.main.map.mark.menu.menuitem.meta.meter.nav.noscript.object.ol.optgroup.option.output.p.param.picture.pre.progress.q.rp.rt.ruby.s.samp.script.section.select.small.source.span.strong.style.sub.summary.sup.table.tbody.td.textarea.tfoot.th.thead.time.title.tr.track.u.ul.var.video.wbr.circle.clipPath.defs.ellipse.foreignObject.g.image.line.linearGradient.mask.path.pattern.polygon.polyline.radialGradient.rect.stop.svg.text.tspan`.split(`.`);La.assign({batchedUpdates:sa.unstable_batchedUpdates,createStringInterpolator:es,colors:to});var fl=Ns(dl,{applyAnimatedValues:el,createAnimatedStyle:e=>new ll(e),getComponentProps:({scrollTop:e,scrollLeft:t,...n})=>n}).animated,pl=`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`.split(`.`),ml=[[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 hl(e){if(e<=255)return pl[e];let t=0,n=ml.length-1;for(;t<=n;){let r=t+n>>1,i=ml[r];if(e<i[0]){n=r-1;continue}if(e>i[1]){t=r+1;continue}return i[2]}return`L`}function gl(e){let t=e.length;if(t===0)return null;let n=Array(t),r=!1;for(let i=0;i<t;){let a=e.charCodeAt(i),o=a,s=1;if(a>=55296&&a<=56319&&i+1<t){let t=e.charCodeAt(i+1);t>=56320&&t<=57343&&(o=(a-55296<<10)+(t-56320)+65536,s=2)}let c=hl(o);(c===`R`||c===`AL`||c===`AN`)&&(r=!0);for(let e=0;e<s;e++)n[i+e]=c;i+=s}if(!r)return null;let i=0;for(let e=0;e<t;e++){let t=n[e];if(t===`L`){i=0;break}if(t===`R`||t===`AL`){i=1;break}}let a=new Int8Array(t);for(let e=0;e<t;e++)a[e]=i;let o=i&1?`R`:`L`,s=o,c=s;for(let e=0;e<t;e++)n[e]===`NSM`?n[e]=c:c=n[e];c=s;for(let e=0;e<t;e++){let t=n[e];t===`EN`?n[e]=c===`AL`?`AN`:`EN`:(t===`R`||t===`L`||t===`AL`)&&(c=t)}for(let e=0;e<t;e++)n[e]===`AL`&&(n[e]=`R`);for(let e=1;e<t-1;e++)n[e]===`ES`&&n[e-1]===`EN`&&n[e+1]===`EN`&&(n[e]=`EN`),n[e]===`CS`&&(n[e-1]===`EN`||n[e-1]===`AN`)&&n[e+1]===n[e-1]&&(n[e]=n[e-1]);for(let e=0;e<t;e++){if(n[e]!==`EN`)continue;let r;for(r=e-1;r>=0&&n[r]===`ET`;r--)n[r]=`EN`;for(r=e+1;r<t&&n[r]===`ET`;r++)n[r]=`EN`}for(let e=0;e<t;e++){let t=n[e];(t===`WS`||t===`ES`||t===`ET`||t===`CS`)&&(n[e]=`ON`)}c=s;for(let e=0;e<t;e++){let t=n[e];t===`EN`?n[e]=c===`L`?`L`:`EN`:(t===`R`||t===`L`)&&(c=t)}for(let e=0;e<t;e++){if(n[e]!==`ON`)continue;let r=e+1;for(;r<t&&n[r]===`ON`;)r++;let i=e>0?n[e-1]:s,a=r<t?n[r]:s,o=i===`L`?`L`:`R`;if(o===(a===`L`?`L`:`R`))for(let t=e;t<r;t++)n[t]=o;e=r-1}for(let e=0;e<t;e++)n[e]===`ON`&&(n[e]=o);for(let e=0;e<t;e++){let t=n[e];a[e]&1?(t===`L`||t===`AN`||t===`EN`)&&a[e]++:t===`R`?a[e]++:(t===`AN`||t===`EN`)&&(a[e]+=2)}return a}function _l(e,t){let n=gl(e);if(n===null)return null;let r=new Int8Array(t.length);for(let e=0;e<t.length;e++)r[e]=n[t[e]];return r}var vl=/[ \t\n\r\f]+/g,yl=/[\t\n\r\f]| {2,}|^ | $/;function bl(e){let t=e??`normal`;return t===`pre-wrap`?{mode:t,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:t,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}}function xl(e){if(!yl.test(e))return e;let t=e.replace(vl,` `);return t.charCodeAt(0)===32&&(t=t.slice(1)),t.length>0&&t.charCodeAt(t.length-1)===32&&(t=t.slice(0,-1)),t}function Sl(e){return/[\r\f]/.test(e)?e.replace(/\r\n/g,`
|
|
597
|
+
`).replace(/[\r\f]/g,`
|
|
598
|
+
`):e}var Cl=null,wl;function Tl(){return Cl===null&&(Cl=new Intl.Segmenter(wl,{granularity:`word`})),Cl}var El=/\p{Script=Arabic}/u,Dl=/\p{M}/u,Ol=/\p{Nd}/u;function kl(e){return El.test(e)}function Al(e){return e>=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=183984&&e<=191471||e>=191472&&e<=192093||e>=194560&&e<=195103||e>=196608&&e<=201551||e>=201552&&e<=205743||e>=205744&&e<=210041||e>=63744&&e<=64255||e>=12288&&e<=12351||e>=12352&&e<=12447||e>=12448&&e<=12543||e>=12592&&e<=12687||e>=44032&&e<=55215||e>=65280&&e<=65519}function jl(e){for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(!(n<12288)){if(n>=55296&&n<=56319&&t+1<e.length){let r=e.charCodeAt(t+1);if(r>=56320&&r<=57343){if(Al((n-55296<<10)+(r-56320)+65536))return!0;t++;continue}}if(Al(n))return!0}}return!1}function Ml(e){let t=Jl(e);return t!==null&&(Rl.has(t)||Vl.has(t))}var Nl=new Set([`\xA0`,` `,``,``]),Pl=new Set([`-`,`‐`,`–`,`—`]);function Fl(e){let t=Jl(e);return t!==null&&Nl.has(t)}function Il(e){let t=Jl(e);return t!==null&&Pl.has(t)}function Ll(e,t){return Fl(e)?!1:!t||!(Ml(e)||Il(e))}var Rl=new Set(`,...!.:.;.?.、.。.・.).〕.〉.》.」.』.】.〗.〙.〛.ー.々.〻.ゝ.ゞ.ヽ.ヾ`.split(`.`)),zl=new Set([`"`,`(`,`[`,`{`,`¡`,`¿`,`“`,`‘`,`‚`,`„`,`«`,`‹`,`⸘`,`(`,`〔`,`〈`,`《`,`「`,`『`,`【`,`〖`,`〘`,`〚`]),Bl=new Set([`'`,`’`]),Vl=new Set(`.(,(!(?(:(;(،(؛(؟(।(॥(၊(။(၌(၍(၏()(](}(%("(”(’(»(›(…`.split(`(`)),Hl=new Set([`:`,`.`,`،`,`؛`]),Ul=new Set([`၏`]),Wl=new Set([`”`,`’`,`»`,`›`,`」`,`』`,`】`,`》`,`〉`,`〕`,`)`]);function Gl(e){if(V(e))return!0;let t=!1;for(let n of e){if(Vl.has(n)||$l(n)){t=!0;continue}if(!(t&&Dl.test(n)))return!1}return t}function Kl(e){for(let t of e)if(!Rl.has(t)&&!Vl.has(t))return!1;return e.length>0}function B(e){if(V(e))return!0;for(let t of e)if(!zl.has(t)&&!Bl.has(t)&&!Dl.test(t)&&!$l(t))return!1;return e.length>0}function V(e){let t=!1;for(let n of e)if(!(n===`\\`||Dl.test(n))){if(zl.has(n)||Vl.has(n)||Bl.has(n)){t=!0;continue}return!1}return t}function ql(e,t){let n=t-1;if(n<=0)return Math.max(n,0);let r=e.charCodeAt(n);if(r<56320||r>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 Jl(e){if(e.length===0)return null;let t=ql(e,e.length);return e.slice(t)}function Yl(e){for(let t of e)if(!Dl.test(t))return t;return null}function Xl(e){for(let t=e.length;t>0;){let n=ql(e,t),r=e.slice(n,t);if(!Dl.test(r))return r;t=n}return null}var Zl=[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 Ql(e,t){for(let n=0;n<t.length;n+=2)if(e>=t[n]&&e<=t[n+1])return!0;return!1}function $l(e){let t=e.codePointAt(0);return t!==void 0&&Ql(t,Zl)}function eu(e){let t=Xl(e);return t!==null&&$l(t)}function tu(e){let t=Yl(e);return t!==null&&Ol.test(t)}function nu(e){let t=Array.from(e),n=t.length;for(;n>0;){let e=t[n-1];if(Dl.test(e)){n--;continue}if(zl.has(e)||Bl.has(e)){n--;continue}break}return n<=0||n===t.length?null:{head:t.slice(0,n).join(``),tail:t.slice(n).join(``)}}function ru(e,t,n){return n===`text`&&!t&&e.length===1&&e!==`-`&&e!==`—`?e:null}function iu(e,t,n,r){let i=t[r],a=e[r];if(i==null)return a;let o=n[r];if(a.length===o)return a;let s=i.repeat(o);return e[r]=s,s}function au(e,t){return e&&t!==null&&Hl.has(t)}function ou(e){let t=Jl(e);return t!==null&&Ul.has(t)}function su(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 cu(e){let t=e.length;for(;t>0;){let n=ql(e,t),r=e.slice(n,t);if(Wl.has(r))return!0;if(!Vl.has(r))return!1;t=n}return!1}function lu(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===` `)return`preserved-space`;if(e===` `)return`tab`;if(t.preserveHardBreaks&&e===`
|
|
599
|
+
`)return`hard-break`}return e===` `?`space`:e===`\xA0`||e===` `||e===``||e===``?`glue`:e===``?`zero-width-break`:e===``?`soft-hyphen`:`text`}var uu=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function du(e){return e.length===1?e[0]:e.join(``)}function fu(e,t){let n=[];for(let t=e.length-1;t>=0;t--)n.push(e[t]);return n.push(t),du(n)}function pu(e,t,n,r){if(!uu.test(e))return[{text:e,isWordLike:t,kind:`text`,start:n}];let i=[],a=null,o=[],s=n,c=!1,l=0;for(let u of e){let e=lu(u,r),d=e===`text`&&t;if(a!==null&&e===a&&d===c){o.push(u),l+=u.length;continue}a!==null&&i.push({text:du(o),isWordLike:c,kind:a,start:s}),a=e,o=[u],s=n+l,c=d,l+=u.length}return a!==null&&i.push({text:du(o),isWordLike:c,kind:a,start:s}),i}function mu(e){return e===`space`||e===`preserved-space`||e===`zero-width-break`||e===`hard-break`}var hu=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function gu(e,t){let n=e.texts[t];return n.startsWith(`www.`)?!0:hu.test(n)&&t+1<e.len&&e.kinds[t+1]===`text`&&e.texts[t+1]===`//`}function _u(e){return e.includes(`?`)&&(e.includes(`://`)||e.startsWith(`www.`))}function vu(e){let t=e.texts.slice(),n=e.isWordLike.slice(),r=e.kinds.slice(),i=e.starts.slice();for(let i=0;i<e.len;i++){if(r[i]!==`text`||!gu(e,i))continue;let a=[t[i]],o=i+1;for(;o<e.len&&!mu(r[o]);){a.push(t[o]),n[i]=!0;let e=t[o].includes(`?`);if(r[o]=`text`,t[o]=``,o++,e)break}t[i]=du(a)}let a=0;for(let e=0;e<t.length;e++){let o=t[e];o.length!==0&&(a!==e&&(t[a]=o,n[a]=n[e],r[a]=r[e],i[a]=i[e]),a++)}return t.length=a,n.length=a,r.length=a,i.length=a,{len:a,texts:t,isWordLike:n,kinds:r,starts:i}}function yu(e){let t=[],n=[],r=[],i=[];for(let a=0;a<e.len;a++){let o=e.texts[a];if(t.push(o),n.push(e.isWordLike[a]),r.push(e.kinds[a]),i.push(e.starts[a]),!_u(o))continue;let s=a+1;if(s>=e.len||mu(e.kinds[s]))continue;let c=[],l=e.starts[s],u=s;for(;u<e.len&&!mu(e.kinds[u]);)c.push(e.texts[u]),u++;c.length>0&&(t.push(du(c)),n.push(!0),r.push(`text`),i.push(l),a=u-1)}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}var bu=new Set([`:`,`-`,`/`,`×`,`,`,`.`,`+`,`–`,`—`]),xu=/[\p{P}\p{S}\p{Co}]/u,Su=/\p{Emoji_Presentation}/u,Cu=new Set([`?`,`֊`,`-`,`‐`,`‒`,`–`,`—`,`…`,`‼`,`‽`,`⁉`]);function wu(e){return e>=33&&e<=47&&e!==45||e>=58&&e<=64&&e!==63||e>=91&&e<=96||e>=123&&e<=126}function Tu(e){let t=e.charCodeAt(0);return t<128?wu(t):!Cu.has(e)&&!Su.test(e)&&xu.test(e)}function Eu(e){let t=!1;for(let n of e)if(!Dl.test(n)){if(!Tu(n))return!1;t=!0}return t}function Du(e){for(let t=e.length;t>0;){let n=ql(e,t),r=e.slice(n,t);if(Dl.test(r)){t=n;continue}return Tu(r)||$l(r)}return!1}function Ou(e,t,n,r){let i=!t&&Eu(e),a=!r&&Eu(n),o=eu(e),s=(t||o)&&Du(e);return!i&&!a&&!s||jl(e)||jl(n)?!1:(t||i||o)&&(r||a)}function ku(e){for(let t of e)if(Ol.test(t))return!0;return!1}function Au(e){if(e.length===0)return!1;for(let t of e)if(!(Ol.test(t)||bu.has(t)))return!1;return!0}function ju(e){let t=[],n=[],r=[],i=[];for(let a=0;a<e.len;a++){let o=e.texts[a],s=e.kinds[a];if(s===`text`&&Au(o)&&ku(o)){let s=[o],c=a+1;for(;c<e.len&&e.kinds[c]===`text`&&Au(e.texts[c]);)s.push(e.texts[c]),c++;t.push(du(s)),n.push(!0),r.push(`text`),i.push(e.starts[a]),a=c-1;continue}t.push(o),n.push(e.isWordLike[a]),r.push(s),i.push(e.starts[a])}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function Mu(e){let t=[],n=[],r=[],i=[],a=0;for(;a<e.len;){let o=e.texts[a],s=e.kinds[a],c=e.isWordLike[a];if(s===`text`){let s=[o],l=a+1,u=c;for(;l<e.len&&e.kinds[l]===`text`&&Ou(e.texts[l-1],e.isWordLike[l-1],e.texts[l],e.isWordLike[l]);){let t=e.texts[l];s.push(t),u||=e.isWordLike[l],l++}if(l>a+1){t.push(du(s)),n.push(u),r.push(`text`),i.push(e.starts[a]),a=l;continue}}t.push(o),n.push(c),r.push(s),i.push(e.starts[a]),a++}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function Nu(e){let t=[],n=[],r=[],i=[];for(let a=0;a<e.len;a++){let o=e.texts[a];if(e.kinds[a]===`text`&&o.includes(`-`)){let s=o.split(`-`),c=s.length>1;for(let e=0;e<s.length;e++){let t=s[e];if(!c)break;(t.length===0||!ku(t)||!Au(t))&&(c=!1)}if(c){let o=0;for(let c=0;c<s.length;c++){let l=s[c],u=c<s.length-1?`${l}-`:l;t.push(u),n.push(!0),r.push(`text`),i.push(e.starts[a]+o),o+=u.length}continue}}t.push(o),n.push(e.isWordLike[a]),r.push(e.kinds[a]),i.push(e.starts[a])}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function Pu(e){let t=[],n=[],r=[],i=[],a=0;for(;a<e.len;){let o=[e.texts[a]],s=e.isWordLike[a],c=e.kinds[a],l=e.starts[a];if(c===`glue`){let u=[o[0]],d=l;for(a++;a<e.len&&e.kinds[a]===`glue`;)u.push(e.texts[a]),a++;let f=du(u);if(a<e.len&&e.kinds[a]===`text`)o[0]=f,o.push(e.texts[a]),s=e.isWordLike[a],c=`text`,l=d,a++;else{t.push(f),n.push(!1),r.push(`glue`),i.push(d);continue}}else a++;if(c===`text`)for(;a<e.len&&e.kinds[a]===`glue`;){let t=[];for(;a<e.len&&e.kinds[a]===`glue`;)t.push(e.texts[a]),a++;let n=du(t);if(a<e.len&&e.kinds[a]===`text`){o.push(n,e.texts[a]),s||=e.isWordLike[a],a++;continue}o.push(n)}t.push(du(o)),n.push(s),r.push(c),i.push(l)}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function Fu(e){let t=e.texts.slice(),n=e.isWordLike.slice(),r=e.kinds.slice(),i=e.starts.slice();for(let e=0;e<t.length-1;e++){if(r[e]!==`text`||r[e+1]!==`text`||!jl(t[e])||!jl(t[e+1]))continue;let n=nu(t[e]);n!==null&&(t[e]=n.head,t[e+1]=n.tail+t[e+1],i[e+1]=i[e]+n.head.length)}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function Iu(e,t,n){let r=Tl(),i=0,a=[],o=[],s=[],c=[],l=[],u=[],d=[],f=[],p=[],m=[],h=[],g=[];for(let _ of r.segment(e))for(let e of pu(_.segment,_.isWordLike??!1,_.index,n)){let n=e.kind===`text`,r=ru(e.text,e.isWordLike,e.kind),_=jl(e.text),v=kl(e.text),y=Jl(e.text),b=cu(e.text),x=ou(e.text),S=i-1;function C(){u[S]!==null&&(o[S]=[iu(a,u,d,S)],u[S]=null),o[S].push(e.text),s[S]=s[S]||e.isWordLike,f[S]=f[S]||_,p[S]=p[S]||v,m[S]=b,h[S]=x,g[S]=au(p[S],y)}t.carryCJKAfterClosingQuote&&n&&i>0&&c[S]===`text`&&_&&f[S]&&m[S]||n&&i>0&&c[S]===`text`&&Kl(e.text)&&f[S]||n&&i>0&&c[S]===`text`&&h[S]?C():n&&i>0&&c[S]===`text`&&e.isWordLike&&v&&g[S]?(C(),s[S]=!0):r!==null&&i>0&&c[S]===`text`&&u[S]===r?d[S]=(d[S]??1)+1:n&&!e.isWordLike&&i>0&&c[S]===`text`&&!f[S]&&(Gl(e.text)||e.text===`-`&&s[S])?C():(a[i]=e.text,o[i]=[e.text],s[i]=e.isWordLike,c[i]=e.kind,l[i]=e.start,u[i]=r,d[i]=r===null?0:1,f[i]=_,p[i]=v,m[i]=b,h[i]=x,g[i]=au(v,y),i++)}for(let e=0;e<i;e++){if(u[e]!==null){a[e]=iu(a,u,d,e);continue}a[e]=du(o[e])}for(let e=1;e<i;e++)c[e]===`text`&&!s[e]&&V(a[e])&&c[e-1]===`text`&&!f[e-1]&&(a[e-1]+=a[e],s[e-1]=s[e-1]||s[e],a[e]=``);let _=Array.from({length:i},()=>null),v=-1;for(let e=i-1;e>=0;e--){let t=a[e];if(t.length!==0){if(c[e]===`text`&&!s[e]&&v>=0&&c[v]===`text`&&(B(t)||t===`-`&&tu(a[v]))){let n=_[v]??[];n.push(t),_[v]=n,l[v]=l[e],a[e]=``;continue}v=e}}for(let e=0;e<i;e++){let t=_[e];t!=null&&(a[e]=fu(t,a[e]))}let y=0;for(let e=0;e<i;e++){let t=a[e];t.length!==0&&(y!==e&&(a[y]=t,s[y]=s[e],c[y]=c[e],l[y]=l[e]),y++)}a.length=y,s.length=y,c.length=y,l.length=y;let b=Fu(Mu(Nu(ju(yu(vu(Pu({len:y,texts:a,isWordLike:s,kinds:c,starts:l})))))));for(let e=0;e<b.len-1;e++){let t=su(b.texts[e]);t!==null&&(b.kinds[e]!==`space`&&b.kinds[e]!==`preserved-space`||b.kinds[e+1]!==`text`||!kl(b.texts[e+1])||(b.texts[e]=t.space,b.isWordLike[e]=!1,b.kinds[e]=b.kinds[e]===`preserved-space`?`preserved-space`:`space`,b.texts[e+1]=t.marks+b.texts[e+1],b.starts[e+1]=b.starts[e]+t.space.length))}return b}function Lu(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];let n=[],r=0;for(let t=0;t<e.len;t++)e.kinds[t]===`hard-break`&&(n.push({startSegmentIndex:r,endSegmentIndex:t,consumedEndSegmentIndex:t+1}),r=t+1);return r<e.len&&n.push({startSegmentIndex:r,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}),n}function Ru(e,t,n){if(t.len<=1)return t;let r=[],i=[],a=[],o=[],s=-1,c=!1;function l(e){r.push(t.texts[e]),i.push(t.isWordLike[e]),a.push(`text`),o.push(t.starts[e])}function u(n,s){let c=!1;for(let e=n;e<s;e++)c||=t.isWordLike[e];let l=t.starts[n],u=s<t.len?t.starts[s]:e.length;r.push(e.slice(l,u)),i.push(c),a.push(`text`),o.push(l)}function d(e){if(!(s<0)){if(c)s+1===e?l(s):u(s,e);else for(let t=s;t<e;t++)l(t);s=-1,c=!1}}for(let e=0;e<t.len;e++){let l=t.texts[e],u=t.kinds[e];if(u===`text`){s>=0&&!Ll(t.texts[e-1],n)&&d(e),s<0&&(s=e),c||=jl(l);continue}d(e),r.push(l),i.push(t.isWordLike[e]),a.push(u),o.push(t.starts[e])}return d(t.len),{len:r.length,texts:r,isWordLike:i,kinds:a,starts:o}}function zu(e,t,n=`normal`,r=`normal`){let i=bl(n),a=i.mode===`pre-wrap`?Sl(e):xl(e);if(a.length===0)return{normalized:a,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};let o=Iu(a,t,i),s=r===`keep-all`?Ru(a,o,t.breakKeepAllAfterPunctuation):o;return{normalized:a,chunks:Lu(s,i),...s}}var Bu=null,Vu=new Map,Hu=null,Uu=96,Wu=/\p{Emoji_Presentation}/u,Gu=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u,Ku=null,qu=new Map;function Ju(){if(Bu!==null)return Bu;if(typeof OffscreenCanvas<`u`)return Bu=new OffscreenCanvas(1,1).getContext(`2d`),Bu;if(typeof document<`u`)return Bu=document.createElement(`canvas`).getContext(`2d`),Bu;throw Error(`Text measurement requires OffscreenCanvas or a DOM canvas context.`)}function Yu(e){let t=Vu.get(e);return t||(t=new Map,Vu.set(e,t)),t}function Xu(e,t){let n=t.get(e);return n===void 0&&(n={width:Ju().measureText(e).width,containsCJK:jl(e)},t.set(e,n)),n}function Zu(){if(Hu!==null)return Hu;if(typeof navigator>`u`)return Hu={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,breakKeepAllAfterPunctuation:!0,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},Hu;let e=navigator.userAgent,t=navigator.vendor===`Apple Computer, Inc.`&&e.includes(`Safari/`)&&!e.includes(`Chrome/`)&&!e.includes(`Chromium/`)&&!e.includes(`CriOS/`)&&!e.includes(`FxiOS/`)&&!e.includes(`EdgiOS/`),n=e.includes(`Chrome/`)||e.includes(`Chromium/`)||e.includes(`CriOS/`)||e.includes(`Edg/`);return Hu={lineFitEpsilon:t?1/64:.005,carryCJKAfterClosingQuote:n,breakKeepAllAfterPunctuation:!t,preferPrefixWidthsForBreakableRuns:t,preferEarlySoftHyphenBreak:t},Hu}function Qu(e){let t=e.match(/(\d+(?:\.\d+)?)\s*px/);return t?parseFloat(t[1]):16}function $u(){return Ku===null&&(Ku=new Intl.Segmenter(void 0,{granularity:`grapheme`})),Ku}function ed(e){return Wu.test(e)||e.includes(`️`)}function td(e){return Gu.test(e)}function nd(e,t){let n=qu.get(e);if(n!==void 0)return n;let r=Ju();r.font=e;let i=r.measureText(`😀`).width;if(n=0,i>t+.5&&typeof document<`u`&&document.body!==null){let t=document.createElement(`span`);t.style.font=e,t.style.display=`inline-block`,t.style.visibility=`hidden`,t.style.position=`absolute`,t.textContent=`😀`,document.body.appendChild(t);let r=t.getBoundingClientRect().width;document.body.removeChild(t),i-r>.5&&(n=i-r)}return qu.set(e,n),n}function rd(e){let t=0,n=$u();for(let r of n.segment(e))ed(r.segment)&&t++;return t}function id(e,t){return t.emojiCount===void 0&&(t.emojiCount=rd(e)),t.emojiCount}function ad(e,t,n){return n===0?t.width:t.width-id(e,t)*n}function od(e,t,n,r,i){if(t.breakableFitAdvances!==void 0&&t.breakableFitMode===i)return t.breakableFitAdvances;t.breakableFitMode=i;let a=$u(),o=[];for(let t of a.segment(e))o.push(t.segment);if(o.length<=1)return t.breakableFitAdvances=null,t.breakableFitAdvances;if(i===`sum-graphemes`){let e=[];for(let t of o){let i=Xu(t,n);e.push(ad(t,i,r))}return t.breakableFitAdvances=e,t.breakableFitAdvances}if(i===`pair-context`||o.length>Uu){let e=[],i=null,a=0;for(let t of o){let o=ad(t,Xu(t,n),r);if(i===null)e.push(o);else{let o=i+t,s=Xu(o,n);e.push(ad(o,s,r)-a)}i=t,a=o}return t.breakableFitAdvances=e,t.breakableFitAdvances}let s=[],c=``,l=0;for(let e of o){c+=e;let t=Xu(c,n),i=ad(c,t,r);s.push(i-l),l=i}return t.breakableFitAdvances=s,t.breakableFitAdvances}function sd(e,t){let n=Ju();n.font=e;let r=Yu(e),i=Qu(e);return{cache:r,fontSize:i,emojiCorrection:t?nd(e,i):0}}function cd(e){return e===`space`||e===`zero-width-break`||e===`soft-hyphen`}function ld(e){return e===`space`||e===`preserved-space`||e===`tab`||e===`zero-width-break`||e===`soft-hyphen`}function ud(e,t,n=e.widths.length){for(;t<n;){let n=e.kinds[t];if(!cd(n))break;t++}return t}function dd(e,t){if(t<=0)return 0;let n=e%t;return Math.abs(n)<=1e-6?t:t-n}function fd(e,t,n){return e.letterSpacing!==0&&t&&e.spacingGraphemeCounts[n]>0?e.letterSpacing:0}function pd(e,t){return t===0?0:e+t}function md(e,t){return e.letterSpacing!==0&&e.spacingGraphemeCounts[t]>0?e.letterSpacing:0}function hd(e,t,n,r,i){return pd(r,t===`tab`?i+md(e,n):e.lineEndFitAdvances[n])}function gd(e,t,n,r){return pd(r,t===`tab`?0:e.lineEndFitAdvances[n])}function _d(e,t,n,r,i){return pd(r,t===`tab`?i:e.lineEndPaintAdvances[n])}function vd(e,t,n){return e.letterSpacing!==0&&t?n+e.letterSpacing:n}function yd(e,t){return e.letterSpacing===0?t:t+e.letterSpacing}function bd(e,t,n){let r=t;for(;r<e.length&&e[r]<n;)r++;return r}function xd(e,t,n,r,i){if(e.letterSpacing===0)return 0;if(i>0)return e.spacingGraphemeCounts[r]>0?e.letterSpacing:0;for(let i=r-1;i>=t;i--){let a=e.kinds[i];if(!(a===`space`||a===`zero-width-break`||a===`hard-break`)){if(a===`soft-hyphen`){if(i===r-1)return 0;continue}return i===t&&n>0||e.spacingGraphemeCounts[i]>0?e.letterSpacing:0}}return 0}function Sd(e,t,n,r,i,a){return t+xd(e,n,r,i,a)}function Cd(e,t,n){let{widths:r,kinds:i,breakableFitAdvances:a,breakablePreferredBreaks:o}=e;if(r.length===0)return 0;let s=t+Zu().lineFitEpsilon,c=0,l=0,u=!1,d=0,f=0,p=0,m=0,h=-1,g=0;function _(){h=-1,g=0}function v(e=p,t=m,r=l){c++,n?.(r,d,f,e,t),l=0,u=!1,_()}function y(e,t){u=!0,d=e,f=0,p=e+1,m=0,l=t}function b(e,t,n){u=!0,d=e,f=t,p=e,m=t+1,l=n}function x(e,t){if(!u){y(e,t);return}l+=t,p=e+1,m=0}function S(e,t){let n=a[e],r=o[e]??null,i=r===null?-1:bd(r,0,t+1),c=-1,d=0,f=t;for(;f<n.length;){let a=n[f];if(!u)b(e,f,a);else if(l+a>s){if(r!==null&&c>t){v(e,c,d),f=c,i=bd(r,i,f+1),c=-1,d=0;continue}v(),b(e,f,a)}else l+=a,p=e,m=f+1;let o=f+1;r!==null&&r[i]===o&&(c=o,d=l,i++),f++}u&&p===e&&m===n.length&&(p=e+1,m=0)}let C=0;for(;C<r.length&&!(!u&&(C=ud(e,C),C>=r.length));){let e=r[C],t=i[C],n=ld(t);if(!u){e>s&&a[C]!==null?S(C,0):y(C,e),n&&(h=C+1,g=l-e),C++;continue}if(l+e>s){if(n){x(C,e),v(C+1,0,l-e),C++;continue}if(h>=0){if(p>h||p===h&&m>0){v();continue}v(h,0,g);continue}if(e>s&&a[C]!==null){v(),S(C,0),C++;continue}v();continue}x(C,e),n&&(h=C+1,g=l-e),C++}return u&&v(),c}function wd(e,t,n){if(e.simpleLineWalkFastPath)return Cd(e,t,n);let{widths:r,kinds:i,breakableFitAdvances:a,breakablePreferredBreaks:o,discretionaryHyphenWidth:s,chunks:c}=e;if(r.length===0||c.length===0)return 0;let l=Zu(),u=t+l.lineFitEpsilon,d=0,f=0,p=!1,m=0,h=0,g=0,_=0,v=-1,y=0,b=0,x=null;function S(){v=-1,y=0,b=0,x=null}function C(){return x===`soft-hyphen`&&v===g&&_===0?b:f}function w(t=g,r=_,i){d++,n!==void 0&&n(Sd(e,i??C(),m,h,t,r),m,h,t,r),f=0,p=!1,S()}function T(e,t){p=!0,m=e,h=0,g=e+1,_=0,f=t}function ee(e,t,n){p=!0,m=e,h=t,g=e,_=t+1,f=n}function E(e,t){if(!p){T(e,t);return}f+=t,g=e+1,_=0}function D(t,n,r,i,a,o){if(!n)return;let s=gd(e,t,r,a),c=_d(e,t,r,a,i);v=r+1,y=f-o+s,b=f-o+c,x=t}function te(t,n){let r=a[t],i=o[t]??null,s=i===null?-1:bd(i,0,n+1),c=-1,l=0,d=n;for(;d<r.length;){let a=r[d];if(!p)ee(t,d,a);else{let r=vd(e,!0,a),o=f+r;if(yd(e,o)>u){if(i!==null&&c>n){w(t,c,l),d=c,s=bd(i,s,d+1),c=-1,l=0;continue}w(),ee(t,d,a)}else f=o,g=t,_=d+1}let o=d+1;i!==null&&i[s]===o&&(c=o,l=f,s++),d++}p&&g===t&&_===r.length&&(g=t+1,_=0)}function ne(e){d++,n?.(0,e.startSegmentIndex,0,e.consumedEndSegmentIndex,0),S()}for(let t=0;t<c.length;t++){let n=c[t];if(n.startSegmentIndex===n.endSegmentIndex){ne(n);continue}p=!1,f=0,m=n.startSegmentIndex,h=0,g=n.startSegmentIndex,_=0,S();let o=n.startSegmentIndex;for(;o<n.endSegmentIndex&&!(!p&&(o=ud(e,o,n.endSegmentIndex),o>=n.endSegmentIndex));){let t=i[o],n=ld(t),c=fd(e,p,o),d=t===`tab`?dd(f+c,e.tabStopAdvance):r[o],m=c+d,h=hd(e,t,o,c,d);if(t===`soft-hyphen`){p&&(g=o+1,_=0,v=o+1,y=f+s,b=f+s,x=t),o++;continue}if(!p){h>u&&a[o]!==null?te(o,0):T(o,d),D(t,n,o,d,c,m),o++;continue}if(f+h>u){let r=f+gd(e,t,o,c),i=f+_d(e,t,o,c,d);if(x===`soft-hyphen`&&l.preferEarlySoftHyphenBreak&&y<=u){w(v,0,b);continue}if(n&&r<=u){E(o,m),w(o+1,0,i),o++;continue}if(v>=0&&y<=u){if(g>v||g===v&&_>0){w();continue}let e=v;w(e,0,b),o=e;continue}if(h>u&&a[o]!==null){w(),te(o,0),o++;continue}w();continue}E(o,m),D(t,n,o,d,c,m),o++}if(p){let e=v===n.consumedEndSegmentIndex?b:f;w(n.consumedEndSegmentIndex,0,e)}}return d}var Td=null;function Ed(){return Td===null&&(Td=new Intl.Segmenter(void 0,{granularity:`grapheme`})),Td}function Dd(e){return e?{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],breakablePreferredBreaks:[],letterSpacing:0,spacingGraphemeCounts:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[],segments:[]}:{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],breakablePreferredBreaks:[],letterSpacing:0,spacingGraphemeCounts:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[]}}function Od(e,t){let n=[],r=[],i=0,a=!1,o=!1,s=!1;function c(){r.length!==0&&(n.push({text:r.length===1?r[0]:r.join(``),start:i}),r=[],a=!1,o=!1,s=!1)}function l(e,t,n){r=[e],i=t,a=n,o=cu(e),s=zl.has(e)}function u(e,t){r.push(e),a||=t;let n=cu(e);e.length===1&&Vl.has(e)?o||=n:o=n,s=!1}for(let n of Ed().segment(e)){let e=n.segment,i=jl(e);if(r.length===0){l(e,n.index,i);continue}if(s||Rl.has(e)||Vl.has(e)||t.carryCJKAfterClosingQuote&&i&&o){u(e,i);continue}if(!a&&!i){u(e,i);continue}c(),l(e,n.index,i)}return c(),n}function kd(e,t,n){if(t.length<=1)return t;let r=[],i=-1,a=!1;function o(n,i){let a=t[n].start,o=i<t.length?t[i].start:e.length;r.push({text:e.slice(a,o),start:a})}function s(e){if(!(i<0)){if(a)i+1===e?r.push(t[i]):o(i,e);else for(let n=i;n<e;n++)r.push(t[n]);i=-1,a=!1}}for(let e=0;e<t.length;e++){let r=t[e];i>=0&&!Ll(t[e-1].text,n)&&s(e),i<0&&(i=e),a||=jl(r.text)}return s(t.length),r}function H(e,t){if(t===`zero-width-break`||t===`soft-hyphen`||t===`hard-break`)return 0;if(t===`tab`)return 1;let n=0,r=Ed();for(let t of r.segment(e))n++;return n}function Ad(e){return e===`-`||e===`֊`||e===`‐`||e===`‒`||e===`–`||e===`—`}function jd(e){if(!/[-\u058A\u2010\u2012\u2013\u2014]/u.test(e))return null;let t=[],n=0;for(let r of Ed().segment(e))n++,Ad(r.segment)&&t.push(n);return t.length===0?null:t}function Md(e,t,n){return t>1?e+(t-1)*n:e}function Nd(e,t,n,r,i){let a=Zu(),{cache:o,emojiCorrection:s}=sd(t,td(e.normalized)),c=ad(`-`,Xu(`-`,o),s)+(i===0?0:i*2),l=ad(` `,Xu(` `,o),s)*8,u=i!==0;if(e.len===0)return Dd(n);let d=[],f=[],p=[],m=[],h=e.chunks.length<=1&&!u,g=n?[]:null,_=[],v=[],y=[],b=n?[]:null,x=Array.from({length:e.len});function S(e,t,n,r,i,a,o,s,c){i!==`text`&&i!==`space`&&i!==`zero-width-break`&&(h=!1),d.push(t),f.push(n),p.push(r),m.push(i),g?.push(a),_.push(o),v.push(s),u&&y.push(c),b!==null&&b.push(e)}function C(e,t,n,c,l){let d=Xu(e,o),f=u?H(e,t):0,p=Md(ad(e,d,s),f,i),m=t===`space`||t===`preserved-space`||t===`zero-width-break`?0:p,h=m===0?0:m+(f>0?i:0),g=t===`space`||t===`zero-width-break`?0:p;if(l&&c&&e.length>1){let c=`sum-graphemes`;i===0?Au(e)?c=`pair-context`:a.preferPrefixWidthsForBreakableRuns&&(c=`segment-prefixes`):c=`segment-prefixes`;let l=od(e,d,o,s,c);S(e,p,h,g,t,n,l,l===null||r===`keep-all`?null:jd(e),f);return}S(e,p,h,g,t,n,null,null,f)}for(let t=0;t<e.len;t++){x[t]=d.length;let n=e.texts[t],i=e.isWordLike[t],s=e.kinds[t],l=e.starts[t];if(s===`soft-hyphen`){S(n,0,c,c,s,l,null,null,0);continue}if(s===`hard-break`){S(n,0,0,0,s,l,null,null,0);continue}if(s===`tab`){S(n,0,0,0,s,l,null,null,u?H(n,s):0);continue}let f=Xu(n,o);if(s===`text`&&f.containsCJK){let e=Od(n,a),t=r===`keep-all`?kd(n,e,a.breakKeepAllAfterPunctuation):e;for(let e=0;e<t.length;e++){let n=t[e];C(n.text,`text`,l+n.start,i,r===`keep-all`||!jl(n.text))}continue}C(n,s,l,i,!0)}let w=Pd(e.chunks,x,d.length),T=g===null?null:_l(e.normalized,g);return b===null?{widths:d,lineEndFitAdvances:f,lineEndPaintAdvances:p,kinds:m,simpleLineWalkFastPath:h,segLevels:T,breakableFitAdvances:_,breakablePreferredBreaks:v,letterSpacing:i,spacingGraphemeCounts:y,discretionaryHyphenWidth:c,tabStopAdvance:l,chunks:w}:{widths:d,lineEndFitAdvances:f,lineEndPaintAdvances:p,kinds:m,simpleLineWalkFastPath:h,segLevels:T,breakableFitAdvances:_,breakablePreferredBreaks:v,letterSpacing:i,spacingGraphemeCounts:y,discretionaryHyphenWidth:c,tabStopAdvance:l,chunks:w,segments:b}}function Pd(e,t,n){let r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a.startSegmentIndex<t.length?t[a.startSegmentIndex]:n,s=a.endSegmentIndex<t.length?t[a.endSegmentIndex]:n,c=a.consumedEndSegmentIndex<t.length?t[a.consumedEndSegmentIndex]:n;r.push({startSegmentIndex:o,endSegmentIndex:s,consumedEndSegmentIndex:c})}return r}function Fd(e,t,n,r){let i=r?.wordBreak??`normal`,a=r?.letterSpacing??0;return Nd(zu(e,Zu(),r?.whiteSpace,i),t,n,i,a)}function Id(e,t,n){return Fd(e,t,!0,n)}function Ld(e){return e}function Rd(e){let t=0;return wd(Ld(e),1/0,e=>{e>t&&(t=e)}),t}function zd(e){let t=e.toLowerCase().replace(/^←\s*/,``);return t.includes(`force push`)?`force-push`:t.includes(`cherry`)?`cherry-pick`:t.includes(`uncommit`)?`uncommit`:t.includes(`revert`)?`revert`:t.includes(`rebase`)?`rebase`:t.includes(`merge`)?`merge`:t.includes(`checkout`)?`checkout`:t.includes(`fetch`)?`fetch`:t.includes(`push`)?`push`:t.includes(`delete`)||t.includes(`discard`)?`delete`:t.includes(`unstage`)?`unstage`:t.includes(`stage`)?`stage`:t.includes(`stash`)?`stash`:t.includes(`move`)?`move`:t.includes(`reset`)?`reset`:t.includes(`branch`)?`branch`:t.includes(`tag`)?`tag`:`checkout`}function Bd({name:e,size:t=14}){let n={fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`};return(0,y.jsxs)(`svg`,{"aria-hidden":`true`,focusable:`false`,width:t,height:t,viewBox:`0 0 24 24`,style:{flex:`0 0 auto`},children:[e===`branch`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`circle`,{...n,cx:`6`,cy:`6`,r:`3`}),(0,y.jsx)(`circle`,{...n,cx:`18`,cy:`18`,r:`3`}),(0,y.jsx)(`path`,{...n,d:`M6 9v9`}),(0,y.jsx)(`path`,{...n,d:`M9 18h6`})]}),e===`checkout`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...n,d:`M5 12h14`}),(0,y.jsx)(`path`,{...n,d:`m13 6 6 6-6 6`}),(0,y.jsx)(`path`,{...n,d:`M5 5v14`})]}),e===`cherry-pick`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`circle`,{...n,cx:`7`,cy:`7`,r:`3`}),(0,y.jsx)(`circle`,{...n,cx:`17`,cy:`17`,r:`3`}),(0,y.jsx)(`path`,{...n,d:`M10 7h2a5 5 0 0 1 5 5v2`})]}),e===`delete`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...n,d:`M3 6h18`}),(0,y.jsx)(`path`,{...n,d:`M8 6V4h8v2`}),(0,y.jsx)(`path`,{...n,d:`m19 6-1 14H6L5 6`}),(0,y.jsx)(`path`,{...n,d:`M10 11v5`}),(0,y.jsx)(`path`,{...n,d:`M14 11v5`})]}),e===`fetch`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...n,d:`M12 5v12`}),(0,y.jsx)(`path`,{...n,d:`m7 12 5 5 5-5`}),(0,y.jsx)(`path`,{...n,d:`M5 20h14`})]}),e===`force-push`&&(0,y.jsx)(`path`,{...n,d:`M13 2 4 14h7l-1 8 10-13h-7l0-7Z`}),e===`merge`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`circle`,{...n,cx:`6`,cy:`6`,r:`3`}),(0,y.jsx)(`circle`,{...n,cx:`6`,cy:`18`,r:`3`}),(0,y.jsx)(`circle`,{...n,cx:`18`,cy:`18`,r:`3`}),(0,y.jsx)(`path`,{...n,d:`M6 9v6`}),(0,y.jsx)(`path`,{...n,d:`M9 6h1a8 8 0 0 1 8 8v1`})]}),e===`move`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...n,d:`M3 12h18`}),(0,y.jsx)(`path`,{...n,d:`m8 7-5 5 5 5`}),(0,y.jsx)(`path`,{...n,d:`m16 7 5 5-5 5`})]}),e===`push`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...n,d:`M12 19V5`}),(0,y.jsx)(`path`,{...n,d:`m7 10 5-5 5 5`}),(0,y.jsx)(`path`,{...n,d:`M5 20h14`})]}),e===`rebase`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`circle`,{...n,cx:`6`,cy:`6`,r:`3`}),(0,y.jsx)(`circle`,{...n,cx:`6`,cy:`18`,r:`3`}),(0,y.jsx)(`circle`,{...n,cx:`18`,cy:`12`,r:`3`}),(0,y.jsx)(`path`,{...n,d:`M6 9v6`}),(0,y.jsx)(`path`,{...n,d:`M9 6h2a7 7 0 0 1 7 7`})]}),e===`reset`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...n,d:`M4 7v6h6`}),(0,y.jsx)(`path`,{...n,d:`M20 17a8 8 0 0 1-14.9-4`}),(0,y.jsx)(`path`,{...n,d:`M4 13A8 8 0 0 1 19 8`})]}),e===`revert`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...n,d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.7 2.7L3 8`}),(0,y.jsx)(`path`,{...n,d:`M3 3v5h5`})]}),e===`stage`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...n,d:`M12 5v14`}),(0,y.jsx)(`path`,{...n,d:`M5 12h14`})]}),e===`stash`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...n,d:`M4 4h16v6H4z`}),(0,y.jsx)(`path`,{...n,d:`M6 10v10h12V10`}),(0,y.jsx)(`path`,{...n,d:`M9 14h6`})]}),e===`tag`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...n,d:`M20 10 10 20 4 14V4h10l6 6Z`}),(0,y.jsx)(`circle`,{...n,cx:`9`,cy:`9`,r:`1`})]}),e===`unstage`&&(0,y.jsx)(`path`,{...n,d:`M5 12h14`}),e===`uncommit`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...n,d:`M9 14 4 9l5-5`}),(0,y.jsx)(`path`,{...n,d:`M4 9h10a6 6 0 0 1 0 12h-1`})]})]})}function Vd({size:e=13}){return(0,y.jsx)(`svg`,{"aria-hidden":`true`,focusable:`false`,width:e,height:e,viewBox:`0 0 24 24`,style:{flex:`0 0 auto`},children:(0,y.jsx)(`path`,{d:`M12 3a9 9 0 0 1 9 9`,fill:`none`,stroke:`currentColor`,strokeWidth:2.4,strokeLinecap:`round`,children:(0,y.jsx)(`animateTransform`,{attributeName:`transform`,type:`rotate`,from:`0 12 12`,to:`360 12 12`,dur:`0.8s`,repeatCount:`indefinite`})})})}function Hd({label:e,onClick:t,tone:n,onMouseEnter:r,onMouseLeave:i}){let a=n===`success`?`#0b1020`:n===`warning`?`#fff7d6`:n===`merge`?`#fff7ff`:`#fff7ed`,o=n===`success`?`#6d9658`:n===`warning`?`#d8a43a`:n===`merge`?`#b764d9`:`#9a3412`,s=n===`success`?`#8dcf78`:n===`warning`?`#b88a25`:n===`merge`?`#c77de4`:`#b45309`,c=n===`success`?`#9cda89`:n===`warning`?`#c99a30`:n===`merge`?`#d08bea`:`#c26115`;return(0,y.jsxs)(`button`,{onClick:e=>{e.stopPropagation(),t()},style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,minWidth:104,height:30,padding:`0 12px`,background:s,border:`1px solid ${o}`,borderRadius:7,color:a,fontSize:10,fontWeight:700,cursor:`pointer`,fontFamily:`inherit`,whiteSpace:`nowrap`,position:`relative`,zIndex:8,boxShadow:`0 10px 24px rgba(0,0,0,0.35)`,gap:6,lineHeight:1},onMouseEnter:e=>{e.currentTarget.style.background=c},onMouseLeave:e=>{e.currentTarget.style.background=s},onPointerEnter:r,onPointerLeave:i,children:[(0,y.jsx)(Bd,{name:zd(e)}),(0,y.jsx)(`span`,{children:e})]})}function U({label:e,onClick:t,tone:n,size:r=`default`,variant:i=`solid`,disabled:a=!1,loading:o=!1,iconOnly:s=!1}){let c=r===`compact`,l=i===`ghost`,u=a||o,d=n===`danger`?`#5c2430`:n===`warning`?`#7a4e11`:n===`success`?`#2c4231`:`#2f3348`,f=n===`danger`?`#6a2b39`:n===`warning`?`#8a5a16`:n===`success`?`#37523d`:`#3a4058`,p=n===`danger`?`#8b3a4a`:n===`warning`?`#d19128`:n===`success`?`#588a5c`:`#4a4f68`,m=n===`danger`?`#f5a6b8`:n===`warning`?`#f9d28b`:n===`success`?`#a6e3a1`:l?`#bac2de`:`#cdd6f4`;return(0,y.jsxs)(`button`,{onClick:e=>{e.stopPropagation(),!u&&t()},disabled:u,"aria-busy":o||void 0,"aria-label":s?e:void 0,title:s?e:void 0,style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,minWidth:s?c?24:30:c?72:84,height:c?20:28,padding:s?0:c?`0 8px`:`0 10px`,background:l?`rgba(24,24,37,0.5)`:d,border:l?`1px solid transparent`:`1px solid ${p}`,color:m,fontSize:10,fontWeight:600,cursor:u?`default`:`pointer`,opacity:a&&!o?.62:1,borderRadius:c?6:7,fontFamily:`inherit`,whiteSpace:`nowrap`,gap:c?5:6,lineHeight:1},onMouseEnter:e=>{u||(e.currentTarget.style.background=l?`rgba(49,50,68,0.8)`:f)},onMouseLeave:e=>{u||(e.currentTarget.style.background=l?`rgba(24,24,37,0.5)`:d)},children:[o?(0,y.jsx)(Vd,{size:c?12:13}):(0,y.jsx)(Bd,{name:zd(e),size:c?12:13}),!s&&(0,y.jsx)(`span`,{children:e})]})}var Ud=2e4,Wd=new Set([`g`,`path`,`circle`,`ellipse`,`line`,`polyline`,`polygon`,`rect`]),Gd=new Set([`title`,`desc`,`metadata`]),Kd={d:`d`,fill:`fill`,stroke:`stroke`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"stroke-miterlimit":`strokeMiterlimit`,"stroke-dasharray":`strokeDasharray`,"stroke-dashoffset":`strokeDashoffset`,"fill-rule":`fillRule`,"clip-rule":`clipRule`,opacity:`opacity`,"fill-opacity":`fillOpacity`,"stroke-opacity":`strokeOpacity`,transform:`transform`,cx:`cx`,cy:`cy`,r:`r`,rx:`rx`,ry:`ry`,x:`x`,y:`y`,x1:`x1`,x2:`x2`,y1:`y1`,y2:`y2`,width:`width`,height:`height`,points:`points`,"vector-effect":`vectorEffect`},qd=new Set([`fill`,`stroke`]),Jd=/^[+\-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+\-]?\d+)?(?:px)?$/i,Yd=/^[\d\s,.+\-eE]+$/,Xd=/^[\d\s,.+\-eEa-zA-Z]+$/,Zd=/^[\d\s,.+\-eEa-zA-Z()]+$/,Qd=new Map;function $d(e){let t=e.trim().toLowerCase();return t===`none`||t===`transparent`?`none`:`currentColor`}function ef(e,t){let n=t.trim();return!n||n.length>5e3?null:qd.has(e)?$d(n):e===`d`?Xd.test(n)?n:null:e===`points`?Yd.test(n)?n:null:e===`transform`?Zd.test(n)?n:null:e===`vector-effect`?n===`non-scaling-stroke`?n:null:e===`fill-rule`||e===`clip-rule`?n===`evenodd`||n===`nonzero`?n:null:e===`stroke-linecap`?[`butt`,`round`,`square`].includes(n)?n:null:e===`stroke-linejoin`?[`arcs`,`bevel`,`miter`,`miter-clip`,`round`].includes(n)?n:null:e===`stroke-dasharray`?n===`none`||Yd.test(n)?n:null:Jd.test(n)?n.replace(/px$/i,``):null}function tf(e){let t={};for(let n of e.attributes){let e=n.name.toLowerCase();if(e.startsWith(`on`)||e===`href`||e===`xlink:href`)continue;if(e===`style`){for(let e of n.value.split(`;`)){let n=e.indexOf(`:`);if(n===-1)continue;let r=e.slice(0,n).trim().toLowerCase(),i=Kd[r];if(!i)continue;let a=ef(r,e.slice(n+1));a!==null&&(t[i]=a)}continue}let r=Kd[e];if(!r)continue;let i=ef(e,n.value);i!==null&&(t[r]=i)}return t}function nf(e){let t=e.getAttribute(`viewBox`);if(t){let e=t.trim().split(/[\s,]+/).map(Number);if(e.length===4&&e.every(Number.isFinite)&&e[2]>0&&e[3]>0)return e.join(` `)}let n=Number.parseFloat(e.getAttribute(`width`)??``),r=Number.parseFloat(e.getAttribute(`height`)??``);return Number.isFinite(n)&&Number.isFinite(r)&&n>0&&r>0?`0 0 ${n} ${r}`:`0 0 24 24`}function rf(e){let t=Qd.get(e);if(t)return t;let n;if(!e.trim())n={value:null,error:`Paste a complete <svg> element.`};else if(e.length>2e4)n={value:null,error:`SVG must be smaller than ${Ud.toLocaleString()} characters.`};else if(typeof DOMParser>`u`)n={value:null,error:`SVG parsing is unavailable in this environment.`};else try{let t=new DOMParser().parseFromString(e,`image/svg+xml`),r=t.querySelector(`parsererror`),i=t.documentElement;if(r||i.localName.toLowerCase()!==`svg`)n={value:null,error:`Paste one valid <svg> element.`};else{let e=0,t=null,r=n=>{let i=[];for(let a of n.children){let n=a.localName.toLowerCase();if(Gd.has(n))continue;if(!Wd.has(n))return t=`Unsupported SVG element: <${n}>.`,[];if(e+=1,e>250)return t=`SVG contains too many elements (maximum 250).`,[];let o=r(a);if(t)return[];i.push({tag:n,props:tf(a),children:o})}return i},a=r(i);n=t?{value:null,error:t}:a.length===0?{value:null,error:`SVG does not contain a supported shape.`}:{value:{viewBox:nf(i),rootProps:tf(i),children:a},error:null}}}catch{n={value:null,error:`Could not parse this SVG.`}}return Qd.size>=100&&Qd.clear(),Qd.set(e,n),n}function af(e){return rf(e).error}function of(e,t){return(0,b.createElement)(e.tag,{...e.props,key:t},e.children.map((e,n)=>of(e,`${t}-${n}`)))}function sf({source:e,color:t,size:n=13}){let r=rf(e);return r.value?(0,y.jsx)(`svg`,{fill:`currentColor`,stroke:`none`,...r.value.rootProps,"aria-hidden":`true`,focusable:`false`,x:-n/2,y:-n/2,width:n,height:n,viewBox:r.value.viewBox,style:{color:t,overflow:`visible`},children:r.value.children.map((e,t)=>of(e,`custom-svg-${t}`))}):null}var cf=[`accessibility`,`api`,`build`,`chore`,`ci`,`config`,`database`,`dependencies`,`docs`,`feature`,`fix`,`i18n`,`infra`,`merge`,`move`,`performance`,`refactor`,`release`,`rename`,`revert`,`security`,`style`,`test`,`ui`];function lf(e,t,n,...r){return{id:e,icon:e,label:t,enabled:!0,types:n,patterns:r}}var uf=[lf(`revert`,`Revert`,[`revert`],String.raw`\b(?:revert(?:ed|ing)?|rollbacks?)\b`),lf(`merge`,`Merge`,[`merge`],String.raw`\bmerg(?:e|ed|ing)\b`),lf(`security`,`Security`,[`security`,`sec`],String.raw`\b(?:security|vulnerabilit(?:y|ies)|cve|xss|csrf)\b`),lf(`fix`,`Fix`,[`fix`,`bugfix`,`hotfix`],String.raw`\b(?:fix(?:es|ed|ing)?|bugs?|bugfix(?:es)?|hotfix(?:es)?)\b`),lf(`feature`,`Feature`,[`feat`,`feature`],String.raw`\b(?:feat|feature)s?\b`),lf(`performance`,`Performance`,[`perf`,`performance`],String.raw`\b(?:perf|performance|optimi[sz](?:e[ds]?|ing|ation)|speedups?)\b`),lf(`refactor`,`Refactor`,[`refactor`],String.raw`\b(?:refactor(?:s|ed|ing)?|restructur(?:e[ds]?|ing))\b`),lf(`move`,`Move`,[`move`],String.raw`\b(?:move[ds]?|moving|relocat(?:e[ds]?|ing))\b`),lf(`rename`,`Rename`,[`rename`],String.raw`\b(?:rename[ds]?|renaming)\b`),lf(`test`,`Tests`,[`test`,`tests`],String.raw`\b(?:tests?|specs?|coverage|e2e)\b`),lf(`docs`,`Documentation`,[`docs`,`doc`],String.raw`\b(?:docs?|documentation|readme|changelog)\b`),lf(`accessibility`,`Accessibility`,[`a11y`,`accessibility`],String.raw`\b(?:a11y|accessibility|aria|screen[\s-]?reader)\b`),lf(`i18n`,`Localization`,[`i18n`,`l10n`],String.raw`\b(?:i18n|l10n|internationali[sz]ation|locali[sz]ation|translations?)\b`),lf(`database`,`Database`,[`db`,`database`,`migration`],String.raw`\b(?:database|db|sql|schemas?|migrations?)\b`),lf(`api`,`API`,[`api`],String.raw`\b(?:apis?|graphql|grpc|rpc|endpoints?|webhooks?)\b`),lf(`ui`,`UI`,[`ui`,`ux`],String.raw`\b(?:ui|ux|frontend|layouts?|responsive)\b`),lf(`infra`,`Infrastructure`,[`infra`,`infrastructure`,`deploy`],String.raw`\b(?:infra|infrastructure|terraform|kubernetes|k8s|docker|deploy(?:ment|s|ed|ing)?)\b`),lf(`ci`,`CI`,[`ci`],String.raw`\b(?:ci|continuous[\s-]integration|github[\s-]actions?|workflows?|pipelines?)\b`),lf(`build`,`Build`,[`build`],String.raw`\b(?:builds?|built|bundl(?:e[ds]?|er|ing)|compil(?:e[ds]?|er|ing)|webpack|vite)\b`),lf(`dependencies`,`Dependencies`,[`deps`,`dependencies`,`dependency`],String.raw`\b(?:deps?|dependencies|dependency|packages?|lockfiles?|bump(?:s|ed|ing)?)\b`),lf(`release`,`Release`,[`release`],String.raw`\b(?:releases?|version(?:ing)?|publish(?:es|ed|ing)?)\b`),lf(`config`,`Configuration`,[`config`],String.raw`\b(?:config|configuration|settings?|environment)\b`,String.raw`(?:^|\s)\.env(?:\s|$)`),lf(`style`,`Style`,[`style`,`format`,`lint`],String.raw`\b(?:styles?|styling|css|themes?|format(?:ted|ting)?|lint(?:ed|ing)?)\b`),lf(`chore`,`Chore`,[`chore`],String.raw`\b(?:chores?|cleanup|housekeeping|maintenance)\b`)],df=/^([a-z][a-z0-9-]*)(?:\([^)]*\))?!?:/i,ff=new Map;function pf(e){if(ff.has(e))return ff.get(e)??null;try{let t=new RegExp(e,`i`);return ff.set(e,t),t}catch{return ff.set(e,null),null}}function mf(e){if(!e.trim())return`Pattern cannot be empty.`;try{return new RegExp(e,`i`),null}catch(e){return e instanceof Error?e.message:`Invalid regular expression.`}}function hf(e,t=uf){let n=df.exec(e.trim())?.[1]?.toLowerCase();if(n){let e=t.find(e=>e.enabled&&e.types.some(e=>e.toLowerCase()===n));if(e)return e}return t.find(t=>t.enabled&&t.patterns.some(t=>pf(t)?.test(e)===!0))??null}var gf=`ingit.commitIconRules`,_f=1,vf=200,yf=50,bf=500;function xf(e){return e.map(e=>({...e,types:[...e.types],patterns:[...e.patterns]}))}function Sf(e){return JSON.stringify({version:_f,rules:e})}function Cf(e){return typeof e==`string`&&cf.includes(e)}function wf(e,t){if(!Array.isArray(e)||e.length>yf)return null;let n=[];for(let r of e){if(typeof r!=`string`)return null;let e=r.trim();if(!e||e.length>t)return null;n.push(e)}return n}function Tf(e){if(e===null)return null;try{let t=JSON.parse(e);if(!t||typeof t!=`object`)return null;let{version:n,rules:r}=t;if(n!==_f||!Array.isArray(r)||r.length>vf)return null;let i=new Set,a=[];for(let e of r){if(!e||typeof e!=`object`)return null;let t=e,n=typeof t.id==`string`?t.id.trim():``,r=typeof t.label==`string`?t.label.trim():``,o=wf(t.types,80),s=wf(t.patterns,bf),c=t.customSvg===void 0?void 0:typeof t.customSvg==`string`?t.customSvg.trim():null;if(!n||n.length>100||i.has(n)||!r||r.length>100||!Cf(t.icon)||typeof t.enabled!=`boolean`||o===null||s===null||c===null||c!==void 0&&(!c||c.length>2e4)||c!==void 0&&typeof DOMParser<`u`&&af(c)!==null||s.some(e=>mf(e)!==null))return null;i.add(n),a.push({id:n,label:r,icon:t.icon,enabled:t.enabled,types:o,patterns:s,...c===void 0?{}:{customSvg:c}})}return a}catch{return null}}function Ef(){try{return typeof window>`u`?null:window.localStorage}catch{return null}}function Df(){let e=Ef();if(!e)return xf(uf);try{return Tf(e.getItem(gf))??xf(uf)}catch{return xf(uf)}}var Of=Df(),kf=new Set;function Af(e){Of=e;for(let e of kf)e()}function jf(e){e.key!==null&&e.key!==gf||Af(Tf(e.newValue)??xf(uf))}function Mf(e){let t=kf.size===0;return kf.add(e),t&&typeof window<`u`&&window.addEventListener(`storage`,jf),()=>{kf.delete(e),kf.size===0&&typeof window<`u`&&window.removeEventListener(`storage`,jf)}}function Nf(){return(0,b.useSyncExternalStore)(Mf,()=>Of,()=>uf)}function Pf(e){let t=Tf(Sf(e));if(!t)return!1;let n=Ef();if(!n)return!1;try{n.setItem(gf,Sf(t))}catch{return!1}return Af(t),!0}function Ff(){let e=Ef();if(!e)return!1;try{e.removeItem(gf)}catch{return!1}return Af(xf(uf)),!0}var W={fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`};function If({icon:e,color:t,size:n=13,customSvg:r}){return r?(0,y.jsx)(sf,{source:r,color:t,size:n}):(0,y.jsxs)(`svg`,{"aria-hidden":`true`,focusable:`false`,x:-n/2,y:-n/2,width:n,height:n,viewBox:`0 0 24 24`,style:{color:t,overflow:`visible`},children:[e===`accessibility`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`circle`,{...W,cx:`12`,cy:`4`,r:`2`}),(0,y.jsx)(`path`,{...W,d:`M5 8h14M12 6v7M8 21l4-8 4 8M7 13l5-2 5 2`})]}),e===`api`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...W,d:`M9 3v5M15 3v5M7 8h10v3a5 5 0 0 1-5 5v5`}),(0,y.jsx)(`path`,{...W,d:`M8 12h8`})]}),e===`build`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...W,d:`m14 5 5 5M16 3l5 5-3 3-5-5 3-3Z`}),(0,y.jsx)(`path`,{...W,d:`M14.5 8.5 4 19l1 1L15.5 9.5`})]}),e===`chore`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...W,d:`m20 3-9 9M11 10l3 3`}),(0,y.jsx)(`path`,{...W,d:`m11 10-7 7 3 3 7-7-3-3ZM3 21h9`})]}),e===`ci`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`circle`,{...W,cx:`6`,cy:`6`,r:`2.5`}),(0,y.jsx)(`circle`,{...W,cx:`18`,cy:`6`,r:`2.5`}),(0,y.jsx)(`circle`,{...W,cx:`12`,cy:`18`,r:`2.5`}),(0,y.jsx)(`path`,{...W,d:`M8.5 6h7M7.4 8.2l3.2 7.6M16.6 8.2l-3.2 7.6`})]}),e===`config`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...W,d:`M4 6h10M18 6h2M4 12h2M10 12h10M4 18h8M16 18h4`}),(0,y.jsx)(`circle`,{...W,cx:`16`,cy:`6`,r:`2`}),(0,y.jsx)(`circle`,{...W,cx:`8`,cy:`12`,r:`2`}),(0,y.jsx)(`circle`,{...W,cx:`14`,cy:`18`,r:`2`})]}),e===`database`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`ellipse`,{...W,cx:`12`,cy:`5`,rx:`7`,ry:`3`}),(0,y.jsx)(`path`,{...W,d:`M5 5v6c0 1.7 3.1 3 7 3s7-1.3 7-3V5M5 11v6c0 1.7 3.1 3 7 3s7-1.3 7-3v-6`})]}),e===`dependencies`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...W,d:`m12 3 9 5-9 5-9-5 9-5Z`}),(0,y.jsx)(`path`,{...W,d:`M3 8v8l9 5 9-5V8M12 13v8`})]}),e===`docs`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...W,d:`M12 6a6 6 0 0 0-8-2v15a6 6 0 0 1 8 2V6Z`}),(0,y.jsx)(`path`,{...W,d:`M12 6a6 6 0 0 1 8-2v15a6 6 0 0 0-8 2V6Z`})]}),e===`feature`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...W,d:`M12 3c.6 3.2 1.8 4.4 5 5-3.2.6-4.4 1.8-5 5-.6-3.2-1.8-4.4-5-5 3.2-.6 4.4-1.8 5-5Z`}),(0,y.jsx)(`path`,{...W,d:`M19 15c.3 1.7 1 2.4 2.7 2.7-1.7.3-2.4 1-2.7 2.7-.3-1.7-1-2.4-2.7-2.7 1.7-.3 2.4-1 2.7-2.7Z`})]}),e===`fix`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`rect`,{...W,x:`7`,y:`6`,width:`10`,height:`14`,rx:`5`}),(0,y.jsx)(`path`,{...W,d:`M9 6 7 3M15 6l2-3M3 10h4M17 10h4M3 15h4M17 15h4M9 11h.01M15 11h.01M12 14v6`})]}),e===`i18n`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`circle`,{...W,cx:`12`,cy:`12`,r:`9`}),(0,y.jsx)(`path`,{...W,d:`M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18`})]}),e===`infra`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`rect`,{...W,x:`3`,y:`4`,width:`18`,height:`6`,rx:`2`}),(0,y.jsx)(`rect`,{...W,x:`3`,y:`14`,width:`18`,height:`6`,rx:`2`}),(0,y.jsx)(`path`,{...W,d:`M7 7h.01M7 17h.01M11 7h7M11 17h7`})]}),e===`merge`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`circle`,{...W,cx:`6`,cy:`5`,r:`2`}),(0,y.jsx)(`circle`,{...W,cx:`18`,cy:`19`,r:`2`}),(0,y.jsx)(`circle`,{...W,cx:`6`,cy:`19`,r:`2`}),(0,y.jsx)(`path`,{...W,d:`M6 7v10M8 5h2a8 8 0 0 1 8 8v4`})]}),e===`move`&&(0,y.jsx)(`path`,{...W,d:`M12 3v18M3 12h18M8 7l4-4 4 4M8 17l4 4 4-4M7 8l-4 4 4 4M17 8l4 4-4 4`}),e===`performance`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...W,d:`M4 18a8 8 0 1 1 16 0M12 18l4-5M6.5 10l1 1M12 7v2M17.5 10l-1 1`}),(0,y.jsx)(`circle`,{...W,cx:`12`,cy:`18`,r:`1`})]}),e===`refactor`&&(0,y.jsx)(y.Fragment,{children:(0,y.jsx)(`path`,{...W,d:`m8 7 4-4 4 4M12 3v7M18 10l3 4-3 4M21 14h-7M8 21l-4-4 4-4M4 17h7`})}),e===`release`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...W,d:`M14 4c3-2 5-1 6 0s2 3 0 6l-6 6-6-6 6-6Z`}),(0,y.jsx)(`circle`,{...W,cx:`16`,cy:`8`,r:`1.5`}),(0,y.jsx)(`path`,{...W,d:`M8 10H5l-2 4 5 1M14 16v3l-4 2-1-5M7 17l-2 2`})]}),e===`rename`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...W,d:`m14 5 5 5M4 20l3.5-.8L20 6.7 17.3 4 4.8 16.5 4 20Z`}),(0,y.jsx)(`path`,{...W,d:`M3 22h9`})]}),e===`revert`&&(0,y.jsx)(y.Fragment,{children:(0,y.jsx)(`path`,{...W,d:`m9 7-5 5 5 5M4 12h10a6 6 0 0 1 6 6v2`})}),e===`security`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...W,d:`M12 3 20 6v6c0 5-3.4 8-8 10-4.6-2-8-5-8-10V6l8-3Z`}),(0,y.jsx)(`path`,{...W,d:`m8.5 12 2.2 2.2 4.8-5`})]}),e===`style`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...W,d:`M12 3a9 9 0 0 0 0 18h1.5a2 2 0 0 0 0-4H12a2 2 0 0 1 0-4h3a6 6 0 0 0 0-12h-3Z`}),(0,y.jsx)(`path`,{...W,d:`M7.5 10h.01M9 6.5h.01M14 6.5h.01M17 9h.01`})]}),e===`test`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...W,d:`M9 3h6M10 3v6l-5 9a2 2 0 0 0 2 3h10a2 2 0 0 0 2-3l-5-9V3`}),(0,y.jsx)(`path`,{...W,d:`M7.5 15h9`})]}),e===`ui`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`rect`,{...W,x:`3`,y:`4`,width:`18`,height:`16`,rx:`2`}),(0,y.jsx)(`path`,{...W,d:`M9 4v16M9 10h12`})]})]})}function Lf(e,t,n,r,i){if(e.length===0)return null;let a=Math.min(t,n),o=Math.max(t,n),s=[...new Set(e.map(e=>e.x))].sort((e,t)=>e-t),c=new Set(e.filter(e=>e.idx>a&&e.idx<o).map(e=>e.x)),l=e.find(e=>e.idx===n)?.x,u=l===void 0?[]:s.filter(e=>i===`left`?e<=l:e>=l).sort((e,t)=>i===`left`?t-e:e-t);for(let e of u)if(!c.has(e))return e;return i===`left`?s[0]-r:s[s.length-1]+r}function Rf(e,t,n){return e.map((r,i)=>{let a=e.length-i;return{...r,y:t.y-a*n,idx:t.idx-a}})}function zf(e,t,n,r){if(r<1)return null;let i=new Map(e.map(e=>[e.sha,e])),a=i.get(n);if(!a)return null;let o=[],s=new Set,c=t;for(;c&&c!==n&&!s.has(c);){s.add(c);let e=i.get(c);if(!e)return null;o.push(e),c=e.parentShas[0]}if(c!==n||o.length===0)return null;let l=e.indexOf(a),u=Math.min(e.indexOf(o[0]),l),d=Math.max(e.indexOf(o[o.length-1]),l),f=t=>{for(let n=u;n<=d;n++)if(e[n].lane===t)return!1;return!0},p=0;for(let e=1;e<=r&&p===0;e++)f(e)?p=e:f(-e)&&(p=-e);if(p===0)return null;let m=new Set(o.map(e=>e.sha));return e.map(e=>m.has(e.sha)?{...e,lane:p}:e)}function Bf(e,t,n){let r=t??e;return{anchor:r,y:r.y-n,idx:r.idx-1}}function Vf(e,t){return{y:e.y-t,idx:e.idx-1}}function Hf(e,t){return[{x1:e.x-t,y1:e.y-t,x2:e.x+t,y2:e.y+t},{x1:e.x+t,y1:e.y-t,x2:e.x-t,y2:e.y+t}]}function Uf({baseZoom:e,bounds:t,viewport:n,scroll:r,margin:i}){let a=t.minX*e-r.x,o=t.maxX*e-r.x,s=t.minY*e-r.y,c=t.maxY*e-r.y;if(a>=i&&o<=n.width-i&&s>=i&&c<=n.height-i)return{zoom:e,translateX:0,translateY:0};let l=Math.max(1,t.maxX-t.minX),u=Math.max(1,t.maxY-t.minY),d=Math.max(1,n.width-i*2),f=Math.max(1,n.height-i*2),p=Math.max(.05,Math.min(e,d/l,f/u)),m=t.minX*p-r.x,h=t.maxX*p-r.x,g=t.minY*p-r.y,_=t.maxY*p-r.y,v=(e,t,n)=>{let r=i-e,a=n-i-t;return Math.min(a,Math.max(r,0))};return{zoom:p,translateX:v(m,h,n.width),translateY:v(g,_,n.height)}}function Wf(e,t,n){let r=t.x-e.x,i=t.y-e.y,a=Math.hypot(r,i)||1;return{x:e.x+r/a*n,y:e.y+i/a*n}}function Gf(e,t,n,r,i){let a=1-i,o=a**3,s=3*a**2*i,c=3*a*i**2,l=i**3;return{x:e.x*o+t.x*s+n.x*c+r.x*l,y:e.y*o+t.y*s+n.y*c+r.y*l}}function Kf(e,t,n){let r=n.x-t.x,i=n.y-t.y,a=r*r+i*i;if(a===0)return(e.x-t.x)**2+(e.y-t.y)**2;let o=Math.max(0,Math.min(1,((e.x-t.x)*r+(e.y-t.y)*i)/a)),s=t.x+o*r,c=t.y+o*i;return(e.x-s)**2+(e.y-c)**2}function qf(e,t,n,r,i){let a=r.nodeRadius-1,o=Wf(e,t,a),s=Wf(t,e,a),c=s.y-o.y,l={x:o.x,y:o.y+c*r.curveControlRatio},u={x:s.x,y:s.y-c*r.curveControlRatio},d=(r.nodeRadius+r.clearance)**2,f=Math.max(32,Math.ceil(Math.hypot(s.x-o.x,s.y-o.y)/4)),p=Math.min(e.idx,t.idx)+1,m=Math.max(e.idx,t.idx)-1,h=[];for(let t=p;t<=m;t++){let a=n[t],o=[...a===void 0?[]:[a],...i?.get(t)??[]];for(let n of o)h.push({x:e.x+(n-e.lane)*r.laneWidth,y:e.y+(t-e.idx)*r.rowHeight})}let g=o;for(let e=1;e<=f;e++){let t=Gf(o,l,u,s,e/f);if(h.some(e=>Kf(e,g,t)<=d))return!0;g=t}return!1}function Jf(e,t,n,r,i){let a=r===`from`?e.lane:t.lane,o=Math.min(e.idx,t.idx)+1,s=Math.max(e.idx,t.idx)-1;for(let e=o;e<=s;e++)if(n[e]===a||i?.get(e)?.includes(a))return!1;return!0}function Yf(e,t,n,r,i){if(!Jf(e,t,n,r,i))return null;let a=r===`from`?e:t,o=r===`from`?t:e;return{side:a.x<=o.x?`left`:`right`,anchorLane:a.lane,innerLane:o.lane,outerRailX:a.x}}function Xf(e,t,n,r,i,a){if(Math.abs(t.idx-e.idx)<2||!qf(e,t,n,r,a))return null;if(Jf(e,t,n,i,a))return i;let o=i===`from`?`to`:`from`;return Jf(e,t,n,o,a)?o:null}var Zf={position:`fixed`,inset:0,margin:`auto`,width:`min(420px, calc(100vw - 32px))`,padding:0,border:`1px solid #45475a`,borderRadius:8,background:`#1e1e2e`,color:`#cdd6f4`,boxShadow:`0 22px 64px rgba(0,0,0,0.58)`},Qf={display:`flex`,flexDirection:`column`,gap:14,padding:18,fontFamily:`system-ui, -apple-system, sans-serif`},$f={margin:0,color:`#f5e0dc`,fontSize:16,fontWeight:700,lineHeight:1.25},ep={height:30,padding:`0 12px`,borderRadius:6,border:`1px solid #45475a`,background:`#181825`,color:`#bac2de`,fontSize:12,fontWeight:700,fontFamily:`inherit`,cursor:`pointer`},tp={height:30,padding:`0 12px`,borderRadius:6,border:`1px solid #6d9658`,background:`#8dcf78`,color:`#0b1020`,fontSize:12,fontWeight:800,fontFamily:`inherit`,cursor:`pointer`};function np({open:e,title:t,label:n,initialValue:r=``,confirmLabel:i,allowEmpty:a=!1,placeholder:o,onSubmit:s,onClose:c}){let l=(0,b.useRef)(null),u=(0,b.useRef)(null),[d,f]=(0,b.useState)(r);return(0,b.useEffect)(()=>{e&&f(r)},[r,e]),(0,b.useEffect)(()=>{let t=l.current;if(t){if(e){t.open||t.showModal(),requestAnimationFrame(()=>u.current?.focus());return}t.open&&t.close()}},[e]),(0,y.jsx)(`dialog`,{ref:l,"aria-labelledby":`text-input-dialog-title`,onCancel:c,onClose:c,onClick:e=>{e.target===e.currentTarget&&c()},style:Zf,children:(0,y.jsxs)(`form`,{method:`dialog`,onSubmit:e=>{e.preventDefault();let t=d.trim();if(!a&&!t){u.current?.focus();return}s(t)},onClick:e=>e.stopPropagation(),style:Qf,children:[(0,y.jsx)(`h2`,{id:`text-input-dialog-title`,style:$f,children:t}),(0,y.jsxs)(`label`,{style:{display:`flex`,flexDirection:`column`,gap:7,color:`#bac2de`,fontSize:12,fontWeight:700},children:[n,(0,y.jsx)(`input`,{ref:u,value:d,onChange:e=>f(e.target.value),required:!a,placeholder:o,autoComplete:`off`,spellCheck:!1,style:{height:34,padding:`0 10px`,borderRadius:6,border:`1px solid #45475a`,background:`#11111b`,color:`#cdd6f4`,fontSize:13,fontFamily:`inherit`,outline:`none`}})]}),(0,y.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:8,paddingTop:2},children:[(0,y.jsx)(`button`,{type:`button`,onClick:c,style:ep,children:`Cancel`}),(0,y.jsx)(`button`,{type:`submit`,value:`confirm`,style:tp,children:i})]})]})})}function rp({open:e,title:t,message:n,confirmLabel:r,onConfirm:i,onClose:a}){let o=(0,b.useRef)(null);return(0,b.useEffect)(()=>{let t=o.current;if(t){if(e){t.open||t.showModal();return}t.open&&t.close()}},[e]),(0,y.jsx)(`dialog`,{ref:o,"aria-labelledby":`confirm-dialog-title`,onCancel:a,onClose:a,onClick:e=>{e.target===e.currentTarget&&a()},style:Zf,children:(0,y.jsxs)(`form`,{method:`dialog`,onSubmit:e=>{e.preventDefault(),i()},onClick:e=>e.stopPropagation(),style:Qf,children:[(0,y.jsx)(`h2`,{id:`confirm-dialog-title`,style:$f,children:t}),(0,y.jsx)(`p`,{style:{margin:0,color:`#bac2de`,fontSize:13,lineHeight:1.45},children:n}),(0,y.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:8,paddingTop:2},children:[(0,y.jsx)(`button`,{type:`button`,onClick:a,style:ep,children:`Cancel`}),(0,y.jsx)(`button`,{type:`submit`,value:`confirm`,style:tp,children:r})]})]})})}var ip=20,G=16,ap=`#11111b`,op=20,sp=30,cp=28,lp=sp,up=400,dp=112,fp=1e3,pp=G-5,mp=`#1e1e2e`,hp=`#45475a`,gp=`#cdd6f455`,_p=`#cdd6f422`,vp=`#a6e3a1`,yp=`#f38ba8`,bp=`#a6e3a1`,xp=`#f38ba8`,Sp=2,Cp=.85,wp=12,Tp=6,Ep=30,Dp=6,Op=6,kp=3,Ap={mass:2.1,tension:180,friction:28},jp=220,Mp=900,Np=`cubic-bezier(0.22, 1, 0.36, 1)`,Pp=6,Fp=14,Ip=`600 11px system-ui, -apple-system, sans-serif`,Lp=6,Rp=13,zp=150,Bp=56*.55,Vp=56*.3,Hp=54,Up={laneWidth:80,rowHeight:56,nodeRadius:G,clearance:2,curveControlRatio:.3},Wp=new Map;function Gp(e){return Math.round((op-e)/2)}function Kp(e,t){return!!e&&e.action===t.action&&e.refName===t.refName&&e.sha===t.sha&&e.force===t.force}function qp(e){return!!e&&typeof e==`object`&&e.code===`CONFLICT`}function Jp(e){if(!e||typeof e!=`object`)return null;let t=e.data;if(!t||typeof t!=`object`)return null;let n=t;return n.reason===`branch-in-use`&&typeof n.worktreePath==`string`?n.worktreePath:null}function Yp(e){return e.replace(/[\\/]+$/,``).split(/[\\/]+/).at(-1)||e}function Xp({color:e,size:t=Rp}){return(0,y.jsxs)(`svg`,{width:t,height:t,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,style:{display:`block`,flexShrink:0},children:[(0,y.jsx)(`path`,{d:`M8 13V9M8 9H4V5M8 9h4V5`,stroke:e,strokeWidth:`1.6`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,y.jsx)(`circle`,{cx:`4`,cy:`3.5`,r:`1.5`,fill:ap,stroke:e,strokeWidth:`1.4`}),(0,y.jsx)(`circle`,{cx:`12`,cy:`3.5`,r:`1.5`,fill:ap,stroke:e,strokeWidth:`1.4`}),(0,y.jsx)(`circle`,{cx:`8`,cy:`13`,r:`1.5`,fill:ap,stroke:e,strokeWidth:`1.4`})]})}function Zp(e){let t=/^(v?)(\d+)\.(\d+)\.(\d+)$/.exec(e);return t?{hasVPrefix:t[1]===`v`,major:Number(t[2]),minor:Number(t[3]),patch:Number(t[4])}:null}function Qp(e,t){return e.major-t.major||e.minor-t.minor||e.patch-t.patch||Number(e.hasVPrefix)-Number(t.hasVPrefix)}function $p(e){let t=null;for(let n of e){if(n.kind!==`tag`)continue;let e=Zp(n.shortName);e&&(!t||Qp(e,t)>0)&&(t=e)}return t?`${t.hasVPrefix?`v`:``}${t.major}.${t.minor}.${t.patch+1}`:``}function em(e){return e?e.startsWith(`refs/remotes/`)?e.slice(13):e:null}function tm(e,t){let n=em(e.upstream);if(n)return t.find(e=>e.kind===`remote`&&e.shortName===n)??null;let r=t.find(t=>t.kind===`remote`&&t.shortName===`origin/${e.shortName}`);if(r)return r;let i=t.filter(t=>t.kind===`remote`&&t.shortName.endsWith(`/${e.shortName}`));return i.length===1?i[0]:null}function nm(e,t){return e.parentShas.length===t.parentShas.length&&e.parentShas.every((e,n)=>e===t.parentShas[n])}function rm(e,t,n,r){if(r.kind===`uncommit`)return null;let i=wr(t.rows,n.maxLaneRadius),a=e.nodes.find(e=>e.row.lane===0)?.x??n.laneCenterX,o=Dr(i,n.extraLeftGutter,n.rightGutter,{laneCenterX:a,laneRadius:n.maxLaneRadius,totalWidth:n.layoutWidth});if(r.kind===`commit`){let t=o.nodes.find(t=>!e.shaToNode.has(t.row.sha));if(!t)return null;let n=e.shaToNode.get(t.row.parentShas[0]);if(!n)return null;let r=e.nodes[0]??n,i={...t,x:n.x,y:r.y-56,idx:r.idx-1},a=`${i.row.sha}-${n.row.sha}`,s=hm(i,n,a,e.nodes.map(e=>e.row.lane));return{nodes:[{node:i,color:bp}],edges:[{key:a,path:_m(i,n,s,0),color:bp,dashed:!0}]}}let s=new Set;for(let t of o.nodes){let n=e.shaToNode.get(t.row.sha);(!n||!nm(n.row,t.row))&&s.add(t.row.sha)}let c=t.refs.find(e=>e.kind===`head`&&e.isCurrent),l=[],u=new Set,d=c?.targetSha;for(;d&&!u.has(d);){u.add(d);let e=o.shaToNode.get(d);if(!e)break;l.push(e),d=e.row.parentShas[0]}let f=l.findIndex(e=>s.has(e.row.sha)),p=f>=0?l.slice(0,f+1):t.headSha?[o.shaToNode.get(t.headSha)].filter(e=>!!e):[];if(p.length===0)return null;let m=t.refs.find(e=>e.shortName===r.targetRefName),h=m?.peeledSha??m?.targetSha,g=h?e.shaToNode.get(h)??o.shaToNode.get(h):null,_=g?p.map(e=>({...e,x:g.x,row:{...e.row,lane:g.row.lane}})):p,v=g??e.nodes[0];if(!v)return null;let y=Rf(_,v,56),b=new Set(y.map(e=>e.row.sha)),x=new Map(y.map(e=>[e.row.sha,e])),S=o.nodes.map(e=>e.row.lane),C=[];for(let t of y)for(let n=0;n<t.row.parentShas.length;n++){let r=t.row.parentShas[n],i=b.has(r)?x.get(r):e.shaToNode.get(r)??o.shaToNode.get(r);if(!i)continue;let a=`action-preview:${t.row.sha}-${i.row.sha}`,s=hm(t,i,a,S,{adjacentTrack:n>0?`to`:`from`});C.push({key:a,path:_m(t,i,s,0),color:bp,dashed:!0})}return{nodes:[...y.map(e=>({node:e,color:bp}))],edges:C,gutterX:g?g.x-Hp/2:void 0}}function im(e,t,n,r){if(e===n)return`M${e},${t}L${n},${r}`;let i=r-t;return`M${e},${t}C${e},${t+i*.3} ${n},${r-i*.3} ${n},${r}`}function am(e,t,n,r,i){let a=n-e,o=r-t,s=Math.hypot(a,o)||1;return{x:e+a/s*i,y:t+o/s*i}}function om(e,t){if(e.length===0)return``;if(e.length===1)return`M${e[0].x},${e[0].y}`;let n=`M${e[0].x},${e[0].y}`;for(let r=1;r<e.length-1;r++){let i=e[r-1],a=e[r],o=e[r+1],s=a.x-i.x,c=a.y-i.y,l=o.x-a.x,u=o.y-a.y,d=Math.hypot(s,c),f=Math.hypot(l,u);if(d<.001||f<.001){n+=`L${a.x},${a.y}`;continue}let p=Math.min(t,d/2,f/2),m=a.x-s/d*p,h=a.y-c/d*p,g=a.x+l/f*p,_=a.y+u/f*p;n+=`L${m},${h}Q${a.x},${a.y} ${g},${_}`}let r=e[e.length-1];return n+=`L${r.x},${r.y}`,n}function sm(e,t,n){let r=Math.abs(t.idx-e.idx),i=Math.min(e.y,t.y),a=vr(n),o=r>12?[.28,.42,.56,.7]:[.35,.5,.65],s=o[a%o.length]??.5,c=Math.max(0,Math.min(r-1,Math.round((r-1)*s))),l=((a>>3)%3-1)*4;return i+56*(c+.5)+l}function cm(e,t,n,r){let i=Math.max(0,Math.min(t,n)+1),a=Math.min(e.length-1,Math.max(t,n)-1),o=0;for(let t=i;t<=a;t++){let n=e[t];r(n,t)&&o++}return o}function lm(e,t,n,r,i){let a=Math.max(0,Math.min(t,n)),o=Math.min(r.length-1,Math.max(t,n));for(let t=a;t<=o;t++)if(r[t]===e||i?.get(t)?.includes(e))return!1;return!0}function um(e,t,n,r=!1,i=0,a=G,o=!1){let s=t.y>e.y?1:-1,c=e.y+s*24,l=Math.max(1,a-1);if(!r&&Math.abs(n-t.x)<.001&&Math.abs(e.x-t.x)>.001){let n=e.x<t.x?-1:1,r=-s,i=l*Math.SQRT1_2,a={x:t.x+n*i,y:t.y+r*i},o={x:a.x+n*18*Math.SQRT1_2,y:a.y+r*18*Math.SQRT1_2},u=o.x;return om([am(e.x,e.y,u,c,G-1),{x:u,y:c},o,a],5)}let u=!o&&Math.abs(n-e.x)<.001&&Math.abs(e.x-t.x)>.001,d=n,f;if(u){let n=t.x<e.x?-1:1,r=(G-1)*Math.SQRT1_2,i={x:e.x+n*r,y:e.y+s*r},a={x:i.x+n*18*Math.SQRT1_2,y:i.y+s*18*Math.SQRT1_2};d=a.x,f=[i,a]}else f=[am(e.x,e.y,n,c,G-1),{x:n,y:c}];let p=r?Math.max(-l,Math.min(l,i)):i,m=r?t.y+p:t.y-s*24,h=r?{x:t.x+Math.sign(d-t.x||1)*Math.sqrt(Math.max(0,l**2-p**2)),y:m}:am(t.x,t.y,d,m,l);return om([...f,{x:d,y:m},h],wp)}function dm(e,t,n,r=0,i=G,a=!1){let o=t.y>e.y?1:-1,s=e.y+o*24,c=Math.abs(n-t.x)>.001,l=Math.max(1,i-1);if(!c&&Math.abs(e.x-t.x)>.001){let n=e.x<t.x?-1:1,r=-o,i=l*Math.SQRT1_2,a={x:t.x+n*i,y:t.y+r*i},c={x:a.x+n*18*Math.SQRT1_2,y:a.y+r*18*Math.SQRT1_2},u=c.x;return om([am(e.x,e.y,u,s,G-1),{x:u,y:s},c,a],5)}let u=!a&&Math.abs(n-e.x)<.001&&Math.abs(e.x-t.x)>.001,d=n,f;if(u){let n=t.x<e.x?-1:1,r=(G-1)*Math.SQRT1_2,i={x:e.x+n*r,y:e.y+o*r},a={x:i.x+n*18*Math.SQRT1_2,y:i.y+o*18*Math.SQRT1_2};d=a.x,f=[i,a]}else f=[am(e.x,e.y,n,t.y,G-1),{x:n,y:s}];let p=c?Math.max(-l,Math.min(l,r)):0,m=t.y+p,h=c?{x:t.x+Math.sign(d-t.x)*Math.sqrt(Math.max(0,l**2-p**2)),y:m}:am(t.x,t.y,d,m,l);return om([...f,{x:d,y:m},h],wp)}function fm(e,t,n,r,i){let a=am(e.x,e.y,t.x,t.y,G-1),o=am(t.x,t.y,e.x,e.y,G-1),s=t.y>e.y?1:-1,c=e.y+s*24,l=t.y-s*24;return om([a,{x:n,y:c},{x:n,y:i},{x:r,y:i},{x:r,y:l},o],wp)}function pm(e,t,n=0,r=G,i){if(Math.abs(e.x-t.x)<.001&&Math.abs(n)>.001){let a=t.y>e.y?1:-1,o=G-1,s=Math.max(1,r-1),c=Math.max(-Math.min(o,s),Math.min(Math.min(o,s),n)),l=Math.sqrt(Math.max(0,s**2-c**2)),u=Math.abs(t.y-e.y),d=i===void 0?34:Math.abs(i-e.y),f=Math.min(u/2,34),p=Math.max(f,u-l-8),m=Math.max(f,Math.min(p,d)),h=e.y+a*m,g=h-a*10,_={x:t.x+c,y:t.y-a*l};return om([{x:e.x,y:e.y+a*o},{x:e.x,y:g},{x:e.x+c,y:h},_],Math.min(wp,6))}let a=am(e.x,e.y,t.x,t.y,G-1),o=am(t.x,t.y,e.x,e.y,Math.max(1,r-1));return`M${a.x},${a.y}L${o.x},${o.y}`}function mm(e,t,n,r=G,i){if(n){let a=Math.max(1,r-1),o=t.y>=e.y?1:-1,s=G-1,c=s*Math.SQRT1_2,l=i?{x:e.x+(i===`left`?-c:c),y:e.y+o*c}:{x:e.x,y:e.y+o*s},u={x:t.x+(n===`left`?-a:a),y:t.y},d=Math.min(18,Math.hypot(u.x-l.x,u.y-l.y)*.2);return om([l,{x:l.x+(i===`left`?-d*Math.SQRT1_2:i===`right`?d*Math.SQRT1_2:0),y:l.y+o*(i?d*Math.SQRT1_2:d)},{x:u.x+(n===`left`?-d:d),y:u.y},u],Math.min(5,d/2))}let a=am(e.x,e.y,t.x,t.y,G-1),o=am(t.x,t.y,e.x,e.y,G-1);return im(a.x,a.y,o.x,o.y)}function hm(e,t,n,r,i={}){let a=Math.abs(e.row.lane-t.row.lane),o=Math.abs(t.idx-e.idx);if(a===0)return{mode:`straight`};if(a===1&&o>=Tp)return{mode:`adjacent-hook`,laneA:Math.min(e.row.lane,t.row.lane),laneB:Math.max(e.row.lane,t.row.lane),track:i.adjacentTrack??`from`};if(o<Tp){let n=i.adjacentTrack??`from`,a=Xf({x:e.x,y:e.y,idx:e.idx,lane:e.row.lane},{x:t.x,y:t.y,idx:t.idx,lane:t.row.lane},r,Up,n,i.additionalOccupiedLanes);return a?{mode:`occlusion-hook`,laneA:Math.min(e.row.lane,t.row.lane),laneB:Math.max(e.row.lane,t.row.lane),track:a}:{mode:`curve`}}let s=i.adjacentTrack??`from`,c={x:e.x,y:e.y,idx:e.idx,lane:e.row.lane},l={x:t.x,y:t.y,idx:t.idx,lane:t.row.lane};if(s===`to`&&e.row.lane*t.row.lane<0){let n=e.row.lane<0?-1:1,a=e.row.lane+n;if(lm(a,e.idx,t.idx,r,i.additionalOccupiedLanes))return{mode:`outer-rail`,side:n<0?`left`:`right`,anchorLane:a,innerLane:t.row.lane,outerRailX:e.x+n*80,horizontalTargetJoin:!0}}let u=Yf(c,l,r,s,i.additionalOccupiedLanes);if(u)return{mode:`outer-rail`,...u,horizontalTargetJoin:!0};let d=Math.min(e.row.lane,t.row.lane),f=Math.max(e.row.lane,t.row.lane),p=vr(n)%3*Dp,m=t.x>e.x?1:-1,h=Ep+p,g=e.x+m*h,_=t.x-m*h,v=sm(e,t,n),y=Math.max(e.x,t.x),b=Math.min(e.x,t.x),x=cm(r,e.idx,t.idx,e=>e>d&&e<f),S=cm(r,e.idx,t.idx,e=>e<d),C=cm(r,e.idx,t.idx,e=>e>f),w=e.x<t.x?`left`:(e.x,t.x,`right`),T=x*5+a,ee=S*2+(w===`left`?0:.5),E=C*2+(w===`right`?0:.5);return E<=ee&&E<T?{mode:`outer-rail`,side:`right`,anchorLane:f,innerLane:d,outerRailX:y}:ee<T?{mode:`outer-rail`,side:`left`,anchorLane:d,innerLane:f,outerRailX:b}:{mode:`inside-rail`,minLane:d,maxLane:f,sourceRailX:g,targetRailX:_,crossoverY:v}}function gm(e,t){let n=e=>`vertical:${Math.round(e*1e3)/1e3}`;switch(t.mode){case`straight`:return n(e.from.x);case`outer-rail`:return n(t.outerRailX);case`inside-rail`:return`${t.mode}:${t.minLane}:${t.maxLane}`;case`adjacent-hook`:case`occlusion-hook`:case`target-hook`:return n(t.track===`to`?e.to.x:e.from.x);default:return null}}function _m(e,t,n,r,i=0,a=G){switch(n.mode){case`straight`:return pm(e,t,r,a,n.bundleJoinY);case`curve`:return mm(e,t,n.targetSide,a,n.sourceSide);case`adjacent-hook`:case`occlusion-hook`:case`target-hook`:return dm(e,t,(n.track===`to`?t.x:e.x)+r,i,a,n.centeredSource);case`inside-rail`:return fm(e,t,n.sourceRailX+r,n.targetRailX+r,n.crossoverY);case`outer-rail`:return um(e,t,n.outerRailX+r,n.horizontalTargetJoin,i,a,n.centeredSource)}}function vm(e,t,n){if(e.mode!==t.mode)return n<.5?e:t;switch(t.mode){case`straight`:{let r=e;return{mode:`straight`,bundleJoinY:r.bundleJoinY===void 0?t.bundleJoinY:t.bundleJoinY===void 0?r.bundleJoinY:K(r.bundleJoinY,t.bundleJoinY,n)}}case`curve`:return t;case`adjacent-hook`:case`occlusion-hook`:case`target-hook`:return t;case`inside-rail`:{let r=e;return{...t,sourceRailX:K(r.sourceRailX,t.sourceRailX,n),targetRailX:K(r.targetRailX,t.targetRailX,n),crossoverY:K(r.crossoverY,t.crossoverY,n)}}case`outer-rail`:{let r=e;return{...t,outerRailX:K(r.outerRailX,t.outerRailX,n)}}}}function ym(e,t){return _m({x:K(e.fromX1,e.toX1,t),y:K(e.fromY1,e.toY1,t)},{x:K(e.fromX2,e.toX2,t),y:K(e.fromY2,e.toY2,t)},vm(e.fromPlan,e.toPlan,t),K(e.fromBundleOffset,e.toBundleOffset,t),K(e.fromTargetJoinOffset,e.toTargetJoinOffset,t),K(e.fromTargetNodeRadius,e.toTargetNodeRadius,t))}function bm(e){if(e.length===0)return 0;let t=e.map(e=>e.locChanged).sort((e,t)=>e-t);return t[Math.max(0,Math.ceil(t.length*Cp)-1)]??t[t.length-1]??0}function xm(e,t,n,r){let i=+(r===`right`);return`M ${e} ${t-n} A ${n} ${n} 0 0 ${i} ${e} ${t+n} L ${e} ${t-n} Z`}function Sm(e,t,n,r){let i=+(r===`right`);return`M ${e} ${t-n} A ${n} ${n} 0 0 ${i} ${e} ${t+n}`}function Cm(e,t,n){if(e<=0||t<=0)return 0;let r=n*Math.min(e/t,1);return Math.max(Sp,r)}var wm=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`];function Tm(e){return e>=1.4}function Em(e,t){return e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}function Dm(e,t){return Em(e,t)&&e.getHours()===t.getHours()}function Om(e){return`${wm[e.getMonth()]} ${e.getDate()}, ${e.getFullYear()}`}function km(e){return`${`${e.getHours()}`.padStart(2,`0`)}:${`${e.getMinutes()}`.padStart(2,`0`)}`}function Am(e,t){return Tm(t)?`${Om(e)} ${km(e)}`:Om(e)}function jm(e,t){if(e.length===0)return[];let n=Tm(t),r=[],i=null,a=-1/0;for(let o of e){let e=new Date(o.row.committerUnix*1e3),s=o.y*t,c=!i||!Em(e,i),l=!i||e.getMonth()!==i.getMonth()||e.getFullYear()!==i.getFullYear(),u=!i||!Dm(e,i);i=e;let d=null;if(n?c?d={key:`${o.row.sha}:day`,text:Om(e),y:s,kind:`month`}:u&&(d={key:`${o.row.sha}:hour`,text:km(e),y:s,kind:`hour`}):c&&(d={key:`${o.row.sha}:day`,text:l?Om(e):`${e.getDate()}`,y:s,kind:l?`month`:`day`}),!d)continue;let f=d.kind===`hour`?34:22;s-a<f||(r.push(d),a=s)}return r}function Mm(e,t,n){if(e.length===0)return null;let r=t/n,i=Math.max(0,Math.min(e.length-1,Math.floor((r-40-112)/56)));for(;i+1<e.length&&e[i+1].y*n<=t;)i++;return e[i]??e[0]??null}function Nm(e){return e.includes(`/`)}function Pm(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Fm(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.sha!==i.sha||r.row!==i.row||r.lane!==i.lane||r.parentShas.length!==i.parentShas.length||!Pm(r.refNames,i.refNames))return!1;for(let e=0;e<r.parentShas.length;e++)if(r.parentShas[e]!==i.parentShas[e])return!1}return!0}function Im(e,t){if(t.length<=e.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.sha!==i.sha||r.row!==i.row||r.lane!==i.lane||!Pm(r.refNames,i.refNames))return!1}return!0}function Lm(e,t){return!(!e||!t||e.length===0||t.length===0||Fm(e,t)||Im(e,t))}function Rm(e,t){return e?`☁ `:t?`● `:`⎇ `}var zm=new Map;function Bm(e){let t=zm.get(e);if(t!==void 0)return t;let n=Rd(Id(e,Ip));return zm.set(e,n),n}function Vm(e,t,n){let r=Rm(t,n)+e;return Fp+Math.ceil(Bm(r))}function Hm(e,t,n,r,i){let a=[],o=new Map;for(let s of e){let e=s.x+(i?.get(s.row.sha)??G)+8,c=s.y-10,l=e;for(let e of s.row.refNames){let i=t!==null&&e===t,o=Nm(e);a.push({refName:e,nodeSha:s.row.sha,x:l,y:c,color:r.get(s.row.sha)??yr(s.row.lane),isCurrent:i,isSelected:e===n,isRemote:o}),l+=Vm(e,o,i)+Pp}o.set(s.row.sha,s.row.refNames.length>0?l-e-Pp:0)}return{placements:a,rowWidths:o}}function Um(e){return Math.min(zp,30+Math.ceil(Bm(Yp(e.path))))}function Wm(e,t,n){let r=new Map;for(let e of t){if(!e.headSha||e.bare||e.prunable||e.isCurrent&&!e.detached)continue;let t=r.get(e.headSha)??[];t.push(e),r.set(e.headSha,t)}let i=[];for(let t of e){let e=r.get(t.row.sha);if(!e)continue;e.sort((e,t)=>Number(t.isCurrent)-Number(e.isCurrent)||e.path.localeCompare(t.path));let a=t.x-(n?.get(t.row.sha)??G)-8;for(let n of e){let e=Um(n);i.push({worktree:n,nodeSha:t.row.sha,x:a-e,y:t.y-op/2,width:e}),a-=e+Lp}}return i}function K(e,t,n){return e+(t-e)*n}function Gm(e,t,n,r){let i=t*3,a=e-i,o=e+t+i,s=56*r,c=152*r;return{firstIdx:Math.max(0,Math.floor((a-c)/s)),lastIdx:Math.min(n-1,Math.ceil((o-c)/s))}}function Km(e,t,n,r){return Math.max(e,t)>=n&&Math.min(e,t)<=r}function qm(e,t,n){let r=e.nodes.slice(t,n+1),i=[];for(let r of e.nodes)for(let a=0;a<r.row.parentShas.length;a++){let o=r.row.parentShas[a],s=e.shaToNode.get(o)??{row:{...r.row,sha:o,parentShas:[],refNames:[]},x:r.x,y:e.totalHeight,idx:e.nodes.length};Km(r.idx,s.idx,t,n)&&i.push({from:r,to:s,isMerge:a>0,key:`${r.row.sha}-${s.row.sha}`})}return{visibleNodes:r,visibleEdges:i}}function Jm(e,t){let n=new Set;if(!e||!t)return n;let r=e.nodes.find(e=>e.row.refNames.includes(t));if(!r)return n;let i=r.row.sha,a=new Set;for(;i&&!a.has(i);){a.add(i);let t=e.shaToNode.get(i),r=t?.row.parentShas[0];if(!t||!r)break;n.add(`${t.row.sha}-${r}`);let o=e.shaToNode.get(r);if(!o)break;i=o.row.sha}return n}function Ym(e,t){let n=new Set;if(!e||!t)return n;let r=e.nodes.find(e=>e.row.refNames.includes(t));if(!r)return n;let i=r.row.sha;for(;i&&!n.has(i);){n.add(i);let t=e.shaToNode.get(i),r=t?.row.parentShas[0];if(!t||!r||!e.shaToNode.get(r))break;i=r}return n}function Xm(e,t){if(!e||!t)return null;let n=e.nodes.find(e=>e.row.refNames.includes(t));return n?{key:t,x:n.x-Hp/2,color:e.shaToColor.get(n.row.sha)??yr(n.row.lane)}:null}function Zm(e){return new Set(e.unstaged.filter(e=>e.status===`U`).map(e=>e.path)).size}function Qm(e,t){return Math.max(e.topIdx,t.topIdx)<Math.min(e.bottomIdx,t.bottomIdx)}function $m(e,t=kp){let n=new Map;for(let t of e){let e=n.get(t.railKey);e?e.push(t):n.set(t.railKey,[t])}let r=new Map;for(let e of n.values()){e.sort((e,t)=>e.topIdx-t.topIdx||e.bottomIdx-t.bottomIdx||e.key.localeCompare(t.key));let n=e.map((e,t)=>t),i=e=>n[e]===e?e:(n[e]=i(n[e]),n[e]),a=(e,t)=>{let r=i(e),a=i(t);r!==a&&(n[a]=r)};for(let t=0;t<e.length;t++)for(let n=t+1;n<e.length&&!(e[n].topIdx>e[t].bottomIdx);n++)Qm(e[t],e[n])&&a(t,n);let o=new Map;for(let t=0;t<e.length;t++){let n=i(t),r=o.get(n);r?r.push(e[t]):o.set(n,[e[t]])}for(let e of o.values()){let n=[...e].sort((e,t)=>(e.bundleOrder??0)-(t.bundleOrder??0)||e.topIdx-t.topIdx||e.bottomIdx-t.bottomIdx||e.key.localeCompare(t.key)),i=[],a=[],o=[];for(let e of n){let t=i.findIndex(t=>t.every(t=>!Qm(t,e)));t<0&&(t=i.length,i.push([])),i[t].push(e),a[t]=Math.max(a[t]??0,e.strokeWidth??3),o.push({key:e.key,slot:t})}let s=[0];for(let e=1;e<a.length;e++)s[e]=s[e-1]+a[e-1]/2+t+a[e]/2;let c=Math.floor(s.length/2),l=s.length%2==1?s[c]:(s[c-1]+s[c])/2;for(let e of o)r.set(e.key,s[e.slot]-l)}}return r}function eh(e,t=Op){let n=new Map;for(let t of e){let e=`${t.targetKey}:${t.side}`,r=n.get(e);r?r.push(t):n.set(e,[t])}let r=new Map;for(let e of n.values()){e.sort((e,t)=>(e.side===`right`?e.railX-t.railX:t.railX-e.railX)||e.key.localeCompare(t.key));let n=(e.length-1)/2;for(let i=0;i<e.length;i++)r.set(e[i].key,(i-n)*t)}return r}function th(e,t=Op){let n=new Map;for(let t of e){let e=`${t.targetKey}:${t.side}`,r=n.get(e);r?r.count++:n.set(e,{targetKey:t.targetKey,count:1})}let r=new Map;for(let{targetKey:e,count:i}of n.values()){if(i<5)continue;let n=G+Math.ceil((i-4)*t/2);r.set(e,Math.max(r.get(e)??G,n))}return r}function nh(e,t,n=0){return t?.mode===`outer-rail`&&t.horizontalTargetJoin?t.outerRailX+n:t?.mode===`adjacent-hook`||t?.mode===`occlusion-hook`||t?.mode===`target-hook`?(t.track===`to`?e.to.x:e.from.x)+n:null}function rh(e,t,n){let r=new Map;for(let i of e){let e=hm(i.from,i.to,i.key,t,{adjacentTrack:i.isMerge?`to`:`from`,additionalOccupiedLanes:n});r.set(i.key,e)}let i=new Set,a=new Map;for(let t of e){let e=nh(t,r.get(t.key));if(e===null||Math.abs(e-t.to.x)<.001)continue;let n=e<t.to.x?`left`:`right`;i.add(`${t.to.row.sha}:${n}`)}for(let t of e){if(r.get(t.key)?.mode!==`curve`)continue;let e=t.from.x<t.to.x?`left`:t.from.x>t.to.x?`right`:null;if(!e)continue;let n=`${t.to.row.sha}:${e}`;a.set(n,(a.get(n)??0)+1)}for(let[e,t]of a)t>1&&i.add(e);for(let a of e){if(r.get(a.key)?.mode!==`curve`)continue;let e=a.from.x<a.to.x?`left`:a.from.x>a.to.x?`right`:null;if(!e||!i.has(`${a.to.row.sha}:${e}`))continue;let o=Yf({x:a.from.x,y:a.from.y,idx:a.from.idx,lane:a.from.row.lane},{x:a.to.x,y:a.to.y,idx:a.to.idx,lane:a.to.row.lane},t,`from`,n);!o||o.side!==e||r.set(a.key,{mode:`target-hook`,laneA:Math.min(a.from.row.lane,a.to.row.lane),laneB:Math.max(a.from.row.lane,a.to.row.lane),track:`from`})}let o=new Set(e.filter(e=>e.isMerge&&e.from.idx<e.to.idx).map(e=>e.from.row.sha));for(let t of e){if(t.isMerge||t.from.idx>=t.to.idx||!o.has(t.from.row.sha))continue;let e=r.get(t.key);((e?.mode===`adjacent-hook`||e?.mode===`occlusion-hook`||e?.mode===`target-hook`)&&e.track===`from`||e?.mode===`outer-rail`&&Math.abs(e.outerRailX-t.from.x)<.001)&&r.set(t.key,{...e,centeredSource:!0})}let s=e.flatMap(e=>{let t=r.get(e.key);if(!t)return[];let n=gm(e,t);return n?[{key:e.key,railKey:n,topIdx:Math.min(e.from.idx,e.to.idx),bottomIdx:Math.max(e.from.idx,e.to.idx),bundleOrder:+!!e.isMerge,railStartY:Math.min(e.from.y,e.to.y)+G+8,strokeWidth:e.isMerge?2:4.5}]:[]}),c=$m(s);for(let e of s){if(r.get(e.key)?.mode!==`straight`||Math.abs(c.get(e.key)??0)<.001)continue;let t=s.filter(t=>t.key!==e.key&&t.railKey===e.railKey&&t.topIdx>e.topIdx&&t.topIdx<e.bottomIdx&&Qm(e,t)).sort((e,t)=>e.topIdx-t.topIdx||e.key.localeCompare(t.key))[0];t?.railStartY!==void 0&&r.set(e.key,{mode:`straight`,bundleJoinY:t.railStartY-8})}let l=new Map,u=new Set;for(let t of e){let e=r.get(t.key);if((e?.mode===`straight`||(e?.mode===`adjacent-hook`||e?.mode===`occlusion-hook`||e?.mode===`target-hook`||e?.mode===`outer-rail`)&&e.centeredSource===!0)&&t.from.idx<t.to.idx&&u.add(t.from.row.sha),t.from.idx>=t.to.idx||!gm(t,e??{mode:`curve`}))continue;let n=l.get(t.to.row.sha);n?n.push(t.key):l.set(t.to.row.sha,[t.key])}for(let t of e){if(r.get(t.key)?.mode!==`curve`||Math.abs(t.from.x-t.to.x)<.001)continue;let e=l.get(t.to.row.sha)??[];!(!(e.length<2)&&e.some(e=>Math.abs(c.get(e)??0)>.001))&&!u.has(t.to.row.sha)||r.set(t.key,{mode:`curve`,targetSide:t.from.x<t.to.x?`left`:`right`,...u.has(t.from.row.sha)?{sourceSide:t.to.x<t.from.x?`left`:`right`}:{}})}let d=e.flatMap(e=>{let t=nh(e,r.get(e.key),c.get(e.key)??0);return t===null||Math.abs(t-e.to.x)<.001?[]:[{key:e.key,targetKey:e.to.row.sha,side:t<e.to.x?`left`:`right`,railX:t}]});return{plans:r,bundleOffsets:c,targetJoinOffsets:eh(d),targetNodeRadii:th(d)}}function ih(e,t,n,r,i){return e.map(e=>{let a=r.has(e.key),o=t.plans.get(e.key)??hm(e.from,e.to,e.key,n,{adjacentTrack:e.isMerge?`to`:`from`}),s=t.bundleOffsets.get(e.key)??0,c=t.targetJoinOffsets.get(e.key)??0,l=t.targetNodeRadii.get(e.to.row.sha)??G,u=e.isMerge?e.to:e.from;return{key:e.key,fromSha:e.from.row.sha,toSha:e.to.row.sha,path:_m(e.from,e.to,o,s,c,l),plan:o,bundleOffset:s,targetJoinOffset:c,targetNodeRadius:l,x1:e.from.x,y1:e.from.y,x2:e.to.x,y2:e.to.y,isMerge:e.isMerge,stroke:i.get(u.row.sha)??yr(u.row.lane),strokeWidth:a?4.5:e.isMerge?2:3,opacity:a?.95:.8}})}function ah(e,t,n,r,i,a){return Lm(e,t)?!0:!i||!a?!1:n!==r}function oh(){let e=Nf(),t=I(e=>e.historyWindow),n=I(e=>e.graphModel),r=I(e=>e.refs),i=I(e=>e.selectedSha),a=I(e=>e.selectedRefName),o=I(e=>e.mergePreview),s=I(e=>e.scrollToSha),c=I(e=>e.scrollToKey),l=I(e=>e.selectCommit),u=I(e=>e.selectGraphRef),d=I(e=>e.clearGraphRefSelection),f=I(e=>e.ensureMergePreview),p=I(e=>e.requestMore),m=I(e=>e.performRefAction),h=I(e=>e.performCommitAction),g=I(e=>e.performMergeRef),_=I(e=>e.performRebaseRef),v=I(e=>e.pendingMutation),x=I(e=>e.pendingCheckout),S=I(e=>e.graphAnimationSuppressToken),C=I(e=>e.showCommitMessages),w=I(e=>e.showGutterColors),T=I(e=>e.graphZoom),ee=I(e=>e.setGraphZoom),E=I(e=>e.showError),D=I(e=>e.commitCIStatus),te=I(e=>e.fetchCommitCIStatusesIfNeeded),ne=I(e=>e.worktreeChanges),re=I(e=>e.worktrees),ie=I(e=>e.worktreeSelected),ae=I(e=>e.selectWorktree),oe=I(e=>e.openRepoByPath),se=I(e=>e.repoId),[O,ce]=(0,b.useState)(null),le=(0,b.useRef)(null),ue=(0,b.useRef)(null),de=(0,b.useRef)(null),fe=(0,b.useRef)({scrollTop:0,clientHeight:0}),pe=(0,b.useRef)(0),k=(0,b.useRef)(null),me=(0,b.useRef)(null),he=(0,b.useRef)(null),ge=(0,b.useRef)(!1),_e=(0,b.useRef)(null),ve=(0,b.useRef)(0),[ye,be]=(0,b.useState)(!1),[xe,Se]=(0,b.useState)(0),[Ce,we]=(0,b.useState)(()=>typeof window>`u`?0:window.innerWidth),[Te,Ee]=(0,b.useState)(0),[De,Oe]=(0,b.useState)(0),[ke,Ae]=(0,b.useState)(null),je=(0,b.useRef)(null),[Me,Ne]=(0,b.useState)(!1),[A,Pe]=(0,b.useState)(null),[Fe,Ie]=(0,b.useState)(null),[Le,Re]=(0,b.useState)(!1),[ze,Be]=(0,b.useState)(null),[Ve,He]=(0,b.useState)(null),[Ue,We]=(0,b.useState)(null),[Ge,Ke]=(0,b.useState)(null),[{graphProgress:qe},Je]=Gc(()=>({graphProgress:1,config:Ap})),Ye=(0,b.useRef)(T),Xe=(0,b.useRef)(null),Ze=(0,b.useRef)(0),Qe=(0,b.useRef)(null),$e=(0,b.useRef)(0),et=(0,b.useRef)(null),tt=(0,b.useRef)(null),nt=(0,b.useRef)(null),rt=(0,b.useRef)(S),[,it]=(0,b.useReducer)(e=>e+1,0),at=(0,b.useRef)({firstIdx:0,lastIdx:100});(0,b.useEffect)(()=>{let e=()=>we(window.innerWidth);return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),(0,b.useEffect)(()=>{let e=e=>{e.code!==`KeyC`||!e.ctrlKey||!e.shiftKey||e.altKey||(e.preventDefault(),e.stopImmediatePropagation(),!(e.repeat||!se)&&Bt(se).catch(e=>{E(`Open terminal failed`,e)}))};return document.addEventListener(`keydown`,e,{capture:!0}),()=>document.removeEventListener(`keydown`,e,{capture:!0})},[se,E]);let ot=(0,b.useCallback)(()=>{Xe.current!==null&&clearTimeout(Xe.current),be(!0),Xe.current=setTimeout(()=>{Xe.current=null,be(!1)},fp)},[]);(0,b.useEffect)(()=>()=>{Xe.current!==null&&clearTimeout(Xe.current)},[]);let st=n?.currentBranch??r.find(e=>e.isCurrent)?.shortName??null,ct=Ce>0?Ce:(n?.layout.totalWidth??0)*Math.max(T,.1),lt=(0,b.useMemo)(()=>Sr(ct,Te,T,C?260:0),[ct,Te,C,T]),ut=(0,b.useMemo)(()=>n?wr(n.renderedRows,lt.maxLaneRadius):null,[n,lt.maxLaneRadius]),dt=(0,b.useMemo)(()=>{if(!ut||A?.kind!==`rebase`)return ut;let e=r.find(e=>e.kind===`head`&&e.isCurrent),t=r.find(e=>e.shortName===A.targetRefName),n=t?t.peeledSha??t.targetSha:void 0;return!e||!n?ut:zf(ut,e.targetSha,n,lt.maxLaneRadius)??ut},[ut,A,r,lt.maxLaneRadius]),ft=(0,b.useMemo)(()=>dt?Cr(dt,lt):null,[dt,lt]),j=(0,b.useMemo)(()=>!dt||!ft?null:Dr(dt,lt.extraLeftGutter,lt.rightGutter,ft),[dt,ft,lt.extraLeftGutter,lt.rightGutter]),pt=(0,b.useMemo)(()=>new Map(r.map(e=>[e.shortName,e])),[r]),mt=(0,b.useMemo)(()=>{let e=new Map;for(let t of re){if(!t.branchShortName||t.bare||t.prunable)continue;let n=e.get(t.branchShortName)??[];n.push(t),e.set(t.branchShortName,n)}return e},[re]),M=(0,b.useMemo)(()=>a?pt.get(a)??null:null,[pt,a]),ht=(0,b.useMemo)(()=>{if(!M)return null;if(M.kind===`head`)return mt.get(M.shortName)?.find(e=>!e.isCurrent)??null;if(M.kind===`remote`){let e=r.find(e=>e.kind===`head`&&e.upstream===M.name);return e?mt.get(e.shortName)?.find(e=>!e.isCurrent)??null:null}return null},[M,r,mt]),gt=(0,b.useMemo)(()=>$p(r),[r]),_t=(0,b.useMemo)(()=>{if(!A||!t||A.kind===`uncommit`)return null;if(A.kind===`rebase`)return ur(t.rows,r,A.targetRefName);let e=t.rows.find(e=>e.sha===A.sha);if(!e)return null;let n=A.action===`revert`?`Revert "${e.subject}"`:e.subject;return sr(t.rows,r,n,A.action)},[A,t,r]),vt=(0,b.useMemo)(()=>!j||!A||!_t?null:rm(j,_t,lt,A),[j,A,_t,lt]),yt=(0,b.useMemo)(()=>{if(!j||A?.kind!==`uncommit`)return null;let e=j.shaToNode.get(A.sha);return e?Hf(e,G*1.45):null},[j,A]),bt=(0,b.useMemo)(()=>{if(A?.kind!==`rebase`||!Fe||Fe.targetRefName!==A.targetRefName||!vt||vt.nodes.length===0)return null;let e=G*2,t=[...vt.nodes.map(({node:e})=>e),Fe.targetNode];return Uf({baseZoom:Fe.baseZoom,bounds:{minX:Math.min(...t.map(e=>e.x))-e,minY:Math.min(...t.map(e=>e.y))-e,maxX:Math.max(...t.map(e=>e.x))+e,maxY:Math.max(...t.map(e=>e.y))+e},viewport:Fe.viewport,scroll:Fe.scroll,margin:12})},[A,vt,Fe]),xt=bt?.zoom??T,St=bt?.translateX??0,Ct=bt?.translateY??0,wt=`${Le?Mp:jp}ms ${Np}`,N=(0,b.useMemo)(()=>{if(!j||!ne)return null;let e=ne.staged.length+ne.unstaged.length;if(e===0)return null;let t=(st?j.nodes.find(e=>e.row.refNames.includes(st)):void 0)??j.shaToNode.get(ne.headSha);if(!t)return null;let n=ne.mergeHeadShas?.length?`merge`:ne.rebaseHeadSha?`rebase`:`worktree`,r=Zm(ne),i=n===`worktree`?j.shaToColor.get(t.row.sha)??yr(t.row.lane):`#fab387`,a=Bf(t,n===`worktree`&&A?.kind===`commit`?vt?.nodes[0]?.node??null:null,56),o=n===`merge`?Vf(j.nodes[0]??t,56):a,s=n===`worktree`?a.anchor:t,c={row:{row:s.row.row-1,sha:`${n}:${ne.headSha}:${ne.mergeHeadShas?.[0]??ne.rebaseHeadSha??`dirty`}`,parentShas:[s.row.sha,...ne.mergeHeadShas?.slice(0,1)??[]],authorName:``,authorEmail:``,authorUnix:0,committerUnix:0,subject:n===`merge`?`Merge in progress`:n===`rebase`?`Rebase in progress`:`Uncommitted changes`,additions:0,deletions:0,locChanged:0,refNames:[],lane:s.row.lane},x:s.x,y:o.y,idx:o.idx},l=j.nodes.map(e=>e.row.lane),u=hm(c,s,`${c.row.sha}-${s.row.sha}`,l),d=ne.mergeHeadShas?.[0],f=d?j.shaToNode.get(d)??null:null,p=f?_m(c,f,hm(c,f,`${c.row.sha}-${f.row.sha}`,l,{adjacentTrack:`to`}),0):null;return{kind:n,x:c.x,y:c.y,idx:c.idx,lane:c.row.lane,headX:s.x,headY:s.y,color:i,count:e,conflictedCount:r,targetPlan:u,sourcePath:p}},[j,ne,st,A,vt]),P=N??(x?he.current:null),Tt=!!P&&!ge.current,{worktreeX:Et,worktreeY:Dt,worktreeHeadX:Ot,worktreeHeadY:kt,worktreeOpacity:At}=Gc({worktreeX:P?.x??0,worktreeY:P?.y??0,worktreeHeadX:P?.headX??0,worktreeHeadY:P?.headY??0,worktreeOpacity:P?x?.5:1:0,immediate:e=>e!==`worktreeOpacity`&&Tt,config:e=>e===`worktreeOpacity`?{mass:1,tension:210,friction:26,clamp:!0}:Ap});(0,b.useEffect)(()=>{N?he.current=N:x||(he.current=null),P?ge.current=!0:x||(ge.current=!1)},[N,P,x]);let jt=(0,b.useCallback)(e=>{ve.current=e,me.current===null&&(me.current=requestAnimationFrame(()=>{me.current=null,Se(ve.current)}))},[]),Mt=(0,b.useCallback)(()=>{k.current!==null&&(cancelAnimationFrame(k.current),k.current=null),je.current&&(Je.stop(),Je.set({graphProgress:1}),je.current=null,Ae(null))},[Je]),Nt=(0,b.useCallback)(e=>{k.current!==null&&(cancelAnimationFrame(k.current),k.current=null),Je.stop(),Je.set({graphProgress:0}),je.current=e,Ae(e),k.current=requestAnimationFrame(()=>{k.current=requestAnimationFrame(()=>{k.current=null,je.current===e&&Je.start({graphProgress:1,immediate:!1,config:Ap,onRest:t=>{t.finished&&Ae(t=>t===e?(je.current=null,null):t)}})})})},[Je]),Pt=(0,b.useCallback)(()=>{_e.current!==null&&(clearTimeout(_e.current),_e.current=null)},[]),Ft=(0,b.useCallback)(e=>{Pt(),Be(e)},[Pt]),It=(0,b.useCallback)(e=>{Pt(),_e.current=setTimeout(()=>{Be(t=>t===e?null:t),_e.current=null},up)},[Pt]);(0,b.useEffect)(()=>{Ne(!1),Pe(null),Ie(null),He(null)},[a,i]),(0,b.useEffect)(()=>{if(Fe||!Le)return;let e=window.setTimeout(()=>Re(!1),Mp);return()=>window.clearTimeout(e)},[Fe,Le]),(0,b.useEffect)(()=>()=>{Pt()},[Pt]),(0,b.useEffect)(()=>{if(!j||!t){et.current=t?.rows??null,tt.current=j,nt.current=st,Mt();return}let e=S!==rt.current;if(rt.current=S,e){et.current=t.rows,tt.current=j,nt.current=st;return}ah(et.current,t.rows,nt.current,st,tt.current,j)&&tt.current?Nt({fromLayout:tt.current,toLayout:j,fromCurrentBranch:nt.current,toCurrentBranch:st}):Mt(),et.current=t.rows,tt.current=j,nt.current=st},[st,t,j,S,Nt,Mt]),(0,b.useEffect)(()=>()=>{Je.stop(),k.current!==null&&cancelAnimationFrame(k.current),me.current!==null&&cancelAnimationFrame(me.current)},[Je]);let Lt=(0,b.useMemo)(()=>t?bm(t.rows):0,[t]),F=(0,b.useMemo)(()=>j?j.nodes.map(e=>e.row.lane):[],[j]),Rt=(0,b.useMemo)(()=>P?new Map([[P.idx,[P.lane]]]):void 0,[P]),zt=(0,b.useMemo)(()=>{if(!w)return[];let e=ft?.laneCenterX??lt.laneCenterX,t=j?Math.min(0,...j.nodes.map(e=>e.row.lane)):-lt.maxLaneRadius,n=j?Math.max(0,...j.nodes.map(e=>e.row.lane)):lt.maxLaneRadius;return Array.from({length:n-t+1},(n,r)=>{let i=r+t;return{lane:i,x:e+i*80,color:yr(i)}})},[ft?.laneCenterX,j,w,lt.laneCenterX,lt.maxLaneRadius]),Vt=(0,b.useMemo)(()=>Jm(j,st),[j,st]),Ht=(0,b.useCallback)((e,t)=>{if(!j)return;fe.current={scrollTop:e.scrollTop,clientHeight:e.clientHeight},pe.current=e.scrollTop,jt(e.scrollTop),ue.current&&(ue.current.style.transform=`translateY(${-e.scrollTop}px)`);let{firstIdx:n,lastIdx:r}=Gm(e.scrollTop,e.clientHeight,j.nodes.length,t);at.current={firstIdx:n,lastIdx:r},it()},[j,jt]);(0,b.useEffect)(()=>{if(!s||!j||!le.current||Date.now()<Ze.current)return;let e=j.shaToNode.get(s);if(!fr(Qe.current,c,!!e)||!e)return;Qe.current=c;let t=le.current,n=e.y*T-t.clientHeight/2;$e.current=Date.now()+700,t.scrollTo({top:Math.max(0,n),behavior:`smooth`})},[s,c,j,T]),(0,b.useEffect)(()=>{let e=le.current;if(!e)return;let n=()=>{if(!j)return;let n=e.scrollTop,r=Math.abs(n-pe.current)>.5;e.scrollLeft!==0&&(e.scrollLeft=0),fe.current={scrollTop:e.scrollTop,clientHeight:e.clientHeight},we(window.innerWidth),Ee(e.getBoundingClientRect().left),Oe(e.clientHeight),pe.current=n,r&&Date.now()>=$e.current&&Mt(),jt(e.scrollTop),ue.current&&(ue.current.style.transform=`translateY(${-e.scrollTop}px)`),de.current&&(de.current.style.transform=`translateY(${-e.scrollTop}px)`);let{firstIdx:i,lastIdx:a}=Gm(e.scrollTop,e.clientHeight,j.nodes.length,Ye.current),o=at.current,s=Math.floor((o.lastIdx-o.firstIdx)*.25);if((i<o.firstIdx+s||a>o.lastIdx-s)&&(at.current={firstIdx:i,lastIdx:a},it()),t&&t.hasMoreAfter&&j){let t=j.totalHeight*Ye.current;dr(e.scrollTop,e.clientHeight,t)&&p(`down`)}};e.addEventListener(`scroll`,n,{passive:!0});let r=new ResizeObserver(()=>n());return r.observe(e),n(),()=>{e.removeEventListener(`scroll`,n),r.disconnect()}},[j,t,p,Mt,jt]),(0,b.useEffect)(()=>{let e=le.current;!e||!ue.current||Ht(e,T)},[j,T,Ht]);let Ut=(0,b.useCallback)((e,t)=>{let n=le.current;if(!n)return;let r=Ye.current;if(ot(),e===r)return;let i=(n.scrollTop+t)/r;Ye.current=e,ee(e),n.scrollTop=Math.max(0,i*e-t)},[ee,ot]),Wt=(0,b.useCallback)(()=>{let e=le.current;e&&Ut(1,e.clientHeight/2)},[Ut]);(0,b.useEffect)(()=>{let e=e=>{if(!e.ctrlKey&&!e.metaKey)return;let t=le.current;if(!t||!t.contains(e.target))return;e.preventDefault(),e.stopPropagation();let n=t.getBoundingClientRect(),r=Ye.current,i=e.deltaY>0?-.1:.1,a=Math.max(qr,Math.min(3,Math.round((r+i)*10)/10));Ut(a,e.clientY-n.top)};return document.addEventListener(`wheel`,e,{passive:!1,capture:!0}),()=>document.removeEventListener(`wheel`,e,{capture:!0})},[Ut]),(0,b.useEffect)(()=>{!j||!le.current||!t?.hasMoreAfter||le.current.clientHeight/T>j.nodes.length*56*.8&&p(`down`)},[T,j,t,p]);let{visibleNodes:Gt,visibleEdges:Kt}=(0,b.useMemo)(()=>{if(!j)return{visibleNodes:[],visibleEdges:[]};let{firstIdx:e,lastIdx:t}=at.current;return qm(j,e,t)},[j,at.current.firstIdx,at.current.lastIdx]),qt=(0,b.useMemo)(()=>rh(Kt,F,Rt),[Kt,F,Rt]),{placements:Jt,rowWidths:Yt}=(0,b.useMemo)(()=>Hm(Gt,st,a,j?.shaToColor??Wp,qt.targetNodeRadii),[Gt,st,a,j,qt]),Xt=(0,b.useMemo)(()=>Wm(Gt,re,qt.targetNodeRadii),[Gt,re,qt]),Zt=(0,b.useMemo)(()=>{let e=new Map;for(let t of Xt)e.set(t.nodeSha,Math.min(e.get(t.nodeSha)??1/0,t.x));return e},[Xt]),Qt=Yt,$t=(0,b.useMemo)(()=>ih(Kt,qt,F,Vt,j?.shaToColor??Wp),[Kt,qt,F,Vt,j]),en=(0,b.useMemo)(()=>Xm(j,st),[j,st]),tn=(0,b.useMemo)(()=>{if(!ke)return null;let e=fe.current.scrollTop,t=fe.current.clientHeight||le.current?.clientHeight||0,n=ke.fromLayout.nodes.map(e=>e.row.lane),r=ke.toLayout.nodes.map(e=>e.row.lane),i=Gm(e,t,ke.fromLayout.nodes.length,T),o=Gm(e,t,ke.toLayout.nodes.length,T),s=qm(ke.fromLayout,i.firstIdx,i.lastIdx),c=qm(ke.toLayout,o.firstIdx,o.lastIdx),l=rh(s.visibleEdges,n),u=rh(c.visibleEdges,r),d=ih(s.visibleEdges,l,n,Jm(ke.fromLayout,ke.fromCurrentBranch),ke.fromLayout.shaToColor),f=ih(c.visibleEdges,u,r,Jm(ke.toLayout,ke.toCurrentBranch),ke.toLayout.shaToColor),p=Hm(s.visibleNodes,ke.fromCurrentBranch,a,ke.fromLayout.shaToColor,l.targetNodeRadii).placements,m=Hm(c.visibleNodes,ke.toCurrentBranch,a,ke.toLayout.shaToColor,u.targetNodeRadii).placements,h=Xm(ke.fromLayout,ke.fromCurrentBranch),g=Xm(ke.toLayout,ke.toCurrentBranch),_=new Map(s.visibleNodes.map(e=>[e.row.sha,e])),v=new Map(c.visibleNodes.map(e=>[e.row.sha,e])),y=new Map(d.map(e=>[e.key,e])),b=new Map(f.map(e=>[e.key,e])),x=new Map(p.map(e=>[e.refName,e])),S=new Map(m.map(e=>[e.refName,e]));return{nodes:[...new Set([..._.keys(),...v.keys()])].map(e=>{let t=_.get(e),n=v.get(e),r=n??t;if(!r)return null;let i=n?ke.toLayout:ke.fromLayout;return{sortIdx:n?.idx??t?.idx??0,item:{key:e,row:r.row,interactive:!!n,color:i.shaToColor.get(e)??yr(r.row.lane),fromX:t?.x??r.x,fromY:t?t.y:r.y+Bp,toX:n?.x??r.x,toY:n?n.y:r.y-Vp,fromOpacity:+!!t,toOpacity:+!!n,fromRadius:t?l.targetNodeRadii.get(e)??G:u.targetNodeRadii.get(e)??G,toRadius:n?u.targetNodeRadii.get(e)??G:l.targetNodeRadii.get(e)??G}}}).filter(e=>e!==null).sort((e,t)=>e.sortIdx-t.sortIdx).map(e=>e.item),edges:[...new Set([...y.keys(),...b.keys()])].map(e=>{let t=y.get(e),n=b.get(e),r=n??t;if(!r)return null;let i=n?ke.fromLayout.shaToNode.get(n.fromSha):void 0,a=n?ke.fromLayout.shaToNode.get(n.toSha):void 0,o=t?ke.toLayout.shaToNode.get(t.fromSha):void 0,s=t?ke.toLayout.shaToNode.get(t.toSha):void 0;return{sortY:Math.min(n?.y1??t?.y1??0,n?.y2??t?.y2??0),item:{key:e,fromSha:r.fromSha,toSha:r.toSha,path:n?.path??t?.path??``,fromPlan:t?.plan??n?.plan??{mode:`curve`},toPlan:n?.plan??t?.plan??{mode:`curve`},fromBundleOffset:t?.bundleOffset??n?.bundleOffset??0,toBundleOffset:n?.bundleOffset??t?.bundleOffset??0,fromTargetJoinOffset:t?.targetJoinOffset??n?.targetJoinOffset??0,toTargetJoinOffset:n?.targetJoinOffset??t?.targetJoinOffset??0,fromTargetNodeRadius:t?.targetNodeRadius??n?.targetNodeRadius??G,toTargetNodeRadius:n?.targetNodeRadius??t?.targetNodeRadius??G,stroke:n?.stroke??t?.stroke??`#cdd6f4`,fromStrokeWidth:t?.strokeWidth??r.strokeWidth,toStrokeWidth:n?.strokeWidth??r.strokeWidth,fromOpacity:t?.opacity??0,toOpacity:n?.opacity??0,fromX1:t?.x1??i?.x??r.x1,fromY1:t?.y1??i?.y??r.y1+Bp,fromX2:t?.x2??a?.x??r.x2,fromY2:t?.y2??a?.y??r.y2+Bp,toX1:n?.x1??o?.x??r.x1,toY1:n?.y1??o?.y??r.y1-Vp,toX2:n?.x2??s?.x??r.x2,toY2:n?.y2??s?.y??r.y2-Vp}}}).filter(e=>e!==null).sort((e,t)=>e.sortY-t.sortY).map(e=>e.item),refs:[...new Set([...x.keys(),...S.keys()])].map(e=>{let t=x.get(e),n=S.get(e),r=n??t;return r?{sortY:n?.y??t?.y??0,item:{key:e,placement:r,fromX:t?.x??r.x,fromY:t?t.y:r.y+Bp,toX:n?.x??r.x,toY:n?n.y:r.y-Vp,fromOpacity:+!!t,toOpacity:+!!n,fromScale:t?1:.9,toScale:n?1:.92}}:null}).filter(e=>e!==null).sort((e,t)=>e.sortY-t.sortY).map(e=>e.item),lane:h||g?{key:g?.key??h?.key??`current-lane`,color:g?.color??h?.color??`#89b4fa`,fromX:h?.x??g?.x??0,toX:g?.x??h?.x??0,fromOpacity:+!!h,toOpacity:+!!g}:null}},[ke,a,T]),nn=(0,b.useMemo)(()=>tn?.nodes??Gt.map(e=>({key:e.row.sha,row:e.row,interactive:!0,color:j?.shaToColor.get(e.row.sha)??yr(e.row.lane),fromX:e.x,fromY:e.y,toX:e.x,toY:e.y,fromOpacity:1,toOpacity:1,fromRadius:qt.targetNodeRadii.get(e.row.sha)??G,toRadius:qt.targetNodeRadii.get(e.row.sha)??G})),[tn,Gt,j]),rn=(0,b.useMemo)(()=>tn?.edges??$t.map(e=>({key:e.key,fromSha:e.fromSha,toSha:e.toSha,path:e.path,fromPlan:e.plan,toPlan:e.plan,fromBundleOffset:e.bundleOffset,toBundleOffset:e.bundleOffset,fromTargetJoinOffset:e.targetJoinOffset,toTargetJoinOffset:e.targetJoinOffset,fromTargetNodeRadius:e.targetNodeRadius,toTargetNodeRadius:e.targetNodeRadius,stroke:e.stroke,fromStrokeWidth:e.strokeWidth,toStrokeWidth:e.strokeWidth,fromOpacity:e.opacity,toOpacity:e.opacity,fromX1:e.x1,fromY1:e.y1,fromX2:e.x2,fromY2:e.y2,toX1:e.x1,toY1:e.y1,toX2:e.x2,toY2:e.y2})),[tn,$t]),an=(0,b.useMemo)(()=>tn?.refs??Jt.map(e=>({key:e.refName,placement:e,fromX:e.x,fromY:e.y,toX:e.x,toY:e.y,fromOpacity:1,toOpacity:1,fromScale:1,toScale:1})),[tn,Jt]),on=(0,b.useMemo)(()=>vt?.gutterX===void 0?tn?tn.lane:en?{key:en.key,color:en.color,fromX:en.x,toX:en.x,fromOpacity:1,toOpacity:1}:null:{key:`action-preview-gutter`,color:bp,fromX:vt.gutterX,toX:vt.gutterX,fromOpacity:1,toOpacity:1},[vt,tn,en]),sn=(0,b.useMemo)(()=>j&&st?j.nodes.find(e=>e.row.refNames.includes(st))??null:null,[j,st]),cn=(0,b.useMemo)(()=>!M||M.kind!==`head`?null:tm(M,r),[M,r]),ln=(0,b.useMemo)(()=>!M||M.kind!==`head`?!1:!cn||cn.targetSha!==M.targetSha,[M,cn]),un=(0,b.useMemo)(()=>!M||M.kind!==`head`||!cn||cn.targetSha===M.targetSha?!1:(M.ahead??0)>0,[M,cn]),dn=(0,b.useMemo)(()=>{if(!M)return[];if(M.kind===`head`){let e=(M.behind??0)>0?{action:`push`,label:`Force push`,tone:`warning`,force:!0}:{action:`push`,label:`Push`,tone:`neutral`};return M.isCurrent?[...ln?[e]:[],...un?[{action:`reset`,label:`Reset`,tone:`warning`}]:[]]:ht?[{action:`open-worktree`,label:`Open worktree`,tone:`neutral`,worktreePath:ht.path},...ln?[e]:[]]:[{action:`checkout`,label:`Checkout`,tone:`neutral`},...ln?[e]:[],...un?[{action:`reset`,label:`Reset`,tone:`warning`}]:[],{action:`delete`,label:`Delete`,tone:`danger`}]}return M.kind===`remote`?[...ht?[{action:`open-worktree`,label:`Open worktree`,tone:`neutral`,worktreePath:ht.path}]:[{action:`checkout`,label:`Checkout`,tone:`neutral`}],{action:`delete`,label:`Delete`,tone:`danger`}]:[{action:`push`,label:`Push`,tone:`neutral`}]},[M,ht,ln,un]),fn=(0,b.useMemo)(()=>!M||M.kind!==`head`||ht?null:M.shortName,[M,ht]),pn=(0,b.useMemo)(()=>!!sn&&!!st&&!!a&&a!==st&&o?.sourceRefName===a&&o.mergeable,[sn,st,a,o]),mn=(0,b.useMemo)(()=>M&&M.kind===`head`&&M.isCurrent?M:null,[M]),hn=(0,b.useMemo)(()=>{if(!j||!a||!o?.mergeable||o.sourceRefName!==a||!o.sourceSha||!o.targetSha)return null;let e=j.shaToNode.get(o.sourceSha),t=j.shaToNode.get(o.targetSha);if(!e||!t)return null;let n=j.nodes[0]??t,r={row:{row:n.row.row-1,sha:`preview:${o.sourceSha}:${o.targetSha}`,parentShas:[t.row.sha,e.row.sha],authorName:``,authorEmail:``,authorUnix:0,committerUnix:0,subject:`Merge preview`,additions:0,deletions:0,locChanged:0,refNames:[],lane:t.row.lane},x:t.x,y:n.y-56,idx:n.idx-1},i=`${r.row.sha}-${t.row.sha}`,s=`${r.row.sha}-${e.row.sha}`,c=hm(r,t,i,F),l=e.x<r.x?`left`:`right`,u=Lf(j.nodes,r.idx,e.idx,80,l),d=j.nodes.find(e=>e.x===u),f=u!==null&&u<Math.min(r.x,e.x)?`left`:`right`;return{previewNode:r,sourceNode:e,targetNode:t,sourcePath:_m(r,e,u===null?hm(r,e,s,F,{adjacentTrack:`to`}):{mode:`outer-rail`,side:f,anchorLane:d?.row.lane??(f===`left`?Math.min(...F)-1:Math.max(...F)+1),innerLane:f===`left`?Math.max(r.row.lane,e.row.lane):Math.min(r.row.lane,e.row.lane),outerRailX:u},qt.bundleOffsets.get(s)??0),targetPath:_m(r,t,c,qt.bundleOffsets.get(i)??0),color:j.shaToColor.get(t.row.sha)??yr(t.row.lane)}},[j,a,o,F,qt.bundleOffsets]),gn=(0,b.useMemo)(()=>Me?hn:null,[Me,hn]),_n=(0,b.useCallback)((e,t)=>{e.stopPropagation(),Ne(!1),Pe(null),Ie(null),u(t)},[u]),vn=(0,b.useCallback)(e=>(ce(e),m(e.action,e.refName,e.sha,e.force).finally(()=>{ce(t=>Kp(t,e)?null:t)})),[m]),yn=(0,b.useCallback)(e=>{if(!a||!M||v)return;if(Ne(!1),e.action===`open-worktree`){e.worktreePath&&oe(e.worktreePath);return}let t=e.action,n=M.targetSha,r=a,i={action:t,label:e.label,tone:e.tone,refName:r,sha:n,force:!!e.force};vn(i).catch(t=>{if(e.action===`push`&&!e.force&&qp(t))E(`Push rejected`,t,{label:`Force push`,run:()=>{vn({action:`push`,label:`Force push`,tone:`warning`,force:!0,refName:r,sha:n}).catch(e=>E(`Force push failed`,e))}});else{let n=e.action===`checkout`?Jp(t):null;if(n){E(`Branch is already checked out`,t,{label:`Open worktree`,run:()=>{oe(n)}});return}E(`${e.action} failed`,t)}})},[a,M,vn,E,v,oe]),bn=(0,b.useCallback)(e=>{if(!fn||v)return;let t=M?.kind===`head`&&M.isCurrent;Ke({title:`Move branch`,message:t?`Move checked-out branch ${fn} to commit ${e.slice(0,8)}? This resets the working tree and discards tracked changes.`:`Move branch ${fn} to commit ${e.slice(0,8)}?`,confirmLabel:`Move`,onConfirm:()=>{Ne(!1),m(`move`,fn,e).catch(e=>{E(`Move failed`,e)})}})},[fn,M,m,E,v]),xn=(0,b.useCallback)((e,t)=>{v||(Ne(!1),He(null),Be(null),We({kind:e,targetSha:t}))},[v]),Sn=(0,b.useCallback)(e=>{if(!Ue)return;let{kind:t,targetSha:n}=Ue;We(null),m(t===`branch`?`create`:`create-tag`,e,n).catch(e=>{E(`Create ${t} failed`,e)})},[Ue,m,E]),Cn=(0,b.useCallback)(()=>We(null),[]),wn=Ue?.kind===`branch`?`Branch name`:`Tag name`,Tn=Ue?`Create ${Ue.kind} at ${Ue.targetSha.slice(0,8)}`:`Create ref`,En=Ue?.kind===`tag`?gt:``,Dn=(0,b.useCallback)(()=>{a&&(Pe(null),Ie(null),Ne(!0),(!o||o.sourceRefName!==a)&&f(a))},[a,o,f]),On=(0,b.useCallback)(()=>{Ne(!1)},[]),kn=(0,b.useCallback)((e,t)=>{Ne(!1),Ie(null),Pe(e===`uncommit`?{kind:`uncommit`,sha:t}:{kind:`commit`,action:e,sha:t})},[]),An=(0,b.useCallback)((e,t,n)=>{let r=le.current;if(!r)return;let i=n.currentTarget.getBoundingClientRect(),a=Ye.current;Ne(!1),Re(!0),Ie({targetRefName:e,buttonRect:{left:i.left,top:i.top,width:i.width,height:i.height},buttonScale:i.height/sp,baseZoom:a,viewport:{width:r.clientWidth,height:r.clientHeight},scroll:{x:r.scrollLeft,y:r.scrollTop},targetNode:{x:t.x,y:t.y}}),Pe({kind:`rebase`,targetRefName:e})},[]),jn=(0,b.useCallback)(()=>{Pe(null),Ie(null)},[]),Mn=(0,b.useCallback)(()=>{Pe(e=>e?.kind===`rebase`?null:e),Ie(null)},[]),Nn=(0,b.useCallback)(()=>{let e=le.current;if(!e||!hn)return;let t=Math.max(hn.previewNode.y+G,hn.sourceNode.y+G,hn.targetNode.y+G),n=Math.max(t+40,224),r=Math.min(Ye.current,Math.max(.18,Math.min(1,e.clientHeight/n)));Ze.current=Date.now()+500,Ye.current=r,ee(r),e.scrollTo({top:0,behavior:`smooth`}),requestAnimationFrame(()=>Ht(e,r))},[hn,Ht,ee]),Pn=(0,b.useCallback)(()=>{a&&(v||(Ne(!0),Nn(),g(a).catch(e=>{E(`Merge failed`,e)})))},[a,g,Nn,E,v]),Fn=(0,b.useCallback)(e=>{Ne(!1),Pe(null),Ie(null),_(e).catch(e=>{E(`Rebase failed`,e)})},[_,E]),In=(0,b.useCallback)(e=>{mn&&(v||Fn(e))},[mn,Fn,v]),Ln=(0,b.useMemo)(()=>{if(!j||!le.current)return[];let e=le.current.scrollTop,t=new Map;for(let e of Gt){let n=t.get(e.row.lane);(!n||e.y<n.y)&&t.set(e.row.lane,e)}let n=new Map;for(let r of j.nodes){if(r.row.refNames.length===0||r.y*xt+Ct>=e)continue;let i=r.row.lane;if(n.has(i))continue;let a=t.get(i);if(!a)continue;let o=Er(r.row.refNames);o&&j.shaToBranch.get(a.row.sha)===o&&n.set(i,{name:o,x:r.x,color:br(o)})}let r=[...n.values()].sort((e,t)=>e.x-t.x),i=[],a=[];for(let e of r){let t=e.x*xt+St-4,n=e.name.length*7+20,r=0;for(let e=0;e<a.length;e++){if(t>=a[e]){r=e;break}r=e+1}r>=a.length&&a.push(0),a[r]=t+n+4,i.push({...e,row:r})}return i},[j,Gt,xt,St,Ct]),Rn=(0,b.useMemo)(()=>j?jm(j.nodes,xt).map(e=>({...e,y:e.y+Ct})):[],[j,xt,Ct]),zn=(0,b.useMemo)(()=>{if(!j)return null;let e=Mm(j.nodes,Math.max(0,xe-Ct),xt);return e?Am(new Date(e.row.committerUnix*1e3),xt):null},[j,xe,xt,Ct]),Bn=(0,b.useMemo)(()=>Rn.filter(e=>e.y-xe>28),[Rn,xe]),Vn=(0,b.useMemo)(()=>Ym(j,st),[j,st]),Hn=(0,b.useMemo)(()=>!j||Vn.size===0||!C?[]:j.nodes.filter(e=>Vn.has(e.row.sha)).map(e=>({key:e.row.sha,sha:e.row.sha,y:e.y*xt+Ct,text:e.row.subject})),[j,Vn,xt,Ct,C]),Un=(0,b.useMemo)(()=>Hn.filter(e=>e.y-xe>28),[Hn,xe]),Wn=(0,b.useMemo)(()=>De===0?[]:Hn.filter(e=>{let t=e.y-xe;return t>0&&t<De}),[Hn,xe,De]);(0,b.useEffect)(()=>{if(Wn.length===0)return;let e=window.setTimeout(()=>{let e=Wn.slice(0,ip).map(e=>e.sha);te(e)},200);return()=>window.clearTimeout(e)},[Wn,te]);let Gn=(0,b.useMemo)(()=>j&&i?j.shaToNode.get(i)??null:null,[j,i]),Kn=(0,b.useMemo)(()=>{if(!j||!Gn||!st)return!1;let e=j.nodes.find(e=>e.row.refNames.includes(st));if(!e)return!1;let t=e.row.sha,n=new Set;for(;t&&!n.has(t);){if(t===Gn.row.sha)return!0;n.add(t);let e=j.shaToNode.get(t);if(!e||e.row.parentShas.length===0)break;t=e.row.parentShas[0]}return!1},[j,Gn,st]),qn=(0,b.useMemo)(()=>!Gn||!st?!1:Gn.row.refNames.includes(st),[Gn,st]),Jn=(0,b.useMemo)(()=>{if(!Gn)return[];let e=[],t=Gn.row.parentShas.length===1;return qn?(e.push({action:`uncommit`,label:`Uncommit`,tone:`uncommit`}),t&&e.push({action:`revert`,label:`Revert`,tone:`warning`}),e):Kn?(t&&e.push({action:`revert`,label:`Revert`,tone:`warning`}),e):(t&&(e.push({action:`cherry-pick`,label:`Cherry pick`,tone:`success`}),e.push({action:`revert`,label:`Revert`,tone:`warning`})),e)},[Gn,qn,Kn]),Yn=(0,b.useCallback)(e=>{if(!Gn||v)return;if(Pe(null),Ie(null),e===`cherry-pick`){h(e,Gn.row.sha).catch(t=>{E(`${e} failed`,t)});return}let t=Gn.row.sha.slice(0,8),n=e===`uncommit`?`Uncommit`:`Revert commit`,r=e===`uncommit`?`Uncommit ${t}? This will move HEAD to its parent and keep the changes in your working tree.`:`Revert commit ${t} on the current branch?`;Ke({title:n,message:r,confirmLabel:e===`uncommit`?`Uncommit`:`Revert`,onConfirm:()=>{h(e,Gn.row.sha).catch(t=>{E(`${e} failed`,t)})}})},[Gn,h,E,v]),Xn=ke!==null;if(!j)return(0,y.jsx)(`div`,{style:{flex:1,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#45475a`,fontSize:13},children:`No commits to display`});let Zn=j.totalWidth,Qn=j.totalHeight,$n=Zn*T,er=Qn*T,tr=P?Math.max(22,String(P.conflictedCount).length*7+14):0,nr=P?.kind===`merge`?P.conflictedCount>0?`Merge conflicts`:`Merge in progress`:P?.kind===`rebase`?P.conflictedCount>0?`Rebase conflicts`:`Rebase in progress`:`Uncommitted changes`,rr=P?.kind===`worktree`?`Uncommitted changes — ${P.count} file${P.count===1?``:`s`}\nClick to stage / unstage`:`${nr} — ${P?.conflictedCount??0} conflict${P?.conflictedCount===1?``:`s`}\nClick to review files`;return(0,y.jsxs)(`div`,{ref:le,style:{flex:1,height:`100%`,overflowY:`auto`,overflowX:`hidden`,position:`relative`,background:`#1e1e2e`,touchAction:`pan-y`},onClick:()=>{Ne(!1),Pe(null),Ie(null),He(null),Be(null),Pt(),d()},children:[(0,y.jsx)(np,{open:!!Ue,title:Tn,label:wn,initialValue:En,confirmLabel:`Create`,onSubmit:Sn,onClose:Cn}),(0,y.jsx)(rp,{open:!!Ge,title:Ge?.title??``,message:Ge?.message??``,confirmLabel:Ge?.confirmLabel??`Confirm`,onConfirm:()=>{let e=Ge?.onConfirm;Ke(null),e?.()},onClose:()=>Ke(null)}),ye&&(0,y.jsx)(`div`,{style:{position:`sticky`,top:`calc(100% - 54px)`,left:0,zIndex:30,width:`100%`,height:0,display:`flex`,justifyContent:`center`,overflow:`visible`,pointerEvents:`none`},children:(0,y.jsxs)(`div`,{"aria-live":`polite`,onClick:e=>e.stopPropagation(),style:{display:`flex`,alignItems:`center`,gap:8,minHeight:34,padding:Math.abs(T-1)>.001?`4px 5px 4px 12px`:`4px 12px`,border:`1px solid #45475a`,borderRadius:8,background:`#181825ee`,color:`#cdd6f4`,fontSize:11,fontWeight:700,fontVariantNumeric:`tabular-nums`,boxShadow:`0 8px 24px rgba(0,0,0,0.35)`,backdropFilter:`blur(8px)`,pointerEvents:`auto`,userSelect:`none`},children:[(0,y.jsxs)(`span`,{"aria-label":`Zoom ${Math.round(T*100)} percent`,children:[Math.round(T*100),`%`]}),Math.abs(T-1)>.001&&(0,y.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),Wt()},style:{height:26,padding:`0 8px`,border:`1px solid #45475a`,borderRadius:5,background:`#313244`,color:`#bac2de`,fontFamily:`inherit`,fontSize:10,fontWeight:700,cursor:`pointer`},children:`Reset zoom`})]})}),Fe&&(0,sa.createPortal)((0,y.jsx)(`div`,{style:{position:`fixed`,left:Fe.buttonRect.left,top:Fe.buttonRect.top,width:Fe.buttonRect.width,height:Fe.buttonRect.height,zIndex:1e4,pointerEvents:`auto`},children:(0,y.jsx)(`div`,{style:{width:Fe.buttonRect.width/Fe.buttonScale,height:Fe.buttonRect.height/Fe.buttonScale,transform:`scale(${Fe.buttonScale})`,transformOrigin:`top left`},children:(0,y.jsx)(Hd,{label:`Rebase`,tone:`success`,onClick:()=>In(Fe.targetRefName),onMouseLeave:Mn})})}),document.body),(0,y.jsx)(`div`,{style:{position:`sticky`,top:0,left:0,zIndex:20,height:0,overflow:`visible`,pointerEvents:`none`},children:Ln.map(e=>(0,y.jsx)(`div`,{onClick:t=>_n(t,e.name),style:{position:`absolute`,left:e.x*xt+St-4,top:4+e.row*22,padding:`2px 8px`,borderRadius:4,background:a===e.name?e.color+`35`:e.color+`20`,border:`1px solid ${a===e.name?e.color:e.color+`50`}`,color:e.color,fontSize:10,fontWeight:600,whiteSpace:`nowrap`,pointerEvents:`auto`,transform:`scale(${Math.min(xt,1)})`,transformOrigin:`top left`,transition:`left ${wt}, transform ${wt}`,cursor:`pointer`,boxShadow:a===e.name?`0 0 8px ${e.color}40`:`none`},children:e.name},e.name))}),(0,y.jsxs)(`div`,{style:{position:`sticky`,top:0,left:0,width:`100%`,height:0,overflow:`visible`,zIndex:5,pointerEvents:`none`},children:[zn&&(0,y.jsx)(`div`,{style:{position:`absolute`,right:20,top:6,padding:`3px 8px`,borderRadius:6,background:`#181825`,border:`1px solid #313244`,color:`#9399b2`,fontSize:11,fontWeight:600,whiteSpace:`nowrap`,boxShadow:`0 4px 12px rgba(0,0,0,0.2)`},children:zn}),(0,y.jsxs)(`div`,{ref:de,style:{position:`relative`},children:[P&&P.y*xt+Ct-xe>28&&(0,y.jsxs)(fl.div,{style:{position:`absolute`,left:20,top:Xc(Dt,e=>e*xt+Ct-7),opacity:At,maxWidth:(160+lt.extraLeftGutter-40)*xt,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,color:ie?P.color:`#a6adc8`,fontSize:12,fontWeight:600,pointerEvents:`none`,userSelect:`none`,display:`flex`,alignItems:`center`,gap:6,transition:`max-width ${wt}`},children:[(0,y.jsx)(`span`,{style:{display:`inline-block`,width:8,height:8,borderRadius:`50%`,background:P.color,flexShrink:0}}),(0,y.jsx)(`span`,{style:{overflow:`hidden`,textOverflow:`ellipsis`},children:nr})]}),Un.map(e=>{let t=D[e.sha],n=t?{success:`#a6e3a1`,pending:`#f9e2af`,failure:`#f38ba8`,error:`#f38ba8`,neutral:`#6c7086`,loading:`#585b70`,none:`#45475a`}[t.state]:void 0;return(0,y.jsxs)(`div`,{style:{position:`absolute`,left:20,top:e.y-7,maxWidth:(160+lt.extraLeftGutter-40)*xt,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,color:`#a6adc8`,fontSize:12,pointerEvents:`none`,userSelect:`none`,display:`flex`,alignItems:`center`,gap:6,transition:`top ${wt}, max-width ${wt}`},children:[n&&(0,y.jsx)(`span`,{style:{display:`inline-block`,width:8,height:8,borderRadius:`50%`,background:n,flexShrink:0}}),(0,y.jsx)(`span`,{style:{overflow:`hidden`,textOverflow:`ellipsis`},children:e.text})]},e.key)})]}),(0,y.jsx)(`div`,{ref:ue,style:{position:`relative`},children:Bn.map(e=>(0,y.jsxs)(`div`,{style:{position:`absolute`,right:20,top:e.y-7,padding:`2px 6px`,borderRadius:6,background:`#1e1e2e`,color:e.kind===`month`?`#6c7086`:e.kind===`hour`?`#585b70`:`#45475a`,fontSize:e.kind===`month`?11:10,fontWeight:e.kind===`month`?600:e.kind===`hour`?500:400,whiteSpace:`nowrap`,pointerEvents:`none`,userSelect:`none`,transition:`top ${wt}`},children:[(0,y.jsx)(`span`,{style:{display:`inline-block`,width:e.kind===`month`?16:e.kind===`hour`?6:8,height:1,background:e.kind===`month`?`#585b70`:e.kind===`hour`?`#45475a`:`#313244`,verticalAlign:`middle`,marginRight:4}}),e.text]},e.key))})]}),(0,y.jsx)(`div`,{style:{width:$n,height:er,position:`relative`,zIndex:10},children:(0,y.jsxs)(`div`,{style:{position:`absolute`,top:0,left:0,width:Zn,height:Qn,transform:`translate(${St}px, ${Ct}px) scale(${xt})`,transformOrigin:`top left`,transition:`transform ${wt}`,willChange:Fe?`transform`:void 0},children:[(0,y.jsxs)(`svg`,{width:Zn,height:Qn,style:{position:`absolute`,top:0,left:0,zIndex:10,pointerEvents:`none`,overflow:`visible`},children:[zt.map(e=>(0,y.jsx)(`rect`,{x:e.x-80/2+2,y:0,width:76,height:Qn,rx:16,fill:`${e.color}16`,stroke:`${e.color}24`,strokeWidth:1},`gutter-${e.lane}`)),on&&(0,y.jsxs)(fl.g,{opacity:Xn?Xc(qe,e=>K(on.fromOpacity,on.toOpacity,e)*.95):on.toOpacity*.95,children:[(0,y.jsx)(fl.rect,{x:Xn?Xc(qe,e=>K(on.fromX,on.toX,e)):on.toX,y:0,width:Hp,height:Qn,rx:18,fill:`${on.color}10`}),(0,y.jsx)(fl.rect,{x:Xn?Xc(qe,e=>K(on.fromX,on.toX,e)+2):on.toX+2,y:0,width:Hp-4,height:Qn,rx:16,fill:`${on.color}06`})]},on.key),gn&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{d:gn.targetPath,stroke:gn.color,strokeWidth:3,fill:`none`,strokeLinecap:`round`,strokeDasharray:`8 6`,opacity:.7}),(0,y.jsx)(`path`,{d:gn.sourcePath,stroke:gn.color,strokeWidth:2.5,fill:`none`,strokeLinecap:`round`,strokeDasharray:`8 6`,opacity:.55})]}),rn.map(e=>(0,y.jsx)(fl.path,{d:Xn?Xc(qe,t=>t>=.999?e.path:ym(e,t)):e.path,stroke:e.stroke,strokeWidth:Xn?Xc(qe,t=>K(e.fromStrokeWidth,e.toStrokeWidth,t)):e.toStrokeWidth,fill:`none`,strokeLinecap:`round`,opacity:Xn?Xc(qe,t=>K(e.fromOpacity,e.toOpacity,t)):e.toOpacity},e.key)),vt?.edges.map(e=>(0,y.jsx)(`path`,{d:e.path,stroke:e.color,strokeWidth:3,fill:`none`,strokeLinecap:`round`,strokeDasharray:e.dashed?`7 6`:void 0,opacity:.9},e.key))]}),(0,y.jsxs)(`svg`,{width:Zn,height:Qn,style:{position:`absolute`,top:0,left:0,zIndex:30,pointerEvents:`none`,overflow:`visible`},children:[nn.map(t=>{let{row:n}=t,r=n.sha===i,a=t.color,o=pp*2,s=Cm(n.additions,Lt,o),c=Cm(n.deletions,Lt,o),u=`gauge-${n.sha}`,d=`${u}-left`,f=`${u}-right`,p=r?gp:hp,m=r?_p:mp,h=hf(n.subject,e),g=Xn?Xc(qe,e=>K(t.fromX,t.toX,e)):t.toX,_=Xn?Xc(qe,e=>K(t.fromY,t.toY,e)):t.toY,v=Xn?Xc(qe,e=>K(t.fromOpacity,t.toOpacity,e)):t.toOpacity,b=Xn?Xc(qe,e=>K(t.fromRadius,t.toRadius,e)):t.toRadius,x=Xn?Xc(qe,e=>K(t.fromRadius,t.toRadius,e)*2.5):t.toRadius*2.5,S=Xn?Xc(qe,e=>`translate(${K(t.fromX,t.toX,e)} ${K(t.fromY,t.toY,e)})`):`translate(${t.toX} ${t.toY})`,C=Xn?Xc(qe,e=>xm(K(t.fromX,t.toX,e),K(t.fromY,t.toY,e),pp,`left`)):xm(t.toX,t.toY,pp,`left`),w=Xn?Xc(qe,e=>xm(K(t.fromX,t.toX,e),K(t.fromY,t.toY,e),pp,`right`)):xm(t.toX,t.toY,pp,`right`),T=Xn?Xc(qe,e=>Sm(K(t.fromX,t.toX,e),K(t.fromY,t.toY,e),pp,`left`)):Sm(t.toX,t.toY,pp,`left`),ee=Xn?Xc(qe,e=>Sm(K(t.fromX,t.toX,e),K(t.fromY,t.toY,e),pp,`right`)):Sm(t.toX,t.toY,pp,`right`);return(0,y.jsxs)(fl.g,{"data-commit-sha":n.sha,onClick:t.interactive?e=>{e.stopPropagation(),l(n.sha)}:void 0,onPointerEnter:t.interactive?()=>Ft(n.sha):void 0,onPointerLeave:t.interactive?()=>It(n.sha):void 0,opacity:v,style:{cursor:t.interactive?`pointer`:`default`,pointerEvents:t.interactive?`auto`:`none`},children:[(0,y.jsx)(`title`,{children:`${n.subject}${h?`\n${h.label} commit`:``}\n+${n.additions} / -${n.deletions} (${n.locChanged} LOC changed)`}),r&&(0,y.jsx)(fl.circle,{cx:g,cy:_,r:x,fill:a,opacity:.15}),(0,y.jsx)(fl.circle,{cx:g,cy:_,r:b,fill:ap,stroke:a,strokeWidth:r?3.5:2.75}),(0,y.jsxs)(`defs`,{children:[(0,y.jsx)(`clipPath`,{id:d,clipPathUnits:`userSpaceOnUse`,children:(0,y.jsx)(fl.path,{d:C})}),(0,y.jsx)(`clipPath`,{id:f,clipPathUnits:`userSpaceOnUse`,children:(0,y.jsx)(fl.path,{d:w})})]}),(0,y.jsx)(fl.path,{d:C,fill:m}),(0,y.jsx)(fl.path,{d:w,fill:m}),s>0&&(0,y.jsx)(fl.rect,{x:Xn?Xc(qe,e=>K(t.fromX,t.toX,e)-pp):t.toX-pp,y:Xn?Xc(qe,e=>K(t.fromY,t.toY,e)+pp-s):t.toY+pp-s,width:pp,height:s,fill:vp,clipPath:`url(#${d})`}),c>0&&(0,y.jsx)(fl.rect,{x:g,y:Xn?Xc(qe,e=>K(t.fromY,t.toY,e)+pp-c):t.toY+pp-c,width:pp,height:c,fill:yp,clipPath:`url(#${f})`}),(0,y.jsx)(fl.path,{d:T,stroke:p,strokeWidth:1.6,fill:`none`}),(0,y.jsx)(fl.path,{d:ee,stroke:p,strokeWidth:1.6,fill:`none`}),(0,y.jsx)(fl.line,{x1:g,y1:Xn?Xc(qe,e=>K(t.fromY,t.toY,e)-pp):t.toY-pp,x2:g,y2:Xn?Xc(qe,e=>K(t.fromY,t.toY,e)+pp):t.toY+pp,stroke:p,strokeWidth:1.6}),!h&&n.parentShas.length>1&&(0,y.jsx)(fl.circle,{cx:g,cy:_,r:2,fill:a}),h&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(fl.circle,{cx:g,cy:_,r:7.4,fill:ap,opacity:.9}),(0,y.jsx)(fl.g,{transform:S,children:(0,y.jsx)(If,{icon:h.icon,color:a,customSvg:h.customSvg})})]})]},t.key)}),P&&(0,y.jsxs)(fl.g,{opacity:At,style:{pointerEvents:`none`},children:[P.sourcePath&&(0,y.jsx)(`path`,{d:P.sourcePath,stroke:P.color,strokeWidth:2.25,strokeLinecap:`round`,strokeDasharray:`3 5`,fill:`none`,opacity:.55}),(0,y.jsx)(fl.path,{d:Xc([Et,Dt,Ot,kt],(e,t,n,r)=>_m({x:e,y:t},{x:n,y:r},P.targetPlan,0)),stroke:P.color,strokeWidth:2.5,strokeLinecap:`round`,strokeDasharray:`3 5`,fill:`none`,opacity:.7})]})]}),(0,y.jsxs)(`svg`,{"data-testid":`preview-node-layer`,width:Zn,height:Qn,style:{position:`absolute`,top:0,left:0,zIndex:50,pointerEvents:`none`,overflow:`visible`},children:[gn&&(0,y.jsxs)(`g`,{children:[(0,y.jsx)(`circle`,{cx:gn.previewNode.x,cy:gn.previewNode.y,r:G*1.9,fill:gn.color,opacity:.12}),(0,y.jsx)(`circle`,{cx:gn.previewNode.x,cy:gn.previewNode.y,r:G,fill:ap,stroke:gn.color,strokeWidth:3,strokeDasharray:`6 4`}),(0,y.jsx)(`circle`,{cx:gn.previewNode.x,cy:gn.previewNode.y,r:2.5,fill:gn.color})]}),vt?.nodes.map(({node:e,color:t})=>(0,y.jsxs)(`g`,{children:[(0,y.jsx)(`circle`,{cx:e.x,cy:e.y,r:G*1.9,fill:t,opacity:.12}),(0,y.jsx)(`circle`,{cx:e.x,cy:e.y,r:G,fill:ap,stroke:t,strokeWidth:3,strokeDasharray:`6 4`}),(0,y.jsx)(`circle`,{cx:e.x,cy:e.y,r:2.5,fill:t})]},`action-preview:${e.row.sha}`)),yt&&(0,y.jsx)(`g`,{"data-testid":`uncommit-preview-cross`,pointerEvents:`none`,children:yt.map((e,t)=>(0,y.jsx)(`line`,{...e,stroke:xp,strokeWidth:3.25,strokeLinecap:`round`,strokeDasharray:`6 4`},`uncommit-cross-${t}`))}),P&&(0,y.jsxs)(fl.g,{"data-testid":`pending-operation-node`,onClick:e=>{e.stopPropagation(),ae()},opacity:At,style:{cursor:`pointer`,pointerEvents:`auto`},children:[(0,y.jsx)(`title`,{children:rr}),ie&&(0,y.jsx)(fl.circle,{cx:Et,cy:Dt,r:G*2.5,fill:P.color,opacity:.15}),(0,y.jsx)(fl.circle,{cx:Et,cy:Dt,r:G,fill:ap,stroke:P.color,strokeWidth:ie?3.5:2.75,strokeDasharray:`4 3`}),P.kind===`worktree`?(0,y.jsx)(fl.text,{x:Et,y:Dt,textAnchor:`middle`,dominantBaseline:`central`,fontSize:12,fontWeight:700,fill:P.color,style:{pointerEvents:`none`,userSelect:`none`},children:P.count}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(fl.circle,{cx:Et,cy:Dt,r:2.5,fill:P.color}),P.conflictedCount>0&&(0,y.jsxs)(`g`,{style:{pointerEvents:`none`,userSelect:`none`},children:[(0,y.jsx)(fl.rect,{x:Xc(Et,e=>e+G+6),y:Xc(Dt,e=>e-10),width:tr,height:20,rx:10,fill:`#fab38722`,stroke:`#fab387`,strokeWidth:1.4}),(0,y.jsx)(fl.text,{x:Xc(Et,e=>e+G+6+tr/2),y:Dt,textAnchor:`middle`,dominantBaseline:`central`,fontSize:11,fontWeight:800,fill:`#fab387`,children:P.conflictedCount})]})]})]})]}),an.map(e=>{let{placement:t}=e,n=t.isSelected||t.isCurrent,r=t.isSelected?t.color+`35`:t.isCurrent?t.color+`2a`:t.color+`18`,i=[`inset 0 1px 0 rgba(255, 255, 255, 0.14)`,`inset 0 -1px 0 ${t.color}18`,n?`0 0 8px ${t.color}38`:`0 2px 5px rgba(0, 0, 0, 0.18)`].join(`, `);return(0,y.jsxs)(fl.div,{onClick:e=>_n(e,t.refName),onPointerEnter:()=>Ft(t.nodeSha),onPointerLeave:()=>It(t.nodeSha),style:{position:`absolute`,left:0,top:0,zIndex:40,height:20,padding:`0 7px`,borderRadius:4,background:`linear-gradient(135deg, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0.015) 38%, ${t.color}18 100%), linear-gradient(${r}, ${r}), rgba(24, 24, 37, 0.5)`,backdropFilter:`blur(3px) saturate(145%) contrast(103%)`,WebkitBackdropFilter:`blur(3px) saturate(145%) contrast(103%)`,border:`1px solid ${n?t.color:t.color+`66`}`,color:t.color,fontSize:11,fontWeight:600,lineHeight:`20px`,whiteSpace:`nowrap`,cursor:`pointer`,userSelect:`none`,boxShadow:i,transformOrigin:`top left`,opacity:Xn?Xc(qe,t=>K(e.fromOpacity,e.toOpacity,t)):e.toOpacity,transform:Xn?Xc(qe,t=>`translate(${K(e.fromX,e.toX,t)}px, ${K(e.fromY,e.toY,t)}px) scale(${K(e.fromScale,e.toScale,t)})`):`translate(${e.toX}px, ${e.toY}px) scale(${e.toScale})`},children:[Rm(t.isRemote,t.isCurrent),t.refName]},e.key)}),!Xn&&Xt.map(e=>{let{worktree:t}=e,n=Yp(t.path),r=t.isCurrent?`#f9e2af`:`#94e2d5`;return(0,y.jsxs)(`div`,{"data-testid":`worktree-marker`,title:n,"aria-label":`${t.isCurrent?`Current detached worktree`:`Open linked worktree`} ${t.path}`,onClick:e=>{e.stopPropagation(),t.isCurrent||oe(t.path)},onPointerEnter:()=>Ft(e.nodeSha),onPointerLeave:()=>It(e.nodeSha),style:{position:`absolute`,left:e.x,top:e.y,zIndex:40,boxSizing:`border-box`,width:e.width,height:op,display:`flex`,alignItems:`center`,padding:`0 5px 0 7px`,borderRadius:`4px 1px 1px 4px`,borderRight:`2px solid ${r}aa`,background:`linear-gradient(90deg, rgba(17,17,27,0.82), ${r}14)`,color:`#cdd6f4`,fontSize:11,fontWeight:600,whiteSpace:`nowrap`,cursor:t.isCurrent?`default`:`pointer`,userSelect:`none`,boxShadow:`0 2px 5px rgba(0,0,0,0.2)`},children:[(0,y.jsx)(Xp,{color:r}),(0,y.jsx)(`span`,{style:{marginLeft:5,minWidth:0,overflow:`hidden`,textOverflow:`ellipsis`},children:n})]},`worktree:${t.path}`)}),Gt.map(e=>{let t=Qt.get(e.row.sha)??0,n=qt.targetNodeRadii.get(e.row.sha)??G,r=e.x+n+8+t+(t>0?8:0),o=e.y-10,s=O!==null,c=!s&&e.row.sha===i?Jn:[],l=!!a&&e.row.refNames.includes(a),u=l?dn:[],d=s&&l&&O?u.find(e=>e.action===O.action)??O:null,f=s?d?[d]:[]:u,p=!s&&!!st&&e.row.refNames.includes(st)&&pn,m=!v&&!s&&!Xn&&(ze===e.row.sha||Ve===e.row.sha),h=m&&!!fn&&e.row.sha!==M?.targetSha,g=!s&&mn&&e.row.sha!==mn.targetSha?Er(e.row.refNames.filter(e=>e!==mn.shortName)):null,_=g&&(A?.kind!==`rebase`||A.targetRefName===g)?g:null,x=f.length>0||p||h||m||!!_;return c.length===0&&!x?null:(0,y.jsxs)(b.Fragment,{children:[c.length>0&&(0,y.jsx)(`div`,{style:{position:`absolute`,left:(Zt.get(e.row.sha)??e.x-G)-12,top:e.y,transform:`translate(-100%, -50%)`,display:`flex`,alignItems:`center`,gap:10,flexWrap:`nowrap`,zIndex:40},children:c.map(t=>(0,y.jsx)(Hd,{label:t.label,tone:t.tone,onClick:()=>Yn(t.action),onMouseEnter:()=>kn(t.action,e.row.sha),onMouseLeave:jn},t.action))}),x&&(0,y.jsxs)(`div`,{onPointerEnter:()=>Ft(e.row.sha),onPointerLeave:()=>It(e.row.sha),style:{position:`absolute`,left:r,top:o,display:`flex`,alignItems:`flex-start`,gap:10,flexWrap:`nowrap`,zIndex:m||Ve===e.row.sha?40:20},children:[f.length>0&&(0,y.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,position:`relative`,top:Gp(cp),zIndex:7},children:f.map(e=>(0,y.jsx)(U,{label:e.label,tone:e.tone,loading:!!d&&e.action===d.action,onClick:()=>yn(e)},e.action))}),_&&(0,y.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,position:`relative`,top:Gp(sp),zIndex:7},children:(0,y.jsx)(Hd,{label:`Rebase`,tone:`success`,onClick:()=>In(_),onMouseEnter:t=>An(_,e,t),onMouseLeave:Fe?.targetRefName===_?void 0:Mn})}),p&&(0,y.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,position:`relative`,top:Gp(sp),zIndex:7},children:(0,y.jsx)(Hd,{label:`Merge`,tone:`merge`,onClick:Pn,onMouseEnter:Dn,onMouseLeave:On})}),h&&(0,y.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,position:`relative`,zIndex:7},children:(0,y.jsx)(U,{label:`Move ${fn} here`,tone:`neutral`,size:`compact`,variant:`ghost`,onClick:()=>bn(e.row.sha)})}),m&&(0,y.jsxs)(`div`,{style:{position:`relative`,top:Gp(lp),zIndex:8},children:[(0,y.jsx)(`button`,{type:`button`,title:`Create branch or tag`,"aria-label":`Create branch or tag`,onClick:t=>{t.stopPropagation(),Ne(!1),He(t=>t===e.row.sha?null:e.row.sha),Be(e.row.sha)},style:{width:lp,height:lp,display:`inline-flex`,alignItems:`center`,justifyContent:`center`,padding:0,borderRadius:6,border:`1px solid #4a4f68`,background:`#2f3348`,color:`#cdd6f4`,fontSize:21,fontWeight:600,lineHeight:1,cursor:`pointer`,fontFamily:`inherit`,boxShadow:`0 8px 20px rgba(0,0,0,0.28)`},onMouseEnter:e=>{e.currentTarget.style.background=`#3a4058`},onMouseLeave:e=>{e.currentTarget.style.background=`#2f3348`},children:`+`}),Ve===e.row.sha&&(0,y.jsx)(`div`,{onClick:e=>e.stopPropagation(),style:{position:`absolute`,right:0,top:36,width:dp,padding:5,borderRadius:7,border:`1px solid #4a4f68`,background:`#181825`,boxShadow:`0 14px 30px rgba(0,0,0,0.42)`,display:`flex`,flexDirection:`column`,gap:4},children:[`branch`,`tag`].map(t=>(0,y.jsx)(`button`,{type:`button`,onClick:n=>{n.stopPropagation(),xn(t,e.row.sha)},style:{height:28,padding:`0 9px`,borderRadius:5,border:`1px solid transparent`,background:`transparent`,color:`#cdd6f4`,fontSize:12,fontWeight:600,fontFamily:`inherit`,textAlign:`left`,cursor:`pointer`},onMouseEnter:e=>{e.currentTarget.style.background=`#313244`,e.currentTarget.style.borderColor=`#45475a`},onMouseLeave:e=>{e.currentTarget.style.background=`transparent`,e.currentTarget.style.borderColor=`transparent`},children:t===`branch`?`Branch`:`Tag`},t))})]})]})]},`${e.row.sha}-actions`)})]})})]})}var sh=56,ch=56,lh=12,uh=`#11111b`,dh=56,fh=80,ph=110,mh=150,hh=28,gh=640,_h=[`#89b4fa`,`#a6e3a1`,`#f9e2af`,`#f38ba8`,`#cba6f7`,`#94e2d5`,`#fab387`,`#74c7ec`,`#f5c2e7`,`#b4befe`];function vh(e){return _h[(e%_h.length+_h.length)%_h.length]}var yh=`#f9e2af`,bh={commit:`#a6e3a1`,amend:`#f9e2af`,checkout:`#89b4fa`,reset:`#f38ba8`,rebase:`#fab387`,merge:`#cba6f7`,"cherry-pick":`#94e2d5`,revert:`#f5c2e7`,pull:`#74c7ec`,branch:`#b4befe`,clone:`#9399b2`,other:`#9399b2`},xh=new Set([`reset`,`rebase`,`amend`]),Sh={reset:`reset moved HEAD away — commits only on the old position may be unreachable`,rebase:`rebase rewrote history — the original commits live on only in the reflog`,amend:`amend replaced the previous commit — the original version is only in the reflog`};function Ch(e,t,n,r){if(e===n)return`M${e},${t}L${n},${r}`;let i=r-t;return`M${e},${t}C${e},${t+i*.3} ${n},${r-i*.3} ${n},${r}`}function wh(e){let t=new Map;e.forEach((e,n)=>t.set(e.sha,n));let n=new Map,r=[],i=[],a=0;for(let o=0;o<e.length;o++){let s=e[o],c=n.get(s.sha);c===void 0&&(c=r.indexOf(null),c===-1?(c=r.length,r.push(s.sha)):r[c]=s.sha,n.set(s.sha,c)),i.push(c),c>a&&(a=c),t.get(s.sha)===o&&(r[c]=null)}return{lanes:i,maxLane:a}}function Th(e){if(!e)return``;let t=Math.floor(Date.now()/1e3-e);if(t<60)return`just now`;if(t<3600)return`${Math.floor(t/60)}m ago`;if(t<86400)return`${Math.floor(t/3600)}h ago`;if(t<172800)return`yesterday`;if(t<14*86400)return`${Math.floor(t/86400)}d ago`;let n=new Date(e*1e3),r=n.toLocaleDateString(void 0,{month:`short`,day:`numeric`});return n.getFullYear()===new Date().getFullYear()?r:`${r} ${n.getFullYear()}`}function Eh(){let e=I(e=>e.reflog),t=I(e=>e.reflogLoading),n=I(e=>e.reflogMaxCount),r=I(e=>e.selectedSha),i=I(e=>e.selectCommit),a=I(e=>e.recoverBranch),o=I(e=>e.checkoutSha),s=I(e=>e.performCommitAction),c=I(e=>e.loadMoreReflog),l=I(e=>e.showError),[u,d]=(0,b.useState)(null),[f,p]=(0,b.useState)(null),[m,h]=(0,b.useState)(null);(0,b.useEffect)(()=>{d(null)},[e]);let g=e?.entries??[],{lanes:_,maxLane:v}=(0,b.useMemo)(()=>wh(g),[g]),x=(0,b.useMemo)(()=>{let e=new Set;for(let t of g)t.isReachable||e.add(t.sha);return e},[g]),S=e=>mh+e*ch,C=e=>dh+e*sh,w=mh+(v+1)*ch+hh,T=w+gh,ee=dh+g.length*sh+fh,E=(0,b.useMemo)(()=>{let e=``;return g.map(t=>{let n=Th(t.entryUnix);return n===e?``:(e=n,n)})},[g]),D=e=>{p({entry:e,defaultName:`recovered-${e.sha.slice(0,7)}`})},te=e=>{h({title:`Checkout commit`,message:`Checkout ${e.sha.slice(0,8)}? This detaches HEAD at that state.`,confirmLabel:`Checkout`,onConfirm:()=>{o(e.sha).catch(e=>l(`Checkout failed`,e))}})},ne=e=>{h({title:`Cherry pick commit`,message:`Cherry-pick ${e.sha.slice(0,8)} onto the current branch?`,confirmLabel:`Cherry pick`,onConfirm:()=>{s(`cherry-pick`,e.sha).catch(e=>l(`Cherry-pick failed`,e))}})},re=e=>{if(!f)return;let{entry:t}=f;p(null),a(e,t.sha).catch(e=>l(`Recover failed`,e))},ie=e=>{navigator.clipboard?.writeText(e.sha)};return!e&&t?(0,y.jsx)(`div`,{style:{flex:1,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#6c7086`,fontSize:13},children:`Reading reflog…`}):g.length===0?(0,y.jsx)(`div`,{style:{flex:1,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#45475a`,fontSize:13},children:`No reflog entries — this repository has no recorded HEAD movements yet`}):(0,y.jsxs)(`div`,{style:{flex:1,height:`100%`,overflow:`auto`,position:`relative`,background:`#1e1e2e`},onClick:()=>d(null),children:[(0,y.jsx)(np,{open:!!f,title:f?`Create branch at ${f.entry.sha.slice(0,8)}`:`Create branch`,label:`Branch name`,initialValue:f?.defaultName??``,confirmLabel:`Create`,onSubmit:re,onClose:()=>p(null)}),(0,y.jsx)(rp,{open:!!m,title:m?.title??``,message:m?.message??``,confirmLabel:m?.confirmLabel??`Confirm`,onConfirm:()=>{let e=m?.onConfirm;h(null),e?.()},onClose:()=>h(null)}),x.size>0&&(0,y.jsxs)(`div`,{style:{position:`sticky`,top:0,zIndex:30,margin:`10px 14px 0`,padding:`8px 14px`,borderRadius:6,background:`#f9e2af18`,border:`1px solid ${yh}55`,color:yh,fontSize:12,display:`flex`,alignItems:`center`,gap:8},children:[(0,y.jsx)(`span`,{style:{fontSize:14},children:`⚠`}),(0,y.jsxs)(`span`,{children:[x.size===1?`1 commit in your reflog is no longer reachable from any branch.`:`${x.size} commits in your reflog are no longer reachable from any branch.`,` `,`Select a dashed entry below to recover it.`]})]}),(0,y.jsxs)(`div`,{style:{width:T,height:ee,position:`relative`},children:[(0,y.jsxs)(`div`,{style:{position:`absolute`,left:150-lh,top:16,color:`#585b70`,fontSize:11,whiteSpace:`nowrap`,userSelect:`none`},children:[e?.refName??`HEAD`,` time machine — every state HEAD has pointed to, newest first`]}),(0,y.jsxs)(`svg`,{width:T,height:ee,style:{position:`absolute`,top:0,left:0,pointerEvents:`none`,overflow:`visible`},children:[g.slice(0,-1).map((e,t)=>{let n=S(_[t]),r=C(t);return(0,y.jsx)(`path`,{d:Ch(S(_[t+1]),C(t+1),n,r),stroke:vh(_[t]),strokeWidth:2.25,fill:`none`,strokeLinecap:`round`,opacity:.85},`edge-${t}`)}),g.map((e,t)=>{let n=S(_[t]),a=C(t),o=vh(_[t]),s=u===t||u===null&&e.sha===r,c=!e.isReachable;return(0,y.jsxs)(`g`,{onClick:n=>{n.stopPropagation(),d(t),i(e.sha)},style:{cursor:`pointer`,pointerEvents:`auto`},children:[(0,y.jsx)(`title`,{children:`${e.selector} — ${e.message}`}),s&&(0,y.jsx)(`circle`,{cx:n,cy:a,r:lh*2.3,fill:o,opacity:.15}),c&&(0,y.jsx)(`circle`,{cx:n,cy:a,r:17,fill:`none`,stroke:yh,strokeWidth:1.5,strokeDasharray:`4 3`,opacity:.9}),(0,y.jsx)(`circle`,{cx:n,cy:a,r:lh,fill:uh,stroke:o,strokeWidth:s?3:2.25}),t===0&&(0,y.jsx)(`circle`,{cx:n,cy:a,r:3,fill:o})]},`node-${t}`)})]}),g.map((e,t)=>{let n=C(t);return E[t]?(0,y.jsx)(`div`,{style:{position:`absolute`,left:0,top:n-7,width:ph,textAlign:`right`,color:`#585b70`,fontSize:11,whiteSpace:`nowrap`,pointerEvents:`none`,userSelect:`none`},children:E[t]},`time-${t}`):null}),g.map((e,t)=>{let n=C(t),r=u===t,a=!e.isReachable,o=bh[e.kind],s=xh.has(e.kind),c=Sh[e.kind];return(0,y.jsxs)(`div`,{onClick:n=>{n.stopPropagation(),d(t),i(e.sha)},style:{position:`absolute`,left:w,top:n-10,cursor:`pointer`},children:[(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,height:20,whiteSpace:`nowrap`},children:[(0,y.jsxs)(`span`,{title:c??e.message,style:{height:18,padding:`0 8px`,borderRadius:4,background:o+`20`,border:`1px solid ${o}55`,color:o,fontSize:10,fontWeight:700,lineHeight:`18px`,textTransform:`uppercase`,letterSpacing:.4},children:[s?`⚠ `:``,e.kind]}),a&&(0,y.jsx)(`span`,{title:`Not reachable from any branch — only the reflog still knows this commit`,style:{height:18,padding:`0 8px`,borderRadius:4,background:`#f9e2af20`,border:`1px solid ${yh}`,color:yh,fontSize:10,fontWeight:700,lineHeight:`18px`},children:`LOST`}),e.refNames.slice(0,3).map(e=>(0,y.jsx)(`span`,{style:{height:18,padding:`0 7px`,borderRadius:4,background:`#89b4fa18`,border:`1px solid #89b4fa55`,color:`#89b4fa`,fontSize:10,fontWeight:600,lineHeight:`18px`},children:e},e)),(0,y.jsx)(`span`,{style:{color:`#6c7086`,fontSize:11,fontFamily:`monospace`},children:e.sha.slice(0,7)}),(0,y.jsx)(`span`,{style:{color:`#a6adc8`,fontSize:12,overflow:`hidden`,textOverflow:`ellipsis`,maxWidth:360},children:e.subject})]}),r?(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginTop:4},children:[a?(0,y.jsx)(Hd,{label:`Recover branch`,tone:`success`,onClick:()=>D(e)}):(0,y.jsx)(U,{label:`Branch here`,tone:`neutral`,size:`compact`,onClick:()=>D(e)}),(0,y.jsx)(U,{label:`Checkout`,tone:`warning`,size:`compact`,onClick:()=>te(e)}),(0,y.jsx)(U,{label:`Cherry-pick`,tone:`neutral`,size:`compact`,onClick:()=>ne(e)}),(0,y.jsx)(U,{label:`Copy sha`,tone:`neutral`,size:`compact`,variant:`ghost`,onClick:()=>ie(e)})]}):(0,y.jsx)(`div`,{style:{marginTop:4,color:`#6c7086`,fontSize:10,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`,maxWidth:gh-40},children:e.message})]},`row-${t}`)}),g.length>=n&&(0,y.jsx)(`div`,{style:{position:`absolute`,left:w,top:C(g.length)+4},children:(0,y.jsx)(U,{label:t?`Loading…`:`Load older entries`,tone:`neutral`,size:`compact`,variant:`ghost`,onClick:()=>{c()}})})]})]})}var Dh=Object.defineProperty,Oh=e=>t=>{var n=e[t];if(n)return n();throw Error(`Module not found in bundle: `+t)},kh=(e,t)=>()=>(e&&(t=e(e=0)),t),Ah=(e,t)=>{for(var n in t)Dh(e,n,{get:t[n],enumerable:!0})},jh={};Ah(jh,{default:()=>Mh});var Mh,Nh=kh(()=>{Mh=[{type:`cmnt`,match:/(;|#).*/gm},{expand:`str`},{expand:`num`},{type:`num`,match:/\$[\da-fA-F]*\b/g},{type:`kwd`,match:/^[a-z]+\s+[a-z.]+\b/gm,sub:[{type:`func`,match:/^[a-z]+/g}]},{type:`kwd`,match:/^\t*[a-z][a-z\d]*\b/gm},{match:/%|\$/g,type:`oper`}]}),Ph={};Ah(Ph,{default:()=>Ih});var Fh,Ih,Lh=kh(()=>{Fh={type:`var`,match:/\$\w+|\${[^}]*}|\$\([^)]*\)/g},Ih=[{sub:`todo`,match:/#.*/g},{type:`str`,match:/(["'])((?!\1)[^\r\n\\]|\\[^])*\1?/g,sub:[Fh]},{type:`oper`,match:/(?<=\s|^)\.*\/[a-z/_.-]+/gi},{type:`kwd`,match:/\s-[a-zA-Z]+|$<|[&|;]+|\b(unset|readonly|shift|export|if|fi|else|elif|while|do|done|for|until|case|esac|break|continue|exit|return|trap|wait|eval|exec|then|declare|enable|local|select|typeset|time|add|remove|install|update|delete)(?=\s|$)/g},{expand:`num`},{type:`func`,match:/(?<=(^|\||\&\&|\;)\s*)[a-z_.-]+(?=\s|$)/gim},{type:`bool`,match:/(?<=\s|^)(true|false)(?=\s|$)/g},{type:`oper`,match:/[=(){}<>!]+/g},{type:`var`,match:/(?<=\s|^)[\w_]+(?=\s*=)/g},Fh]}),Rh={};Ah(Rh,{default:()=>zh});var zh,Bh=kh(()=>{zh=[{match:/[^\[\->+.<\]\s].*/g,sub:`todo`},{type:`func`,match:/\.+/g},{type:`kwd`,match:/[<>]+/g},{type:`oper`,match:/[+-]+/g}]}),Vh={};Ah(Vh,{default:()=>Hh});var Hh,Uh=kh(()=>{Hh=[{match:/\/\/.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,sub:`todo`},{expand:`str`},{expand:`num`},{type:`kwd`,match:/#\s*include (<.*>|".*")/g,sub:[{type:`str`,match:/(<|").*/g}]},{match:/asm\s*{[^}]*}/g,sub:[{type:`kwd`,match:/^asm/g},{match:/[^{}]*(?=}$)/g,sub:`asm`}]},{type:`kwd`,match:/\*|&|#[a-z]+\b|\b(asm|auto|double|int|struct|break|else|long|switch|case|enum|register|typedef|char|extern|return|union|const|float|short|unsigned|continue|for|signed|void|default|goto|sizeof|volatile|do|if|static|while)\b/g},{type:`oper`,match:/[/*+:?&|%^~=!,<>.^-]+/g},{type:`func`,match:/[a-zA-Z_][\w_]*(?=\s*\()/g},{type:`class`,match:/\b[A-Z][\w_]*\b/g}]}),Wh={};Ah(Wh,{default:()=>Gh});var Gh,Kh=kh(()=>{Gh=[{match:/\/\*((?!\*\/)[^])*(\*\/)?/g,sub:`todo`},{expand:`str`},{type:`kwd`,match:/@\w+\b|\b(and|not|only|or)\b|\b[a-z-]+(?=[^{}]*{)/g},{type:`var`,match:/\b[\w-]+(?=\s*:)|(::?|\.)[\w-]+(?=[^{}]*{)/g},{type:`func`,match:/#[\w-]+(?=[^{}]*{)/g},{type:`num`,match:/#[\da-f]{3,8}/g},{type:`num`,match:/\d+(\.\d+)?(cm|mm|in|px|pt|pc|em|ex|ch|rem|vm|vh|vmin|vmax|%)?/g,sub:[{type:`var`,match:/[a-z]+|%/g}]},{match:/url\([^)]*\)/g,sub:[{type:`func`,match:/url(?=\()/g},{type:`str`,match:/[^()]+/g}]},{type:`func`,match:/\b[a-zA-Z]\w*(?=\s*\()/g},{type:`num`,match:/\b[a-z-]+\b/g}]}),qh={};Ah(qh,{default:()=>Jh});var Jh,Yh=kh(()=>{Jh=[{expand:`strDouble`},{type:`oper`,match:/,/g}]}),Xh={};Ah(Xh,{default:()=>Zh});var Zh,Qh=kh(()=>{Zh=[{type:`deleted`,match:/^[-<].*/gm},{type:`insert`,match:/^[+>].*/gm},{type:`kwd`,match:/!.*/gm},{type:`section`,match:/^@@.*@@$|^\d.*|^([*-+])\1\1.*/gm}]}),$h={};Ah($h,{default:()=>eg});var eg,tg=kh(()=>{Lh(),eg=[{type:`kwd`,match:/^(FROM|RUN|CMD|LABEL|MAINTAINER|EXPOSE|ENV|ADD|COPY|ENTRYPOINT|VOLUME|USER|WORKDIR|ARG|ONBUILD|STOPSIGNAL|HEALTHCHECK|SHELL)\b/gim},...Ih]}),ng={};Ah(ng,{default:()=>rg});var rg,ig=kh(()=>{Qh(),rg=[{match:/^#.*/gm,sub:`todo`},{expand:`str`},...Zh,{type:`func`,match:/^(\$ )?git(\s.*)?$/gm},{type:`kwd`,match:/^commit \w+$/gm}]}),ag={};Ah(ag,{default:()=>og});var og,sg=kh(()=>{og=[{match:/\/\/.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,sub:`todo`},{expand:`str`},{expand:`num`},{type:`kwd`,match:/\*|&|\b(break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go|goto|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/g},{type:`func`,match:/[a-zA-Z_][\w_]*(?=\s*\()/g},{type:`class`,match:/\b[A-Z][\w_]*\b/g},{type:`oper`,match:/[+\-*\/%&|^~=!<>.^-]+/g}]}),cg={};Ah(cg,{default:()=>mg,name:()=>dg,properties:()=>fg,xmlElement:()=>pg});var lg,ug,dg,fg,pg,mg,hg=kh(()=>{lg=`:A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�`,ug=lg+`\\-\\.0-9·̀-ͯ‿-⁀`,dg=`[${lg}][${ug}]*`,fg=`\\s*(\\s+${dg}\\s*(=\\s*([^"']\\S*|("|')(\\\\[^]|(?!\\4)[^])*\\4?)?)?\\s*)*`,pg={match:RegExp(`<[/!?]?${dg}${fg}[/!?]?>`,`g`),sub:[{type:`var`,match:RegExp(`^<[/!?]?${dg}`,`g`),sub:[{type:`oper`,match:/^<[\/!?]?/g}]},{type:`str`,match:/=\s*([^"']\S*|("|')(\\[^]|(?!\2)[^])*\2?)/g,sub:[{type:`oper`,match:/^=/g}]},{type:`oper`,match:/[\/!?]?>/g},{type:`class`,match:RegExp(dg,`g`)}]},mg=[{match:/<!--[^]*?-->/g,sub:`todo`},{type:`class`,match:/<!\[CDATA\[[\s\S]*?\]\]>/gi},pg,{type:`str`,match:RegExp(`<\\?${dg}([^?]|\\?[^?>])*\\?+>`,`g`),sub:[{type:`var`,match:RegExp(`^<\\?${dg}`,`g`),sub:[{type:`oper`,match:/^<\?/g}]},{type:`oper`,match:/\?+>$/g}]},{type:`var`,match:/&(#x?)?[\da-z]{1,8};/gi}]}),gg={};Ah(gg,{default:()=>_g});var _g,vg=kh(()=>{hg(),_g=[{type:`class`,match:/<!DOCTYPE("[^"]*"|'[^']*'|[^"'>])*>/gi,sub:[{type:`str`,match:/"[^"]*"|'[^']*'/g},{type:`oper`,match:/^<!|>$/g},{type:`var`,match:/DOCTYPE/gi}]},{match:RegExp(`<style${fg}>[^]*?</style\\s*>`,`g`),sub:[{match:RegExp(`^<style${fg}>`,`g`),sub:pg.sub},{match:RegExp(`${pg.match}|[^]*(?=</style\\s*>$)`,`g`),sub:`css`},pg]},{match:RegExp(`<script${fg}>[^]*?<\/script\\s*>`,`g`),sub:[{match:RegExp(`^<script${fg}>`,`g`),sub:pg.sub},{match:RegExp(`${pg.match}|[^]*(?=<\/script\\s*>$)`,`g`),sub:`js`},pg]},...mg]}),yg,bg,xg=kh(()=>{yg=[[`bash`,[/#!(\/usr)?\/bin\/bash/g,500],[/\b(if|elif|then|fi|echo)\b|\$/g,10]],[`html`,[/<\/?[a-z-]+[^\n>]*>/g,10],[/^\s+<!DOCTYPE\s+html/g,500]],[`http`,[/^(GET|HEAD|POST|PUT|DELETE|PATCH|HTTP)\b/g,500]],[`js`,[/\b(console|await|async|function|export|import|this|class|for|let|const|map|join|require|document|window)\b/g,10]],[`ts`,[/\b(console|await|async|function|export|import|this|class|for|let|const|map|join|require|document|window|implements|interface|namespace)\b/g,10]],[`py`,[/\b(def|print|await|async|class|and|or|lambda|import|from|self|asyncio|pass|True|False|None|__init__)\b/g,10]],[`sql`,[/\b(SELECT|INSERT|FROM)\b/g,50]],[`pl`,[/#!(\/usr)?\/bin\/perl/g,500],[/\b(use|print)\b|\$/g,10]],[`lua`,[/#!(\/usr)?\/bin\/lua/g,500]],[`make`,[/\b(ifneq|endif|if|elif|then|fi|echo|.PHONY|^[a-z]+ ?:$)\b|\$/gm,10]],[`uri`,[/https?:|mailto:|tel:|ftp:/g,30]],[`css`,[/^(@import|@page|@media|(\.|#)[a-z]+)/gm,20]],[`diff`,[/^[+><-]/gm,10],[/^@@ ?[-+,0-9 ]+ ?@@/gm,25]],[`md`,[/^(>|\t\*|\t\d+.)/gm,10],[/\[.*\](.*)/g,10]],[`docker`,[/^(FROM|ENTRYPOINT|RUN)/gm,500]],[`xml`,[/<\/?[a-z-]+[^\n>]*>/g,10],[/^<\?xml/g,500]],[`c`,[/#include\b|\bprintf\s+\(/g,100]],[`rs`,[/^\s+(use|fn|mut|match)\b/gm,100]],[`go`,[/\b(func|fmt|package)\b/g,100]],[`java`,[/^import\s+java/gm,500]],[`asm`,[/^(section|global main|extern|\t(call|mov|ret))/gm,100]],[`css`,[/^(@import|@page|@media|(\.|#)[a-z]+)/gm,20]],[`json`,[/\b(true|false|null|\{})\b|\"[^"]+\":/g,10]],[`yaml`,[/^(\s+)?[a-z][a-z0-9]*:/gim,10]]],bg=e=>yg.map(([t,...n])=>[t,n.reduce((t,[n,r])=>t+[...e.matchAll(n)].length*r,0)]).filter(([e,t])=>t>20).sort((e,t)=>t[1]-e[1])[0]?.[0]||`plain`}),Sg={};Ah(Sg,{default:()=>Cg});var Cg,wg=kh(()=>{xg(),Cg=[{type:`kwd`,match:/^(GET|HEAD|POST|PUT|DELETE|CONNECT|OPTIONS|TRACE|PATCH|PRI|SEARCH)\b/gm},{expand:`str`},{type:`section`,match:/\bHTTP\/[\d.]+\b/g},{expand:`num`},{type:`oper`,match:/[,;:=]/g},{type:`var`,match:/[a-zA-Z][\w-]*(?=:)/g},{match:/\n\n[^]*/g,sub:bg}]}),Tg={};Ah(Tg,{default:()=>Eg});var Eg,Dg=kh(()=>{Eg=[{match:/(^[ \f\t\v]*)[#;].*/gm,sub:`todo`},{type:`var`,match:/.*(?==)/g},{type:`section`,match:/^\s*\[.+\]\s*$/gm},{type:`oper`,match:/=/g},{type:`str`,match:/.*/g}]}),Og={};Ah(Og,{default:()=>kg});var kg,Ag=kh(()=>{kg=[{match:/\/\/.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,sub:`todo`},{expand:`str`},{expand:`num`},{type:`kwd`,match:/\b(abstract|assert|boolean|break|byte|case|catch|char|class|continue|const|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|package|private|protected|public|requires|return|short|static|strictfp|super|switch|synchronized|this|throw|throws|transient|try|var|void|volatile|while)\b/g},{type:`oper`,match:/[/*+:?&|%^~=!,<>.^-]+/g},{type:`func`,match:/[a-zA-Z_][\w_]*(?=\s*\()/g},{type:`class`,match:/\b[A-Z][\w_]*\b/g}]}),jg={};Ah(jg,{default:()=>Mg});var Mg,Ng=kh(()=>{Mg=[{match:/(("|')([^\r\n\\]|\\[^])*?\2|[a-zA-Z]\w*)(?=\s*:)/g},{match:/\/\*\*((?!\*\/)[^])*(\*\/)?/g,sub:`jsdoc`},{match:/\/\/.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,sub:`todo`},{expand:`str`},{match:/`((?!`)[^]|\\[^])*`?/g,sub:`js_template_literals`},{type:`kwd`,match:/=>|\b(this|set|get|as|async|await|break|case|catch|class|const|constructor|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|if|implements|import|in|instanceof|interface|let|var|of|new|package|private|protected|public|return|static|super|switch|throw|throws|try|typeof|void|while|with|yield)\b/g},{match:/\/((?!\/)[^\r\n\\]|\\.)+\/[dgimsuy]*/g,sub:`regex`},{expand:`num`},{type:`num`,match:/\b(NaN|null|undefined|[A-Z][A-Z_]*)\b/g},{type:`bool`,match:/\b(true|false)\b/g},{type:`oper`,match:/[/*+:?&|%^~=!,<>.^-]+/g},{type:`class`,match:/\b[A-Z][\w_]*\b/g},{type:`func`,match:/[a-zA-Z$_][\w$_]*(?=\s*((\?\.)?\s*\(|=\s*(\(?[\w,{}\[\])]+\)? =>|function\b)))/g}]}),Pg={};Ah(Pg,{default:()=>Fg,type:()=>Ig});var Fg,Ig,Lg=kh(()=>{Fg=[{match:new class{exec(e){let t=this.lastIndex,n,r=n=>{for(;++t<e.length-2;)if(e[t]==`{`)r();else if(e[t]==`}`)return};for(;t<e.length;++t)if(e[t-1]!=`\\`&&e[t]==`$`&&e[t+1]==`{`)return n=t++,r(t),this.lastIndex=t+1,{index:n,0:e.slice(n,t+1)};return null}},sub:[{type:`kwd`,match:/^\${|}$/g},{match:/(?!^\$|{)[^]+(?=}$)/g,sub:`js`}]}],Ig=`str`}),Rg={};Ah(Rg,{default:()=>zg,type:()=>Bg});var zg,Bg,Vg=kh(()=>{zg=[{type:`err`,match:/\b(TODO|FIXME|DEBUG|OPTIMIZE|WARNING|XXX|BUG)\b/g},{type:`class`,match:/\bIDEA\b/g},{type:`insert`,match:/\b(CHANGED|FIX|CHANGE)\b/g},{type:`oper`,match:/\bQUESTION\b/g}],Bg=`cmnt`}),Hg={};Ah(Hg,{default:()=>Ug,type:()=>Wg});var Ug,Wg,Gg=kh(()=>{Vg(),Ug=[{type:`kwd`,match:/@\w+/g},{type:`class`,match:/{[\w\s|<>,.@\[\]]+}/g},{type:`var`,match:/\[[\w\s="']+\]/g},...zg],Wg=`cmnt`}),Kg={};Ah(Kg,{default:()=>qg});var qg,Jg=kh(()=>{qg=[{type:`var`,match:/(("|')([^\r\n\\]|\\[^])*?\2|[a-zA-Z]\w*)(?=\s*:)/g},{expand:`str`},{expand:`num`},{type:`num`,match:/\bnull\b/g},{type:`bool`,match:/\b(true|false)\b/g}]}),Yg={};Ah(Yg,{default:()=>Xg});var Xg,Zg=kh(()=>{xg(),Xg=[{type:`cmnt`,match:/^>.*|(=|-)\1+/gm},{type:`class`,match:/\*\*.*?\*\*/g},{match:/^(`{3,})(.*)\n[^]*?^\1[ \t]*$/gm,sub:e=>({type:`kwd`,sub:[{match:/\n[^]*(?=```)/g,sub:e.split(`
|
|
600
|
+
`)[0].slice(3)||bg(e)}]})},{type:`str`,match:/`[^`]*`/g},{type:`var`,match:/~~.*?~~/g},{type:`kwd`,match:/\b_\S([^\n]*?\S)?_\b|\*\S([^\n]*?\S)?\*/g},{type:`kwd`,match:/^\s*(\*|\d+\.)\s/gm},{type:`func`,match:/\[[^\]]*]\([^)]*\)|<[^>]*>/g,sub:[{type:`oper`,match:/^\[[^\]]*]/g}]}]}),Qg={};Ah(Qg,{default:()=>$g});var $g,e_=kh(()=>{Zg(),xg(),$g=[{type:`insert`,match:/(leanpub-start-insert)((?!leanpub-end-insert)[^])*(leanpub-end-insert)?/g,sub:[{type:`insert`,match:/leanpub-(start|end)-insert/g},{match:/(?!leanpub-start-insert)((?!leanpub-end-insert)[^])*/g,sub:bg}]},{type:`deleted`,match:/(leanpub-start-delete)((?!leanpub-end-delete)[^])*(leanpub-end-delete)?/g,sub:[{type:`deleted`,match:/leanpub-(start|end)-delete/g},{match:/(?!leanpub-start-delete)((?!leanpub-end-delete)[^])*/g,sub:bg}]},...Xg]}),t_={};Ah(t_,{default:()=>n_});var n_,r_=kh(()=>{n_=[{type:`cmnt`,match:/^#.*/gm},{expand:`strDouble`},{expand:`num`},{type:`err`,match:/\b(err(or)?|[a-z_-]*exception|warn|warning|failed|ko|invalid|not ?found|alert|fatal)\b/gi},{type:`num`,match:/\b(null|undefined)\b/gi},{type:`bool`,match:/\b(false|true|yes|no)\b/gi},{type:`oper`,match:/\.|,/g}]}),i_={};Ah(i_,{default:()=>a_});var a_,o_=kh(()=>{a_=[{match:/^#!.*|--(\[(=*)\[[^]*?--\]\2\]|.*)/g,sub:`todo`},{expand:`str`},{type:`kwd`,match:/\b(and|break|do|else|elseif|end|for|function|if|in|local|not|or|repeat|return|then|until|while)\b/g},{type:`bool`,match:/\b(true|false|nil)\b/g},{type:`oper`,match:/[+*/%^#=~<>:,.-]+/g},{expand:`num`},{type:`func`,match:/[a-z_]+(?=\s*[({])/g}]}),s_={};Ah(s_,{default:()=>c_});var c_,l_=kh(()=>{c_=[{match:/^\s*#.*/gm,sub:`todo`},{expand:`str`},{type:`oper`,match:/[${}()]+/g},{type:`class`,match:/.PHONY:/gm},{type:`section`,match:/^[\w.]+:/gm},{type:`kwd`,match:/\b(ifneq|endif)\b/g},{expand:`num`},{type:`var`,match:/[A-Z_]+(?=\s*=)/g},{match:/^.*$/gm,sub:`bash`}]}),u_={};Ah(u_,{default:()=>d_});var d_,f_=kh(()=>{d_=[{match:/#.*/g,sub:`todo`},{type:`str`,match:/(["'])(\\[^]|(?!\1)[^])*\1?/g},{expand:`num`},{type:`kwd`,match:/\b(any|break|continue|default|delete|die|do|else|elsif|eval|for|foreach|given|goto|if|last|local|my|next|our|package|print|redo|require|return|say|state|sub|switch|undef|unless|until|use|when|while|not|and|or|xor)\b/g},{type:`oper`,match:/[-+*/%~!&<>|=?,]+/g},{type:`func`,match:/[a-z_]+(?=\s*\()/g}]}),p_={};Ah(p_,{default:()=>m_});var m_,h_=kh(()=>{m_=[{expand:`strDouble`}]}),g_={};Ah(g_,{default:()=>__});var __,v_=kh(()=>{__=[{match:/#.*/g,sub:`todo`},{type:`str`,match:/f("""|''')(\\[^]|(?!\1)[^])*\1?|f("|')(\\[^]|(?!\3).)*\3?/gi,sub:[{type:`var`,match:/{[^{}]*}/g,sub:[{match:/(?!^{)[^]*(?=}$)/g,sub:`py`}]}]},{match:/("""|''')(\\[^]|(?!\1)[^])*\1?/g,sub:`todo`},{expand:`str`},{type:`kwd`,match:/\b(and|as|assert|break|class|continue|def|del|elif|else|except|finally|for|from|global|if|import|in|is|lambda|nonlocal|not|or|pass|raise|return|try|while|with|yield)\b/g},{type:`bool`,match:/\b(False|True|None)\b/g},{expand:`num`},{type:`func`,match:/[a-z_]\w*(?=\s*\()/gi},{type:`oper`,match:/[-/*+<>,=!&|^%]+/g},{type:`class`,match:/\b[A-Z][\w_]*\b/g}]}),y_={};Ah(y_,{default:()=>b_,type:()=>x_});var b_,x_,S_=kh(()=>{b_=[{match:/^(?!\/).*/gm,sub:`todo`},{type:`num`,match:/\[((?!\])[^\\]|\\.)*\]/g},{type:`kwd`,match:/\||\^|\$|\\.|\w+($|\r|\n)/g},{type:`var`,match:/\*|\+|\{\d+,\d+\}/g}],x_=`oper`}),C_={};Ah(C_,{default:()=>w_});var w_,T_=kh(()=>{w_=[{match:/\/\/.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,sub:`todo`},{expand:`str`},{expand:`num`},{type:`kwd`,match:/\b(as|break|const|continue|crate|else|enum|extern|false|fn|for|if|impl|in|let|loop|match|mod|move|mut|pub|ref|return|self|Self|static|struct|super|trait|true|type|unsafe|use|where|while|async|await|dyn|abstract|become|box|do|final|macro|override|priv|typeof|unsized|virtual|yield|try)\b/g},{type:`oper`,match:/[/*+:?&|%^~=!,<>.^-]+/g},{type:`class`,match:/\b[A-Z][\w_]*\b/g},{type:`func`,match:/[a-zA-Z_][\w_]*(?=\s*!?\s*\()/g}]}),E_={};Ah(E_,{default:()=>D_});var D_,O_=kh(()=>{D_=[{match:/--.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,sub:`todo`},{expand:`str`},{type:`func`,match:/\b(AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/g},{type:`kwd`,match:/\b(ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:_INSERT|COL)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|kwdS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:S|ING)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/g},{type:`num`,match:/\.?\d[\d.oxa-fA-F-]*|\bNULL\b/g},{type:`bool`,match:/\b(TRUE|FALSE)\b/g},{type:`oper`,match:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|IN|ILIKE|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/g},{type:`var`,match:/@\S+/g}]}),k_={};Ah(k_,{default:()=>A_});var A_,j_=kh(()=>{A_=[{match:/#.*/g,sub:`todo`},{type:`str`,match:/("""|''')((?!\1)[^]|\\[^])*\1?/g},{expand:`str`},{type:`section`,match:/^\[.+\]\s*$/gm},{type:`num`,match:/\b(inf|nan)\b|\d[\d:ZT.-]*/g},{expand:`num`},{type:`bool`,match:/\b(true|false)\b/g},{type:`oper`,match:/[+,.=-]/g},{type:`var`,match:/\w+(?= \=)/g}]}),M_={};Ah(M_,{default:()=>N_});var N_,P_=kh(()=>{Ng(),N_=[{type:`type`,match:/:\s*(any|void|number|boolean|string|object|never|enum)\b/g},{type:`kwd`,match:/\b(type|namespace|typedef|interface|public|private|protected|implements|declare|abstract|readonly)\b/g},...Mg]}),F_={};Ah(F_,{default:()=>I_});var I_,L_=kh(()=>{I_=[{match:/^#.*/gm,sub:`todo`},{type:`class`,match:/^\w+(?=:?)/gm},{type:`num`,match:/:\d+/g},{type:`oper`,match:/[:/&?]|\w+=/g},{type:`func`,match:/[.\w]+@|#[\w]+$/gm},{type:`var`,match:/\w+\.\w+(\.\w+)*/g}]}),R_={};Ah(R_,{default:()=>z_});var z_,B_=kh(()=>{z_=[{match:/#.*/g,sub:`todo`},{expand:`str`},{type:`str`,match:/(>|\|)\r?\n((\s[^\n]*)?(\r?\n|$))*/g},{type:`type`,match:/!![a-z]+/g},{type:`bool`,match:/\b(Yes|No)\b/g},{type:`oper`,match:/[+:-]/g},{expand:`num`},{type:`var`,match:/[a-zA-Z]\w*(?=:)/g}]}),V_={num:{type:`num`,match:/(\.e?|\b)\d(e-|[\d.oxa-fA-F_])*(\.|\b)/g},str:{type:`str`,match:/(["'])(\\[^]|(?!\1)[^\r\n\\])*\1?/g},strDouble:{type:`str`,match:/"((?!")[^\r\n\\]|\\[^])*"?/g}},H_=Oh({"./languages/asm.js":()=>Promise.resolve().then(()=>(Nh(),jh)),"./languages/bash.js":()=>Promise.resolve().then(()=>(Lh(),Ph)),"./languages/bf.js":()=>Promise.resolve().then(()=>(Bh(),Rh)),"./languages/c.js":()=>Promise.resolve().then(()=>(Uh(),Vh)),"./languages/css.js":()=>Promise.resolve().then(()=>(Kh(),Wh)),"./languages/csv.js":()=>Promise.resolve().then(()=>(Yh(),qh)),"./languages/diff.js":()=>Promise.resolve().then(()=>(Qh(),Xh)),"./languages/docker.js":()=>Promise.resolve().then(()=>(tg(),$h)),"./languages/git.js":()=>Promise.resolve().then(()=>(ig(),ng)),"./languages/go.js":()=>Promise.resolve().then(()=>(sg(),ag)),"./languages/html.js":()=>Promise.resolve().then(()=>(vg(),gg)),"./languages/http.js":()=>Promise.resolve().then(()=>(wg(),Sg)),"./languages/ini.js":()=>Promise.resolve().then(()=>(Dg(),Tg)),"./languages/java.js":()=>Promise.resolve().then(()=>(Ag(),Og)),"./languages/js.js":()=>Promise.resolve().then(()=>(Ng(),jg)),"./languages/js_template_literals.js":()=>Promise.resolve().then(()=>(Lg(),Pg)),"./languages/jsdoc.js":()=>Promise.resolve().then(()=>(Gg(),Hg)),"./languages/json.js":()=>Promise.resolve().then(()=>(Jg(),Kg)),"./languages/leanpub-md.js":()=>Promise.resolve().then(()=>(e_(),Qg)),"./languages/log.js":()=>Promise.resolve().then(()=>(r_(),t_)),"./languages/lua.js":()=>Promise.resolve().then(()=>(o_(),i_)),"./languages/make.js":()=>Promise.resolve().then(()=>(l_(),s_)),"./languages/md.js":()=>Promise.resolve().then(()=>(Zg(),Yg)),"./languages/pl.js":()=>Promise.resolve().then(()=>(f_(),u_)),"./languages/plain.js":()=>Promise.resolve().then(()=>(h_(),p_)),"./languages/py.js":()=>Promise.resolve().then(()=>(v_(),g_)),"./languages/regex.js":()=>Promise.resolve().then(()=>(S_(),y_)),"./languages/rs.js":()=>Promise.resolve().then(()=>(T_(),C_)),"./languages/sql.js":()=>Promise.resolve().then(()=>(O_(),E_)),"./languages/todo.js":()=>Promise.resolve().then(()=>(Vg(),Rg)),"./languages/toml.js":()=>Promise.resolve().then(()=>(j_(),k_)),"./languages/ts.js":()=>Promise.resolve().then(()=>(P_(),M_)),"./languages/uri.js":()=>Promise.resolve().then(()=>(L_(),F_)),"./languages/xml.js":()=>Promise.resolve().then(()=>(hg(),cg)),"./languages/yaml.js":()=>Promise.resolve().then(()=>(B_(),R_))}),U_={},W_=(e=``)=>e.replaceAll(`&`,`&`).replaceAll?.(`<`,`<`).replaceAll?.(`>`,`>`),G_=(e,t)=>t?`<span class="shj-syn-${t}">${e}</span>`:e;async function K_(e,t,n){try{let r,i,a={},o,s=[],c=0,l=typeof t==`string`?await(U_[t]??(U_[t]=H_(`./languages/${t}.js`))):t,u=[...typeof t==`string`?l.default:t.sub];for(;c<e.length;){for(a.index=null,r=u.length;r-->0;){if(i=u[r].expand?V_[u[r].expand]:u[r],s[r]===void 0||s[r].match.index<c){if(i.match.lastIndex=c,o=i.match.exec(e),o===null){u.splice(r,1),s.splice(r,1);continue}s[r]={match:o,lastIndex:i.match.lastIndex}}s[r].match[0]&&(s[r].match.index<=a.index||a.index===null)&&(a={part:i,index:s[r].match.index,match:s[r].match[0],end:s[r].lastIndex})}if(a.index===null)break;n(e.slice(c,a.index),l.type),c=a.end,a.part.sub?await K_(a.match,typeof a.part.sub==`string`?a.part.sub:typeof a.part.sub==`function`?a.part.sub(a.match):a.part,n):n(a.match,a.part.type)}n(e.slice(c,e.length),l.type)}catch{n(e)}}async function q_(e,t,n=!0,r={}){let i=``;return await K_(e,t,(e,t)=>i+=G_(W_(e),t)),n?`<div><div class="shj-numbers">${`<div></div>`.repeat(!r.hideLineNumbers&&e.split(`
|
|
601
|
+
`).length)}</div><div>${i}</div></div>`:i}var J_=5e4,Y_={ts:`ts`,tsx:`ts`,mts:`ts`,cts:`ts`,js:`js`,jsx:`js`,mjs:`js`,cjs:`js`,py:`py`,rs:`rs`,go:`go`,java:`java`,lua:`lua`,pl:`pl`,c:`c`,h:`c`,cpp:`c`,cc:`c`,hpp:`c`,css:`css`,scss:`css`,html:`html`,htm:`html`,xml:`xml`,svg:`xml`,json:`json`,md:`md`,markdown:`md`,yml:`yaml`,yaml:`yaml`,toml:`toml`,ini:`ini`,sh:`bash`,bash:`bash`,zsh:`bash`,sql:`sql`,dockerfile:`docker`,makefile:`make`};function X_(e){let t=e.slice(e.lastIndexOf(`/`)+1).toLowerCase();return t===`dockerfile`?`docker`:t===`makefile`?`make`:Y_[t.slice(t.lastIndexOf(`.`)+1)]??`plain`}var Z_=`
|
|
602
|
+
.file-diff .shj-syn-cmnt { color: #6c7086; font-style: italic; }
|
|
603
|
+
.file-diff .shj-syn-kwd { color: #cba6f7; }
|
|
604
|
+
.file-diff .shj-syn-num { color: #fab387; }
|
|
605
|
+
.file-diff .shj-syn-bool { color: #fab387; }
|
|
606
|
+
.file-diff .shj-syn-str { color: #a6e3a1; }
|
|
607
|
+
.file-diff .shj-syn-func { color: #89b4fa; }
|
|
608
|
+
.file-diff .shj-syn-class { color: #f9e2af; }
|
|
609
|
+
.file-diff .shj-syn-section { color: #94e2d5; }
|
|
610
|
+
.file-diff .shj-syn-oper { color: #94e2d5; }
|
|
611
|
+
.file-diff .shj-syn-var { color: #cdd6f4; }
|
|
612
|
+
.file-diff .shj-syn-esc { color: #f5c2e7; }
|
|
613
|
+
.file-diff .shj-syn-err { color: #f38ba8; }
|
|
614
|
+
`;function Q_(e){let t=[],n=!1;for(let r of e.split(`
|
|
615
|
+
`)){if(r.startsWith(`@@`)){n=!0,t.push({kind:`hunk`,content:r,marker:``});continue}n&&(r.startsWith(`+`)?t.push({kind:`add`,content:r.slice(1),marker:`+`}):r.startsWith(`-`)?t.push({kind:`del`,content:r.slice(1),marker:`-`}):r.startsWith(` `)||r===``?t.push({kind:`ctx`,content:r.slice(1),marker:` `}):r.startsWith(`\\`)&&t.push({kind:`ctx`,content:r,marker:``}))}return t}var $_={add:`#a6e3a114`,del:`#f38ba814`,hunk:`transparent`,ctx:`transparent`},ev={add:`#a6e3a1`,del:`#f38ba8`,hunk:`#89b4fa`,ctx:`#45475a`};function tv({entry:e,path:t}){let n=(0,b.useMemo)(()=>e.patchText?Q_(e.patchText):[],[e.patchText]),r=(0,b.useMemo)(()=>X_(t),[t]),i=r!==`plain`&&n.length<=J_,[a,o]=(0,b.useState)(null);return(0,b.useEffect)(()=>{if(o(null),!i||n.length===0)return;let e=!1;return Promise.all(n.map(e=>e.kind===`hunk`||e.content.length===0?Promise.resolve(null):q_(e.content,r,!1).catch(()=>null))).then(t=>{e||o(t)}),()=>{e=!0}},[n,r,i]),e.loading?(0,y.jsx)(rv,{text:`Loading diff...`}):e.error?(0,y.jsx)(rv,{text:e.error,color:`#f38ba8`}):e.imageDiff?(0,y.jsx)(nv,{imageDiff:e.imageDiff,path:t}):e.isBinary?(0,y.jsx)(rv,{text:`Binary file`}):n.length===0?(0,y.jsx)(rv,{text:`No textual changes`}):(0,y.jsxs)(`div`,{className:`file-diff`,style:{margin:`2px 0 6px 24px`,border:`1px solid #313244`,borderRadius:6,background:`#11111b`,overflow:`auto`,maxHeight:420,fontSize:11,fontFamily:`monospace`,lineHeight:1.5},children:[(0,y.jsx)(`style`,{children:Z_}),(0,y.jsx)(`div`,{style:{minWidth:`fit-content`},children:n.map((e,t)=>{let n=a?.[t]??null;return(0,y.jsxs)(`div`,{style:{display:`flex`,background:$_[e.kind],color:e.kind===`hunk`?`#89b4fa`:`#cdd6f4`,whiteSpace:`pre`},children:[(0,y.jsx)(`span`,{style:{flexShrink:0,width:16,textAlign:`center`,color:ev[e.kind],userSelect:`none`},children:e.marker}),n===null?(0,y.jsx)(`span`,{children:e.content}):(0,y.jsx)(`span`,{dangerouslySetInnerHTML:{__html:n}})]},t)})})]})}function nv({imageDiff:e,path:t}){let n=[];return e.before&&n.push({label:e.after?`Before`:`Deleted image`,preview:e.before}),e.after&&n.push({label:e.before?`After`:`Added image`,preview:e.after}),(0,y.jsx)(`div`,{style:{margin:`2px 0 6px 24px`,padding:10,display:`flex`,flexWrap:`wrap`,gap:10,border:`1px solid #313244`,borderRadius:6,background:`#11111b`,overflow:`auto`,maxHeight:520},children:n.map(({label:e,preview:n})=>(0,y.jsxs)(`figure`,{style:{flex:`1 1 220px`,minWidth:0,margin:0,display:`flex`,flexDirection:`column`,gap:6},children:[(0,y.jsx)(`figcaption`,{style:{color:`#a6adc8`,fontSize:10,fontWeight:700,letterSpacing:`0.08em`,textTransform:`uppercase`},children:e}),(0,y.jsx)(`div`,{style:{minHeight:80,padding:8,display:`flex`,alignItems:`center`,justifyContent:`center`,borderRadius:4,backgroundColor:`#181825`,backgroundImage:[`linear-gradient(45deg, #242435 25%, transparent 25%)`,`linear-gradient(-45deg, #242435 25%, transparent 25%)`,`linear-gradient(45deg, transparent 75%, #242435 75%)`,`linear-gradient(-45deg, transparent 75%, #242435 75%)`].join(`,`),backgroundPosition:`0 0, 0 8px, 8px -8px, -8px 0`,backgroundSize:`16px 16px`},children:(0,y.jsx)(`img`,{src:n.dataUrl,alt:`${t} ${e.toLowerCase()}`,draggable:!1,style:{display:`block`,maxWidth:`100%`,maxHeight:410,objectFit:`contain`}})})]},e))})}function rv({text:e,color:t}){return(0,y.jsx)(`div`,{style:{margin:`2px 0 6px 24px`,padding:`6px 10px`,fontSize:11,color:t??`#6c7086`,border:`1px solid #313244`,borderRadius:6,background:`#11111b`},children:e})}function iv(e,t,n){let r={top:t.bottom-n.height,right:t.right,bottom:t.bottom,left:t.right-n.width};return e.left<r.right&&e.right>r.left&&e.top<r.bottom&&e.bottom>r.top}var av={success:`#a6e3a1`,failure:`#f38ba8`,error:`#f38ba8`,pending:`#f9e2af`,neutral:`#6c7086`},ov={success:`✓`,failure:`✗`,error:`✗`,pending:`◔`,neutral:`–`},sv={A:`#a6e3a1`,M:`#f9e2af`,D:`#f38ba8`,R:`#cba6f7`,C:`#94e2d5`,T:`#89b4fa`,U:`#fab387`},cv={A:`A`,M:`M`,D:`D`,R:`R`,C:`C`,T:`T`,U:`U`};function lv(e){return new Date(e*1e3).toLocaleString(void 0,{year:`numeric`,month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}function uv({commit:e,diff:t,branchName:n,prs:r,authorAvatarUrl:i,ciState:a,ciRuns:o,githubUrl:s,onCheckout:c,onNavigate:l}){let u=(0,b.useRef)(null),[d,f]=(0,b.useState)(`bottom`),p=(0,b.useCallback)(()=>{let t=u.current;if(!e||!t)return;let n=document.querySelector(`[data-commit-sha="${e.sha}"]`),r=t.parentElement;if(!n||!r){f(`bottom`);return}let i=n.getBoundingClientRect(),a=r.getBoundingClientRect(),o=t.getBoundingClientRect();f(iv(i,a,o)?`top`:`bottom`)},[e]);if((0,b.useLayoutEffect)(()=>{if(!e||!u.current)return;p();let t=new ResizeObserver(p);return t.observe(u.current),window.addEventListener(`resize`,p),document.addEventListener(`scroll`,p,!0),()=>{t.disconnect(),window.removeEventListener(`resize`,p),document.removeEventListener(`scroll`,p,!0)}},[e,p]),!e)return null;let m=e.sha.slice(0,12);return(0,y.jsxs)(`div`,{ref:u,"data-testid":`commit-detail`,style:{position:`absolute`,right:0,[d]:0,zIndex:40,width:400,height:`fit-content`,maxHeight:`100%`,background:`#181825`,borderLeft:`1px solid #313244`,borderTop:`1px solid #313244`,display:`flex`,flexDirection:`column`,overflow:`hidden`},children:[(0,y.jsxs)(`div`,{style:{padding:`14px 16px 12px`,borderBottom:`1px solid #313244`,flexShrink:0},children:[(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:8},children:[(0,y.jsx)(`span`,{style:{fontFamily:`monospace`,fontSize:11,color:`#89b4fa`,letterSpacing:`0.04em`},children:m}),l&&(0,y.jsx)(gv,{label:`Navigate to`,onClick:()=>l(e.sha)}),c&&(0,y.jsx)(gv,{label:`Checkout`,onClick:()=>c(e.sha)})]}),(0,y.jsx)(`p`,{style:{fontSize:14,fontWeight:600,color:`#cdd6f4`,lineHeight:1.4,margin:0,marginBottom:10},children:e.subject}),(0,y.jsx)(dv,{label:`Author`,value:`${e.authorName} <${e.authorEmail}>`,leading:(0,y.jsx)(fv,{name:e.authorName,url:i})}),(0,y.jsx)(dv,{label:`Date`,value:lv(e.authorUnix)}),n&&(0,y.jsx)(dv,{label:`Branch`,value:n}),(e.committerName!==e.authorName||e.committerUnix!==e.authorUnix)&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(dv,{label:`Committer`,value:`${e.committerName} <${e.committerEmail}>`}),(0,y.jsx)(dv,{label:`Commit date`,value:lv(e.committerUnix)})]}),e.parents.length>0&&(0,y.jsxs)(`div`,{style:{display:`flex`,gap:8,marginBottom:3,fontSize:12},children:[(0,y.jsx)(`span`,{style:{color:`#6c7086`,minWidth:76,flexShrink:0},children:`Parents`}),(0,y.jsx)(`span`,{style:{display:`flex`,gap:4,flexWrap:`wrap`},children:e.parents.map(e=>(0,y.jsx)(`span`,{onClick:()=>l?.(e),style:{fontFamily:`monospace`,color:`#89b4fa`,cursor:l?`pointer`:`default`,textDecoration:l?`underline`:`none`},children:e.slice(0,8)},e))})]}),e.parents.length>1&&(0,y.jsxs)(`div`,{style:{fontSize:12,color:`#a6adc8`,marginBottom:3},children:[(0,y.jsx)(`span`,{style:{color:`#6c7086`},children:`Merge: `}),`merged into`,` `,(0,y.jsx)(`span`,{onClick:()=>l?.(e.parents[0]),style:{color:`#89b4fa`,cursor:`pointer`,textDecoration:`underline`,fontFamily:`monospace`},children:e.parents[0].slice(0,8)}),` `,`from`,` `,(0,y.jsx)(`span`,{onClick:()=>l?.(e.parents[1]),style:{color:`#a6e3a1`,cursor:`pointer`,textDecoration:`underline`,fontFamily:`monospace`},children:e.parents[1].slice(0,8)})]}),r&&r.length>0&&(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,flexWrap:`wrap`,gap:4,marginTop:6,marginBottom:4},children:[(0,y.jsx)(`span`,{style:{color:`#6c7086`,fontSize:12,marginRight:4},children:r.length===1?`Pull request`:`Pull requests`}),r.map(e=>(0,y.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`Open pull request #${e.number}: ${e.title}`,title:`Open pull request #${e.number}: ${e.title}`,style:{color:e.mergedAt?`#a6e3a1`:`#89b4fa`,fontSize:12,textDecoration:`underline`},children:[`PR #`,e.number,` ↗`,e.title?`: ${e.title.length>40?`${e.title.slice(0,40)}…`:e.title}`:``]},e.number))]}),s&&e.isPushed&&(0,y.jsxs)(`div`,{style:{marginTop:4,marginBottom:4,display:`flex`,gap:12},children:[(0,y.jsx)(`a`,{href:`${s}/commit/${e.sha}`,target:`_blank`,rel:`noopener noreferrer`,style:{fontSize:11,color:`#6c7086`,textDecoration:`underline`},children:`View on GitHub`}),(0,y.jsx)(`a`,{href:`${s}/commit/${e.sha}/checks`,target:`_blank`,rel:`noopener noreferrer`,style:{fontSize:11,color:`#6c7086`,textDecoration:`underline`},children:`CI runs`})]}),a===`loading`&&(0,y.jsx)(`div`,{style:{marginTop:8},children:(0,y.jsx)(hv,{})}),o&&o.length>0&&(0,y.jsx)(`div`,{style:{marginTop:8,display:`flex`,flexDirection:`column`,gap:3},children:o.map((e,t)=>(0,y.jsx)(mv,{run:e},`${e.name}-${t}`))}),e.refs.length>0&&(0,y.jsx)(`div`,{style:{marginTop:8,display:`flex`,flexWrap:`wrap`,gap:4},children:e.refs.map(e=>(0,y.jsx)(`span`,{style:{background:`#313244`,color:`#89b4fa`,fontSize:11,borderRadius:4,padding:`2px 6px`,fontWeight:500},children:e},e))})]}),e.body&&(0,y.jsx)(`div`,{style:{padding:`10px 16px`,borderBottom:`1px solid #313244`,flexShrink:0,maxHeight:200,overflowY:`auto`},children:(0,y.jsx)(`pre`,{style:{fontSize:12,color:`#a6adc8`,whiteSpace:`pre-wrap`,wordBreak:`break-word`,fontFamily:`inherit`,margin:0,lineHeight:1.5},children:e.body})}),(0,y.jsx)(`div`,{style:{flex:`1 1 auto`,minHeight:0,overflowY:`auto`},children:t&&t.changedPaths.length>0?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:12,padding:`8px 16px 4px`,fontSize:11,fontWeight:700,letterSpacing:`0.08em`,color:`#6c7086`,textTransform:`uppercase`,position:`sticky`,top:0,background:`#181825`},children:[(0,y.jsxs)(`span`,{children:[`Changed files (`,t.changedPaths.length,`)`]}),(0,y.jsxs)(`span`,{style:{display:`flex`,gap:10,fontSize:10,letterSpacing:`0.04em`},children:[(0,y.jsxs)(`span`,{style:{color:`#a6e3a1`},children:[`+`,t.additions]}),(0,y.jsxs)(`span`,{style:{color:`#f38ba8`},children:[`-`,t.deletions]})]})]}),t.changedPaths.map((t,n)=>(0,y.jsx)(pv,{sha:e.sha,cp:t},`${t.status}:${t.oldPath??``}:${t.path}:${n}`))]}):t?(0,y.jsx)(`div`,{style:{padding:`16px`,fontSize:13,color:`#45475a`},children:`No changed files`}):null})]})}function dv({label:e,value:t,mono:n,leading:r}){return(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:r?`center`:void 0,gap:8,marginBottom:3,fontSize:12},children:[(0,y.jsx)(`span`,{style:{color:`#6c7086`,minWidth:76,flexShrink:0},children:e}),(0,y.jsxs)(`span`,{style:{display:`flex`,alignItems:`center`,gap:7,minWidth:0,color:`#a6adc8`,fontFamily:n?`monospace`:`inherit`},children:[r,(0,y.jsx)(`span`,{style:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:t})]})]})}function fv({name:e,url:t}){let[n,r]=(0,b.useState)(!1);(0,b.useEffect)(()=>r(!1),[t]);let i={width:24,height:24,borderRadius:`50%`,flexShrink:0};return t&&!n?(0,y.jsx)(`img`,{src:t,alt:`${e} avatar`,width:24,height:24,onError:()=>r(!0),style:{...i,display:`block`,objectFit:`cover`,background:`#313244`}}):(0,y.jsx)(`span`,{"aria-hidden":`true`,style:{...i,display:`inline-flex`,alignItems:`center`,justifyContent:`center`,background:`#313244`,color:`#cdd6f4`,fontSize:11,fontWeight:700},children:e.trim().charAt(0).toUpperCase()||`?`})}function pv({sha:e,cp:t}){let[n,r]=(0,b.useState)(!1),i=I(e=>e.loadCommitFileDiff),a=I(n=>n.commitFileDiffs[Wr(e,t.path)]),o=sv[t.status]??`#cdd6f4`,s=cv[t.status]??t.status,c=t.oldPath?`${t.oldPath} → ${t.path}`:t.path;return(0,b.useEffect)(()=>{n&&!a&&i(e,t)},[n,a,e,t,i]),(0,y.jsxs)(`div`,{children:[(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,padding:`5px 16px`,fontSize:12,color:`#cdd6f4`,borderBottom:`1px solid #1e1e2e`,cursor:`pointer`},onClick:()=>{let a=!n;r(a),a&&i(e,t)},onMouseEnter:e=>{e.currentTarget.style.background=`#1e1e2e`},onMouseLeave:e=>{e.currentTarget.style.background=`transparent`},children:[(0,y.jsx)(`span`,{style:{flexShrink:0,width:10,fontSize:9,color:`#6c7086`,userSelect:`none`},children:n?`▼`:`▶`}),(0,y.jsx)(`span`,{style:{flexShrink:0,width:18,height:18,borderRadius:3,background:o+`33`,color:o,display:`flex`,alignItems:`center`,justifyContent:`center`,fontSize:10,fontWeight:700},children:s}),(0,y.jsx)(`span`,{style:{flex:1,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,fontFamily:`monospace`,fontSize:12,color:`#a6adc8`},title:c,children:c})]}),n&&a&&(0,y.jsx)(tv,{entry:a,path:t.path})]})}function mv({run:e}){let t=av[e.state],n=ov[e.state],r=(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`span`,{style:{color:t,fontSize:12,fontWeight:700,width:12,textAlign:`center`,flexShrink:0},children:n}),(0,y.jsx)(`span`,{style:{color:`#cdd6f4`,fontWeight:500,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,flexShrink:0,maxWidth:`55%`},children:e.name}),e.description&&(0,y.jsx)(`span`,{style:{color:`#6c7086`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,flex:1},children:e.description})]}),i={display:`flex`,alignItems:`center`,gap:8,fontSize:12,padding:`2px 0`,textDecoration:`none`};return e.url?(0,y.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,style:i,title:e.description??e.name,children:r}):(0,y.jsx)(`div`,{style:i,title:e.description??e.name,children:r})}function hv(){return(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,fontSize:12,padding:`2px 0`,color:`#6c7086`},title:`Loading CI status`,children:[(0,y.jsx)(`span`,{style:{width:10,height:10,borderRadius:`50%`,border:`2px solid #45475a`,borderTopColor:`#89b4fa`,flexShrink:0,animation:`ci-spin 0.8s linear infinite`}}),(0,y.jsx)(`span`,{style:{color:`#cdd6f4`,fontWeight:500},children:`CI status`}),(0,y.jsx)(`span`,{children:`Loading...`}),(0,y.jsx)(`style`,{children:`@keyframes ci-spin { to { transform: rotate(360deg); } }`})]})}function gv({label:e,onClick:t}){return(0,y.jsx)(`button`,{onClick:t,title:e,style:{background:`#313244`,border:`1px solid #45475a`,borderRadius:4,color:`#cdd6f4`,fontSize:11,padding:`2px 8px`,cursor:`pointer`,fontFamily:`inherit`},onMouseEnter:e=>{e.currentTarget.style.background=`#45475a`},onMouseLeave:e=>{e.currentTarget.style.background=`#313244`},children:e})}function _v({state:e,onClose:t}){let n=(0,b.useRef)(null),r=(0,b.useRef)(null);(0,b.useEffect)(()=>{let t=n.current;t&&(e?t.open||t.showModal():t.open&&t.close())},[e]),(0,b.useEffect)(()=>{let e=r.current;e&&(e.scrollTop=e.scrollHeight)},[e?.output]);let i=!!e&&!e.running;return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`style`,{children:`.ingit-install-output-dialog::backdrop { background: rgba(10, 10, 18, 0.76); backdrop-filter: blur(2px); }`}),(0,y.jsx)(`dialog`,{ref:n,className:`ingit-install-output-dialog`,"aria-labelledby":`install-output-dialog-title`,onCancel:e=>{i?t():e.preventDefault()},onClose:()=>{i&&t()},style:{position:`fixed`,inset:0,margin:`auto`,width:`min(680px, calc(100vw - 32px))`,padding:0,border:`1px solid ${e?.error?`#8b3a4a`:`#45475a`}`,borderRadius:9,background:`#1e1e2e`,color:`#cdd6f4`,boxShadow:`0 22px 64px rgba(0,0,0,0.62)`},children:e&&(0,y.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,fontFamily:`system-ui, -apple-system, sans-serif`},children:[(0,y.jsxs)(`div`,{style:{padding:`16px 18px 12px`,borderBottom:`1px solid #313244`},children:[(0,y.jsxs)(`h2`,{id:`install-output-dialog-title`,style:{margin:0,color:`#f5e0dc`,fontSize:16},children:[`Resolving `,e.path.split(`/`).at(-1)]}),(0,y.jsx)(`div`,{style:{marginTop:5,color:`#a6adc8`,fontSize:12},children:e.command?`$ ${e.command}`:`Starting package manager…`})]}),(0,y.jsx)(`pre`,{ref:r,"aria-live":`polite`,"aria-label":`Package manager output`,style:{boxSizing:`border-box`,width:`100%`,minHeight:240,maxHeight:`min(420px, calc(100vh - 220px))`,margin:0,padding:16,overflow:`auto`,background:`#11111b`,color:`#cdd6f4`,fontSize:12,lineHeight:1.5,whiteSpace:`pre-wrap`,overflowWrap:`anywhere`},children:e.output||`Waiting for output…`}),(0,y.jsxs)(`div`,{style:{minHeight:54,padding:`11px 16px`,borderTop:`1px solid #313244`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:12},children:[(0,y.jsx)(`span`,{style:{color:e.error?`#f5a6b8`:`#a6e3a1`,fontSize:12,fontWeight:700},children:e.running?`● Install running…`:e.error??``}),!e.running&&(0,y.jsx)(`button`,{type:`button`,onClick:t,style:{height:30,padding:`0 12px`,borderRadius:6,border:`1px solid #45475a`,background:`#181825`,color:`#bac2de`,fontSize:12,fontWeight:700,fontFamily:`inherit`,cursor:`pointer`},children:`Close`})]})]})})]})}function vv(e){let t=[],n=``,r=!1,i=null,a=()=>{r&&=(t.push(n),n=``,!1)};for(let t=0;t<e.length;t+=1){let o=e[t];if(i===`'`){o===`'`?i=null:n+=o,r=!0;continue}if(i===`"`){if(o===`"`)i=null;else if(o===`\\`){let r=e[t+1];r===`"`||r===`\\`?(n+=r,t+=1):n+=o}else n+=o;r=!0;continue}if(/\s/.test(o)){a();continue}if(o===`'`||o===`"`){i=o,r=!0;continue}if(o===`\\`){let i=e[t+1];if(i!==void 0&&(/\s/.test(i)||i===`'`||i===`"`||i===`\\`)){n+=i,r=!0,t+=1;continue}}n+=o,r=!0}return i===null?(a(),t.length>0?t:null):null}var yv=class extends Error{issues;data;constructor(e){super(e.message,e),this.issues=e.issues,this.data=e.data}};function bv(e,t){return{...e,...t}}var xv=class{"~orpc";constructor(e){if(e.route?.successStatus&&We(e.route.successStatus))throw Error(`[ContractProcedure] Invalid successStatus.`);if(Object.values(e.errorMap).some(e=>e&&e.status&&!We(e.status)))throw Error(`[ContractProcedure] Invalid error status code.`);this[`~orpc`]=e}};function Sv(e){return e instanceof xv||(typeof e==`object`||typeof e==`function`)&&e!==null&&`~orpc`in e&&typeof e[`~orpc`]==`object`&&e[`~orpc`]!==null&&`errorMap`in e[`~orpc`]&&`route`in e[`~orpc`]&&`meta`in e[`~orpc`]}function Cv(e,t){return{...e,...t}}function wv(e,t){return{...e,...t}}function Tv(e,t){return e.path?{...e,path:`${t}${e.path}`}:e}function Ev(e,t){return{...e,tags:[...t,...e.tags??[]]}}function Dv(e,t){return e?`${e}${t}`:t}function Ov(e,t){return e?[...e,...t]:t}function kv(e,t){let n=e;return t.prefix&&(n=Tv(n,t.prefix)),t.tags?.length&&(n=Ev(n,t.tags)),n}function Av(e,t){if(Sv(e))return new xv({...e[`~orpc`],errorMap:bv(t.errorMap,e[`~orpc`].errorMap),route:kv(e[`~orpc`].route,t)});if(typeof e!=`object`||!e)return e;let n={};for(let r in e)n[r]=Av(e[r],t);return n}var jv=new class e extends xv{constructor(e){super(e),this[`~orpc`].prefix=e.prefix,this[`~orpc`].tags=e.tags}$meta(t){return new e({...this[`~orpc`],meta:t})}$route(t){return new e({...this[`~orpc`],route:t})}$input(t){return new e({...this[`~orpc`],inputSchema:t})}errors(t){return new e({...this[`~orpc`],errorMap:bv(this[`~orpc`].errorMap,t)})}meta(t){return new e({...this[`~orpc`],meta:Cv(this[`~orpc`].meta,t)})}route(t){return new e({...this[`~orpc`],route:wv(this[`~orpc`].route,t)})}input(t){return new e({...this[`~orpc`],inputSchema:t})}output(t){return new e({...this[`~orpc`],outputSchema:t})}prefix(t){return new e({...this[`~orpc`],prefix:Dv(this[`~orpc`].prefix,t)})}tag(...t){return new e({...this[`~orpc`],tags:Ov(this[`~orpc`].tags,t)})}router(e){return Av(e,this[`~orpc`])}}({errorMap:{},route:{},meta:{}}),Mv=Symbol(`ORPC_EVENT_ITERATOR_DETAILS`);function Nv(e,t){return{"~standard":{[Mv]:{yields:e,returns:t},vendor:`orpc`,version:1,validate(n){return xe(n)?{value:ot(n,{async value(n,r){let i=r?t:e;if(!i)return n;let a=await i[`~standard`].validate(n);if(a.issues)throw new He(`EVENT_ITERATOR_VALIDATION_FAILED`,{message:`Event iterator validation failed`,cause:new yv({issues:a.issues,message:`Event iterator validation failed`,data:n})});return a.value},error:async e=>e})}:{issues:[{message:`Expect event iterator`,path:[]}]}}}}}var Pv;function q(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}var Fv=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Iv=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(Pv=globalThis).__zod_globalConfig??(Pv.__zod_globalConfig={});var Lv=globalThis.__zod_globalConfig;function Rv(e){return e&&Object.assign(Lv,e),Lv}function zv(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function Bv(e,t){return typeof t==`bigint`?t.toString():t}function Vv(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}throw Error(`cached value already set`)}}}function Hv(e){return e==null}function Uv(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function Wv(e,t){let n=e/t,r=Math.round(n),i=2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}var Gv=Symbol(`evaluating`);function Kv(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Gv)return r===void 0&&(r=Gv,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function qv(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Jv(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function Yv(e){return JSON.stringify(e)}function Xv(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var Zv=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function Qv(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var $v=Vv(()=>{if(Lv.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function ey(e){if(Qv(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(Qv(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function ty(e){return ey(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var ny=new Set([`string`,`number`,`symbol`]);function ry(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function iy(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function J(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function ay(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var oy={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function sy(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return iy(e,Jv(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return qv(this,`shape`,e),e},checks:[]}))}function cy(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return iy(e,Jv(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return qv(this,`shape`,r),r},checks:[]}))}function ly(e,t){if(!ey(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return iy(e,Jv(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return qv(this,`shape`,n),n}}))}function uy(e,t){if(!ey(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return iy(e,Jv(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return qv(this,`shape`,n),n}}))}function dy(e,t){if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return iy(e,Jv(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return qv(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function fy(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return iy(t,Jv(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return qv(this,`shape`,i),i},checks:[]}))}function py(e,t,n){return iy(t,Jv(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return qv(this,`shape`,i),i}}))}function my(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function hy(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function gy(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function _y(e){return typeof e==`string`?e:e?.message}function vy(e,t,n){let r=e.message?e.message:_y(e.inst?._zod.def?.error?.(e))??_y(t?.error?.(e))??_y(n.customError?.(e))??_y(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??=[],s.message=r,t?.reportInput&&(s.input=o),s}function yy(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function by(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var xy=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Bv,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Sy=q(`$ZodError`,xy),Cy=q(`$ZodError`,xy,{Parent:Error});function wy(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Ty(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i];i===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(a))):r[n]=r[n]||{_errors:[]},r=r[n],i++}}}};return r(e),n}var Ey=e=>(t,n,r,i)=>{let a=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new Fv;if(o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>vy(e,a,Rv())));throw Zv(t,i?.callee),t}return o.value},Dy=e=>async(t,n,r,i)=>{let a=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>vy(e,a,Rv())));throw Zv(t,i?.callee),t}return o.value},Oy=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new Fv;return a.issues.length?{success:!1,error:new(e??Sy)(a.issues.map(e=>vy(e,i,Rv())))}:{success:!0,data:a.value}},ky=Oy(Cy),Ay=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>vy(e,i,Rv())))}:{success:!0,data:a.value}},jy=Ay(Cy),My=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Ey(e)(t,n,i)},Ny=e=>(t,n,r)=>Ey(e)(t,n,r),Py=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Dy(e)(t,n,i)},Fy=e=>async(t,n,r)=>Dy(e)(t,n,r),Iy=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Oy(e)(t,n,i)},Ly=e=>(t,n,r)=>Oy(e)(t,n,r),Ry=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Ay(e)(t,n,i)},zy=e=>async(t,n,r)=>Ay(e)(t,n,r),By=/^[cC][0-9a-z]{6,}$/,Vy=/^[0-9a-z]+$/,Hy=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Uy=/^[0-9a-vA-V]{20}$/,Wy=/^[A-Za-z0-9]{27}$/,Gy=/^[a-zA-Z0-9_-]{21}$/,Ky=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,qy=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Jy=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Yy=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Xy=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function Zy(){return new RegExp(Xy,`u`)}var Qy=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,$y=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,eb=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,tb=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,nb=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,rb=/^[A-Za-z0-9_-]*$/,ib=/^https?$/,ab=/^\+[1-9]\d{6,14}$/,ob=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,sb=RegExp(`^${ob}$`);function cb(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function lb(e){return RegExp(`^${cb(e)}$`)}function ub(e){let t=cb({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${ob}T(?:${r})$`)}var db=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},fb=/^-?\d+$/,pb=/^-?\d+(?:\.\d+)?$/,mb=/^(?:true|false)$/i,hb=/^[^A-Z]*$/,gb=/^[^a-z]*$/,_b=q(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),vb={number:`number`,bigint:`bigint`,object:`date`},yb=q(`$ZodCheckLessThan`,(e,t)=>{_b.init(e,t);let n=vb[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),bb=q(`$ZodCheckGreaterThan`,(e,t)=>{_b.init(e,t);let n=vb[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),xb=q(`$ZodCheckMultipleOf`,(e,t)=>{_b.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):Wv(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Sb=q(`$ZodCheckNumberFormat`,(e,t)=>{_b.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=oy[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=fb)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),Cb=q(`$ZodCheckMaxLength`,(e,t)=>{var n;_b.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Hv(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=yy(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),wb=q(`$ZodCheckMinLength`,(e,t)=>{var n;_b.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Hv(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=yy(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Tb=q(`$ZodCheckLengthEquals`,(e,t)=>{var n;_b.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Hv(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=yy(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Eb=q(`$ZodCheckStringFormat`,(e,t)=>{var n,r;_b.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Db=q(`$ZodCheckRegex`,(e,t)=>{Eb.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Ob=q(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=hb,Eb.init(e,t)}),kb=q(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=gb,Eb.init(e,t)}),Ab=q(`$ZodCheckIncludes`,(e,t)=>{_b.init(e,t);let n=ry(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),jb=q(`$ZodCheckStartsWith`,(e,t)=>{_b.init(e,t);let n=RegExp(`^${ry(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Mb=q(`$ZodCheckEndsWith`,(e,t)=>{_b.init(e,t);let n=RegExp(`.*${ry(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Nb=q(`$ZodCheckOverwrite`,(e,t)=>{_b.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),Pb=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
616
|
+
`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
|
|
617
|
+
`))}},Fb={major:4,minor:4,patch:3},Ib=q(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Fb;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=my(e),i;for(let a of t){if(a._zod.def.when){if(hy(e)||!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new Fv;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=my(e,t))});else{if(e.issues.length===t)continue;r||=my(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(my(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new Fv;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new Fv;return o.then(e=>t(e,r,a))}return t(o,r,a)}}Kv(e,`~standard`,()=>({validate:t=>{try{let n=ky(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return jy(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),Lb=q(`$ZodString`,(e,t)=>{Ib.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??db(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),Rb=q(`$ZodStringFormat`,(e,t)=>{Eb.init(e,t),Lb.init(e,t)}),zb=q(`$ZodGUID`,(e,t)=>{t.pattern??=qy,Rb.init(e,t)}),Bb=q(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=Jy(e)}else t.pattern??=Jy();Rb.init(e,t)}),Vb=q(`$ZodEmail`,(e,t)=>{t.pattern??=Yy,Rb.init(e,t)}),Hb=q(`$ZodURL`,(e,t)=>{Rb.init(e,t),e._zod.check=n=>{try{let r=n.value.trim();if(!t.normalize&&t.protocol?.source===ib.source&&!/^https?:\/\//i.test(r)){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}let i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Ub=q(`$ZodEmoji`,(e,t)=>{t.pattern??=Zy(),Rb.init(e,t)}),Wb=q(`$ZodNanoID`,(e,t)=>{t.pattern??=Gy,Rb.init(e,t)}),Gb=q(`$ZodCUID`,(e,t)=>{t.pattern??=By,Rb.init(e,t)}),Kb=q(`$ZodCUID2`,(e,t)=>{t.pattern??=Vy,Rb.init(e,t)}),qb=q(`$ZodULID`,(e,t)=>{t.pattern??=Hy,Rb.init(e,t)}),Jb=q(`$ZodXID`,(e,t)=>{t.pattern??=Uy,Rb.init(e,t)}),Yb=q(`$ZodKSUID`,(e,t)=>{t.pattern??=Wy,Rb.init(e,t)}),Xb=q(`$ZodISODateTime`,(e,t)=>{t.pattern??=ub(t),Rb.init(e,t)}),Zb=q(`$ZodISODate`,(e,t)=>{t.pattern??=sb,Rb.init(e,t)}),Qb=q(`$ZodISOTime`,(e,t)=>{t.pattern??=lb(t),Rb.init(e,t)}),$b=q(`$ZodISODuration`,(e,t)=>{t.pattern??=Ky,Rb.init(e,t)}),ex=q(`$ZodIPv4`,(e,t)=>{t.pattern??=Qy,Rb.init(e,t),e._zod.bag.format=`ipv4`}),tx=q(`$ZodIPv6`,(e,t)=>{t.pattern??=$y,Rb.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),nx=q(`$ZodCIDRv4`,(e,t)=>{t.pattern??=eb,Rb.init(e,t)}),rx=q(`$ZodCIDRv6`,(e,t)=>{t.pattern??=tb,Rb.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function ix(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var ax=q(`$ZodBase64`,(e,t)=>{t.pattern??=nb,Rb.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{ix(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function ox(e){if(!rb.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return ix(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var sx=q(`$ZodBase64URL`,(e,t)=>{t.pattern??=rb,Rb.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{ox(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),cx=q(`$ZodE164`,(e,t)=>{t.pattern??=ab,Rb.init(e,t)});function lx(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var ux=q(`$ZodJWT`,(e,t)=>{Rb.init(e,t),e._zod.check=n=>{lx(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),dx=q(`$ZodNumber`,(e,t)=>{Ib.init(e,t),e._zod.pattern=e._zod.bag.pattern??pb,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),fx=q(`$ZodNumberFormat`,(e,t)=>{Sb.init(e,t),dx.init(e,t)}),px=q(`$ZodBoolean`,(e,t)=>{Ib.init(e,t),e._zod.pattern=mb,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),mx=q(`$ZodUnknown`,(e,t)=>{Ib.init(e,t),e._zod.parse=e=>e}),hx=q(`$ZodNever`,(e,t)=>{Ib.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function gx(e,t,n){e.issues.length&&t.issues.push(...gy(n,e.issues)),t.value[n]=e.value}var _x=q(`$ZodArray`,(e,t)=>{Ib.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>gx(t,n,e))):gx(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function vx(e,t,n,r,i,a){let o=n in r;if(e.issues.length){if(i&&a&&!o)return;t.issues.push(...gy(n,e.issues))}if(!o&&!i){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}function yx(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=ay(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function bx(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optin===`optional`,d=c.optout===`optional`;for(let i in t){if(i===`__proto__`||s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>vx(e,n,i,t,u,d))):vx(a,n,i,t,u,d)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}var xx=q(`$ZodObject`,(e,t)=>{if(Ib.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}let n=Vv(()=>yx(t));Kv(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=Qv,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optin===`optional`,i=n._zod.optout===`optional`,a=n._zod.run({value:s[e],issues:[]},o);a instanceof Promise?c.push(a.then(n=>vx(n,t,e,s,r,i))):vx(a,t,e,s,r,i)}return i?bx(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),Sx=q(`$ZodObjectJIT`,(e,t)=>{xx.init(e,t);let n=e._zod.parse,r=Vv(()=>yx(t)),i=e=>{let t=new Pb([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=Yv(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=Yv(r),s=e[r],c=s?._zod?.optin===`optional`,l=s?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),c&&l?t.write(`
|
|
618
|
+
if (${n}.issues.length) {
|
|
619
|
+
if (${o} in input) {
|
|
620
|
+
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
621
|
+
...iss,
|
|
622
|
+
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
623
|
+
})));
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
if (${n}.value === undefined) {
|
|
628
|
+
if (${o} in input) {
|
|
629
|
+
newResult[${o}] = undefined;
|
|
630
|
+
}
|
|
631
|
+
} else {
|
|
632
|
+
newResult[${o}] = ${n}.value;
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
`):c?t.write(`
|
|
636
|
+
if (${n}.issues.length) {
|
|
637
|
+
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
638
|
+
...iss,
|
|
639
|
+
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
640
|
+
})));
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
if (${n}.value === undefined) {
|
|
644
|
+
if (${o} in input) {
|
|
645
|
+
newResult[${o}] = undefined;
|
|
646
|
+
}
|
|
647
|
+
} else {
|
|
648
|
+
newResult[${o}] = ${n}.value;
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
`):t.write(`
|
|
652
|
+
const ${n}_present = ${o} in input;
|
|
653
|
+
if (${n}.issues.length) {
|
|
654
|
+
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
655
|
+
...iss,
|
|
656
|
+
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
657
|
+
})));
|
|
658
|
+
}
|
|
659
|
+
if (!${n}_present && !${n}.issues.length) {
|
|
660
|
+
payload.issues.push({
|
|
661
|
+
code: "invalid_type",
|
|
662
|
+
expected: "nonoptional",
|
|
663
|
+
input: undefined,
|
|
664
|
+
path: [${o}]
|
|
665
|
+
});
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
if (${n}_present) {
|
|
669
|
+
if (${n}.value === undefined) {
|
|
670
|
+
newResult[${o}] = undefined;
|
|
671
|
+
} else {
|
|
672
|
+
newResult[${o}] = ${n}.value;
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=Qv,s=!Lv.jitless,c=s&&$v.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?bx([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function Cx(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!my(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>vy(e,r,Rv())))}),t)}var wx=q(`$ZodUnion`,(e,t)=>{Ib.init(e,t),Kv(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),Kv(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),Kv(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),Kv(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>Uv(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>Cx(t,r,e,i)):Cx(o,r,e,i)}}),Tx=q(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,wx.init(e,t);let n=e._zod.parse;Kv(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=Vv(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!Qv(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback||a.direction===`backward`?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()),input:o,path:[t.discriminator],inst:e}),i)}}),Ex=q(`$ZodIntersection`,(e,t)=>{Ib.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>Ox(e,t,n)):Ox(e,i,a)}});function Dx(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(ey(e)&&ey(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=Dx(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Dx(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Ox(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),my(e))return e;let o=Dx(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var kx=q(`$ZodRecord`,(e,t)=>{Ib.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!ey(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[],o=t.keyType._zod.values;if(o){n.value={};let s=new Set;for(let c of o)if(typeof c==`string`||typeof c==`number`||typeof c==`symbol`){s.add(typeof c==`number`?c.toString():c);let o=t.keyType._zod.run({value:c,issues:[]},r);if(o instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(o.issues.length){n.issues.push({code:`invalid_key`,origin:`record`,issues:o.issues.map(e=>vy(e,r,Rv())),input:c,path:[c],inst:e});continue}let l=o.value,u=t.valueType._zod.run({value:i[c],issues:[]},r);u instanceof Promise?a.push(u.then(e=>{e.issues.length&&n.issues.push(...gy(c,e.issues)),n.value[l]=e.value})):(u.issues.length&&n.issues.push(...gy(c,u.issues)),n.value[l]=u.value)}let c;for(let e in i)s.has(e)||(c??=[],c.push(e));c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:c})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`||!Object.prototype.propertyIsEnumerable.call(i,o))continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof o==`string`&&pb.test(o)&&s.issues.length){let e=t.keyType._zod.run({value:Number(o),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(s=e)}if(s.issues.length){t.mode===`loose`?n.value[o]=i[o]:n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>vy(e,r,Rv())),input:o,path:[o],inst:e});continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...gy(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...gy(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),Ax=q(`$ZodEnum`,(e,t)=>{Ib.init(e,t);let n=zv(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>ny.has(typeof e)).map(e=>typeof e==`string`?ry(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),jx=q(`$ZodLiteral`,(e,t)=>{if(Ib.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?ry(e):e?ry(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),Mx=q(`$ZodTransform`,(e,t)=>{Ib.init(e,t),e._zod.optin=`optional`,e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Iv(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n.fallback=!0,n));if(i instanceof Promise)throw new Fv;return n.value=i,n.fallback=!0,n}});function Nx(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var Px=q(`$ZodOptional`,(e,t)=>{Ib.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,Kv(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Kv(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Uv(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=e.value,i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(e=>Nx(e,r)):Nx(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),Fx=q(`$ZodExactOptional`,(e,t)=>{Px.init(e,t),Kv(e._zod,`values`,()=>t.innerType._zod.values),Kv(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Ix=q(`$ZodNullable`,(e,t)=>{Ib.init(e,t),Kv(e._zod,`optin`,()=>t.innerType._zod.optin),Kv(e._zod,`optout`,()=>t.innerType._zod.optout),Kv(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Uv(e.source)}|null)$`):void 0}),Kv(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Lx=q(`$ZodDefault`,(e,t)=>{Ib.init(e,t),e._zod.optin=`optional`,Kv(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Rx(e,t)):Rx(r,t)}});function Rx(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var zx=q(`$ZodPrefault`,(e,t)=>{Ib.init(e,t),e._zod.optin=`optional`,Kv(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Bx=q(`$ZodNonOptional`,(e,t)=>{Ib.init(e,t),Kv(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Vx(t,e)):Vx(i,e)}});function Vx(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var Hx=q(`$ZodCatch`,(e,t)=>{Ib.init(e,t),e._zod.optin=`optional`,Kv(e._zod,`optout`,()=>t.innerType._zod.optout),Kv(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>vy(e,n,Rv()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>vy(e,n,Rv()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),Ux=q(`$ZodPipe`,(e,t)=>{Ib.init(e,t),Kv(e._zod,`values`,()=>t.in._zod.values),Kv(e._zod,`optin`,()=>t.in._zod.optin),Kv(e._zod,`optout`,()=>t.out._zod.optout),Kv(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Wx(e,t.in,n)):Wx(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Wx(e,t.out,n)):Wx(r,t.out,n)}});function Wx(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}var Gx=q(`$ZodReadonly`,(e,t)=>{Ib.init(e,t),Kv(e._zod,`propValues`,()=>t.innerType._zod.propValues),Kv(e._zod,`values`,()=>t.innerType._zod.values),Kv(e._zod,`optin`,()=>t.innerType?._zod?.optin),Kv(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Kx):Kx(r)}});function Kx(e){return e.value=Object.freeze(e.value),e}var qx=q(`$ZodCustom`,(e,t)=>{_b.init(e,t),Ib.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Jx(t,n,r,e));Jx(i,n,r,e)}});function Jx(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(by(e))}}var Yx,Xx=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Zx(){return new Xx}(Yx=globalThis).__zod_globalRegistry??(Yx.__zod_globalRegistry=Zx());var Qx=globalThis.__zod_globalRegistry;function $x(e,t){return new e({type:`string`,...J(t)})}function eS(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...J(t)})}function tS(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...J(t)})}function nS(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...J(t)})}function rS(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...J(t)})}function iS(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...J(t)})}function aS(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...J(t)})}function oS(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...J(t)})}function sS(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...J(t)})}function cS(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...J(t)})}function lS(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...J(t)})}function uS(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...J(t)})}function dS(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...J(t)})}function fS(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...J(t)})}function pS(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...J(t)})}function mS(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...J(t)})}function hS(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...J(t)})}function gS(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...J(t)})}function _S(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...J(t)})}function vS(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...J(t)})}function yS(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...J(t)})}function bS(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...J(t)})}function xS(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...J(t)})}function SS(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...J(t)})}function CS(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...J(t)})}function wS(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...J(t)})}function TS(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...J(t)})}function ES(e,t){return new e({type:`number`,checks:[],...J(t)})}function DS(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...J(t)})}function OS(e,t){return new e({type:`boolean`,...J(t)})}function kS(e){return new e({type:`unknown`})}function AS(e,t){return new e({type:`never`,...J(t)})}function jS(e,t){return new yb({check:`less_than`,...J(t),value:e,inclusive:!1})}function MS(e,t){return new yb({check:`less_than`,...J(t),value:e,inclusive:!0})}function NS(e,t){return new bb({check:`greater_than`,...J(t),value:e,inclusive:!1})}function PS(e,t){return new bb({check:`greater_than`,...J(t),value:e,inclusive:!0})}function FS(e,t){return new xb({check:`multiple_of`,...J(t),value:e})}function IS(e,t){return new Cb({check:`max_length`,...J(t),maximum:e})}function LS(e,t){return new wb({check:`min_length`,...J(t),minimum:e})}function RS(e,t){return new Tb({check:`length_equals`,...J(t),length:e})}function zS(e,t){return new Db({check:`string_format`,format:`regex`,...J(t),pattern:e})}function BS(e){return new Ob({check:`string_format`,format:`lowercase`,...J(e)})}function VS(e){return new kb({check:`string_format`,format:`uppercase`,...J(e)})}function HS(e,t){return new Ab({check:`string_format`,format:`includes`,...J(t),includes:e})}function US(e,t){return new jb({check:`string_format`,format:`starts_with`,...J(t),prefix:e})}function WS(e,t){return new Mb({check:`string_format`,format:`ends_with`,...J(t),suffix:e})}function GS(e){return new Nb({check:`overwrite`,tx:e})}function KS(e){return GS(t=>t.normalize(e))}function qS(){return GS(e=>e.trim())}function JS(){return GS(e=>e.toLowerCase())}function YS(){return GS(e=>e.toUpperCase())}function XS(){return GS(e=>Xv(e))}function ZS(e,t,n){return new e({type:`array`,element:t,...J(n)})}function QS(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...J(n)})}function $S(e,t){let n=eC(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(by(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=t.value,r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(by(r))}},e(t.value,t)),t);return n}function eC(e,t){let n=new _b({check:`custom`,...J(t)});return n._zod.check=e,n}function tC(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??Qx,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function nC(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,nC(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&aC(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function rC(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
677
|
+
|
|
678
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function iC(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:sC(t,`input`,e.processors),output:sC(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function aC(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return aC(r.element,n);if(r.type===`set`)return aC(r.valueType,n);if(r.type===`lazy`)return aC(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`)return aC(r.innerType,n);if(r.type===`intersection`)return aC(r.left,n)||aC(r.right,n);if(r.type===`record`||r.type===`map`)return aC(r.keyType,n)||aC(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:aC(r.in,n)||aC(r.out,n);if(r.type===`object`){for(let e in r.shape)if(aC(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(aC(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(aC(e,n))return!0;return!!(r.rest&&aC(r.rest,n))}return!1}var oC=(e,t={})=>n=>{let r=tC({...n,processors:t});return nC(e,r),rC(r,e),iC(r,e)},sC=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=tC({...i??{},target:a,io:t,processors:n});return nC(e,o),rC(o,e),iC(o,e)},cC={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},lC=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=cC[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},uC=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s==`string`&&s.includes(`int`)?i.type=`integer`:i.type=`number`;let d=typeof u==`number`&&u>=(a??-1/0),f=typeof l==`number`&&l<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o==`number`&&(i.maximum=o),typeof c==`number`&&(i.multipleOf=c)},dC=(e,t,n,r)=>{n.type=`boolean`},fC=(e,t,n,r)=>{n.not={}},pC=(e,t,n,r)=>{let i=e._zod.def,a=zv(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},mC=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},hC=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},gC=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},_C=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=nC(a.element,t,{...r,path:[...r.path,`items`]})},vC=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=nC(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=nC(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},yC=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>nC(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},bC=(e,t,n,r)=>{let i=e._zod.def,a=nC(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=nC(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},xC=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=nC(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else(t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=nC(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=nC(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},SC=(e,t,n,r)=>{let i=e._zod.def,a=nC(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},CC=(e,t,n,r)=>{let i=e._zod.def;nC(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},wC=(e,t,n,r)=>{let i=e._zod.def;nC(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},TC=(e,t,n,r)=>{let i=e._zod.def;nC(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},EC=(e,t,n,r)=>{let i=e._zod.def;nC(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},DC=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;nC(o,t,r);let s=t.seen.get(e);s.ref=o},OC=(e,t,n,r)=>{let i=e._zod.def;nC(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},kC=(e,t,n,r)=>{let i=e._zod.def;nC(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},AC=q(`ZodISODateTime`,(e,t)=>{Xb.init(e,t),nw.init(e,t)});function jC(e){return SS(AC,e)}var MC=q(`ZodISODate`,(e,t)=>{Zb.init(e,t),nw.init(e,t)});function NC(e){return CS(MC,e)}var PC=q(`ZodISOTime`,(e,t)=>{Qb.init(e,t),nw.init(e,t)});function FC(e){return wS(PC,e)}var IC=q(`ZodISODuration`,(e,t)=>{$b.init(e,t),nw.init(e,t)});function LC(e){return TS(IC,e)}var RC=q(`ZodError`,(e,t)=>{Sy.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>Ty(e,t)},flatten:{value:t=>wy(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Bv,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Bv,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),zC=Ey(RC),BC=Dy(RC),VC=Oy(RC),HC=Ay(RC),UC=My(RC),WC=Ny(RC),GC=Py(RC),KC=Fy(RC),qC=Iy(RC),JC=Ly(RC),YC=Ry(RC),XC=zy(RC),ZC=new WeakMap;function QC(e,t,n){let r=Object.getPrototypeOf(e),i=ZC.get(r);if(i||(i=new Set,ZC.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}var $C=q(`ZodType`,(e,t)=>(Ib.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:sC(e,`input`),output:sC(e,`output`)}}),e.toJSONSchema=oC(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>zC(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>VC(e,t,n),e.parseAsync=async(t,n)=>BC(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>HC(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>UC(e,t,n),e.decode=(t,n)=>WC(e,t,n),e.encodeAsync=async(t,n)=>GC(e,t,n),e.decodeAsync=async(t,n)=>KC(e,t,n),e.safeEncode=(t,n)=>qC(e,t,n),e.safeDecode=(t,n)=>JC(e,t,n),e.safeEncodeAsync=async(t,n)=>YC(e,t,n),e.safeDecodeAsync=async(t,n)=>XC(e,t,n),QC(e,`ZodType`,{check(...e){let t=this.def;return this.clone(Jv(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return iy(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(fT(e,t))},superRefine(e,t){return this.check(pT(e,t))},overwrite(e){return this.check(GS(e))},optional(){return Jw(this)},exactOptional(){return Xw(this)},nullable(){return Qw(this)},nullish(){return Jw(Qw(this))},nonoptional(e){return iT(this,e)},array(){return jw(this)},or(e){return Pw([this,e])},and(e){return Rw(this,e)},transform(e){return cT(this,Kw(e))},default(e){return eT(this,e)},prefault(e){return nT(this,e)},catch(e){return oT(this,e)},pipe(e){return cT(this,e)},readonly(){return uT(this)},describe(e){let t=this.clone();return Qx.add(t,{description:e}),t},meta(...e){if(e.length===0)return Qx.get(this);let t=this.clone();return Qx.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get(){return Qx.get(e)?.description},configurable:!0}),e)),ew=q(`_ZodString`,(e,t)=>{Lb.init(e,t),$C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>lC(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,QC(e,`_ZodString`,{regex(...e){return this.check(zS(...e))},includes(...e){return this.check(HS(...e))},startsWith(...e){return this.check(US(...e))},endsWith(...e){return this.check(WS(...e))},min(...e){return this.check(LS(...e))},max(...e){return this.check(IS(...e))},length(...e){return this.check(RS(...e))},nonempty(...e){return this.check(LS(1,...e))},lowercase(e){return this.check(BS(e))},uppercase(e){return this.check(VS(e))},trim(){return this.check(qS())},normalize(...e){return this.check(KS(...e))},toLowerCase(){return this.check(JS())},toUpperCase(){return this.check(YS())},slugify(){return this.check(XS())}})}),tw=q(`ZodString`,(e,t)=>{Lb.init(e,t),ew.init(e,t),e.email=t=>e.check(eS(rw,t)),e.url=t=>e.check(oS(ow,t)),e.jwt=t=>e.check(xS(xw,t)),e.emoji=t=>e.check(sS(sw,t)),e.guid=t=>e.check(tS(iw,t)),e.uuid=t=>e.check(nS(aw,t)),e.uuidv4=t=>e.check(rS(aw,t)),e.uuidv6=t=>e.check(iS(aw,t)),e.uuidv7=t=>e.check(aS(aw,t)),e.nanoid=t=>e.check(cS(cw,t)),e.guid=t=>e.check(tS(iw,t)),e.cuid=t=>e.check(lS(lw,t)),e.cuid2=t=>e.check(uS(uw,t)),e.ulid=t=>e.check(dS(dw,t)),e.base64=t=>e.check(vS(vw,t)),e.base64url=t=>e.check(yS(yw,t)),e.xid=t=>e.check(fS(fw,t)),e.ksuid=t=>e.check(pS(pw,t)),e.ipv4=t=>e.check(mS(mw,t)),e.ipv6=t=>e.check(hS(hw,t)),e.cidrv4=t=>e.check(gS(gw,t)),e.cidrv6=t=>e.check(_S(_w,t)),e.e164=t=>e.check(bS(bw,t)),e.datetime=t=>e.check(jC(t)),e.date=t=>e.check(NC(t)),e.time=t=>e.check(FC(t)),e.duration=t=>e.check(LC(t))});function Y(e){return $x(tw,e)}var nw=q(`ZodStringFormat`,(e,t)=>{Rb.init(e,t),ew.init(e,t)}),rw=q(`ZodEmail`,(e,t)=>{Vb.init(e,t),nw.init(e,t)}),iw=q(`ZodGUID`,(e,t)=>{zb.init(e,t),nw.init(e,t)}),aw=q(`ZodUUID`,(e,t)=>{Bb.init(e,t),nw.init(e,t)}),ow=q(`ZodURL`,(e,t)=>{Hb.init(e,t),nw.init(e,t)}),sw=q(`ZodEmoji`,(e,t)=>{Ub.init(e,t),nw.init(e,t)}),cw=q(`ZodNanoID`,(e,t)=>{Wb.init(e,t),nw.init(e,t)}),lw=q(`ZodCUID`,(e,t)=>{Gb.init(e,t),nw.init(e,t)}),uw=q(`ZodCUID2`,(e,t)=>{Kb.init(e,t),nw.init(e,t)}),dw=q(`ZodULID`,(e,t)=>{qb.init(e,t),nw.init(e,t)}),fw=q(`ZodXID`,(e,t)=>{Jb.init(e,t),nw.init(e,t)}),pw=q(`ZodKSUID`,(e,t)=>{Yb.init(e,t),nw.init(e,t)}),mw=q(`ZodIPv4`,(e,t)=>{ex.init(e,t),nw.init(e,t)}),hw=q(`ZodIPv6`,(e,t)=>{tx.init(e,t),nw.init(e,t)}),gw=q(`ZodCIDRv4`,(e,t)=>{nx.init(e,t),nw.init(e,t)}),_w=q(`ZodCIDRv6`,(e,t)=>{rx.init(e,t),nw.init(e,t)}),vw=q(`ZodBase64`,(e,t)=>{ax.init(e,t),nw.init(e,t)}),yw=q(`ZodBase64URL`,(e,t)=>{sx.init(e,t),nw.init(e,t)}),bw=q(`ZodE164`,(e,t)=>{cx.init(e,t),nw.init(e,t)}),xw=q(`ZodJWT`,(e,t)=>{ux.init(e,t),nw.init(e,t)}),Sw=q(`ZodNumber`,(e,t)=>{dx.init(e,t),$C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>uC(e,t,n,r),QC(e,`ZodNumber`,{gt(e,t){return this.check(NS(e,t))},gte(e,t){return this.check(PS(e,t))},min(e,t){return this.check(PS(e,t))},lt(e,t){return this.check(jS(e,t))},lte(e,t){return this.check(MS(e,t))},max(e,t){return this.check(MS(e,t))},int(e){return this.check(ww(e))},safe(e){return this.check(ww(e))},positive(e){return this.check(NS(0,e))},nonnegative(e){return this.check(PS(0,e))},negative(e){return this.check(jS(0,e))},nonpositive(e){return this.check(MS(0,e))},multipleOf(e,t){return this.check(FS(e,t))},step(e,t){return this.check(FS(e,t))},finite(){return this}});let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function X(e){return ES(Sw,e)}var Cw=q(`ZodNumberFormat`,(e,t)=>{fx.init(e,t),Sw.init(e,t)});function ww(e){return DS(Cw,e)}var Tw=q(`ZodBoolean`,(e,t)=>{px.init(e,t),$C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>dC(e,t,n,r)});function Z(e){return OS(Tw,e)}var Ew=q(`ZodUnknown`,(e,t)=>{mx.init(e,t),$C.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Dw(){return kS(Ew)}var Ow=q(`ZodNever`,(e,t)=>{hx.init(e,t),$C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fC(e,t,n,r)});function kw(e){return AS(Ow,e)}var Aw=q(`ZodArray`,(e,t)=>{_x.init(e,t),$C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_C(e,t,n,r),e.element=t.element,QC(e,`ZodArray`,{min(e,t){return this.check(LS(e,t))},nonempty(e){return this.check(LS(1,e))},max(e,t){return this.check(IS(e,t))},length(e,t){return this.check(RS(e,t))},unwrap(){return this.element}})});function jw(e,t){return ZS(Aw,e,t)}var Mw=q(`ZodObject`,(e,t)=>{Sx.init(e,t),$C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vC(e,t,n,r),Kv(e,`shape`,()=>t.shape),QC(e,`ZodObject`,{keyof(){return Hw(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:Dw()})},loose(){return this.clone({...this._zod.def,catchall:Dw()})},strict(){return this.clone({...this._zod.def,catchall:kw()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return ly(this,e)},safeExtend(e){return uy(this,e)},merge(e){return dy(this,e)},pick(e){return sy(this,e)},omit(e){return cy(this,e)},partial(...e){return fy(qw,this,e[0])},required(...e){return py(rT,this,e[0])}})});function Q(e,t){return new Mw({type:`object`,shape:e??{},...J(t)})}var Nw=q(`ZodUnion`,(e,t)=>{wx.init(e,t),$C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yC(e,t,n,r),e.options=t.options});function Pw(e,t){return new Nw({type:`union`,options:e,...J(t)})}var Fw=q(`ZodDiscriminatedUnion`,(e,t)=>{Nw.init(e,t),Tx.init(e,t)});function Iw(e,t,n){return new Fw({type:`union`,options:t,discriminator:e,...J(n)})}var Lw=q(`ZodIntersection`,(e,t)=>{Ex.init(e,t),$C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bC(e,t,n,r)});function Rw(e,t){return new Lw({type:`intersection`,left:e,right:t})}var zw=q(`ZodRecord`,(e,t)=>{kx.init(e,t),$C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xC(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function Bw(e,t,n){return!t||!t._zod?new zw({type:`record`,keyType:Y(),valueType:e,...J(t)}):new zw({type:`record`,keyType:e,valueType:t,...J(n)})}var Vw=q(`ZodEnum`,(e,t)=>{Ax.init(e,t),$C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pC(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Vw({...t,checks:[],...J(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new Vw({...t,checks:[],...J(r),entries:i})}});function Hw(e,t){return new Vw({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...J(t)})}var Uw=q(`ZodLiteral`,(e,t)=>{jx.init(e,t),$C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mC(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Ww(e,t){return new Uw({type:`literal`,values:Array.isArray(e)?e:[e],...J(t)})}var Gw=q(`ZodTransform`,(e,t)=>{Mx.init(e,t),$C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gC(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Iv(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(by(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(by(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function Kw(e){return new Gw({type:`transform`,transform:e})}var qw=q(`ZodOptional`,(e,t)=>{Px.init(e,t),$C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>kC(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Jw(e){return new qw({type:`optional`,innerType:e})}var Yw=q(`ZodExactOptional`,(e,t)=>{Fx.init(e,t),$C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>kC(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Xw(e){return new Yw({type:`optional`,innerType:e})}var Zw=q(`ZodNullable`,(e,t)=>{Ix.init(e,t),$C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>SC(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Qw(e){return new Zw({type:`nullable`,innerType:e})}var $w=q(`ZodDefault`,(e,t)=>{Lx.init(e,t),$C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wC(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function eT(e,t){return new $w({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():ty(t)}})}var tT=q(`ZodPrefault`,(e,t)=>{zx.init(e,t),$C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>TC(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function nT(e,t){return new tT({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():ty(t)}})}var rT=q(`ZodNonOptional`,(e,t)=>{Bx.init(e,t),$C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>CC(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function iT(e,t){return new rT({type:`nonoptional`,innerType:e,...J(t)})}var aT=q(`ZodCatch`,(e,t)=>{Hx.init(e,t),$C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>EC(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function oT(e,t){return new aT({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var sT=q(`ZodPipe`,(e,t)=>{Ux.init(e,t),$C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>DC(e,t,n,r),e.in=t.in,e.out=t.out});function cT(e,t){return new sT({type:`pipe`,in:e,out:t})}var lT=q(`ZodReadonly`,(e,t)=>{Gx.init(e,t),$C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>OC(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function uT(e){return new lT({type:`readonly`,innerType:e})}var dT=q(`ZodCustom`,(e,t)=>{qx.init(e,t),$C.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hC(e,t,n,r)});function fT(e,t={}){return QS(dT,e,t)}function pT(e,t){return $S(e,t)}var $=Y(),mT=Y(),hT=Q({kind:Hw([`symbolic`,`detached`]),refName:Y().optional(),sha:$}),gT=Q({name:Y(),shortName:Y(),kind:Hw([`head`,`remote`,`tag`]),targetSha:$,peeledSha:$.optional(),upstream:Y().optional(),ahead:X().optional(),behind:X().optional(),isCurrent:Z().optional()}),_T=Q({selector:Y(),sha:$,parentSha:$,message:Y(),createdAt:X()}),vT=Q({path:Y(),headSha:$.nullable(),branchRef:Y().optional(),branchShortName:Y().optional(),isCurrent:Z(),detached:Z(),bare:Z(),locked:Z(),lockedReason:Y().optional(),prunable:Z(),prunableReason:Y().optional()}),yT=Q({row:X(),sha:$,parentShas:jw($),authorName:Y(),authorEmail:Y(),authorUnix:X(),committerUnix:X(),subject:Y(),additions:X(),deletions:X(),locChanged:X(),bodyPreview:Y().optional(),refNames:jw(Y()),lane:X()}),bT=Q({fromRow:X(),toRow:X(),fromLane:X(),toLane:X(),kind:Hw([`linear`,`merge`,`fork`])}),xT=Q({path:Y(),oldPath:Y().optional(),status:Hw([`A`,`M`,`D`,`R`,`C`,`T`,`U`])}),ST=Hw([`A`,`M`,`D`,`R`,`C`,`T`,`U`,`?`]),CT=Q({path:Y(),oldPath:Y().optional(),status:ST}),wT=Q({branch:Y().optional(),headSha:$,mergeHeadShas:jw($).optional(),rebaseHeadSha:$.optional(),staged:jw(CT),unstaged:jw(CT)}),TT=Iw(`type`,[Q({type:Ww(`start`),command:Y()}),Q({type:Ww(`output`),stream:Hw([`stdout`,`stderr`,`status`]),text:Y()}),Q({type:Ww(`complete`),ok:Z(),exitCode:X().optional(),error:Y().optional(),changes:wT.optional()})]),ET=Hw([`stage`,`unstage`,`stage-all`,`unstage-all`,`discard`,`discard-all`]),DT=Hw([`staged`,`unstaged`]),OT=Q({dataUrl:Y(),byteSize:X()}),kT=Q({before:OT.nullable(),after:OT.nullable()}),AT=Hw([`cherry-pick`,`revert`,`uncommit`]),jT=Hw([`current-branch`,`detached-head`,`up-to-date`,`missing-ref`]),MT=Hw([`merge`,`rebase`]),NT=Hw([`checkout`,`push`,`fetch`,`delete`,`move`,`reset`,`create`,`create-tag`]),PT=Hw([`commit`,`amend`,`checkout`,`reset`,`rebase`,`merge`,`cherry-pick`,`revert`,`pull`,`branch`,`clone`,`other`]),FT=Q({index:X(),selector:Y(),sha:$,oldSha:$.nullable(),kind:PT,message:Y(),subject:Y(),authorName:Y(),authorEmail:Y(),committerUnix:X(),entryUnix:X(),isReachable:Z(),refNames:jw(Y())}),IT=Q({name:Y(),path:Y(),isGitRepo:Z()}),LT=Hw([`terminal`,`ide`,`background`]),RT=Hw([`claude`,`codex`]),zT=Q({pid:X(),agent:RT,kind:LT,cwd:Y(),gitRoot:Y().nullable(),tty:Y().nullable(),ide:Y().nullable(),focusable:Z(),busy:Z().nullable(),title:Y().nullable()}),BT=Q({displayServer:Y(),canFocusTerminals:Z(),canInstallWindowCalls:Z()});jv.input(Q({path:Y()})).output(Q({repoId:mT,rootPath:Y(),currentWorktreePath:Y(),totalCommitCount:X(),githubUrl:Y().nullable(),head:hT})),jv.input(Q({repoId:mT})).output(Q({ok:Z(),error:Y().optional()})),jv.input(Q({})).output(jw(Y())),jv.input(Q({folder:Y().optional()})).output(Q({folder:Y(),repos:jw(Y())})),jv.input(Q({folder:Y().optional()})).output(Q({path:Y(),parentPath:Y().nullable(),isGitRepo:Z(),entries:jw(IT),error:Y().optional()})),jv.input(Q({repoId:mT})).output(jw(gT)),jv.input(Q({repoId:mT})).output(jw(vT)),jv.input(Q({repoId:mT,path:Y()})).output(Q({ok:Z(),worktrees:jw(vT)})),jv.input(Q({repoId:mT})).output(Q({branch:Y().optional(),headSha:$,stagedCount:X(),unstagedCount:X(),untrackedCount:X(),conflictedCount:X()})),jv.input(Q({repoId:mT})).output(wT),jv.input(Q({repoId:mT})).output(jw(_T)),jv.input(Q({repoId:mT,stashSha:$})).output(Q({sha:$,changedPaths:jw(xT),additions:X(),deletions:X()})),jv.input(Q({repoId:mT,stashSha:$,path:Y(),oldPath:Y().optional()})).output(Q({sha:$,path:Y(),patchText:Y(),isBinary:Z(),imageDiff:kT.optional()})),jv.input(Iw(`action`,[Q({repoId:mT,action:Ww(`create`),message:Y().optional()}),Q({repoId:mT,action:Ww(`apply`),stashSha:$}),Q({repoId:mT,action:Ww(`drop`),stashSha:$})])).output(Q({ok:Z(),message:Y(),stashes:jw(_T),changes:wT})),jv.input(Q({repoId:mT,action:ET,paths:jw(Y())})).output(wT),jv.input(Q({repoId:mT,path:Y(),fileName:Y().min(1).max(255),command:Y().min(1).max(1e3)})).output(Nv(TT)),jv.input(Q({repoId:mT,path:Y(),area:DT,oldPath:Y().optional()})).output(Q({path:Y(),area:DT,patchText:Y(),isBinary:Z(),imageDiff:kT.optional()})),jv.input(Q({repoId:mT,message:Y().min(1),noVerify:Z().optional(),amend:Z().optional()})).output(Q({ok:Z(),headSha:$,changes:wT})),jv.input(Q({repoId:mT,scope:Q({kind:Hw([`all`,`ref`,`range`,`path`]),value:Y().optional(),secondaryValue:Y().optional()}),anchor:Q({kind:Hw([`head`,`ref`,`sha`,`row`,`mergeBase`]),value:Y().optional(),secondaryValue:Y().optional()}),beforeRows:X(),afterRows:X(),firstParent:Z(),topoOrder:Z()})).output(Q({projectionId:Y(),rows:jw(yT),edges:jw(bT),checkpointsKnownUntilRow:X(),totalRowsKnown:X().optional(),hasMoreBefore:Z(),hasMoreAfter:Z(),indexingState:Hw([`cold`,`warming`,`warm`])})),jv.input(Q({repoId:mT,sha:$})).output(Q({sha:$,parents:jw($),authorName:Y(),authorEmail:Y(),authorUnix:X(),committerName:Y(),committerEmail:Y(),committerUnix:X(),subject:Y(),body:Y(),treeSha:Y(),refs:jw(Y()),isPushed:Z()})),jv.input(Q({repoId:mT,sha:$})).output(Q({avatarUrl:Y().nullable()})),jv.input(Q({repoId:mT,sha:$})).output(Q({sha:$,changedPaths:jw(xT),additions:X(),deletions:X(),patchText:Y().optional()})),jv.input(Q({repoId:mT,sha:$,path:Y(),oldPath:Y().optional()})).output(Q({sha:$,path:Y(),patchText:Y(),isBinary:Z(),imageDiff:kT.optional()})),jv.input(Q({repoId:mT,sha:$})).output(jw(Q({number:X(),title:Y(),url:Y(),state:Y(),mergedAt:Y().nullable()}))),jv.input(Q({repoId:mT,sha:$})).output(Q({state:Hw([`success`,`pending`,`failure`,`error`,`neutral`,`none`]),runs:jw(Q({name:Y(),description:Y().optional(),state:Hw([`success`,`pending`,`failure`,`error`,`neutral`]),url:Y().optional()}))})),jv.input(Q({repoId:mT,shas:jw($)})).output(Bw(Y(),Q({state:Hw([`success`,`pending`,`failure`,`error`,`neutral`,`none`]),runs:jw(Q({name:Y(),description:Y().optional(),state:Hw([`success`,`pending`,`failure`,`error`,`neutral`]),url:Y().optional()}))}))),jv.input(Q({repoId:mT,sha:$,action:AT})).output(Q({ok:Z(),message:Y(),headSha:$})),jv.input(Q({repoId:mT,refName:Y()})).output(Q({mergeable:Z(),reason:jT.optional(),sourceRefName:Y(),sourceSha:$.optional(),targetRefName:Y().optional(),targetSha:$.optional(),requiresFetch:Z()})),jv.input(Q({repoId:mT,refName:Y()})).output(Q({ok:Z(),message:Y(),headSha:$})),jv.input(Q({repoId:mT,refName:Y()})).output(Q({ok:Z(),message:Y(),headSha:$})),jv.input(Q({repoId:mT,operation:MT})).output(Q({ok:Z(),message:Y(),headSha:$,changes:wT})),jv.input(Q({repoId:mT,operation:MT})).output(Q({ok:Z(),message:Y(),headSha:$,changes:wT})),jv.input(Q({repoId:mT,action:NT,refName:Y(),sha:$,force:Z().optional()})).output(Q({ok:Z(),message:Y()})),jv.input(Q({repoId:mT,ref:Y().optional(),maxCount:X().optional()})).output(Q({refName:Y(),entries:jw(FT)})),jv.input(Q({})).output(Q({sessions:jw(zT),capabilities:BT})),jv.input(Q({pid:X(),cwd:Y().optional()})).output(Q({ok:Z(),method:Y().optional(),error:Y().optional()})),jv.input(Q({})).output(Q({ok:Z(),error:Y().optional()}));function VT(e,t,n){return{id:e,fileName:t,command:n}}var HT=[VT(`npm`,`package-lock.json`,`npm install`),VT(`npm-shrinkwrap`,`npm-shrinkwrap.json`,`npm install`),VT(`pnpm`,`pnpm-lock.yaml`,`pnpm install`),VT(`yarn`,`yarn.lock`,`yarn install`),VT(`bun-text`,`bun.lock`,`bun install`),VT(`bun-binary`,`bun.lockb`,`bun install`),VT(`python-poetry`,`poetry.lock`,`poetry lock --regenerate`),VT(`python-uv`,`uv.lock`,`uv sync`),VT(`python-pipenv`,`Pipfile.lock`,`pipenv lock`),VT(`ruby-bundler`,`Gemfile.lock`,`bundle install`),VT(`go-modules`,`go.sum`,`go mod tidy`),VT(`go-workspace`,`go.work.sum`,`go work sync`),VT(`rust-cargo`,`Cargo.lock`,`cargo generate-lockfile`),VT(`php-composer`,`composer.lock`,`composer update --lock`),VT(`swift-package-manager`,`Package.resolved`,`swift package resolve`),VT(`cocoapods`,`Podfile.lock`,`pod install`),VT(`dart-pub`,`pubspec.lock`,`dart pub get`),VT(`elixir-mix`,`mix.lock`,`mix deps.get`),VT(`dotnet-nuget`,`packages.lock.json`,`dotnet restore --force-evaluate`),VT(`gradle`,`gradle.lockfile`,`gradle dependencies --write-locks`)],UT=`ingit.conflictResolvers`,WT=1,GT=100,KT=100,qT=255,JT=1e3;function YT(e){return e.length>0&&e.length<=qT&&e!==`.`&&e!==`..`&&!e.includes(`/`)&&!e.includes(`\\`)}function XT(e){return e.map(e=>({...e}))}function ZT(e){return JSON.stringify({version:WT,resolvers:e})}function QT(e){if(e===null)return null;try{let t=JSON.parse(e);if(!t||typeof t!=`object`)return null;let{version:n,resolvers:r}=t;if(n!==WT||!Array.isArray(r)||r.length>GT)return null;let i=new Set,a=new Set,o=[];for(let e of r){if(!e||typeof e!=`object`)return null;let t=e,n=typeof t.id==`string`?t.id.trim():``,r=typeof t.fileName==`string`?t.fileName.trim():``,s=typeof t.command==`string`?t.command.trim():``;if(!n||n.length>KT||i.has(n)||!YT(r)||a.has(r)||!s||s.length>JT||!vv(s))return null;i.add(n),a.add(r),o.push({id:n,fileName:r,command:s})}return o}catch{return null}}function $T(e,t){let n=e.replaceAll(`\\`,`/`).split(`/`).at(-1);return n?t.find(e=>e.fileName===n)??null:null}function eE(){try{return typeof window>`u`?null:window.localStorage}catch{return null}}function tE(){let e=eE();if(!e)return XT(HT);try{return QT(e.getItem(UT))??XT(HT)}catch{return XT(HT)}}var nE=tE(),rE=new Set;function iE(e){nE=e;for(let e of rE)e()}function aE(e){e.key!==null&&e.key!==UT||iE(QT(e.newValue)??XT(HT))}function oE(e){let t=rE.size===0;return rE.add(e),t&&typeof window<`u`&&window.addEventListener(`storage`,aE),()=>{rE.delete(e),rE.size===0&&typeof window<`u`&&window.removeEventListener(`storage`,aE)}}function sE(){return(0,b.useSyncExternalStore)(oE,()=>nE,()=>HT)}function cE(e){let t=QT(ZT(e));if(!t)return!1;let n=eE();if(!n)return!1;try{n.setItem(UT,ZT(t))}catch{return!1}return iE(t),!0}function lE(){let e=eE();if(!e)return!1;try{e.removeItem(UT)}catch{return!1}return iE(XT(HT)),!0}var uE={A:`#a6e3a1`,M:`#f9e2af`,D:`#f38ba8`,R:`#cba6f7`,C:`#94e2d5`,T:`#89b4fa`,U:`#fab387`,"?":`#94e2d5`},dE={A:`Added`,M:`Modified`,D:`Deleted`,R:`Renamed`,C:`Copied`,T:`Type changed`,U:`Conflicted`,"?":`Untracked`};function fE({file:e,area:t,actionLabel:n,onAction:r,onDiscard:i,resolvingLockfile:a,onInstallAndResolve:o}){let[s,c]=(0,b.useState)(!1),l=I(e=>e.loadWorktreeFileDiff),u=I(n=>n.worktreeFileDiffs[Ur(t,e.path)]),d=e.path.lastIndexOf(`/`),f=d>=0?e.path.slice(0,d+1):``,p=d>=0?e.path.slice(d+1):e.path,m=uE[e.status]??`#cdd6f4`;return(0,b.useEffect)(()=>{s&&!u&&l(e,t)},[s,u,e,t,l]),(0,y.jsxs)(`div`,{children:[(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,padding:`4px 6px`,borderRadius:6,cursor:`pointer`},onClick:()=>{let n=!s;c(n),n&&l(e,t)},onMouseEnter:e=>{e.currentTarget.style.background=`#1e1e2e`},onMouseLeave:e=>{e.currentTarget.style.background=`transparent`},children:[(0,y.jsx)(`span`,{style:{flexShrink:0,width:10,fontSize:9,color:`#6c7086`,userSelect:`none`},children:s?`▼`:`▶`}),(0,y.jsx)(`span`,{title:dE[e.status]??e.status,style:{flexShrink:0,width:16,height:16,borderRadius:3,background:m+`22`,color:m,fontSize:10,fontWeight:700,fontFamily:`monospace`,display:`inline-flex`,alignItems:`center`,justifyContent:`center`},children:e.status}),(0,y.jsx)(`span`,{title:e.path,style:{flex:1,minWidth:0,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,fontSize:12,fontFamily:`monospace`,direction:`rtl`,textAlign:`left`},children:(0,y.jsxs)(`bdi`,{dir:`ltr`,children:[(0,y.jsx)(`span`,{style:{color:`#6c7086`},children:f}),(0,y.jsx)(`span`,{style:{color:`#cdd6f4`},children:p})]})}),(0,y.jsxs)(`span`,{onClick:e=>e.stopPropagation(),style:{display:`flex`,gap:4},children:[o&&(0,y.jsx)(U,{label:`run install & resolve`,tone:`success`,size:`compact`,loading:a,onClick:o}),(0,y.jsx)(U,{label:n,tone:`neutral`,size:`compact`,variant:`ghost`,iconOnly:!0,onClick:r}),(0,y.jsx)(U,{label:`Discard`,tone:`danger`,size:`compact`,variant:`ghost`,iconOnly:!0,onClick:i})]})]}),s&&u&&(0,y.jsx)(tv,{entry:u,path:e.path})]})}function pE({title:e,files:t,area:n,bulkLabel:r,bulkTone:i=`neutral`,bulkDisabled:a=!1,onBulk:o,rowActionLabel:s,onRowAction:c,onDiscard:l,resolvingLockfilePath:u,conflictResolvers:d=[],onInstallAndResolve:f}){return t.length===0?null:(0,y.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:2},children:[(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,padding:`0 6px 4px`},children:[(0,y.jsxs)(`span`,{style:{fontSize:11,fontWeight:700,letterSpacing:.4,textTransform:`uppercase`,color:`#a6adc8`},children:[e,` `,(0,y.jsxs)(`span`,{style:{color:`#6c7086`},children:[`(`,t.length,`)`]})]}),r&&o&&(0,y.jsx)(U,{label:r,tone:i,size:`compact`,disabled:a,onClick:o})]}),t.map(e=>{let t=e.status===`U`?$T(e.path,d):null;return(0,y.jsx)(fE,{file:e,area:n,actionLabel:typeof s==`function`?s(e):s,onAction:()=>c(e),onDiscard:()=>l(e),resolvingLockfile:u===e.path,onInstallAndResolve:f&&t?()=>f(e,t):void 0},`${e.status}:${e.path}`)})]})}function mE({stagedCount:e,headSha:t,branch:n,amendable:r}){let i=I(e=>e.performCommit),a=I(e=>e.performRefAction),o=I(e=>e.runStageAction),s=I(e=>e.showError),c=I(e=>e.pendingMutation),l=I(e=>e.repoId),u=I(e=>e.worktreeCommitMessage),d=I(e=>e.setWorktreeCommitMessage),[f,p]=(0,b.useState)(()=>{try{return localStorage.getItem(`commitNoVerify`)===`true`}catch{return!1}}),[m,h]=(0,b.useState)(!1),[g,_]=(0,b.useState)(!1),[v,x]=(0,b.useState)(()=>{try{return localStorage.getItem(`commitSubmitAction`)===`commit-and-push`?`commit-and-push`:`commit`}catch{return`commit`}}),[S,C]=(0,b.useState)(!1),[w,T]=(0,b.useState)(!1),ee=(0,b.useRef)(null),[E,D]=(0,b.useState)(``),te=m&&r;(0,b.useEffect)(()=>{if(!S)return;let e=e=>{ee.current?.contains(e.target)||C(!1)},t=e=>{e.key===`Escape`&&C(!1)};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[S]);let ne=e=>{try{localStorage.setItem(`commitNoVerify`,String(e))}catch{}p(e)},re=async e=>{if(h(e),e){_(!0);let e=await o(`stage-all`,[]);if(_(!1),!e){h(!1);return}if(u.trim().length===0&&l&&t)try{let e=await on(l,t),n=e.body?`${e.subject}\n\n${e.body}`:e.subject;I.getState().worktreeCommitMessage.trim().length===0&&(d(n),D(n))}catch{}}else u===E&&(d(``),D(``))},ie=e>0&&u.trim().length>0&&!g&&!c,ae=ie&&(v===`commit`||!!n),oe=e=>{try{localStorage.setItem(`commitSubmitAction`,e)}catch{}x(e),C(!1)},se=async()=>{if(!ae||!await i(u.trim(),f,te)||(d(``),D(``),h(!1),v!==`commit-and-push`||!n))return;let e=I.getState(),r=e.refs.find(e=>e.kind===`head`&&e.isCurrent),o=r?.shortName??n,c=r?.targetSha??e.worktreeChanges?.headSha??t;if(!c){s(`Push failed`,`Could not determine the committed revision to push`);return}T(!0);try{await a(`push`,o,c)}catch(e){e&&typeof e==`object`&&e.code===`CONFLICT`?s(`Push rejected`,e,{label:`Force push`,run:()=>{a(`push`,o,c,!0).catch(e=>s(`Force push failed`,e))}}):s(`Push failed`,e)}finally{T(!1)}},O=g?`Staging…`:w?`Pushing…`:c?te?`Amending…`:`Committing…`:`${te?`Amend`:`Commit`}${v===`commit-and-push`?` & push`:``}${e>0?` (${e})`:``}`;return(0,y.jsxs)(`div`,{style:{borderBottom:`1px solid #313244`,padding:`10px 12px`,display:`flex`,flexDirection:`column`,gap:8,flexShrink:0},children:[(0,y.jsx)(`textarea`,{value:u,onChange:e=>d(e.target.value),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&(e.preventDefault(),se())},placeholder:te?`Amend commit message`:e>0?`Commit message`:`Stage files to commit`,rows:3,style:{resize:`vertical`,minHeight:54,background:`#11111b`,border:`1px solid #313244`,borderRadius:6,color:`#cdd6f4`,fontSize:12,fontFamily:`inherit`,padding:`8px 10px`,outline:`none`},onFocus:e=>{e.currentTarget.style.borderColor=`#89b4fa`},onBlur:e=>{e.currentTarget.style.borderColor=`#313244`}}),(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:8},children:[(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12,minWidth:0},children:[r&&(0,y.jsxs)(`label`,{title:`Replace the previous commit (git commit --amend) instead of creating a new one`,style:{display:`flex`,alignItems:`center`,gap:6,fontSize:11,color:`#a6adc8`,cursor:`pointer`,userSelect:`none`},children:[(0,y.jsx)(`input`,{type:`checkbox`,checked:m,disabled:g,onChange:e=>void re(e.target.checked),style:{accentColor:`#cba6f7`,cursor:g?`default`:`pointer`}}),`Amend`]}),(0,y.jsxs)(`label`,{title:`Commit with --no-verify (skips pre-commit and commit-msg hooks)`,style:{display:`flex`,alignItems:`center`,gap:6,fontSize:11,color:`#a6adc8`,cursor:`pointer`,userSelect:`none`},children:[(0,y.jsx)(`input`,{type:`checkbox`,checked:f,onChange:e=>ne(e.target.checked),style:{accentColor:`#fab387`,cursor:`pointer`}}),`Skip git hooks`]})]}),(0,y.jsxs)(`div`,{ref:ee,style:{display:`flex`,position:`relative`,flexShrink:0},children:[(0,y.jsx)(`button`,{onClick:()=>void se(),disabled:!ae,title:v===`commit-and-push`&&!n?`Check out a branch before committing and pushing`:void 0,style:{background:ae?`#a6e3a1`:`#313244`,color:ae?`#11111b`:`#6c7086`,border:`none`,borderRadius:`6px 0 0 6px`,fontSize:12,fontWeight:700,padding:`6px 12px 6px 14px`,cursor:ae?`pointer`:`default`,fontFamily:`inherit`,whiteSpace:`nowrap`},children:O}),(0,y.jsx)(`button`,{type:`button`,"aria-label":`Choose commit action`,"aria-haspopup":`menu`,"aria-expanded":S,disabled:g||c||w,onClick:()=>C(e=>!e),style:{width:28,background:ie?`#a6e3a1`:`#313244`,color:ie?`#11111b`:`#6c7086`,border:`none`,borderLeft:`1px solid ${ie?`#11111b33`:`#45475a`}`,borderRadius:`0 6px 6px 0`,cursor:g||c||w?`default`:`pointer`,fontFamily:`inherit`,fontSize:10,fontWeight:700},children:`▼`}),S&&(0,y.jsx)(`div`,{role:`menu`,"aria-label":`Commit action`,style:{position:`absolute`,right:0,bottom:`calc(100% + 6px)`,zIndex:50,minWidth:154,padding:4,border:`1px solid #45475a`,borderRadius:7,background:`#1e1e2e`,boxShadow:`0 8px 24px #00000066`},children:[[`commit`,`Commit`],[`commit-and-push`,`Commit & push`]].map(([e,t])=>(0,y.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":v===e,onClick:()=>oe(e),style:{display:`flex`,alignItems:`center`,gap:8,width:`100%`,padding:`7px 9px`,border:`none`,borderRadius:5,background:v===e?`#313244`:`transparent`,color:`#cdd6f4`,cursor:`pointer`,fontFamily:`inherit`,fontSize:12,textAlign:`left`,whiteSpace:`nowrap`},children:[(0,y.jsx)(`span`,{style:{width:12,color:`#a6e3a1`},children:v===e?`✓`:``}),t]},e))})]})]})]})}function hE({operation:e,conflictedCount:t}){let n=I(e=>e.abortInProgressOperation),r=I(e=>e.continueInProgressOperation),i=I(e=>e.pendingMutation),a=e===`rebase`?`Rebase`:`Merge`,o=t>0?`${a} conflict`:`${a} in progress`,s=t>0?`${t} conflicted file${t===1?``:`s`} — resolve and stage them, then continue`:`All conflicts resolved — continue the ${e} to finish.`,c=!i&&t===0;return(0,y.jsxs)(`div`,{style:{border:`1px solid #8b3a4a`,background:`#5c243033`,borderRadius:7,padding:`10px 10px`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:12},children:[(0,y.jsxs)(`div`,{style:{minWidth:0,display:`flex`,flexDirection:`column`,gap:2},children:[(0,y.jsx)(`span`,{style:{color:`#f5a6b8`,fontSize:13,fontWeight:700},children:o}),(0,y.jsx)(`span`,{style:{color:`#a6adc8`,fontSize:11},children:s})]}),(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6,flexShrink:0},children:[(0,y.jsx)(`span`,{title:c?void 0:t>0?`Stage all conflicted files first`:void 0,children:(0,y.jsx)(U,{label:i?`Working…`:`Continue ${a}`,tone:`success`,onClick:()=>void r(e),disabled:!c})}),(0,y.jsx)(U,{label:i?`Aborting…`:`Abort ${a}`,tone:`danger`,onClick:()=>void n(e),disabled:i})]})]})}function gE(){let e=I(e=>e.worktreeChanges),t=I(e=>e.runStageAction),n=I(e=>e.createStash),r=I(e=>e.pendingMutation),i=I(e=>e.repoId),a=sE(),[o,s]=(0,b.useState)(!1),[c,l]=(0,b.useState)(null),[u,d]=(0,b.useState)(null),f=e?.staged??[],p=e?.unstaged??[],m=(0,b.useMemo)(()=>new Set([...f,...p].map(e=>e.path)).size,[f,p]),h=e?.mergeHeadShas?.length?`merge`:e?.rebaseHeadSha?`rebase`:null,g=(0,b.useMemo)(()=>new Set(p.filter(e=>e.status===`U`).map(e=>e.path)).size,[p]),_=e=>{l({title:`Discard file changes?`,message:`Discard all staged and unstaged changes to “${e.path}”? This cannot be undone.`,paths:e.oldPath?[e.path,e.oldPath]:[e.path],all:!1})},v=()=>{l({title:`Discard all changes?`,message:`Permanently discard changes in ${m} file${m===1?``:`s`}, including untracked files? This cannot be undone.`,paths:[],all:!0})},x=()=>{let e=c;l(null),e&&t(e.all?`discard-all`:`discard`,e.paths)},S=async(e,t)=>{if(!i||u?.running)return;d({path:e.path,command:``,output:``,running:!0});let n=e=>{if(e.type===`start`){d(t=>t&&{...t,command:e.command});return}if(e.type===`output`){d(t=>t&&{...t,output:t.output+e.text});return}if(e.ok&&e.changes){I.setState({worktreeChanges:e.changes,worktreeFileDiffs:{}}),d(null);return}let t=e.error??`Package manager install failed`;d(e=>e&&{...e,running:!1,error:t,output:e.output.endsWith(`
|
|
679
|
+
`)?`${e.output}\n${t}\n`:`${e.output}\n\n${t}\n`})};try{let r=await tn(i,e.path,t.fileName,t.command);for(;;){let e=await r.next();if(e.done)break;n(e.value)}}catch(e){let t=e instanceof Error?e.message:String(e);d(e=>e&&{...e,running:!1,error:t,output:`${e.output}\n\n${t}\n`})}};return(0,y.jsxs)(`div`,{"data-testid":`working-tree-detail`,style:{position:`absolute`,right:0,bottom:0,zIndex:40,width:480,height:`fit-content`,maxHeight:`100%`,borderLeft:`1px solid #313244`,borderTop:`1px solid #313244`,background:`#181825`,display:`flex`,flexDirection:`column`,overflow:`hidden`},children:[(0,y.jsx)(np,{open:o,title:`Stash changes`,label:`Message (optional)`,placeholder:`Describe these changes`,confirmLabel:`Stash`,allowEmpty:!0,onSubmit:e=>{s(!1),n(e||void 0)},onClose:()=>s(!1)}),(0,y.jsx)(_v,{state:u,onClose:()=>d(null)}),(0,y.jsx)(rp,{open:!!c,title:c?.title??``,message:c?.message??``,confirmLabel:`Discard`,onConfirm:x,onClose:()=>l(null)}),(0,y.jsxs)(`div`,{style:{padding:`14px 16px 10px`,borderBottom:`1px solid #313244`},children:[(0,y.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`baseline`,gap:8,minWidth:0},children:[(0,y.jsx)(`span`,{style:{fontSize:14,fontWeight:700,color:`#cdd6f4`,flexShrink:0},children:`Working tree`}),e?.branch&&(0,y.jsxs)(`span`,{style:{fontSize:12,color:`#89b4fa`,fontFamily:`monospace`,overflow:`hidden`,textOverflow:`ellipsis`},children:[`⎇ `,e.branch]})]})}),(0,y.jsx)(`div`,{style:{fontSize:11,color:`#6c7086`,marginTop:2},children:m===0?`No changes`:`${m} changed file${m===1?``:`s`}`})]}),(0,y.jsx)(mE,{stagedCount:f.length,headSha:e?.headSha,branch:e?.branch,amendable:!h&&!!e?.headSha}),(0,y.jsxs)(`div`,{style:{flex:`1 1 auto`,minHeight:0,overflow:`auto`,padding:`12px 10px`,display:`flex`,flexDirection:`column`,gap:16},children:[h&&(0,y.jsx)(hE,{operation:h,conflictedCount:g}),m===0?(0,y.jsx)(`div`,{style:{color:`#45475a`,fontSize:13,textAlign:`center`,marginTop:28},children:`Working tree clean`}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(pE,{title:`Staged`,files:f,area:`staged`,bulkLabel:`Unstage all`,bulkDisabled:r,onBulk:()=>t(`unstage-all`,[]),rowActionLabel:`Unstage`,onRowAction:e=>t(`unstage`,[e.path]),onDiscard:_}),(0,y.jsx)(pE,{title:`Changes`,files:p,area:`unstaged`,bulkLabel:`Stage all`,bulkTone:`success`,bulkDisabled:r,onBulk:()=>t(`stage-all`,[]),rowActionLabel:e=>e.status===`U`?`Mark resolved`:`Stage`,onRowAction:e=>t(`stage`,[e.path]),onDiscard:_,resolvingLockfilePath:u?.running?u.path:void 0,conflictResolvers:a,onInstallAndResolve:(e,t)=>void S(e,t)})]})]}),m>0&&(0,y.jsxs)(`div`,{style:{flexShrink:0,display:`flex`,alignItems:`center`,justifyContent:`flex-end`,gap:8,padding:`10px 12px`,borderTop:`1px solid #313244`},children:[(0,y.jsx)(U,{label:`Stash all`,tone:`neutral`,disabled:r,onClick:()=>s(!0)}),(0,y.jsx)(U,{label:`Discard all`,tone:`danger`,variant:`ghost`,disabled:r,onClick:v})]})]})}var _E={A:`#a6e3a1`,M:`#f9e2af`,D:`#f38ba8`,R:`#cba6f7`,C:`#94e2d5`,T:`#89b4fa`,U:`#fab387`};function vE(e){return new Date(e*1e3).toLocaleString(void 0,{year:`numeric`,month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}function yE({stash:e,diff:t,busy:n,onApply:r,onDrop:i,onNavigate:a}){let[o,s]=(0,b.useState)(!1),[c,l]=(0,b.useState)(!1),u=async()=>{if(!n){s(!0);try{await r(e.sha)}finally{s(!1)}}},d=async()=>{if(!n&&window.confirm(`Drop ${e.selector}? This permanently deletes the stashed changes.`)){l(!0);try{await i(e.sha)}finally{l(!1)}}};return(0,y.jsxs)(`div`,{style:{width:400,flexShrink:0,height:`100%`,background:`#181825`,borderLeft:`1px solid #313244`,display:`flex`,flexDirection:`column`,overflow:`hidden`},children:[(0,y.jsxs)(`div`,{style:{padding:`14px 16px 12px`,borderBottom:`1px solid #313244`,flexShrink:0},children:[(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:10},children:[(0,y.jsx)(`span`,{style:{padding:`2px 6px`,borderRadius:4,background:`#55323c`,color:`#f5c2e7`,fontFamily:`monospace`,fontSize:11,fontWeight:700},children:e.selector}),(0,y.jsx)(`span`,{style:{color:`#6c7086`,fontFamily:`monospace`,fontSize:10},children:e.sha.slice(0,10)})]}),(0,y.jsx)(`p`,{style:{margin:`0 0 11px`,color:`#cdd6f4`,fontSize:14,fontWeight:600,lineHeight:1.4},children:e.message||`Stashed changes`}),(0,y.jsxs)(`div`,{style:{display:`flex`,gap:8,marginBottom:3,fontSize:12},children:[(0,y.jsx)(`span`,{style:{minWidth:58,color:`#6c7086`},children:`Created`}),(0,y.jsx)(`span`,{style:{color:`#a6adc8`},children:vE(e.createdAt)})]}),(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:12,fontSize:12},children:[(0,y.jsx)(`span`,{style:{minWidth:58,color:`#6c7086`},children:`Parent`}),(0,y.jsx)(`button`,{type:`button`,onClick:()=>a(e.parentSha),title:`Navigate to ${e.parentSha}`,style:{padding:0,border:`none`,background:`none`,color:`#89b4fa`,fontFamily:`monospace`,fontSize:11,textDecoration:`underline`,textUnderlineOffset:2,cursor:`pointer`},children:e.parentSha.slice(0,12)})]}),(0,y.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,y.jsx)(`button`,{type:`button`,onClick:()=>void u(),disabled:n,style:{padding:`5px 11px`,border:`1px solid #b87b89`,borderRadius:4,background:n?`#55323c`:`#f5c2e7`,color:n?`#a77b86`:`#311f25`,fontSize:11,fontWeight:750,cursor:n?`default`:`pointer`},children:o?`Applying…`:`Apply stash`}),(0,y.jsx)(`button`,{type:`button`,onClick:()=>void d(),disabled:n,style:{padding:`5px 11px`,border:`1px solid #f38ba866`,borderRadius:4,background:`#311f25`,color:n?`#8b626c`:`#f38ba8`,fontSize:11,fontWeight:700,cursor:n?`default`:`pointer`},children:c?`Dropping…`:`Drop stash`})]})]}),(0,y.jsx)(`div`,{style:{flex:1,overflowY:`auto`},children:t?t.changedPaths.length>0?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(`div`,{style:{position:`sticky`,top:0,display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:12,padding:`8px 16px 4px`,background:`#181825`,color:`#6c7086`,fontSize:11,fontWeight:700,letterSpacing:`0.08em`,textTransform:`uppercase`,zIndex:1},children:[(0,y.jsxs)(`span`,{children:[`Stashed files (`,t.changedPaths.length,`)`]}),(0,y.jsxs)(`span`,{style:{display:`flex`,gap:10,fontSize:10,letterSpacing:`0.04em`},children:[(0,y.jsxs)(`span`,{style:{color:`#a6e3a1`},children:[`+`,t.additions]}),(0,y.jsxs)(`span`,{style:{color:`#f38ba8`},children:[`-`,t.deletions]})]})]}),t.changedPaths.map((t,n)=>(0,y.jsx)(bE,{stashSha:e.sha,file:t},`${t.status}:${t.oldPath??``}:${t.path}:${n}`))]}):(0,y.jsx)(`div`,{style:{padding:16,color:`#6c7086`,fontSize:13},children:`No changed files`}):(0,y.jsx)(`div`,{style:{padding:16,color:`#6c7086`,fontSize:12},children:`Loading stashed files…`})})]})}function bE({stashSha:e,file:t}){let[n,r]=(0,b.useState)(!1),i=I(e=>e.loadStashFileDiff),a=I(n=>n.stashFileDiffs[Gr(e,t.path)]),o=t.oldPath?`${t.oldPath} → ${t.path}`:t.path,s=_E[t.status]??`#cdd6f4`;return(0,b.useEffect)(()=>{n&&!a&&i(e,t)},[n,a,e,t,i]),(0,y.jsxs)(`div`,{children:[(0,y.jsxs)(`button`,{type:`button`,onClick:()=>{let a=!n;r(a),a&&i(e,t)},style:{width:`100%`,display:`flex`,alignItems:`center`,gap:8,padding:`5px 16px`,border:`none`,borderBottom:`1px solid #1e1e2e`,background:`transparent`,color:`#cdd6f4`,fontFamily:`inherit`,fontSize:12,textAlign:`left`,cursor:`pointer`},children:[(0,y.jsx)(`span`,{style:{width:10,flexShrink:0,color:`#6c7086`,fontSize:9},children:n?`▼`:`▶`}),(0,y.jsx)(`span`,{style:{width:18,height:18,flexShrink:0,display:`flex`,alignItems:`center`,justifyContent:`center`,borderRadius:3,background:`${s}33`,color:s,fontSize:10,fontWeight:700},children:t.status}),(0,y.jsx)(`span`,{title:o,style:{flex:1,minWidth:0,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,color:`#a6adc8`,fontFamily:`monospace`,fontSize:12},children:o})]}),n&&a&&(0,y.jsx)(tv,{entry:a,path:t.path})]})}function xE({error:e,onDismiss:t}){let[n,r]=(0,b.useState)(!1);return(0,b.useEffect)(()=>{if(!e)return;r(!1);let n=e=>{e.key===`Escape`&&t()};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,t]),e?(0,y.jsx)(`div`,{onClick:t,style:{position:`fixed`,inset:0,background:`rgba(17, 17, 27, 0.75)`,display:`flex`,alignItems:`center`,justifyContent:`center`,zIndex:1e3,padding:24},children:(0,y.jsxs)(`div`,{onClick:e=>e.stopPropagation(),role:`alertdialog`,"aria-modal":`true`,"aria-labelledby":`error-dialog-title`,style:{background:`#1e1e2e`,border:`1px solid #45475a`,borderRadius:8,boxShadow:`0 12px 40px rgba(0, 0, 0, 0.5)`,maxWidth:760,width:`100%`,maxHeight:`80vh`,display:`flex`,flexDirection:`column`,overflow:`hidden`},children:[(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,padding:`14px 18px`,borderBottom:`1px solid #313244`,background:`#181825`},children:[(0,y.jsx)(`span`,{id:`error-dialog-title`,style:{fontSize:14,fontWeight:600,color:`#f38ba8`},children:e.title}),(0,y.jsx)(`button`,{type:`button`,onClick:t,"aria-label":`Close`,style:{background:`transparent`,border:`none`,color:`#6c7086`,fontSize:20,lineHeight:1,cursor:`pointer`,padding:4},children:`×`})]}),(0,y.jsx)(`pre`,{style:{margin:0,padding:`16px 18px`,overflow:`auto`,flex:1,fontFamily:`ui-monospace, SFMono-Regular, Menlo, Consolas, monospace`,fontSize:12.5,lineHeight:1.5,color:`#cdd6f4`,whiteSpace:`pre-wrap`,wordBreak:`break-word`,userSelect:`text`},children:e.message}),(0,y.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:8,padding:`12px 18px`,borderTop:`1px solid #313244`,background:`#181825`},children:[(0,y.jsx)(`button`,{type:`button`,onClick:async()=>{try{await navigator.clipboard.writeText(e.message),r(!0),setTimeout(()=>r(!1),1500)}catch{}},style:{background:`#313244`,color:`#cdd6f4`,border:`1px solid #45475a`,borderRadius:6,padding:`6px 14px`,fontSize:13,cursor:`pointer`},children:n?`Copied`:`Copy`}),e.action&&(0,y.jsx)(`button`,{type:`button`,onClick:()=>{e.action?.run(),t()},style:{background:`#f9e2af`,color:`#1e1e2e`,border:`none`,borderRadius:6,padding:`6px 14px`,fontSize:13,fontWeight:600,cursor:`pointer`},children:e.action.label}),(0,y.jsx)(`button`,{type:`button`,onClick:t,style:{background:`#89b4fa`,color:`#1e1e2e`,border:`none`,borderRadius:6,padding:`6px 14px`,fontSize:13,fontWeight:600,cursor:`pointer`},children:`Close`})]})]})}):null}function SE(e){let t=e.split(`/`).filter(Boolean);return t[t.length-1]??e}function CE(e){let t=new Set(e.map(e=>e.agent)).size>1?`Agents ×${e.length}`:`${e[0].agent[0].toUpperCase()}${e[0].agent.slice(1)} ×${e.length}`,n=e.filter(e=>e.busy).length;return n>0?`${t} · ${n} working`:t}function wE(){let{sessions:e,capabilities:t,focusingPid:n,installing:r,focus:i,install:a,canInstallWindowCalls:o}=Hi(),[s,c]=(0,b.useState)(!1),[l,u]=(0,b.useState)(()=>{try{return localStorage.getItem(`agentSessionsShowAll`)===`true`}catch{return!1}}),d=e=>{try{localStorage.setItem(`agentSessionsShowAll`,String(e))}catch{}u(e)},[f,p]=(0,b.useState)(null),m=I(e=>e.repoPath),h=I(e=>e.openRepoByPath),g=(0,b.useRef)(null);(0,b.useEffect)(()=>{if(!s)return;let e=e=>{g.current&&!g.current.contains(e.target)&&c(!1)};return window.addEventListener(`pointerdown`,e),()=>window.removeEventListener(`pointerdown`,e)},[s]);let _=async e=>{await i(e)&&c(!1)},v=e=>{!e.gitRoot||e.gitRoot===m||(c(!1),h(e.gitRoot))};if(e.length===0)return null;let x=zi(e),S=m?x.filter(e=>e.gitRoot===m||e.cwd===m):[],C=x.filter(e=>!S.includes(e)),w=m===null||l?[...S,...C]:S,T=m!==null&&!l?C.length:0;return(0,y.jsxs)(`div`,{ref:g,style:{position:`relative`,flexShrink:0},children:[(0,y.jsxs)(`button`,{onClick:e=>{let t=e.currentTarget.getBoundingClientRect();p({top:t.bottom+4,right:window.innerWidth-t.right}),c(e=>!e)},title:`${e.length} agent session${e.length===1?``:`s`} running`,"aria-label":`Agent sessions`,style:{display:`flex`,alignItems:`center`,gap:5,padding:`4px 10px`,borderRadius:4,border:`1px solid ${S.length>0?`#a6e3a155`:`#313244`}`,background:S.length>0?`#a6e3a115`:`transparent`,color:S.length>0?`#a6e3a1`:`#6c7086`,fontSize:11,cursor:`pointer`},children:[[...new Set(e.map(e=>e.agent))].map(t=>(0,y.jsx)(Gi,{agent:t,size:12,busy:e.some(e=>e.agent===t&&e.busy)},t)),CE(e)]}),s&&f&&(0,y.jsxs)(`div`,{style:{position:`fixed`,top:f.top,right:f.right,width:480,maxWidth:`calc(100vw - 16px)`,maxHeight:320,overflowY:`auto`,background:`#181825`,border:`1px solid #313244`,borderRadius:6,boxShadow:`0 8px 24px #00000088`,zIndex:100,padding:4},children:[o&&(0,y.jsxs)(`div`,{style:{padding:`8px 8px 10px`,borderBottom:`1px solid #313244`,marginBottom:4},children:[(0,y.jsx)(`div`,{style:{color:`#a6adc8`,fontSize:11,marginBottom:6,lineHeight:1.4},children:`Focusing terminal windows needs the “Activate Window By Title” GNOME\xA0Shell extension.`}),(0,y.jsx)(`button`,{onClick:()=>void a(),disabled:r,style:{padding:`4px 10px`,borderRadius:4,border:`1px solid #89b4fa55`,background:`#89b4fa20`,color:r?`#45475a`:`#89b4fa`,fontSize:11,cursor:r?`default`:`pointer`},children:r?`Waiting for GNOME confirmation…`:`Install extension`})]}),w.length===0&&(0,y.jsx)(`div`,{style:{padding:`8px`,color:`#585b70`,fontSize:11},children:`No agents running in this repository`}),w.map(e=>{let r=m!==null&&(e.gitRoot===m||e.cwd===m),i=e.gitRoot!==null&&!r,a=!e.focusable,o=a?e.kind===`terminal`?t?.displayServer===`wayland`?`Can't focus terminal windows on Wayland — install the 'Activate Window By Title' GNOME Shell extension`:`Can't focus terminal windows — install wmctrl`:`This session has no window to focus`:`Focus ${e.agent} window · ${Vi(e)} (pid ${e.pid})`;return(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,width:`100%`,borderRadius:4,background:`transparent`,opacity:n!==null&&n!==e.pid?.5:1},onMouseEnter:e=>{e.currentTarget.style.background=`#31324466`},onMouseLeave:e=>{e.currentTarget.style.background=`transparent`},children:[(0,y.jsxs)(`button`,{onClick:()=>v(e),disabled:!i,title:r?`${e.cwd} · currently open repository`:e.gitRoot?`Switch to ${e.gitRoot}`:`${e.cwd} · not inside a Git repository`,style:{display:`flex`,alignItems:`center`,gap:8,flex:1,minWidth:0,padding:`6px 8px`,border:`none`,background:`transparent`,color:`#a6adc8`,fontSize:11,textAlign:`left`,cursor:i?`pointer`:`default`},children:[(0,y.jsx)(`span`,{style:{flexShrink:0,display:`inline-flex`},children:(0,y.jsx)(Gi,{agent:e.agent,size:13,busy:e.busy??!1})}),(0,y.jsxs)(`span`,{style:{flexShrink:0,fontFamily:`monospace`},children:[SE(e.cwd),e.count>1?` ×${e.count}`:``]}),(0,y.jsx)(`span`,{style:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,flex:1,color:`#7f849c`,textAlign:`right`},children:e.title??Vi(e)}),e.busy&&(0,y.jsx)(`span`,{style:{flexShrink:0,color:`#f9e2af`,fontSize:10},children:`working`}),r&&(0,y.jsx)(`span`,{style:{flexShrink:0,color:`#a6e3a1`,fontSize:10},children:`this repo`})]}),(0,y.jsx)(`button`,{onClick:()=>!a&&void _(e),disabled:a||n!==null,title:o,style:{flexShrink:0,marginRight:6,padding:`3px 7px`,border:`1px solid #89b4fa55`,borderRadius:4,background:`#89b4fa18`,color:a?`#45475a`:`#89b4fa`,fontSize:10,cursor:a||n!==null?`default`:`pointer`},children:n===e.pid?`Focusing…`:`Focus on window`})]},`${e.pid}:${e.cwd}`)}),T>0&&(0,y.jsxs)(`button`,{onClick:()=>d(!0),style:{display:`block`,width:`100%`,padding:`6px 8px`,marginTop:w.length>0?2:0,border:`none`,borderTop:w.length>0?`1px solid #313244`:`none`,background:`transparent`,color:`#6c7086`,fontSize:11,textAlign:`left`,cursor:`pointer`},children:[`▸ Show `,T,` agent`,T===1?``:`s`,` in other repositories`]}),m!==null&&l&&C.length>0&&(0,y.jsx)(`button`,{onClick:()=>d(!1),style:{display:`block`,width:`100%`,padding:`6px 8px`,border:`none`,borderTop:`1px solid #313244`,background:`transparent`,color:`#6c7086`,fontSize:11,textAlign:`left`,cursor:`pointer`},children:`▾ Hide agents in other repositories`})]})]})}var TE=`modulepreload`,EE=function(e){return`/`+e},DE={},OE=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=EE(t,n),t=s(t),t in DE)return;DE[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:TE,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},kE=(0,b.lazy)(async()=>({default:(await OE(()=>import(`./SettingsDialog-DRhvy5Hz.js`),[])).SettingsDialog})),AE=`ingit`,jE=8;function ME(e){if(e.trim().length===0)return null;let t=Math.max(e.lastIndexOf(`/`),e.lastIndexOf(`\\`));if(t===-1)return{folder:`.`,prefix:e};let n=e.slice(t+1),r=e[t],i=e.slice(0,t);return/^[A-Za-z]:$/.test(i)&&(i+=r),i||=e.startsWith(`/`)||e.startsWith(`\\`)?r:`.`,{folder:i,prefix:n}}function NE(e){return e.replace(/[\\/]+$/,``).split(/[\\/]+/).at(-1)||e}function PE(e){if(!e)return 0;let t=new Set;for(let n of e.staged)t.add(n.path);for(let n of e.unstaged)t.add(n.path);return t.size}function FE(){let[e,t]=(0,b.useState)(!1),[n,r]=(0,b.useState)(!1),[i,a]=(0,b.useState)(!1),[o,s]=(0,b.useState)(``),[c,l]=(0,b.useState)(!1),[u,d]=(0,b.useState)(!1),[f,p]=(0,b.useState)(!1),[m,h]=(0,b.useState)(!1),[g,_]=(0,b.useState)([]),[v,x]=(0,b.useState)(0),[S,C]=(0,b.useState)(null),w=(0,b.useRef)(null),{status:T,repoId:ee,repoPath:D,currentWorktreePath:te,worktrees:ne,recentRepos:re,discoveredFolder:ie,discoveredRepos:ae,openError:oe,errorDialog:se,dismissError:O,showError:ce,openRepoByPath:le,closeRepo:ue,openFromUrl:de,performRefAction:fe,showCommitMessages:pe,setShowCommitMessages:k,viewMode:me,setViewMode:he,worktreeChanges:ge,reloadFromServer:_e}=I(E(e=>({status:e.status,repoId:e.repoId,repoPath:e.repoPath,currentWorktreePath:e.currentWorktreePath,worktrees:e.worktrees,recentRepos:e.recentRepos,discoveredFolder:e.discoveredFolder,discoveredRepos:e.discoveredRepos,openError:e.openError,errorDialog:e.errorDialog,dismissError:e.dismissError,showError:e.showError,openRepoByPath:e.openRepoByPath,closeRepo:e.closeRepo,openFromUrl:e.openFromUrl,performRefAction:e.performRefAction,showCommitMessages:e.showCommitMessages,setShowCommitMessages:e.setShowCommitMessages,viewMode:e.viewMode,setViewMode:e.setViewMode,worktreeChanges:e.worktreeChanges,reloadFromServer:e.reloadFromServer}))),ve=async()=>{if(!i){a(!0);try{await fe(`fetch`,``,``)}catch(e){ce(`Fetch failed`,e)}finally{a(!1)}}};(0,b.useEffect)(()=>{let e=()=>de();return window.addEventListener(`hashchange`,e),de(),()=>window.removeEventListener(`hashchange`,e)},[de]),(0,b.useEffect)(()=>{T!==`ready`||!ee||ve()},[ee,T]),(0,b.useEffect)(()=>{s(D??``),d(!1),p(!1)},[D]),(0,b.useEffect)(()=>{if(!c||!u){p(!1),h(!1);return}let e=ME(o);if(!e){_([]),p(!1),h(!1);return}let t=!1,n=window.setTimeout(()=>{h(!0),Ut(e.folder).then(n=>{if(t)return;let r=e.prefix.toLowerCase(),i=n.entries.filter(e=>r.length===0||e.name.toLowerCase().startsWith(r)).slice(0,jE);_(i),x(0),p(i.length>0)}).catch(()=>{t||(_([]),p(!1))}).finally(()=>{t||h(!1)})},120);return()=>{t=!0,window.clearTimeout(n)}},[u,c,o]),(0,b.useEffect)(()=>{if(T!==`ready`||!D){document.title=AE;return}document.title=`${NE(D)} (${PE(ge)})`},[T,D,ge]),(0,b.useEffect)(()=>{let e=document.visibilityState===`hidden`?Date.now():null,t=()=>{e=Date.now()},n=()=>{document.visibilityState!==`hidden`&&(e!==null&&Date.now()-e>3e4&&_e(),e=null)},r=()=>{document.visibilityState===`hidden`?t():n()};return window.addEventListener(`blur`,t),window.addEventListener(`focus`,n),document.addEventListener(`visibilitychange`,r),()=>{window.removeEventListener(`blur`,t),window.removeEventListener(`focus`,n),document.removeEventListener(`visibilitychange`,r)}},[_e]);let ye=e=>{e.preventDefault();let t=o.trim();if(!t||t===D){s(D??``),l(!1),e.currentTarget.querySelector(`input`)?.blur();return}le(t)},be=()=>{let e=w.current?.getBoundingClientRect();e&&C({top:e.bottom+4,left:e.left,width:e.width})},xe=e=>{s(e.path),d(!1),p(!1),x(0)},Se=c&&S!==null&&(m||f&&g.length>0);return T===`no-repo`?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(Zi,{onOpen:le,error:oe,recentRepos:re,discoveredFolder:ie,discoveredRepos:ae}),(0,y.jsx)(`button`,{type:`button`,onClick:()=>r(!0),title:`Open settings`,"aria-label":`Open settings`,style:{position:`fixed`,top:14,right:14,zIndex:20,padding:`6px 11px`,border:`1px solid #45475a`,borderRadius:6,background:`#181825`,color:`#a6adc8`,fontSize:11,fontWeight:700,cursor:`pointer`},children:`Settings`}),n&&(0,y.jsx)(b.Suspense,{fallback:null,children:(0,y.jsx)(kE,{open:!0,onClose:()=>r(!1)})}),(0,y.jsx)(xE,{error:se,onDismiss:O})]}):T===`loading`?(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`center`,height:`100%`,width:`100%`,background:`#1e1e2e`,flexDirection:`column`,gap:16},children:[(0,y.jsx)(RE,{}),(0,y.jsx)(`span`,{style:{color:`#6c7086`,fontSize:13},children:`Opening repository…`})]}):(0,y.jsxs)(`div`,{style:{position:`relative`,display:`flex`,height:`100%`,width:`100%`,overflow:`hidden`,background:`#1e1e2e`},children:[e&&(0,y.jsx)(IE,{onClose:()=>t(!1),onOpenSettings:()=>r(!0),settingsOpen:n}),(0,y.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,overflow:`hidden`},children:[(0,y.jsxs)(`div`,{style:{height:36,flexShrink:0,display:`flex`,alignItems:`center`,padding:`0 14px`,borderBottom:`1px solid #313244`,background:`#181825`,fontSize:12,color:`#6c7086`,gap:8,overflow:`hidden`},children:[!e&&(0,y.jsx)(`button`,{onClick:()=>t(!0),title:`Show refs`,"aria-label":`Show refs`,style:{width:24,height:20,flexShrink:0,padding:0,borderRadius:3,border:`1px solid #313244`,background:`#1e1e2e`,color:`#6c7086`,fontSize:13,lineHeight:`18px`,cursor:`pointer`},children:`☰`}),me===`history`&&(0,y.jsx)(`button`,{onClick:()=>k(!pe),style:{flexShrink:0,padding:`4px 10px`,borderRadius:4,border:`1px solid ${pe?`#89b4fa55`:`#313244`}`,background:pe?`#89b4fa20`:`transparent`,color:pe?`#89b4fa`:`#6c7086`,fontSize:11,cursor:`pointer`},title:pe?`Hide commit messages`:`Show commit messages`,children:pe?`Hide messages`:`Show messages`}),(0,y.jsxs)(`div`,{style:{flexShrink:0,display:`flex`,borderRadius:4,border:`1px solid #313244`,overflow:`hidden`},children:[(0,y.jsx)(`button`,{onClick:()=>he(`history`),style:{padding:`4px 10px`,border:`none`,background:me===`history`?`#89b4fa20`:`transparent`,color:me===`history`?`#89b4fa`:`#6c7086`,fontSize:11,cursor:`pointer`},title:`Branch history graph`,children:`History`}),(0,y.jsx)(`button`,{onClick:()=>he(`reflog`),style:{padding:`4px 10px`,border:`none`,borderLeft:`1px solid #313244`,background:me===`reflog`?`#f9e2af20`:`transparent`,color:me===`reflog`?`#f9e2af`:`#6c7086`,fontSize:11,cursor:`pointer`},title:`Reflog time machine — recover lost commits and see where HEAD has been`,children:`Time Machine`})]}),ne.filter(e=>!e.bare).length>1&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`span`,{style:{color:`#45475a`,marginLeft:8},children:`worktree`}),(0,y.jsx)(`select`,{value:te??``,onChange:e=>{e.target.value&&e.target.value!==te&&le(e.target.value)},title:`Switch linked worktree`,"aria-label":`Current linked worktree`,style:{maxWidth:220,flexShrink:1,minWidth:90,padding:`3px 5px`,border:`1px solid #313244`,borderRadius:4,outline:`none`,background:`#1e1e2e`,color:`#a6adc8`,fontFamily:`monospace`,fontSize:11},children:ne.filter(e=>!e.bare).map(e=>(0,y.jsxs)(`option`,{value:e.path,disabled:e.prunable,children:[NE(e.path),` — `,e.branchShortName??(e.detached?`detached ${e.headSha?.slice(0,8)??``}`:`no branch`)]},e.path))})]}),(0,y.jsx)(`span`,{style:{color:`#45475a`,marginLeft:8},children:`repo`}),(0,y.jsx)(`form`,{onSubmit:ye,style:{display:`flex`,flex:1,minWidth:0},children:(0,y.jsx)(`input`,{ref:w,value:o,onChange:e=>{s(e.target.value),d(!0),be()},onFocus:e=>{l(!0),d(!1),be(),e.currentTarget.select()},onBlur:()=>{l(!1),d(!1),p(!1)},onKeyDown:e=>{if(f&&g.length>0){if(e.key===`ArrowDown`){e.preventDefault(),x(e=>(e+1)%g.length);return}if(e.key===`ArrowUp`){e.preventDefault(),x(e=>(e-1+g.length)%g.length);return}if(e.key===`Tab`||e.key===`Enter`){e.preventDefault(),xe(g[v]);return}if(e.key===`Escape`){e.preventDefault(),d(!1),p(!1);return}}e.key===`Escape`&&(s(D??``),e.currentTarget.blur())},"aria-label":`Repository path`,title:`Type a repository path and press Enter to open it`,spellCheck:!1,autoComplete:`off`,role:`combobox`,"aria-expanded":Se,"aria-controls":`header-repo-path-suggestions`,"aria-autocomplete":`list`,style:{width:`100%`,minWidth:0,padding:`3px 5px`,border:`1px solid ${c?`#89b4fa88`:`transparent`}`,borderRadius:3,outline:`none`,background:c?`#1e1e2e`:`transparent`,color:`#a6adc8`,fontFamily:`monospace`,fontSize:12}})}),Se&&(0,y.jsx)(`div`,{id:`header-repo-path-suggestions`,role:`listbox`,style:{position:`fixed`,zIndex:100,top:S.top,left:S.left,width:S.width,maxHeight:238,overflowY:`auto`,padding:4,border:`1px solid #3d4253`,borderRadius:5,background:`#181825`,boxShadow:`0 8px 24px #00000088`},children:m&&g.length===0?(0,y.jsx)(`div`,{style:{padding:`7px 8px`,color:`#7f849c`,fontSize:11},children:`Loading…`}):g.map((e,t)=>(0,y.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":t===v,onMouseEnter:()=>x(t),onMouseDown:t=>{t.preventDefault(),xe(e)},style:{display:`flex`,alignItems:`center`,gap:8,width:`100%`,minWidth:0,padding:`6px 8px`,border:`none`,borderRadius:4,background:t===v?`#313244`:`transparent`,color:`#cdd6f4`,fontSize:11,textAlign:`left`,cursor:`pointer`},children:[(0,y.jsx)(`span`,{style:{flex:1,minWidth:0,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,fontFamily:`monospace`},children:e.path}),e.isGitRepo&&(0,y.jsx)(`span`,{style:{flexShrink:0,color:`#a6e3a1`,fontSize:10},children:`repo`})]},e.path))}),(0,y.jsx)(wE,{}),(0,y.jsxs)(`button`,{onClick:ve,disabled:i,title:`Fetch all remotes`,"aria-label":`Fetch all remotes`,style:{flexShrink:0,display:`flex`,alignItems:`center`,gap:5,padding:`4px 10px`,borderRadius:4,border:`1px solid #313244`,background:`transparent`,color:i?`#45475a`:`#6c7086`,fontSize:11,cursor:i?`default`:`pointer`},children:[(0,y.jsx)(`span`,{style:{display:`inline-block`,animation:i?`spin 0.7s linear infinite`:`none`},children:`⟳`}),i?`Fetching…`:`Fetch`,(0,y.jsx)(`style`,{children:`@keyframes spin { to { transform: rotate(360deg); } }`})]}),(0,y.jsx)(`button`,{onClick:ue,title:`Close repository`,"aria-label":`Close repository`,style:{flexShrink:0,padding:`4px 10px`,borderRadius:4,border:`1px solid #313244`,background:`transparent`,color:`#6c7086`,fontSize:11,cursor:`pointer`},children:`Close`})]}),me===`reflog`?(0,y.jsx)(Eh,{}):(0,y.jsx)(oh,{})]}),(0,y.jsx)(LE,{}),(0,y.jsx)(xE,{error:se,onDismiss:O}),n&&(0,y.jsx)(b.Suspense,{fallback:null,children:(0,y.jsx)(kE,{open:!0,onClose:()=>r(!1)})})]})}function IE({onClose:e,onOpenSettings:t,settingsOpen:n}){let{refs:r,stashes:i,worktrees:a,selectRef:o,selectStash:s,navigateTo:c,openRepoByPath:l,removeWorktree:u,selectedStashSha:d,selectedSha:f}=I(E(e=>({refs:e.refs,stashes:e.stashes,worktrees:e.worktrees,selectRef:e.selectRef,selectStash:e.selectStash,navigateTo:e.navigateTo,openRepoByPath:e.openRepoByPath,removeWorktree:e.removeWorktree,selectedStashSha:e.selectedStashSha,selectedSha:e.selectedSha})));return(0,y.jsx)(ea,{refs:r,stashes:i,worktrees:a,onSelectRef:o,onSelectStash:s,onSelectStashParent:e=>{c(e)},onOpenWorktree:e=>{l(e)},onRemoveWorktree:u,selectedStashSha:d,selectedSha:f,onClose:e,onOpenSettings:t,settingsOpen:n})}function LE(){let{selectedStashSha:e,stashes:t,stashDiff:n,pendingMutation:r,applyStash:i,dropStash:a,navigateTo:o,worktreeSelected:s,selectedSha:c,historyWindow:l,commitDetail:u,commitDiff:d,commitPRs:f,commitAuthorAvatars:p,commitCIStatus:m,githubUrl:h,checkoutSha:g,showError:_}=I(E(e=>({selectedStashSha:e.selectedStashSha,stashes:e.stashes,stashDiff:e.stashDiff,pendingMutation:e.pendingMutation,applyStash:e.applyStash,dropStash:e.dropStash,navigateTo:e.navigateTo,worktreeSelected:e.worktreeSelected,selectedSha:e.selectedSha,historyWindow:e.historyWindow,commitDetail:e.commitDetail,commitDiff:e.commitDiff,commitPRs:e.commitPRs,commitAuthorAvatars:e.commitAuthorAvatars,commitCIStatus:e.commitCIStatus,githubUrl:e.githubUrl,checkoutSha:e.checkoutSha,showError:e.showError}))),v=e?t.find(t=>t.sha===e)??null:null,x=c?m[c]:void 0,S=x?.runs??[],C=(0,b.useMemo)(()=>{if(!c||!l)return null;let e=l.rows,t=new Map(e.map(e=>[e.sha,e]));for(let n of e){if(n.refNames.length===0)continue;let e=n.refNames.find(e=>!e.includes(`/`)),r=n.refNames.find(e=>e.includes(`/`)&&e!==`origin`&&e!==`HEAD`),i=e??r;if(!i)continue;let a=n.sha,o=new Set;for(;a&&!o.has(a);){if(a===c)return i;o.add(a);let e=t.get(a);if(!e||e.parentShas.length===0)break;a=e.parentShas[0]}}return null},[c,l]);return v?(0,y.jsx)(yE,{stash:v,diff:n,busy:r,onApply:i,onDrop:a,onNavigate:e=>{o(e)}}):s?(0,y.jsx)(gE,{}):(0,y.jsx)(uv,{commit:u,diff:d,branchName:C,prs:f,authorAvatarUrl:u?p[u.sha]:void 0,ciState:x?.state,ciRuns:S,githubUrl:h,onNavigate:o,onCheckout:async e=>{try{await g(e)}catch(e){_(`Checkout failed`,e)}}})}function RE(){return(0,y.jsx)(`div`,{style:{width:32,height:32,border:`3px solid #313244`,borderTopColor:`#89b4fa`,borderRadius:`50%`,animation:`spin 0.7s linear infinite`},children:(0,y.jsx)(`style`,{children:`@keyframes spin { to { transform: rotate(360deg); } }`})})}(0,x.createRoot)(document.getElementById(`root`)).render((0,y.jsx)(b.StrictMode,{children:(0,y.jsx)(FE,{})}));export{c as S,Nf as _,ZT as a,f as b,cf as c,xf as d,mf as f,Sf as g,Pf as h,cE as i,If as l,Ff as m,XT as n,sE as o,hf as p,lE as r,vv as s,HT as t,uf as u,af as v,u as x,I as y};
|